query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
2799c0c4635200fae9bab572eb52e425
This function is here to be API compatible with the loader.
[ { "docid": "ff250805f6a0c8322d35b5772f5cca32", "score": "0.5019068", "text": "function forceLoad() {\n // Noop\n}", "title": "" } ]
[ { "docid": "ccf95aa0871037f8ffea58049dc371cf", "score": "0.6491175", "text": "load() {\n\n\t\t}", "title": "" }, { "docid": "aa51eb17d16f50d1872cd039878cedc1", "score": "0.6385493", "text": "load() {}", "title": "" }, { "docid": "5a73c340dba3d4e5cf8eaa7b920a6177", "score": "0.63846576", "text": "load () {\n\n\t}", "title": "" }, { "docid": "c65a4048bd09a7a43d792ad6521feaf2", "score": "0.63409555", "text": "function ResourceLoader() {}", "title": "" }, { "docid": "cd332bf132ab68f0df87aeaa31c06acf", "score": "0.62394947", "text": "ensureLoaded() {}", "title": "" }, { "docid": "403c8560174f19351e6d065c357afb13", "score": "0.6226664", "text": "function LoaderProto() {}", "title": "" }, { "docid": "403c8560174f19351e6d065c357afb13", "score": "0.6226664", "text": "function LoaderProto() {}", "title": "" }, { "docid": "403c8560174f19351e6d065c357afb13", "score": "0.6226664", "text": "function LoaderProto() {}", "title": "" }, { "docid": "403c8560174f19351e6d065c357afb13", "score": "0.6226664", "text": "function LoaderProto() {}", "title": "" }, { "docid": "2924ebe3b390dd33b68847aa9237a7a3", "score": "0.60209185", "text": "load() {\n }", "title": "" }, { "docid": "55553145c701a2df471775e59f1f5655", "score": "0.5987402", "text": "function Load() {}", "title": "" }, { "docid": "4062c16b5bdf8449de300449be9323e4", "score": "0.5984931", "text": "_loading() {\n }", "title": "" }, { "docid": "15c44f580234abfbe46689f5099474ca", "score": "0.58854616", "text": "static get current() {\n return defaultLoader;\n }", "title": "" }, { "docid": "3f467d83696715fe9d191c330c76065a", "score": "0.5807603", "text": "function LoaderProxy() {\n return {\n draw: $.noop,\n fill: $.noop,\n frame: $.noop,\n update: $.noop,\n width: null,\n height: null\n };\n }", "title": "" }, { "docid": "cb40cc3c788943b94cabb299d5287b71", "score": "0.5675834", "text": "function CompressedTextureLoader() { }", "title": "" }, { "docid": "43433bac7effb6ac6518f7b11fdf88a7", "score": "0.5674066", "text": "function forceLoad() {}", "title": "" }, { "docid": "4fa1fbcd237079a5c2192f0b56740766", "score": "0.56702363", "text": "function ResourceUtils() {}", "title": "" }, { "docid": "9a8301fcd0e12dad8eb8a8e58fa6b65e", "score": "0.5634533", "text": "function TW21Loader() {\n}", "title": "" }, { "docid": "0f10ad33d531cde8e3d3f7bdfd4cc04c", "score": "0.5605335", "text": "function Loader () {\n this.registry = new Registry();\n}", "title": "" }, { "docid": "d73fc170fb4484256229db645330a880", "score": "0.5600304", "text": "async load () {}", "title": "" }, { "docid": "c0d1bf9b7cbe35a3ee0d9535b1779937", "score": "0.5579", "text": "constructor(loader, updater = defaultUpdater) {\r\n super(loader());\r\n this.previousLoaded = undefined;\r\n this.loader = loader;\r\n this.updater = updater;\r\n }", "title": "" }, { "docid": "cbac7199e5f25e17ef17904c9ea9f4c0", "score": "0.55350125", "text": "function load() {\r\n\r\n}", "title": "" }, { "docid": "67a3b3db659d94df00e9cfd07e84dc85", "score": "0.55122817", "text": "cacheLoader (mainNameSpace) {\n \n let NoEmptyNamespace = false \n if (typeof mainNameSpace == \"object\" ) {\n \n let keys_exists = Object.keys(mainNameSpace) ; \n\n (keys_exists || keys_exists.length > 0)?NoEmptyNamespace = true : NoEmptyNamespace \n \n if(NoEmptyNamespace){\n \n for(let method in mainNameSpace){\n \n (typeof mainNameSpace[method] == \"function\") ? mainNameSpace[method]() : console.warn(\"\")\n }\n }\n \n\n }\n \n }", "title": "" }, { "docid": "0b266fa6564513dbfdf1fc38b89c686d", "score": "0.5507918", "text": "LoadFromFile(fileName) {\t\t\r\n\t\t\treturn 1;\r\n\t\t}", "title": "" }, { "docid": "85dae1ed962565159a72f98b469e593c", "score": "0.5462459", "text": "function load() {\n\n}", "title": "" }, { "docid": "750bf3742d1726241234d56b7a723d4b", "score": "0.54618967", "text": "_setupSrc () {}", "title": "" }, { "docid": "4356a3c9f2d222bbdc1f55c35e68d4ba", "score": "0.54253554", "text": "function core(loader) {\n\n /*\n __useDefault\n \n When a module object looks like:\n newModule({\n __useDefault: true,\n default: 'some-module'\n })\n\n Then importing that module provides the 'some-module'\n result directly instead of the full module.\n\n Useful for eg module.exports = function() {}\n */\n var loaderImport = loader['import'];\n loader['import'] = function(name, options) {\n return loaderImport.call(this, name, options).then(function(module) {\n return module.__useDefault ? module['default'] : module;\n });\n }\n\n // support the empty module, as a concept\n loader.set('@empty', loader.newModule({}));\n\n /*\n Config\n Extends config merging one deep only\n\n loader.config({\n some: 'random',\n config: 'here',\n deep: {\n config: { too: 'too' }\n }\n });\n\n <=>\n\n loader.some = 'random';\n loader.config = 'here'\n loader.deep = loader.deep || {};\n loader.deep.config = { too: 'too' };\n */\n loader.config = function(cfg) {\n for (var c in cfg) {\n var v = cfg[c];\n if (typeof v == 'object' && !(v instanceof Array)) {\n this[c] = this[c] || {};\n for (var p in v)\n this[c][p] = v[p];\n }\n else\n this[c] = v;\n }\n }\n\n // override locate to allow baseURL to be document-relative\n var baseURI;\n if (typeof window == 'undefined' &&\n typeof WorkerGlobalScope == 'undefined') {\n baseURI = process.cwd() + '/';\n }\n // Inside of a Web Worker\n else if(typeof window == 'undefined') {\n baseURI = loader.global.location.href;\n }\n else {\n baseURI = document.baseURI;\n if (!baseURI) {\n var bases = document.getElementsByTagName('base');\n baseURI = bases[0] && bases[0].href || window.location.href;\n }\n }\n\n var loaderLocate = loader.locate;\n var normalizedBaseURL;\n loader.locate = function(load) {\n if (this.baseURL != normalizedBaseURL) {\n normalizedBaseURL = toAbsoluteURL(baseURI, this.baseURL);\n\n if (normalizedBaseURL.substr(normalizedBaseURL.length - 1, 1) != '/')\n normalizedBaseURL += '/';\n this.baseURL = normalizedBaseURL;\n }\n\n return Promise.resolve(loaderLocate.call(this, load));\n }\n\n\n // Traceur conveniences\n var aliasRegEx = /^\\s*export\\s*\\*\\s*from\\s*(?:'([^']+)'|\"([^\"]+)\")/;\n var es6RegEx = /(?:^\\s*|[}{\\(\\);,\\n]\\s*)(import\\s+['\"]|(import|module)\\s+[^\"'\\(\\)\\n;]+\\s+from\\s+['\"]|export\\s+(\\*|\\{|default|function|var|const|let|[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*))/;\n\n var loaderTranslate = loader.translate;\n loader.translate = function(load) {\n var loader = this;\n\n if (load.name == '@traceur')\n return loaderTranslate.call(loader, load);\n\n // support ES6 alias modules (\"export * from 'module';\") without needing Traceur\n var match;\n if ((load.metadata.format == 'es6' || !load.metadata.format) && (match = load.source.match(aliasRegEx))) {\n load.metadata.format = 'es6';\n load.metadata.alias = match[1] || match[2];\n }\n\n // detect ES6\n else if (load.metadata.format == 'es6' || !load.metadata.format && load.source.match(es6RegEx)) {\n load.metadata.format = 'es6';\n\n // dynamically load Traceur for ES6 if necessary\n if (!loader.global.traceur) {\n return loader['import']('@traceur').then(function() {\n return loaderTranslate.call(loader, load);\n });\n }\n }\n\n return loaderTranslate.call(loader, load);\n }\n\n // always load Traceur as a global\n var loaderInstantiate = loader.instantiate;\n loader.instantiate = function(load) {\n var loader = this;\n if (load.name == '@traceur') {\n loader.__exec(load);\n return {\n deps: [],\n execute: function() {\n return loader.newModule({});\n }\n };\n }\n if (load.metadata.format == 'alias') {\n return Promise.resolve(loader.normalize(load.metadata.alias, load.name, load.address))\n .then(function(alias) {\n return {\n deps: [alias],\n execute: function() {\n return System.get(alias);\n }\n };\n });\n }\n return loaderInstantiate.call(loader, load);\n }\n}", "title": "" }, { "docid": "25be1918396aa91479611b150aa9e508", "score": "0.542037", "text": "load(storagePath) {\n throw new Error('Unimplemented');\n }", "title": "" }, { "docid": "0c34649d336e6b096938d30321bcdac3", "score": "0.54134524", "text": "startLoading() {}", "title": "" }, { "docid": "d37f86cb9551f4c9f99226ff192bc0a1", "score": "0.54070044", "text": "function LoaderService() {\n var self = this,\n //The internal storage values\n internal = {\n order: 0, //The load order value\n adapter: null,\n adapterObject: null,\n filter: null,\n cache: new IndexedPageCache(),\n queue: new Queue(),\n loadCount: 0,\n loading: { }, //A reference to items actually being loaded\n waiting: { }, //A reference to items waiting in a retry delay\n existingMode: LoaderService.DEFAULT_EXISTING_MODE,\n executionMode: LoaderService.DEFAULT_EXECUTION_MODE,\n parallel: LoaderService.DEFAULT_PARALLEL,\n batching: LoaderService.DEFAULT_BATCHING,\n retryCount: LoaderService.DEFAULT_RETRY_COUNT,\n retryDelay: LoaderService.DEFAULT_RETRY_DELAY,\n batchCancelMode: LoaderService.DEFAULT_BATCH_CANCEL_MODE,\n batchMax: LoaderService.DEFAULT_BATCH_MAX,\n loadMax: LoaderService.DEFAULT_LOAD_MAX,\n loadOverflowMode: LoaderService.DEFAULT_LOAD_OVERFLOW_MODE\n };\n\n //Inherit from event emitter\n EventEmitter.call(this);\n\n //Assign the constants\n this.EXISTING_MODE = EXISTING_MODE;\n this.EXECUTION_MODE = EXECUTION_MODE;\n\n //Assign the public API\n //Accessors\n this.cache = getCache;\n this.adapter = getAdapter;\n this.adapterObject = getAdapterObject;\n this.setAdapter = setAdapter;\n this.filter = getFilter;\n this.setFilter = setFilter;\n this.parallel = getParallel;\n this.setParallel = setParallel;\n this.batching = getBatching;\n this.setBatching = setBatching;\n this.batchCancelMode = getBatchCancelMode;\n this.setBatchCancelMode = setBatchCancelMode;\n this.batchMax = getBatchMax;\n this.loadMax = getLoadMax;\n this.setLoadMax = setLoadMax;\n this.loadOverflowMode = getLoadOverflowMode;\n this.setLoadOverflowMode = setLoadOverflowMode;\n this.setBatchMax = setBatchMax;\n this.executionMode = getExecutionMode;\n this.setExecutionMode = setExecutionMode;\n this.existingMode = getExistingMode;\n this.setExistingMode = setExistingMode;\n this.retryDelay = getRetryDelay;\n this.setRetryDelay = setRetryDelay;\n this.retryCount = getRetryCount;\n this.setRetryCount = setRetryCount;\n this.state = getState;\n this.setState = setState;\n\n //Functions\n this.load = load;\n this.info = info;\n this.batchBreak = batchBreak;\n this.execute = executeCommands;\n this.clear = clear;\n\n /** Returns the internal cache */\n function getCache() {\n return internal.cache;\n }\n\n /** Gets the adapter name or object (as it was set) */\n function getAdapter() {\n return internal.adapter;\n }\n\n /** Gets the adapter object */\n function getAdapterObject() {\n return internal.adapterObject;\n }\n\n /**\n * Sets the adapter.\n * @param {string | object} value The global adapter name, or the adapter object to use.\n */\n function setAdapter(value) {\n var adapter, old;\n if (typeof value === 'string') {\n adapter = AdapterService.global.find(value);\n if (!adapter) {\n throw new Error('adapter named \"' + value + '\" not found!');\n }\n } else if (typeof value === 'object') {\n AdapterService.global.validate(value);\n adapter = value;\n } else {\n throw new Error('invalid adapter value. MUST be a string or an object. Got a \"' + typeof value + '\"');\n }\n old = internal.adapter;\n internal.adapter = value;\n if (value !== old) {\n self.emit('adapterChanged', value, old);\n }\n internal.adapterObject = adapter;\n }\n\n /** Returns the current filter */\n function getFilter() {\n return internal.filter;\n }\n\n /** Sets the filter to pass to the adapter on load */\n function setFilter(value) {\n var old;\n if (!sys.equals(internal.filter, value)) {\n old = internal.filter;\n internal.filter = value;\n clear();\n self.emit('filterChanged', value, old);\n }\n }\n\n /**\n * Returns the maximum number of parallel loads to perform at a given time.\n */\n function getParallel() {\n return internal.parallel;\n }\n\n /**\n * Sets the maximum number of parallel loads to perform at any given time.\n * @param {number} value A positive value indicating the maximum number of loads to perform.\n */\n function setParallel(value) {\n var old;\n if (value >= 1) {\n old = internal.parallel;\n if (old !== value) {\n internal.parallel = value;\n self.emit('parallelChanged', value, old);\n }\n } else {\n throw new Error('parallel MUST be a number greater than or equal to 1');\n }\n }\n\n /**\n * Returns whether request batching is enabled, and sequentuial requests should\n * be grouped together when possible.\n */\n function getBatching() {\n return internal.batching;\n }\n\n /**\n * Sets whether batching is enabled, and sequentuial requests should\n * be grouped together when possible.\n * @param value A truthy represenation of whether batching is enabled.\n */\n function setBatching(value) {\n var old = internal.batching;\n if (value !== old) {\n internal.batching = value;\n self.emit('batchingChanged', value, old);\n }\n }\n\n /** Returns the currently set maximum number of records to batch together. */\n function getBatchMax() {\n return internal.batchMax;\n }\n\n /** Updates the maximum number of records to batch together */\n function setBatchMax(value) {\n if (value > 0) {\n internal.batchMax = value;\n } else {\n throw new Error('batchMax MUST be a number greater than 0');\n }\n }\n\n /** Returns the maximum number of items to load */\n function getLoadMax() {\n return internal.loadMax;\n }\n\n /** Sets the maximum number of items to load */\n function setLoadMax(value) {\n var old;\n if (value > 0) {\n old = internal.loadMax;\n if (old !== value) {\n internal.loadMax = value;\n purge(value);\n self.emit('loadMaxChanged', value, old);\n }\n } else {\n throw new Error('loadMax MUST be a number greater than 0');\n }\n }\n\n /** Returns the current batch cancel mode */\n function getLoadOverflowMode() {\n return internal.loadOverflowMode;\n }\n\n /** Sets the batch cancel mode. */\n function setLoadOverflowMode(value) {\n var old;\n if (LOAD_OVERFLOW_MODE[value]) {\n old = internal.loadOverflowMode;\n if (value !== old) {\n internal.loadOverflowMode = value;\n self.emit('loadOverflowModeChanged', value, old);\n }\n } else {\n throw new Error('invalid loadOverflowMode value \"' + value + '\". Must be one of the following: ' + Object.keys(LOAD_OVERFLOW_MODE).join(', '));\n }\n }\n\n /** Returns the current batch cancel mode */\n function getBatchCancelMode() {\n return internal.batchCancelMode;\n }\n\n /** Sets the batch cancel mode. */\n function setBatchCancelMode(value) {\n var old;\n if (BATCH_CANCEL_MODE[value]) {\n old = internal.batchCancelMode;\n if (value !== old) {\n internal.batchCancelMode = value;\n self.emit('batchCancelModeChanged', value, old);\n }\n } else {\n throw new Error('invalid batchCancelMode value \"' + value + '\". Must be one of the following: ' + Object.keys(BATCH_CANCEL_MODE).join(', '));\n }\n }\n\n /**\n * Returns the current execution mode.\n */\n function getExecutionMode() {\n return internal.executionMode;\n }\n\n /**\n * Sets the execution mode.\n * @param {string} value The execution mode.\n */\n function setExecutionMode(value) {\n var old;\n if (EXECUTION_MODE[value]) {\n old = internal.executionMode;\n if (value !== old) {\n internal.executionMode = value;\n self.emit('executionModeChanged', value, old);\n }\n } else {\n throw new Error('invalid executionMode value \"' + value + '\". Must be one of the following: ' + Object.keys(EXECUTION_MODE).join(', '));\n }\n }\n\n /** How to deal with load requests of existing items */\n function getExistingMode() {\n return internal.existingMode;\n }\n\n /**\n * Sets what to do when an item already exists in the cache and a load is requested.\n */\n function setExistingMode(value) {\n var old;\n if (EXISTING_MODE[value]) {\n old = internal.existingMode;\n if (value !== old) {\n internal.existingMode = value;\n self.emit('existingModeChanged', value, old);\n }\n } else {\n throw new Error('invalid existing mode value \"' + value + '\". MUST be one of the following: ' + Object.keys(EXISTING_MODE).join(', '));\n }\n }\n\n /** Returns the number of milliseconds to wait between retries after request failure. */\n function getRetryDelay() {\n return internal.retryDelay;\n }\n\n /**\n * Sets the amount of time to wait between retries after request failure.\n * @param {number} value The time to wait between retries.\n */\n function setRetryDelay(value) {\n var old;\n if (value >= 0) {\n old = internal.retryDelay;\n if (value !== old) {\n internal.retryDelay = value;\n self.emit('retryDelayChanged', value, old);\n }\n } else {\n throw new Error('retryDelay MUST be number greater than or equal to 0');\n }\n }\n\n /** Returns the maximum number of times to retry before returning failure. */\n function getRetryCount() {\n return internal.retryCount;\n }\n\n /**\n * Sets the maximum number of times to retry before returning an error\n * @param {number} value\n */\n function setRetryCount(value) {\n var old;\n if (value >= 0) {\n old = internal.retryCount;\n if (value !== old) {\n internal.retryCount = value;\n self.emit('retryCountChanged', value, old);\n }\n } else {\n throw new Error('retryCount MUST be number greater than or equal to 0');\n }\n }\n\n /** Returns an object representing the configuration state of the loader */\n function getState() {\n return {\n adapter: self.adapter(),\n filter: self.filter(),\n existingMode: self.existingMode(),\n executionMode: self.executionMode(),\n parallel: self.parallel(),\n batching: self.batching(),\n retryCount: self.retryCount(),\n retryDelay: self.retryDelay(),\n batchCancelMode: self.batchCancelMode()\n };\n }\n\n /** Allows the configuration to be updated in bul */\n function setState(value) {\n if (!value || typeof value !== 'object') {\n throw new Error('supplied state MUST be an object');\n }\n if (value.hasOwnProperty('adapter')) {\n self.setAdapter(value.adapter);\n }\n if (value.hasOwnProperty('filter')) {\n self.setFilter(value.filter);\n }\n if (value.hasOwnProperty('existingMode')) {\n self.setExistingMode(value.existingMode);\n }\n if (value.hasOwnProperty('executionMode')) {\n self.setExecutionMode(value.executionMode);\n }\n if (value.hasOwnProperty('parallel')) {\n self.setParallel(value.parallel);\n }\n if (value.hasOwnProperty('batching')) {\n self.setBatching(value.batching);\n }\n if (value.hasOwnProperty('batchMax')) {\n self.setBatchMax(value.batchMax);\n }\n if (value.hasOwnProperty('loadMax')) {\n self.setLoadMax(value.loadMax);\n }\n if (value.hasOwnProperty('loadOverflowMode')) {\n self.setLoadOverflowMode(value.loadOverflowMode);\n }\n if (value.hasOwnProperty('retryCount')) {\n self.setRetryCount(value.retryCount);\n }\n if (value.hasOwnProperty('retryDelay')) {\n self.setRetryDelay(value.retryDelay);\n }\n if (value.hasOwnProperty('batchCancelMode')) {\n self.setBatchCancelMode(value.batchCancelMode);\n }\n }\n\n /**\n * Loads the page with the specified index from the adapter.\n * @param {number} index The page index to load\n * @returns A promise that will be resolved once the load has been completed.\n */\n function load(index, cancel) {\n var ldeferred, cdeferred, command, ps, info;\n index = parseInt(index, 10);\n if (isNaN(index)) {\n throw new Error('supplied index MUST be a number');\n }\n\n ldeferred = $q.defer();\n\n //If the record exists and the existing mode is set to drop, we drop the load request,\n // and immediately return the data.\n if (self.existingMode() === EXISTING_MODE.drop) {\n\n //Check if we have an existing entry which has not been cancelled.\n info = self.info(index);\n if (info.exists && !info.cancelled) {\n self.emit('dropped', index);\n if (info.cached) {\n ldeferred.resolve(info.cached);\n } else {\n info.loaded\n .then(ldeferred.resolve)\n .catch(ldeferred.reject);\n }\n return ldeferred.promise;\n }\n }\n\n internal.order = (internal.order + 1) % (Number.MAX_SAFE_INTEGER || Number.MAX_VALUE);\n ps = internal.cache.pageSize();\n\n cdeferred = $q.defer();\n command = {\n index: index * ps, //We want the item index, not the page index\n order: internal.order,\n loaded: ldeferred,\n cancel: docancel,\n userCancel: cdeferred.promise,\n cancelled: false,\n retry: self.retryCount(),\n loading: false,\n count: ps\n };\n if (cancel) {\n if (typeof cancel.then === 'function') {\n cancel.then(docancel);\n } else {\n throw new Error('when supplied, cancel MUST be a promise');\n }\n }\n\n //Enqueue the command\n internal.queue.enqueue(command);\n\n //Have we overflowed?\n if (queueLoadCount() > self.loadMax()) {\n if (self.loadOverflowMode() === LOAD_OVERFLOW_MODE.cancel) {\n purge(self.loadMax());\n } else {\n throw new Error('loadMax loads reached. Wait until some loads have completed before attempting to load new records.');\n }\n }\n\n if (internal.executionMode === EXECUTION_MODE.instant) {\n //Execute immediately\n self.execute();\n }\n\n //Return the load promise.\n return ldeferred.promise;\n\n /** Resolves the cancel promise, so that any cancel code that needs to run can be */\n function docancel() {\n cdeferred.resolve();\n if (!command.cancelled) {\n command.cancelled = true;\n //If we are loading the code inside execute will manage the cancel\n if (!command.loading) {\n internal.queue.remove(command);\n }\n }\n }\n\n function queueLoadCount() {\n return internal.queue.count() + Object.keys(internal.loading).length + Object.keys(internal.waiting).length;\n }\n }\n\n /** Removes all data from the cache, */\n function clear() {\n self.cache().clear();\n\n //Get loading, queued and waiting, and cancel them all\n var others = self.info();\n others.forEach(cancel);\n\n /** Calls the cancel function on the supplied item */\n function cancel(item) {\n item.cancel();\n }\n }\n\n /** Checks whether the given page index exists in the cache or is being loaded */\n function exists(index) {\n var data = self.info(index);\n return data.cached || data.loading || data.queued || data.waiting;\n }\n\n /**\n * Returns information regarding the specific index, or information on all elements\n * if no index is supplied.\n * @param {number} index The index to load the info for. If this is not supplied info for\n * all will be supplied in an array.\n */\n function info(index) {\n var queue = sparseIndex(internal.queue.all());\n if (arguments.length > 0) {\n return indexInfo(index, queue);\n } else {\n return allInfo(queue);\n }\n\n /**\n * Converts the given array into an object using the item index\n * properties as property names on the object\n */\n function sparseIndex(arr) {\n var i, res = { },\n pidx;\n for (i = 0; i < arr.length; i++) {\n pidx = Math.floor(arr[i].index / arr[i].count);\n res[pidx] = arr[i];\n }\n return res;\n }\n }\n\n /** Loads information for a single index */\n function indexInfo(index, queue) {\n var queued,\n loading,\n waiting,\n cache,\n info;\n\n //Get the data (if there is any)\n cache = self.cache().data(index);\n\n //Get the values\n queued = queue[index];\n loading = internal.loading[index];\n waiting = internal.waiting[index];\n\n //Create the info object\n info = itemInfo(index, cache, queued, loading, waiting);\n\n //Give the info back to the consumer\n return info;\n }\n\n /** Loads information for all the indexes (cached, loading, queued and waiting) */\n function allInfo(queue) {\n var i, res, cached, cache, indexes, qindexes, info;\n\n res = [];\n qindexes = Object.keys(queue)\n .map(asInt);\n\n //Get all stored data\n cached = internal.cache.cached();\n\n //Get a distinct list of all indexes (cached, queued and loading)\n indexes = cached.map(indexValue);\n indexes = indexes.concat(qindexes);\n indexes = indexes.concat(Object.keys(internal.loading).map(asInt));\n indexes = indexes.concat(Object.keys(internal.waiting).map(asInt));\n indexes = indexes.filter(unique);\n\n //Process all indexes.\n for (i = 0; i < indexes.length; i++) {\n\n //Since we have cached records first,\n // we can assume that if this is within\n // the cache count, this index is cached.\n cache = i < cached.length ? cached[i] : null;\n\n //Create the info entry\n info = itemInfo(indexes[i], cache, queue[indexes[i]], internal.loading[indexes[i]], internal.waiting[indexes[i]]);\n\n //Add the entry to the return data\n res.push(info);\n }\n\n //Finally sort by index.\n res.sort(byIndex);\n\n //Return the data to the consumer\n return res;\n\n /** Returns the supplied value as an integer. */\n function asInt(val) {\n return parseInt(val, 10);\n }\n\n /** Allows duplicates to be filtered */\n function unique(val, i, arr) {\n return arr.indexOf(val) === i;\n }\n\n /** Sorts by index */\n function byIndex(a, b) {\n return a.index - b.index;\n }\n }\n\n /** Builds up an item information object */\n function itemInfo(index, cache, queue, loading, waiting) {\n var command = null,\n loaded,\n cancel;\n\n //If the data is not cached, we should have a command.\n if (!cache) {\n command = queue || loading || waiting;\n }\n\n //If we have a command, copy the loaded promise and cancel function\n // from there.\n if (command) {\n loaded = command.loaded.promise;\n cancel = command.cancel;\n } else {\n //If the item does not exist, the promise will return null,\n // otherwise the existing cached data will be returned.\n loaded = $q.defer();\n loaded.resolve(cache || null);\n loaded = loaded.promise;\n cancel = noop;\n }\n\n return {\n index: index,\n exists: !!cache || !!loading || !!waiting || !!queue,\n cached: cache,\n cancelled: (command && command.cancelled) || false,\n //command: command,\n loading: !!loading,\n waiting: !!waiting,\n queued: !!queue,\n cancel: cancel,\n loaded: loaded\n };\n }\n\n /**\n * Inserts a noop action into the queue which can be used to prevent query batching.\n * This is only useful if batching is enabled.\n */\n function batchBreak() {\n //Just add a break onto the queue.\n internal.queue.enqueue(BATCH_BREAK);\n }\n\n /** Runs the execute function in parallel until there are not commands left. */\n function executeCommands(single) {\n var deferred,\n res = [],\n tmp = new Error();\n\n tmp = tmp.stack;\n\n deferred = $q.defer();\n if (internal.queue.count()) {\n if (single) {\n runner();\n } else {\n //Begin execution\n executeRunners();\n }\n } else {\n deferred.resolve(res);\n }\n\n //This will be resolved once all loads are done.\n return deferred.promise;\n\n /** Executes the maximum number of runners allowed */\n function executeRunners() {\n var prl = self.parallel();\n while (internal.loadCount < prl && internal.queue.count()) {\n runner();\n }\n }\n\n /**\n * Executes a runner. Note: Calling this with nothing on the queue\n * will cause unterminated execution.\n */\n function runner() {\n internal.loadCount++;\n execute()\n //Execute will never reject its promise, so we only use\n // success and finally (though we could use only 1).\n .then(success)\n .finally(done);\n }\n\n /** Called when data has been sucesfully received */\n function success(data) {\n res.push(data);\n }\n\n /** Called once the execution function returns. */\n function done() {\n internal.loadCount--;\n if (!single && internal.queue.count()) {\n executeRunners();\n } else {\n //Complete with all the pages loaded.\n deferred.resolve(res);\n }\n }\n }\n\n /** Executes the next set of commands and ties up to the completion event to run again */\n function execute() {\n\n //Get the next load command\n var i, idx, command, complete, deferred;\n\n //We cannot do anything without an adapter\n if (!internal.adapterObject) {\n throw new Error('adapter has not been set. You must set an adapter before calling execute.');\n }\n\n //Get the next command\n command = batch();\n\n //Keep reading until we have an actual load command.\n while (command === null && internal.queue.count()) {\n command = batch();\n }\n\n //Create an execution deferal\n deferred = $q.defer();\n\n if (command) {\n //Go through the queue commands and indicate\n // that we have started loading, and tie up\n // the cancel promise.\n for (i = 0; i < command.commands.length; i++) {\n idx = Math.floor(command.commands[i].index / command.commands[i].count);\n internal.loading[idx] = command.commands[i];\n command.commands[i].loading = true;\n if (command.commands[i].userCancel) {\n command.commands[i].userCancel\n .then(cancelled.bind(null, command.commands[i].index));\n }\n }\n\n //Create the http cancel token\n command.cancel = $q.defer();\n\n //Make the call\n complete = internal.adapterObject.find(internal.filter, {\n skip: command.index,\n limit: command.count,\n cancel: command.cancel.promise\n });\n\n complete\n .then(completed)\n .catch(error);\n } else {\n deferred.resolve([]);\n }\n\n //return the promise\n return deferred.promise;\n\n /** Called when the load has completed */\n function completed(data) {\n var i, base, start, end, cmd, idx, sliced,\n indexes = command.commands.map(indexValue);\n command.cancelled = true;\n base = Math.min.apply(Math, indexes);\n\n //Complete the loads\n for (i = 0; i < command.commands.length; i++) {\n cmd = command.commands[i];\n\n //We are no longer loading\n idx = Math.floor(cmd.index / cmd.count);\n delete internal.loading[idx];\n\n //Get the bounds in the data for the page\n start = cmd.index - base;\n end = start + cmd.count;\n\n //Perform the cache if necesary\n if (self.existingMode() !== EXISTING_MODE.ignore || self.cache().info(idx) === null) {\n //Cache the item only if the mode is not ignore or it does not exist\n self.cache().cache(idx, data.slice(start, end));\n }\n }\n\n for (i = 0; i < command.commands.length; i++) {\n cmd = command.commands[i];\n\n //Get the bounds in the data for the page\n start = cmd.index - base;\n end = start + cmd.count;\n\n //Get the data for this page\n sliced = data.slice(start, end);\n\n //Get the page index\n idx = Math.floor(cmd.index / cmd.count);\n\n //Emit the event\n self.emit('loaded', idx, sliced);\n\n //Pass the page off.\n cmd.loaded.resolve(data.slice(start, end));\n }\n\n //Format the return data\n data = {\n indexes: indexes,\n data: data\n };\n\n //Resolve the execute promise\n deferred.resolve(data);\n\n //Emit the executed event\n self.emit('executed', data);\n }\n\n /** Called when an error has occured during the load. */\n function error(err) {\n var i, delay, idx;\n command.cancelled = true;\n for (i = 0; i < command.commands.length; i++) {\n if (command.commands[i].retry) {\n //Decrement retry, wait the retry delay and then requeue the\n // command so it can be retried.\n command.commands[i].retry--;\n delay = self.retryDelay();\n requeue = cancelQueueCommand.bind(null, command.commands[i]);\n idx = Math.floor(command.commands[i].index / command.commands[i].count);\n if (!Array.isArray(internal.waiting[idx])) {\n internal.waiting[idx] = [];\n }\n internal.waiting[idx].push(command.commands[i]);\n if (delay) {\n $timeout(requeue.bind(null, i), delay);\n } else {\n requeue();\n }\n } else {\n //No more retries, remove from the queue and return the error.\n cancelQueueCommand(command.commands[i], err);\n }\n }\n deferred.reject(err);\n\n /** Requeues the queue command with the specified index */\n function requeue(i) {\n //No longer waiting\n var idx, pidx;\n pidx = command.commands[i].index / command.commands[i].count;\n idx = internal.waiting[pidx].indexOf(command.commands[i]);\n internal.waiting[pidx].splice(idx, 1);\n if (internal.waiting[pidx].length === 0) {\n delete internal.waiting[pidx];\n }\n //Requeue the command\n cancelQueueCommand(command.commands[i]);\n }\n }\n\n /** Called when any of the queue commands that are part of this are cancelled. */\n function cancelled(index) {\n var i, uc;\n if (!command.cancelled) {\n //If we do not ignore, we cancel the en\n if (self.batchCancelMode() === BATCH_CANCEL_MODE.all) {\n //Only allow this to be called once.\n command.cancelled = true;\n\n //Cancel the http load.\n command.cancel.resolve();\n\n //Requeue all others\n for (i = 0; i < command.commands.length; i++) {\n cancelQueueCommand(command.commands[i], command.commands[i].index === index ? 'cancelled' : false);\n }\n //Reject the promise returned by execute\n deferred.reject('cancelled');\n } else if (self.batchCancelMode() === BATCH_CANCEL_MODE.ignore) {\n uc = command.commands.filter(uncancelled);\n //Is this the last command left to cancel?\n if (uc.length === 1) {\n //Prevent any more cancel calls\n command.cancelled = true;\n //Cancel the http load only if there are not other commands being loaded.\n command.cancel.resolve();\n //Reject the promise returned by execute\n deferred.reject('cancelled');\n }\n\n for (i = 0; i < command.commands.length; i++) {\n if (command.commands[i].index === index) {\n cancelQueueCommand(command.commands[i], 'cancelled');\n }\n }\n } else {\n throw new Error('unrecognised batch cancel mode \"' + self.batchCancelMode() + '\"');\n }\n }\n\n /** Returns whether the command has not been cancelled */\n function uncancelled(item) {\n return !item.cancelled;\n }\n }\n\n /**\n * Cancels the queue command.\n * @param {object} command The queue command to cancel\n * @param {boolean} reason The reason the command is being rejected.\n * If this is not supplied, the command will be requeued.\n */\n function cancelQueueCommand(command, reason) {\n var idx;\n if (reason) {\n //Set to cancelled\n command.cancelled = true;\n //The load has failed.\n command.loaded.reject(reason);\n } else {\n //Set loading back to false\n command.loading = false;\n //Set cancelled back to false\n command.cancelled = false;\n //Requeue the command so it can be executed again.\n internal.queue.requeue(command);\n //Start the execution process\n if (self.executionMode() === EXECUTION_MODE.delayed) {\n //true executes only a single command (ie. The one we have just requeued)\n self.execute(true);\n } else {\n //Executes all commands currenty on the queue\n self.execute();\n }\n }\n idx = Math.floor(command.index / command.count);\n delete internal.loading[idx];\n }\n }\n\n /**\n * Attempts to create a batch from the next set of items in the queue.\n * If batching is enabled, only the first item will be returned.\n */\n function batch() {\n var current, data, pidx, command = null;\n\n //This will get the next command to perform off the queue.\n while (!command || canMerge(command, internal.queue.peek())) {\n\n //Get the next item off the queue\n current = internal.queue.dequeue();\n\n //This will only ever happen on the first iterarion as\n // canMerge will reject batch break as the next item\n if (!current || current === BATCH_BREAK) {\n break;\n }\n\n //On the first iteration we need to create the command.\n if (!command) {\n command = createCommand(current.index);\n }\n\n //Merge the queue command into the load command\n mergeCommand(command, current);\n }\n\n //If the command is a single item, and existing mode is ignore , we should check for the\n // index in the cache, and if it exists, return null so the command is ignored.\n if (command && command.commands.length === 1 && self.existingMode() === EXISTING_MODE.ignore) {\n pidx = Math.floor(command.index / command.count);\n data = exists(pidx);\n if (data) {\n self.emit('ignored', pidx);\n if (Array.isArray(data)) {\n //We have cached data\n command.commands[0].loaded.resolve(data);\n } else {\n //We have data being queried for\n data.loaded.promise\n .then(command.commands[0].loaded.resolve)\n .catch(command.commands[0].loaded.reject);\n }\n command = null;\n }\n }\n\n //Return the load command\n return command;\n\n /** Creates a load command base d at the specified index */\n function createCommand(index) {\n var command = {\n index: index,\n count: 0,\n commands: [],\n cancelled: false\n };\n return command;\n }\n\n /** Merges a queue command into a load command. This function assumes the 2 are mergable */\n function mergeCommand(cmd, qcmd) {\n //Note: Once here, we already know they can be merged\n if (cmd.index === qcmd.index) {\n cmd.count = Math.max(cmd.count, qcmd.count);\n } else {\n cmd.count += qcmd.count;\n if (qcmd.index < cmd.index) {\n cmd.index -= qcmd.count;\n }\n }\n\n //Add the command to the commands array\n cmd.commands.push(qcmd);\n }\n\n /** Checks that the queue command can be merged with the command */\n function canMerge(cmd, qcmd) {\n var res = false;\n if (self.batching() && qcmd && qcmd !== BATCH_BREAK) {\n if (cmd.count < self.batchMax()) {\n res = cmd.index === qcmd.index ||\n cmd.index + cmd.count === qcmd.index ||\n cmd.index - qcmd.count === qcmd.index;\n }\n }\n return res;\n }\n }\n\n /** Purges loading items until we are under loadMax */\n function purge(cnt) {\n var lcount = internal.queue.count() +\n Object.keys(internal.loading).length +\n Object.keys(internal.waiting).length,\n lm = self.loadMax(),\n commands;\n\n if (lcount > lm) {\n //Get all commands\n commands = internal.queue.all()\n .concat(Object.keys(internal.loading).map(item.bind(internal.loading)))\n .concat(Object.keys(internal.loading).map(item.bind(internal.waiting)));\n commands.sort(byOrder);\n\n while (commands.length > lm) {\n commands[0].cancel();\n commands.shift();\n }\n }\n\n /** Return the item */\n function item(val) {\n return this[val];\n }\n\n /** Sorts by the order property */\n function byOrder(a, b) {\n return a.order - b.order;\n }\n }\n\n /** Returns the index property on the given item */\n function indexValue(item) {\n return item.index;\n }\n\n /** Does nothing */\n function noop() { }\n\n }", "title": "" }, { "docid": "a1b835c384fd73026ea85e24b9aa951e", "score": "0.5401656", "text": "init() {\n Logger.error(\"Base init called in loader\");\n }", "title": "" }, { "docid": "a48594c4d6541551806b8c3783971d1e", "score": "0.5400192", "text": "static Super(obj, reader) {\r\n if (warninglvl > 0)\r\n console.warn(\"deprecated\");\r\n\r\n reader(obj);\r\n\r\n function reader2(obj) {\r\n }\r\n\r\n let cls = obj.constructor;\r\n let bad = cls === undefined || cls.prototype === undefined || cls.prototype.__proto__ === undefined;\r\n\r\n if (bad) {\r\n return;\r\n }\r\n\r\n let parent = cls.prototype.__proto__.constructor;\r\n bad = bad || parent === undefined;\r\n\r\n if (!bad && parent.prototype[keywords.load] && parent.prototype[keywords.load] !== obj[keywords.load]) { //parent.prototype.hasOwnProperty(\"loadSTRUCT\")) {\r\n parent.prototype[keywords.load].call(obj, reader2);\r\n }\r\n }", "title": "" }, { "docid": "bf957910ba30670e423bba73db3f3d51", "score": "0.5394346", "text": "loadData() {\r\n\r\n\t}", "title": "" }, { "docid": "ab2fac1171d8c1158074f185b532343a", "score": "0.53893566", "text": "constructor() {\n super({key: 'Loader'});\n }", "title": "" }, { "docid": "c2ab77f5ef828a7079c80a72326c9b96", "score": "0.5376482", "text": "_map_data() { }", "title": "" }, { "docid": "c3b0b88b413e73602faf4e6eae36e9df", "score": "0.53730047", "text": "function onLoad() {}", "title": "" }, { "docid": "7750cf4acd8fd3dfe5e6636ec6588e94", "score": "0.5365219", "text": "function getYepnope () {\n var y = yepnope;\n y['loader'] = {\n \"load\": load,\n \"i\" : 0\n };\n return y;\n }", "title": "" }, { "docid": "7750cf4acd8fd3dfe5e6636ec6588e94", "score": "0.5365219", "text": "function getYepnope () {\n var y = yepnope;\n y['loader'] = {\n \"load\": load,\n \"i\" : 0\n };\n return y;\n }", "title": "" }, { "docid": "062b0c611a865941c1cc32b75f751917", "score": "0.53573173", "text": "function makeLoader(theFile){// Making a p5.File object\nvar p5file=new p5.File(theFile);return function(e){p5file.data=e.target.result;callback(p5file);};}// Is the file stuff supported?", "title": "" }, { "docid": "6927536d1e5e6ea9e09687840fcf8cd8", "score": "0.53542626", "text": "init() {\n\t\t\n\t}", "title": "" }, { "docid": "798653defa3eccdcf21b1548b48015f8", "score": "0.53170764", "text": "function LoaderExtend () {\n \n if (!(this instanceof LoaderExtend)) {\n throw new TypeError(\"LoaderExtend constructor cannot be called as a function.\");\n }\n \n // INFO\n // appel du constructeur de la classe mère\n // avec passage de param.\n Loader.apply(this, arguments);\n \n // INFO\n // autre manière d'appeller le constructeur :\n // this.base = Loader;\n // this.base(arguments);\n \n // INFO\n // on surcharge la valeur\n this.options.insert = true;\n }", "title": "" }, { "docid": "086ad042dad70597b64d6da2ab5602f0", "score": "0.53120816", "text": "buildLoaders() {\n this.gltfLoader = new GLTFLoader(LoaderManager.loadingManager);\n this.fbxLoader = new FBXLoader(LoaderManager.loadingManager);\n }", "title": "" }, { "docid": "e21b83851666f62634b74ea0b89acba8", "score": "0.53096277", "text": "loadedHandler( e ) {}", "title": "" }, { "docid": "3c5b7f7ea4a355a3b318db8a030022d7", "score": "0.5308519", "text": "init() {\n\t\t// Could be implemented\n\t}", "title": "" }, { "docid": "5d0f0645c9871008c1897cc59801ebb0", "score": "0.527418", "text": "register( loader ) {\n this.loaders.set( loader.name, loader )\n }", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.52729255", "text": "loadingData() {}", "title": "" }, { "docid": "eb7037532f955366401630f136970ef7", "score": "0.52729255", "text": "loadingData() {}", "title": "" }, { "docid": "fe57b9de81d907e94207f7ec0a18a997", "score": "0.5262621", "text": "__init7() {this.oldPlugins = {}}", "title": "" }, { "docid": "595b0ec0e12e03e3803735abc4d9c721", "score": "0.525079", "text": "init()\n\t{\n\n\t}", "title": "" }, { "docid": "b1439db4a7ab212f44a8041b591a19a8", "score": "0.5250284", "text": "function forceLoad(){// Noop\n}", "title": "" }, { "docid": "78361957584abcb1808410cc56675414", "score": "0.52499557", "text": "ensureLoadingStarted() {\n switch (this.state) {\n case harp_mapview_1.TileLoaderState.Ready:\n case harp_mapview_1.TileLoaderState.Initialized:\n case harp_mapview_1.TileLoaderState.Canceled:\n this.doStartLoad();\n return;\n case harp_mapview_1.TileLoaderState.Loading:\n case harp_mapview_1.TileLoaderState.Loaded:\n // we may reuse already started loading promise\n logger.info(\"reusing already started load operation\");\n return;\n case harp_mapview_1.TileLoaderState.Decoding:\n this.cancelDecoding();\n this.doStartLoad();\n return;\n }\n }", "title": "" }, { "docid": "4f68531ba3f2217cc39419f913ab7729", "score": "0.5248059", "text": "function initLoader() {\r\n loadPopular = loadPopular();\r\n loadNew = loadNew();\r\n query = query();\r\n suggestion = suggestion();\r\n}", "title": "" }, { "docid": "1838c04c5970b7fae605780ca55e3490", "score": "0.5224572", "text": "loadingFinished() {\n // To be used in subclasses.\n }", "title": "" }, { "docid": "fe33a18f7097ce940b2f87ecec356401", "score": "0.52209586", "text": "function Loader(baseKey) {\n this.key = baseKey || baseURI;\n this.registry = new Registry();\n }", "title": "" }, { "docid": "f42cc7836dd49db498472fe17f1e0f70", "score": "0.52205247", "text": "load(component, metadata, callback) {\n return this.loader.load(component, callback, metadata);\n }", "title": "" }, { "docid": "d8499606bb541481c34f4a1380c77a3b", "score": "0.5217628", "text": "function LoadLock(){}", "title": "" }, { "docid": "dce67e98d3b2cc9d078a344c31bc6b45", "score": "0.52146226", "text": "get onLoad() { throw new Error(_errSavesOnLoadDeprecated); }", "title": "" }, { "docid": "2ee34297fa69b4ca4199de50c98f1498", "score": "0.5199353", "text": "function createLoad(name) {\n\t return {\n\t status: 'loading',\n\t name: name,\n\t linkSets: [],\n\t dependencies: [],\n\t metadata: {}\n\t };\n\t }", "title": "" }, { "docid": "2ee34297fa69b4ca4199de50c98f1498", "score": "0.5199353", "text": "function createLoad(name) {\n\t return {\n\t status: 'loading',\n\t name: name,\n\t linkSets: [],\n\t dependencies: [],\n\t metadata: {}\n\t };\n\t }", "title": "" }, { "docid": "2ee34297fa69b4ca4199de50c98f1498", "score": "0.5199353", "text": "function createLoad(name) {\n\t return {\n\t status: 'loading',\n\t name: name,\n\t linkSets: [],\n\t dependencies: [],\n\t metadata: {}\n\t };\n\t }", "title": "" }, { "docid": "234fa5a3eb36383dc13a8471d17418f4", "score": "0.5181358", "text": "function useLoaderData() {\n let state = useDataRouterState(DataRouterStateHook.UseLoaderData);\n let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);\n if (state.errors && state.errors[routeId] != null) {\n console.error(\n \"You cannot `useLoaderData` in an errorElement (routeId: \" +\n routeId +\n \")\"\n );\n return undefined;\n }\n return state.loaderData[routeId];\n }", "title": "" }, { "docid": "07d64908c628401bee1983eebb564601", "score": "0.5169682", "text": "preload() {}", "title": "" }, { "docid": "e9c7ae529367c6fd9cc8273a1cb7996f", "score": "0.5168099", "text": "function libraryLoaded(library){return{type:'LIBRARY_LOADED',library:library};}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5161597", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5161597", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5161597", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5161597", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5161597", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5161597", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5161597", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5161597", "text": "initialize() {}", "title": "" }, { "docid": "18ced69a5c2ba62ca14602cb2b5e112d", "score": "0.51599586", "text": "packument () {\n return FileFetcher.prototype.packument.apply(this)\n }", "title": "" }, { "docid": "91839079af17f561a959faed4dc3c2b2", "score": "0.5159448", "text": "_initTextures() {}", "title": "" }, { "docid": "68c7b053bfaa0b7ce98cbd0bfa870baa", "score": "0.5158952", "text": "function SuperLoader() {\n\t (0, _classCallCheck3.default)(this, SuperLoader);\n\t return (0, _possibleConstructorReturn3.default)(this, (SuperLoader.__proto__ || (0, _getPrototypeOf2.default)(SuperLoader)).call(this, null)); // bypass AudioBufferLoader constructor. This is bad but it works.\n\t }", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.5155961", "text": "init() {\n\t}", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.5155961", "text": "init() {\n\t}", "title": "" }, { "docid": "8eb3a859dd167d42a3a5537d1f32b502", "score": "0.514839", "text": "function ResourceLoader_ResourceLoader(customLoader) {\n this._pending = 0;\n this._loader = customLoader || index_browser_loader();\n}", "title": "" }, { "docid": "a43b396a2536fc85c4bc7728c2c44a61", "score": "0.51343215", "text": "function Loader ()\n{\n var _this = this;\n\n _this._count = 0;\n _this._max = 0;\n \n}", "title": "" }, { "docid": "317f04d12c2fa4a15cd750f5d2e326a8", "score": "0.5134003", "text": "_loadedHandler( e )\n\t{\n\t\tconsole.log( 'Loadable _loaded %o on %o by %o', e, e.target, this );\n\t\tthis.loadedHandler && this.loadedHandler.call( this, e );\n\t}", "title": "" }, { "docid": "c3bd122153b7d0e897c4cd6069d6454a", "score": "0.5127016", "text": "_initDefaultImageImporter() {\n this.eventManager.listen('addImageBlobHook', (blob, callback) => {\n const reader = new FileReader();\n\n reader.onload = event => {\n callback(event.target.result);\n };\n\n reader.readAsDataURL(blob);\n });\n }", "title": "" }, { "docid": "26b3f49783708b9cafad1573eaa86dcf", "score": "0.5118386", "text": "_init(){\n\t}", "title": "" }, { "docid": "5b0e1ffc66150f2c543674e03d1a8f5f", "score": "0.51114637", "text": "init() {\n this._parseNameCache = (0, _utils.dictionary)(null);\n }", "title": "" }, { "docid": "096ddf9009e83e4fb295096b161d2c4c", "score": "0.5095842", "text": "static assetsAsyncLoad(context){\n\t\treturn (new Vector()).push((new Vector()).push(\"@Runtime/rs.js\").push(\"@Runtime/re.js\").push(\"@Runtime/rtl.js\").push(\"@Runtime/Collection.js\").push(\"@Runtime/Container.js\").push(\"@Runtime/CoreObject.js\").push(\"@Runtime/Dict.js\").push(\"@Runtime/Emitter.js\").push(\"@Runtime/RuntimeConstant.js\").push(\"@Runtime/RuntimeUtils.js\").push(\"@Runtime/Exceptions/RuntimeException.js\").push(\"@Runtime/Interfaces/CloneableInterface.js\").push(\"@Runtime/Interfaces/ContextInterface.js\").push(\"@Runtime/Interfaces/FactoryInterface.js\").push(\"@Runtime/Interfaces/ModuleDescriptionInterface.js\").push(\"@Runtime/Interfaces/SerializeInterface.js\").push(\"@Runtime/Interfaces/StringInterface.js\").push(\"@Runtime/Interfaces/SubscribeInterface.js\")).push((new Vector()).push(\"@Runtime/AsyncTask.js\").push(\"@Runtime/AsyncThread.js\").push(\"@Runtime/Context.js\").push(\"@Runtime/ContextObject.js\").push(\"@Runtime/CoreStruct.js\").push(\"@Runtime/CoreEvent.js\").push(\"@Runtime/Map.js\").push(\"@Runtime/Maybe.js\").push(\"@Runtime/ModuleDescription.js\").push(\"@Runtime/Reference.js\").push(\"@Runtime/Vector.js\").push(\"@Runtime/Exceptions/IndexOutOfRange.js\").push(\"@Runtime/Exceptions/KeyNotFound.js\").push(\"@Runtime/Exceptions/UnknownError.js\")).push((new Vector()).push(\"@Runtime/DateTime.js\").push(\"@Runtime/IntrospectionInfo.js\").push(\"@Runtime/UIStruct.js\")).push((new Vector()).push(\"@Core/Http/ApiRequest.js\").push(\"@Core/Http/ApiResult.js\").push(\"@Core/Http/Cookie.js\").push(\"@Core/Http/Request.js\").push(\"@Core/Http/Response.js\").push(\"@Core/UI/UIController.js\").push(\"@Core/UI/Annotations/ControllerAnnotation.js\").push(\"@Core/UI/Annotations/RouteInfo.js\").push(\"@Core/UI/Events/CommandEvent.js\").push(\"@Core/UI/Events/ComponentEvent.js\").push(\"@Core/UI/Events/ModelChange.js\").push(\"@Core/UI/Events/MountEvent.js\").push(\"@Core/UI/Events/UpdateStateEvent.js\").push(\"@Core/UI/Events/UserEvent/UserEvent.js\").push(\"@Core/UI/Interfaces/ApiDeclaringInterface.js\").push(\"@Core/UI/Interfaces/AssetsInterface.js\").push(\"@Core/UI/Interfaces/FrontendInterface.js\").push(\"@Core/UI/Interfaces/RoutesDeclaringInterface.js\").push(\"@Core/UI/Interfaces/RoutesInterface.js\").push(\"@Core/UI/Render/CoreManager.js\").push(\"@Core/UI/Render/CoreRoute.js\").push(\"@Core/UI/Render/CoreView.js\").push(\"@Core/UI/Render/RenderContainer.js\").push(\"@Core/UI/Render/RenderHelper.js\").push(\"@Core/UI/Render/WebContainer.js\")).push((new Vector()).push(\"@Core/Http/JsonResponse.js\").push(\"@Core/UI/Assets.js\").push(\"@Core/UI/Animations/FadeIn.js\").push(\"@Core/UI/Animations/FadeOut.js\").push(\"@Core/UI/Annotations/BindModel.js\").push(\"@Core/UI/Annotations/BindValue.js\").push(\"@Core/UI/Annotations/Event.js\").push(\"@Core/UI/Annotations/EventAsync.js\").push(\"@Core/UI/Annotations/SignalOut.js\").push(\"@Core/UI/Events/KeyboardEvent/KeyboardEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseEvent.js\").push(\"@Core/UI/Events/UserEvent/BlurEvent.js\").push(\"@Core/UI/Events/UserEvent/ChangeEvent.js\").push(\"@Core/UI/Events/UserEvent/FocusEvent.js\").push(\"@Core/UI/Render/CoreLayout.js\")).push((new Vector()).push(\"@Core/UI/Events/KeyboardEvent/KeyDownEvent.js\").push(\"@Core/UI/Events/KeyboardEvent/KeyPressEvent.js\").push(\"@Core/UI/Events/KeyboardEvent/KeyUpEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseClickEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseContextMenuEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseDoubleClickEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseDownEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseEnterEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseLeaveEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseMoveEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseOutEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseOverEvent.js\").push(\"@Core/UI/Events/MouseEvent/MouseUpEvent.js\"));\n\t}", "title": "" }, { "docid": "b9cb8899f4ca483381b9fd597f99a633", "score": "0.50937325", "text": "[_loadDeps] () {}", "title": "" }, { "docid": "c3b70ba63c4d4e2aa590f61920fcfc12", "score": "0.5091866", "text": "function mkloader (branch, parser) {\n return function _loadParser (p1, p2, p3, p4) {\n var fn = _load(branch, parser)\n return fn(p1, p2, p3, p4)\n }\n }", "title": "" }, { "docid": "112749dc953eeb27186da0131b87ef54", "score": "0.50905913", "text": "function ContextualLoader (loader, key) {\n this.loader = loader;\n this.key = this.id = key;\n}", "title": "" }, { "docid": "d15a76c2a3630548d70c96379cfb8535", "score": "0.50876546", "text": "async load(cb) {\n if (this.out.load) return cb(null, this.out.load);\n\n const success = (obj) => {\n obj = utils.stringToJSON(obj);\n this.f_load = obj;\n cb(null, obj);\n };\n\n if (this.type === 'json' || this.type === 'string-json' || this.type === 'string-yaml') {\n return success(this.file);\n } else if(this.type === 'buffer') {\n return success(this.file.toString());\n } else if (this.type === 'url') {\n let resp = await r2.get(this.file).text;\n return success(resp);\n } else if (this.type === 'path') {\n // Load a local file\n if (!this.opts.enablePaths) {\n return cb(new Error(\"Use opts.enablePaths to enable accessing local files\"));\n }\n\n const contents = fs.readFileSync(this.file).toString();\n return success(contents);\n } else {\n cb(new Error(\"Could not load this file\"));\n }\n }", "title": "" }, { "docid": "b79629eada6ab7ca8087a0ecbefb4d70", "score": "0.50750685", "text": "_initTextures() {\n\n\t}", "title": "" }, { "docid": "d4416182392d257ac7baf105545156c9", "score": "0.5073851", "text": "function Loader(usageType){\n this.rootPath = null;\n if (sys.env[\"BOGART_ROOT\"])\n this.rootPath = sys.env[\"BOGART_ROOT\"];\n else\n this.rootPath = fs.path(require.main).dirname();\n\n this.rootPath = new fs.Path(fs.join(this.rootPath, \"app\", usageType));\n\n this.fileMatcher = new RegExp(\"_\" + usageType + \".js$\");\n}", "title": "" }, { "docid": "0cf21ad353f1ddb765f1d9ea697c1633", "score": "0.5073846", "text": "loadUpdate() {\n }", "title": "" }, { "docid": "f63c4ee644153647ac5abc7af1c66048", "score": "0.5069015", "text": "async loaded() {\r\n try {\r\n await this.loadingPromise;\r\n return;\r\n } catch (e) {\r\n throw e;\r\n }\r\n }", "title": "" }, { "docid": "38e53f280cbcdb98625fab9956f0ce2f", "score": "0.50594723", "text": "function initFn() {\n loadFactory.load();\n }", "title": "" }, { "docid": "0b1756bb5663207dc9ca0ec88421ca1f", "score": "0.5051268", "text": "function ContextualLoader(loader, key) {\n this.loader = loader;\n this.key = this.id = key;\n }", "title": "" }, { "docid": "60879c08cf45d49f87f19428a42668bf", "score": "0.5042587", "text": "function load() {\n //do some stuff\n}", "title": "" }, { "docid": "7afd73d0f2459d2a124e8dce1b33e819", "score": "0.504062", "text": "_setup(data) {}", "title": "" }, { "docid": "a54d8dc3f828c26e494ce7d2e3105bae", "score": "0.50354576", "text": "_loadUrl( category, url ){\n var that = this;\n\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, true);\n xhr.responseType = \"arraybuffer\";\n\n xhr.onload = function(event) {\n var arrayBuff = xhr.response;\n \n var basename = url.split(/[\\\\/]/).pop();\n var extension = basename.split('.').pop();\n var checksum = md5( arrayBuff );\n \n // few metadata for recognizing files (potentially)\n that._metadata.filenames[ category ] = basename;\n that._metadata.checksums[ category ] = checksum;\n\n // trying to un-gzip it with Pako for non pixp files\n if( extension.localeCompare(\"pixp\") ){\n try {\n arrayBuff = pako.inflate(arrayBuff).buffer;\n console.log(\"File was un-gziped successfully\");\n } catch (err) {\n console.log(\"Pako: \" + err + \" (this content is not gziped)\");\n }\n }\n \n that._output[ category ] = arrayBuff\n \n\n that._outputCounter ++;\n\n if( that._outputCounter == that.getNumberOfInputs()){\n that.triggerEvent(\"ready\");\n }\n };\n\n xhr.error = function(){\n console.log(\"here go the error\");\n }\n\n xhr.send();\n }", "title": "" }, { "docid": "4f1b399154edaf560218b25a2834fdc3", "score": "0.50318944", "text": "function __b_aPxD_aAgzT_aoP7hbI6qzoA(){}", "title": "" }, { "docid": "ffe8eba06275e937eae4a70c134a70f8", "score": "0.5017805", "text": "function loadGeneric() {\n // Load sprite sheets that are not in JSON files.\n // Textures are already loaded so it will not need to reload.\n instance.spritesheets.forEach(function(data) {\n var loader = new PIXI.ImageLoader(data.texture);\n loader.loadFramedSpriteSheet(data.width, data.height, data.name);\n });\n\n // Load the sounds.\n var key;\n for (key in instance.sounds) {\n if (instance.sounds.hasOwnProperty(key)) {\n // Load the sound and count as a load even if the sound has an error.\n instance.sounds[key] = new Howl({\n urls: [key],\n onload: loadSound,\n onloaderror: loadSoundError(key)\n });\n }\n }\n\n // Finish loading if no other data.\n if (size === 0) {\n if (onComplete) onComplete();\n return;\n }\n\n // Load data files.\n for (key in instance.data) {\n if (instance.data.hasOwnProperty(key)) {\n var request = new PIXI.AjaxRequest();\n request.onreadystatechange = loadData(request, key);\n request.open('GET', key, true);\n request.send();\n }\n }\n }", "title": "" } ]
ccf50388c590bf4ddf5150852345c091
this changes the internal seek modes of all the movers, but also tracks the universal move state for the whole scene, for resetting purposes
[ { "docid": "4f1a5a10a71a247dd86f729cc997057d", "score": "0.7136676", "text": "function ChangeSeekMode(){\n for(let i = 0; i < utils.paperList.length; i++){\n utils.paperList[i].UpdateMoveState();\n }\n\n for(let i = 0; i < utils.rockList.length; i++){\n utils.rockList[i].UpdateMoveState();\n }\n\n for(let i = 0; i < utils.scissorList.length; i++){\n utils.scissorList[i].UpdateMoveState();\n }\n\n if(currentMoveState == \"wander\")\n currentMoveState = \"seek\"\n else\n currentMoveState = \"wander\";\n}", "title": "" } ]
[ { "docid": "b5718abb78f2f397700620190c1e341b", "score": "0.5808563", "text": "onApplyMove(move) {}", "title": "" }, { "docid": "6b2c2fdc958cf2d5810d8e55fa47c2a2", "score": "0.5718031", "text": "_onMove(obj, p) {\r\n obj._setStates(false, true, false);\r\n obj._setSelect(p.x, p.y);\r\n obj._setTrigger();\r\n obj._setActive(true);\r\n }", "title": "" }, { "docid": "b4c88d706e59dc0d9fc9db1aa2ae2911", "score": "0.57149607", "text": "function resetMove() {\r\n selected = false;\r\n selectedID = \"\";\r\n lockout = false;\r\n endLoc = 0;\r\n unhighlightMoves();\r\n}", "title": "" }, { "docid": "e943e65bee9293847647d10a62e0aab1", "score": "0.5707404", "text": "setMovements(){\n super.setMovements();\n\n var scene = this.scene;\n\n //------------------------------------------------------------------------\n // KEEP\n this.movements.filter(mov => {return mov.direction === 'keep';})[0].trigger = ()=>{return true;};\n\n //------------------------------------------------------------------------\n // UP\n\n /* trigger */\n var movementUp = this.movements.filter(mov => {return mov.direction === 'up';})[0];\n movementUp.trigger = this.controls[\"up\"];\n movementUp.action = ()=>{\n movementUp.defaultAction();\n this.phaserCharacter.anims.play(this.name + '_move', true);\n this.setAngle(270);\n };\n\n //------------------------------------------------------------------------\n // DOWN\n\n /* trigger */\n var movementDown = this.movements.filter(mov => {return mov.direction === 'down';})[0];\n movementDown.trigger = this.controls[\"down\"];\n movementDown.action = ()=>{\n movementDown.defaultAction();\n this.phaserCharacter.anims.play(this.name + '_move', true);\n this.setAngle(90);\n };\n\n //------------------------------------------------------------------------\n // RIGHT\n\n /* trigger */\n var movementRight = this.movements.filter(mov => {return mov.direction === 'right';})[0];\n movementRight.trigger = this.controls[\"right\"];\n movementRight.action = ()=>{\n movementRight.defaultAction();\n this.phaserCharacter.anims.play(this.name + '_move', true);\n this.setAngle(0);\n };\n\n //------------------------------------------------------------------------\n // LEFT\n\n /* trigger */\n var movementLeft = this.movements.filter(mov => {return mov.direction === 'left';})[0];\n movementLeft.trigger = this.controls[\"left\"];\n movementLeft.action = ()=>{\n movementLeft.defaultAction();\n this.phaserCharacter.anims.play(this.name + '_move', true);\n this.setAngle(180);\n };\n }", "title": "" }, { "docid": "3014e95ee925b3ea3cd67986a273339f", "score": "0.5669948", "text": "onMoveModeChange() {\n if (this.movementInfo.currentModeMode == MoveMode.walking) {\n this.movementInfo.currentFloor = this.findFloor(this.capsule.center, null);\n this.adjustFloorHeight();\n }\n }", "title": "" }, { "docid": "afd1417694076d359a2f2b9cbf03337b", "score": "0.56633407", "text": "reset(){\n this.currOffset = this.startOffset;\n this.isPlaying = true;\n this.randomizeAcceptanceRegion();\n }", "title": "" }, { "docid": "602b18d688a47e45883a80cbb2e5efac", "score": "0.5619881", "text": "function initialMoveWave(){ \n resetBase();\n resetMoveTime();\n}", "title": "" }, { "docid": "083bfd3ff108abf1857380ee124b8bed", "score": "0.5605116", "text": "move() {\n this.available_moves = [];\n this.unselect();\n\n // TODO: do the rest\n }", "title": "" }, { "docid": "e44cdce94f6a1ece2700ab0f0bec77eb", "score": "0.55062973", "text": "reset() {\n movex = 202;\n movey = 350;\n }", "title": "" }, { "docid": "d8d2abff1db5e0e4b7e6e5529e5517f8", "score": "0.55026424", "text": "reset() {\n if (this.moving) {\n this.moving = false;\n this._queue = [];\n }\n this._moveClass = '';\n this._faces = ScaryCube.solvedCube;\n }", "title": "" }, { "docid": "7ea11bb36ff27cf08f882c9611d714b0", "score": "0.5477726", "text": "set setCurrentMove(move){\r\n this.imageIndex = 1;\r\n switch (move) {\r\n case 2:\r\n this.currentMove = this.move[1];\r\n break;\r\n case 3:\r\n this.currentMove = this.move[2];\r\n break;\r\n default:\r\n this.currentMove = this.move[0];\r\n }\r\n this.mainMove = false;\r\n }", "title": "" }, { "docid": "1278db4b813991541bd5abb9f720ad9e", "score": "0.5474569", "text": "move() {\n\t\tif(this._current_position === 'down' && this.is_full()) {\n\t\t\tthis._current_position = 'up';\n\t\t}\n\t\telse if(this._current_position === 'up' && this.is_full()) {\n\t\t\tthis._current_position = 'up1';\n\t\t}\n\t\telse if (this._current_position === 'up1' && !this.is_full()){\n\t\t\tthis._current_position = 'down';\n\t\t}\n\t}", "title": "" }, { "docid": "accb2540163a7586df918e5acee3535f", "score": "0.5437063", "text": "reset() {\n this.moves = {}\n this.vnodes = stream(m('div', '<no moves>'))\n this.half_move = -1\n this.current_move = stream()\n const initial_position = new Move({\n san: '',\n fen: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1'\n })\n this.add_move(initial_position)\n }", "title": "" }, { "docid": "43c059695b35006c593a7f7bd1ba9ddd", "score": "0.5428055", "text": "playMove() {\n\t\t\t\n\t\t}", "title": "" }, { "docid": "bc3f59c7ebc03b0be57a18b01d2332cc", "score": "0.54179287", "text": "function defaultMovements () {\n MOVING_UP = false\n MOVING_DOWN = false\n MOVING_LEFT = false\n MOVING_RIGHT = false\n}", "title": "" }, { "docid": "1870d44e6c2fa6ae76e5722328eb69cc", "score": "0.53843623", "text": "function moveForward(){\n console.log(\"*** Fordward\");\n\n switch(rover.direction){\n case 'N':\n rover.y = rover.y - 1;\n break;\n \n case 'E':\n rover.x = rover.x + 1;\n break;\n \n case 'S':\n rover.y = rover.y + 1;\n break;\n \n case 'W':\n rover.x = rover.x - 1;\n break;\n }\n tracksMovements();\n}", "title": "" }, { "docid": "c8afc691231943e794c5828148be570f", "score": "0.53750217", "text": "prepareMovieState() {\n this.gameOrchestrator.interface3D.setCurrentMenu(MENUS.InGameMenu);\n this.gameOrchestrator.changeState(new MovieState(this.gameOrchestrator));\n }", "title": "" }, { "docid": "a0fe0b3aa80faf7ad7788d8bebed7630", "score": "0.53672063", "text": "updateMove() { if (this._isMoving()) this._updateMoving(); }", "title": "" }, { "docid": "8364bda654b71c8e463356529ce7231c", "score": "0.5362222", "text": "resumeMovement() {\n if (this.modes.menu) {\n engine.titleMngr.resume();\n engine.gfxController.resumeLayerMovements();\n engine.gfxController.hideDeathLayer();\n engine.gfxController.clearTextLayer();\n this.musicSlider.hide();\n this.sfxSlider.hide();\n this.resetButton.hide();\n } else {\n engine.gfxController.resumeLayerMovements();\n engine.gfxController.hideDeathLayer();\n engine.gfxController.clearTextLayer();\n engine.playerMngr.resume();\n engine.enemyMngr.resumeEnemies();\n }\n }", "title": "" }, { "docid": "77cf9394dc1fc82ba38c9cfa447c2f08", "score": "0.5345353", "text": "function move_map() {\n\t\t\tif(params.mode2d) {\n\t\t\t\tview(monde);\n\t\t\t}\n\t\t\t\n\t\t\tif(nbrObjLoad == 0 && !params.mode2d) {\n\t\t\t\tif(move_map_waiting) obj_conteneur.css('display', 'none');\n\t\t\t\tmove_map_waiting = false;\n\t\t\t\tmove_map_actually = true;\n\t\t\t\tif(params.positionFixe == true) {\n\t\t\t\t\tobj_conteneur.animate({\n\t\t\t\t\t\tleft:(padxFixe|0),\n\t\t\t\t\t\ttop:(padyFixe|0)\n\t\t\t\t\t}, params.speed_map, function() {\n\t\t\t\t\t\tview(monde);\t\t\t\t\t\t\n\t\t\t\t\t\tmove_map_actually = false;\n\t\t\t\t\t\tobj_conteneur.fadeIn('100');\n\t\t\t\t\t\tobj_wait.css('display', 'none');\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tif(params.fluide) {\n\t\t\t\t\t\tobj_conteneur.animate({\n\t\t\t\t\t\t\tleft:(padx|0),\n\t\t\t\t\t\t\ttop:(pady|0)\n\t\t\t\t\t\t}, params.speed_map, function() {\n\t\t\t\t\t\t\tview(monde);\t\t\t\t\t\t\n\t\t\t\t\t\t\tmove_map_actually = false;\n\t\t\t\t\t\t\tobj_conteneur.fadeIn('100');\n\t\t\t\t\t\t\tobj_wait.css('display', 'none');\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tobj_conteneur.css({\n\t\t\t\t\t\t\t'left':(padx|0),\n\t\t\t\t\t\t\t'top':(pady|0)\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tview(monde);\n\t\t\t\t\t\tmove_map_actually = false;\n\t\t\t\t\t\tobj_wait.css('display', 'none');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\tmove_map_waiting = true;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2c61c43cd89e6cb97d8ecb6253e94610", "score": "0.5338285", "text": "_moveVideoForward(time = 10) {\n let seekTime;\n if (\n this.state.selectedLearningObjective !== 'none' &&\n this.state.selectedLearningObjective !== 'revisit'\n ) {\n seekTime = this.state.selectedLOEndTime / 1000;\n if (this.state.selectedLOEndTime / 1000 - this.state.currentTime > time) {\n seekTime = this.state.currentTime + time;\n }\n } else {\n seekTime = this.state.duration;\n if (this.state.duration - this.state.currentTime > time) {\n seekTime = this.state.currentTime + time;\n }\n }\n this.seekTo(seekTime);\n const percent = seekTime / this.state.duration;\n this.setSeekerPosition(\n (this.player.seekerWidth - this.props.seekerWidth) * percent,\n );\n }", "title": "" }, { "docid": "5fd35e4f12e8b8d73d6efcd2d59afd2c", "score": "0.53366846", "text": "function myMove(e) {\n\tswitch (mode) {\n\t\tcase TYPE.PIECHART:\n\t\t\tif (!isSet) {\n\t\t\t\tgetMouse(e);\n\t\t\t\tinvalidate();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase TYPE.TWOAXIS:\n\t\t\t\tgetMouse(e);\n\t\t\t\t// invalidate();\n\t\t\tbreak;\n\t\tcase TYPE.SLIDER:\n\t\t\t\tgetMouse(e);\n\t\t\tbreak\n\t}\n\n\n}", "title": "" }, { "docid": "d1182fb722b0a8954e036f0fbe3405d7", "score": "0.5334424", "text": "forceMoved() {\n this.m_lastCameraPos.set(Number.NaN, Number.NaN, Number.NaN);\n }", "title": "" }, { "docid": "6a1d8d496b523d55205f309a7607dde6", "score": "0.5326472", "text": "function setMove(which){\t\t\n\tmover = which;\n\t//get the last position of the thing... (NOW through the transform=translate(x,y))\n\txy=getTransform(which);\n\n\tmyX=xy[0];\n\tmyY=xy[1];\n\t//get the object then re-append it to the document so it is on top!\n\tgetPiece(which).putOnTop(which);\n}", "title": "" }, { "docid": "fd0c8007c61d036d63f3a87581c13232", "score": "0.5310931", "text": "function onPlaybackSeeking() {\n if (isBufferingCompleted) {\n seekClearedBufferingCompleted = true;isBufferingCompleted = false;maxAppendedIndex = 0;\n }seekStartTime = undefined;onPlaybackProgression();\n }", "title": "" }, { "docid": "a0134b072b636c7ce22919fa62cdd2e1", "score": "0.5272801", "text": "updateAnimationMode() {\n const speed = Math.abs(this.movement.velX);\n if (speed > 1 && this.mode === \"idle\") this.changeMode(\"run\", true);\n else if (speed < 1 && this.mode === \"run\") this.changeMode(\"idle\", true);\n }", "title": "" }, { "docid": "e51581f12fc36586ea44b591e6d2e5f3", "score": "0.526381", "text": "onSeeking_() {\n this.gapController_.onSeeking()\n const currentTime = this.videoWrapper_.getTime()\n const targetTime = this.reposition_(currentTime)\n\n const gapLimit = GapJumpingController.BROWSER_GAP_TOLERANCE\n if (Math.abs(targetTime - currentTime) > gapLimit) {\n // You can only seek like this every so often. This is to prevent an\n // infinite loop on systems where changing currentTime takes a significant\n // amount of time (e.g. Chromecast).\n const time = new Date().getTime() / 1000\n if (!this.lastCorrectiveSeek_ || this.lastCorrectiveSeek_ < time - 1) {\n this.lastCorrectiveSeek_ = time\n this.videoWrapper_.setTime(targetTime)\n return\n }\n }\n\n console.info('Seek to ' + currentTime)\n this.onSeek_()\n }", "title": "" }, { "docid": "4ff357205a89543610df4f10a68a1991", "score": "0.5250341", "text": "runExactMove()\n {\n const targetPos = new RoomPosition(this.memory.targetPos.x,\n this.memory.targetPos.y,\n this.memory.targetPos.roomName);\n\n if (this.instance.pos === targetPos)\n {\n this.calcNextState();\n this.run();\n return;\n }\n\n // Not there yet? Move.\n if (!this.instance.fatigue)\n this.instance.moveTo(targetPos, {visualizePathStyle: {stroke: '#ffffff'}});\n }", "title": "" }, { "docid": "d2a3278a12e89f04dfab0c9c9e74105b", "score": "0.5239725", "text": "function resetPos(){\n var molecule = Mol();\n var cys = OriCrystal();\n centerMolecule();\n drawMolecule();\n if(molecule[0].type == \"crystal\" && cys[0].cleave == 0){\n drawCube();\n }\n if(cys[0].preview == 1){\n drawCube();\n }\n drawAxis();\n if(cys[0].cleave == 1){\n drawsurface();\n }\n}", "title": "" }, { "docid": "461f080dcb4608c389ec527e454d9595", "score": "0.52395505", "text": "updateMovement() {\n\n this.video.style.transform = 'rotateX(' + this.mousePos.x + 'deg) rotateY(' + this.mousePos.y + 'deg)';\n this.itemsMap[this.currentItem].el.style.transform = 'translateX(' + Math.round(this.mousePos.y * 100) / 100 + '%) translateY(-50%)';\n this.pagination.style.transform = 'translateX(' + this.mousePos.y + '%)';\n this.pagination.style.marginBottom = this.mousePos.x + 'px';\n\n }", "title": "" }, { "docid": "36bf74c417c18e4ec9e0d1c0653c3f12", "score": "0.5226288", "text": "move(){\n\t\t// get time since last update\n\t\tvar delta_t = this.updateTimer.getElapsedTime();\n\t\tthis.updateTimer.resetGameClock();\n\t\tthis.vx = (Math.cos(this.direction))*this.movePower;\n\t\tthis.vy = (Math.sin(this.direction))*this.movePower;\n\t\tthis.setRotation(this.direction / Math.PI * 180);\t\n\t\t\n\t\t// Update Squid rotation\n\t\tif (this.moveStatus == 'wandering'){\n\t\t\tif (Math.random() < .1){ this.direction += this.rotationDampener*(Math.random() - .5) * (Math.PI); }\n\t\t} else if (this.moveStatus == 'attacking') {\n\t\t\tthis.direction = this.calculatePlayerRotation(); // Face towards player\n\t\t} else if (this.moveStatus == 'fleeing'){\n\t\t\tthis.direction = this.calculatePlayerRotation() - Math.PI; // Face away from player\n\t\t}\n\t\t// update position\n\t\tvar newX = (this.getX()) + (this.vx * delta_t);\n\t\tvar newY = (this.getY()) + (this.vy * delta_t);\n\t\tthis.setX(newX);\n\t\tthis.setY(newY);\n }", "title": "" }, { "docid": "407b114c6ae493d17c5c9ab98cc62038", "score": "0.5222077", "text": "move() {\n this.checkMoveSides();\n this.checkForPortal();\n this.checkForCoin();\n let newPos;\n\n let speed = this.speed;\n\n if (this.isEating) {\n speed = this.eatSpeed;\n }\n switch (this.moveDirection) {\n case moveDirections.RIGHT:\n newPos = this.xPos + speed;\n if (!this.moveSides.RIGHT) {\n this.xPos = Math.round(this.xPos);\n return;\n }\n this.yPos = Math.round(this.yPos);\n this.xPos = newPos;\n break;\n case moveDirections.DOWN:\n newPos = this.yPos + speed;\n if (!this.moveSides.DOWN) {\n this.yPos = Math.round(this.yPos);\n return;\n }\n this.xPos = Math.round(this.xPos);\n this.yPos = newPos;\n break;\n case moveDirections.LEFT:\n newPos = this.xPos - speed;\n if (!this.moveSides.LEFT) {\n this.xPos = Math.round(this.xPos);\n return;\n }\n this.yPos = Math.round(this.yPos);\n this.xPos = newPos;\n break;\n case moveDirections.UP:\n newPos = this.yPos - speed;\n if (!this.moveSides.UP) {\n this.yPos = Math.round(this.yPos);\n return;\n }\n this.xPos = Math.round(this.xPos);\n this.yPos = newPos;\n break;\n }\n }", "title": "" }, { "docid": "29dbb206113ccbf7afe3f413a4a26524", "score": "0.5201754", "text": "updateBehavior() {\n this.seekClosestPlayer();\n }", "title": "" }, { "docid": "e7a09484a74607c86f292829602a9e71", "score": "0.5195607", "text": "updateMovingTiles(){\r\n\t\tif(!this.paused){\r\n\t\t\tthis.movingTiles.forEach(tile => {tile.updatePosition();});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7fae5c51e71329ad9671385e9cfdedfc", "score": "0.5190391", "text": "function updatePosition () {\n media1.getCurrentPosition(\n function (position) {\n if (position >= 0.0) {\n setAudioPosition(position + ' sec');\n }\n },\n function (e) {\n console.log('Error getting pos=' + e);\n setAudioPosition('Error: ' + e);\n }\n );\n }", "title": "" }, { "docid": "481e6dbfb71e7d7a22457eec15c19c5d", "score": "0.5182869", "text": "function clearMove() {\n isInTransit = true;\n //Switch on transition property\n screen.style.transition = '';\n\n let x = -((currentIndex + offset) * 100) + '%';\n\n screen.style.transform = `translateX(${x})`;\n\n start = 0;\n diff = 0;\n }", "title": "" }, { "docid": "df760b43447129106d7302a499206cc7", "score": "0.51810247", "text": "trackMoved(moveCount) {\n // We don't currently pay attention to the track move count. We tried spacing them out by 5ms or 10ms\n // and it didn't sound good. So just play one track move sound.\n this.playTrackSound();\n }", "title": "" }, { "docid": "748bdebbe24f4d5fec83d06bb619d07d", "score": "0.51762617", "text": "function restoreState(moves){\n if(moves > allOpen[0]){\n resetTimer(timer)=false;\n }\n else{\n resetTimer(timer)=true;\n }\n}", "title": "" }, { "docid": "53eff526dcc37853f2d0e4cfef101191", "score": "0.5171514", "text": "update(time, delta)\n{\n/**\n * A movement intention is set here if a cursor is held down. This will be\n * passed into the move function to determine which direction the player will\n * move. If no key is held down then moveIntention is false\n * Note: this movement system is only active when the player is not in combat.\n */\n if(this.attemptMove === false)\n {\n if(this.state == false && !Number.isInteger(this.state))\n {\n if(this.cursors.left.isDown)\n {\n this.attemptMove = true;\n this.scene.socket.emit('moveAttempt', 'left');\n }\n else if(this.cursors.right.isDown)\n {\n this.scene.socket.emit('moveAttempt', 'right');\n this.attemptMove = true;\n }\n else if(this.cursors.up.isDown)\n {\n this.scene.socket.emit('moveAttempt', 'up');\n this.attemptMove = true;\n }\n else if(this.cursors.down.isDown)\n {\n this.scene.socket.emit('moveAttempt', 'down');\n this.attemptMove = true;\n }\n }\n else if(Number.isInteger(this.state))\n {\n if(this.cursors.left.isDown)\n {\n this.scene.socket.emit('combatMove', 'left');\n this.attemptMove = true;\n }\n else if(this.cursors.right.isDown)\n {\n this.scene.socket.emit('combatMove', 'right');\n this.attemptMove = true;\n }\n else if(this.cursors.up.isDown)\n {\n this.scene.socket.emit('combatMove', 'up');\n this.attemptMove = true;\n }\n else if(this.cursors.down.isDown)\n {\n this.scene.socket.emit('combatMove', 'down');\n this.attemptMove = true;\n }\n }\n }\n else if(!this.cursors.isDown && this.isMoving()) this.moveIntention = false;\n super.update(time, delta);\n }", "title": "" }, { "docid": "29e5ddae6c4b38fbfb0e48405877c479", "score": "0.51656973", "text": "moveModelAnimation(){\r\n\t\tif (moveModel == false){\r\n\t\tmoveModel = true}\r\n\t\telse {moveModel = false}\r\n\t}", "title": "" }, { "docid": "653eb96a7f39b2212d97edc677c04f2e", "score": "0.51608527", "text": "processCursorMove() {\n if (!this.isCursorMovable()) {\n return;\n }\n\n const lastIndex = this._index;\n\n if (Input.isRepeated('down')) {\n this.cursorDown(Input.isTriggered('down'));\n }\n\n if (Input.isRepeated('up')) {\n this.cursorUp(Input.isTriggered('up'));\n }\n\n if (Input.isRepeated('right')) {\n this.cursorRight(Input.isTriggered('right'));\n }\n\n if (Input.isRepeated('left')) {\n this.cursorLeft(Input.isTriggered('left'));\n }\n\n if (Input.isTriggered('pagedown')) {\n this.cursorPageDown();\n }\n\n if (Input.isTriggered('pageup')) {\n this.cursorPageUp();\n }\n\n if (this._index !== lastIndex) {\n this.playCursorSound();\n }\n }", "title": "" }, { "docid": "419f50fb37ae079fc06a542b1490ad52", "score": "0.5149884", "text": "function setPos(params) {\n\tvar params = params || {};\n\tCamera.duration = 0;\n\tCamera.easing = platino.ANIMATION_CURVE_LINEAR;\n\tCamera.lookAt_eyeX = params.eyeX || params.centerX;\n\tCamera.lookAt_centerX = params.centerX;\n\tCamera.lookAt_eyeY = params.eyeY || params.centerY;\n\tCamera.lookAt_centerY = params.centerY;\n\tCamera.lookAt_eyeZ = params.eyeZ;\n\tCamera.skipOnComplete = params.skipOnCompleteListener || false;\n\tgame.moveCamera(Camera);\n}", "title": "" }, { "docid": "d63c0c65ccf0ec12d7fc1e185503f23b", "score": "0.514888", "text": "move() {\n if (this.x > canvasWidth || this.x < 0) {\n // do nothing\n return;\n }\n if (this.y > canvasHeight || this.y < 0) {\n // do nothing\n return;\n }\n \n if (this.trackNum == 0) {\n this.y -= 10;\n } else if (this.trackNum == 1) {\n this.x -= 10;\n } else if (this.trackNum == 2) {\n this.y += 10;\n } else if (this.trackNum == 3){\n this.x += 10;\n }\n\n // if ()\n\n\n // making cars stop at traffic lights\n }", "title": "" }, { "docid": "7cffdc43f18d583fa5fe7bf8f89ccac6", "score": "0.5125449", "text": "reset() {\n this.x = 2;\n this.y = 5;\n this.win = false;\n this.moving = false;\n }", "title": "" }, { "docid": "077aa7f8886521ac47d207e54f356895", "score": "0.51243025", "text": "move() {\n this.consume();\n if (this._alive && !this._stopped) {\n if (this.canTurn()) {\n this._direction = this._moves.direction;\n this._moving = true;\n }\n if (this._moving) {\n var newLoc = Vector.add(this._gridLoc, this.unit_step);\n if (this._grid.getTile(newLoc.x, newLoc.y).isTraversible()) {\n this._loc = Vector.add(this._loc, this.step);\n if (Vector.compare(this._loc, Vector.round(this._loc)), this.speed/2) {\n this._loc = Vector.round(this._loc);\n }\n if (!this.isBetween()) {\n this._gridLoc = this._loc;\n if (this._grid.getTile(this._gridLoc.x, this._gridLoc.y).isDeadly()) {\n this._moving = false;\n this.die();\n } else if (this._grid.getTile(this._gridLoc.x, this._gridLoc.y).isInterrupting()) {\n this._moving = false;\n } else if (!this._grid.getTile(this._gridLoc.x, this._gridLoc.y).isSlippery()) {\n if (Direction.compare(this._moves.direction, Direction.NONE()) || this._hiding) {\n this._moving = false;\n } else {\n this._direction = this._moves.direction;\n }\n }\n }\n } else {\n this._moving = false;\n }\n }\n }\n }", "title": "" }, { "docid": "61a398ee221e78a33252f5a64db8267a", "score": "0.511922", "text": "function changeopmode(mode){\n var molecule = Mol();\n if( molecule[0].mousemove == \"rotate\"&&mode==\"translate\"){\n molecule[0].mousemove = \"translate\";\n buttonColor('translatemode',1);\n buttonColor('rotatemode',0);\n }else if(molecule[0].mousemove == \"translate\"&&mode==\"rotate\"){\n molecule[0].mousemove = \"rotate\";\n buttonColor('translatemode',0);\n buttonColor('rotatemode',1);\n } \n // InfoWin(molecule[0].mousemove);\n}", "title": "" }, { "docid": "e8fb396ab6b84385e9529b626228b393", "score": "0.51187474", "text": "onScrollChangeDirection(){\n\t\tif ( this.props.syncTracks ) return;\n\t\tthis.showTracks();\n\t\tthis.hideTracks();\n\t}", "title": "" }, { "docid": "17f21a9af36294eca476fc568fa97532", "score": "0.5105099", "text": "function initMoveBehavior() {\n mviewer.getMap().on('moveend', function() {\n setInfosPanel(true);\n });\n\n // select interaction working on \"singleclick\"\n selectSingleClick = new ol.interaction.Select({\n condition: ol.events.condition.singleClick,\n style: function(feature) {\n return zacBaseStyle;\n },\n layers: function (layer) { // to apply select only onto zac layer\n return layer.get('id') === 'zac';\n }\n });\n mviewer.getMap().addInteraction(selectSingleClick);\n mviewer.select = selectSingleClick;\n selectSingleClick.on('select', function(e) {\n if (selectSingleClick && selectSingleClick.getFeatures().getArray().length>0){\n var mview = mviewer.getMap().getView();\n var zac_geom = selectSingleClick.getFeatures().getArray()[0].getGeometry();\n mview.fit(zac_geom.getExtent(), {size: mviewer.getMap().getSize()});\n mview.setResolution(mviewer.getMap().getView().getResolution()+2);\n if (!zac_geom.intersectsCoordinate(mview.getCenter())){\n var centerPoint = zac_geom.getClosestPoint(mview.getCenter());\n mview.centerOn(centerPoint, mviewer.getMap().getSize());\n }\n }\n })\n }", "title": "" }, { "docid": "c47c90ef20c7d86a0ab84f360dd188bd", "score": "0.5090561", "text": "function aiMove() {\n if(moves.length === 1) {\n //If user moves to the middle on first move, move to bottom left\n if($scope.squares.data[4].val) {\n aiMoveSet(6);\n }\n //If user moves to a corner on first move, move to the middle\n else {\n aiMoveSet(4);\n }\n }\n else {\n ifAICanWin();\n if(!$scope.gameEnded.gameover) {\n //If AI's first move was the middle, now move to edges and block human player\n if($scope.squares.data[4].val === 'O') {\n if($scope.squares.data[0].val === 'X' && $scope.squares.data[1].val === 'X' && !$scope.squares.data[2].val) {\n aiMoveSet(2);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[2].val === 'X' && !$scope.squares.data[1].val) {\n aiMoveSet(1);\n }\n else if($scope.squares.data[1].val === 'X' && $scope.squares.data[2].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[3].val === 'X' && !$scope.squares.data[6].val) {\n aiMoveSet(6);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[6].val === 'X' && !$scope.squares.data[3].val) {\n aiMoveSet(3);\n }\n else if($scope.squares.data[3].val === 'X' && $scope.squares.data[6].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[2].val === 'X' && $scope.squares.data[5].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n else if($scope.squares.data[2].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[5].val) {\n aiMoveSet(5);\n }\n else if($scope.squares.data[5].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[2].val) {\n aiMoveSet(2);\n }\n else if($scope.squares.data[6].val === 'X' && $scope.squares.data[7].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n else if($scope.squares.data[7].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[6].val) {\n aiMoveSet(6);\n }\n else if($scope.squares.data[6].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[7].val) {\n aiMoveSet(7);\n }\n //Blocking all 4 corners if necessary\n else if($scope.squares.data[1].val === 'X' && $scope.squares.data[5].val === 'X' && !$scope.squares.data[2].val) {\n aiMoveSet(2);\n }\n else if($scope.squares.data[1].val === 'X' && $scope.squares.data[3].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[3].val === 'X' && $scope.squares.data[7].val === 'X' && !$scope.squares.data[6].val) {\n aiMoveSet(6);\n }\n else if($scope.squares.data[5].val === 'X' && $scope.squares.data[7].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n //Move were all blocked, move to next available space\n else {\n aiChooseAvailSpaceMiddleFirst();\n }\n }\n //If Players first move was the middle, now block or win\n else {\n if($scope.squares.data[0].val === 'X' && $scope.squares.data[1].val === 'X' && !$scope.squares.data[2].val) {\n aiMoveSet(2);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[2].val === 'X' && !$scope.squares.data[1].val) {\n aiMoveSet(1);\n }\n else if($scope.squares.data[1].val === 'X' && $scope.squares.data[2].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[3].val === 'X' && !$scope.squares.data[6].val) {\n aiMoveSet(6);\n }\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[6].val === 'X' && !$scope.squares.data[3].val) {\n aiMoveSet(3);\n }\n else if($scope.squares.data[3].val === 'X' && $scope.squares.data[6].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[2].val === 'X' && $scope.squares.data[5].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n else if($scope.squares.data[2].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[5].val) {\n aiMoveSet(5);\n }\n else if($scope.squares.data[5].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[2].val) {\n aiMoveSet(2);\n }\n else if($scope.squares.data[6].val === 'X' && $scope.squares.data[7].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n else if($scope.squares.data[7].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[6].val) {\n aiMoveSet(6);\n }\n else if($scope.squares.data[6].val === 'X' && $scope.squares.data[8].val === 'X' && !$scope.squares.data[7].val) {\n aiMoveSet(7);\n }\n //Account for the middle space also since the user has moved into that space\n else if($scope.squares.data[0].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[8].val) {\n aiMoveSet(8);\n }\n else if($scope.squares.data[8].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[0].val) {\n aiMoveSet(0);\n }\n else if($scope.squares.data[3].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[5].val) {\n aiMoveSet(5);\n }\n else if($scope.squares.data[5].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[3].val) {\n aiMoveSet(3);\n }\n else if($scope.squares.data[1].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[7].val) {\n aiMoveSet(7);\n }\n else if($scope.squares.data[7].val === 'X' && $scope.squares.data[4].val === 'X' && !$scope.squares.data[1].val) {\n aiMoveSet(1);\n }\n //Move was blocked, move to next available space\n else {\n aiChooseAvailSpaceOther();\n }\n }\n }\n }\n }", "title": "" }, { "docid": "764b34d87451e73c54372cb0f4f1cd55", "score": "0.5083738", "text": "onMove() {\n }", "title": "" }, { "docid": "068f959da439a630856429f4dc713b87", "score": "0.5076357", "text": "function getMotionMatch() {\n\t\t\t\tif (prefersReducedMotion) {\n\t\t\t\t\tanimationSpeed = 0\n\t\t\t\t} else {\n\t\t\t\t\tanimationSpeed = 1250\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "aef8d2feb75b31289fceea8e12ebd748", "score": "0.5073166", "text": "onUpdate() {\r\n this.updateMovementDependencies();\r\n if (this.luminusMovement) this.luminusMovement.move();\r\n }", "title": "" }, { "docid": "bf5c752d493f87e0059f359a8b28a86d", "score": "0.5071009", "text": "function move(m) {\n\t \t\n\t }", "title": "" }, { "docid": "3b254f1d4ed3d073d0ade3523b863ab1", "score": "0.5068461", "text": "function setLocation(percentage) {\n activeSong.currentTime = activeSong.duration * percentage;\n }", "title": "" }, { "docid": "dfc7fef430c08f4b9c66dbedbfa6537f", "score": "0.5066535", "text": "function setAccessibilityState() {\n if (reduceMotionQuery.matches) {\n enableAnimations = false;\n } else { \n enableAnimations = true;\n }\n }", "title": "" }, { "docid": "a78f173096e76229f951c58f0c108baf", "score": "0.50658137", "text": "function reset() {\n player.x = current.playerx;\n player.y = current.playery;\n player.sizeX = current.playersizeX;\n player.sizeY = current.playersizeY;\n player.grow = current.playergrow;\n safeZone.x = current.safeZonex;\n safeZone.y = current.safeZoney;\n safeZone.sizeX = current.safeZonesizeX;\n safeZone.sizeY = current.safeZonesizeY;\n safeZone.move = current.safeZonemove;\n }", "title": "" }, { "docid": "c661bc546862533fc47d8996da24fc50", "score": "0.5062643", "text": "beforeStandByOn() {\n\t\tif (this._plugin.IsPlaying()) {\n\t\t\tthis._resumedPositionAfterStandByOff = this.getPosition();\n\t\t\tthis.pause();\n\t\t}\n\t}", "title": "" }, { "docid": "e9cf76d44a47512d1692ab77ed1113bf", "score": "0.50561583", "text": "function setComputerMoves() {\n\n}", "title": "" }, { "docid": "0f55069b3a236b3ef76b6d43a382f2fc", "score": "0.50540334", "text": "function onMove () {\r\n \r\n if ( !move && moveTrigger === 10 ) {\r\n\r\n move = true;\r\n if ( item !== null ) { \r\n \r\n item.material.color = colorState;\r\n colorState = null;\r\n item = null;\r\n }\r\n };\r\n moveTrigger ++;\r\n}", "title": "" }, { "docid": "2eae83175c8cd07a683102e57c86b78b", "score": "0.50540227", "text": "function restoreState() {\n\t\tUI.refreshSelectedID();\n\t\t\t\n\t\tif (Player.getStatus() == 'playing') {\n\t\t\tUI.showPause();\n\t\t}\n\t\telse {\n\t\t\tUI.showPlay();\n\t\t}\n\t\t\n\t\t//set currently playing info.\n\t\tupdateTrack(UI.getSelectedStation());\n\t}", "title": "" }, { "docid": "d57b2cbae96726cc31c5892085cbac7e", "score": "0.5051849", "text": "function resetPlayerPos(){\n window.currentScene.player.setPosition(100, 400);\n}", "title": "" }, { "docid": "d00a5aba22f3520175dbef4d7b21797b", "score": "0.50494593", "text": "changeMove (danceChart, beat, key, position) {\n // detects hand according to pressed button\n let hand = 'L'\n if (editorConfig.pressedKey === 's') hand = 'R'\n // get the hand move that will be changed\n let handMove = this.getHandMove(danceChart, this.songManager.nearestBeat, hand)\n // TODO: one more time assumes that checkForMoves will not return -1\n let i = this.checkForMoves(danceChart)\n if (hand === 'L') {\n // Adds position to in Progress move\n if (handMove.length === 2) {\n danceChart.moves[i][2] = handMove[0] + position + 'P'\n } else { // Changes position in non Progress move\n danceChart.moves[i][2] = handMove[0] + position + handMove[2]\n }\n } else {\n if (handMove.length === 2) {\n danceChart.moves[i][3] = handMove[0] + position + 'P'\n } else {\n danceChart.moves[i][3] = handMove[0] + position + handMove[2]\n }\n }\n }", "title": "" }, { "docid": "11cf0370d2966a1708cf8dcd757665d1", "score": "0.5046332", "text": "function moveBehavior() {\n cleanInfos();\n if ($('#switch').is(':checked')) {\n getZacByPoint(mviewer.getMap().getView().getCenter());\n } else {\n getDataByExtent();\n }\n }", "title": "" }, { "docid": "d1b4c6503a346d61370f6151029b7988", "score": "0.50440013", "text": "refresh() {\r\n const t = this.physics.worldTransform;\r\n this.ammo.getMotionState().setWorldTransform(t);\r\n }", "title": "" }, { "docid": "5b053c09cee8bf30af68939493e9516f", "score": "0.5043531", "text": "function moveScenery(object) { \n object.x -= screenSpeed;\n object.prevX -= screenSpeed\n}", "title": "" }, { "docid": "8eda8e354a42c2e35674fc98ddedfc79", "score": "0.50414944", "text": "function initialize(){\n moveAbsolute(initialPos);\n}", "title": "" }, { "docid": "01ce60d6558b79d06611745e045f69ef", "score": "0.5036189", "text": "function onMove() {\t\t\t\n\t\tWGL.mcontroller.zoommove(map.getZoom(), getTopLeftTC(), WGL.filterByExt);\n}", "title": "" }, { "docid": "5a62b937242ab44bd916bc21ea15e11c", "score": "0.50278485", "text": "function change_position(player,newPosition){\n\tvar newPositionleft = newPosition.css('left');\n\tvar newPositiontop = newPosition.css('top');\n\t//$('#travel')[0].play();\n\tchange_position_audio.play();\n\tplayer.animate({\n\t\t'top': newPositiontop,\n\t\t'left': newPositionleft\n\t},1500,\"swing\",function(){\n\t});\n\t\n} // end of function players_position", "title": "" }, { "docid": "a45b9c37dda271a6eb2c84a0e962c6a1", "score": "0.5024925", "text": "onChangeStart() {\n this.controls.setSeeking(true);\n this.video.pause();\n }", "title": "" }, { "docid": "602d592476f52ac555bd2750a7c52790", "score": "0.5023661", "text": "moveLogic() {\r\n if (this.isPlaced == false) {\r\n if (frameCount % 15 == 0) {\r\n this.y1 = this.y1 + 40;\r\n this.y2 = this.y2 + 40;\r\n this.y3 = this.y3 + 40;\r\n this.y4 = this.y4 + 40;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "602d592476f52ac555bd2750a7c52790", "score": "0.5023661", "text": "moveLogic() {\r\n if (this.isPlaced == false) {\r\n if (frameCount % 15 == 0) {\r\n this.y1 = this.y1 + 40;\r\n this.y2 = this.y2 + 40;\r\n this.y3 = this.y3 + 40;\r\n this.y4 = this.y4 + 40;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "602d592476f52ac555bd2750a7c52790", "score": "0.5023661", "text": "moveLogic() {\r\n if (this.isPlaced == false) {\r\n if (frameCount % 15 == 0) {\r\n this.y1 = this.y1 + 40;\r\n this.y2 = this.y2 + 40;\r\n this.y3 = this.y3 + 40;\r\n this.y4 = this.y4 + 40;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "602d592476f52ac555bd2750a7c52790", "score": "0.5023661", "text": "moveLogic() {\r\n if (this.isPlaced == false) {\r\n if (frameCount % 15 == 0) {\r\n this.y1 = this.y1 + 40;\r\n this.y2 = this.y2 + 40;\r\n this.y3 = this.y3 + 40;\r\n this.y4 = this.y4 + 40;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "602d592476f52ac555bd2750a7c52790", "score": "0.5023661", "text": "moveLogic() {\r\n if (this.isPlaced == false) {\r\n if (frameCount % 15 == 0) {\r\n this.y1 = this.y1 + 40;\r\n this.y2 = this.y2 + 40;\r\n this.y3 = this.y3 + 40;\r\n this.y4 = this.y4 + 40;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "602d592476f52ac555bd2750a7c52790", "score": "0.5023661", "text": "moveLogic() {\r\n if (this.isPlaced == false) {\r\n if (frameCount % 15 == 0) {\r\n this.y1 = this.y1 + 40;\r\n this.y2 = this.y2 + 40;\r\n this.y3 = this.y3 + 40;\r\n this.y4 = this.y4 + 40;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "602d592476f52ac555bd2750a7c52790", "score": "0.5023661", "text": "moveLogic() {\r\n if (this.isPlaced == false) {\r\n if (frameCount % 15 == 0) {\r\n this.y1 = this.y1 + 40;\r\n this.y2 = this.y2 + 40;\r\n this.y3 = this.y3 + 40;\r\n this.y4 = this.y4 + 40;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "c2e5eb4cf2e47b8851e44d7521d013c6", "score": "0.5017808", "text": "refresh() {\n // this.ctx.translate(-this.canvasOffset.x, -this.canvasOffset.y);\n const { gameObjects } = this.props;\n this.activeState.restore(gameObjects);\n Matter.Mouse.setOffset(this.mouse, this.activeState.camera.view.min);\n }", "title": "" }, { "docid": "b459a95137445e20c38189e2472f5e20", "score": "0.50175667", "text": "function updatePlayerMoveSpeed(){\n\tif(gameData.curSpeed <= 0){\n\t\tgameData.curSpeed = gameData.speed;\n\t\tgameData.frame++;\n\t\t\n\t\tvar totalFrames = humanBottomData.getNumFrames()-1;\n\t\tgameData.frame = gameData.frame > totalFrames ? 1 : gameData.frame;\n\t}else{\n\t\tgameData.curSpeed--;\n\t}\n\thumanBottomAnimation.gotoAndStop(gameData.frame);\n\t\n\tif(gameData.frame == 1){\n\t\tgameData.walk = false;\n\t}else if(gameData.frame == (humanBottomData.getNumFrames()-1) && !gameData.walk){\n\t\tgameData.walk = true;\n\t\t\n\t\tif(gameData.walkSound){\n\t\t\tgameData.walkSound = false;\n\t\t\tplaySound('soundRope1');\n\t\t}else{\n\t\t\tgameData.walkSound = true;\n\t\t\tplaySound('soundRope2');\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3302bcaa92e3c7a3226d8d319fa0bb1b", "score": "0.5016737", "text": "movie_move() {\n if(this.board.indexMovie >= this.board.listOfMoves.length) {\n this.board.indexMovie = 0;\n this.scene.update_message(\"End of replay!\");\n this.scene.quitGame();\n return;\n }\n var coordinates = this.board.listOfMoves[this.board.indexMovie];\n this.board.indexMovie += 1;\n this.coords_before = coordinates[0];\n for(var i = 0; i < this.pawns.length; i++)\n {\n if(this.pawns[i].coordinates[0] == this.coords_before[0] && this.pawns[i].coordinates[1] == this.coords_before[1])\n this.selected_pawn = this.pawns[i];\n }\n this.coords_after = coordinates[1];\n this.currentState=this.state.pawn_animation;\n this.selected_pawn.setAnimation(coordinates[1]);\n this.check_jump_over_enemies(coordinates[0], coordinates[1]);\n }", "title": "" }, { "docid": "96193eecdbce2b8a70e14004d70ff266", "score": "0.5016174", "text": "reset() {\n this.x = 2 * xMovement;\n this.y = 5 * yMovement - moveFactor;\n }", "title": "" }, { "docid": "beb6bda656877094d4414ad66171d51b", "score": "0.50092185", "text": "function resetMainVRPosition() {\n\tcameraZeroPos = reverseThreeVector(camera.position)\n\tupdateSystemScaling()\n}", "title": "" }, { "docid": "caf61b0733480381c6c503f0dc63dec7", "score": "0.50027674", "text": "function changeEnemyWithMusic() {\n enemies.forEachAlive(function(enemy) {\n if (enemy.subType === 'grounded' && enemy.body.onFloor()) {\n enemy.goingForward = !enemy.goingForward;\n } else if (enemy.subType === 'flying') {\n if (enemy.body.velocity.y >= 0) {\n enemy.body.velocity.y = -enemy.body.velocity.y;\n } else {\n enemy.body.velocity.y = -enemy.body.velocity.y;\n }\n }\n }, this);\n}", "title": "" }, { "docid": "84b1a9d75ce04072ad493dede2b8b903", "score": "0.50023526", "text": "function movePosition(self, pos) {\n pos = pos / self.trackWidth * 100;\n self.trackControl.style.left = pos + '%';\n self.trackInner.style.width = pos + '%';\n }", "title": "" }, { "docid": "7a30ad32074f1af3829c9cee6f89f7ca", "score": "0.50003105", "text": "onChange() {\n if (!this.video.duration) {\n // Can't seek yet. Ignore.\n return;\n }\n\n // Update the UI right away.\n this.update();\n\n // We want to wait until the user has stopped moving the seek bar for a\n // little bit to reduce the number of times we ask the player to seek.\n //\n // To do this, we will start a timer that will fire in a little bit, but if\n // we see another seek bar change, we will cancel that timer and re-start\n // it.\n //\n // Calling |start| on an already pending timer will cancel the old request\n // and start the new one.\n this.seekTimer_.tickAfter(/* seconds= */ 0.125);\n }", "title": "" }, { "docid": "dff7feb4c8d1355b63e2e8273ce2281d", "score": "0.49986696", "text": "get seeking() {\n return [PLAYER_STATE.FAST_FORWARD, PLAYER_STATE.REWIND].includes(\n this.state,\n );\n }", "title": "" }, { "docid": "9870bab28e98c586498b5f7db74be670", "score": "0.49955606", "text": "function resetAnimationState() {\n state = {\n timeSolar: 0,\n timeTerra: 0,\n timeLunar: 0,\n timeOwl: 0\n };\n }", "title": "" }, { "docid": "4929a2e5aef9bd3e104033b77b242c7f", "score": "0.49949655", "text": "function changeSpeed() {\n\tif (mode == 1 || mode == 3) { // izvršava se jedino u režimu „PLAY“ ili u režimu „REVERSE“\n\t\tclearInterval(runLoop); // prekida se dosadašnja radna petlja...\n\t\tsetSpeed(); // ...i startuje nova, s novopodešenom brzinom\n\t}\n}", "title": "" }, { "docid": "a6c469a7247eb72b48ef54ebb61a73e1", "score": "0.4993666", "text": "saveState() {\n this.getTarget(this._target0);\n this.getPosition(this._position0);\n this._zoom0 = this._zoom;\n this._focalOffset0.copy(this._focalOffset);\n }", "title": "" }, { "docid": "ce5b7e954d970f125f4f8457eb644e61", "score": "0.49918696", "text": "function screenMove() {\n //Horizonal position of player\n var STATIC_HOR_POSITION = dynamic.position().left;\n //Map position from left\n var MAP_POSITION = $('.map').position().left;\n //Map whith\n var MAP_WHITH = $('.map').width();\n //Screen window\n var WINDOW_WHITH = $(window).width();\n var DYNAMIC_POSITION = (dynamic.position().left - Math.abs(MAP_POSITION));\n //console.log(DYNAMIC_POSITION);\n var offset = player.speedX;//number of speed for map moving\n if(STATIC_HOR_POSITION >= WINDOW_WHITH/2){\n if (Math.abs(MAP_POSITION) == (MAP_WHITH - WINDOW_WHITH)) {\n offset = 0;\n }\n else if(WINDOW_WHITH/2 >= DYNAMIC_POSITION){\n offset = 0;\n }else{\n offset = player.speedX;\n }\n $('.map').css({'left' : (MAP_POSITION - offset)});\n }\n if (DYNAMIC_POSITION <= 0) {\n //console.log('yes');\n //console.log((DYNAMIC_POSITION + 3) + 'px');\n dynamic.css(\"left\", Math.abs(MAP_POSITION));\n }//end if \n }", "title": "" }, { "docid": "cfcf191f15529a6c710347f692205f6d", "score": "0.4986681", "text": "playMove (thisMove) { \n \n this.logMove(thisMove);\n this.logBoard();\n this.switchColor(); \n \n }", "title": "" }, { "docid": "4c7911854086337a5562a4eda63db61b", "score": "0.49864906", "text": "function Move(){ \n\n\t\tvar pos = $window.scrollTop(); //position of the scrollbar\n\n\t\t\n\n\t\t// Ausgabe: Position, Window height\n\n\t\t//$(\"#meta\").html(\"pos: \"+pos+\" windowHeight: \"+windowHeight);\n\n\t\t\n\n\t\t// home: 0\n\n\t\tif($homeBG.hasClass(\"inview\")){\n\n\t\t\t//call the newPos function and change the background position\n\n\t\t\t$homeBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 600, 0.3)}); \n\n\t\t\t//call the newPos function and change the secnond background position\n\n\t\t\t//homesprite.css({'backgroundPosition': newPos(50, windowHeight, pos, 1143, 0.6)});\n\n\t\t}\n\n\t\t\n\n\t\t// whyus: 1000\n\n\t\tif($whyusBG.hasClass(\"inview\")){\n\n\t\t\t/*//call the newPos function and change the background position\n\n\t\t\t$whyusBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 1800, 0.3)});\n\n\t\t\tvar ptr=(((windowHeight + pos) - 3) * 0.1) \n\n\t\t\t//$whyusBG.find('.wrapper').css({'marginTop': ptr+'px'});\n\n\t\t\twhyussprite.css({'backgroundPosition': newPos01(80, windowHeight, pos, 9580, 0.06)});\n\n\t\t\t$('.spritesun').css({'backgroundPosition': newPos(30, windowHeight, pos, 2200, 0.19)});\n\n\t\t\tvar p = newPos1(windowHeight, pos, 2200, 0.19);\n\n\t\t\tif (p<81){\n\n\t\t\t\t $('.spritesun').addClass('spritesunFixed');\t\n\n\t\t\t}\n\n\t\t\telse{\n\n\t\t\t\t $('.spritesun').removeClass('spritesunFixed');\t\n\n\t\t\t}*/\n\n\t\t\t\n\n\t\t}\n\n\t\t\n\n\t\t// ourprocess: 2000\n\n\t\tif($ourprocessBG.hasClass(\"inview\")){\n\n\t\t\t//call the newPos function and change the background position\n\n\t\t\t$ourprocessBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 2800, 0.3)}); \n\n\t\t\t//call the newPos function and change the secnond background position\n\n\t\t\t//ourprocesssprite.css({'backgroundPosition': newPos01(center, windowHeight, pos, 6580, 0.06)});\n\n\t\t\t\n\n\t\t\t\n\n\t\t}\n\n\t\t\n\n\t\t// kandyvideos: 3000\n\n\t\tif($kandyvideosBG.hasClass(\"inview\")){\n\n\t\t\t//call the newPos function and change the background position\n\n\t\t\t$kandyvideosBG.css({'backgroundPosition': newPos01(50, windowHeight, pos, 3850, 0.01)}); \n\n\t\t\t//call the newPos function and change the secnond background position\n\n\t\t\t//kandyvideossprite.css({'backgroundPosition': newPos(50, windowHeight, pos, 3660, -0.6)});\n\n\t\t}\n\n\n\n\t\t// clientsayings: 4000\n\n\t\tif($clientsayingsBG.hasClass(\"inview\")){\n\n\t\t\t//call the newPos function and change the background position\n\n\t\t//\t$clientsayingsBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 4800, 0.3)}); \n\n\t\t\t//call the newPos function and change the secnond background position\n\n\t\t\t//clientsayingssprite.css({'backgroundPosition': newPos(50, windowHeight, pos, 5300, 0.6)});\n\n\t\t}\n\n\n\n\t\t// requestquote: 5000\n\n\t\tif($requestquoteBG.hasClass(\"inview\")){\n\n\t\t\t//call the newPos function and change the background position\n\n\t\t//\t$requestquoteBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 5800, 0.3)}); \n\n\t\t\t//call the newPos function and change the secnond background position\n\n\t\t\t//requestquotesprite.css({'backgroundPosition': newPos(50, windowHeight, pos, 6350, 0.6)});\n\n\t\t}\n\n\n\n\t\t\n\n\t}", "title": "" }, { "docid": "4c7911854086337a5562a4eda63db61b", "score": "0.49864906", "text": "function Move(){ \n\n\t\tvar pos = $window.scrollTop(); //position of the scrollbar\n\n\t\t\n\n\t\t// Ausgabe: Position, Window height\n\n\t\t//$(\"#meta\").html(\"pos: \"+pos+\" windowHeight: \"+windowHeight);\n\n\t\t\n\n\t\t// home: 0\n\n\t\tif($homeBG.hasClass(\"inview\")){\n\n\t\t\t//call the newPos function and change the background position\n\n\t\t\t$homeBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 600, 0.3)}); \n\n\t\t\t//call the newPos function and change the secnond background position\n\n\t\t\t//homesprite.css({'backgroundPosition': newPos(50, windowHeight, pos, 1143, 0.6)});\n\n\t\t}\n\n\t\t\n\n\t\t// whyus: 1000\n\n\t\tif($whyusBG.hasClass(\"inview\")){\n\n\t\t\t/*//call the newPos function and change the background position\n\n\t\t\t$whyusBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 1800, 0.3)});\n\n\t\t\tvar ptr=(((windowHeight + pos) - 3) * 0.1) \n\n\t\t\t//$whyusBG.find('.wrapper').css({'marginTop': ptr+'px'});\n\n\t\t\twhyussprite.css({'backgroundPosition': newPos01(80, windowHeight, pos, 9580, 0.06)});\n\n\t\t\t$('.spritesun').css({'backgroundPosition': newPos(30, windowHeight, pos, 2200, 0.19)});\n\n\t\t\tvar p = newPos1(windowHeight, pos, 2200, 0.19);\n\n\t\t\tif (p<81){\n\n\t\t\t\t $('.spritesun').addClass('spritesunFixed');\t\n\n\t\t\t}\n\n\t\t\telse{\n\n\t\t\t\t $('.spritesun').removeClass('spritesunFixed');\t\n\n\t\t\t}*/\n\n\t\t\t\n\n\t\t}\n\n\t\t\n\n\t\t// ourprocess: 2000\n\n\t\tif($ourprocessBG.hasClass(\"inview\")){\n\n\t\t\t//call the newPos function and change the background position\n\n\t\t\t$ourprocessBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 2800, 0.3)}); \n\n\t\t\t//call the newPos function and change the secnond background position\n\n\t\t\t//ourprocesssprite.css({'backgroundPosition': newPos01(center, windowHeight, pos, 6580, 0.06)});\n\n\t\t\t\n\n\t\t\t\n\n\t\t}\n\n\t\t\n\n\t\t// kandyvideos: 3000\n\n\t\tif($kandyvideosBG.hasClass(\"inview\")){\n\n\t\t\t//call the newPos function and change the background position\n\n\t\t\t$kandyvideosBG.css({'backgroundPosition': newPos01(50, windowHeight, pos, 3850, 0.01)}); \n\n\t\t\t//call the newPos function and change the secnond background position\n\n\t\t\t//kandyvideossprite.css({'backgroundPosition': newPos(50, windowHeight, pos, 3660, -0.6)});\n\n\t\t}\n\n\n\n\t\t// clientsayings: 4000\n\n\t\tif($clientsayingsBG.hasClass(\"inview\")){\n\n\t\t\t//call the newPos function and change the background position\n\n\t\t//\t$clientsayingsBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 4800, 0.3)}); \n\n\t\t\t//call the newPos function and change the secnond background position\n\n\t\t\t//clientsayingssprite.css({'backgroundPosition': newPos(50, windowHeight, pos, 5300, 0.6)});\n\n\t\t}\n\n\n\n\t\t// requestquote: 5000\n\n\t\tif($requestquoteBG.hasClass(\"inview\")){\n\n\t\t\t//call the newPos function and change the background position\n\n\t\t//\t$requestquoteBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 5800, 0.3)}); \n\n\t\t\t//call the newPos function and change the secnond background position\n\n\t\t\t//requestquotesprite.css({'backgroundPosition': newPos(50, windowHeight, pos, 6350, 0.6)});\n\n\t\t}\n\n\n\n\t\t\n\n\t}", "title": "" }, { "docid": "1f2cab8d36b38117526b7793da432792", "score": "0.49835113", "text": "fullReset() {\n let _done = false;\n this.midi.loading(() => {\n return _done;\n });\n let session = this.config.ControlSettings.session;\n AssetManager.disposeAll();\n this.presetMan.reload();\n this.presetMan.resetStatus();\n this.settingsManager.reset();\n this.config.SourceSettingsManager.reset();\n this.config.ControlSettingsManager.reset();\n this.config.DisplaySettingsManager.reset();\n\n let sources = this.config.SourceSettingsManager.prepareFlat();\n let controls = this.config.ControlSettingsManager.prepareFlat();\n let displays = this.config.DisplaySettingsManager.prepareFlat();\n\n controls.session = session;\n\n Messaging.emitSources(sources, true, false, true);\n Messaging.emitControls(controls, true, false, true);\n Messaging.emitDisplays(displays, true, false, true);\n this.updateSources(sources, true, true, true);\n this.updateControls(controls, true, true, true);\n this.updateDisplays(displays, true, true, true);\n\n this.syncLayers().finally(() => {\n this._checkDisplayVisibility();\n _done = true;\n });\n }", "title": "" }, { "docid": "2c6b249180a59b9961bf1d3f9d1a6b3a", "score": "0.4980532", "text": "function updateScreenPositions()\n{\t\n\tvar idAndCamera = [playerObjectsList.indexOf(playersTank),camera[0], camera[1]];\n\t// thisClient.emit('cameraChanged', idAndCamera);\n\tvar cameraXChange = camera[0] - screen[0];\n\tvar cameraYChange = camera[1] - screen[1];\n\tfor (var i = 0; i < playerObjectsList.length; i++) \n\t{\n\t\tvar playerObject = playerObjectsList[i] || {};\t\t\n\t\tif(playerObject.id != 'player')\n\t\t{\n\t\t\t// playerObject.xPosition -= cameraXChange;\t\t\n\t\t\t// playerObject.yPosition -= cameraYChange;\n\t\t\tplayerObject.xOnScreen -= cameraXChange;\t\t\n\t\t\tplayerObject.yOnScreen -= cameraYChange;\n\t\t}\t\t\t\n\t} \n\t// playersTank.xPosition -= cameraXChange;\n\t// playersTank.yPosition -= cameraYChange;\n\t//all player tanks\n\t//all pickUps\n\t// for(i = 0; i < deadList.length; i++)\n\t// {\n\t\t// var thisDeadImageInfo = deadList[i];\n\t\t// thisDeadImageInfo[1] -= cameraXChange;\t\n\t\t// thisDeadImageInfo[2] -= cameraYChange;\t\t\t\n\t// }\n\tfor(i = 0; i < activePickups.length; i++)\n\t{\n\t\tactivePickups[i].gameX -= cameraXChange;\t\t\n\t\tactivePickups[i].gameY -= cameraYChange;\t\n\t}\n\t//all enemies\n\t// for(var i=0; i < enemies.length; i++)\n\t// {\t\t\n\t\t// enemies[i].xPosition -= cameraXChange;\t\t\n\t\t// enemies[i].yPosition -= cameraYChange;\t\n\t// }\n\tfor(var i=0; i < allWalls.length; i++)\n\t{\n\t\tallWalls[i][0] -= cameraXChange;\n\t\tallWalls[i][1] -= cameraYChange;\n\t}\n\tfor(var i=0; i < allBullets.length; i++)\n\t{\n\t\tallBullets[i].gameX -= cameraXChange;\n\t\tallBullets[i].gameY -= cameraYChange;\n\t}\n\tfor(var i=0; i < pebbles.length; i++)\n\t{\n\t\tpebbles[i][0] -= cameraXChange;\n\t\tpebbles[i][1] -= cameraYChange;\n\t}\n\tfor(var i=0; i < allExplosives.length; i++)\n\t{\n\t\tallExplosives[i].gameX -= cameraXChange;\n\t\tallExplosives[i].gameY -= cameraYChange;\n\t}\n\t\n\t// playersTank.cameraX = camera[0];\n\t// playersTank.cameraY = camera[1];\n\tscreen[0] = camera[0];\n\tscreen[1] = camera[1];\n}", "title": "" }, { "docid": "486acaab1330bf4f00b393b9cd10678b", "score": "0.49791458", "text": "function mover(ctx) {\n \n var oldPos = posicion,\n onGrid = onGridSquare(posicion),\n npos = null;\n \n if (due !== direccion) {\n \n npos = nuevaUbicacion(due, posicion);\n \n if (onGrid &&\n map.isFloorSpace({\n \"y\":pointToCoord(nextSquare(npos.y, due)),\n \"x\":pointToCoord(nextSquare(npos.x, due))})) {\n direccion = due;\n } else {\n npos = null;\n }\n }\n \n if (npos === null) {\n npos = nuevaUbicacion(direccion, posicion);\n }\n \n if (onGrid &&\n map.isParedSpace({\n \"y\" : pointToCoord(nextSquare(npos.y, direccion)),\n \"x\" : pointToCoord(nextSquare(npos.x, direccion))\n })) {\n \n due = getRandomdireccion(); \n return mover(ctx);\n }\n\n posicion = npos; \n \n var tmp = pane(posicion);\n if (tmp) { \n posicion = tmp;\n }\n \n due = getRandomdireccion();\n \n return {\n \"new\" : posicion,\n \"old\" : oldPos\n };\n }", "title": "" }, { "docid": "4b9f78e42ac459572f2e61f16209bb4a", "score": "0.4975534", "text": "function mover() {\n\t\tsm.updateLight(0, pos.x, pos.y, .4);\n\t\tsm.updateLight(1, pos.x-10, pos.y, .4);\n\t\tsm.updateLight(2, pos.x+10, pos.y, .4);\n\t\tsm.updateLight(3, pos.x, pos.y-10, .4);\n\t\tsm.updateLight(4, pos.x, pos.y+10, .4);\n\t\tsm.updateLight(5, pos.x+7.1, pos.y+7.1, .4);\n\t\tsm.updateLight(6, pos.x+7.1, pos.y-7.1, .4);\n\t\tsm.updateLight(7, pos.x-7.1, pos.y+7.1, .4);\n\t\tsm.updateLight(8, pos.x-7.1, pos.y-7.1, .4);\n\n\t\tvar sprite = ss.getSprite(0);\n\t\tif(sprite.x > w-150) {\n\t\t\tss.updateSprite(0, sprite.x, sprite.y, -Math.abs(sprite.velx), sprite.vely);\n\t\t} else if(sprite.y > h-165) {\n\t\t\tss.updateSprite(0, sprite.x, sprite.y, sprite.velx, -Math.abs(sprite.vely));\n\t\t} else if(sprite.x < 0) {\n\t\t\tss.updateSprite(0, sprite.x, sprite.y, Math.abs(sprite.velx), sprite.vely);\n\t\t} else if(sprite.y < 0) {\n\t\t\tss.updateSprite(0, sprite.x, sprite.y, sprite.velx, Math.abs(sprite.vely));\n\t\t}\n\t}", "title": "" }, { "docid": "19a4f2aabbfaf0bd3e23a4b9ebdd64ec", "score": "0.49727854", "text": "onMoveStart () {\n if (!this.$Windy) return\n this.$Windy.stop()\n }", "title": "" }, { "docid": "26734117caf3bfceb3186518c5832ec7", "score": "0.49725205", "text": "onMoveEnd () {\n if (!this.$Windy) return\n this.$Windy.start()\n }", "title": "" }, { "docid": "8f06635059c8fe5958bf92a6eac294cc", "score": "0.49722207", "text": "function resetAllPointers(){\r\n\t//find patiala as our reset position\r\n\tvar resetIndex = 0;\r\n\tfor(var i=0; i<properties.length; i++){\r\n\t\t//indexValue 786 is for Patiala\r\n\t\tif(properties[i].indexValue == 786){\r\n\t\t\tresetIndex = i;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i=0; i<playerArray.length; i++){\r\n\t\tplayerArray[i].posX = (((properties[resetIndex].indexValue)%TILE_COL-0.25)*TILE_HEIGHT);\r\n\t\tplayerArray[i].posY = ((Math.floor((properties[resetIndex].indexValue/TILE_ROW)))*TILE_WIDTH - 20);\r\n\t\tplayerArray[i].currentIndex = resetIndex;\r\n\t}\r\n}", "title": "" }, { "docid": "270b0b22a0ac9d4cd3692bb50ffb2027", "score": "0.4971505", "text": "function onAudioPositionChanged(position, from, skipping) { //noLetPlay\n\n audioCurrentTime = position;\n\n// if (_letPlay)\n// {\n// return;\n// }\n\n _skipAudioEnded = false;\n// _skipTTSEnded = false;\n\n if (!_smilIterator || !_smilIterator.currentPar)\n {\n return;\n }\n\n var parFrom = _smilIterator.currentPar;\n \n var audio = _smilIterator.currentPar.audio;\n\n //var TOLERANCE = 0.05;\n if(\n //position >= (audio.clipBegin - TOLERANCE) &&\n position > DIRECTION_MARK &&\n position <= audio.clipEnd) {\n\n//console.debug(\"onAudioPositionChanged: \" + position);\n return;\n }\n\n _skipAudioEnded = true;\n\n//console.debug(\"PLAY NEXT: \" + \"(\" + audio.clipBegin + \" -- \" + audio.clipEnd + \") [\" + from + \"] \" + position);\n//console.debug(_smilIterator.currentPar.text.srcFragmentId);\n\n var isPlaying = _audioPlayer.isPlaying();\n if (isPlaying && from === 6)\n {\n console.debug(\"from userNav _audioPlayer.isPlaying() ???\");\n }\n\n var goNext = position > audio.clipEnd;\n\n var doNotNextSmil = !_autoNextSmil && from !== 6 && goNext;\n\n var spineItemIdRef = (_smilIterator && _smilIterator.smil && _smilIterator.smil.spineItemId) ? _smilIterator.smil.spineItemId : ((_lastPaginationData && _lastPaginationData.spineItem && _lastPaginationData.spineItem.idref) ? _lastPaginationData.spineItem.idref : undefined);\n if (doNotNextSmil && spineItemIdRef && _lastPaginationData && _lastPaginationData.paginationInfo && _lastPaginationData.paginationInfo.openPages && _lastPaginationData.paginationInfo.openPages.length > 1)\n {\n //var iPage = _lastPaginationData.paginationInfo.isRightToLeft ? _lastPaginationData.paginationInfo.openPages.length - 1 : 0;\n var iPage = 0;\n \n var openPage = _lastPaginationData.paginationInfo.openPages[iPage];\n if (spineItemIdRef === openPage.idref)\n {\n doNotNextSmil = false;\n }\n }\n \n if (goNext)\n {\n _smilIterator.next();\n }\n else //position <= DIRECTION_MARK\n {\n _smilIterator.previous();\n }\n\n if(!_smilIterator.currentPar)\n {\n //\n // if (!noLetPlay)\n // {\n // _letPlay = true;\n // setTimeout(function()\n // {\n // _letPlay = false;\n // nextSmil(goNext);\n // }, 200);\n // }\n // else\n // {\n // nextSmil(goNext);\n // }\n\n//console.debug(\"NEXT SMIL ON AUDIO POS\");\n \n if (doNotNextSmil)\n {\n _wasPausedBecauseNoAutoNextSmil = true;\n self.reset();\n //self.pause();\n }\n else\n {\n nextSmil(goNext);\n }\n return;\n }\n\n//console.debug(\"ITER: \" + _smilIterator.currentPar.text.srcFragmentId);\n\n if(!_smilIterator.currentPar.audio) {\n self.pause();\n return;\n }\n \n if(_settings.mediaOverlaysSkipSkippables)\n {\n var skip = false;\n var parent = _smilIterator.currentPar;\n while (parent)\n {\n if (parent.isSkippable && parent.isSkippable(_settings.mediaOverlaysSkippables))\n {\n skip = true;\n break;\n }\n parent = parent.parent;\n }\n\n if (skip)\n {\n console.log(\"MO SKIP: \" + parent.epubtype);\n\n self.pause();\n\n var pos = goNext ? _smilIterator.currentPar.audio.clipEnd + 0.1 : DIRECTION_MARK - 1;\n\n onAudioPositionChanged(pos, from, true); //noLetPlay\n return;\n }\n }\n\n // _settings.mediaOverlaysSynchronizationGranularity\n if (!isPlaying && (_smilIterator.currentPar.element || _smilIterator.currentPar.cfi && _smilIterator.currentPar.cfi.cfiTextParent))\n {\n var scopeTo = _elementHighlighter.adjustParToSeqSyncGranularity(_smilIterator.currentPar);\n if (scopeTo && scopeTo !== _smilIterator.currentPar)\n {\n var scopeFrom = _elementHighlighter.adjustParToSeqSyncGranularity(parFrom);\n if (scopeFrom && (scopeFrom === scopeTo || !goNext))\n {\n if (scopeFrom === scopeTo)\n {\n do\n {\n if (goNext) _smilIterator.next();\n else _smilIterator.previous();\n } while (_smilIterator.currentPar && _smilIterator.currentPar.hasAncestor(scopeFrom));\n\n if (!_smilIterator.currentPar)\n {\n //console.debug(\"adjustParToSeqSyncGranularity nextSmil(goNext)\");\n\n if (doNotNextSmil)\n {\n _wasPausedBecauseNoAutoNextSmil = true;\n self.reset();\n //self.pause();\n }\n else\n {\n nextSmil(goNext);\n }\n \n return;\n }\n }\n \n//console.debug(\"ADJUSTED: \" + _smilIterator.currentPar.text.srcFragmentId);\n if (!goNext)\n {\n var landed = _elementHighlighter.adjustParToSeqSyncGranularity(_smilIterator.currentPar);\n if (landed && landed !== _smilIterator.currentPar)\n {\n var backup = _smilIterator.currentPar;\n \n var innerPar = undefined;\n do\n {\n innerPar = _smilIterator.currentPar;\n _smilIterator.previous();\n }\n while (_smilIterator.currentPar && _smilIterator.currentPar.hasAncestor(landed));\n \n if (_smilIterator.currentPar)\n {\n _smilIterator.next();\n \n if (!_smilIterator.currentPar.hasAncestor(landed))\n {\n console.error(\"adjustParToSeqSyncGranularity !_smilIterator.currentPar.hasAncestor(landed) ???\");\n }\n //assert \n }\n else\n {\n//console.debug(\"adjustParToSeqSyncGranularity reached begin\");\n\n _smilIterator.reset();\n \n if (_smilIterator.currentPar !== innerPar)\n {\n console.error(\"adjustParToSeqSyncGranularity _smilIterator.currentPar !=== innerPar???\");\n }\n }\n\n if (!_smilIterator.currentPar)\n {\n console.error(\"adjustParToSeqSyncGranularity !_smilIterator.currentPar ?????\");\n _smilIterator.goToPar(backup);\n }\n \n//console.debug(\"ADJUSTED PREV: \" + _smilIterator.currentPar.text.srcFragmentId);\n }\n }\n }\n }\n }\n \n if(_audioPlayer.isPlaying()\n && _smilIterator.currentPar.audio.src\n && _smilIterator.currentPar.audio.src == _audioPlayer.currentSmilSrc()\n && position >= _smilIterator.currentPar.audio.clipBegin\n && position <= _smilIterator.currentPar.audio.clipEnd)\n {\n//console.debug(\"ONLY highlightCurrentElement\");\n highlightCurrentElement();\n return;\n }\n\n //position <= DIRECTION_MARK goes here (goto previous):\n\n// if (!noLetPlay && position > DIRECTION_MARK\n// && _audioPlayer.isPlaying() && _audioPlayer.srcRef() != _smilIterator.currentPar.audio.src)\n// {\n// _letPlay = true;\n// setTimeout(function()\n// {\n// _letPlay = false;\n// playCurrentPar();\n// }, 100);\n//\n// playCurrentPar();\n//\n// return;\n// }\n\n playCurrentPar();\n }", "title": "" } ]
4220751e80ec9640b7414b3e7a0eef2e
Distributor List all Deliveries with a Problem
[ { "docid": "6758a0e709cefd780cb0b83e86d8e036", "score": "0.48324004", "text": "async show(req, res) {\n const { page = 1 } = req.query;\n const response = await DeliveryProblem.findAndCountAll({\n // Config search\n where: {},\n order: [['id', 'DESC']],\n limit: 7,\n offset: (page - 1) * 7\n });\n return res.json({\n deliveriesProbList: response.rows,\n deliveriesProbCount: response.count\n });\n }", "title": "" } ]
[ { "docid": "f478897077d4e97d5b6bae6143137536", "score": "0.54640037", "text": "function deliveries() { }", "title": "" }, { "docid": "cbe2f8c19914126bc506566300da85ae", "score": "0.523006", "text": "function viewAllDepts() {\n connection.query(\"SELECT d.name AS Department FROM department d ORDER BY d.name;\", function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var deptObj = [res[i].Department];\n tableResults.push(deptObj);\n }\n console.clear();\n console.log(\n \" ------------------------------------ \\n ALL COMPANY DEPARTMENTS AT THIS TIME \\n ------------------------------------\"\n );\n console.table([\"Department\"], tableResults);\n actions();\n });\n}", "title": "" }, { "docid": "944bf264db8e8dbf7296dffedb32118b", "score": "0.51222676", "text": "deliveries(){\n const deliveriesInNeighborhood = [];\n for(const delivery of store.deliveries){\n if(delivery.neighborhoodId === this.id){\n deliveriesInNeighborhood.push(delivery)\n }\n }\n return deliveriesInNeighborhood;\n }", "title": "" }, { "docid": "952147558251a50c792ee0fbe3aff52c", "score": "0.51114434", "text": "deliveries() {\n let allDeliveries = this.employees().map(employee => {\n return employee.deliveries();\n });\n let merged = [].concat.apply([], allDeliveries);\n return merged;\n }", "title": "" }, { "docid": "d16d5f7876694eddcf3be28db2c46ea6", "score": "0.5094709", "text": "function assignDeliverables() {\n vm.booking.technical_specifications.deliverables = vm.deliverables;\n isDoneAllDeliverables();\n }", "title": "" }, { "docid": "5b0e887b8a567bb6e07a3e052a9e97ae", "score": "0.5082856", "text": "function calculDeductible () {\n for (var i = 0; i < deliveries.length; i++) {\n if (deliveries[i].options.deductibleReduction == true) {\n deliveries[i].price += deliveries[i].volume\n deliveries[i].commission.convargo += deliveries[i].volume\n }\n }\n}", "title": "" }, { "docid": "7e37eca27b5fc719b3139270b157dd5d", "score": "0.50703555", "text": "function restrictListProducts(prods, lactoseIntolerant, nutFree, organic, sorter) {\n\tlet products = [];\n\tfor (let i = 0; i < prods.length; i += 1) {\n\t\tif (ableToEat(prods[i], lactoseIntolerant, nutFree, organic)) {\n\t\t\tproducts.push(prods[i]);\n\t\t}\n\t}\n\treturn products.sort(sorter);\n}", "title": "" }, { "docid": "6257c499d18eadb9bf857f208b001ee5", "score": "0.5047778", "text": "function restrictListProducts(prods, restriction) {\n\tlet restrictedProduct = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\t//Vegetarian\n\t\tif ((restriction[0]) && (!prods[i].vegetarian)){\n\t\t\tcontinue;\n\t\t}\n\t\t//Gluten-Free\n\t\tif ((restriction[1]) && (!prods[i].glutenFree)){\n\t\t\tcontinue;\n\t\t}\n\t\t//organic\n\t\tif ((restriction[2]) && (!prods[i].organic)){\n\t\t\tcontinue;\n\t\t}\n\t\t//vegan \n\t\tif ((restriction[3]) && (!prods[i].vegan)){\n\t\t\tcontinue;\n\t\t}\n\t\t//dairy Free\n\t\tif ((restriction[4]) && (!prods[i].dairyF)){\n\t\t\tcontinue;\n\t\t}\n\t\trestrictedProduct.push(prods[i]);\n\t}\n\treturn restrictedProduct;\n}", "title": "" }, { "docid": "8c692f5e97e3d9f0520e84b24037205b", "score": "0.50304115", "text": "get desserts() {}", "title": "" }, { "docid": "d9c72f5ad0cc318fc2ad94b62ee5a18a", "score": "0.49560854", "text": "function isDoneAllDeliverables() {\n vm.allDeliverablesDone = true;\n for (var i = 0, l = vm.deliverables.length; i < l; i++) {\n if (!vm.deliverables[i].done) {\n vm.allDeliverablesDone = false;\n break;\n }\n }\n }", "title": "" }, { "docid": "f100e6bdb5c255e7b1e4c005450b2525", "score": "0.49470297", "text": "handleLootDistribution (reactionInfo, battle) {\r\n let players = Util.getEffectiveCharacters(this.players).players;\r\n let empty = false;\r\n if (!battle.itemsToDistribute) {\r\n // Battle just finished, generate the listo\r\n battle.itemsToDistribute = [].concat(...battle.graveyard.filter(dead => !dead.controller).map(dead => dead.items));\r\n if (players.length === 1 && battle.itemsToDistribute.length > 0) {\r\n battle.itemsToDistribute.forEach(item => {\r\n item.equipped = false;\r\n item.owner = players[0];\r\n });\r\n players[0].items.push(...battle.itemsToDistribute);\r\n let lootList = Util.formattedList(Util.reduceList(battle.itemsToDistribute.map(item => Util.getDisplayName(item))));\r\n battle.itemsToDistribute = [];\r\n this.send('It looks like you\\'re the only person around, so you get all the loot (' + lootList + ')! Drop what you don\\'t need later.');\r\n empty = true;\r\n } else if (battle.itemsToDistribute.length > 0) {\r\n this.send('Welcome to ***Need or Greed***, the show where bodies are looted, RNG is rampant, and most importantly, the contribution to the previous fight *doesn\\'t matter.*');\r\n this.send('Let\\'s get started!');\r\n } else {\r\n empty = true;\r\n }\r\n } else {\r\n // Reaction comes in, let's see if we need to run the distribution\r\n let {messageReaction, react, user, reactions } = reactionInfo;\r\n if (react === '✅') {\r\n let options = Util.getSelectedOptions(reactions, ['🙆', '🤷', '🙅'], user.id);\r\n if (options.length === 0) {\r\n // No option provided!\r\n this.send(`Please select a roll ${Util.getMention(user.id)}!`);\r\n messageReaction.remove(user);\r\n return;\r\n } else if (options.length > 1) {\r\n // Too many options provided!\r\n this.send(`Too many roll choices ${Util.getMention(user.id)}! Only one pls!`);\r\n messageReaction.remove(user);\r\n return;\r\n } else {\r\n // Let us consume...\r\n const need = reactions.get('🙆').users.keyArray().filter(userId => this.playerIds.includes(userId));\r\n const greed = reactions.get('🤷').users.keyArray().filter(userId => this.playerIds.includes(userId));\r\n const pass = reactions.get('🙅').users.keyArray().filter(userId => this.playerIds.includes(userId));\r\n if (need.length + greed.length + pass.length < players.length) return;\r\n let checkArray = need.length > 0 ? need : greed;\r\n if (checkArray.length === 0) {\r\n this.send(`What? Nobody wants this? Well, I guess ravens can have it then.`);\r\n battle.itemsToDistribute.shift();\r\n } else {\r\n let winner = null;\r\n do {\r\n let chances = checkArray.map(id => Math.random());\r\n let maxChance = null;\r\n let maxChancePos = null;\r\n for (let i = 0; i < chances.length; i++) {\r\n if (maxChance < chances[i]) {\r\n maxChance = chances[i];\r\n maxChancePos = i;\r\n } else if (maxChance === chances[i]) {\r\n maxChancePos = null;\r\n break;\r\n }\r\n }\r\n winner = maxChancePos;\r\n } while (winner === null);\r\n // We have a winner!\r\n let winnerPlayer = players.find(player => player.controller === checkArray[winner]);\r\n this.send(Util.getDisplayName(winnerPlayer) + ' wins! Enjoy!');\r\n let item = battle.itemsToDistribute.shift();\r\n console.log(battle.itemsToDistribute);\r\n item.owner = winnerPlayer;\r\n item.equipped = false;\r\n winnerPlayer.items.push(item);\r\n }\r\n }\r\n } else {\r\n return;\r\n }\r\n }\r\n if (battle.itemsToDistribute.length > 0) {\r\n let itemToGive = battle.itemsToDistribute[0];\r\n this.send('Who wants a *' + Util.getDisplayName(itemToGive) + '?* ' + Util.getNeedOrGreedStartText() +\r\n '\\n\\n*Here\\'s the info:*\\n' + itemToGive.getItemDetails() + '\\n\\n' +\r\n 'Press 🙆 to roll Need, 🤷 to roll Greed, or 🙅 to pass.\\nWhen you\\'re ready, press ✅', ['🙆', '🤷', '🙅', '✅'], true);\r\n } else if (!empty) {\r\n this.send('Show\\'s over folks!');\r\n }\r\n }", "title": "" }, { "docid": "acd509a32682b41222f6c5fb805fd0e3", "score": "0.49273008", "text": "printDept() {\n // get department information\n dbFunctions.viewDepartments()\n // show results in console\n .then((results) => {\n console.table(results)\n startManagement()\n })\n }", "title": "" }, { "docid": "e674b957732a3d3f2c8aa98397ffb454", "score": "0.49208742", "text": "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\t/*for (let i=0; i<prods.length; i+=1) {\n\t\tif (restriction==\"None\"){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price]);\t\n }\n\t\telse if ((restriction == \"Lactose-intolerant Nutallergy and Organic\") && (prods[i].lactoseFree == true && (prods[i].nutFree == true)&& (prods[i].organic== true))){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price]);\n\t\t}\n\t\telse if ((restriction == \"Lactose-intolerant and Nutallergy\") && (prods[i].lactoseFree == true && (prods[i].nutFree == true))){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price]);\n\t\t}\n\t\telse if ((restriction == \"Lactose-intolerant and Organic\") && (prods[i].lactoseFree == true && (prods[i].organic == true))){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price]);\n\t\t}\n\t\telse if ((restriction == \"Nutallergy and Organic\") && (prods[i].organic == true && (prods[i].nutFree == true))){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price]);\n\t\t}\n\t\telse if ((restriction == \"Lactose-intolerant\") && (prods[i].lactoseFree == true)){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price]);\n\t\t}\n\t\telse if ((restriction == \"Nutallergy\") && (prods[i].nutFree == true)){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price]);\n\t\t}\n\t\telse if (restriction == \"Organic\" && prods[i].organic==true){\n\t\t\tproduct_names.push([prods[i].name, prods[i].price]);\t\n\t\t}\n\t}*/\n\tif(restriction[\"None\"]==true){\n\t\tfor (let i=0; i<prods.length; i+=1) {\n\t\t\tproduct_names.push([prods[i].name, prods[i].price]);\t\n\t}}else{\n\t\tfor (let i=0; i<prods.length; i+=1) {\n\t\t\tconsole.log(restriction[\"Organic\"]+ \"==\"+ prods[i].organic+ \" \"+ restriction[\"Nutallergt\"]+ \"==\"+ prods[i].nutFree+ \" \"+ restriction[\"Lactose-intolerant\"]+ \"==\"+ prods[i].lactoseFree+ \" \");\n\t\t\tif((restriction[\"Organic\"]==prods[i].organic|| restriction[\"Organic\"]==false) &&(restriction[\"Nutallergy\"]==prods[i].nutFree|| restriction[\"Nutallergy\"]==false) && (restriction[\"Lactose-intolerant\"]==prods[i].lactoseFree|| restriction[\"Lactose-intolerant\"]==false)){\n\t\t\t\tproduct_names.push([prods[i].name, prods[i].price]);\t\n\t\t\t}\n\t\t}\n\t}\n\treturn product_names.sort(function([a,b], [c,d]){ // method taken from https://stackoverflow.com/a/50415269\n\t\treturn b-d;\n\t});;\n}", "title": "" }, { "docid": "dd79f68dc2741b3434af456fa8fefc0b", "score": "0.49190277", "text": "function viewDeps() {\n connection.query(\"SELECT * FROM department\", (err, results) => {\n if (err) throw err\n console.table(results)\n action()\n })\n}", "title": "" }, { "docid": "77c5263ad97d90806c385c6a3623dc6d", "score": "0.49154228", "text": "function viewAllDepts() {\n connection.query(\n 'SELECT * FROM Department', (err, res) => {\n if (err) {\n console.log(err);\n }\n console.table(res)\n startProgram();\n })\n}", "title": "" }, { "docid": "fe1cc8221468f2accfa2c765956ab750", "score": "0.49059448", "text": "function restrictList(product, restriction, is_organic, type){\n let temp;\n for (let i = 0; i < product.length; i++) {\n for (let j = 0; j < product.length; j++) {\n if (product[i].price < product[j].price) {\n temp = product[i]\n product[i] = product[j]\n product[j] = temp\n }\n }\n }\n let product_names = [];\n if (type==\"all\") {\n if (is_organic == true) {\n for (let i = 0; i < product.length; i += 1) {\n if ((restriction == \"Vegetarian\") && (product[i].vegetarian == true) && (product[i].organic == true)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if ((restriction == \"GlutenFree\") && (product[i].glutenFree == true) && (product[i].organic == true)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if ((restriction == \"VegAGlu\") && (product[i].glutenFree == true) && (product[i].vegetarian == true) && (product[i].organic == true)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if ((restriction == \"None\") && (product[i].organic == true)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n }\n }\n } else {\n for (let i = 0; i < product.length; i += 1) {\n if ((restriction == \"Vegetarian\") && (product[i].vegetarian == true)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if ((restriction == \"GlutenFree\") && (product[i].glutenFree == true)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if ((restriction == \"VegAGlu\") && (product[i].glutenFree == true) && (product[i].vegetarian == true)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if (restriction == \"None\") {\n product_names.push(product[i].name + \" $\" + product[i].price);\n }\n }\n }\n }\n else{\n if (is_organic == true) {\n for (let i = 0; i < product.length; i += 1) {\n if ((restriction == \"Vegetarian\") && (product[i].vegetarian == true) && (product[i].organic == true) &&(product[i].type==type)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if ((restriction == \"GlutenFree\") && (product[i].glutenFree == true) && (product[i].organic == true) &&(product[i].type==type)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if ((restriction == \"VegAGlu\") && (product[i].glutenFree == true) && (product[i].vegetarian == true) && (product[i].organic == true) &&(product[i].type==type)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if ((restriction == \"None\") && (product[i].organic == true) &&(product[i].type==type)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n }\n }\n } else {\n for (let i = 0; i < product.length; i += 1) {\n if ((restriction == \"Vegetarian\") && (product[i].vegetarian == true) &&(product[i].type==type)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if ((restriction == \"GlutenFree\") && (product[i].glutenFree == true) &&(product[i].type==type)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if ((restriction == \"VegAGlu\") && (product[i].glutenFree == true) && (product[i].vegetarian == true) &&(product[i].type==type)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n } else if (restriction == \"None\" &&(product[i].type==type)) {\n product_names.push(product[i].name + \" $\" + product[i].price);\n }\n }\n }\n }\n return product_names;\n}", "title": "" }, { "docid": "b897c8b4db2cc15671b2a0e1cf654a47", "score": "0.49042505", "text": "function listarReceitasPossiveis(receitas,ingredientes){\r\n\r\n var receitasPossiveis = \"\";\r\n\r\n for(var i = 0; i < receitas.length; i++){ // Itera entre as receitas\r\n \r\n var possivel = 0; //Variavel que diz se e possivel ou nao fazer a receita\r\n\r\n for(var j = 0; j < receitas[i].ingredientes.length; j++){ // Itera entre os ingredientes das receitas\r\n for(var k = 0; k < ingredientes.length; k++){ // Itera entre os ingredientes possiveis\r\n\r\n if(receitas[i].ingredientes[j].nome == ingredientes[k].nome){\r\n if(receitas[i].ingredientes[j].quantidade <= ingredientes[k].quantidade) {\r\n possivel++;\r\n }\r\n }\r\n\r\n }//end fork\r\n }//end forj\r\n\r\n if(possivel > 0){receitasPossiveis += receitas[i].nome + \"<br>\";}\r\n\r\n }//end fori\r\n\r\n $(\"#receitasPossiveis\").html(receitasPossiveis);\r\n\r\n}//end listarReceitasPossiveis", "title": "" }, { "docid": "b9ef7461f58529bce449dde48d04d63a", "score": "0.48954666", "text": "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif ((restriction == \"NutFree\") && (prods[i].nutfree == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if ((restriction == \"LactoseFree\") && (prods[i].lactosefree == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if ((restriction == \"Include Baby supplies\") && (prods[i].babysupplies == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t\telse if ((restriction == \"Include carrot\") && (prods[i].lactosefree == true)){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\n\t\telse if (restriction == \"None\"){\n\t\t\tproduct_names.push(prods[i].name);\n\t\t}\n\t}\n\treturn product_names;\n}", "title": "" }, { "docid": "04fb7df205bf94ad7658662bb535498a", "score": "0.48837715", "text": "function restrictListProducts(prods, restriction, organicProduct) {\n\tlet product_names = [];\n\tconsole.log(organicProduct, restriction);\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tvar product = { name: null, price: null };\n\n\t\tif (organicProduct == true && prods[i].organic == true){\n\t\t\tif ((restriction == \"Vegetarian\") && (prods[i].vegetarian == true)){\n\t\t\t\tproduct.name = prods[i].name;\n\t\t\t\tproduct.price = prods[i].price;\n\t\t\t\tproduct_names.push(product);\n\t\t\t}\n\t\t\telse if ((restriction == \"GlutenFree\") && (prods[i].glutenFree == true)){\n\t\t\t\tproduct.name = prods[i].name;\n\t\t\t\tproduct.price = prods[i].price;\n\t\t\t\tproduct_names.push(product);\n\t\t\t}\n\t\t\telse if ((restriction == \"VegetarianANDGlutenFree\") && (prods[i].glutenFree == true && prods[i].vegetarian == true)){\n\t\t\t\tproduct.name = prods[i].name;\n\t\t\t\tproduct.price = prods[i].price;\n\t\t\t\tproduct_names.push(product);\n\t\t\t }\n\t\t\telse if (restriction == \"None\"){\n\t\t\t\tproduct.name = prods[i].name;\n\t\t\t\tproduct.price = prods[i].price;\n\t\t\t\tproduct_names.push(product);\n\t\t\t}\n\t\t}\n\t\telse if (organicProduct == false) {\n\t\t\tif ((restriction == \"Vegetarian\") && (prods[i].vegetarian == true)){\n\t\t\t\tproduct.name = prods[i].name;\n\t\t\t\tproduct.price = prods[i].price;\n\t\t\t\tproduct_names.push(product);\n\t\t\t}\n\t\t\telse if ((restriction == \"GlutenFree\") && (prods[i].glutenFree == true)){\n\t\t\t\tproduct.name = prods[i].name;\n\t\t\t\tproduct.price = prods[i].price;\n\t\t\t\tproduct_names.push(product);\n\t\t\t}\n\t\t\telse if ((restriction == \"VegetarianANDGlutenFree\") && (prods[i].glutenFree == true && prods[i].vegetarian == true)){\n\t\t\t\tproduct.name = prods[i].name;\n\t\t\t\tproduct.price = prods[i].price;\n\t\t\t\tproduct_names.push(product);\n\t\t\t }\n\t\t\telse if (restriction == \"None\"){\n\t\t\t\tproduct.name = prods[i].name;\n\t\t\t\tproduct.price = prods[i].price;\n\t\t\t\tproduct_names.push(product);\n\t\t\t}\n\t\t}\n\t}\n\treturn product_names;\n}", "title": "" }, { "docid": "8cc20f5b551c81bf785eecfc12f956a7", "score": "0.48724782", "text": "function viewDepartmentsBudget() {\n // console.log(`Selecting all departments...\\n`);\n connection.query(`SELECT d.department_name ,sum(r.salary) FROM employees e LEFT JOIN roles r on e.role_id = r.id JOIN ` + `departments d on d.id=r.departmentId where d.department_name !='None' GROUP BY d.department_name `, (err, res) => {\n if (err) throw err;\n // console.log(res);\n console.table(res);\n\n askeQuestions();\n });\n}", "title": "" }, { "docid": "b6ee32f1662dc5e738971baba232903a", "score": "0.48629203", "text": "function viewDept() {\n db.selectAllDepartments()\n .then(([data]) => {\n console.log(`${separator}\\n DEPARTMENTS\\n${separator}`);\n console.table(data);\n console.log(`${separator}\\n`);\n })\n .then(() => {\n promptAction();\n })\n}", "title": "" }, { "docid": "fd8063c3ce308850ee070903ac61fbe9", "score": "0.48530513", "text": "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif ((restriction == \"lactose\") &&(prods[i].LactoseFree == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction == \"noix\") && (prods[i].noixfree == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction == \"vegetarian\")&& (prods[i].vegetarian == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction == \"gluten\") && (prods[i].glutenFree == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction == \"jus\") && (prods[i].type == \"jus\")){\n\t\t product_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction == \"legume\") && (prods[i].type == \"legume\")){\n\t\t product_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction == \"fruit\") && (prods[i].type == \"fruit\")){\n\t\t product_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction == \"laitier\") && (prods[i].type == \"laitier\")){\n\t\t product_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction == \"orga\") && (prods[i].organic == true)){\n\t\t product_names.push(prods[i]);\n\t\t}\n\n\n\t}\n\n\tvar sorted = product_names.sort((a, b) => a.price - b.price);\n\treturn sorted;\n}", "title": "" }, { "docid": "26ee8c41f17caca8d1a526cdf07a6f51", "score": "0.48498046", "text": "reason() {\n // Reason each one\n replacement = subrequirements.map(sub => sub.reason())\n // Keep the satisfied ones\n .filter(sub => sub.satisfied)\n // Merge\n .reduce((acc, sub) => acc.merge(sub));\n return replacement;\n }", "title": "" }, { "docid": "e77f3be2b400d18c04b4df47e3518cb6", "score": "0.48461154", "text": "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif ((restriction.includes(\"nutAllergy\")) && (restriction.includes(\"lactoseIntolerant\")) && (prods[i].lactoseIntolerant == true) && (prods[i].nutAllergy == true) && (prods[i].organic == false)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction.includes(\"lactoseIntolerant\")) && !(restriction.includes(\"nutAllergy\")) && !(restriction.includes(\"organic\")) && (prods[i].lactoseIntolerant == true) && (prods[i].organic == false)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction.includes(\"nutAllergy\")) && !(restriction.includes(\"lactoseIntolerant\")) && (prods[i].nutAllergy == true) && (prods[i].organic == false)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction.includes(\"organic\")) && (prods[i].organic == true)){\n\t\t\tproduct_names.push(prods[i]); \n\t\t}\n\t\telse if (restriction.includes(\"none\")){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t}\n\treturn product_names;\n}", "title": "" }, { "docid": "58581acff3268e5aec934d19f53bd6c5", "score": "0.4841111", "text": "function restrictListProducts(prods, restriction, organic) {\n\trestricted_prods = [];\n\n\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif ((restriction[\"nut-free\"] == true && restriction[\"lactose-free\"] == false) && (prods[i].nut == false)){\n\t\t\t_organicCheck(prods[i],organic);\n\t\t}\n\n\t\telse if ((restriction[\"lactose-free\"] == true && restriction[\"nut-free\"] == false) && (prods[i].lactose == false)){\n\t\t\t_organicCheck(prods[i],organic);\n\t\t}\n\n\t\telse if((restriction[\"lactose-free\"] == true && restriction[\"nut-free\"] == true) && (prods[i].lactose == false && prods[i].nut == false)) {\n\t\t\t_organicCheck(prods[i],organic);\n\t\t}\n\n\t\telse if(restriction[\"none\"] == true){\n\t\t\t_organicCheck(prods[i],organic);\n\t\t}\n\n\t}\n\treturn restricted_prods;\n}", "title": "" }, { "docid": "693f682c7c0da926c1b2852cd8583ac3", "score": "0.48410082", "text": "function viewDepatments() {\n var query = \"SELECT * FROM DEPARTMENTS\";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Name: \" + res[i].name + \"|| ID: \" + res[i].id);\n }\n runManager();\n });\n }", "title": "" }, { "docid": "e05cb815ada1e57c3e681b6daf1628fe", "score": "0.4839892", "text": "function displayProductsByDept() {\n // Query department_id, department_name, over_head_costs, product_sales\n // GROUP BY department_id requires SUM of over_head_costs, product_sales, product_sales - over_head_costs\n // Create alias for temporary column total_profit = over_head_costs - product_sales\n connection.query('SELECT department_id, departments.department_name, over_head_costs, SUM(product_sales), SUM(product_sales)-over_head_costs AS total_profit FROM departments LEFT JOIN products ON departments.department_name=products.department_name GROUP BY department_id', function(err, results) {\n if (err) throw err;\n console.log(\n '\\nWelcome to Bamazon Supervisor View' +\n '\\n-Product Sales by Department-' + '\\n'\n );\n\n // Log query results in table\n console.table(results);\n \n // Call to display supervisor view\n viewSupervisor();\n });\n}", "title": "" }, { "docid": "4b82607e3c38e6f13b617c3ba24c2914", "score": "0.482837", "text": "function viewAllDepts() {\n console.log(\"Showing all departments...\\n\");\n connection.query(\"SELECT * FROM department \", function (err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n });\n}", "title": "" }, { "docid": "4044c0f87f1937ab929c303c946e6d27", "score": "0.48163888", "text": "function restrictListProducts(prods, restrictions) {\n\tvar lactoseFree = false;\n\tvar nutFree = false;\n\tvar organic = false;\n\tif (restrictions.length > 0){\n\t\tfor (i = 0; i < restrictions.length; i++) { \n\t\t\tif (restrictions[i] == \"organic\"){\n\t\t\t\torganic = true;\n\t\t\t}\n\t\t\telse if (restrictions[i] == \"nutFree\"){\n\t\t\t\tnutFree = true;\n\t\t\t}\n\t\t\telse if (restrictions[i] == \"lactoseFree\"){\n\t\t\t\tlactoseFree = true;\n\t\t\t}\n\t\t}\n\t}\n\t\n\tlet product_names = [];\n\t\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif ((lactoseFree == true) && (nutFree == true)&& (organic == true) && (prods[i].lactoseFree == true) && (prods[i].organic == true) && (prods[i].nutFree == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((lactoseFree == true) && (nutFree == true) && (organic == false) && (prods[i].lactoseFree == true) && (prods[i].nutFree == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((lactoseFree == true) && (organic == true) && (nutFree == false) && (prods[i].lactoseFree == true) && (prods[i].organic == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((nutFree == true) && (organic == true) && (lactoseFree == false) && (prods[i].organic == true) && (prods[i].nutFree == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((lactoseFree == false) && (nutFree == true)&& (organic == false) && (prods[i].nutFree == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((lactoseFree == true) && (nutFree == false)&& (organic == false) && (prods[i].lactoseFree == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((lactoseFree == false) && (nutFree == false)&& (organic == false)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((lactoseFree == false) && (nutFree == false)&& (organic == true) && (prods[i].organic == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t}\n\treturn product_names;\n}", "title": "" }, { "docid": "d9ce7c46c46f0202ab8c739c8dd3d21e", "score": "0.48146728", "text": "getCommanditaires() {\n\t\tthis.serviceTournois.getCommanditaires(this.tournoi.idtournoi).then(commanditaires => {\n\t\t\tthis.commanditaires = commanditaires;\n\t\t\tfor (let commanditaire of this.commanditaires) {\n\t\t\t\tthis.getContribution(commanditaire);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "ffd993a5a0bb4be59a9db8f7fd2d8d7b", "score": "0.48099396", "text": "harvestAll() {\n let total = 0;\n this.plotList.forEach((plot, index) => {\n total += this.harvest(index, true);\n });\n if (total > 0) {\n Notifier.notify({ message: `You earned ${total} money from the harvest!`, type: GameConstants.NotificationOption.success });\n }\n }", "title": "" }, { "docid": "b4696b4525c0180a1b64954e7620950d", "score": "0.48003596", "text": "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif(restriction==\"None\"){\n\t\t\tproduct_names.push({name:prods[i].name, price:prods[i].price});\n\t\t}else if(prods[i][restriction]){\n\t\t\tproduct_names.push({name:prods[i].name, price:prods[i].price});\n\t\t}\n\t}\n\tproduct_names.sort((a,b)=>{return a.price - b.price;});\n\treturn product_names;\n}", "title": "" }, { "docid": "8f62ffe5704b93d10f21894c4a87b3cd", "score": "0.47998193", "text": "function restrictListProducts(prods, lactose, nut, organic) {\n\tlet products = [];\n\n\tprods.sort(function(a, b){\n\t\t\treturn a.price - b.price;\n\t})\n\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif (lactose && !prods[i].lactose) continue;\n\t\tif (nut && !prods[i].nutFree) continue;\n\t\tif (organic && !prods[i].organic) continue;\n\t\tproducts.push(prods[i]);\n\n\t}\n\treturn products;\n}", "title": "" }, { "docid": "e264f211217999abc48ef8a575fae637", "score": "0.47967586", "text": "async list(request, response) {\n try {\n const distributors = await distributorsModel.getDistributors()\n\n return response.status(200).json(distributors)\n } catch (error) { \n return response.status(error.status || 500).json(error.message)\n }\n }", "title": "" }, { "docid": "2c9b604b1a550329c9713e631b6d10f4", "score": "0.47962788", "text": "function jogosDaDesenvolvedora(desenvolvedora){\n let jogos = [];\n\n for (let categoria of jogosPorCategoria) {\n for ( let jogo of categoria.jogos ) {\n if (jogo.desenvolvedora === desenvolvedora){\n jogos.push(jogo.titulo)\n } \n }\n }\n console.log(\"Os jogos da \" + desenvolvedora + \" são: \" + jogos)\n}", "title": "" }, { "docid": "ddb5f7c7a03f9bea71d8ec914d84ca5e", "score": "0.47939944", "text": "function consoleTableDept(title, results) {\n\tvar values = [];\n\tfor (var i = 0; i < results.length; i++) {\n\t\tvar resultObject = {\n\t\t\tID: results[i].department_id,\n\t\t\tDepartment: results[i].department_name,\n\t\t\tover_head_costs: \"$\" + results[i].over_head_costs.toFixed(2),\n\t\t};\n\t\tvalues.push(resultObject);\n\t}\n\tconsole.table(title, values);\n}", "title": "" }, { "docid": "d1bfbd6cda25c32c668e93871dc45235", "score": "0.47674295", "text": "static getList() {\n return new Promise(resolve => {\n setTimeout(() => {\n // build some dummy desks list\n let desks = [];\n for (let x = 1; x <= 5; x++) {\n desks.push(new Desk(\n x,\n 'Desk ' + x,\n Utils.getRandomIntInclusive(5, 20)*1000));\n }\n resolve(desks);\n }, 1000);\n });\n }", "title": "" }, { "docid": "01a15c5c20fc005b9cde8e74b494d32f", "score": "0.47640514", "text": "function restrictListProducts(prods, restriction, organic) {\n\tvar product_information = [];\n if (organic){\n\n for (let i=0; i<prods.length; i+=1) {\n if ((restriction == \"lactosenutfree\") && (prods[i].lactosefree) && (prods[i].nutfree) && (prods[i].organic)){\n product_information.push([prods[i].price, prods[i].name]);\n }\n else if ((restriction == \"lactosefree\") && (prods[i].lactosefree) && (prods[i].organic)){\n product_information.push([prods[i].price, prods[i].name]);\n }\n else if ((restriction == \"nutfree\") && (prods[i].nutfree) && (prods[i].organic)){\n product_information.push([prods[i].price, prods[i].name]);\n }\n else if ((restriction == \"None\") && (prods[i].organic)){\n product_information.push([prods[i].price, prods[i].name]);\n }\n }\n return product_information.sort(function sortListProducts(valA, valB) {\n return valA[0] - valB[0];\n });\n\n }else{\n\n for (let i=0; i<prods.length; i+=1) {\n if ((restriction == \"lactosenutfree\") && (prods[i].lactosefree) && (prods[i].nutfree)){\n product_information.push([prods[i].price, prods[i].name]);\n }\n else if ((restriction == \"lactosefree\") && (prods[i].lactosefree)){\n product_information.push([prods[i].price, prods[i].name]);\n }\n else if ((restriction == \"nutfree\") && (prods[i].nutfree)){\n product_information.push([prods[i].price, prods[i].name]);\n }\n else if (restriction == \"None\"){\n product_information.push([prods[i].price, prods[i].name]);\n }\n }\n return product_information.sort(function sortListProducts(valA, valB) {\n return valA[0] - valB[0];\n });\n }\n}", "title": "" }, { "docid": "c84ec6b90667db4f42cf1bc74161fcb6", "score": "0.47639158", "text": "function getProblemFiles()\n{\n\t//clear array\n\tjobsArray = [];\n\n\tvar includedListDiv = document.getElementById(\"includedFilesList\");\n\tvar numPrograms = document.getElementById(\"configurationTable\").rows.length;\n\n\t//add each included problem to array\n\tfor(var i=0;i<includedListDiv.options.length;i++)\n\t{\n\t\tjobsArray.push(includedListDiv.options[i].value);\n\t\t//console.log(includedListDiv.options[i].value);\n\t}\n\tnumPrograms = numPrograms-1;\n\n\t//call function to create task\n\tcreateTask(jobsArray.length*numPrograms);\n}", "title": "" }, { "docid": "44740a2ca5b69f53350b36f19c095a50", "score": "0.4752641", "text": "getEntries() {\n return this.getOrder().pipe(filter((order) => !!(order === null || order === void 0 ? void 0 : order.entries)), map((order) => order.entries.filter((entry) => entry.entryNumber !== -1 && entry.cancellableQuantity > 0)));\n }", "title": "" }, { "docid": "923551ddbca6ddf0a2067eda8a42323b", "score": "0.47508255", "text": "function DrdDistributeElements(distributeElements) {\n distributeElements.registerFilter(function (elements) {\n return filter(elements, function (element) {\n var cannotDistribute = isAny(element, ['dmn:AuthorityRequirement', 'dmn:InformationRequirement', 'dmn:KnowledgeRequirement', 'dmn:Association', 'dmn:TextAnnotation']);\n return !(element.labelTarget || cannotDistribute);\n });\n });\n }", "title": "" }, { "docid": "9bb8b582bb0040ee3373b06835beba2d", "score": "0.47506008", "text": "function viewDepartmentBudget() {\n console.log(\"Selecting all departments...\\n\");\n connection.query(\"SELECT SUM(salary),department.name FROM role JOIN department ON role.department_id = department.id GROUP BY role.department_id;\", function (err, resDep) {\n if (err) throw err;\n console.table(resDep);\n mainPrompt()\n });\n}", "title": "" }, { "docid": "e387887534ae13c54e40eb7af7243b80", "score": "0.4747356", "text": "function getDepartments() {\n\tsocket.emit('departmentRequest',\"\");\n}", "title": "" }, { "docid": "338b648a10a8d56580df095c0c13ba45", "score": "0.47424844", "text": "function listAllTasks() {\n for (var ix = 0; ix < toDoList.length; ix++) {\n console.log(ix + 1 + \": \" + toDoList[ix]);\n }\n}", "title": "" }, { "docid": "caf55e0f48cfa1a3bee7cb4e5136b753", "score": "0.4734127", "text": "function displayNewAssignments() {\n\n\tvar present = getPresent();\n\n\tfor (var i = 0; i < present.length; i++) {\n\t\t$('#new').append('<div class=\"text\">' + '<b>' + present[i].name + '</b>: ' + present[i].dailyList() + '</div>');\n\t\t\t// + ' - ' + present[i].dailyList() + '</div>');\n\t\t// console.log (present[i].dailyList())\n\t}\n}", "title": "" }, { "docid": "d80665aea5c0e621ab9c4dd0fb710f94", "score": "0.47238326", "text": "async display(criteria) {\n const discountAdapter = adapters_1.Adapter.getPromotionAdapter();\n const groups = await Group.find(criteria);\n let updatedDishes = [];\n for (let i = 0; i < groups.length; i++) {\n try {\n updatedDishes.push(discountAdapter.displayGroup(groups[i]));\n }\n catch (error) {\n sails.log(error);\n continue;\n }\n }\n return updatedDishes;\n }", "title": "" }, { "docid": "08976a123f68d8d872723d7c6d6d2b9a", "score": "0.47163755", "text": "function viewProductByDept(){\n //prints the items for sale and their details\n connection.query('SELECT * FROM departments', function(err, res){\n if(err) throw err;\n // cli-table build\n var table = new Table({\n head: [\"Id\", \"Department\", \"Over-Head\" , \"Sales\", \"Profit\"]\n , colWidths: [5, 20, 10, 10, 10]\n });\n \n //push data to table\n for (i = 0; i < res.length; i++) {\n table.push(\n [res[i].department_id, res[i].department_name, (res[i].over_head_costs).toFixed(2), (res[i].total_sales).toFixed(2), (res[i].total_sales - res[i].over_head_costs).toFixed(2)]\n )\n }\n // displays table\n console.log(table.toString());\n isThatAll();\n })\n}", "title": "" }, { "docid": "68341ab14da3203d983d2e3ab16296ef", "score": "0.47115967", "text": "function supplyCheck(supplies) {\n supplies.forEach(item => {\n console.log(`${item} is logged and accounted for.`)\n });\n}", "title": "" }, { "docid": "78976f960f70f34c6abe475af3a93f38", "score": "0.47087875", "text": "function maartjisTask(maartjesTasks) {\n let body = document.getElementById('body');\n let header = document.createElement('h1');\n let textHeader = document.createTextNode('Lists of Maartjies Task befor Filtered ');\n document.innerHTML = document.getElementById('body').appendChild(textHeader);\n let ul = document.createElement('ul');\n body.appendChild(ul);\n\n for (let val of maartjesTasks) {\n let nameli = document.createElement('li');\n\n let listNod1 = document.createTextNode('Task:' + val.name);\n\n ul.appendChild(nameli);\n document.innerHTML = nameli.appendChild(listNod1);\n\n let durationli = document.createElement('li');\n let listNod2 = document.createTextNode('Duration:' + val.duration);\n\n nameli.appendChild(durationli);\n document.innerHTML = durationli.appendChild(listNod2);\n }\n }", "title": "" }, { "docid": "65474f3d6322529fd60bcd88ac297b09", "score": "0.46970305", "text": "function restrictListProducts(prods, restriction) {\r\n\tlet product_names = [];\r\n var restrictions = restriction.split(',');\r\n// console.log(restrictions);\r\n\tfor (let i=0; i<prods.length; i+=1) {\r\n var productVegetarian = prods[i].vegetarian;\r\n var productGlutenFree = prods[i].glutenFree;\r\n var productOrganic = prods[i].organic;\r\n var restrictVeg = false;\r\n var restrictGlu = false;\r\n var restrictOrg = false;\r\n var None = false;\r\n// console.log(restrictions.length);\r\n \r\n if(restrictions.length >= 2){\r\n for(let j = 0; j < restrictions.length; j++){\r\n if(restrictions[j] == \"Vegetarian\") restrictVeg = true;\r\n if(restrictions[j] == \"GlutenFree\") restrictGlu = true;\r\n if(restrictions[j] == \"Organic\") restrictOrg = true;\r\n }\r\n if ((restrictVeg && restrictOrg && restrictGlu) && (productVegetarian && productOrganic && productGlutenFree)){\r\n\t\t\t product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }else if ((restrictGlu && restrictVeg && !restrictOrg) && (productVegetarian && productGlutenFree)){\r\n\t\t\t product_names.push(prods[i].name + \":\" + prods[i].price);\r\n\t\t }else if ((restrictGlu && restrictOrg && !restrictVeg) && (productGlutenFree&& productOrganic)){\r\n\t\t\t product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }else if ((restrictVeg && restrictOrg && !restrictGlu) && (productVegetarian && productOrganic)){\r\n\t\t\t product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }\r\n }else{\r\n if ((restrictions[0] == \"Vegetarian\") && (productVegetarian)){\r\n product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }else if ((restrictions[0] == \"GlutenFree\") && (productGlutenFree)){\r\n product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }else if ((restrictions[0] == \"Organic\") && (productOrganic)){\r\n product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }else if (restrictions[0] == \"None\"){\r\n product_names.push(prods[i].name + \":\" + prods[i].price);\r\n }\r\n }\r\n \r\n\r\n\t}\r\n\treturn product_names;\r\n}", "title": "" }, { "docid": "cc11b6268286c56b9dee930041d2e909", "score": "0.46911672", "text": "function getAvailableDepartments() {\n departmentService.getAllDepartments().then(function(departments) {\n $scope.departments = departments.data;\n })\n }", "title": "" }, { "docid": "cc9a2da90c335c85b4269ffd67a44723", "score": "0.4689103", "text": "async checkUpdates() {\n const updates = [];\n const active = await this.fetch('postbox/deliveries?active=true&rows=20&type=to');\n\n (active.deliveries || []).forEach(({ registrationNumber, statusCode, statusText }) => {\n // Check if we already have this delivery.\n const hasDelivery = this.deliveries.find(d => d.registrationNumber === registrationNumber);\n if (!hasDelivery) {\n updates.push({\n registrationNumber,\n message: `${registrationNumber} discovered`,\n });\n } else if (hasDelivery.statusCode !== statusCode) {\n updates.push({\n registrationNumber,\n message: `${registrationNumber} is now ${statusText}`,\n });\n }\n });\n\n return updates;\n }", "title": "" }, { "docid": "f422ed00247e3555bf4267c37bcbe73a", "score": "0.46875766", "text": "deliveries() {\n return store.deliveries.filter(\n function(delivery) {\n return delivery.neighborhoodId === this.id;\n }.bind(this));\n }", "title": "" }, { "docid": "777212382855b4428ba43f54ff1fc573", "score": "0.46765077", "text": "function restrictListProducts(prods, restriction) {\r\n\tlet product_names = [];\r\n\tfor (let i=0; i<prods.length; i+=1) {\r\n\t\tprods.sort(function(a, b){return a.price - b.price}); //sort product list by price\r\n\t\tif ((restriction == \"Lactose\") && (prods[i].lactoseF == true)){\r\n\t\t\tproduct_names.push(prods[i].name);\r\n\t\t}\r\n\t\telse if ((restriction == \"Nuts\") && (prods[i].nutsF == true)){\r\n\t\t\tproduct_names.push(prods[i].name);\r\n\t\t}\r\n\t\telse if ((restriction == \"Organic\") && (prods[i].org == true)){\r\n\t\t\tproduct_names.push(prods[i].name);\r\n\t\t}\r\n\t\telse if (restriction == \"None\"){\r\n\t\t\tproduct_names.push(prods[i].name);\r\n\t\t}\r\n\t}\r\n\treturn product_names;\r\n}", "title": "" }, { "docid": "90827cde977459e4516987055f085879", "score": "0.46753767", "text": "function LoadDistributionByAnswer(){\n\t\n\tfor (var i = 0; i < answers.length;i++){\n\t\tif (answers[i].SelectedAnswer != null)\n\t\t{\n\t\t\tvar answerid = answers[i].SelectedAnswer.Id;\n\t\t\t\n\t\t\t$.get( \"datalayer.php\", { task: \"LoadDistributionByAnswer\", id: answerid,language: SystemLanguage} )\n\t\t\t\t.done(function( data ) {\t\n\t\t\t\t\tvar obj = JSON.parse(data);\n\t\t\t\t\tfor (var x = 0; x < obj.length;x++){\n\t\t\t\t\t\tvar found = false;\n\t\t\t\t\t\tfor (var y = 0; y < distros.length;y++){\n\t\t\t\t\t\t\tif (distros[y].Name == obj[x].Name){\n\t\t\t\t\t\t\t\tdistros[y].ChoosedBy++;\n\t\t\t\t\t\t\t\tif (distros[y].ChoosedByQuestion.length == 0){\n\t\t\t\t\t\t\t\t\tdistros[y].ChoosedByQuestion = [];\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdistros[y].ChoosedByQuestion.push(answers[i]);\n\t\t\t\t\t\t\t\tfound = true;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!found){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tobj[x].ChoosedBy = 1;\n\t\t\t\t\t\t\tif (obj[x].ChoosedByQuestion.length == 0){\n\t\t\t\t\t\t\t\t\tobj[x].ChoosedByQuestion = [];\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tobj[x].ChoosedByQuestion.push(answers[i]);\n\t\t\t\t\t\t\tdistros.push(obj[x]);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\tSortDistributionsByRank();\n\t\t\t\t\tDisplayDistributions();\n\t\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n\t\n}", "title": "" }, { "docid": "2c053f81215e9e3f35ecea1afda7362a", "score": "0.46710488", "text": "function calculCommission () {\n for (var i = 0; i < deliveries.length; i++) {\n var commission = deliveries[i].price * 0.3;\n deliveries[i].commission.insurance = commission / 2;\n deliveries[i].commission.treasury = Math.floor(deliveries[i].distance/500) + 1\n deliveries[i].commission.convargo = commission - deliveries[i].commission.insurance - deliveries[i].commission.treasury\n }\n}", "title": "" }, { "docid": "2305ae35027df22c582992b53b4fe00f", "score": "0.46666783", "text": "meals() {\n return this.deliveries().map(function(delivery) {\n return delivery.meal();\n });\n }", "title": "" }, { "docid": "56b808b614dc2c872b7a3f60e93c3f92", "score": "0.46663857", "text": "meals() {\n return this.deliveries().map(delivery => {\n return delivery.meal();\n });\n }", "title": "" }, { "docid": "abf46d3d72dc3d43173b178e4de03ff0", "score": "0.4665331", "text": "function departmentList() {\n\n\t\t// empty array to store the department names into\n\t\tvar department_list = [];\n\n\t\t// store the query string into a variable to pass to connection.query()\n\t\tvar query = 'SELECT DepartmentName FROM Departments';\n\t\t\n\t\t// grab the department names\n\t\tconnect.connection.query(query, function(err, data) {\n\t\t\t\n\t\t\t// if error, throw error\n\t\t\tif (err) throw err;\n\n\t\t\t// loop through each department name returned from data\n\t\t\tvar i;\n\t\t\tvar data_length = data.length;\n\t\t\tfor (i = 0; i < data_length; i++) {\n\t\t\t\t\n\t\t\t\t// push each department name into the department_list array\n\t\t\t\tdepartment_list.push(data[i].DepartmentName);\n\n\t\t\t} // end for loop\n\n\t\t\t// call addNewProduct and pass the completed department_list array\n\t\t\taddNewProduct(department_list);\n\n\t\t}); // end connect.connection.query()\n\n\t} // end departmentList()", "title": "" }, { "docid": "1df1309f07367e2c484b35025e3365a0", "score": "0.46593732", "text": "function sendMails(){\n\t\t//get watched products\n WatchedProduct.find({}, function(err, watched_products){\n \tif(err){\n \t\tconsole.log(\"couldnt get watched products from db\");\n \t}else{\n \t\t//get products\n \t\tProduct.find({}, function(err2, products){\n \t\t\tif(err2){\n \t\t\t\tconsole.log(\"couldnt get products from db\");\n \t\t\t}else{\n \t\t\t\tfor(wprod in watched_products){\n wprod = watched_products[wprod];\n for(prod in products){\n prod = products[prod];\n if(prod.sid === wprod.sid){\n \tif(wprod.notifications === 'enabled' && parseFloat(wprod.threshold) >= parseFloat(prod.price)){\n \t\tsendNotif(wprod,prod);\n \t\tbreak;\n \t}\n }\n }\n }\n \t\t\t}\n \t\t});\n \t}\n });\n\t}", "title": "" }, { "docid": "e4b075fb1f9e0bbab8e7bbdaf51be443", "score": "0.4659315", "text": "function getProblem() {\n let problemNum = id(\"problem-number\").value;\n let url = BASE_URL + \"problem/\" + problemNum;\n fetch(url)\n .then(checkStatus)\n .then(JSON.parse)\n .then(createDownload)\n .catch(console.log); // use console.log or replace with more user-friendly error function\n }", "title": "" }, { "docid": "05187f0c351d9b52619fbe236de92241", "score": "0.46529534", "text": "function getTaskList(indice) \n{\n RMPApplication.debug(\"begin getTaskList\");\n c_debug(dbug.task, \"=> getTaskList\");\n id_index.setValue(indice);\n var query = \"parent.number=\" + var_order_list[indice].wo_number;\n\n var options = {};\n var pattern = {\"wm_task_query\": query};\n c_debug(dbug.task, \"=> getTaskList: pattern = \", pattern);\n id_get_work_order_tasks_list_api.trigger(pattern, options, task_ok, task_ko);\n RMPApplication.debug(\"end getTaskList\");\n}", "title": "" }, { "docid": "46b2ce8d47c437537f81e5d39c942d20", "score": "0.46335316", "text": "function makeProblems () {\n\tpartialProblems = new AProblem().problems;\n\tfor (var p in partialProblems) {\n\t\tfor (var l in partialProblems[p].steps) {\n\t\t\tpartialProblems[p].steps[l].droppedpremises = [];\n\t\t\tpartialProblems[p].steps[l].premisesdropped = 0;\n\t\t\tpartialProblems[p].steps[l].ruledropped = false;\n\t\t\tpartialProblems[p].steps[l].justified = false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "eb9551dc0c7bc64485a22f97eb0942b3", "score": "0.46108153", "text": "function gather_cpan_dependents(dist) {\n requestCrossDomain( 'http://deps.cpantesters.org/depended-on-by.pl?dist=' + escape(dist), function(resp) {\n num = '0';\n if ( resp ) {\n num = resp.split('<li>').length-1;\n }\n dependent_counts[dist] = num;\n add_dependents_to_page(dist);\n num_dists_fetched += 1;\n if ( num_dists_fetched == num_dists ) {\n show_top_dists();\n }\n });\n}", "title": "" }, { "docid": "19a8c6eddb6f6bff01c6af0fef019d7b", "score": "0.46099943", "text": "function viewSalesbyDept () {\n connection.query(\"SELECT department_name FROM departments\", function(err, res) {\n if (err) throw err;\n\n var departments = [];\n for(i in res) {\n join = `SELECT departments.department_name, departments.over_head_costs, SUM(product_sales) as 'total_sales'\n FROM departments INNER JOIN products \n ON departments.department_name = products.department_name\n WHERE departments.department_name = '${res[i].department_name}'; \n `\n\n connection.query(join, function(err, res2) {\n total_profit = res2[0].total_sales - res2[0].over_head_costs;\n salesInfo = new DepartmentSales(res2[0].department_name, res2[0].over_head_costs, res2[0].total_sales, total_profit);\n departments.push(salesInfo);\n console.table(salesInfo);\n });\n }\n });\n}", "title": "" }, { "docid": "130df198597be63340f17266e3b36a38", "score": "0.4608991", "text": "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\n\t\t\t\n\tlet lactoseFree = document.getElementById(\"lactoseIntolerant\");\n\t\n\tlet Nut = document.getElementById(\"nutFree\");\n\n\tlet isOrganic = document.getElementById(\"organic\");\n\n\tlet isHealthy = document.getElementById(\"healthy\");\n\n\tlet goodForWeightLoss = document.getElementById(\"weightLoss\");\n\n\n\tif(lactoseFree.checked) {\n\t\tproduct_names = product_names.filter(product_names => product_names.lactoseIntolerant);\n\n\t}\n\n\tif(Nut.checked) {\n\t\tproduct_names = product_names.filter(product_names => product_names.nutFree);\n\n\t}\n\n\tif(isOrganic.checked) {\n\t\tproduct_names = product_names.filter(product_names => product_names.organic);\n\n\t}\n\n\tif(isHealthy.checked) {\n\t\tproduct_names = product_names.filter(product_names => product_names.healthy);\n\n\t}\n\n\tif(goodForWeightLoss.checked) {\n\t\tproduct_names = product_names.filter(product_names => product_names.weightLoss);\n\n\t}\n\n\t\t\t\n\t// Sort the array by price so that the items show in price order\n\n\tproduct_names.sort(function(a, b){\n\t\treturn a.price - b.price\n\t});\n\t\n\n\t\n\treturn product_names;\n}", "title": "" }, { "docid": "a08728cb3c7be197779dbba23859db94", "score": "0.45914137", "text": "function seeAllDepartments(){\n //query to see all departments on department table\n db.viewAllDepartments().then(([res]) => {\n console.table(res)\n loadMainPrompt();\n });\n}", "title": "" }, { "docid": "c8de6de6721b4418d569e94673871222", "score": "0.45898393", "text": "dump() {\n const prereqs = this._makePrereqs();\n const allCellIds = Object.keys(prereqs);\n const nCells = allCellIds.length;\n let cellIds0 =\n\t allCellIds.\n\t filter(id => prereqs[id].length === 0).\n\t sort();\n const sortedIds = [];\n const doneIds = new Set();\n while (sortedIds.length < nCells) {\n let cellIds1 = [];\n for (const cellId of cellIds0) {\n\tdoneIds.add(cellId);\n\tsortedIds.push(cellId);\n\tconsole.assert(this._cells[cellId]);\n\tfor (const dependentId of this._cells[cellId].dependents) {\n\t if (prereqs[dependentId]) {\n\t console.assert(this._cells[cellId]);\n\t const dependentCell = this._cells[dependentId];\n\t let hasPrereqs = true;\n\t for (const prereq of prereqs[dependentId]) {\n\t if (!doneIds.has(prereq)) { hasPrereqs = false; break; }\n\t }\n\t if (hasPrereqs) cellIds1.push(dependentId);\n\t }\n\t} //for (const dependentId...)\n } //for (const cellId of cellIds0)\n cellIds0 = cellIds1.sort();\n } //while\n return sortedIds.map(id => [ id, this._cells[id].formula ]);\n }", "title": "" }, { "docid": "f254ad6d2ae46e4905fd0f0fb4d1bd81", "score": "0.45800498", "text": "function maartjisFilteredTask(earnings) {\n let body = document.getElementById('body');\n let header = document.createElement('h1');\n let textHeader = document.createTextNode('Lists of Maartjies Task After Filtered ');\n document.innerHTML = document.getElementById('body').appendChild(textHeader);\n let ul = document.createElement('ul');\n body.appendChild(ul);\n\n for (let val of earnings) {\n let nameli = document.createElement('li');\n\n let listNod1 = document.createTextNode('Task:' + val.name);\n\n ul.appendChild(nameli);\n document.innerHTML = nameli.appendChild(listNod1);\n\n let durationli = document.createElement('li');\n let listNod2 = document.createTextNode('Duration:' + val.duration);\n\n nameli.appendChild(durationli);\n document.innerHTML = durationli.appendChild(listNod2);\n }\n }", "title": "" }, { "docid": "fa4be2dbb5df491fc2ee7666fccd0797", "score": "0.45772088", "text": "function portlist() {\n\n var port = document.getElementById(\"portfolio\");\n var showt = document.getElementById(\"showtime\");\n port.removeChild(showt);\n var div = appendElementChild(\"div\", port, \"accomplish\");\n var dl = appendElementChild(\"dl\", div);\n\n // Build accomplishment listing.\n if ( accomplishMy !== null) {\n var i = 0;\n do {\n\n var dt = appendElementChild(\"dt\", dl);\n dt.innerHTML = accomplishMy[i].dt;\n var dd = appendElementChild(\"dd\", dl);\n dd.innerHTML = accomplishMy[i].dd;\n appendBreakChild(2, dl);\n i++;\n\n } while ( i < accomplishMy.length);\n\n }\n\n return true;\n}", "title": "" }, { "docid": "8309220453376036af5b2369f57f4063", "score": "0.45761475", "text": "function getPlannerItems() {\n\n\tvar items = \"\";\n\n\tfor( var i = 0; i<mealSchedule.length; i++ ) {\n\t\n\t\tif( mealSchedule[i] != undefined ) {\n\t\t\n\t\t\tfor( var k = mealSchedule[i].length-1; k>=0; k-- ) {\n\t\t\t\n\t\t\t\tif ( items == \"\" ) {\n\t\t\t\t\titems = items + i + \",\" + mealSchedule[i][k].servingSize + \",\" + mealSchedule[i][k].id\n\t\t\t\t\t} else {\n\t\t\t\t\titems = items + \";\" + i + \",\" + mealSchedule[i][k].servingSize + \",\" + \n\t\t\t\t\t\tmealSchedule[i][k].id;\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\t} //end of for loop\n\t\t\t\n\t\t\n\t\t\t} //end of if statement\n\t\n\t\t} //end of for loop\n\n\treturn items;\n\n\t} //end of function", "title": "" }, { "docid": "669987923e7c8cf4b017da98cb8d5368", "score": "0.45733944", "text": "function deductibleDescription() { \n return gapPlanData.description();\n}", "title": "" }, { "docid": "0736af3d9c1bd29312f223f6e7339bfd", "score": "0.45716438", "text": "process() {\n var schoolsWithDepartments = await(services.school.listInstances()),\n preparedDepartments = this.findNecessary_(schoolsWithDepartments);\n\n var departmentsGrades = this.convertStages_(preparedDepartments);\n\n await(this.updateDb_(departmentsGrades));\n\n // await(this.deleteUnnecessaryDepartments_());\n }", "title": "" }, { "docid": "f5b9f3e6209fff8a310a3f796f6f6919", "score": "0.45701638", "text": "function jogosDaRespawn(){\n let jogos = [];\n\n for (let categoria of jogosPorCategoria) {\n for ( let jogo of categoria.jogos ) {\n if (jogo.desenvolvedora == \"Respawn Entertainment\"){\n jogos.push(jogo.titulo)\n } \n }\n }\n console.log(\"Os jogos da Respawn Entertainment são \" + jogos)\n}", "title": "" }, { "docid": "024e68bbb8e1a6f0a2946993de9ca51d", "score": "0.45631203", "text": "function deptList() {\n return connection.query(\"SELECT id, dept_name FROM departments\");\n}", "title": "" }, { "docid": "b622dedf203f58601ab1089566b7b1b4", "score": "0.45572117", "text": "list_possibles() {\n let factor = 1;\n\n this.nodes.forEach(node => {\n if (node.solved) return;\n factor = factor * node.possibles.length;\n console.log(`${node.index} (${node.possibles.length}): ${node.possibles}`);\n });\n\n console.log(factor);\n }", "title": "" }, { "docid": "c33467fb56dc7f7990edad6a8e8e8174", "score": "0.45538336", "text": "function findProduct() {\n var tally = value(typeBtns) + value(problemBtns);\n compare(tally);\n checkPorosity();\n}", "title": "" }, { "docid": "cb29efc481c35a58416912f58ebd0312", "score": "0.45490307", "text": "deliveries() {\n return store.deliveries.filter(delivery => {\n return delivery.mealId == this.id;\n });\n }", "title": "" }, { "docid": "e03e97806e4b0ac0620cac18af73da62", "score": "0.4545969", "text": "listarPendientesCompletados (completado=true){\n\n //Arreglos para diferenciar tareas completas de pendientes \n const listadoCompletas=[];\n const listadoPendientes=[];\n\n\n //recorridos del listado arreglado \n this.listadoArr.forEach((tarea)=>{\n\n //destructuracion de la tarea, lo que necesito\n const {descripcion, completadoEn} = tarea;\n\n //dependiendo del estado de las tareas las agrego a los arreglos establecidos para cada caso\n (completadoEn)\n ? listadoCompletas.push(tarea)\n : listadoPendientes.push(tarea);\n })\n\n //Separar si quiero ver las completadas o las pendientes\n if(completado){\n\n console.log('');\n\n //recorrido e impresion de las tareas completadas\n listadoCompletas.forEach((tareasCompletadas,i)=>{\n const indice = `${i+1}.`.green;\n const {descripcion, completadoEn} = tareasCompletadas;\n console.log(`${indice} ${descripcion} :: ${completadoEn.green}`);\n })\n } else {\n\n console.log('');\n\n //recorrido e impresion de las tareas pendietes \n listadoPendientes.forEach((tareasPendientes,i)=>{\n const indice = `${i+1}.`.green;\n const {descripcion, completadoEn} = tareasPendientes;\n console.log(`${indice} ${descripcion} :: ${'Pendiente'.red}`);\n })\n }\n }", "title": "" }, { "docid": "9091b95727a16de38a143ca58890a5b4", "score": "0.45366836", "text": "function affichageSolutions()\n\t{\n\t var i = null;\n\t var j = null;\n\t \n\t document.write('<br /><table border=\"1\">');\n\t \n\t for(i = 0; i < this.solutions.length; i++)\n\t {\n document.write('<tr>');\n\t for(j = 0; j < this.solutions[i].length; j++)\n\t {\n\t document.write('<td>'+this.solutions[i][j]+'</td>');\n\t }\n\t document.write('</tr>');\n\t }\n\t}", "title": "" }, { "docid": "7d7961182e4cb4db262f7ba7c2e7bc95", "score": "0.4534283", "text": "distribute(amount, branches) {\n\t\t\tvar remaining = 100;\n\t\t\tvar remainingAmount = amount;\n\n\t\t\tvar distributions = [];\n\n\t\t\tvar step, distribution;\n\t\t\tfor (step = 0; step < branches; step++) {\n\t\t\t\t// First Distibution\n\t\t\t\tif(step == 0) {\n\t\t\t\t\tdistribution = $j.dice(\"roll\", \"eventInterval\", \"exploding_1\");\n\t\t\t\t\tremaining = remaining - distribution;\n\t\t\t\t} else if(step == (branches-1)) {\n\t\t\t\t\t// Last Distribution\n\t\t\t\t\tdistribution = remaining;\n\t\t\t\t} else {\n\t\t\t\t\tdistribution = random([0, remaining])\n\t\t\t\t\tremaining = remaining - distribution;\n\t\t\t\t}\n\n\t\t\t\tvar distributionAmount;\n\t\t\t\tif(step == (branches-1)) {\n\t\t\t\t\tdistributionAmount = remainingAmount;\n\t\t\t\t} else {\n\t\t\t\t\tdistributionAmount = Math.floor(remainingAmount*(distribution/100))\n\t\t\t\t\tremainingAmount = remainingAmount - distributionAmount;\n\t\t\t\t}\n\n\t\t\t\tdistributions.push(distributionAmount);\n\t\t\t}\n\n\t\t\treturn distributions;\n\t\t}", "title": "" }, { "docid": "4662e134dbf733808060311a9ecfa586", "score": "0.45321044", "text": "function viewDepartments(){\n connection.query(queryList.deptList, function(err, res){\n if(err) throw err;\n console.table(res);\n startQ();\n })\n\n}", "title": "" }, { "docid": "440df9d99efeae416847d4e8f5211c9a", "score": "0.4522673", "text": "_makePrereqs() {\n const prereqCells =\n Object.values(this._cells).filter(cell => !cell.isEmpty());\n const prereqs = Object.fromEntries(prereqCells.map(c => [c.id, []]));\n for (const cell of prereqCells) {\n for (const d of cell.dependents) {\n\tif (prereqs[d]) prereqs[d].push(cell.id);\n }\n }\n return prereqs;\n }", "title": "" }, { "docid": "60e28bb1c3498615310eada9d401b778", "score": "0.45223248", "text": "async function collectCasesSubcasesAndDecisionmakingFlows(distributor) {\n const properties = [\n [ '^besluitvorming:genereertAgendapunt', 'besluitvorming:vindtPlaatsTijdens' ], // subcase\n [ '^besluitvorming:genereertAgendapunt', 'besluitvorming:vindtPlaatsTijdens', '^dossier:doorloopt' ], // decisionmaking-flow\n [ '^besluitvorming:genereertAgendapunt', 'besluitvorming:vindtPlaatsTijdens', '^dossier:doorloopt', '^dossier:Dossier.isNeerslagVan' ], // case\n ];\n const path = properties.map(prop => prop.join(' / ')).map(path => `( ${path} )`).join(' | ');\n\n const relatedQuery = `\n PREFIX besluitvorming: <https://data.vlaanderen.be/ns/besluitvorming#>\n PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>\n PREFIX dossier: <https://data.vlaanderen.be/ns/dossier#>\n PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>\n INSERT {\n GRAPH <${distributor.tempGraph}> {\n ?s a ?type ;\n ext:tracesLineageTo ?agenda .\n }\n } WHERE {\n GRAPH <${distributor.tempGraph}> {\n ?agendaitem a besluit:Agendapunt ;\n ext:tracesLineageTo ?agenda .\n }\n GRAPH <${distributor.sourceGraph}> {\n ?agendaitem ${path} ?s .\n ?s a ?type .\n }\n }`;\n await updateTriplestore(relatedQuery);\n}", "title": "" }, { "docid": "4be54132a7abf09c66d3d5bf65afbf26", "score": "0.45169878", "text": "function afficher() {\n console.log (\"\\nVoici la liste de tous vos contacts :\");\n Gestionnaire.forEach(function (liste) {\n\n console.log(liste.decrire()); // on utilise la méthode decrire créé dans nos objets\n\n }); // la parenthese fermante correspond à la la parenthese de la méthode forEach()\n\n}", "title": "" }, { "docid": "9b452dea8fbc43fcc92c08b1b7aa3fd8", "score": "0.45144224", "text": "function viewDepartments(){\n // Select all data from the departmenets table\n connection.query(`SELECT * FROM department_table`, (err, res) => {\n // If error log error\n if (err) throw err;\n // Display the data in a table format...\n console.table(res);\n // Run the task completed function\n taskComplete();\n })\n }", "title": "" }, { "docid": "ac1319bee62ad296963ab81df56aedc6", "score": "0.45136982", "text": "function enviarListado(){\n var ui = SpreadsheetApp.getUi();\n var categoriasNombres = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(\"Categorias\").getRange(\"B2:B\").getValues().filter(String);\n var nombreProducto = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(\"Productos\").getRange(\"B2:B\").getValues().filter(String);\n var costoProducto = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(\"Productos\").getRange(\"D2:D\").getValues().filter(String);\n var idCategorias = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(\"Productos\").getRange(\"C2:C\").getValues().filter(String);\n var data = 'Categoria Producto Costo' \n\n for(i = 0; i < nombreProducto.length; i++){\n var separator = '----------------'\n if(parseInt(idCategorias[i]) == 1){\n data = data + '\\n' + categoriasNombres[0] + ' ------- ' + nombreProducto[i] + separator.slice(nombreProducto[i].toString().length, -1) + costoProducto[i] \n } else if(parseInt(idCategorias[i]) == 2){\n data = data + '\\n' + categoriasNombres[1] + ' -- ' + nombreProducto[i] + separator.slice(nombreProducto[i].toString().length, -1) + costoProducto[i]\n }\n }\n var prompt = ui.prompt(\"Enviar Listado por e-mail\", \"Ingrese e-mail de destino\", ui.ButtonSet.OK_CANCEL)\n var mail = prompt.getResponseText().toString();\n var button = prompt.getSelectedButton();\n \n if(button == ui.Button.OK){\n GmailApp.sendEmail(mail, \"Lista de Productos\", data)\n ui.alert(\"Lista enviada!\")\n }\n}", "title": "" }, { "docid": "a45429b617bf61ce5995e5df2ac3e288", "score": "0.45095068", "text": "deliveries(){\n return store.deliveries.filter(delivery=>{\n return delivery.mealId === this.id\n })\n }", "title": "" }, { "docid": "a900298880baa650d6d07d237ed14cb0", "score": "0.44983593", "text": "async sendBatchOrder(quantity, stocks, side){\r\n var prom = new Promise(async (resolve, reject) => {\r\n var incomplete = [];\r\n var executed = [];\r\n var promOrders = [];\r\n stocks.forEach(async (stock) => {\r\n promOrders.push(new Promise(async (resolve, reject) => {\r\n if(!this.blacklist.has(stock)){ // Checks if the stock is not blacklisted, if it is not black listed create new order ticket\r\n var promSO = this.submitOrder(quantity, stock, side);\r\n await promSO.then((resp) => {\r\n if(resp) executed.push(stock);\r\n else incomplete.push(stock);\r\n resolve();\r\n });\r\n }\r\n else resolve();\r\n }));\r\n });\r\n await Promise.all(promOrders).then(() => {\r\n resolve([incomplete, executed]);\r\n });\r\n });\r\n return prom;\r\n }", "title": "" }, { "docid": "90933cf594513f3b71135450a9cbce15", "score": "0.44965824", "text": "function displayDepartments() {\n var deptArr = [];\n connection.query(\"SELECT d.department_id, d.department_name, d.over_head_costs, SUM(p.sales) AS product_sales, (SUM(p.sales)-d.over_head_costs) AS total_profit FROM departments AS d INNER JOIN products AS p ON department_name = p.department GROUP BY department_id ORDER BY department_id ASC\", \n function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n var tempArry =\n {\n department_id: res[i].department_id,\n department_name: res[i].department_name,\n over_head_costs: res[i].over_head_costs,\n product_sales: res[i].product_sales,\n total_profit: res[i].total_profit\n }\n deptArr.push(tempArry);\n };\n console.table('\\nBamazon Departments', deptArr);\n console.log(\"-----------------------------------------------------\\n\");\n inquireForm();\n });\n}", "title": "" }, { "docid": "58b5ed10d2b14561c9727bf2921a6a73", "score": "0.4492562", "text": "function getBigParties(){\n btnFeedback('big')\n resultParties = [];\n resultParties = parties.filter(party => {\n return party.size >= bigParty;\n })\n}", "title": "" }, { "docid": "6bb527b2fd391d89a14e11250510828a", "score": "0.44903743", "text": "function getProcessResults() {\n StatusService.stopWaiting();\n getFlowRows();\n if ( $scope.paramGrid.dissipation) {\n $scope.compositionFlow = CompositionFlowService.get($scope.process.compositionFlowID);\n $scope.paramGrid.dissipation.extractData();\n }\n getLciaResults();\n }", "title": "" }, { "docid": "2a760a9343f568829a94df751cdb5938", "score": "0.44875503", "text": "getReport() {\n let list = [];\n for (let index = 0; index < this.objectGenerators.length; index++) {\n const objectGenerator = this.objectGenerators[index];\n list.push(objectGenerator.toString());\n }\n return list;\n }", "title": "" }, { "docid": "6c3e9064417ec88ac13cf1a6196c770c", "score": "0.4480171", "text": "function obtenerEquiposDisponibles(){\n wizardFactory.equipos()\n .success(function (data) {\n vm.equipos = data;\n })\n .error( errorHandler ); \n }", "title": "" }, { "docid": "460eae5d628d44ca26839e649cdb48b9", "score": "0.44799665", "text": "function getBiggerParties() {\n checkSelectParty('bigsger')\n topParties = [];\n subjects.forEach(subjectInit);\n //Hij filter hier de grote partijen\n topParties = parties.filter(function (party) {\n return party.size >= bigParty;\n })\n\n console.log(topParties)\n}", "title": "" }, { "docid": "d4742674adfdd1658fe19a4b9ce8e682", "score": "0.44788662", "text": "function viewBudget() {\n connection.query(\n \"SELECT d.name AS 'Department', SUM(r.salary) AS 'Budget' FROM employee e INNER JOIN role r ON r.id = e.role_id INNER JOIN department d ON d.id = r.department_id GROUP BY Department;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (let i = 0; i < res.length; i++) {\n let empObj = [res[i].Department, res[i].Budget];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" ------------------------------------ \\n ALL COMPANY DEPARTMENTS & BUDGET UTILIZED \\n ------------------------------------\"\n );\n console.table([\"Department\", \"Budget\"], tableResults);\n actions();\n }\n );\n}", "title": "" }, { "docid": "b2cedb8bfe12686369bbbcdacd771cf2", "score": "0.44787467", "text": "function budgetByDept() {\n connection.query(\"SELECT * FROM department\", function (err, res) {\n if (err) throw err;\n inquirer.prompt([\n {\n type: \"list\",\n name: \"deptid\",\n message: \"which department budget you would like calculate? \",\n choices: res.map(dept => {\n return {\n name: dept.name,\n value: dept.id\n }\n })\n }\n\n ]).then((answers) => {\n\n var query = `SELECT d.name AS department,SUM(r.salary) as budgetbydept\n FROM employee AS e INNER JOIN role AS r on e.role_id = r.id INNER JOIN department as d on r.department_id = d.id\n where d.id = ?;`\n\n connection.query(query, [answers.deptid], function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n main();\n\n });\n })\n\n })\n}", "title": "" }, { "docid": "f02b30119002ec2b3264e847cabec2c7", "score": "0.447614", "text": "getEfforts () {\n return this.db.many(sql.getEfforts)\n }", "title": "" }, { "docid": "35304da76c2f6a84079dfbbda4d1ccfe", "score": "0.4474684", "text": "function getTaskLists() {\n\n}", "title": "" }, { "docid": "28907100775f594acea3ccb5c52f2740", "score": "0.4474397", "text": "function displayAllDepartments() {\n let query = \"SELECT * FROM department \";\n connection.query(query, (err, res) => {\n if (err) throw err;\n\n console.log(\"\\n\\n ** Full Department list ** \\n\");\n console.table(res);\n });\n}", "title": "" } ]
14bfa04775a48baa67dcdb1c3933e140
now we need a function which completes 1 frame of animation if dir.up and dir.left are true, I would add speed to those directions
[ { "docid": "958d231012b5259e389e22f726257c6d", "score": "0.0", "text": "function movement(){\n \n //check all directions and add/subtract to top and left\n var newtop = 0;\n var newleft = 0;\n \n if( dir.up == true ){\n newtop -= speed; \n }\n if( dir.down == true ){\n newtop += speed; \n }\n if( dir.left == true ){\n newleft -= speed; \n }\n if( dir.right == true ){\n newleft += speed; \n }\n \n //add newtop and current top together\n var shiptop = $('#ship').position().top;\n var bheight = $(window).height();\n \n if( shiptop + newtop < 0 || shiptop + newtop + 50 > bheight ){\n //shiptop+newleft cant be less than 0 or greater than browserheight\n newtop = 0; //dont move in up/down direction\n }\n \n //add newtop and current top together\n var shipleft = $('#ship').position().left;\n var bwidth = $(window).width();\n \n if( shipleft + newleft < 0 || shipleft + newleft + 50 > bwidth ){\n //shiptop+newleft cant be less than 0 or greater than browserheight\n newleft = 0; //dont move in up/down direction\n }\n \n $('#ship').css({top: '+='+newtop, left: '+='+newleft});\n \n \n } //end movement()", "title": "" } ]
[ { "docid": "5ae93bcf1ce784ca18e428710e65efc2", "score": "0.7240349", "text": "_moved(dir) {\n\t\tlet [px, py, pz] = this.animatedSprite.sprite.gamePos\n\t\tthis.arkona.blocks.checkRoof(px - 1, py - 1, pz)\n\t\tif (dir != null) {\n\t\t\tthis.setDir(dir)\n\t\t\tthis.setAnimation(\"walk\")\n\t\t}\n\t\tthis.arkona.checkMapBoundary(px, py)\n\t}", "title": "" }, { "docid": "0914584e33b735bfe5027e55124026cd", "score": "0.6996487", "text": "function walk(dir){\n\t\tplayer.facing = dir;\n\t\tplayer.state = \"walking\";\n\t\tswitch(dir){\n\t\t\tcase 'left':\n\t\t\t\tif(player.x > 0){\n\t\t\t\t\tplayer.animation.walking(1);\n\t\t\t\t\tplayer.x -= speed;\n\t\t\t\t} else {\n\t\t\t\t\tplayer.stop(37);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'up':\n\t\t\t\tif(player.y > 0){\n\t\t\t\t\tplayer.animation.walking(3);\n\t\t\t\t\tplayer.y -= speed;\n\t\t\t\t} else {\n\t\t\t\t\tplayer.stop(38);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'right':\n\t\t\t\tif(player.x < maps[currentMap].width - 1) {\n\t\t\t\t\tplayer.animation.walking(2);\n\t\t\t\t\tplayer.x += speed;\n\t\t\t\t} else {\n\t\t\t\t\tplayer.stop(39);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'down':\n\t\t\t\tif(player.y < maps[currentMap].height - 1) {\n\t\t\t\t\tplayer.animation.walking(0);\n\t\t\t\t\tplayer.y += speed;\n\t\t\t\t} else {\n\t\t\t\t\tplayer.stop(40);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "700fa527e44dbb3488c000508de68165", "score": "0.69307494", "text": "function Move()\n{\n\t// If right, walk right\n\tif(dir == Direction.RIGHT)\n\t{\n\t\ttransform.Translate(Vector3.right * Time.deltaTime * speed);\n\t\n\t\t// no longer still\n\t\tstill = false;\n\t}\n\t// If left, walk left\n\telse if(dir == Direction.LEFT)\n\t{\n\t\ttransform.Translate(Vector3.left * Time.deltaTime * speed);\n\t\t\n\t\t// no longer still\n\t\tstill = false;\n\t}\n\t// if up, walk up\n\telse if(dir == Direction.UP)\n\t{\n\t\ttransform.Translate(Vector3.up * Time.deltaTime * speed);\n\t}\n\t// if down, walk down\n\telse if(dir == Direction.DOWN)\n\t{\n\t\ttransform.Translate(Vector3.down * Time.deltaTime * speed);\n\t}\n}", "title": "" }, { "docid": "40ce2d595bf00eabc4e0cb9a0c3d380b", "score": "0.6924693", "text": "function move(delay, duration, direction, forward)//direction ranges from -1 to 1 negative is left positive is right\n{\n setTimeout(function()\n {\n //console.log(\"moving to \" + direction)\n direction *= -1\n direction += 1\n var angle = direction * (Math.PI / 2.0)\n //console.log(angle)\n var sideSpeed = Math.cos(angle)\n var frontSpeed = Math.sin(angle)\n\n frontSpeed *= (forward) ? 1:-1\n sideSpeed = (sideSpeed > .000001 || sideSpeed < -.0000001) ? sideSpeed : 0\n frontSpeed = (frontSpeed > .000001 || frontSpeed < -.0000001) ? frontSpeed : 0\n\n\n console.log(sideSpeed, frontSpeed)\n\n pcmd.right = sideSpeed * SPEED;\n pcmd.front = frontSpeed * SPEED;\n }, delay)\n setTimeout(function() {\n pcmd = {}\n }, delay + duration)\n\n}", "title": "" }, { "docid": "2b35ce7d8e115fc63514c9a84e6072e9", "score": "0.68961984", "text": "update(dir) {\n // multiply any movement by the dt parameter\n // will ensure the game runs at the same speed for\n // all computers.\n if (dir == 'left') {\n this.x -= 50;\n if (this.x < 0)\n this.x = 0;\n\n }\n else if (dir == 'right') {\n this.x += 50;\n if (this.x > 400)\n this.x = 400;\n }\n else if (dir == 'up') {\n this.y -= 50;\n if (this.y < -10) {\n this.playerWin();\n }\n }\n else if (dir == 'down') {\n this.y += 50;\n if (this.y > 400)\n this.y = 400;\n }\n \n }", "title": "" }, { "docid": "8faa16b491232b1ef29c59cce681fa4a", "score": "0.6747578", "text": "animate(){\n\t\tif (this.leftWingOpen == true){\n\t\t\tthis.leftWingRotation++;\n\t\t\tif (this.leftWingRotation > 20){\n\t\t\t\tthis.leftWingOpen = false;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.leftWingRotation--;\n\t\t\tif (this.leftWingRotation < 5){\n\t\t\t\tthis.leftWingOpen = true;\n\t\t\t}\n\t\t}\n\n\t\tif (this.rightWingOpen == true){\n\t\t\tthis.rightWingRotation++;\n\t\t\tif (this.rightWingRotation > 355){\n\t\t\t\tthis.rightWingOpen = false;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.rightWingRotation--;\n\t\t\tif (this.rightWingRotation < 340){\n\t\t\t\tthis.rightWingOpen = true;\n\t\t\t}\n\t\t}\n\n\t}", "title": "" }, { "docid": "715c48037dae7f588ebfa7431cb0bf7d", "score": "0.6692023", "text": "determineMove(){\n this.dir = this.nextDir;\n }", "title": "" }, { "docid": "f633168ee43eebed99337ba97d8fe7d5", "score": "0.6630011", "text": "function walkIn(direction){\n setTimeout(function(){\n walk.style.opacity = 1\n }, 500)\n setTimeout(function(){\n sit.style.opacity = 1\n }, 1500)\n setTimeout(function(){\n like.style.opacity = 1\n }, 2500)\n setTimeout(function(){\n showArrow()\n }, direction === \"up\" ? 0 : 2500)\n}", "title": "" }, { "docid": "598b91edf8f67d2ae77204bad0108048", "score": "0.65782255", "text": "function move(dir : int) {\n\tif (currentTile.charOn == false && currentTile.isWall() == false) {\n\t\tprevTile.remChar();\n\t\tcurrentTile.addChar();\n\t\tsmoothMove(dir);\n\t\tmoved = true;\n\t\treturn true;\n\t} else if (currentTile.isWall() == true) {\n\t\tcurrentTile = prevTile;\n\t\twallBounce(dir);\n\t\treturn false;\n\t} else {\n\t\tcurrentTile = prevTile;\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "608ab5257e631ca2be88a6797ea1e9a5", "score": "0.657473", "text": "animate(l,r,u,d){\n this.animations.add('left', l, 10, true);\n this.animations.add('right',r, 10, true);\n this.animations.add('up', u, 10, true);\n this.animations.add('down', d, 10, true);\n }", "title": "" }, { "docid": "5dc28f612c83b113c8f937e3ee6d675a", "score": "0.6574561", "text": "direction(){\n //Moving right\n if(direction == 'x' && speed >= 0){\n return 3;\n }\n //Moving left\n else if(direction == 'x' && speed < 0){\n return 1;\n }\n //Moving down\n else if(direction == 'y' && speed >= 0){\n return 0;\n }\n //moving up\n else return 2;\n }", "title": "" }, { "docid": "cf25f761441c2d0fed6fbb64ffc60f24", "score": "0.65457815", "text": "move(dir) {\n this.clear();\n if (dir == \"right\") {\n this.x += HOR_MOVEMENT;\n } else if (dir == \"left\") {\n this.x -= HOR_MOVEMENT;\n }\n this.show();\n }", "title": "" }, { "docid": "ed8c9c052d4944af264f1ce2757f53bb", "score": "0.65407646", "text": "move(direction){\n //character's walking direction: -1 for left, 1 for right\n var opt;\n this.moving = true;\n if(direction == \"left\"){\n opt = -1;\n }else{\n opt = 1;\n }\n\n //7 movements\n var self = this;//use \"self\" to replace \"this\" inside the function\n var count = 2;\n var stopped = false;\n var walk = setInterval(\n function(){\n if(self.collision() && self.image_state.split(\"-\")[0] == direction){\n clearInterval(walk);\n self.moving = false;\n stopped = true;\n //bump into wall and walk in the same direction as wall\n }\n if(!stopped){\n //ctx.fillRect(self.x,self.y,self.w,self.h);\n ctx.clearRect(self.x,self.y - 5,self.w,self.h + 10);\n var width = opt * 5;\n\n self.x = self.x + width;\n self.image_state = direction + \"-running-\" + count;\n self.draw();\n count++;\n if(count > 8){\n self.moving = false;\n clearInterval(walk);\n }\n if(self.jumping){\n self.moving = false;\n self.jump_move(direction);\n clearInterval(walk);\n }\n }\n }, 50);\n this.check();\n }", "title": "" }, { "docid": "c1a324545123260010d71850c7a1794c", "score": "0.6539214", "text": "function move(dir) {\n var upY = retY-2;\n var downY = retY+2;\n var leftX = retX-1;\n var rightX = retX+1;\n console.log('Inside move, before switch '+ dir);\n switch(dir) {\n case 'up':\n if(distance(retX,upY, radarRad,radarRad)<=radLimit) {\n retY = upY;\n }\n break; \n case 'down':\n if(distance(retX,downY, radarRad,radarRad)<=radLimit) {\n retY = downY;\n }\n break; \n case 'left':\n if(distance(leftX,retY, radarRad,radarRad)<=radLimit) {\n retX = leftX;\n }\n break; \n case 'right':\n if(distance(rightX,retY, radarRad,radarRad)<=radLimit) {\n retX = rightX;\n }\n break; \n default:\n console.log('inside move');\n break;\n }\n drawZoomMap();\n drawLoc();\n}", "title": "" }, { "docid": "8364346f262f5b25669c4eb62bbdbf89", "score": "0.64912456", "text": "function moveForward() {\n\tif (dir == UP) pos[1] -= 1;\n\tif (dir == RIGHT) pos[0] += 1;\n\tif (dir == DOWN) pos[1] += 1;\n\tif (dir == LEFT) pos[0] -= 1;\n}", "title": "" }, { "docid": "986f649d9aa027a74ba34fdf5732d265", "score": "0.64481896", "text": "function move() {\n //compute frame time and motion delta\n var time = new Date();\n var now = time.getMilliseconds() / 1000.0;\n var dt = now - myclock;\n if (dt < 0.0) dt += 1.0;\n var delta = speed * dt * 400;\n myclock = now;\n\n if (delta > 0 && delta < 1000) { //time change must be reasonable\n switch (animationState) {\n case motionstate.up: moveUp(delta); break;\n case motionstate.across: moveAcross(delta); break;\n case motionstate.down: moveDown(delta); break;\n } //switch\n } //if\n} //move", "title": "" }, { "docid": "0b4a16a1081a10bb4a6a0e780c58b524", "score": "0.64124125", "text": "update(){\n if(!this.done){\n this.x += this.dx;\n this.y += this.dy;\n if(this.aim > 0){\n if(this.dx < 0){\n this.dx = this.dx + 0.03;\n }\n else if(this.dx < 0){\n this.dx = this.dx - 0.03;\n }\n if(this.dy < 0 && !this.done){\n this.dy = this.dy + 0.03;\n }\n if(this.dy > 0){\n this.dy = 0;\n this.done = true;\n }\n }\n if(this.aim === 0){\n if(this.dy < 0 && !this.done){\n this.dy = this.dy + 0.03;\n }\n if(this.dy > 0){\n this.dy = 0;\n this.done = true;\n }\n }\n if(this.aim < 0){\n if(this.dx > 0){\n this.dx = this.dx + 0.03;\n }\n if(this.dy < 0 && !this.done){\n this.dy = this.dy + 0.03;\n }\n if(this.dy > 0){\n this.dy = 0;\n this.done = true;\n }\n }\n }\n }", "title": "" }, { "docid": "6771797a374e2a1960270234965b7c5d", "score": "0.6405029", "text": "walk_into(dir) {\n if (this.falling || dir == UP || dir == DOWN)\n return false;\n let to = this.point.step(dir);\n if (!this.world.get(to)) {\n this.move(to);\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "2ec9ae6cf610a7839f838d09e6332e11", "score": "0.63841426", "text": "animate ( )\n\t{\n\t\t//\tCheck the enemy isn't dead or attacking\n\t\tif ( !this.bolDead && !this.bolAttacking )\n\t\t{\n\t\t\t//\tDetermine animation to play\n\t\t\tswitch ( this.intAnimationMask )\n\t\t\t{\n\t\t\t\t\t//\tIdle\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.sprite.animations.stop ( );\n\t\t\t\t\tbreak;\n\n\t\t\t\t\t//\tStraights\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.sprite.animations.play ( 'W' );\n\t\t\t\t\tthis.sprite.body.velocity.x = -250;\n\n\t\t\t\t\tthis.vecForward.x = -1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.sprite.animations.play ( 'N' );\n\t\t\t\t\tthis.sprite.body.velocity.y = -250;\n\n\t\t\t\t\tthis.vecForward.y = -1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tthis.sprite.animations.play ( 'E' );\n\t\t\t\t\tthis.sprite.body.velocity.x = 250;\n\n\t\t\t\t\tthis.vecForward.x = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tthis.sprite.animations.play ( 'S' );\n\t\t\t\t\tthis.sprite.body.velocity.y = 250;\n\n\t\t\t\t\tthis.vecForward.y = 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\t//\tDiagonals\n\t\t\t\tcase 6:\n\t\t\t\t\tthis.sprite.animations.play ( 'NE' );\n\t\t\t\t\tthis.sprite.body.velocity.x = 250;\n\t\t\t\t\tthis.sprite.body.velocity.y = -250;\n\n\t\t\t\t\tthis.vecForward.x = 1;\n\t\t\t\t\tthis.vecForward.y = -1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tthis.sprite.animations.play ( 'NW' );\n\t\t\t\t\tthis.sprite.body.velocity.x = -250;\n\t\t\t\t\tthis.sprite.body.velocity.y = -250;\n\n\t\t\t\t\tthis.vecForward.x = -1;\n\t\t\t\t\tthis.vecForward.y = -1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\t\tthis.sprite.animations.play ( 'SE' );\n\t\t\t\t\tthis.sprite.body.velocity.x = 250;\n\t\t\t\t\tthis.sprite.body.velocity.y = 250;\n\n\t\t\t\t\tthis.vecForward.x = 1;\n\t\t\t\t\tthis.vecForward.y = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\tthis.sprite.animations.play ( 'SW' );\n\t\t\t\t\tthis.sprite.body.velocity.x = -250;\n\t\t\t\t\tthis.sprite.body.velocity.y = 250;\n\n\t\t\t\t\tthis.vecForward.x = -1;\n\t\t\t\t\tthis.vecForward.y = 1;\n\t\t\t\t\tbreak;\t\t\t\t\n\t\t\t}\n\n\t\t\t//\tSet attack mask\n\t\t\tif ( this.intAnimationMask != 0 )\n\t\t\t\tthis.intAttackMask = this.intAnimationMask;\n\n\t\t\tthis.intAnimationMask = 0;\n\t\t}\n\t}", "title": "" }, { "docid": "323cd5b78842f595f83e57ab71eb1325", "score": "0.6366413", "text": "function walk() {\n\tthis.transform.position += (speed * direction * Time.deltaTime);\n}", "title": "" }, { "docid": "4f37dc1018eb726b2ed5f0c22d2de862", "score": "0.63375884", "text": "function updateCameraDir(speed) {\n\t\t// if(!(upPressed || downPressed || rightPressed || leftPressed)) return;\n\t\tconst dirVec = v3.subtract(settings.cameraTarget, settings.cameraPos);\n\t\tlet direction;\n\n\t\tdirection = v3.mulScalar(v3.normalize(dirVec), speed * 2);\n\t\tif(v3.length(v3.subtract(settings.cameraTarget, settings.cameraPos)) >= 2.0) {\n\t\t\tif (equalPressed) {\n\t\t\t\tv3.add(settings.cameraTarget, direction, settings.cameraTarget);\n\t\t\t}\n\t\t\tif (minusPressed) {\n\t\t\t\tv3.subtract(settings.cameraTarget, direction, settings.cameraTarget);\n\t\t\t}\n\t\t} else v3.add(settings.cameraTarget, direction, settings.cameraTarget);\n\t\tdirection = v3.cross(dirVec, [0, 1, 0]);\n\t\tdirection = v3.normalize(direction);\n\t\tdirection[1] = 0;\n\t\tif (rightPressed) {\n\t\t\tdirection = v3.mulScalar(direction, speed*1.5);\n\t\t\tv3.add(settings.cameraTarget, direction, settings.cameraTarget);\n\t\t\treturn;\n\t\t}\n\t\tif (leftPressed) {\n\t\t\tdirection = v3.mulScalar(direction, speed*1.5);\n\t\t\tv3.subtract(settings.cameraTarget, direction, settings.cameraTarget);\n\t\t\treturn;\n\t\t}\n\n\t\tconst vecLength = v3.length(dirVec);\n\t\tdirection = [0, speed, 0];\n\t\tif (upPressed) {\n\t\t\tv3.add(settings.cameraTarget, direction, settings.cameraTarget);\n\t\t}\n\t\tif (downPressed) {\n\t\t\tv3.subtract(settings.cameraTarget, direction, settings.cameraTarget);\n\t\t}\n\t}", "title": "" }, { "docid": "0117936a1338642ccd1f492cd040fd9a", "score": "0.6331712", "text": "function reverse(direction){ \n if(direction === 'left'){ //Checks the Penguins direction if Left was given as a parameter then move -50\n console.log(\"Reverse Me LEFT\"); \n $pen.animate({\n left: \"-=50\"\n }, 500);\n } else { // If Right was given as a parameter then go +50\n console.log(\"Reverse Me RIGHT\"); \n $pen.animate({\n left: \"+=50\"\n }, 500);\n }\n}", "title": "" }, { "docid": "2116041e13081a7446f402481572a1ba", "score": "0.6330458", "text": "updateAnimation() {\n let prefix = this.isChaser ? 'chaser' : 'player';\n let velX = this.sprite.body.velocity.x;\n let velY = this.sprite.body.velocity.y;\n if (velX !== 0 || velY !== 0) {\n let direction = '';\n direction += (velY === 0 ? '' : (velY > 0 ? 'S' : 'N'));\n direction += (velX === 0 ? '' : (velX > 0 ? 'E' : 'W'));\n this.sprite.anims.play(prefix + '-' + direction, true);\n }\n }", "title": "" }, { "docid": "0f343fe7611b5834e719cb51677802ed", "score": "0.63256425", "text": "move() {\n if (this.direction === \"up\") {\n this.y -= 5;\n }\n else if (this.direction === \"left\") {\n this.x -= 5;\n }\n else if (this.direction === \"down\") {\n this.y += 5;\n }\n else {\n this.x += 5;\n }\n }", "title": "" }, { "docid": "5b2b04ae88d952def3533a5032a1b6d0", "score": "0.63214326", "text": "function processWalk(dir){\n charStep ++;\n if (charStep === 5) charStep = 1;\n\n //removes class\n $('#bomberman').removeAttr('class');\n\n //add class for direction moving\n switch(charStep){\n case 1: $('#bomberman').addClass(dir); break;\n case 2: $('#bomberman').addClass(dir + '-one'); break;\n case 3: $('#bomberman').addClass(dir); break;\n case 4: $('#bomberman').addClass(dir + '-two'); break;\n }\n\n //move bomberman length and height of image\n switch(dir){\n case 'front':\n if ($('#bomberman').position().top < 370){\n $('#bomberman').animate({top: '+=10'}, charSpeed);\n fromTop ++\n //If the player steps down into a new row, add 8 to the index\n if (fromTop % 5 === 0){\n index += 8;\n }\n isIndexBlock()\n }\n break;\n case 'back':\n if ($('#bomberman').position().top > 0){\n $('#bomberman').animate({top: '-=10'}, charSpeed);\n fromTop --\n //if the player steps up into a new row, take 8 off the index\n if (fromTop %5 === 4){\n index -=8\n }\n isIndexBlock()\n }\n break;\n case 'left':\n if ($('#bomberman').position().left >0){\n $('#bomberman').animate({left:'-=10'}, charSpeed);\n fromLeft --\n //if the player steps left into a column, take 1 off the index\n if (fromLeft %5 === 4){\n index --\n }\n isIndexBlock()\n }\n break;\n case 'right':\n if ($('#bomberman').position().left <380){\n\n $('#bomberman').animate({left: '+=10'}, charSpeed);\n fromLeft ++\n console.log(fromLeft)\n //if player steps right into a column, add 1 to the index\n if (fromLeft % 5 ===0){\n index ++\n }\n console.log(index)\n isIndexBlock()\n\n }\n break;\n }\n }", "title": "" }, { "docid": "2d46f06d8953e2c2915939ea4d03bccd", "score": "0.63145214", "text": "function balloonAct(dir)\n {\n if (dir != Up) return false;\n var t = grid.find(self, Up);\n if (t.is(SPACE))\n {\n moveAndTrigger(Up, Up);\n }\n else if (t.is(BOULDER))\n {\n if (grid.find(self,Left).is(SPACE) &&\n grid.find(self,UpLeft).is(SPACE))\n {\n moveAndTrigger(UpLeft, Up);\n }\n else if (grid.find(self,Right).is(SPACE) &&\n grid.find(self,UpRight).is(SPACE))\n {\n moveAndTrigger(UpRight, Up);\n }\n else return false;\n }\n else if (t.is(LEFT_DEFLECTOR))\n {\n if (! grid.find(self,Right).is(SPACE)) return false;\n if (! grid.find(self,UpRight).is(SPACE)) return false;\n moveAndTrigger(UpRight, Right);\n }\n else if (t.is(RIGHT_DEFLECTOR))\n {\n if (! grid.find(self,Left).is(SPACE)) return false;\n if (! grid.find(self,UpLeft).is(SPACE)) return false;\n moveAndTrigger(UpLeft, Left);\n }\n else return false;\n level.enqueue(self, Up);\n return true;\n }", "title": "" }, { "docid": "3df0b8b4309acd3754fa76d67268b11f", "score": "0.6313021", "text": "function move_direction(direction) {\n\tmachine.jog(direction);\n}", "title": "" }, { "docid": "17bf70d5d18d0a3835c9dee345e11bc1", "score": "0.62789136", "text": "function updateAnimation(anim) {\n\n // Time left being negative means no change\n if (anim.left < 0) return null;\n\n // else decrease by 1\n anim.left--;\n\n // If it reaches 0, advance one step of the animation cycle\n if (anim.left === 0) {\n // Increase step by 1\n anim.step++;\n\n // If step exceedes number, cycle back to 0\n if (anim.step === anim.totalSteps) anim.step = 0;\n\n // Set new timeleft and frame values\n anim.left = animations[anim.name][anim.step].duration;\n anim.frame = animations[anim.name][anim.step].frame;\n };\n\n }", "title": "" }, { "docid": "c132ef6a069d040bfa47b543671c0f09", "score": "0.6233036", "text": "animate(framestep) {\n\t\tlet add =\n\t\t\tMath.sin(framestep + this.animationShift) *\n\t\t\tanimationSpeed *\n\t\t\tthis.animationScale *\n\t\t\tthis.direction;\n\t\tthis.obj.position.z += add;\n\t}", "title": "" }, { "docid": "c0c6ef201d44583a698316e7a353445c", "score": "0.6222501", "text": "function moveForward(rover){\n // console.log(\"moveForward was called!\");\n // (x,y) inicial (1,1) canto baixo, esquerdo ?\n MarsMaxX= 9;\n MarsMinX=0;\n MarsMaxY= 9; \n MarsMinY=0;\n rover.travelLog += \"f\";\n\n function moveY (){\n let measureY = 4*rover.y ;\n return `${measureY}vw`};\n\n function moveX (){\n let measureX = 4*rover.x ;\n return `${measureX}vw`};\n\n switch (rover.direction){\n case \"N\": rover.y=Math.max(rover.y-1,MarsMinY);\n roverHtml.style.top = moveY();\n break;\n case \"S\": rover.y=Math.min(rover.y+1,MarsMaxY);\n roverHtml.style.top = moveY();\n break;\n case \"E\": rover.x=Math.min(rover.x+1,MarsMaxX);\n roverHtml.style.left = moveX ();\n break;\n case \"W\": rover.x=Math.max(rover.x-1,MarsMinX);\n roverHtml.style.left = moveX ();\n break;\n default: console.log(\"no valid direction was selected\");\n } \n showStatus (); \n }", "title": "" }, { "docid": "6748c4d1557e43962d6498c8e53f06b1", "score": "0.6209688", "text": "move() {\n var distanceX = this.destination.x - this.x;\n\n if (Math.abs(distanceX) < this.speedX) {\n this.x = this.destination.x;\n\n } else {\n if (distanceX > 0) {\n this.moveRight();\n return\n }\n if (distanceX < 0) {\n this.moveLeft();\n return;\n }\n }\n var distanceY = this.destination.y - this.y;\n if (Math.abs(distanceY) < this.speedY) {\n this.y = this.destination.y;\n this.state = CPU_CONST.STATIC;\n return;\n\n\n } else {\n\n if (distanceY > 0) {\n this.moveDown();\n\n return;\n }\n if (distanceY < 0) {\n this.moveUp();\n\n return;\n }\n }\n\n\n\n\n }", "title": "" }, { "docid": "8adc1ade4d359e188ae27c89f0f1b99c", "score": "0.6206017", "text": "currentDirection()\r\n {\r\n // gets the traveled distance\r\n var distanceCovered = this.traveled;\r\n\r\n //gets animation control points\r\n var points = this.controlP;\r\n\r\n //gets the animation directions\r\n var dir = this.directions;\r\n\r\n/*goes through all points, calculates distance between them, and subtracts them.\r\n when 'distanceCovered' is equal or less than 0,\r\n means that that is the current direction, and returns it*/\r\n for(var i = 0; i < points.length - 1; i++)\r\n {\r\n distanceCovered -= this.distanceBetweenPoints(points[i], points[i+1]);\r\n\r\n if(distanceCovered <= 0)\r\n {\r\n //updates current point\r\n this.currentPoint = i;\r\n\r\n return dir[i];\r\n }\r\n }\r\n\r\n //updates current point\r\n this.currentPoint = dir.length - 1;\r\n\r\n return dir[dir.length - 1];\r\n }", "title": "" }, { "docid": "e360e3a669db841f4ce7b08a8980309d", "score": "0.6201329", "text": "go(vX, vY, direction){\n this.setVelocityX(vX);\n this.setVelocityY(vY);\n if(direction!= this.direction){\n this.direction = direction;\n this.anims.play(direction);\n }\n \n }", "title": "" }, { "docid": "bc7de8ae873916b2c3c7cd0e79edfc96", "score": "0.6177953", "text": "function setFlagPosition(flag,deg){\n if(flag === \"right\"){\n $(\"#imageRightFlag\").css(\"transition-duration\",\"1s\");\n $(\"#imageRightFlag\").css('transform', 'rotate('+deg+'deg)');\n setTimeout(function() { $(\"#imageRightFlag\").css(\"transition-duration\",\"0s\"); }, 1000); //1,05 sec delay\n curHandPos[0] = deg;\n }\n else if(flag === \"left\"){\n $(\"#imageLeftFlag\").css(\"transition-duration\",\"1s\");\n $(\"#imageLeftFlag\").css('transform', 'rotate('+deg+'deg)');\n setTimeout(function() { $(\"#imageLeftFlag\").css(\"transition-duration\",\"0s\"); }, 1000); //1,05 sec delay\n curHandPos[1] = deg;\n }\n}", "title": "" }, { "docid": "3b4f2315ed9be227e98d0002a31e9c2a", "score": "0.6163688", "text": "function move(direction) {\n\tswitch (direction) {\n\tcase 'up':\n\t\tmyTank.moveUp();\n\t\tbreak;\n\tcase 'down':\n\t\tmyTank.moveDown();\n\t\tbreak;\n\tcase 'left':\n\t\tmyTank.moveLeft();\n\t\tbreak;\n\tcase 'right':\n\t\tmyTank.moveRight();\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "7fb1c303f0cb328adb8c5c554e6b03ad", "score": "0.61600864", "text": "upLeft(){\n if (this.speed>0.6){this.speed -=.5}\n this.vx = -(this.speed/Math.sqrt((this.speed**2)+(this.speed**2)))\n this.vy = -(this.speed/Math.sqrt((this.speed**2)+(this.speed**2)))\n }", "title": "" }, { "docid": "040b1c0b9de26931d3c4a3aa87b508bf", "score": "0.61522007", "text": "move() {\n //console.log(\"current location: x=\" + this.x + \" y=\"+ this.y);\n //console.log(\"this direction:\" + this.dir);\n switch(this.dir) {\n case 0: \n this.y = this.y - this.size;\n break;\n case 1:\n this.x = this.x + this.size;\n break;\n case 2:\n this.y = this.y + this.size;\n break;\n case 3:\n this.x = this.x - this.size;\n break;\n }\n //console.log(\"current location: x=\" + this.x + \" y=\"+ this.y);\n }", "title": "" }, { "docid": "dca0990056a20e8bd5e63a35f4f9b2da", "score": "0.6146771", "text": "movePlayer(direction){\n if (direction == 'right') {\n this.setState({ playerSide: 'right' });\n Animated.spring(\n // move to the edge of the right side of the screen\n this.state.movePlayerVal,\n {\n toValue: Dimensions.get('window').width - 140,\n tension: 150,\n }\n // with a spring of \"150\" tension. Quite a speed when dealing with springs!\n ).start();\n } else if (direction == 'left') {\n this.setState({ playerSide: 'left' });\n Animated.spring(\n this.state.movePlayerVal,\n {\n toValue: 40,\n tension: 150,\n }\n // once more but for the left\n ).start();\n }\n // basically a spring function was called with boundry values\n // depending on wheter one wanted to go right or left\n }", "title": "" }, { "docid": "4b0469b3bdad7af1963b082c6e031c11", "score": "0.6142886", "text": "function turnLeft() {\n g_bot.dir--;\n if (g_bot.dir < ANTUP) {\n g_bot.dir = ANTLEFT;\n }\n moveForward();\n}", "title": "" }, { "docid": "b5dc7c080ce411e39874b13dc1b1fed8", "score": "0.6129683", "text": "move(dx, dy, sw, sh, speed) {\n\n if (this.moving) return;\n\n this.dir = new Vector2(dx, dy);\n\n this.target.x = this.pos.x + dx;\n this.target.y = this.pos.y + dy;\n\n // Determine movement speed\n let len = Math.hypot(dx*this.w, dy*this.h);\n this.speed = 1.0 / (len / speed);\n\n // Handle looping\n if (this.target.x < 0) {\n\n this.target.x += sw;\n this.pos.x += sw;\n }\n else if (this.target.x >= sw) {\n\n this.target.x -= sw;\n this.pos.x -= sw;\n }\n\n if (this.target.y < 0) {\n\n this.target.y += sh;\n this.pos.y += sh;\n }\n else if (this.target.y >= sh) {\n\n this.target.y -= sh;\n this.pos.y -= sh;\n }\n\n this.moving = true;\n this.moveTimer = 0.0; \n }", "title": "" }, { "docid": "83e0922b620b23ac7e07fb798dea521f", "score": "0.6118676", "text": "move(direction) {\n if (direction === MOVE_UP && this.y >= PLAYER_HEIGHT) {\n this.y = this.y - PLAYER_HEIGHT;\n\n } else if (direction === MOVE_DOWN && this.y < GAME_HEIGHT - PLAYER_HEIGHT) {\n this.y = this.y + PLAYER_HEIGHT;\n }\n\n if (direction === MOVE_LEFT && this.x > 0) {\n this.x = this.x - PLAYER_WIDTH;\n }\n else if (direction === MOVE_RIGHT && this.x < GAME_WIDTH - PLAYER_WIDTH) {\n this.x = this.x + PLAYER_WIDTH;\n }\n }", "title": "" }, { "docid": "b4e00064c8f775411efcfe2277aaae10", "score": "0.6115395", "text": "function Move( moveDirection:String )\n{\n\tif ( isMoving == false && moveDelay <= 0 )\n\t{\n\t\t//The object is moving\n\t\tisMoving = true;\n\t\t\n\t\tswitch ( moveDirection )\n\t {\n\t\t case \"forward\":\n\t\t //Turn to the front\n\t\t\t\tthisTransform.eulerAngles.y = 0;\n\t\t\t\t\n\t\t\t\t//Set the new target position to move to\n\t\t\t\ttargetPosition = thisTransform.position + Vector3(1,0,0);\n\t\t\t\t\n\t\t\t\t//Make sure the player lands on the grid \n\t\t\t\ttargetPosition.x = Mathf.Round(targetPosition.x);\n\t\t\t\ttargetPosition.z = Mathf.Round(targetPosition.z);\n\t\t\t\t\n\t\t\t\t//Register the last position the player was at, so we can return to it if the path is blocked\n\t\t\t\tpreviousPosition = thisTransform.position;\n\t\t\t\t\t\n\t\t break;\n\t\t \n\t\t case \"backward\":\n\t\t //Turn to the back\n\t\t\t\tthisTransform.eulerAngles.y = 180;\n\t\t\t\t\n\t\t\t\t//Register the last position the player was at, so we can return to it if the path is blocked\n\t\t\t\tpreviousPosition = thisTransform.position;\n\t\t\t\t\n\t\t\t\t//Make sure the player lands on the grid \n\t\t\t\ttargetPosition.x = Mathf.Round(targetPosition.x);\n\t\t\t\ttargetPosition.z = Mathf.Round(targetPosition.z);\n\t\t\t\t\n\t\t\t\t//Set the new target position to move to\n\t\t\t\ttargetPosition = thisTransform.position + Vector3(-1,0,0);\n\t\t \n\t\t break;\n\t\t \n\t\t case \"right\":\n\t\t //Turn to the right\n\t\t\t\tthisTransform.eulerAngles.y = 90;\n\t\t\t\t\n\t\t\t\t//Register the last position the player was at, so we can return to it if the path is blocked\n\t\t\t\tpreviousPosition = thisTransform.position;\n\t\t\t\t\n\t\t\t\t//Make sure the player lands on the grid \n\t\t\t\ttargetPosition.x = Mathf.Round(targetPosition.x);\n\t\t\t\ttargetPosition.z = Mathf.Round(targetPosition.z);\n\t\t\t\t\n\t\t\t\t//Set the new target position to move to\n\t\t\t\ttargetPosition = thisTransform.position + Vector3(0,0,-1);\n\t\t \n\t\t break;\n\t\t \n\t\t case \"left\":\n\t \t//Turn to the left\n\t\t\t\tthisTransform.eulerAngles.y = -90;\n\t\t\t\t\n\t\t\t\t//Register the last position the player was at, so we can return to it if the path is blocked\n\t\t\t\tpreviousPosition = thisTransform.position;\n\t\t\t\t\n\t\t\t\t//Make sure the player lands on the grid \n\t\t\t\ttargetPosition.x = Mathf.Round(targetPosition.x);\n\t\t\t\ttargetPosition.z = Mathf.Round(targetPosition.z);\n\t\t\t\t\n\t\t\t\t//Set the new target position to move to\n\t\t\t\ttargetPosition = thisTransform.position + Vector3(0,0,1);\n\t\t\t\t\t\n\t\t break;\n\t\t \n\t\t default:\n\t\t //Turn to the front\n\t\t\t\tthisTransform.eulerAngles.y = 0;\n\t\t\t\t\n\t\t\t\t//Set the new target position to move to\n\t\t\t\ttargetPosition = thisTransform.position + Vector3(1,0,0);\n\t\t\t\t\n\t\t\t\ttargetPosition.Normalize();\n\t\t\t\t\n\t\t\t\t//Register the last position the player was at, so we can return to it if the path is blocked\n\t\t\t\tpreviousPosition = thisTransform.position;\n\n\t\t break;\n\t }\n\t \n\t\t//If there is an animation, play it\n\t\tif ( GetComponent.<Animation>() && animationMove ) \n\t\t{\n\t\t\t//Stop the animation\n\t\t\tGetComponent.<Animation>().Stop();\n\t\t\t\n\t\t\t//Play the animation\n\t\t\tGetComponent.<Animation>().Play(animationMove.name);\n\t\t\t\n\t\t\t//Set the animation speed base on the movement speed\n\t\t\tGetComponent.<Animation>()[animationMove.name].speed = speed;\n\t\t\t\n\t\t\t//If there is a sound source and more than one sound assigned, play one of them from the source\n\t\t\tif ( soundSourceTag != String.Empty && soundMove.Length > 0 ) GameObject.FindGameObjectWithTag(soundSourceTag).GetComponent.<AudioSource>().PlayOneShot(soundMove[Mathf.Floor(Random.value * soundMove.Length)]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "76fe97d9cdd2581c2251c153b4dd61d8", "score": "0.61043555", "text": "function moveUp(delta) {\n if (speed >= 8.0) { //jump to position\n var time = new Date();\n var now = time.getMinutes() * 60 + time.getSeconds() + time.getMilliseconds() / 1000.0;\n\n if (now - startDelayTime > delayTime) {\n startDelayTime = now;\n discX[curDisc] = pegX[destPeg];\n discY[curDisc] = pegY;\n animationState = motionstate.down;\n } //if\n } //if\n else { //smooth animation\n discY[curDisc] -= 0.8 * delta;\n if (discY[curDisc] <= floatHeight) {\n discY[curDisc] = floatHeight;\n animationState = motionstate.across;\n } //if\n } //else\n} //moveUp", "title": "" }, { "docid": "92ce8a6ebb6d8bc24aece1193fd69aee", "score": "0.60939515", "text": "function boss1na_update() {\n //Init frame counter of needed.\n if (this.frameCounter === 0)\n this.frameCounter = 1;\n //Moving right...\n if (this.frameCounter > 0) {\n this.frameCounter++;\n //Do actual movement to the right.\n if (this.frameCounter % 1 === 0) {\n this.middleX++;\n }\n //If count exceeded, invert the direction.\n if (this.frameCounter > 60)\n this.frameCounter = -1;\n }\n //Moving left...\n else if (this.frameCounter < 0) {\n this.frameCounter--;\n //Do actual movement to the right.\n if (this.frameCounter % 1 === 0) {\n this.middleX--;\n }\n //If count exceeded, invert the direction.\n if (this.frameCounter < -60)\n this.frameCounter = 1;\n }\n\n}", "title": "" }, { "docid": "3151991dad3e176caa7bb9181734054b", "score": "0.60926247", "text": "step (direction) {\n let iDiff\n let jDiff\n let iStart\n let jStart\n let iEnd\n let jEnd\n let transposing = false\n\tthis.changed = false\n switch (direction) {\n case 'left':\n transposing = true\n case 'up':\n ;(iStart = 0), (iEnd = 4), (iDiff = 1)\n ;(jStart = 0), (jEnd = 3), (jDiff = 1)\n break\n case 'right':\n transposing = true\n case 'down':\n ;(iStart = 0), (iEnd = 4), (iDiff = 1)\n ;(jStart = 3), (jEnd = 0), (jDiff = -1)\n break\n }\n this.shift(iDiff, jDiff, iStart, jStart, iEnd, jEnd, transposing)\n this.merge(iDiff, jDiff, iStart, jStart, iEnd, jEnd, transposing)\n this.shift(iDiff, jDiff, iStart, jStart, iEnd, jEnd, transposing)\n if (this.changed) {\n this.addNewValue()\n this.display()\n }\n }", "title": "" }, { "docid": "475e8695b536badf9e47091a48b7aa4e", "score": "0.60847664", "text": "function moveForward() {\n if (g_bot.dir == ANTUP) {\n g_bot.y--;\n } else if (g_bot.dir == ANTRIGHT) {\n g_bot.x++;\n } else if (g_bot.dir == ANTDOWN) {\n g_bot.y++;\n } else if (g_bot.dir == ANTLEFT) {\n g_bot.x--;\n }\n\n if (x > width - 1) {\n x = 0;\n } else if (x < 0) {\n x = width - 1;\n }\n if (y > height - 1) {\n y = 0;\n } else if (y < 0) {\n y = height - 1;\n }\n}", "title": "" }, { "docid": "d6bf67f4746a09f40b0f8feb1f5f2fca", "score": "0.60837644", "text": "function update(dir, step) {\n \n // dir x or y\n // step + or -\n \n var moved = false;\n \n var futurePos = currentPos.slice(0);\n futurePos[dir] += step;\n \n console.log(\"current\"+currentPos);\n console.log(\"future\"+futurePos);\n \n // movement logic\n \n if ((futurePos[0] < 0) || (futurePos[0] > myBoard.length - 1)\n || (futurePos[1] < 0) || (futurePos[1] > myBoard[0].length - 1)) {\n console.log(\"stepped off the board\");\n } else {\n \n switch (myBoard[futurePos[0]][futurePos[1]]) {\n \n case USABLE:\n case FLAG:\n myBoard[futurePos[0]][futurePos[1]] = CAT;\n moved = true;\n break;\n case KEY:\n myBoard[futurePos[0]][futurePos[1]] = CAT;\n futurePos[2] = true;\n moved = true;\n break;\n case LOCK:\n if (currentPos[2]) {\n myBoard[futurePos[0]][futurePos[1]] = CAT;\n moved = true;\n }\n break;\n case MAT:\n myBoard[futurePos[0]][futurePos[1]] = CATMAT;\n moved = true;\n break;\n case START:\n myBoard[futurePos[0]][futurePos[1]] = CATSTART;\n moved = true;\n break;\n case FINISH:\n myBoard[futurePos[0]][futurePos[1]] = CATFINISH;\n moved = true;\n break;\n default:\n moved = false;\n console.log(\"can't move\");\n \n }\n \n if (moved) {\n \n switch (myBoard[currentPos[0]][currentPos[1]]) {\n \n case CATSTART:\n myBoard[currentPos[0]][currentPos[1]] = START;\n break;\n case CATMAT:\n myBoard[currentPos[0]][currentPos[1]] = MAT;\n break;\n case KEY:\n case LOCK:\n case CAT:\n case FLAG:\n myBoard[currentPos[0]][currentPos[1]] = USED;\n break;\n case CATFINISH:\n myBoard[currentPos[0]][currentPos[1]] = FINISH;\n break;\n default:\n console.log(\"can't move\");\n \n }\n \n updateCell(myBoard, currentPos[0], currentPos[1]);\n updateCell(myBoard, futurePos[0], futurePos[1]);\n \n currentPos = futurePos;\n \n }\n \n printBoard(myBoard);\n console.log(currentPos);\n \n }\n \n}", "title": "" }, { "docid": "e4bf6298ae9893eb3648e8ddfe3ebb7f", "score": "0.6082126", "text": "move() {\n let dirX = 0;\n let dirY = 0;\n\n if (this.destX == this.x) {\n dirX = 0;\n this.destX = this.canvas.width / 32 - this.x;\n } else {\n this.destX - this.x < 0 ? dirX = -1 : dirX = 1;\n }\n if (this.destY == this.y) {\n dirY = 0;\n this.destY = this.canvas.width / 32 - this.y;\n } else {\n this.destY - this.y < 0 ? dirY = -1 : dirY = 1;\n }\n\n this.x = this.x + dirX * this.ms;\n this.y = this.y + dirY * this.ms;\n\n //console.log(this.x, this.y);\n\n }", "title": "" }, { "docid": "3264c18a2118a54bb6c76abd311a20e6", "score": "0.60780644", "text": "move(){\n\t\tvar step = createVector(Noise.simplex2(this.offset, 0) * this.speed, Noise.simplex2(0, this.offset) * this.speed);\n\t\tthis.x += step.x;\n\t\tthis.y += step.y;\n\t\tthis.offset += this.increment;\n\n\t\t//calculate angle based on direction\n\t\tthis.theta = step.heading() + 90;\n\n\t\tif (this.x > width){\n\t\t\tthis.x = 0;\n\t\t} else if (this.x < 0){\n\t\t\tthis.x = width;\n\t\t}\n\n\t\tif (this.y > height){\n\t\t\tthis.y = 0;\n\t\t} else if (this.y < 0){\n\t\t\tthis.y = height;\n\t\t}\n\t}", "title": "" }, { "docid": "3264c18a2118a54bb6c76abd311a20e6", "score": "0.60780644", "text": "move(){\n\t\tvar step = createVector(Noise.simplex2(this.offset, 0) * this.speed, Noise.simplex2(0, this.offset) * this.speed);\n\t\tthis.x += step.x;\n\t\tthis.y += step.y;\n\t\tthis.offset += this.increment;\n\n\t\t//calculate angle based on direction\n\t\tthis.theta = step.heading() + 90;\n\n\t\tif (this.x > width){\n\t\t\tthis.x = 0;\n\t\t} else if (this.x < 0){\n\t\t\tthis.x = width;\n\t\t}\n\n\t\tif (this.y > height){\n\t\t\tthis.y = 0;\n\t\t} else if (this.y < 0){\n\t\t\tthis.y = height;\n\t\t}\n\t}", "title": "" }, { "docid": "ff924c11ba4d8885fd4517e8e0d97681", "score": "0.60661596", "text": "goTheWayWereFacing() {\n this.x += this.speed * sin(this.angle);\n this.y += this.speed * cos(this.angle);\n }", "title": "" }, { "docid": "a17568de4d0b9869eb28b8052cb516ab", "score": "0.60613084", "text": "function keyPressed() {\n\tif (keyCode == UP_ARROW && s.yspeed != 1 && s.alive) {\n\t\ts.dir(0, -1);\n\t} else if (keyCode == DOWN_ARROW && s.yspeed != -1 && s.alive) {\n\t\ts.dir(0, 1);\n\t} else if (keyCode == RIGHT_ARROW && s.xspeed != -1 && s.alive) {\n\t\ts.dir(1, 0);\n\t} else if (keyCode == LEFT_ARROW && s.xspeed != 1 && s.alive) {\n\t\ts.dir(-1, 0);\n\t}\n}", "title": "" }, { "docid": "0b7ff0c67244f0e857ca7b5fe892c2cf", "score": "0.60546273", "text": "function move(event) {\n\n if (event.key === 'ArrowRight') {\n\n if ( !idTimeout ) {\n idTimeout = setTimeout(function() {\n idTimeout = null;\n right();\n }, 20);\n }\n\n } else if (event.key === 'ArrowLeft') {\n\n if ( !idTimeout ) {\n idTimeout = setTimeout(function() {\n idTimeout = null;\n left();\n }, 20);\n }\n\n // Rotates block\n\n } else if (event.key === 'ArrowUp') {\n\n //Speed downs\n\n }else if(event.key === 'ArrowDown') {\n\n fastAnim = 20;\n\n if ( !id ) {\n id = setTimeout(function() {\n clearTimeout(idAnimate);\n id = null;\n clearTimeout(idAnimate);\n animate();\n }, 10);\n }\n\n }\n\n}", "title": "" }, { "docid": "7e3b8492e78d40fbee1f3797878f4446", "score": "0.6054289", "text": "step() {\n\t\tswitch (this.#direction) {\n\t\t\tcase DIRECTION_TOP:\n\t\t\t\tthis.#y -= 1;\n\t\t\t\tbreak;\n\t\t\tcase DIRECTION_RIGHT:\n\t\t\t\tthis.#x += 1;\n\t\t\t\tbreak;\n\t\t\tcase DIRECTION_DOWN:\n\t\t\t\tthis.#y += 1;\n\t\t\t\tbreak;\n\t\t\tcase DIRECTION_LEFT:\n\t\t\t\tthis.#x -= 1;\n\t\t\t\tbreak;\n\t\t}\n\t\tthis.checkStep();\n\t}", "title": "" }, { "docid": "d7f3f994faf3bf68f2eb30333fec35dd", "score": "0.6051797", "text": "function playerMovement(){\n if(cursors.up.isDown){\n link.body.velocity.y = -vel;\n link.animations.play('walkVerticalUp', 9, true);\n up = true,down = false,left = false,right = false;\n }\n \n else if(cursors.down.isDown){\n link.body.velocity.y = vel;\n link.animations.play('walkVerticalDown', 9, true);\n up = false,down = true,left = false,right = false;\n }\n \n else{\n link.body.velocity.y = 0;\n link.animations.stop('walkVerticalUp');\n link.animations.stop('walkVerticalDown');\n }\n \n if(cursors.left.isDown){\n link.body.velocity.x = -vel;\n link.animations.play('walkHorizontalLeft', 9, true);\n up = false,down = false,left = true,right = false;\n }\n \n else if(cursors.right.isDown){\n link.body.velocity.x = vel;\n link.animations.play('walkHorizontalRight', 9, true);\n up = false,down = false,left = false,right = true;\n }\n \n else{\n link.body.velocity.x = 0;\n link.animations.stop('walkHorizontalRight');\n link.animations.stop('walkHorizontalLeft');\n }\n}", "title": "" }, { "docid": "ba1fc0bf5b9f2d9ae0d75411eb1943bb", "score": "0.6050433", "text": "function animate() {\n //stats.update();\n\tstep++;\t\n\tvar normDistance = .5;\n\tif(controls.goOrbit)\n\t{\n\t\tmercury.position.x = .3*normDistance*((Math.cos(step*controls.normSpeed/(.240))));\n\t\tmercury.position.y = .3*normDistance*((Math.sin(step*controls.normSpeed/(.240)))); \n\t\tvenus.position.x = .6*normDistance*((Math.cos(step*controls.normSpeed/(.615))));\n\t\tvenus.position.y = .6*normDistance*((Math.sin(step*controls.normSpeed/(.615)))); \n\t\tearth.position.x = 1*normDistance*((Math.cos(step*controls.normSpeed/1)));\n\t\tearth.position.y = 1*normDistance*((Math.sin(step*controls.normSpeed/1))); \n\t\tmars.position.x = 1.5*normDistance*((Math.cos(step*controls.normSpeed/(1.88))));\n\t\tmars.position.y = 1.5*normDistance*((Math.sin(step*controls.normSpeed/(1.88)))); \n\t\tjupiter.position.x = 2.5*normDistance*((Math.cos(step*controls.normSpeed/(11.862))));\n\t\tjupiter.position.y = 2.5*normDistance*((Math.sin(step*controls.normSpeed/(11.862))));\n\t\tsaturn.position.x = 3.5*normDistance*((Math.cos(step*controls.normSpeed/(29.457))));\n\t\tsaturn.position.y = 3.5*normDistance*((Math.sin(step*controls.normSpeed/(29.457))));\n\t\turanus.position.x = 5.5*normDistance*((Math.cos(step*controls.normSpeed/(84.017))));\n\t\turanus.position.y = 5.5*normDistance*((Math.sin(step*controls.normSpeed/(84.017)))); \t \t\n\t\tneptune.position.x = 8.5*normDistance*((Math.cos(step*controls.normSpeed/(164.8))));\n\t\tneptune.position.y = 8.5*normDistance*((Math.sin(step*controls.normSpeed/(164.8))));\n\t\t\n\t\ttitan.position.x = saturn.position.x + .2*normDistance*((Math.cos(step*controls.normSpeed/(1))));\n\t\ttitan.position.y = saturn.position.y// + .2*normDistance*((Math.sin(step*controls.normSpeed/(1))));\n\t\ttitan.position.z = saturn.position.z + .2*normDistance*((Math.sin(step*controls.normSpeed/(1))));\n\t\tiapetus.position.x = saturn.position.x + .4*normDistance*((Math.cos(step*controls.normSpeed/(2))));\n\t\tiapetus.position.y = saturn.position.y //+ .4*normDistance*((Math.sin(step*controls.normSpeed/(2))));\n\t\tiapetus.position.z = saturn.position.z + .4*normDistance*((Math.sin(step*controls.normSpeed/(2))));\n\t}\n\n // render using requestAnimationFrame\n requestAnimationFrame(animate);\n renderer.render(scene, camera);\n}", "title": "" }, { "docid": "540fcffa2d9e3070498540f299195fbf", "score": "0.6048457", "text": "animate(reverse){\n //The callback function will be called after 1 animation cycle (this allows you to have sprite resume activity);\n if(frameCount % this.animation_speed == 0){\n if(reverse){\n if(this.animation_index > 0){\n this.animation_index--;\n } else {\n \n if(this.state != 'dead_l'){\n if(this.state != this.state_pending){\n this.state_change_temp(this.state_pending);\n }\n\n this.animation_index = this.animation_dictionary[this.state]['length'] - 1;\n \n } else {\n this.animation_index = 0;\n this.alive = false;\n }\n }\n\n } else {\n if(this.animation_index < this.animation_dictionary[this.state]['length'] - 1){\n this.animation_index++;\n } else {\n \n \n if(this.state != 'dead_r'){\n if(this.state != this.state_pending){\n this.state_change_temp(this.state_pending);\n }\n\n this.animation_index = 0;\n \n } else {\n this.animation_index = this.animation_dictionary[this.state]['length'] - 1;\n this.alive = false;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "6b83b4d984292847c3a057eda9c614cd", "score": "0.60432005", "text": "moveRight() {\n this.sprite.startAnimation();\n this.direction.x = 1;\n this.direction.y = 0;\n }", "title": "" }, { "docid": "18fe5f98bd7a487dc535fed092186f3a", "score": "0.6031428", "text": "function walkDirection () {\n\t\tvar walkDirectionWaypoint = new Waypoint({\n\t\t element: document.getElementById('walk-idle-loop-clear'),\n\t\t handler: function(direction) {\n\t\t \tif ( (direction === 'down') ) {\n \t\t\t\tconsole.log('right');\n\t\t\t\t} else {\t\t\t\t\t\n \t\t\t\tconsole.log('up');\n \t\t\t\tSTNET.aaron.clearState(); \n\t\t\t\t} \n\t\t }\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "fa279adf4396f15879429ab42026113b", "score": "0.6021943", "text": "function directionsX(x) {\n $(\".hoover\").animate({\"left\": x }, \"slow\");\n }", "title": "" }, { "docid": "493e3ce223d72cb354a9d368aa5c0c1f", "score": "0.6017792", "text": "function boulderAct(dir)\n {\n if (dir != Down) return false;\n var t = grid.find(self, Down);\n if (boulderViable(Down))\n {\n moveAndTrigger(Down, Down);\n isMoving = true;\n }\n else if (t.is(BOULDER) && grid.find(self,Left).is(SPACE) &&\n grid.find(self,DownLeft).is(SPACE))\n {\n moveAndTrigger(DownLeft, Down);\n isMoving = true;\n }\n else if (t.is(BOULDER) && grid.find(self,Right).is(SPACE) &&\n grid.find(self,DownRight).is(SPACE))\n {\n moveAndTrigger(DownRight, Down);\n isMoving = true;\n }\n else if (t.is(LEFT_DEFLECTOR) && grid.find(self,Left).is(SPACE) &&\n grid.find(self,DownLeft).is(SPACE))\n {\n moveAndTrigger(DownLeft, Down);\n isMoving = true;\n }\n else if (t.is(RIGHT_DEFLECTOR) && grid.find(self,Right).is(SPACE) &&\n grid.find(self,DownRight).is(SPACE))\n {\n moveAndTrigger(DownRight, Down);\n isMoving = true;\n }\n else\n {\n isMoving = false;\n return false;\n }\n // If the boulder is moving, let it continue\n level.enqueue(self, Down);\n return true;\n }", "title": "" }, { "docid": "17c51b54f960e5699246c887a814886b", "score": "0.6011666", "text": "move(){\n if(this.facingIndex == 0){\n this.y += 1; \n }\n if(this.facingIndex == 1){\n this.x += 1;\n }\n if(this.facingIndex == 2){\n this.y -= 1;\n }\n if(this.facingIndex == 3){\n this.x -= 1;\n }\n }", "title": "" }, { "docid": "ac3d2c6b8662ae62169036383f30fdd8", "score": "0.600671", "text": "function frame() {\n if (animateDeg == to) {\n pdfV.inputBlockedByAnimation = false;\n clearInterval(id);\n callback = (callback === undefined) ? '': callback(true);\n } else {\n animateDeg += (reverse) ? 5 : -5;\n page.style.transform = 'rotateY('+animateDeg+'deg)';\n }\n }", "title": "" }, { "docid": "2987cc3b1aadd27e17d9437440ff032b", "score": "0.60042816", "text": "function cycleAnimation() {\n if (frameCount % 4 === 0) {\n animationCycle++;\n }\n if (direction === \"up\") {\n if (animationCycle > 23) {\n animationCycle = 16;\n }\n }\n else if (direction === \"left\") {\n if (animationCycle > 7) {\n animationCycle = 0;\n }\n }\n else if (direction === \"down\") {\n if (animationCycle > 31) {\n animationCycle = 24;\n }\n }\n else if (direction === \"right\") {\n if (animationCycle > 15) {\n animationCycle = 8;\n }\n }\n}", "title": "" }, { "docid": "50bb923d5ad0c781ea2bfa565d63e6e0", "score": "0.5996353", "text": "function charWalk(dir){\n if (dir === 'up') dir = 'back';\n if (dir === 'down') dir = 'front';\n //Moves bomberman\n processWalk(dir);\n //Make him walk at a regular pace\n timerWalk = setInterval(function(){\n processWalk(dir);}, charSpeed);\n }", "title": "" }, { "docid": "c3c1f90a5e2b4ccb0b71a0419863efdc", "score": "0.5975367", "text": "function leftMove() {\r\n var elem = document.getElementById(\"animation-right-bear\");\r\n var pos = 0;\r\n var id = setInterval(frame, 40);\r\n var temp = 0;\r\n\r\n function frame() {\r\n if (pos === 180) {\r\n //clearInterval(id);\r\n pos = 0;\r\n } else {\r\n if (pos < 90) {\r\n pos++;\r\n elem.style.right = pos + 'px';\r\n } else {\r\n pos++;\r\n temp = (90 - (pos - 90));\r\n elem.style.right = temp + 'px';\r\n // pos = 0;\r\n }\r\n\r\n }\r\n }\r\n}", "title": "" }, { "docid": "cae10a3283f0639c118e25c6a654003b", "score": "0.5973313", "text": "move(updatePositionCallback) {\n //Update the direction if the character is centerd in a square\n //and if the queued direction isn't null, and isn't the same as the current direction\n //If the tile in the queued direction is a Wall, reset queuedDir to dir\n //(this just makes movement a little more difficult and closer to the original)\n if (this.isCenteredInSquare(this.pos.x, this.pos.y) && this.queuedDir != null &&!this.queuedDir.equals(this.dir)) {\n if (this.nextTileInDirIsWall(this.pos, this.queuedDir)) {\n this.queuedDir = this.dir;\n } else {\n this.dir = this.queuedDir.copy().setMag(speed);\n //Sync immediately when the direction changes\n let currentTile = this.maze.getIndexByCoords(this.pos.x, this.pos.y);\n let unitDir = this.dir.copy().setMag(1);\n updatePositionCallback(this.id, currentTile, unitDir);\n }\n }\n\n //Add dir to a copy of pos\n let newPos = this.pos.copy();\n newPos.add(this.dir);\n\n //If the character is centered, check the next tile in the direction of dir\n //If that tile is a wall, keep the character where it is, else move it by dir\n // console.log(`(${this.pos.x}, ${this.pos.y}): ${this.isCenteredInSquare(this.pos.x, this.pos.y}`);\n if (this.isCenteredInSquare(this.pos.x, this.pos.y)) {\n let unitDir = this.dir.copy().setMag(1);\n let currentTile = this.maze.getIndexByCoords(newPos.x, newPos.y);\n if (this.nextTileInDirIsWall(newPos, unitDir)) {\n newPos = this.pos;\n }\n\n //Only sync if the character is actually moving\n //(i.e. not staying still against a wall)\n if (newPos != this.pos) {\n updatePositionCallback(this.id, currentTile, unitDir);\n }\n }\n this.pos = newPos;\n\n //Check if character runs into a food\n //if role == 0, meaning this character is pacman\n if (this.role == 0) {\n if (this.maze.getTile(this.pos.x, this.pos.y) == Maze.FOOD) {\n this.maze.eatFood(this.pos.x, this.pos.y, Maze.EMPTY);\n }\n }\n }", "title": "" }, { "docid": "e8e43a6ae82ab49e413c038ef12f832a", "score": "0.595955", "text": "function onFrame(event) {\n\n if (Key.isDown(\"left\")) {\n carVector = carVector.rotate(-1);\n car.rotate(-1);\n }\n if (Key.isDown(\"right\")) {\n\n carVector = carVector.rotate(1);\n car.rotate(1);\n }\n if ((Key.isDown(\"up\") || Key.isDown(\"q\"))\n && carVector.length < MAX_SPEED)\n carVector.length += 0.1;\n if ((Key.isDown(\"down\") || Key.isDown(\"a\"))\n && carVector.length > 1)\n carVector.length -= 0.1;\n\n\n\n car.position += carVector;\n\n var hitresult = road.hitTest(car.position);\n\n if (!hitresult) {\n\n carVector.length = 1;\n\n }\n\n\n\n // ...calculate the time of the animation between 0 and 1... \n var slowness = 2000;\n var time = event.count % slowness / slowness;\n // ...and move the car.\n moveCompetior(time);\n}", "title": "" }, { "docid": "ef983edd9cd4e830d5c078ff1acc118b", "score": "0.59559774", "text": "setEnemyDirection(direction) { //set enemy movement direction with direction parameter\n this.lastEnemyMoveDir = this.enemyMoveDir; //sets enemyMoveDir as lastEnemyMoveDir\n this.enemyMoveDir = direction; //enemyMoveDir is equal to direction parameter\n }", "title": "" }, { "docid": "e6a0028885eaa7282f021d8ece162c41", "score": "0.5953895", "text": "move(direction) {\n if (direction === MOVE_LEFT && this.x > 0) {\n this.x = this.x - PLAYER_WIDTH;\n } else if (direction === MOVE_RIGHT && this.x < GAME_WIDTH - PLAYER_WIDTH) {\n this.x = this.x + PLAYER_WIDTH;\n }\n }", "title": "" }, { "docid": "eea33fa70ef1fa7202e5409942d12c93", "score": "0.59414065", "text": "function animate() {\n // request another frame\n requestAnimationFrame(animate);\n\n if(App.walk){\n // calculate elapsed time since last loop\n let now = Date.now(),\n elapsed = now - previous_time;\n total_elapsed += elapsed;\n // Get ready for next frame by setting then=now, but...\n previous_time = now - (elapsed % interval);\n\n // if enough time has elapsed, draw the next frame\n if (elapsed > interval) {\n animation_count++;\n\n /* Move the walker forward in the App.scene */\n walker.walk(total_elapsed/1e3 + Number.EPSILON);\n }\n\n if(total_elapsed/1e3 > 10){\n App.walk = false;\n }\n\n }\n\n /* Render the scene */\n render();\n }", "title": "" }, { "docid": "d60502247f6966e54f8c32661b6f168a", "score": "0.59411466", "text": "function myMove() {\n var elem = document.getElementById('myAnimation'); \n var pos = 0;\n var id = setInterval(frame, 15);\n function frame() {\n if (pos == 8000\n ) {\n clearInterval(id);\n } else {\n pos++; \n elem.style.bottom = pos + 'px'; \n elem.style.right = pos + 'px'; \n }\n }\n}", "title": "" }, { "docid": "52b6177ca80a6edd9a8807a477a8a6d6", "score": "0.5938664", "text": "chooseDirection() {\n if (frameCount % 20 === 0) {\n let randomDirection = round(random(100));\n if (randomDirection > 75) {\n this.direction = \"right\";\n this.image = 8;\n }\n else if (randomDirection < 75 && randomDirection > 50) {\n this.direction = \"down\";\n this.image = 24;\n }\n else if (randomDirection < 50 && randomDirection > 25) {\n this.direction = \"left\";\n this.image = 0;\n }\n else {\n this.direction = \"up\";\n this.image = 16;\n }\n }\n }", "title": "" }, { "docid": "583407e9e4ff447d777605f597661676", "score": "0.59349316", "text": "move() {\n if (this.loc_y >= 0) {\n this.move_y += this.delta_y;\n this.loc_y += this.move_y;\n }\n\n if (this.loc_y >= height) {\n this.falling = false;\n this.move_y = 0;\n }\n }", "title": "" }, { "docid": "af58ebee33de0a152daa3fa1d72ff713", "score": "0.5934866", "text": "function callWithDirection( fn, faceDirection ) {\n\n\n \tswitch ( faceDirection ) {\n\n case 'up' :\n fn( 'up', Math.PI );\n fn( 'down', 0 );\n fn( 'left', -Math.PI / 2 );\n fn( 'right', Math.PI / 2 );\n break;\n\n case 'down' :\n fn( 'up', Math.PI );\n fn( 'down', 0 );\n fn( 'left', Math.PI / 2 );\n fn( 'right', -Math.PI / 2 );\n break;\n\n case 'left' : \n fn( 'up', -Math.PI / 2 );\n fn( 'down', Math.PI / 2 );\n fn( 'left', 0 );\n fn( 'right', Math.PI );\n break;\n\n case 'right' :\n fn( 'up', Math.PI / 2 );\n fn( 'down', -Math.PI / 2 );\n fn( 'left', Math.PI );\n fn( 'right', 0 );\n break;\n\n };\n\n }", "title": "" }, { "docid": "ebf3d5bdf766c33e47400e77cb181df1", "score": "0.59341705", "text": "changeDirection() {\n this.forward = !this.forward; // change the direction switch\n this.dx = -this.dx; // reverse the moving speed\n }", "title": "" }, { "docid": "1c0df9ba9c8d0515f94afcb47aa15379", "score": "0.59298193", "text": "function dan() {\n next = now +1;\n if (next >= danpin.length) {\n next = 0;\n }\n $(danpin[next]).css({\"left\":\"100%\"});\n $(danpin[now]).animate({left: -1200},500);\n $(danpin[next]).animate({left: 0}, 500);\n now =next;\n }", "title": "" }, { "docid": "7bcd86486e663967c59ee7ae7a9b9fae", "score": "0.59271574", "text": "function move () {\n\t\tif (direction == \"right\") {\n\t\t\ttx ++;\n\t\t} else if (direction == \"left\") {\n\t\t\ttx --;\n\t\t} else if (direction == \"up\") {\n\t\t\tty --;\n\t\t} else if (direction == \"down\") {\n\t\t\tty ++;\n\t\t}\n\t}", "title": "" }, { "docid": "b55fe7bd20129b4f0c1c73f0585dcb3d", "score": "0.5925272", "text": "function trackMovement() {\t\n\t\tif(transform.eulerAngles.y >= 86 && transform.eulerAngles.y <= 94) {\n\t\t\ttravelDir = \"East\";\n\t\t}else if(transform.eulerAngles.y >= -4 && transform.eulerAngles.y <= 4) {\n\t\t\ttravelDir = \"North\";\n\t\t}else if(transform.eulerAngles.y >= 266 && transform.eulerAngles.y <= 274) {\n\t\t\ttravelDir = \"West\";\n\t\t}else if(transform.eulerAngles.y >= 176 && transform.eulerAngles.y <= 184) {\n\t\t\ttravelDir = \"South\";\n\t\t}\n\t}", "title": "" }, { "docid": "4f8a6552e866e86727dec093f95c60a2", "score": "0.59179175", "text": "function turnRight() {\n g_bot.dir++;\n if(g_bot.dir > ANTLEFT) {\n g_bot.dir = ANTUP;\n }\n moveForward();\n}", "title": "" }, { "docid": "20abd3dd99ffe0f09db52b8476ad3a4d", "score": "0.59165597", "text": "function moveShip() {\n\tif(dir == null) {\n\t\treturn;\n\t}\n\n\n\n\tship.position.x += dir.x * speed;\n\tship.position.y += dir.y * speed;\n\tship.position.z += dir.z * speed;\n}", "title": "" }, { "docid": "c1665398346aa6fa1279dffb4cf85f3f", "score": "0.59116626", "text": "advandeFrame(){\n\t\tswitch(this.mode){\n\t\t\tcase Animation.NORMAL:\n\t\t\t\tthis.count++;\n\t\t\t\tif (this.count === this.frames.length) {\n\t\t\t\t\tthis.loops++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase Animation.REVERSE:\n\t\t\t\tthis.count += this.frames.length - 1;\n\t\t\t\tif (this.count === this.frames.length) {\n\t\t\t\t\tthis.loops++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase Animation.ALTERNATE:\n\t\t\t\tif (this.direction && this.mode === Animation.ALTERNATE) {\n\t\t\t\t\tthis.count++\n\t\t\t\t\tif (this.count == this.frames.length - 1) {\n\t\t\t\t\t\tthis.direction = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.count--;\n\t\t\t\t\tif (this.count == 0) {\n\t\t\t\t\t\tthis.direction = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.count === 0) {\n\t\t\t\t\tthis.loops++;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\tthis.count %= this.frames.length;\n\t}", "title": "" }, { "docid": "d6c56196c23fc8247639d66a315612e4", "score": "0.59076285", "text": "function leftRight() {\n if (topPosa == 1500) {dira = -1}\n else if (topPosa == -10) {dira = 1}\n topPosa += 5 * dira;\n imageDog.style.left = `${topPosa}px`;\n requestAnimationFrame(leftRight);\n}", "title": "" }, { "docid": "483dcbb19408028090ba61b99a54fe73", "score": "0.59069324", "text": "function jog_direction(direction) {\n\tmachine.jog(direction);\n}", "title": "" }, { "docid": "b53c1eb45c42f94e861adf6e6269ec9b", "score": "0.5904009", "text": "moveForward(){\r\n this.leftWheel.forward();\r\n this.rightWheel.forward();\r\n }", "title": "" }, { "docid": "78de733f2fdbdab8228e721dedd14f32", "score": "0.58963346", "text": "set moveDirection(value) {}", "title": "" }, { "docid": "b7f7d756c59f517833484e5e182527eb", "score": "0.58937615", "text": "function keyPressed() {\n if (keyCode === UP_ARROW ){\n s.dir(0, -1);\n} else if (keyCode === DOWN_ARROW){\n s.dir(0, 1);\n} else if (keyCode === RIGHT_ARROW){\ns.dir(1, 0);\n} else if (keyCode === LEFT_ARROW){\ns.dir(-1, 0);\n}\n\n}", "title": "" }, { "docid": "3b30d9fc021f388f0c5034f82acb0b11", "score": "0.5892853", "text": "void update() {\n x = x + (speed * xDirection);\n if (x >= unit || x <= 0) {\n xDirection *= -1;\n x = x + (1 * xDirection);\n y = y + (1 * yDirection);\n }\n if (y >= unit || y <= 0) {\n yDirection *= -1;\n y = y + (1 * yDirection);\n }\n }", "title": "" }, { "docid": "ccdff4b458ec2948dfad0dbba0603f65", "score": "0.5891128", "text": "function animateEntrance() { // eslint-disable-line no-unused-vars\r\n $(\".player-sprite\").css({ left: \"-50vw\" });\r\n $(\".player-stats\").css({ top: \"-10vw\" });\r\n $(\".enemy-stats\").css({ top: \"-10vw\" });\r\n $(\".player-sprite\").animate({ left: \"+=50vw\" }, 3500);\r\n setTimeout(function () {\r\n $(\".player-stats\").animate({ \"top\": \"+=12vw\" }, 1450, \"easeOutBounce\");\r\n $(\".enemy-stats\").animate({ \"top\": \"+=12vw\" }, 1550, \"easeOutBounce\");\r\n }, 3500);\r\n}", "title": "" }, { "docid": "059456935856a2ba2f592a39f455188b", "score": "0.5888657", "text": "function moveLeft(){\n $('#cartoon').animate({\n left: \"-=\" +bg},\n 9500, moveRight)\n }", "title": "" }, { "docid": "62fcfd8c6195e72b158d4d56912ec4d6", "score": "0.5885284", "text": "_computePositionAnimationState(dir = this._getLayoutDirection()) {\n if (this._positionIndex < 0) {\n this._position = dir == 'ltr' ? 'left' : 'right';\n }\n else if (this._positionIndex > 0) {\n this._position = dir == 'ltr' ? 'right' : 'left';\n }\n else {\n this._position = 'center';\n }\n }", "title": "" }, { "docid": "59cf776fe9ee310ccd65a8099ff03bf1", "score": "0.58828676", "text": "function slowMove_update() {\n this.frameCounter++;\n // this.frameCounter = this.frameCounter % 2;\n if (this.frameCounter % 2 === 1) {\n this.middleY = this.middleY + 1;\n }\n}", "title": "" }, { "docid": "6f89d8b655eef8ad4bacd3fd5c0b4f26", "score": "0.58822834", "text": "moveSelf() {\n if (this.direction === \"N\") {\n this.y -= this.speed;\n } else if (this.direction === \"S\") {\n this.y += this.speed;\n } else if (this.direction === \"E\") {\n this.x += this.speed;\n } else if (this.direction === \"W\") {\n this.x -= this.speed;\n } else {\n console.log(\"Error: invalid direction\");\n }\n }", "title": "" }, { "docid": "03ef22d09895f8066da14b77b7b0ff18", "score": "0.5879762", "text": "onUpdate(timestamp, delta){\n if(this.wayPoints.length<=0){\n return\n }\n var waypoint = this.wayPoints[this.currentWP];\n var distance = waypoint.dist(this.sprite.position)\n if(distance <= 1){\n this.currentWP++;\n if(this.currentWP>=this.wayPoints.length){\n this.currentWP=0;\n }\n }\n // var angleDeg = Math.atan2(waypoint.x - this.sprite.position.x, waypoint.y - this.sprite.position.y) * 180 / Math.PI;\n var angleDeg = this.getAngle(waypoint,this.sprite.position);\n // console.log(\"angleDeg\",angleDeg)\n var pos = Vector.moveTowards(this.sprite.position,waypoint, 1.7);\n console.log(\"getCardinalDirection\",this.getCardinal(angleDeg))\n this.sprite.position.x += pos.x;\n this.sprite.position.y += pos.y;\n }", "title": "" }, { "docid": "94277ed39428712cf801cb0f2eea17f3", "score": "0.58782375", "text": "move(){\n this.x += gameState.speed * this.direction;\n if(this.x > canvas.width - this.width || this.x < 0) this.direction *= -1\n }", "title": "" }, { "docid": "c6a07722d5a4bde36bf5d9dd94665346", "score": "0.5878104", "text": "updateDirection() {\n if ((keyCode == UP_ARROW) & (this.dir != 'D')) {\n this.dir = 'U';\n } else if ((keyCode == RIGHT_ARROW) & (this.dir != 'L')) {\n this.dir = 'R';\n } else if ((keyCode == LEFT_ARROW) & (this.dir != 'R')) {\n this.dir = 'L';\n } else if ((keyCode == DOWN_ARROW) & (this.dir != 'U')) {\n this.dir = 'D';\n }\n }", "title": "" }, { "docid": "be3f093fc365a3e73eab11c641bd2659", "score": "0.5874565", "text": "function moveRight(){\n $('#cartoon').animate({\n left: \"+=\" +bg},\n 9500, moveLeft)\n }", "title": "" }, { "docid": "7205baf26ee1491a4429ddb01d876afe", "score": "0.5870351", "text": "handleInput(direction) {\n\t\t\n\t\tswitch (direction){\n\t\t\tcase 'left':\n\t\t\t\tif (this.x - this.xSpeed >= 0){\n\t\t\t\t\tthis.x -= this.xSpeed;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'right':\n\t\t\t\tif (this.x + this.xSpeed <= 404){\n\t\t\t\t\tthis.x += this.xSpeed;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'up':\t\t\t\t\n\t\t\t\tif (this.y - this.ySpeed >= 0){\n\t\t\t\t\tthis.y -= this.ySpeed;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'down':\n\t\t\t\tif (this.y + this.ySpeed <= 415){\n\t\t\t\t\tthis.y += this.ySpeed;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "67371910426cc2df604a810ee62930d5", "score": "0.5868746", "text": "moveDown() {\n this.sprite.stopAnimation();\n this.direction.x = 0;\n this.direction.y = 1;\n }", "title": "" }, { "docid": "2a45bc83056537ba98d3df7584b6d959", "score": "0.5867734", "text": "move() {\n if (this.facing == this.north) {\n this.y++;\n } else if (this.facing == this.east) {\n this.x++;\n } else if (this.facing == this.south) {\n this.y--;\n } else if (this.facing == this.west) {\n this.x--;\n }\n }", "title": "" }, { "docid": "3aff0cc01b6670ff05ed47ed5fa41e3c", "score": "0.5865663", "text": "function moveup() {\n if(dy!==1){\n dx=0;dy=-1;}\n}", "title": "" } ]
90e9ec1188680d1f04baac1eb79dce73
Gets fired when the user stops draging MARIUS WIES
[ { "docid": "532bc3f51074f4fdfd2983500c772e36", "score": "0.6506943", "text": "function dragEnd() {\r\n active = false;\r\n document.removeEventListener(\"mousemove\", drag);\r\n document.removeEventListener(\"mouseup\", dragEnd);\r\n}", "title": "" } ]
[ { "docid": "0705451c7bcab6bca61a67e510a2153e", "score": "0.6954919", "text": "function stopDragging(e) {\n deltaCenter = null;\n\tdeltaCenter2 = null;\n}", "title": "" }, { "docid": "4233ab5be025963eefc68835d7869daf", "score": "0.6834743", "text": "function stopDrag()\r\n{\r\n currentDraggedObject = null;\r\n document.body.onmousemove = null;\r\n \r\n canDrag = true;\r\n mouseMoveHandler = null;\r\n}", "title": "" }, { "docid": "53b60b21bfa472db5585edf12e042855", "score": "0.6710544", "text": "function stop() {\n view.root.removeEventListener(\"mouseup\", stop);\n view.root.removeEventListener(\"dragstart\", stop);\n view.root.removeEventListener(\"mousemove\", move);\n if (key.getState(view.state) != null) { view.dispatch(view.state.tr.setMeta(key, -1)); }\n }", "title": "" }, { "docid": "53b60b21bfa472db5585edf12e042855", "score": "0.6710544", "text": "function stop() {\n view.root.removeEventListener(\"mouseup\", stop);\n view.root.removeEventListener(\"dragstart\", stop);\n view.root.removeEventListener(\"mousemove\", move);\n if (key.getState(view.state) != null) { view.dispatch(view.state.tr.setMeta(key, -1)); }\n }", "title": "" }, { "docid": "53b60b21bfa472db5585edf12e042855", "score": "0.6710544", "text": "function stop() {\n view.root.removeEventListener(\"mouseup\", stop);\n view.root.removeEventListener(\"dragstart\", stop);\n view.root.removeEventListener(\"mousemove\", move);\n if (key.getState(view.state) != null) { view.dispatch(view.state.tr.setMeta(key, -1)); }\n }", "title": "" }, { "docid": "bda979eb9fbcacd6dcdba33c5620e313", "score": "0.6615766", "text": "function stop_dragging()\n{\n // make the product non-transparent when the dragging ends\n this.alpha = 1;\n // stop the dragging of the product\n this.dragging = false;\n // set the interaction data to null\n this.data = null;\n}", "title": "" }, { "docid": "54bf33dbad133104cf97856cc516e8df", "score": "0.6589808", "text": "function stopDrag(selected) {\n selected.body.moves = true;\n }", "title": "" }, { "docid": "4fe931986d760e2be5b5be8c3ecae41c", "score": "0.6501309", "text": "onKnobTouchEnd(e){\n if (!e) var e = window.event\n this.isStartMove = false\n }", "title": "" }, { "docid": "e75f77401fe15d9e7ac462da0233afff", "score": "0.64698714", "text": "dragEndHandler() {\n this.setPropertyState('dragging', false);\n }", "title": "" }, { "docid": "6b1eab0546f6583a0a440d80e2ccace0", "score": "0.6445572", "text": "function StopDrag_1() {\n\tNumber_1.x = NUMBER_1_POSX;\n\tNumber_1.y = NUMBER_1_POSY;\n\tscore_f();\n}", "title": "" }, { "docid": "0a8e804eb6eed72869977eab340a16c9", "score": "0.6413585", "text": "stopDrag (e) {\n if (!this.isDragging) return;\n\n $('body').unbind('mousemove');\n this.doDrag(e);\n this.isDragging = false;\n }", "title": "" }, { "docid": "6ed8a026b3b602615addae0f7d49e0d0", "score": "0.6393254", "text": "interruptDrag() {\n if ( this.dragHandler.isPressed ) {\n this.dragHandler.interrupt();\n }\n }", "title": "" }, { "docid": "3533c1b797ebcc0c5966b01bcd10dee2", "score": "0.6391328", "text": "function dragend(d) {\n\t\n}", "title": "" }, { "docid": "113bab8a847c0b85967649a66b85c10b", "score": "0.63885546", "text": "function stop() {\n view.root.removeEventListener(\"mouseup\", stop);\n view.root.removeEventListener(\"dragstart\", stop);\n view.root.removeEventListener(\"mousemove\", move);\n if (index_es_key.getState(view.state) != null) { view.dispatch(view.state.tr.setMeta(index_es_key, -1)); }\n }", "title": "" }, { "docid": "4efd9139b363995647f1284deb5165d0", "score": "0.6384994", "text": "function dragEnd() {\n setTimeout(() => {\n setisDrag(false)\n }, 200);\n }", "title": "" }, { "docid": "60ef876302928fd2965f3e9234376a25", "score": "0.637057", "text": "stopDragging() {\n this.dragging = false;\n this.dragSelectedPatients = [];\n }", "title": "" }, { "docid": "e6c18e7f7f5c869839b8b6d651a4fc04", "score": "0.63646847", "text": "function stopKnobUpdate() {\n canvas.removeEventListener(\"mousemove\", updateKnobPostion);\n canvas.removeEventListener(\"touchmove\", updateKnobPostion);\n animate = false;\n joystick.down = false;\n window.cancelAnimationFrame(id);\n }", "title": "" }, { "docid": "ba5ec31cde8a5c6bb93b24904dead2bf", "score": "0.63474584", "text": "stopDrag() {\n const x = this._lastX;\n const y = this._lastY;\n\n if (this._dragStarted) {\n const start = this._dragStarted;\n this._dragStarted = null;\n this._dragHandle = null;\n start.then(drag => {\n if (drag) {\n return this.context.dragDropContext.endDrag(drag, x, y).then(cancelled => {\n this.props.onDragEnd(drag.handle, cancelled);\n });\n }\n });\n }\n }", "title": "" }, { "docid": "e0b2f0119a2ca61184e5190907d91386", "score": "0.6340661", "text": "function touchMoved() {\n return false;\n}", "title": "" }, { "docid": "e0b2f0119a2ca61184e5190907d91386", "score": "0.6340661", "text": "function touchMoved() {\n return false;\n}", "title": "" }, { "docid": "072a3a726085242e243bec324e4976a3", "score": "0.6334253", "text": "function onDragEnd() {\n draggedElement = null;\n lastEnteredElement = null;\n\n stopLongHoldTimer();\n removeAnyActiveClass();\n}", "title": "" }, { "docid": "a37c2daf97542f87d3c58b6f0305937c", "score": "0.632258", "text": "onScrollerDragEnd() {\n\t\tthis.block.setElMod(this.$refs.scroller, 'scroller', 'active', false);\n\t}", "title": "" }, { "docid": "05059117a9a49fe7f1aeea618a5668bf", "score": "0.6300154", "text": "function StopDrag_7() {\n\tNumber_7.x = NUMBER_7_POSX;\n\tNumber_7.y = NUMBER_7_POSY;\n\tscore_f();\n}", "title": "" }, { "docid": "6274d54bc46382a13bc87a410417cdd8", "score": "0.62593204", "text": "function dragEnd (e) {\n self.draggy.position = self.position;\n classes(self.draggy.ele).remove('activeDrag');\n self.dispatchEvent(onDrop);\n d.removeEventListener(events.move, dragMove);\n d.removeEventListener(events.end, dragEnd);\n }", "title": "" }, { "docid": "475ccb80aa278086801086a3219dfdf6", "score": "0.6245768", "text": "function stopMovement() {\n \n}", "title": "" }, { "docid": "5916a4bf9120a88d538af48a843f1846", "score": "0.6241734", "text": "function onDragEnd() {\n this.dragging = false;\n this.data = null;\n}", "title": "" }, { "docid": "3fe6aa91932a7ed403d02ed85c6c9c99", "score": "0.6229014", "text": "function endDrag() {\n\n //Remove the events bindings\n document.onmouseup = null;\n document.onmousemove = null;\n }", "title": "" }, { "docid": "12e94dc38d483ce824cbc9a5c634890a", "score": "0.6201546", "text": "dragend(){\r\n if ( this.removable ){\r\n this.visibleBin = false;\r\n this.draggedIdx = -1;\r\n }\r\n }", "title": "" }, { "docid": "2385a96a9697c3d22a9b4272e357cfdf", "score": "0.619886", "text": "mouseReleased() {\n this.isMoving = false;\n }", "title": "" }, { "docid": "b177209f9a3de10d3d50c2a0098c6a8c", "score": "0.6192553", "text": "released() {\n this.dragging = false;\n }", "title": "" }, { "docid": "ae91f31c9c800a0418092b2e6691d069", "score": "0.617798", "text": "function stopDraggingAction() {\n\tconsole.log(\"A drag has stopped\");\n\t// if we were panning, stop the panning\n\tif (movingViewPort) {\n\t\tmovingViewPort = false;\n\t\tconsole.log(\"Panning has stopped\");\n\n\t// otherwise we need to end a box selection\n\t} else if (boxSelectionX != null) {\n\t\t//deselect all of the previously selected cells\n\t\tdeselectAllCells();\n\n\t\tvar curX = curMousePos.x;\n\t\tvar curY = curMousePos.y\n\n\t\tvar rect = smartRect(boxSelectionX, boxSelectionY, curX, curY);\n\n\t\tvar enclosed = paper.findViewsInArea(rect);\n\t\tfor (var i = 0; i < enclosed.length; i++) {\n\t\t\tenclosed[i].highlight();\n\t\t}\n\n\t\t// clear the property box\n\t\t$$(\"propertiesFormId\").reconstruct();\n\n\t\t// remove all drawn selection boxes\n\t\t$(\".selectionBox\").remove();\n\n\t\t// reset the box selection start values\n\t\tboxSelectionX = null;\n\t\tboxSelectionY = null;\n\t\tconsole.log(\"Box selection has stopped\");\n\t}\n}", "title": "" }, { "docid": "c75c95c3cd3505c63294a7543babe303", "score": "0.61699325", "text": "function DIF_enddrag(e) {\n\tDIF_dragging=false;\n\tDIF_iframeBeingDragged=\"\";\n\t}", "title": "" }, { "docid": "08bec626b9db7b1f34989fb2d1e7ce03", "score": "0.61588115", "text": "function stopDrag_4() {\n\tBird_4.scale.setTo(0.8);\n\tif (Bird_4.y < 324 && Bird_4.y > 165 && Bird_4.x < 406 && Bird_4.x > 238) {\n\t\tBird_4.inputEnabled = false;\n\t\tBird_4.x = '342.6';\n\t\tBird_4.y = '248.6';\n\t\tScore++;\n\t\tsound[1].play();\n\t} else {\n\t\tBird_4.x = BIRD_4_POSX;\n\t\tBird_4.y = BIRD_4_POSY;\n\t\tBird_4.scale.setTo(1);\n\t\tsound[2].play();\n\t}\n\tProcess();\n}", "title": "" }, { "docid": "795d469c6969820673553907827abaef", "score": "0.6149028", "text": "onMousedown(event) {\n if (this.dragState) {\n this.dragState = null\n this._onDragEnd(event)\n }\n }", "title": "" }, { "docid": "00aa5fe0cd56ab10bf29e2bf758fad7b", "score": "0.61415315", "text": "function onDocumentMouseUp() {\n isMoving = false;\n $document.off('mousemove', onDocumentMouseMoveThrottled);\n $document.off('mouseup', onDocumentMouseUp); \n }", "title": "" }, { "docid": "ea573adafa8e762113eab7c92920c7c9", "score": "0.61214566", "text": "function flightsDragEndHandler(ev) {\n dragEventCounter--;\n if (dragEventCounter === 0) {\n $(\".drop_box\").hide();\n $(\".internal\").show();\n $(\".external\").show();\n $(\".flights *\").css(\"pointer-events\", \"\");\n }\n}", "title": "" }, { "docid": "36cb7e3ef720d9fbb977050d28758e40", "score": "0.6110949", "text": "function stopDrag_3() {\n\tBird_3.scale.setTo(0.8);\n\tif (Bird_3.y < 154 && Bird_3.y > 26 && Bird_3.x < 1170 && Bird_3.x > 978) {\n\t\tBird_3.inputEnabled = false;\n\t\tBird_3.x = '1078.9';\n\t\tBird_3.y = '70.2';\n\t\tScore++;\n\t\tsound[1].play();\n\t} else {\n\t\tBird_3.x = BIRD_3_POSX;\n\t\tBird_3.y = BIRD_3_POSY;\n\t\tBird_3.scale.setTo(1);\n\t\tsound[2].play();\n\t}\n\tProcess();\n}", "title": "" }, { "docid": "a6c9545d613b2b21124b868aefc44eb7", "score": "0.6103145", "text": "function dragended(d) {\n // we are doing nothing, here , aren't we?\n }", "title": "" }, { "docid": "ffd51d0aa05ccb8e904f7aefdc1ecb70", "score": "0.6091476", "text": "function endDrag(d) {\n\t if (!d3.event.active) sim.alphaTarget(0);\n\t \td.fx = null;\n\t \td.fy = null;\n\t}", "title": "" }, { "docid": "0db47894e0a213b1679781cd528ba476", "score": "0.6089417", "text": "dragStart() {\n return false;\n }", "title": "" }, { "docid": "1d6ccc7146ef68107c427616a309c6a0", "score": "0.6069906", "text": "function mouseIsPressed() {\n vroom.stop();\n\n}", "title": "" }, { "docid": "fd8e3a5dd1e8d2e39bc24f2a4b7228d0", "score": "0.60507846", "text": "function leaveDroppable() {\n document.removeEventListener('mousemove', onMouseMove);\n swal({\n title: \"ERROR!\",\n text: \"Please stay inside the blueprint.\",\n icon: \"error\"\n })\n self.stopDragNDropLogic()\n }", "title": "" }, { "docid": "cdfec7a78be346fa62338b68f1148c81", "score": "0.6043014", "text": "function onInertiaStart(e) {\n var target = getManipulationElement(e.target);\n target.gestureObject.stop(e.pointerId);\n }", "title": "" }, { "docid": "6e7e734881d51e4816c72575df98fb22", "score": "0.60393155", "text": "function myAgendaDragStop(eventObj,divElm,agendaItem){\n\t\t//alert(\"drag stop\");\n\t}", "title": "" }, { "docid": "f790c20a7f1bfca3d98572ad8aa6ec8e", "score": "0.60347754", "text": "function touchMoved() {\n // do some stuff\n return false;\n}", "title": "" }, { "docid": "93c2f22d7933777a5569df1a8e708446", "score": "0.60275763", "text": "function reactionMouseUp (e) { \r\n drag = false; // Zugmodus deaktivieren \r\n }", "title": "" }, { "docid": "8ac7e07e1364ad083dc7292ef25fdd59", "score": "0.6021822", "text": "stopMotion(){\n clearInterval(this.interval);\n }", "title": "" }, { "docid": "12abe9f5e7540a3c1794a38c65ed25d7", "score": "0.6011893", "text": "function stopDrag_1() {\n\tBird_1.scale.setTo(0.8);\n\tif (Bird_1.y > 320 && Bird_1.y < 443 && Bird_1.x < 1125 && Bird_1.x > 940) {\n\t\tBird_1.inputEnabled = false;\n\t\tBird_1.x = '1033.6';\n\t\tBird_1.y = '363.9';\n\t\tScore++;\n\t\tsound[1].play();\n\t} else {\n\t\tBird_1.x = BIRD_1_POSX;\n\t\tBird_1.y = BIRD_1_POSY;\n\t\tBird_1.scale.setTo(1);\n\t\tsound[2].play();\n\t}\n\tProcess();\n}", "title": "" }, { "docid": "eeaa085aba8354603f30d33d33b84f17", "score": "0.6008079", "text": "function stopDragging() {\n var self = this;\n var a = elements[self.a].element;\n var b = elements[self.b].element;\n\n if (self.dragging) {\n getOption(options, 'onDragEnd', NOOP)(getSizes());\n }\n\n self.dragging = false;\n\n // Remove the stored event listeners. This is why we store them.\n global[removeEventListener]('mouseup', self.stop);\n global[removeEventListener]('touchend', self.stop);\n global[removeEventListener]('touchcancel', self.stop);\n global[removeEventListener]('mousemove', self.move);\n global[removeEventListener]('touchmove', self.move);\n\n // Clear bound function references\n self.stop = null;\n self.move = null;\n\n a[removeEventListener]('selectstart', NOOP);\n a[removeEventListener]('dragstart', NOOP);\n b[removeEventListener]('selectstart', NOOP);\n b[removeEventListener]('dragstart', NOOP);\n\n a.style.userSelect = '';\n a.style.webkitUserSelect = '';\n a.style.MozUserSelect = '';\n a.style.pointerEvents = '';\n\n b.style.userSelect = '';\n b.style.webkitUserSelect = '';\n b.style.MozUserSelect = '';\n b.style.pointerEvents = '';\n\n self.gutter.style.cursor = '';\n self.parent.style.cursor = '';\n document.body.style.cursor = '';\n }", "title": "" }, { "docid": "5bf893987e71681a34e463a05d6932eb", "score": "0.60079646", "text": "dragEnd() {\n this.sendAction('dragging');\n }", "title": "" }, { "docid": "11e576ab6740c46f7773a8155e3289f0", "score": "0.60071653", "text": "function Stop() {\n if (_running) {\n Reset();\n GeolocationSvc.Stop();\n DataManagerSvc.RemoveListenerDataChange(OnDataChange);\n document.removeEventListener('device_move_xy', OnDeviceMove, false);\n _running = false;\n }\n }", "title": "" }, { "docid": "dff984d2ff8a80110dfd5d4323c7bc10", "score": "0.59910715", "text": "function unmove() {\n mMoved = false;\n }", "title": "" }, { "docid": "517883f4d82abea56fdd05613ea31945", "score": "0.59840494", "text": "function mouseUp(ev){\n dragObject = null;\n}", "title": "" }, { "docid": "39b98d2c22272696b92bab0d2ae07566", "score": "0.597597", "text": "_onDragEnd(event) {\n this.carouselService.owlDOMData.isGrab = false;\n this.listenerOneMouseMove();\n this.listenerOneTouchMove();\n if (this._drag.moving) {\n this.renderer.setStyle(this.el.nativeElement.children[0], 'transform', ``);\n this.renderer.setStyle(this.el.nativeElement.children[0], 'transition', this.carouselService.speed(+this.carouselService.settings.dragEndSpeed || this.carouselService.settings.smartSpeed) / 1000 + 's');\n this._finishDragging(event);\n this.listenerMouseMove();\n this.listenerTouchMove();\n }\n this._drag = {\n time: null,\n target: null,\n pointer: null,\n stage: {\n start: null,\n current: null\n },\n direction: null,\n active: false,\n moving: false\n };\n // this.carouselService.trigger('dragged');\n this.listenerMouseUp();\n this.listenerTouchEnd();\n }", "title": "" }, { "docid": "39b98d2c22272696b92bab0d2ae07566", "score": "0.597597", "text": "_onDragEnd(event) {\n this.carouselService.owlDOMData.isGrab = false;\n this.listenerOneMouseMove();\n this.listenerOneTouchMove();\n if (this._drag.moving) {\n this.renderer.setStyle(this.el.nativeElement.children[0], 'transform', ``);\n this.renderer.setStyle(this.el.nativeElement.children[0], 'transition', this.carouselService.speed(+this.carouselService.settings.dragEndSpeed || this.carouselService.settings.smartSpeed) / 1000 + 's');\n this._finishDragging(event);\n this.listenerMouseMove();\n this.listenerTouchMove();\n }\n this._drag = {\n time: null,\n target: null,\n pointer: null,\n stage: {\n start: null,\n current: null\n },\n direction: null,\n active: false,\n moving: false\n };\n // this.carouselService.trigger('dragged');\n this.listenerMouseUp();\n this.listenerTouchEnd();\n }", "title": "" }, { "docid": "e7ea58422319575265baf599e88d6a32", "score": "0.59710634", "text": "function stopDrag_2() {\n\tBird_2.scale.setTo(0.8);\n\tif (Bird_2.y < 277 && Bird_2.y > 130 && Bird_2.x < 143 && Bird_2.x > -40) {\n\t\tBird_2.inputEnabled = false;\n\t\tBird_2.x = '62.4';\n\t\tBird_2.y = '187.4';\n\t\tScore++;\n\t\tsound[1].play();\n\t} else {\n\n\t\tBird_2.x = BIRD_2_POSX;\n\t\tBird_2.y = BIRD_2_POSY;\n\t\tBird_2.scale.setTo(1);\n\t\tsound[2].play();\n\t}\n\tProcess();\n}", "title": "" }, { "docid": "a693c4d828a5f8f23db201a00231f10c", "score": "0.5969836", "text": "function dragEnd(e) {\n //Get the new location of the object.\n itemLocationX[itemNum] = currentX;\n itemLocationY[itemNum] = currentY;\n\n //active is set to false to prevent dragging when the mouse/finger isn't clicked down.\n active = false;\n}", "title": "" }, { "docid": "4e9aa34533f1af0ab4d3cf7b30ebd0d8", "score": "0.5967813", "text": "function windowFocusLeave(){\r\n\tappState.dragInProgress = false;\r\n\tappState.dragOverlayEntered = false;\r\n}", "title": "" }, { "docid": "ca06b3243c7813e2d839d297c30de496", "score": "0.5960196", "text": "function stopMoving(event) {\n var direction = getInputDirection(event.event.keyCode);\n \n if (direction === 'up' || direction === 'down') {\n player.walking = false;\n }\n }", "title": "" }, { "docid": "2b8362cec667012795f59dc52ceb677a", "score": "0.5958025", "text": "function moveOn() {\r\n stop = true;\r\n}", "title": "" }, { "docid": "11f77d824d170d76162cbe40b1e3554b", "score": "0.5952334", "text": "function parachutePinchListener () {\n $this.dropParachute();\n }", "title": "" }, { "docid": "3df52db1d90ae142b59dc32b57e44780", "score": "0.5945513", "text": "onDragEndMapSeries() {\n this.isDrag = false;\n }", "title": "" }, { "docid": "6fbd803ea3ae19050e2447116beb0265", "score": "0.5944533", "text": "onDragEnd(e, gesture) {\n // Get the drag coordinates\n const [x, y] = [\n gesture.moveX * this.context.dragDropContext.scale,\n gesture.moveY * this.context.dragDropContext.scale,\n ];\n\n this._lastX = x;\n this._lastY = y;\n\n // Do the stopping\n this.stopDrag();\n }", "title": "" }, { "docid": "addc8cd9ec80160ebf924bf230209941", "score": "0.59399253", "text": "function touchEnd(element, clientX, clientY) {\n element[symbols.dragging] = false;\n if (element[deltaXSymbol] >= 20) {\n // Finished going right at high speed.\n element[symbols.goLeft]();\n } else if (element[deltaXSymbol] <= -20) {\n // Finished going left at high speed.\n element[symbols.goRight]();\n } else {\n // Finished at low speed.\n trackTo(element, clientX);\n const travelFraction = element.travelFraction;\n if (travelFraction >= 0.5) {\n element[symbols.goRight]();\n } else if (travelFraction <= -0.5) {\n element[symbols.goLeft]();\n }\n }\n element.travelFraction = 0;\n element[deltaXSymbol] = null;\n element[deltaYSymbol] = null;\n}", "title": "" }, { "docid": "d0ff2d45f7c135ab145a5836171ea6ec", "score": "0.5937388", "text": "function stopDragover() {\n placeholder.remove();\n element.removeClass(\"dndDragover\");\n return true;\n }", "title": "" }, { "docid": "63555b3527d7a84ea72312ecce505b1b", "score": "0.5934006", "text": "function stopResizing() {\t\t\t\t//Function that removes border and listeners for resizing\n\t\t\t\t\ttemp.resizing = false;\n\t\t\t\t\ttemp.widget.style.outline = \"none\";\n\n\t\t\t\t\ttemp.resized();\n\n\t\t\t\t\twindow.removeEventListener(touchstart, mouseDown);\n\t\t\t\t\twindow.removeEventListener(touchstart, mouseDown);\n\t\t\t\t\tremoveListeners();\n\t\t\t\t}", "title": "" }, { "docid": "9f3b54352c3c09a21cffc1757db89e15", "score": "0.59334564", "text": "function stop(event) {\n\n\t\tvar data = event.data,\n\t\ttarget = data.target,\n\t\toptions = data.options,\n\t\tflags = data.flags,\n\t\tthumbs = data.thumbs,\n\n\t\t// hides the thumbs after the animation is done\n\t\tdone = function () {\n\t\t\tif (thumbs && !options.hoverThumbs) {\n\t\t\t\ttoggleThumbs(thumbs, options, false);\n\t\t\t}\n\t\t};\n\n\t\t// remove drag listeners from doc or target\n\t\tif(options.dragHold) {\n\t\t\t$(document).unbind(events.drag, drag);\n\t\t} else {\n\t\t\ttarget.unbind(events.drag, drag);\n\t\t}\n\n\t\t// only fire events and drift if we started with a\n\t\t// valid position\n\t\tif (data.position) {\n\n\t\t\ttriggerEvent('dragend', target);\n\n\t\t\t// only drift if a drag passed our threshold\n\t\t\tif (flags.dragging && !compat().overflowScrolling) {\n\t\t\t\tdrift(target.get(0), event, done);\n\t\t\t} else {\n\t\t\t\tdone();\n\t\t\t}\n\n\t\t}\n\n\t\t// only if we moved, and the mouse down is the same as\n\t\t// the mouse up target do we defer the event\n\t\tif (flags.dragging && !compat().overflowScrolling && data.start && data.start.is(event.target)) {\n\t\t\tdeferClick(data.start);\n\t\t}\n\n\t\t// clear all internal flags and settings\n\t\ttarget.data(datakey).dragging =\n\t\t\tdata.start =\n\t\t\tdata.capture =\n\t\t\tdata.position =\n\t\t\tflags.dragged =\n\t\t\tflags.dragging = false;\n\n\t\t// set the cursor back to normal\n\t\ttarget.css('cursor', compat().cursor.grab);\n\n\t}", "title": "" }, { "docid": "fe2ec5016c58bc44826640fe52f5b91a", "score": "0.5928414", "text": "function blockDrag()\r\n{\r\n currentDraggedObject = null;\r\n canDrag = false;\r\n}", "title": "" }, { "docid": "464f20f44d092c9667890d314b3088fd", "score": "0.592841", "text": "function drop() {\n let cnv = document.getElementById(\"canvas\");\n\n cnv.removeEventListener(\"mousemove\", move, false);\n cnv.removeEventListener(\"mouseup\", drop, false);\n cnv.style.cursor = \"crosshair\";\n}", "title": "" }, { "docid": "4b104ebea89a61e7eae561fe4bb47552", "score": "0.59227353", "text": "stopMomentum() {\n if (this._native.timeoutId) {\n qx.event.Registration.getManager(this._originalTarget)\n .getHandler(qx.event.handler.Gesture)\n .stopMomentum(this._native.timeoutId);\n }\n }", "title": "" }, { "docid": "6ba15dba98cef092dc26bdbfa64ff118", "score": "0.5906301", "text": "function stopDragover() {\n\t placeholder.remove();\n\t element.removeClass(\"dndDragover\");\n\t return true;\n\t }", "title": "" }, { "docid": "a6c621826f82129c4ba37ff6f970c84f", "score": "0.5877353", "text": "async onDragEnd() {\r\n this.getParent().updateMovedLocations();\r\n }", "title": "" }, { "docid": "3b7d299a5cbd11093c84689fd5622756", "score": "0.5871134", "text": "function stopAdjusting() {\n adjustingPrice = false;\n canvasOne.removeEventListener('mouseup', stopAdjusting);\n canvasOne.removeEventListener('mousemove', stopAdjusting);\n }", "title": "" }, { "docid": "a5dcb449d86c3b4f8f367b8a2c3594f6", "score": "0.5866507", "text": "function onDragEnd() {\n dragSelectionState = null;\n}", "title": "" }, { "docid": "3a41c29b3103b2290bfd542d6118a4e1", "score": "0.5859593", "text": "function _mouseUp() {\n if (_dragStarted) {\n _triggerHandler(paper.draggable.current(), \"dragend\");\n }\n\n paper.draggable.clearCurrent();\n }", "title": "" }, { "docid": "aa77f3412e23bd3c36fca374a9580ba1", "score": "0.5857955", "text": "function myUp(e) {\n for(index in citybrand.lines) {\n var line = citybrand.lines[index];\n line.dragging = false;\n }\n \n citybrand.progress.dragging = false;\n \n citybrand.allDrag = false;\n \n citybrand.render();\n}", "title": "" }, { "docid": "6c37790e243770a3985f3bfd94e13358", "score": "0.58553797", "text": "function dragEnd( e ) {\n posEnd = _getPos();\n\n let isLastSlide = instance.current() == instance.length() - 1;\n let isFirstSlide = instance.current() == 0;\n \n // if the drag is longer than threshold, move to next/prev\n if( posEnd - posInitial < -threshold && !isLastSlide ) {\n instance.next();\n } else if( posEnd - posInitial > threshold && !isFirstSlide ) {\n instance.prev();\n }\n // if the drag is shorter than threshold, stay in current slide\n else {\n _setPos( posInitial );\n }\n\n // prevent click if already dragging\n if( e.type == 'mouseup' ) {\n this.isDrag ?\n e.target.addEventListener( 'click', hSlider_preventClick )\n :\n e.target.removeEventListener( 'click', hSlider_preventClick );\n\n this.isDrag = false;\n }\n\n document.onmouseup = null;\n document.onmousemove = null;\n }", "title": "" }, { "docid": "c095a591aa07d673be432d610b925db5", "score": "0.58411276", "text": "function ondragend() {\n $timeout(function() {\n localStorage.setItem('checkmove', false);\n }, 100);\n var newX = vm.sceneEditSphere.getHotspotParam(vm.hotspot.name, 'ath'),\n newY = vm.sceneEditSphere.getHotspotParam(vm.hotspot.name, 'atv');\n\n var SphereOld = vm.sceneEditSphere.spheretoscreen(vm.hotspot.position.x, vm.hotspot.position.y);\n var SphereNew = vm.sceneEditSphere.spheretoscreen(newX, newY);\n\n vm.hotspot.position.x = newX;\n vm.hotspot.position.y = newY;\n\n if ((Math.abs(SphereOld.x - SphereNew.x) >= 2) && (Math.abs(SphereOld.y - SphereNew.y) >= 2)) {\n // it really a drag event\n saveForm();\n } else {\n // it just a click event\n showForm();\n }\n }", "title": "" }, { "docid": "ae012b4178355435b77d2b04ef30f2b8", "score": "0.5835847", "text": "stop () {\n if (!this.started) return\n Events.off(this.root, 'mousedown mouseover mouseout mouseenter mouseleave dblclick click contextmenu mousewheel', this.handler)\n this.stopKeys()\n this.started = false\n }", "title": "" }, { "docid": "cee98a597343debe97a2be4ee77e3f4d", "score": "0.58356845", "text": "function mouseReleased()\n{\n mouseWasPressed = false;\n if ( mouseButton === LEFT || mouseButton === RIGHT )\n {\n clearInterval( blast_interval );\n clearInterval( missile_interval );\n }\n}", "title": "" }, { "docid": "07416a676d21473d084ecd80b8f3e8ee", "score": "0.58345854", "text": "_removedHook() {\n this._viewer.off(SceneEventType.CAMERA_MOVE_END, this._reset, this)\n }", "title": "" }, { "docid": "0a4164d9d78b4c04d8cc97aba62481e9", "score": "0.58337504", "text": "function onDragLeave() {\n hideDropIndicator();\n}", "title": "" }, { "docid": "2df047ba7c205b395d4151c0f264ee46", "score": "0.5826057", "text": "function unregRectEvents(){\n pad.stopObserving('mousedown');\n pad.stopObserving('mouseup');\n}", "title": "" }, { "docid": "fdf7177f9bc90b634089887b7e02be25", "score": "0.5823085", "text": "function destroyDragOnMouseDown() {\n document.removeEventListener('mouseup', destroyDragOnMouseDown);\n document.removeEventListener('mousemove', moveBall);\n}", "title": "" }, { "docid": "3bf7390fd560e843a9f2dc6a7f6be897", "score": "0.582266", "text": "function on_gizmo_drag_state( is_drag ){ App.cam_ctrl.active = !is_drag; }", "title": "" }, { "docid": "5a8b6f436c0c5c9bf8a8dc172943fe45", "score": "0.5820933", "text": "function stopDragover() {\n placeholder.remove();\n element.removeClass(\"dndDragover\");\n return true;\n }", "title": "" }, { "docid": "46c496bd1ef129a394e2905a2cea4a0c", "score": "0.581449", "text": "function finishDrag() {\n if (!isDragging) {\n return;\n }\n\n isDragging = false;\n\n dragElement.style.top = parseInt(dragElement.style.top) + window.pageYOffset + 'px';\n dragElement.style.position = 'absolute';\n\n document.removeEventListener('mousemove', onMouseMove);\n dragElement.removeEventListener('mouseup', onMouseUp);\n }", "title": "" }, { "docid": "179d74248c04dacc3c44bd31731302b5", "score": "0.58136284", "text": "function onTouchEnd(event){\n\t\t\n\t\tif(g_temp.isControlEnabled == false)\n\t\t\treturn(true);\n\t\t\t\t\n\t\tg_temp.buttonReleaseTime = jQuery.now();\n\t\t\n\t\tif(g_temp.touch_active == false){\n\t\t\tendStripTouchLoop(event);\n\t\t\treturn(true);\n\t\t}\n\t\t\n\t\tevent.preventDefault();\n\t\t\t\n\t\tg_temp.touch_active = false;\n\t\t\n\t\tendStripTouchLoop(event);\n\t\t\n\t\tg_objStrip.removeClass(\"ug-dragging\");\n\t\t\n\t}", "title": "" }, { "docid": "e2578b44d00dfcfa5e18a383d8c6b51e", "score": "0.58084464", "text": "function stopResize_y() {\n \n document.body.style.cursor = 'auto';\n window.removeEventListener('mousemove', resize_y);\n window.removeEventListener('mouseup', stopResize_y);\n \n _xyz.tableview.current_table.Tabulator.redraw(true);\n }", "title": "" }, { "docid": "e52031c027ca2262134b55f5c4d8bc1f", "score": "0.58074844", "text": "disconnectedCallback() {\n this.$start.removeEventListener('focus', this.focusLastElement);\n this.$end.removeEventListener('focus', this.focusFirstElement);\n this.removeEventListener('focusin', this.onFocusIn);\n this.removeEventListener('focusout', this.onFocusOut);\n }", "title": "" }, { "docid": "8f57073e325fc830b61639316386394b", "score": "0.5799538", "text": "function documentTouchEndHandler(event) {\n mouseIsDown = false;\n }", "title": "" }, { "docid": "279a7834e9fb01f71486ac6a8bd02afc", "score": "0.57957214", "text": "stop() {\n this.stopEvents = true;\n }", "title": "" }, { "docid": "b43caaab88a442b86cbc304e8d14ed7d", "score": "0.5791888", "text": "function mouseReleased(){\n //switch off the bulb\n off();\n }", "title": "" }, { "docid": "7b0771e086642e7e4a5ad7e839c60114", "score": "0.5785271", "text": "disableDrag() {\r\n this.disableDragEvents = true;\r\n }", "title": "" }, { "docid": "ee4185cec1b7f48a1300986a739a3bad", "score": "0.5768512", "text": "function myAgendaDragStop(eventObj,divElm,agendaItem){\n\talert(\"drag stop\");\n}", "title": "" }, { "docid": "3e09fbff4732e4677a8501afada86d4e", "score": "0.5750553", "text": "function clickStop(){\r\n this.dragging = false;\r\n this.data = null;\r\n}", "title": "" }, { "docid": "788ce906df119f5fc11bf5a33e6ced41", "score": "0.57465273", "text": "function dragMoveListener (event) {\n /*\n do whatever should be done when dragging something\n */\n\n hideIdleState(containerElem);\n // this function is triggered numerous times during drag,\n // so we don't transmit analytics events or reset timer for this: only on drag start or end\n}", "title": "" }, { "docid": "62c2067fec65536c3e591d013d761cd6", "score": "0.57459253", "text": "function dropper(event) {\n\n// Unregister the event handlers for mouseup and mousemove\n\n document.removeEventListener(\"mouseup\", dropper, true);\n document.removeEventListener(\"mousemove\", mover, true);\n\n// Prevent propagation of the event\n\n event.stopPropagation();\n\n reposition();\n} //** end of dropper", "title": "" }, { "docid": "25587e0e213f684c45e98973f4f590e4", "score": "0.57425636", "text": "stopDragging(drag) {\n const index = this._activeDragInstances.indexOf(drag);\n if (index > -1) {\n this._activeDragInstances.splice(index, 1);\n if (this._activeDragInstances.length === 0) {\n this._clearGlobalListeners();\n }\n }\n }", "title": "" }, { "docid": "d198b9d78191f5e82d18d3e588b34b9f", "score": "0.5742438", "text": "onDragLeave(event) {\n console.log('onDragEnter');\n this.isDragging = false;\n this.$emit('drag-leave', event);\n }", "title": "" } ]
66fbc51b5949aa7d9b11624a1b2a5e97
This functions computes discrete and numeric arrays of attribute values from line given data stream specification in JSON ASSUMES: Line is commaseparated
[ { "docid": "14a9cf88f6ceed28208eeb97c76ccf02", "score": "0.72990483", "text": "function line2array(line, jsonCfg) {\n line = line.trim().split(\",\");\n var example_discrete = [];\n var example_numeric = [];\n var i = 0;\n for (i = 0; i < jsonCfg[\"dataFormat\"].length-1; ++i) {\n var attributeName = jsonCfg.dataFormat[i];\n if (jsonCfg[attributeName].type == \"discrete\") {\n example_discrete.push(line[i]);\n } else {\n example_numeric.push(parseFloat(line[i]));\n }\n }\n \n var target = line[i];\n if (jsonCfg[jsonCfg.dataFormat[i]].type == \"numeric\") {\n target = parseFloat(target);\n }\n \n return {\"discrete\": example_discrete,\n \"numeric\": example_numeric,\n \"target\": target };\n}", "title": "" } ]
[ { "docid": "c46d84e49085851a54527f40514b6507", "score": "0.61886847", "text": "function getLinesArray() {\r\n var data = {\r\n \"41\": [\r\n [41.939304, 21.532305],\r\n [41.939404, 21.52361],\r\n [41.937293, 21.52205],\r\n [41.939392, 21.515914],\r\n [41.940764, 21.511826],\r\n [41.938147, 21.509144],\r\n [41.939903, 21.499818],\r\n [41.948545, 21.493598],\r\n [41.951697, 21.491536],\r\n [41.955391, 21.487418],\r\n [41.959285, 21.483663],\r\n [41.964925, 21.475292],\r\n [41.969784, 21.465296],\r\n [41.97316, 21.458109],\r\n [41.97574, 21.452552],\r\n [41.978947, 21.445648],\r\n [41.984494, 21.438474],\r\n [41.989338, 21.435917],\r\n [41.992305, 21.438599],\r\n [41.993293, 21.442551],\r\n [41.989861, 21.445324]\r\n ],\r\n \"7\": [\r\n [41.971498, 21.476887],\r\n [41.973949, 21.471652],\r\n [41.975384, 21.46854],\r\n [41.97723, 21.464583],\r\n [41.982909, 21.452522],\r\n [41.985625, 21.446546],\r\n [41.987188, 21.44322],\r\n [41.991079, 21.444851],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.998342, 21.424407],\r\n [41.999482, 21.418796],\r\n [42.000885, 21.411898],\r\n [42.001619, 21.406168],\r\n [42.00248, 21.399924],\r\n [42.003668, 21.391427],\r\n [42.007891,21.391089],\r\n ],\r\n \"15\": [\r\n [41.985071, 21.48359],\r\n [41.982343, 21.481512],\r\n [41.979803, 21.477402],\r\n [41.982004, 21.47266],\r\n [41.982723, 21.47116],\r\n [41.985402, 21.466416],\r\n [41.986741, 21.463991],\r\n [41.989134, 21.458048],\r\n [41.988336, 21.454121],\r\n [41.988751, 21.45013],\r\n [41.991207, 21.446203],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.998342, 21.424407],\r\n [41.999482, 21.418796],\r\n [42.000885, 21.411898],\r\n [42.001619, 21.406168],\r\n [42.00248, 21.399924],\r\n [42.003668, 21.391427],\r\n [42.007891,21.391089]\r\n ],\r\n \"15a\": [\r\n [41.985071, 21.48359],\r\n [41.982343, 21.481512],\r\n [41.979803, 21.477402],\r\n [41.982004, 21.47266],\r\n [41.982723, 21.47116],\r\n [41.985402, 21.466416],\r\n [41.986741, 21.463991],\r\n [41.989134, 21.458048],\r\n [41.988336, 21.454121],\r\n [41.988751, 21.45013],\r\n [41.991207, 21.446203],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.997811, 21.42846],\r\n [41.999627, 21.428543],\r\n [42.002824, 21.422036],\r\n [42.005806, 21.41635],\r\n [42.006675, 21.411313],\r\n [42.007082, 21.404682],\r\n [42.007255, 21.400214],\r\n [42.007518, 21.395879],\r\n [42.007606, 21.393626],\r\n [42.007891,21.391089]\r\n ],\r\n \"31\": [\r\n [41.958884, 21.538572],\r\n [41.957037, 21.535232],\r\n [41.955077, 21.532767],\r\n [41.952719, 21.531938],\r\n [41.949976, 21.530604],\r\n [41.945158, 21.5278],\r\n [41.943181, 21.526681],\r\n [41.939404, 21.52361],\r\n [41.937293, 21.52205],\r\n [41.939392, 21.515914],\r\n [41.940764, 21.511826],\r\n [41.938147, 21.509144],\r\n [41.939903, 21.499818],\r\n [41.948545, 21.493598],\r\n [41.951697, 21.491536],\r\n [41.955391, 21.487418],\r\n [41.959285, 21.483663],\r\n [41.964925, 21.475292],\r\n [41.969784, 21.465296],\r\n [41.97316, 21.458109],\r\n [41.97316, 21.458109],\r\n [41.978947, 21.445648],\r\n [41.984494, 21.438474],\r\n [41.989338, 21.435917],\r\n [41.992305, 21.438599],\r\n [41.993293, 21.442551],\r\n [41.989861, 21.445324]\r\n ],\r\n \"5\": [\r\n [41.986203,21.48164],\r\n [41.985071, 21.48359],\r\n [41.982343, 21.481512],\r\n [41.979803, 21.477402],\r\n [41.982004, 21.47266],\r\n [41.982723, 21.47116],\r\n [41.985402, 21.466416],\r\n [41.986741, 21.463991],\r\n [41.989134, 21.458048],\r\n [41.988336, 21.454121],\r\n [41.988751, 21.45013],\r\n [41.991207, 21.446203],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.995178, 21.423844],\r\n [41.994596, 21.417546],\r\n [41.995561, 21.410218],\r\n [41.99627, 21.405391],\r\n [41.996805, 21.40112],\r\n [41.998189, 21.391317],\r\n [41.998811, 21.386097],\r\n [41.999417, 21.382401],\r\n [42.001371, 21.377241],\r\n [42.003926, 21.373223],\r\n [42.006306, 21.369087],\r\n [42.007, 21.364551],\r\n [42.006703, 21.359104],\r\n [42.006484, 21.355062],\r\n [42.006273, 21.35092],\r\n [42.006267, 21.343639],\r\n [42.006983, 21.340756],\r\n [42.007861, 21.340004],\r\n [42.010556, 21.339907]\r\n ],\r\n \"2\": [\r\n [42.004057, 21.332267],\r\n [42.006832, 21.334025],\r\n [42.006983, 21.340756],\r\n [42.006267, 21.343639],\r\n [42.006273, 21.35092],\r\n [42.006484, 21.355062],\r\n [42.006703, 21.359104],\r\n [42.007, 21.364551],\r\n [42.008316, 21.3697],\r\n [42.007084, 21.374233],\r\n [42.004575, 21.384637],\r\n [42.003668, 21.391427],\r\n [42.00248, 21.399924],\r\n [42.001619, 21.406168],\r\n [42.000885, 21.411898],\r\n [41.999482, 21.418796],\r\n [41.998342, 21.424407],\r\n [41.997811, 21.42846],\r\n [41.999266, 21.43288],\r\n [41.998821, 21.439166],\r\n [42.000089, 21.44013],\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [42.001943, 21.439822],\r\n [41.999395, 21.452186],\r\n [42.000823, 21.459914],\r\n [42.001681, 21.465046]\r\n ],\r\n \"2a\": [\r\n [42.004057, 21.332267],\r\n [42.006832, 21.334025],\r\n [42.006983, 21.340756],\r\n [42.006267, 21.343639],\r\n [42.006273, 21.35092],\r\n [42.006484, 21.355062],\r\n [42.006703, 21.359104],\r\n [42.007, 21.364551],\r\n [42.008316, 21.3697],\r\n [42.007084, 21.374233],\r\n [42.004575, 21.384637],\r\n [42.003668, 21.391427],\r\n [42.00248, 21.399924],\r\n [42.001619, 21.406168],\r\n [42.000885, 21.411898],\r\n [41.999482, 21.418796],\r\n [41.998342, 21.424407],\r\n [41.997811, 21.42846],\r\n [41.999266, 21.43288],\r\n [41.998821, 21.439166],\r\n [42.000089, 21.44013],\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [42.001943, 21.439822],\r\n [41.999395, 21.452186],\r\n [42.000625, 21.45893],\r\n [42.00631, 21.46312],\r\n [42.013471,21.457608]\r\n ],\r\n \"42\": [\r\n [41.932764, 21.521019],\r\n [41.934891, 21.52147],\r\n [41.939392, 21.515914],\r\n [41.940764, 21.511826],\r\n [41.938147, 21.509144],\r\n [41.939903, 21.499818],\r\n [41.948545, 21.493598],\r\n [41.951697, 21.491536],\r\n [41.955391, 21.487418],\r\n [41.959285, 21.483663],\r\n [41.964925, 21.475292],\r\n [41.969784, 21.465296],\r\n [41.97311, 21.460973],\r\n [41.97723, 21.464583],\r\n [41.982723, 21.47116],\r\n [41.987673, 21.473525],\r\n [41.989265, 21.474044],\r\n [41.994193, 21.475514],\r\n [41.996682, 21.476005],\r\n [42.000896, 21.471327],\r\n [42.001681, 21.465046],\r\n [42.000823, 21.459914],\r\n [42.00631, 21.46312],\r\n [42.013471, 21.457608]\r\n ],\r\n \"13\": [\r\n [41.969161, 21.448571],\r\n [41.971373, 21.445166],\r\n [41.977903, 21.445148],\r\n [41.97316, 21.458109],\r\n [41.97574, 21.452552],\r\n [41.97311, 21.460973],\r\n [41.97723, 21.464583],\r\n [41.982723, 21.47116],\r\n [41.987673, 21.473525],\r\n [41.989265, 21.474044],\r\n [41.994193, 21.475514],\r\n [41.996682, 21.476005],\r\n [42.000896, 21.471327],\r\n [42.001681, 21.465046],\r\n [42.000823, 21.459914],\r\n [42.00631, 21.46312],\r\n [42.013471,21.457608]\r\n ],\r\n \"3\": [\r\n [41.9922, 21.465247],\r\n [41.989265, 21.474044],\r\n [41.985071, 21.48359],\r\n [41.982343, 21.481512],\r\n [41.979803, 21.477402],\r\n [41.982004, 21.47266],\r\n [41.982723, 21.47116],\r\n [41.985402, 21.466416],\r\n [41.986741, 21.463991],\r\n [41.989134, 21.458048],\r\n [41.988336, 21.454121],\r\n [41.988751, 21.45013],\r\n [41.991207, 21.446203],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.990314, 21.420625],\r\n [41.98357, 21.41873],\r\n [41.982699, 21.421562],\r\n [41.981131, 21.420872],\r\n [41.993924,21.424622],\r\n ],\r\n \"3b\": [\r\n [41.996059, 21.492927],\r\n [41.996682, 21.476005],\r\n [41.994193, 21.475514],\r\n [41.989265, 21.474044],\r\n [41.985071, 21.48359],\r\n [41.982343, 21.481512],\r\n [41.979803, 21.477402],\r\n [41.982004, 21.47266],\r\n [41.982723, 21.47116],\r\n [41.985402, 21.466416],\r\n [41.986741, 21.463991],\r\n [41.989134, 21.458048],\r\n [41.988336, 21.454121],\r\n [41.988751, 21.45013],\r\n [41.991207, 21.446203],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.990314, 21.420625],\r\n [41.993924, 21.424622],\r\n [41.988382,21.417852]\r\n ],\r\n \"Mileniumski\": [\r\n [41.991207, 21.446203],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.990314, 21.420625],\r\n [41.993924, 21.424622],\r\n [41.982699, 21.421562],\r\n [41.981131, 21.420872],\r\n [41.974992,21.408733]\r\n ],\r\n \"24\": [\r\n [41.962402, 21.44984],\r\n [41.969161, 21.448571],\r\n [41.971373, 21.445166],\r\n [41.977665,21.437405],\r\n [41.986885, 21.432878],\r\n [41.990075, 21.433994],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.998342, 21.424407],\r\n [41.999482, 21.418796],\r\n [42.000885, 21.411898],\r\n [42.001619, 21.406168],\r\n [42.00248, 21.399924],\r\n [42.003668, 21.391427],\r\n [41.998463,21.388975]\r\n ],\r\n \"22\": [\r\n [41.991207, 21.446203],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.998342, 21.424407],\r\n [41.999482, 21.418796],\r\n [42.000885, 21.411898],\r\n [42.001619, 21.406168],\r\n [42.00248, 21.399924],\r\n [42.003668, 21.391427],\r\n [42.008316, 21.3697],\r\n [42.006787, 21.375393],\r\n [42.004575, 21.384637],\r\n [42.009976, 21.363055],\r\n [42.015139, 21.358393],\r\n [42.018623, 21.354766],\r\n [42.02366, 21.348909],\r\n [42.028482,21.353769]\r\n ],\r\n \"4\": [\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.998342, 21.424407],\r\n [41.999482, 21.418796],\r\n [42.000885, 21.411898],\r\n [42.001619, 21.406168],\r\n [42.00248, 21.399924],\r\n [42.003668, 21.391427],\r\n [42.006787, 21.375393],\r\n [42.001987, 21.373118],\r\n [41.97574, 21.452552],\r\n [41.978947, 21.445648],\r\n [41.984494, 21.438474],\r\n [41.989338, 21.435917],\r\n [41.976357, 21.453863],\r\n [42.004575, 21.384637]\r\n ],\r\n \"4a\": [\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [42.006787, 21.375393],\r\n [42.001987, 21.373118],\r\n [41.97574, 21.452552],\r\n [41.978947, 21.445648],\r\n [41.984494, 21.438474],\r\n [41.989338, 21.435917],\r\n [42.004575, 21.384637],\r\n [41.994524, 21.430796],\r\n [41.995178, 21.423844],\r\n [41.994596, 21.417546],\r\n [41.995561, 21.410218],\r\n [41.99627, 21.405391],\r\n [41.996805, 21.40112],\r\n [41.969784, 21.465296],\r\n [41.97316, 21.458109],\r\n [41.97574, 21.452552],\r\n [41.998189, 21.391317],\r\n [41.965284,21.461883]\r\n ],\r\n \"16\": [\r\n [42.000089, 21.44013],\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [41.999395, 21.452186],\r\n [42.000625, 21.45893],\r\n [42.00631, 21.46312],\r\n [42.013471, 21.457608],\r\n [41.998821, 21.439166],\r\n [41.997575, 21.438073],\r\n [41.99388, 21.436115],\r\n [41.990075, 21.433994],\r\n [41.991843, 21.434342],\r\n [41.986626, 21.430605],\r\n [41.983955, 21.428551],\r\n [41.981707, 21.431928],\r\n [41.978453, 21.434686],\r\n [41.976236, 21.432969]\r\n\r\n\r\n ],\r\n \"17\": [\r\n [42.000089, 21.44013],\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [42.001943, 21.439822],\r\n [41.998821, 21.439166],\r\n [41.997575, 21.438073],\r\n [41.99388, 21.436115],\r\n [41.991843, 21.434342],\r\n [41.971498, 21.476887],\r\n [41.973949, 21.471652],\r\n [41.975384, 21.46854],\r\n [41.97723, 21.464583],\r\n [41.982909, 21.452522],\r\n [41.985625, 21.446546],\r\n [41.987188, 21.44322],\r\n [41.991079, 21.444851],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [42.00991, 21.430802],\r\n [42.008557, 21.433715],\r\n [41.972136, 21.477934],\r\n [41.975058, 21.480179],\r\n [41.976837, 21.482989],\r\n [41.981572, 21.490712]\r\n ],\r\n \"7b\": [\r\n [41.991843, 21.434342],\r\n [41.971498, 21.476887],\r\n [41.973949, 21.471652],\r\n [41.975384, 21.46854],\r\n [41.97723, 21.464583],\r\n [41.982909, 21.452522],\r\n [41.985625, 21.446546],\r\n [41.987188, 21.44322],\r\n [41.991079, 21.444851],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.994524, 21.430796],\r\n [41.993924, 21.424622],\r\n [41.99305, 21.421942]\r\n ],\r\n \"57\": [\r\n [41.998431, 21.379083],\r\n [41.996723, 21.386014],\r\n [41.994737, 21.395587],\r\n [41.993829, 21.402344],\r\n [41.993549, 21.408429],\r\n [41.993215, 21.413581],\r\n [41.992342, 21.421289],\r\n [41.994524, 21.430796],\r\n [41.993924, 21.424622],\r\n [41.998821, 21.439166],\r\n [41.997575, 21.438073],\r\n [41.99388, 21.436115],\r\n [42.000089, 21.44013],\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [42.008448, 21.443372],\r\n [42.013141, 21.445433],\r\n [42.017624, 21.447533],\r\n [42.021683, 21.449245],\r\n [42.024567, 21.448169],\r\n [42.029325, 21.444816],\r\n [42.031613, 21.445385],\r\n [42.035462, 21.446238],\r\n [42.036509, 21.446259],\r\n [42.040517, 21.448813],\r\n [42.043486, 21.45065],\r\n [42.049167, 21.449835],\r\n [42.051876, 21.450457],\r\n [42.055285, 21.450961],\r\n [42.062359, 21.451262],\r\n [42.065902, 21.4515],\r\n [42.072131, 21.448877]\r\n ],\r\n \"8\": [\r\n [41.999266, 21.43288],\r\n [41.998821, 21.439166],\r\n [42.000089, 21.44013],\r\n [42.000089, 21.44013],\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [42.008448, 21.443372],\r\n [42.013141, 21.445433],\r\n [42.017624, 21.447533],\r\n [42.021683, 21.449245],\r\n [42.024567, 21.448169],\r\n [42.029325, 21.444816],\r\n [42.031613, 21.445385],\r\n [42.035462, 21.446238],\r\n [42.036509, 21.446259],\r\n [42.040517, 21.448813],\r\n [41.999627, 21.428543],\r\n [42.002824, 21.422036],\r\n [42.005806, 21.41635],\r\n [42.006675, 21.411313],\r\n [42.007082, 21.404682],\r\n [42.007255, 21.400214],\r\n [42.007518, 21.395879],\r\n [42.007606, 21.393626],\r\n [42.007891, 21.391089],\r\n [42.007614, 21.383927],\r\n [42.004824, 21.374379],\r\n [42.041279, 21.451412],\r\n [42.039749, 21.454555],\r\n [42.044833,21.459126]\r\n ],\r\n \"50\": [\r\n [42.003157, 21.473116],\r\n [42.002878, 21.479629],\r\n [42.000678, 21.485712],\r\n [42.000112, 21.487386],\r\n [41.997364, 21.495113],\r\n [41.996013, 21.499641],\r\n [41.994661, 21.503803],\r\n [41.993612, 21.505917],\r\n [41.99163, 21.509311],\r\n\r\n [41.998821, 21.439166],\r\n [42.000089, 21.44013],\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [42.001943, 21.439822],\r\n [41.999395, 21.452186],\r\n [42.000823, 21.459914],\r\n [42.001681, 21.465046],\r\n [41.998821, 21.439166],\r\n [41.997575, 21.438073],\r\n [41.99388, 21.436115],\r\n [41.994524, 21.430796],\r\n [41.990314, 21.420625],\r\n [41.993924, 21.424622],\r\n [41.988382, 21.417852]\r\n ],\r\n \"44\": [\r\n [41.979792,21.52895],\r\n [41.981375, 21.5263],\r\n [41.983106,21.523452],\r\n [41.986397,21.517994],\r\n [41.989154, 21.513407], \r\n [41.997364, 21.495113],\r\n [41.996013, 21.499641],\r\n [41.994661, 21.503803],\r\n [41.993612, 21.505917],\r\n [41.99163, 21.509311],\r\n [41.996059, 21.492927],\r\n [41.996682, 21.476005],\r\n [41.994193, 21.475514],\r\n [41.989265, 21.474044],\r\n [41.982723, 21.47116],\r\n [41.985402, 21.466416],\r\n [41.986741, 21.463991],\r\n [41.989134, 21.458048],\r\n [41.988336, 21.454121],\r\n [41.988751, 21.45013],\r\n [41.991207, 21.446203],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.993924, 21.424622],\r\n [41.99305, 21.421942] // Nova Makedonija\r\n ],\r\n \"35\": [\r\n [41.985071, 21.48359],\r\n [41.982343, 21.481512],\r\n [41.979803, 21.477402],\r\n [41.982004, 21.47266],\r\n [41.982723, 21.47116],\r\n [41.985402, 21.466416],\r\n [41.986741, 21.463991],\r\n [41.989134, 21.458048],\r\n [41.988336, 21.454121],\r\n [41.988751, 21.45013],\r\n [41.991207, 21.446203],\r\n [41.993293, 21.442551],\r\n [41.996634, 21.440633], // MANU\r\n [42.000089, 21.44013], // Bit Pazar 1\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [42.008448, 21.443372],\r\n [42.013141, 21.445433],\r\n [42.017624, 21.447533],\r\n [42.021401, 21.448342],\r\n [42.021909, 21.443969],\r\n [42.025033, 21.443053],\r\n [42.026163,21.439952]\r\n ],\r\n \"26\": [\r\n [41.994524, 21.430796],\r\n [41.998342, 21.424407],\r\n [41.999482, 21.418796],\r\n [42.000885, 21.411898],\r\n [42.001619, 21.406168],\r\n [42.00248, 21.399924],\r\n [42.003668, 21.391427],\r\n [42.007891, 21.391089],\r\n [41.994524, 21.430796], \r\n [41.998821, 21.439166],\r\n [41.997575, 21.438073],\r\n [41.99388, 21.436115],\r\n [42.000089, 21.44013],\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [42.008448, 21.443372],\r\n [42.013141, 21.445433],\r\n [42.017624, 21.447533],\r\n [42.020128, 21.451345],\r\n [42.017426,21.453394],\r\n [42.013471, 21.457608]\r\n ],\r\n \"33\": [\r\n [41.958884, 21.538572],\r\n [41.957037, 21.535232],\r\n [41.971441, 21.481213],\r\n [41.969363, 21.486979],\r\n [41.966792, 21.490174],\r\n [41.964951, 21.494267],\r\n [41.965037, 21.497314],\r\n [41.963956, 21.50027],\r\n [41.962377, 21.504489],\r\n [41.960051, 21.513104],\r\n [41.958166, 21.521424],\r\n [41.957195, 21.530514],\r\n \r\n [41.971498, 21.476887],\r\n [41.973949, 21.471652],\r\n [41.975384, 21.46854],\r\n [41.97723, 21.464583],\r\n [41.982909, 21.452522],\r\n [41.985625, 21.446546],\r\n [41.987188, 21.44322],\r\n [41.991079, 21.444851],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.993924, 21.424622],\r\n [41.99305, 21.421942] // Nova Makedonija\r\n ],\r\n \"23\": [ \r\n [41.997364, 21.495113],\r\n [41.996013, 21.499641],\r\n [41.996059, 21.492927],\r\n [41.996682, 21.476005],\r\n [41.994193, 21.475514],\r\n [41.989265, 21.474044],\r\n [41.982723, 21.47116],\r\n [41.985402, 21.466416],\r\n [41.986741, 21.463991],\r\n [41.989134, 21.458048],\r\n [41.988336, 21.454121],\r\n [41.988751, 21.45013],\r\n [41.991207, 21.446203],\r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.993924, 21.424622],\r\n [41.99305, 21.421942], // Nova Makedonija\r\n\r\n [41.985071, 21.48359],\r\n [41.982343, 21.481512],\r\n [41.979803, 21.477402],\r\n\r\n [42.005562, 21.503663],\r\n [42.006704, 21.504231],\r\n [42.010576,21.508995]\r\n\r\n ],\r\n \"9\": [ \r\n [41.990314, 21.420625],\r\n [41.988382, 21.417852],\r\n [41.990879, 21.430055],\r\n [41.992494, 21.426525],\r\n [41.990075, 21.433994],\r\n [41.992305, 21.438599],\r\n\r\n [41.996634, 21.440633], // MANU\r\n [42.000089, 21.44013], // Bit Pazar 1\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [42.008448, 21.443372],\r\n [42.013141, 21.445433],\r\n [42.013665, 21.441602],\r\n [42.013404,21.434987],\r\n [42.013121, 21.435824],\r\n [42.017101, 21.434515],\r\n [42.019156, 21.432457],\r\n [42.022339, 21.433389],\r\n [42.020722, 21.434382] \r\n ],\r\n \"22a\": [ \r\n [41.998342, 21.424407],\r\n [41.999482, 21.418796],\r\n [42.000885, 21.411898],\r\n [42.001619, 21.406168],\r\n [42.00248, 21.399924],\r\n [42.003668, 21.391427],\r\n [42.008316, 21.3697],\r\n [42.006787, 21.375393],\r\n [42.004575, 21.384637],\r\n [42.009976, 21.363055],\r\n [42.015139, 21.358393],\r\n [42.018623, 21.354766],\r\n [42.02366, 21.348909],\r\n [42.028482, 21.353769],\r\n [41.993924, 21.424622],\r\n [41.990314, 21.420625],\r\n [41.988382, 21.417852],\r\n ],\r\n \"19\": [\r\n [41.998342, 21.424407],\r\n [41.999482, 21.418796],\r\n [42.000885, 21.411898],\r\n [42.001619, 21.406168],\r\n [42.00248, 21.399924],\r\n [41.999266, 21.43288],\r\n [41.998821, 21.439166],\r\n [42.000089, 21.44013],\r\n [42.000089, 21.44013],\r\n [42.000892, 21.439964],\r\n [42.001943, 21.439822],\r\n [42.008448, 21.443372],\r\n [42.013141, 21.445433],\r\n [42.017624, 21.447533],\r\n [42.007606, 21.393626],\r\n [41.997811, 21.42846], // Posta\r\n [42.021401, 21.448342],\r\n [42.021766, 21.439328],\r\n [42.022339, 21.433389],\r\n [42.026281, 21.429542],\r\n [42.031943, 21.428052], // Zatvor Sutka\r\n [42.035282, 21.426321],\r\n [42.03922, 21.424674],\r\n [42.042844, 21.423542],\r\n [42.047656,21.428311]\r\n ],\r\n \"21\": [\r\n [42.025623, 21.375744],\r\n [42.025536, 21.380036],\r\n [42.01623, 21.39114],\r\n [42.013468, 21.390727],\r\n [42.013859, 21.382857],\r\n [42.011121, 21.375819],\r\n [42.009128,21.369478],\r\n [42.008316, 21.3697],\r\n [42.007084, 21.374233],\r\n [42.004575, 21.384637],\r\n [42.003668, 21.391427],\r\n [42.00248, 21.399924],\r\n [42.001619, 21.406168],\r\n [42.000885, 21.411898],\r\n [41.999482, 21.418796],\r\n [41.998342, 21.424407], \r\n [41.993293, 21.442551],\r\n [41.992305, 21.438599],\r\n [41.991843, 21.434342],\r\n [41.994524, 21.430796],\r\n [41.989861, 21.445324]\r\n ]\r\n };\r\n\r\n return data;\r\n}", "title": "" }, { "docid": "7bd4866b925407f9b2d8f27563b922d2", "score": "0.57996875", "text": "function processDataLine(data) {\n\n // Define variable to store data\n var line_data = new Object;\n\n // Create necassery entries\n data[1990].forEach(function(d) {\n line_data[d.code] = new Object\n line_data[d.code].name = d.name\n line_data[d.code].values = []\n })\n\n // Loop over every year and entry\n for (i = 1990; i < 2013; i++) {\n data[i].forEach(function(d) {\n\n // Store data as needed\n line_data[d.code].values.push({\n \"year\": i,\n \"waste\": d.waste,\n \"agriculture\": d.agriculture,\n \"energy\": d.energy,\n \"fuel\": d.fuel,\n \"industrial\": d.industrial,\n \"land\": d.land\n });\n });\n };\n\n // Return data\n return line_data;\n}", "title": "" }, { "docid": "197b45a6171b965dc26ec3eddb27d5a9", "score": "0.57924026", "text": "function processData(data){\n //empty array to hold attributes\n var attributes = [];\n //properties of the first feature in the dataset\n var properties = data.features[0].properties;\n \n //push each attribute name into attributes array\n for(var attribute in properties){\n //only take attributes with unemployment rate values\n if(attribute.indexOf(\"Year\") > -1){\n attributes.push(attribute);\n };\n };\n \n //check result\n //console.log(attributes);\n return attributes;\n}", "title": "" }, { "docid": "247053ccfff7c511bf462feb2d84e64e", "score": "0.56887513", "text": "function LineValues(state) {\n return [\n (state[0][1] + state[1][1] + state[2][1]),\n (state[3][1] + state[4][1] + state[5][1]),\n (state[6][1] + state[7][1] + state[8][1]),\n (state[0][1] + state[3][1] + state[6][1]),\n (state[1][1] + state[4][1] + state[7][1]),\n (state[2][1] + state[5][1] + state[8][1]),\n (state[0][1] + state[4][1] + state[8][1]),\n (state[2][1] + state[4][1] + state[6][1]),\n ];\n }", "title": "" }, { "docid": "3155fe8bc192ae594198d23a5a7c47e4", "score": "0.5679947", "text": "function toOutputArray(response) {\n var responseJson = JSON.parse(response);\n \n //LCP\n //LCP Good\n var lcpgood = responseJson.record.metrics.largest_contentful_paint.histogram.filter(function (row) {\n return row.start === 0;\n });\n lcpgood = lcpgood[0].density\n \n //LCP Needs improvements\n var lcpni = responseJson.record.metrics.largest_contentful_paint.histogram.filter(function (row) {\n return row.start === 2500;\n });\n lcpni = lcpni[0].density\n\n //LCP Poor\n var lcppoor = responseJson.record.metrics.largest_contentful_paint.histogram.filter(function (row) {\n return row.start === 4000;\n });\n lcppoor = lcppoor[0].density\n\n \n //CLS\n //CLS Good\n var clsgood = responseJson.record.metrics.cumulative_layout_shift.histogram.filter(function (row) {\n return row.start === \"0.00\";\n });\n clsgood = clsgood[0].density\n\n //CLS Needs improvements\n var clsni = responseJson.record.metrics.cumulative_layout_shift.histogram.filter(function (row) {\n return row.start === \"0.10\";\n });\n clsni = clsni[0].density\n\n //CLS Poor\n var clspoor = responseJson.record.metrics.cumulative_layout_shift.histogram.filter(function (row) {\n return row.start === \"0.25\";\n });\n clspoor = clspoor[0].density\n \n \n //FID\n //FID Good\n var fidgood = responseJson.record.metrics.first_input_delay.histogram.filter(function (row) {\n return row.start === 0;\n });\n fidgood = fidgood[0].density\n\n //FID Needs improvements\n var fidni = responseJson.record.metrics.first_input_delay.histogram.filter(function (row) {\n return row.start === 100;\n });\n fidni = fidni[0].density\n\n //FID Poor\n var fidpoor = responseJson.record.metrics.first_input_delay.histogram.filter(function (row) {\n return row.start === 300;\n });\n fidpoor = fidpoor[0].density\n\n var date = Utilities.formatDate(new Date(), \"GMT+1\", \"yyyy-MM-dd\")\n var outputArray = [date, responseJson.record.key.origin, lcpgood, lcpni, lcppoor, clsgood, clsni, clspoor, fidgood, fidni, fidpoor]\n //Logger.log(outputArray)\n appendOutputRow(outputArray)\n}", "title": "" }, { "docid": "da3ff2afb13c20ffacb3b2ac2a4139f9", "score": "0.5565175", "text": "_toAttributes(line) {\n // Three components per vertex\n var vertices = new Float32Array(line.verticesCount * 3);\n var colours = new Float32Array(line.verticesCount * 3);\n\n var pickingIds;\n if (line.pickingId) {\n // One component per vertex\n pickingIds = new Float32Array(line.verticesCount);\n }\n\n var _vertices = line.vertices;\n var _colour = line.colours;\n\n var _pickingId;\n if (pickingIds) {\n _pickingId = line.pickingId;\n }\n\n var lastIndex = 0;\n\n for (var i = 0; i < _vertices.length; i++) {\n var ax = _vertices[i][0];\n var ay = _vertices[i][1];\n var az = _vertices[i][2];\n\n var c1 = _colour[i];\n\n vertices[lastIndex * 3 + 0] = ax;\n vertices[lastIndex * 3 + 1] = ay;\n vertices[lastIndex * 3 + 2] = az;\n\n colours[lastIndex * 3 + 0] = c1[0];\n colours[lastIndex * 3 + 1] = c1[1];\n colours[lastIndex * 3 + 2] = c1[2];\n\n if (pickingIds) {\n pickingIds[lastIndex] = _pickingId;\n }\n\n lastIndex++;\n }\n\n var attributes = {\n vertices: vertices,\n colours: colours\n };\n\n if (pickingIds) {\n attributes.pickingIds = pickingIds;\n }\n\n return attributes;\n }", "title": "" }, { "docid": "4f50e8ed356f84b3f79bbafe0bec204f", "score": "0.55412924", "text": "function parse(line,dataStruct){\n let le=line.split(' ');\n switch (le[0]) {\n case \"v\":\n let x=parseFloat(le[1]);\n dataStruct[0].push(le[1]);\n if(x>dataStruct[4][0])dataStruct[4][0]=x;\n if(x<dataStruct[5][0])dataStruct[5][0]=x;\n let y=parseFloat(le[2]);\n dataStruct[1].push(y);\n if(y>dataStruct[4][1])dataStruct[4][1]=y;\n if(y<dataStruct[5][1])dataStruct[5][1]=y;\n let z=parseFloat(le[3]);\n dataStruct[2].push(z);\n if(z>dataStruct[4][2])dataStruct[4][2]=z;\n if(z<dataStruct[5][2])dataStruct[5][2]=z;\n break;\n case \"f\":\n dataStruct[3].push([parseInt(le[1].split('/')[0])-1,parseInt(le[2].split('/')[0])-1,parseInt(le[3].split('/')[0])-1]);\n break;\n default://Do nothing. We don't really care about typos or other stuff.\n break;\n }\n return dataStruct;\n }", "title": "" }, { "docid": "3f1721bedf2a3b0bb79a96c9f40e774b", "score": "0.5535724", "text": "parseData(originalData) {\n let data = [];\n const annotations = [];\n // Parse data if it is in the standard string format\n if (typeof originalData === 'string') {\n data = originalData.split(' ').map(x => x.split(':').map(Number));\n }\n // Check that the data is in a readable form already\n else if (Array.isArray(originalData) && originalData.length > 0 && Array.isArray(originalData[0])) {\n data = originalData;\n }\n // Reduce the object-form of the mass spectrum\n else if (Array.isArray(originalData) && originalData.length > 0 && typeof originalData[0] === 'object') {\n originalData.forEach(x => {\n if (typeof x.selected === 'undefined' || x.selected === true) {\n data.push([x.ion, x.intensity]);\n if (x.annotation && x.annotation !== '') {\n annotations.push([x.ion, x.annotation]);\n }\n }\n });\n }\n if (data.length > 1000) {\n data.sort((a, b) => b[1] - a[1]);\n data = data.slice(0, 1000);\n }\n // Sort data by m/z\n data.sort((a, b) => a[0] - b[0]);\n data = this.truncate ? data.map(x => [Number(x[0].toFixed(4)), Number(x[1].toFixed(2))]) : data;\n // Return parsed data\n return { data, annotations };\n }", "title": "" }, { "docid": "3693a323601f0031b9eaa961a01272f9", "score": "0.5484469", "text": "function parseParams(line) {\n const inputs = line.substring(2).split(' ');\n console.log(inputs);\n const params = {};\n inputs.forEach((item) => {\n const keyValue = item.split('=');\n switch (keyValue[0].toUpperCase()) {\n case 'P':\n params.price = Number(keyValue[1]);\n break;\n case 'F':\n params.funds = Number(keyValue[1]);\n break;\n case 'T':\n // eslint-disable-next-line prefer-destructuring\n params.orderType = keyValue[1].toUpperCase();\n break;\n case 'S':\n params.size = Number(keyValue[1]);\n break;\n case 'I':\n // eslint-disable-next-line prefer-destructuring\n params.instrumentId = keyValue[1];\n break;\n default:\n break;\n }\n });\n console.log(params);\n return params;\n}", "title": "" }, { "docid": "68d0b8c0da16259e928c1b7ddef46c88", "score": "0.5444689", "text": "function setDimensions() {\n dimensions = [];\n dimensions_input.forEach(item => {\n dimension_id = item.id;\n item.value.split(',').forEach(d => {\n dimensions.push({x : d.split('x')[0], y : d.split('x')[1], type : dimension_id});\n })\n });\n console.log(dimensions);\n}", "title": "" }, { "docid": "14d7b190c19d7db3535a03e07c92c37b", "score": "0.54396844", "text": "_toAttributes(line) {\n // Three components per vertex\n var vertices = new Float32Array(line.verticesCount * 3);\n var colours = new Float32Array(line.verticesCount * 3);\n\n var pickingIds;\n if (line.pickingId) {\n // One component per vertex\n pickingIds = new Float32Array(line.verticesCount);\n }\n\n var _vertices = line.vertices;\n var _colour = line.colours;\n\n var normals;\n var _normals;\n if (line.normals) {\n normals = new Float32Array(line.verticesCount * 3);\n _normals = line.normals;\n }\n\n var _pickingId;\n if (pickingIds) {\n _pickingId = line.pickingId;\n }\n\n var lastIndex = 0;\n\n for (var i = 0; i < _vertices.length; i++) {\n var ax = _vertices[i][0];\n var ay = _vertices[i][1];\n var az = _vertices[i][2];\n\n var nx;\n var ny;\n var nz;\n if (_normals) {\n nx = _normals[i][0];\n ny = _normals[i][1];\n nz = _normals[i][2];\n }\n\n var c1 = _colour[i];\n\n vertices[lastIndex * 3 + 0] = ax;\n vertices[lastIndex * 3 + 1] = ay;\n vertices[lastIndex * 3 + 2] = az;\n\n if (normals) {\n normals[lastIndex * 3 + 0] = nx;\n normals[lastIndex * 3 + 1] = ny;\n normals[lastIndex * 3 + 2] = nz;\n }\n\n colours[lastIndex * 3 + 0] = c1[0];\n colours[lastIndex * 3 + 1] = c1[1];\n colours[lastIndex * 3 + 2] = c1[2];\n\n if (pickingIds) {\n pickingIds[lastIndex] = _pickingId;\n }\n\n lastIndex++;\n }\n\n var attributes = {\n vertices: vertices,\n colours: colours\n };\n\n if (normals) {\n attributes.normals = normals;\n }\n\n if (pickingIds) {\n attributes.pickingIds = pickingIds;\n }\n\n return attributes;\n }", "title": "" }, { "docid": "1b8094d196758938ceca13876b074664", "score": "0.5410103", "text": "function createLineConsts() {\n let myArr = [];\n myArrayOfKeys.map((val, index) => {\n myArr.push(\n d3\n .line()\n .defined(d => {\n return !Number.isNaN(d[val[\"dataKey\"]]);\n })\n .x((d, i) => {\n return x(i);\n })\n .y(d => y(d[val[\"dataKey\"]]))\n );\n });\n return myArr;\n }", "title": "" }, { "docid": "7eeb7346dd13cae2c7c390d41c6b30b4", "score": "0.5407745", "text": "function process_lines(data) {\n if (Array.isArray(data)) {\n var lines = data.map(function (c, i, a) {\n if (c.hasOwnProperty(\"credit\")) {\n return process_credit(c);\n } else {\n return process_debit(c);\n }\n });\n return {\n line: lines,\n replaceAll: true\n };\n }\n}", "title": "" }, { "docid": "2f4fcecfdc728a4ff4e3e088d3d7961e", "score": "0.5394315", "text": "function processAnnotations( buffer2 ) {\r\n var textLines = buffer2.split(/\\r\\n|\\n/);\r\n //var fields = textLines[0].split(',');\r\n var jsonLine;\r\n var ants = [];\r\n \r\n for (var i=0; i < textLines.length; i++) {\r\n var data = textLines[i].split(',');\r\n //data[0] = date, data[1] = seriesKey (minus one), data[2] = text\r\n var seriesKey = parseInt( data[1] );\r\n var series1 = chartLabels[ seriesKey + 1 ];\r\n jsonLine = \r\n {\r\n series: series1,\r\n x: data[0],\r\n shortText: parseInt(i + 1),\r\n text: \"Alarm \" + parseInt(i + 1) + \": \" + data[2]\r\n };\r\n ants[i] = jsonLine;\r\n };\r\n \r\n //alert( \"Line1 = \" + ants[1].text );\r\n return( ants );\r\n\r\n }", "title": "" }, { "docid": "23493f3cdeb4bfe5ba2a35d939aff088", "score": "0.5389899", "text": "function transformResponse(data){\n\n// access data property of the response\nlet dataHere = data.dataSets[0].series;\n\n// access variables in the response and save length for later\nlet series = data.structure.dimensions.series;\nlet seriesLength = series.length;\n\n// set up array of variables and array of lengths\nlet varArray = [];\nlet lenArray = [];\n\nseries.forEach(function(serie){\n varArray.push(serie);\n lenArray.push(serie.values.length);\n});\n\n// get the time periods in the dataset\nlet observation = data.structure.dimensions.observation[0];\n\n// add time periods to the variables, but since it's not included in the\n// 0:0:0 format it's not included in the array of lengths\nvarArray.push(observation);\n\n// create array with all possible combinations of the 0:0:0 format\nlet strings = Object.keys(dataHere);\n\n// set up output array, an array of objects, each containing a single datapoint\n// and the descriptors for that datapoint\nlet dataArray = [];\n\n// for each string that we created\nstrings.forEach(function(string){\n // for each observation and its index\n observation.values.forEach(function(obs, index){\n let data = dataHere[string].observations[index];\n if (data != undefined){\n\n // set up temporary object\n let tempObj = {};\n\n let tempString = string.split(\":\");\n tempString.forEach(function(s, indexi){\n tempObj[varArray[indexi].name] = varArray[indexi].values[s].name;\n });\n\n // every datapoint has a time and ofcourse a datapoint\n tempObj[\"time\"] = obs.name;\n tempObj[\"datapoint\"] = data[0];\n\n dataArray.push(tempObj);\n }\n });\n});\n// return the finished product!\nreturn dataArray;\n}", "title": "" }, { "docid": "14cffa656b2af5f786bd30d0241ba91c", "score": "0.53544974", "text": "function readDataset(str){\n\tif(str.indexOf(\"(\")+str.indexOf(\")\")>0)\n\t\treturn parseDatasetFunction(str);\n\t\n\tvar dataset = [];\n\tvar lines = str.split(\"\\r\\n\").join(\"\\n\").trim().split(\"\\n\");\n\tfor(var i=0;i<lines.length;i++){\n\t\tdataset.push([]);\n\t\tvalues = lines[i].split(\" \").join(\"\").split(\",\");\n\t\tfor(var j=0;j<values.length;j++){\n\t\t\tdataset[i].push(parseFloat(values[j]));\n\t\t}\n\t}\n\n\treturn dataset;\n}", "title": "" }, { "docid": "3c438ff8460f4fb4a9a513ca5324a795", "score": "0.5343043", "text": "function processData(data){\n //empty array to hold attributes\n var attributes = [];\n\n //properties of the first feature in the dataset\n var properties = data.features[0].properties;\n\n //push each attribute name into attributes array\n for (var attribute in properties){\n //only take attributes with a rank value\n if (attribute.indexOf(\"Rank\") > -1){\n attributes.push(attribute);\n };\n };\n\n // //check result\n // console.log(\"Current attribute:\" + attributes);\n\n return attributes;\n\n}", "title": "" }, { "docid": "6266774627319581aea1f233d5dfd37c", "score": "0.5329366", "text": "function Array2JSON(data){\n\n\t\tvar line,datum,header,types;\n\t\tvar newdata = new Array();\n\t\tvar formats = new Array();\n\t\tvar req = new Array();\n\t\tvar start = 1;\n\t\tvar r,c,isdate;\n\t\theader = data[0];\n\n\t\tfor(r = 0, rows = 0 ; r < data.length; r++){\n\n\t\t\tdatum = new Array(data[r].length);\n\t\t\ttypes = new Array(data[r].length);\n\n\t\t\t// Loop over each column in the line\n\t\t\tfor(c = 0; c < data[r].length; c++){\n\t\t\t\t\n\t\t\t\t// Remove any quotes around the column value\n\t\t\t\tdatum[c] = data[r][c].replace(/^\\\"(.*)\\\"$/,function(m,p1){ return p1; });\n\n\t\t\t\tisdate = false;\n\t\t\t\tif(datum[c].search(/[0-9]{2}[\\/\\- ][0-9]{2}[\\/\\- ][0-9]{4}/) >= 0) isdate = true;\n\t\t\t\tif(!isNaN(Date.parse(datum[c]))) isdate = true;\n\t\t\t\t// If the value parses as a float\n\t\t\t\tif(typeof parseFloat(datum[c])===\"number\" && parseFloat(datum[c]) == datum[c]){\n\t\t\t\t\ttypes[c] = \"float\";\n\t\t\t\t\t// Check if it is actually an integer\n\t\t\t\t\tif(typeof parseInt(datum[c])===\"number\" && parseInt(datum[c])+\"\" == datum[c]){\n\t\t\t\t\t\ttypes[c] = \"integer\";\n\t\t\t\t\t\t// If it is an integer and in the range 1700-2100 we'll guess it is a year\n\t\t\t\t\t\tif(datum[c] >= 1700 && datum[c] < 2100) types[c] = \"year\";\n\t\t\t\t\t}\n\t\t\t\t}else if(datum[c].search(/^(true|false)$/i) >= 0){\n\t\t\t\t\t// The format is boolean\n\t\t\t\t\ttypes[c] = \"boolean\";\n\t\t\t\t}else if(datum[c].search(/https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&\\/\\/=]*)/) >= 0){\n\t\t\t\t\t// The value looks like a URL\n\t\t\t\t\ttypes[c] = \"URL\";\n\t\t\t\t}else if(isdate){\n\t\t\t\t\t// The value parses as a date\n\t\t\t\t\ttypes[c] = \"datetime\";\n\t\t\t\t}else{\n\t\t\t\t\t// Default to a string\n\t\t\t\t\ttypes[c] = \"string\";\n\t\t\t\t\t// If the string value looks like a time we set it as that\n\t\t\t\t\tif(datum[c].search(/^[0-2]?[0-9]\\:[0-5][0-9]$/) >= 0) types[c] = \"time\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(r == 0 && start > 0) header = datum;\n\t\t\tif(r >= start){\n\t\t\t\tnewdata[rows] = datum;\n\t\t\t\tformats[rows] = types;\n\t\t\t\trows++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Now, for each column, we sum the different formats we've found\n\t\tvar format = new Array(header.length);\n\t\tfor(var j = 0; j < header.length; j++){\n\t\t\tvar count = {};\n\t\t\tvar empty = 0;\n\t\t\tfor(var i = 0; i < newdata.length; i++){\n\t\t\t\tif(!newdata[i][j]) empty++;\n\t\t\t}\n\t\t\tfor(var i = 0 ; i < formats.length; i++){\n\t\t\t\tif(!count[formats[i][j]]) count[formats[i][j]] = 0;\n\t\t\t\tcount[formats[i][j]]++;\n\t\t\t}\n\t\t\tvar mx = 0;\n\t\t\tvar best = \"\";\n\t\t\tfor(var k in count){\n\t\t\t\tif(count[k] > mx){\n\t\t\t\t\tmx = count[k];\n\t\t\t\t\tbest = k;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Default\n\t\t\tformat[j] = \"string\";\n\n\t\t\t// If more than 80% (arbitrary) of the values are a specific format we assume that\n\t\t\tif(mx >= 0.8*newdata.length) format[j] = best;\n\n\t\t\t// If we have a few floats in with our integers, we change the format to float\n\t\t\tif(format[j] == \"integer\" && count['float'] > 0.1*newdata.length) format[j] = \"float\";\n\n\t\t\treq.push(header[j] ? true : false);\n\t\t}\n\n\t\t// Return the structured data\n\t\treturn { 'fields': {'name':header,'title':clone(header),'format':format,'required':req }, 'rows': newdata };\n\t}", "title": "" }, { "docid": "af2a67ae6aef0111b4ba471acc74a253", "score": "0.5312861", "text": "function getValueArray(lines, key, num) {\r\n\tvar value = undefined;\r\n\tvar line = lines.split(\"\\n\");\r\n\tvar N = line.length;\r\n\tfor(var i = 0; i < N; i++) {\r\n\t\tvar col = line[i].split(\" \");\r\n\t\tif(col[0] == key) {\r\n\t\t\tvalue = parseFloat(col[num+1]);\r\n\t\t}\r\n\t}\r\n\treturn value;\r\n}", "title": "" }, { "docid": "a8314908598ed18014135e80104595fc", "score": "0.52982014", "text": "function parse(input) {\n var _loop = 0, out = {}, details = {},\n currentSection = '',\n lines = input.split('\\n');\n for (var i in lines) {\n if (isEmpty(lines[i])) {\n delete lines[i];\n } else {\n ++_loop;\n details = readline(lines[i]);\n\n if (typeof details.value !== 'function') {\n if (details.key) {\n details.key = details.key.trim();\n }\n if (details.type === 'section') {\n currentSection = details.key;\n out[currentSection] = {};\n } else if (details.type === 'item') {\n out[currentSection][details.key] = details.value;\n } else if (details.type === 'multi-value') {\n if (!out[currentSection][details.key]) {\n out[currentSection][details.key] = []; // create array\n }\n if (typeof details.value !== 'function') {\n out[currentSection][details.key].push(details.value);\n }\n } else if (details.type === 'empty') {\n _loop=_loop-1;\n } else {\n throw new Error('Invalid line data type type in line no. ' + i);\n }\n delete lines[i];\n }\n }\n }\n return (_loop > 0) ? out : false;\n}", "title": "" }, { "docid": "2cbbc6cffa928217d80b4af5e3eee8eb", "score": "0.5289581", "text": "function JSON2NVD3(data, chart) {\n\n\t\tvar lines = new Array();\n\t\tvar titles = new Array();\n\t\tfor (line=0; line<data.length; line++) {\n\t\t\tvar colss = new Array();\n\t\t\tfor (label in data[line]) {\n\t\t\t\tcolss.push(data[line][label]);\n\t\t\t\tif (line == 0 && label != 'max' && label != 'min' && label != 'numericSortReverse') \n\t\t\t\t\ttitles.push(label);\n\t\t\t}\n\t\t\tlines.push(colss);\n\t\t}\n\t\t// console.info(titles);\n\t\t// console.info(lines);\n\t\tvar res = new Array();\n\t\tif (chart == 'pie' || chart == 'donut')\n\t\t\tfor (t=0; t<lines.length; t++)\n\t\t\t\t\tres.push(new Object( { \"label\":lines[t][0], \"value\":operator(+lines[t][1]) } ));\n\t\telse if (chart == 'discretebar')\n\t\t\tfor (t=1; t<titles.length; t++) // 1st column passed (eq t=0)\n\t\t\t\tres.push(new Object( { \"key\":titles[t], \"values\":forceNumb(lines, t) } ));\n\t\telse if (chart == 'stackedarea' || chart == 'lineplusbar' || chart == 'cumulativeline')\n\t\t\tfor (t=1; t<titles.length; t++) // 1st column passed (eq t=0)\n\t\t\t\tres.push(new Object( { \"key\":titles[t], \"values\":forceNumb2(lines, t) } ));\n\t\telse // multibars etc\n\t\t\tfor (t=1; t<titles.length; t++) // 1st column passed (eq t=0)\n\t\t\t\tres.push(new Object( { \"key\":titles[t], \"values\":getCol(t,lines) } ));\n\n//\t\tconsole.info(res);\n\t\treturn res;\n\n//\treturn data;\n\nfunction forceNumb(arr, t) { // Name data points + force numbers type for values \n\n\tfor (i=0; i<arr.length; i++) {\n\t\tarr[i]['label'] = arr[i][0];\n\t\tif (+arr[i][1] || arr[i][1] == '0')\n\t\t\tarr[i]['value'] = operator(+arr[i][1]);\n\t}\n\treturn arr;\n}\n\nfunction forceNumb2(arr, t) { // Name data points + force numbers type for values \n\n\tvar out = new Array();\n\tfor (i=0; i<arr.length; i++) {\n\t\tif (+arr[i][t] || arr[i][t] == '0')\n\t\t\tout.push( new Array( +arr[i][0], operator(+arr[i][t]) ) );\n\t}\n\treturn out;\n}\n\nfunction getCol(colname, lines) {\n\tvar out = new Array();\n\tfor (i=0; i<lines.length; i++) // Note: forcing numerical values output\n\t\tif (lines[i][colname] && +lines[i][colname]) {\n//\t\tif (! +lines[i][colname]) console.warning( 'Illegal value on input:'+lines[i][colname] );\n\t\tvar cell = new Object( {\"y\": (operator(+lines[i][colname])), \"x\":lines[i][0] } );\n\t\tout.push( cell );\n\t}\n\treturn out;\n}\n\nfunction operator(x) { return x; }\n} // parseJSON", "title": "" }, { "docid": "84e81059b7dcc3d7a68213d1eaaaa354", "score": "0.5287537", "text": "parseData(dataLine) {\n var data = dataLine.match(/[-*.*0-9]+|\\s(?=,)/g); // globally matches any signed or unsigned numbers and spaces followed by ','\n return data;\n }", "title": "" }, { "docid": "1378cc3a14db32f4cf755f786123fde4", "score": "0.5267446", "text": "function processData(data){\n var attributes = [];\n var properties = data.features[0].properties;\n\n for (var attribute in properties){\n attributes.push(attribute);\n };\n return attributes;\n}", "title": "" }, { "docid": "a64881107e4db085b98cb2c2f1d806b2", "score": "0.52379304", "text": "function parseLine(line) {\n let pairs = line.split(\" -> \").map(p => p.split(',').map(Number))\n return pairs\n}", "title": "" }, { "docid": "5c8732dce87393fd3b5a0dd4cd9d618f", "score": "0.523497", "text": "function processData(input) {\n parseAndCompute(input).forEach(x => console.log(formatting(x)));\n}", "title": "" }, { "docid": "89bec85a7b8795d7f441c9f58d11f91a", "score": "0.5232606", "text": "function transform(line) {\n var values = line.split(',');\n \n var obj = new Object();\n obj.unique_key = values[0];\n obj.complaint_type = values[1];\n obj.complaint_description = values[2];\n obj.owning_department = values[3];\n obj.source = values[4];\n obj.status = values[5];\n obj.status_change_date = values[6];\n obj.created_date = values[7];\n obj.last_update_date = values[8];\n obj.close_date = values[9];\n obj.incident_address = values[10];\n obj.street_number = values[11];\n obj.street_name = values[12];\n obj.city = values[13];\n obj.incident_zip = values[14];\n obj.county = values[15];\n obj.latitude = values[16];\n obj.longitude = values[17];\n var jsonString = JSON.stringify(obj);\n \n return jsonString;\n }", "title": "" }, { "docid": "e8c2a69bd125473618aadcf81db3c2ae", "score": "0.52200603", "text": "function parse(data) {\n const stat = JSONstat(data);\n const dataset = stat.Dataset(0);\n\n const returnArray = [];\n for (var i = 0; dataset.Dimension(1).Category(i); i++) {\n returnArray.push({\n week: dataset.Dimension(1).Category(i).label,\n weightInKg: dataset.Data([0, i, 0]).value,\n pricePrKg: dataset.Data([0, i, 1]).value\n });\n }\n\n return returnArray;\n}", "title": "" }, { "docid": "a5f00f16d86152b65c1ad08ec39e8b8e", "score": "0.5213975", "text": "function processData(data){\n //empty array to hold attributes(names)\n var attributes = [];\n\n //properties of the first feature in the dataset\n var properties = data.features[0].properties;\n\n //push each attribute name into attributes array\n for (var attribute in properties){\n //only take attributes with population values\n if (attribute.indexOf(\"yr\") ==0){ //property name starting with 'yr'\n attributes.push(attribute); //push() method adds new items to the end of an array\n };\n };\n\n //check result\n console.log(attributes);\n var i;\n for (i=0; i<data.features.length;i++){\n data.features[i].properties['visible']=1;\n };\n\n return attributes;\n}", "title": "" }, { "docid": "cd664a0c4282e4f8a99a0335cd1384dd", "score": "0.5194991", "text": "function makeDomainArray(csvData){\n\t//build a domain array for the attribute\n\tvar domainArray = [];\n\tfor (var i=0; i<csvData.length; i++) {\n\t\tvar val = parseFloat(csvData[i][expressed]); //remember that 'expressed' is a global attribute!\n\t\tdomainArray.push(val);\n\t};\n\treturn domainArray;\n}", "title": "" }, { "docid": "2f7a8a0a5b6d4248d9a5da663123e068", "score": "0.5190967", "text": "function ParseLineData(data) {\r\n const lineData = [];\r\n for (let i = 0; i < 8; i++) lineData[i] = '';\r\n let who = 0;\r\n let prevChar = ' ';\r\n for (let i = 0; i < data.length; i++) {\r\n const d = data[i];\r\n if (who < lineData.length) lineData[who] = d;\r\n if (who > 0) {\r\n const c = d[0];\r\n if (c >= '0' && c <= '9') {\r\n lineData[who - 1] += d;\r\n continue;\r\n }\r\n if (c === ',') {\r\n lineData[who - 1] += c;\r\n prevChar = c;\r\n continue;\r\n }\r\n if (prevChar === ',') {\r\n lineData[who - 1] += c;\r\n }\r\n prevChar = c;\r\n }\r\n who++;\r\n }\r\n return lineData;\r\n}", "title": "" }, { "docid": "6da40e867ca416fd823069989886eb1e", "score": "0.51863223", "text": "parseArray(datos)\n\t{\n\t\t//Si hay datos.\n\t\tif (datos.length>0)\n\t\t{\n\t\t\tlet resu = [];\n\n\t\t\t//Parse los datos.\n\t\t\tdatos.forEach((item)=>\n\t\t\t{\n\t\t\t\t//Quito el linestring.\n\t\t\t\titem[0] = item[0].replace(\"LINESTRING (\", \"\");\n\n\t\t\t\t//Parse el string a un array.\n\t\t\t\tlet tmp = item[0].split(',');\n\n\t\t\t\t//Creo un array con puntos.\n\t\t\t\tlet ptos = [];\n\n\t\t\t\t//Itero el string parseado.\n\t\t\t\ttmp.forEach((x)=>{\n\t\t\t\t\t//Parseo cada item.\n\t\t\t\t\tlet pto = x.split(' ');\n\n\t\t\t\t\t//Grabo los puntos.\n\t\t\t\t\tptos.push({\"location\":[parseFloat(pto[0]),parseFloat(pto[1])]});\n\t\t\t\t});\n\n\t\t\t\t//Agrego los datos a un array para que se agregue con el formato.\n\t\t\t\tresu.push({\"puntos\":ptos,\"idlinea\":item[1],\"linea\":item[2],\"tipo\":item[3],\"ramal\":item[4],\"sentido\":item[5]});\n\t\t\t});\n\n\t\t\treturn resu;\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "168a0269c083fd9d29dcd05271ea9c61", "score": "0.5170109", "text": "function getLinesByDataType(values) {\n let output = {\n manipulator: [],\n interpretation: [],\n filter: [],\n xfilter: [],\n reference: [],\n layout: [],\n global: [],\n local: [],\n barline: [],\n data: []\n };\n for (let i = 0; i < values.length; i++) {\n if (hasSpineManipulator(values[i])) {\n output.manipulator.push(i);\n } else if (values[i][0].match(/^'?\\*/)) {\n output.interpretation.push(i);\n } else if (values[i][0].match(/^'?!!!filter\\s*:/)) {\n output.filter.push(i);\n } else if (values[i][0].match(/^'?!!!Xfilter\\s*:/)) {\n output.xfilter.push(i);\n } else if (values[i][0].match(/^'?!!![^:\\s]+:/)) {\n output.reference.push(i);\n } else if (hasLayoutParameters(values[i])) {\n output.layout.push(i);\n } else if (values[i][0].match(/^'?!![^!]/) || (values[i][0] === '!!')) {\n output.global.push(i);\n } else if (values[i][0].match(/^'?![^!]/) || (values[i][0] === '!')) {\n output.local.push(i);\n } else if (values[i][0].match(/^'?=/)) {\n output.barline.push(i);\n } else {\n output.data.push(i);\n }\n }\n return output;\n}", "title": "" }, { "docid": "b057906ca5362777ec3e64594d5a541d", "score": "0.513713", "text": "extractData(rawData) {\r\n if (this.path.length === 0) {\r\n var representativeAV = rawData.length === 0 ? {} : rawData[0];\r\n var paths = Object.keys(representativeAV).map(attr => [attr]);\r\n if (!(\"recordId\" in representativeAV)) {\r\n paths.push([\"recordId\"]);\r\n }\r\n return [{\r\n path: this.path,\r\n mapping: {\r\n rowNr: 0,\r\n nrDataElements: rawData.length,\r\n firstDataElementId: 0,\r\n paths: paths\r\n }\r\n }];\r\n }\r\n else {\r\n var attr = this.path[0];\r\n var indexedValues;\r\n var compressedData;\r\n if (attr === \"recordId\" && rawData.length > 0 && !(attr in rawData[0])) {\r\n compressedData = [{ o: 0, v: rawData.map((value, index) => index) }];\r\n }\r\n else {\r\n var columnData = rawData.map(row => row[attr]);\r\n indexedValues = getUniqueValues(columnData);\r\n compressedData = compressRawData(columnData, indexedValues);\r\n }\r\n return [{\r\n path: this.path,\r\n indexedValues: indexedValues,\r\n pathValuesRanges: compressedData\r\n }];\r\n }\r\n }", "title": "" }, { "docid": "18f573208cd6179debd202cfb49f1df6", "score": "0.5114691", "text": "function array_try_1(){\n\tvar div = \"dl_trial_a\"\n\tvar math = dl.ENV.math;\n\tvar a = dl.Array1D.new(temp_json[\"CURVES\"][\"GR\"])\n\tvar b = dl.Scalar.new(200);\n\tvar result = math.add(a, b);\n\t// result.data().then(data => console.log(data));\n\tresult.data().then(data => draw_curve_from_data(data,div,\"GR\"));\n\t// result.data().then(data => console.log(\"data = \",data));\n\n}", "title": "" }, { "docid": "4b5fa5bec3b745a200652ebcea08f1df", "score": "0.51122755", "text": "function processData(input) {\n //Enter your code here\n input = input.split(/\\r?\\n/);\n x = input.shift();\n y = input.shift();\n \n\n for (e in input) {\n input[e] = input[e].split(\" \");\n }\n matrix = input;\n \n //count = step(0,0,matrix);\n areas = [];\n for (i = 0; i < x; i++){\n for( j = 0; j < y; j++){\n areas.push(step(i,j,matrix));\n //console.log(count); \n //console.log(\"*********************************\");\n }\n }\n areas.sort(function(a,b){return b - a;});\n \n console.log(areas[0]);\n \n}", "title": "" }, { "docid": "6775fada4318a003d9123d347bf14558", "score": "0.5102838", "text": "function csvToArrays(allText, separator, comment, keyval) {\n var allTextLines = allText.split(/\\r\\n|\\n/);\n\n var qlc = {};\n var taxa = {};\n var concepts = {};\n var tIdx = -1;\n var cIdx = -1;\n var selection = [];\n var columns = {};\n var count = 1;\n\n var firstLineFound = false;\n var noid = false;\n for (var i = 0; i < allTextLines.length; i++)\n {\n var data = allTextLines[i].split(separator);\n if (data[0].charAt(0) == comment || data[0].replace(/\\s*/g,'') == '' || data[0].charAt(0) == keyval){}\n else if (data[0] == 'ID')\n {\n firstLineFound = true;\n\n /* get the header */\n var header = [];\n for (j = 1; j < data.length; j++)\n {\n var datum = data[j].toUpperCase();\n header.push(datum);\n if (['TAXA', 'TAXON', 'LANGUAGE', 'DOCULECT'].indexOf(datum) != -1)\n {\n tIdx = j;\n }\n if (datum == 'GLOSS' || datum == 'CONCEPT')\n {\n cIdx = j;\n }\n if (BASICS.indexOf(datum) != -1)\n {\n columns[datum] = j;\n }\n else\n {\n columns[datum] = -j;\n }\n }\n /* apply check for tidx and cidx */\n if (tIdx == -1 && cIdx == -1) {tIdx = 1;cIdx = 2;}\n else if (cIdx == -1 && tIdx > 1) {cIdx = 1; }\n else if (cIdx == -1 && tIdx <= 1) {cIdx = 2; }\n else if (tIdx == -1 && cIdx > 1) {tIdx = 1; }\n else if (tIdx == -1 && cIdx <= 1) {tIdx = 2; }\n\n /* append to basics */\n columns[data[tIdx].toUpperCase()] = Math.abs(columns[data[tIdx].toUpperCase()]);\n columns[data[cIdx].toUpperCase()] = Math.abs(columns[data[cIdx].toUpperCase()]);\n BASICS.push(data[tIdx].toUpperCase());\n BASICS.push(data[cIdx].toUpperCase());\n\n }\n/* handle cases where no ID has been submitted */\n else if(firstLineFound == false)\n {\n firstLineFound = true;\n noid = true;\n CFG['noid'] = true;\n\n /* get the header */\n var header = [];\n for (j = 0; j < data.length; j++)\n {\n var datum = data[j].toUpperCase();\n header.push(datum);\n if (['TAXA', 'TAXON', 'LANGUAGE', 'DOCULECT'].indexOf(datum) != -1)\n {\n tIdx = j;\n }\n if (datum == 'GLOSS' || datum == 'CONCEPT')\n {\n cIdx = j;\n }\n\t columns[datum] = j+1;\n }\n /* apply check for tidx and cidx */\n if (tIdx == -1 && cIdx == -1) {tIdx = 0;cIdx = 1;}\n else if (cIdx == -1 && tIdx > 1) {cIdx = 0; }\n else if (cIdx == -1 && tIdx <= 1) {cIdx = 1; }\n else if (tIdx == -1 && cIdx > 1) {tIdx = 2; }\n else if (tIdx == -1 && cIdx <= 1) {tIdx = 1; }\n\n /* append to basics */\n columns[data[tIdx].toUpperCase()] = Math.abs(columns[data[tIdx].toUpperCase()]);\n columns[data[cIdx].toUpperCase()] = Math.abs(columns[data[cIdx].toUpperCase()]);\n BASICS.push(data[tIdx].toUpperCase());\n BASICS.push(data[cIdx].toUpperCase());\n\n\n }\n //else if (data[0].charAt(0) == comment || data[0] == '') {}\n else if (firstLineFound)\n {\n if(!noid)\n {\n\t var idx = parseInt(data[0]);\n\t qlc[idx] = data.slice(1, data.length);\n }\n else\n {\n\t var idx = count;\n\t count += 1;\n\t qlc[idx] = data.slice(0,data.length);\n }\n\n /* check for header */\n var taxon = data[tIdx];\n var concept = data[cIdx];\n if (taxon in taxa)\n {\n taxa[taxon].push(idx);\n }\n else\n {\n taxa[taxon] = [idx];\n }\n if (concept in concepts)\n {\n concepts[concept].push(idx);\n }\n else\n {\n concepts[concept] = [idx];\n }\n selection.push(idx);\n }\n }\n // check whether or not we need this sorting mode, maybe we can as well get rid of it\n //selection.sort(function(x, y) {return x - y});\n\n WLS = qlc;\n WLS['header'] = header;\n WLS['taxa'] = taxa;\n WLS['concepts'] = concepts;\n WLS['parsed'] = true;\n WLS['rows'] = selection;\n WLS['columns'] = columns;\n WLS['filename'] = CFG['filename'];\n\n var all_columns = document.getElementById('columncb');\n var tmp_text = '<th>Columns</th><td>';\n for (col in WLS['columns'])\n {\n tmp_text += '<input id=\"cb_' + col + '\" onchange=\"filterColumns(this.value);\" type=\"checkbox\" ';\n if (BASICS.indexOf(col) != -1)\n {\n tmp_text += 'checked ';\n }\n tmp_text += 'name=\"columns\" value=\"';\n tmp_text += col;\n tmp_text += '\"> ' + col + '<br>';\n }\n all_columns.innerHTML = tmp_text + '</td>';\n all_columns.style.display = 'table-row';\n}", "title": "" }, { "docid": "db19ed7b66bed54dda02bb0bbfaaafe8", "score": "0.5100823", "text": "static parse_front_of_line_attributes(line){\n if(line.startsWith(\"Attributes\")) { line = line.substring(14) }\n else { line = line.substring(15) }\n let pairs = line.split(\",\")\n let attr_obj = {}\n for(let pair of pairs){\n let [key, val] = pair.split(\"=\")\n key = key.trim()\n\n if(!val) { val = \"\" }\n else { val = val.trim() }\n if(val.startsWith('\"') && val.endsWith('\"')) {\n val = val.substring(1, val.length - 1) //cut off surrounding double quotes\n }\n attr_obj[key] = val\n }\n return attr_obj\n }", "title": "" }, { "docid": "f11797074392689aebe516a13ffc5a70", "score": "0.50965697", "text": "function processData(data){\n\n //variable to store the first feature in the data\n var properties = data.features[0].properties;\n\n //for loop to push each attribute name into array\n for (var attribute in properties){ // looping through values with an index of \"Pop\" and pushing them to the array if they have a value greater than 0\n\n //indexOf will only allow attributes with population values to be pushed\n if (attribute.indexOf(\"Victims\") > -1){\n attributes.push(attribute);\n\n };\n };\n\n return attributes; //returns attributes array to be used in callback\n}", "title": "" }, { "docid": "db81e102eb7bb30ea4fc87dc63ef438c", "score": "0.50609505", "text": "function parseTrainingData(){\n let matches = RAW_TRAINING_DATA.match(patt);\n for(let x = 0; x < matches.length; ++x){\n matches[x] = matches[x].replaceAll(\")\", \"\"); // remove trailing parenthesis\n // split match by spaces\n let spliced = matches[x].split(\" \");\n let vec = Array();\n for(let i = 0; i < spliced.length; ++i){\n vec.push(parseFloat(spliced[i]));\n }\n training_data.push(vec);\n }\n return training_data;\n}", "title": "" }, { "docid": "b34db3727398e24f89866eab802f20a1", "score": "0.50588447", "text": "function metricsData(metrics) {\n let ret = [];\n metrics.split('\\n').forEach((line, i) => {\n if (line.substr(0, 1) == '#') {\n return;\n }\n let nameValue = line.split(' ');\n // Massage the value to make a JSON object\n if (nameValue.length == 2 && nameValue[0].substr(0, 19) == 'cf_cluster_requests') {\n let vals = nameValue[0].substr(19)\n let o = JSON.parse(vals\n .replace('destination=', '\"destination\":')\n .replace('method=', '\"method\":')\n .replace('node=', '\"node\":'))\n o.count = +nameValue[1];\n ret.push(o);\n }\n })\n return ret\n}", "title": "" }, { "docid": "bb1372dbb46c7bc8de39688605f1c50a", "score": "0.50583565", "text": "parseData(dataset) {\n let parsedData = [];\n for (let i = 0; i < dataset.length; i++) {\n let xx;\n if (this.ss.timeseries && this.ss.timeseries.active) {\n xx = (d3.isoParse(dataset[i][this.ss.data.xParam])) ? d3.isoParse(dataset[i][this.ss.data.xParam]) : dataset[i][this.ss.data.xParam];\n } else {\n xx = dataset[i][this.ss.data.xParam];\n }\n var a = {\n xValue: xx,\n yValue: dataset[i][this.ss.data.yParam]\n };\n parsedData.push(a);\n }\n return parsedData;\n }", "title": "" }, { "docid": "319fde4532209515c4135547146168cd", "score": "0.5035851", "text": "parseAnnotFromTsvLine(tsvLine, headerLine, chrs) {\n var annot, chrIndex, chr, start, color, fullName, significance, citations,\n name, index,\n columns = tsvLine.split(/\\t/g);\n\n [chr, start, stop, length] =\n this.parseGenomicCoordinates(columns);\n chrIndex = chrs.indexOf(chr);\n if (chrIndex === -1) return [null, null];\n\n name = columns[0];\n annot = [name, start, length, 0];\n\n if (headerLine.includes('color')) {\n index = this.getValueColumnIndex('color', headerLine);\n color = columns[index];\n annot.push(color);\n }\n if (headerLine.includes('full_name')) {\n index = this.getValueColumnIndex('full_name', headerLine);\n fullName = columns[index];\n annot.push(fullName);\n }\n if (headerLine.includes('citations')) {\n index = this.getValueColumnIndex('citations', headerLine);\n citations = columns[index];\n annot.push(citations);\n }\n if (headerLine.includes('significance')) {\n index = this.getValueColumnIndex('significance', headerLine);\n significance = columns[index];\n annot.push(significance);\n }\n\n return [chrIndex, annot];\n }", "title": "" }, { "docid": "06f3c905bcec0bf712ed387f2532c733", "score": "0.502458", "text": "function _parseVertex(line) {\n var vertex = JSON.parse(line);\n assert.ok(_smellsLikeAnElement(vertex));\n // A vertex is an object, i.e. a key,value map.\n // We don't sort the keys of the object, leaving that to jsonStableStringify below.\n // But a vertex values contain `property containers`, each of which may contain embedded arrays of elements.\n return _.mapValues(vertex, _sortPropertyContainers);\n }", "title": "" }, { "docid": "8a0ad74b16b846cea3c93b1cf5976b89", "score": "0.5017572", "text": "function setupLineAData(xLineMin, xLineMax, yLineMin, yLineMax, plotLineStep) {\n let xLine = [];\n let yLine = [];\n\n for (let i = xLineMin; i <= xLineMax; i += plotLineStep){\n xLine.push(i);\n }\n\n for (let j = xLineMin; j <= xLineMax; j += plotLineStep){\n yLine.push(yLineMin);\n }\n\n return [xLine , yLine];\n}", "title": "" }, { "docid": "a66659cabc126bc69cd393f5a1fd1fab", "score": "0.49993318", "text": "function processDataAsObj(csv){\r\n var allTextLines = csv.split(/\\r\\n|\\n/);\r\n var lines = [];\r\n\r\n //first line of csv\r\n var keys = allTextLines.shift().split(',');\r\n\r\n while (allTextLines.length) {\r\n var arr = allTextLines.shift().split(',');\r\n var obj = {};\r\n for(var i = 0; i < keys.length; i++){\r\n obj[keys[i]] = arr[i];\r\n\t}\r\n lines.push(obj);\r\n }\r\n console.log(lines);\r\n\tdrawOutputAsObj(lines);\r\n}", "title": "" }, { "docid": "560af49ab64ef17c5d933ba5b9e21709", "score": "0.4996317", "text": "function getNnnItemRowArr(dataLineArr, subjectBeginEndIdxArr, condition) {\n var jsonRowArr = [];\n _.each(subjectBeginEndIdxArr, function(subjectBE) {\n var subjectTitleLine = dataLineArr[subjectBE[0]];\n\n var id = subjectTitleLine.substring(subjectTitleLine.indexOf(' ID ') + 4);\n id = id.replace(/[\\r]+/g, ''); //remove the last '\\r' char;\n\n //+2 skip \" Item RT \" header\n for (var i = subjectBE[0] + 2; i <= subjectBE[1]; i++) {\n var line = dataLineArr[i].trim();\n if (line[0] === '!' || !line.split(/\\s{2,}/)[0]) {\n continue; //skip description and '\\r' line\n }\n\n //the row would go the output excel file\n var row = {};\n\n row['ID'] = id;\n row['Group'] = id.split(',')[0];\n row['Subject'] = id.split(',')[1];\n row['Initials'] = id.split(',')[2];\n row['Condition'] = condition;\n\n row['Item number'] = line.split(/\\s{1,}/)[0];\n row['Reaction time'] = line.split(/\\s{1,}/)[1];\n row['Block'] = row['Item number'][0];\n row['Trial'] = row['Item number'][1];\n\n row['Accuracy'] = row['Reaction time'] > 0 ? 1 : 0;\n\n jsonRowArr.push(row);\n }\n });\n return jsonRowArr;\n }", "title": "" }, { "docid": "6db5c043bb98bee7b47688b6651f8f6e", "score": "0.49706984", "text": "function process_raw_val(raw_attr_val, separator) {\r\n var attr_val_arr = []; // List contains the correct values\r\n // When or in value, split and put into attr_val_arr\r\n if (String(raw_attr_val).includes(separator)) {\r\n attr_val_arr = raw_attr_val.split(separator);\r\n\r\n for (var val_index = 0; val_index < attr_val_arr.length; val_index++) {\r\n var val = parseFloat(attr_val_arr[val_index].trim());\r\n\r\n if (!isNaN(val) && !String(raw_attr_val).includes('^')) {\r\n attr_val_arr[val_index] = val;\r\n } else {\r\n attr_val_arr[val_index] = attr_val_arr[val_index].trim();\r\n }\r\n }\r\n }\r\n\r\n // When single val, put it into attr_val_arr\r\n else {\r\n var val = parseFloat(raw_attr_val);\r\n if (!isNaN(val) && !String(raw_attr_val).includes('^')) {\r\n attr_val_arr.push(val);\r\n } else {\r\n attr_val_arr.push(raw_attr_val.trim());\r\n }\r\n }\r\n\r\n return attr_val_arr;\r\n}", "title": "" }, { "docid": "62810af3496ba88332fdaf13ca4faed3", "score": "0.49682516", "text": "function getData(station, smooth) {\n var item_sums = {};\n var item_counts = {};\n var dates = [];\n // loop through all lines\n for (line of lines) {\n var date = new Date(line.date);\n if (smooth) {\n date.setMonth(6);\n }\n if (!the_station || the_station == line['Station.Number']) {\n for (attr of attributes) {\n // print(line[attr]);\n if (attr in line && line[attr] != \"\" && line[attr] != \"NaN\") {\n if (!(date in item_sums)) {\n item_sums[date] = {};\n item_counts[date] = {};\n dates.push(date);\n }\n if (!(attr in item_sums[date])) {\n item_sums[date][attr] = 0.;\n item_counts[date][attr] = 0;\n }\n item_sums[date][attr] += parseFloat(line[attr]);\n item_counts[date][attr] += 1;\n }\n }\n }\n }\n // calculate average\n var items = [];\n for (date of dates) {\n item = {};\n for (attr of attributes) {\n if (attr in item_sums[date]) {\n item[attr] = item_sums[date][attr] / item_counts[date][attr];\n }\n }\n item.date = date;\n items.push(item);\n }\n return items;\n}", "title": "" }, { "docid": "f38bfbbaec81d65caa14d6b9126af34c", "score": "0.49598086", "text": "function parseMatAdjToJSON (data1) {\n\n\tvar data = data1[0];\n\t//console.log(data);\n\n\tvar nbLign = nbLignes(data);\n\t//console.log(nbLign);\n\n\tvar rez1 = [],\n\t\tindexLign,\n\t\tcp1data = data,\n\t\tcp2data = data;\n\n\tfor (var i = 0; i < nbLign-1; i++) {\n\t\tindexLign = data.indexOf(\"\\n\");\n\t\tcp1data = data;\n\t\tcp1data = cp1data.slice(0,indexLign);\n\t\t//console.log(cp1data);\n\t\tvar rez2 = cp1data.split(\" \",i+1)\n\t\tfor (var j = 0; j < rez2.length; j++) {\n\t\t\trez2[j] = +rez2[j]\n\t\t};\n\t\t//console.log(rez2);\n\n\t\t//on coupe data\n\t\tindexLign++;\n\t\tdata = data.slice(indexLign,data.length);\n\t\t//console.log(data);\n\n\t\trez1.push(rez2);\t\t\n\t};\n\n\trez2 = data.split(\" \",nbLign-1);\n\t//console.log(data);\n\t//console.log(data.length);\n\trez2.push(data.slice(data.length-1,data.length));\n\tfor (var i = 0; i < rez2.length; i++) {\n\t\trez2[i] = + rez2[i];\n\t};\n\trez1.push(rez2);\t\n\n\n\t//console.log(rez1);\n\treturn(rez1);\n\n}", "title": "" }, { "docid": "be5dae84a1f1a6714d77c60402266dc6", "score": "0.4959043", "text": "function processDataAsObj(csv){\n var allTextLines = csv.split(/\\r\\n|\\n/);\n var lines = [];\n\n //first line of csv\n var keys = allTextLines.shift().split(',');\n console.log(keys);\n\n while (allTextLines.length) {\n var arr = allTextLines.shift().split(',');\n var obj = {};\n for(var i = 0; i < keys.length; i++){\n obj[keys[i]] = arr[i];\n }\n lines.push(obj);\n }\n // console.log(lines);\n drawOutputAsObj(lines);\n }", "title": "" }, { "docid": "1134e46096440cb1b1480aeae1c8431c", "score": "0.495553", "text": "function func(data, bFirstline) {\n var temp = _.str.rtrim(data, \"\\n\");\n\n if (bFirstline) {\n legendArray = _.str.words(temp, \"|\");\n }\n else {\n lineArray = _.str.words(temp, \"|\");\n\n if (legendArray.length === lineArray.length) {\n var cdr = {};\n\n cdr.callId = lineArray[_.indexOf(legendArray, 'fbasename')];\n cdr.calldate = lineArray[_.indexOf(legendArray, 'calldate')];\n cdr.duration = lineArray[_.indexOf(legendArray, 'duration')];\n cdr.caller = lineArray[_.indexOf(legendArray, 'caller')];\n cdr.callerDomain = lineArray[_.indexOf(legendArray, 'caller_domain')];\n cdr.callerName = lineArray[_.indexOf(legendArray, 'callername')];\n cdr.called = lineArray[_.indexOf(legendArray, 'called')];\n cdr.calledDomain = lineArray[_.indexOf(legendArray, 'called_domain')];\n cdr.lastSipResponseNum = lineArray[_.indexOf(legendArray, 'lastSIPresponseNum')];\n cdr.sensorId = lineArray[_.indexOf(legendArray, 'id_sensor')];\n \n// a_mos_f1\n// a_mos_f2\n// a_mos_adapt\n// b_mos_f1\n// b_mos_f2\n// b_mos_adapt\n// a_rtcp_loss\n// a_rtcp_maxfr\n// a_rtcp_avgfr\n// a_rtcp_maxjitter\n// a_rtcp_avgjitter\n// b_rtcp_loss\n// b_rtcp_maxfr\n// b_rtcp_avgfr\n// b_rtcp_maxjitter\n// b_rtcp_avgjitter\n// jitter\n// mos_min\n// a_mos_min\n// b_mos_min\n// packet_loss_perc\n// a_packet_loss_perc\n// b_packet_loss_perc\n// delay_sum\n// a_delay_sum\n// b_delay_sum\n// delay_avg\n// a_delay_avg\n// b_delay_avg\n\n //console.log('xxxx:', cdr.callId);\n \n cdrArray.push(cdr);\n }\n else {\n console.log('data mismatch', legendArray.length, \"!=\", lineArray.length);\n process.exit();\n }\n }\n //console.log('Line: ' + temp);\n //console.log(legendArray);\n}", "title": "" }, { "docid": "3122bdef5e196db66f0e0262feb3b4fd", "score": "0.4938601", "text": "function transform_results(input){\n for(var i=0;i<input.length;i++){\n input[i] = {\"airport_1\":attr_data[i][\"airport_1\"],\"airport_2\":attr_data[i][\"airport_2\"],\"segments\":input[i],\"label\":attr_data[i][\"label\"],\"percent_change_2018_2019\":attr_data[i][\"percent_change_2018_2019\"]};\n }\n}", "title": "" }, { "docid": "ada636d0ee99ad06d15016841957a35e", "score": "0.4930574", "text": "static get lines() {\n\treturn { \n\t \"777777\":\"0\",\"888888\":\"1\",\"788878\":\"2\",\"878887\":\"3\",\"777878\":\"4\",\"878777\":\"5\",\"878888\":\"6\",\"888878\":\"7\",\n\t \"777877\":\"8\",\"778777\":\"9\",\"777888\":\"10\",\"888777\":\"11\",\"787777\":\"12\",\"777787\":\"13\",\"887888\":\"14\",\"888788\":\"15\",\n\t \"788778\":\"16\",\"877887\":\"17\",\"778888\":\"18\",\"888877\":\"19\",\"788787\":\"20\",\"787887\":\"21\",\"888887\":\"22\",\"788888\":\"23\",\n\t \"788777\":\"24\",\"777887\":\"25\",\"788887\":\"26\",\"877778\":\"27\",\"878878\":\"28\",\"787787\":\"29\",\"887778\":\"30\",\"877788\":\"31\",\n\t \"887777\":\"32\",\"777788\":\"33\",\"888787\":\"34\",\"787888\":\"35\",\"787877\":\"36\",\"778787\":\"37\",\"887878\":\"38\",\"878788\":\"39\",\n\t \"778887\":\"40\",\"788877\":\"41\",\"777778\":\"42\",\"877777\":\"43\",\"888778\":\"44\",\"877888\":\"45\",\"878778\":\"46\",\"877878\":\"47\",\n\t \"787778\":\"48\",\"877787\":\"49\",\"788788\":\"50\",\"887887\":\"51\",\"887877\":\"52\",\"778788\":\"53\",\"787788\":\"54\",\"887787\":\"55\",\n\t \"877877\":\"56\",\"778778\":\"57\",\"878877\":\"58\",\"778878\":\"59\",\"778877\":\"60\",\"887788\":\"61\",\"787878\":\"62\",\"878787\":\"63\"\n\t} \n }", "title": "" }, { "docid": "7ac258ff828830f635fa42aad6b4478f", "score": "0.4928624", "text": "async function processLineByLine(fileName) {\n\n const fileStream = fs.createReadStream(fileName);\n const rl = readline.createInterface({\n input: fileStream,\n crlfDelay: Infinity\n });\n\n for await (const line of rl) {\n // Each line in input will be successively available here as `line`.\n let lineWithTypePos = line.indexOf('type=\"');\n if (lineWithTypePos > -1) {\n let lineWithType = line.substring(lineWithTypePos, line.length);\n //console.log(lineWithType) ; \n let arr = lineWithType.split('\"');\n\n if (arr[1] != null && arr[3] != null) {\n let typeID = arr[1]; //typeID of your code\n let entityName = arr[3]; //entityName of your code\n\n //console.log(typeID + ' : ' + entityName );\n\n // Compare EntityName with CSV Wikia\n if (arrayOfClass[typeID] != null) {\n if (entityName != arrayOfClass[typeID]) {\n console.log('@@@ Found 2 XML with the same typeID but EntityName is different: type=\"' + typeID + '\" -> \"name=\"' + entityName + '\" vs \"name\"=\"' + arrayOfClass[typeID] + '\"');\n //console.log(line); \n }\n }\n\n // Compare TypeID with CSV Wikia\n if (arrayOfTypeID[entityName] != null) {\n if (typeID != arrayOfTypeID[entityName]) {\n console.log('### Found 2 XML with the same EntityName but typeID is different: \"name=\"' + entityName + '\" -> \"type\"=' + typeID + '\" vs \"type\"=' + arrayOfTypeID[entityName] + '\"');\n //console.log(line); \n }\n }\n } else {\n //console.log(line); //# Query: type=\"1 # Query: type=\"2\n }\n }\n }\n}", "title": "" }, { "docid": "750ce48e6bf8787bf6db0150843f25f4", "score": "0.49241886", "text": "function parseData (data) {\n const inputLines = data.split('\\n')\n\n const battingTeam = inputLines.shift()\n const bowlingTeam = inputLines.shift()\n const [\n overs,\n playersRemaining,\n runsTarget\n ] = inputLines.shift()\n .split(' ')\n .map(d => parseInt(d))\n\n const playersProbabilities = []\n for (let i = 0; i < playersRemaining * 2; i += 2) {\n playersProbabilities.push(\n [\n inputLines[i],\n inputLines[i + 1].split(' ').map(d => parseInt(d))\n ]\n )\n }\n\n return [\n battingTeam,\n bowlingTeam,\n overs,\n playersRemaining,\n runsTarget,\n playersProbabilities\n ]\n}", "title": "" }, { "docid": "777b87840d63f8d3a2f7bd153718ab5e", "score": "0.49231824", "text": "function extractData(arr){\r\n \r\n rawData.numEntries += arr.length;\r\n \r\n arr.forEach(function(element, index){\r\n\t\r\n var lineArr = element.split(/[\\t]/);\r\n var temp;\r\n\r\n // Hour started shopping\r\n temp = lineArr.shift().slice(11,13);\r\n rawData.hourHisto[temp] = (rawData.hourHisto[temp] || 0);\r\n rawData.hourHisto[temp] += 1;\r\n \r\n rawData.mostFrequentHour = (rawData.mostFrequentHour || temp);\r\n if (rawData.hourHisto[temp] > rawData.hourHisto[rawData.mostFrequentHour])\r\n rawData.mostFrequentHour = temp;\r\n\t\r\n // Cart-add\r\n temp = lineArr.shift();\r\n rawData.cartHisto[temp] = (rawData.cartHisto[temp] || 0);\r\n rawData.cartHisto[temp] += 1;\r\n\t\r\n // Made Purchase\r\n temp = lineArr.shift();\r\n if (temp === '1') rawData.numBought += 1;\r\n\t\r\n // Total amount spent\r\n rawData.spentTotal += +lineArr.shift();\r\n\t\r\n // Country shopped from\r\n temp = lineArr.shift();\r\n rawData.countryHisto[temp] = (rawData.countryHisto[temp] || 0);\r\n rawData.countryHisto[temp] += 1;\r\n determineTop3(temp);\r\n\t\r\n // Screen resolution\r\n temp = lineArr.shift() + \" x \" + lineArr.shift();\r\n rawData.screenHisto[temp] = (rawData.screenHisto[temp] || 0);\r\n rawData.screenHisto[temp] += 1;\r\n \r\n rawData.mostPopularResolution = (rawData.mostPopularResolution || temp);\r\n if (rawData.screenHisto[temp] > rawData.screenHisto[rawData.mostPopularResolution])\r\n rawData.mostPopularResolution = temp;\r\n\t\r\n\t});\r\n \r\n}", "title": "" }, { "docid": "54d67bddaf62a6964217ac58b95c2ced", "score": "0.4918872", "text": "function path(d) {\n// var data = []\n// vars.forEach(function(v,i){\n// data.push([position(i),y[i](getValue(d,v,names[i],customs[i]))])\n// })\n// console.log(data)\n// console.log(vars.map(function(p,i) {return [position(p), y[p](getValue(d,\"\",\"val\"+keyMap[p]))];}))\n// var v = d3.range(0,vars.length,1)\n return line(xDom.map(function(p) {return [position(p), y[p](getValue(d,vars[p],names[p],customs[p]))];}));\n return line(data)\n }", "title": "" }, { "docid": "bb9e60c824e68224d037d2927f9e2c66", "score": "0.49147052", "text": "function parseInput(input) {\n let parsedInput = input.split('\\n');\n parsedInput = parsedInput.map((line) => {\n line = line.trim();\n let lineArray = line.split(',');\n lineArray = lineArray.map((element) => element.trim());\n lineArray[2] = parseInt(lineArray[2]);\n return lineArray;\n });\n return parsedInput;\n}", "title": "" }, { "docid": "234083b209269b28716203171766e221", "score": "0.48865783", "text": "function createLines(json) {\n var meta = json.meta;\n var data = json.data;\n\n var newLines = [];\n\n for (var i=0; i < meta.lines.length; i++) {\n // Get the tag\n var lineTag = meta.lines[i].tag;\n\n newLines.push([]);\n // Generate the list of data (month, measurement)\n for (var j=0; j < data.length; j++) {\n // Assumes data has a \"Month\" tag in each element\n newLines[i].push([data[j][\"Month\"], data[j][lineTag]]);\n }\n }\n return newLines;\n }", "title": "" }, { "docid": "b3fa4cb515e44379be1802c84e208ba5", "score": "0.48669246", "text": "function build_json(line) {\n\tline = line.split(\",\");\n\tvar data = {\"state\":line[0]}\n\tvar lis = [];\n\tvar ind = 0;\n\tfor (var i = 1; i < line.length; i += 3) {\n\t\tlis[ind] = [parseInt(line[i + 1]), parseInt(line[i + 2])];\n\t\tind += 1;\n\t}\n\tdata[\"districts\"] = lis;\n\treturn data\n}", "title": "" }, { "docid": "6a8419e754819595981e694bf2d0a0df", "score": "0.48632762", "text": "assembleLineItems(){\n return this.props.bom.items.reduce((sum,item,n)=>{\n sum.push({\n id : this.props.bom.items[n].id,\n\t name : this.props.bom.products[n].name,\n description : this.props.bom.products[n].description,\n price : this.props.bom.items[n].cost,\n quantity : this.props.bom.items[n].quantity,\n extended : this.props.bom.items[n].cost *\n\t this.props.bom.items[n].quantity,\n });\n return sum;\n },[]);\n }", "title": "" }, { "docid": "ed7410905577b5c00d9621af033b4eb7", "score": "0.48416713", "text": "function parseSequentialAttributes(stream, element, numFeatures, gf) {\n\n\n}", "title": "" }, { "docid": "14e38c8e0b528054c423d46c9ff465f6", "score": "0.483772", "text": "function generateSimulations(lines){\n var simulations = []\n for(let i = 0; i < lines.length; i++){\n if(lines[i][0] != 'acc'){\n var simulation = JSON.parse(JSON.stringify(lines))\n simulation[i][0] = simulation[i][0] == 'nop' ? 'jmp' : 'nop' \n simulations.push(simulation)\n }\n }\n return simulations \n}", "title": "" }, { "docid": "74f664ddb332ed2344c6d439cf08c6fc", "score": "0.48270643", "text": "addAnnotations(datum) {\n for (let [key, addValues] of Object.entries(datum)) {\n if(addValues instanceof Date|| typeof addValues === 'symbol'){\n continue; // don't handel dates yet\n }\n let annotation = this.annotations[key];\n if (!annotation) {\n annotation = {};\n this.annotations[key] = annotation;\n }\n\n if(typeof addValues === 'string' || addValues instanceof String){\n // fake it as an array\n addValues = [addValues];\n }\n if (Array.isArray(addValues)) {\n // is a set of discrete values or \n const type = Type.DISCRETE;\n\n if (annotation.type && annotation.type !== type) {\n throw Error(`existing values of the annotation, ${key}, in the tree is not of the same type`);\n }\n annotation.type = type;\n annotation.values = annotation.values? [...annotation.values, ...addValues]:[...addValues]\n } else if (Object.isExtensible(addValues)) {\n // is a set of properties with values \n let type = null;\n\n let sum = 0.0;\n let keys = [];\n for (let [key, value] of Object.entries(addValues)) {\n if (keys.includes(key)) {\n throw Error(`the states of annotation, ${key}, should be unique`);\n }\n if (typeof value === typeof 1.0) {\n // This is a vector of probabilities of different states\n type = (type === undefined) ? Type.PROBABILITIES : type;\n\n if (type === Type.DISCRETE) {\n throw Error(`the values of annotation, ${key}, should be all boolean or all floats`);\n }\n\n sum += value;\n if (sum > 1.0) {\n throw Error(`the values of annotation, ${key}, should be probabilities of states and add to 1.0`);\n }\n } else if (typeof value === typeof true) {\n type = (type === undefined) ? Type.DISCRETE : type;\n\n if (type === Type.PROBABILITIES) {\n throw Error(`the values of annotation, ${key}, should be all boolean or all floats`);\n }\n } else {\n throw Error(`the values of annotation, ${key}, should be all boolean or all floats`);\n }\n keys.append(key);\n }\n\n if (annotation.type && annotation.type !== type) {\n throw Error(`existing values of the annotation, ${key}, in the tree is not of the same type`);\n }\n\n annotation.type = type;\n annotation.values = annotation.values? [...annotation.values, ...addValues]:[...addValues]\n } else {\n let type = Type.DISCRETE;\n\n if (typeof addValues === typeof true) {\n type = Type.BOOLEAN;\n } else if (Number(addValues)) {\n type = (addValues % 1 === 0 ? Type.INTEGER : Type.FLOAT);\n }\n\n if (annotation.type && annotation.type !== type) {\n if ((type === Type.INTEGER && annotation.type === Type.FLOAT) ||\n (type === Type.FLOAT && annotation.type === Type.INTEGER)) {\n // upgrade to float\n type = Type.FLOAT;\n } else {\n throw Error(`existing values of the annotation, ${key}, in the tree is not of the same type`);\n }\n }\n\n if (type === Type.DISCRETE) {\n if (!annotation.values) {\n annotation.values = new Set();\n }\n annotation.values.add(addValues);\n \n }\n\n annotation.type = type;\n }\n\n // overwrite the existing annotation property\n this.annotations[key] = annotation;\n }\n }", "title": "" }, { "docid": "2c01aeebd036ffba006df091a7e4e96d", "score": "0.4812993", "text": "function getMcItemRowArr(dataLineArr, subjectBeginEndIdxArr, Genre) {\n var jsonRowArr = [];\n _.each(subjectBeginEndIdxArr, function(subjectBE) {\n var subjectTitleLine = dataLineArr[subjectBE[0]];\n\n var id = subjectTitleLine.substring(subjectTitleLine.indexOf(' ID ') + 4);\n id = id.replace(/[\\r]+/g, ''); //remove the last '\\r' char;\n\n //+2 skip \" Item RT \" header\n var noResponseItemNum = 9999;\n for (var i = subjectBE[0] + 2; i <= subjectBE[1]; i++) {\n var line = dataLineArr[i].trim();\n if (line.indexOf('Played') > 0 && line.indexOf('frames') > 0) {\n //get the item number\n var itemNum = dataLineArr[i + 1].split(',')[0].split(' ')[1];\n if (itemNum > 100) {\n continue; //greater than 100 means test item, not real data\n }\n //the row would go into the output excel file\n var row = {};\n\n row['ID'] = id;\n row['Group'] = id.split(',')[0];\n row['Subject'] = id.split(',')[1];\n row['Initials'] = id.split(',')[2];\n\n row['Item number'] = itemNum;\n row['Stimulus filename'] = line.split(' ').pop();\n if (row['Stimulus filename'].indexOf('mik') >= 0) {\n row['Stimulus gender'] = 'Male';\n }\n if (row['Stimulus filename'].indexOf('lor') >= 0) {\n row['Stimulus gender'] = 'Female';\n }\n if (!row['Stimulus gender']) {\n console.log(line);\n console.log('Error: Stimulus gender parse failed.');\n }\n\n row['Genre'] = Genre; //this will be removed in merge json\n\n row['Reaction time'] = dataLineArr[i + 1].split(',')[1].trim();\n\n //No response: will repeat, get the second same item info\n if (row['Reaction time'].indexOf('No') >= 0 && noResponseItemNum !== row['Item number']) {\n noResponseItemNum = row['Item number'];\n continue;\n }\n //response number, will be changed to Participant response code like 'Ba, Da'\n if (dataLineArr[i + 2].split(',')[1]) {\n row['Participant btn num'] = dataLineArr[i + 2].split(',')[1][1].trim();\n } else {\n row['Participant btn num'] = undefined;\n }\n\n row['Accuracy'] = row['Reaction time'] > 0 ? 1 : 0;\n\n jsonRowArr.push(row);\n }\n }\n });\n //console.log(jsonRowArr);\n return jsonRowArr;\n }", "title": "" }, { "docid": "77ba6a3c0677d1489333322c5a53bf44", "score": "0.48100755", "text": "function graphFromCSV(filePath, ZOOM, BaseLineType, initHeight){\n\t\tlet parseResult = new Object({\n\t\tname : 'pouet',\n\t\ttimeBegin : 0,\n\t\ttimeEnd : 0,\n\t\ttime : new Array(),\n\t\tvalueMax : 0,\n\t\tvalueMin : 0,\n\t\tvalue : new Array()\n\t\t})\n\n\t\tlet words = filePath.split('/');\n\t\tconsole.log(words);\n\t\tlet tempname = \"\";\n\t\tfor (let l=0; l < words[words.length-1].length-4;l++){\n\t\t\ttempname = tempname + words[words.length-1][l]\n\t\t}\n\n\t $.ajax({\n\t \turl:filePath,\n\t \tasync:false,\n\t \tsuccess:function(data){\n\t \t\tparseResult.name = tempname;\n\t \t\tparseResult.time = [];\n\t \t\tparseResult.value = [];\n\t\t let lines = data.split(/\\r?\\n|\\r/);\n\t\t let conformData = true;\n\t\t for(let l in lines){\n\t\t \tlet vals = lines[l].split(',');\n\t\t \tif(vals.length < 2)\n\t\t \t\tcontinue;\n\t\t \tlet date = new Date(vals[0]);\n\t\t\t if(l>1){\n\t\t\t if(date < parseResult.time[parseResult.time.length-1]){\n\t\t\t \tparseResult.time.push(date);\n\t\t\t \tparseResult.value.push(parseFloat(vals[vals.length-1]))\n\t\t\t }\n\t\t\t else{\n\t\t\t \tconsole.log(\"WARNING : data not linear in time\")\n\t\t\t \tconformData = false;\n\t\t\t \tbreak;\n\t\t\t }\n\t\t\t }\n\t\t\t else if(l == 1){\n\t\t\t \tparseResult.timeEnd = date;\n\t\t\t \tparseResult.valueMax = parseFloat(vals[vals.length-1]);\n\t\t\t \tparseResult.valueMin = parseFloat(vals[vals.length-1]);\n\t\t\t \tparseResult.time.push(date);\n\t\t\t parseResult.value.push(parseFloat(vals[vals.length-1]))\n\t\t\t }\n\t\t \t}\n\t\t \tif(conformData){\n\t\t \t\tparseResult.timeBegin = parseResult.time[parseResult.time.length-1];\n\t\t \t\tlet tempTimeTable = new Array();\n\t\t \t\tlet tempValueTable = new Array();\n\t\t \t\tfor(let i in parseResult.time){\n\t\t \t\t\tparseResult.time[i] = parseResult.time[i] - parseResult.timeBegin;\n\t\t \t\t\tparseResult.time[i] = parseResult.time[i]/(parseResult.timeEnd-parseResult.timeBegin);\n\n\t\t \t\t\tif(i!=0 && i!=parseResult.time.length-1){\n\t\t \t\t\t\tif(Math.round(tempValueTable[tempValueTable.length-1])!=Math.round(parseResult.value[i])){\n\t\t \t\t\t\t\ttempTimeTable.push(parseResult.time[i])\n\t\t \t\t\t\t\ttempValueTable.push(parseFloat(parseResult.value[i]))\n\t\t \t\t\t\t}\n\t\t \t\t\t}\n\t\t \t\t\telse{\n\t\t \t\t\t\ttempTimeTable.push(parseResult.time[i])\n\t\t \t\t\t\ttempValueTable.push(parseFloat(parseResult.value[i]))\n\t\t \t\t\t}\n\t\t \t\t}\n\t\t \t\tparseResult.time = tempTimeTable.reverse();\n\t\t \t\tparseResult.value = tempValueTable.reverse();\n\t\t \t}\n\t\t \tfor(let i in parseResult.value){\n\t\t \t\tif(parseResult.value[i] > parseResult.valueMax)\n\t\t \t\t\tparseResult.valueMax = parseResult.value[i];\n\t\t \t\telse if(parseResult.value[i] < parseResult.valueMin)\n\t\t \t\t\tparseResult.valueMin = parseResult.value[i];\n\t\t \t} \n\t }\n\t });\n\t console.log(\"done\");\n\t let finalResult = new Graph((parseResult.valueMax+parseResult.valueMin)/2, ZOOM, 1,\n\t\t\t\t\t\t\t\t parseResult.value, parseResult.time, BaseLineType, 0, parseResult.time.length-1,\n\t\t\t\t\t\t\t\t initHeight, 2, parseResult.name);\n\t\tfinalResult.init();\n\t\tfinalResult.initListener();\n\t\tfinalResult.draw(true);\n\t\tconsole.log(Object.values(finalResult));\n\t return finalResult;\n\t}", "title": "" }, { "docid": "345e6d3f3e1988a43c45665c2191a38d", "score": "0.48089573", "text": "function n(r){return r&&g.fromJSON(r).features.map((r=>r))}", "title": "" }, { "docid": "89fe679616bcc85335c5c1e3a162d677", "score": "0.48052245", "text": "function processData(data, keyword){\n //empty array to hold attributes\n var attributes = [];\n //empty variable to store properties\n var currentProperties;\n\n //properties of the first feature in the dataset\n if (keyword === \"all\") {\n //assign current json to global variable for filtering\n currentDB = data;\n\n //properties of the first feature in the dataset\n currentProperties = data.features[0].properties;\n\n //push each attribute name into attributes array\n for (var attribute in currentProperties){\n //only take attributes with keyword values\n if (attribute.indexOf(\"totalCasualties\") > -1){\n attributes.push(attribute);\n };\n };\n } else if (keyword === \"union\") {\n //assign current json to global variable for filtering\n currentDB = data;\n\n //properties of the first feature in the dataset\n currentProperties = data.features[0].properties;\n\n //push each attribute name into attributes array\n for (var attribute in currentProperties){\n //only take attributes with keyword values\n if (attribute.indexOf(\"unionCasualties\") > -1){\n attributes.push(attribute);\n };\n };\n } else if (keyword === \"confederate\") {\n //assign current json to global variable for filtering\n currentDB = data;\n\n //properties of the first feature in the dataset\n currentProperties = data.features[0].properties;\n\n //push each attribute name into attributes array\n for (var attribute in currentProperties){\n //only take attributes with keyword values\n if (attribute.indexOf(\"confederateCasualties\") > -1){\n attributes.push(attribute);\n };\n };\n }\n return attributes;\n}", "title": "" }, { "docid": "98a5ff135af11e605e330c89fce2f8fe", "score": "0.47992533", "text": "async function loadData() {\n const data = new Array();\n\n const readStream = fs.createReadStream(__dirname + '/2sum-input.txt');\n const rl = readline.createInterface({\n input: readStream,\n crlfDelay: Infinity,\n });\n\n for await (const line of rl) {\n data.push(Number(line));\n }\n\n return data;\n}", "title": "" }, { "docid": "70ee931809d7094c3713f2aee632380a", "score": "0.4798566", "text": "jsonCondense(triples){\n let source = sem.rdfSerialize(triples,\"rdfjson\");\n var target = {\"@context\":this.prefixMap,graph:{}};\n Object.keys(source).forEach((subjectURI)=>{\n var subjectCurie = this.curie(subjectURI).replace(/\\:$/,'');\n target.graph[subjectCurie] = {};\n Object.keys(source[subjectURI]).forEach((predicateURI)=>{\n var predicateCurie = this.curie(predicateURI);\n target.graph[subjectCurie][predicateCurie]=[];\n var newObj = {}\n source[subjectURI][predicateURI].forEach((obj)=>{\n if (obj.type === \"uri\"){\n newObj = {value:this.curie(obj.value),type:obj.type}\n }\n else if (obj.type === \"blank\"){\n newObj = Object.assign(obj,{})\n } \n else {\n newObj = {value:obj.value,type:obj.type,datatype:this.curie(obj.datatype)}\n \n }\n target.graph[subjectCurie][predicateCurie].push(newObj);\n })\n })\n })\n return target; \n }", "title": "" }, { "docid": "43aed891b7ee4cd8b06e9502342c22d0", "score": "0.4796195", "text": "function graphFromCSV(filePath, ZOOM, BaseLineType, initHeight){\n let parseResult = new Object({\n name : 'pouet',\n timeBegin : 0,\n timeEnd : 0,\n time : new Array(),\n valueMax : 0,\n valueMin : 0,\n value : new Array()\n })\n\n let words = filePath.split('/');\n let tempname = \"\";\n for (let l=0; l < words[words.length-1].length-4;l++){\n tempname = tempname + words[words.length-1][l]\n }\n\n $.ajax({\n url:filePath,\n async:false,\n success:function(data){\n parseResult.name = tempname;\n parseResult.time = [];\n parseResult.value = [];\n let lines = data.split(/\\r?\\n|\\r/);\n let conformData = true;\n for(let l in lines){\n let vals = lines[l].split(',');\n if(vals.length < 2)\n continue;\n let date = new Date(vals[0]);\n if(l>1){\n if(date < parseResult.time[parseResult.time.length-1]){\n parseResult.time.push(date);\n parseResult.value.push(parseFloat(vals[vals.length-1]))\n }\n else{\n console.log(\"WARNING : data not linear in time\")\n conformData = false;\n break;\n }\n }\n else if(l == 1){\n parseResult.timeEnd = date;\n parseResult.valueMax = parseFloat(vals[vals.length-1]);\n parseResult.valueMin = parseFloat(vals[vals.length-1]);\n parseResult.time.push(date);\n parseResult.value.push(parseFloat(vals[vals.length-1]))\n }\n }\n if(conformData){\n parseResult.timeBegin = parseResult.time[parseResult.time.length-1];\n let tempTimeTable = new Array();\n let tempValueTable = new Array();\n for(let i in parseResult.time){\n parseResult.time[i] = parseResult.time[i] - parseResult.timeBegin;\n parseResult.time[i] = parseResult.time[i]/(parseResult.timeEnd-parseResult.timeBegin);\n if(i!=0 && i!=parseResult.time.length-1){\n tempTimeTable.push(parseResult.time[i])\n tempValueTable.push(parseFloat(parseResult.value[i]))\n }\n else{\n tempTimeTable.push(parseResult.time[i])\n tempValueTable.push(parseFloat(parseResult.value[i]))\n }\n }\n parseResult.time = tempTimeTable.reverse();\n parseResult.value = tempValueTable.reverse();\n }\n for(let i in parseResult.value){\n if(parseResult.value[i] > parseResult.valueMax)\n parseResult.valueMax = parseResult.value[i];\n else if(parseResult.value[i] < parseResult.valueMin)\n parseResult.valueMin = parseResult.value[i];\n }\n }\n });\n console.log(\"done\");\n let finalResult = new Graph((parseResult.valueMax+parseResult.valueMin)/2, ZOOM, 1,\n parseResult.value, parseResult.time, BaseLineType, 0, parseResult.time.length-1,\n initHeight, parseResult.name);\n finalResult.init();\n finalResult.initListener();\n finalResult.draw(true);\n return finalResult;\n }", "title": "" }, { "docid": "70ae0a319f63e6e4d0c035db71eccea4", "score": "0.4787298", "text": "function parseLine(iterator, line) {\n const idMatch = line.match(/^\\[(.*?)\\]/);\n if (idMatch) {\n const id = idMatch[1];\n if (line.match(/Started/) && line.indexOf(\"/assets/\") === -1) {\n requestHash[id] = parseRequestStart(id, line);\n } else if (line.match(/Completed/)) {\n const response = Object.assign({}, requestHash[id], parseRequestEnd(line));\n iterator.push(response);\n delete requestHash[id];\n\n const resource = resourceHash[response.requestResource];\n resourceHash[response.requestResource] = updateResource(resource, response);\n }\n }\n\n return iterator;\n}", "title": "" }, { "docid": "517ad2b4c35a8857cb939a3f538d6dd5", "score": "0.47856557", "text": "function u(r){return r&&x.fromJSON(r).features.map((r=>r))}", "title": "" }, { "docid": "264467c4baa65ff2fa100c37087ba7dd", "score": "0.4781306", "text": "formatArrayOfDatumOfArrayOfObject(data) {\n if (!this.inputLookup) {\n const inputLookup = new ArrayLookupTable(data, 'input');\n this.inputLookup = inputLookup.table;\n this.inputLookupLength = inputLookup.length;\n }\n if (!this.outputLookup) {\n const outputLookup = new ArrayLookupTable(data, 'output');\n this.outputLookup = outputLookup.table;\n this.outputLookupLength = outputLookup.length;\n }\n if (!this.outputLookupLength) {\n throw new Error('this.outputLookupLength not set to usable number');\n }\n const result = [];\n for (let i = 0; i < data.length; i++) {\n const datum = data[i];\n result.push(inputOutputObjectsToFloat32Arrays(datum.input, datum.output, this.inputLookup, this.outputLookup, this.inputLookupLength, this.outputLookupLength));\n }\n return result;\n }", "title": "" }, { "docid": "8864dc9cecd85cc4bd30b4b7f820e161", "score": "0.47787368", "text": "function processData(input) {\n //Enter your code here\n // console.log('input', input);\n // console.log('typeof input', typeof input);\n\n array1 = input.split(\"\\n\");\n // console.log('array1', array1);\n // console.log('typeof array1', typeof array1);\n\n numberOfIntegers = Number(array1[0]);\n // console.log('numberOfIntegers', numberOfIntegers);\n // console.log('typeof numberOfIntegers', typeof numberOfIntegers);\n\n individualIntegers = array1[1].split(\" \");\n // console.log('individualIntegers', individualIntegers);\n\n lengthOfIndividualIntegers = individualIntegers.length;\n // console.log('lengthOfIndividualIntegers', lengthOfIndividualIntegers);\n\n for (index = 0; index < lengthOfIndividualIntegers; index++) {\n if (\n individualIntegers[index] === \"2\" &&\n individualIntegers[index + 1] === undefined\n ) {\n console.log(-1);\n } else if (individualIntegers[index] === \"2\") {\n console.log(Number(individualIntegers[index + 1]));\n }\n }\n}", "title": "" }, { "docid": "0f70100459655e5c44bacfa75a7c7b9c", "score": "0.47765335", "text": "function parser(arr){\n // Fields to be parsed: \"originalInvestment\", \"valueToday\"\n // YOUR CODE HERE\n return arr.map(function(investment){\n investment.originalInvestment = Number(investment.originalInvestment);\n investment.valueToday = Number(investment.valueToday);\n return investment;\n })\n}", "title": "" }, { "docid": "57fe0961ceafe4d954e8aa42dd5096df", "score": "0.47703516", "text": "formatArrayOfObject(data) {\n this.requireInputOutputOfOne();\n if (!this.inputLookup) {\n const lookupTable = new LookupTable(data);\n this.inputLookup = this.outputLookup = lookupTable.table;\n this.inputLookupLength = this.outputLookupLength = lookupTable.length;\n }\n const result = [];\n for (let i = 0; i < data.length; i++) {\n result.push(objectToFloat32Arrays(data[i]));\n }\n return result;\n }", "title": "" }, { "docid": "8a08ba9af6a842e3c00440b46adc2d86", "score": "0.4767172", "text": "function aa_deser_createArray(cmd, procLog) {\n\t\t\tvar arr = [];\n\t\t\t\n\t\t\tnodesByKey[cmd.key] = arr; // add to lookup\n\t\t\taa_deser_log(cmd, procLog);\n\t\t\t\n\t\t\treturn arr;\n\t\t}", "title": "" }, { "docid": "f877ed1f42f4cf66c3497e38490db06e", "score": "0.47650728", "text": "function csvString(str, delemiter)\n{\n let titles = str.slice(0, str.indexOf(\"\\n\")).split(delemiter);\n let arr = str.substring(str.indexOf('\\n') + 1).split('\\n').map(v => \n {\n const value = v.split(delemiter)\n return titles.reduce(function (obj, title, index) { \n obj[title] = value[index];\n console.log(obj[title], title,value[index], index); \n return obj; //return value or accummulator\n },\n {}//initial value\n );\n \n });\n console.log(arr);\n return arr;\n}", "title": "" }, { "docid": "5367ef30a2ef833e5d6bcab71050e2b4", "score": "0.4763424", "text": "formatArrayOfDatumOfObject(data) {\n this.requireInputOutputOfOne();\n if (!this.inputLookup) {\n const inputLookup = new LookupTable(data, 'input');\n this.inputLookup = inputLookup.table;\n this.inputLookupLength = inputLookup.length;\n }\n if (!this.outputLookup) {\n const outputLookup = new LookupTable(data, 'output');\n this.outputLookup = outputLookup.table;\n this.outputLookupLength = outputLookup.length;\n }\n const result = [];\n for (let i = 0; i < data.length; i++) {\n const datum = data[i];\n result.push(inputOutputObjectToFloat32Arrays(datum.input, datum.output));\n }\n return result;\n }", "title": "" }, { "docid": "c19577e789cf6f5ffa8d63d47b6d712e", "score": "0.47609138", "text": "function retreiveData(sample) {\n d3.json(url_barLine).then(data=> {\n console.log(data)\n });\n}", "title": "" }, { "docid": "905968aed4696e02280c4bda58cc6308", "score": "0.47561708", "text": "function convertToArr(src){\n\tlet parsedData = d3.timeParse(\"%Y-%m-%d\");\n\t// put the api's bpi into an object\n\tlet obj = src.bpi\n\t// store object in a key\n\tlet keys = Object.keys(obj)\n\t// map through the keys creating an object of each key\n\tlet resArr = keys.map(k => {\n\t\tlet o = {}\n\t\to['date'] = parsedData(k)\n\t\to['value'] = obj[k]\n\t\treturn o\n\t})\n\tsrc.bpi = resArr;\n\treturn src\n}", "title": "" }, { "docid": "496dbab0f09e8dacbb15d102ca4bb4e3", "score": "0.4756058", "text": "function createextrusionincrementvalues(d,numpoints,v_matdiameter,v_nozzlediameter){\n\n\tvar e = new Array;\n\n\t/*Calculating nozzle_material_surfaces_ratio*/\t\n\tvar v_materialsurface=Math.PI*Math.pow((v_matdiameter/2.0),2);\n\tvar v_nozzlesurface=Math.PI*Math.pow((v_nozzlediameter/2.0),2);\n\tvar nozzle_material_surfaces_ratio=v_nozzlesurface/v_materialsurface;\n\t\n\tfor (var p_counter = 0; p_counter < numpoints; p_counter = p_counter+1) {\n\t\te[p_counter]=d[p_counter]*nozzle_material_surfaces_ratio \n\t}\n\treturn e;\n}", "title": "" }, { "docid": "cd68e4a5b5b1c3b6f34b0949a6d2a23f", "score": "0.47555164", "text": "getProcessedJson(data, header) {\n let keys = this.getKeys(data, header);\n let newData = [];\n let _self = this;\n data.map(function(item, index) {\n let newItem = {};\n for (let label in keys) {\n let property = keys[label];\n newItem[label] = _self.getValue(property, item);\n }\n newData.push(newItem);\n });\n\n return newData;\n }", "title": "" }, { "docid": "38d86cbf29f7a945558a9a7c77e759cf", "score": "0.47547585", "text": "formatArrayOfArrayOfObject(data) {\n if (!this.inputLookup) {\n const lookupTable = new LookupTable(data);\n this.inputLookup = this.outputLookup = lookupTable.table;\n this.inputLookupLength = this.outputLookupLength = lookupTable.length;\n }\n const result = [];\n for (let i = 0; i < data.length; i++) {\n const array = [];\n for (let j = 0; j < data[i].length; j++) {\n array.push(objectToFloat32Array(data[i][j], this.inputLookup, this.inputLookupLength));\n }\n result.push(array);\n }\n return result;\n }", "title": "" }, { "docid": "488c2691b11b5f9c058b886b70e92053", "score": "0.47532234", "text": "function convertLineToObj(line){\n let data = {};\n\n line.split('').forEach(letter => {\n if( data[letter]){\n data[letter]= data[letter] +1;\n }else{\n data[letter]=1;\n };\n });\n return data;\n}", "title": "" }, { "docid": "0d389691e3519d8028e924e98d0bfaba", "score": "0.47481063", "text": "function updateLinechartValues(datum) {\n var count = 0;\n for (var i in items) {\n if (items[i].status == \"full\") {\n count+=1;\n }\n }\n datum = datum.slice(14,19);\n xValuesLine.push(datum);\n yValuesLine.push(count);\n}", "title": "" }, { "docid": "5394e6f891e7f39fc707e628afa77deb", "score": "0.47437218", "text": "function calculateLineItems(cart) {\n var lineItems = [];\n return Promise.map(cart.lineItems, function(item) {\n return ChannelService.byId(item.distributionChannel.id).then(function(distributionChannel) {\n return ProductService.byIdAsync(item.productId).then(function(product) {\n\n var taxCode;\n if (distributionChannel.key == 'nonprescription') {\n if (product.categories[0].obj.slug.en === 'eyeglasses') {\n taxCode = config.avalara.nonPrescriptionEyewearTaxCode;\n } else {\n taxCode = config.avalara.nonPrescriptionSunglassTaxCode;\n }\n } else if (distributionChannel.key == 'singlevision') {\n if (product.categories[0].obj.slug.en === 'eyeglasses') {\n taxCode = config.avalara.prescriptionEyewearTaxCode;\n } else {\n taxCode = config.avalara.prescriptionSunglassTaxCode;\n }\n }\n\n return {\n \"LineNo\": item.id,\n \"DestinationCode\": cart.shippingAddress.id,\n \"OriginCode\": ORIGIN_ADDRESS.AddressCode,\n \"Qty\": item.quantity,\n \"Amount\": Number(parseInt(item.totalPrice.centAmount / 100).toFixed(0)),\n \"Description\": item.name.en,\n \"ItemCode\": item.productSlug.en,\n \"TaxCode\": taxCode\n };\n })\n })\n }).then(function(lineItems) {\n return lineItems;\n }).catch(function(error) {\n app.logger.error(\"Error calculating Avalara taxes %s\", JSON.stringify(error));\n throw new Error(\"There was an error calculating the taxes, please try again later or contact us for support.\")\n });\n }", "title": "" }, { "docid": "01bd1ec93af5525877107225657d0903", "score": "0.4740926", "text": "function processData(input) {\n //Enter your code here\n array1 = input.split(\"\\n\");\n // console.log(array1)\n value1 = array1[0];\n value2 = array1[1];\n // console.log(value1);\n arrayConstraint = value1.split(\" \");\n // console.log(arrayConstraint)\n // console.log(typeof arrayConstraint)\n arrayConstraint1 = arrayConstraint[0];\n arrayConstraint2 = arrayConstraint[1];\n numberConstraint1 = Number(arrayConstraint1);\n numberConstraint2 = Number(arrayConstraint2);\n // console.log(Number(arrayConstraint1))\n // console.log(Number(arrayConstraint2))\n // console.log(typeof value1)\n // console.log(value2);\n // number1 = value1[1];\n // console.log(number1);\n arrayUpload = value2.split(\" \");\n // console.log(arrayUpload)\n // console.log(typeof arrayUpload)\n arrayUpload1 = arrayUpload[0];\n arrayUpload2 = arrayUpload[1];\n numberArrayUpload1 = Number(arrayUpload1);\n numberArrayUpload2 = Number(arrayUpload2);\n // console.log(Number(arrayUpload1))\n // console.log(Number(arrayUpload2))\n\n if (numberConstraint1 > numberArrayUpload1) {\n console.log(\"Increase Length\");\n } else {\n console.log(\"Increase Width\");\n }\n}", "title": "" }, { "docid": "2d3bd2542c3cfa8f608c2faa3af455d5", "score": "0.47395578", "text": "function makeLineObjects (arrOfLines) {\n const final = []\n arrOfLines.forEach(line => {\n let obj1 = {}, obj2 = {}, obj3 = {}\n obj1['ExecutionDateTime'] = line[0]\n obj1['ExecutionSpeed'] = line[4]\n obj2['DatabaseType'] = line[5]\n obj2['DatabaseFileName'] = line[6]\n obj3['QueryName'] = findName(line[7])\n final.push([obj1, obj2, obj3])\n })\n return final\n}", "title": "" }, { "docid": "467969a0c098f814289f2d4fe7b219c3", "score": "0.47381812", "text": "function stepFnData(x, y){\n\t\t\tvar stepx = [], stepy = [];\n\t\t\tfor (var i = 0; i < x.length; i++){\n\t\t\t\t\tif ((i > 0) && !isNaN(y[i-1])){\n\t\t\t\t\t\t\tstepx.push(x[i]);\n\t\t\t\t\t\t\tstepy.push(y[i-1]);\n\t\t\t\t\t}\n\t\t\t\t\tif (!isNaN(y[i])){\n\t\t\t\t\t\t\tstepx.push(x[i]);\n\t\t\t\t\t\t\tstepy.push(y[i]);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\"x\": stepx, \"y\": stepy};\n\t}", "title": "" }, { "docid": "4f53874c9192cb0298e463493a7335d1", "score": "0.4736308", "text": "function processData(allRows, xLabel, yLabel, yTraceName, yTraceColor, yWidth, yDash) {\n\n var x = [],\n y = [],\n trace = [];\n // console.log(allRows.length);\n\n for (var i = 0; i < allRows.length; i++) {\n row = allRows[i];\n x.push(row[xLabel]);\n y.push(row[yLabel]);\n if (i === 0) {\n // console.log(i);\n }\n }\n trace = {\n x: x,\n y: y,\n name: yTraceName,\n mode: 'lines',\n line: {color: yTraceColor, width: yWidth, dash: yDash },\n };\n //console.log(trace.mode);\n return trace;\n }", "title": "" }, { "docid": "d46cbe5698d815b8cce81044391cb4f1", "score": "0.4735718", "text": "function parseLine(line) {\n\treturn {\n\t\tname: line.substring(0, 6),\n\t\tyear: line.substring(6, 10),\n\t\tv1: line.substring(10,14 ),\n\t\tv2: line.substring(17, 21),\n\t\tv3: line.substring(24, 28),\n\t\tv4: line.substring(31, 35),\n\t\tv5: line.substring(38, 42),\n\t\tv6: line.substring(45, 49),\n\t\tv7: line.substring(52, 56),\n\t\tv8: line.substring(59, 63),\n\t\tv9: line.substring(66, 70),\n\t\tv10: line.substring(73, 77)\n\t};\n}", "title": "" }, { "docid": "2d0fb1ccff88d3408b9d6a00d399834b", "score": "0.47304338", "text": "function parseSensorData(sensorData) {\n let splitData = sensorData.split('|');\n return [{\n x: splitData[2],\n y: splitData[3],\n z: splitData[4]\n },\n {\n x: splitData[5], \n y: splitData[6], \n z: splitData[7]\n },\n {\n x: splitData[8],\n y: splitData[9],\n z: splitData[10]\n },\n {\n x: splitData[11],\n y: splitData[12],\n z: splitData[13]\n },\n splitData[15]\n ] \n}", "title": "" }, { "docid": "16abe6c5e211e794abc24dad150be081", "score": "0.47267908", "text": "function exampleData() {\n return [\n { \n \"label\": \"2010\",\n \"value\" : \"65.689\"\n } , \n { \n \"label\": \"2011\",\n \"value\" : \"61.701\"\n } , \n { \n \"label\": \"2012\",\n \"value\" : \"48.660\"\n } , \n { \n \"label\": \"2013\",\n \"value\" : \"44.263\"\n } , \n { \n \"label\": \"2014\",\n \"value\" : \"24.704\"\n } , \n { \n \"label\": \"2015\",\n \"value\" : \"26.770\"\n } , \n { \n \"label\": \"2016\",\n \"value\" : \"25.956\"\n }\n ];\n}", "title": "" }, { "docid": "5ed17a76c96c394d25d26f58ec4246c0", "score": "0.4717984", "text": "function getProgs() {\n sa.getSheet(\"PROGRAMS_AND_LIBRARIANS\").then(response => {\n progInfo = sa.parseSheetValues(response);\n console.log(progInfo);\n for(let i = 1; i < progInfo.length; i++){\n progArray[i] = progInfo[i][0];\n }\n console.log(progArray);\n });\n}", "title": "" }, { "docid": "19408f33169e7e707649281ac0a48b2f", "score": "0.471709", "text": "_parseResult(data) {\n return data\n ? data.map(item => {\n const fromWei = utils.fromWei(item.value);\n const value = BigNumber(fromWei).toFixed(4);\n const returnedValue = BigNumber(value).toNumber();\n const actualTimeStamp = BigNumber(item.timestamp)\n .times(1000)\n .toNumber();\n return [actualTimeStamp, returnedValue];\n })\n : [];\n }", "title": "" }, { "docid": "1ebb6c3ed17d29003baa53a670ef4414", "score": "0.4716848", "text": "function parse(data) {\n var array = [];\n // throw error if first number is not a number\n if (!isNaN(parseInt(data[0], 10))) {\n var dimension = parseInt(data[0], 10);\n var index = 1;\n while (!isNaN(parseInt(data[index], 10))) {\n // maybe it's a number greater than 9\n dimension = dimension * 10 + parseInt(data[index], 10);\n index++;\n }\n // iterate and do the same for every other number\n for (var i = index; i <= data.length; i++) {\n var number = parseInt(data[i], 10);\n if (!isNaN(number)) {\n index = i+1;\n while (!isNaN(parseInt(data[index], 10))) {\n number = number * 10 + parseInt(data[index], 10);\n index++;\n }\n i = index-1;\n array.push(number);\n }\n }\n }\n if (array.length == dimension*dimension) {\n // If parsing was successful, update new table dimension\n $rootScope.dimension = dimension;\n } else {\n // indicate unsuccessful parsing\n array = [];\n }\n return array;\n }", "title": "" }, { "docid": "9f153a8fbff3594f3af364d8f0f12c22", "score": "0.471613", "text": "function parseAttribute(attribute){\n var name = attribute.name.toLowerCase();\n switch(name){\n\t\tcase 'accent-height' : interpretAttribute(attribute); break;\n\t\tcase 'alphabetic' : interpretAttribute(attribute); break;\n\t\tcase 'amplitude' : interpretAttribute(attribute); break;\n\t\tcase 'ascent' : interpretAttribute(attribute); break;\n\t\tcase 'cap-height' : interpretAttribute(attribute); break;\n\t\tcase 'cx' : interpretAttribute(attribute); break;\n\t\tcase 'cy' : interpretAttribute(attribute); break;\n\t\tcase 'descent' : interpretAttribute(attribute); break;\n\t\tcase 'dx' : interpretAttribute(attribute); break;\n\t\tcase 'dy' : interpretAttribute(attribute); break;\n\t\tcase 'exponent' : interpretAttribute(attribute); break;\n\t\tcase 'fx' : interpretAttribute(attribute); break;\n\t\tcase 'fy' : interpretAttribute(attribute); break;\n\t\tcase 'font-size' : interpretAttribute(attribute); break;\n\t\tcase 'hanging' : interpretAttribute(attribute); break;\n\t\tcase 'height' : interpretAttribute(attribute); break;\n\t\tcase 'horiz-adv-x' : interpretAttribute(attribute); break;\n\t\tcase 'ideographic' : interpretAttribute(attribute); break;\n\t\tcase 'intercept' : interpretAttribute(attribute); break;\n\t\tcase 'k' : interpretAttribute(attribute); break;\n\t\tcase 'k1' : interpretAttribute(attribute); break;\n\t\tcase 'k2' : interpretAttribute(attribute); break;\n\t\tcase 'k3' : interpretAttribute(attribute); break;\n\t\tcase 'k4' : interpretAttribute(attribute); break;\n\t\tcase 'mathematical' : interpretAttribute(attribute); break;\n\t\tcase 'offset' : interpretAttribute(attribute); break;\n\t\tcase 'offset' : interpretAttribute(attribute); break;\n\t\tcase 'overline-position' : interpretAttribute(attribute); break;\n\t\tcase 'overline-thickness' : interpretAttribute(attribute); break;\n\t\tcase 'panose-1' : interpretAttribute(attribute); break;\n\t\tcase 'pathLength' : interpretAttribute(attribute); break;\n\t\tcase 'r' : interpretAttribute(attribute); break;\n\t\tcase 'rx' : interpretAttribute(attribute); break;\n\t\tcase 'ry' : interpretAttribute(attribute); break;\n\t\tcase 'scale' : interpretAttribute(attribute); break;\n\t\tcase 'seed' : interpretAttribute(attribute); break;\n\t\tcase 'slope' : interpretAttribute(attribute); break;\n\t\tcase 'specularConstant' : interpretAttribute(attribute); break;\n\t\tcase 'specularExponent' : interpretAttribute(attribute); break;\n\t\tcase 'startOffset' : interpretAttribute(attribute); break;\n\t\tcase 'stemh' : interpretAttribute(attribute); break;\n\t\tcase 'stemv' : interpretAttribute(attribute); break;\n\t\tcase 'strikethrough-position' : interpretAttribute(attribute); break;\n\t\tcase 'strikethrough-thickness' : interpretAttribute(attribute); break;\n\t\tcase 'targetY' : interpretAttribute(attribute); break;\n\t\tcase 'textLength' : interpretAttribute(attribute); break;\n\t\tcase 'underline-position' : interpretAttribute(attribute); break;\n\t\tcase 'underline-thickness' : interpretAttribute(attribute); break;\n\t\tcase 'units-per-em' : interpretAttribute(attribute); break;\n\t\tcase 'v-alphabetic' : interpretAttribute(attribute); break;\n\t\tcase 'v-hanging' : interpretAttribute(attribute); break;\n\t\tcase 'v-ideographic' : interpretAttribute(attribute); break;\n\t\tcase 'v-mathematical' : interpretAttribute(attribute); break;\n\t\tcase 'version' : interpretAttribute(attribute); break;\n\t\tcase 'vert-adv-y' : interpretAttribute(attribute); break;\n\t\tcase 'vert-adv-y' : interpretAttribute(attribute); break;\n\t\tcase 'vert-origin-x' : interpretAttribute(attribute); break;\n\t\tcase 'vert-origin-x' : interpretAttribute(attribute); break;\n\t\tcase 'vert-origin-y' : interpretAttribute(attribute); break;\n\t\tcase 'vert-origin-y' : interpretAttribute(attribute); break;\n\t\tcase 'width' : interpretAttribute(attribute); break;\n\t\tcase 'x' : interpretAttribute(attribute); break;\n\t\tcase 'x1' : interpretAttribute(attribute); break;\n\t\tcase 'x2' : interpretAttribute(attribute); break;\n\t\tcase 'x-height' : interpretAttribute(attribute); break;\n\t\tcase 'y' : interpretAttribute(attribute); break;\n\t\tcase 'y1' : interpretAttribute(attribute); break;\n\t\tcase 'y2' : interpretAttribute(attribute); break;\n\t\tcase 'z' : interpretAttribute(attribute); break;\n default : break;\n }\n}", "title": "" }, { "docid": "facc2d3fa6879b36dcc658522a6f6faf", "score": "0.47128686", "text": "function extract(item){\n\n let data = new Array (header.length);\n // since few documents dont have evalscores and their status is evalPending\n if(item['evalScores'] && header.length <= 0){\n Object.keys(item).map(function(key){\n if(key!='evalScores' && key!='payload'){\n header.push(key);\n }\n else if(key == 'evalScores'){\n Object.keys(item['evalScores']).map(function(evalTemp){\n if(evalTemp == 'sections'){\n item['evalScores']['sections'].map(function(element,index){\n header.push('evalScores_sections_'+element['name']+'_status');\n header.push('evalScores_sections_'+element['name']+'_total');\n header.push('evalScores_sections_'+element['name']+'_passes');\n header.push('evalScores_sections_'+element['name']+'_failed');\n header.push('evalScores_sections_'+element['name']+'_score');\n })\n }\n else{\n header.push('evalScores_finalScore');\n }\n })\n }\n else if (key == 'payload') {\n Object.keys(item['payload']).map(function(payTemp){\n header.push('payload_'+payTemp);\n })\n }\n })\n // console.log(header.length);\n }else {\n Object.keys(item).map(function(key){\n if(key!='evalScores' && key!='payload'){\n data[header.indexOf(key)] = item[key];\n }\n else if(key == 'evalScores'){\n Object.keys(item['evalScores']).map(function(evalTemp){\n if(evalTemp == 'sections'){\n item['evalScores']['sections'].map(function(element,index){\n data[header.indexOf('evalScores_sections_'+element['name']+'_status')] = item['evalScores']['sections'][index]['status'];\n data[header.indexOf('evalScores_sections_'+element['name']+'_total')] = item['evalScores']['sections'][index]['total'];\n data[header.indexOf('evalScores_sections_'+element['name']+'_passes')] = item['evalScores']['sections'][index]['passes'];\n data[header.indexOf('evalScores_sections_'+element['name']+'_failed')] = item['evalScores']['sections'][index]['failed'];\n data[header.indexOf('evalScores_sections_'+element['name']+'_score')] = item['evalScores']['sections'][index]['score'];\n })\n }\n else{\n data[header.indexOf('evalScores_finalScore')] = item['evalScores']['finalScore'];\n }\n })\n }\n else if (key == 'payload') {\n Object.keys(item['payload']).map(function(payTemp){\n data[header.indexOf('payload_solutionRepoUrl')] = item['payload']['solutionRepoUrl'];\n })\n }\n })\n\n data[0] = data[0].toString(); // the first entry is the Id which is in the form Object, hence converted to String\n \n //author Ashwin Jayadev\n // insertion code to cassandra\n client.execute(query,data,{ prepare : true },(err,result)=>{\n if(err) throw err;\n })\n \n }\n}", "title": "" } ]
157798e0c09a022e15807a5c0c1c083e
Actualiza el valor de las HorasExtras en el Storage
[ { "docid": "71a2b6f859b017c6f921ddc3bbff8966", "score": "0.6191796", "text": "function actualizarHorasExtrasResta(horasARestar){\n\t\t//obtenemos el acumulado actual de las horas extras\n\t\tvar horasExtrasActuales = localStorage.getItem('HorasExtras');\n\t\tvar nuevaHorasExtras = restaHoras(horasExtrasActuales, horasARestar);\n\t\tvar vminutos = nuevaHorasExtras.split(\":\"); \n\t\tvar retNuevaHora = vminutos[0] + \":\" + ( (parseInt(vminutos[1],10) < 10) ? (\"0\" + vminutos[1]) : vminutos[1] );\n\t\tlocalStorage.setItem('HorasExtras', retNuevaHora );\n}", "title": "" } ]
[ { "docid": "94091ff430290a0e9650b06b624aaa1f", "score": "0.59791374", "text": "set storage(value) { this._storage = value; }", "title": "" }, { "docid": "ba9fcbd22e2527b79e110ff6d88f50b6", "score": "0.5941818", "text": "constructor() {\n this.storage = {};\n this.amount = 0;\n }", "title": "" }, { "docid": "9269dd73266da14aef2c62beaaa3ecfd", "score": "0.58966255", "text": "_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 }", "title": "" }, { "docid": "024a96f3868bec6df867676259019996", "score": "0.57885844", "text": "function _save(){\n try{\n _storage_service.jStorage = json_encode(_storage);\n // If userData is used as the storage engine, additional\n if(_storage_elm) {\n _storage_elm.setAttribute(\"jStorage\",_storage_service.jStorage);\n _storage_elm.save(\"jStorage\");\n }\n _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;\n }catch(E7){/* probably cache is full, nothing is saved this way*/}\n }", "title": "" }, { "docid": "010d4b942ceb4782a675971a0ee6c31e", "score": "0.57453054", "text": "async function savePedido(){\n try {\n await AsyncStorage.setItem('@Pedido', JSON.stringify(pedido));\n } catch (error) {\n // Error retrieving data\n }\n }", "title": "" }, { "docid": "ce83ca1d384af08f3a8e1142a2cd5348", "score": "0.5723854", "text": "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}", "title": "" }, { "docid": "a9cfd22076f0db012a58b9a8902bf309", "score": "0.57168055", "text": "_updateStorage() {\n sessionStorage.setItem(`${this._storagePrefix}`, JSON.stringify(Object.entries(this._items).map(([, item]) => item.data)));\n }", "title": "" }, { "docid": "cb1e2030ded6482d3d9e3cd56aa154e2", "score": "0.5710378", "text": "saveDataToLocal(problem) {\n AsyncStorage.getItem('problemArray').then((value) => {\n let valueOfArray = (value === null ? null : JSON.parse(value));\n if (valueOfArray === null){\n AsyncStorage.setItem('problemArray', JSON.stringify([problem]));\n }else{\n AsyncStorage.setItem('problemArray', JSON.stringify([problem, ...valueOfArray]));\n }\n });\n }", "title": "" }, { "docid": "5dd4da52ae24542aca609ed1c405129c", "score": "0.5694407", "text": "atualizarLocalStorage(context) {\n localStorage.removeItem(\"herois\")\n const heroisPagina = JSON.stringify(context.state.herois)\n localStorage.setItem(\"herois\", heroisPagina)\n }", "title": "" }, { "docid": "a83c750005d7c9d112fa7e847a348152", "score": "0.5688478", "text": "constructor() {\n \tthis.storage = {};\n }", "title": "" }, { "docid": "4815c8a246553b37ef937c3b7eeb73ad", "score": "0.567503", "text": "function _storage() {\n localStorage.setObject(\"data\", data);\n }", "title": "" }, { "docid": "c72065c7962a0a197f9a615c16c9fb7b", "score": "0.5662736", "text": "function sincronizarStorage() {\n localStorage.setItem('carrito', JSON.stringify(articulosCarrito));\n localStorage.setItem('cantidadtotal', JSON.stringify(cantidadTotal));\n localStorage.setItem('totalpagar', JSON.stringify(totalPagar))\n}", "title": "" }, { "docid": "3ea19779354597d25e3cfbbaff00cab5", "score": "0.56444204", "text": "setFromStorage() {\n const storageItems = localStorage[this.storageKey]\n this.items = storageItems ? JSON.parse(storageItems) : []\n }", "title": "" }, { "docid": "a0c08f2103563d504c8a3f87d4f3debb", "score": "0.56246215", "text": "function ActualizarDatosServicio(servicio)\n {\n console.log(\"Actualizando datos del servicio en localstorage:\" + JSON.stringify(servicio));\n //DatosServicio=servicio;\n window.localStorage.setItem(\"Servicio\", JSON.stringify(servicio));\n }", "title": "" }, { "docid": "a65aa795abd3d67c4513e2eedf68609b", "score": "0.5613397", "text": "function saveValues() {\n\tstorage.hiscore2 = hiscore;\n\tstorage.longest2 = longest;\n\tstorage.speed2 = speed;\n}", "title": "" }, { "docid": "b09924757e1fc3ce8052e039ee435231", "score": "0.5577936", "text": "function setJsonStorage (chave, valor){\n localStorage.setItem(chave,valor);\n}", "title": "" }, { "docid": "4b0e72c29721c2bf14fe9f05b9a84868", "score": "0.55699825", "text": "function updateStorage()\r\n{\r\n\tlocalStorage.setItem('todos',JSON.stringify(todo));\r\n\tlocalStorage.setItem('completed',JSON.stringify(completed));\r\n}", "title": "" }, { "docid": "da901b491a2b88af55baa26ed73e6e5d", "score": "0.5537466", "text": "function fillstorage() {\n const obj_1 = 'some_content';\n const obj_2 = {bar: 'baz'};\n\n// save to file\n const id = storage.put(obj_2);\n console.log(id)\n const everything = storage.all();\n console.log(everything)\n}", "title": "" }, { "docid": "63e044b36854017a69ec8886c2904a6d", "score": "0.55317837", "text": "function initLocalStorage() {\n\t//\n\tvalue = that.get(key);\n\tif (value == null) {\n\t\tthat.set(key, JSON.stringify([]));\n\t}\n}", "title": "" }, { "docid": "5fafc69d466cc54d96629a8b34b6ce57", "score": "0.5530334", "text": "function guardarDatosLocalStorage(){\n //toma el valor de un arreglo con datos de LS o vacio\n localStorage.setItem('respuestasH', JSON.stringify(respuestaHelmet)); // todas las motos quedan almacenadas en local storage// todas las motos quedan almacenadas en local storage\n}", "title": "" }, { "docid": "4041bf9dc82053fe612b00857e03a068", "score": "0.5527831", "text": "constructor() {\n this.storage = {};\n }", "title": "" }, { "docid": "4041bf9dc82053fe612b00857e03a068", "score": "0.5527831", "text": "constructor() {\n this.storage = {};\n }", "title": "" }, { "docid": "7605cab286c9eac0f75cba9a103298ab", "score": "0.5519", "text": "function _load_storage(){\n /* if jStorage string is retrieved, then decode it */\n if(_storage_service.jStorage){\n try{\n _storage = JSON.parse(String(_storage_service.jStorage));\n }catch(E6){_storage_service.jStorage = \"{}\";}\n }else{\n _storage_service.jStorage = \"{}\";\n }\n _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;\n\n if(!_storage.__jstorage_meta){\n _storage.__jstorage_meta = {};\n }\n if(!_storage.__jstorage_meta.CRC32){\n _storage.__jstorage_meta.CRC32 = {};\n }\n }", "title": "" }, { "docid": "133fecfc807839271593a19450b719ce", "score": "0.5504665", "text": "actualizarUsuario() {\n let calculo = (this.usuario.peso / (this.usuario.estatura * this.usuario.estatura)) * 10000;\n this.x = calculo.toFixed(2)\n this.usuario.IMC = this.x\n let posicion = this.lista_usuario.findIndex(\n usuario => usuario.id == this.usuario.id\n );\n this.lista_usuario.splice(posicion, 1, this.usuario);\n localStorage.setItem(posicion, this.usuario);\n this.usuario = {\n tipoidentificacion: \"\",\n id: \"\",\n nombres: \"\",\n apellidos: \"\",\n correo: \"\",\n peso: \"\",\n estatura: \"\",\n IMC: \"\",\n acciones: true\n };\n this.saveLocalStorage();\n this.enEdicion = false\n }", "title": "" }, { "docid": "773fea8051324d249d86bb8f1f929c85", "score": "0.54954094", "text": "function handleUpdate(){ \n let tam = parseInt(localStorage.getItem('Size'));\n if(tam > 0){\n for(let i = 0; i <tam; i++){\n console.log('NumeroEcoRef: ' + localStorage.getItem('NumeroEcoRef'+i))\n NumeroEcoRef.current[i].value = localStorage.getItem('NumeroEcoRef'+i)\n //localStorage.removeItem('NumeroEcoRef'+i)\n KmMesRef.current[i].value = localStorage.getItem('KmMesRef'+i)\n //localStorage.removeItem('KmMesRef'+i)\n }\n }\n }", "title": "" }, { "docid": "5f970a7bdd12463d8cf6e23277b4a859", "score": "0.54799205", "text": "function setExtras(extras) {\n\t getCurrentHub().setExtras(extras);\n\t}", "title": "" }, { "docid": "acc3728e6e4c1b6cad6a64d12845a0e6", "score": "0.54447204", "text": "function save(storage, name, value) {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n }", "title": "" }, { "docid": "acc3728e6e4c1b6cad6a64d12845a0e6", "score": "0.54447204", "text": "function save(storage, name, value) {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n }", "title": "" }, { "docid": "acc3728e6e4c1b6cad6a64d12845a0e6", "score": "0.54447204", "text": "function save(storage, name, value) {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n }", "title": "" }, { "docid": "acc3728e6e4c1b6cad6a64d12845a0e6", "score": "0.54447204", "text": "function save(storage, name, value) {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n }", "title": "" }, { "docid": "acc3728e6e4c1b6cad6a64d12845a0e6", "score": "0.54447204", "text": "function save(storage, name, value) {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n }", "title": "" }, { "docid": "673a3d7e2aa213ef143682d51982fd40", "score": "0.54199743", "text": "guardarProductosLocalStorage(producto){\n let productos;\n productos = this.obtenerProductosLocalStorage();\n productos.push(producto);\n localStorage.setItem('productos', JSON.stringify(productos));\n }", "title": "" }, { "docid": "7cbb224002985ac2617f6c306306bbb3", "score": "0.5416043", "text": "function storageSet(key, value) {\n chrome.storage.sync.get([\"zillowHouseHide\"], result => {\n console.log(\"test:\", result.zillowHouseHide);\n chrome.storage.sync.set({\n zillowHouseHide: {\n ...result.zillowHouseHide,\n [key]: value\n }\n });\n });\n}", "title": "" }, { "docid": "af07cdac8805afa7d11e9b7e672de55e", "score": "0.54076505", "text": "guardarProductosLocalStorage(producto){\n let productos;\n //Toma valor ed un arreglo con datos del LS\n productos = this.obtenerProductosLocalStorage();\n //Agregar el producto al carrito\n productos.push(producto);\n //agregamos al LS\n localStorage.setItem('productos', JSON.stringify(productos));\n }", "title": "" }, { "docid": "072ac65cd767ceabf096805c65ce4ab6", "score": "0.5396978", "text": "function getStorageData() {\r\n if(localStorage.Data) {\r\n Product.all = JSON.parse(localStorage.Data);\r\n }\r\n}", "title": "" }, { "docid": "89128c722f722ddec4e4b0cf39b27f09", "score": "0.5394124", "text": "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}", "title": "" }, { "docid": "1ef9b45982c18dd545b1e84a07c15511", "score": "0.5390009", "text": "load() {\n\t\t\tlet storage = Storage.local.get('commander') || null;\n\t\t\tif (storage) {\n\t\t\t\tupdate(bs => {\n\t\t\t\t\tbs = storage;\n\t\t\t\t\treturn bs;\n\t\t\t\t});\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "6afe44a0ee69a096b20681144cda1228", "score": "0.5387786", "text": "constructor() {\n this.storage = {};\n this.storage.size = 0;\n this.storage.first = 0;\n }", "title": "" }, { "docid": "237ed963fd150940aef8230a90de0140", "score": "0.5386804", "text": "constructor() {\n \tthis.storage = {};\n this.count = 0;\n }", "title": "" }, { "docid": "30e16cae584a0f585f8a5207fd7e39a8", "score": "0.5385701", "text": "setInitialValues(data) {\n //publicoAlvo\n if(data.publicoAlvoSim === 1){\n this.publicoAlvoSim = 1\n this.hasSavedValues = true\n } else {\n this.publicoAlvoSim= 0\n }\n if(data.publicoAlvoNao === 1){\n this.publicoAlvoNao= 1\n this.hasSavedValues = true\n } else {\n this.publicoAlvoNao= 0\n }\n if(data.publicoAlvoALVA === 1){\n this.publicoAlvoALVA= 1\n this.hasSavedValues = true\n } else {\n this.publicoAlvoALVA= 0\n } \n //sistemaResponsavel\n if(data.XER === 1){\n this.XER= 1\n this.hasSavedValues = true\n } else {\n this.XER= 0\n }\n if(data.COP === 1){\n this.COP= 1\n this.hasSavedValues = true\n } else {\n this.COP= 0\n }\n //listaPrefixosGecor\n for(let e of data.listaPrefixos){\n this.listaPrefixos.push(e)\n this.hasSavedValues = true\n }\n //situacaoVinculoDaOperacao\n if(data.operacaoNaoVinculada === 1){\n this.operacaoNaoVinculada= 1\n this.hasSavedValues = true\n } else {\n this.operacaoNaoVinculada= 0\n }\n if(data.operacaoVinculada === 1){\n this.operacaoVinculada= 1\n this.hasSavedValues = true\n } else {\n this.operacaoVinculada= 0\n }\n if(data.operacaoVinculadaEmOutroNPJ === 1){\n this.operacaoVinculadaEmOutroNPJ= 1\n this.hasSavedValues = true\n } else {\n this.operacaoVinculadaEmOutroNPJ= 0\n }\n //acordoRegistradoNoPortal\n if(data.acordoRegPortalSim === 1){\n this.acordoRegPortalSim= 1\n this.hasSavedValues = true\n } else {\n this.acordoRegPortalSim= 0\n }\n if(data.acordoRegPortalNao === 1){\n this.acordoRegPortalNao= 1\n this.hasSavedValues = true\n } else {\n this.acordoRegPortalNao= 0\n }\n // if(data.acordoRegPortalDuplicados === 1){\n // this.acordoRegPortalDuplicados= 1\n // this.hasSavedValues = true\n // } else {\n // this.acordoRegPortalDuplicados= 0\n // }\n if(data.duplicadoSimNao===1){\n this.duplicadoSimNao =1 \n this.hasSavedValues = true\n }\n if(data.analisadoSimNao===1){\n this.analisadoSimNao = 1\n this.hasSavedValues = true\n }\n //totalRegistrosComFiltro\n this.totaisEstoque = data.est\n this.totaisFluxo = data.flu\n //quantidade de registros a gerar\n if(data.estoqueNumber > 0){\n this.estoqueNumber = data.estoqueNumber\n this.hasSavedValues = true\n }\n if(data.fluxoNumber > 0){\n this.fluxoNumber = data.fluxoNumber\n this.hasSavedValues = true\n }\n }", "title": "" }, { "docid": "e3a1751cb62994550cf50d557e096f51", "score": "0.5384615", "text": "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}", "title": "" }, { "docid": "5747931be45279387370a86a1826df37", "score": "0.5382071", "text": "saveData() {\n window.localStorage.setItem(\"HVACData\", JSON.stringify(this.hvacData.getHashmap()));\n }", "title": "" }, { "docid": "1ec8c2b06c924ab95e146c5ff630eb69", "score": "0.5376182", "text": "function storage() {\n let string = JSON.stringify(Product.allProduct);\n localStorage.setItem('product', string)\n\n}", "title": "" }, { "docid": "21da9a92716d60ec3197722c87b2acaf", "score": "0.5374922", "text": "function _save(){\n _dropOldEvents(); // remove expired events\n try{\n _storage_service.jStorage = JSON.stringify(_storage);\n // If userData is used as the storage engine, additional\n if(_storage_elm) {\n _storage_elm.setAttribute(\"jStorage\",_storage_service.jStorage);\n _storage_elm.save(\"jStorage\");\n }\n _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;\n }catch(E7){/* probably cache is full, nothing is saved this way*/}\n }", "title": "" }, { "docid": "ff1f18dfaab0841de7aea4eb0a7816d3", "score": "0.53739583", "text": "updateStorageMap(storage) {\n const denormalizationStorage = this.createStorageMap(storage);\n super.setNormalizedData(denormalizationStorage);\n }", "title": "" }, { "docid": "11f24965e4cbe3552281b2a8fa0c3c09", "score": "0.53688604", "text": "function agregarElementosLocalStorage(producto) {\n let productos;\n productos = revisarLocalStorage();\n //Añadir el producto al Array de productos\n productos.push(producto);\n localStorage.setItem('productos', JSON.stringify(productos) )\n\n}", "title": "" }, { "docid": "e17e0594a28facd927301295b124be61", "score": "0.5360711", "text": "guardarStorage() {\n localStorage.setItem('usuario', JSON.stringify(this.usuario));\n }", "title": "" }, { "docid": "15de315c4391d6d0324a455eec25c088", "score": "0.5352493", "text": "save() {\n\t\t\tupdate(bs => {\n\t\t\t\tStorage.local.put('commander', bs);\n\t\t\t\treturn bs;\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "2c280a5894d75cef68b7af1939b0a4c3", "score": "0.5349321", "text": "function guardarStorage() {\r\n localStorage.setItem('carrito', JSON.stringify(ProductosCarrito));\r\n //console.log(localStorage.getItem('carrito'))\r\n}", "title": "" }, { "docid": "f3fe9a73d971d9a1111e6d59537289b5", "score": "0.534319", "text": "function updateStorageAmount(){\t\t\r\n\t\tstorage.getBytesInUse(function(bytesInUse){\r\n\t\t\tvar bytesAvailable = storage.MAX_ITEMS ? MAX_SYNC_DATA_SIZE : MAX_LOCAL_DATA_SIZE;\r\n\t\t\r\n\t\t\t// set current bytes\r\n\t\t\t$(\".currentBytes\").html(roundByteSizeWithPercent(bytesInUse, bytesAvailable));\r\n\r\n\t\t\t// set total bytes available\r\n\t\t\t$(\".bytesAvailable\").html(roundByteSize(bytesAvailable));\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "094119fcfae8f92f3c25da89a58c7686", "score": "0.5337615", "text": "function updateData(uType, uValue){\n /*Grab Value. Update the needed header, set the values again\n */\n let tempOptions = {};\n storage.get('options', function(items) {\n\n //if the object has been created before\n if (items.options) {\n // textarea.value = items.css;\n // alert(\"Loaded saved options: \");\n //store options object\n tempOptions = items.options;\n\n //update value\n tempOptions.userOptions[uType] = uValue;\n\n //set value\n storage.set({'options': tempOptions}, function() {\n // Notify that we saved.\n // alert(\"Settings saved with updates: \"+uType+\" to \"+uValue);\n });\n }\n\n //if the object has not been created before\n else{\n let anObject =\n {\n userOptions: {\n stackOverflow: true,\n GitHub: true\n }\n }\n\n //update the object\n anObject.userOptions[uType] = uValue;\n\n //set value\n storage.set({'options': anObject}, function() {\n // Notify that we saved.\n // alert(\"Settings saved\");\n });\n }\n });\n}", "title": "" }, { "docid": "a53a069207cde1a75c18626e6801abad", "score": "0.5337593", "text": "saveToStorage() {\n try {\n localStorage.setItem(this.name, JSON.stringify(this.storage));\n } catch(e) {\n\n }\n }", "title": "" }, { "docid": "bac079fc3f5d54ac8708f69da6946593", "score": "0.53369814", "text": "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}", "title": "" }, { "docid": "982c6cad3e3c83ac2b429bf627351d1d", "score": "0.5335591", "text": "function updateStorage() {\n\n let stringArr = JSON.stringify(products);\n console.log(products);\n\n localStorage.setItem('items', stringArr);\n\n\n}", "title": "" }, { "docid": "4931327d8e5eb10f15480d667ba3e0dd", "score": "0.53276086", "text": "function saveData() {\n if (localStorage != null && JSON != null) {\n localStorage[\"size\"] = JSON.stringify(size);\n localStorage[\"cartData\"] = JSON.stringify(cartData);\n }\n }", "title": "" }, { "docid": "30a6d15d28ca9a670583e995d39cb33e", "score": "0.53196156", "text": "function updateProductInfo() {\n chrome.storage.sync.get(['product-analysis'], function (data) {\n productAnalysis = data;\n console.log(data);\n console.log(chrome.storage);\n });\n}", "title": "" }, { "docid": "2843c077b7dadab4c582fb8b7edb9852", "score": "0.53138274", "text": "function save() {\n localStorage.productData = JSON.stringify(Product.allProducts);\n localStorage.totalCounter = totalCounter;\n}", "title": "" }, { "docid": "be531e9ff9dec83665f89c6c12913a5c", "score": "0.5312937", "text": "add(consommable, qte, note, montant, resto, callback) {\n AsyncStorage.getItem(KEY_NAME).then((value) => {\n var stored = JSON.parse(value);\n if(stored == null || stored == undefined || stored.length <=0) {\n var newItem = {\n resto: resto,\n commande: [\n {\n consommable: consommable,\n quantite: qte,\n note: note,\n prix: montant\n }\n ]\n };\n stored = [newItem];\n }\n else {\n var found = false;\n for(var i=0; i<stored.length; i++) {\n // We already made an order from this resto, so add this new order to the old ones\n if(stored[i].resto.email == resto.email) {\n found = true;\n stored[i].commande.push({\n consommable: consommable,\n quantite: qte,\n note: note,\n prix: montant\n });\n }\n }\n if(!found) {\n stored.push({\n resto: resto,\n commande: [\n {\n consommable: consommable,\n quantite: qte,\n note: note,\n prix: montant\n }\n ]\n });\n }\n }\n AsyncStorage.setItem(KEY_NAME, JSON.stringify(stored));\n callback(false);\n });\n }", "title": "" }, { "docid": "3024bfe9c6536c4cc27c865c0189cda9", "score": "0.53102183", "text": "materializar() {\n\t\t// Se pueden agregar comprobaciones para evitar que haya campos en blanco cuando se guarda.\n\t\tthis.guardarObjetoEnArchivo();\n\t}", "title": "" }, { "docid": "68e9ae6ae919983ce634aefbc13be55b", "score": "0.53039974", "text": "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch(err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "title": "" }, { "docid": "6e0852c3cd2b381d24714e9184e3af3b", "score": "0.5294944", "text": "async putObject() {\n const { ContentLength } = this.object;\n this.resultData = await this.cosSdkInstance.putObjectRetry({\n ...this.object,\n GetBody: () => readStreamAddPassThrough(this.getReadStream(0, ContentLength)),\n });\n this.manageGlobalCacheData('remove');\n }", "title": "" }, { "docid": "88ac55e0e79f7d29584e636a01fc1835", "score": "0.529381", "text": "async loadItems() {\n const keys = await AsyncStorage.getAllKeys();\n const values = await AsyncStorage.multiGet(keys);\n\n this.data = this.data.set('source', fromJS(values));\n }", "title": "" }, { "docid": "193c733d52fa3d54446c9a6ce3174c29", "score": "0.52876246", "text": "function almacenarlocal(clave, valor)\n{\n local.setItem(clave, valor);\n console.log(\"guardo\");\n\n //borrar\n //localStorage.removeItem('nombre');\n //limpiar\n //localStorage.clear();\n\n}", "title": "" }, { "docid": "17ac0e01b65a6db2076ac82fb1cfa3a9", "score": "0.52842885", "text": "async function storageUser(data){\n await AsyncStorage.setItem('Auth_user', JSON.stringify(data));\n }", "title": "" }, { "docid": "2f7c622ed4e70c84af6bed13b7d6ee64", "score": "0.5282663", "text": "function guardarDatosLocalStorage(){\n //toma el valor de un arreglo con datos de LS o vacio\n localStorage.setItem('respuestasM', JSON.stringify(respuestaMotorcycle)); // todas las motos quedan almacenadas en local storage// todas las motos quedan almacenadas en local storage\n}", "title": "" }, { "docid": "414d8636543a21e00d41d0b9cfba4fe0", "score": "0.5279173", "text": "async _saveData()\n {\n try{\n await AsyncStorage.setItem(\"@JapQuiz:list\",\n JSON.stringify({score: this._currentPoint,\n wrong_list: this._wrong_list,}));\n }\n catch(error)\n {\n console.log(error.toString());\n }\n }", "title": "" }, { "docid": "5936e39e745752c0e51198b2a082c62d", "score": "0.52779394", "text": "function setExtras(extras) {\n callOnHub('setExtras', extras);\n}", "title": "" }, { "docid": "5936e39e745752c0e51198b2a082c62d", "score": "0.52779394", "text": "function setExtras(extras) {\n callOnHub('setExtras', extras);\n}", "title": "" }, { "docid": "5936e39e745752c0e51198b2a082c62d", "score": "0.52779394", "text": "function setExtras(extras) {\n callOnHub('setExtras', extras);\n}", "title": "" }, { "docid": "378a1ac33ed1d4108f8e6cf9a60cea92", "score": "0.5277869", "text": "function initStorage() {\n $localStorage.authors = $localStorage.authors || [];\n $localStorage.books = $localStorage.books || [];\n $localStorage.authorId = $localStorage.authorId || $localStorage.authors.length + 1;\n $localStorage.booksId = $localStorage.booksId || $localStorage.books.length + 1;\n }", "title": "" }, { "docid": "a2c8aef8432e441442609e3cd01bd17c", "score": "0.5276219", "text": "function setExtras(extras) {\n hub.getCurrentHub().setExtras(extras);\n}", "title": "" }, { "docid": "e7e12bdc7692822e66583183e57424bf", "score": "0.52754295", "text": "saveOptions(form) {\n let newSettings = {};\n\n for (let [key, value] of new FormData(form)) {\n if (newSettings.hasOwnProperty(key)) { // SerializedArray\n newSettings[key] += ',' + value; // add new\n newSettings[key] = newSettings[key].split(','); // to array [old, new]\n\n } else {\n newSettings[key] = value;\n };\n }\n\n Storage.setParams(newSettings, this.storageMethod);\n\n // notify background page\n chrome.extension.sendMessage({ // manifest v2\n // chrome.runtime.sendMessage({ // manifest v3\n \"action\": 'setOptions',\n \"settings\": newSettings\n });\n }", "title": "" }, { "docid": "6ad6f2fb06d0a4581ee964778ade2632", "score": "0.5270181", "text": "function sincronizarLocalSotorage() {\n localStorage.setItem(\"carrito\", JSON.stringify(coleccionProductos));\n}", "title": "" }, { "docid": "aec68d7a08699452f5c0768be6df5a11", "score": "0.5269694", "text": "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch(err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "title": "" }, { "docid": "aec68d7a08699452f5c0768be6df5a11", "score": "0.5269694", "text": "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch(err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "title": "" }, { "docid": "7e2f04dd4322baf06a06d5559f4b1bf9", "score": "0.526554", "text": "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "title": "" }, { "docid": "7e2f04dd4322baf06a06d5559f4b1bf9", "score": "0.526554", "text": "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "title": "" }, { "docid": "7e2f04dd4322baf06a06d5559f4b1bf9", "score": "0.526554", "text": "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "title": "" }, { "docid": "7e2f04dd4322baf06a06d5559f4b1bf9", "score": "0.526554", "text": "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "title": "" }, { "docid": "7e2f04dd4322baf06a06d5559f4b1bf9", "score": "0.526554", "text": "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "title": "" }, { "docid": "7e2f04dd4322baf06a06d5559f4b1bf9", "score": "0.526554", "text": "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "title": "" }, { "docid": "7e2f04dd4322baf06a06d5559f4b1bf9", "score": "0.526554", "text": "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch (err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "title": "" }, { "docid": "576536fd86cc56c70a785079388b5428", "score": "0.5262188", "text": "writeToStorage() {\n return (localStorage[this.storageKey] = JSON.stringify(this.items))\n }", "title": "" }, { "docid": "c157fdb11120671c1b16592a9eb004a5", "score": "0.5257101", "text": "function setStorage() {\n\tconsole.log('Setting Storage...');\n\tvar chapterPromise = getLatestPost();\n\n\tchapterPromise.then(function(data) {\n\t\tvar chapterNum = getNumFromString(data.title);\n\n\t\tchrome.storage.sync.set({\n\t\t\t'tomoLatestChapter': chapterNum\n\t\t}, function() {\n\t\t\tconsole.log('Latest chapter set to:', chapterNum);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "16a264eba87401c2dcbadbd3d4427b8f", "score": "0.52505773", "text": "async storeFavoritos(){\n try{\n // Primero traemos del storage las que ya estaban iomportadas y hacemos un nuevo array junto con las seleccionadas\n const favoritosImportados = await getDataAsync('Favoritos')\n const favoritos = [...favoritosImportados, ...this.state.seleccionados]\n // Guardamos en el storage con la key favoritos\n storeDataAsync(favoritos, 'Favoritos')\n // Alert para saber cuantas personas se importaron\n const seleccionadosLength = \"Se importaron las \" + this.state.seleccionados.length + \" tarjetas seleccionadas\" \n if(this.state.seleccionados.length != 0){\n this.sacarImportados(this.state.seleccionados, this.state.personas)\n Alert.alert(seleccionadosLength)\n }else{\n Alert.alert('No se selecciono ninguna tarjeta')\n }\n // Vaciamos seleccionados una vez importadas las tarjetas\n this.setState({seleccionados: []})\n }catch(e){\n console.log(e)\n }\n }", "title": "" }, { "docid": "90bb1283bafc81efd04ead5540ff9f75", "score": "0.5247193", "text": "persistData() {\n // Convert the likes array in string before save\n localStorage.setItem('likes', JSON.stringify(this.likes));\n }", "title": "" }, { "docid": "3e15be6ec5e96c675f5e94f690a3c2b9", "score": "0.52382535", "text": "async setUserData(key, platform) {\n await AsyncStorage.setItem('USER_KEY', key[0].toString());\n await AsyncStorage.setItem('Platform_KEY', platform);\n await AsyncStorage.setItem('Token_KEY', key[2]);\n }", "title": "" }, { "docid": "6b98e5bb01c2d6c01fe27bac993f9362", "score": "0.52381456", "text": "async function GetFavTaxi() {\n var datanew = await AsyncStorage.getItem(\"storage\")\n var parseFavTaxi = JSON.parse(datanew);\n // console.log(parseFavTaxi.FavTaxi[0].favtaxiphone);\n setFavTaxi(parseFavTaxi.FavTaxi);\n }", "title": "" }, { "docid": "5c65d07e285cc0fb54a71108f86bbf5b", "score": "0.5235846", "text": "async writeToStorage() {\r\n const fetchedInfo = {\r\n fetchedUsername: this.state.fetchedUsername,\r\n fetchedPassword: this.state.fetchedPassword,\r\n };\r\n\r\n //Save the user info\r\n localStorage.setItem(\"fetchedInfo\", JSON.stringify(fetchedInfo));\r\n }", "title": "" }, { "docid": "c57d7004129821be9e50dafbe6709a79", "score": "0.52346885", "text": "function saveLocal() {\r\n let aJson = JSON.stringify(Productos)\r\n localStorage.setItem(\"productos\", aJson)\r\n}", "title": "" }, { "docid": "f5af1bd11d9d403cbb3f221652c69976", "score": "0.5232202", "text": "constructor() {\n this._storage = {};\n this._length = 0;\n }", "title": "" }, { "docid": "193aaae0e5d1a00c5514a1892f5d6aad", "score": "0.52248496", "text": "async function HandleUpload() {\n /*let newBook={id:bookId, title, genre, sinopsis, coverImageData:imageData, price, author, comments};\n let books=await AsyncStorage.getItem('books');\n books=JSON.parse(books);\n const index=books.findIndex(book=>book.id===bookId);\n books[index]=newBook;\n books=JSON.stringify(books);\n await AsyncStorage.setItem('books', books);*/\n var book=new Book(title, sinopsis, author, genre, price, imageData, comments, bookId);\n var result=await book.Update();\n if(result) {\n ClearFields();\n navigation.navigate('Store');\n }\n else {\n Alert.alert(\"Error:\", \"Couldn't Save the edits to the book...\");\n }\n }", "title": "" }, { "docid": "2453a7e3ddc926d6c84901d8223461df", "score": "0.52186906", "text": "function setExtraInfo(){}", "title": "" }, { "docid": "258a9e8c7016252e33f690fe602a2369", "score": "0.52170664", "text": "saveExtra() { \n }", "title": "" }, { "docid": "2059bb7cd415406c7c96dd46df328ba8", "score": "0.5215406", "text": "function setDescFromStorage() {\n for (var i = 0; i < descriptionArr.length; i++) {\n //getItem is i+9 here as the localstorage id is related to\n //the time in the timeSlot, not its position in the descriptionArr array\n descriptionArr[i].value = localStorage.getItem(i+9);\n }\n}", "title": "" }, { "docid": "f9eb5ffb0191849edad105a68821dcff", "score": "0.5214601", "text": "function guardarProductosLocalStorage() {\n localStorage.setItem(\"Carrito\", JSON.stringify(carrito));\n}", "title": "" }, { "docid": "f485268eac2c80c499ad7261eca2efd8", "score": "0.52130663", "text": "persistData()\n {\n // Convert the likes array to JSON so we\n // can persist it w/ localStorage (setItem() method takes only\n // string arguments!)\n localStorage.setItem('likes', JSON.stringify(this.likes));\n }", "title": "" }, { "docid": "ff247ede6d9965fbc70d491cc963a17a", "score": "0.5203058", "text": "get extras() {\n return this._extras;\n }", "title": "" }, { "docid": "bbc04541b2fc24fee0794b2ad0889fb2", "score": "0.5201395", "text": "static setItem(value) {\n let item = JSON.stringify(value);\n localStorage.setItem(CartManager.key, item);\n }", "title": "" }, { "docid": "faf1ec3358072ed8d6c50a5342989ca7", "score": "0.5201246", "text": "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}", "title": "" } ]
7d0c29eac12e6afcf0183898bc5d6631
interaccion con html triangulo
[ { "docid": "143cb93b0dafa1f8082c32edf1429245", "score": "0.0", "text": "function calcularPerimetroTriangulo(){\n const lado1 = document.getElementById(\"lado1Triangulo\")\n const value1 = lado1.value;\n const lado2 = document.getElementById(\"lado2Triangulo\")\n const value2 = lado2.value;\n const base = document.getElementById(\"baseTriangulo\")\n const basee = base.value;\n const perimetro = perimetroTriangulo(value1,value2,basee)\n alert(perimetro);\n \n}", "title": "" } ]
[ { "docid": "cd9015d0bead41ade0761bf0212aa117", "score": "0.61952555", "text": "function salto_linea_html(valor) {\n\tif (valor!=''&&valor!=null) return str_replace(array('@@','||'),array('<','>'),valor);\n\telse return '';\n}", "title": "" }, { "docid": "0864fb65a378a9df6456b14be5344751", "score": "0.6042275", "text": "function affichagechaine(lettre)\n\t{\n\tvar lettreHTML = \"<span>\" + lettre + \"</span>\";\n\tdocument.querySelector('#caracteres').innerHTML += lettreHTML;\n\t}", "title": "" }, { "docid": "88651bb9dbba0a32e16111b4152430df", "score": "0.58702606", "text": "function GeneradorTriplo(cont, caract1, operacion, caract2) {\r\n \r\n if (operacion == \"*\") {\r\n return `t${cont} = ${caract2} ${\"*\"} ${caract1}` + saltoDeLinea;\r\n }\r\n if (operacion == \"/\") {\r\n return `t${cont} = ${caract2} ${\"/\"} ${caract1}` + saltoDeLinea;\r\n }\r\n if (operacion == \"+\") {\r\n return `t${cont} = ${caract2} ${\"+\"} ${caract1}` + saltoDeLinea\r\n }\r\n if (operacion == \"-\") {\r\n return `t${cont} = ${caract2} ${\"-\"} ${caract1}` + saltoDeLinea\r\n }\r\n \r\n return \"\";\r\n }", "title": "" }, { "docid": "34cfc355e6500de1ecd637eecb0e590f", "score": "0.586252", "text": "function Depuro(text){\n\tvar caracteres=new Array('<span','</span>','<img','<br/>','<br>','<br />','<SPAN','</SPAN>','<IMG','<BR/>','<BR>','<BR />','<input','<INPUT');\t\n\tvar numc= new Array('5','7','4','5','4','6','6','6','6','6','6','6','6','6');\n\tfor(var i=0; i< caracteres.length; i++){\n\t//alert('['+caracteres[i]+']'+text.indexOf(caracteres[i]));\n\t\twhile(text.indexOf(caracteres[i])!=-1){\n\t\t\tif(text.indexOf(caracteres[i])==0){\n\t\t\t\tif(i==1 || i==3){text= text.substring(text.indexOf(caracteres[i])+numc[i],text.length);}\n\t\t\t\telse{text=text.substr(text.indexOf('>')+1,text.length);}\n\t\t\t}else{\n\t\t\t\tif(i==1 || i==3){\n\t\t\t\t\tvar num=parseInt(text.indexOf(caracteres[i]))+ parseInt(numc[i]);\n\t\t\t\t\ttext=text.substr(0,text.indexOf(caracteres[i]))+' '+text.substring(num,text.length);\n\t\t\t\t}else{\n\t\t\t\t\tvar num=parseInt(text.indexOf(caracteres[i]));\n\t\t\t\t\tvar ocu=text.substr(num,text.length);\n\t\t\t\t\tvar num2=parseInt(ocu.indexOf('>')+1)+ parseInt(num);\n\t\t\t\t\ttext=text.substr(0,num)+' '+text.substr(num2,text.length);\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\ttext=nospaces(text);/*funcion que elimina los espacios en blanco, retornos de carro y linea, esta en onload.js*/\n\treturn text;\n}", "title": "" }, { "docid": "4b6def27123b4c59aee8e832dad7812c", "score": "0.5749412", "text": "function dibujarLetras(){\n\tlet letrasHtml=\"\";\n\n\tletrasHtml+='<div class=\"numero\"></div>';\n\tfor(let j=0;j<8;j++){\n\n\t\tletrasHtml+='<div class=\"letra ancho\">'+letrasArray[j]+'</div>'\n\n\t}\n\tletrasHtml+='<div class=\"numero\"></div>';\n\treturn letrasHtml;\n}", "title": "" }, { "docid": "eac5bc79d3f7aa4fd9aaabc0a0b14338", "score": "0.56442326", "text": "function modifTexte(phrase, lchiffre) {\n var str = phrase;\n var HTML = \"\";\n // On augmente la taille de la lettre\n mem[lchiffre]=mem[lchiffre].big();\n\n for(i =0; i<phrase.length;i++){\n memi =0;\n for(j=0;j<lettre.length;j++){\n if (phrase[i]==lettre[j]){\n HTML +=mem[j];\n memi=1;\n }\n }\n if(memi==0){\n HTML +=phrase[i]\n }\n }\n // Ecriture de la phrase sur la page\n document.getElementById(\"animtext\").innerHTML = HTML;\n }", "title": "" }, { "docid": "f8155fbb4729e751031276e622e41966", "score": "0.561283", "text": "function colocarLetras(){\n letrasRosco = document.getElementById(\"letrasRosco\")\n letrasRoscoArray = letrasRosco.textContent.split('');\n letrasRosco.textContent = '';\n for(var i = 0; i< letrasRoscoArray.length; i++){\n letrasRosco.innerHTML += `<div id=\"${letrasRoscoArray[i]}\"; style=\"transform:rotate(+${(i*13.3)}deg)\"><h2 style=\"transform:rotate(-${(i*13.3)}deg);\"> ${letrasRoscoArray[i]}</h2></div>`\n }\n return;\n}", "title": "" }, { "docid": "1b8506a886beb2fd18b17a5b24dfb6ca", "score": "0.55572456", "text": "function unionTexto() {\n\t// En el div #containerTextoObra poner un <p> que contiene todos los textos de las \n\t// casillas seprados por algún caracter (., espacio, barritas...)\n\n}", "title": "" }, { "docid": "6e9bbc2c6aafcfb6ae96e1a6b181d97c", "score": "0.5557223", "text": "function limpiarHtml() {\n while(contenedorCarrito.firstChild){\n contenedorCarrito.removeChild(contenedorCarrito.firstChild)\n }\n }", "title": "" }, { "docid": "5fa3e00261e2709f0b708705aea78944", "score": "0.5549918", "text": "function txt_to(nombre,texto) {\n texto=texto+\"\";\n var spr = String.fromCharCode(160);\n eval (\"var expReg=/\" + spr + \"/gi;\");\n if (texto.replace(expReg,'').replace(/\\s/gi,'')=='')\n texto=\"\"; //Si había varios blancos, los convierto a \"\" \n \n var obj=eval(nombre); obj.txt=texto;\n var id=obj.ID\n //var id=eval(nombre+'.ID');\n var idtxt=\"\";\n if (id!=null && id != '' && id != ' ') {\n if ( ! (window.LABC_SVQE && texto==\"\")) { //opcion en globales.xml: <MODIFICAR COMPONENTE=\"LABELC\" OPCION=\"SiVacioQuitarEstilo\"/>\n idtxt=\" ID=\\\"\"+id+\"\\\" CLASS=\\\"\"+id+\"\\\" \";\n }\n }\n\n\tvar texto2;\n\ttexto=escapeISO(texto);\n\tif (window.labelRC=='S') {texto=texto.replace(/\\n/g,\"<br>\");}\n\n var enlace=\"\";\n\t//if (eval(nombre+\".link != null\")) {\n\tif (obj.link != null) {\n enlace=\"HREF=\\\"\"+ obj.link +\"\\\"\";\n } else {\n //enlace=\"HREF='javascript:void(null)'\";\n }\n\n var tooltip=\"\";\n\n if (obj.tooltip != null) {\n\n if (window.tipoTooltip.toUpperCase() == 'NATIVO' && ie) {\n tooltip=\"title=\\\"\"+DrdEscHTML(obj.tooltip)+\"\\\"\";\n }\n else{\n tooltip=\"onmouseover='tooltip(event, \\\"\" + obj.tooltip + \"\\\")' onmouseout='tooltip()'\";\n }\n } \n\n if (obj.link != null || obj.tooltip != null)\n texto=\"<A \"+idtxt+ \" \" + enlace + \" \" + tooltip + \" id='T1C'>\"+texto+\"</A>\";\n\n //texto=\"<A ID=\"+id+ \" \" + enlace + \" \" + tooltip + \" id='T1C'>\"+texto+\"</A>\";\n \n /*\n\tif (id!='') {\n\t\tif (eval(nombre+\".TC=='Label'\")) {\n texto2='<SPAN '+idtxt+'>'+texto+'</SPAN>';\n }\n else if (eval(nombre+\".TC=='LabelR'\")) {\n var elnowrap=\"\"\n if (eval(nombre+'.W')==0) \n elnowrap=\" nowrap \"\n texto2='<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><TR><TD '+idtxt+' '+ (eval(nombre+'.W')>0?'WIDTH='+eval(nombre+'.W'):'') +' '+ (eval(nombre+'.H')>0?'HEIGHT='+eval(nombre+'.H'):'') +' '+elnowrap+'>'+texto+'</TD></TR></TABLE>';\n }\n else {\n texto2=texto;\n }\n\t }\n\telse {\n texto2=texto;\n }\n */\n\n if (obj.TC=='Label') {\n texto2='<SPAN '+idtxt+'>'+texto+'</SPAN>';\n }\n else if (obj.TC=='LabelR') {\n var elnowrap=\"\"\n if (obj.W==0) \n elnowrap=\" nowrap \"\n texto2='<TABLE BORDER=\\\"0\\\" CELLSPACING=\\\"0\\\" CELLPADDING=\\\"0\\\"><TR><TD '+idtxt+' '+ (obj.W>0?'WIDTH='+obj.W:'') +' '+ (obj.H>0?'HEIGHT='+obj.H:'') +' '+elnowrap+'>'+texto+'</TD></TR></TABLE>';\n }\n else {\n texto2=texto;\n }\n\n/*\n if (ns) {\n\t\tvar nsdoc=eval(nombre+'.NS');\n\t\teval(nsdoc+'.open()');\n\t\teval(nsdoc+'.write(texto2)');\n eval(nsdoc+'.close()');\n\t}\n else if (ie) {\n */\n\t\t\t\tvar milabel=document.all.item(nombre);\n\t\tif (milabel!=null) {\n\t\t\tif (milabel.length!=null) {\n\t\t\t\tfor (var i=0; i<milabel.length; i++) {\n\t\t\t\t\tif (milabel(i).tagName=='DIV') {milabel(i).innerHTML=texto2;break;}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {document.all[nombre].innerHTML=texto2;}\n\t\t} \n/* \t} */\n\t\n\n\tvar enviar_label=obj.enviar;\n\tif (enviar_label) {set(enviar_label,texto);}\n}", "title": "" }, { "docid": "072e08d1523678fff630c8a074784af0", "score": "0.552094", "text": "function latino() {document.getElementById(\"estratto\").innerHTML = \n`(10) Archimedis vero cum multa miranda inventa et varia fuerint, \nex omnibus etiam infinita sollertia id, quod exponam, videtur esse expressum. \nNimium Hiero enim Syracusis auctus regia potestate, rebus bene gestis cum auream \ncoronam votivam diis inmortalibus in quodam fano constituisset ponendam, \nmanupretio locavit faciendam et aurum ad sacomam adpendit redemptori. \nIs ad tempus opus manu factum subtiliter regi adprobavit et ad sacomam \npondus coronae visus est praestitisse. [10] Posteaquam indicium est factum \ndempto auro tantundem argenti in id coronarium opus admixtum esse, \nindignatus Hiero se contemptum esse neque inveniens, qua ratione id \nfurtum reprehenderet, rogavit Archimeden, uti in se sumeret sibi de \neo cogitationem. Tunc is, cum haberet eius rei curam, casu venit in \nbalineum, ibique cum in solium descenderet, animadvertit, \nquantum corporis sui in eo insideret, tantum aquae extra solium effluere. \nItaque cum eius rei rationem explicationis ostendisset, non est moratus, \nsed exiluit gaudio motus de solio et nudus vadens domum verius significabat \nclara voce invenisse, quod quaereret; nam currens identidem graece clamabat:\n\n(11) Tum vero ex eo inventionis ingressu duas fecisse dicitur massas aequo pondere, \nquo etiam fuerat corona, unam ex auro et alteram ex argento. Cum ita fecisset, \nvas amplum ad summa labra implevit aquae, in quo dimisit argenteam massam. \nCuius quanta magnitudo in vasum depressa est, tantum aquae effluxit. \nIta exempta massa quanto minus factum fuerat, refudit sextario mensus, \nut eodem modo, quo prius fuerat, ad labra aequaretur. Ita ex eo invenit, \nquantum ad certum pondus argenti ad certam aquae mensuram responderet.\n\n(12) Cum id expertus esset, tum auream massam similiter pleno vaso demisit et ea exempta, \neadem ratione mensura addita invenit ex aquae numero non tantum esse: minore quanto minus \nmagno corpore eodem pondere auri massa esset quam argenti. Postea vero repleto vaso in \neadem aqua ipsa corona demissa invenit plus aquae defluxisse in coronam quam in auream \neodem pondere massam, et ita ex eo, quod fuerit plus aquae in corona quam in massa, \nratiocinatus reprehendit argenti in auro mittionem et manifestum furtum redemptoris.\n`}", "title": "" }, { "docid": "7139ec3c0ed5ebdc64d107686afbfbcf", "score": "0.5509964", "text": "function naytaTaulukko(tiedot){\t\t\t//tiedot parametri on Javascript -objekti, jossa taulukoituna objekteja\n\t\tvar tuloste=\"\";\t\t\t\t\t//tekstimuuttuja html -taulukon muodostamiseen: elementit ja sisältö\n\t\tvar otsikot=[];\t\t\t\t\t//html-taulukon otsikot\n\t\tvar varillinen=true;\t\t\t//html-taulukon riviin liitettävä tyylimääre\n\t\t\n\t\ttuloste = \"<table>\";\n\t\ttuloste += \"<tr>\";\n\t\t\n\t\t//html -taulukkoon otsikot eli taulukkoon tallennettujen objektien arvoparien nimet\t\t\n\t\tfor (x in tiedot[0]){ \n\t\t\ttuloste +=\"<th>\"+x+\"</th>\";\n\t\t\totsikot.push(x);\n\t\t}\n\t\ttuloste += \"</tr>\";\n\t\t\n\t\t//html -taulukon tietorivit eli taulukkoon tallennettujen objektien arvoparien arvot\n\t\t//käsitteellaan yksi rivi kerrallaan\n\t\tfor (var i=0;i<tiedot.length;i++){\n\t\t\t//jokatoinen rivi värilliseksi css -luokkamääritteen kautta\n\t\t\tif (varillinen){ \n\t\t\t\ttuloste +='<tr class=\"vari\">';\t\n\t\t\t\tvarillinen=false;\n\t\t\t}\n\t\t\telse{\t\n\t\t\t\ttuloste +=\"<tr>\";\n\t\t\t\tvarillinen=true;\n\t\t\t\t}\n\t\t\t//rivin sisältämän objektin arvot html-taulukon soluihin\n\t\t\tfor (var j=0;j<otsikot.length;j++){\n\t\t\t\ttuloste +='<td>'+tiedot[i][otsikot[j]]+'</td>';\n\t\t\t}\n\t\t\ttuloste +=\"</tr>\";\t\t\t\n\t\t}\n\t\ttuloste += \"</table>\";\n\t\t$tulostus.append(tuloste);\t//valmiin html -taulukon tulostus\t\n}", "title": "" }, { "docid": "d35da02ea47f90fbc427c7ba79ac17ce", "score": "0.5504799", "text": "function limpiandoHTML() {\n while ($listaTuits.firstChild) {\n $listaTuits.removeChild($listaTuits.firstChild);\n }\n}", "title": "" }, { "docid": "d93287b5c5a39a65e45a9cc8c45c0277", "score": "0.54895735", "text": "function ToonVertikaal() {\r\n //Declareer variabelen\r\n let woord, woordVertikaal = \"\";\r\n let aantalLetters;\r\n woord = txtWoord.value;\r\n aantalLetters = woord.length;\r\n for (let index = 0; index < aantalLetters; index++) {\r\n let teken = woord.charAt(index);\r\n woordVertikaal += teken + '<br />';\r\n console.log(index + ': Teken: ' + teken);\r\n }\r\n divResultaat.innerHTML = woordVertikaal;\r\n //Haal info uit de GUI\r\n //Voer de nodige bewerkingen uit\r\n //Geef feedback\r\n}", "title": "" }, { "docid": "bfb4b4785588711246dd22be716537b4", "score": "0.54793346", "text": "function variacie_to_text(v){\n\tif (v.typ == \"op\"){\n\t\treturn v.nazov+\"<br>\"+v.cislo1+\" ^ \"+v.cislo2;\n\t}\n\tvar text = v.nazov+\"<br>\"\n\tfor (var i=0; i<v.cislo2; i++){\n\t\ttext += ((parseInt(v.cislo1)-i).toString()+\" * \");\n\t}\n\treturn text.substring(0,text.length-2);\n}", "title": "" }, { "docid": "9f653773dae8d711b01039dd27c47146", "score": "0.5473833", "text": "function zmienTytul()\t\t// nazwa naszej funkcji\r\n{\r\n\tvar tytul = document.getElementById(\"tytul\"); \r\n\t// \"getElementById\" odwolanie do elementu o okreslonym id \r\n\t// i przypisanie do zmiennej\r\n\ttytul.innerHTML += \" Podstawy\"; \r\n\t//metoda \".innerHTML\" umozliwia modyfikacje tresci\r\n\t// tytul.innerHTML += \" Podstawy\"; -> dopisuje do tekstu z HTML\r\n\t// tytul.innerHTML = \" Podstawy\"; -> zamienia tekst z HTML\r\n}", "title": "" }, { "docid": "10c592831777f5a6478ac7c9707fbdf3", "score": "0.5461678", "text": "function novaRede(cont) {\n return `<hr> \n <div style=\"padding-top: 0px; class=\"RedesSociais\"> \n <label style=\"padding-top: 10px;\" for=\"nomeRedeSocial${cont.toString()}\">Nome Rede social ${cont.toString()} </label> \n <input id=\"nomeRedeSocial${cont.toString()}\" class=\"form-control\"> \n <label style=\"padding-top: 10px;\" for=\"linkRedeSocial${cont.toString()}\">Link Rede social ${cont.toString()} </label> \n <input id=\"linkRedeSocial${cont.toString()}\" class=\"form-control\"> \n <div id=\"invFB-RedeSocial${cont.toString()}\" style=\"display: none\" class=\"invalid-feedback\"> \n Para adicionar uma rede Social, os campos 'Nome' e 'Link' devem estar preenchidos \n </div>\n </div>`;\n}", "title": "" }, { "docid": "e5b41d6e3011a0c81845693939e752b5", "score": "0.545159", "text": "function xianshi1(){\n\t xianshi.innerHTML=\"<font color='#06C'style='font-family:Georgia, \\\"Times New Roman\\\"'>01.\tSólo cubrimos franco de avería particular y seguros contra guerras.<br/>02.Esta partida de mercancías no es artículo frágil. No puede sufrir daños durante el transporte. Basta con franco de avería particular.<br/>03.\tSi contratamos el franco de avería particular, una vez que se hunda, queme o encalle el barco, ¿ustedes nos pagarán todas las perdidas?<br/>04.\t¿Me puede mandar las instrucciones para actuar en caso de avería, así como la forma de efectuar las indemnizaciones?<br/>05. Quiero cambiar esta palabra por después de la entrega.<br/>06.\tNo tenemos sugerencia sobre las cláusulas del contrato, pero las condiciones de pago nos parecen exigentes.<br/>07.\tLa parte compradora debe pagar el 30% del total como entrada en el lapso de diez días después de firmar el contrato.<br/>08. Al recibir el aviso del banco, la parte compradora transmitirá el pago en seguida.<br/>09.\tAcerca de la reclamación solicitada por la parte compradora, le va a dar la respuesta lo más pronto posible la parte vendedora. <br/>10.\tCreemos que es muy necesario añadir la cláusula de fuerza mayor.<br/>11.\tDeseamos que no se opongan a que añadamos esta cláusul en el acuerdo.<br/>12.\tSegún el contrato, la reclamación se hace de acuerdo con el informe de inspección expedido por el Buró de Inspección de Mercancías de China.<br/>13.\tSi surgen disputas entre la parte compradora y la parte vendedora, éstas deberán ser resueltas mediante amistosas consultas.<br/>14. Si no, las disputas deberán ser resueltas mediante el arbitraje o la sentencia judicial.<br/>15. El presente contrato está en dos ejemplares originales, y cada uno está escrito en los idiomas chino y español, siendo ambos textos de igual validez.<br/>16.\tSin apobación de ambas partes, no se puede introducir ninguna modificación en el contrato.<br/>17. Si no se entregan la mercancías de acuerdo con la fecha fijada, el contrato se anulará.<br/>18.\tEste contrato será válido durante un año, y entra en vigor desde el día de firmar.<br/>19.\tSi cualquier parte piensa que no es necesario renovar este contrato, la parte de sugerencia debe concertar negociar activamente con la otra parte en el mes anterior al día de vecimiento del contrato.<br/>20.\tSi una parte contraviene cualquier cláusula de este convenio, otra parte tiene derecho a notificar a la parte contraria la terminación de este convenio por escrito.<br></font>\";}", "title": "" }, { "docid": "4d035908130fd9c4bd7c9f700666ab17", "score": "0.5448009", "text": "function mostrarUnaTarea(pTarea) {\n switch (pTarea.prioridad) {\n case 'diaria':\n clase = 'diaria'\n break;\n case 'mensual':\n clase = 'mensual'\n break;\n case 'urgente':\n clase = 'urgente'\n break;\n }\n tareas.innerHTML += `<div class=\"tarea ${clase}\" >\n <div class=\"texto\"> ${pTarea.texto}</div>\n <div class=\"eliminar\" data-id=${pTarea.idtarea} >Eliminar</div>\n </div>`;\n}", "title": "" }, { "docid": "23f67b5e49a1a2e51e15c9043a7a1d7d", "score": "0.5440389", "text": "function paragraf(boja) {\n return `<p style='color:${boja}'>Tekst koji ce biti obojen...</p>`;//ubacuje paragraf u postojeci div\n}", "title": "" }, { "docid": "0a2b1eb47dec59e4aca67731f371aceb", "score": "0.5413029", "text": "function xianshi1(){\n\t xianshi.innerHTML=\"<font color='#06C'style='font-family:Georgia, \\\"Times New Roman\\\"'>1.Como agente de comosión, hacemos negocios sobre la base de comisión.<br>2.¿Quiere ser nuestro agente en América del Sur?<br>3.Si la proporción de comisión es favorable, queremos ser su agente en nuestra región.<br>4.Generalmente pagamos 3% del monto de cada negocio como comisión a los agentes.<br>5.Generalmente pagamos la comisión según el precio CIF.<br>6.Pueden descontar comisiones directamente de la factura.<br>7.Cotícennos el más bajo precio CIF Buenos Aires, incluído 5% de comisión, por favor.<br>8.Esta cotización nuestra tiene una comisión de 6%.<br>9.Generalmente, no damos descuento para pedidos de pequeña cantidad.<br>10.Esta vez queremos hacer un pedido de gran cantidad, pero deberían darnos un descuento. Si no, no podamos llegar a un acuerdo.<br>11.Si hacen un pedido de gran cantidad, les podemos dar más descuento.<br>12.Si el volumen de ventas supera a un millón de dólares, podemos darles un descuento especial de 5%.<br>13.Estoy de acuerdo con un descuento de 15%, pero deberá hacer un pedido de 100 mil juegos.<br>14.Si haces un pedido de 100 piezas o más de 100 piezas, te podemos dar un descuento de 3%.<br>15.Si haces un pedido de 100 piezas o más cinco mil juegos, les daremos un descuento de 10% según la tarifa.<br>16.Si hacen un pedido de más de 200 mil dólares al año, les daremos una comisión de 5%.<br>17.Si la cantidad de su pedido aumenta hasta 120 mil dicenas, les daremos otro 5% de comisión.<br>18.Si pagan con efectivo, les damos un descuento de 10%.<br>19.El 10% es imposible, pero estamos dispuestos a darles un descuento de 8%.<br>20.Considerando todo, creemos que un descuento de 8% es muy especial y puede ayudarles a ampliar sus comercios en África.<br>21.Considerando nuestra relación de comercio a largo plazo, queremos darles 2% más de comisión.<br>22.Considerando nuestra relación de comercio a largo plazo, te damos un descuento especial de 12%.<br>23.Después del pago, les giraremos la comisión según el 4% del monto de la factura.<br>24.Les pagaremos la comisión de 5% con cheque.<br>25.Sea como sea, cedamos cada parte. ¿Qué le parece un 5% de comisión?<br>26.Lo siento. No podemos darte una comisión tan alta.<br>27.No creo poder ceder en eso.<br>28.Normalmente si se trata de este tipo de artículos especiales, sólo damos 3% de comisión.<br>29.¿Qué descuento nos dará?<br>30.Les daremos máximo un descuento de 15%.<br>31.Para ser fraco, no nos interesa mucho un descuento de 4%.<br>32.Generalmente conseguimos descuentos de 5% a 10% de otros suministradores.<br>33.Como compensación, queremos darles un descuento especial de 5%.<br>34.Para expresarte nuestro agradecimiento en los pedidos, les daremos una comisión de 6%.<br>35.Ya que acceden al incremento en los pedidos, les daremos un descuento del 3% más.<br>36.Para mostrarles nuestra buena fé, nos hemos decidido a darles un descuento especial de 5%.<br>37.Les proveemos recambios de automóvil a precio preferencial, les damos un descuento de 10%.<br>38.Por cualquier producto que se encarguen en mayo, les haremos un descuento de 7%.<br>39.Últimamente tenemos dificultades temporales en las finanzas.Nos encontramos con unos pronlemas imprevistos.<br>40.Le llamo para demandar una prórroga de pagp.<br>41.¿Podemos aplazar el pago un mes/diez días/dos semanas?<br>42.Nos vemos obligados a aplazar el pago.<br>43.¿Podría permitir que aplacemos el pago?<br>44.¿Podría prorrogar el plazo?<br>45.Si usted puede ayudarnos a pasar las difucultades, les agradeceremos mucho.<br>46.Si nos conceden 15 días de prórroga, nos alegremos mucho.<br>47.Si permite que aplacemos el pago 60 días, nuestros recursos financieros pueden circular.<br>48.Pedimos que se aplace el pago por 4 meses, para la circulación de<br> 49.nuestros recursos financieros<br>50.Deseamos que nos concedan una prórroga de pago, porque tenemos dificultades en finanzas.<br>51.Somos clientes con reputación crediticia.<br>52.Cumpliremos nuestra promesa.<br>53.Tenemos un plazo de tres meses para pagar la cuenta.<br>54.Sin duda alguna pagaremos al contado dentro de tres días.<br>55.Les agradezco mucho por su tolerancia.<br>56.Les agradecemos mucho que nos hayan concedido una prórroga para pagar el resto por un mes.<br>57.Tengo que pensarlo antes de darle la respuesta.<br>58.Perdonad, no estamos de acuerdo con vuestra prórroga de pago.<br>59.El aplazamiento del pago nos acarreará muchos problemas.<br>60.Estamos de acuerdo con prorrogar dos meses el plazo de pago. <br></font>\";}", "title": "" }, { "docid": "ab67c46578583eff8f2d9b2c4ccbd2f5", "score": "0.5387919", "text": "function corregirText(i) {\n\tvar valor = preguntaHTML[i].getElementsByTagName('input')[0].value;\n\t\n\tif (valor.toUpperCase() == (window['ok' + i][0].toUpperCase())) {\n\t\tnota++;\n\t\tvar z = true;\n\t\tponerBold(\"P \" + (i+1), z);\n\t\tdarExplicacion(\"CORRECTA. Puntuación: 1\");\n\t} else {\n\t\tnota = nota - 0.2;\n\t\tvar z = false;\n\t\tponerBold(\"P \" + (i+1), z);\t\t\n\t\tdarExplicacion(\"INCORRECTA. Puntuación: -0.2\");\n\t\tdarExplicacion(\"Respuesta correcta: \" + window['ok' + i][0]);\n\t}\t\n}", "title": "" }, { "docid": "e88303acd15b347c9e2319423adc8c7e", "score": "0.53874975", "text": "function getHtml(){\n const codeLines = document.querySelectorAll('.line-answer')\n let html = '';\n for(let line of codeLines){\n // let test = [...line.getElementsByTagName('div')].filter(item => item.className != \"draggable-zone\").map(el => el.innerHTML)\n html += [...line.getElementsByTagName('div')].filter(item => item.className != \"draggable-zone\").map(el => el.innerText).join('');\n \n // .join(''));\n }\n return html\n }", "title": "" }, { "docid": "57ca1808a7c90eb3a3bb57651a120510", "score": "0.53871113", "text": "function li(t) {\n return t + \"\u0001\u0001\";\n }", "title": "" }, { "docid": "ce04d850200a91c4a3c29824d0b47a28", "score": "0.5385326", "text": "function Maiusculo ({texto}){\n const textoRecebido = texto\n const textoMaiusculo = textoRecebido.toUpperCase() //converte em maiusculo.\n return<> {textoMaiusculo} </>\n}", "title": "" }, { "docid": "df75a6c26d8e2c050f24fd3f75f97f08", "score": "0.5373685", "text": "function tntRCligneBlanche3Col() {\r\n\treturn(\"<tr height='\" + tntRCsize8 + \"'><td class='tntRCblanc' width='\" + tntRCsize5 + \"'></td><td class='tntRCblanc' width='\" + tntRCsize789 + \"'></td><td class='tntRCblanc' width='\" + tntRCsize6 + \"'></td></tr>\");\r\n}", "title": "" }, { "docid": "81070a2ff5c4f501d2e045a7181f5d0a", "score": "0.53506863", "text": "function add_custom_html_tags( text , dizionario ) {\n var raw_split = text.split(/([ '\\.])/);\n\tvar got_words = text.split(/\\b/);\n\tvar out = \"\";\n\tfor (i in raw_split) {\n\t\t// deletes tags and punctuation for comparison\n\t\tvar epurated = raw_split[i].replace(/(<\\/{0,1}\\w*>)/g, \"\").replace(/[\\.,;!\\?]/g,\"\").trim();\n\t\tvar epuratedLowercased = epurated.toLowerCase();\n\t debug_out(raw_split[i]+\" // \"+epuratedLowercased+\" /?/ \"+isNullOrEmpty(epurated),3);\n\t\t// it's not a word, copy as it is\n\t\tif ( isNullOrEmpty(epurated) ) {\n\t\t\tout += raw_split[i];\n\t\t}\n\t\telse {\n\t\t\t// if it's included in the dictionary, adds the <wd> tag\n\t\t\tif ( dizionario.indexOf(epuratedLowercased) >= 0 ) {\n if (UI_settings.wordhighlight) {\n\t\t\t out += \"<wdh onClick=\\'pick_a_word(\\\"\"+ epuratedLowercased +\"\\\");\\'>\"+ raw_split[i] +\"</wdh>\";\n }\n else {\n\t\t\t out += \"<wd onClick=\\'pick_a_word(\\\"\"+ epuratedLowercased +\"\\\");\\'>\"+ raw_split[i] +\"</wd>\";\n }\n\t\t\t}\n\t\t\telse {\n\t\t\t\tout += raw_split[i];\n\t\t\t}\n\t\t}\n\t}\n return out;\n}", "title": "" }, { "docid": "64b0f454cea4f53db1d9c2d7e9ae826e", "score": "0.5342408", "text": "function ErYing() {\n return <h2>二营</h2>\n}", "title": "" }, { "docid": "53abb9e4be1a3ae0603471417e63eab8", "score": "0.5340778", "text": "function dibujarTablero(){\n\n\tlet htmlTablero=\"\";\n\tlet letras=dibujarLetras();\n\n\thtmlTablero+=letras;\n\thtmlTablero+=dibujarCeldas();\n\thtmlTablero+=letras;\n\n\treturn htmlTablero;\n\t\n}", "title": "" }, { "docid": "074cd86411605c5036195bbb93b75c5b", "score": "0.53393734", "text": "function resultTextArea(){trans_input_before.innerText = \"\";trans_input_after.innerText = \"\";}", "title": "" }, { "docid": "00f3d7cc5b1763bb08970a2dc2905b6c", "score": "0.5333144", "text": "function getAnswerFullHtml(prob_0_start, prob_0_end, prob_50_start, prob_50_end, prob_75) {\n\n var result = \"<p>Существует некоторая <span class='prob_0'>ненулевая вероятность</span> завершения проекта \";\n\n if (prob_0_start != prob_0_end) {\n result += \"в период между <span class='light_text'>\" + prob_0_start + \"</span> и <span class='light_text'>\" + prob_0_end + \"</span></p>\";\n } else {\n result += \"<span class='light_text'>\" + prob_0_end + \"</span></p>\";\n }\n\n result += \"<p><span class='prob_50'>Значительно вероятнее</span>, однако, что вы будете готовы \";\n\n if (prob_50_start != prob_50_end) {\n result += \"между <span class='light_text'>\" + prob_50_start + \"</span> и <span class='light_text'>\" + prob_50_end + \"</span></p>\";\n } else {\n result += \"<span class='light_text'>\" + prob_50_end + \"</span></p>\";\n }\n\n result += \"<p>С <span class='prob_75'>75%-ной достоверностью</span> можно назначить сроком сдачи <span class='light_text'>\" + prob_75 + \"</span></p>\";\n\n if ($('#no-risk-4').is(\":checked\"))\n {\n var value = parseInt($('.no-risk-4').find('div.flat-slider-vertical-bad span.ui-slider-tip').text());\n result += '<p><b>С вероятностью - ' + value.toString() + '% </b> проект прекратится.</p>';\n }\n\n result += \"<div class='quote-info'><p><b>Диаграмма совокупного риска</b> показвает результат прогонов проекта через симулятор 50 000 раз.</p>\" +\n \"<p><b>Кумулятивная диаграмма</b> показывает вероятность завершения проекта от 0 до 100% во времени.</p></div>\";\n\n return result;\n}", "title": "" }, { "docid": "669f0808948fd568a849512c5825715f", "score": "0.5327999", "text": "function susunPertanyaan() {\n textPertanyaan = document.getElementById('text-pertanyaan')\n divPilihan = document.getElementById('div-pilihan')\n\n\n const soal = kumpulanSoal[indexSoal]\n textPertanyaan.innerText = soal.pertanyaan\n\n const jawaban = soal.jawaban\n\n let htmlString = ''\n for (const key in jawaban) {\n htmlString += `\n<div class=\"pilihan\">\n <input type=\"radio\" id=\"${key}\" name=\"jawaban\" value=\"${jawaban[key].hasil}\">\n <label for=\"${key}\">${key}. ${jawaban[key].text}</label> <br>\n</div>\n` // default contoh pilihan jawaban\n }\n\n let htmlNode = new DOMParser().parseFromString(htmlString, \"text/html\").body // Untuk mengubah String ke DOM Node\n .childNodes;\n\n divPilihan.replaceChildren(...htmlNode) \n indexSoal++\n}", "title": "" }, { "docid": "9872704788c8dc14f627f776230e4773", "score": "0.5327994", "text": "function kliknul() {\n citadlo += ruce ;\n document.getElementById(\"textsusky\").innerHTML = citadlo;\n }", "title": "" }, { "docid": "d33a756878f32630842a87fadd96eab0", "score": "0.53208584", "text": "function makeLentilleHtml(tab) {\n\n let html = `<option value=\"\">${tab[0]}</option>`\n\n //on commence à i = 1 pck on déclare le 0 et le 1 dans la première boucle\n for (i=1 ; i < tab.length ; i++) {\n \n html = html + `<option value=\"${tab[i]}\">${tab[i]}</option>`\n }\n return html\n }", "title": "" }, { "docid": "3cf9e38e9ecf811bb397a338bc9bb3f7", "score": "0.53207976", "text": "function add_custom_html_tags( text , dizionario ) {\n var raw_split = text.split(/([ '\\.])/);\n var got_words = text.split(/\\b/);\n var out = \"\";\n for (i in raw_split) {\n // deletes tags and punctuation for comparison\n var epurated = raw_split[i].replace(/(<\\/{0,1}\\w*>)/g, \"\").replace(/[\\.,;!\\?]/g,\"\").trim();\n var epuratedLowercased = epurated.toLowerCase();\n debug_out(raw_split[i]+\" // \"+epuratedLowercased+\" /?/ \"+isNullOrEmpty(epurated),3);\n // it's not a word, copy as it is\n if ( isNullOrEmpty(epurated) ) {\n out += raw_split[i];\n }\n else {\n // if it's included in the dictionary, adds the <wd> tag\n if ( dizionario.indexOf(epuratedLowercased) >= 0 ) {\n if (FIN_framework.UI_settings.wordhighlight) {\n out += \"<wdh onClick=\\'pick_a_word(\\\"\"+ epuratedLowercased +\"\\\");\\'>\"+ raw_split[i] +\"</wdh>\";\n }\n else {\n out += \"<wd onClick=\\'pick_a_word(\\\"\"+ epuratedLowercased +\"\\\");\\'>\"+ raw_split[i] +\"</wd>\";\n }\n }\n else {\n out += raw_split[i];\n }\n }\n }\n return out;\n}", "title": "" }, { "docid": "90116867e298627c83a28d6897111779", "score": "0.5312737", "text": "function carritoHtml() {\n //limpiar Html\n limpiarHtml();\n //recorre carrito y genera el html en el tbody\n artCarrito.forEach(zapat => {\n //usando destructuring\n const { imagen, titulo, precio, cantidad, id } = zapat;\n const row = document.createElement('tr');\n row.innerHTML = `\n <td><img src=\"${imagen}\" style=\"width:100px;\"></td>\n <td>${titulo}</td>\n <td>${precio}</td>\n <td>${cantidad}</td>\n <td><a href=\"#\" class=\"borrar-zapat\" data-id=\"${id}\"> X </a></td>\n\n `;\n //Agregar el html del carrito en el tbody\n contenedorCarrito.appendChild(row);\n });\n}", "title": "" }, { "docid": "c0c72fbc71d0a69a86e66a6963435922", "score": "0.5294135", "text": "function carritoHtml(){\n//limpia el html\nlimpiarHtml();\n\n//recorre el carrito\n articulosCarrito.forEach(curso =>{\n const row = document.createElement('tr');\n row.innerHTML=`\n <td><img src=\" ${curso.imagen}\" width= \"100\"></td>\n <td>${curso.titulo}</td>\n <td>${curso.precio}</td>\n <td>${curso.cantidad}</td>\n <td> <a href =\"#\" class=\"borrar-curso\" data-id=\"${curso.id}\">X</a> </td>\n \n `;\n//Agrega el carrito al html\ncontenedorCarrito.appendChild(row);\n\n })\n}", "title": "" }, { "docid": "71ce9e42679478f671cc7bb555dde07b", "score": "0.5288543", "text": "function textToHtmlCB(mstr, m1, m2, m3, m4, offset, string)\r\n{ \r\n \r\n //zeilenumbruch check\r\n if(m1 && m1.length) {\r\n if(m1 == 'p' || m1 == '\\n')\r\n return \"<br />\";\r\n }\r\n\r\n \r\n if(isValidTag(m2)) {\r\n // falls url offen\r\n if(opentags.length && opentags[opentags.length-1].bbtag == \"url\" && urlstart >= 0)\r\n return \"[\" + m2 + \"]\";\r\n switch (m2) {\r\n\t\t \r\n\t\t case \"p\":\r\n\t\t \treturn \"<br />\"\r\n\t\t \r\n case \"color\":\r\n if(!m3 || !color_re.test(m3))\r\n m3 = \"inherit\";\r\n opentags.push(new taginfo_t(m2, \"</span>\"));\r\n return \"<span style=\\\"color: \" + m3 + \"\\\">\";\r\n\t\t\t\r\n\t\t case \"align\":\r\n if(!m3 || !align_re.test(m3))\r\n return mstr;\r\n opentags.push(new taginfo_t(m2, \"</p>\"));\r\n return \"<p style=\\\"text-align: \" + m3 + \"\\\">\";\r\n\t\t\t\r\n\t\t case \"font\":\r\n if(!m3 || !font_re.test(m3))\r\n\t\t\t\treturn mstr;\r\n\t\t\topentags.push(new taginfo_t(m2, \"</span>\"));\r\n\t\t\treturn \"<span style=\\\"font-family: \" + m3 + \"\\\">\";\r\n \r\n case \"size\":\r\n if(!m3 || !number_re.test(m3))\r\n m3 = \"1\";\r\n opentags.push(new taginfo_t(m2, \"</span>\"));\r\n return \"<span style=\\\"font-size: \" + Math.min(Math.max(m3, 0.7), 3) + \"em\\\">\";\r\n\r\n case \"s\":\r\n opentags.push(new taginfo_t(m2, \"</span>\"));\r\n return \"<span style=\\\"text-decoration: line-through\\\">\";\r\n\t\t\t\r\n\t\t case \"center\":\r\n opentags.push(new taginfo_t(m2, \"</p>\"));\r\n return \"<p style=\\\"text-align: center\\\">\";\r\n\t\t\t\r\n\t\tcase \"sup\":\r\n opentags.push(new taginfo_t(m2, \"</span>\"));\r\n return \"<span style=\\\"vertical-align: super\\\">\";\r\n\t\t\t\r\n\t\tcase \"sub\":\r\n opentags.push(new taginfo_t(m2, \"</span>\"));\r\n return \"<span style=\\\"vertical-align: sub\\\">\";\r\n\t\t\r\n\t\tcase \"list\":\r\n opentags.push(new taginfo_t(m2, \"</ul>\"));\r\n return \"<ul style=\\\"list-style-type: square;\\\"\\\">\";\r\n\t\t\t\r\n\t\tcase \"*\":\r\n\t\t\treturn \"<li>\";\t\r\n\t\t\t\r\n\t\t case \"email\":\r\n\t\t\tif(m3 && !email_re.test(m3))\r\n\t\t\t\treturn mstr;\r\n\t\t\tif (m3 && email_re.test(m3)){\r\n\t\t\t opentags.push(new taginfo_t(m2, \"</a>\"));\r\n\t\t\t return \"<a href=\\\"mailto://\" + m3 +\"\\\">\";\r\n\t\t\t}\r\n\t\t\tif (!m3 && email_re.test(string.substring(7,string.length - 8))){\r\n\t\t\t opentags.push(new taginfo_t(m2, \"</a>\"));\r\n\t\t\t return \"<a href=\\\"mailto://\" + string.substring(7,string.length - 8) +\"\\\">\";\r\n\t\t\t} else\r\n\t\t\t\treturn mstr;\r\n\r\n case \"url\":\r\n opentags.push(new taginfo_t(m2, \"</a>\"));\r\n \r\n \r\n if(m3 && uri_re.test(m3)) {\r\n urlstart = -1;\r\n return \"<a href=\\\"\" + m3 + \"\\\">\";\r\n }\r\n\r\n \r\n urlstart = mstr.length + offset;\r\n return \"<a href=\\\"\";\r\n\r\n\r\n default:\r\n\t\t \t\r\n // [b],[i],[u]\r\n opentags.push(new taginfo_t(m2, \"</\" + m2 + \">\"));\r\n\t\t\t\r\n return \"<\" + m2 + \">\";\r\n \r\n }\r\n }\r\n \r\n //schluss tags \r\n if(isValidTag(m4)) {\r\n if(!opentags.length || opentags[opentags.length-1].bbtag != m4)\r\n return \"<span style=\\\"color: red\\\">[/\" + m4 + \"]</span>\";\r\n\r\n if(m4 == \"url\") {\r\n if(urlstart > 0)\r\n return \"\\\">\" + string.substr(urlstart, offset-urlstart) + opentags.pop().etag;\r\n \r\n return opentags.pop().etag;\r\n }\r\n else if(m4 == \"code\" || m4 == \"pre\")\r\n crlf2br = true;\r\n return opentags.pop().etag;\r\n }\r\n return mstr;\r\n}", "title": "" }, { "docid": "602f1a1f93acf056c8cceb79e164ef33", "score": "0.5265859", "text": "function imprimirCadena(c,nivel,termino){\n let cadena = \"\";\n\n for (let index = 0; index <= nivel; index++) {\n cadena += \"\\t\\t\";\n }\n \n nivel += 1;\n if (termino) {\n c = \"<< \" + c + \" >>\";\n cadena += nivel + \" \" + c;\n //console.log('%c ' + cadena, 'color: #EB4034');\n\n \n }else{\n cadena += nivel + \" \" + c;\n //console.log(cadena); \n } \n\n // txt += \"\\n\" + cadena;\n \n}", "title": "" }, { "docid": "291c0ed86912e5d7737de12044e26184", "score": "0.5258529", "text": "function transliterate() {\r\n var input_text = document.getElementById(\"abaza_text\").value; \r\n var trans_sys = document.getElementById(\"trans_sys\").value; \r\n var stress = document.getElementById(\"stress\").checked;\r\n var punct = document.getElementById(\"punct\").checked;\r\n var tab = document.getElementById(\"tab\").checked;\r\n \r\n if (stress == true) {input_text = input_text.toLowerCase()}\r\n if (tab == true) {input_text = tabulate(input_text)}\r\n if (punct == true) {input_text = rm_punct(input_text)}\r\n if (trans_sys == \"fieldwork\") {\r\n\t var result_field = aba2field(input_text); \r\n\t document.getElementById(\"output\").style.display = \"block\";\r\n\t document.getElementById(\"tip\").innerHTML = result_field;\r\n } else if (trans_sys == \"ipa\") {\r\n\t\tvar result_ipa = aba2ipa(input_text); \r\n\t\tdocument.getElementById(\"output\").style.display = \"block\";\r\n\t\tdocument.getElementById(\"tip\").innerHTML = result_ipa;\r\n\t}\r\n}", "title": "" }, { "docid": "fc41da17fe826715211f991e5a73c668", "score": "0.5257569", "text": "function convertHTML(str) {\n\n}", "title": "" }, { "docid": "fda627b0723e816c53fe33154d68f70f", "score": "0.5230749", "text": "function ponerDatosInputHtml(t, pos) {\r\n document.getElementById(\"input\" + pos).innerHTML = t;\r\n\r\n}", "title": "" }, { "docid": "8c41c006f8d6058517922dfdecfd0c97", "score": "0.52299297", "text": "function crearNoticiaHtml(titulo,texto){\n\n// Construimos el string 'noticiaHTML' que contiene el titulo y el texto y lo retornamos\nnoticiaHTML = ' '; //inicializamos la variable\nnoticiaHTML += '<h4>'+ titulo + '</h4>';//le agregamos el título con formato\nnoticiaHTML += texto;//y el texto\nreturn noticiaHTML;//y lo retornamos\n}", "title": "" }, { "docid": "31db9b8e99d166d20ed5a107cc0f0f0b", "score": "0.52257776", "text": "function limpiarHTML() {\r\n while (contenedorCarrito.firstChild) {\r\n contenedorCarrito.removeChild(contenedorCarrito.firstChild);\r\n }\r\n}", "title": "" }, { "docid": "1529d0b55558946b0fb4e54dcfd56c7b", "score": "0.5219503", "text": "function carritoHTML() {\n vaciarCarrito();\n\n //recorre el carrito\n articulosCarrito.forEach((curso) => {\n const { titulo, precio, cantidad, id } = curso;\n const row = document.createElement(\"tr\");\n row.innerHTML = `\n <td>${id}</td>\n <td>${titulo}</td>\n <td>${precio}</td>\n <td>${cantidad}</td>\n <td>\n <a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\"> X </a>\n </td>\n `;\n //agrega html del carrito en el tbody\n contenedorCarrito.appendChild(row);\n });\n }", "title": "" }, { "docid": "ad1ea9b50029874570bf51fe2b036468", "score": "0.52194345", "text": "function kacSayiGirildi(pSayiAdedi) {\n let adet = document.getElementById(\"kac-adet-sayi\");\n adet.innerHTML = pSayiAdedi;\n}", "title": "" }, { "docid": "c94a1d90765e784cce5d1e592a62b087", "score": "0.521267", "text": "function actualizarPalabra(letraRecibida) {\n for (let index = 0; index < palabra.split('').length; index++) {\n if (palabra.split('')[index] == letraRecibida && letrasJuego[index] == \" __ \") {\n letrasJuego[index] = \"<strong>\" + letraRecibida + \"</strong>\";\n }\n }\n palabraJuego = \"\";\n for (let index = 0; index < letrasJuego.length; index++) {\n palabraJuego = palabraJuego + letrasJuego[index];\n }\n document.getElementById(\"palabra\").innerHTML = palabraJuego;\n document.getElementById(\"letra\").value = \"\";\n if (!letrasJuego.includes(\" __ \")) {\n reiniciar();\n alert(\"Ganaste!!! Fin del Juego, palabra: \" + palabra);\n }\n}", "title": "" }, { "docid": "6806a7b55cd41431b46b48bcadcef419", "score": "0.5207075", "text": "function findWords2(str){\r\n\r\nvar titulo = document.getElementsByTagName(\"h1\")[0].innerHTML\r\ntexto2 = findWords3(titulo);\r\n\r\n texto2 += \"<p>\";\r\n \r\n // Gambiarra porque a merda do javascript não tem replaceALL e usar regex com os parametros como ! e , é muito dificil\r\n str = str.split(',').join(\"DELIMITER,\");\r\n str = str.split(\"!\").join(\"DELIMITER!\");\r\n str = str.split(\":\").join(\"DELIMITER:\");\r\n str = str.split(\" \").join(\"DELIMITER \");\r\n str = str.split('\"').join('DELIMITER\"');\r\n str = str.split(\".\").join(\"DELIMITER.\");\r\n str = str.split(\";\").join(\"DELIMITER;\");\r\n str = str.split(\"'\").join(\"DELIMITER'\");\r\n \r\n //console.log(str);\r\n var array1 = str.split(\"DELIMITER\");\r\n console.log(array1);\r\n\r\n var grifarRosa ='<span style=\"background-color: pink\">';\r\n var grifarAzul = \"<span style='background-color: blue;'>\";\r\n var grifarRoxo = \"<span style='background-color: purple;'>\";\r\n var grifarPos = \"</span>\";\r\n var size = 0;\r\n var aux = \"\";\r\n for(var x = 0 ; x < array1.length ; x++)\r\n {\r\nsize = array1[x].length;\r\nif( size > 7)\r\n {\r\n texto2+= \" \" + grifarRosa+array1[x].trim()+grifarPos;\r\n\r\n }\r\nelse{\r\ntexto2+=array1[x];\r\n}\r\n }\r\n texto2 += \"</p>\";\r\n \r\n return texto2;\r\n}", "title": "" }, { "docid": "526a815f7f8d9879d9a98af9325e9fcc", "score": "0.5206893", "text": "function carritoHtml(){\n\n // limpiar el html \n limpiarhtml();\n // Recorre y genera el carrito\n \n articuloCarrito.forEach(curso =>{ \n const {imagen,titulo,precio,cantidad,id} = curso;\n const row = document.createElement('tr');\n row.innerHTML =` \n <td>\n <img src = \"${imagen}\" width = \"89\">\n\n </td>\n <td>${titulo}</td>\n <td>${precio}</td>\n <td>${cantidad}</td>\n <td>\n <a href= \"#\" class = \"borrar-curso\" data-id=\"${id}\"> x </a>\n </td> \n `;\n\n //Agrega el html en el carrito\n contenedorcarrito.appendChild(row);\n })\n}", "title": "" }, { "docid": "90aa2e8f4a76c839bed38775870ca454", "score": "0.5204822", "text": "function convertir() {\n\tvar letras = document.getElementById('input_text').value;\n\t//SPLIT SIRVE PARA SEPARAR UNA CADENA DE STRINGS. CADENA.SPLIT(SEPARADOR)\n\tvar lista = letras.split(\"\");\n\n\tvar html = \"\"\n\t//LISTA.LENGTH.. ADQUIERE EL VALOR TODAR DE LOS DATOS INGRESADOS.\n\t//ESTO SIGNIFICA QUE EL FOR VA REPETIRSE DEPENDIENDO DE LAS LETRAS INGRESADAS.\n\tfor (var i = 0; i < lista.length; i++) {\n\t\t//IF PARA SABER LOS ESPACIOS EMTRE LETRAS\n\t\tif (lista[i] == \" \") {\n\t\t\thtml += \"<span class='img-container'><p> </p> </span>\"\n\t\t\tnum = false;\n\t\t}\n\t\t//LOS ASTERISCOS\n\t\telse if (lista[i] == \"*\") {\n\t\t\tvar currentDiv = document.getElementById(\"output_text\")\n\t\t\thtml += \"<span class='img-container'>\" + getImage(\"asterisco\") + \"</span>\"\n\t\t\tnum = false;\n\t\t}\n\t\t//CIERRE DE INTERROGACION\n\t\telse if (lista[i] == \"?\" || lista[i] == \"¿\") {\n\t\t\tvar currentDiv = document.getElementById(\"output_text\")\n\t\t\thtml += \"<span class='img-container'>\" + getImage(\"ininterrogacion\") + \"</span>\"\n\t\t\tnum = false;\n\t\t}\n\t\telse if (lista[i] >= \"A\" && lista[i] <= \"Z\") {\n\t\t\tvar currentDiv = document.getElementById(\"output_text\")\n\t\t\thtml += \"<span class='img-container'>\" + getImage(\"mayus\") + \"</span>\"\n\t\t\thtml += \"<span class='img-container'>\" + getImage(lista[i]) + \"</span>\"\n\t\t\tnum = false;\n\t\t}\n\t\telse if (lista[i] >= \"0\" && lista[i] <= \"9\") {\n\t\t\tvar currentDiv = document.getElementById(\"output_text\")\n\t\t\tif (num == false) {\n\t\t\t\thtml += \"<span class='img-container'>\" + getImage(\"num\") + \"</span>\"\n\t\t\t\tnum = true;\n\t\t\t}\n\t\t\thtml += \"<span class='img-container'>\" + getImage(lista[i]) + \"</span>\"\n\t\t} else if (lista[i] == /\"/) {\n\t\t\tvar currentDiv = document.getElementById(\"output_text\")\n\t\t\thtml += \"<span class='img-container'>\" + getImage(\"comiillas\") + \"</span>\"\n\t\t\tnum = false;\n\t\t} else if (lista[i] == \":\") {\n\t\t\tvar currentDiv = document.getElementById(\"output_text\")\n\t\t\thtml += \"<span class='img-container'>\" + getImage(\"2puntos\") + \"</span>\"\n\t\t\tnum = false;\n\t\t}\n\t\t//PARA LETRAS.\n\t\telse {\n\t\t\tvar currentDiv = document.getElementById(\"output_text\")\n\t\t\thtml += \"<span class='img-container'>\" + getImage(lista[i]) + \"</span>\"\n\t\t}\n\n\t}\n\t//IMPRIME LOS DATOS QUE INGRESAN.\n\tcurrentDiv.innerHTML = \"<div id='paginacion'>\" + html + \"</div>\";\n\n\t\"<link rel='stylesheet' type='text/css' href='css/Braile.css' media='screen'/>\"\n}", "title": "" }, { "docid": "b8a2186bee570da173d420ff9d321fa8", "score": "0.5202963", "text": "function to_html(text, teg = \"p\") \n{\n //teg = teg || 'p';\n \n document.write(\"<\"+teg+\">\");\n document.write(text);\n document.write(\"</\"+teg+\">\");\n}", "title": "" }, { "docid": "706618efdeea9840e0e4fb9c10dc2887", "score": "0.51999575", "text": "function badil0(){\n document.getElementById(\"ee\").innerHTML = \"<h1 >0.2 Sprich mit uns- HOTEL PACHA</h1><br><p>Cet événement est Basé sur le concept de l’innovation et de la créativité.Une journée d’échange, dedébats et de tables rondes traitant des sujets d’actualité (La POLLUTION).Dans ce cadre et avec la participation de plus que 80 personnes, l’action vise à rapprocher les élèves ingénieurs, les employeurs,les élèves, les médecins, les directeurs. C’est une occasion privilégiée pour communiquer et échanger des idées avec des élèves ingénieurs, des employeurs, des élèves, des médecins , directeurs...</p>\";\n}", "title": "" }, { "docid": "dec3b43a0033f07b036f5ed23756b46d", "score": "0.51983136", "text": "function result(sanin) {\r\n document.querySelector('.topic3').remove();\r\n\r\n var textElement = document.createElement('p');\r\n textElement.className = 'result'\r\n textElement.innerHTML = sanin\r\n page.appendChild(textElement)\r\n \r\n}", "title": "" }, { "docid": "769d48ebb56fef20ba1a14239f61301e", "score": "0.5188876", "text": "function convertir_línea(texto){\n\tvar partes = int_línea(texto);\n//\tif(!partes) return document.createTextNode(\"\");\n\tvar n = partes.length;\n\tvar i;\n\tif(sust_símbolos){\n\t\tconst df = [];\n\t\tfor(i=0;i<n;i++){\n\t\t\tif(typeof partes[i] == \"string\") df.push(partes[i]);\n\t\t\telse{\n\t\t\t\tif(partes[i].tipo < 5) df.push(\" \");\n\t\t\t\tdf.push(partes[i].limpiar());\n\t\t\t}\n\t\t}\n\t\tpartes = df;\n\t\tn = df.length;\n\t}/**/\n\tconst df2 = document.createDocumentFragment();\n\tfor(i=0;i<n;i++){\n\t\tlet nodo;\n\t\tif(typeof partes[i] == \"string\") nodo = document.createTextNode(partes[i]);\n else nodo = partes[i].obt_nodos();\n\t\tdf2.appendChild(nodo);\n\t}\n\treturn df2;\n}", "title": "" }, { "docid": "2813e4489cb5c737681ab9a4cdfbf658", "score": "0.51857775", "text": "function tripColorize(trip)\n{ \n var namePart, tripPart;\n var tripFound = trip.match(/!/g);\n if (tripFound)\n {\n var splitName = trip.split(\"!\");\n namePart = splitName[0];\n tripPart = \"!\" + splitName[1];\n tripPart = \"<SPAN Class = 'trip-display greentext'>\" + tripPart + \"</SPAN>\";\n return namePart + tripPart;\n }\n \n return trip;\n}", "title": "" }, { "docid": "432b7f5f98669df3e8673cebe366d02c", "score": "0.5182741", "text": "function palabraSecreta() { //funcion que encripta la palabra aleatoria\n var start='';\n for (var i = 0; i < palabra.length;i++){\n start += '*';\n }\n return start;\n}", "title": "" }, { "docid": "9eada5450a95658519b34b52e45f0ae3", "score": "0.51826954", "text": "function xianshi1(){\n\txianshi.innerHTML=\"<font color='#06C' style='font-family:Georgia, \\\"Times New Roman\\\"'>01.¿Qué peticiones tienen sobre el embalaje exterior e interior?<br/>02.La vez pasada me dijiste que querías el embarque más económico.<br/>03.Puedes darnos consejos sobre el embarque.<br/>04.¿Cuál es el embarque de mayor venta?<br/>05.El embalaje exterior require exactitud absoluta y claridad.<br/>06.En cuanto al embarque interior, debe tener atracción. Es favorable para la venta.<br/>07.Diseñamos meticulosamente los embalajes adecuados para cada partida de las mercancías.<br/>08.Pierden cuidado. Hemos perfeccionado mucho el embalaje.<br/>09.La especificación de nuestro contenedor cumoke absolutamente la norma de la Organización Internacional de Estandarización.<br/>10.El precio de este artículo ya incluye el gasto del empaque.<br/>11.\tGeneralmente los gastos del empaque tienen que correr de la cuenta de la parte del comprador.<br/> 12.\t¿Este empaque es conveniente para el largo transporte?<br/> 13.\tPedimos que el embalaje pueda soportar el largo viaje por el mar.<br/>14.Tenemos las peticiones especiales sobre el empaque.<br/>15.\tPor elevadísimo que sea el precio, exigimos que embalen esta partida de mercancías en materiales especiales de envase.<br/> 16.\tHaga el favor de marcar en la caja de embalaje el puerto de destino, las medidas, el número de serie, peso bruto y peso neto.<br/>17.\tEn cada carga de bultos deben marcar el puerto de destino, número, peso bruto y neto, tamaño y signo.<br/>18.\tPara evitar los posibles daños sufridos en tránsito, pedimos que embalen en pequeñas cajas sólidos de madera.<br/>19.\tLa caja de madera no sólo tiene que ser muy conveniente para el tranporte de mar, sino también muy resistente para proteger las mercancías de la posible pérdida.<br/>20.\tPedimos que las cajas sean forradas impermeablemente, reforzadas con dos correas meteles.<br></font>\";}", "title": "" }, { "docid": "923d1bc4951e4c10fe005c69566beadd", "score": "0.5182469", "text": "function carritoHTML() {\n // Limpiar el HTML\n limpiarHTML();\n // Recorre el carrito y genera el HTML\n for (const elemento of articulosCarrito) {\n const row = document.createElement(\"tr\");\n row.innerHTML = `\n <td>\n <img src=\"${elemento.imagen}\" width=\"100\">\n </td> \n <td>${elemento.titulo}</td>\n <td>${elemento.precio}</td>\n <td>${elemento.cantidad}</td>\n <td>\n <a href=\"#\" class=\"borrar-producto\" data-id=\"${elemento.id}\" > X </a>\n </td> \n `;\n // Agrega el HTML del carrito en el tbody\n contenedorCarrito.append(row);\n }\n}", "title": "" }, { "docid": "c94c9bd3f6f510a85a7bb667306c73bb", "score": "0.51793325", "text": "function li(t) {\n return t + \"\u0001\u0001\";\n}", "title": "" }, { "docid": "e43307516b4b0da9a2d06dd30ebe01b7", "score": "0.51654416", "text": "function limpiarHTML (){\n //Forma lenta\n //contenedorCarrito.innerHTML = '';\n while(contenedorCarrito.firstChild){\n contenedorCarrito.removeChild(contenedorCarrito.firstChild);\n }\n}", "title": "" }, { "docid": "612070b39c4add4cd78c9c1f924e2ab2", "score": "0.5155828", "text": "function spoctiTxt() {\n /* volani funkce textova, ktera je implementovana v JSONU*/\n textova();\n}", "title": "" }, { "docid": "354a41a058eab01ec8887765887c41e2", "score": "0.5155764", "text": "apasinDOI() {\n let resultado = '';\n for (let i = 0; i < this.getAutor().length; i++) {\n let autorAux = this.getAutor()[i].split(\" \");\n resultado += autorAux[1] + \", \" + autorAux[0][0] + \". \";\n if (i < this.getAutor().length - 1) {\n resultado += \"& \";\n }\n }\n resultado += \"(\" + this.getFecha() + \"). \";\n resultado += this.getTitulo() + \". \";\n resultado += this.getEditorial() + \".\";\n return resultado;\n }", "title": "" }, { "docid": "a963d5d88954f254607f403b28890267", "score": "0.5146097", "text": "function carritoHTML() {\n //Limpia el HTML\n limpiarHtml();\n\n //Recorre el carrito y agrega el HTML\n articulosCarrito.forEach(producto => {\n const row = document.createElement('tr');\n row.innerHTML = `<td> <img src=\"${producto.imagen}\" width='100'></td>\n <td class=\"tablePersonalizada table__content\">${producto.nombre}</td>\n <td class=\"tablePersonalizada table__content\">$${producto.precio}</td>\n <td class=\"tablePersonalizada table__content\">${producto.cantidad}</td>\n <td class=\"tablePersonalizada\"><a href=\"#\" class=\"borrar-producto btn btn-dark\" data-id=\"${producto.id}\">X</a></td>`;\n \n //Agrega el HTML del Carrito en el tag <tbody>\n contenedorCarrito.appendChild(row);\n })\n //Sincronizar con Storage\n sincronizarStorage();\n }", "title": "" }, { "docid": "319782ac9b81a7a5b73d78eef48b8a41", "score": "0.51440334", "text": "function Tranformer(variable) {\n var Herramienta = \"\";\n for (var q = 0; q < variable.length; q++) {\n if (variable.charAt(q) == '/') {\n Herramienta += '|';\n } else {\n Herramienta += variable.charAt(q);\n }\n }\n return Herramienta;\n}", "title": "" }, { "docid": "742f402ba4d46d56c8c75edc35f49873", "score": "0.51349986", "text": "function trattaRichiesta(chi, esito) {\n PT.VIEW.getInstanceUpdater().trattaRichiestaPendente(chi, esito);\n}", "title": "" }, { "docid": "19408fcc2c27a95e19aa462ac1128dbe", "score": "0.5127044", "text": "function carritoHTML() {\n \n limpiarHTML();\n\n //recorre carrito y genera el HTML\n articulosCarrito.forEach( curso => {\n const { imagen, titulo, precio, cantidad, id } = curso; \n const row = document.createElement('tr');\n row.innerHTML = `\n <td>\n <img src=\"${imagen}\" width=\"100\">\n </td>\n <td> ${titulo} </td>\n <td> ${precio} </td>\n <td> ${cantidad} </td>\n <td>\n <a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\"> X </a>\n </td>\n `;\n\n contenedorCarrito.appendChild(row);\n })\n}", "title": "" }, { "docid": "22c70953c79d82f19a487ef64fd78ec0", "score": "0.5126843", "text": "templateArmia(data) {\r\n if (data) {\r\n this.html = `\r\n <nav class=\"center\">\r\n <ul class=\"first-menu-armia\">\r\n ${this.firstEle(data)}\r\n </ul>\r\n </nav>`;\r\n } else {\r\n this.html = \"ERROR\";\r\n }\r\n return this.html;\r\n }", "title": "" }, { "docid": "2ad1a4851c02299b34586e36160a0e01", "score": "0.51247036", "text": "function normalizeText(text) {\n // Uzun so'zni tanlab natija ko'rinishda chiqarishuvchi o'zgaruvchi yaratamiz\n var result = '';\n\n // Input qiymatini tozalab tashlaymiz\n elInput.value = null;\n\n // Uzun so'zni chiqaruvchi loop kodlarini yozamiz\n for (var word of textArr) {\n\n // Shartni qanotlantiruvchi natijani chiqaramiz\n if (word.length > result.length) {\n result = word;\n }\n\n }\n\n return result;\n }", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.5118574", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.5118574", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.5118574", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.5118574", "text": "function SafeHtml() {}", "title": "" }, { "docid": "7021a013a532131fb71f4660abfbea8c", "score": "0.51165336", "text": "function carritoHTML(){\n\n //limpiar el html\n \n limpiarHtml();\n\n articulosCarrito.forEach( curso =>{\n //recorrer carrito y generar hmtl\n const {imagen,titulo,precio,cantidad,id} = curso;\n const row = document.createElement('TR');\n row.innerHTML = `\n <td>\n <img src=${imagen} >\n </td>\n <td>\n ${titulo}\n </td>\n <td>\n ${precio}\n </td>\n <td>\n ${cantidad}\n </td>\n <td>\n <a href='#' class=\"borrar-curso\" data-id=${id}>X</a>\n </td>\n `;\n listaCarrito.appendChild(row); \n\n })\n\n //sincronizar con storage\n\n sincronizarStorage();\n\n}", "title": "" }, { "docid": "1556d4d11b8ba8562fde3df030734d6c", "score": "0.5115703", "text": "function separaFrases(){\r\n var paragrafo = document.getElementsByTagName(\"p\");\r\n var br = \"</br>\";\r\n\r\n for(var i = 0; i < paragrafo.length; i++){ //loop de 0 até o numero de strings no texto\r\n for(var j = 0; j < paragrafo[i].innerHTML.length; j++){ //loop de 0 até o numero de letras em cada string\r\n if(paragrafo[i].innerHTML[j] === '.' || paragrafo[i].innerHTML[j] === '?' || paragrafo[i].innerHTML[j] === '!'){\r\n paragrafo[i].innerHTML = paragrafo[i].innerHTML.substring(0, j + 2) + br + paragrafo[i].innerHTML.substring(j + 2);\r\n j += br.length + 1;\r\n }\r\n\r\n if(paragrafo[i].innerHTML[j] == '<'){\r\n while(paragrafo[i].innerHTML[j] != '>' && i < paragrafo[i].innerHTML.length){\r\n j++;\r\n }\r\n continue;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "bcfe90202ce8a2a25db5108ca7ee6019", "score": "0.5113773", "text": "function markAsWrong(sword, htmlText1, htmlText2) {\n spat1 = new RegExp(sword, \"i\")\n rpat1 = \"<u>\" + sword + \"</u>\"\n newWSize = rpat1.length\n segmentRight = htmlText2.replace(spat1, rpat1);\n $(\"#p2\").html(htmlText1 + segmentRight);\n voiceHtml = segmentLeft + segmentRight\n}", "title": "" }, { "docid": "bb9b2d55a1e3963d0e4a44b34fd0e72c", "score": "0.5113714", "text": "function afficherBoutonMultiplicateur(){\ndocument.getElementById('multiplicateur').innerHTML = (\" Multiplicateur X \" +compteur+ \" Prochain Bonus à \" + palier);\n}", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51093924", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51093924", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51093924", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51093924", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51093924", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51093924", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51093924", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51093924", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51093924", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.51093924", "text": "function SafeHtml() { }", "title": "" }, { "docid": "5595d393080261677477b32e19f1a3a9", "score": "0.5104991", "text": "function tr(t) {\n return hr.js(t, Pr.store);\n}", "title": "" }, { "docid": "46d7f924bf8982098f4e45d40fe59ec6", "score": "0.5100347", "text": "function toHtmlSamp( c, t, n ) {\n\tc = c.replace( /\\t/g, \"\\t\" ).replace( /\\t/g, \"&#160;&#160;&#160;&#160;\" ).replace( /\\n/g, \"<br>\\n\\t\\t\\t\\t\" );\n\treturn sampBase.replace( \"%b\", c.replace( \"&lt;b&gt;\", \"<b id = \\\"snip%n\\\" style = \\\"font-size:100%\\\">\" ) )\n\t\t.replace( \"&lt;/b&gt;\", \"</b>\" ).replace( /%n/g, n ).replace( /%t/g, t )\n}", "title": "" }, { "docid": "2766692e34161ff27aa2caf253d9ff17", "score": "0.509138", "text": "function nU(a,b,c,g){b=b(c||oU,g);b=Ea(b)?b instanceof PT?R(b):SQ(\"zSoyz\"):SQ(String(b));if(fR())for(;a.lastChild;)a.removeChild(a.lastChild);a.innerHTML=QQ(b)}", "title": "" }, { "docid": "c07d455764da4937a39d94de1969fca9", "score": "0.5090276", "text": "get tr() { return new EditorTransform(this) }", "title": "" }, { "docid": "d884b2e7b3a3b6c434525c6aeb54b7ad", "score": "0.5089904", "text": "function copy_html() {\n var htm = $('#editor').trumbowyg('html');\n htm = htm.replace(/\\r?\\n|\\r/g, \" \");\n // for copying text into clipboard\n const el = document.createElement('textarea');\n el.value = htm;\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n }", "title": "" }, { "docid": "f465d78e4c18f7ac26b13acb3f58482e", "score": "0.50881964", "text": "function add_custom_html_tagsOLD( text , dizionario ) {\n// es: add_custom_html_tags ( \"#placeholder\" , DICTIONARY )\n // cleans up the text to be checked and splits it word by word\n/// var words = text.replace(/[\\.,;!\\?]/g,\" \").split(\" \");\n var words = text.split(\" \");\n var words_testable = text.replace(/(<\\/{0,1}\\w*>)/g, \"\").replace(/[\\.,;!\\?]/g,\" \").split(\" \");\n// var words_testable = text.replace(/(<\\/{0,1}\\w*>)/g, \"\").replace(/\\'.,;!\\?/g, \" \").split(\" \");\n// var words_testable = text.replace(/(<\\/{0,1}\\w*>)/g, \"\").split(/\\b/);\n var new_all = \"\";\n var new_wd;\n // for each word:\n for (var i=0; i < words_testable.length ; i+=1) {\n\t\tconsole.log(\">>>>\"+words[i]+\">>\"+words_testable[i]+\">>\");\n if (!isNullOrEmpty(words_testable[i])) {\n new_wd = words_testable[i].toLowerCase().replace(/[\\W]+/g,\"\");\n // if the (lower-cased) word is in dictionary adds the specific tag, otherwise...\n if ( dizionario.indexOf(new_wd) >= 0 ) {\n new_all += \"<wd onClick=\\'pick_a_word(\\\"\"+new_wd+\"\\\");\\'>\"+words[i]+\"</wd> \";\n// new_all += \"<wd onClick=\\'pick_a_word(\\\"\"+new_wd+\"\\\");\\'>\"+words_testable[i]+\"</wd> \";\n\t\t\t}\n // ... does not add any tag\n else {\n if (!isNullOrEmpty(words[i])) {\n new_all += words[i]+\" \";\n// new_all += words_testable[i]+\" \";\n }\n }\n\t }\n }\n return new_all;\n}", "title": "" }, { "docid": "4ef32b53f766f43a4b591fe11c18e609", "score": "0.5085605", "text": "function tr(t) {\n return hr.js(t, Pr.store);\n }", "title": "" }, { "docid": "93a7f13b8b18830ff12564cbf1ae7b73", "score": "0.5082313", "text": "function text()\n {\n x=document.getElementById(\"kuqe\") // marrim elementin per editim!\n x.style.color=\"purple\"; // dhe ja ndryshojm ngjyren.\n }", "title": "" }, { "docid": "4c4532e30904b5728d5be44b66213e94", "score": "0.50823104", "text": "function createHtml(item){\n console.log('dentro funzione crea html');\n\n const container = document.querySelector('.container');\n //console.log('container', container);\n let prevContent = container.innerHTML;\n\n //destrutturo oggetto icon per accedere alle sue proprietà\n const {name, prefix, family, color} = item;\n\n //definisco struttura html\n prevContent +=\n `\n\t\t<div class=\"box text-center\">\n <i class=\"${family} ${prefix}${name} fs-1\" style=\"color:${color}\"\"></i>\n <h5 class=\"text-uppercase fs-5\">${name}</h5>\n </div> \n \n `;\n\n container.innerHTML = prevContent;\n \n}", "title": "" }, { "docid": "6005bd92b950858dd5001017fb57d2b4", "score": "0.50814813", "text": "function carritoHTML() {\r\n //limpiar el HTML\r\n limpiarHTML();\r\n\r\n //Recorre el arreglo del carrito y genera el HTML\r\n articulosCarrito.forEach(curso => {\r\n const { imagen, titulo, precio, cantidad, id } = curso\r\n\r\n const row = document.createElement('tr');\r\n row.innerHTML = `\r\n <td>\r\n <img src=\"${imagen}\" width=\"100\">\r\n </td>\r\n <td>\r\n ${titulo}\r\n </td>\r\n <td>\r\n ${precio}\r\n </td>\r\n <td>\r\n ${cantidad}\r\n </td>\r\n <td>\r\n <a href=\"#\" class=\"borrar-curso\" data-id=${id}> X </a>\r\n </td>\r\n `;\r\n //agrega al HTML del carrito en el tbody\r\n\r\n contenedorCarrito.appendChild(row);\r\n\r\n })\r\n}", "title": "" }, { "docid": "a0c39de6f3652faaf94dec958b96dbd0", "score": "0.5077428", "text": "function t(e, t, n, r) {\n switch (n) {\n case \"s\":\n return t ? \"хэдхэн секунд\": \"хэдхэн секундын\";\n case \"ss\":\n return e + (t ? \" секунд\": \" секундын\");\n case \"m\":\n case \"mm\":\n return e + (t ? \" минут\": \" минутын\");\n case \"h\":\n case \"hh\":\n return e + (t ? \" цаг\": \" цагийн\");\n case \"d\":\n case \"dd\":\n return e + (t ? \" өдөр\": \" өдрийн\");\n case \"M\":\n case \"MM\":\n return e + (t ? \" сар\": \" сарын\");\n case \"y\":\n case \"yy\":\n return e + (t ? \" жил\": \" жилийн\");\n default:\n return e\n }\n }", "title": "" }, { "docid": "3f7d82891f823357782737c3dcc85bd4", "score": "0.50719017", "text": "convertieTdEnString(td){\n return td.getAttribute('data-ligne') + ' ' + td.getAttribute('data-colonne');\n }", "title": "" }, { "docid": "5d0f02efe0462d6982d8ecb10a4d5cfa", "score": "0.5069886", "text": "function limpiarHTML() {\n // contenedorCarrito.innerHTML = '';\n\n //codigo mejorado*\n while(contenedorCarrito.firstChild) {\n contenedorCarrito.removeChild(contenedorCarrito.firstChild)\n }\n}", "title": "" }, { "docid": "45b3bb5217b992e29e385ecf2cad12fb", "score": "0.50660455", "text": "function pagi() {\n return 'selamat pagai, kamu apa kabar?'\n}", "title": "" }, { "docid": "89bb77846060c57cdb8a98c63e6815ce", "score": "0.5058166", "text": "function indiceScrambleur(lettre){\n\treturn retroScrambleur[positionApresA(lettre)];\n}", "title": "" } ]
6499cf94b7f557d092e94900d883fcb1
This function will set the amount of mines defined for each level on random available locations on the board
[ { "docid": "832277f138be67b2ed946d32bd8e0dc4", "score": "0.77559716", "text": "function setMinesInTheModel() {\r\n var minesAvailable = gLevel.MINES;\r\n var mineX = generateRandomCoordinate(gLevel.SIZE);\r\n var mineY = generateRandomCoordinate(gLevel.SIZE);\r\n while (minesAvailable > 0) {\r\n if (isMine(gBoard, mineX, mineY)) {\r\n mineX = generateRandomCoordinate(gLevel.SIZE);\r\n mineY = generateRandomCoordinate(gLevel.SIZE);\r\n }\r\n else {\r\n minesAvailable--;\r\n gBoard[mineX][mineY].isMine = true;\r\n }\r\n }\r\n}", "title": "" } ]
[ { "docid": "14d1e3f1b7b033eaa8733da073175a5c", "score": "0.75867814", "text": "function setMines() {\r\n\r\n var minesCounter = 0;\r\n\r\n// you shouldn't use while - \r\n//you cant tell how many times it will run\r\n// and we like to make sure how many itterations it will have. \r\n// instead, use a function that get empty cells and put mines in it by randomly picking cells. \r\n// its better, safer and more predictable.\r\n\r\n while (minesCounter < gLevel.MINES) {\r\n var randI = getRandomInteger(0, gBoard.length);\r\n var randJ = getRandomInteger(0, gBoard[0].length);\r\n if (gBoard[randI][randJ].isMine) {\r\n continue;\r\n }\r\n\r\n // not iIdx, you should call it i\r\n\r\n gBoard[randI][randJ].isMine = true;\r\n gMinesIdxs.push({ randI, randJ });\r\n minesCounter++;\r\n }\r\n}", "title": "" }, { "docid": "25b0279d2c2976cd3b14cb9735fe2232", "score": "0.7202808", "text": "function plantMines()\n {\n var i, minesPlanted = 0, x, y;\n\n while (minesPlanted < mines)\n {\n x = getRandomNumber(dimension);\n y = getRandomNumber(dimension);\n\n if (!boardData[x][y].isMine)\n {\n // console.log('BOARD DATA:', boardData[x][y])\n boardData[x][y].setMine(true);\n minesPlanted++;\n }\n\n }\n }", "title": "" }, { "docid": "18a1e02bda5570cbf41e48280bc5cbc4", "score": "0.70131093", "text": "function setMinesNegsCount(board) {\r\n for (var i = 0; i < gLevel.SIZE; i++) {\r\n for (var j = 0; j < gLevel.SIZE; j++) {\r\n var currPos = { i, j };\r\n var currMines = countNegs(currPos);\r\n board[i][j].minesAroundCount = currMines.length;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "85a99025a113c8c21d65e10372177b7a", "score": "0.69848794", "text": "function placeMines (size, minesNum) {\n for (let mines=0; mines<minesNum; mines++) {\n let ranNum1 = parseInt(Math.random() * (size) + 0);\n let ranNum2 = parseInt(Math.random() * (size) + 0);\n let cell = document.getElementById(`[${ranNum1}][${ranNum2}]`);\n if (cell.dataset.mines == 1) mines--;\n else cell.dataset.mines = 1;\n }\n}", "title": "" }, { "docid": "0f79f35dbbabcefb1bca7ae3489b4dc6", "score": "0.6862149", "text": "placeMines_(density) {\n let height = this.getHeight();\n let width = this.getWidth();\n let numTiles = height * width;\n this.numMines_ = Math.floor(density * numTiles);\n this.updateCounters();\n this.tilesLeftToReveal_ = numTiles - this.numMines_;\n // Shuffle 1D array to determine mine positions\n let minePositions = new Array(numTiles).fill(false);\n for (let i = 0; i < this.numMines_; i++) {\n minePositions[i] = true;\n }\n shuffle(minePositions);\n // Map onto tile grid\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n this.grid_[y][x].hasMine = minePositions[y * width + x];\n }\n }\n }", "title": "" }, { "docid": "27afdfd8a661ecc69f9f3d85b7be0908", "score": "0.6829518", "text": "function addMines(mat) {\n var rndIdxs = []\n for (var i = 0; i < mat.length; i++) {\n rndIdxs.push(i);\n }\n for (var i = 0; i < gLevel.mines; i++) {\n var rndI = Math.floor(Math.random() * rndIdxs.length)\n var rndJ = Math.floor(Math.random() * rndIdxs.length)\n mat[rndI][rndJ] = MINE\n }\n var mineCounter = 0;\n // CR: not realy needed. can count on the first loop.\n for (var i = 0; i < mat.length; i++) {\n for (var j = 0; j < mat.length; j++) {\n var cell = mat[i][j];\n if (cell === MINE) mineCounter++\n }\n }\n gState.minesCount = mineCounter;\n}", "title": "" }, { "docid": "bdfcf972d59a7245c3c2cc717c3300e8", "score": "0.6741929", "text": "function putMine() {\n const random = Math.random() * 100;\n\n // nincs akna\n if (random > MAX_MINES_PROBABILITY) {\n return 0;\n }\n\n ++allMines;\n\n return 1;\n}", "title": "" }, { "docid": "6eca0a86899922eb6d04d5e1bda60a81", "score": "0.67076623", "text": "_seedTiles() {\n const { rows, cols } = this.levelConfig;\n let incrementor = 1;\n \n this.boardState.tiles = Array(rows).fill(0).map(\n _ => Array(cols).fill(0).map(_ => incrementor++)\n );\n }", "title": "" }, { "docid": "00290cc1377905198dbc948970a51e53", "score": "0.66586393", "text": "_initGenerateMines() {\n\n let m = __private__.get(this);\n let minesCounter = 0;\n\n // Do this while my minesCounter is less than my mines amount\n while (minesCounter < m.minesAmount) {\n\n // Use random to generate a number between 0 and the buttonContainer.lenght\n let randomMine = Math.floor(Math.random() * m.buttonContainer.length);\n let actualButton = m.buttonContainer[randomMine];\n\n // if that position already have a mine do this\n if (m.buttonContainer[randomMine].hasMine != true) {\n minesCounter++;\n buttonPosition[actualButton.rowPosition][actualButton.colPosition].hasMine = true;\n buttonPosition[actualButton.rowPosition][actualButton.colPosition].addClass(\"ion-gear-b\");\n\n // Call the method that generate the numbers on the buttons on the sides buttons of the mines\n this._initGenerateNumbers(actualButton);\n\n // If the button is a mine remove the classes that are not necesary\n if (buttonPosition[actualButton.rowPosition][actualButton.colPosition].hasMine = true)\n {\n buttonPosition[actualButton.rowPosition][actualButton.colPosition].removeClass(\"game-flag\");\n buttonPosition[actualButton.rowPosition][actualButton.colPosition].removeClass(\"game-btn-selected\");\n }\n // Eliminate the mine from the button container\n m.buttonContainer.splice(actualButton, 1);\n // Add the mine to the mines container\n m.minesContainer.push(actualButton);\n }\n }\n }", "title": "" }, { "docid": "2546c1cc86c23ec72cc5b36222ee85fc", "score": "0.6647546", "text": "initBoardData(row, col, mines) {\n \n let data = [];\n // create empty array \n for (let i = 0; i < row; i++) {\n data.push([]);\n for (let j = 0; j < col; j++) {\n data[i][j] = {\n row: i,\n col: j,\n isMine: false,\n neighbour: 0,\n isRevealed: false,\n isEmpty: false,\n isFlagged: false,\n };\n }\n }\n\n // plant mines\n let randomRow, randomCol, minesPlanted = 0;\n\n while (minesPlanted < mines) {\n randomRow = getRandomNumber(row);\n randomCol = getRandomNumber(col);\n if (!(data[randomRow][randomCol].isMine)) {\n data[randomRow][randomCol].isMine = true;\n minesPlanted++;\n }\n }\n\n // calc number of neighbouring mines for each cell\n for (let i = 0; i < row; i++) {\n for (let j = 0; j < col; j++) {\n if (!data[i][j].isMine) {\n let count = 0;\n const area = this.traverseBoard(data[i][j].row, data[i][j].col, data);\n area.forEach(value => {\n if (value.isMine) {\n count++;\n }\n });\n if (count === 0) {\n data[i][j].isEmpty = true;\n }\n data[i][j].neighbour = count;\n }\n }\n }\n return data;\n }", "title": "" }, { "docid": "0c5760dff48368666c61611eca8463bf", "score": "0.6567821", "text": "function onBodyLoad() {\n\n randomMines = generateRandomMineLocations(noOfMines); \n\n for(let i = 0; i < noOfRows; i++){\n for (let j = 0; j < noOfCellsPerRow; j++){\n addRow(i);\n let cellNo = i*noOfCellsPerRow + j;\n console.log(cellNo);\n addCellToRow(i, j, randomMines.includes(cellNo));\n \n }\n }\n\n for(let i = 0; i < noOfRows; i++){\n for (let j = 0; j < noOfCellsPerRow; j++){\n addMineNumber(i, j);\n }\n }\n\n}", "title": "" }, { "docid": "c239d6b2832daded1272e16164cb7b7a", "score": "0.6543532", "text": "setWalls() {\n let prob = 0;\n for (let r = 0; r < 20; r++) {\n for (let c = 0; c < 20; c++) {\n prob = Math.random();\n if (prob <= .4) // 40%\n this.maze[r][c] = WALL;\n }\n }\n }", "title": "" }, { "docid": "74f46f5953331b05588d56f0a3ae19cc", "score": "0.65057236", "text": "createLevel(){\r\n\t\tlet matrix = [];\r\n\t\tlet row = [];\r\n\t\tthis.score = 100;\r\n\t\tlet objects = 0;\r\n\t\tlet enemies = 0;\r\n\t\tlet items = 0;\r\n\t\tlet obj_per_row = 0;\r\n\t\tlet enem_per_row = 0;\r\n\t\tlet items_per_row = 0;\r\n\t\tfor(let i=0;i<this.levelHeight;i++){ //Generate matrix\r\n\t\t\trow = [];\r\n\t\t\tobj_per_row = 0;\r\n\t\t\tenem_per_row = 0;\r\n\t\t\tlet limit_per_row = Math.floor((Math.random() * (6 - 2 + 1) + 2));\r\n\t\t\tlet limit_per_row_enem = 1;\r\n\t\t\tfor(let j=0;j<this.levelWidth;j++){ //Generate each row\r\n\t\t\t\tif(i == 0 || i == 9){ //Generate horizontal walls\r\n\t\t\t\t\tif(j == 29)\r\n\t\t\t\t\t\trow[j] = \"5\";\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\trow[j] = \"5\";\r\n\t\t\t\t}else if(j == 0){ //Generate vertical walls\r\n\t\t\t\t\trow[j] = \"5\";\r\n\t\t\t\t}else if(j == 29){ //Generate vertical walls\r\n\t\t\t\t\trow[j] = \"5<br>\";\r\n\t\t\t\t}else if(i == 8 && j == 28){ //Generate exit\r\n\t\t\t\t\trow[j] = \"6\";\r\n\t\t\t\t}else if(i == 1 && j == 1){ //Generate player\r\n\t\t\t\t\trow[j] = \"0\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif((Math.random() * (20 - 0 + 1) + 0) >= 18 && objects < 80 && obj_per_row < limit_per_row && i != 2 && j != 2 && i != 7 && i != 27){ //Generate random walls\r\n\t\t\t\t\t\trow[j] = \"5\";\r\n\t\t\t\t\t\tobjects++;\r\n\t\t\t\t\t\tobj_per_row++;\r\n\t\t\t\t\t}else if((Math.random() * (100 - 0 + 1) + 0) >= 85 && enemies < 4 && enem_per_row < limit_per_row_enem && i >= 4 && j >= 4 && i <= 7 && i <= 27){ //Generate random enemies\r\n\t\t\t\t\t\trow[j] = \"2\";\r\n\t\t\t\t\t\tenemies++;\r\n\t\t\t\t\t\tenem_per_row++;\r\n\t\t\t\t\t}else if((Math.random() * (100 - 0 + 1) + 0) >= 90 && items < 3 && items_per_row < 1 && i >= 4 && j >= 4 && i <= 7 && i <= 27){ //Generate random items\r\n\t\t\t\t\t\trow[j] = \"*\";\r\n\t\t\t\t\t\titems++;\r\n\t\t\t\t\t\titems_per_row++;\r\n\t\t\t\t\t}else{ //Fill the remaining places with empty space\r\n\t\t\t\t\t\trow[j] = \"_\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmatrix.push(row);\r\n\t\t}\r\n\t\tthis.currentlevel = matrix;\r\n\t}", "title": "" }, { "docid": "ae5150a917a35bc1f2519dcc1af3531e", "score": "0.6483867", "text": "function placerMine(lvl){ // placer des mines\n var a = Math.random();\n //probabilité que chaque case contienne une mine\n if(lvl==1) var b = 0.10;\n if(lvl==2) var b = 0.13;\n if(lvl==3) var b = 0.16;\n if(lvl==4) var b = 0.19;\n if(lvl==5) var b = 0.22;\n if(lvl==6) var b = 0.25;\n if(lvl==7) var b = 0.28;\n if(lvl==8) var b = 0.31;\n if(lvl==9) var b = 0.34;\n if(lvl==10) var b = 0.37;\n if (a <= b){\n colonne.classList.add(\"mine\");\n nbMines++;\n nbMinesATrouver++;\n }\n }", "title": "" }, { "docid": "94010578519bf6e56b9df635bfbb9676", "score": "0.64739656", "text": "function setMinesNegsCount() {\n for (var i = 0; i < gBoard.length; i++) {\n for (var j = 0; j < gBoard.length; j++) {\n if (gBoard[i][j].isMine === false) {\n gBoard[i][j].minesAroundCount = checkingNegs(gBoard, i, j);\n }\n }\n }\n}", "title": "" }, { "docid": "c1d8fcff642e4acd6cb8f2e473070115", "score": "0.6459473", "text": "function setMinesNegsCount(board) {\n for (let i = 0; i < board.length; i++) {\n for (let j = 0; j < board[0].length; j++) {\n var currCell = board[i][j];\n if (currCell.isMine === true) continue;\n for (let idxi = i - 1; idxi <= i + 1; idxi++) {\n for (let idxj = j - 1; idxj <= j + 1; idxj++) {\n if (idxi < 0 || idxi >= board.length) continue;\n if (idxj < 0 || idxj >= board.length) continue;\n if (board[idxi][idxj].isMine === true) currCell.minesAroundCount++;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "7be03e240b53a5a9a55fe21fb631b0cd", "score": "0.6417207", "text": "function setMinesNegsCount(board, pos) {\n var count = countNegs(board, pos);\n gBoard[pos.i][pos.j].minesAroundCount = count;\n if (gBoard[pos.i][pos.j].element === EMPTY) gBoard[pos.i][pos.j].element = gBoard[pos.i][pos.j].minesAroundCount;\n}", "title": "" }, { "docid": "ebcecb694d57841979be695e4f408d8b", "score": "0.6395742", "text": "function setMinesNegsCount(board) {\n board.forEach(function (cells, i) {\n cells.forEach(function (cell, j) {\n if (cell.value !== MINE_SYMBOL) {\n var nNegs = getNegs(board, i, j);\n if (nNegs > 0) {\n board[i][j].value = nNegs;\n board[i][j].show = false;\n }\n }\n });\n });\n}", "title": "" }, { "docid": "7815e7ceb0b6b2895f835837693a24fe", "score": "0.63660383", "text": "function setLevel(levelIdx) {\n var levels = [\n { size: 4, mines: 2 },\n { size: 6, mines: 5 },\n { size: 8, mines: 15 }\n ]\n gLevel.size = levels[levelIdx].size;\n gLevel.mines = levels[levelIdx].mines;\n localStorage.mineSweeperLevel = levelIdx;\n gBoard = createBoard()\n gState = { isGameOn: true, shownCount: 0, markedCount: 0, time: 0 }\n addMines(gBoard)\n countNegs(gBoard);\n renderBoard(gBoard);\n}", "title": "" }, { "docid": "725b7396d51c4e64a642bbd01925daec", "score": "0.6327948", "text": "_plantMines() {\n\t\tlet mineLocations = new Set();\n\t\tlet randomx, randomy = 0;\n\t\n\t\twhile(mineLocations.size < this.mines) {\n\t\t\trandomx = Math.floor(Math.random() * this.width);\n\t\t\trandomy = Math.floor(Math.random() * this.height);\n\t\t\tconst coord = this.getIndexFromCoords(randomx, randomy);\n\t\t\tmineLocations.add(coord);\n\t\t}\n\t\treturn mineLocations;\n\t}", "title": "" }, { "docid": "5e31141e1923417e90f9cdb6286a8d2a", "score": "0.6323881", "text": "constructor(width, height, mines) {\n /* Sanitize input parameters. */\n width = Number(width);\n height = Number(height);\n mines = Number(mines);\n if (!Number.isInteger(width)) width = 10;\n if (!Number.isInteger(height)) height = 10;\n if (!Number.isInteger(mines)) mines = 10;\n \n /* Validate input parameters. */\n if (width < 1) width = 1;\n if (height < 1) height = 1;\n if (mines > width * height) mines = width * height;\n \n /* Initialize the minefield. */\n this.fieldWidth = width;\n this.fieldHeight = height;\n this.field = new Array(width);\n this.veil = new Array(width);\n for (var x = 0; x < width; x++) {\n this.field[x] = new Array(height);\n this.veil[x] = new Array(height);\n for (var y = 0; y < height; y++) {\n this.field[x][y] = ' ';\n this.veil[x][y] = true;\n }\n }\n \n /* Place mines. */\n var placed = 0;\n while (placed < mines) {\n var x = Math.floor(Math.random() * this.width);\n var y = Math.floor(Math.random() * this.height);\n if (this.field[x][y] == ' ') {\n this.field[x][y] = \"&#128163\";\n placed++;\n }\n }\n \n /* Compute numbers. */\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < height; y++) {\n if (this.field[x][y] == ' ') {\n var count = 0;\n for (var dx = -1; dx <= 1; dx++) {\n for (var dy = -1; dy <= 1; dy++) {\n var x0 = x + dx;\n var y0 = y + dy;\n if (x0 >= 0 && x0 < width && y0 >= 0 && y0 < height)\n count += (this.field[x0][y0] == \"&#128163\" ? 1 : 0);\n }\n }\n this.field[x][y] = '' + count;\n }\n }\n }\n }", "title": "" }, { "docid": "ee8c296abe2fafabed12bd73d439baf2", "score": "0.6229904", "text": "setlevel(){\n var midx = Math.floor(Map_Size / 2);\n var midy = midx;\n var dist = Room.getdistance(midx, midy, this.x, this.y);\n /**Room level */\n this.level = Math.ceil(dist) + 1;\n }", "title": "" }, { "docid": "254bd65fd61f7c96136d6542623d226d", "score": "0.62223345", "text": "increaseLevelAndResetPlayerPosition() {\n // increase the level and shuffle the prizes\n game.newLevel();\n this.x = 3 * cellWidth;\n this.y = 5 * cellHeight - this.heightAdj;\n }", "title": "" }, { "docid": "3789677d4f4dfaf7e1b655725587f5da", "score": "0.61930984", "text": "function layMines() {\n for(let i=0;i<fieldDim;i++) {\n mineField[i] = [];\n for (let j=0;j<fieldDim;j++) {\n //rando = Math.floor(Math.random()*2); //use binary - 50% seed rate\n rando = Math.random() < 0.4; //use boolean - specified seed rate 0.4\n mineField[i][j] = squares[divCount];\n mineField[i][j].dataset.isMine = rando;\n mineField[i][j].dataset.neighbMines = 0;\n mineField[i][j].dataset.row = i;\n mineField[i][j].dataset.column = j;\n mineField[i][j].setAttribute('onClick','play(this)');\n divCount++;\n }\n }\n}", "title": "" }, { "docid": "96d09032be6058598f3b6eea6a472d4e", "score": "0.6185473", "text": "function addMines(mines, i, j) {\n\n var mineReleased = 0;\n while (mineReleased < mines) {\n var currCell = gBoard[randomInt(gGameLevel.size)][randomInt(gGameLevel.size)]\n if (currCell.isMine === false && currCell !== gBoard[i][j]) {\n currCell.isMine = true;\n mineReleased++;\n }\n }\n}", "title": "" }, { "docid": "a8c529e6991497da7962b38b8d1656cb", "score": "0.6185139", "text": "function minepositions(cols, rows, mines, firstPosition) {\n\t\tvar count = 0;\n\t\tvar totalcells = cols * rows;\n\t\tvar random_position;\n\t\tvar minecount = mines;\n\t\t\n\t\tvar positions = [];\n\t\tvar positioncode = [];\n\t\t\n\t\tvar firstRow = firstPosition.substr(0, firstPosition.indexOf('-'));\n\t\tvar firstCol = firstPosition.substr(firstPosition.indexOf('-')+1, firstPosition.length);\n\t\t\n\t\tvar firstVal = ((parseInt(firstRow) - 1) * curcols) + parseInt(firstCol);\t\t\t\n\t\t\n\t\twhile (count < minecount) {\n\t\t\trandom_position = Math.floor((Math.random() * totalcells) + 1);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tif ((positions.includes(random_position) === false) && (random_position !== firstVal))\n\t\t\t{\t\t\t\t\n\t\t\t\tpositions.push(random_position);\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\t\t\t\trandom_position = Math.floor((Math.random() * 10) + 1);\t\t\t\t\n\t\t\t};\n\t\t}\n\t\t\n\t\tvar rowcode;\n\t\tvar colcode;\n\t\tvar poscode = \"\";\n\t\tvar length = positions.length;\n\t\t\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\trowcode = Math.ceil(positions[i] / cols);\n\t\t\t\n\t\t\tif (positions[i] % cols === 0){\n\t\t\t\tcolcode = positions[i] / rowcode;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcolcode = positions[i] % cols;\n\t\t\t}\n\t\t\t\n\t\t\tposcode = String(rowcode) + '-' + String(colcode);\n\t\t\tpositioncode.push(poscode);\n\t\t}\n\t\t\n\t\treturn positioncode;\n\t}", "title": "" }, { "docid": "7a165ad2d862fac972a16c5f6b0653e9", "score": "0.61811155", "text": "initializeLevel () {\n\t\twhile (this.getCurrentGoldScoreInMap() < this.calculateTotalGoldScore()) {\n\t\t\tthis.generateItem('gold');\n\t\t}\n\n\t\tfor (let i = 0; i < this.calculateNumberOfRocks(); i ++) {\n\t\t\tthis.generateItem('rock');\n\t\t}\n\t}", "title": "" }, { "docid": "a081d52f77c93693a92eea313271fe23", "score": "0.61731005", "text": "function manuallyPositionedMines() {\n gManuallOn = gManuallOn ? false : true;\n if (gManuallOn) init();\n if (gMinesByUser === gLevel.MINES) {\n // after all mines are deployed\n startManuallyGame();\n return;\n }\n gMinesByUser = 0;\n gBoard = buildBoard(gLevel.SIZE);\n renderBoardMinesByUser(gBoard, `tbody`);\n gGame.isOn = true;\n}", "title": "" }, { "docid": "dbf48963824c579ae3468e450f092903", "score": "0.61642766", "text": "constructor(width, height, diffuclty) {\n this.field = []\n this.diffuclty = diffuclty\n this.cells = width * height // amount of cells\n this.mines = Math.ceil(diffuclties[diffuclty] * ((this.cells) / 100)) // get amount of mines based of diffuculty, sizes with field size\n this.markedCells = 0 // amount of marked cells\n this.openedCells = 0 // amount of opened cells\n this.gameState = 0\n this.moves = 0\n this.time = 0\n this.intervalEvent\n\n for (let i = 0; i < height; i++) { // First create an array with the desired size\n this.field[i] = []\n for (let j = 0; j < width; j++) {\n this.field[i][j] = new Mine(i, j)\n }\n }\n\n let amountOfMines = this.mines // amount of mines that still need to be assigned\n while (amountOfMines > 0) {\n let i = Math.floor(Math.random() * height) // assign mines to random tiles\n let j = Math.floor(Math.random() * width)\n if (!this.field[i][j].mine) { // make sure tile isnt already a mine\n this.field[i][j].mine = true\n amountOfMines -= 1\n }\n }\n document.getElementById(\"timer\").innerHTML = \"00:00:00\" // reset UI\n document.getElementById(\"moves\").innerHTML = \"Moves: 0\"\n }", "title": "" }, { "docid": "308471dd416c39e0d7c0b5c4a8aef7dd", "score": "0.6155381", "text": "function placingRandomMines(clickedCell) {\n var possibleCells = []\n for (var i = 0; i < gBoard.length; i++) {\n for (var j = 0; j < gBoard.length; j++) {\n if (clickedCell.i === i && clickedCell.j === j) continue\n possibleCells.push({ i: i, j: j })\n }\n }\n for (var i = 0; i < gBoard.length; i++) {\n var selectedCell = possibleCells.splice(getRandomIntInclusive(0, possibleCells.length - 1), 1)[0]\n gBoard[selectedCell.i][selectedCell.j].isMine = true\n }\n}", "title": "" }, { "docid": "9c9661f0e21ec5485d7b4480f4e35d7c", "score": "0.61368096", "text": "tower(fullLevel, startZ, growProb=0.5) {\n this.towerNumber++;\n const connectedTowers=[this.towerNumber];\n // Start at top and go down\n const startSize = random.range(5,7);\n let minCorner = this.forceInBorder(this.randomPosition(),startSize).map((x)=>x-startSize);\n let maxCorner = this.forceInBorder(minCorner.map((x)=>x+startSize));\n\n for (let z=startZ-1; z>=0; z--) {\n this.rectangle(fullLevel[z],[minCorner[0], maxCorner[0]],[minCorner[1],maxCorner[1]],connectedTowers,random.range(10,100));\n this.possibleStairs[z][this.towerNumber]=[];\n\n if (this.towerNumber !== Math.min(...connectedTowers)) {\n let breaker=20\n while (Math.min(...connectedTowers) in this.connectedTowers[z] && Math.min(...connectedTowers) !== this.connectedTowers[z][Math.min(...connectedTowers)] && breaker>0) {\n breaker--;\n connectedTowers.push(this.connectedTowers[z][Math.min(...connectedTowers)]);\n }\n }\n for (let i=0;i<connectedTowers.length;i++) {\n this.connectedTowers[z][connectedTowers[i]] = Math.min(...connectedTowers);\n }\n\n this.possibleStairs[z][this.towerNumber].push([minCorner, maxCorner]);\n\n\n if (random.random()<growProb) {\n if (random.random()>0.5) {\n minCorner = this.forceInBorder(minCorner.map(x=>x-1));\n }\n else {\n maxCorner = this.forceInBorder(maxCorner.map(x=>x+1));\n }\n }\n }\n }", "title": "" }, { "docid": "770fca19d51e0e8b0d5664a77eeabdf7", "score": "0.61276996", "text": "function mineInitializer(quantity) {\n const x = STORAGE.levelsGenerated ? STORAGE.rendWidth / 2 : STORAGE.rendWidth * 1.5;\n const y = STORAGE.levelsGenerated * 1000;\n const width = STORAGE.levelsGenerated ? 2880 : 2880 - STORAGE.rendWidth;\n const height = 1000;\n\n let created = [];\n for(let i = 0; i < quantity; ++i) {\n let coords = mineCoords(x, y, width, height);\n if(!coords) {\n break;\n }\n created.push(new Mine(coords.x, coords.y));\n }\n\n return created;\n}", "title": "" }, { "docid": "b6490d9b688477c3563e58a3ed5ad24c", "score": "0.6103038", "text": "function createGrid(width, height, mines) {\n for (let i = 0; i < (width * height) - mines - 3; i++) {\n const safe = document.createElement('div')\n safeCells.push(safe)\n safeCells[i].classList.add('safe')\n safeCells[i].value = 0\n if (grid.classList.contains('mediumGame')) {\n safeCells[i].classList.add('medium')\n }\n if (grid.classList.contains('hardGame')) {\n safeCells[i].classList.add('hard')\n }\n }\n for (let i = 0; i < 3; i++) {\n const safe = document.createElement('div')\n extraCells.push(safe)\n extraCells[i].classList.add('safe')\n extraCells[i].value = 0\n }\n for (let i = 0; i < mines; i++) {\n const mine = document.createElement('div')\n randomMines.push(mine)\n randomMines[i].classList.add('mine')\n if (grid.classList.contains('mediumGame')) {\n randomMines[i].classList.add('medium')\n }\n if (grid.classList.contains('hardGame')) {\n randomMines[i].classList.add('hard')\n }\n }\n randomMines = randomMines.concat(safeCells)\n\n // * Shuffling Mines\n for (let i = 0; i < randomMines.length; i++) {\n const j = Math.floor(Math.random() * (i + 1))\n const temp = randomMines[i]\n randomMines[i] = randomMines[j]\n randomMines[j] = temp\n }\n randomMines = randomMines.concat(extraCells)\n \n // add shuffled array to grid\n for (let i = 0; i < (width * height); i++) {\n grid.appendChild(randomMines[i])\n cells.push(randomMines[i])\n }\n numberLogic()\n }", "title": "" }, { "docid": "1fcababf52b76bc7b940c46fb4b829bc", "score": "0.6084303", "text": "function setMinesNegsCount(cell) {\n var rowIdx = cell.location.i;\n var colIdx = cell.location.j;\n var negs = countNegs(gBoard, rowIdx, colIdx);\n cell.minesAroundCount = negs;\n}", "title": "" }, { "docid": "b5ee43fff855d63f1d28e6f218bbc029", "score": "0.60733396", "text": "function mineGen(mines) {\r\n // Creating the minefield\r\n var mineField = [];\r\n var width = 9;\r\n var height = 9;\r\n for (var i = 0; i < height; ++i) {\r\n mineField.push(Array(width).fill(0));\r\n }\r\n\r\n // Inserting each mine\r\n var squaresLeft = width * height;\r\n for (var i = 0; i < mines; ++i) {\r\n // Finding where to insert the next mine\r\n var nextSquare = Math.floor(Math.random() * squaresLeft);\r\n var insertX = 0; var insertY = 0;\r\n [insertY, insertX] = nthOpenSquare(mineField, nextSquare);\r\n mineField[insertY][insertX] = -1;\r\n\r\n // Incrementing the mine counts of surrounding squares\r\n for (var j = -1; j <= 1; ++j) {\r\n for (var k = -1; k <= 1; ++k) {\r\n var currY = insertY + j;\r\n var currX = insertX + k;\r\n if ((currY < 0 || currY >= height) || (currX < 0 || currX >= width)) {continue;}\r\n if (mineField[currY][currX] != -1) {\r\n ++mineField[currY][currX];\r\n }\r\n }\r\n }\r\n\r\n // Decrementing the number of squares left, and checking to see if any more mines can be added\r\n --squaresLeft;\r\n if (squaresLeft == 0) {\r\n break;\r\n }\r\n }\r\n\r\n // Translating the board into emojis\r\n var boardStr = '';\r\n for (var i = 0; i < height; ++i) {\r\n for (var j = 0; j < width; ++j) {\r\n boardStr += codeToEmoji(mineField[i][j]);\r\n }\r\n boardStr += '\\n';\r\n }\r\n\r\n return boardStr;\r\n}", "title": "" }, { "docid": "737647954495d306316d719c85555132", "score": "0.60693985", "text": "function loadPowerups() {\r\n var rngArr = [2, 5, null, 1, 1, 2, null, null, 4, null, 3, null, null, null, 4, null, null, null, 4, null, null, null, null, 2, 2];\r\n for(var i = 0; i < 15; i++) {\r\n for(var j = 0; j < 10; j++) {\r\n rng = randomPiece(25);\r\n if(!grid[i][j]){\r\n grid[i][j] = rngArr[rng];\r\n console.log(\"Filled tile\");\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "53e2cd63545fb61d87064f7c258b7c49", "score": "0.6060919", "text": "function addMines() {\n for (let i = 0; i < bombCount; i++) {\n let index = Math.floor(Math.random() * size * size);\n let cell = document.querySelector(`[data-index=\"${index}\"]`);\n cell.setAttribute(\"data-mine\", \"true\");\n if (testMode) {\n console.log(index);\n cell.innerHTML = \"X\";\n revealMines();\n }\n }\n}", "title": "" }, { "docid": "2cbfa22bd487d4a5488fe06903a0b300", "score": "0.6055851", "text": "function generateMines(x,y){\n while(mines.length < numMines){\n var mine = Math.floor(Math.random() * (rows * columns));\n if(mines.indexOf(mine) === -1 &&\n mine != ((x-1)*columns+y-1) && mine != ((x-1)*columns+y) && mine != ((x-1)*columns+y+1) &&\n mine != (x*columns+y-1) && mine != (x*columns+y) && mine != (x*columns+y+1) &&\n mine != ((x+1)*columns+y-1) && mine != ((x+1)*columns+y) && mine != ((x+1)*columns+y+1)){\n mines.push(mine);\n }\n }\n}", "title": "" }, { "docid": "d7ca95208636c1413bf4fe420f7fbe25", "score": "0.60479915", "text": "createPain( board, rows ){\n for (let i=0; i < rows; i++ ){\n const arrAux = [];\n let pos = Math.floor( this.arena[0].length * Math.random() );\n for ( let j = 0; j < this.arena[0].length; j++ ){\n j === pos ? arrAux.push(0) : arrAux.push(5);\n }\n board.arena.push( arrAux );\n board.arena.shift();\n }\n }", "title": "" }, { "docid": "acfe62db73296b06bcb7bba1d33bb696", "score": "0.6019052", "text": "function startGame () {\n\n for (var i = 0; i < board.cells.length; i++) {\n board.cells[i].surroundingMines = countSurroundingMines(board.cells[i]); \n };\n // Don't remove this function call: it makes the game work!\n lib.initBoard()\n}", "title": "" }, { "docid": "ce4cc62df65b060c377698a864b264f7", "score": "0.5963986", "text": "function changelevel() {\n game.level += 1;\n ship = newship();\n createAsteroidBelt(ROID_NUM + getRandomArbitrary(game.level, game.level + 3));\n game.newLevel = true;\n}", "title": "" }, { "docid": "2ffec7db0699d92d207c45cdb552d7ee", "score": "0.59482443", "text": "function randomizeLevel(){\r\n ctx.fillRect(0,0,canvas.width, canvas.height);\r\n var currentPos = new Vector2(0,canvas.height);\r\n for(;currentPos.x <= canvas.width;){\r\n begLength = rndInt(rndLen[0],rndLen[1]);\r\n begColorPos = rndInt(0,colors.length);\r\n maxDepth = rndInt(rndMaxDepth[0],rndMaxDepth[1]);\r\n branching = rndInt(rndBranching[0],rndBranching[1]);\r\n lengthNext = Math.random();\r\n c = 180 / (branching + 1);\r\n branch(currentPos, begLength, 180, begColorPos, 0);\r\n currentPos.x += rndInt(rndNextPos[0], rndNextPos[1]);\r\n }\r\n}", "title": "" }, { "docid": "a8c402069e6bee1d1a2780739830e837", "score": "0.59183943", "text": "function buildBoard(SIZE, MINES) {\n var board = [];\n gMines = MINES;\n var count = 0;\n var num1;\n var num2;\n for (var i = 0; i < SIZE; i++) {\n board[i] = [];\n for (var j = 0; j < SIZE; j++) {\n board[i][j] = '';\n }\n }\n while (MINES > 0) {\n num1 = getRandomInt(0, SIZE);\n num2 = getRandomInt(0, SIZE);\n if (board[num1][num2] !== '💣') {\n board[num1][num2] = '💣';\n MINES--;\n }\n }\n\n for (var i = 0; i < board.length; i++) {\n for (var j = 0; j < board[0].length; j++) {\n count = setMinesNeighborsCount(board, i, j);\n if (count !== 0) board[i][j] = count;\n }\n }\n console.table(board);\n renderBoard(board);\n return board;\n}", "title": "" }, { "docid": "d940d592ccfadd35601df2205426f139", "score": "0.5915451", "text": "function xSpawnLimit() {\n return Math.floor(Math.random()* 15+2)*box;\n}", "title": "" }, { "docid": "3c3f966ab436bf0fe02aebeb8d20440b", "score": "0.5906108", "text": "function startGame () {\n var boardCells = (document.getElementsByClassName('board')[0].children)\n for (var i = 0; i < boardCells.length; i++) {\n addListeners(boardCells[i])\n addCellToBoard(boardCells[i])\n }\n// this is the loop needed to count how far away the mines are\n for (var j = 0; j < board.cells.length; j++) {\n board.cells[j].surroundingMines = countSurroundingMines(board.cells[j])\n }\n}", "title": "" }, { "docid": "f0800b00a144aa1ae47fa8f03de4c09a", "score": "0.58953965", "text": "function initMiners() {\n for (var i = 0; i < numberOfMiners; i++) {\n Miners_player_array[Miners_player_array.length] = new Miners();\n }\n}", "title": "" }, { "docid": "bf347e0479280b5a7605c852509f7410", "score": "0.5868737", "text": "_buildBoard() {\n\t\tthis.mineLocations = this._plantMines();\n\t\t\n\t\tthis.board = [];\n\t\tfor(let y = 0; y < this.height; y++) {\n\t\t\tfor(let x = 0; x < this.width; x++) {\n\t\t\t\tconst coord = this.getIndexFromCoords(x, y);\n\t\t\t\tthis.board.push(new Cell( x, y, this.mineLocations.has(coord), this ));\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5afba8f2ae33762b55d9c5ba400b48ec", "score": "0.58573663", "text": "function randomize(){\n\tboard = Array.matrix(DIM, DIM);\n\tbombcount = 0;\n\tfor(var i = 0; i < DIM; i++){\n\t\tfor(var j = 0; j < DIM; j++){\n\t\t\tif(Math.random() < density/100){\n\t\t\t\tboard[i][j].isBomb = true;\n\t\t\t\tbombcount++;\n\t\t\t}\n\t\t}\n\t}\n\tbombcountspan.html(\"Bombs left: \" + bombcount);\n\tcountSurroundings();\n}", "title": "" }, { "docid": "c6d99fa2b8d723dd4f9caf7f13a70218", "score": "0.5850137", "text": "placeSeedRoom(x, y){\n this.currentRoomWidth = random(2, this.maxRoomSize);\n this.currentRoomHeight = random(2, this.maxRoomSize);\n\n if (x + this.currentRoomHeight > this.mapSize || y + this.currentRoomWidth > this.mapSize){\n x -= 20;\n y -= 20;\n this.entities[0].x -= 20;\n this.entities[0].y -= 20;\n \n }\n\n for (let yPos = y; yPos < y + this.currentRoomHeight; yPos++){\n for (let xPos = x; xPos < x + this.currentRoomWidth; xPos++){\n \n \n this.map[yPos][xPos] = \".\";\n \n }\n \n }\n\n \n\n \n\n \n }", "title": "" }, { "docid": "c12b10213a4b443853eed71af497d1dc", "score": "0.5849006", "text": "function addRandom(num)\n{\n\n //for the size of random tiles added, set that number of tiles to active\n for(var i = 0; i < num;i++)\n { \n\n var x = Math.floor(Math.random() * (columns - 1));\n var y = Math.floor(Math.random() * (rows - 1));\n \n girdArray[x][y] = 1;\n\n\n\n\n }\n\n\n //redrawing the updated board\n mgraphics.redraw();\n\n\n\n}", "title": "" }, { "docid": "8e40590eac19fcc95d6a14be025f5b10", "score": "0.5847923", "text": "function assignRandomms(rows, cols, ms) {\n let msToAssign = ms;\n let msAssigned = 0;\n while (msAssigned < ms) {\n let randomRow = Math.floor(Math.random()*rows) + 1;\n let randomCol = Math.floor(Math.random()*cols) + 1;\n if (board[randomRow][randomCol].value !== 'm') {\n board[randomRow][randomCol].value = 'm';\n msAssigned += 1;\n } \n }\n}", "title": "" }, { "docid": "b3df5005a5bcf167c811450034b9cef7", "score": "0.5838106", "text": "function generateLevel()\n{\n\tEntities.push(new BlockBar(0, getRand(0, 100), getRand(1, 150), 0));\n\tEntities.push(new BlockBar(Entities[Entities.length - 1].EntityWidth + _XBARSPACER, Entities[Entities.length - 1].getYLoc(), Entities[Entities.length - 1].EntityWidth + GameCanvas.width, 1));\n}", "title": "" }, { "docid": "9b6978cff8b1c003137b474cc8b46440", "score": "0.58227116", "text": "placeLandmines()\n {\n let temp = [];\n\n for (let iRow = 0; iRow < this._cells.length; ++iRow)\n {\n let row = this._cells[iRow];\n\n for (let iColumn = 0; iColumn < row.length; ++iColumn)\n {\n temp.push(row[iColumn]);\n }\n }\n\n for (let iMine = 0; iMine < this.getLandmines(); ++iMine)\n {\n let index = Math.floor(Math.random() * temp.length);\n \n temp[index].setLandmine(true);\n\n temp.splice(index, 1);\n }\n }", "title": "" }, { "docid": "f35d2b94be018eb934c74d8d2ac85226", "score": "0.58211863", "text": "TickLevel()\n {\n for(let i =0; i < this.tiles.length; i++)\n {\n this.tiles[i].TickOccupants(this.player, this);\n }\n }", "title": "" }, { "docid": "6a9ae6666f7e35c6af98fec3253e32a7", "score": "0.58163995", "text": "function startGame(x,y){\n generateMines(x,y);\n for(m of mines){\n var i = Math.floor(m/columns);\n var j = m%columns;\n board[i][j]='*';\n }\n generateNumbers();\n}", "title": "" }, { "docid": "e47784997a7a7d939d18df3a5c72c03c", "score": "0.5809764", "text": "addGems() {\n let board = this.state.playerBoard;\n let i = 0;\n\n while (i < this.state.numberOfGems) {\n const row = Math.floor(Math.random() * this.state.numberOfRows);\n const column = Math.floor(Math.random() * this.state.numberOfColumns);\n\n if (board[row][column].isGem === false && board[row][column].isBomb === false && board[row][column].isStart === false) {\n board[row][column].isGem = true;\n i++;\n }\n }\n }", "title": "" }, { "docid": "98b6ded3afaa673610c1e22f65da0451", "score": "0.5807519", "text": "function boardInit() {\n board = [];\n showingCells = [];\n for (let i = 0; i < rowCount; i++) {\n let row = [],\n showingRow = [];\n for (let j = 0; j < rowCount; j++) {\n row.push(0);\n showingRow.push(false);\n }\n board.push(row);\n showingCells.push(showingRow);\n }\n\n for (let i = 0; i < mineCount;) {\n // noinspection JSCheckFunctionSignatures\n let x = parseInt(rowCount * Math.random()),\n y = parseInt(rowCount * Math.random());\n if (board[y][x] !== 9) {\n board[y][x] = 9;\n i++;\n }\n }\n\n for (let y = 0; y < rowCount; y++) {\n for (let x = 0; x < rowCount; x++) {\n if (board[y][x] === 9) continue;\n let count = 0;\n let upAvailable = y - 1 >= 0,\n downAvailable = y + 1 < rowCount,\n leftAvailable = x - 1 >= 0,\n rightAvailable = x + 1 < rowCount;\n if (leftAvailable) {\n if (upAvailable) if (board[y - 1][x - 1] === 9) count++;\n if (downAvailable) if (board[y + 1][x - 1] === 9) count++;\n if (board[y][x - 1] === 9) count++;\n }\n if (rightAvailable) {\n if (upAvailable) if (board[y - 1][x + 1] === 9) count++;\n if (downAvailable) if (board[y + 1][x + 1] === 9) count++;\n if (board[y][x + 1] === 9) count++;\n }\n if (upAvailable) if (board[y - 1][x] === 9) count++;\n if (downAvailable) if (board[y + 1][x] === 9) count++;\n\n board[y][x] = count;\n }\n }\n\n initialized = true;\n\n startTime = new Date();\n}", "title": "" }, { "docid": "4c4c6f63bfb92ae69da99b9f2eed258d", "score": "0.58061033", "text": "function randomize(){\n \tfor(var i = 0; i < randomizeAmount; i++) {\n var x = Math.floor(Math.random() * (cells));\n var y = Math.floor(Math.random() * (cells));\n \t\tif(x != 2 || y != 2) {\n \t\tcheckPosition(board[x][y]);\n \t\t}\n \t}\n \n //Reset moves to 0\n moves = 0; \n moveCounter.innerHTML = pad(moves);\n \n //Reset Time to 0\n totalSeconds = 0;\n secondsLabel.innerHTML = pad(totalSeconds%60);\n\t\t\tminutesLabel.innerHTML = pad(parseInt(totalSeconds/60)); \n \t}", "title": "" }, { "docid": "1b877bb3018894b416d1c186287b07ff", "score": "0.5799797", "text": "function initTiles(){\n\t\t\tvar i = that.row * that.col - 1;\n\t\t\twhile(i > 0){\n\t\t\t\tvar j = Math.floor(Math.random() * i);\n\t\t\t\tvar xi = i % that.row;\n\t\t\t var yi = Math.floor(i / that.row);\n\t\t\t var xj = j % that.row;\n\t\t\t var yj = Math.floor(j / that.row);\n\t\t\t that.swapValueAt(xi, yi, xj, yj);\n\t\t\t --i;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "365731b802f1459649e4cb97d15988be", "score": "0.5794461", "text": "function setPuzzle(){\r\n\tfor(let cells=80;cells>g_blankSpace;cells--){\r\n\t\ttestgrid=ghostgrid;\r\n\t\tconsole.log(\"cells:\"+cells);\r\n\t\t\r\n\t\tlet position=Math.floor(Math.random()*81);//position at random\r\n\t\tlet ghostRow=findRow(position);\r\n\t\tlet ghostCol=findColumn(position);\r\n\t\t\r\n\t\t//if position is already located in blacklist\r\n\t\tif(blacklist.indexOf(position)!==-1){\r\n\t\t\tz++;\r\n\t\t}\r\n\t\t//if blacklist hasn't been given a value\r\n\t\telse if(blacklist===undefined){\r\n\t\t\tblacklist.unshift(position);\r\n\t\t\tghostGrid[ghostRow][ghostCol]=0;\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//checks possible solutions \r\n\t\t\tif(gridSolver(cells,ghostRow,ghostCol)===true){\r\n\t\t\t\tblacklist.unshift(position);\r\n\t\t\t\tghostGrid[ghostRow][ghostCol]=0;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tcells--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconsole.log(\"set complete!\");\r\n}", "title": "" }, { "docid": "c5ab100a4704ac3a04b392d088c3e666", "score": "0.5791354", "text": "function randomValues() {\n var random = Math.random();\n if (random <= 0.1) {\n levelSize = randomInt(7, 9);\n boxNumber = randomInt(2, 4);\n } else if (random <= 0.3) {\n levelSize = randomInt(8, 12);\n boxNumber = 3;\n } else if (random <= 0.7) {\n levelSize = randomInt(9, 13);\n boxNumber = 4;\n } else if (random <= 0.9) {\n levelSize = randomInt(9, 14);\n boxNumber = 5;\n } else if (random <= 0.96) {\n levelSize = randomInt(16, 20);\n boxNumber = randomInt(4, 8);\n } else if (random <= 1) {\n levelSize = randomInt(9, 16);\n boxNumber = randomInt(6, 14);\n }\n}", "title": "" }, { "docid": "4eb48a4fcc02f86c49bd2c8ffa1d5e36", "score": "0.57870984", "text": "function newLevel(currentLevel) {\n //If you wish to update amount of levels, increase here\n var rand = Math.floor(Math.random() * 6);\n if (rand == currentLevel) {\n newLevel(currentLevel);\n } else {\n return rand;\n }\n}", "title": "" }, { "docid": "2061783bdef9a29b746e9d9b87169a45", "score": "0.5785138", "text": "function grow(nodes) {\r\n if(resettingMedium) {\r\n nodes = initialState();\r\n furthest = 0;\r\n resettingMedium = false;\r\n //console.log(nodes);\r\n }\r\n //console.log(nodes);\r\n // Stop growing if we have over 250 cells\r\n if (nodes.length < maxColonySize) {\r\n var newNodes = [];\r\n // For each existing cell, there is some probability of splitting\r\n nodes.forEach(function(n) {\r\n // Only split with a certain probability\r\n if (Math.random() < n.splitprob) {\r\n // Establish the new cell's position next to the old one's\r\n // Nearly equiaxially to the old one\r\n var nx = n.x,\r\n ny = n.y;\r\n var mag = Math.sqrt(Math.pow(nx,2) + Math.pow(ny, 2));\r\n var rnx = cellRadius * (Math.random() - 0.5) * 2;\r\n var rny = cellRadius * (Math.random() - 0.5) * 2;\r\n nx = nx + cellRadius * Math.cos(n.angle);\r\n ny = ny + cellRadius * Math.sin(n.angle);\r\n\r\n mag = Math.sqrt(Math.pow(nx, 2) + Math.pow(ny, 2));\r\n if (mag > furthest) {\r\n furthest = mag;\r\n }\r\n\r\n //var nx = Math.random() * cellRadius * 2;\r\n //var ny = Math.random() * cellRadius * 2;\r\n\r\n\r\n //var nx = Math.random() * 10;\r\n // var ny = Math.random() * 10;\r\n\r\n newNodes.push({\r\n radius: cellRadius - 2,\r\n x: nx,\r\n y: ny,\r\n splitprob: 1,\r\n age: 1,\r\n // New cells have similar but slightly different angles to their parents\r\n angle: n.angle + (Math.random() - 1) * Math.PI / 3,\r\n color: n.color\r\n }); \r\n }\r\n });\r\n\r\n nodes = nodes.concat(newNodes); // Add new nodes to existing dataset\r\n\r\n //Scale splitprob based on how far out cells are and their age\r\n nodes.forEach(function(n) {\r\n var mag = Math.sqrt(Math.pow(n.x, 2) + Math.pow(n.y, 2));\r\n n.splitprob = Math.pow(n.age, agePower) * Math.pow(Math.min(mag / furthest, 1), distancePower);\r\n //console.log(n.splitprob);\r\n n.age = n.age * agingFactor;\r\n });\r\n }\r\n else {\r\n // Recalling reset(grow()) once we exceed a certain colony size\r\n timer.stop();\r\n growing = false;\r\n }\r\n return nodes;\r\n }", "title": "" }, { "docid": "522ef88f3438aa73fc637a2ceddd2a4a", "score": "0.5782723", "text": "setDifficulty(level) {\n level = Math.floor(level);\n\n if (level != this.difficulty) {\n this.difficulty = level;\n\n if (this.difficulty <= 1.9) {\n this.MAX_NUMBER_OVO = 10;\n console.log(\"NIVEL UNO\");\n } else if (this.difficulty <= 2.9) {\n this.MAX_NUMBER_OVO = 20;\n console.log(\"NIVEL DOS\");\n } else {\n this.MAX_NUMBER_OVO = 40;\n console.log(\"NIVEL TRES\");\n }\n\n if (this.currentOvo > this.MAX_NUMBER_OVO) {\n for (let index = 0; index < this.ovoList.length; index++) {\n this.model.remove(this.ovoList[index]);\n this.ovoList[index] = 0;\n }\n\n this.currentOvo = 0;\n\n let contList = 0;\n while (contList < (Math.floor(this.MAX_NUMBER_OVO * 0.2))) {\n const rand = Math.floor(Math.random() * 20);\n if (this.ovoList[rand] !== 1) {\n this.ovoList[rand] = 1;\n contList++;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "530bbd690de9c524132e816a1ef1e044", "score": "0.57797915", "text": "function assignHands() {\n player1Score = parseInt(Math.random()*10)%3;\n player2Score = parseInt(Math.random()*10)%3;\n}", "title": "" }, { "docid": "fb732a7fb649307ef860831a5b2034f0", "score": "0.57731044", "text": "function add_random_tile() {\n var unused_tiles = [];\n for(var i = 0; i < TILE_COUNT; ++i) {\n if(tiles[i].val === 0) {\n unused_tiles.push(i);\n }\n }\n\n var rand_tile = unused_tiles[Math.floor(Math.random() * unused_tiles.length)];\n var rand_val = Math.floor(Math.random() * 11) < 2 ? 4 : 2;\n\n tiles[rand_tile].tile_div = create_tile_div();\n tiles[rand_tile].val = rand_val;\n }", "title": "" }, { "docid": "10e822b5de1e8e2460bf58d573d1425d", "score": "0.57699376", "text": "function generate(level) {\r\n //level 1 -> easy, 2 -> medium, 3 -> hard\r\n if (null==level)\r\n level=2;\r\n if(level<1 || level>3)\r\n level=2;\r\n var cells = newCells();\r\n \r\n var max=Math.floor(Math.random()*5)+(4-level)*10;\r\n \r\n cells[0][1]={value:2, read_only:false, color:\"#000000\"};\r\n cells[0][5]={value:5, read_only:false, color:\"#000000\"};\r\n cells[0][7]={value:3, read_only:false, color:\"#000000\"};\r\n cells[0][8]={value:1, read_only:false, color:\"#000000\"};\r\n cells[1][1]={value:3, read_only:false, color:\"#000000\"};\r\n cells[1][4]={value:4, read_only:false, color:\"#000000\"};\r\n cells[1][7]={value:8, read_only:false, color:\"#000000\"};\r\n cells[1][8]={value:7, read_only:false, color:\"#000000\"};\r\n cells[2][2]={value:6, read_only:false, color:\"#000000\"};\r\n cells[2][7]={value:5, read_only:false, color:\"#000000\"};\r\n \r\n \r\n var template=solution(cells,false);\r\n //randomizing the transformation\r\n do\r\n {\r\n var transformer=generateTransformer();\r\n template.cells=transformTemplate(template.cells,transformer);\r\n } while (Math.floor(Math.random()*9)!=1);\r\n Template=template;\r\n \r\n cells = newCells();\r\n var ind=0;\r\n while(ind<max) {\r\n var i=Math.floor(Math.random()*9);\r\n var j=Math.floor(Math.random()*9);\r\n if (cells[i][j].value == 0) {\r\n cells[i][j].value=template.cells[i][j].value;\r\n cells[i][j].read_only=true;\r\n //cells[i][j].color=\"#999999\";\r\n ind++;\r\n }\r\n }\r\n \r\n setDataToCells(cells);\r\n startTimer();\r\n}", "title": "" }, { "docid": "944691c54532f77b2a7c4e332d151dca", "score": "0.5765666", "text": "setEnemySpawns()\n {\n for(let i = 0; i < this.numEnemies; i++)\n {\n let enemy;\n\n // Find a random cell within the bounds of the room to place an enemy\n let row = Math.floor(Math.random() * this.bounds.length);\n let col = Math.floor(Math.random() * this.bounds[row].length);\n\n while(this.checkSurrounding(row, col, [cellTypes.exit]) != \"0000\" || this.bounds[row][col] != 1)\n {\n row = Math.floor(Math.random() * this.bounds.length);\n col = Math.floor(Math.random() * this.bounds[row].length);\n }\n\n let xPos = col * this.cellWidth + this.baseCellX + this.cellWidth / 2;\n let yPos = row * this.cellHeight + this.baseCellY + this.cellHeight / 2;\n\n enemy = new Enemy(xPos, yPos, this);\n this.enemies.push(enemy);\n }\n }", "title": "" }, { "docid": "4101ed209fcc930778d7a7eed21f9f88", "score": "0.57467264", "text": "updateTetrisBag(tetrisBag) {\r\n let next = tetrisBag.next;\r\n let stats = tetrisBag.appear.stats;\r\n let selectable = new Array(stats.length).fill(0);\r\n let q = 0;\r\n let min = stats[0];\r\n selectable[q] = 0;\r\n for (let i = 1; i < stats.length; i++) {\r\n if (stats[i] === min) {\r\n q++;\r\n selectable[q] = i;\r\n }\r\n if (stats[i] < min) {\r\n min = stats[i];\r\n q = 0;\r\n selectable[q] = i;\r\n }\r\n }\r\n --q;\r\n\r\n tetrisBag.appear.min = min;\r\n if (min >= 10) {\r\n for (let i = 0; i < stats.length; i++) {\r\n stats[i] -= min;\r\n }\r\n }\r\n\r\n this.rollForNextPiece(tetrisBag);\r\n tetrisBag.bag[next] = selectable[Math.floor(Math.random() * (q + 1))];\r\n }", "title": "" }, { "docid": "7393baed8d7ccf1743911b2f06e1a55c", "score": "0.5746122", "text": "function random() {\n init();\n setStartingPopulation(Math.ceil((sizeX * sizeY) / 5));\n reDraw(true);\n}", "title": "" }, { "docid": "25c53c7142f922b73c82c00058666efa", "score": "0.57409763", "text": "function newLevel() {\n //read level size and box number values\n inGame ? randomValues() : readHtmlValues();\n setHtmlValues();\n currentLvl = new Level(levelSize, levelSize, boxNumber);\n //randomly remove walls from the level\n currentLvl.rip(randomInt(-2, 5));\n //generate level\n generatePaths(currentLvl);\n\n //if the level is unsolvable, generate a new level\n if (currentLvl.trash) {\n newLevel();\n console.log(\"trashlevel\");\n } else {\n levelNumber++;\n activeSpots = [];\n document.getElementById(\"optimizeButton\").style.visibility = \"visible\";\n\n //randomly optimize the level if in game\n if (inGame && boxNumber < 6) {\n optimize(randomInt(-1000, 1000));\n }\n active = true;\n win = false;\n drawAll();\n }\n}", "title": "" }, { "docid": "8260b9b5b798d00b0dceb350287bd9a4", "score": "0.57321995", "text": "function assignAdjMines() {\n for (var i = 0; i < boardDimensions; i++) {\n for (var j = 0; j < boardDimensions; j++) {\n var currentCell = board[i][j];\n currentCell.row = i;\n currentCell.column = j;\n if (currentCell.mine) {\n currentCell.adjMines = null;\n }\n else {\n checkNeighbours(i, j).forEach(function(neighbour) {\n neighbour.mine && (currentCell.adjMines += 1);\n })\n }\n } \n }\n}", "title": "" }, { "docid": "984efca90b2d8368bf5b0cbb91c7d47b", "score": "0.5728961", "text": "function initMap(){\n\n\tmap = [];\n\n\t//initialise map (make 2d, then fill with walls)\n\tfor(let x = 0; x < mapSize; x++){\n\t\tmap[x] = [];\n\t\trooms = [];\n\t\tfor(let y = 0; y < mapSize; y++){\n\t\t\tmap[x][y] = Tile.WALL;\n\t\t}\n\t}\n\n\t//these values prevent it from trying to place rooms on the perimeter\n\tlet minXY = 2;\n\tlet maxXY = mapSize-3;\n\tlet roomsLeftToBePlaced = numRooms;\n\n\t//loop continues until all rooms have been placed\n\twhile(roomsLeftToBePlaced > 0){\n\n\t\tlet x = Math.floor(Math.random() * (maxXY - minXY + 1)) + minXY;\n\t\tlet y = Math.floor(Math.random() * (maxXY - minXY + 1)) + minXY;\n\n\t\tlet validRoom = false;\n\t\t//find a spot for valid room\n\t\twhile(!validRoom){\n\t\t \tif(map[x][y] != Tile.FLOOR){\n\t\t \t\t//check that you can fit a 3x3 room at this location\n\t\t \t\tvalidRoom = checkValidRoomSize(x, y);\n\t\t \t\tif(!validRoom){\n\t\t \t\t\t//try new location\n\t\t \t\t\tx = Math.floor(Math.random() * (maxXY - minXY + 1)) + minXY;\n\t\t\t\t\ty = Math.floor(Math.random() * (maxXY - minXY + 1)) + minXY;\n\t\t \t\t} \n\t\t \t}\n\t\t \telse{\n\t\t \t\t//try new location\n\t\t \t\tx = Math.floor(Math.random() * (maxXY - minXY + 1)) + minXY;\n\t\t\t\ty = Math.floor(Math.random() * (maxXY - minXY + 1)) + minXY;\n\t\t \t}\n\t\t}\n\n\t\t//change the valid tiles from WALLs to FLOORs\n\t\tmap[x-1][y-1] = Tile.FLOOR;\n\t\tmap[x][y-1] = Tile.FLOOR;\n\t\tmap[x+1][y-1] = Tile.FLOOR;\n\t\tmap[x-1][y] = Tile.FLOOR;\n\t\tmap[x][y] = Tile.FLOOR;\n\t\tmap[x+1][y] = Tile.FLOOR;\n\t\tmap[x-1][y+1] = Tile.FLOOR;\n\t\tmap[x][y+1] = Tile.FLOOR;\n\t\tmap[x+1][y+1] = Tile.FLOOR;\n\n\t\tlet currentRoom = numRooms - roomsLeftToBePlaced; \n\n\t\t//create new Room object and fill its tile array\n\t\tlet room = new Room(currentRoom);\n\t\troom.tiles[0] = [{x: x-1, y: y-1}, {x: x, y: y-1}, {x: x+1, y: y-1}];\n\t\troom.tiles[1] = [{x: x-1, y: y}, {x: x, y: y}, {x: x+1, y: y}];\n\t\troom.tiles[2] = [{x: x-1, y: y+1}, {x : x, y: y+1}, {x: x+1, y: y+1}];\n\n\t\t//add new room to rooms array\n\t\trooms[currentRoom] = room;\n\n\t\troomsLeftToBePlaced--;\n\t}\n}", "title": "" }, { "docid": "09a86d668ad93e31d285005c9fd1324d", "score": "0.5726272", "text": "function poner_obstaculos(count){\n\tfor(var c=0;c<count;){\n\t\tvar random_x = Math.floor(Math.random()*(config.grid_size-2))+1;\n\t\tvar random_y = Math.floor(Math.random()*(config.grid_size-2))+1;\n\t\tif(squares[random_x][random_y] == 0){\n\t\t\tsquares[random_x][random_y] = 4;\n\t\t\tc++;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b76bfd8dc9362e4cb6ec48c61e4a9d68", "score": "0.57156736", "text": "function place_obstacles(count){\r\n\tfor(var c=0;c<count;){\r\n\t\tvar random_x = Math.floor(Math.random()*(config.grid_size-2))+1;\r\n\t\tvar random_y = Math.floor(Math.random()*(config.grid_size-2))+1;\r\n\t\tif(squares[random_x][random_y] == 0){\r\n\t\t\tsquares[random_x][random_y] = 4;\r\n\t\t\tc++;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "791745c200c712366dd2b5b9ef3f0e30", "score": "0.5715348", "text": "function setLevelMax() {\n const levelCells = $(\".level-cell\");\n\n // iterate over all level cells\n levelCells.each(function (ind) {\n if (ind < levels.length) {\n $(this).removeClass(\"locked\"); // make sure no cell has been left locked, later we refresh locked cells\n\n // CREATE PROGRESSBAR\n if (app.game_max_points[ind]) {\n // create a progress div\n const\n progress = document.createElement(\"div\"),\n progressBar = $(this).find(\".level-progressbar\"),\n percent = Math.min(\n Math.floor(\n ((app.game_max_points[ind] / levels[ind].targetPoints) || 0) * 100\n ), 100);\n\n let className = \"\";\n\n switch (true) {\n case percent <= 0: { className = \"zero\"; break; }\n case percent >= 1 && percent < 25: { className = \"under-twentyfive-percent\"; break; }\n case percent >= 25 && percent < 50: { className = \"under-fifty-percent\"; break; }\n case percent >= 50 && percent < 75: { className = \"under-seventyfive-percent\"; break; }\n case percent >= 75 && percent < 100: { className = \"under-hundred-percent\"; break; }\n case percent >= 100: { className = \"maxed\"; }\n } // end of switch percent\n\n\n $(progress)\n .removeClass()\n .addClass(\"progress \" + className) // different color for different percentage\n .css(\"width\", percent + \"%\");\n\n $(progressBar)\n .empty() // so it won't be duplicated, if function is called multiple times\n .append(progress);\n } // end of there is any progress so far\n\n\n // ADD PADLOCKS\n const\n lockedFrom = !app.game_max_points[app.game_max_points.length - 1]\n ? app.game_max_points.length\n : app.game_max_points.length + 1;\n\n // if previous level has been completed aka its level max is not 0 or undefined\n if (ind >= lockedFrom) {\n $(this).addClass(\"locked\");\n } // end of locked cells\n } // end of level cell has a valid level\n }); // end of level cell iteration\n}", "title": "" }, { "docid": "6dd46b5dbc6f232ae90d4714875a47b8", "score": "0.57095", "text": "function generateRandomNum() {\r\n //Loop to create the ships\r\n for (let n = 0; n < 3; n++) {\r\n //Generate random location on grid\r\n let locationRow = Math.randomInt(0, cpuRowMax);\r\n let locationCol = Math.randomInt(cpuColMin, cpuColMax);\r\n //Change the restrictions on each ship\r\n cpuRowMax = cpuRowMax - 1;\r\n cpuColMin = cpuColMax + 2;\r\n cpuColMax = cpuColMax + 2;\r\n //Change shipId along with loop\r\n let shipId = Number(1 + n);\r\n //Assign ship Id\r\n cpuGrid[locationRow][locationCol] = shipId;\r\n //Change the number of coordinates\r\n let numCoor = Number(3 + n);\r\n //Draw each coordinate\r\n for (let i = 1; i < numCoor; i++) {\r\n let loc2 = locationRow + i;\r\n cpuGrid[loc2][locationCol] = shipId;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "238f79ae95f4b0bb65ecf8d05b89d0e4", "score": "0.57078636", "text": "function populateRandomBoard(board, pct = 50) {\n let rand;\n for (let i = 0; i < board.grid.length; i++) {\n for (let j = 0; j < board.grid.length; j++) {\n rand = Math.random();\n if (rand > pct/100) {\n board.grid[i][j] = 0;\n } else {\n board.grid[i][j] = 1;\n board.numLiving += 1;\n }\n }\n }\n board.percentage = pct;\n}", "title": "" }, { "docid": "5ebea9e5f4984e0ff443bdf39f5785cc", "score": "0.57055074", "text": "function placeMines() {\n console.log(firstSquare)\n let firstSquareId = parseInt(firstSquare.getAttribute('id').substr(2),10)\n for (i = 0; i < allMarkers; i++) {\n values.push(\"mine\")\n }\n console.log(`The array has ${values.length} mines`)\n for (i = 0; i < ((numColumns * numRows) - allMarkers - 1); i++) {\n values.push(\"tbd\")\n }\n //shuffle the array\n let currentIndex = values.length, temporaryValue, randomIndex;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = values[currentIndex];\n values[currentIndex] = values[randomIndex];\n values[randomIndex] = temporaryValue;\n }\n //push shuffled values to array and recombine, mixing in the first click\n console.log(`The first square clicked was ${firstSquareId}`)\n console.log(values.slice(0,(firstSquareId - 1)))\n finalValues.push(values.slice(0,(firstSquareId - 1)))\n console.log(finalValues[0].length)\n finalValues.push([\"tbd\"])\n finalValues.push(values.slice((firstSquareId - 1)))\n values = finalValues[0].concat(finalValues[1],finalValues[2])\n console.log(`The array has ${values.length} values`)\n console.log(values)\n startTimer()\n}", "title": "" }, { "docid": "83cdfc84d2d208bba5b09ada216bce8d", "score": "0.570234", "text": "function setLevel() {\n\n var level = player.level;\n var levelMarker = document.getElementById('levelMarker');\n levelMarker.innerHTML = level;\n\n var enemyRules = void 0;\n\n if (level === 1) {\n enemyRules = {\n 'speed': {\n 'high': 200,\n 'low': 100\n },\n 'toxicChance': 0\n };\n } else if (level === 2) {\n enemyRules = {\n 'speed': {\n 'high': 280,\n 'low': 130\n },\n 'toxicChance': 0.1\n };\n } else if (level === 3) {\n enemyRules = {\n 'speed': {\n 'high': 300,\n 'low': 160\n },\n 'toxicChance': 0.2\n };\n } else if (level === 4) {\n enemyRules = {\n 'speed': {\n 'high': 340,\n 'low': 200\n },\n 'toxicChance': 0.3\n };\n } else if (level === 5) {\n enemyRules = {\n 'speed': {\n 'high': 400,\n 'low': 250\n },\n 'toxicChance': 0.4\n };\n }\n\n setEnemies(enemyRules);\n}", "title": "" }, { "docid": "24769b71d95cbc3111a605203bdbbd38", "score": "0.5687031", "text": "getItemSpawnWeights() {\n // Radius is a scalar to this.width.\n const bell = (p1, p2, radius) => {\n const dist = p1.sub(p2).norm() / this.width;\n const exp = Math.pow(2 * dist / radius, 2);\n return Math.pow(2, -exp);\n };\n \n // Get all valid target-spawn positions:\n let choices = this.grid.filter((tile) => {\n return (!(this.isCharacter(tile)) && \n !(this.targets.includes(tile.pos)))\n }, this);\n choices = choices.map((tile) => tile.pos);\n let center = new Pos(\n Math.floor(this.width / 2),\n Math.floor(this.width / 2));\n \n // Favor the center and bias against \n const weights = new Map();\n for (let chPos of choices) {\n const playersWeight = this.livePlayers.map((player) => \n bell(player.pos, chPos, 1/3)).reduce((a, b) => a + b);\n \n weights.set(chPos, \n 5/3 * bell(center, chPos, 0.8) +\n (playersWeight / this.livePlayers.length) + \n bell(this.nommer, chPos, 1/3)\n );\n }\n return weights;\n }", "title": "" }, { "docid": "a6a95f2e8d860f95ac7813f08364f94d", "score": "0.56857336", "text": "drawTiles() {\n while (this.tiles.length < 4) {\n const availableTiles = game.getAvailableTiles();\n const tile = availableTiles[Math.floor(Math.random() * availableTiles.length)];\n\n tile.player = this;\n tile.position = this.tiles.length - 1;\n }\n\n this.tiles.forEach(tile => tile.init());\n }", "title": "" }, { "docid": "1ac26e720ac8e9a005fe033fb2e626a4", "score": "0.5685285", "text": "function setup(){\n createCanvas(SCREEN, SCREEN);\n grid = makeGrid(cols, rows);\n for(let i = 0; i < cols; i++){\n for(let j = 0; j < rows; j++){\n grid[i][j] = new Cell(i, j, w);\n }\n }\n\n // add mines\n let options = [];\n for(let i = 0; i < cols; i++){\n for(let j = 0; j < rows; j++){\n options.push([i, j]);\n }\n }\n\n for(let m = 0; m < mines; m++){\n let idx = Math.floor(random(options.length));\n let choice = options[idx];\n let x = choice[0],\n y = choice[1];\n options.splice(idx, 1);\n grid[x][y].mine = true;\n }\n\n // count squares\n for(let i = 0; i < cols; i++){\n for(let j = 0; j < rows; j++){\n grid[i][j].countNeighbors();\n }\n }\n\n}", "title": "" }, { "docid": "2a6cd93cde80353081e75f71cefa7f80", "score": "0.56792843", "text": "function setGrid() {\n grid = new Array(rows * cols);\n\n let maxFruits = 6, fruits = 0;\n for (let y = 0; y < gridData.length; y++) {\n let r = gridData[y];\n\n for (let x = 0; x < r.length; x++) {\n let w = r[x]\n if (w === 1) {\n grid[y * cols + x] = new Wall({x, y})\n } else if (w === 0) {\n if (random() < .02 && fruits < maxFruits) {\n grid[y * cols + x] = new Fruit({x, y});\n fruits++;\n } else grid[y * cols + x] = new Dot({x, y});\n } else {\n grid[y * cols + x] = new FieldElement();\n }\n }\n }\n\n leftToWin = grid.filter(g => {\n return g instanceof Dot;\n }).length\n}", "title": "" }, { "docid": "56edeb7a7e323bdde963c95068cf9a3e", "score": "0.5677583", "text": "function init () {\n board = new Array(boardDimensions).fill(null);\n board.forEach(function(elem, idx) {\n elem = new Array(boardDimensions).fill(null);\n elem = elem.map(function() {\n return new Cell(false, null, false, false);\n });\n board[idx] = elem;\n })\n\n time = 0;\n runTimer = false;\n $('.timer').html(`00:00`)\n \n numFlagged = 0;\n winner = null;\n gameOver = null;\n randomMinePlacement(boardDimensions);\n assignAdjMines();\n\n render();\n}", "title": "" }, { "docid": "f82687ff971338142752a5bd5ae102d1", "score": "0.56565624", "text": "function initGame(n) {\n //initiate gameboard\n var myBoard = new gameboard();\n //array of colors for blocks\n //['blue','red','green','purple','yellow']\n //color counts\n var colorCounts = Array.apply(null, new Array(colors.length))\n .map(Number.prototype.valueOf,0); \n var max = 4;\n //construct board of blocks\n var x; var y;\n for(x=0; x<n; x++) {\n for(y=0; y<n; y++) {\n if(y===0 && x===n-1) { //top right\n tempBlock = new block(x,y,'white');\n tempBlock.isBlank = true;\n myBoard.blank = tempBlock;\n } \n else {\n //get a number (corresponding to color) randomly up to max number \n var cn = Math.floor((Math.random() * colors.length));\n while( colorCounts[cn] >= max ) { \n cn = Math.floor((Math.random() * colors.length));\n }\n colorCounts[cn] += 1;\n var blockColor = colors[cn];\n tempBlock = new block(x,y,blockColor);//colors[(x+y)%6]); \n }\n var keyStr = x+'_'+y;\n myBoard.blocks[keyStr] = tempBlock;\n }\n }\n return myBoard;\n}", "title": "" }, { "docid": "860daac4425def949b6826cae17ddb88", "score": "0.565261", "text": "function setUpLevel(){\n\t \n\t \n\t \n\t console.log('Set Up Level function CALLED');\n\t \n\t \n\t //sets up random location for rocks and mothership\n\t var randomX, randomY;\n\t \n\t //increases level by 1\n\t currentLevel += 1;\n\t \n\t //checks if game is over\n\t if(currentLevel > lastLevel){\n\t userBeatGame = true;\n\t return;\n\t }\n\t \n\t if(currentLevel == lastLevel){\n\t finalLevelSound.play();\n\t }else{\n\t //begins normal soundtrack \n\t\t\t soundTrack.play();\n\t }\n\t\t\t\n\t //resets enemy killed and rocks destroyed counter and ship lives\n\t enemiesKilled = 0;\n\t rocksDestroyed = 0;\n\t if(currentLevel == 1){\n\t shipLives = 4;\n\t }\n\t //sets up number of rocks and enemies that will be displayed\n\t levelEnemies = currentLevel+1;\n\t levelRocks = currentLevel+2;\n\t \n\t //checks to see if the level rocks and enemies exceed total in pool.\n\t levelEnemies = (levelEnemies>=totalEnemies)? totalEnemies : levelEnemies;\n\t levelRocks = (levelRocks>=totalRocks)? totalRocks : levelRocks;\n\t \n\t //centers ship and hide all of its missiles\n\t playerShip.spawn(centerX, centerY);\n\t \n\t //kill off any alive rocks and enemies\n\t perksPool.hideItems();\n\t enemyShipsPool.hideItems();\n\t meteorPool.hideItems();\n\t \n\t //inits the rocks\n\t for(var i=0; i<levelRocks; i++){\n\t randomX = Math.floor(Math.random()*(mainCanvas.width-50)),\n\t randomY = Math.floor(Math.random()*(mainCanvas.height-50));\n\t meteorPool.get(randomX, randomY, \"largeRock\");\n\t meteorPool.get(randomX, randomY, \"smallRock\");\n\t }\n\t \n\t for(var h=0; h<levelPerks; h++){\n\t randomX = Math.floor(Math.random()*(mainCanvas.width-50)),\n\t randomY = Math.floor(Math.random()*(mainCanvas.height-50));\n\t perksPool.get(randomX, randomY, \"life\");\n\t perksPool.get(randomY, randomX, \"shield\");\n\t }\n\t \n\t //alienMothership.init(\"alien\");\n\t alienMothership.spawn(randomX, randomY);\n\t alienMothership.shield.active = true;\n\t alienMothership.setRelease(levelEnemies, 8);\n\t \n\t updateCounter('level');\n\t updateCounter('life');\n\t updateCounter('score');\n\t \n\t }", "title": "" }, { "docid": "874253cbe85ad37bdfd9059d24997c1d", "score": "0.5651692", "text": "function placeMines(cols, rows, mines, firstMove) {\n\t\t// The positions of the mines\n\t\t// and the values for the board\n\t\tvar positioncode = minepositions(cols, rows, mines, firstMove);\t\t\n\t\tblockval = blockvalues(positioncode, cols, rows);\n\t\t\n\t\tfor (var k = 1; k <= rows; k++) {\t\t\t\t\t\t\n\t\t\tfor(var j = 1; j <= cols; j++)\n\t\t\t{\n\t\t\t\tvar compare = String(k) + '-' + String(j);\n\t\t\t\t\n\t\t\t\tvar curId = \"#\" + compare;\n\t\t\t\t// Square is a mine\n\t\t\t\tif (positioncode.includes(compare) === true){\n\t\t\t\t\t$(curId).addClass(\"mine\");\n\t\t\t\t\tdocument.getElementById(compare).value = -100;\n\t\t\t\t}\n\t\t\t\t// Square is not a mine\n\t\t\t\telse {\n\t\t\t\t\t$(curId).addClass(\"square\");\n\t\t\t\t\tdocument.getElementById(compare).value = blockval[k][j];\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a975b60155abda049b2b7ff3cf7cb8dd", "score": "0.5647955", "text": "function applyActiveTiles()\n{\n var currentActiveInRow : int = 0;\n \n var currentCol : int = 0;\n var currentRow : int = 0;\n\n for (var i=0; i<rows; i++)\n {\n var arr = [];\n arr = tileList[i];\n\n do\n {\n var range : int = Random.Range(0, cols);\n if (arr[range] == 0)\n {\n arr[range] = 1;\n tileList[i] = arr;\n \n currentActiveInRow++;;\n }\n\n }\n\t\t\n while (currentActiveInRow < activeTilesPerRow);\n\t\tcurrentActiveInRow = 0;\n }\n}", "title": "" }, { "docid": "d1b8a6ace15285b03392c1f615af9aae", "score": "0.56355894", "text": "function randomise_stars() {\n const num = Math.floor(Math.random() * 1000) + 100;\n console.log(num);\n gridSetup(num);\n}", "title": "" }, { "docid": "286c25d8c4527634a5f6d17a25b4a2a4", "score": "0.56223536", "text": "function cw_init() {\n // clone silver dot and health bar\n var mmm = document.getElementsByName('minimapmarker')[0];\n var hbar = document.getElementsByName('healthbar')[0];\n var generationSize = generationConfig.constants.generationSize;\n\n for (var k = 0; k < generationSize; k++) {\n\n // minimap markers\n var newbar = mmm.cloneNode(true);\n newbar.id = \"bar\" + k;\n newbar.style.paddingTop = k * 9 + \"px\";\n minimapholder.appendChild(newbar);\n\n // health bars\n var newhealth = hbar.cloneNode(true);\n newhealth.getElementsByTagName(\"DIV\")[0].id = \"health\" + k;\n newhealth.car_index = k;\n document.getElementById(\"health\").appendChild(newhealth);\n }\n mmm.parentNode.removeChild(mmm);\n hbar.parentNode.removeChild(hbar);\n world_def.floorseed = btoa(Math.seedrandom());\n cw_generationZero();\n ghost = ghost_create_ghost();\n resetCarUI();\n currentRunner = worldRun(world_def, generationState.generation, uiListeners);\n setupCarUI();\n cw_drawMiniMap();\n window.requestAnimationFrame(gameLoop);\n \n}", "title": "" }, { "docid": "286c25d8c4527634a5f6d17a25b4a2a4", "score": "0.56223536", "text": "function cw_init() {\n // clone silver dot and health bar\n var mmm = document.getElementsByName('minimapmarker')[0];\n var hbar = document.getElementsByName('healthbar')[0];\n var generationSize = generationConfig.constants.generationSize;\n\n for (var k = 0; k < generationSize; k++) {\n\n // minimap markers\n var newbar = mmm.cloneNode(true);\n newbar.id = \"bar\" + k;\n newbar.style.paddingTop = k * 9 + \"px\";\n minimapholder.appendChild(newbar);\n\n // health bars\n var newhealth = hbar.cloneNode(true);\n newhealth.getElementsByTagName(\"DIV\")[0].id = \"health\" + k;\n newhealth.car_index = k;\n document.getElementById(\"health\").appendChild(newhealth);\n }\n mmm.parentNode.removeChild(mmm);\n hbar.parentNode.removeChild(hbar);\n world_def.floorseed = btoa(Math.seedrandom());\n cw_generationZero();\n ghost = ghost_create_ghost();\n resetCarUI();\n currentRunner = worldRun(world_def, generationState.generation, uiListeners);\n setupCarUI();\n cw_drawMiniMap();\n window.requestAnimationFrame(gameLoop);\n \n}", "title": "" }, { "docid": "6f34f3988a8394758731d8da661ded3f", "score": "0.56102544", "text": "function initBoard(density){\n board = new Board(x, y);\n //initialize grid to random\n var grid = board.grid;\n for(var r = 1; r <= x; r++) {\n for (var c = 1; c <= y; c++) {\n var isAlive = false;\n var rand = Math.random();\n if (rand < density) {\n isAlive = true;\n }\n grid[r][c] = new Cell(r, c, 0, isAlive);\n }\n }\n repaint();\n}", "title": "" }, { "docid": "a02a8cf9196be9570b7ffec6daa32c2c", "score": "0.56096274", "text": "function randomMines(mines, firstClick) {\n let i = 0;\n for (i; i < mines; i++) {\n let index = Math.floor(Math.random() * (width * height));\n if (tBoxVecs[index].status === \"💣\" || index == firstClick) {\n i--;\n continue;\n } else {\n tBoxVecs[index].status = \"💣\";\n }\n }\n}", "title": "" }, { "docid": "d7e58f445099c867a651eb8f90d936e2", "score": "0.5607332", "text": "function setupBoard() {\n\ttileColors = createList(Math.max(WIDTH, HEIGHT), function(idx) {\n\t\treturn \"\";\n\t});\n\n\t// check if the color is already assigned to another number\n\tvar colorFail = true;\n\twhile (colorFail) {\n\t\ttileColors = map(tileColors, function(tc) {\n\t\t\tvar color = colors[randomInteger(colors.length)],\n\t\t\t\tc = null;\n\t\t\tfor (var key in color) {\n\t\t\t\tif (color.hasOwnProperty(key)) {\n\t\t\t\t\tc = color[key];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn c === null ? colors[0][\"Forest Green\"] : c;\n\t\t});\n\t\t// check for duplicates now\n\t\tvar seen = [];\n\t\teach(tileColors, function(tc) {\n\t\t\tif (seen.indexOf(tc) == -1) {\n\t\t\t\tseen.push(tc);\t\n\t\t\t}\n\t\t});\n\t\tcolorFail = seen.length != tileColors.length;\n\t}\n\n\t// TODO(dkg): the initial board should have more 1s and 2s than 3s!\n\t// TODO(dkg): make sure the board is playable!\n\tboard = createList(NUMBER_OF_TILES, function(idx) { \n\t\treturn new Tile(idx, randomInteger(3), null); \n\t});\n\n\tpointsLabel.innerHTML = \"\";\n\tpoints = 0;\n}", "title": "" }, { "docid": "013afc13c214b0f0f90f8fa16afa3ad0", "score": "0.5607316", "text": "function initMinersEnemy() {\n for (var i = 0; i < numberOfMinersEnemy; i++) {\n Miners_player_array_enemy[Miners_player_array_enemy.length] = new EnemyMiners();\n }\n}", "title": "" }, { "docid": "a1cbaa35ca355805fbc3eb60c227540f", "score": "0.56071734", "text": "function initPositionSnake(){\r\n \r\n xSnake = Math.trunc(Math.random()*nbrBlockWidth)*sizeSnake;\r\n ySnake = Math.trunc(Math.random()*nbrBlockHeight)*sizeSnake;\r\n \r\n}", "title": "" }, { "docid": "7ef610b0a11ff722c3f71260931d3cc9", "score": "0.56050354", "text": "function createGameSeed() {\n let mines = Array(mineNumber).fill(\"mine\")\n let safe = Array((width * width) - mineNumber).fill(\"safe\")\n let tempSeed = safe.concat(mines);\n tempSeed = tempSeed.sort(() => Math.random() - 0.5);\n let index = 0;\n for (let i = 0; i < width; i++) {\n let row = [];\n for (let j = 0; j < width; j++) {\n row.push(tempSeed[index++]);\n }\n gameSeed.push(row);\n }\n }", "title": "" }, { "docid": "31a1c119aa95e15d92d11ef5d2dda066", "score": "0.5601519", "text": "function spawnRandomBlock() {\n level.push(sidescroller.block.blockFactory(Math.round(Math.random() * canvas.width) - globalPosX, Math.round(Math.random() * canvas.height), \"grass01\"));\n }", "title": "" }, { "docid": "6769dcc0d73b77eab79a68d98d3e852f", "score": "0.5600697", "text": "function surround(board,bombs)//the function going on the locations of the mines and add to the cubes that surrounding them 1\n{\n for(let i = 0;i<bombs.length;i++)\n {\n let x = bombs[i][0];\n let y = bombs[i][1];\n if(x+1 < x_squares)\n board[x+1][y].number != -1 ? board[x+1][y].number += 1 : board[x+1][y].number += 0 ;\n if(y+1 < y_squares)\n board[x][y+1].number != -1 ? board[x][y+1].number += 1 : board[x][y+1].number += 0 ;\n if(x-1 >= 0)\n board[x-1][y].number != -1 ? board[x-1][y].number += 1 : board[x-1][y].number += 0 ;\n if(y-1 >= 0)\n board[x][y-1].number != -1 ? board[x][y-1].number += 1 : board[x][y-1].number += 0 ;\n if(x+1 < x_squares && y+1 < y_squares)\n board[x+1][y+1].number != -1 ? board[x+1][y+1].number += 1 : board[x+1][y+1].number += 0 ;\n if(x-1 >= 0 && y-1 >= 0)\n board[x-1][y-1].number != -1 ? board[x-1][y-1].number += 1 : board[x-1][y-1].number += 0 ;\n if(x+1 < x_squares && y-1 >= 0)\n board[x+1][y-1].number != -1 ? board[x+1][y-1].number += 1 : board[x+1][y-1].number += 0 ;\n if(x-1 >= 0 && y+1 < y_squares)\n board[x-1][y+1].number != -1 ? board[x-1][y+1].number += 1 : board[x-1][y+1].number += 0 ;\n }\n return board;\n}", "title": "" } ]
62574f82df55a029482d778c343a4d43
Process footnotes ////////////////////////////////////////////////////////////////////////////// Renderer partials
[ { "docid": "6159ce46ed5ea81c2f91d4e0ef0db595", "score": "0.0", "text": "function render_footnote_anchor_name(tokens, idx, options, env /*, slf*/) {\n var n = Number(tokens[idx].meta.id + 1).toString();\n var prefix = \"\";\n if (typeof env.docId === \"string\") {\n prefix = \"-\" + env.docId + \"-\";\n }\n return prefix + n;\n }", "title": "" } ]
[ { "docid": "9661f15d5516a9545a75b4f5589c2ff2", "score": "0.7040319", "text": "function RenderFootnote(){\n //These 2 lines are used to reset the footnote div element in the HTML file\n var footnoteElem = document.getElementById(\"footnote\");\n footnoteElem.innerHTML = \"<hr>\";\n\n //The conditional statement here is to check if there are any footnotes in the input box or not\n if (GetFoonoteContent() != null)\n {\n //These 2 lines are used to put the contents of the footnotes into an array called \"footnoteContentArray\"\n var replaceContent = GetFoonoteContent();\n var footnoteContentArray = replaceContent.split(\",\");\n\n //This for loop is used to create div child elements inside the footnote div element in the HTML file\n var footnoteDiv;\n for (var i = 1; i <= footnoteContentArray.length; i++)\n {\n //This conditional statement is used to check if the footnote and its content has existed or not.\n //If not, then we will create it.\n if (document.getElementById(\"source-\" + i) == null)\n {\n footnoteDiv = document.createElement(\"div\");\n footnoteDiv.id = \"source-\" + i;\n footnoteElem.appendChild(footnoteDiv);\n }\n }\n\n //This for loop is used to add the actual content into the footnote.\n for (var i = 0; i < footnoteContentArray.length; i++)\n {\n var cnt = i+1;\n document.getElementById(\"source-\" + cnt).innerHTML = footnoteContentArray[i] + '<a href=\"#footnote-' + cnt + '\">[Back to footnote ' + cnt + ']</a>';\n }\n }\n else\n {\n return;\n }\n}", "title": "" }, { "docid": "1db7ca32cf158fd8602a0c5d1076eb9a", "score": "0.6662596", "text": "function renderFootnotes(text) {\n var footnotes = [];\n var reFootnoteContent = /\\[\\^(\\d+)\\]: ?([\\S\\s]+?)(?=\\[\\^(?:\\d+)\\]|\\n\\n|$)/g;\n var reInlineFootnote = /\\[\\^(\\d+)\\]\\((.+?)\\)/g;\n var reFootnoteIndex = /\\[\\^(\\d+)\\]/g;\n var html = '';\n\n // threat all inline footnotes\n text = text.replace(reInlineFootnote, function(match, index, content) {\n footnotes.push({\n index: index,\n content: content\n });\n // remove content of inline footnote\n return '[^' + index + ']';\n });\n // threat all footnote contents\n text = text.replace(reFootnoteContent, function(match, index, content) {\n footnotes.push({\n index: index,\n content: content\n });\n // remove footnote content\n return '';\n });\n // render (HTML) footnotes reference\n text = text.replace(reFootnoteIndex,\n '<sup id=\"fnref:$1\"><a href=\"#fn:$1\" rel=\"footnote\">$1</a></sup>');\n // sort footnotes by their index\n footnotes.sort(function(a, b) {\n return a.index - b.index;\n });\n // render footnotes (HTML)\n footnotes.forEach(function(footNote) {\n html += '<li class=\"footnote__item\" id=\"fn:' + footNote.index + '\">';\n html += '<a class=\"footnote__index\" href=\"#fnref:' + footNote.index + '\" rev=\"footnote\">';\n html += footNote.index;\n html += '.</a>';\n html += '<span class=\"footnote__content\">';\n html += footNote.content.trim();\n html += '</span>';\n html += '</li>';\n });\n // add footnotes at the end of the content\n if (footnotes.length) {\n text += '<hr>';\n text += '<ol class=\"footnote__list\">' + html + '</ol>';\n }\n return text;\n}", "title": "" }, { "docid": "d6508c722ad349859df47e896ddaf0eb", "score": "0.65570045", "text": "function footnote_tail(state) {\n var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel, insideRef = false, refTokens = {};\n if (!state.env.footnotes) {\n return;\n }\n state.tokens = state.tokens.filter((function(tok) {\n if (tok.type === \"footnote_reference_open\") {\n insideRef = true;\n current = [];\n currentLabel = tok.meta.label;\n return false;\n }\n if (tok.type === \"footnote_reference_close\") {\n insideRef = false;\n // prepend ':' to avoid conflict with Object.prototype members\n refTokens[\":\" + currentLabel] = current;\n return false;\n }\n if (insideRef) {\n current.push(tok);\n }\n return !insideRef;\n }));\n if (!state.env.footnotes.list) {\n return;\n }\n list = state.env.footnotes.list;\n token = new state.Token(\"footnote_block_open\", \"\", 1);\n state.tokens.push(token);\n for (i = 0, l = list.length; i < l; i++) {\n token = new state.Token(\"footnote_open\", \"\", 1);\n token.meta = {\n id: i,\n label: list[i].label\n };\n state.tokens.push(token);\n if (list[i].tokens) {\n tokens = [];\n token = new state.Token(\"paragraph_open\", \"p\", 1);\n token.block = true;\n tokens.push(token);\n token = new state.Token(\"inline\", \"\", 0);\n token.children = list[i].tokens;\n token.content = list[i].content;\n tokens.push(token);\n token = new state.Token(\"paragraph_close\", \"p\", -1);\n token.block = true;\n tokens.push(token);\n } else if (list[i].label) {\n tokens = refTokens[\":\" + list[i].label];\n }\n if (tokens) state.tokens = state.tokens.concat(tokens);\n if (state.tokens[state.tokens.length - 1].type === \"paragraph_close\") {\n lastParagraph = state.tokens.pop();\n } else {\n lastParagraph = null;\n }\n t = list[i].count > 0 ? list[i].count : 1;\n for (j = 0; j < t; j++) {\n token = new state.Token(\"footnote_anchor\", \"\", 0);\n token.meta = {\n id: i,\n subId: j,\n label: list[i].label\n };\n state.tokens.push(token);\n }\n if (lastParagraph) {\n state.tokens.push(lastParagraph);\n }\n token = new state.Token(\"footnote_close\", \"\", -1);\n state.tokens.push(token);\n }\n token = new state.Token(\"footnote_block_close\", \"\", -1);\n state.tokens.push(token);\n }", "title": "" }, { "docid": "fa4b753f3500c91c3c6583285811a87c", "score": "0.6518255", "text": "function processFootPattern() {\r\n try {\r\n var footPath = path.resolve(paths.source.meta, '_01-foot.mustache');\r\n var footPattern = new Pattern(footPath, null, patternlab);\r\n footPattern.template = fs.readFileSync(footPath, 'utf8');\r\n footPattern.isPattern = false;\r\n footPattern.isMetaPattern = true;\r\n pattern_assembler.decomposePattern(footPattern, patternlab, true);\r\n patternlab.userFoot = footPattern.extendedTemplate;\r\n }\r\n catch (ex) {\r\n plutils.logRed('\\nWARNING: Could not find the user-editable footer template, currently configured to be at ' + path.join(config.paths.source.meta, '_01-foot.mustache') + '. Your configured path may be incorrect (check paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.\\n');\r\n if (patternlab.config.debug) { console.log(ex); }\r\n process.exit(1);\r\n }\r\n }", "title": "" }, { "docid": "97fa0ad27458a767ed500abe521244e6", "score": "0.6506697", "text": "function footnote_tail(state) {\n var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel,\n insideRef = false,\n refTokens = {};\n\n if (!state.env.footnotes) { return; }\n\n state.tokens = state.tokens.filter(function(tok) {\n if (tok.type === 'footnote_reference_open') {\n insideRef = true;\n current = [];\n currentLabel = tok.meta.label;\n return false;\n }\n if (tok.type === 'footnote_reference_close') {\n insideRef = false;\n // prepend ':' to avoid conflict with Object.prototype members\n refTokens[':' + currentLabel] = current;\n return false;\n }\n if (insideRef) { current.push(tok); }\n return !insideRef;\n });\n\n if (!state.env.footnotes.list) { return; }\n list = state.env.footnotes.list;\n\n token = new state.Token('footnote_block_open', '', 1);\n state.tokens.push(token);\n\n for (i = 0, l = list.length; i < l; i++) {\n token = new state.Token('footnote_open', '', 1);\n token.meta = { id: i };\n state.tokens.push(token);\n\n if (list[i].tokens) {\n tokens = [];\n\n token = new state.Token('paragraph_open', 'p', 1);\n token.block = true;\n tokens.push(token);\n\n token = new state.Token('inline', '', 0);\n token.children = list[i].tokens;\n token.content = '';\n tokens.push(token);\n\n token = new state.Token('paragraph_close', 'p', -1);\n token.block = true;\n tokens.push(token);\n\n } else if (list[i].label) {\n tokens = refTokens[':' + list[i].label];\n }\n\n state.tokens = state.tokens.concat(tokens);\n if (state.tokens[state.tokens.length - 1].type === 'paragraph_close') {\n lastParagraph = state.tokens.pop();\n } else {\n lastParagraph = null;\n }\n\n t = list[i].count > 0 ? list[i].count : 1;\n for (j = 0; j < t; j++) {\n token = new state.Token('footnote_anchor', '', 0);\n token.meta = { id: i, subId: j };\n state.tokens.push(token);\n }\n\n if (lastParagraph) {\n state.tokens.push(lastParagraph);\n }\n\n token = new state.Token('footnote_close', '', -1);\n state.tokens.push(token);\n }\n\n token = new state.Token('footnote_block_close', '', -1);\n state.tokens.push(token);\n }", "title": "" }, { "docid": "53429adf09bce84095d2a7b5f2e8e717", "score": "0.6503638", "text": "function footnote_tail(state) {\n var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel,\n insideRef = false,\n refTokens = {};\n\n if (!state.env.footnotes) { return; }\n\n state.tokens = state.tokens.filter(function (tok) {\n if (tok.type === 'footnote_reference_open') {\n insideRef = true;\n current = [];\n currentLabel = tok.meta.label;\n return false;\n }\n if (tok.type === 'footnote_reference_close') {\n insideRef = false;\n // prepend ':' to avoid conflict with Object.prototype members\n refTokens[':' + currentLabel] = current;\n return false;\n }\n if (insideRef) { current.push(tok); }\n return !insideRef;\n });\n\n if (!state.env.footnotes.list) { return; }\n list = state.env.footnotes.list;\n\n token = new state.Token('footnote_block_open', '', 1);\n state.tokens.push(token);\n\n for (i = 0, l = list.length; i < l; i++) {\n token = new state.Token('footnote_open', '', 1);\n token.meta = { id: i, label: list[i].label };\n state.tokens.push(token);\n\n if (list[i].tokens) {\n tokens = [];\n\n token = new state.Token('paragraph_open', 'p', 1);\n token.block = true;\n tokens.push(token);\n\n token = new state.Token('inline', '', 0);\n token.children = list[i].tokens;\n token.content = '';\n tokens.push(token);\n\n token = new state.Token('paragraph_close', 'p', -1);\n token.block = true;\n tokens.push(token);\n\n } else if (list[i].label) {\n tokens = refTokens[':' + list[i].label];\n }\n\n state.tokens = state.tokens.concat(tokens);\n if (state.tokens[state.tokens.length - 1].type === 'paragraph_close') {\n lastParagraph = state.tokens.pop();\n } else {\n lastParagraph = null;\n }\n\n t = list[i].count > 0 ? list[i].count : 1;\n for (j = 0; j < t; j++) {\n token = new state.Token('footnote_anchor', '', 0);\n token.meta = { id: i, subId: j, label: list[i].label };\n state.tokens.push(token);\n }\n\n if (lastParagraph) {\n state.tokens.push(lastParagraph);\n }\n\n token = new state.Token('footnote_close', '', -1);\n state.tokens.push(token);\n }\n\n token = new state.Token('footnote_block_close', '', -1);\n state.tokens.push(token);\n }", "title": "" }, { "docid": "ee7237646dfac44763623433d5d8cb32", "score": "0.6481282", "text": "function footnoteTail(state) {\n let i;\n let l;\n let lastParagraph;\n let list;\n let token;\n let tokens;\n let current;\n let currentLabel;\n let insideRef = false;\n let refTokens = {};\n\n if (!state.env.footnotes) {\n return;\n }\n\n state.tokens = state.tokens.filter(tok => {\n if (tok.type === 'footnote_reference_open') {\n insideRef = true;\n current = [];\n currentLabel = tok.meta.label;\n return false;\n }\n if (tok.type === 'footnote_reference_close') {\n insideRef = false;\n // prepend ':' to avoid conflict with Object.prototype members\n refTokens[':' + currentLabel] = current;\n return false;\n }\n if (insideRef) {\n current.push(tok);\n }\n return !insideRef;\n });\n\n if (!state.env.footnotes.list) {\n return;\n }\n list = state.env.footnotes.list;\n\n token = new state.Token('footnote_block_open', '', 1);\n state.tokens.push(token);\n\n for (i = 0, l = list.length; i < l; i++) {\n token = new state.Token('footnote_open', '', 1);\n token.meta = {id: i, label: list[i].label};\n state.tokens.push(token);\n\n if (list[i].tokens) {\n tokens = [];\n\n token = new state.Token('paragraph_open', 'p', 1);\n token.block = true;\n tokens.push(token);\n\n token = new state.Token('inline', '', 0);\n token.children = list[i].tokens;\n token.content = '';\n tokens.push(token);\n\n token = new state.Token('paragraph_close', 'p', -1);\n token.block = true;\n tokens.push(token);\n }\n else if (list[i].label) {\n tokens = refTokens[':' + list[i].label];\n }\n\n state.tokens = state.tokens.concat(tokens);\n if (state.tokens[state.tokens.length - 1].type === 'paragraph_close') {\n lastParagraph = state.tokens.pop();\n }\n else {\n lastParagraph = null;\n }\n\n if (lastParagraph) {\n state.tokens.push(lastParagraph);\n }\n\n token = new state.Token('footnote_close', '', -1);\n state.tokens.push(token);\n }\n\n token = new state.Token('footnote_block_close', '', -1);\n state.tokens.push(token);\n}", "title": "" }, { "docid": "f23dc4d36d81dea0845c8fa39d2226d9", "score": "0.6464055", "text": "function footnote_tail(state) {\n var i, l, j, t, lastParagraph, list, token, tokens, current, currentLabel,\n insideRef = false,\n refTokens = {};\n\n if (!state.env.footnotes) { return; }\n\n state.tokens = state.tokens.filter(function (tok) {\n if (tok.type === 'footnote_reference_open') {\n insideRef = true;\n current = [];\n currentLabel = tok.meta.label;\n return false;\n }\n if (tok.type === 'footnote_reference_close') {\n insideRef = false;\n // prepend ':' to avoid conflict with Object.prototype members\n refTokens[':' + currentLabel] = current;\n return false;\n }\n if (insideRef) { current.push(tok); }\n return !insideRef;\n });\n\n if (!state.env.footnotes.list) { return; }\n list = state.env.footnotes.list;\n\n token = new state.Token('footnote_block_open', '', 1);\n state.tokens.push(token);\n\n for (i = 0, l = list.length; i < l; i++) {\n token = new state.Token('footnote_open', '', 1);\n token.meta = { id: i, label: list[i].label };\n state.tokens.push(token);\n\n if (list[i].tokens) {\n tokens = [];\n\n token = new state.Token('paragraph_open', 'p', 1);\n token.block = true;\n tokens.push(token);\n\n token = new state.Token('inline', '', 0);\n token.children = list[i].tokens;\n token.content = list[i].content;\n tokens.push(token);\n\n token = new state.Token('paragraph_close', 'p', -1);\n token.block = true;\n tokens.push(token);\n\n } else if (list[i].label) {\n tokens = refTokens[':' + list[i].label];\n }\n\n state.tokens = state.tokens.concat(tokens);\n if (state.tokens[state.tokens.length - 1].type === 'paragraph_close') {\n lastParagraph = state.tokens.pop();\n } else {\n lastParagraph = null;\n }\n\n t = list[i].count > 0 ? list[i].count : 1;\n for (j = 0; j < t; j++) {\n token = new state.Token('footnote_anchor', '', 0);\n token.meta = { id: i, subId: j, label: list[i].label };\n state.tokens.push(token);\n }\n\n if (lastParagraph) {\n state.tokens.push(lastParagraph);\n }\n\n token = new state.Token('footnote_close', '', -1);\n state.tokens.push(token);\n }\n\n token = new state.Token('footnote_block_close', '', -1);\n state.tokens.push(token);\n }", "title": "" }, { "docid": "4db625f7f50f70e9bc04b9be6a4e0b82", "score": "0.64543766", "text": "setFootnotes(footnotes) {\n const $ = cheerio.load(this.content);\n\n $('sup').each((i, sup) => {\n if ($(sup).children().first().is('a')) {\n const footnoteId = $(sup).children().first().attr('href');\n\n if (Boolean(footnotes[footnoteId])) {\n const footnoteHTML = footnotes[footnoteId];\n const $footnote = $(`<p>${footnoteHTML}</p>`);\n\n let $lastTag = $('*').first();\n while (Boolean($lastTag.next().length)) {\n $lastTag = $lastTag.next();\n }\n\n $lastTag.after($footnote);\n\n delete footnotes[footnoteId];\n }\n }\n });\n\n this.content = $.html();\n }", "title": "" }, { "docid": "f4b359b69a97e6d035085e638f20b2b3", "score": "0.6402165", "text": "function inlineFootnotes() {\n\tvar ftn = \"ftn.\"; // ID prefix of the references in the footnotes\n\tvar refs = getReferences();\n\tvar content = $(\"#region-content\");\n\tvar footnoteReferences = $(\"span.footnoteReference\",content);\n\tfor (var i = 0; i < footnoteReferences.length; i++ ){\n\t\tvar link = $(\"a\", footnoteReferences[i]);\n\t\tvar ref_id = link.attr('id');\n\t\tif (ref_id.substring(0,4) != ftn) {\n\t\t\tvar id = ftn + ref_id;\n\t\t\tlink.after('<div class=\"inlineReference\"></div>');\n\t\t\tvar tt = $(\"div\",footnoteReferences[i]);\n\t\t\ttt.html(refs[id]);\n\t\t\t$(\"span\",tt).remove(\".footnoteReference\");\n\t\t\tlink.tooltip({\n\t\t\t\t//effect: 'fade',\n\t\t\t\t//fadeOutSpeed: 50,\n\t\t\t\t//predelay: 400,\n\t\t\t\tdelay: 500,\n\t\t\t\tposition: \"bottom center\",\n\t\t\t\toffset: [0, 0]\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1bedbabe71a269d15993e32872d42968", "score": "0.6390038", "text": "function generateFootnotes(h) {\n var footnotes = h.footnotes;\n var length = footnotes.length;\n var index = -1;\n var listItems = [];\n var def;\n\n if (!length) {\n return null;\n }\n\n while (++index < length) {\n def = footnotes[index];\n\n listItems[index] = {\n type: 'listItem',\n data: {hProperties: {id: 'fn-' + def.identifier}},\n children: def.children.concat({\n type: 'link',\n url: '#fnref-' + def.identifier,\n data: {hProperties: {className: ['footnote-backref']}},\n children: [{\n type: 'text',\n value: '↩'\n }]\n }),\n position: def.position\n };\n }\n\n return h(null, 'div', {\n className: ['footnotes']\n }, wrap([\n thematicBreak(h),\n list(h, {\n type: 'list',\n ordered: true,\n children: listItems\n })\n ], true));\n}", "title": "" }, { "docid": "c1de389a37c5d5181c813c9fcfecaeab", "score": "0.63457483", "text": "function footnotes() {\n \tvar footnotes = $(\".footnote-footer a\")\n for (var i = 0; i < footnotes.length; i++) {\n var footnote = footnotes[i];\n // Remove WIKIDOT api call\n footnote.setAttribute(\"onclick\",\"\");\n\n footnote.addEventListener(\"click\", function() {\n var footnoteNumber = $(this).get(0).parentElement.id.replace(/^footnote\\-/, \"\");\n \tvar footnoteref = $(\"#footnoteref-\"+footnoteNumber);\n var tabview_to_select = footnoteref.closest(\"div\");\n if (tabview_to_select.length != 0 && tabview_to_select.get(0).id.startsWith(\"wiki-tab\")) {\n \tvar index = parseInt(tabview_to_select.get(0).id.replace(\"wiki-tab-0-\",\"\"));\n \ttabview_to_select.parent().prev(\".yui-nav\").get(0).children.item(index).click();\n }\n var collapsible_block_to_unfold = footnoteref.closest(\"div.collapsible-block\");\n if (collapsible_block_to_unfold.length != 0) {\n \tvar folded_block = collapsible_block_to_unfold.children(\".collapsible-block-folded\")\n \tvar folded = folded_block.is(\":visible\");\n if (folded)\n \t\tfolded_block.children(\".collapsible-block-link\").get(0).click();\n }\n scrollToMiddle(footnoteref.get(0));\n footnoteref.parent().highlight(2000);\n })\n }\n }", "title": "" }, { "docid": "177963543bb1b8070aef5059669acb35", "score": "0.62944376", "text": "function getFootnoteContent(index) {\n const id = \"fn:\" + index;\n const fn = document.getElementById(id);\n return \"<center><b>Footnote</b></center>\"+ fn.innerHTML.trim();\n}", "title": "" }, { "docid": "58df4a21e6d0e8f468825dafbc12d8cb", "score": "0.6260258", "text": "function footnoterefs() {\n var footnoterefs = $(\".footnoteref a\")\n for (var i = 0; i < footnoterefs.length; i++) {\n var footnoteref = footnoterefs[i];\n // Get rid of the WIKIDOT api call to scroll to the footnote\n footnoteref.setAttribute(\"onclick\",\"\");\n var footnoteNumber = footnoteref.id.replace(/^footnoteref\\-/, \"\");\n\n // Assign a tooltip to every footnoteref corresponding to the footnote at the bottom\n tippy(footnoteref, {\n allowTitleHTML: true,\n hideOnClick: false,\n html: \"#footnote-\" + footnoteNumber,\n interactive: true,\n });\n }\n // Removes all tooltips on scroll\n window.addEventListener('scroll', () => {\n for (const popper of document.querySelectorAll('.tippy-popper')) {\n const instance = popper._tippy\n\n if (instance.state.visible) {\n instance.popperInstance.disableEventListeners()\n instance.hide()\n }\n }\n })\n }", "title": "" }, { "docid": "c36d9fb98695f830611814b164e94d7e", "score": "0.6109622", "text": "set footnotes(footnotes) {\n this.list.innerHTML = '';\n if (footnotes.length) {\n // ensure footnote list is visible\n this.root.style.display = '';\n\n for (const footnote of footnotes) {\n // construct and append list item to show footnote\n const listItem = document.createElement('li');\n listItem.id = footnote.id + '-listing';\n listItem.innerHTML = footnote.innerHTML;\n\n const backlink = document.createElement('a');\n backlink.setAttribute('class', 'footnote-backlink');\n backlink.textContent = '[↩]';\n backlink.href = '#' + footnote.id;\n\n listItem.appendChild(backlink);\n this.list.appendChild(listItem);\n }\n } else {\n // ensure footnote list is invisible\n this.root.style.display = 'none';\n }\n }", "title": "" }, { "docid": "06e208b1c4fc92eded82e9f6e4ace06d", "score": "0.5981413", "text": "function footnotesAtTheEnd(opts) {\n var isFootnode = function isFootnode(child) {\n return child.type === opts.typeFootnote;\n };\n\n return {\n match: function match(node) {\n return node.kind === 'document';\n },\n validate: function validate(node) {\n var nodes = node.nodes;\n\n var footnotesAtEnd = nodes.reverse().takeWhile(isFootnode);\n\n // Find all footnotes not at the end\n var lastNonFootnote = nodes.size - footnotesAtEnd.size;\n var invalids = nodes.slice(0, lastNonFootnote).filter(isFootnode);\n\n if (invalids.size === 0) return;\n\n return {\n invalids: invalids\n };\n },\n normalize: function normalize(transform, node, _ref2) {\n var invalids = _ref2.invalids;\n\n return invalids.reduce(moveToDocumentEnd, transform);\n }\n };\n}", "title": "" }, { "docid": "9407e3eedb58faecad9855530e5091c0", "score": "0.59441084", "text": "function footnotesInDocument(opts) {\n return {\n match: function match(node) {\n return node.kind === 'block';\n },\n validate: function validate(node) {\n var footnotes = node.nodes.filter(function (child) {\n return child.type === opts.typeFootnote;\n });\n\n if (footnotes.isEmpty()) return;\n\n return {\n footnotes: footnotes\n };\n },\n normalize: function normalize(transform, node, _ref) {\n var footnotes = _ref.footnotes;\n\n return footnotes.reduce(moveToDocumentEnd, transform);\n }\n };\n}", "title": "" }, { "docid": "9800465970656ff30427a3a5ee737fad", "score": "0.590448", "text": "drawNotes() { }", "title": "" }, { "docid": "518cf4c1c080539a32019e23d4b27bfb", "score": "0.58004445", "text": "renderFooter() { }", "title": "" }, { "docid": "8f17ed2525cf3a6a93300cfbd4d81e44", "score": "0.5716493", "text": "function initFootnoteTooltips () {\n $ ('a.annotation-ref').each (function () {\n const tt = new Tooltip (this, {\n 'trigger' : 'manual',\n 'placement' : 'top',\n 'html' : true,\n 'title' : function () {\n const href = $ (this).attr ('href');\n return $ (href).closest ('div.annotation-content').prop ('outerHTML');\n },\n });\n\n $ (this).on ('mouseenter', function () {\n tt.show ();\n }).on ('mouseleave', function () {\n // hack: are there any open tooltips hovered ?\n const hovers = $ ('.tooltip:hover');\n if (hovers.length) {\n // pointer went over the content\n // close when pointer leaves the content\n hovers.on ('mouseleave', function () {\n tt.hide ();\n });\n } else {\n // close now\n tt.hide ();\n }\n });\n });\n}", "title": "" }, { "docid": "49cb911fad5e3ed30f4c717d551e9f54", "score": "0.57066107", "text": "function footnote(h, node) {\n var identifiers = [];\n var identifier = 1;\n var footnotes = h.footnotes;\n var length = footnotes.length;\n var index = -1;\n\n while (++index < length) {\n identifiers[index] = footnotes[index].identifier;\n }\n\n while (identifiers.indexOf(String(identifier)) !== -1) {\n identifier++;\n }\n\n identifier = String(identifier);\n\n footnotes.push({\n type: 'footnoteDefinition',\n identifier: identifier,\n children: node.children,\n position: node.position\n });\n\n return footnoteReference(h, {\n type: 'footnoteReference',\n identifier: identifier,\n position: node.position\n });\n}", "title": "" }, { "docid": "7834463304dd229476f6f5480e055822", "score": "0.5685759", "text": "function render_footnote_caption(tokens, idx/*, options, env, slf*/) {\n var n = Number(tokens[idx].meta.id + 1).toString();\n if (tokens[idx].meta.subId > 0) {\n n += ':' + tokens[idx].meta.subId;\n }\n return '' + n + '';\n }", "title": "" }, { "docid": "a040471e8e55e84581d439749306bf36", "score": "0.5683642", "text": "function inject_footnote_pre_markup(copy){\n var com_i = 1;\n while (copy.find('[name=cmnt_ref'+com_i+']').length) {\n var ref_el = copy.find('[name=cmnt_ref'+com_i+']');\n // This here is the magic assumptions come in about how Google exports their comments in the HTML format\n // gotta' stick the different spans together with a \\n in the case of multi-line comments...\n var footnote = _.map(copy.find('[name=cmnt'+com_i+']').parent().parent('div').find('span'), function(c) { \n return $(c).text();\n }).join(\"\\n\");\n var possible_content = ref_el.parent().prev()\n var comment = find_comment(footnote, possible_content);\n if (comment) {\n console.log(\"rebecca, you rock!\");\n footnote = mark_up_comment(footnote, comment);\n attempt_to_highlight(comment, ref_el, possible_content);\n } else {\n console.warn(\"no love for '\"+footnote+\"'\");\n $('.problems').append(\"<li>Unable to find a matching comment for footnote: <span class='comment-in-question bad'>\"+footnote+\"</span>\");\n }\n ref_el.parent().prepend(footnote); // neither footnote nor orig content has been scrubbed yet\n ref_el.remove();\n ++com_i;\n }\n}", "title": "" }, { "docid": "141b7d6da0172a3885756559e2fee0e8", "score": "0.5679158", "text": "function rendernotes(notesObjs) {\n const notes = notesObjs.map(postNoteToPage)\n }", "title": "" }, { "docid": "760e56a3ee49b400f7224cc07037f2b4", "score": "0.5656335", "text": "function identifyFootnotesSection(containingDocument = document.firstElementChild) {\n\tGWLog(\"identifyFootnotesSection\", \"rewrite.js\", 1);\n\n\tlet footnotesSection = containingDocument.querySelector(\"section.footnotes\");\n\tif (footnotesSection)\n\t\tfootnotesSection.id = \"footnotes\";\n}", "title": "" }, { "docid": "d8e705e6ee089296a4197d6803bfd6af", "score": "0.56415164", "text": "function ConvertFootnoteToEndnoteMenuItem() {\n}", "title": "" }, { "docid": "f2cc8b1a90fb8530c6cd4d7570c44ac8", "score": "0.55833864", "text": "function printHeadFoot() {\n doc.altText(15, 15, COMPANY, 18);\n doc.altText(15, 20, taiwanDateFormat(START_DATE) +\n \" ~ \" + taiwanDateFormat(END_DATE), 12);\n doc.altText(78, 15, \"台茂槽車進貨需求確認單\", 14);\n doc.altText(104, 290, pageNo++, DEFAULT_FONT_SIZE);\n }", "title": "" }, { "docid": "6417a2523c7ee36d390e9301dee924b2", "score": "0.5581615", "text": "function footnote(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldParentType, pos, label,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n if (state.level >= state.options.maxNesting) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n state.tokens.push({\n type: 'footnote_reference_open',\n label: label,\n level: state.level++\n });\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldParentType = state.parentType;\n state.tShift[startLine] = state.skipSpaces(pos) - pos;\n state.bMarks[startLine] = pos;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.tShift[startLine] < state.blkIndent) {\n state.tShift[startLine] += state.blkIndent;\n state.bMarks[startLine] -= state.blkIndent;\n }\n\n state.parser.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.bMarks[startLine] = oldBMark;\n\n state.tokens.push({\n type: 'footnote_reference_close',\n level: --state.level\n });\n\n return true;\n}", "title": "" }, { "docid": "0c1cdbe8c84082879d01485a017bc50a", "score": "0.5566977", "text": "_initializeTableFootnoteManagers() {\n let doc = this._getDocument();\n let tableFigures = doc.getIndex('type').get('table-figure');\n forEach(tableFigures, tableFigure => {\n tableFigure.setFootnoteManager(new TableFootnoteManager(this.editorSession, tableFigure));\n });\n }", "title": "" }, { "docid": "58a2bd172c4381a03741f4d744e0a042", "score": "0.552638", "text": "function renderNotes(notes) {\n var renderNotesHTMLTemplate = Handlebars.compile($(\"#notes-template\").html());\n $(\"#displayNotes\").html(renderNotesHTMLTemplate(notes));\n}", "title": "" }, { "docid": "75c85067e1a1e6db1a59c6dd0c05225a", "score": "0.5479904", "text": "buildNoteHeads() {\n this._noteHeads = [];\n const stemDirection = this.getStemDirection();\n const keys = this.getKeys();\n let lastLine = undefined;\n let lineDiff = undefined;\n let displaced = false;\n // Draw notes from bottom to top.\n // For down-stem notes, we draw from top to bottom.\n let start;\n let end;\n let step;\n if (stemDirection === _stem__WEBPACK_IMPORTED_MODULE_3__.Stem.UP) {\n start = 0;\n end = keys.length;\n step = 1;\n }\n else {\n start = keys.length - 1;\n end = -1;\n step = -1;\n }\n for (let i = start; i !== end; i += step) {\n const noteProps = this.keyProps[i];\n const line = noteProps.line;\n // Keep track of last line with a note head, so that consecutive heads\n // are correctly displaced.\n if (lastLine === undefined) {\n lastLine = line;\n }\n else {\n lineDiff = Math.abs(lastLine - line);\n if (lineDiff === 0 || lineDiff === 0.5) {\n displaced = !displaced;\n }\n else {\n displaced = false;\n this.use_default_head_x = true;\n }\n }\n lastLine = line;\n const notehead = new _notehead__WEBPACK_IMPORTED_MODULE_2__.NoteHead({\n duration: this.duration,\n note_type: this.noteType,\n displaced,\n stem_direction: stemDirection,\n custom_glyph_code: noteProps.code,\n glyph_font_scale: this.render_options.glyph_font_scale,\n x_shift: noteProps.shift_right,\n stem_up_x_offset: noteProps.stem_up_x_offset,\n stem_down_x_offset: noteProps.stem_down_x_offset,\n line: noteProps.line,\n });\n this._noteHeads[i] = notehead;\n }\n }", "title": "" }, { "docid": "d0c739c05878bf8b4775e90582be4ccb", "score": "0.54692566", "text": "function displayNotes() {\n const notes = getNotes();\n notes.forEach(note => {\n addNoteToList(note);\n })\n}", "title": "" }, { "docid": "96ec35cf188a64df6090b3566cbc220e", "score": "0.53873456", "text": "function updateNotes() {\n\n\t\tif( config.showNotes && dom.speakerNotes && currentSlide && !isPrintingPDF() ) {\n\n\t\t\tdom.speakerNotes.innerHTML = getSlideNotes() || '';\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "ea2217afd728d7720b3ee8fd3df35db6", "score": "0.5362945", "text": "function renderNotes(notes) {\n //Rensa det som för tillfället visas för användaren\n noteListElement.innerHTML = '';\n //För varje note i listan notes\n notes.forEach(note => {\n //Gör om javascripts note till HTML note, lägg sedan till det som ett child på note-list elemetet i HTML\n noteListElement.appendChild(noteToHTML(note));\n });\n}", "title": "" }, { "docid": "2e5c63e9f602b125e099d675b8d260b2", "score": "0.53444296", "text": "function updatefooter() {\n\t\treturn updateFixed( cfg_fixed_footer );\n\t}", "title": "" }, { "docid": "7dbbda47d6d8ab9e712521b84f9c39af", "score": "0.5324877", "text": "paintNotes(deleteMode, noteArray) {\n this.displayNone(this.elements.headingNote);\n this.displayBlock(this.elements.headingNote);\n this.displayNone(this.elements.mainFolderForm);\n this.displayNone(this.elements.subFolderForm);\n this.displayNone(this.elements.noteForm);\n this.displayNone(this.elements.noteList);\n // clear the div\n this.clearNoteDisplay();\n // build div\n noteArray.forEach((note, index) => {\n // if delete mode is true, build div with head of the note to delete and move note\n if (deleteMode) {\n let html = \"\";\n const newHead = document.createElement(\"div\");\n html += `<h3 data-index=\"${index}\" class=\"head\"><span title='Move Down' class='moveUp'>&uArr;</span><i\n title=\"Delete Note\"\n class=\"delete-item fas fa-trash-alt trash\"\n ></i\n ><span title='Move Up' class='moveDown'>&dArr;</span><i class=\"edit-note fas fa-edit\" data-toggle=\"modal\" data-target=\"#myModal\"\n title=\"Edit Note\"\n \n></i\n></h3>`;\n newHead.innerHTML = html;\n // insert the head of the note\n this.elements.noteList.appendChild(newHead);\n } // End Head of Note\n //######################## Now build the Note #################################\n const newElement = document.createElement(\"h4\");\n newElement.className = \"note\";\n newElement.setAttribute(\"data-index\", `${index}`);\n if (note.imagePath) {\n newElement.appendChild(\n document.createTextNode(`${note.text}\\n\\n ${note.imagePath}`)\n );\n } else {\n newElement.appendChild(document.createTextNode(`${note.text}`));\n }\n // insert the note\n this.elements.noteList.appendChild(newElement);\n });\n\n this.displayBlock(this.elements.noteList);\n }", "title": "" }, { "docid": "b9c4d6296062566e3f0125b67a993b25", "score": "0.5319563", "text": "function footer() {\n\n\t doc.setFontSize(8);\n\t doc.text(185, 295, n); //print number bottom right\n\t doc.page++;\n\n\t }", "title": "" }, { "docid": "fd3f0185ac08dcadf84cd97431cc04d5", "score": "0.52937984", "text": "function footnote_inline(state, silent) {\n var labelStart,\n labelEnd,\n footnoteId,\n oldLength,\n max = state.posMax,\n start = state.pos;\n\n if (start + 2 >= max) { return false; }\n if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }\n if (state.level >= state.options.maxNesting) { return false; }\n\n labelStart = start + 2;\n labelEnd = parseLinkLabel(state, start + 1);\n\n // parser failed to find ']', so it's not a valid note\n if (labelEnd < 0) { return false; }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n footnoteId = state.env.footnotes.list.length;\n\n state.pos = labelStart;\n state.posMax = labelEnd;\n\n state.push({\n type: 'footnote_ref',\n id: footnoteId,\n level: state.level\n });\n state.linkLevel++;\n oldLength = state.tokens.length;\n state.parser.tokenize(state);\n state.env.footnotes.list[footnoteId] = { tokens: state.tokens.splice(oldLength) };\n state.linkLevel--;\n }\n\n state.pos = labelEnd + 1;\n state.posMax = max;\n return true;\n}", "title": "" }, { "docid": "d67ec1bc7bda06ced7b727fad784cf94", "score": "0.52925825", "text": "function commonFooter() {\nvar text;\ntext = botTable();\ntext += \"<table style='margin-top:20px; width:100%;'>\";\ntext += \"<tr><td style='text-align:left; vertical-align:bottom;'>\"+foot1()+\"</td>\";\ntext += \"<td style='text-align:center; vertical-align:bottom;'>\"+mathJaXImgAnchor+\"<br />beautiful math</td>\";\ntext += \"<td style='text-align:center; vertical-align:bottom;'>\"+jsxGraphImgAnchor+\"<br />beautiful graphics</td>\";\ntext += \"<td style='text-align:right; vertical-align:bottom;'>\"+foot3()+\"<td></tr>\";\ntext += \"</table>\";\nreturn text;\n}", "title": "" }, { "docid": "6ee1826049e0ac48fabbf0acd0313921", "score": "0.5291998", "text": "function updateFootnotesAfterInclusion(includeLink, newContent, newContentFootnotesSection) {\n GWLog(\"updateFootnotesAfterInclusion\", \"transclude.js\", 2);\n\n\t/*\tIf the transcluded content didn’t include the footnotes section of the\n\t\tsource page, attempt to get the footnotes section from the cached full\n\t\tdocument that the new content was sliced from.\n\t */\n if ( newContentFootnotesSection == null\n \t&& Transclude.isAnnotationTransclude(includeLink) == false) {\n \tlet newContentSourceDocument = Content.cachedDocumentForLink(includeLink);\n \tif (newContentSourceDocument)\n \t\tnewContentFootnotesSection = newContentSourceDocument.querySelector(\"#footnotes\");\n }\n\n let citationsInNewContent = newContent.querySelectorAll(\".footnote-ref\");\n if ( citationsInNewContent.length == 0\n || newContentFootnotesSection == null)\n return;\n\n let containingDocument = includeLink.eventInfo.document;\n\n\t//\tIf the host page doesn’t have a footnotes section, construct one.\n let footnotesSection = containingDocument.querySelector(\".markdownBody > #footnotes\");\n if (!footnotesSection) {\n // Construct footnotes section.\n footnotesSection = newElement(\"SECTION\", { \"id\": \"footnotes\", \"class\": \"footnotes\", \"role\": \"doc-endnotes\" });\n footnotesSection.append(newElement(\"HR\"));\n footnotesSection.append(newElement(\"OL\"));\n\n // Wrap.\n let footnotesSectionWrapper = newElement(\"SPAN\", { \"class\": \"include-wrapper\" });\n footnotesSectionWrapper.append(footnotesSection);\n\n // Inject.\n let markdownBody = (containingDocument.querySelector(\"#markdownBody\") ?? containingDocument.querySelector(\".markdownBody\"));\n markdownBody.append(footnotesSectionWrapper);\n\n // Fire events.\n GW.notificationCenter.fireEvent(\"GW.contentDidLoad\", {\n source: \"transclude.footnotesSection\",\n container: footnotesSectionWrapper,\n document: containingDocument\n });\n\t\tGW.notificationCenter.fireEvent(\"GW.contentDidInject\", {\n\t\t\tsource: \"transclude.footnotesSection\",\n\t\t\tcontainer: footnotesSectionWrapper,\n\t\t\tdocument: containingDocument,\n flags: 0\n\t\t});\n\n // Update page TOC to add footnotes section entry.\n updatePageTOCIfNeeded(includeLink.eventInfo);\n\n // Unwrap.\n unwrap(footnotesSectionWrapper);\n }\n\n\t//\tConstruct wrapper.\n let newFootnotesWrapper = newElement(\"OL\", { \"class\": \"include-wrapper\" });\n\n\t//\tAdd new footnotes to wrapper.\n citationsInNewContent.forEach(citation => {\n // Original footnote (in source content/document).\n let footnote = newContentFootnotesSection.querySelector(Notes.footnoteSelectorMatching(citation));\n\n\t\t//\tDetermine footnote’s source page, and its note number on that page.\n\t\tlet sourcePagePathname = (footnote.dataset.sourcePagePathname ?? loadLocationForIncludeLink(includeLink).pathname);\n\t\tlet originalNoteNumber = (footnote.dataset.originalNoteNumber ?? Notes.noteNumber(citation));\n\n\t\t//\tCheck for already added copy of this footnote.\n\t\tlet alreadyAddedFootnote = footnotesSection.querySelector(`li.footnote`\n\t\t\t\t\t\t\t\t + `[data-source-page-pathname='${(CSS.escape(sourcePagePathname))}']`\n\t\t\t\t\t\t\t\t + `[data-original-note-number='${originalNoteNumber}']`);\n\n // Copy the footnote, or keep a pointer to it.\n citation.footnote = (alreadyAddedFootnote ?? newFootnotesWrapper.appendChild(document.importNode(footnote, true)));\n\n\t\tif (alreadyAddedFootnote == null) {\n\t\t\t//\tRecord source page and original number.\n\t\t\tcitation.footnote.dataset.sourcePagePathname = sourcePagePathname;\n\t\t\tcitation.footnote.dataset.originalNoteNumber = originalNoteNumber;\n\t\t}\n });\n\n\t//\tInject wrapper.\n footnotesSection.appendChild(newFootnotesWrapper);\n\n\t//\tFire GW.contentDidLoad event.\n\tGW.notificationCenter.fireEvent(\"GW.contentDidLoad\", {\n\t\tsource: \"transclude.footnotes\",\n\t\tcontainer: newFootnotesWrapper,\n\t\tdocument: containingDocument,\n\t\tloadLocation: loadLocationForIncludeLink(includeLink)\n\t});\n\n\t//\tParent element of footnotes.\n\tlet footnotesList = footnotesSection.querySelector(\"ol\");\n\n\t//\tMerge and unwrap.\n\tfootnotesList.append(...(newFootnotesWrapper.children));\n\n\t//\tRe-number citations/footnotes, and re-order footnotes.\n\tlet footnoteNumber = 1;\n\tcontainingDocument.querySelectorAll(\".footnote-ref\").forEach(citation => {\n\t\tif (citation.closest(\".sidenote\"))\n\t\t\treturn;\n\n\t\tlet footnote = citation.footnote ?? footnotesSection.querySelector(Notes.footnoteSelectorMatching(citation));\n\n\t\tif (footnote.parentElement == newFootnotesWrapper) {\n\t\t\tNotes.setCitationNumber(citation, Notes.noteNumber(footnote));\n\t\t} else {\n\t\t\tNotes.setCitationNumber(citation, footnoteNumber);\n\t\t\tNotes.setFootnoteNumber(footnote, footnoteNumber);\n\n\t\t\tnewFootnotesWrapper.appendChild(footnote);\n\n\t\t\tfootnoteNumber++;\n\t\t}\n\t});\n\n\t//\tFire inject event.\n\tlet flags = GW.contentDidInjectEventFlags.clickable;\n\tif (containingDocument == document)\n\t\tflags |= GW.contentDidInjectEventFlags.fullWidthPossible;\n\tGW.notificationCenter.fireEvent(\"GW.contentDidInject\", {\n\t\tsource: \"transclude.footnotes\",\n\t\tcontainer: newFootnotesWrapper,\n\t\tdocument: containingDocument,\n\t\tloadLocation: loadLocationForIncludeLink(includeLink),\n\t\tflags: flags\n\t});\n\n\t//\tMerge and unwrap (redux).\n\tfootnotesList.append(...(newFootnotesWrapper.children));\n\n\t//\tDiscard wrapper.\n\tnewFootnotesWrapper.remove();\n}", "title": "" }, { "docid": "fc7ed0003407a411451fe767d4a79c60", "score": "0.5261593", "text": "function isDefFootnote(block) /* (block : block) -> bool */ {\n return (block._tag === 12);\n}", "title": "" }, { "docid": "a904b6c3051b00665a6a94c7d1eef0cd", "score": "0.5250387", "text": "function footnote_ref(state, silent) {\n var label, pos, footnoteId, footnoteSubId, token, max = state.posMax, start = state.pos;\n // should be at least 4 chars - \"[^x]\"\n if (start + 3 > max) {\n return false;\n }\n if (!state.env.footnotes || !state.env.footnotes.refs) {\n return false;\n }\n if (state.src.charCodeAt(start) !== 91 /* [ */) {\n return false;\n }\n if (state.src.charCodeAt(start + 1) !== 94 /* ^ */) {\n return false;\n }\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 32) {\n return false;\n }\n if (state.src.charCodeAt(pos) === 10) {\n return false;\n }\n if (state.src.charCodeAt(pos) === 93 /* ] */) {\n break;\n }\n }\n if (pos === start + 2) {\n return false;\n }\n // no empty footnote labels\n if (pos >= max) {\n return false;\n }\n pos++;\n label = state.src.slice(start + 2, pos - 1);\n if (typeof state.env.footnotes.refs[\":\" + label] === \"undefined\") {\n return false;\n }\n if (!silent) {\n if (!state.env.footnotes.list) {\n state.env.footnotes.list = [];\n }\n if (state.env.footnotes.refs[\":\" + label] < 0) {\n footnoteId = state.env.footnotes.list.length;\n state.env.footnotes.list[footnoteId] = {\n label: label,\n count: 0\n };\n state.env.footnotes.refs[\":\" + label] = footnoteId;\n } else {\n footnoteId = state.env.footnotes.refs[\":\" + label];\n }\n footnoteSubId = state.env.footnotes.list[footnoteId].count;\n state.env.footnotes.list[footnoteId].count++;\n token = state.push(\"footnote_ref\", \"\", 0);\n token.meta = {\n id: footnoteId,\n subId: footnoteSubId,\n label: label\n };\n }\n state.pos = pos;\n state.posMax = max;\n return true;\n }", "title": "" }, { "docid": "7927c204afcdb0b2fc9165b72180e0cd", "score": "0.5226687", "text": "function oyCrosswordFooter(t){this.puzz=t}", "title": "" }, { "docid": "9bbd4fc68ac146e37829727d0f58a9d4", "score": "0.52255887", "text": "function footnote_inline(state, silent) {\n var labelStart, labelEnd, footnoteId, token, tokens, max = state.posMax, start = state.pos;\n if (start + 2 >= max) {\n return false;\n }\n if (state.src.charCodeAt(start) !== 94 /* ^ */) {\n return false;\n }\n if (state.src.charCodeAt(start + 1) !== 91 /* [ */) {\n return false;\n }\n labelStart = start + 2;\n labelEnd = parseLinkLabel(state, start + 1);\n // parser failed to find ']', so it's not a valid note\n if (labelEnd < 0) {\n return false;\n }\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n \n if (!silent) {\n if (!state.env.footnotes) {\n state.env.footnotes = {};\n }\n if (!state.env.footnotes.list) {\n state.env.footnotes.list = [];\n }\n footnoteId = state.env.footnotes.list.length;\n state.md.inline.parse(state.src.slice(labelStart, labelEnd), state.md, state.env, tokens = []);\n token = state.push(\"footnote_ref\", \"\", 0);\n token.meta = {\n id: footnoteId\n };\n state.env.footnotes.list[footnoteId] = {\n content: state.src.slice(labelStart, labelEnd),\n tokens: tokens\n };\n }\n state.pos = labelEnd + 1;\n state.posMax = max;\n return true;\n }", "title": "" }, { "docid": "fcf17a70a6cc067a30efea40e2be6c1a", "score": "0.5211282", "text": "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token, initial, offset, ch, posAfterColon, start = state.bMarks[startLine] + state.tShift[startLine], max = state.eMarks[startLine];\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) {\n return false;\n }\n if (state.src.charCodeAt(start) !== 91 /* [ */) {\n return false;\n }\n if (state.src.charCodeAt(start + 1) !== 94 /* ^ */) {\n return false;\n }\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 32) {\n return false;\n }\n if (state.src.charCodeAt(pos) === 93 /* ] */) {\n break;\n }\n }\n if (pos === start + 2) {\n return false;\n }\n // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 58 /* : */) {\n return false;\n }\n if (silent) {\n return true;\n }\n pos++;\n if (!state.env.footnotes) {\n state.env.footnotes = {};\n }\n if (!state.env.footnotes.refs) {\n state.env.footnotes.refs = {};\n }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[\":\" + label] = -1;\n token = new state.Token(\"footnote_reference_open\", \"\", 1);\n token.meta = {\n label: label\n };\n token.level = state.level++;\n state.tokens.push(token);\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n if (isSpace(ch)) {\n if (ch === 9) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n pos++;\n }\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = \"footnote\";\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n state.md.block.tokenize(state, startLine, endLine, true);\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n token = new state.Token(\"footnote_reference_close\", \"\", -1);\n token.level = --state.level;\n state.tokens.push(token);\n return true;\n }", "title": "" }, { "docid": "4d2c79ce5f43d28b2052c85b5f78ebb2", "score": "0.5205764", "text": "function renderPage(PID) {\n //Render Internal Templates\n $(document).ready(function() {\n $.Mustache.addFromDom() //read all template from DOM \n\n // head\n $('head').mustache('head_t', APIdata);\n\n // info-panel \n $.get('templates/info-panel.htm', function(template) {\n var html = Mustache.to_html(template, APIdata);\n $(\".info-panel\").html(html);\n });\n\n // display-more-info\n $.get('templates/display-more-info.htm', function(template) {\n var html = Mustache.to_html(template, APIdata);\n $(\".display-more-info table\").html(html);\n cleanEmptyMetaRows();\n // fire contentType Specific cleanup / changes\n ctypeSpecific();\n });\n\n // Content Model Specific\n function ctypeSpecific() {\n // WSUebooks\n if (APIdata.translated.preferredContentModelPretty == \"WSUebook\") {\n PID_suffix = PID.split(\":\")[1]\n\n // generate fullText URLs\n APIdata.fullText = [{\n \"key\": \"HTML\",\n \"value\": \"http://\" + config.APP_HOST + \"/WSUAPI/bitStream/\" + PID + \"/HTML_FULL\"\n }, {\n \"key\": \"PDF\",\n \"value\": \"http://\" + config.APP_HOST + \"/WSUAPI/bitStream/\" + PID + \"/PDF_FULL\"\n }, ];\n\n // check for OCLC num, generate citation link (ADDRESS IN V2)\n if (\"mods_identifier_oclc_ms\" in APIdata.singleObjectPackage.objectSolrDoc) {\n APIdata.citationLink = \"http://library.wayne.edu/inc/OCLC_citation.php?oclcnum=\" + APIdata.singleObjectPackage.objectSolrDoc.mods_identifier_oclc_ms[0];\n }\n\n // check for Bib num, generate persistent link (ADDRESS IN V2)\n if (\"mods_bibNo_ms\" in APIdata.singleObjectPackage.objectSolrDoc) {\n APIdata.persistLink = \"http://elibrary.wayne.edu/record=\" + APIdata.singleObjectPackage.objectSolrDoc.mods_bibNo_ms[0].slice(0, -1);\n }\n }\n\n // Collection objects\n if (APIdata.translated.preferredContentModelPretty == \"Collection\") {\n // remove iiif manifest link\n $(\"#iiif_manifest\").remove();\n }\n\n // generate downloads \n generateDownloads();\n \n // trigger Admin\n triggerAdmin();\n }\n\n // finish rendering page and templates (case switching based on content type)\n finishRendering();\n\n });\n\n}", "title": "" }, { "docid": "0883fe3c041c64e7959a582ccab19547", "score": "0.5205691", "text": "function rendernote(tokens, idx) {\n if (tokens[idx].nesting === 1) {\n // opening tag\n var type = tokens[idx].info.trim().match(/^(\\w+).*$/)[1];\n return '<div class=\"note ' + type + '\"><div class=\"note-icon\"></div><div class=\"note-content\">';\n } else {\n // closing tag\n return '</div></div>\\n';\n }\n}", "title": "" }, { "docid": "3b7093b0566bd046b7e567edd7945977", "score": "0.51997614", "text": "function updateNotes() {\n noteContent.innerHTML = \"\";\n noteCard.style.height = `${historyCard.clientHeight}px`;\n for (var x = 0; x < notesArr.length; x++) {\n var p = document.createElement('p');\n var n = document.createElement('span');\n n.setAttribute('class', 'mr-1');\n n.innerHTML = notesArr[x].Name;\n var t = document.createElement('span');\n t.setAttribute('class', 'mr-1');\n t.innerHTML = moment(notesArr[x].Time).format('MMMM Do YYYY h:mm:ss a');\n var c = document.createElement('span');\n c.setAttribute('class', 'mr-1');\n c.innerHTML = notesArr[x].Comment;\n p.appendChild(n);\n p.appendChild(t);\n p.appendChild(c);\n noteContent.appendChild(p);\n }\n}", "title": "" }, { "docid": "85b30d761016396a6f99d93d9477c30d", "score": "0.5190093", "text": "function buildFooterHTML(patternlab, patternPartial) {\r\n //first render the general footer\r\n var footerPartial = pattern_assembler.renderPattern(patternlab.footer, {\r\n patternData: JSON.stringify({\r\n patternPartial: patternPartial,\r\n }),\r\n cacheBuster: patternlab.cacheBuster\r\n });\r\n\r\n var allFooterData;\r\n try {\r\n allFooterData = JSON5.parse(JSON5.stringify(patternlab.data));\r\n } catch (err) {\r\n console.log('There was an error parsing JSON for patternlab.data');\r\n console.log(err);\r\n }\r\n allFooterData.patternLabFoot = footerPartial;\r\n\r\n //then add it to the user footer\r\n var footerHTML = pattern_assembler.renderPattern(patternlab.userFoot, allFooterData);\r\n return footerHTML;\r\n }", "title": "" }, { "docid": "9b30c24b3809c8022c2df1a7fad03ce2", "score": "0.5173231", "text": "addPageFooter (markupList) {\n return markupList.map(page => {\n return page + `<div class=\"page-footer\">\n <div class=\"footer-left\"></div>\n <div class=\"footer-right tiny-h-font small-h-font medium-h-font\"></div>\n </div>`\n })\n }", "title": "" }, { "docid": "332ec29e63c029e17a85c5075ce19850", "score": "0.5159934", "text": "function displayNotes() {\n let notes = getDataFromStorage();\n if(notes.length > 0){\n noteID = notes[notes.length - 1].id;\n noteID++\n } else {\n noteID = 1;\n }\n notes.forEach(item => {\n createNote(item);\n })\n }", "title": "" }, { "docid": "c02fa23ff7d192016af61dc7d8571eb1", "score": "0.51556647", "text": "function footersReady(signal){\n\t\t\t\tif(!signal.responded){\n\t\t\t\t\tsignal.status(404)\n\t\t\t\t\t//console.log(signal.url.pathname, 'FOOTER READY')\n\t\t\t\t\tif (app.routes.missing.length){ \n\t\t\t\t\t\tnew RouteIterator(app.routes.missing, signal, false, 'missing_body') \n\t\t\t\t\t} else { \n\t\t\t\t\t\tresponse.end('404 page not found') \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "62053755e17dd6d15f7c84a4bcb1cb38", "score": "0.51502705", "text": "function footnote_inline(state, silent) {\n var labelStart,\n labelEnd,\n footnoteId,\n token,\n tokens,\n max = state.posMax,\n start = state.pos;\n\n if (start + 2 >= max) { return false; }\n if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }\n\n labelStart = start + 2;\n labelEnd = parseLinkLabel(state, start + 1);\n\n // parser failed to find ']', so it's not a valid note\n if (labelEnd < 0) { return false; }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n footnoteId = state.env.footnotes.list.length;\n\n state.md.inline.parse(\n state.src.slice(labelStart, labelEnd),\n state.md,\n state.env,\n tokens = []\n );\n\n token = state.push('footnote_ref', '', 0);\n token.meta = { id: footnoteId };\n\n state.env.footnotes.list[footnoteId] = {\n content: state.src.slice(labelStart, labelEnd),\n tokens: tokens\n };\n }\n\n state.pos = labelEnd + 1;\n state.posMax = max;\n return true;\n }", "title": "" }, { "docid": "d0623e4bf1873df5539c390beda085eb", "score": "0.5147753", "text": "function _footnote_ref(tokens, idx) {\n var n = Number(tokens[idx].meta.id + 1).toString();\n var id = 'fnref' + n;\n if (tokens[idx].meta.subId > 0) {\n id += ':' + tokens[idx].meta.subId;\n }\n return '<sup class=\"footnote-ref\"><a href=\"#fn' + n + '\" id=\"' + id + '\">[' + n + ']</a></sup>';\n}", "title": "" }, { "docid": "b0d9750abd8458f2407cee64cbe41972", "score": "0.5141478", "text": "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,\n initial, offset, ch, posAfterColon,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "title": "" }, { "docid": "b0d9750abd8458f2407cee64cbe41972", "score": "0.5141478", "text": "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,\n initial, offset, ch, posAfterColon,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "title": "" }, { "docid": "b0d9750abd8458f2407cee64cbe41972", "score": "0.5141478", "text": "function footnote_def(state, startLine, endLine, silent) {\n var oldBMark, oldTShift, oldSCount, oldParentType, pos, label, token,\n initial, offset, ch, posAfterColon,\n start = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) { return false; }\n\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos + 1 >= max || state.src.charCodeAt(++pos) !== 0x3A /* : */) { return false; }\n if (silent) { return true; }\n pos++;\n\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.refs) { state.env.footnotes.refs = {}; }\n label = state.src.slice(start + 2, pos - 2);\n state.env.footnotes.refs[':' + label] = -1;\n\n token = new state.Token('footnote_reference_open', '', 1);\n token.meta = { label: label };\n token.level = state.level++;\n state.tokens.push(token);\n\n oldBMark = state.bMarks[startLine];\n oldTShift = state.tShift[startLine];\n oldSCount = state.sCount[startLine];\n oldParentType = state.parentType;\n\n posAfterColon = pos;\n initial = offset = state.sCount[startLine] + pos - (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charCodeAt(pos);\n\n if (isSpace(ch)) {\n if (ch === 0x09) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = 'footnote';\n\n if (state.sCount[startLine] < state.blkIndent) {\n state.sCount[startLine] += state.blkIndent;\n }\n\n state.md.block.tokenize(state, startLine, endLine, true);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new state.Token('footnote_reference_close', '', -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n }", "title": "" }, { "docid": "3885291512356854c8b5297cacd60fcf", "score": "0.51308435", "text": "function footnote_ref(state, silent) {\n var label,\n pos,\n footnoteId,\n footnoteSubId,\n max = state.posMax,\n start = state.pos;\n\n // should be at least 4 chars - \"[^x]\"\n if (start + 3 > max) { return false; }\n\n if (!state.env.footnotes || !state.env.footnotes.refs) { return false; }\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n if (state.level >= state.options.maxNesting) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x0A) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos >= max) { return false; }\n pos++;\n\n label = state.src.slice(start + 2, pos - 1);\n if (typeof state.env.footnotes.refs[':' + label] === 'undefined') { return false; }\n\n if (!silent) {\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n\n if (state.env.footnotes.refs[':' + label] < 0) {\n footnoteId = state.env.footnotes.list.length;\n state.env.footnotes.list[footnoteId] = { label: label, count: 0 };\n state.env.footnotes.refs[':' + label] = footnoteId;\n } else {\n footnoteId = state.env.footnotes.refs[':' + label];\n }\n\n footnoteSubId = state.env.footnotes.list[footnoteId].count;\n state.env.footnotes.list[footnoteId].count++;\n\n state.push({\n type: 'footnote_ref',\n id: footnoteId,\n subId: footnoteSubId,\n level: state.level\n });\n }\n\n state.pos = pos;\n state.posMax = max;\n return true;\n}", "title": "" }, { "docid": "b85bed1af8900bd45dd0a332189e6381", "score": "0.51102465", "text": "function renderNote(pages, message, timestamp, noteID) {\n //console.log(timestamp);\n var noteHTML = '<div data-noteLink=\"' + pages + '\" data-noteID=\"' + noteID + '\" data-notets=\"' + timestamp + '\" class=\"note\">' +\n '<div class=\"notePages\">' + convertPageIndexToText(pages) + '</div>' +\n //'<div class=\"notePages\">' + (pages) + '</div>' +\n //'<div class=\"noteText\" contenteditable=\"true\">' + message +\n //'</div>' +\n //Text area doesn't always allow input so a space is added in the middle to insure edit abilities\n '<textarea class=\"noteText\">' + (message ? message : ' ') +\n '</textarea>' +\n '<div class=\"noteTimestamp\">' + updateTimestamp(timestamp) + '</div>' +\n '<div class=\"removeNote\"><a href=\"#\"></a></div>' +\n '</div>';\n $notesBody.prepend(noteHTML);\n //console.log(noteHTML);\n }", "title": "" }, { "docid": "7fbf7278f0d353515ad7fd06c52e503b", "score": "0.51089036", "text": "function footnote_ref(state, silent) {\n var label,\n pos,\n footnoteId,\n footnoteSubId,\n token,\n max = state.posMax,\n start = state.pos;\n\n // should be at least 4 chars - \"[^x]\"\n if (start + 3 > max) { return false; }\n\n if (!state.env.footnotes || !state.env.footnotes.refs) { return false; }\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x0A) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos >= max) { return false; }\n pos++;\n\n label = state.src.slice(start + 2, pos - 1);\n if (typeof state.env.footnotes.refs[':' + label] === 'undefined') { return false; }\n\n if (!silent) {\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n\n if (state.env.footnotes.refs[':' + label] < 0) {\n footnoteId = state.env.footnotes.list.length;\n state.env.footnotes.list[footnoteId] = { label: label, count: 0 };\n state.env.footnotes.refs[':' + label] = footnoteId;\n } else {\n footnoteId = state.env.footnotes.refs[':' + label];\n }\n\n footnoteSubId = state.env.footnotes.list[footnoteId].count;\n state.env.footnotes.list[footnoteId].count++;\n\n token = state.push('footnote_ref', '', 0);\n token.meta = { id: footnoteId, subId: footnoteSubId, label: label };\n }\n\n state.pos = pos;\n state.posMax = max;\n return true;\n }", "title": "" }, { "docid": "7fbf7278f0d353515ad7fd06c52e503b", "score": "0.51089036", "text": "function footnote_ref(state, silent) {\n var label,\n pos,\n footnoteId,\n footnoteSubId,\n token,\n max = state.posMax,\n start = state.pos;\n\n // should be at least 4 chars - \"[^x]\"\n if (start + 3 > max) { return false; }\n\n if (!state.env.footnotes || !state.env.footnotes.refs) { return false; }\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x0A) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos >= max) { return false; }\n pos++;\n\n label = state.src.slice(start + 2, pos - 1);\n if (typeof state.env.footnotes.refs[':' + label] === 'undefined') { return false; }\n\n if (!silent) {\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n\n if (state.env.footnotes.refs[':' + label] < 0) {\n footnoteId = state.env.footnotes.list.length;\n state.env.footnotes.list[footnoteId] = { label: label, count: 0 };\n state.env.footnotes.refs[':' + label] = footnoteId;\n } else {\n footnoteId = state.env.footnotes.refs[':' + label];\n }\n\n footnoteSubId = state.env.footnotes.list[footnoteId].count;\n state.env.footnotes.list[footnoteId].count++;\n\n token = state.push('footnote_ref', '', 0);\n token.meta = { id: footnoteId, subId: footnoteSubId, label: label };\n }\n\n state.pos = pos;\n state.posMax = max;\n return true;\n }", "title": "" }, { "docid": "5d0e1e47a623205443bdcd1f3983f458", "score": "0.5093075", "text": "function GetFoonoteContent(){\n var entireInput = document.getElementById(\"text1\").value;\n if (entireInput.match(/<footnote>(.*?)<\\/footnote>/g) != null)\n {\n var entireFootnotes = entireInput.match(/<footnote>(.*?)<\\/footnote>/g).toString();\n var actualContent = entireFootnotes.replace(/<footnote>(.*?)<\\/footnote>/g, '$1');\n console.log(actualContent);\n\n return actualContent;\n }\n else\n {\n return null;\n }\n}", "title": "" }, { "docid": "d34a03826b0d6dccc6cb916cebb74431", "score": "0.50857174", "text": "function footnote_ref(state, silent) {\n var label,\n pos,\n footnoteId,\n footnoteSubId,\n token,\n max = state.posMax,\n start = state.pos;\n\n // should be at least 4 chars - \"[^x]\"\n if (start + 3 > max) { return false; }\n\n if (!state.env.footnotes || !state.env.footnotes.refs) { return false; }\n if (state.src.charCodeAt(start) !== 0x5B/* [ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5E/* ^ */) { return false; }\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charCodeAt(pos) === 0x20) { return false; }\n if (state.src.charCodeAt(pos) === 0x0A) { return false; }\n if (state.src.charCodeAt(pos) === 0x5D /* ] */) {\n break;\n }\n }\n\n if (pos === start + 2) { return false; } // no empty footnote labels\n if (pos >= max) { return false; }\n pos++;\n\n label = state.src.slice(start + 2, pos - 1);\n if (typeof state.env.footnotes.refs[':' + label] === 'undefined') { return false; }\n\n if (!silent) {\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n\n if (state.env.footnotes.refs[':' + label] < 0) {\n footnoteId = state.env.footnotes.list.length;\n state.env.footnotes.list[footnoteId] = { label: label, count: 0 };\n state.env.footnotes.refs[':' + label] = footnoteId;\n } else {\n footnoteId = state.env.footnotes.refs[':' + label];\n }\n\n footnoteSubId = state.env.footnotes.list[footnoteId].count;\n state.env.footnotes.list[footnoteId].count++;\n\n token = state.push('footnote_ref', '', 0);\n token.meta = { id: footnoteId, subId: footnoteSubId };\n }\n\n state.pos = pos;\n state.posMax = max;\n return true;\n }", "title": "" }, { "docid": "954f5e067109f98b14702320f3e01356", "score": "0.5066297", "text": "function displayNotes() {\r\n let notes = getDataFromStorage();\r\n if (notes.length > 0) {\r\n noteID = notes[notes.length - 1].id;\r\n noteID++;\r\n }\r\n notes.forEach(item => {\r\n createNote(item);\r\n });\r\n}", "title": "" }, { "docid": "99b479e422ecc340d72ab7331e2ac6cf", "score": "0.5066001", "text": "function footnote_inline(state, silent) {\n var labelStart,\n labelEnd,\n footnoteId,\n token,\n tokens,\n max = state.posMax,\n start = state.pos;\n\n if (start + 2 >= max) { return false; }\n if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }\n\n labelStart = start + 2;\n labelEnd = parseLinkLabel(state, start + 1);\n\n // parser failed to find ']', so it's not a valid note\n if (labelEnd < 0) { return false; }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n footnoteId = state.env.footnotes.list.length;\n\n state.md.inline.parse(\n state.src.slice(labelStart, labelEnd),\n state.md,\n state.env,\n tokens = []\n );\n\n token = state.push('footnote_ref', '', 0);\n token.meta = { id: footnoteId };\n\n state.env.footnotes.list[footnoteId] = { tokens: tokens };\n }\n\n state.pos = labelEnd + 1;\n state.posMax = max;\n return true;\n }", "title": "" }, { "docid": "99b479e422ecc340d72ab7331e2ac6cf", "score": "0.5066001", "text": "function footnote_inline(state, silent) {\n var labelStart,\n labelEnd,\n footnoteId,\n token,\n tokens,\n max = state.posMax,\n start = state.pos;\n\n if (start + 2 >= max) { return false; }\n if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; }\n if (state.src.charCodeAt(start + 1) !== 0x5B/* [ */) { return false; }\n\n labelStart = start + 2;\n labelEnd = parseLinkLabel(state, start + 1);\n\n // parser failed to find ']', so it's not a valid note\n if (labelEnd < 0) { return false; }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n //\n if (!silent) {\n if (!state.env.footnotes) { state.env.footnotes = {}; }\n if (!state.env.footnotes.list) { state.env.footnotes.list = []; }\n footnoteId = state.env.footnotes.list.length;\n\n state.md.inline.parse(\n state.src.slice(labelStart, labelEnd),\n state.md,\n state.env,\n tokens = []\n );\n\n token = state.push('footnote_ref', '', 0);\n token.meta = { id: footnoteId };\n\n state.env.footnotes.list[footnoteId] = { tokens: tokens };\n }\n\n state.pos = labelEnd + 1;\n state.posMax = max;\n return true;\n }", "title": "" }, { "docid": "462e6a76fa2b450972f3b403138f909b", "score": "0.50637454", "text": "function handleInfoNote() {\n\tvar funnelCardWrap = $('.funnel-card-wrap');\n\tvar infoNote = $('.landing-page .info-note');\n\tvar firstScreenHeight = funnelCardWrap.offset().top + funnelCardWrap.innerHeight() - 100;\n\n\tif ($('main').hasClass('landing-page')) {\n\t\tif ($(window).scrollTop() > firstScreenHeight && !infoNote.hasClass('hide-content')) {\n\t\t\tinfoNote.addClass('show-content');\n\t\t} else if ($(window).scrollTop() > firstScreenHeight && infoNote.hasClass('hide-content')) {\n\t\t\tinfoNote.removeClass('hide-content');\n\t\t} else if (infoNote.hasClass('show-content')) {\n\t\t\tinfoNote.addClass('hide-content');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "32bbc758faa352483314d252c709d4dd", "score": "0.50488687", "text": "function loadFooter(copyrightDates){\n //\n // There are small variants depending on the page\n // 1. Different pages have different copyrightDates\n // 2. Links to the next and previous pages depend on the page\n //\n var footerText = \"\";\n var book = getbook();\n var prfx = (book == -1)? \"\" : \"../\";\n var prop = getprop(book);\n footerText += \"<br><p><hr size=6><p><center>\";\n // build the table of links\n footerText += \"<table><tr valign=top>\";\n if (book == -1) {// This is a page in the main directory\n footerText += \"<td>\"+getTopicForm(prfx)+\"</td><td>&nbsp;</td>\";\n footerText += \"<td>\"+getBookForm(prfx)+\"</td></tr>\";\n } else if (prop == -1) { // this is the book introduction page\n footerText += \"<td>\"+getFirstPageLink(book)+\" &nbsp; &nbsp; &nbsp; &nbsp;</td> \";\n footerText += \"<td>\"+getPropForm(book)+\"</td></tr>\";\n footerText += \"<tr valign=top><td>Next: \"+getBookLink(book-1+2)+\"</td>\";\n footerText += \"<td>\"+getBookForm(prfx)+\"</td></tr>\";\n footerText += \"<tr valign=top><td>Previous: \"+getBookLink(book-1)+\"</td>\";\n footerText += \"<td>\"+getTopicForm(prfx)+\"</td></tr>\";\n } else { // This is a proposition page\n footerText += \"<td>\"+getNextProp(book,prop)+\" &nbsp; &nbsp; &nbsp; &nbsp; </td>\";\n footerText += \"<td>\"+getPropForm(book)+\"</td></tr>\";\n footerText += \"<tr valign=top><td>\"+getPreviousProp(book,prop)+\"</td>\";\n footerText += \"<td>\"+getBookForm(prfx)+\"</td></tr>\";\n footerText += \"<tr valign=top><td>\"+getBookLink(book)+\"</td>\";\n footerText += \"<td>\"+getTopicForm(prfx)+\"</td></tr>\";\n }\n footerText += \"</table></center>\"\n // that finishes the table of links\n //finish up the footer\n footerText+=\"<hr size=6><p>\";\n footerText+=\"<font size=-1><a href=\"+prfx+\"copyright.html>\\u00A9\"+copyrightDates+\"</a>\";\n footerText+=\"<br><a href='http://aleph0.clarku.edu/~djoyce/'>David E. Joyce</a>\" ;\n footerText+=\"<br><img src='\"+prfx+\"dj.gif'>\";\n footerText+=\"<br><a href='http://www.clarku.edu/departments/mathcs/'>Department of Mathematics and Computer Science</a>\";\n footerText+=\"<br><a href='http://www.clarku.edu/'>Clark University</a><br>Worcester, MA 01610\";\n footerText+=\"</font size>\";\n //\n // footer is the footer for each chapter page\n //\n document.getElementById(\"footer\").innerHTML=footerText;\n}", "title": "" }, { "docid": "85aae9978f50c1bc93a86993175d914b", "score": "0.5041054", "text": "function myRender() {\n\n $.get(`/api/notes`, function(data) {\n\n $allNotes.empty();\n \n data.forEach( (item, index) => {\n\n // setting the HTML to append\n let lineItem = `<li><a href=\"#!\" class=\"waves-effect menu-item\" data-index=\"${index}\"><i class=\"material-icons right deleteBtn\">delete_forever</i>${item.title}</a></li>`;\n\n // appending the HTML\n $allNotes.append(lineItem);\n\n });\n\n });\n}", "title": "" }, { "docid": "7770687dd94bb94b133598c75e2fd818", "score": "0.5023618", "text": "function renderNotes(articleId) {\n // Empty the notes from the note section\n $(\"#notes\").empty();\n $(\"#notes\").show()\n $.ajax({\n method: \"GET\",\n url: \"/articles/\" + articleId\n })\n // adding note info to page\n .then(function (data) {\n\n $(\"#notes\").append(\"<div class='card' style='width: 18rem;' id='displayNotes'></div>\");\n $(\"#notes\").append(\"<textarea id='bodyinput' name='body'></textarea>\");\n $(\"#notes\").append(\"<button data-id='\" + articleId + \"' id='savenote'>Save Note</button>\");\n\n for (var i = 0; i < data.length; i++) {\n // If there's a note in the article this prevent empty note inputs that are submitted by user\n if (data[i].body) {\n // Place the body of the note in the body textarea\n $(\"#displayNotes\").append(`<span class=\"noteX\">\n <button data-id='${data[i]._id}' data-articleid =\"${articleId}\" class=\"deleteBtn btn btn-dark\">X</button>${data[i].body}</span>`);\n }\n }\n });\n}", "title": "" }, { "docid": "c6426922f1a2e7b43fa16cc494a31945", "score": "0.50133216", "text": "function addRTFooter() {\n var body = document.getElementsByTagName(\"body\")[0];\n // creating the div element which will contain the footer\n var footerDiv = document.createElement(\"div\");\n\n // Setting the style to the footer div\n footerDiv.setAttribute(\"class\", StyleClass.FOOTER);\n footerDiv.setAttribute(\"id\", \"998\");\n var footNode = getBoxInfo(\"998\");\n\n // creating a new footer table\n var footerTable = document.createElement(\"table\");\n\n // appending the first, second, third, fourth rows to footerTable\n if (footNode.hasPdfButton || footNode.hasFootnote || footNode.hasAbbreviation) {\n footerTable.appendChild(getFootNoteButtonRow(footNode));\n }\n if (footNode.hasFootnote) {\n footerTable.appendChild(getReferenceTextRow(footNode));\n }\n if (footNode.hasAbbreviation) {\n footerTable.appendChild(getAbbreviationTextRow(footNode));\n }\n if (footNode.hasMoreInfoButton) {\n footerTable.appendChild(getMoreInfoLinkButton(footNode));\n }\n\n // appending the Reset button to footerTable\n if (footNode.resetButtonText.trim() !== \"\")\n footerTable.appendChild(getResetButton(footNode));\n\n // appending the table to footerDiv\n footerDiv.appendChild(footerTable);\n // appending the footerDiv to the body\n\n body.appendChild(footerDiv);\n\n if (footNode.extraButtons.length > 0) {\n body.appendChild(addExtraButtons(footNode));\n }\n}", "title": "" }, { "docid": "636a2b6c4250a717a459767d4c89fe91", "score": "0.50031", "text": "function renderNotesList(data) {\n var articleId = data._id;\n var notesObject = data.notes;\n var notesArray = [];\n var currentNote;\n if (notesObject.length <= 0) {\n // If we have no notes, just display a message explaing this\n currentNote = [\"<li class='list-group-item'>\", \"No notes for this article yet.\", \"</li>\"].join(\"\");\n notesArray.push(currentNote);\n }\n else {\n // If we do have notes, go through each one\n // for (var i = 0; i < data.notes.note.length; i++) {\n // Constructs an li element to contain our noteText and a delete button\n currentNote = $(\n [\n \"<li class='list-group-item note'>\",\n notesObject.noteText,\n \"<button class='btn btn-danger note-delete'>x</button>\",\n \"</li>\"\n ].join(\"\")\n );\n // Store the note id on the delete button for easy access when trying to delete\n currentNote.children(\"button\").data(\"_id\", notesObject._id);\n // Adding our currentNote to the notesToRender array\n notesArray.push(currentNote);\n // }\n }\n // Now append the notesToRender to the note-container inside the note modal\n $(\".note-container\").append(notesArray);\n }", "title": "" }, { "docid": "a7a9fbe63b6bc6fd7e91e8dd19674891", "score": "0.5000916", "text": "displayFormNote(){\n this.seenEditNote = false;\n this.bodyNote = \"\";\n this.titleNote = \"\";\n if (!this.seenAddNote)\n this.seenAddNote = true;\n else\n this.seenAddNote = false;\n }", "title": "" }, { "docid": "b17a554f825755236dc996d8fea4cd94", "score": "0.49970904", "text": "function addsNotesSection(v, container){\n\n var left = Html.buildHtml('span', {'class': 'tabnav-left'}, {});\n\n v.displayer = Html.buildHtml('span', '', {'class': 'note'});\n var bookmarked = Html.buildHtml('span', '', {'class': 'octicon octicon-light-bulb'});\n left.append(bookmarked);\n left.append(Html.buildHtml('span', {'class':'divider'}, {}));\n left.append(v.displayer);\n\n container.append(left);\n v.handler.push(v.namespace + '-' + 'next');\n\n\n v.callback.push(Notes.nextNote);\n return container;\n }", "title": "" }, { "docid": "5ba3ff80823d24b1593a4d47847c7f88", "score": "0.4995406", "text": "static displayNotes(notesArray,idcontainer){\n\t\tcontainer= document.querySelector(`#${idcontainer}`);\n\t\tcontainer.innerHTML=\"\";\n\t\t//on boucle sur le tableau des instances , on cree une variable instance pour stoker les valeur recu\n\t\tnotesArray.forEach(instance =>{\n\t\t\t// on insert le html recu et on choisi l endroit \n\t\t\tcontainer.insertAdjacentElement('beforeend',instance.render());\n\n\t\t})\n\t}", "title": "" }, { "docid": "50ea1902477b8c8035abd94e95815923", "score": "0.49900225", "text": "function fixFoot() {\n var tfoot = $(settings.table).find(\"tfoot\");\n var tr = tfoot.find(\"tr\");\n var cells = tfoot.find(\"tr > *\");\n\n setBackground(cells);\n cells.css({\n 'position': 'relative'\n });\n }", "title": "" }, { "docid": "50ea1902477b8c8035abd94e95815923", "score": "0.49900225", "text": "function fixFoot() {\n var tfoot = $(settings.table).find(\"tfoot\");\n var tr = tfoot.find(\"tr\");\n var cells = tfoot.find(\"tr > *\");\n\n setBackground(cells);\n cells.css({\n 'position': 'relative'\n });\n }", "title": "" }, { "docid": "97e913f3a124f0ce6a08b2a46670bc0a", "score": "0.4983457", "text": "function footnoteReference(h, node) {\n var identifier = node.identifier;\n\n return h(node.position, 'sup', {id: 'fnref-' + identifier}, [\n h(node, 'a', {\n href: '#fn-' + identifier,\n className: ['footnote-ref']\n }, [u('text', identifier)])\n ]);\n}", "title": "" }, { "docid": "9223de8af749d8b11ffb79e300ad1a3d", "score": "0.4978867", "text": "function displayPublicNotes(notes) {\n $('.e').remove();\n $('.h').remove();\n $('.b').remove();\n notes.forEach(note => {\n if (note.type == 'public') {\n $('.g').append(`<div class='notes-icon public h'>\n<a class='openNote openNote-js'>\n<h3>${note.title.slice(0,11)}...</h3>\n<p class='small-note'>${note.body.slice(0, 140)}...</p>\n</a>\n<div class='function-container'>\n<form class='edit-note-form'>\n<input type='hidden' class='edit-note-id' value='${note._id}'>\n<button type='submit' class='function-icon openNoteSmall-js'><img src='../images/edit-icon.png' alt='edit note icon' title='edit note' /></button>\n</form>\n\n<form class='save-private-note-form'>\n<input type='hidden' class='save-private-note-id' value='${note._id}'>\n<button type='submit' class='function-icon save-private-js'><img src='../images/save-private-icon.png' alt='save note to home icon' title='move note to home' /></button>\n</form>\n\n<form class='delete-note-form'>\n<input type='hidden' class='delete-note-id' value='${note._id}'>\n<button type='submit' class='function-icon delete-js'><img src='../images/trash-icon.png' alt='delete note icon' title='delete note' /></button>\n</form>\n</div>\n</div>`)\n }\n });\n}", "title": "" }, { "docid": "e89820757fa6f18e52d142c3dbf89a50", "score": "0.49778658", "text": "render() {\n // decontruct props\n let { notes } = this.props;\n console.log(`notes: ${notes}`);\n let notesRender = \"\";\n\n // Only render notes if they exist\n if (notes && notes.length > 0) {\n notesRender = notes.map((note) => {\n return(<Note refreshParentPage={this.refreshPage} _id={note._id} key={note._id} user={note.user} comments={note.comments} articleId={note.articleId} />);\n });\n }\n \n return (\n // Only display comments header if there are comments\n <div>\n {notesRender}\n </div>\n );\n }", "title": "" }, { "docid": "088a1d5f8e6d8e5bf78c616d8612c9bc", "score": "0.4976896", "text": "render() {\n \treturn (\n \t\t<div style={{marginTop:\"100px\", marginBottom:\"70px\"}}>\n \t\t<h2 className=\"center\">Past Notes from Meetings</h2>\n \t\t\t<div className=\"columns is-centered\">\t\n \t\t\t\t<div className=\"column is-two-thirds\">\n \t\t\t\t<button className=\"button is-info\" onClick={()=> {window.location.href='#/meeting/'+this.id }}> Go back </button>\n \t\t\t\t\t{this.state.notes.map((note) => {\n \t\t\t\t\t\tconst newNote= new Notes(note)\n \t\t\t\t\t\tif (newNote) {\n \t\t\t\t\t\t\treturn (\n \t\t\t\t\t\t\t\t<div className=\"box\" style={{textAlign:\"left\"}}>\n \t\t\t\t\t\t\t\t<p>Taken on {newNote.date}:</p>\n \t\t\t\t\t\t\t\t<pre>{newNote.text}</pre>\n \t\t\t\t\t\t\t</div>\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</div>\n \t\t\t</div>\n \t\t</div>\n \t)\n \t}", "title": "" }, { "docid": "fe85ce208549421c511bfb37f01d1fef", "score": "0.49625024", "text": "function CP2_SC3_function_notespan(i) {\n var ModalVar = 'CP2_SC3_myNoteModal' + i;\n\n document.getElementById(ModalVar).style.display = \"none\";\n}", "title": "" }, { "docid": "e5f6518abd66446986c1c4c2294369be", "score": "0.49540398", "text": "function CP2_SC1_function_notespan(i) {\n var ModalVar = 'CP2_SC1_myNoteModal' + i;\n\n document.getElementById(ModalVar).style.display = \"none\";\n}", "title": "" }, { "docid": "b6db5859e56489f48af30901b0762dad", "score": "0.49536723", "text": "function footprints(givenDots, plusLevel){\n headprints(givenDots, plusLevel); //bottom up\n indexUp(clearnode, 0, plusLevel-1); //clear everything except weighted headprint on plusLevel\n indexDn(incrementKids,plusLevel,0);\n}", "title": "" }, { "docid": "97b12ecba8ecc027468463f6c0cfece7", "score": "0.49442407", "text": "function CP2_SC2_function_notespan(i) {\n var ModalVar = 'CP2_SC2_myNoteModal' + i;\n\n document.getElementById(ModalVar).style.display = \"none\";\n}", "title": "" }, { "docid": "ddb3f8f07e7be24a15ed5b7d0d97b8a9", "score": "0.4937499", "text": "function hideNotes() {\n notes.forEach(function (note) {\n note.style.opacity = 0;\n });\n }", "title": "" }, { "docid": "713789aaab6e9d8bd5692762360c58c3", "score": "0.49297437", "text": "function prepareFooter(options, metabase, state, classname, code) {\n\t}", "title": "" }, { "docid": "a5e99ab7cfef9042e022bdcff3d06e20", "score": "0.4927956", "text": "function renderFoot(storeArray) {\n var tableFoot = document.createElement('tfoot');\n tableFoot.id = 'foot';\n tableFoot.appendChild(newEl('th','Total'));\n\n for (var i of hourSum(storeArray)) {\n tableFoot.appendChild(newEl('td',i));\n }\n\n salesTable.appendChild(tableFoot);\n}", "title": "" }, { "docid": "fd5d30bb84c599413a3cc5e0af606e91", "score": "0.4926418", "text": "function displayNote() {\n\ttextAlign(RIGHT, BOTTOM);\n\ttextSize(24);\n\tnoStroke(0);\n\tfill(255);\n\t\n\t// \n\tvar playingText;\n\t\n\tif(playing)\n\t\tplayingText = \"Playing \" + NOTENAMES[notePlaying % 12];\n\telse\n\t\tplayingText = \"Playing nothing\";\n\t\n\ttext(playingText, width-30, height-5);\n\n\tfor (var i = 0; i < numNotes; i++) {\n\t\tvar upperBound = (height/numNotes) * i;\n\n\t\ttextAlign(LEFT, TOP);\n\t\ttextSize(20);\n\t\tfill(0, 0, 50, 200);\n\t\ttext(NOTENAMES[(72-i) % 12], 10, upperBound+5);\n\t}\n}", "title": "" }, { "docid": "2799235dbf8fa3cf16ae9857d18fd1bd", "score": "0.49251196", "text": "function viewNotes() {\n let allNotes = localStorage.getItem(\"data\");\n if (allNotes == null) {\n notes = [];\n } else {\n notes = JSON.parse(allNotes);\n }\n\n let notesDes = \" \";\n //adding the notes dynamically to html document\n notes.forEach(function (content, index) {\n notesDes += `\n <div class=\"notes-main\" >\n <div>\n <h3> Note ${index + 1} </h3>\n </div>\n <div class=\"main-con\">\n <p>${content}</p>\n </div>\n <div class=\"rm-btn\">\n <button id=\"${index}\" onclick=\"remove(this.id)\">Remove<img src=\"./Images/remove.svg\"></button>\n </div>\n </div> \n `;\n });\n//Replacing The Divs\n if (notes.length != 0) {\n notes_main.innerHTML = notesDes;\n no_notes.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "7c2d431ff691fb14af57f163a84d547f", "score": "0.49219352", "text": "handler(argv) {\n notes.addNote(argv.title, argv.body)\n }", "title": "" }, { "docid": "7c2d431ff691fb14af57f163a84d547f", "score": "0.49219352", "text": "handler(argv) {\n notes.addNote(argv.title, argv.body)\n }", "title": "" }, { "docid": "06b8637cb357b79053411b2f8969b6d7", "score": "0.49214706", "text": "function setItemNotes(itemNotes) {\n var size = itemNotes.length; // number of notes\n var html = ''; // empty html string to place into the notes section\n\n // generate all the html\n for (var count = 0; count < size; count++)\n html += getItemNoteCardHtml(itemNotes[count]);\n\n // set the item notes section to the generated html\n $(\"#item-notes-cards\").html(html);\n}", "title": "" }, { "docid": "731156f5585daea4324092a222a60efc", "score": "0.49207693", "text": "renderBody() {\n const supportingText = this.multiLineSupportingText !== '' ?\n this.renderMultiLineSupportingText() :\n this.supportingText !== '' ? this.renderSupportingText() :\n '';\n return html `<div class=\"body\"\n ><span class=\"label-text\">${this.headline}</span>${supportingText}</div>`;\n }", "title": "" }, { "docid": "bea4fbfa2abcb28d6014894f547986b2", "score": "0.49105075", "text": "function footer(req, res, next){\n var sess = req.session;\n res.write('<hr>');\n res.write('<h1>Carleton University</h1>');\n res.write('<hr>');\n res.write('<h4>Author: Alex Patel, Company: Patel Brothers, Copywrite@2015</h4>');\n res.write('</html>');\n res.end();\n }", "title": "" }, { "docid": "7f4228cdd22d3486ca35c9eeacaa6e37", "score": "0.49065107", "text": "renderNotes() {\n // Generate notesToDisplay array which will be used to render the notes in clinical notes view\n const signedNotes = Lang.filter(this.props.patient.getNotes(), o => o.signed);\n // TODO: sort notes based on selected sort; use the notesTimeSorter right now.\n signedNotes.sort(this.notesTimeSorter);\n const maxNotes = this.maxNotesToDisplay ? Math.min(this.maxNotesToDisplay, signedNotes.length) : signedNotes.length;\n\n return signedNotes.slice(0, maxNotes).map((item, i) => // item is a signed note\n this.renderClinicalNote(item, i)\n );\n }", "title": "" }, { "docid": "ee27593bc5acf1bbde21b529d1d11c24", "score": "0.49039263", "text": "function AddFootnoteOrChapter(footnoteOrChapter){\n if (footnoteOrChapter == \"footnoteNumber\")\n {\n var contentBetweenTag = document.getElementById(\"text1\");\n var selectedContent = document.getSelection().toString();\n var startCaret = document.getElementById(\"text1\").selectionStart;\n var endCaret = document.getElementById(\"text1\").selectionEnd;\n var openTag = \"<footnote>\";\n var closeTag = \"</footnote>\";\n\n contentBetweenTag.value = contentBetweenTag.value.substring(0, startCaret)\n + openTag\n + selectedContent\n + closeTag\n + contentBetweenTag.value.substring(endCaret, contentBetweenTag.value.length);\n }\n else if (footnoteOrChapter == \"chapterNumber\")\n {\n var contentBetweenTag = document.getElementById(\"text1\");\n var selectedContent = document.getSelection().toString();\n var startCaret = document.getElementById(\"text1\").selectionStart;\n var endCaret = document.getElementById(\"text1\").selectionEnd;\n var openTag = \"<chapter:[replace this with a chapter number and add chapter content between these tags]>\";\n var closeTag = \"</chapter>\";\n\n contentBetweenTag.value = contentBetweenTag.value.substring(0, startCaret)\n + openTag\n + selectedContent\n + closeTag\n + contentBetweenTag.value.substring(endCaret, contentBetweenTag.value.length);\n }\n}", "title": "" }, { "docid": "0ec369a383b8cccbd645b2e8375fadab", "score": "0.48963037", "text": "function showNotes() {\n notes.forEach(function (note) {\n // first position the notes randomly on the page\n positionNote(note);\n // now, animate the notes torwards the button\n animateNote(note);\n });\n }", "title": "" }, { "docid": "33cf54db48adceea63e128c304a01848", "score": "0.4880019", "text": "function loadNotes(){\n loadPageWithGetData(\"rest/noter\",\"noter.mustache\");\n\n}", "title": "" }, { "docid": "a10585918ecceab068eb14d4909afd66", "score": "0.4879592", "text": "handleNote(value, i){\n var noteP = value-1;\n var regP = i;\n\n this.props.setChpParaN(noteP);\n this.props.setPanesTabs('main','text','b');\n this.props.setChpPara(this.props.nav.chp, regP);\n this.props.setUpdate(true);\n }", "title": "" }, { "docid": "856d7ff3f1d8199da76d59be5ee343ef", "score": "0.487416", "text": "function renderLastNote() {\n var note = localStorage.getItem(\"#toDo8\");\n notePad8.textContent = note;\n\n var note = localStorage.getItem(\"#toDo9\");\n notePad9.textContent = note;\n\n var note = localStorage.getItem(\"#toDo10\");\n notePad10.textContent = note;\n\n var note = localStorage.getItem(\"#toDo11\");\n notePad11.textContent = note;\n\n var note = localStorage.getItem(\"#toDo12\");\n notePad12.textContent = note;\n\n var note = localStorage.getItem(\"#toDo1\");\n notePad1.textContent = note;\n\n var note = localStorage.getItem(\"#toDo2\");\n notePad2.textContent = note;\n\n var note = localStorage.getItem(\"#toDo3\");\n notePad3.textContent = note;\n\n var note = localStorage.getItem(\"#toDo4\");\n notePad4.textContent = note;\n}", "title": "" } ]
53d78a6171125753dbb4fa6f9bb23643
The function whose prototype chain sequence wrappers inherit from.
[ { "docid": "78529f8fef69a3c0526519a7ed48e59b", "score": "0.0", "text": "function baseLodash() {\n\t\t\t // No operation performed.\n\t\t\t }", "title": "" } ]
[ { "docid": "aba8494f9b8475a84f767d168bf786d8", "score": "0.6645316", "text": "function F(){} //the prototype of the 'F' function should point to the", "title": "" }, { "docid": "35a5f239363a727331d342c09c126740", "score": "0.61504096", "text": "function h(e,t,n){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:h(o,t,n)}if(\"value\"in i)return i.value;var r=i.get;return void 0!==r?r.call(n):void 0}", "title": "" }, { "docid": "1a618bf7e4de2e02b92a589805b91a65", "score": "0.59690493", "text": "function base() {}", "title": "" }, { "docid": "ec0a613f6699f1e3aaa7d3a7535aa3f9", "score": "0.59624034", "text": "function Base_extendPrototype(ctor) {\n if (typeof ctor !== 'function') ctor = Function.prototype;\n if (ctor.extend !== Base_extend) setValue(ctor, 'extend', Base_extend);\n return this;\n }", "title": "" }, { "docid": "269e8fc988088547a2944ae95db7d4fe", "score": "0.5899747", "text": "function F(e,t){function n(){this.constructor=e}P(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "08483e76bec11d9601b114fcca830163", "score": "0.5866364", "text": "function F(t,e){function n(){this.constructor=t}B(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "b48695d04f71ad1086fd67e5b43f060b", "score": "0.57956654", "text": "function F(e,t){function n(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "bc9d47b5fa84832e3b93d11b34eba7c1", "score": "0.5758287", "text": "function c(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "title": "" }, { "docid": "a11f570bd5b21a758c9b091827bd4640", "score": "0.5732841", "text": "function protoCtrChain(e){var t=[];for(;e;e=e.__proto__)t.push(e.constructor);return t.join()}", "title": "" }, { "docid": "47d304ac3e2836cb2406c37e2936702b", "score": "0.57314515", "text": "function F () {}", "title": "" }, { "docid": "06a502fc05d786c850f63f856a9a4ab3", "score": "0.56866074", "text": "function a(t,e){s(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){s(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){s(t,e,n)}))}", "title": "" }, { "docid": "5678155fc754ba8e6334761e49ca3454", "score": "0.5679837", "text": "function i(e,t){a(e,t),Object.getOwnPropertyNames(t.prototype).forEach((function(r){a(e.prototype,t.prototype,r)})),Object.getOwnPropertyNames(t).forEach((function(r){a(e,t,r)}))}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "5799c74a5b77b00aae14e81da0c00348", "score": "0.5678385", "text": "function F() {}", "title": "" }, { "docid": "0e23985181ba3eb66bfc42226bb872b7", "score": "0.5625841", "text": "function inherit(proto){\n\tfunction F(){}\n\tF.prototype = proto;\n\treturn new F;\n}", "title": "" }, { "docid": "0e23985181ba3eb66bfc42226bb872b7", "score": "0.5625841", "text": "function inherit(proto){\n\tfunction F(){}\n\tF.prototype = proto;\n\treturn new F;\n}", "title": "" }, { "docid": "fa2a058e35c1ed93cadf7429572d34e4", "score": "0.562449", "text": "function A() {}", "title": "" }, { "docid": "a4978bb452d428417b620bc7fe207884", "score": "0.5623611", "text": "function fu(e,r){function o(){this.constructor=e}hu(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}", "title": "" }, { "docid": "9e2d6a9addaf907cfabe97c8621a7f75", "score": "0.5618365", "text": "function getFunctionParent() {\n return this.findParent(function (path) {\n return path.isFunction() || path.isProgram();\n });\n}", "title": "" }, { "docid": "592d2f7714f07c54af5ddf792dd196bd", "score": "0.55621916", "text": "function F () { }", "title": "" }, { "docid": "d3c9053069481171aac9b02113e65712", "score": "0.5529987", "text": "function l(e,t){function i(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}", "title": "" }, { "docid": "d2c3f7dbeae1e412364b4cac0fdaf22f", "score": "0.5518914", "text": "getPrototypeOf() {\n return null;\n }", "title": "" }, { "docid": "573747eb3c10e00c0ef209f0725d677e", "score": "0.550782", "text": "prototypeFor(value) {\n return value;\n }", "title": "" }, { "docid": "fe8d45f6758b28742f9a27657a877e1b", "score": "0.5487554", "text": "function BaseFunc(parent) {\n this.parent = parent;\n return this;\n}", "title": "" }, { "docid": "be91d9d204a3c26f4ad44c7e00b25965", "score": "0.54704195", "text": "function Sequence() {}", "title": "" }, { "docid": "42adea7d0a191c0c06374d17c8d435c5", "score": "0.54609203", "text": "doSth() {\n console.log('this method is in prototype')\n }", "title": "" }, { "docid": "eb38c915051536b656dc76d729530684", "score": "0.5460861", "text": "function x() {}", "title": "" }, { "docid": "096925b7ae26a174af5387076905a9ea", "score": "0.5438256", "text": "function i(t,e){function u(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(u.prototype=e.prototype,new u)}", "title": "" }, { "docid": "e37c446b1aa06ded31f06a0fcdbd2a37", "score": "0.54362035", "text": "function Chain() {\n\n}", "title": "" }, { "docid": "4f205a21e479f4ac0bfb81773c1ed6d6", "score": "0.5432029", "text": "function n(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "d17e49932e6f965116430935bf45efd1", "score": "0.5421656", "text": "function i(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "title": "" }, { "docid": "154b14a3c98b1c36908e197355dade8d", "score": "0.5416251", "text": "function F() {\n}", "title": "" }, { "docid": "7136ee1c3f92a605421efc875c4d0095", "score": "0.5387299", "text": "function r(e){return\"function\"===typeof e}", "title": "" }, { "docid": "7136ee1c3f92a605421efc875c4d0095", "score": "0.5387299", "text": "function r(e){return\"function\"===typeof e}", "title": "" }, { "docid": "7136ee1c3f92a605421efc875c4d0095", "score": "0.5387299", "text": "function r(e){return\"function\"===typeof e}", "title": "" }, { "docid": "41ad7d0bc2acf001d8dd36c0925ac94e", "score": "0.53862643", "text": "function i(e,t){function r(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "title": "" }, { "docid": "38532c35b5e076bdd01fe8982e25897a", "score": "0.53746974", "text": "function Ft(e,t){function r(){this.constructor=e}Vt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}", "title": "" }, { "docid": "441b8e35acba12d90d4d6df51c665f13", "score": "0.5372636", "text": "function n(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e}", "title": "" }, { "docid": "441b8e35acba12d90d4d6df51c665f13", "score": "0.5372636", "text": "function n(e,t){function n(){}n.prototype=t.prototype,e.superClass_=t.prototype,e.prototype=new n,e.prototype.constructor=e}", "title": "" }, { "docid": "14f8013be58604bf0c607575fb288c13", "score": "0.5371169", "text": "function a(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "0bb19b28caf5368bbc565f9e7d443517", "score": "0.53647894", "text": "function functionName(fn){if(Function.prototype.name===undefined){var funcNameRegex=/function\\s([^(]{1,})\\(/;var results=funcNameRegex.exec(fn.toString());return results&&results.length>1?results[1].trim():\"\";}else if(fn.prototype===undefined){return fn.constructor.name;}else{return fn.prototype.constructor.name;}}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.5356992", "text": "function Parent() {}", "title": "" }, { "docid": "5408e4a4de4e5f4b5bfa97220cfdbe11", "score": "0.5356992", "text": "function Parent() {}", "title": "" }, { "docid": "f39b6e5d5594ad5861ec77be5ccd2d0b", "score": "0.53565645", "text": "function eo(e,t){function i(){this.constructor=e}Qi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}", "title": "" }, { "docid": "8b682bfff4dce011ef44bea2c066489c", "score": "0.53533316", "text": "function ComposedFn( ... fnChain ) {\n\tthis.fnChain = fnChain ;\n}", "title": "" }, { "docid": "1f59c5cc5840c41ec7558765d1a19abf", "score": "0.5349911", "text": "function constFunc(fn) {\n fn.w___('prototype', null);\n return freeze(fn);\n }", "title": "" }, { "docid": "15ff26471e746e5fc0da0b6100571339", "score": "0.5343796", "text": "function $P(e,t){var n=Si()(e);if(bi.a){var r=bi()(e);t&&(r=yi()(r).call(r,(function(t){return mi()(e,t).enumerable}))),n.push.apply(n,r)}return n}", "title": "" }, { "docid": "4c091516cadd2fb3807944e808a3a3c8", "score": "0.5343151", "text": "function i(e){return\"function\"===typeof e}", "title": "" }, { "docid": "dcf6013543d02d137a99db3034b42056", "score": "0.5337687", "text": "function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "dcf6013543d02d137a99db3034b42056", "score": "0.5337687", "text": "function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "dcf6013543d02d137a99db3034b42056", "score": "0.5337687", "text": "function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "dcf6013543d02d137a99db3034b42056", "score": "0.5337687", "text": "function i(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "00fd0e59499978de5a827ac2d8faa083", "score": "0.5325714", "text": "function testsOnUserDefinedFunction() {\n\t\tlog('\\n%cA %c// An object of type function', code, comment);\n\t\tinspect(A); // An object of type function\n\n\t\tlog('%cA.__proto__ %c// equal to Function.prototype i.e., prototype of Function (its parent)', code, comment);\n\t\tinspect(A.__proto__); // equal to Function.prototype i.e., prototype of Function (its parent)\n\n\t\tlog('%cA.__proto__.__proto__ %c// equal to Object.prototype i.e., prototype of Object', code, comment);\n\t\tinspect(A.__proto__.__proto__); // equal to Object.prototype i.e., prototype of Object\n\n\t\tlog('%cA.__proto__.__proto__.__proto__ %c// equal to null (end of __proto__ chain)', code, comment);\n\t\tinspect(A.__proto__.__proto__.__proto__); // equal to null (end of __proto__ chain)\n\t}", "title": "" }, { "docid": "f6f68bdfeee024a187495f15443fa582", "score": "0.5325254", "text": "function n(e){return\"undefined\"!==typeof Function&&e instanceof Function||\"[object Function]\"===Object.prototype.toString.call(e)}", "title": "" }, { "docid": "448e51257389ee1b71505b74804bc4c1", "score": "0.5306853", "text": "function getPrototypeChain (value) {\n const protoChain = []\n let current = value\n while (current && (typeof current === 'object' || typeof current === 'function')) {\n protoChain.push(current)\n current = Reflect.getPrototypeOf(current)\n }\n return protoChain\n }", "title": "" }, { "docid": "c7e5d07acef0935b821fa80a70f54f36", "score": "0.5306218", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "title": "" }, { "docid": "c7e5d07acef0935b821fa80a70f54f36", "score": "0.5306218", "text": "function o(t,e){a(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){a(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){a(t,e,n)}))}", "title": "" }, { "docid": "8facc09a4546d9f81f5d7aef0f281dde", "score": "0.5301181", "text": "function n(t,e){function n(){}n.prototype=e.prototype,t.superClass_=e.prototype,t.prototype=new n,t.prototype.constructor=t}", "title": "" }, { "docid": "8facc09a4546d9f81f5d7aef0f281dde", "score": "0.5301181", "text": "function n(t,e){function n(){}n.prototype=e.prototype,t.superClass_=e.prototype,t.prototype=new n,t.prototype.constructor=t}", "title": "" }, { "docid": "2f465ce80f3225873417292599ffa92c", "score": "0.5298437", "text": "get prototypeIndex() {}", "title": "" }, { "docid": "250c974e150dbaf1a05c63f993b7bb33", "score": "0.52951694", "text": "function inherit(C, P){\n\tC.prototype = P.prototype\n}", "title": "" }, { "docid": "584d8dc28465a45de5e4d58408010375", "score": "0.52921456", "text": "function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "584d8dc28465a45de5e4d58408010375", "score": "0.52921456", "text": "function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "b710430b36b720720646ea2888bc69f9", "score": "0.5285302", "text": "function O() {}", "title": "" }, { "docid": "8356c1c1e4f3d4dafcca59073844f92d", "score": "0.5276648", "text": "function inheritPrototype(ScientificCalculator, Calculator) { \n\t\n\tScientificCalculator.prototype=Object.create(Calculator.prototype);\n\tScientificCalculator.prototype.constructor=ScientificCalculator; \n}", "title": "" }, { "docid": "a7012e8f6bc2cbfb027338d05b80e647", "score": "0.52688104", "text": "function y(){f.call(this)}", "title": "" }, { "docid": "2e9b4116093e16fbfc26f0c287d26fef", "score": "0.526731", "text": "function B(e,t){function n(){this.constructor=e}H(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "6272304173418c5de27d6185f67ccc14", "score": "0.52630186", "text": "function Function$prototype$chain(f) {\n return x => f (this (x)) (x);\n }", "title": "" }, { "docid": "3935e07213b59186311b7e16e1a6ea2f", "score": "0.525294", "text": "function s(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "c3a1ed765500109d41b016a023e93590", "score": "0.5250546", "text": "function a() {}", "title": "" }, { "docid": "c3a1ed765500109d41b016a023e93590", "score": "0.5250546", "text": "function a() {}", "title": "" }, { "docid": "c3a1ed765500109d41b016a023e93590", "score": "0.5250546", "text": "function a() {}", "title": "" }, { "docid": "4f20653e4e94de3f87b733c4b6b88307", "score": "0.52291316", "text": "function main() {\n class A {}\n A.prototype.prototype = 'a string';\n class C extends A {\n m() {\n super.prototype;\n }\n }\n function f() {}\n\n // Create handler; receiver is a function.\n C.prototype.m.call(f);\n // Use handler; receiver not a function.\n C.prototype.m.call('not a function');\n}", "title": "" }, { "docid": "2053ec4e8a082ee38405e5b6d5552bb6", "score": "0.52162904", "text": "function inherit(proto) {\n function F() {\n };\n F.prototype = proto;\n return new F();\n }", "title": "" }, { "docid": "b783ad4aae7b89326d19aa706c2d10ad", "score": "0.5205251", "text": "function f(e){switch(e){case\"implements\":case\"interface\":case\"package\":case\"private\":case\"protected\":case\"public\":case\"static\":case\"yield\":case\"let\":return!0;default:return!1}}", "title": "" }, { "docid": "a611ad9f644a783abea86d9336a7b77b", "score": "0.5202534", "text": "function It(t,e){function n(){this.constructor=t}Nt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "664d0cf3b103be66e35806bd9263ce6e", "score": "0.51997524", "text": "function ye(e,t){function n(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}", "title": "" }, { "docid": "89fba4f86bfe0e7344400fd3c46f3597", "score": "0.5199633", "text": "function I(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Class extends value \"+String(e)+\" is not a constructor or null\");function n(){this.constructor=t}A(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}", "title": "" }, { "docid": "a0bc997a18f81024e43d895f3771c225", "score": "0.51920414", "text": "function iub(a){return\"function\"===typeof a}", "title": "" }, { "docid": "fecd42c82909bb0f35235c7d8423faea", "score": "0.519158", "text": "function Super () {}", "title": "" }, { "docid": "5412cbec186d84761f7c0bb74ddbad34", "score": "0.5191113", "text": "function __func(){}", "title": "" }, { "docid": "87ad75756a1b61d78d5a839800d3c3a2", "score": "0.518993", "text": "function nr(t){return function(){var e,n=Object(ht[\"a\"])(t);if(rr()){var r=Object(ht[\"a\"])(this).constructor;e=it()(n,arguments,r)}else e=n.apply(this,arguments);return Object(pt[\"a\"])(this,e)}}", "title": "" }, { "docid": "ad3223ed83f0a6b7bc2a9ef6a44c71ee", "score": "0.5184972", "text": "function e(t){return\"undefined\"!==typeof Function&&t instanceof Function||\"[object Function]\"===Object.prototype.toString.call(t)}", "title": "" }, { "docid": "ad3223ed83f0a6b7bc2a9ef6a44c71ee", "score": "0.5184972", "text": "function e(t){return\"undefined\"!==typeof Function&&t instanceof Function||\"[object Function]\"===Object.prototype.toString.call(t)}", "title": "" }, { "docid": "ad3223ed83f0a6b7bc2a9ef6a44c71ee", "score": "0.5184972", "text": "function e(t){return\"undefined\"!==typeof Function&&t instanceof Function||\"[object Function]\"===Object.prototype.toString.call(t)}", "title": "" }, { "docid": "ad3223ed83f0a6b7bc2a9ef6a44c71ee", "score": "0.5184972", "text": "function e(t){return\"undefined\"!==typeof Function&&t instanceof Function||\"[object Function]\"===Object.prototype.toString.call(t)}", "title": "" }, { "docid": "ad3223ed83f0a6b7bc2a9ef6a44c71ee", "score": "0.5184972", "text": "function e(t){return\"undefined\"!==typeof Function&&t instanceof Function||\"[object Function]\"===Object.prototype.toString.call(t)}", "title": "" }, { "docid": "ad3223ed83f0a6b7bc2a9ef6a44c71ee", "score": "0.5184972", "text": "function e(t){return\"undefined\"!==typeof Function&&t instanceof Function||\"[object Function]\"===Object.prototype.toString.call(t)}", "title": "" } ]
00e0be7738047d9d6d84f6571672582e
Load our XSL stylesheet from a URL
[ { "docid": "5fc53bed6c39f7597ef06fe0e0e50100", "score": "0.6950172", "text": "function loadXSLtext(url)\r\n{\r\n xhttp = new XMLHttpRequest();\r\n xhttp.open(\"GET\", url, false);\r\n xhttp.send();\r\n if(xhttp.responseXML == undefined) throw \"XHR failed for \" + url;\r\n return xhttp.responseXML;\r\n}", "title": "" } ]
[ { "docid": "7e1c3d746e0fbcc3fa8f4b2ace2234cf", "score": "0.67603344", "text": "function getXML(url) {\n // return a link to the XML (or XSL) file referenced by the url argument\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url, false);\n xhr.send(null);\n return xhr.responseXML;\n}", "title": "" }, { "docid": "f4c4d9cc3598bc37fb7eb88eadf74074", "score": "0.641616", "text": "function XSLTransformer(stylesheet, xmlLoader)\n{\n\tvar loader = xmlLoader;\n\tvar xslProc = null\n\tvar xslDoc = null;\n\tvar xslSheet= stylesheet;\n\tvar error = 0;\n\t\n\t//--- load stylesheet\n\n\tker.loadMan.acquire();\n\tker.loadURL(Env.url +'/xsl/'+ stylesheet, importStyleSheet);\n\t// try again if we didn't get it\n\tif (xslDoc == null) ker.loadURL(Env.url +'/xsl/'+ stylesheet, importStyleSheet);\n\tker.loadMan.release();\n\t\n\t\nfunction importStyleSheet(t)\n{\n\tif (t.responseXML != undefined) {\n\t\ttry\n\t\t{\n\t\t\t\t\t\n\t\t\txslDoc = t.responseXML;\n\t\t\t\n\t\t\tif (window.ActiveXObject == null)\n\t\t\t{\n\t\t\t\txslProc = new XSLTProcessor();\n\t\t\t\txslProc.importStylesheet(xslDoc);\n\t\t\t}\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\talert('error on : '+Env.url +'/xsl/'+ stylesheet+'\\n'+t.responseText+\" \"+t.responseXML+\" \"+e);\n\t\t}\n\t}\n}\n\n//=====================================================================================\n//===\n//=== API methods\n//===\n//=====================================================================================\n\nthis.transform = function(node)\n{\n\tvar doc = buildDocument(node);\n\t\n\tif (window.ActiveXObject)\n\t{\n\t\ttry\n\t\t{\n\t\t\tvar text = doc.transformNode(xslDoc);\n\t\t\tvar xmlDoc = new ActiveXObject('Microsoft.XMLDOM');\n\t\t\t\n\t\t\txmlDoc.async = 'false';\n\t\t\n\t\t\tif (xmlDoc.loadXML(text) == false)\n\t\t\t\tthrow 'Parse error for:\\n\\n'+text;\n\t\t\n\t\t\t//--- convert XML result into a DOM result\n\t\t\treturn xml.convert(xmlDoc);\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\tthrow 'Cannot transform with stylesheet.\\nFile : '+ xslSheet;\n\t\t}\n\t}\n\telse\n\t\treturn xslProc.transformToDocument(doc);\n}\n\n//=====================================================================================\n\nthis.transformToText = function(node)\n{\n\tvar doc = buildDocument(node);\n\t\n\tif (window.ActiveXObject)\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn doc.transformNode(xslDoc);\n\t\t}\n\t\tcatch(e)\n\t\t{\n\t\t\tthrow 'Cannot transform with stylesheet.\\nFile : '+ xslSheet;\n\t\t}\n\t}\n\telse\n\t\treturn xml.toString(xslProc.transformToDocument(doc));\n}\n\n//=====================================================================================\n//===\n//=== Private methods\n//===\n//=====================================================================================\n\nfunction buildDocument(node)\n{\n\tvar strings = (!loader) \n\t\t\t\t\t\t? Sarissa.getDomDocument().createElement('strings')\n\t\t\t\t\t\t: loader.getNode();\n\n\tvar doc = Sarissa.getDomDocument();\n\tvar root = doc.createElement('root');\n\t\n\tdoc .appendChild(root);\n\troot.appendChild(node.cloneNode(true));\n\troot.appendChild(createEnv(doc));\n\troot.appendChild(strings.cloneNode(true));\n\t\n\treturn doc;\n}\n\n//=====================================================================================\n\nfunction createEnv(doc)\n{\n\tvar env = doc.createElement('env');\n\t\n\tvar elUrl = doc.createElement('url');\n\tvar elLocUrl = doc.createElement('locUrl');\n\tvar elLocSer = doc.createElement('locService');\n\tvar elLang = doc.createElement('language');\n\t\n\tenv.appendChild(elUrl);\n\tenv.appendChild(elLocUrl);\n\tenv.appendChild(elLocSer);\n\tenv.appendChild(elLang);\n\t\n\telUrl .appendChild(doc.createTextNode(Env.url));\n\telLocUrl.appendChild(doc.createTextNode(Env.locUrl));\n\telLocSer.appendChild(doc.createTextNode(Env.locService));\n\telLang .appendChild(doc.createTextNode(Env.lang));\n\t\n\treturn env;\n}\n\n//=====================================================================================\n}", "title": "" }, { "docid": "d2630ecf923f5446df8b84cc4533d0cb", "score": "0.6408026", "text": "function loadXSLDoc(dname)\n{ \n xslhttp=new XMLHttpRequest();\n xslhttp.open(\"GET\",dname,false);\n xslhttp.send(\"\");\n return xslhttp.responseXML;\n}", "title": "" }, { "docid": "1247fe5e2f3a0f13bf161abf63621e21", "score": "0.59620494", "text": "function loadXMLDoc( url, processor ) {\n // native\n if( ! processor ) processor = processReqChange\n if( window.XMLHttpRequest ) {\n req = new XMLHttpRequest()\n req.onreadystatechange = processor\n req.open( \"GET\", url, true )\n req.setRequestHeader( 'REFERER', location.href );\n req.send( null )\n // ie/windows/activex\n }\n else {\n isIE = true\n req = new ActiveXObject( \"Microsoft.XMLHTTP\" )\n if( req ) {\n req.onreadystatechange = processor\n req.open( \"GET\", url, true )\n req.send()\n }\n }\n}", "title": "" }, { "docid": "fb404a978fa84645e67f0f129aecaa89", "score": "0.5956473", "text": "function loadFromUrl(url){\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", url, false);\n xmlhttp.send('');\n var responseText = xmlhttp.responseText;\n var oDomDoc = Sarissa.getDomDocument();\n oDomDoc = (new DOMParser()).parseFromString(responseText, \"text/xml\");\n return oDomDoc;\n}", "title": "" }, { "docid": "08fc8667a214f1f72bd34378e406ed05", "score": "0.59479654", "text": "function loadXMLDoc(url)\n{\n\t// branch for native XMLHttpRequest object\n\tif (window.XMLHttpRequest)\n\t{\n\t\treq = new XMLHttpRequest();\n\t\treq.onreadystatechange = processReqChange;\n\t\treq.open(\"GET\", url, true);\n\t\treq.send(null);\n\t// branch for IE/Windows ActiveX version\n\t}\n\telse if (window.ActiveXObject)\n\t{\n\t\tisIE = true;\n\t\treq = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tif (req)\n\t\t{\n\t\t\treq.onreadystatechange = processReqChange;\n\t\t\treq.open(\"GET\", url, true);\n\t\t\treq.send();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "05fcb32fd275671c98a317dea82d0327", "score": "0.5946678", "text": "function loadStyle(url) {\n var head = document.getElementsByTagName('head')[0],\n link = document.createElement('link');\n link.setAttribute('href', url);\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('type', 'text/css');\n\n var sheet, cssRules;\n // get the correct properties to check for depending on the browser\n if ('sheet' in link) {\n sheet = 'sheet';\n cssRules = 'cssRules';\n }\n else {\n sheet = 'styleSheet';\n cssRules = 'rules';\n }\n // insert the link node into the DOM\n head.appendChild(link);\n\n return link;\n }", "title": "" }, { "docid": "6fc5c84196f6d514987cfa924645b770", "score": "0.5914899", "text": "function loadStylesheet(doc, url, f) {\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var response, e_2, s, rules;\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 3]);\r\n return [4 /*yield*/, _utils_Net__WEBPACK_IMPORTED_MODULE_18__[\"load\"](url)];\r\n case 1:\r\n response = _a.sent();\r\n return [3 /*break*/, 3];\r\n case 2:\r\n e_2 = _a.sent();\r\n console.error(\"Failed to load stylesheet\", url, e_2);\r\n return [2 /*return*/];\r\n case 3:\r\n s = doc.createElement(\"style\");\r\n s.textContent = response.response;\r\n doc.head.appendChild(s);\r\n _a.label = 4;\r\n case 4:\r\n _a.trys.push([4, , 7, 8]);\r\n return [4 /*yield*/, getCssRules(s)];\r\n case 5:\r\n rules = _a.sent();\r\n return [4 /*yield*/, eachStylesheet(doc, url, rules, f)];\r\n case 6:\r\n _a.sent();\r\n return [3 /*break*/, 8];\r\n case 7:\r\n doc.head.removeChild(s);\r\n return [7 /*endfinally*/];\r\n case 8: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "6e8c06a7868ea3a948ec7e6ddeab4cf8", "score": "0.58952695", "text": "function transformXSL(viaXML, fileName) {\n\t//Code for IE\n\tif (window.ActiveXObject || window.navigator.userAgent.indexOf(\"Trident/7.0\") > 0) {\n\t\t//Initialize all the XSLT methods\n\t\tvar xslt = new ActiveXObject(\"Msxml2.XSLTemplate.3.0\");\n\t\tvar xslDoc = new ActiveXObject(\"Msxml2.FreeThreadedDOMDocument.3.0\");\n\t\txslDoc.async = false;\n\t\txslDoc.load(fileName);\n\n\t\t//Load the XML\n\t\tconsole.log(typeof window.XMLSerializer != \"undefined\");\n\t\tvar xmlDoc = new ActiveXObject(\"Msxml2.DOMDocument.6.0\");\n\t\txmlDoc.loadXML('<?xml version=\"1.0\"?>' + serializeXmlNode(viaXML));\n\n\t\tif (xslDoc.parseError.errorCode != 0) {\n\t\t\tvar myErr = xslDoc.parseError;\n\t\t\tlogJS(\"You have error \" + myErr.reason);\n\t\t} else {\n\t\t\txslt.stylesheet = xslDoc;\n\t\t\tvar xslProc = xslt.createProcessor();\n\t\t\txslProc.input = xmlDoc;\n\t\t\txslProc.transform();\n\n\t\t\treturn xslProc.output;\n\t\t}\n\t}\n\t//Code for Normal browsers like Chrome, Firefox, Opera, etc.\n\telse if (document.implementation && document.implementation.createDocument) {\n\t\tvar viaXSL = loadXML(fileName);\n\t\txsltProcessor = new XSLTProcessor();\n\t\txsltProcessor.importStylesheet(viaXSL);\n\t\tresultDocument = xsltProcessor.transformToFragment(viaXML, document);\n\t\treturn resultDocument;\n\t}\n}", "title": "" }, { "docid": "549bcde7121d8fe8796ec43dad5efbe4", "score": "0.58938617", "text": "function xmlLoader(url){\n if(window.XMLHttpRequest){\n var Loader = new XMLHttpRequest();\n Loader.open(\"GET\", url ,false);\n Loader.send(null);\n return Loader.responseXML;\n }else if(window.ActiveXObject){\n var Loader = new ActiveXObject(\"Msxml2.DOMDocument.3.0\");\n Loader.async = false;\n Loader.load(url);\n return Loader;\n }\n}", "title": "" }, { "docid": "a3140b8a56b7087891df7b9a37305be7", "score": "0.58365774", "text": "function loadXMLDoc(url) {\n\txmlhttp=null\n\t// code for Mozilla, etc.\n\tif (window.XMLHttpRequest) {\n\t\txmlhttp=new XMLHttpRequest()\n\t}\n\t// code for IE\n\telse if (window.ActiveXObject) {\n\t\txmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\")\n\t}\n\t\n\tif (xmlhttp!=null) {\n\t\txmlhttp.onreadystatechange=state_Change\n\t\txmlhttp.open(\"GET\",url,false)\n\t\txmlhttp.send(null)\n\t\t//gXMLDocument = xmlhttp.responseXML\n\t\treturn xmlhttp.responseXML\n\t} else {\n\t\talert(\"Your browser does not support XMLHTTP.\")\n\t}\n}", "title": "" }, { "docid": "8008e9efa4208dbed35486c5326e3e19", "score": "0.58212364", "text": "function loadXML(url) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send();\n return xhr.responseXML;\n }", "title": "" }, { "docid": "09fb1a9b2cd46c5a8556c04b922cddb8", "score": "0.57793677", "text": "function ajax_xslproc(url, ready_cb, timeout_cb, timeout_ms)\r\n{\r\n\tif (!AJAX_BROWSER_HAS_XMLHTTP || !AJAX_BROWSER_HAS_XSLT) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/*\r\n\t * Private members.\r\n\t */\r\n\tvar xslproc_url = url;\r\n\tvar xslproc_timeout_ms = timeout_ms || 6000;\r\n\tvar xslproc_timeout_id = 0;\r\n\tvar xslproc_ready_app_cb = ready_cb;\r\n\tvar xslproc_timeout_app_cb = timeout_cb || null;\r\n\r\n\t/*\r\n\t * This is incorrectly set in inner anonymous functions.\r\n\t */\r\n\tvar that = this;\r\n\r\n\t/*\r\n\t * xsl_ready_cb()\r\n\t *\tPrivate method called once the XSL is loaded, that creates\r\n\t *\tan XSLT processor, and call back the application function.\r\n\t */\r\n\tvar xsl_ready_cb = function(xslobj) {\r\n\t\tif (window.XMLHttpRequest && window.XSLTProcessor) {\r\n\t\t\tthat.xslproc = new XSLTProcessor();\r\n\t\t\tthat.xslproc.importStylesheet(xslobj.xmldoc);\r\n\t\t} else if (window.ActiveXObject) {\r\n\t\t\tvar xslft = new ActiveXObject(MSXML_FT_ID);\r\n\t\t\txslft.loadXML(xslobj.textdoc);\r\n\t\t\tvar xsltemp = new ActiveXObject(MSXML_XSL_ID);\r\n\t\t\txsltemp.stylesheet = xslft;\r\n\t\t\tthat.xslproc = xsltemp.createProcessor();\r\n\t\t}\r\n\t\txslproc_ready_app_cb(that);\r\n\t};\r\n\r\n\t/*\r\n\t * Instantiate a XMLHTTPRequest object.\r\n\t */\r\n\tvar xmlhttp = new ajax_xmlhttp(xslproc_url, xsl_ready_cb, timeout_cb || null, timeout_ms || null);\r\n\tif (!xmlhttp.retrieve_xml) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t/*\r\n\t * retrieve_xsl()\r\n\t *\tPublic method that initiates the XSL retrieval.\r\n\t */\r\n\tthis.retrieve_xsl = function() {\r\n\t\txmlhttp.retrieve_xml();\r\n\t};\r\n\r\n\t/*\r\n\t * add_param()\r\n\t *\tPublic method that sets a value for a parameter to be used in later\r\n\t *\tXSL transformations.\r\n\t */\r\n\tthis.add_param = function(name, value) {\r\n\t\tif (window.XMLHttpRequest && window.XSLTProcessor) {\r\n\t\t\tthat.xslproc.setParameter(null, name, value);\r\n\t\t} else if (window.ActiveXObject) {\r\n\t\t\tthat.xslproc.addParameter(name, value);\r\n\t\t}\r\n\t};\r\n\r\n\t/*\r\n\t * transform()\r\n\t *\tPublic method that transforms a XML DOM document with the loaded XSL\r\n\t *\tinto an HTML DOM object, and eventually appends it to a HTML target element.\r\n\t */\r\n\tthis.transform = function(xmlobj, owner, target) {\r\n\t\tif (window.XMLHttpRequest && window.XSLTProcessor) {\r\n\t\t\tvar fragment = that.xslproc.transformToFragment(xmlobj.xmldoc, owner);\r\n\t\t\tif (target) {\r\n\t\t\t\ttarget.appendChild(fragment);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\treturn fragment;\r\n\t\t} else if (window.ActiveXObject) {\r\n\t\t\tthat.xslproc.input = xmlobj.xmldoc;\r\n\t\t\tthat.xslproc.transform();\r\n\t\t\tvar output = that.xslproc.output;\r\n\t\t\tif (target) {\r\n\t\t\t\tif (output && output.length > 0) {\r\n\t\t\t\t\ttarget.innerHTML = output;\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar result = owner.createElement('span');\r\n\t\t\tresult.outerHTML = output;\r\n\t\t\treturn result;\r\n\t\t}\r\n\t};\r\n}", "title": "" }, { "docid": "0a268b95b8e37d96af6e4e09d439d8c6", "score": "0.5701732", "text": "function loadStyle(url) {\n\tlet css = document.createElement('link');\n\tcss.id = url + '-css';\n\tcss.href = url + '.css';\n\tcss.type = 'text/css';\n\tcss.rel = 'stylesheet'\n\tdocument.head.appendChild(css);\n}", "title": "" }, { "docid": "8fbff1b712fa9cbd49253861c0008b37", "score": "0.5694509", "text": "function loadXMLDoc(url)\n{\n\tvar log=document.getElementById(\"log\");\n\t//log.innerHTML+=\"loadXMLDoc()<br>\";\n\t//log.innerHTML+=\"-- url = \"+url+\"<br>\";\n\t// branch for native XMLHttpRequest object\n\n\tif (window.XMLHttpRequest)\n\t{\n\t\treq = new XMLHttpRequest();\n\t\treq.onreadystatechange = processReqChange;\n\t\treq.open(\"GET\", url, true);\n\t\treq.send(null);\n\t// branch for IE/Windows ActiveX version\n\t}\n\telse if (window.ActiveXObject)\n\t{\n\t\tisIE = true;\n\t\treq = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tif (req)\n\t\t{\n\t\t\treq.onreadystatechange = processReqChange;\n\t\t\treq.open(\"GET\", url, true);\n\t\t\treq.send();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "496024f192da94e549d7d5219143a816", "score": "0.5679091", "text": "function loadCSS(url) {\r\n $('<link>').attr('rel', 'stylesheet').attr('href', url).appendTo('head');\r\n }", "title": "" }, { "docid": "078d4e149e636539ff8af41c01924a0c", "score": "0.5652202", "text": "function loadCSS(url) {\n $('<link>').attr('rel', 'stylesheet').attr('href', url).appendTo('head');\n }", "title": "" }, { "docid": "fb5ad70523713a368966230416135f1d", "score": "0.56081223", "text": "function transformXSLT( XSLStyleSheet, XMLData, InsertElementID) {\n if (window.ActiveXObject) {\n //Code for internet explorer\n TransformDoc = XMLData.transformNode(XSLStyleSheet);\n document.getElementById(InsertElementID).innerHTML = TransformDoc;\n }\n else if (document.implementation && document.implementation.createDocument) {\n //Code for mozilla\n XSLTProcessor = new XSLTProcessor();\n XSLTProcessor.importStylesheet(XSLStyleSheet);\n TransformDoc = XSLTProcessor.transformToFragment(XMLData, document);\n document.getElementById(InsertElementID).appendChild(TransformDoc);\n }\n else {\n return false;\n }\n\n\n}", "title": "" }, { "docid": "78b0c75b83ce2dd68b717866e3c37b02", "score": "0.5571604", "text": "function load_css(url) {\n var e = domConstruct.create('link', {\n 'href': url,\n 'type': 'text/css',\n 'rel': 'stylesheet',\n 'media': 'screen'\n });\n domConstruct.place(e, $('head')[0], 'first');\n }", "title": "" }, { "docid": "a1b1bbea72b6a3d23bcb255ea241843c", "score": "0.5548592", "text": "function transform(XMLdoc,targetStyle,targetDiv){\r\n \tif(window.navigator.appName != 'Microsoft Internet Explorer') {\r\n\t\tvar xsltProcessor = new XSLTProcessor();\r\n\t\tvar request = new XMLHttpRequest();\r\n\t\trequest.open(\"GET\",targetStyle , false);\r\n\t\trequest.send(null);\r\n\t\t//load the xsl file\r\n\t\txsltProcessor.importStylesheet(request.responseXML)\r\n\t\t\t\t\r\n\t\tfragment = xsltProcessor.transformToFragment(XMLdoc,document);\r\n\t\t\r\n\t\t//remove all the child nodes of the target div, and append the new processed root.\r\n\t\ttargetDiv=document.getElementById(targetDiv);\r\n\t\twhile(targetDiv.childNodes.length!=0)\r\n\t\t\ttargetDiv.removeChild(targetDiv.childNodes[0]);\r\n\r\n\t\r\n\t\ttargetDiv.appendChild(fragment);\r\n\t}else{\r\n\t\t// Load the XSL\r\n\t\t/*\r\n\t\t//var xsl = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t//var xsl = new ActiveXObject(\"Msxml2.FreeThreadedDOMDocument.3.0\");\r\n\t\txsl.async = \"false\";\r\n\t\txsl.load(targetStyle);\r\n\t\tfragment=XMLdoc.transformNode(xsl);//*/\r\n\t\t\r\n\t\t/*targetDiv=document.getElementById(targetDiv);\r\n\t\twhile(targetDiv.childNodes.length!=0)\r\n\t\t\ttargetDiv.removeChild(targetDiv.childNodes[0]);\r\n\t\r\n\t\ttargetDiv.appendChild(fragment);*/\r\n\t\t\r\n\t}\r\n}", "title": "" }, { "docid": "f60a715e83b4a783f2bd7104b4f86382", "score": "0.54815686", "text": "function loadFromURL(url, callback)\n{\n loadURL(url, xml=>callback(loadFromString(xml)));\n}", "title": "" }, { "docid": "973dcd8893fe267664d6bd94794d97a8", "score": "0.5455757", "text": "function handleStyleSheet(url, pathname) {\n \tvar css = fs.readFileSync(pathname, 'utf8'),\n \t\ttemplate = getTemplate('stylesheet.jst');\n \t\tstyle = unescape(path.basename(url.pathname, '.css')),\n \t\toptions = { dataAttr: true, debug: defaults.debug, out: 'html', populate: true };\n \tfile = tmpl(template, { html: css2html(css, options), style: style, url: url.pathname });\n \treturn { file: file };\n }", "title": "" }, { "docid": "c0cac041732a572a0d5ce174eb124b5f", "score": "0.5413123", "text": "_loadStylesheet (url) {\n let linkElement = Ember.$(`<link rel=\"stylesheet\" href=\"${url}\" type=\"text/css\"/>`);\n let promise = new Ember.RSVP.Promise((resolve, reject)=>{\n linkElement.one('load', ()=> Ember.run(null, resolve));\n linkElement.one('error', (evt)=> Ember.run(null, reject, evt));\n });\n document.head.appendChild(linkElement[0]);\n return promise;\n }", "title": "" }, { "docid": "90cefffed801c1550b867bf6af101efe", "score": "0.5304718", "text": "function loadDoc(url, cFunction) {\n var xhttp;\n xhttp=new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n cFunction(this);\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n }", "title": "" }, { "docid": "2bc75f4395e1685a86ae1eaab464f785", "score": "0.528893", "text": "function browseForXSLTFile()\n{\n var fileName = \"\";\n var theXSLFilter\t= new Array(LABEL_XSLTFILTER);\n fileName = dw.browseForFileURL(\"select\",dw.loadString(\"XMLXSL_SB/SelectXSLT\"),false,false,theXSLFilter);\n if (fileName) \n {\n // If we are using ColdFusion, then we probably want this URL\n // for a cflocation tag, therefore we should strip any cfoutput tags.\n // This will be a no-op for other server models.\n if (dwscripts.stripCFOutputTags != null)\n {\n fileName = dwscripts.stripCFOutputTags(fileName);\n } \n _xslFile.setValue(fileName);\n }\t\n}", "title": "" }, { "docid": "7af0f8a5fee4fce5c491781228c0dcee", "score": "0.52885574", "text": "function loadCSS(urlToLoadFrom) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlet link = document.createElement(\"link\");\n\n\t\t\tlet baseURL = urlToLoadFrom ? urlToLoadFrom : GSLB_BASE_URL;\n\n\t\t\tlink.href = baseURL + \"/embeddedservice/asyncclient/bootstrap\" + (embeddedservice_bootstrap.settings.devMode ? \"\" : \".min\") + \".css\";\n\t\t\tlink.type = \"text/css\";\n\t\t\tlink.rel = \"stylesheet\";\n\n\t\t\tlink.onerror = reject;\n\t\t\tlink.onload = resolve;\n\n\t\t\tdocument.getElementsByTagName(\"head\")[0].appendChild(link);\n\t\t});\n\t}", "title": "" }, { "docid": "0fb00644ddebb77aede4653e4f502574", "score": "0.52839833", "text": "function XSLTHelper(xslt)\n{\n var xsltDoc = xslt;\n\n this.process = function(xml)\n {\n if(window.ActiveXObject) //IE\n {\n xml.setProperty(\"SelectionLanguage\", \"XPath\")\n return xml.transformNode(xsltDoc)\n }\n else if(document.implementation && document.implementation.createDocument)\n {\n var xsltProcessor = new XSLTProcessor();\n xsltProcessor.importStylesheet(xsltDoc);\n return xsltProcessor.transformToFragment(xml, document);\n }\n else //Not supported\n {\n return null;\n }\n }\n}", "title": "" }, { "docid": "10493c7530e2ccdd62292b4f21c5e460", "score": "0.52782834", "text": "function loadXMLDoc(filename) \n{\n let xhttp = null;\n if (window.XMLHttpRequest) \n {\n xhttp = new XMLHttpRequest();\n } else \n {\n xhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xhttp.open(\"GET\", filename, false);\n xhttp.send();\n return xhttp.responseXML;\n}", "title": "" }, { "docid": "6474a4a5820d97347c9668400af15d44", "score": "0.52456737", "text": "function loadWebPageXml(url, cb) {\r\n\tvar h = CC[\"@mozilla.org/xmlextras/xmlhttprequest;1\"].createInstance()\r\n\tvar async;\r\n\tif (cb) {\r\n\t\tasync = true;\r\n\t} else {\r\n\t\tasync = false;\r\n\t}\r\n\th.overrideMimeType(\"text/xml\");\r\n\th.open(\"get\", url, async)\r\n\tsetCoScripterRequestHeaders(h,url);\r\n\th.onload = function(event) {\r\n\t\tcb(event.currentTarget.responseXML);\r\n\t}\r\n\th.send(\"\")\r\n\tif (cb) {\r\n\t\treturn;\r\n\t} else {\r\n\t\treturn h.responseXML;\r\n }\r\n}", "title": "" }, { "docid": "59a7905e41752f6389c501f7ea66bbc3", "score": "0.5240086", "text": "function loadCss(urlOrVersion, before) {\n var url = getCssUrl(urlOrVersion);\n var link = getCss(url);\n if (!link) {\n // create & load the css link\n link = createStylesheetLink(url);\n insertLink(link, before);\n }\n return link;\n}", "title": "" }, { "docid": "faa8a4eed0f3afae54fb3baa2c858a79", "score": "0.52255344", "text": "function loadXml(xmlUrl) {\n var xmldoc = null;\n\n // create the xml doc object\n try {\n xmldoc = document.implementation.createDocument(\"\", \"\", null); //Firefox, Mozilla, Opera, etc.\n }\n catch (e) {\n try {\n xmldoc = new ActiveXObject(\"Microsoft.XMLDOM\"); // IE/WScriptShell\n } catch (e) {\n alert(e.message);\n }\n }\n\n // load the content to xml doc object from xmlurl\n try {\n // make load synchronized\n xmldoc.async = false;\n xmldoc.load(xmlUrl);\n return xmldoc;\n } catch(e){\n if(e.message.indexOf(\"Object #<Document> has no method 'load'\") > -1) {\n try //Google Chrome\n {\n var xmlhttp = new window.XMLHttpRequest();\n xmlhttp.open(\"GET\",xmlUrl,false);\n xmlhttp.send(null);\n return xmlhttp.responseXML.documentElement;\n } catch (e) {\n alert(e.message + \"\\n\" + \"Please check the file:\" + xmlUrl + \" is correct.\");\n }\n } else if(e.message.indexOf('Access to restricted URI denied') != -1) {\n if(os.toLowerCase()==\"firefox\") {\n alert(e.message + \"\\n\" + \"1. navigate to about:config\\n2. (double click)set security.fileuri.strict_origin_policy = false\");\n } else {\n alert(e.message + \"\\n\" + \"Do not support the \" + os + \", you can retry in firefox.\");\n }\n } else {\n alert(e.message + \"\\n\" + \"Please check the file:\" + xmlUrl + \" is correct.\");\n }\n }\n return null;\n}", "title": "" }, { "docid": "a8f1614265844260571fbcfe5fa00071", "score": "0.52056485", "text": "function loadStyle(url, callback, frame) {\r\n // TODO: check to see if the domain is different, if so don't mess with the url - David\r\n var dir = url.split('/');\r\n dir.pop();\r\n dir = dir.join('/');\r\n if (dir.substr(0, 7) != 'http://') {\r\n dir = server + dir;\r\n }\r\n \r\n //console.log('loadStyle: ' + url);\r\n loadFile(url, function(rx) {\r\n var css = rx.responseText;\r\n // this needs to be smarter, only works on directory specific urls\r\n css = css.replace(/url\\(([^)]+)\\)/g, 'url(' + dir + '/$1)');\r\n \r\n // if it's a frame load it into the frame\r\n if(frame)\r\n {\r\n var doc = frame.contentDocument;\r\n\r\n if( doc.getElementsByTagName('head').length != 0 )\r\n {\r\n var head = doc.getElementsByTagName('head')[0];\r\n }\r\n else\r\n {\r\n // In Safari iframes don't get the head element by default - David\r\n // Mootools-ize body\r\n $(doc.body);\r\n var head = new Element( 'head' );\r\n head.injectBefore( doc.body );\r\n }\r\n \r\n var style = doc.createElement('style');\r\n style.setAttribute('type', 'text/css');\r\n style.appendChild(doc.createTextNode(css)); // You can not use setHTML on style elements in Safari - David\r\n head.appendChild(style);\r\n }\r\n else\r\n {\r\n GM_addStyle(css);\r\n }\r\n \r\n if (typeof callback == 'function') \r\n {\r\n callback();\r\n } \r\n\r\n });\r\n }", "title": "" }, { "docid": "de3872e374b166909cd9f4cc32cd5af9", "score": "0.51761025", "text": "function importStylesheet(page) {\n\tif (page.indexOf('http://') === -1 && page.indexOf('https://') === -1 && page.indexOf('//') !== 0 && page.indexOf('file:///') === -1) {\n\t\tpage = wgScript + '?action=raw&ctype=text/css&smaxage=0&title=' + encodeURIComponent(page.replace(/ /g,'_'));\n\t}\n\treturn document.createStyleSheet ? document.createStyleSheet(page) : appendCSS('@import \"' + page + '\";');\n}", "title": "" }, { "docid": "3675da935c7e846b22b9921782e1c3bc", "score": "0.5161574", "text": "function loadFromString(scxml)\n{\n const xmldoc = (new DOMParser).parseFromString(scxml, \"text/xml\");\n return wrapNode(xmldoc);\n}", "title": "" }, { "docid": "f37910fe9601d700366b4eeb3150f323", "score": "0.5142925", "text": "function loadStyleSheet(stylesheet) {\n\t\n\tstylesheet.addStyle(\"@page\", \"margin:10mm 10mm 10mm 20mm\");\n\tstylesheet.addStyle(\"body\", \"font-family:\" + param.styleFontText);\n\n\t//Define lines\n\tstylesheet.addStyle(\".horizontalLine\", \"border-bottom:thin solid black\");\n\n\t//Define some font styles\n\tstylesheet.addStyle(\".bold\", \"font-weight:bold\");\n\tstylesheet.addStyle(\".italic\", \"font-style:italic\");\n\tstylesheet.addStyle(\".font8\", \"font-size:8px\");\n\tstylesheet.addStyle(\".font12\", \"font-size:12px\");\n\tstylesheet.addStyle(\".font16\", \"font-size:16px\");\n\n\t//Define some background colors\n\tstylesheet.addStyle(\".backgroundColorBlue\", \"background-color:#2C4068\");\n\tstylesheet.addStyle(\".backgroundColorGrey\", \"background-color:#eeeeee\");\n\n\t//Define text colors (by default it's black)\n\tstylesheet.addStyle(\".text-color-white\", \"color:#fff\");\n\n\t//Define text alignments\n\tstylesheet.addStyle(\".alignRight\", \"text-align:right\");\n\tstylesheet.addStyle(\".alignCenter\", \"text-align:center\");\n\tstylesheet.addStyle(\".alignLeft\", \"text-align:left\");\n\n\n\t//Define columns width\n\tstylesheet.addStyle(\".col1\", \"width:\" + param.columWidth[0]);\n\tstylesheet.addStyle(\".col2\", \"width:\" + param.columWidth[1]);\n\tstylesheet.addStyle(\".col3\", \"width:\" + param.columWidth[2]);\n\tstylesheet.addStyle(\".col4\", \"width:\" + param.columWidth[3]);\n\n\t//Define table style\n\tstyle = stylesheet.addStyle(\"table\");\n\tstyle.setAttribute(\"width\", \"100%\");\n\tstylesheet.addStyle(\"table.table td\", \"border:thin solid \" + param.styleColorBorderTable);\n\n\treturn stylesheet;\n}", "title": "" }, { "docid": "6389f8363ae179d7844eba5382574211", "score": "0.5131618", "text": "function loadDoc(url, cFunction) {\r\n var xhttp;\r\n xhttp=new XMLHttpRequest();\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n cFunction(this);\r\n }\r\n };\r\n xhttp.open(\"GET\", url, true);\r\n xhttp.send();\r\n}", "title": "" }, { "docid": "40fe2b1b2d1df87ef2aacaf73e3d0e11", "score": "0.511706", "text": "function loadXMLDoc(filename)\n {\n if (window.XMLHttpRequest)\n {\n xhttp=new XMLHttpRequest();\n }\n else // code for IE5 and IE6\n {\n xhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xhttp.open(\"GET\",filename,false);\n\n xhttp.send();\n\n return xhttp.responseXML;\n }", "title": "" }, { "docid": "21cfecc47f5b398197d7ef20604df94b", "score": "0.5092433", "text": "function loadCss(url) {\n return new Promise(function(resolve) {\n // Check if file was already added\n var links = document.querySelectorAll('link');\n for (var n = 0, m = links.length; n < m; n++) {\n if (links[n].rel === 'stylesheet' && links[n].getAttribute('href') === url) {\n resolve();\n return;\n }\n }\n\n // Add file and wait till it loads\n var link = document.createElement('link');\n link.rel = 'stylesheet';\n link.onload = resolve;\n link.onerror = function () {\n app.showErrorAlert('Error loading CSS File: ' + url);\n resolve();\n };\n link.href = url;\n document.head.appendChild(link);\n });\n }", "title": "" }, { "docid": "625660e7f3331acf11d733721bbbde83", "score": "0.5067425", "text": "function registerStyleSheet(url) {\n\t var uri = ioService.newURI(url, null, null);\n\t if (!ssService.sheetRegistered(uri, ssService.AGENT_SHEET)) {\n\t ssService.loadAndRegisterSheet(uri, ssService.AGENT_SHEET);\n\t }\n\t}", "title": "" }, { "docid": "870b2153e3738cc613c3924fc90e7e8e", "score": "0.5064155", "text": "function loadXMLDoc(filename, handler)\n{\n if (window.ActiveXObject)\n {\n xhttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n }\n else\n {\n xhttp = new XMLHttpRequest();\n }\n\n xhttp.open(\"GET\", filename);\n xhttp.onload = handler;\n try {\n xhttp.responseType = \"msxml-document\"\n } catch(err) {} // Helping IE11\n\n xhttp.send();\n}", "title": "" }, { "docid": "8f06476dfc84a6a9bf163864c7a87be6", "score": "0.5060056", "text": "load(url) {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open(\"GET\", url, false);\n xmlHttp.send();\n return xmlHttp.responseText;\n }", "title": "" }, { "docid": "73ab1a22e87c960433181a6f36d436ec", "score": "0.5052203", "text": "function xsltProcess(xmlDoc, stylesheet) {\n var output = domCreateDocumentFragment(new XDocument);\n xsltProcessContext(new ExprContext(xmlDoc), stylesheet, output);\n var ret = xmlText(output);\n return ret;\n}", "title": "" }, { "docid": "2f33dca53ecf04660925705ffbdda46e", "score": "0.50498843", "text": "function load_css_file(filename) {\n var fileref = document.createElement('link');\n fileref.setAttribute(\"type\", \"text/css\");\n fileref.setAttribute(\"href\", filename);\n fileref.setAttribute(\"rel\", \"stylesheet\");\n\n if (typeof fileref != \"undefined\")\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n}", "title": "" }, { "docid": "5a239f1b5441ac7ec1b2917e97faa423", "score": "0.5047774", "text": "function loadDisplay(data)\n{\n var processor = new XSLTProcessor();\n var xslDoc = Sarissa.getDomDocument();\n xslDoc.async = false;\n xslDoc.load(stylesheet);\n processor.importStylesheet(xslDoc);\n var parser = new DOMParser();\n var dom = parser.parseFromString(data, \"text/xml\");\n Sarissa.updateContentFromNode(dom, $(\"display\"), processor);\n}", "title": "" }, { "docid": "97af886b6c4e9b46e59966e8d103d603", "score": "0.50474143", "text": "function loadDoc(url, callback) {\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function () {\r\n if (this.readyState == 4 && this.status == 200) {\r\n callback(this);\r\n }\r\n };\r\n xhttp.open(\"GET\", url, true);\r\n xhttp.send();\r\n}", "title": "" }, { "docid": "02e1d5d3720fb0eb94b2981a57908d5f", "score": "0.5045421", "text": "function convertToXSLT()\n{\n\tvar dom = dw.getDocumentDOM();\n\tif (dom != null)\n\t{\n\t\tvar domXSLT;\n\t\tvar docType;\n\t\tvar strStyleSheetBegin = '<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\">\\n<xsl:output method=\"html\"/>\\n<xsl:template match=\"/\">\\n';\n\t\tvar strStyleSheetEnd = '\\n</xsl:template>\\n</xsl:stylesheet>';\n\n\t\tvar outerHTML = dom.documentElement.outerHTML;\n\t\tvar innerHTML = dom.documentElement.innerHTML;\n\t\tif(outerHTML == innerHTML)\n\t\t{\n\t\t\t// creating a fragment\n\t\t\t// merge the xsl:stylesheet, xsl:output, xsl:template tags\n\t\t\touterHTML = strStyleSheetBegin + innerHTML + strStyleSheetEnd;\n\t\t\tdocType = \"XSLT-fragment\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// creating a full page\n\t\t\tvar outerHTMLlower = outerHTML.toLowerCase();\n\t\t\tvar strBeginHTML = \"<html\";\n\t\t\tvar strEndHTML = \"</html>\";\n\n\t\t\tvar indexStartBeforeHTML = 0;\n\t\t\tvar indexEndBeforeHTML = outerHTMLlower.indexOf(strBeginHTML);\n\t\t\tvar strBeforeHTML = \"\";\n\t\t\tif(indexStartBeforeHTML >= 0 && indexEndBeforeHTML >= 0 && indexStartBeforeHTML <= indexEndBeforeHTML)\n\t\t\t{\n\t\t\t\tstrBeforeHTML = outerHTML.substring(indexStartBeforeHTML, indexEndBeforeHTML);\n\t\t\t}\n\t\t\tvar indexStartHTML = indexEndBeforeHTML;\n\t\t\tvar indexEndHTML = outerHTML.indexOf(innerHTML);\n\t\t\tvar strHTML = \"\";\n\t\t\tif(indexStartHTML >= 0 && indexEndHTML >= 0 && indexStartHTML <= indexEndHTML)\n\t\t\t{\n\t\t\t\tstrHTML = outerHTML.substring(indexStartHTML, indexEndHTML);\n\t\t\t}\n\t\t\tvar indexStartAfterHTML = outerHTMLlower.indexOf(strEndHTML) + strEndHTML.length;\n\t\t\tvar indexEndAfterHTML = outerHTML.length;\n\t\t\tvar strAfterHTML = \"\";\n\t\t\tif(indexEndBeforeHTML >= 0 && indexStartAfterHTML >= 0 && indexEndAfterHTML >= 0 && indexStartAfterHTML <= indexEndAfterHTML)\n\t\t\t{\n\t\t\t\tstrAfterHTML = outerHTML.substring(indexStartAfterHTML, indexEndAfterHTML);\n\t\t\t}\n\n\t\t\t// merge the xsl:stylesheet, xsl:output, xsl:template tags\n\t\t\touterHTML = strBeforeHTML + strStyleSheetBegin + strHTML + innerHTML + strEndHTML + strStyleSheetEnd + strAfterHTML;\n\t\t\tdocType = \"XSLT\";\n\t\t}\n\n\t\t// create new XSLT document with old converted content\n\t\tdomXSLT = dw.createDocument(false, docType);\n\t\tdomXSLT.setCharSet(dom.getCharSet());\n\t\tdomXSLT.documentElement.outerHTML = outerHTML;\n\t\tvar arrXSLTresults = domXSLT.convertToXSLT();\n\t\t// save the file next to our original file with a .xsl file extension\n\t\tvar strFileName = dom.URL;\n\t\tif(strFileName.length)\n\t\t{\n\t\t\tvar nTempDotPosition = strFileName.indexOf('.');\n\t\t\tvar nDotPosition = strFileName.length;\n\t\t\twhile(nTempDotPosition != -1)\n\t\t\t{\n\t\t\t\tnDotPosition = nTempDotPosition;\n\t\t\t\tnTempDotPosition = strFileName.indexOf('.', nTempDotPosition+1);\n\t\t\t}\n\t\t\tif(DWfile.exists(strFileName.substr(0, nDotPosition) + \".xsl\"))\n\t\t\t{\n\t\t\t\t// find an appropriate file name to save as\n\t\t\t\t// using a counter\n\t\t\t\tvar nCount = 1;\n\t\t\t\twhile(DWfile.exists(strFileName.substr(0, nDotPosition) + \"_\" + nCount.toString() + \".xsl\"))\n\t\t\t\t{\n\t\t\t\t\tnCount++;\n\t\t\t\t}\n\t\t\t\tstrFileName = strFileName.substr(0, nDotPosition) + \"_\" + nCount.toString() + \".xsl\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstrFileName = strFileName.substr(0, nDotPosition) + \".xsl\";\n\t\t\t}\n\t\t\tdw.saveDocument(domXSLT, strFileName);\n\t\t}\n\n\t\t// refresh view so that the CSS renders\n\t\tdomXSLT.refreshViews()\n\t\t\n\t\tif ((arrXSLTresults.missingMapID > 0) ||\n\t\t\t(arrXSLTresults.missingScriptType > 0) ||\n\t\t\t(arrXSLTresults.missingStyleType > 0) ||\n\t\t\t(arrXSLTresults.missingImgAlt > 0) ||\n\t\t\t(arrXSLTresults.missingAreaAlt > 0) )\n\t\t{\n\t\t\tMM_clearLog();\n\t\t\tif ( arrXSLTresults.missingMapID > 0)\n\t\t\t\tMM_note( dw.loadString(\"xhtml/cleanup/missing_map_id\"), arrXSLTresults.missingMapID);\n\t\t\tif ( arrXSLTresults.missingScriptType > 0)\n\t\t\t\tMM_note( dw.loadString(\"xhtml/cleanup/missing_script_type\"), arrXSLTresults.missingScriptType );\n\t\t\tif ( arrXSLTresults.missingStyleType > 0)\n\t\t\t\tMM_note( dw.loadString(\"xhtml/cleanup/missing_style_type\"), arrXSLTresults.missingStyleType );\n\t\t\tif ( arrXSLTresults.missingImgAlt > 0)\n\t\t\t\tMM_note( dw.loadString(\"xhtml/cleanup/missing_img_alt\"), arrXSLTresults.missingImgAlt );\n\t\t\tif ( arrXSLTresults.missingAreaAlt > 0)\n\t\t\t\tMM_note( dw.loadString(\"xhtml/cleanup/missing_area_alt\"), arrXSLTresults.missingAreaAlt );\n\t\t\tMM_showLog();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c706d77ece044b2c45d22f1d0446ca92", "score": "0.50413924", "text": "function loadXMLDoc1(url,cfunc)\n {\n \tif (window.XMLHttpRequest)\n \t{// IE7+, Firefox, Chrome, Opera, Safari 代码\n \t\txmlhttp1=new XMLHttpRequest();\n \t}\n \telse\n \t{// IE6, IE5 代码\n \t\txmlhttp1=new ActiveXObject(\"Microsoft.XMLHTTP\");\n \t}\n \txmlhttp1.onreadystatechange=cfunc;\n \txmlhttp1.open(\"GET\",url,true);\n \txmlhttp1.send();\n }", "title": "" }, { "docid": "44f1cf275aee1e972cef8610f323f56b", "score": "0.5039325", "text": "function loadXMLDoc() {\n \n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function() {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n myFunction(xmlhttp);\n }\n }\n\n xmlhttp.open(\"GET\", \"xml/cd_catalog.xml\", true);\n xmlhttp.send();\n}", "title": "" }, { "docid": "bc98c496a5afb54bb24aba75034e18fa", "score": "0.5033666", "text": "function loadStyle(href, callback) {\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].href == href) {\n return;\n }\n }\n var head = document.getElementsByTagName(\"head\")[0];\n var link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.type = \"text/css\";\n link.href = '/Admin/' + href;\n if (callback) {\n link.onload = function () {\n callback();\n };\n }\n var mainCss = $(head).find('[href$=\"main.css\"]');\n if (mainCss.length !== 0) {\n mainCss[0].before(link);\n } else {\n head.appendChild(link);\n }\n}", "title": "" }, { "docid": "4bbb0b710a31e5b39c643a25df342cfa", "score": "0.5026909", "text": "function loadXMLDoc_Contract(url) {\n\t// branch for native XMLHttpRequest object\n\tif (window.XMLHttpRequest) {\n\t\treq = new XMLHttpRequest();\n\t\treq.onreadystatechange = processReqChange_Contract;\n\t\treq.open(\"GET\", url, true);\n\t\treq.send(null);\n\t// branch for IE/Windows ActiveX version\n\t} else if (window.ActiveXObject) {\n\t\treq = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\tif (req) {\n\t\t\treq.onreadystatechange = processReqChange_Contract;\n\t\t\treq.open(\"GET\", url, true);\n\t\t\treq.send();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c7e567c6714a1104d5765668a974b237", "score": "0.50163734", "text": "function loadCSS() {\n // IE requires us to call this ie-only function\n if (document.createStyleSheet) {\n document.createStyleSheet(study_data.conditionCssUrl);\n \t\tdocument.createStyleSheet(study_data.taskBarCssUrl);\n } else {\n var css = $wlux('<link>').attr({'rel': 'stylesheet',\n 'type': 'text/css',\n 'href': study_data.conditionCssUrl});\n $wlux('head').append(css);\n css = $wlux('<link>').attr({'rel': 'stylesheet',\n 'type': 'text/css',\n 'href': study_data.taskBarCssUrl});\n $wlux('head').append(css);\n }\n }", "title": "" }, { "docid": "d6842fddbcbeaeaa0119c75ac0be1ec3", "score": "0.5007356", "text": "function displayResult(xsl)\n{\nxml=loadXSLDoc(\"clothes.xml\");\nxsl=loadXSLDoc(xsl);\n// code for IE\nif (window.ActiveXObject)\n {\n ex=xml.transformNode(xsl);\n document.getElementById(\"brands\").innerHTML=ex;\n }\n// code for Mozilla, Firefox, Opera, etc.\nelse if (document.implementation && document.implementation.createDocument)\n {\n xsltProcessor=new XSLTProcessor();\n xsltProcessor.importStylesheet(xsl);\n resultDocument = xsltProcessor.transformToFragment(xml,document);\n document.getElementById(\"brands\").innerHTML=\"\";\n document.getElementById(\"brands\").appendChild(resultDocument);\n \n\n\n }\n\n document.getElementById(\"Armani\").checked=true;\n document.getElementById(\"Versace\").checked=true;\n document.getElementById(\"Carlo\").checked=true;\n document.getElementById(\"Jack\").checked=true;\n \n}", "title": "" }, { "docid": "af19c0438f59caa4e350a608a6cefdb8", "score": "0.49815097", "text": "function applyXSLT(xmlString, xslString) {\n var output, i;\n if (window.ActiveXObject || window.hasOwnProperty(\"ActiveXObject\")) { // IE\n var xslt = new ActiveXObject(\"Msxml2.XSLTemplate\"),\n xmlDoc = new ActiveXObject(\"Msxml2.DOMDocument\"),\n xslDoc = new ActiveXObject(\"Msxml2.FreeThreadedDOMDocument\"),\n xslProc;\n\n xmlDoc.loadXML(xmlString);\n xslDoc.loadXML(xslString);\n xslt.stylesheet = xslDoc;\n xslProc = xslt.createProcessor();\n xslProc.input = xmlDoc;\n // [patched from ECDMP] Add parameters to xsl document (addParameter = ie only)\n if (params) {\n for (i = 0; i < params.length; i++) {\n xslProc.addParameter(params[i].key, params[i].value, \"\");\n }\n }\n xslProc.transform();\n output = xslProc.output;\n } else { // Chrome/FF/Others\n var xsltProcessor = new XSLTProcessor();\n xsltProcessor.importStylesheet(xslString);\n // [patched from ECDMP] Add parameters to xsl document (setParameter = Chrome/FF/Others)\n if (params) {\n for (i = 0; i < params.length; i++) {\n xsltProcessor.setParameter(null, params[i].key, params[i].value || \"\");\n }\n }\n output = xsltProcessor.transformToFragment(xmlString, document);\n\n // turn a document fragment into a proper jQuery object\n if (!returnFragment) {\n output = ($('body')\n .append(output)\n .children().last())\n .detach();\n }\n }\n return output;\n }", "title": "" }, { "docid": "0328feb9b16297466627beaee5c611fd", "score": "0.49598393", "text": "function loadXML(next) {\n\n console.log(\"\\nLoading XML ...\");\n\n $.ajax({\n url: \"/data/alex.xml\",\n dataType: \"xml\"\n }).done(function(xmlData) {\n convertData(xmlData);\n });\n }", "title": "" }, { "docid": "f298ec3e035e4459de28d295f4b91132", "score": "0.49570328", "text": "async loadXml(pUrl) {\n return fetch(pUrl).then(async (pResponse) => {\n return pResponse.text();\n }).then((pResponeText) => {\n return new DOMParser().parseFromString(pResponeText, 'text/xml');\n });\n }", "title": "" }, { "docid": "0c0fd2906de40a7d3d9e959cbed33440", "score": "0.49561688", "text": "function loadStyle(href, callback) {\n for (var i = 0; i < document.styleSheets.length; i++) {\n\tif (document.styleSheets[i].href == href) {\n\t return;\n\t}\n }\n var head = document.getElementsByTagName(\"head\")[0];\n var link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.type = \"text/css\";\n link.href = href;\n if (callback) {\n\tlink.onload = function () {\n\t callback();\n\t};\n }\n var mainCss = $(head).find('[href$=\"main.css\"]');\n if (mainCss.length !== 0) {\n\tmainCss[0].before(link);\n } else {\n\thead.appendChild(link);\n }\n}", "title": "" }, { "docid": "b718d0899aba228b9b2fc7f6db86815b", "score": "0.49554363", "text": "function loadXMLDoc() {\n\n // Get an XMLHttpRequest object\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n // Save the document node\n xmlDoc = this.responseXML;\n }\n if (this.response) {\n populatetable();\n }\n };\n xmlhttp.open(\"GET\", \"Student1FINAL.xml\", true);\n xmlhttp.send();\n}", "title": "" }, { "docid": "15fbe7cda6d8e27e7e6c38be437e43d9", "score": "0.49439976", "text": "function parseStyleSheet( url ) {\r\n\t\tif (url) {\r\n\t\t\treturn loadStyleSheet(url).replace(RE_COMMENT, EMPTY_STRING).\r\n\t\t\treplace(RE_IMPORT, function( match, quoteChar, importUrl, quoteChar2, importUrl2 ) { \r\n\t\t\t\treturn parseStyleSheet(resolveUrl(importUrl || importUrl2, url));\r\n\t\t\t}).\r\n\t\t\treplace(RE_ASSET_URL, function( match, quoteChar, assetUrl ) { \r\n\t\t\t\tquoteChar = quoteChar || EMPTY_STRING;\r\n\t\t\t\treturn \" url(\" + quoteChar + resolveUrl(assetUrl, url) + quoteChar + \") \"; \r\n\t\t\t});\r\n\t\t}\r\n\t\treturn EMPTY_STRING;\r\n\t}", "title": "" }, { "docid": "43314db423e32fa51af9687958d6bcc1", "score": "0.49315646", "text": "function parseStyleSheet( url ) {\n\t\tif (url) {\n\t\t\treturn loadStyleSheet(url).replace(RE_COMMENT, EMPTY_STRING).\n\t\t\treplace(RE_IMPORT, function( match, quoteChar, importUrl, quoteChar2, importUrl2 ) { \n\t\t\t\treturn parseStyleSheet(resolveUrl(importUrl || importUrl2, url));\n\t\t\t}).\n\t\t\treplace(RE_ASSET_URL, function( match, quoteChar, assetUrl ) { \n\t\t\t\tquoteChar = quoteChar || EMPTY_STRING;\n\t\t\t\treturn \" url(\" + quoteChar + resolveUrl(assetUrl, url) + quoteChar + \") \"; \n\t\t\t});\n\t\t}\n\t\treturn EMPTY_STRING;\n\t}", "title": "" }, { "docid": "839430846acfd1ba8481870a684b6594", "score": "0.4927907", "text": "function loadSvg(url, callback, errorCallback) {\n if (url) {\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n // readyState is DONE\n var status = req.status;\n if (status == 200) {\n // request status is OK\n callback(req.responseXML, req.responseText.trim());\n } else if (status >= 400) {\n // request status is error (4xx or 5xx)\n errorCallback();\n } else if (status == 0) {\n // request status 0 can indicate a failed cross-domain call\n errorCallback();\n }\n }\n };\n req.open('GET', url, true);\n req.send();\n }\n }", "title": "" }, { "docid": "7a3340e5cb9d209fb38d638501b9252f", "score": "0.49150038", "text": "function loadCss () {\n\t\tvar link = document.createElement ('link');\n\t\tlink.setAttribute ('rel', 'stylesheet');\n\t\tlink.setAttribute ('href', SERVER_URL + '/lichen/css/lichen.css');\n\t\tdocument.getElementsByTagName ('head')[0].appendChild (link);\n\t}", "title": "" }, { "docid": "70da32198e4f2b1775fb61de34259874", "score": "0.49148345", "text": "function ImportStyleFile (css_file) {\n if (document.createStyleSheet){\n document.createStyleSheet(css_file);\n } else {\n var $linkTag = document.createElement (\"link\");\n $linkTag.href = css_file;\n $linkTag.rel = \"stylesheet\";\n var $head = document.getElementsByTagName (\"head\")[0];\n $head.appendChild ($linkTag);\n }\n}", "title": "" }, { "docid": "69d23eafb275c1ac372e7e0cb83bc6e9", "score": "0.48995864", "text": "function mkBallotXsl(ballot,xsl,xml) {\n var fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n var ForReading = 1, ForWriting = 2, ForAppending = 8;\n var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;\n var ballotXml = stepmodHome+\"/ballots/ballots/\"+ballot+\"/\"+xml;\n fso.CreateTextFile(ballotXml, true);\n var f = fso.GetFile(ballotXml);\n\n var ts = f.OpenAsTextStream(ForWriting, TristateUseDefault);\n ts.WriteLine(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\n ts.WriteLine(\"<!DOCTYPE ballot SYSTEM \\\"../../dtd/ballot_xsl_appl.dtd\\\">\");\n ts.WriteLine(\"<?xml-stylesheet type=\\\"text/xsl\\\" href=\\\"../../xsl/\"+xsl+\"\\\" ?>\");\n\n ts.WriteLine(\"<!-- \");\n ts.WriteLine(\"$Id: mkballot_main.js,v 1.18 2005/03/21 16:40:52 thendrix Exp $\");\n ts.WriteLine(\" Author: Rob Bodington, Eurostep Limited\");\n ts.WriteLine(\" Owner: Developed by Eurostep Limited http://www.eurostep.com\");\n ts.WriteLine(\" Purpose: A grouping of modules into ballot packages\");\n ts.WriteLine(\"-->\");\n ts.WriteLine(\"<ballot directory=\\\"\"+ballot+\"\\\"/>\");\n ts.Close();\n}", "title": "" }, { "docid": "2a698bedb1f4e5077601357dad002e7f", "score": "0.4896294", "text": "function mkBallotIssueTableXsl(ballot,xsl,xml,content) {\n var fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n var ForReading = 1, ForWriting = 2, ForAppending = 8;\n var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;\n var ballotXml = stepmodHome+\"/ballots/ballots/\"+ballot+\"/\"+xml;\n fso.CreateTextFile(ballotXml, true);\n var f = fso.GetFile(ballotXml);\n\n var ts = f.OpenAsTextStream(ForWriting, TristateUseDefault);\n ts.WriteLine(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\n ts.WriteLine(\"<!DOCTYPE ballot SYSTEM \\\"../../dtd/ballot_xsl_appl.dtd\\\">\");\n ts.WriteLine(\"<?xml-stylesheet type=\\\"text/xsl\\\" href=\\\"../../xsl/\"+xsl+\"\\\" ?>\");\n\n ts.WriteLine(\"<!-- \");\n ts.WriteLine(\"$Id: mkballot_main.js,v 1.18 2005/03/21 16:40:52 thendrix Exp $\");\n ts.WriteLine(\" Author: Rob Bodington, Eurostep Limited\");\n ts.WriteLine(\" Owner: Developed by Eurostep Limited http://www.eurostep.com\");\n ts.WriteLine(\" Purpose: A grouping of modules into ballot packages\");\n ts.WriteLine(\"-->\");\n ts.WriteLine(\"<ballot directory=\\\"\"+ballot+\"\\\" content=\\\"\"+content+\"\\\"/>\");\n ts.Close();\n}", "title": "" }, { "docid": "99b1010b2efdb10dabaec3abcc1daddd", "score": "0.48901772", "text": "function parseStyleSheet( url ) {\n\t\n\t\t\n\t\tif (url) {\n\t\t\treturn loadStyleSheet(url).replace(RE_COMMENT, EMPTY_STRING)\n\t\t\t.replace(RE_IMPORT, function( match, quoteChar, importUrl, quoteChar2, importUrl2 ) { \n\t\t\t\treturn parseStyleSheet(resolveUrl(importUrl || importUrl2, url)) \n\t\t\t})\n\t\t\t.replace(RE_ASSET_URL, function( match, quoteChar, assetUrl ) { \n\t\t\t\tquoteChar = quoteChar || \"\";\n\t\t\t\treturn \" url(\" + quoteChar + resolveUrl(assetUrl, url) + quoteChar + \") \"; \n\t\t\t});\n\t\t}\n\t\treturn EMPTY_STRING\n\t}", "title": "" }, { "docid": "bd5f34258949c3eb58b91a45523917dd", "score": "0.48890916", "text": "function getSelectedXSLTFilePath()\n{\n var xslFileURI = _xslFile.getValue();\n\tvar xslAbsRef=null;\n\tif (xslFileURI.length)\n\t{\n\t\tvar isHTTPReference = ((xslFileURI.indexOf(\"http://\") != -1) || (xslFileURI.indexOf(\"https://\") != -1));\n\t\tif (!isHTTPReference)\n\t\t{\n\t\t\tif (xslFileURI.charAt(0) == '/')\n\t\t\t{\n\t\t\t\t //check for site relative path and map them to absolute path\n\t\t\t\txslAbsRef = site.siteRelativeToLocalPath(xslFileURI);\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//doc relative to absolute\n\t\t\t\tvar currDocURL = dw.getDocumentDOM().URL;\n\t\t\t\tvar siteRootURL\t= dreamweaver.getSiteRoot();\n\t\t\t\txslAbsRef = dreamweaver.relativeToAbsoluteURL( currDocURL, siteRootURL, xslFileURI);\n\t\t\t}\n\t\t}\n\t}\n\treturn xslAbsRef;\n}", "title": "" }, { "docid": "df283a0296c14795845d31af7c0923aa", "score": "0.48648563", "text": "function mkPubBallotXsl(ballot,xsl,xml) {\n var fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n var ForReading = 1, ForWriting = 2, ForAppending = 8;\n var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;\n var ballotXml = stepmodHome+\"/ballots/ballots/\"+ballot+\"/\"+xml;\n fso.CreateTextFile(ballotXml, true);\n var f = fso.GetFile(ballotXml);\n\n var ts = f.OpenAsTextStream(ForWriting, TristateUseDefault);\n ts.WriteLine(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\n ts.WriteLine(\"<!DOCTYPE ballot SYSTEM \\\"../../dtd/ballot_xsl_appl.dtd\\\">\");\n ts.WriteLine(\"<?xml-stylesheet type=\\\"text/xsl\\\" href=\\\"../../../xsl/pub_ballot/\"+xsl+\"\\\" ?>\");\n\n ts.WriteLine(\"<!-- \");\n ts.WriteLine(\"$Id: mkballot_main.js,v 1.18 2005/03/21 16:40:52 thendrix Exp $\");\n ts.WriteLine(\" Author: Rob Bodington, Eurostep Limited\");\n ts.WriteLine(\" Owner: Developed by Eurostep Limited http://www.eurostep.com\");\n ts.WriteLine(\" Purpose: A grouping of modules into ballot packages\");\n ts.WriteLine(\"-->\");\n ts.WriteLine(\"<ballot directory=\\\"\"+ballot+\"\\\"/>\");\n ts.Close();\n}", "title": "" }, { "docid": "24bad46cb9b73582becf64cdb44f0f4f", "score": "0.48582348", "text": "function ClientTransform()\r\n{\r\n\r\n\tif (window.XSLTProcessor)\r\n\t{\t\t\r\n\t\tvar xsltProc = new XSLTProcessor();\r\n\t\t\r\n\t\t// Load XSL\r\n\t\txslSS = document.implementation.createDocument(\"\", \"doc\", null);\r\n\t\txslSS.async = false;\r\n\t\txslSS.load(\"wmXML2HTML.xsl\");\r\n\t\txsltProc.importStylesheet(xslSS);\r\n\t\t\r\n\t\t// Load XML\r\n\t\tvar xmlDoc = document.implementation.createDocument(\"\", \"doc\", null);\r\n\t\txmlDoc.async = false;\r\n\t\txmlDoc.load(\"xml/weatherMap.xml\");\r\n\t\t\r\n\t\t\r\n\t\t// Transform\r\n\t\tvar fragment = xsltProc.transformToFragment(xmlDoc, document);\r\n\t\t\r\n\t\t//clear the old table first\r\n\t\tvar oTable=document.getElementById(\"xsltContent\"); \r\n\t\twhile(oTable.childNodes.length>2) \r\n\t\toTable.removeChild(oTable.lastChild); \r\n\t\t\r\n\t\t// Save to weatherMap.xml file\r\n\t\toTable.appendChild(fragment);\r\n\t}\r\n\telse if (window.ActiveXObject)\r\n\t{\r\n\t\t\r\n\t\t// Load XML\r\n\t\tvar xml = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\txml.async = false;\r\n\t\txml.load(\"xml/weatherMap.xml\");\r\n\t\t\r\n\t\t// Load XSL\r\n\t\tvar xsl = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\txsl.async = false;\r\n\t\txsl.load(\"wmXML2HTML.xsl\");\r\n\t\t\r\n\t\t// Transform\r\n\t\tvar fragment = xml.transformNode(xsl);\r\n\t\t\r\n\t\t// Insert into web page\r\n\t\tdocument.getElementById(\"xsltContent\").appendChild(fragment);\r\n\t}\r\n\telse // neither\r\n\t\talert (\"Neither\");\r\n}", "title": "" }, { "docid": "d8a296f589907a6aae637c6a60d0dbe9", "score": "0.485678", "text": "function loadCSS(settings)\n\t{\t\t\n\t\tvar element = document.createElement(\"link\");\n\t\telement.setAttribute(\"rel\",\"stylesheet\");\n\t\telement.setAttribute(\"href\", settings.path);\n\t\tif (settings.data) {\n\t\t\tfor(var key in settings.data) {\n\t\t\t\telement.setAttribute(\"data-\" + key, settings.data[key]);\n\t\t\t}\n\t\t}\n\t\tif (settings.callback) {\n\t\t\telement.addEventListener(\"load\", function(event){\n\t\t\t\tsettings.callback(event);\n\t\t\t});\n\t\t\telement.addEventListener(\"error\", function(event){\n\t\t\t\tsettings.callback(event);\n\t\t\t});\n\t\t}\n\t\treturn document.head.appendChild(element);\n\t}", "title": "" }, { "docid": "4694f27486361f992b2cdd142e0465e6", "score": "0.48554206", "text": "function loadXML(url) {\n\t//Creating a Native empty Dom Element\n\tvar xml = $.ajax({\n\t\turl: url,\n\t\tdataType: \"xml\",\n\t\tasync: false,\n\t\terror: function() {\n\t\t\tlogJS('XML retrieval error')\n\t\t}\n\t}).responseXML;\n\t//logJS(pnxRecord);\n\treturn xml;\n}", "title": "" }, { "docid": "0a17c7b4ad59cf90246100de0c7ebc15", "score": "0.48419443", "text": "function addStyle(url) {\n\t\tvar element = document.createElement('link');\n\t\telement.type = \"text/css\";\n\t\telement.rel = \"stylesheet\";\n\t\telement.href = url;\n\n\t\taddFile(element);\n\t}", "title": "" }, { "docid": "e1da9be98d4bfaef0cdb7b28b0388576", "score": "0.4840385", "text": "function loadXML(file)\r\n{\r\n \tvar request=this.createXMLHttpRequest();\r\n\trequest.open(\"GET\",file,true);\r\n\trequest.onreadystatechange=function(){if(request.readyState==4)xmlready(request.responseXML);}\r\n\trequest.send(null);\r\n}", "title": "" }, { "docid": "dd49cd2910ed328501e87a873522e285", "score": "0.48401266", "text": "function loadShader(url) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", url, false);\n req.send(null);\n if (req.status == 200)\n return req.responseText;\n else {\n log(\"File open failed: \" + url);\n return null;\n }\n}", "title": "" }, { "docid": "808cb95e1debbbdad43a2245b1b4501d", "score": "0.48225945", "text": "function loadCss( css_url, callback ) {\n var head = document.getElementsByTagName('head')[0];\n\n var link = document.createElement('link');\n //link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = css_url;\n\n link.onload = function () {\n sendCallBack(callback);\n };\n\n head.appendChild(link);\n}", "title": "" }, { "docid": "d9231204a3e1772f76caab2880908ba3", "score": "0.47976547", "text": "function loadDoc(url, cFunction, markup) {\n \n var xhttp;\n xhttp=new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n cFunction(this, markup);\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "title": "" }, { "docid": "6c400148fa9df7d1323e440e9028a2d2", "score": "0.4791518", "text": "function setStyleSheet(url) {\n /* global document */\n document.body.style.margin = '0px';\n const styles = document.createElement('link');\n styles.type = 'text/css';\n styles.rel = 'stylesheet';\n styles.href = url;\n document.head.appendChild(styles);\n}", "title": "" }, { "docid": "b392cad410f4aca684f7ce4e2d92e1a2", "score": "0.47613424", "text": "function twcheese_requestXML(targetUrl)\r\n\t{\r\n\t\tvar xmlhttps;\r\n\t\tif (window.XMLHttpRequest)\r\n\t\t\txmlhttps=new XMLHttpRequest();\r\n\t\telse\r\n\t\t\txmlhttps=new ActiveXObject(\"Microsoft.XMLhttps\");\r\n\t\txmlhttps.open(\"GET\",targetUrl,false);\r\n\t\txmlhttps.send(\"\");\r\n\r\n\t\treturn xmlhttps.responseText;\r\n\t}", "title": "" }, { "docid": "fd3c9bc3916cf8d694ecb34b74427f61", "score": "0.47457722", "text": "function injectStylesheet(url)\n {\n $('head').append('<link rel=\"stylesheet\" type=\"text/css\" href=\"'+url+'\"/>');\n }", "title": "" }, { "docid": "7e0d161178f063b3081d751816edd807", "score": "0.47449225", "text": "function Xml_LoadXmlDom(strUrl,callback)\r\n{\r\n var objXmlDom = new ActiveXObject(\"Msxml2.domdocument\");\r\n objXmlDom.async = true;\r\n objXmlDom.onreadystatechange = function () {\r\n if (objXmlDom.readyState == 4) {\r\n callback(objXmlDom);\r\n }\r\n\t};\r\n objXmlDom.load(strUrl);\r\n}", "title": "" }, { "docid": "887650bd7f05ad659316aee27f37e30b", "score": "0.47405773", "text": "function include(_stylesheet) {\n return HtmlService.createHtmlOutputFromFile(_stylesheet)\n .setSandboxMode(HtmlService.SandboxMode.IFRAME)\n .getContent();\n}//load the CSS file", "title": "" }, { "docid": "e5bff435ec440c4008eee5aeed3293d7", "score": "0.47384453", "text": "function loadjscssfile(filename, filetype) {\n\t\tif (filetype == \"js\") { //if filename is a external JavaScript file\n\t\t\tvar fileref = document.createElement('script');\n\t\t\tfileref.setAttribute(\"type\", \"text/javascript\");\n\t\t\tfileref.setAttribute(\"src\", filename);\n\t\t}\n\t\telse if (filetype == \"css\") { //if filename is an external CSS file\n\t\t\tvar fileref = document.createElement(\"link\");\n\t\t\tfileref.setAttribute(\"rel\", \"stylesheet\");\n\t\t\tfileref.setAttribute(\"type\", \"text/css\");\n\t\t\tfileref.setAttribute(\"href\", filename);\n\t\t\tfileref.setAttribute(\"id\", \"stylesheet\");\n\t\t}\n\t\t$(\"#stylesheet\").remove();\n\n\t\tif (typeof fileref != \"undefined\")\n\t\t\tdocument.getElementsByTagName(\"head\")[0].appendChild(fileref);\n\t}", "title": "" }, { "docid": "99f4a8f9da2f4c5317ddbdc2414d9df9", "score": "0.47362015", "text": "function loadJSXFile(pPath) {\n csInterface.evalScript(\"checkOpenDoc()\", function (count) { \n if (count==\"true\") {\n // var count = Number;\n // First countlayers, so we can show loader before app freezes due to script running\n csInterface.evalScript(\"countLayers()\", function (count) {\n // Show loader\n if (count > 30) {\n $(\"#loaderBlock\").show();\n setTimeout(function () {\n var scriptPath = csInterface.getSystemPath(SystemPath.EXTENSION) + pPath;\n csInterface.evalScript('evalFile(\"' + scriptPath + '\")', function () {\n $(\"#loaderBlock\").hide();\n });\n }, 100);\n // Dont show loader\n } else {\n var scriptPath = csInterface.getSystemPath(SystemPath.EXTENSION) + pPath;\n csInterface.evalScript('evalFile(\"' + scriptPath + '\")');\n }\n });\n } else {\n highlightNewDoc(true);\n }\n });\n }", "title": "" }, { "docid": "c61bc14bae82fc82a66fe783a4607cb1", "score": "0.47108263", "text": "function loadScript(url, load) {\n\t\tvar link = createLink(url),\n\t\t\tscript = doc.createElement('script');\n\n\t\thead.appendChild(link);\n\n\t\tscript.onload = script.onerror = function () {\n\t\t\thead.removeChild(script);\n\n\t\t\t// In Safari the stylesheet might not yet be applied, when\n\t\t\t// the script is loaded so we poll document.styleSheets for it\n\t\t\tvar checkLoaded = function () {\n\t\t\t\tif (styleSheetLoaded(url)) {\n\t\t\t\t\tload();\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(checkLoaded, 25);\n\t\t\t};\n\t\t\tcheckLoaded();\n\t\t};\n\t\tscript.src = url;\n\n\t\thead.appendChild(script);\n\t}", "title": "" }, { "docid": "8d30a542a92efa93ba0d8ad0aa4c23a7", "score": "0.4708334", "text": "function loadCssFile(filename) {\r\n var styles = document.getElementsByTagName(\"head\")[0].getElementsByTagName('link');\r\n for (var i = 0; i < styles.length; i++) {\r\n if (styles[i].getAttribute('href') == filename) {\r\n return;\r\n }\r\n }\r\n var fileref = document.createElement(\"link\");\r\n fileref.setAttribute(\"rel\", \"stylesheet\");\r\n fileref.setAttribute(\"type\", \"text/css\");\r\n fileref.setAttribute(\"href\", filename);\r\n if (typeof fileref != \"undefined\")\r\n document.getElementsByTagName(\"head\")[0].appendChild(fileref)\r\n}", "title": "" }, { "docid": "0f773e7c2b81190189370bd2cd64c9d9", "score": "0.4704923", "text": "function loadUrl(url) {\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", url, false);\n\txhr.send(null);\n\treturn xhr.responseText;\n}", "title": "" }, { "docid": "8a0fdb33376b4f90f3e039749f2c96c1", "score": "0.47003067", "text": "function transformxml(xml)\r\n{\r\n var xslUrl = chrome.extension.getURL('nhs_CDA_Document_Renderer.xsl')\r\n var xsl = loadXSLtext(xslUrl);\r\n \r\n var xsltPrs = new XSLTProcessor();\r\n xsltPrs.importStylesheet(xsl);\r\n\r\n var result = xsltPrs.transformToFragment(xml, document);\r\n\r\n var xmlsrv = new XMLSerializer();\r\n var plaintext = xmlsrv.serializeToString(result);\r\n return plaintext;\r\n}", "title": "" }, { "docid": "beee4fe2a729b382847546b54850027f", "score": "0.4694906", "text": "function getCSS(url) {\n $(\"head\").append(\"<link>\");\n css = $(\"head\").children(\":last\");\n css.attr({\n rel: \"stylesheet\",\n type: \"text/css\",\n href: url\n });\n}", "title": "" }, { "docid": "eddfd1a52b78f7a7bc6b99e9d487ce48", "score": "0.46739995", "text": "function applyStylesheet() {\n return backend.fetchFileContent(\"style.css\")\n .then(content => basic.appendStyle(content, {}))\n .catch(() => true)\n}", "title": "" }, { "docid": "4da7b5a65a40810533a4a036876cee3b", "score": "0.46438515", "text": "function addXStyle(css) {\r\n var head, style;\r\n GM_log(\"Applying external CSS\");\r\n head = document.getElementsByTagName('head')[0];\r\n if (!head) { return; }\r\n style = document.createElement('link');\r\n style.setAttribute(\"rel\", \"stylesheet\");\r\n style.setAttribute(\"type\", \"text/css\");\r\n style.setAttribute(\"href\", css);\r\n head.appendChild(style);\r\n}", "title": "" }, { "docid": "a80518b75340cf404dc076d6cbf71406", "score": "0.4643554", "text": "function loadXMLDoc(dname) {\n\tif (window.XMLHttpRequest) {\n\t\txhttp = new XMLHttpRequest();\n\t\t}\n\telse {\n\t\txhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t\t}\n\txhttp.open(\"GET\",dname,false);\n\txhttp.send(\"\");\n\treturn xhttp.responseXML;\n}", "title": "" }, { "docid": "3a49c6b24bb8a5d25fee084aecfd88e3", "score": "0.46434072", "text": "function loadSvg(url) {\n var target = $('.svg-wrap');\n\n // If SVG is supported\n if (typeof SVGRect != \"undefined\") {\n\n // Request the SVG file\n var ajax = new XMLHttpRequest();\n \n ajax.open(\"GET\", url, true);\n\n ajax.send();\n\n // Append the SVG to the target\n ajax.onload = function(e) {\n \t\t$('.svg-wrap').html(ajax.responseText);\n \t\tsetup();\n }\n } else {\n // Fallback to png\n // target.innerHTML = \"<img src='\" + url + \".png' />\";\n alert('Sorry, I couldn\\'t load the file, please try a different file.');\n }\n}", "title": "" }, { "docid": "907a0f7f9d304006a6c51ab726eafc95", "score": "0.4642144", "text": "function loadResource( url, type, callback ) {\n\t\tvar head = document.querySelector( 'head' );\n\t\tvar resource;\n\n\t\tif ( type === 'script' ) {\n\t\t\tresource = document.createElement( 'script' );\n\t\t\tresource.type = 'text/javascript';\n\t\t\tresource.src = url;\n\t\t}\n\t\telse if ( type === 'stylesheet' ) {\n\t\t\tresource = document.createElement( 'link' );\n\t\t\tresource.rel = 'stylesheet';\n\t\t\tresource.href = url;\n\t\t}\n\n\t\t// Wrapper for callback to make sure it only fires once\n\t\tvar finish = function() {\n\t\t\tif( typeof callback === 'function' ) {\n\t\t\t\tcallback.call();\n\t\t\t\tcallback = null;\n\t\t\t}\n\t\t}\n\n\t\tresource.onload = finish;\n\n\t\t// IE\n\t\tresource.onreadystatechange = function() {\n\t\t\tif ( this.readyState === 'loaded' ) {\n\t\t\t\tfinish();\n\t\t\t}\n\t\t}\n\n\t\t// Normal browsers\n\t\thead.appendChild( resource );\n\t}", "title": "" }, { "docid": "a9d3a168ac0b530abbdb658fd8c060db", "score": "0.46393162", "text": "function loadStyle(name) {\n $('body').append($('<link>', {\n rel: 'stylesheet',\n type: 'text/css',\n href: appOptions.baseUrl + 'css/' + name + '.css'\n }));\n}", "title": "" }, { "docid": "d1f592682bd11823ab677e54ba573acd", "score": "0.4639064", "text": "function add_css( url ) {\n\t\t\t\t\tvar link = document.createElement(\"link\");\n\t\t\t\t\tlink.type = \"text/css\";\n\t\t\t\t\tlink.rel = \"stylesheet\";\n\t\t\t\t\tlink.href = url;\n\t\t\t\t\tdocument.getElementsByTagName(\"head\")[0].appendChild(link);\n\t\t\t\t}", "title": "" }, { "docid": "37c1a7dcd3ba30a031522a9aa50fa7be", "score": "0.46380636", "text": "loadStyleSheets() {\n let workspaceId = this.props.workspaceId\n fetch(API + \"/stylesheets/load/\" + workspaceId, {\n method: \"GET\",\n headers: { 'Content-Type': 'application/json' }\n })\n .then(response => response.json())\n .then(data => {\n if (data.success && JSON.stringify(data.stylesheets) !== JSON.stringify(this.state.stylesheets)) {\n this.setState({ stylesheets: data.stylesheets, ifStylesheetLoading: false });\n }\n });\n }", "title": "" }, { "docid": "46fbcec3ffeec98c1b6f6df4c2bb6b48", "score": "0.46316168", "text": "function loadCss(href, onLoad) {\n var link_tag = document.createElement('link');\n link_tag.setAttribute('type', 'text/css');\n link_tag.setAttribute('rel', 'stylesheet');\n link_tag.setAttribute('href', href);\n\n if (link_tag.readyState) {\n link_tag.onreadystatechange = function () {\n if (this.readyState == 'complete' || this.readyState == 'loaded') {\n onLoad();\n }\n };\n } else {\n link_tag.onload = onLoad;\n }\n\n // append loaded style sheet to head\n (document.getElementsByTagName('head')[0] || document.documentElement).appendChild(link_tag);\n }", "title": "" }, { "docid": "2c8c6a3499f121ac23e3ceb2d052c2d6", "score": "0.46241674", "text": "loadWicaCSS_()\n {\n\n // This mechanism ensures that the Wica CSS file is loaded only once.\n if ( !document.getElementById('wica-css-id') )\n {\n const head = document.getElementsByTagName('head')[0];\n const link = document.createElement('link');\n link.id = 'wica-css-id';\n link.rel = 'stylesheet';\n link.type = 'text/css';\n link.href = this.streamServerUrl + '/wica/wica.css' ;\n link.media = 'all';\n head.appendChild(link);\n }\n }", "title": "" }, { "docid": "f3a8b1edf99b193948083dfd97e9fb31", "score": "0.46241042", "text": "function loadResource(url, type, callback) {\n var head = document.querySelector(\"head\");\n var resource;\n\n if (type === \"script\") {\n resource = document.createElement(\"script\");\n resource.type = \"text/javascript\";\n resource.src = url;\n } else if (type === \"stylesheet\") {\n resource = document.createElement(\"link\");\n resource.rel = \"stylesheet\";\n resource.href = url;\n }\n\n // Wrapper for callback to make sure it only fires once\n var finish = function () {\n if (typeof callback === \"function\") {\n callback.call();\n callback = null;\n }\n };\n\n resource.onload = finish;\n\n // IE\n resource.onreadystatechange = function () {\n if (this.readyState === \"loaded\") {\n finish();\n }\n };\n\n // Normal browsers\n head.appendChild(resource);\n }", "title": "" }, { "docid": "f13f77fe8a0f608d9e4fd14fe5ed6ff7", "score": "0.46221864", "text": "constructor(filePath,stylesheet) {\n this.filePath = filePath;\n this.stylesheet = stylesheet;\n }", "title": "" }, { "docid": "50ae3afda755ed3df0894194511a0e8b", "score": "0.45877704", "text": "function loadDisplay_dict(data)\n{\n var processor = new XSLTProcessor();\n var xslDoc = Sarissa.getDomDocument();\n xslDoc.async = false;\n xslDoc.load(stylesheet);\n processor.importStylesheet(xslDoc);\n var parser = new DOMParser();\n var dom = parser.parseFromString(data, \"text/xml\");\n Sarissa.updateContentFromNode(dom, $(\"display_dict\"), processor);\n}", "title": "" } ]
cfca7758dbc6fa206c657142eb65df64
date from string and array of format strings
[ { "docid": "f5cfeff1d6e44bcc399d2f5acffc7b00", "score": "0.0", "text": "function configFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n getParsingFlags(config).invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._f = config._f[i];\n configFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += getParsingFlags(tempConfig).charsLeftOver;\n\n //or tokens\n currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;\n\n getParsingFlags(tempConfig).score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n}", "title": "" } ]
[ { "docid": "50cdaa80dd67e5882de11cb78284ac40", "score": "0.71199375", "text": "function makeDateFromStringAndFormat(string, format) {\n var inArray = [0],\n charactersToPutInArray = /[0-9a-zA-Z]+/g,\n inputParts = [],\n formatParts = [],\n i,\n isPm;\n \n // function to convert string input to date\n function addTime(format, input) {\n switch (format) {\n // MONTH\n case 'M' :\n // fall through to MM\n case 'MM' :\n inArray[1] = ~~input - 1;\n break;\n // DAY OF MONTH\n case 'D' : \n // fall through to DDDD\n case 'DD' : \n // fall through to DDDD\n case 'DDD' :\n // fall through to DDDD\n case 'DDDD' :\n inArray[2] = ~~input;\n break;\n // YEAR\n case 'YY' : \n input = ~~input;\n inArray[0] = input + (input > 70 ? 1900 : 2000);\n break;\n case 'YYYY' : \n inArray[0] = ~~input;\n break;\n // AM / PM\n case 'a' : \n // fall through to A\n case 'A' :\n isPm = (input.toLowerCase() === 'pm');\n break;\n // 24 HOUR \n case 'H' : \n // fall through to hh\n case 'HH' : \n // fall through to hh\n case 'h' : \n // fall through to hh\n case 'hh' : \n inArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' : \n // fall through to mm\n case 'mm' : \n inArray[4] = ~~input;\n break;\n // SECOND\n case 's' : \n // fall through to ss\n case 'ss' : \n inArray[5] = ~~input;\n break;\n }\n }\n \n // add input parts to array\n string.replace(charactersToPutInArray, function (input) {\n inputParts.push(input);\n });\n \n // add format parts to array\n format.replace(charactersToPutInArray, function (input) {\n formatParts.push(input);\n });\n \n for (i = 0; i < formatParts.length; i++) {\n addTime(formatParts[i], inputParts[i]);\n }\n \n // handle am pm\n if (isPm && inArray[3] < 12) {\n inArray[3] += 12;\n }\n \n return dateFromArray(inArray);\n }", "title": "" }, { "docid": "579ca415e239846cd1f1468bab9983a9", "score": "0.6992324", "text": "function makeDateFromStringAndArray(string, formats) {\n var output,\n inputParts = string.match(parseMultipleFormatChunker) || [],\n formattedInputParts,\n scoreToBeat = 99,\n i,\n currentDate,\n currentScore;\n for (i = 0; i < formats.length; i++) {\n currentDate = makeDateFromStringAndFormat(string, formats[i]);\n formattedInputParts = formatMoment(new Moment(currentDate), formats[i]).match(parseMultipleFormatChunker) || [];\n currentScore = compareArrays(inputParts, formattedInputParts);\n if (currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n output = currentDate;\n }\n }\n return output;\n }", "title": "" }, { "docid": "84d70c0d6219045b4725ae208f29ce82", "score": "0.6868389", "text": "function makeDateFromStringAndFormat(string, format) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n // We store some additional data on the array for validation\n // datePartArray[7] is true if the Date was created with `Date.UTC` and false if created with `new Date`\n // datePartArray[8] is false if the Date is invalid, and undefined if the validity is unknown.\n var datePartArray = [0, 0, 1, 0, 0, 0, 0],\n config = {\n tzh : 0, // timezone hour offset\n tzm : 0 // timezone minute offset\n },\n tokens = format.match(formattingTokens),\n i, parsedInput;\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, datePartArray, config);\n }\n }\n // handle am pm\n if (config.isPm && datePartArray[3] < 12) {\n datePartArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config.isPm === false && datePartArray[3] === 12) {\n datePartArray[3] = 0;\n }\n // return\n return dateFromArray(datePartArray, config.isUTC, config.tzh, config.tzm);\n }", "title": "" }, { "docid": "eedbed108b021d893b80b1402ac01ac1", "score": "0.68449193", "text": "function makeDateFromStringAndArray(string, formats) {\n\n\n var output,\n inputParts = string.match(inputCharacters),\n scores = [],\n scoreToBeat = 99,\n i,\n curDate,\n curScore;\n for (i = 0; i < formats.length; i++) {\n curDate = makeDateFromStringAndFormat(string, formats[i]);\n curScore = compareArrays(inputParts, formatDate(curDate, formats[i]).match(inputCharacters));\n if (curScore < scoreToBeat) {\n scoreToBeat = curScore;\n output = curDate;\n }\n }\n return output;\n }", "title": "" }, { "docid": "a4684adce70a87e67a09554f14ea2bec", "score": "0.6840907", "text": "function makeDateFromStringAndArray(string, formats) {\n var output,\n inputParts = string.match(inputCharacters),\n scores = [],\n scoreToBeat = 99,\n i,\n curDate,\n curScore;\n for (i = 0; i < formats.length; i++) {\n curDate = makeDateFromStringAndFormat(string, formats[i]);\n curScore = compareArrays(inputParts, formatDate(curDate, formats[i]).match(inputCharacters));\n if (curScore < scoreToBeat) {\n scoreToBeat = curScore;\n output = curDate;\n }\n }\n return output;\n }", "title": "" }, { "docid": "6ca74b9f56dd311eea8b272c9bd93454", "score": "0.6811143", "text": "function makeDateFromStringAndArray(string, formats) {\n var output,\n inputParts = string.match(inputCharacters),\n scores = [],\n scoreToBeat = 99,\n i,\n curDate,\n curScore;\n for (i = 0; i < formats.length; i++) {\n curDate = makeDateFromStringAndFormat(string, formats[i]);\n curScore = compareArrays(inputParts, formatMoment(new Moment(curDate), formats[i]).match(inputCharacters));\n if (curScore < scoreToBeat) {\n scoreToBeat = curScore;\n output = curDate;\n }\n }\n return output;\n }", "title": "" }, { "docid": "7c83ebbd029fa2bdf81b70eb258863b7", "score": "0.67375225", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "7c83ebbd029fa2bdf81b70eb258863b7", "score": "0.67375225", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i]).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "9e719923867a13f268f0ad345d7a4b3a", "score": "0.67109895", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "9e719923867a13f268f0ad345d7a4b3a", "score": "0.67109895", "text": "function makeDateFromStringAndFormat(config) {\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var tokens = config._f.match(formattingTokens),\n string = config._i,\n i, parsedInput;\n\n config._a = [];\n\n for (i = 0; i < tokens.length; i++) {\n parsedInput = (getParseRegexForToken(tokens[i], config).exec(string) || [])[0];\n if (parsedInput) {\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n }\n // don't parse if its not a known token\n if (formatTokenFunctions[tokens[i]]) {\n addTimeToArrayFromToken(tokens[i], parsedInput, config);\n }\n }\n\n // add remaining unparsed input to the string\n if (string) {\n config._il = string;\n }\n\n // handle am pm\n if (config._isPm && config._a[3] < 12) {\n config._a[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[3] === 12) {\n config._a[3] = 0;\n }\n // return\n dateFromArray(config);\n }", "title": "" }, { "docid": "5856e9d576a5c336533b81115379f059", "score": "0.65887785", "text": "function makeDateFromStringAndFormat(config) {\r\n\r\n config._a = [];\r\n config._pf.empty = true;\r\n\r\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\r\n var lang = getLangDefinition(config._l),\r\n string = '' + config._i,\r\n i, parsedInput, tokens, token, skipped,\r\n stringLength = string.length,\r\n totalParsedInputLength = 0;\r\n\r\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\r\n\r\n for (i = 0; i < tokens.length; i++) {\r\n token = tokens[i];\r\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\r\n if (parsedInput) {\r\n skipped = string.substr(0, string.indexOf(parsedInput));\r\n if (skipped.length > 0) {\r\n config._pf.unusedInput.push(skipped);\r\n }\r\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\r\n totalParsedInputLength += parsedInput.length;\r\n }\r\n // don't parse if it's not a known token\r\n if (formatTokenFunctions[token]) {\r\n if (parsedInput) {\r\n config._pf.empty = false;\r\n }\r\n else {\r\n config._pf.unusedTokens.push(token);\r\n }\r\n addTimeToArrayFromToken(token, parsedInput, config);\r\n }\r\n else if (config._strict && !parsedInput) {\r\n config._pf.unusedTokens.push(token);\r\n }\r\n }\r\n\r\n // add remaining unparsed input length to the string\r\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\r\n if (string.length > 0) {\r\n config._pf.unusedInput.push(string);\r\n }\r\n\r\n // handle am pm\r\n if (config._isPm && config._a[HOUR] < 12) {\r\n config._a[HOUR] += 12;\r\n }\r\n // if is 12 am, change hours to 0\r\n if (config._isPm === false && config._a[HOUR] === 12) {\r\n config._a[HOUR] = 0;\r\n }\r\n\r\n dateFromConfig(config);\r\n checkOverflow(config);\r\n }", "title": "" }, { "docid": "5856e9d576a5c336533b81115379f059", "score": "0.65887785", "text": "function makeDateFromStringAndFormat(config) {\r\n\r\n config._a = [];\r\n config._pf.empty = true;\r\n\r\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\r\n var lang = getLangDefinition(config._l),\r\n string = '' + config._i,\r\n i, parsedInput, tokens, token, skipped,\r\n stringLength = string.length,\r\n totalParsedInputLength = 0;\r\n\r\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\r\n\r\n for (i = 0; i < tokens.length; i++) {\r\n token = tokens[i];\r\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\r\n if (parsedInput) {\r\n skipped = string.substr(0, string.indexOf(parsedInput));\r\n if (skipped.length > 0) {\r\n config._pf.unusedInput.push(skipped);\r\n }\r\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\r\n totalParsedInputLength += parsedInput.length;\r\n }\r\n // don't parse if it's not a known token\r\n if (formatTokenFunctions[token]) {\r\n if (parsedInput) {\r\n config._pf.empty = false;\r\n }\r\n else {\r\n config._pf.unusedTokens.push(token);\r\n }\r\n addTimeToArrayFromToken(token, parsedInput, config);\r\n }\r\n else if (config._strict && !parsedInput) {\r\n config._pf.unusedTokens.push(token);\r\n }\r\n }\r\n\r\n // add remaining unparsed input length to the string\r\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\r\n if (string.length > 0) {\r\n config._pf.unusedInput.push(string);\r\n }\r\n\r\n // handle am pm\r\n if (config._isPm && config._a[HOUR] < 12) {\r\n config._a[HOUR] += 12;\r\n }\r\n // if is 12 am, change hours to 0\r\n if (config._isPm === false && config._a[HOUR] === 12) {\r\n config._a[HOUR] = 0;\r\n }\r\n\r\n dateFromConfig(config);\r\n checkOverflow(config);\r\n }", "title": "" }, { "docid": "cdeca56d1da73793a72783a9a37e2ee2", "score": "0.65863997", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (getParseRegexForToken(token, config).exec(string) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.65736145", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.65736145", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.65736145", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.65736145", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.65736145", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.65736145", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.65736145", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "154a666aeb8bb40caff35e2e14d380f5", "score": "0.65736145", "text": "function makeDateFromStringAndFormat(config) {\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.64605933", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "342ffd53c3fbea28478fd1e06c83e80a", "score": "0.64605933", "text": "function makeDateFromString(config) {\n var i,\n string = config._i;\n if (isoRegex.exec(string)) {\n config._f = 'YYYY-MM-DDT';\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "bfb6ede7c7841630d5174b2f71187882", "score": "0.64494216", "text": "function strtodate(str) {\n var arr = str.split(\" \");\n var arr2 = arr[0].split(i18n.dcmvcal.dateformat.separator);\n var arr3 = arr[1].split(\":\");\n\n var y = arr2[i18n.dcmvcal.dateformat.year_index];\n var m = arr2[i18n.dcmvcal.dateformat.month_index].indexOf(\"0\") == 0 ? arr2[i18n.dcmvcal.dateformat.month_index].substr(1, 1) : arr2[i18n.dcmvcal.dateformat.month_index];\n var d = arr2[i18n.dcmvcal.dateformat.day_index].indexOf(\"0\") == 0 ? arr2[i18n.dcmvcal.dateformat.day_index].substr(1, 1) : arr2[i18n.dcmvcal.dateformat.day_index];\n var h = arr3[0].indexOf(\"0\") == 0 ? arr3[0].substr(1, 1) : arr3[0];\n var n = arr3[1].indexOf(\"0\") == 0 ? arr3[1].substr(1, 1) : arr3[1];\n return new Date(y, parseInt(m) - 1, d, h, n);\n }", "title": "" }, { "docid": "bbc6d84980547a105dd412416fa69198", "score": "0.6440538", "text": "function parseDateStringToArray(str) {\n var reggie = /(\\d{2})\\/(\\d{2})\\/(\\d{4})/;\n return reggie.exec(str);\n }", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.6419801", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.6419801", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6b9562146a46d98639f1b24ceea5f376", "score": "0.640779", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "6b9562146a46d98639f1b24ceea5f376", "score": "0.640779", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "6b9562146a46d98639f1b24ceea5f376", "score": "0.640779", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "6b9562146a46d98639f1b24ceea5f376", "score": "0.640779", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "6b9562146a46d98639f1b24ceea5f376", "score": "0.640779", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "6b9562146a46d98639f1b24ceea5f376", "score": "0.640779", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "6b9562146a46d98639f1b24ceea5f376", "score": "0.640779", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "6b9562146a46d98639f1b24ceea5f376", "score": "0.640779", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "6b9562146a46d98639f1b24ceea5f376", "score": "0.640779", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "f3394221bf5074ea9811f2ec854b84cf", "score": "0.6398504", "text": "function makeDateFromStringAndArray(config) {\nvar tempConfig,\nbestMoment,\nscoreToBeat,\ni,\ncurrentScore;\nif (config._f.length === 0) {\nconfig._pf.invalidFormat = true;\nconfig._d = new Date(NaN);\nreturn;\n}\nfor (i = 0; i < config._f.length; i++) {\ncurrentScore = 0;\ntempConfig = copyConfig({}, config);\ntempConfig._pf = defaultParsingFlags();\ntempConfig._f = config._f[i];\nmakeDateFromStringAndFormat(tempConfig);\nif (!isValid(tempConfig)) {\ncontinue;\n}\n// if there is any input that was not parsed add a penalty for that format\ncurrentScore += tempConfig._pf.charsLeftOver;\n//or tokens\ncurrentScore += tempConfig._pf.unusedTokens.length * 10;\ntempConfig._pf.score = currentScore;\nif (scoreToBeat == null || currentScore < scoreToBeat) {\nscoreToBeat = currentScore;\nbestMoment = tempConfig;\n}\n}\nextend(config, bestMoment || tempConfig);\n}", "title": "" }, { "docid": "5eab5c2b210f4729e195b35595a6ed17", "score": "0.6393603", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n initializeParsingFlags(tempConfig);\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "5eab5c2b210f4729e195b35595a6ed17", "score": "0.6393603", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = extend({}, config);\n initializeParsingFlags(tempConfig);\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "ceb8b00b39a1e1a81b31cb8893f36b62", "score": "0.6375298", "text": "function makeDateFromStringAndArray(config) {\r\n var tempConfig,\r\n bestMoment,\r\n\r\n scoreToBeat,\r\n i,\r\n currentScore;\r\n\r\n if (config._f.length === 0) {\r\n config._pf.invalidFormat = true;\r\n config._d = new Date(NaN);\r\n return;\r\n }\r\n\r\n for (i = 0; i < config._f.length; i++) {\r\n currentScore = 0;\r\n tempConfig = extend({}, config);\r\n tempConfig._pf = defaultParsingFlags();\r\n tempConfig._f = config._f[i];\r\n makeDateFromStringAndFormat(tempConfig);\r\n\r\n if (!isValid(tempConfig)) {\r\n continue;\r\n }\r\n\r\n // if there is any input that was not parsed add a penalty for that format\r\n currentScore += tempConfig._pf.charsLeftOver;\r\n\r\n //or tokens\r\n currentScore += tempConfig._pf.unusedTokens.length * 10;\r\n\r\n tempConfig._pf.score = currentScore;\r\n\r\n if (scoreToBeat == null || currentScore < scoreToBeat) {\r\n scoreToBeat = currentScore;\r\n bestMoment = tempConfig;\r\n }\r\n }\r\n\r\n extend(config, bestMoment || tempConfig);\r\n }", "title": "" }, { "docid": "ceb8b00b39a1e1a81b31cb8893f36b62", "score": "0.6375298", "text": "function makeDateFromStringAndArray(config) {\r\n var tempConfig,\r\n bestMoment,\r\n\r\n scoreToBeat,\r\n i,\r\n currentScore;\r\n\r\n if (config._f.length === 0) {\r\n config._pf.invalidFormat = true;\r\n config._d = new Date(NaN);\r\n return;\r\n }\r\n\r\n for (i = 0; i < config._f.length; i++) {\r\n currentScore = 0;\r\n tempConfig = extend({}, config);\r\n tempConfig._pf = defaultParsingFlags();\r\n tempConfig._f = config._f[i];\r\n makeDateFromStringAndFormat(tempConfig);\r\n\r\n if (!isValid(tempConfig)) {\r\n continue;\r\n }\r\n\r\n // if there is any input that was not parsed add a penalty for that format\r\n currentScore += tempConfig._pf.charsLeftOver;\r\n\r\n //or tokens\r\n currentScore += tempConfig._pf.unusedTokens.length * 10;\r\n\r\n tempConfig._pf.score = currentScore;\r\n\r\n if (scoreToBeat == null || currentScore < scoreToBeat) {\r\n scoreToBeat = currentScore;\r\n bestMoment = tempConfig;\r\n }\r\n }\r\n\r\n extend(config, bestMoment || tempConfig);\r\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6371693", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6371693", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6371693", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6371693", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6371693", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6371693", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6371693", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6371693", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6371693", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "73903f1c82c7b60db753e1755e164eb7", "score": "0.6371693", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "8cdf7bab268d1be1846ce9379c510df5", "score": "0.6364184", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n if (config._useUTC != null) {\n tempConfig._useUTC = config._useUTC;\n }\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "dd10f0174121c71dfdf5e497a8203ffa", "score": "0.6359313", "text": "function makeDateFromStringAndArray(config) {\n\t var tempConfig,\n\t bestMoment,\n\n\t scoreToBeat,\n\t i,\n\t currentScore;\n\n\t if (config._f.length === 0) {\n\t config._pf.invalidFormat = true;\n\t config._d = new Date(NaN);\n\t return;\n\t }\n\n\t for (i = 0; i < config._f.length; i++) {\n\t currentScore = 0;\n\t tempConfig = copyConfig({}, config);\n\t tempConfig._pf = defaultParsingFlags();\n\t tempConfig._f = config._f[i];\n\t makeDateFromStringAndFormat(tempConfig);\n\n\t if (!isValid(tempConfig)) {\n\t continue;\n\t }\n\n\t // if there is any input that was not parsed add a penalty for that format\n\t currentScore += tempConfig._pf.charsLeftOver;\n\n\t //or tokens\n\t currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n\t tempConfig._pf.score = currentScore;\n\n\t if (scoreToBeat == null || currentScore < scoreToBeat) {\n\t scoreToBeat = currentScore;\n\t bestMoment = tempConfig;\n\t }\n\t }\n\n\t extend(config, bestMoment || tempConfig);\n\t }", "title": "" }, { "docid": "67aa456f0b260212e98e29efd5b61b26", "score": "0.6350513", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "67aa456f0b260212e98e29efd5b61b26", "score": "0.6350513", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "67aa456f0b260212e98e29efd5b61b26", "score": "0.6350513", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "67aa456f0b260212e98e29efd5b61b26", "score": "0.6350513", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "67aa456f0b260212e98e29efd5b61b26", "score": "0.6350513", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "67aa456f0b260212e98e29efd5b61b26", "score": "0.6350513", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle meridiem\n config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR],\n config._meridiem);\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "0b887867dc6ea476ca291f0162a91c97", "score": "0.6349246", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "0b887867dc6ea476ca291f0162a91c97", "score": "0.6349246", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "0b887867dc6ea476ca291f0162a91c97", "score": "0.6349246", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "0b887867dc6ea476ca291f0162a91c97", "score": "0.6349246", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "0b887867dc6ea476ca291f0162a91c97", "score": "0.6349246", "text": "function makeDateFromStringAndArray(config) {\n var tempConfig,\n bestMoment,\n\n scoreToBeat,\n i,\n currentScore;\n\n if (config._f.length === 0) {\n config._pf.invalidFormat = true;\n config._d = new Date(NaN);\n return;\n }\n\n for (i = 0; i < config._f.length; i++) {\n currentScore = 0;\n tempConfig = copyConfig({}, config);\n tempConfig._pf = defaultParsingFlags();\n tempConfig._f = config._f[i];\n makeDateFromStringAndFormat(tempConfig);\n\n if (!isValid(tempConfig)) {\n continue;\n }\n\n // if there is any input that was not parsed add a penalty for that format\n currentScore += tempConfig._pf.charsLeftOver;\n\n //or tokens\n currentScore += tempConfig._pf.unusedTokens.length * 10;\n\n tempConfig._pf.score = currentScore;\n\n if (scoreToBeat == null || currentScore < scoreToBeat) {\n scoreToBeat = currentScore;\n bestMoment = tempConfig;\n }\n }\n\n extend(config, bestMoment || tempConfig);\n }", "title": "" }, { "docid": "19eb9029b99a3759d2c5f58fc7716d17", "score": "0.63415045", "text": "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "19eb9029b99a3759d2c5f58fc7716d17", "score": "0.63415045", "text": "function makeDateFromStringAndFormat(config) {\n\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var lang = getLangDefinition(config._l),\n string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, lang).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "80db4e70ca1a468fbc317015e3f2e147", "score": "0.6331202", "text": "function makeDateFromStringAndFormat(config) {\n\t if (config._f === moment.ISO_8601) {\n\t parseISO(config);\n\t return;\n\t }\n\n\t config._a = [];\n\t config._pf.empty = true;\n\n\t // This array is used to make a Date, either with `new Date` or `Date.UTC`\n\t var string = '' + config._i,\n\t i, parsedInput, tokens, token, skipped,\n\t stringLength = string.length,\n\t totalParsedInputLength = 0;\n\n\t tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n\t for (i = 0; i < tokens.length; i++) {\n\t token = tokens[i];\n\t parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n\t if (parsedInput) {\n\t skipped = string.substr(0, string.indexOf(parsedInput));\n\t if (skipped.length > 0) {\n\t config._pf.unusedInput.push(skipped);\n\t }\n\t string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n\t totalParsedInputLength += parsedInput.length;\n\t }\n\t // don't parse if it's not a known token\n\t if (formatTokenFunctions[token]) {\n\t if (parsedInput) {\n\t config._pf.empty = false;\n\t }\n\t else {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t addTimeToArrayFromToken(token, parsedInput, config);\n\t }\n\t else if (config._strict && !parsedInput) {\n\t config._pf.unusedTokens.push(token);\n\t }\n\t }\n\n\t // add remaining unparsed input length to the string\n\t config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n\t if (string.length > 0) {\n\t config._pf.unusedInput.push(string);\n\t }\n\n\t // handle am pm\n\t if (config._isPm && config._a[HOUR] < 12) {\n\t config._a[HOUR] += 12;\n\t }\n\t // if is 12 am, change hours to 0\n\t if (config._isPm === false && config._a[HOUR] === 12) {\n\t config._a[HOUR] = 0;\n\t }\n\n\t dateFromConfig(config);\n\t checkOverflow(config);\n\t }", "title": "" }, { "docid": "81fa4f6971aa8aabeb853b08a9ab2500", "score": "0.63261753", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "042d9a8abe1745df37d2bb6c41802418", "score": "0.6323412", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "042d9a8abe1745df37d2bb6c41802418", "score": "0.6323412", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "042d9a8abe1745df37d2bb6c41802418", "score": "0.6323412", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "042d9a8abe1745df37d2bb6c41802418", "score": "0.6323412", "text": "function makeDateFromStringAndFormat(config) {\n if (config._f === moment.ISO_8601) {\n parseISO(config);\n return;\n }\n\n config._a = [];\n config._pf.empty = true;\n\n // This array is used to make a Date, either with `new Date` or `Date.UTC`\n var string = '' + config._i,\n i, parsedInput, tokens, token, skipped,\n stringLength = string.length,\n totalParsedInputLength = 0;\n\n tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];\n\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];\n if (parsedInput) {\n skipped = string.substr(0, string.indexOf(parsedInput));\n if (skipped.length > 0) {\n config._pf.unusedInput.push(skipped);\n }\n string = string.slice(string.indexOf(parsedInput) + parsedInput.length);\n totalParsedInputLength += parsedInput.length;\n }\n // don't parse if it's not a known token\n if (formatTokenFunctions[token]) {\n if (parsedInput) {\n config._pf.empty = false;\n }\n else {\n config._pf.unusedTokens.push(token);\n }\n addTimeToArrayFromToken(token, parsedInput, config);\n }\n else if (config._strict && !parsedInput) {\n config._pf.unusedTokens.push(token);\n }\n }\n\n // add remaining unparsed input length to the string\n config._pf.charsLeftOver = stringLength - totalParsedInputLength;\n if (string.length > 0) {\n config._pf.unusedInput.push(string);\n }\n\n // clear _12h flag if hour is <= 12\n if (config._pf.bigHour === true && config._a[HOUR] <= 12) {\n config._pf.bigHour = undefined;\n }\n // handle am pm\n if (config._isPm && config._a[HOUR] < 12) {\n config._a[HOUR] += 12;\n }\n // if is 12 am, change hours to 0\n if (config._isPm === false && config._a[HOUR] === 12) {\n config._a[HOUR] = 0;\n }\n dateFromConfig(config);\n checkOverflow(config);\n }", "title": "" }, { "docid": "a0ccaecf2a329ee5b0bc2799acfbfd8d", "score": "0.63098574", "text": "function parseDateString(strDateInput) {\n var i, re, handler, bits, result;\n \n // cycle through date parse patterns\n for (i = 0; i < dateParsePatterns.length; i += 1) {\n // get regular expression for this pattern\n re = dateParsePatterns[i].re;\n if ('function' === typeof re && 'RegExp' !== re.constructor.name) { // RegExp's have type \"function\" in Safari\n re = re();\n }\n \n // get handler function for this pattern\n handler = dateParsePatterns[i].handler;\n \n // parse input using regular expression\n bits = re.exec(strDateInput);\n \n // if there was a match\n if (bits) {\n result = handler(bits);\n if (result) {\n // return the result of the handler function (which constitutes bits into a date)\n return result;\n }\n }\n }\n // if no pattern matched - throw exception\n throw new Error(l10n.errors.unknownFormat);\n }", "title": "" }, { "docid": "292e8d7100762bf059dcc5d3b46d9aeb", "score": "0.6270081", "text": "function makeDateFromStringAndFormat(string, format) {\n var inArray = [0, 0, 1, 0, 0, 0, 0],\n timezoneHours = 0,\n timezoneMinutes = 0,\n isUsingUTC = false,\n inputParts = string.match(inputCharacters),\n formatParts = format.match(tokenCharacters),\n i,\n isPm;\n\n // function to convert string input to date\n function addTime(format, input) {\n var a;\n switch (format) {\n // MONTH\n case 'M' :\n // fall through to MM\n case 'MM' :\n inArray[1] = ~~input - 1;\n break;\n case 'MMM' :\n // fall through to MMMM\n case 'MMMM' :\n for (a = 0; a < 12; a++) {\n if (moment.monthsParse[a].test(input)) {\n inArray[1] = a;\n break;\n }\n }\n break;\n // DAY OF MONTH\n case 'D' :\n // fall through to DDDD\n case 'DD' :\n // fall through to DDDD\n case 'DDD' :\n // fall through to DDDD\n case 'DDDD' :\n inArray[2] = ~~input;\n break;\n // YEAR\n case 'YY' :\n input = ~~input;\n inArray[0] = input + (input > 70 ? 1900 : 2000);\n break;\n case 'YYYY' :\n inArray[0] = ~~Math.abs(input);\n break;\n // AM / PM\n case 'a' :\n // fall through to A\n case 'A' :\n isPm = (input.toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' :\n // fall through to hh\n case 'HH' :\n // fall through to hh\n case 'h' :\n // fall through to hh\n case 'hh' :\n inArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' :\n // fall through to mm\n case 'mm' :\n inArray[4] = ~~input;\n break;\n // SECOND\n case 's' :\n // fall through to ss\n case 'ss' :\n inArray[5] = ~~input;\n break;\n // TIMEZONE\n case 'Z' :\n // fall through to ZZ\n case 'ZZ' :\n isUsingUTC = true;\n a = input.match(timezoneParseRegex);\n if (a[1]) {\n timezoneHours = ~~a[1];\n }\n if (a[2]) {\n timezoneMinutes = ~~a[2];\n }\n // reverse offsets\n if (a[0] === '-') {\n timezoneHours = -timezoneHours;\n timezoneMinutes = -timezoneMinutes;\n }\n break;\n }\n }\n for (i = 0; i < formatParts.length; i++) {\n addTime(formatParts[i], inputParts[i]);\n }\n // handle am pm\n if (isPm && inArray[3] < 12) {\n inArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (isPm === false && inArray[3] === 12) {\n inArray[3] = 0;\n }\n // handle timezone\n inArray[3] += timezoneHours;\n inArray[4] += timezoneMinutes;\n // return\n return isUsingUTC ? new Date(Date.UTC.apply({}, inArray)) : dateFromArray(inArray);\n }", "title": "" }, { "docid": "477b01d827e8092434ff5f7bea57ac4d", "score": "0.62658817", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.6261878", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.6261878", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.6261878", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.6261878", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.6261878", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "0d52c25baf6042bdbf90fe04d9a1461b", "score": "0.6254634", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "0d52c25baf6042bdbf90fe04d9a1461b", "score": "0.6254634", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "d7839a8f39e7c6f1ede9046fa903ee3a", "score": "0.62397987", "text": "function makeDateFromStringAndFormat(string, format) {\n var inArray = [0, 0, 1, 0, 0, 0, 0],\n timezoneHours = 0,\n timezoneMinutes = 0,\n isUsingUTC = false,\n inputParts = string.match(inputCharacters),\n formatParts = format.match(tokenCharacters),\n len = Math.min(inputParts.length, formatParts.length),\n i,\n isPm;\n\n // function to convert string input to date\n function addTime(format, input) {\n var a;\n switch (format) {\n // MONTH\n case 'M' :\n // fall through to MM\n case 'MM' :\n inArray[1] = ~~input - 1;\n break;\n case 'MMM' :\n // fall through to MMMM\n case 'MMMM' :\n for (a = 0; a < 12; a++) {\n if (moment.monthsParse[a].test(input)) {\n inArray[1] = a;\n break;\n }\n }\n break;\n // DAY OF MONTH\n case 'D' :\n // fall through to DDDD\n case 'DD' :\n // fall through to DDDD\n case 'DDD' :\n // fall through to DDDD\n case 'DDDD' :\n inArray[2] = ~~input;\n break;\n // YEAR\n case 'YY' :\n input = ~~input;\n inArray[0] = input + (input > 70 ? 1900 : 2000);\n break;\n case 'YYYY' :\n inArray[0] = ~~Math.abs(input);\n break;\n // AM / PM\n case 'a' :\n // fall through to A\n case 'A' :\n isPm = (input.toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' :\n // fall through to hh\n case 'HH' :\n // fall through to hh\n case 'h' :\n // fall through to hh\n case 'hh' :\n inArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' :\n // fall through to mm\n case 'mm' :\n inArray[4] = ~~input;\n break;\n // SECOND\n case 's' :\n // fall through to ss\n case 'ss' :\n inArray[5] = ~~input;\n break;\n // TIMEZONE\n case 'Z' :\n // fall through to ZZ\n case 'ZZ' :\n isUsingUTC = true;\n a = (input || '').match(timezoneParseRegex);\n if (a && a[1]) {\n timezoneHours = ~~a[1];\n }\n if (a && a[2]) {\n timezoneMinutes = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === '+') {\n timezoneHours = -timezoneHours;\n timezoneMinutes = -timezoneMinutes;\n }\n break;\n }\n }\n for (i = 0; i < len; i++) {\n addTime(formatParts[i], inputParts[i]);\n }\n // handle am pm\n if (isPm && inArray[3] < 12) {\n inArray[3] += 12;\n }\n // if is 12 am, change hours to 0\n if (isPm === false && inArray[3] === 12) {\n inArray[3] = 0;\n }\n // handle timezone\n inArray[3] += timezoneHours;\n inArray[4] += timezoneMinutes;\n // return\n return isUsingUTC ? new Date(Date.UTC.apply({}, inArray)) : dateFromArray(inArray);\n }", "title": "" }, { "docid": "90b88ab1517cce986b3b42188baa3c44", "score": "0.6234781", "text": "function makeDateFromString(config) {\r\n var i, l,\r\n string = config._i,\r\n match = isoRegex.exec(string);\r\n\r\n if (match) {\r\n config._pf.iso = true;\r\n for (i = 0, l = isoDates.length; i < l; i++) {\r\n if (isoDates[i][1].exec(string)) {\r\n // match[5] should be \"T\" or undefined\r\n config._f = isoDates[i][0] + (match[6] || \" \");\r\n break;\r\n }\r\n }\r\n for (i = 0, l = isoTimes.length; i < l; i++) {\r\n if (isoTimes[i][1].exec(string)) {\r\n config._f += isoTimes[i][0];\r\n break;\r\n }\r\n }\r\n if (string.match(parseTokenTimezone)) {\r\n config._f += \"Z\";\r\n }\r\n makeDateFromStringAndFormat(config);\r\n }\r\n else {\r\n config._d = new Date(string);\r\n }\r\n }", "title": "" }, { "docid": "90b88ab1517cce986b3b42188baa3c44", "score": "0.6234781", "text": "function makeDateFromString(config) {\r\n var i, l,\r\n string = config._i,\r\n match = isoRegex.exec(string);\r\n\r\n if (match) {\r\n config._pf.iso = true;\r\n for (i = 0, l = isoDates.length; i < l; i++) {\r\n if (isoDates[i][1].exec(string)) {\r\n // match[5] should be \"T\" or undefined\r\n config._f = isoDates[i][0] + (match[6] || \" \");\r\n break;\r\n }\r\n }\r\n for (i = 0, l = isoTimes.length; i < l; i++) {\r\n if (isoTimes[i][1].exec(string)) {\r\n config._f += isoTimes[i][0];\r\n break;\r\n }\r\n }\r\n if (string.match(parseTokenTimezone)) {\r\n config._f += \"Z\";\r\n }\r\n makeDateFromStringAndFormat(config);\r\n }\r\n else {\r\n config._d = new Date(string);\r\n }\r\n }", "title": "" }, { "docid": "5c22405eeb5408c00f4b923db249b6e9", "score": "0.6210579", "text": "function parseDateFromString(input) {\n\tvar parts = input.match(/(\\d+)/g);\n\treturn new Date(parts[0], parts[1]-1, parts[2]);\n}", "title": "" }, { "docid": "9e00b0b4b30c19f24ca370a9189feb71", "score": "0.61948043", "text": "parseDate(value, format) {\n if (format == null || value == null) {\n throw new Error('Invalid arguments');\n }\n\n value = typeof value === \"object\" ? value.toString() : value + \"\";\n\n if (value === \"\") {\n return null;\n }\n\n let iFormat,\n dim,\n extra,\n iValue = 0,\n shortYearCutoff = typeof this.props.shortYearCutoff !== \"string\" ? this.props.shortYearCutoff : new Date().getFullYear() % 100 + parseInt(this.props.shortYearCutoff, 10),\n year = -1,\n month = -1,\n day = -1,\n doy = -1,\n literal = false,\n date,\n lookAhead = match => {\n let matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;\n\n if (matches) {\n iFormat++;\n }\n\n return matches;\n },\n getNumber = match => {\n let isDoubled = lookAhead(match),\n size = match === \"@\" ? 14 : match === \"!\" ? 20 : match === \"y\" && isDoubled ? 4 : match === \"o\" ? 3 : 2,\n minSize = match === \"y\" ? size : 1,\n digits = new RegExp(\"^\\\\d{\" + minSize + \",\" + size + \"}\"),\n num = value.substring(iValue).match(digits);\n\n if (!num) {\n throw new Error('Missing number at position ' + iValue);\n }\n\n iValue += num[0].length;\n return parseInt(num[0], 10);\n },\n getName = (match, shortNames, longNames) => {\n let index = -1;\n let arr = lookAhead(match) ? longNames : shortNames;\n let names = [];\n\n for (let i = 0; i < arr.length; i++) {\n names.push([i, arr[i]]);\n }\n\n names.sort((a, b) => {\n return -(a[1].length - b[1].length);\n });\n\n for (let i = 0; i < names.length; i++) {\n let name = names[i][1];\n\n if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {\n index = names[i][0];\n iValue += name.length;\n break;\n }\n }\n\n if (index !== -1) {\n return index + 1;\n } else {\n throw new Error('Unknown name at position ' + iValue);\n }\n },\n checkLiteral = () => {\n if (value.charAt(iValue) !== format.charAt(iFormat)) {\n throw new Error('Unexpected literal at position ' + iValue);\n }\n\n iValue++;\n };\n\n if (this.props.view === 'month') {\n day = 1;\n }\n\n for (iFormat = 0; iFormat < format.length; iFormat++) {\n if (literal) {\n if (format.charAt(iFormat) === \"'\" && !lookAhead(\"'\")) {\n literal = false;\n } else {\n checkLiteral();\n }\n } else {\n switch (format.charAt(iFormat)) {\n case \"d\":\n day = getNumber(\"d\");\n break;\n\n case \"D\":\n getName(\"D\", this.props.locale.dayNamesShort, this.props.locale.dayNames);\n break;\n\n case \"o\":\n doy = getNumber(\"o\");\n break;\n\n case \"m\":\n month = getNumber(\"m\");\n break;\n\n case \"M\":\n month = getName(\"M\", this.props.locale.monthNamesShort, this.props.locale.monthNames);\n break;\n\n case \"y\":\n year = getNumber(\"y\");\n break;\n\n case \"@\":\n date = new Date(getNumber(\"@\"));\n year = date.getFullYear();\n month = date.getMonth() + 1;\n day = date.getDate();\n break;\n\n case \"!\":\n date = new Date((getNumber(\"!\") - this.ticksTo1970) / 10000);\n year = date.getFullYear();\n month = date.getMonth() + 1;\n day = date.getDate();\n break;\n\n case \"'\":\n if (lookAhead(\"'\")) {\n checkLiteral();\n } else {\n literal = true;\n }\n\n break;\n\n default:\n checkLiteral();\n }\n }\n }\n\n if (iValue < value.length) {\n extra = value.substr(iValue);\n\n if (!/^\\s+/.test(extra)) {\n throw new Error('Extra/unparsed characters found in date: ' + extra);\n }\n }\n\n if (year === -1) {\n year = new Date().getFullYear();\n } else if (year < 100) {\n year += new Date().getFullYear() - new Date().getFullYear() % 100 + (year <= shortYearCutoff ? 0 : -100);\n }\n\n if (doy > -1) {\n month = 1;\n day = doy;\n\n do {\n dim = this.getDaysCountInMonth(year, month - 1);\n\n if (day <= dim) {\n break;\n }\n\n month++;\n day -= dim;\n } while (true);\n }\n\n date = this.daylightSavingAdjust(new Date(year, month - 1, day));\n\n if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {\n throw new Error('Invalid date'); // E.g. 31/02/00\n }\n\n return date;\n }", "title": "" } ]
48982912bb3a1448f671fd7feb43fc36
The `configure` function allows you to configure the domglue API to fit your needs. Arguments: `options`: An object specifying the configurable options of the API. Missing options are filled in with the values found in `domglue/defaults`. `.keyAttribute`: The attribute that identifies elements of interest (default: `datakey`). `.keyToSelector`: A function for matching keys to selectors. Defaults to using `.keyAttribute`. `.operators`: The operator functions to use for manipulating attribute and element values.
[ { "docid": "c834c78429610002f214579ee10f6618", "score": "0.55246145", "text": "function create(options, doc) {\n \n doc = doc || document;\n options = clone(options || DEFAULTS);\n options.keyAttribute = options.keyAttribute || DEFAULTS.keyAttribute;\n options.operators = options.operators || DEFAULTS.operators;\n options.markers = options.markers || DEFAULTS.markers;\n options.markers.attribute = options.markers.attribute || DEFAULTS.markers.attribute;\n options.keyToSelector = options.keyToSelector || keyToSelector;\n \n options.markers.elementContent =\n options.markers.elementContent || DEFAULTS.markers.elementContent;\n \n function isAttributeSelector(selector) {\n return containsChar(selector, options.markers.attribute);\n }\n \n function isElementContentSelector(selector) {\n return containsChar(selector, options.markers.elementContent);\n }\n \n //\n // A function that inserts variable values into `element`'s ancestors if they have a `data-key`\n // attribute that references an existing item in the data.\n //\n // The function returns an array of all manipulated elements.\n //\n function insertVars(element, data, raw, touched) {\n \n touched = touched || [];\n \n eachInObject(data, function (item, selector) {\n if (isAttributeSelector(selector)) {\n processAttribute(item, selector);\n }\n else if (isElementContentSelector(selector)) {\n processElementContent(item, selector);\n }\n else {\n processElement(item, selector);\n }\n });\n \n function processElementContent(value, selector) {\n \n var parts = selector.split(options.markers.elementContent);\n var operator = parts[0];\n var property = raw === true ? \"innerHTML\" : \"textContent\";\n \n if (operator in options.operators) {\n element[property] = options.operators[operator](\n element.textContent,\n value,\n {\n raw: !!raw,\n element: element\n }\n );\n }\n else {\n element[property] = value;\n }\n }\n \n function processAttribute(value, selector) {\n \n var parts = selector.split(options.markers.attribute);\n var operator = parts[0];\n var attribute = parts[1];\n \n if (!contains(touched, element)) {\n touched.push(element);\n }\n \n if (value) {\n if (operator) {\n if (operator in options.operators) {\n element.setAttribute(\n attribute, \n options.operators[operator](\n element.getAttribute(attribute),\n value,\n {\n raw: !!raw,\n element: element,\n attributeName: attribute\n }\n )\n );\n }\n }\n else {\n element.setAttribute(attribute, value);\n }\n }\n else if (element.hasAttribute(attribute)) {\n element.removeAttribute(attribute);\n }\n }\n \n function processElement(item, key) {\n \n var targets = findAllByKey(element, key);\n var property = raw === true ? \"innerHTML\" : \"textContent\";\n \n each(targets, function (target) {\n \n touched.push(target);\n \n if (isObject(item)) {\n insertVars(target, item, raw, touched);\n }\n else {\n target[property] = item;\n }\n });\n }\n \n return touched;\n }\n \n //\n // We find out which elements must be removed by collecting all elements which have\n // been manipulated (\"touched\") in the other functions.\n //\n function removeMissingKeys(element, touched) {\n \n var all = findAll(element);\n \n Array.prototype.filter.call(all, function (item) {\n return !contains(touched, item);\n }).forEach(function (item) {\n item.parentNode.removeChild(item);\n });\n }\n \n function live(element) {\n \n function update(data, raw) {\n insertVars(element, data, raw);\n }\n \n function render(data, raw) {\n removeMissingKeys(element, insertVars(element, data, raw));\n }\n \n function get(key, attribute) {\n \n var target = findOneByKey(element, key);\n \n if (!target) {\n return undefined;\n }\n \n return (attribute ? target.getAttribute(attribute) : target.textContent);\n }\n \n function getAll(key, attribute) {\n \n var elements = findAllByKey(element, key);\n \n return Array.prototype.map.call(elements, function (item) {\n return (attribute ? item.getAttribute(attribute) : item.textContent);\n });\n }\n \n function findOnePublic(key) {\n return findOneByKey(element, key);\n }\n \n function findAllPublic(key) {\n return key ? findAllByKey(element, key) : findAll(element);\n }\n \n function destroy() {\n element = null;\n }\n \n return {\n render: render,\n update: update,\n get: get,\n getAll: getAll,\n find: findOnePublic,\n findAll: findAllPublic,\n destroy: destroy\n };\n }\n \n function templateToElement(template, document) {\n \n var container = document.createElement(\"div\");\n \n container.innerHTML = template;\n \n return container;\n }\n \n function elementToTemplate(element) {\n return element.innerHTML;\n }\n \n function template(templateContent) {\n \n var blueprint = \"\" + templateContent;\n \n function render(data, raw) {\n return insert(\"render\", data, raw);\n }\n \n function renderMany(data, raw, separator) {\n return insertMany(\"render\", data, raw, separator);\n }\n \n function fill(data, raw) {\n return insert(\"update\", data, raw);\n }\n \n function fillMany(data, raw, separator) {\n return insertMany(\"update\", data, raw, separator);\n }\n \n function insertMany(type, data, raw, separator) {\n return data.map(function (item) {\n return insert(type, item, raw);\n }).join(separator || \"\");\n }\n \n function insert(type, data, raw) {\n \n var content;\n var element = templateToElement(blueprint, doc);\n var view = live(element);\n \n view[type](data, raw);\n \n content = elementToTemplate(element);\n \n view.destroy();\n \n return content;\n }\n \n return {\n fill: fill,\n fillMany: fillMany,\n render: render,\n renderMany: renderMany\n };\n }\n \n function findAll(element) {\n return toArray(element.querySelectorAll(\"[\" + options.keyAttribute + \"]\"));\n }\n \n function findOneByKey(element, key) {\n return element.querySelector(options.keyToSelector(key));\n }\n \n function findAllByKey(element, key) {\n return toArray(element.querySelectorAll(options.keyToSelector(key)));\n }\n \n function keyToSelector(key) {\n return \"[\" + options.keyAttribute + \"='\" + key + \"']\";\n }\n \n return {\n live: live,\n template: template\n };\n}", "title": "" } ]
[ { "docid": "8ad14baa005e6caabee9f155d8604edb", "score": "0.4992017", "text": "function setOptionsFromDOM(){\n\n //no anchors option? Checking for them in the DOM attributes\n if(!options.anchors.length){\n var attrName = '[data-anchor]';\n var anchors = $(options.sectionSelector.split(',').join(attrName + ',') + attrName, container);\n if(anchors.length){\n anchors.forEach(function(item){\n options.anchors.push(item.getAttribute('data-anchor').toString());\n });\n }\n }\n\n //no tooltips option? Checking for them in the DOM attributes\n if(!options.navigationTooltips.length){\n var attrName = '[data-tooltip]';\n var tooltips = $(options.sectionSelector.split(',').join(attrName + ',') + attrName, container);\n if(tooltips.length){\n tooltips.forEach(function(item){\n options.navigationTooltips.push(item.getAttribute('data-tooltip').toString());\n });\n }\n }\n }", "title": "" }, { "docid": "b56eb9fe750354315cfba1c446d15df4", "score": "0.49677852", "text": "function setOptionsFromDOM(){\n\n //no anchors option? Checking for them in the DOM attributes\n if(!options.anchors.length){\n var anchorsAttribute = '[data-anchor]';\n var anchors = $(options.sectionSelector.split(',').join(anchorsAttribute + ',') + anchorsAttribute, container);\n if(anchors.length){\n g_initialAnchorsInDom = true;\n anchors.forEach(function(item){\n options.anchors.push(item.getAttribute('data-anchor').toString());\n });\n }\n }\n\n //no tooltips option? Checking for them in the DOM attributes\n if(!options.navigationTooltips.length){\n var tooltipsAttribute = '[data-tooltip]';\n var tooltips = $(options.sectionSelector.split(',').join(tooltipsAttribute + ',') + tooltipsAttribute, container);\n if(tooltips.length){\n tooltips.forEach(function(item){\n options.navigationTooltips.push(item.getAttribute('data-tooltip').toString());\n });\n }\n }\n }", "title": "" }, { "docid": "7c07c6b92264356c8592e10f47ae458e", "score": "0.49498934", "text": "function setOptionsFromDOM(){\n\n //no anchors option? Checking for them in the DOM attributes\n if(!options.anchors.length){\n var anchorsAttribute = '[data-anchor]';\n var anchors = $(options.sectionSelector.split(',').join(anchorsAttribute + ',') + anchorsAttribute, container);\n if(anchors.length && anchors.length === $(options.sectionSelector, container).length){\n g_initialAnchorsInDom = true;\n anchors.forEach(function(item){\n options.anchors.push(item.getAttribute('data-anchor').toString());\n });\n }\n }\n\n //no tooltips option? Checking for them in the DOM attributes\n if(!options.navigationTooltips.length){\n var tooltipsAttribute = '[data-tooltip]';\n var tooltips = $(options.sectionSelector.split(',').join(tooltipsAttribute + ',') + tooltipsAttribute, container);\n if(tooltips.length){\n tooltips.forEach(function(item){\n options.navigationTooltips.push(item.getAttribute('data-tooltip').toString());\n });\n }\n }\n }", "title": "" }, { "docid": "64be6a19b4d27bdad32be4676a3f66c6", "score": "0.49380636", "text": "configElements(cfg) {\n let sel = [];\n let cfgAttr = Object.keys(cfg.cfg.attr||{}).filter(a => typeof cfg.cfg.attr[a] == 'object' && !Array.isArray(cfg.cfg.attr[a]));\n\n cfgAttr.forEach(s => {\n Object.keys(cfg.cfg.attr[s]).forEach(a => {\n sel.push([s, [a, cfg.cfg.attr[s][a]]]);\n });\n });\n\n sel.forEach((item, i) => {\n cfg.target.selectAll(item[0]).attr(...item[1]);\n });\n\n // TODO: Give nicer element specific names?\n cfg.target.selectAll('*').attr('id', d=>cfg.layerState.genID().str);\n }", "title": "" }, { "docid": "dd538e42bc6d074c1a0dbffcc930818c", "score": "0.48394442", "text": "function configure (key, value) {\n var attributes = {};\n\n if (arguments.length > 1) {\n attributes[key] = value;\n } else {\n attributes = key;\n }\n\n for (var k in attributes) {\n configuration[k] = attributes[k];\n }\n\n if (attributes.submit || attributes.disableSubmit) {\n toggleSubmit();\n }\n\n if (attributes.form) {\n addForm(attributes.form);\n }\n }", "title": "" }, { "docid": "dd0f21f850aa92b622aecd757ede05e9", "score": "0.48389325", "text": "function setOptionsFromDOM() {\n var sections = container.find(options.sectionSelector); //no anchors option? Checking for them in the DOM attributes\n\n if (!options.anchors.length) {\n options.anchors = sections.filter('[data-anchor]').map(function () {\n return $(this).data('anchor').toString();\n }).get();\n } //no tooltips option? Checking for them in the DOM attributes\n\n\n if (!options.navigationTooltips.length) {\n options.navigationTooltips = sections.filter('[data-tooltip]').map(function () {\n return $(this).data('tooltip').toString();\n }).get();\n }\n }", "title": "" }, { "docid": "48ed874b7501d04bd37a9100f9a94a61", "score": "0.479705", "text": "function Driver(options) {\n\n\tvar driver = this;\n\n\tdriver.attr = {};\n\n\tdriver.initialize(options);\n\n}", "title": "" }, { "docid": "25b36f13f877b7235f6434027e1e6a2b", "score": "0.47538087", "text": "function DomObject(selector, options) {\n\n // Auto init\n return this.init(selector, options);\n }", "title": "" }, { "docid": "824a1724f8ad992d953ae6b592ca1c16", "score": "0.47353637", "text": "function setOptionsFromDOM(){\n var sections = container.find(options.sectionSelector);\n\n //no anchors option? Checking for them in the DOM attributes\n if(!options.anchors.length){\n options.anchors = sections.filter('[data-anchor]').map(function(){\n return $(this).data('anchor').toString();\n }).get();\n }\n\n //no tooltips option? Checking for them in the DOM attributes\n if(!options.navigationTooltips.length){\n options.navigationTooltips = sections.filter('[data-tooltip]').map(function(){\n return $(this).data('tooltip').toString();\n }).get();\n }\n }", "title": "" }, { "docid": "824a1724f8ad992d953ae6b592ca1c16", "score": "0.47353637", "text": "function setOptionsFromDOM(){\n var sections = container.find(options.sectionSelector);\n\n //no anchors option? Checking for them in the DOM attributes\n if(!options.anchors.length){\n options.anchors = sections.filter('[data-anchor]').map(function(){\n return $(this).data('anchor').toString();\n }).get();\n }\n\n //no tooltips option? Checking for them in the DOM attributes\n if(!options.navigationTooltips.length){\n options.navigationTooltips = sections.filter('[data-tooltip]').map(function(){\n return $(this).data('tooltip').toString();\n }).get();\n }\n }", "title": "" }, { "docid": "ab96fc4862dc9c8f615dffc038f041a0", "score": "0.47207084", "text": "function setOptionsFromDOM(){\r\n var sections = container.find(options.sectionSelector);\r\n\r\n //no anchors option? Checking for them in the DOM attributes\r\n if(!options.anchors.length){\r\n options.anchors = sections.filter('[data-anchor]').map(function(){\r\n return $(this).data('anchor').toString();\r\n }).get();\r\n }\r\n\r\n //no tooltips option? Checking for them in the DOM attributes\r\n if(!options.navigationTooltips.length){\r\n options.navigationTooltips = sections.filter('[data-tooltip]').map(function(){\r\n return $(this).data('tooltip').toString();\r\n }).get();\r\n }\r\n }", "title": "" }, { "docid": "ab96fc4862dc9c8f615dffc038f041a0", "score": "0.47207084", "text": "function setOptionsFromDOM(){\r\n var sections = container.find(options.sectionSelector);\r\n\r\n //no anchors option? Checking for them in the DOM attributes\r\n if(!options.anchors.length){\r\n options.anchors = sections.filter('[data-anchor]').map(function(){\r\n return $(this).data('anchor').toString();\r\n }).get();\r\n }\r\n\r\n //no tooltips option? Checking for them in the DOM attributes\r\n if(!options.navigationTooltips.length){\r\n options.navigationTooltips = sections.filter('[data-tooltip]').map(function(){\r\n return $(this).data('tooltip').toString();\r\n }).get();\r\n }\r\n }", "title": "" }, { "docid": "ab96fc4862dc9c8f615dffc038f041a0", "score": "0.47207084", "text": "function setOptionsFromDOM(){\r\n var sections = container.find(options.sectionSelector);\r\n\r\n //no anchors option? Checking for them in the DOM attributes\r\n if(!options.anchors.length){\r\n options.anchors = sections.filter('[data-anchor]').map(function(){\r\n return $(this).data('anchor').toString();\r\n }).get();\r\n }\r\n\r\n //no tooltips option? Checking for them in the DOM attributes\r\n if(!options.navigationTooltips.length){\r\n options.navigationTooltips = sections.filter('[data-tooltip]').map(function(){\r\n return $(this).data('tooltip').toString();\r\n }).get();\r\n }\r\n }", "title": "" }, { "docid": "1e05ec62d5f88724fc1cff37829b91a8", "score": "0.46927246", "text": "function setOptionsFromDOM(){\n var sections = container.find(options.sectionSelector);\n\n //no anchors option? Checking for them in the DOM attributes\n if(!options.anchors.length){\n options.anchors = sections.filter('[data-anchor]').map(function(){\n return $(this).data('anchor').toString();\n }).get();\n }\n\n //no tooltipos option? Checking for them in the DOM attributes\n if(!options.navigationTooltips.length){\n options.navigationTooltips = sections.filter('[data-tooltip]').map(function(){\n return $(this).data('tooltip').toString();\n }).get();\n }\n }", "title": "" }, { "docid": "1e05ec62d5f88724fc1cff37829b91a8", "score": "0.46927246", "text": "function setOptionsFromDOM(){\n var sections = container.find(options.sectionSelector);\n\n //no anchors option? Checking for them in the DOM attributes\n if(!options.anchors.length){\n options.anchors = sections.filter('[data-anchor]').map(function(){\n return $(this).data('anchor').toString();\n }).get();\n }\n\n //no tooltipos option? Checking for them in the DOM attributes\n if(!options.navigationTooltips.length){\n options.navigationTooltips = sections.filter('[data-tooltip]').map(function(){\n return $(this).data('tooltip').toString();\n }).get();\n }\n }", "title": "" }, { "docid": "da9c2a0907b000ce72e326d2832f1e99", "score": "0.4682842", "text": "constructor(options) {\n // TODO: use react\n super({ node: notebooktools_Private.createSelectorNode(options) });\n /**\n * Get the value for the data.\n */\n this._getValue = (cell) => {\n let value = cell.model.metadata.get(this.key);\n if (value === undefined) {\n value = this._default;\n }\n return value;\n };\n /**\n * Set the value for the data.\n */\n this._setValue = (cell, value) => {\n if (value === this._default) {\n cell.model.metadata.delete(this.key);\n }\n else {\n cell.model.metadata.set(this.key, value);\n }\n };\n this._changeGuard = false;\n this.addClass('jp-KeySelector');\n this.key = options.key;\n this._default = options.default;\n this._validCellTypes = options.validCellTypes || [];\n this._getter = options.getter || this._getValue;\n this._setter = options.setter || this._setValue;\n }", "title": "" }, { "docid": "cd07e1d9a6b6fc20dbbe51747446062d", "score": "0.46806902", "text": "function setOptionsFromDOM(){\r\n var sections = container.find(options.sectionSelector);\r\n\r\n //no anchors option? Checking for them in the DOM attributes\r\n if(!options.anchors.length){\r\n options.anchors = sections.filter('[data-anchor]').map(function(){\r\n return $(this).data('anchor').toString();\r\n }).get();\r\n }\r\n\r\n //no tooltipos option? Checking for them in the DOM attributes\r\n if(!options.navigationTooltips.length){\r\n options.navigationTooltips = sections.filter('[data-tooltip]').map(function(){\r\n return $(this).data('tooltip').toString();\r\n }).get();\r\n }\r\n }", "title": "" }, { "docid": "cb9664b7f64ec13a76996eb20e228ade", "score": "0.46476272", "text": "function setOptionsFromDOM(){\r\n //no anchors option? Checking for them in the DOM attributes\r\n if(!options.anchors.length){\r\n options.anchors = $(options.sectionSelector + '[data-anchor]').map(function(){\r\n return $(this).data('anchor').toString();\r\n }).get();\r\n }\r\n\r\n //no tooltipos option? Checking for them in the DOM attributes\r\n if(!options.navigationTooltips.length){\r\n options.navigationTooltips = $(options.sectionSelector + '[data-tooltip]').map(function(){\r\n return $(this).data('tooltip').toString();\r\n }).get();\r\n }\r\n }", "title": "" }, { "docid": "533da47a0ce9b16c4f6d04eda4615b89", "score": "0.45385307", "text": "function initComponent(options) {\n return {\n get: (host, v) => v, // required to be recognized as property descriptor,\n set: () => {}, //required to stop TypeError: setting getter-only property \"x\"\n connect: (host, key) => {\n\n /**********************************************************/\n /************************ GUIDANCE ************************/\n /**********************************************************/\n /** If your component uses a traditional approach of **/\n /** accepting an element and updating its content, **/\n /** initialise it here and pass `host` as the argument **/\n /** for the element that would normally be passed to **/\n /** your script. If you are creating your element from **/\n /** scratch, see the hybrids.js docs and maybe delete **/\n /** this method and follow the hybrids examples instead **/\n /** https://github.com/hybridsjs/hybrids **/\n /** **/\n /** See also this example component for guidance: **/\n /* https://github.com/yochannah/biojs-webcomponent-prototype\n /** or admire the minimal demo below **/\n /** **/\n /**********************************************************/\n /****** WRITE CODE TO INITIALISE YOUR COMPONENT HERE ******/\n /**********************************************************/\n\n /** If you need to pass in a parameter - e.g. perhaps **/\n /** you have a gene visualisation so you want a gene id **/\n /** as a parameter, set the parameter as an attribute, **/\n /** and then get the attribute from host, like this: **/\n\n var myGeneId = host.getAttribute(\"geneId\"); \n\n /** The line above would return BRCA1 if you've left the **/\n /** default settings. Delete if needed. **/\n /** This is just an example, you should remove it later. **/\n\n host.innerHTML = \"<div>A placeholder for a pretty\" +\n \" visualisation for \" + myGeneId + \".</div>\";\n\n /** The line above explains how you can interact with your Web Component. **/\n /** You should remove it later. **/\n\n //leave this line here. Deleting it will result in your css going AWOL.\n addStylesIfNeeded();\n }\n }\n}", "title": "" }, { "docid": "82a25cbe16507d2c13189df992edf868", "score": "0.4486194", "text": "function _Laidout(key,el,conf) {\n\n\t}", "title": "" }, { "docid": "37c9c5826703791a4739a07f6eca055b", "score": "0.4485377", "text": "function defineComponent(options) {\r\n return isFunction(options) ? { setup: options, name: options.name } : options;\r\n}", "title": "" }, { "docid": "ee2bda33f1457c92cd5b7567c20c70e0", "score": "0.4465199", "text": "static get pluginConfig() {\n return {\n chain: ['render', 'renderContents', 'onElementClick', 'onElementDblClick', 'onElementMouseOver', 'onElementMouseOut'],\n assign: ['getElementForDependency', 'getDependencyForElement']\n };\n }", "title": "" }, { "docid": "5f6786954219adcfb71c3c793a5e0816", "score": "0.43847167", "text": "setup(options) {\n options = options || this.get('options');\n // this.get('containers').pushObjects(containers);\n\n let drake = dragula(this.get('containers'), options);\n\n this.set('drake', drake);\n }", "title": "" }, { "docid": "64c9379ae506a5f2992dec34ce56f368", "score": "0.43618697", "text": "function gui_draw_configure(cid, tag, attr, val) {\n gui(cid).get_elem(tag, function(e) {\n var obj = {};\n if (Array.isArray(val)) {\n obj[attr] = val.join(\" \");\n } else {\n // strings or numbers\n obj[attr] = val;\n }\n configure_item(e, obj);\n });\n}", "title": "" }, { "docid": "ade8fe92f6257be647319495fc5cc227", "score": "0.4361638", "text": "function createSelectorNode(options) {\n let name = options.key;\n let title = options.title || name[0].toLocaleUpperCase() + name.slice(1);\n let optionNodes = [];\n for (let label in options.optionsMap) {\n let value = JSON.stringify(options.optionsMap[label]);\n optionNodes.push(virtualdom_lib[\"h\"].option({ value }, label));\n }\n let node = virtualdom_lib[\"VirtualDOM\"].realize(virtualdom_lib[\"h\"].div({}, virtualdom_lib[\"h\"].label(title, virtualdom_lib[\"h\"].select({}, optionNodes))));\n styling[\"a\" /* Styling */].styleNode(node);\n return node;\n }", "title": "" }, { "docid": "fb6d2c756c437cfb79bef9a31f9a51fe", "score": "0.43442756", "text": "constructor(element, options) {\n\n this._element = element;\n this._options = options;\n this._toggle = null;\n this._targets = null;\n this._triggerFn = null;\n\n this._intitialize();\n\n }", "title": "" }, { "docid": "f0b25b93bbcd15d3309dff8f74478103", "score": "0.43226728", "text": "function wrapFunctional(options) {\n if (!options || !options.functional) {\n return options;\n }\n\n const propKeys = Array.isArray(options.props) ? options.props : Object.keys(options.props || {});\n return {\n render(h) {\n const attrs = {};\n const props = {};\n\n for (const key in this.$attrs) {\n if (propKeys.includes(key)) {\n props[key] = this.$attrs[key];\n } else {\n attrs[key] = this.$attrs[key];\n }\n }\n\n return h(options, {\n on: this.$listeners,\n attrs,\n props,\n scopedSlots: this.$scopedSlots\n }, this.$slots.default);\n }\n\n };\n}", "title": "" }, { "docid": "f0b25b93bbcd15d3309dff8f74478103", "score": "0.43226728", "text": "function wrapFunctional(options) {\n if (!options || !options.functional) {\n return options;\n }\n\n const propKeys = Array.isArray(options.props) ? options.props : Object.keys(options.props || {});\n return {\n render(h) {\n const attrs = {};\n const props = {};\n\n for (const key in this.$attrs) {\n if (propKeys.includes(key)) {\n props[key] = this.$attrs[key];\n } else {\n attrs[key] = this.$attrs[key];\n }\n }\n\n return h(options, {\n on: this.$listeners,\n attrs,\n props,\n scopedSlots: this.$scopedSlots\n }, this.$slots.default);\n }\n\n };\n}", "title": "" }, { "docid": "1b88b1e231bffb5f633f6a817fcaf765", "score": "0.4291565", "text": "constructor( options )\n {\n this.options = options;\n \n try\n {\n\t\t if( options.uniqueid )\n\t\t {\n\t\t \tif( window.ccGUI.guiElements[ options.uniqueid ] )\n\t\t \t{\n\t\t \t\tconsole.log( 'ccGUI: Gui element with proposed uniqueId ' + options.uniqueid + ' is taken. Overwriting.' );\n\t\t \t}\n\t\t \twindow.ccGUI.guiElements[ options.uniqueid ] = this;\n\t\t }\n\t\t}\n\t\tcatch( e )\n\t\t{\n\t\t\tconsole.log( 'No options found, no uniqueid defined when creating object.' );\n\t\t}\n \n let d = document.createElement( 'div' );\n this.domElement = d;\n this.attachDomElement();\n }", "title": "" }, { "docid": "324fcc8788bd73c9c815f3d351f53ba9", "score": "0.42694938", "text": "function configure( options ) {\n\n\t\tvar numberOfSlides = document.querySelectorAll( SLIDES_SELECTOR ).length;\n\n\t\tdom.wrapper.classList.remove( config.transition );\n\n\t\t// New config options may be passed when this method\n\t\t// is invoked through the API after initialization\n\t\tif( typeof options === 'object' ) extend( config, options );\n\n\t\t// Force linear transition based on browser capabilities\n\t\tif( features.transforms3d === false ) config.transition = 'linear';\n\n\t\tdom.wrapper.classList.add( config.transition );\n\n\t\tdom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed );\n\t\tdom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition );\n\n\t\tdom.controls.style.display = config.controls ? 'block' : 'none';\n\t\tdom.progress.style.display = config.progress ? 'block' : 'none';\n\n\t\tif( config.rtl ) {\n\t\t\tdom.wrapper.classList.add( 'rtl' );\n\t\t}\n\t\telse {\n\t\t\tdom.wrapper.classList.remove( 'rtl' );\n\t\t}\n\n\t\tif( config.center ) {\n\t\t\tdom.wrapper.classList.add( 'center' );\n\t\t}\n\t\telse {\n\t\t\tdom.wrapper.classList.remove( 'center' );\n\t\t}\n\n\t\tif( config.mouseWheel ) {\n\t\t\tdocument.addEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF\n\t\t\tdocument.addEventListener( 'mousewheel', onDocumentMouseScroll, false );\n\t\t}\n\t\telse {\n\t\t\tdocument.removeEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF\n\t\t\tdocument.removeEventListener( 'mousewheel', onDocumentMouseScroll, false );\n\t\t}\n\n\t\t// Rolling 3D links\n\t\tif( config.rollingLinks ) {\n\t\t\tenableRollingLinks();\n\t\t}\n\t\telse {\n\t\t\tdisableRollingLinks();\n\t\t}\n\n\t\t// Iframe link previews\n\t\tif( config.previewLinks ) {\n\t\t\tenablePreviewLinks();\n\t\t}\n\t\telse {\n\t\t\tdisablePreviewLinks();\n\t\t\tenablePreviewLinks( '[data-preview-link]' );\n\t\t}\n\n\t\t// Auto-slide playback controls\n\t\tif( numberOfSlides > 1 && config.autoSlide && config.autoSlideStoppable && features.canvas && features.requestAnimationFrame ) {\n\t\t\tautoSlidePlayer = new Playback( dom.wrapper, function() {\n\t\t\t\treturn Math.min( Math.max( ( Date.now() - autoSlideStartTime ) / autoSlide, 0 ), 1 );\n\t\t\t} );\n\n\t\t\tautoSlidePlayer.on( 'click', onAutoSlidePlayerClick );\n\t\t\tautoSlidePaused = false;\n\t\t}\n\t\telse if( autoSlidePlayer ) {\n\t\t\tautoSlidePlayer.destroy();\n\t\t\tautoSlidePlayer = null;\n\t\t}\n\n\t\t// Load the theme in the config, if it's not already loaded\n\t\tif( config.theme && dom.theme ) {\n\t\t\tvar themeURL = dom.theme.getAttribute( 'href' );\n\t\t\tvar themeFinder = /[^\\/]*?(?=\\.css)/;\n\t\t\tvar themeName = themeURL.match(themeFinder)[0];\n\n\t\t\tif( config.theme !== themeName ) {\n\t\t\t\tthemeURL = themeURL.replace(themeFinder, config.theme);\n\t\t\t\tdom.theme.setAttribute( 'href', themeURL );\n\t\t\t}\n\t\t}\n\n\t\tsync();\n\n\t}", "title": "" }, { "docid": "324fcc8788bd73c9c815f3d351f53ba9", "score": "0.42694938", "text": "function configure( options ) {\n\n\t\tvar numberOfSlides = document.querySelectorAll( SLIDES_SELECTOR ).length;\n\n\t\tdom.wrapper.classList.remove( config.transition );\n\n\t\t// New config options may be passed when this method\n\t\t// is invoked through the API after initialization\n\t\tif( typeof options === 'object' ) extend( config, options );\n\n\t\t// Force linear transition based on browser capabilities\n\t\tif( features.transforms3d === false ) config.transition = 'linear';\n\n\t\tdom.wrapper.classList.add( config.transition );\n\n\t\tdom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed );\n\t\tdom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition );\n\n\t\tdom.controls.style.display = config.controls ? 'block' : 'none';\n\t\tdom.progress.style.display = config.progress ? 'block' : 'none';\n\n\t\tif( config.rtl ) {\n\t\t\tdom.wrapper.classList.add( 'rtl' );\n\t\t}\n\t\telse {\n\t\t\tdom.wrapper.classList.remove( 'rtl' );\n\t\t}\n\n\t\tif( config.center ) {\n\t\t\tdom.wrapper.classList.add( 'center' );\n\t\t}\n\t\telse {\n\t\t\tdom.wrapper.classList.remove( 'center' );\n\t\t}\n\n\t\tif( config.mouseWheel ) {\n\t\t\tdocument.addEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF\n\t\t\tdocument.addEventListener( 'mousewheel', onDocumentMouseScroll, false );\n\t\t}\n\t\telse {\n\t\t\tdocument.removeEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF\n\t\t\tdocument.removeEventListener( 'mousewheel', onDocumentMouseScroll, false );\n\t\t}\n\n\t\t// Rolling 3D links\n\t\tif( config.rollingLinks ) {\n\t\t\tenableRollingLinks();\n\t\t}\n\t\telse {\n\t\t\tdisableRollingLinks();\n\t\t}\n\n\t\t// Iframe link previews\n\t\tif( config.previewLinks ) {\n\t\t\tenablePreviewLinks();\n\t\t}\n\t\telse {\n\t\t\tdisablePreviewLinks();\n\t\t\tenablePreviewLinks( '[data-preview-link]' );\n\t\t}\n\n\t\t// Auto-slide playback controls\n\t\tif( numberOfSlides > 1 && config.autoSlide && config.autoSlideStoppable && features.canvas && features.requestAnimationFrame ) {\n\t\t\tautoSlidePlayer = new Playback( dom.wrapper, function() {\n\t\t\t\treturn Math.min( Math.max( ( Date.now() - autoSlideStartTime ) / autoSlide, 0 ), 1 );\n\t\t\t} );\n\n\t\t\tautoSlidePlayer.on( 'click', onAutoSlidePlayerClick );\n\t\t\tautoSlidePaused = false;\n\t\t}\n\t\telse if( autoSlidePlayer ) {\n\t\t\tautoSlidePlayer.destroy();\n\t\t\tautoSlidePlayer = null;\n\t\t}\n\n\t\t// Load the theme in the config, if it's not already loaded\n\t\tif( config.theme && dom.theme ) {\n\t\t\tvar themeURL = dom.theme.getAttribute( 'href' );\n\t\t\tvar themeFinder = /[^\\/]*?(?=\\.css)/;\n\t\t\tvar themeName = themeURL.match(themeFinder)[0];\n\n\t\t\tif( config.theme !== themeName ) {\n\t\t\t\tthemeURL = themeURL.replace(themeFinder, config.theme);\n\t\t\t\tdom.theme.setAttribute( 'href', themeURL );\n\t\t\t}\n\t\t}\n\n\t\tsync();\n\n\t}", "title": "" }, { "docid": "58fb2680047326af60f5bcfb10d9c3ff", "score": "0.42178532", "text": "function extendRenderOptionPropEditors()\n{\n\tvar appendDefinitionItem = function(definitions, fieldName, dataType, targetClasses, fieldNamePrefixes)\n\t{\n\t\tvar classes = AU.toArray(targetClasses);\n\t\tvar prefixes = fieldNamePrefixes || [''];\n\t\tfor (var i = 0, l = classes.length; i < l; ++i)\n\t\t{\n\t\t\tfor (var j = 0, k = prefixes.length; j < k; ++j)\n\t\t\t{\n\t\t\t\tvar name = prefixes[j]? (prefixes[j] + fieldName.upperFirst()): fieldName;\n\t\t\t\tdefinitions.push({'name': 'spectrum_' + name, 'dataType': dataType, 'targetClass': classes[i]});\n\t\t\t}\n\t\t}\n\t};\n\n\t//Kekule.Render.RenderOptionUtils.getOptionDefinitions = function()\n\tvar getSpectrumObjRenderOptionFieldList = function()\n\t{\n\t\t//var result = Kekule.Render.RenderOptionUtils.getOptionDefinitions();\n\t\tvar result = [];\n\t\tvar SpectrumClass = Kekule.Spectroscopy.Spectrum;\n\t\tvar SpectrumDataSectionClass = Kekule.Spectroscopy.SpectrumDataSection;\n\t\tvar axisPrefixes = ['', 'independent', 'dependent'];\n\n\t\tappendDefinitionItem(result, 'reversedAxises', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'reverseIndependentDataDirection', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'reverseDependentDataDirection', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'reverseIndependentAxisAlign', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'reverseDependentAxisAlign', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'dataColor', DataType.STRING, [SpectrumClass, SpectrumDataSectionClass]);\n\t\tappendDefinitionItem(result, 'dataStrokeWidthRatio', DataType.FLOAT, [SpectrumClass, SpectrumDataSectionClass]);\n\t\tappendDefinitionItem(result, 'dataStrokeWidthMin', DataType.NUMBER, [SpectrumClass, SpectrumDataSectionClass]);\n\t\tappendDefinitionItem(result, 'dataStrokeWidthMax', DataType.NUMBER, [SpectrumClass, SpectrumDataSectionClass]);\n\t\tappendDefinitionItem(result, 'dataStrokeWidthFixed', DataType.NUMBER, [SpectrumClass, SpectrumDataSectionClass]);\n\t\tappendDefinitionItem(result, 'visibleIndependentDataRangeFrom_Continuous', DataType.FLOAT, SpectrumClass);\n\t\tappendDefinitionItem(result, 'visibleIndependentDataRangeTo_Continuous', DataType.FLOAT, SpectrumClass);\n\t\tappendDefinitionItem(result, 'visibleDependentDataRangeFrom_Continuous', DataType.FLOAT, SpectrumClass);\n\t\tappendDefinitionItem(result, 'visibleDependentDataRangeTo_Continuous', DataType.FLOAT, SpectrumClass);\n\t\tappendDefinitionItem(result, 'visibleIndependentDataRangeFrom_Peak', DataType.FLOAT, SpectrumClass);\n\t\tappendDefinitionItem(result, 'visibleIndependentDataRangeTo_Peak', DataType.FLOAT, SpectrumClass);\n\t\tappendDefinitionItem(result, 'visibleDependentDataRangeFrom_Peak', DataType.FLOAT, SpectrumClass);\n\t\tappendDefinitionItem(result, 'visibleDependentDataRangeTo_Peak', DataType.FLOAT, SpectrumClass);\n\n\t\tappendDefinitionItem(result, 'displayIndependentAxis', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'displayIndependentAxisScales', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'displayIndependentAxisLabel', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'displayIndependentAxisUnit', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'displayDependentAxis', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'displayDependentAxisScales', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'displayDependentAxisLabel', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'displayDependentAxisUnit', DataType.BOOL, SpectrumClass);\n\t\tappendDefinitionItem(result, 'displaySpectrum', DataType.BOOL, SpectrumClass);\n\n\t\tappendDefinitionItem(result, 'axisScaleLabelFontFamily', DataType.STRING, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisScaleLabelFontSize', DataType.NUMBER, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisScaleLabelColor', DataType.STRING, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisLabelFontFamily', DataType.STRING, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisLabelFontSize', DataType.NUMBER, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisLabelColor', DataType.STRING, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisColor', DataType.STRING, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisWidthRatio', DataType.FLOAT, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisWidthMin', DataType.NUMBER, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisWidthMax', DataType.NUMBER, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisWidthFixed', DataType.NUMBER, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisScaleMarkSizeRatio', DataType.FLOAT, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisScaleMarkSizeMin', DataType.NUMBER, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisScaleMarkSizeMax', DataType.NUMBER, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisScaleMarkSizeFixed', DataType.NUMBER, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisUnlabeledScaleSizeRatio', DataType.FLOAT, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisScaleMarkPreferredCount', DataType.NUMBER, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisLabelPaddingRatio', DataType.FLOAT, SpectrumClass, axisPrefixes);\n\t\tappendDefinitionItem(result, 'axisScaleLabelPaddingRatio', DataType.NUMBER, SpectrumClass, axisPrefixes);\n\n\t\treturn result;\n\t}\n\n\t// hack\n\tif (Kekule.PropertyEditor && Kekule.PropertyEditor.ChemRender2DOptionsEditor)\n\t{\n\t\tvar proto = ClassEx.getPrototype(Kekule.PropertyEditor.ChemRender2DOptionsEditor);\n\t\tproto.CHILD_FIELD_INFOS = proto.CHILD_FIELD_INFOS.concat(getSpectrumObjRenderOptionFieldList());\n\t}\n}", "title": "" }, { "docid": "b835c360bc19a9c4af2115653b0f809a", "score": "0.42041278", "text": "configure(options) {\n (0,_pnp_common__WEBPACK_IMPORTED_MODULE_0__.mergeOptions)(this.data.options, options);\n return this;\n }", "title": "" }, { "docid": "837869ef16772a0d3022f584cf627c9c", "score": "0.41970292", "text": "function defineComponent(options) {\n return Object(shared_esm_bundler[\"n\" /* isFunction */])(options) ? { setup: options, name: options.name } : options;\n}", "title": "" }, { "docid": "ed2005743fc7da925ba61560ac4ea23f", "score": "0.41937703", "text": "function reportsCreateElementFromConfigDOM(elementDOM) {\n //create trackdiv and glyphTrack objects and configure them\n if(!elementDOM) { return null; }\n var element_type = elementDOM.getAttribute(\"element_type\");\n if(element_type == \"layout\") { return null;}\n if(element_type == \"tools_panel\") { return null;}\n\n var elementID = elementDOM.getAttribute(\"elementID\");\n\n var reportElement = current_report.elements[elementID];\n if(!reportElement) {\n reportElement = zenbuElement_createElement(element_type, elementID);\n }\n\n reportElement.load_on_page_init = false;\n reportElement.show_titlebar = true;\n reportElement.widget_search = false;\n reportElement.widget_filter = false;\n reportElement.move_selection_to_top=false;\n reportElement.sort_reverse = false;\n reportElement.show_search_matches = false;\n reportElement.hide_zero = false;\n reportElement.title = \"\";\n reportElement.title_prefix = \"\";\n //reportElement.resetable = false;\n \n if(elementDOM.getAttribute(\"main_div_id\")) { reportElement.main_div_id = elementDOM.getAttribute(\"main_div_id\"); }\n if(elementDOM.getAttribute(\"title\")) { reportElement.title = elementDOM.getAttribute(\"title\"); }\n if(elementDOM.getAttribute(\"title_prefix\")) { reportElement.title_prefix = elementDOM.getAttribute(\"title_prefix\"); }\n\n if(elementDOM.getAttribute(\"datasource_mode\")) { reportElement.datasource_mode = elementDOM.getAttribute(\"datasource_mode\"); }\n if(elementDOM.getAttribute(\"datasourceElementID\")) { reportElement.datasourceElementID = elementDOM.getAttribute(\"datasourceElementID\"); }\n if(elementDOM.getAttribute(\"source_ids\")) { reportElement.source_ids = elementDOM.getAttribute(\"source_ids\"); }\n if(elementDOM.getAttribute(\"query_filter\")) { reportElement.query_filter = elementDOM.getAttribute(\"query_filter\"); }\n if(elementDOM.getAttribute(\"collaboration_filter\")) { reportElement.collaboration_filter = elementDOM.getAttribute(\"collaboration_filter\"); }\n if(elementDOM.getAttribute(\"query_format\")) { reportElement.query_format = elementDOM.getAttribute(\"query_format\"); }\n if(elementDOM.getAttribute(\"query_edge_search_depth\")) { reportElement.query_edge_search_depth = elementDOM.getAttribute(\"query_edge_search_depth\"); }\n\n if(elementDOM.getAttribute(\"table_page_size\")) { reportElement.table_page_size = Math.floor(elementDOM.getAttribute(\"table_page_size\")); }\n //if(elementDOM.getAttribute(\"table_num_pages\")) { reportElement.table_num_pages = elementDOM.getAttribute(\"table_num_pages\"); }\n //if(elementDOM.getAttribute(\"table_page\")) { reportElement.table_page = elementDOM.getAttribute(\"table_page\"); }\n if(elementDOM.getAttribute(\"sort_col\")) { reportElement.sort_col = elementDOM.getAttribute(\"sort_col\"); }\n if(elementDOM.getAttribute(\"sort_reverse\") == \"true\") { reportElement.sort_reverse = true; }\n if(elementDOM.getAttribute(\"move_selection_to_top\") == \"true\") { reportElement.move_selection_to_top = true; }\n\n if(elementDOM.getAttribute(\"load_on_page_init\") == \"true\") { reportElement.load_on_page_init = true; }\n //if(elementDOM.getAttribute(\"resetable\") == \"true\") { reportElement.resetable = true; }\n if(elementDOM.getAttribute(\"init_selection\")) { reportElement.init_selection = elementDOM.getAttribute(\"init_selection\"); }\n //if(elementDOM.getAttribute(\"selected_id\")) { reportElement.selected_id = elementDOM.getAttribute(\"selected_id\"); }\n //if(elementDOM.getAttribute(\"search_data_filter\")) { reportElement.search_data_filter = elementDOM.getAttribute(\"search_data_filter\"); }\n //if(elementDOM.getAttribute(\"show_search_matches\") == \"true\") { reportElement.show_search_matches = true; }\n\n if(elementDOM.getAttribute(\"show_titlebar\") == \"false\") { reportElement.show_titlebar = false; }\n if(elementDOM.getAttribute(\"widget_search\") == \"true\") { reportElement.widget_search = true; }\n if(elementDOM.getAttribute(\"widget_filter\") == \"true\") { reportElement.widget_filter = true; }\n if(elementDOM.getAttribute(\"border\")) { reportElement.border = elementDOM.getAttribute(\"border\"); }\n\n if(elementDOM.getAttribute(\"hide_zero\") == \"true\") { reportElement.hide_zero = true; }\n\n if(elementDOM.getAttribute(\"layout_mode\")) { reportElement.layout_mode = elementDOM.getAttribute(\"layout_mode\"); }\n if(elementDOM.getAttribute(\"layout_parentID\")) { reportElement.layout_parentID = elementDOM.getAttribute(\"layout_parentID\"); }\n if(elementDOM.getAttribute(\"layout_col\")) { reportElement.layout_col = parseInt(elementDOM.getAttribute(\"layout_col\")); }\n if(elementDOM.getAttribute(\"layout_row\")) { reportElement.layout_row = parseInt(elementDOM.getAttribute(\"layout_row\")); }\n if(elementDOM.getAttribute(\"layout_xpos\")) { reportElement.layout_xpos = parseInt(elementDOM.getAttribute(\"layout_xpos\")); }\n if(elementDOM.getAttribute(\"layout_ypos\")) { reportElement.layout_ypos = parseInt(elementDOM.getAttribute(\"layout_ypos\")); }\n if(elementDOM.getAttribute(\"content_width\")) { reportElement.content_width = parseInt(elementDOM.getAttribute(\"content_width\")); }\n if(elementDOM.getAttribute(\"content_height\")) { reportElement.content_height = parseInt(elementDOM.getAttribute(\"content_height\")); }\n\n //element_type specific parameters\n //if(reportElement.element_type == \"table\") {\n //}\n if(reportElement.element_type == \"chart\") {\n reportElement.dual_feature_axis = false;\n reportElement.symetric_axis = false;\n if(elementDOM.getAttribute(\"chart_type\")) { reportElement.chart_type = elementDOM.getAttribute(\"chart_type\"); }\n //if(elementDOM.getAttribute(\"layout_type\")) { reportElement.layout_type = elementDOM.getAttribute(\"layout_type\"); }\n if(elementDOM.getAttribute(\"dual_feature_axis\") == \"1\") { reportElement.dual_feature_axis = true; }\n if(elementDOM.getAttribute(\"symetric_axis\") == \"1\") { reportElement.symetric_axis = true; }\n \n var xaxisDOM = elementDOM.getElementsByTagName(\"chart_xaxis\")[0];\n if(xaxisDOM.getAttribute(\"datatype\")) { reportElement.xaxis.datatype = xaxisDOM.getAttribute(\"datatype\"); }\n if(xaxisDOM.getAttribute(\"fixedscale\") == \"1\") { reportElement.xaxis.fixedscale = true; } else { reportElement.xaxis.fixedscale = false; }\n if(xaxisDOM.getAttribute(\"symetric\") == \"1\") { reportElement.xaxis.symetric = true; } else { reportElement.xaxis.symetric = false; }\n if(xaxisDOM.getAttribute(\"log\") == \"1\") { reportElement.xaxis.log = true; } else { reportElement.xaxis.log = false; }\n\n var yaxisDOM = elementDOM.getElementsByTagName(\"chart_yaxis\")[0];\n if(yaxisDOM.getAttribute(\"datatype\")) { reportElement.yaxis.datatype = yaxisDOM.getAttribute(\"datatype\"); }\n if(yaxisDOM.getAttribute(\"fixedscale\") == \"1\") { reportElement.yaxis.fixedscale = true; } else { reportElement.yaxis.fixedscale = false; }\n if(yaxisDOM.getAttribute(\"symetric\") == \"1\") { reportElement.yaxis.symetric = true; } else { reportElement.yaxis.symetric = false; }\n if(yaxisDOM.getAttribute(\"log\") == \"1\") { reportElement.yaxis.log = true; } else { reportElement.yaxis.log = false; }\n }\n if(reportElement.element_type == \"zenbugb\") {\n if(elementDOM.getAttribute(\"zenbu_url\")) { reportElement.zenbu_url = elementDOM.getAttribute(\"zenbu_url\"); }\n if(elementDOM.getAttribute(\"view_config\")) { reportElement.view_config = elementDOM.getAttribute(\"view_config\"); }\n if(elementDOM.getAttribute(\"chrom_location\")) { reportElement.chrom_location = elementDOM.getAttribute(\"chrom_location\"); }\n }\n if(reportElement.element_type == \"html\") {\n if(elementDOM.getAttribute(\"html_content\")) { reportElement.html_content = elementDOM.getAttribute(\"html_content\"); }\n var htmlContentDOM = elementDOM.getElementsByTagName(\"html_content\");\n if(htmlContentDOM && htmlContentDOM.length>0) {\n reportElement.html_content = htmlContentDOM[0].firstChild.nodeValue;\n }\n //console.log(\"html_content [\"+reportElement.html_content+\"]\")\n }\n if(reportElement.element_type == \"category\") {\n if(elementDOM.getAttribute(\"category_datatype\")) { reportElement.category_datatype = elementDOM.getAttribute(\"category_datatype\"); }\n if(elementDOM.getAttribute(\"display_type\")) { reportElement.display_type = elementDOM.getAttribute(\"display_type\"); }\n if(elementDOM.getAttribute(\"colorspace\")) { reportElement.colorspace = elementDOM.getAttribute(\"colorspace\"); }\n }\n //if(reportElement.element_type == \"layout\") {\n // if(reportElement.layout_type) { elementDOM.setAttribute(\"layout_type\", reportElement.layout_type); }\n //}\n\n \n //dtype_column\n // <dtype_column datatype=\"geneName\" title=\"geneName\" colnum=\"6\" col_type=\"mdata\" visible=\"true\"/>\n var colDOMs = elementDOM.getElementsByTagName(\"dtype_column\");\n for(var j=0; j<colDOMs.length; j++) {\n var colDOM = colDOMs[j];\n if(!colDOM) { continue; }\n \n var datatype = colDOM.getAttribute(\"datatype\");\n var title = colDOM.getAttribute(\"title\");\n\n var t_col = reportElementAddDatatypeColumn(reportElement, datatype, title);\n\n if(colDOM.getAttribute(\"colnum\")) { t_col.colnum = parseInt(colDOM.getAttribute(\"colnum\")); }\n if(colDOM.getAttribute(\"col_type\")) { t_col.col_type = colDOM.getAttribute(\"col_type\"); }\n \n if(colDOM.getAttribute(\"visible\") == \"true\") { t_col.visible = true; } else { t_col.visible = false; }\n if(colDOM.getAttribute(\"filtered\") == \"true\") { t_col.filtered = true; } else { t_col.filtered = false; }\n if(colDOM.getAttribute(\"filter_abs\") == \"true\") { t_col.filter_abs = true; } else { t_col.filter_abs = false; }\n\n if(colDOM.getAttribute(\"filter_min\")) {\n t_col.filter_min = colDOM.getAttribute(\"filter_min\");\n if(t_col.filter_min != \"min\") { t_col.filter_min = parseFloat(t_col.filter_min); }\n }\n if(colDOM.getAttribute(\"filter_max\")) {\n t_col.filter_max = colDOM.getAttribute(\"filter_max\");\n if(t_col.filter_max != \"max\") { t_col.filter_max = parseFloat(t_col.filter_max); }\n }\n \n if(t_col.filtered && (t_col.col_type == \"mdata\")) {\n //parse categories for mdata filters\n var ctgDOMs = colDOM.getElementsByTagName(\"md_category\");\n for(var k=0; k<ctgDOMs.length; k++) {\n var ctgDOM = ctgDOMs[k];\n if(!ctgDOM) { continue; }\n \n var ctg_obj = {ctg:\"\", count:0, filtered:false};\n if(ctgDOM.getAttribute(\"ctg\")) { ctg_obj.ctg = ctgDOM.getAttribute(\"ctg\"); }\n if(ctgDOM.getAttribute(\"filtered\") == \"true\") {\n ctg_obj.filtered = true;\n if(!(t_col.categories)) { t_col.categories = new Object; }\n t_col.categories[ctg_obj.ctg] = ctg_obj;\n }\n }\n if(!(t_col.categories)) { t_col.filtered=false; } //safety check\n }\n }\n\n //cascade_trigger\n // <cascade_trigger trigger_idx=\"1\" targetElementID=\"gene_target_aso\" on_trigger=\"select\" action_mode=\"focus_load\" options=\"selection\"/>\n var triggers = elementDOM.getElementsByTagName(\"cascade_trigger\");\n for(var j=0; j<triggers.length; j++) {\n var triggerDOM = triggers[j];\n if(!triggerDOM) { continue; }\n \n //trigDoc.setAttribute(\"trigger_idx\", trig_idx);\n var targetElementID = triggerDOM.getAttribute(\"targetElementID\");\n var on_trigger = triggerDOM.getAttribute(\"on_trigger\");\n var action_mode = triggerDOM.getAttribute(\"action_mode\");\n var options = triggerDOM.getAttribute(\"options\");\n \n var trigger = reportElementAddCascadeTrigger(reportElement, targetElementID, on_trigger, action_mode, options);\n }\n\n reportsUpdateElementLayout(reportElement);\n return reportElement;\n}", "title": "" }, { "docid": "cb5ccc28aeefe539b032cd4e796a6aef", "score": "0.41787615", "text": "function configure(chart, options, chartType){\n if (chart){\n angular.forEach(chart, function(value, key){\n if (key === 'dispatch') {\n if (options[key] === undefined) options[key] = {};\n configureEvents(value, options[key]);\n }\n else if (//TODO: need to fix bug in nvd3\n (key === 'xScale' && chartType === 'scatterChart')\n || (key === 'yScale' && chartType === 'scatterChart')\n || (key === 'values' && chartType === 'pieChart'));\n else if ([\n 'scatter',\n 'defined',\n 'options',\n 'axis',\n 'rangeBand',\n 'rangeBands'\n ].indexOf(key) < 0)\n (options[key] === undefined || options[key] === null)\n ? options[key] = value()\n : chart[key](options[key]);\n });\n }\n }", "title": "" }, { "docid": "db09659cb029e2a3c7634b0280c390a2", "score": "0.4166741", "text": "define(name, constructor, options) {\n const internals = internalsOf(this, 'CustomElementRegistry', 'define');\n name = String(name);\n if (/[A-Z]/.test(name))\n throw new SyntaxError('Custom element name cannot contain an uppercase ASCII letter');\n if (!/^[a-z]/.test(name))\n throw new SyntaxError('Custom element name must have a lowercase ASCII letter as its first character');\n if (!/-/.test(name))\n throw new SyntaxError('Custom element name must contain a hyphen');\n internals.constructorByName.set(name, constructor);\n internals.nameByConstructor.set(constructor, name);\n }", "title": "" }, { "docid": "d4335c363303bf6c72a9fd337f5c0d75", "score": "0.41577044", "text": "function makeConfig(binding) {\n var config = {};\n\n // If Argument, assume element ID\n if (binding.arg) {\n // Element ID specified as arg. We must pre-pend #\n config.element = '#' + binding.arg;\n }\n\n // Process modifiers\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"b\" /* keys */])(binding.modifiers).forEach(function (mod) {\n if (/^\\d+$/.test(mod)) {\n // Offest value\n config.offset = parseInt(mod, 10);\n } else if (/^(auto|position|offset)$/.test(mod)) {\n // Offset method\n config.method = mod;\n }\n });\n\n // Process value\n if (typeof binding.value === 'string') {\n // Value is a CSS ID or selector\n config.element = binding.value;\n } else if (typeof binding.value === 'number') {\n // Value is offset\n config.offset = Math.round(binding.value);\n } else if (_typeof(binding.value) === 'object') {\n // Value is config object\n // Filter the object based on our supported config options\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"b\" /* keys */])(binding.value).filter(function (k) {\n return Boolean(__WEBPACK_IMPORTED_MODULE_0__scrollspy_class__[\"a\" /* default */].DefaultType[k]);\n }).forEach(function (k) {\n config[k] = binding.value[k];\n });\n }\n\n return config;\n}", "title": "" }, { "docid": "0b8dbdef97fb20ff6a8faf78ddeb7efd", "score": "0.41501752", "text": "function gui_draw_configure_all(cid, tag, attr_array) {\n gui(cid).get_elem(tag, attr_array);\n}", "title": "" }, { "docid": "976320667c9d6051edf640402eca5a8a", "score": "0.41446403", "text": "function makeConfig(binding) {\n var config = {};\n\n // If Argument, assume element ID\n if (binding.arg) {\n // Element ID specified as arg. We must pre-pend #\n config.element = '#' + binding.arg;\n }\n\n // Process modifiers\n keys(binding.modifiers).forEach(function (mod) {\n if (/^\\d+$/.test(mod)) {\n // Offest value\n config.offset = parseInt(mod, 10);\n } else if (/^(auto|position|offset)$/.test(mod)) {\n // Offset method\n config.method = mod;\n }\n });\n\n // Process value\n if (typeof binding.value === 'string') {\n // Value is a CSS ID or selector\n config.element = binding.value;\n } else if (typeof binding.value === 'number') {\n // Value is offset\n config.offset = Math.round(binding.value);\n } else if (scrollspy_typeof(binding.value) === 'object') {\n // Value is config object\n // Filter the object based on our supported config options\n keys(binding.value).filter(function (k) {\n return Boolean(scrollspy_class.DefaultType[k]);\n }).forEach(function (k) {\n config[k] = binding.value[k];\n });\n }\n\n return config;\n}", "title": "" }, { "docid": "4f3a3961e697cc6e763c223cd730cd13", "score": "0.41392684", "text": "function configure(options) {\n var settings = _.defaults(options || {}, defaultSettings);\n\n // Pour les tablettes, on essaie d'éliminer le temps de latence entre l'événement \"touch\"\n // et l'événement \"click\".\n $(function() {\n FastClick.attach(document.body);\n });\n\n // Définition du comportement des appels Ajax via jQuery.\n $.ajaxSetup({\n timeout: settings.ajaxTimeout,\n async: true,\n cache: true\n });\n\n // Quand une requête ajax démarre on affiche un indicateur, idem quand un batch\n // de requêtes se termine.\n $(document).ajaxStart(function() {\n NProgress.start();\n }).ajaxStop(function() {\n NProgress.done();\n });\n }", "title": "" }, { "docid": "5739ba8ec2fcb10a4154d9773f7704d2", "score": "0.41355705", "text": "function makeConfig(binding) {\n var config = {};\n\n // If Argument, assume element ID\n if (binding.arg) {\n // Element ID specified as arg. We must pre-pend #\n config.element = '#' + binding.arg;\n }\n\n // Process modifiers\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.modifiers).forEach(function (mod) {\n if (/^\\d+$/.test(mod)) {\n // Offest value\n config.offset = parseInt(mod, 10);\n } else if (/^(auto|position|offset)$/.test(mod)) {\n // Offset method\n config.method = mod;\n }\n });\n\n // Process value\n if (typeof binding.value === 'string') {\n // Value is a CSS ID or selector\n config.element = binding.value;\n } else if (typeof binding.value === 'number') {\n // Value is offset\n config.offset = Math.round(binding.value);\n } else if (_typeof(binding.value) === 'object') {\n // Value is config object\n // Filter the object based on our supported config options\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.value).filter(function (k) {\n return Boolean(__WEBPACK_IMPORTED_MODULE_0__scrollspy_class__[\"a\" /* default */].DefaultType[k]);\n }).forEach(function (k) {\n config[k] = binding.value[k];\n });\n }\n\n return config;\n}", "title": "" }, { "docid": "5739ba8ec2fcb10a4154d9773f7704d2", "score": "0.41355705", "text": "function makeConfig(binding) {\n var config = {};\n\n // If Argument, assume element ID\n if (binding.arg) {\n // Element ID specified as arg. We must pre-pend #\n config.element = '#' + binding.arg;\n }\n\n // Process modifiers\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.modifiers).forEach(function (mod) {\n if (/^\\d+$/.test(mod)) {\n // Offest value\n config.offset = parseInt(mod, 10);\n } else if (/^(auto|position|offset)$/.test(mod)) {\n // Offset method\n config.method = mod;\n }\n });\n\n // Process value\n if (typeof binding.value === 'string') {\n // Value is a CSS ID or selector\n config.element = binding.value;\n } else if (typeof binding.value === 'number') {\n // Value is offset\n config.offset = Math.round(binding.value);\n } else if (_typeof(binding.value) === 'object') {\n // Value is config object\n // Filter the object based on our supported config options\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.value).filter(function (k) {\n return Boolean(__WEBPACK_IMPORTED_MODULE_0__scrollspy_class__[\"a\" /* default */].DefaultType[k]);\n }).forEach(function (k) {\n config[k] = binding.value[k];\n });\n }\n\n return config;\n}", "title": "" }, { "docid": "5739ba8ec2fcb10a4154d9773f7704d2", "score": "0.41355705", "text": "function makeConfig(binding) {\n var config = {};\n\n // If Argument, assume element ID\n if (binding.arg) {\n // Element ID specified as arg. We must pre-pend #\n config.element = '#' + binding.arg;\n }\n\n // Process modifiers\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.modifiers).forEach(function (mod) {\n if (/^\\d+$/.test(mod)) {\n // Offest value\n config.offset = parseInt(mod, 10);\n } else if (/^(auto|position|offset)$/.test(mod)) {\n // Offset method\n config.method = mod;\n }\n });\n\n // Process value\n if (typeof binding.value === 'string') {\n // Value is a CSS ID or selector\n config.element = binding.value;\n } else if (typeof binding.value === 'number') {\n // Value is offset\n config.offset = Math.round(binding.value);\n } else if (_typeof(binding.value) === 'object') {\n // Value is config object\n // Filter the object based on our supported config options\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.value).filter(function (k) {\n return Boolean(__WEBPACK_IMPORTED_MODULE_0__scrollspy_class__[\"a\" /* default */].DefaultType[k]);\n }).forEach(function (k) {\n config[k] = binding.value[k];\n });\n }\n\n return config;\n}", "title": "" }, { "docid": "5739ba8ec2fcb10a4154d9773f7704d2", "score": "0.41355705", "text": "function makeConfig(binding) {\n var config = {};\n\n // If Argument, assume element ID\n if (binding.arg) {\n // Element ID specified as arg. We must pre-pend #\n config.element = '#' + binding.arg;\n }\n\n // Process modifiers\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.modifiers).forEach(function (mod) {\n if (/^\\d+$/.test(mod)) {\n // Offest value\n config.offset = parseInt(mod, 10);\n } else if (/^(auto|position|offset)$/.test(mod)) {\n // Offset method\n config.method = mod;\n }\n });\n\n // Process value\n if (typeof binding.value === 'string') {\n // Value is a CSS ID or selector\n config.element = binding.value;\n } else if (typeof binding.value === 'number') {\n // Value is offset\n config.offset = Math.round(binding.value);\n } else if (_typeof(binding.value) === 'object') {\n // Value is config object\n // Filter the object based on our supported config options\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.value).filter(function (k) {\n return Boolean(__WEBPACK_IMPORTED_MODULE_0__scrollspy_class__[\"a\" /* default */].DefaultType[k]);\n }).forEach(function (k) {\n config[k] = binding.value[k];\n });\n }\n\n return config;\n}", "title": "" }, { "docid": "5739ba8ec2fcb10a4154d9773f7704d2", "score": "0.41355705", "text": "function makeConfig(binding) {\n var config = {};\n\n // If Argument, assume element ID\n if (binding.arg) {\n // Element ID specified as arg. We must pre-pend #\n config.element = '#' + binding.arg;\n }\n\n // Process modifiers\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.modifiers).forEach(function (mod) {\n if (/^\\d+$/.test(mod)) {\n // Offest value\n config.offset = parseInt(mod, 10);\n } else if (/^(auto|position|offset)$/.test(mod)) {\n // Offset method\n config.method = mod;\n }\n });\n\n // Process value\n if (typeof binding.value === 'string') {\n // Value is a CSS ID or selector\n config.element = binding.value;\n } else if (typeof binding.value === 'number') {\n // Value is offset\n config.offset = Math.round(binding.value);\n } else if (_typeof(binding.value) === 'object') {\n // Value is config object\n // Filter the object based on our supported config options\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.value).filter(function (k) {\n return Boolean(__WEBPACK_IMPORTED_MODULE_0__scrollspy_class__[\"a\" /* default */].DefaultType[k]);\n }).forEach(function (k) {\n config[k] = binding.value[k];\n });\n }\n\n return config;\n}", "title": "" }, { "docid": "5739ba8ec2fcb10a4154d9773f7704d2", "score": "0.41355705", "text": "function makeConfig(binding) {\n var config = {};\n\n // If Argument, assume element ID\n if (binding.arg) {\n // Element ID specified as arg. We must pre-pend #\n config.element = '#' + binding.arg;\n }\n\n // Process modifiers\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.modifiers).forEach(function (mod) {\n if (/^\\d+$/.test(mod)) {\n // Offest value\n config.offset = parseInt(mod, 10);\n } else if (/^(auto|position|offset)$/.test(mod)) {\n // Offset method\n config.method = mod;\n }\n });\n\n // Process value\n if (typeof binding.value === 'string') {\n // Value is a CSS ID or selector\n config.element = binding.value;\n } else if (typeof binding.value === 'number') {\n // Value is offset\n config.offset = Math.round(binding.value);\n } else if (_typeof(binding.value) === 'object') {\n // Value is config object\n // Filter the object based on our supported config options\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.value).filter(function (k) {\n return Boolean(__WEBPACK_IMPORTED_MODULE_0__scrollspy_class__[\"a\" /* default */].DefaultType[k]);\n }).forEach(function (k) {\n config[k] = binding.value[k];\n });\n }\n\n return config;\n}", "title": "" }, { "docid": "5739ba8ec2fcb10a4154d9773f7704d2", "score": "0.41355705", "text": "function makeConfig(binding) {\n var config = {};\n\n // If Argument, assume element ID\n if (binding.arg) {\n // Element ID specified as arg. We must pre-pend #\n config.element = '#' + binding.arg;\n }\n\n // Process modifiers\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.modifiers).forEach(function (mod) {\n if (/^\\d+$/.test(mod)) {\n // Offest value\n config.offset = parseInt(mod, 10);\n } else if (/^(auto|position|offset)$/.test(mod)) {\n // Offset method\n config.method = mod;\n }\n });\n\n // Process value\n if (typeof binding.value === 'string') {\n // Value is a CSS ID or selector\n config.element = binding.value;\n } else if (typeof binding.value === 'number') {\n // Value is offset\n config.offset = Math.round(binding.value);\n } else if (_typeof(binding.value) === 'object') {\n // Value is config object\n // Filter the object based on our supported config options\n Object(__WEBPACK_IMPORTED_MODULE_1__utils_object__[\"e\" /* keys */])(binding.value).filter(function (k) {\n return Boolean(__WEBPACK_IMPORTED_MODULE_0__scrollspy_class__[\"a\" /* default */].DefaultType[k]);\n }).forEach(function (k) {\n config[k] = binding.value[k];\n });\n }\n\n return config;\n}", "title": "" }, { "docid": "6839953128971fef3af39653d819aaa4", "score": "0.41185468", "text": "init() {\n this.options = {};\n\n this.classes = {\n dom: {\n filterInput: 'pew_smart-table__filter-input',\n table: 'pew_smart-table__table',\n tableBody: 'pew_smart-table__body',\n sortTrigger: 'pew_smart-table__sort-trigger',\n sortKey: 'pew_smart-table__sort-value',\n resetFilterTrigger: 'pew_smart-table__filter-reset-trigger',\n },\n state: {\n sortTriggerUp: 'pew_smart-table__sort-trigger--up',\n sortTriggerDown: 'pew_smart-table__sort-trigger--down',\n filterActive: 'pew_smart-table__filter--active',\n },\n };\n\n this.nodes = {\n filterInput: this.el.querySelector(`.${this.classes.dom.filterInput}`),\n tableBody: this.el.querySelector(`.${this.classes.dom.tableBody}`),\n sortTriggers: this.el.querySelectorAll(`.${this.classes.dom.sortTrigger}`),\n resetFilterTrigger: this.el.querySelector(`.${this.classes.dom.resetFilterTrigger}`),\n };\n }", "title": "" }, { "docid": "5fde6daabbc0435e8e0cd99f6c7d3e3f", "score": "0.4112425", "text": "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove', 'onElementMouseUp']\n };\n }", "title": "" }, { "docid": "5fde6daabbc0435e8e0cd99f6c7d3e3f", "score": "0.4112425", "text": "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove', 'onElementMouseUp']\n };\n }", "title": "" }, { "docid": "0da5427c69a46f90554b4e636cf5a90e", "score": "0.41048032", "text": "setProps(options) {\n options = this.setDefaultProps(options);\n this.setPropsFromElementAttr(options);\n\n let convertToBoolean = Utils.convertToBoolean;\n let minZIndex = config.minZIndex;\n\n this.$ele = options.ele;\n this.title = options.title;\n this.columns = options.columns;\n this.filtersValue = options.filtersValue;\n this.heightOffset = options.heightOffset;\n this.perPageOptions = options.perPageOptions;\n this.uniqueKey = options.uniqueKey;\n this.apiUrl = options.apiUrl;\n this.selectedRowsActions = options.selectedRowsActions;\n this.theme = options.theme.toLowerCase();\n this.language = options.language.toLowerCase();\n this.scrollableContent = convertToBoolean(options.scrollableContent);\n this.rowsFromServer = convertToBoolean(options.rowsFromServer);\n this.resizable = convertToBoolean(options.resizable);\n this.sortable = convertToBoolean(options.sortable);\n this.exportable = convertToBoolean(options.exportable);\n this.hideHeader = convertToBoolean(options.hideHeader);\n this.showFilters = convertToBoolean(options.showFilters);\n this.showSettings = convertToBoolean(options.showSettings);\n this.disableLocalstorage = convertToBoolean(options.disableLocalstorage);\n this.showSerialNumberCol = convertToBoolean(options.showSerialNumberCol);\n this.showSelectableCol = convertToBoolean(options.showSelectableCol);\n this.tooltipFontSize = options.tooltipFontSize;\n this.tooltipAlignment = options.tooltipAlignment;\n this.tooltipEnterDelay = parseInt(options.tooltipEnterDelay);\n\n this.hasVirtualSelect = typeof VirtualSelect !== 'undefined';\n this.uniqueId = this.getUniqueId();\n this.filtersTagsHeight = parseFloat(config.filtersTagsHeight);\n this.tooltipZIndex = minZIndex + 9;\n this.popoverZIndex = minZIndex + 9;\n this.events = {};\n this.visibleColumns = [];\n this.visibleRows = [];\n this.colMinWidth = 50;\n\n if (!this.rowsFromServer) {\n this.rows = options.rows || [];\n }\n\n this.afterSetProps();\n }", "title": "" }, { "docid": "9bf7b2df0f3b2dc697e5b686430ac937", "score": "0.4103931", "text": "static get pluginConfig() {\n return {\n chain: ['onElementMouseDown', 'onElementMouseMove'],\n before: ['onElementContextMenu']\n };\n }", "title": "" }, { "docid": "ad60f43e4880d0500ba5452a9dbf6a71", "score": "0.41018358", "text": "function gui_draw_configure(cid, tag, attr, val) {\n var item = get_item(cid, tag);\n var obj = {};\n if (Array.isArray(val)) {\n obj[attr] = val.join(\" \");\n } else {\n // strings or numbers\n obj[attr] = val;\n }\n configure_item(item, obj);\n}", "title": "" }, { "docid": "952e680d4fffe86d571bfc3bc46dec02", "score": "0.40989417", "text": "static get pluginConfig() {\n return {\n assign: ['collapseAll', 'expandAll', 'collapse', 'expand', 'expandTo', 'toggleCollapse'],\n before: ['navigateRight', 'navigateLeft'],\n chain: ['onElementClick', 'onElementKeyDown']\n };\n }", "title": "" }, { "docid": "b7ac0dba261bda58b14ca62bee3cd798", "score": "0.40826017", "text": "constructor(options) {\n this.settings = $.extend({}, options);\n this.name_to_node = {};\n this.key_to_edge = {};\n this.min_weight = 0;\n this.max_weight = 0;\n }", "title": "" }, { "docid": "79730085a10ef70b4886726d6037d12b", "score": "0.40557665", "text": "configure(options) {\n Object(_pnp_common__WEBPACK_IMPORTED_MODULE_0__[\"mergeOptions\"])(this.data.options, options);\n return this;\n }", "title": "" }, { "docid": "7a6fe2a6fd6bef9da1fdc5010f3c5dbe", "score": "0.40552014", "text": "configure() {}", "title": "" }, { "docid": "236e52845f06d35a71f59e28d221343d", "score": "0.40517607", "text": "function h(selector, properties) {\n var node = parseSelector(selector, defaultTagName)\n var children = Array.prototype.slice.call(arguments, 2)\n var name = node.tagName.toLowerCase()\n var property\n\n node.tagName = adjust && own.call(adjust, name) ? adjust[name] : name\n\n if (properties && isChildren(properties, node)) {\n children.unshift(properties)\n properties = null\n }\n\n if (properties) {\n for (property in properties) {\n addProperty(node.properties, property, properties[property])\n }\n }\n\n addChild(node.children, children)\n\n if (node.tagName === 'template') {\n node.content = {type: 'root', children: node.children}\n node.children = []\n }\n\n return node\n }", "title": "" }, { "docid": "236e52845f06d35a71f59e28d221343d", "score": "0.40517607", "text": "function h(selector, properties) {\n var node = parseSelector(selector, defaultTagName)\n var children = Array.prototype.slice.call(arguments, 2)\n var name = node.tagName.toLowerCase()\n var property\n\n node.tagName = adjust && own.call(adjust, name) ? adjust[name] : name\n\n if (properties && isChildren(properties, node)) {\n children.unshift(properties)\n properties = null\n }\n\n if (properties) {\n for (property in properties) {\n addProperty(node.properties, property, properties[property])\n }\n }\n\n addChild(node.children, children)\n\n if (node.tagName === 'template') {\n node.content = {type: 'root', children: node.children}\n node.children = []\n }\n\n return node\n }", "title": "" }, { "docid": "653484964e69c3f9f4c4a585da3f0708", "score": "0.40444285", "text": "function defineComponent(options) {\n return Object(_vue_shared__WEBPACK_IMPORTED_MODULE_1__[\"isFunction\"])(options) ? { setup: options, name: options.name } : options;\n}", "title": "" }, { "docid": "9cc2e9d912b1b8e970d543062b2f338b", "score": "0.4044087", "text": "function html(options) {\n return Object.assign(function (context) {\n var defaultOpts = {\n filename: 'index.html',\n template: 'templates/index.html',\n showErrors: false\n };\n\n // Merge the provided html config into the context\n var html = context.html || defaultOpts;\n\n /* Warning: Thar be mutation ahead! */\n /* eslint-disable fp/no-mutation */\n context.html = (0, _deepmerge2.default)(html, options, { clone: true });\n /* eslint-enable fp/no-mutation */\n\n // Return empty config snippet (configuration will be created by the post hook)\n return {};\n }, { post: postConfig });\n}", "title": "" }, { "docid": "8bfd2e05c0e63d985dffad5bd16e9b20", "score": "0.40438005", "text": "function populateKernelSelect(node, options) {\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n let { preference, sessions, specs } = options;\n let { name, id, language, canStart, shouldStart } = preference;\n if (!specs || canStart === false) {\n node.appendChild(optionForNone());\n node.value = 'null';\n node.disabled = true;\n return;\n }\n node.disabled = false;\n // Create mappings of display names and languages for kernel name.\n let displayNames = Object.create(null);\n let languages = Object.create(null);\n for (let name in specs.kernelspecs) {\n let spec = specs.kernelspecs[name];\n displayNames[name] = spec.display_name;\n languages[name] = spec.language;\n }\n // Handle a kernel by name.\n let names = [];\n if (name && name in specs.kernelspecs) {\n names.push(name);\n }\n // Then look by language.\n if (language) {\n for (let specName in specs.kernelspecs) {\n if (name !== specName && languages[specName] === language) {\n names.push(specName);\n }\n }\n }\n // Use the default kernel if no kernels were found.\n if (!names.length) {\n names.push(specs.default);\n }\n // Handle a preferred kernels in order of display name.\n let preferred = document.createElement('optgroup');\n preferred.label = 'Start Preferred Kernel';\n names.sort((a, b) => displayNames[a].localeCompare(displayNames[b]));\n for (let name of names) {\n preferred.appendChild(optionForName(name, displayNames[name]));\n }\n if (preferred.firstChild) {\n node.appendChild(preferred);\n }\n // Add an option for no kernel\n node.appendChild(optionForNone());\n let other = document.createElement('optgroup');\n other.label = 'Start Other Kernel';\n // Add the rest of the kernel names in alphabetical order.\n let otherNames = [];\n for (let specName in specs.kernelspecs) {\n if (names.indexOf(specName) !== -1) {\n continue;\n }\n otherNames.push(specName);\n }\n otherNames.sort((a, b) => displayNames[a].localeCompare(displayNames[b]));\n for (let otherName of otherNames) {\n other.appendChild(optionForName(otherName, displayNames[otherName]));\n }\n // Add a separator option if there were any other names.\n if (otherNames.length) {\n node.appendChild(other);\n }\n // Handle the default value.\n if (shouldStart === false) {\n node.value = 'null';\n }\n else {\n node.selectedIndex = 0;\n }\n // Bail if there are no sessions.\n if (!sessions) {\n return;\n }\n // Add the sessions using the preferred language first.\n let matchingSessions = [];\n let otherSessions = [];\n Object(_phosphor_algorithm__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(sessions, session => {\n if (language &&\n languages[session.kernel.name] === language &&\n session.kernel.id !== id) {\n matchingSessions.push(session);\n }\n else if (session.kernel.id !== id) {\n otherSessions.push(session);\n }\n });\n let matching = document.createElement('optgroup');\n matching.label = 'Use Kernel from Preferred Session';\n node.appendChild(matching);\n if (matchingSessions.length) {\n matchingSessions.sort((a, b) => {\n return a.path.localeCompare(b.path);\n });\n Object(_phosphor_algorithm__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(matchingSessions, session => {\n let name = displayNames[session.kernel.name];\n matching.appendChild(optionForSession(session, name));\n });\n }\n let otherSessionsNode = document.createElement('optgroup');\n otherSessionsNode.label = 'Use Kernel from Other Session';\n node.appendChild(otherSessionsNode);\n if (otherSessions.length) {\n otherSessions.sort((a, b) => {\n return a.path.localeCompare(b.path);\n });\n Object(_phosphor_algorithm__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(otherSessions, session => {\n let name = displayNames[session.kernel.name] || session.kernel.name;\n otherSessionsNode.appendChild(optionForSession(session, name));\n });\n }\n }", "title": "" }, { "docid": "358244ee59990b407f55329ab2c1f270", "score": "0.40435964", "text": "function $(tag, options) {\n if (!options) {\n return document.getElementById(tag);\n }\n\n var element = document.createElement(tag);\n\n for (var option in options) {\n if (options.hasOwnProperty(option)) {\n element[option] = options[option];\n }\n }\n\n return element;\n }", "title": "" }, { "docid": "358244ee59990b407f55329ab2c1f270", "score": "0.40435964", "text": "function $(tag, options) {\n if (!options) {\n return document.getElementById(tag);\n }\n\n var element = document.createElement(tag);\n\n for (var option in options) {\n if (options.hasOwnProperty(option)) {\n element[option] = options[option];\n }\n }\n\n return element;\n }", "title": "" }, { "docid": "9df4dcd215d89dc69fdc26d499b8263a", "score": "0.40350038", "text": "function $(id)\n{\n return {\n \n nodeId: id,\n \n node : document.getElementById(id),\n\n attr : function(key, value)\n {\n this.node.setAttribute(key, value);\n },\n\n css : function(name, value)\n {\n try\n {\n this.node.style[name] = value;\n }\n catch(exception)\n {\n dump(this.nodeId+\"\\n\");\n }\n },\n\n sel : function(index)\n {\n if ( index == null )\n return(this.node.selectedIndex);\n else\n this.node.selectedIndex = index;\n },\n\n selValue : function(index)\n {\n if ( index == null )\n return(this.node.getItemAtIndex(this.sel()).value);\n else\n return(this.node.getItemAtIndex(index).value);\n },\n\n selLabel : function(index)\n {\n if ( index == null )\n return(this.node.getItemAtIndex(this.sel()).getAttribute(\"label\"));\n else\n return(this.node.getItemAtIndex(index).getAttribute(\"label\"));\n },\n \n selLabelVal : function(value)\n {\n return(this.node.getItemAtIndex(this.sel()).setAttribute(\"label\", value));\n },\n\n add : function(child)\n {\n this.node.appendChild(child);\n },\n\n val : function(newVal)\n {\n if ( newVal == null )\n return(this.node.value);\n else\n this.node.value = newVal;\n },\n\n chk : function(isChecked)\n {\n if ( isChecked == null )\n return(this.node.checked);\n else\n this.node.checked = isChecked;\n },\n\n disable : function(isDisabled)\n {\n if ( isDisabled == null )\n return(this.node.disabled);\n else\n this.node.disabled = isDisabled;\n },\n\n hide : function()\n {\n this.node.style.display = \"none\";\n },\n\n show : function()\n {\n this.node.style.display = \"block\";\n },\n \n addClass : function(class)\n {\n this.node.className = this.node.className+\" \"+class;\n },\n };\n}", "title": "" }, { "docid": "0ce2a2359fb83405f5ae125ef809f1d3", "score": "0.40317982", "text": "function configure(chart, options, chartType){\n if (chart && options){\n angular.forEach(chart, function(value, key){\n if (key[0] === '_');\n else if (key === 'dispatch') {\n if (options[key] === undefined || options[key] === null) {\n if (scope._config.extended) options[key] = {};\n }\n configureEvents(value, options[key]);\n }\n else if (key === 'tooltip') {\n if (options[key] === undefined || options[key] === null) {\n if (scope._config.extended) options[key] = {};\n }\n configure(chart[key], options[key], chartType);\n }\n else if (key === 'contentGenerator') {\n if (options[key]) chart[key](options[key]);\n }\n else if ([\n 'axis',\n 'clearHighlights',\n 'defined',\n 'highlightPoint',\n 'nvPointerEventsClass',\n 'options',\n 'rangeBand',\n 'rangeBands',\n 'scatter',\n 'open',\n 'close',\n 'node'\n ].indexOf(key) === -1) {\n if (options[key] === undefined || options[key] === null){\n if (scope._config.extended) options[key] = value();\n }\n else chart[key](options[key]);\n }\n });\n }\n }", "title": "" }, { "docid": "8e9c7fbedc472382ef0c7c27ee5e3700", "score": "0.40303543", "text": "options(options) {\n this.driverOptions = options;\n return this;\n }", "title": "" }, { "docid": "ff1456dbc5b4987263b1d294030767c4", "score": "0.40266144", "text": "configure() {\n //\n }", "title": "" }, { "docid": "ff1456dbc5b4987263b1d294030767c4", "score": "0.40266144", "text": "configure() {\n //\n }", "title": "" }, { "docid": "9b94fca58ffaf60ce9eadc52c775b51e", "score": "0.40243366", "text": "configure () {\n\n }", "title": "" }, { "docid": "9308adcb63bc43d9da7f96f950d34bfa", "score": "0.40118846", "text": "function _setOptions(options) {\n\t var tetherVal = _options.tether;\n\n\t for (attrname in options) {\n\t _options[attrname] = options[attrname];\n\t }\n\n\t if (tetherVal != _options.tether) {\n\t _enableTethering(_options.tether);\n\t }\n\n\t _render();\n\t }", "title": "" }, { "docid": "4fb018c96768e0338e6d87631f9d1c5e", "score": "0.40055227", "text": "configure() {\n \n }", "title": "" }, { "docid": "bf175c59ac8869acd6ea64e170eefe68", "score": "0.400349", "text": "function h(selector, properties) {\n var node = hastUtilParseSelector(selector, defaultTagName);\n var children = Array.prototype.slice.call(arguments, 2);\n var name = node.tagName.toLowerCase();\n var property;\n\n node.tagName = adjust && own$2.call(adjust, name) ? adjust[name] : name;\n\n if (properties && isChildren(properties, node)) {\n children.unshift(properties);\n properties = null;\n }\n\n if (properties) {\n for (property in properties) {\n addProperty(node.properties, property, properties[property]);\n }\n }\n\n addChild(node.children, children);\n\n if (node.tagName === 'template') {\n node.content = {type: 'root', children: node.children};\n node.children = [];\n }\n\n return node\n }", "title": "" }, { "docid": "151b508ecdb5c7185b3671dc8b930182", "score": "0.40024987", "text": "function configure(chart, options, chartType){\n if (chart && options){\n angular.forEach(chart, function(value, key){\n if (key[0] === '_');\n else if (key === 'dispatch') {\n if (options[key] === undefined || options[key] === null) {\n if (scope._config.extended) options[key] = {};\n }\n configureEvents(value, options[key]);\n }\n else if (key === 'tooltip') {\n if (options[key] === undefined || options[key] === null) {\n if (scope._config.extended) options[key] = {};\n }\n configure(chart[key], options[key], chartType);\n }\n else if (key === 'contentGenerator') {\n if (options[key]) chart[key](options[key]);\n }\n else if ([\n 'axis',\n 'clearHighlights',\n 'defined',\n 'highlightPoint',\n 'nvPointerEventsClass',\n 'options',\n 'rangeBand',\n 'rangeBands',\n 'scatter',\n 'open',\n 'close'\n ].indexOf(key) === -1) {\n if (options[key] === undefined || options[key] === null){\n if (scope._config.extended) options[key] = value();\n }\n else chart[key](options[key]);\n }\n });\n }\n }", "title": "" }, { "docid": "250cb4402677e46ff2f4146a3b67832d", "score": "0.4000245", "text": "function setConfig(options) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_4__utils_js__[\"isPlainObject\"])(options)) {\n Object(__WEBPACK_IMPORTED_MODULE_4__utils_js__[\"logError\"])('setConfig options must be an object');\n return;\n }\n\n var topics = Object.keys(options);\n var topicalConfig = {};\n topics.forEach(function (topic) {\n var prop = topic === 'fpd' ? 'ortb2' : topic;\n var option = topic === 'fpd' ? convertFpd(options[topic]) : options[topic];\n\n if (Object(__WEBPACK_IMPORTED_MODULE_4__utils_js__[\"isPlainObject\"])(defaults[prop]) && Object(__WEBPACK_IMPORTED_MODULE_4__utils_js__[\"isPlainObject\"])(option)) {\n option = _extends({}, defaults[prop], option);\n }\n\n topicalConfig[prop] = config[prop] = option;\n });\n callSubscribers(topicalConfig);\n }", "title": "" }, { "docid": "de7c72e5e0915b931e311d21cc62625e", "score": "0.3985169", "text": "function Plugin ( element, options ) {\n var self = this;\n self.$element = $(element);\n self.options = $.extend( {}, defaults, options );\n\n self.sources = [];\n self.dpr = self.getDpr();\n self.attributeCount = self.options.attributes.length;\n\n if( typeof( self.$element.data('source-prefix') ) !== 'undefined' ) {\n self.options.sourcePrefix = self.$element.data('source-prefix');\n }\n\n self.init();\n }", "title": "" }, { "docid": "786159eb5daa15b08562db2189f7053f", "score": "0.3971489", "text": "function configureEvents(dispatch, options){\n if (dispatch){\n angular.forEach(dispatch, function(value, key){\n (options[key] === undefined || options[key] === null)\n ? options[key] = value.on\n : dispatch.on(key + '._', options[key]);\n });\n }\n }", "title": "" }, { "docid": "d2d391ab2b12f97207a1830b6288cee2", "score": "0.39600968", "text": "function h(selector, properties) {\n var node = hastUtilParseSelector(selector, defaultTagName);\n var children = Array.prototype.slice.call(arguments, 2);\n var name = node.tagName.toLowerCase();\n var property;\n node.tagName = adjust && own$6.call(adjust, name) ? adjust[name] : name;\n\n if (properties && isChildren(properties, node)) {\n children.unshift(properties);\n properties = null;\n }\n\n if (properties) {\n for (property in properties) {\n addProperty(node.properties, property, properties[property]);\n }\n }\n\n addChild(node.children, children);\n\n if (node.tagName === 'template') {\n node.content = {\n type: 'root',\n children: node.children\n };\n node.children = [];\n }\n\n return node;\n }", "title": "" }, { "docid": "58ee4618d299b5117ef5a986d254f548", "score": "0.39560914", "text": "addField(element_id, config=null) {\n const default_conf = {\n \"element\": \"div\",\n \"classes\": []\n }\n if(config == null) {\n config = default_conf\n } else {\n // fill missing config keys with defaults\n for(let prop in default_conf) {\n if(!(prop in config)) {\n config[prop] = default_conf[prop]\n }\n }\n }\n if(!(element_id in this.fields)) {\n this.fields[element_id] = config\n this.onNodeAdd[element_id] = function() {}\n this.onNodeDrop[element_id] = function() {}\n }\n }", "title": "" }, { "docid": "98c6c76458f0e8baa5e1c38d063a670c", "score": "0.39543808", "text": "function configFactory(config, emit) {\n /**\n * Set configuration options for math.js, and get current options.\n * Will emit a 'config' event, with arguments (curr, prev, changes).\n *\n * This function is only available on a mathjs instance created using `create`.\n *\n * Syntax:\n *\n * math.config(config: Object): Object\n *\n * Examples:\n *\n *\n * import { create, all } from 'mathjs'\n *\n * // create a mathjs instance\n * const math = create(all)\n *\n * math.config().number // outputs 'number'\n * math.evaluate('0.4') // outputs number 0.4\n * math.config({number: 'Fraction'})\n * math.evaluate('0.4') // outputs Fraction 2/5\n *\n * @param {Object} [options] Available options:\n * {number} epsilon\n * Minimum relative difference between two\n * compared values, used by all comparison functions.\n * {string} matrix\n * A string 'Matrix' (default) or 'Array'.\n * {string} number\n * A string 'number' (default), 'BigNumber', or 'Fraction'\n * {number} precision\n * The number of significant digits for BigNumbers.\n * Not applicable for Numbers.\n * {string} parenthesis\n * How to display parentheses in LaTeX and string\n * output.\n * {string} randomSeed\n * Random seed for seeded pseudo random number generator.\n * Set to null to randomly seed.\n * @return {Object} Returns the current configuration\n */\n function _config(options) {\n if (options) {\n var prev = Object(__WEBPACK_IMPORTED_MODULE_0__utils_object__[\"i\" /* mapObject */])(config, __WEBPACK_IMPORTED_MODULE_0__utils_object__[\"a\" /* clone */]); // validate some of the options\n\n validateOption(options, 'matrix', MATRIX_OPTIONS);\n validateOption(options, 'number', NUMBER_OPTIONS); // merge options\n\n Object(__WEBPACK_IMPORTED_MODULE_0__utils_object__[\"b\" /* deepExtend */])(config, options);\n var curr = Object(__WEBPACK_IMPORTED_MODULE_0__utils_object__[\"i\" /* mapObject */])(config, __WEBPACK_IMPORTED_MODULE_0__utils_object__[\"a\" /* clone */]);\n var changes = Object(__WEBPACK_IMPORTED_MODULE_0__utils_object__[\"i\" /* mapObject */])(options, __WEBPACK_IMPORTED_MODULE_0__utils_object__[\"a\" /* clone */]); // emit 'config' event\n\n emit('config', curr, prev, changes);\n return curr;\n } else {\n return Object(__WEBPACK_IMPORTED_MODULE_0__utils_object__[\"i\" /* mapObject */])(config, __WEBPACK_IMPORTED_MODULE_0__utils_object__[\"a\" /* clone */]);\n }\n } // attach the valid options to the function so they can be extended\n\n\n _config.MATRIX_OPTIONS = MATRIX_OPTIONS;\n _config.NUMBER_OPTIONS = NUMBER_OPTIONS; // attach the config properties as readonly properties to the config function\n\n Object.keys(__WEBPACK_IMPORTED_MODULE_1__config__[\"a\" /* DEFAULT_CONFIG */]).forEach(function (key) {\n Object.defineProperty(_config, key, {\n get: function get() {\n return config[key];\n },\n enumerable: true,\n configurable: true\n });\n });\n return _config;\n}", "title": "" }, { "docid": "a2014a0f6471d7d344cb4b48ef584b4c", "score": "0.3946637", "text": "static get pluginConfig() {\n return {\n assign: ['startEditing'],\n before: ['onElementKeyDown', 'onElementMouseDown'],\n chain: ['onElementClick']\n };\n }", "title": "" }, { "docid": "e2d5b53e537c5a6c6279fa5eba8bf764", "score": "0.3936667", "text": "constructor(options) {\n let defaultOpt = {\n element: \"[data-to]\",\n time: 1000,\n delay: 10,\n decimalSeperator: ',',\n thousandSeparator: ' '\n };\n\n this.options = { ...defaultOpt, ...options };\n\n this.init();\n }", "title": "" }, { "docid": "4d5fe7f53898fd95d97efeccdbb0fc04", "score": "0.3936648", "text": "function Configuration(opts) {\n this.groups = [];\n if (opts['svg']) {\n\tvar svg = opts.svg;\n\t// use SVG object to define groups for this configuration\n\tvar groupList = [];\n\t// extract group ids and joint ids from svg circles\n\t//var circles1 = $(\"circle\");\n\t$.each($(\"circle\"), function(index, value) {\n\t // can't just embed custom attrs apparently, so have to embed group in innerHTML\n\t var groupId = value.innerHTML;\n\t var jointId = value.id;\n\t if (!groupList[groupId]) {\n\t\tgroupList[groupId] = [];\n\t }\n\t groupList[groupId].push(jointId);\n\t});\n\n\t// build groups in this config from svg-based lists\n\tfor (var index in groupList) {\n\t var g = new Group(index);\n\t g.addElements(groupList[index]);\n\t this.groups.push(g);\n\t}\n }\n}", "title": "" }, { "docid": "8744cecd96c5c808448c4260721a3a4c", "score": "0.39358893", "text": "function ConfigurableCoreElement(id) {\n\t// Call the parent constructor, making sure (using Function#call)\n \t// that \"this\" is set correctly during the call\n \tConfigurableBlock.call(this, id);\n\t\n\tthis.headingType = 'h1';\n\tthis.title = '';\n\tthis.justify_content = 'center';\n\tthis.inspectorElem = {};\n}", "title": "" }, { "docid": "76f6dfe3731e0980cb2d96656c7364b7", "score": "0.3934694", "text": "static get pluginConfig() {\n return {\n chain : ['onElementClick', 'populateHeaderMenu', 'getColumnDragToolbarItems', 'renderHeader']\n };\n }", "title": "" }, { "docid": "23d2587ea1b8f538ae2b3afba77a5345", "score": "0.39302275", "text": "function createKeyBinding(options) {\r\n return {\r\n keys: normalizeKeys(options),\r\n selector: validateSelector(options),\r\n command: options.command,\r\n args: options.args || coreutils_1.JSONExt.emptyObject\r\n };\r\n }", "title": "" }, { "docid": "70071c430ee9e6ca3f6bec5b87343354", "score": "0.3928455", "text": "function defineComponent(options) {\n return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(options) ? { setup: options, name: options.name } : options;\n}", "title": "" }, { "docid": "70071c430ee9e6ca3f6bec5b87343354", "score": "0.3928455", "text": "function defineComponent(options) {\n return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(options) ? { setup: options, name: options.name } : options;\n}", "title": "" }, { "docid": "70071c430ee9e6ca3f6bec5b87343354", "score": "0.3928455", "text": "function defineComponent(options) {\n return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(options) ? { setup: options, name: options.name } : options;\n}", "title": "" }, { "docid": "70071c430ee9e6ca3f6bec5b87343354", "score": "0.3928455", "text": "function defineComponent(options) {\n return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(options) ? { setup: options, name: options.name } : options;\n}", "title": "" }, { "docid": "70071c430ee9e6ca3f6bec5b87343354", "score": "0.3928455", "text": "function defineComponent(options) {\n return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(options) ? { setup: options, name: options.name } : options;\n}", "title": "" }, { "docid": "70071c430ee9e6ca3f6bec5b87343354", "score": "0.3928455", "text": "function defineComponent(options) {\n return (0,_vue_shared__WEBPACK_IMPORTED_MODULE_1__.isFunction)(options) ? { setup: options, name: options.name } : options;\n}", "title": "" }, { "docid": "d9280cfb56036d1595d6dcc8b175376d", "score": "0.3923472", "text": "configure(defaults, options) {\n return merge({}, defaults, options);\n }", "title": "" }, { "docid": "7233bc85bac4e3a151c9a69b82428db2", "score": "0.39223948", "text": "static get pluginConfig() {\n return {\n chain: ['renderHeader', 'getCellMenuItems', 'getHeaderMenuItems', 'onElementClick']\n };\n }", "title": "" }, { "docid": "0246137ed144063e5da4a586dac8188e", "score": "0.39203387", "text": "function CreateElement(options) {\n //type : Element type to create\n //class : Class name of element\n //text : Inner text\n //html : Set inner html\n //appendTo : Append to element\n //elements : Inner elements to append to this element\n var element = null;\n\n if (options.hasOwnProperty('type')) {\n element = document.createElement(options['type']);\n if (options.hasOwnProperty('class')) element.className = options['class'];\n if (options.hasOwnProperty('inputType')) {\n element.type = options['inputType'];\n if (options.hasOwnProperty('text')) element.text = options['text'];\n } else {\n if (options['type'] == 'input') {\n if (options.hasOwnProperty('text')) element.value = options['text'];\n } else {\n if (options.hasOwnProperty('text')) element.innerText = options['text'];\n }\n }\n if (options.hasOwnProperty('html')) element.innerHTML = options['html'];\n if (options.hasOwnProperty('opacity')) element.style.opacity = options['opacity'];\n if (options.hasOwnProperty('appendTo')) options['appendTo'].appendChild(element);\n if (options.hasOwnProperty('src')) element.src = options['src'];\n if (options.hasOwnProperty('id')) element.id = options['id'];\n if (options.hasOwnProperty('value')) element.value = options['value'];\n if (options.hasOwnProperty('onClick')) element.onclick = options['onClick'];\n if (options.hasOwnProperty('onMouseMove')) element.onmousemove = options['onMouseMove'];\n if (options.hasOwnProperty('onMouseDown')) element.onmousedown = options['onMouseDown'];\n if (options.hasOwnProperty('onMouseUp')) element.onmouseup = options['onMouseUp'];\n if (options.hasOwnProperty('onChange')) element.onchange = options['onChange'];\n if (options.hasOwnProperty('onInput')) element.oninput = options['onInput'];\n if (options.hasOwnProperty('value')) element.value = options['value'];\n if (options.hasOwnProperty('elements')) {\n var elements = options['elements'];\n for (var i = 0; i < elements.length; i++) {\n var addElement = elements[i];\n element.appendChild(addElement);\n }\n }\n }\n\n return element;\n}", "title": "" }, { "docid": "649a101111fe6c748180f84553959fb2", "score": "0.39145225", "text": "function createKeyBinding(options) {\n return {\n keys: normalizeKeys(options),\n selector: validateSelector(options),\n command: options.command,\n args: options.args || coreutils_1.JSONExt.emptyObject\n };\n }", "title": "" }, { "docid": "649a101111fe6c748180f84553959fb2", "score": "0.39145225", "text": "function createKeyBinding(options) {\n return {\n keys: normalizeKeys(options),\n selector: validateSelector(options),\n command: options.command,\n args: options.args || coreutils_1.JSONExt.emptyObject\n };\n }", "title": "" }, { "docid": "2300332287a1c9d16d899f757bf52b46", "score": "0.39103508", "text": "constructor(config) {\n this.config = config || {};\n\n // Define components\n if (!window.components) {\n window.components = {};\n }\n\n if (!this.config.el) throw new Error(\"Need to define config.el in: \" + this);\n this.el = $(this.config.el);\n\n if (this.config.events) this._registerEvents();\n this._registerComponent();\n if (this.config.include) this._includeComponents();\n this._registerEvents();\n }", "title": "" }, { "docid": "7f314768b40d19ab8025ab7f5402a561", "score": "0.39050958", "text": "constructor(options) {\n this.currentDocument = options.document;\n this.editableElement = options.editableElement;\n this.nodeSelection = new NodeSelection();\n this.domNode = new DOMNode(this.editableElement, this.currentDocument);\n this.observer = new Observer(this);\n this.listObj = new Lists(this);\n this.formatObj = new Formats(this);\n this.alignmentObj = new Alignments(this);\n this.indentsObj = new Indents(this);\n this.linkObj = new LinkCommand(this);\n this.imgObj = new ImageCommand(this);\n this.selectionObj = new SelectionBasedExec(this);\n this.inserthtmlObj = new InsertHtmlExec(this);\n this.insertTextObj = new InsertTextExec(this);\n this.clearObj = new ClearFormatExec(this);\n this.tableObj = new TableCommand(this);\n this.undoRedoManager = new UndoRedoManager(this, options.options);\n this.msWordPaste = new MsWordPaste(this);\n this.wireEvents();\n }", "title": "" } ]
917e7bf3e3f76d7b00339699e3dc7786
YAHOO.util.escapeHTML() doesn't exist until 2.9.x. :( trs, 25 Oct 2013
[ { "docid": "4601d291f0eb94d147953dc5601c01ee", "score": "0.6943122", "text": "function escapeHTML(text) {\n return (\"\" + text).replace(/[<>'\"&]/g, function(c){\n return \"&#x\" + c.charCodeAt(0).toString(16) + \";\"\n });\n}", "title": "" } ]
[ { "docid": "62a1aebbc2bb809c2ff82947a9e451a2", "score": "0.70986164", "text": "function _htmlEscape(text) {\n return text.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;');\n }", "title": "" }, { "docid": "5aa73e2b4dc9578cad5be68714b3b712", "score": "0.70670205", "text": "function escapeHTML(text)\n{\n return text.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\"/g, \"&quot;\");\n}", "title": "" }, { "docid": "966eb9c8842bd23e2a80ddb70810c08f", "score": "0.7045271", "text": "escapeHTML(str) {\n\t\tif (!str) return '';\n\t\treturn ('' + str)\n\t\t\t.replace(/&/g, '&amp;')\n\t\t\t.replace(/</g, '&lt;')\n\t\t\t.replace(/>/g, '&gt;')\n\t\t\t.replace(/\"/g, '&quot;')\n\t\t\t.replace(/'/g, '&apos;')\n\t\t\t.replace(/\\//g, '&#x2f;');\n\t}", "title": "" }, { "docid": "57a576b716f945b025fe85d797227637", "score": "0.7011678", "text": "function escapeHTML(text)\r\n{\r\n text = text.replace('&', '&amp;');\r\n text = text.replace('<', '&lt;');\r\n text = text.replace('>', '&gt;');\r\n text = text.replace('\"', '&quot;');\r\n text = text.replace(\"'\", '&apos;');\r\n\r\n return text;\r\n}", "title": "" }, { "docid": "1e3e6852a13f0d29527461eb5010b864", "score": "0.7001696", "text": "function escapeHTML(text) {\r\n\treturn text.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\r\n}", "title": "" }, { "docid": "719b5dd5890fdb18dc22de57199431b7", "score": "0.6956127", "text": "escapeHTML(text) {\n\t\t\treturn text.replace(/\\&/g,'&amp;').replace(/\\</g,'&lt;').replace(/\\>/g,'&gt;');\n\t\t}", "title": "" }, { "docid": "2e28ed6fd489147e17af68ccf13e668d", "score": "0.69225085", "text": "function dm3_escape_html(str) {\r\n return str\r\n .replace(/&/g, \"&amp;\")\r\n .replace(/</g, \"&lt;\")\r\n .replace(/>/g, \"&gt;\")\r\n .replace(/\"/g, \"&quot;\")\r\n .replace(/'/g, \"&#039;\");\r\n }", "title": "" }, { "docid": "8b9f091731d5534a54873b7167c539af", "score": "0.6905406", "text": "function escapeHTML(html) {\n\tvar x;\n\tvar hchars = {\n\t\t'&': '&amp;',\n\t\t'<': '&lt;',\n\t\t'>': '&gt;',\n\t\t'\"': '&quot;'\n\t};\n\n\tfor (x in hchars) {\n\t\thtml = html.replace(new RegExp(x, 'g'), hchars[x]);\n\t}\n\n\treturn html;\n}", "title": "" }, { "docid": "ac0a4cbaab1c913eb1588d40ba9b7da2", "score": "0.68741846", "text": "function escapeHtml(string) {\n\treturn string;\n}", "title": "" }, { "docid": "a32c40985af8fa8420329471b8091d8e", "score": "0.686694", "text": "function escapeHTML(html) {\n\t\treturn String(html)\n\t\t\t.replace(/&/g, '&amp;')\n\t\t\t.replace(/\"/g, '&quot;')\n\t\t\t.replace(/'/g, '&#39;')\n\t\t\t.replace(/</g, '&lt;')\n\t\t\t.replace(/>/g, '&gt;');\n\t}", "title": "" }, { "docid": "a8585f87ea145e3a2801d9bed587d566", "score": "0.68506163", "text": "function escapeHTML(str) {\n var escaped, i, len, specialChars;\n\n specialChars = [\n [ /&/g, \"&amp;\" ],\n [ /</g, \"&lt;\" ],\n [ />/g, \"&gt;\" ],\n [ /\"/g, \"&quot;\" ], // \" fix my flawed syntax highlighting\n [ /'/g, \"&#39;\" ], // ' fix my flawed syntax highlighting\n [ /\\//g, \"&#47;\" ]\n ];\n\n escaped = str || \"\";\n for (i = 0, len = specialChars.length; i < len; i++) {\n escaped = escaped.replace(specialChars[i][0], specialChars[i][1]);\n }\n\n return escaped;\n }", "title": "" }, { "docid": "b3d3be7b97777dbb1a526d90e265b9bc", "score": "0.68502325", "text": "function escapeHTML(text) {\n\t\t\treturn text.replace(/\\&/g,'&amp;').replace(/\\</g,'&lt;').replace(/\\>/g,'&gt;');\n\t\t}", "title": "" }, { "docid": "26ec04d9354dfd2a81ed49994b7b45b3", "score": "0.6834777", "text": "function escape_html(text) {\n\t var esc = document.createElement('div');\n\t esc.textContent = text;\n\t return esc.innerHTML;\n\t}", "title": "" }, { "docid": "2023d4e8c326f8567f4daac0f82c4fe0", "score": "0.68020624", "text": "function escapeHTML(s) {\n\t\treturn s.replace(/&/g, '&amp;')\n\t\t\t.replace(/</g, '&lt;')\n\t\t\t.replace(/>/g, '&gt;')\n\t\t\t.replace(/'/g, '&apos;')\n\t\t\t.replace(/\"/g, '&quot;')\n\t\t\t.replace(/\\//g, '&sol;');\n\t}", "title": "" }, { "docid": "9b2f3c13cbe478a645bce5d3e192df42", "score": "0.6797407", "text": "function mrl_htmlEncode(value){\r\n\tif (value) {\r\n\t\tvalue = jQuery('<div />').text(value).html();\r\n\r\n\tvar escaped = value;\r\n\tvar findReplace = [[/&/g, \"&amp;\"], [/</g, \"&lt;\"], [/>/g, \"&gt;\"], [/\"/g, \"&quot;\"]]\r\n\tfor(var item in findReplace)\r\n\t\tescaped = escaped.replace(findReplace[item][0], findReplace[item][1]);\r\n\treturn escaped;\r\n\r\n\r\n } else {\r\n return '';\r\n }\r\n}", "title": "" }, { "docid": "b2d4e102dba04d1b0e2175c8d74c79fe", "score": "0.67811555", "text": "function escapeHtml(input) {\n\t\treturn input.replace(/&/g,\"&#38;\").replace(/</g,\"&#60;\");\n\t}", "title": "" }, { "docid": "6099ffda94be156dcddca0d30da7664a", "score": "0.67527384", "text": "function htmlEscape(str)\r\n{\r\n return str\r\n .replace(/&/g, '&amp;')\r\n .replace(/\"/g, '&quot;')\r\n .replace(/'/g, '&#39;')\r\n .replace(/</g, '&lt;')\r\n .replace(/>/g, '&gt;');\r\n}", "title": "" }, { "docid": "3dcce8f4c858ba61747f80b8e26a33d0", "score": "0.674354", "text": "function escapeHtml(text) {\n\t return text\n\t .replace(/&/g, \"&amp;\")\n\t .replace(/</g, \"&lt;\")\n\t .replace(/>/g, \"&gt;\")\n\t .replace(/\"/g, \"&quot;\")\n\t .replace(/'/g, \"&#039;\")\n\t .replace(/-/g, \"&ndash;\")\n\t .replace(/—/g, \"&mdash;\")\n\t .replace(/©/g, \"&copy;\")\n\t .replace(/™/g, \"&trade;\")\n\t .replace(/®/g, \"&reg;\");\n\t}", "title": "" }, { "docid": "0792844588171ce172f2fad492d0bf94", "score": "0.6741023", "text": "function escapeHTML(str) {\n return ('' + str)\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;');\n}", "title": "" }, { "docid": "7d205ebe0348504e12c76389991f6398", "score": "0.67361176", "text": "function escapeHtml(text) {\n\t\t\t var map = {\n\t\t\t '&': '&amp;',\n\t\t\t '<': '&lt;',\n\t\t\t '>': '&gt;',\n\t\t\t '\"': '&quot;',\n\t\t\t \"'\": '&#039;'\n\t\t\t };\n\t\t\t return text.replace(/[&<>\"']/g, function(m) { return map[m]; });\n\t\t\t}", "title": "" }, { "docid": "ea73b7fb85a72bf3192cfb0862f494ae", "score": "0.67305094", "text": "function html_escape(s)\n{\n return s.replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#39;\");\n}", "title": "" }, { "docid": "a5b22151af5cd97c7b896b1283c37f60", "score": "0.6728362", "text": "function escapeHtml(str) {\n if(str == null){\n str=\"\";\n }\n var div = document.createElement('div');\n div.appendChild(document.createTextNode(str.replace(/\"/g, '&quot;')));\n\n return div.innerHTML;\n}", "title": "" }, { "docid": "edf7d4ac99dabec6ed965d190c24569a", "score": "0.67267424", "text": "function escape_html (s) {\n // TODO: this will fail on '<' and '>' in CSS selectors\n return s.replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\")\n }", "title": "" }, { "docid": "09b17287ebad8edeb7f7fca07f9d44cc", "score": "0.670056", "text": "function escapeHtml(text){\n\tvar returnText = \"\" + text;\n\tvar map = {\n\t\t\t'&': '&amp;',\n\t\t\t'<': '&lt;',\n\t\t\t'>': '&gt;',\n\t\t\t'\"': '&quot;',\n\t\t\t\"'\": '&#039;'\n\t};\n\t\n\treturn returnText.replace(/[&<>\"']/g, function(m) { return map[m]; });\n}", "title": "" }, { "docid": "a998f1e347f63e4868e0eea257f732a9", "score": "0.66984344", "text": "function escapeHTML(value) {\n return String(value).replace(/&/g, '&amp;').replace(/</g, '&lt;');\n }", "title": "" }, { "docid": "7de32c7736faf0c3edd3bd5ec1ad4f29", "score": "0.6694154", "text": "function escapeHtml(t) {\n\treturn $('<div/>').text(t).html();\n }", "title": "" }, { "docid": "cdc9286a171e9e9d0b02763c63dac00c", "score": "0.66617167", "text": "function htmlEscape(text) {\r\n return text.replace(/[<>\"&]/g, function (match, pos, originalText) {\r\n switch (match) {\r\n case '<':\r\n return '&lt;';\r\n case '>':\r\n return '&gt;';\r\n case '&':\r\n return '&amp;';\r\n case '\\\"':\r\n return \"&quot;\";\r\n }\r\n })\r\n}", "title": "" }, { "docid": "360fe5b564f7aaf458ac861e62dac4af", "score": "0.66538286", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }", "title": "" }, { "docid": "044fb6b8f3f41249b96f38ae523b6bed", "score": "0.6631348", "text": "function escapehtml(s) {\n\tif (typeof s !== 'string')\n\t\treturn s;\n\tvar r = \"\";\n\tvar i;\n\tfor (i=0;i<s.length;++i) {\n\t\tvar c = s.charAt(i);\n\t\tif (c == '<')\n\t\t\tc = '&lt;';\n\t\telse if (c == '>')\n\t\t\tc = '&gt;';\n\t\telse if (c == '&')\n\t\t\tc = '&amp;';\n\t\telse if (c == '\"')\n\t\t\tc = '&quot;';\n\t\telse if (c == ' ')\n\t\t\tc += '&nbsp;';\n\t\telse if (c == '\\n')\n\t\t\tc += '<br/>';\n\t\tr += c;\t\t\n\t}\n\treturn r;\n}", "title": "" }, { "docid": "eafe84f82c9d7abc2d6829ab2b198589", "score": "0.65962875", "text": "function escapeHTML(code)\n{\n\treturn (code + \"\").replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');\n}", "title": "" }, { "docid": "71628e24364829c6a7d9039542163ac3", "score": "0.65935504", "text": "function htmlEscape(str) {\n return (str+\"\").replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\");\n }", "title": "" }, { "docid": "a4009fe6979c860aef27d530d93ee242", "score": "0.6592163", "text": "function escapeHtml(unsafe) {\r\n return unsafe\r\n .replace(/&/g, \"&amp;\")\r\n .replace(/</g, \"&lt;\")\r\n .replace(/>/g, \"&gt;\")\r\n .replace(/\"/g, \"&quot;\")\r\n .replace(/'/g, \"&#039;\");\r\n }", "title": "" }, { "docid": "a4009fe6979c860aef27d530d93ee242", "score": "0.6592163", "text": "function escapeHtml(unsafe) {\r\n return unsafe\r\n .replace(/&/g, \"&amp;\")\r\n .replace(/</g, \"&lt;\")\r\n .replace(/>/g, \"&gt;\")\r\n .replace(/\"/g, \"&quot;\")\r\n .replace(/'/g, \"&#039;\");\r\n }", "title": "" }, { "docid": "570c8beceda32b5a3590e63724e2767a", "score": "0.6590069", "text": "function escapeHTML(text) {\n return $('<div/>').text(text).html()\n }", "title": "" }, { "docid": "46d1581c8b9fc7e93e124e49e6a60c4f", "score": "0.65843064", "text": "function escapeHTML(s) {\n\treturn s.toString().split('&').join('&amp;').split('<').join('&lt;').split('\"').join('&quot;');\n}", "title": "" }, { "docid": "1f6acf916f599799a1cbbd53c4e77fdb", "score": "0.65607274", "text": "function escapeHTML(value) {\n return String(value)\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;');\n }", "title": "" }, { "docid": "e2af28c2fdad080059d4ba976b410e04", "score": "0.65491384", "text": "function escapeToHtml(text){\n\treturn text.replace(/&/g, \"&amp;\").replace(/>/g, \"&gt;\").replace(/</g, \"&lt;\").replace(/\"/g, \"&quot;\");\n}", "title": "" }, { "docid": "4cd383b9af1c5024865ceb3805c60dc7", "score": "0.65481144", "text": "function encodeHtml(str) {str = str.replace(/</gi, '&lt;');str = str.replace(/>/gi, '&gt;');return str;}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6541295", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6541295", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6541295", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6541295", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6541295", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6541295", "text": "function SafeHtml() {}", "title": "" }, { "docid": "9166bc407b37fc1c66c08c548305aa46", "score": "0.6541295", "text": "function SafeHtml() {}", "title": "" }, { "docid": "63258e9bfca3126c10d7e46c78512d6f", "score": "0.65338665", "text": "function escapeHtml(unsafe) {\n if(unsafe === null || unsafe === undefined) {\n return '';\n }\n\treturn unsafe\n\t .replace(/&/g, '&amp;')\n\t\t .replace(/</g, '&lt;')\n\t\t .replace(/>/g, '&gt;')\n\t\t .replace(/\"/g, '&quot;')\n\t\t .replace(/'/g, '&#039;');\n }", "title": "" }, { "docid": "69c550be6e1947baa1c648658b3195ba", "score": "0.65312374", "text": "function escapeHtml(text) {\n return text\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\");\n }", "title": "" }, { "docid": "048de2d9965dea856334ceabaaccb416", "score": "0.65310013", "text": "function custom_htmlescape(str) {\n var ret = str;\n if (str) {\n var regexp = /&/g;\n ret = ret.replace(regexp, \"&amp;\");\n regexp = /</g;\n ret = ret.replace(regexp, \"&lt;\"); \n regexp = />/g; \n ret = ret.replace(regexp, \"&gt;\");\n regexp = /\\\"/g; \n ret = ret.replace(regexp, \"&quot;\"); \n regexp = /\\\\/g; \n ret = ret.replace(regexp, \"&#092;\"); \n }\n return ret;\n }", "title": "" }, { "docid": "048de2d9965dea856334ceabaaccb416", "score": "0.65310013", "text": "function custom_htmlescape(str) {\n var ret = str;\n if (str) {\n var regexp = /&/g;\n ret = ret.replace(regexp, \"&amp;\");\n regexp = /</g;\n ret = ret.replace(regexp, \"&lt;\"); \n regexp = />/g; \n ret = ret.replace(regexp, \"&gt;\");\n regexp = /\\\"/g; \n ret = ret.replace(regexp, \"&quot;\"); \n regexp = /\\\\/g; \n ret = ret.replace(regexp, \"&#092;\"); \n }\n return ret;\n }", "title": "" }, { "docid": "bf68410119527a6bb42ccafed94670d2", "score": "0.6527041", "text": "function escapeHTML(str){\n return str.replace(/</g, \"&lt\").replace(/>/g, \"&gt\");\n}", "title": "" }, { "docid": "af1164eb0ff35dafe677a683d7ef0e16", "score": "0.65225774", "text": "function guiEscapeHtml(html, isEscape) {\n if (isEscape) {\n var escaped = html;\n escaped = escaped.replace(/&/g, \"&amp;\"); \n escaped = escaped.replace(/</g, \"&lt;\"); \n escaped = escaped.replace(/>/g, \"&gt;\"); \n escaped = escaped.replace(/\"/g, \"&quot;\"); \n escaped = escaped.replace(/'/g, \"&apos;\"); \n return escaped;\n } else {\n var unescaped = html;\n unescaped = unescaped.replace(/&apos;/g, \"'\"); \n unescaped = unescaped.replace(/&quot;/g, '\"'); \n unescaped = unescaped.replace(/&gt;/g, \">\"); \n unescaped = unescaped.replace(/&lt;/g, \"<\"); \n unescaped = unescaped.replace(/&amp;/g, \"&\"); \n return unescaped;\n \n }\n}", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.65157974", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.65157974", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.65157974", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.65157974", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.65157974", "text": "function SafeHtml() { }", "title": "" }, { "docid": "6a22cce458ccce2a376e7c7d1874248e", "score": "0.6503329", "text": "function escapeHTML(s) {\n return String(s)\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "68b953b32f61210033af7244c8540279", "score": "0.6501437", "text": "function escapeHtml(str){\n str = str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/'/g, '&#39;')\n .replace(/\"/g, '&quot;');\n\n return str;\n}", "title": "" }, { "docid": "cff4267c08cc88a517aaa01a361af6a3", "score": "0.6498543", "text": "function HtmlEscape(str) {\n if (!str) return \"\";\n return str.replace(amp_re_, \"&amp;\").replace(lt_re_, \"&lt;\").\n replace(gt_re_, \"&gt;\").replace(quote_re_, \"&quot;\");\n}", "title": "" }, { "docid": "9b2d49f5c9de33a8c4153a094772bfb3", "score": "0.64966846", "text": "function escapeHtml(unsafe) {\r\n return unsafe\r\n .replace(/&/g, \"&amp;\")\r\n .replace(/</g, \"&lt;\")\r\n .replace(/>/g, \"&gt;\")\r\n .replace(/\"/g, \"&quot;\")\r\n .replace(/'/g, \"&#039;\");\r\n}", "title": "" }, { "docid": "1cb5395716157a4043637eab83b8d8e1", "score": "0.6493551", "text": "function escapeHtml(text) {\n\t\t var map = {\n\t\t '&': '&amp;',\n\t\t '<': '&lt;',\n\t\t '>': '&gt;',\n\t\t '\"': '&quot;',\n\t\t \"'\": '&#039;'\n\t\t };\n\n\t\t return text.replace(/[&<>\"']/g, (m) => { return map[m]; });\n\t}", "title": "" }, { "docid": "2f695695e46121cfff6bf4e91a6b16b2", "score": "0.6473716", "text": "function escapeHtml(string) {\n return String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap(s) {\n return entityMap[s];\n });\n}", "title": "" }, { "docid": "7239dfad077a7b92aedf86949c31db0b", "score": "0.6460462", "text": "function SafeHtml(){}", "title": "" }, { "docid": "19bb7eac95d4daf7117959a2bd41bfff", "score": "0.6457485", "text": "function escapeHtml(unsafe) {\r\n return unsafe\r\n .replace(/&/g, \"&amp;\")\r\n .replace(/</g, \"&lt;\")\r\n .replace(/>/g, \"&gt;\")\r\n .replace(/\"/g, \"&quot;\")\r\n .replace(/'/g, \"&#039;\");\r\n}", "title": "" }, { "docid": "530b551c06939439160f539765d9ad5c", "score": "0.6453507", "text": "function escapeHtml(str) {\n\tvar div = document.createElement('div');\n\tdiv.appendChild(document.createTextNode(str));\n\treturn div.innerHTML;\n}", "title": "" }, { "docid": "8f446b5b251ccfb46811696ab434b769", "score": "0.64527845", "text": "function escapeHTML(str) {\n var div = create('div');\n var text = document.createTextNode(str);\n div.appendChild(text);\n return div.innerHTML;\n }", "title": "" }, { "docid": "8754c775ea08ba4b89750f2ede9d1128", "score": "0.6438922", "text": "function escapeHtml(str) {\n var div = document.createElement(\"div\");\n div.appendChild(document.createTextNode(str));\n return div.innerHTML;\n}", "title": "" }, { "docid": "99ff71e4e2b53ffc47680e4a1361074a", "score": "0.64387786", "text": "function encodeHTML(html) {\r\n\treturn html.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\"/g, '&quot;');\r\n}", "title": "" }, { "docid": "e8238edbd569be866322f406df83f8f3", "score": "0.64377975", "text": "function escapeHtml(unsafe) {\n if(unsafe === null || unsafe === undefined) {\n return '';\n }\n if(typeof unsafe !== 'string'){\n \t//non so che e' stato passato, lo ritorno\n \treturn unsafe;\n }\n return unsafe\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#039;');\n }", "title": "" }, { "docid": "cf4ad351e6422295b3d01c4f3225ffaa", "score": "0.6436823", "text": "function escapeHtml(str) {\n var div = document.createElement('div');\n div.appendChild(document.createTextNode(str));\n return div.innerHTML;\n}", "title": "" }, { "docid": "a2f339c1c6938f5618d4c3f2ac199c59", "score": "0.6421674", "text": "function escapeHTML(str) {\n var div = document.createElement('div');\n div.appendChild(document.createTextNode(str));\n return div.innerHTML;\n}", "title": "" }, { "docid": "7cb6d969232b4a8ac38153c26ef398e5", "score": "0.6410881", "text": "function escapeHtml(text) {\n var map = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#039;'\n };\n return text.replace(/[&<>\"']/g, function(m) { return map[m]; });\n}", "title": "" }, { "docid": "8b781aaa2e11d69b64fdcd4973899aaf", "score": "0.64011484", "text": "function _encodeHtml() {\n\t\tvar result = '';\n\t\tvar argCount = arguments.length;\n\t\tvar $wrapper = $local('<p>');\n\t\tfor (var argIdx = 0; argIdx < argCount; argIdx++) {\n\t\t\tresult = result + $wrapper.text(arguments[argIdx]).html();\n\t\t}\n\t\treturn result;\n\t}", "title": "" }, { "docid": "ae6d50ee4067f911d399299282c20544", "score": "0.63960075", "text": "function escapeHTML(str) {\n return str.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "28e1f0d7228edd173e5186fbc7be592b", "score": "0.6394157", "text": "function escapeHtml(string) {\n\t\treturn string ? ('' + string).replace(/</g, '&lt;').replace(/>/g, '&gt;') : string;\n\t}", "title": "" }, { "docid": "68a524f8c43809c3abee80e083ff3803", "score": "0.6393053", "text": "function escapeHtml(str) {\n str = toString_1[\"default\"](str)\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/'/g, '&#39;')\n .replace(/\"/g, '&quot;');\n return str;\n}", "title": "" }, { "docid": "39abd7b637a352045f61d8b35974f9cf", "score": "0.63893485", "text": "function escapeHtml (string) {\n return String(string).replace(/[&<>\"'`=\\/]/g, function (s) {\n return entityMap[s];\n });\n}", "title": "" }, { "docid": "1de8b1c7c15b785bd363d7fac1390f2a", "score": "0.6389026", "text": "function deEscapeFromHTML(value) {\n var undef;\n if(value == undef || value == \"\") {\n return \"\";\n }\n value = value.replace(/&lt;/gi, \"<\");\n value = value.replace(/&gt;/gi, \">\");\n value = value.replace(/&quot;/gi, \"\\\"\");\n // de-escape both 039 and 39 for right now\n // until I can make sure we only use 39\n value = value.replace(/&#039;/gi, \"'\");\n value = value.replace(/&#39;/gi, \"'\");\n value = value.replace(/&amp;/gi, \"&\");\n\n return deEscapeForJavaScript(value);\n}", "title": "" }, { "docid": "1f18c941089ae2929c6753e28bdc9f76", "score": "0.63780105", "text": "function escapeHTML(str) {\n\tvar div = document.createElement(\"div\");\n\tvar text = document.createTextNode(str);\n\tdiv.appendChild(text);\n\treturn div.innerHTML;\n}", "title": "" }, { "docid": "74239023ddb81419cb9df0bd44a3c333", "score": "0.63727176", "text": "function escapeHtml_filter(input) {\n var replace = Packages.org.eclipse.jetty.util.StringUtil.replace;\n var str = (input || \"\").toString();\n return replace(replace(replace(replace(str, '&', '&amp;'), '\"', '&quot;'), '>', '&gt;'), '<', '&lt;');\n}", "title": "" }, { "docid": "e9fb515a9e8c7accdd016d3c7d3b70d9", "score": "0.63695896", "text": "function escapeHtml(string) {\n return String(string).replace(/[&<>\"'\\/]/g, function (s) {\n return entityMap[s];\n });\n }", "title": "" }, { "docid": "3a1f17f6f63cd0540ee45d9630a1aebe", "score": "0.63579214", "text": "function escapeHtml(text) {\n var map = {\n '&': '&amp;',\n '<': '&lt;',\n '>': '&gt;',\n '\"': '&quot;',\n \"'\": '&#039;'\n };\n\n return text.replace(/[&<>\"']/g, function (m) { return map[m]; });\n}", "title": "" }, { "docid": "800d0aed919bd794ec4ad42f34193fce", "score": "0.6357001", "text": "function htmlEscape(str) {\n return String(str)\n .replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "9813bb2c1f78c8a4611013389a377f01", "score": "0.63517267", "text": "function htmlEscape(str) {\n return str\n .replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "f3819b92caad1002a3456b7cf9aa4c62", "score": "0.6323131", "text": "function HTMLEncode(value){\n try{\n var i=value,\n db=true;\n return Encoder.htmlEncode(i,db);\n }\n catch(error){\n alert(error.name + \": \" + error.message + error.lineNumber);\n }\n}", "title": "" }, { "docid": "4a7554aae325855b07b6382ebdd21673", "score": "0.63223076", "text": "function htmlEncode(value){\n\t return $(document.createElement('div')).text(value).html();\n\t }", "title": "" }, { "docid": "baf74c4aefc5bda7b879427e2f94d2d6", "score": "0.63179994", "text": "function html2Quote(s) {\n if (!s)\n return s;\n return htmlQuote(s.replace(/\\&([#a-z0-9A-Z]+);/g, function (f, ent) {\n switch (ent) {\n case \"amp\": return \"&\";\n case \"lt\": return \"<\";\n case \"gt\": return \">\";\n case \"quot\": return \"\\\"\";\n default:\n if (ent[0] == \"#\")\n return String.fromCharCode(parseInt(ent.slice(1)));\n else\n return f;\n }\n }));\n }", "title": "" }, { "docid": "c2a0b03b32ad80c6e210fa47eaf87166", "score": "0.6314211", "text": "function htmlEscape(str) {\n return String(str)\n .replace(/&/g, '&amp;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\\u2018/g, \"&lsquo;\")\n .replace(/\\u2019/g, \"&rsquo;\")\n .replace(/\\u201C/g, \"&ldquo;\")\n .replace(/\\u201D/g, \"&rdquo;\")\n .replace(/\\u00AE/g, \"&reg;\")\n .replace(/\\u2122/g, \"&trade;\")\n .replace(/\\u2013/g, \"&ndash;\")\n .replace(/\\u2014/g, \"&mdash;\");\n }", "title": "" }, { "docid": "9ffe8b5d342386bfd67c352745e2ad91", "score": "0.63090754", "text": "function escapeHtml(rawText) {\n return rawText\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&apos;')\n }", "title": "" }, { "docid": "0d3f82921518c83a4fbaa151f3458f38", "score": "0.63080454", "text": "function htmlEncode(text) {\n return document.createElement('a').appendChild( document.createTextNode(text) ).parentNode.innerHTML;\n}", "title": "" }, { "docid": "0d3f82921518c83a4fbaa151f3458f38", "score": "0.63080454", "text": "function htmlEncode(text) {\n return document.createElement('a').appendChild( document.createTextNode(text) ).parentNode.innerHTML;\n}", "title": "" }, { "docid": "28a1acdfdc05a3769c036e34a0a3c703", "score": "0.63069075", "text": "function escape(value) {\n return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {\n return htmlEntities[character];\n }) : value;\n}", "title": "" }, { "docid": "835d064e56ef89e7deabebc081a10136", "score": "0.62954986", "text": "function escapeHTML(s) {\n // Comment from Ransom:\n // > Very clever, but it took me a few moments to realize you were using split/join\n // > as a global string replace. Note that using replace() with a global flag is\n // > much faster than split/join (at least in Chrome), so consider replace() if\n // > this function is ever churning through large amounts of strings\n //\n //\n return s.split('&').join('&amp;').split('<').join('&lt;').split('\"').join('&quot;');\n }", "title": "" }, { "docid": "252556c5e95fc0047d56b75d9e25fc30", "score": "0.62827283", "text": "function encodeHTML(string) {\n return document.createElement('x').appendChild(document.createTextNode(string)).parentNode.innerHTML;\n }", "title": "" }, { "docid": "0c1d861ed4b489fcbe91fd72b431569d", "score": "0.6276645", "text": "function escape_html_attribute(code){\r\n\t return code.replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\");\r\n}", "title": "" }, { "docid": "b75c4db545a90e4fc78250286bbcbad1", "score": "0.62608886", "text": "function escapeHtml(str) {\n 'use strict';\n var div = document.createElement('div');\n div.appendChild(document.createTextNode(str));\n return div.innerHTML;\n}", "title": "" }, { "docid": "1f413092edeb6149c9d9d4e73f007aae", "score": "0.62397736", "text": "function escaparHtml (str) {\n return $('<div/>').text(str).html();\n}", "title": "" }, { "docid": "02be73b14e749f82a229a2f356bc1395", "score": "0.62392354", "text": "function escapeText( s ) {\n\tif ( !s ) {\n\t\treturn \"\";\n\t}\n\ts = s + \"\";\n\n\t// Both single quotes and double quotes (for attributes)\n\treturn s.replace( /['\"<>&]/g, function( s ) {\n\t\tswitch ( s ) {\n\t\tcase \"'\":\n\t\t\treturn \"&#039;\";\n\t\tcase \"\\\"\":\n\t\t\treturn \"&quot;\";\n\t\tcase \"<\":\n\t\t\treturn \"&lt;\";\n\t\tcase \">\":\n\t\t\treturn \"&gt;\";\n\t\tcase \"&\":\n\t\t\treturn \"&amp;\";\n\t\t}\n\t} );\n}", "title": "" }, { "docid": "65ad3c9728d5ead5c3a3f81c3be3875d", "score": "0.62385756", "text": "function escapeHtml(string) {\n return string.replace(/&/g, '&amp;').replace(/</g, '&lt;');\n}", "title": "" }, { "docid": "48873df91e5775e67097d7d91ca68889", "score": "0.622853", "text": "function escapeText( s ) {\n\tif ( !s ) {\n\t\treturn \"\";\n\t}\n\ts = s + \"\";\n\n\t// Both single quotes and double quotes (for attributes)\n\treturn s.replace( /['\"<>&]/g, function( s ) {\n\t\tswitch ( s ) {\n\t\tcase \"'\":\n\t\t\treturn \"&#039;\";\n\t\tcase \"\\\"\":\n\t\t\treturn \"&quot;\";\n\t\tcase \"<\":\n\t\t\treturn \"&lt;\";\n\t\tcase \">\":\n\t\t\treturn \"&gt;\";\n\t\tcase \"&\":\n\t\t\treturn \"&amp;\";\n\t\t}\n\t});\n}", "title": "" } ]
c0c263a1c7f86a669a61f3a4f62409ca
Elimino Item della ToDoList in base al click
[ { "docid": "99fb73aa96ead10ef0b668cbfa182a1e", "score": "0.0", "text": "function deleteItem(id){\n\n console.log(\"THIS id: \", id);\n $.ajax({\n\n url: \"http://157.230.17.132:3000/todos/\" + id,\n method: \"DELETE\",\n\n success: function(data){\n\n //Se tutto va bene richiamo la funzione per ristampare gli elementi aggiornati\n getItems();\n console.log(\"id Item Cancellato: \", id);\n },\n error: function(error){\n alert(\"errore chiamata DELETE\");\n console.log(\"ERROR DELETE:\", error);\n }\n });\n}", "title": "" } ]
[ { "docid": "65ffcf09d239071904c55c967ed90ad6", "score": "0.81591314", "text": "function deleteToDo(event) {\n const btn = event.target;\n const li = btn.parentNode;\n toDoList.removeChild(li); // this's just remove on the display\n const cleanToDos = toDos.filter(function(toDo) {\n return toDo.id !== parseInt(li.id);\n }); // filter transfer new array when something goes throught it, if they are 'true'\n toDos = cleanToDos\n saveToDos();\n }", "title": "" }, { "docid": "0917e37d4ee0e5514255972edc6de04d", "score": "0.8069483", "text": "function removeToDo(event) {\n \n let specificListItem = $(event.target).parent();\n specificListItem.remove();\n\n saveToDos()\n}", "title": "" }, { "docid": "277688124afe16722b84a6db64ef396f", "score": "0.8004551", "text": "function deleteToDo(event) {\n const btn = event.target;\n //console.dir(event);\n const li = btn.parentNode; // to get the father of btn\n toDoList.removeChild(li);\n const cleanToDos = toDos.filter(function(toDo) {\n return toDo.id !== parseInt(li.id); //change li.id(string) into number\n }); // they give an array of items that pass a check from filter function\n console.log(cleanToDos);\n toDos = cleanToDos;\n saveToDos();\n}", "title": "" }, { "docid": "b77f66c021ef5454ac2cc40e517a6f32", "score": "0.7822773", "text": "function deleteItem(){\n trElement.remove();\n updateOptionsCategory();\n for( let i = 0; i<todoList.length; i++){\n if(todoList[i].id == this.dataset.id){\n todoList.splice(i,1);//Borro la tarea del LS\n }\n saveLocalStorage();\n //Se borra la tarea también en el calendario\n calendar.getEventById(this.dataset.id).remove();\n }\n }", "title": "" }, { "docid": "9d8773541f1d269183974152c122cb2d", "score": "0.7671982", "text": "function deleteItem() {\n // checks which list the item is in so it can be correctly removed from localStorage\n if (\n this.closest(\".button-cont\").children[0].classList.contains(\n \"fa-undo-alt\"\n )\n ) {\n removeLocal(\n this.closest(\".to-do-item\").children[0].innerHTML,\n \"completed\"\n );\n } else {\n removeLocal(this.closest(\".to-do-item\").children[0].innerHTML, \"todo\");\n }\n\n this.closest(\".to-do-item\").remove();\n}", "title": "" }, { "docid": "f6eec3da5957bee63fba528233d39d4d", "score": "0.75764966", "text": "function removeToDo(event) {\n const ELEMENT = event.target;\n ELEMENT.parentNode.parentNode.removeChild(ELEMENT.parentNode);\n list[ELEMENT.id].trash = true;\n localStorage.setItem(\"TODO\", JSON.stringify(list));\n}", "title": "" }, { "docid": "05e26b57054411a3aa5ea36a55083263", "score": "0.7495205", "text": "function deleteItem(e) {\n // Haal het te verwijderen element uit het muisevent e.target.\n var elementToBeDeleted = e.target.parentElement;\n\n // Verwijder het uit de lijst.\n document.getElementById('todoitemlist').removeChild(elementToBeDeleted);\n }", "title": "" }, { "docid": "829059f02fb657378cb3af15e355f166", "score": "0.745688", "text": "function removeItem(){\n var item = $(this).parent().parent();\n var listID = item.parent().attr('id');\n var value = item.text();\n\n if (listID == 'todo') {\n dataTodo.todo.splice(dataTodo.todo.indexOf(value), 1);\n } else {\n dataTodo.completed.splice(dataTodo.completed.indexOf(value), 1);\n }\n \n dataObjectUpdated();\n item.remove();\n}", "title": "" }, { "docid": "93638f6ddca7a071f11a3998b1d8e5bf", "score": "0.7362543", "text": "function deleteAnItem() { \n let item = this.parentNode.parentNode;\n let id = item.id\n let value = this.previousSibling.innerText\n \n if ( id === 'todo') {\n data.todo.splice(data.todo.indexOf(value),1);\n localStorage.setItem('todolist',JSON.stringify(data));\n } else {\n console.log('hi')\n data.completed.splice(data.completed.indexOf(value),1);\n localStorage.setItem('todolist',JSON.stringify(data));\n }\n \n\n let liToRemove = this.parentNode;\n this.parentNode.parentNode.removeChild(liToRemove);\n\n}", "title": "" }, { "docid": "47724ca29c4f16be61d8c728059a396a", "score": "0.7353068", "text": "function removeTodo() {\n /* `this` refers to the button clicked. The buttons parent is the actual\n * <li>-item that we want. Save that in a variable. The container \n * (incomplete or incomplete) is the parent of that <li>-item, save that too\n */\n const listItem = this.parentElement;\n const container = this.parentElement.parentElement;\n /* Remove from DOM */\n container.removeChild(listItem);\n /* Loop through the array and find the item with the same ID as the one \n * we clicked on, splice that item, removing it from the array */\n for(let i = 0; i < todoArray.length; i++) {\n if(todoArray[i].id === listItem.id){\n todoArray.splice(i, 1);\n }\n }\n}", "title": "" }, { "docid": "0db6ddf8a16fa50c428566f93bfa1508", "score": "0.7344904", "text": "static removeToDo(element){\n \n element.parentNode.parentNode.removeChild(element.parentNode);\n \n //you make sure to also erase from the storage that it is saved\n // and not only from the Display\n const curId = element.attributes.id.value;\n const todos = Store.getToDos();\n todos.forEach((todo, index) => {\n if(+todo.id === +curId){\n todos.splice(index, 1);\n }\n });\n\n localStorage.setItem('toDo', JSON.stringify(todos));\n }", "title": "" }, { "docid": "ac1ee6f4f68f99e9eac18142c562f3a9", "score": "0.73398083", "text": "function uncheckItem() {\n const toDoBox = document.getElementById(\"to-do\");\n toDoBox.appendChild(this.closest(\".to-do-item\"));\n\n this.classList.remove(\"fa-undo-alt\");\n this.classList.add(\"fa-check-square\");\n\n this.removeEventListener(\"click\", uncheckItem);\n this.addEventListener(\"click\", completeItem);\n\n const item = this.closest(\".to-do-item\").children[0].innerHTML;\n removeLocal(item, \"completed\");\n addToLocalStorage(item, \"todo\");\n}", "title": "" }, { "docid": "6feb532fabf85ce9973ba0898a0c3a9d", "score": "0.73246723", "text": "function removeToDo(element){\n element.parentNode.parentNode.removeChild(element.parentNode);\n \n LIST[element.id].trash = true;\n}", "title": "" }, { "docid": "fd213b1df577699be936aa300c05ecf8", "score": "0.72978413", "text": "function removeItem(e){\r\n\t\tif(e.target.id == \"remove\" ){\r\n\t\t\t// console.log(e.target)\r\n\t\t\tif (confirm(\"Remove item! Are you sure?\")) {\r\n\t\t\t\tlist.removeChild(e.target.parentElement);\r\n\t\t\t\tvar child = e.target.parentElement.firstChild;\r\n\r\n\t\t\t\tfor (var i = 0; i < todo.length; i++) {\r\n\t\t\t\t\tif (todo[i] === child.textContent) {\r\n\t\t\t\t\t\tvar index1 = todo.indexOf(child.textContent);\r\n\t\t\t\t\t\tvar index2 = completed.indexOf(child.textContent);\r\n\t\t\t\t\t\ttodo.splice(index1,1);\r\n\t\t\t\t\t\tif (index2 != -1){\r\n\t\t\t\t\t\t\tcompleted.splice(index2,1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// call to update localStorage\r\n\t\t\t\t\t\tupdateStorage(\"todoList\", todo);\r\n\t\t\t\t\t\tupdateStorage(\"completed\", completed);\r\n\t\t\t\t\t\tlocation.reload();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "77017df70e75562da4e9796738e44f7d", "score": "0.72333735", "text": "function removeToDo(element) {\n element.parentNode.parentNode.removeChild(element.parentNode)\n LIST[element.id].trash = true;\n}", "title": "" }, { "docid": "eaa133f62d1e561c2c5ac7e020d1395e", "score": "0.7215729", "text": "function removeToDo(element) {\n element.parentNode.parentNode.removeChild(element.parentNode);\n LIST[element.id].trash = true;\n}", "title": "" }, { "docid": "0b48d9fb71ace63e65c769cc272d369c", "score": "0.72029185", "text": "function removeItem() {\n const item = this.parentNode.parentNode;\n const parent = item.parentNode;\n const id = parent.id;\n const value = item.innerText;\n\n if (id === \"todo\") {\n data.todo.splice(data.todo.indexOf(value), 1);\n } else {\n data.completed.splice(data.completed.indexOf(value), 1);\n }\n dataObjectUpdated();\n\n parent.removeChild(item);\n}", "title": "" }, { "docid": "bcfec703baabd86c740e818e9672f2d9", "score": "0.7199581", "text": "Remove(item){\n todoListContainer.removeChild(item)\n numTask--\n }", "title": "" }, { "docid": "ddb5990ea593d4d7994b04a63c6cc76a", "score": "0.71830076", "text": "function removeItem(){\n var item=this.parentNode.parentNode;\n var parent=item.parentNode;\n var id=parent.id;\n var value=item.innerText;\n parent.removeChild(item);\n if(id ==='todo'){\n data.todo.splice(data.todo.indexOf(value),1);\n }else{\n data.completed.splice(data.completed.indexOf(value),1);\n }\n objectUpdated();\n}", "title": "" }, { "docid": "637f5233487c7ba31be42d59303ca15a", "score": "0.7179574", "text": "function deleteTodo(e) {\n var li = e.target.parentNode;\n var id = li.getAttribute('id');\n\n window.app.Store.deleteTodo(id, function(e) {\n\n li.parentNode.removeChild(li);\n\n });\n }", "title": "" }, { "docid": "87b28caadee8c4c517bf550bcfb32f68", "score": "0.71758026", "text": "deleteListItem(ev) {\n \n //this should get the li element of the button that was clicked\n const item = ev.target.parentNode.parentNode\n const itemID = item.dataset.id\n\n //remove item from flick array\n const flickObj = this.getFlickItem(itemID)\n this.flicks.splice(this.flicks.indexOf(flickObj), 1)\n \n\n //remove item from list\n item.remove()\n\n }", "title": "" }, { "docid": "429eb157957ad34054d6fddced233f73", "score": "0.71703124", "text": "function deleteItem() {\n\tvar x = event.target;\n\tif (\"LI\"===x.tagName) {\n\tx.classList.toggle(\"done\");\n\t} else if (\"LI\" === x.parentElement.tagName) {\n\t\tx.parentElement.remove();\n\t}\n\n}", "title": "" }, { "docid": "2eebea2776f69e6cb873c302ac67e462", "score": "0.7152336", "text": "removeToDo(item) {\n ToDos.remove( {_id: item._id });\n }", "title": "" }, { "docid": "803f5879853fb0038bc1a841c9b87368", "score": "0.7145817", "text": "function remove() {\n var id = this.getAttribute('id');\n var todos = get_todos();\n //at position id, remove 1 item\n todos.splice(id, 1);\n localStorage.setItem('todo', JSON.stringify(todos));\n\n show();\n\n return false;\n}", "title": "" }, { "docid": "d673b209bfd1617d233b851b8bedab70", "score": "0.7145686", "text": "function deleteTodo (e, clickedLi) {\n allTodos.forEach( (item, index) => {\n if (item === clickedLi) {\n allTodos.splice(index, 1);\n }\n })\n clickedLi.remove()\n}", "title": "" }, { "docid": "7b71f59deb74c67ae8c7a285b40c6e7b", "score": "0.71349996", "text": "function deleteItem(e) {\n\n if (e.target.className === \"fas fa-times\") {\n //e.target.parentElement.parentElement => list item\n e.target.parentElement.parentElement.remove()\n deleteItemFromLS(e.target.parentElement.parentElement.textContent)\n }\n e.preventDefault()\n}", "title": "" }, { "docid": "c69fc9d5cc017056a5772e18f398d39c", "score": "0.7114792", "text": "function deleteButtonPressed(todo) {\n db.remove(todo);\n }", "title": "" }, { "docid": "b740199dca75789cd511c5d5472279f2", "score": "0.70776474", "text": "removeCurrentList() {\n let indexOfList = -1;\n for (let i = 0; (i < this.toDoLists.length) && (indexOfList < 0); i++) {\n if (this.toDoLists[i].id === this.currentList.id) {\n indexOfList = i;\n }\n }\n this.toDoLists.splice(indexOfList, 1);\n this.currentList = null;\n this.view.clearItemsList();\n this.view.refreshLists(this.toDoLists);\n console.log(\"Hi\");\n }", "title": "" }, { "docid": "97bcee5b25e01ea134a80989c146bd36", "score": "0.70757866", "text": "function RemoveTask(e) {\n var id = e.target.parentElement.id;\n task_array = task_array.filter(data => data.title != id);\n create_list();\n e.preventDefault();\n}", "title": "" }, { "docid": "06e4d5572a9f685743a6cdf91c7ebd0a", "score": "0.7061905", "text": "function deleteItem(e) {\n let item = e.target;\n if (item.classList[0] === \"deletebtn\") {\n let todo = item.parentElement;\n todo.remove();\n }\n}", "title": "" }, { "docid": "af06410ba25ba21907788c51f9af6a39", "score": "0.7057389", "text": "function deleteItem(id) {\n const _alert = document.querySelector(\".alertDelete\")\n const _confirmDelete = document.querySelector(\"#confirm\")\n const _closeAlert = document.querySelector(\"#close\")\n _alert.style = 'display:flex;'\n\n _confirmDelete.onclick = () => {\n for (let i = 0; i < _listToDo.length; i++) {\n if (_listToDo[i].name == id) {\n const index = _listToDo.indexOf(_listToDo[i])\n _listToDo.splice(index, 1)\n ShowItemList(true)\n saveList()\n _alert.style = 'display:none;'\n\n }\n\n }\n }\n _closeAlert.onclick = () => {\n _alert.style = 'display:none;'\n\n }\n\n\n\n}", "title": "" }, { "docid": "b037c7d04fea3266bbf3b6212a83149f", "score": "0.7051923", "text": "function deleteOrMarkItem(event) {\n let item = event.target;\n if (item.classList[0] === \"trash-btn\") {\n let toDoItem = item.parentElement;\n toDoItem.classList.add(\"animation\");\n removeLocalTodoItems(toDoItem);\n toDoItem.addEventListener(\"transitionend\", (event) => {\n toDoItem.remove();\n let todoItems = JSON.parse(localStorage.getItem(`todoItems`));\n let clearBtn = document.querySelector(\".clear-btn\");\n let completedTodosArray = todoItems.filter((todo) => {\n return todo.status === \"Completed\";\n });\n let uncompletedTodosArray = todoItems.filter((todo) => {\n return todo.status === \"Open\";\n });\n if (\n (Array.isArray(todoItems) &&\n todoItems.length === 1 &&\n filterOption.value === \"all\" &&\n clearBtn !== null) ||\n (Array.isArray(completedTodosArray) &&\n completedTodosArray.length === 1 &&\n filterOption.value === \"completed\") ||\n (Array.isArray(uncompletedTodosArray) &&\n uncompletedTodosArray.length === 1 &&\n filterOption.value === \"uncompleted\")\n ) {\n removeClearAll();\n } else if (\n (Array.isArray(completedTodosArray) &&\n completedTodosArray.length === 0) ||\n (Array.isArray(uncompletedTodosArray) &&\n uncompletedTodosArray.length === 0)\n ) {\n showCaseAll();\n }\n });\n }\n if (item.classList[0] === \"complete-btn\") {\n let toDoItem = item.parentElement;\n removeLocalTodoItems(toDoItem);\n saveLocalTodoItems({\n description: toDoItem.children[0].innerHTML,\n status: \"Completed\",\n });\n toDoItem.classList.add(\"completed\");\n }\n}", "title": "" }, { "docid": "0b2a7d6b8d343f9b6e08ba633c8d4908", "score": "0.70088273", "text": "function deleteItems(e){\n let target=e.currentTarget.parentElement.parentElement\n let id=target.dataset.id\n list.removeChild(target)\n if(list.children.length==0){\n container.classList.remove('show-list')\n }\n setDefault()\n displayAlert('to-do event deleted','danger')\n deleteStorage(id)\n}", "title": "" }, { "docid": "b33ff1504443abb25dc1c2792f9a67aa", "score": "0.70031774", "text": "removeCurrentList() {\r\n let indexOfList = -1;\r\n for (let i = 0; (i < this.toDoLists.length) && (indexOfList < 0); i++) {\r\n if (this.toDoLists[i].id === this.currentList.id) {\r\n indexOfList = i;\r\n }\r\n }\r\n this.toDoLists.splice(indexOfList, 1);\r\n this.currentList = null;\r\n this.view.clearItemsList();\r\n this.view.refreshLists(this.toDoLists);\r\n }", "title": "" }, { "docid": "336a819aa36a592e27f1210cdc8b25ba", "score": "0.69964975", "text": "function deleteListItem(){\n // Deletes item from DOM\n // newItem.parentNode.removeChild(newItem);\n\n // Hides item\n newItem.classList.add('delete')\n }", "title": "" }, { "docid": "648420962ce5c9d716dd852dd9ad01e8", "score": "0.6993668", "text": "function itemDone(){\n\tvar itemLi = this.parentNode.parentNode;\n\tvar parentUl = itemLi.parentNode;\n\tvar id = parentUl.id;\n\tparentUl.removeChild(itemLi);\n\n\tif (id === \"todo\"){\n\t\tvar completeList = document.getElementById(\"complete\");\n\t\tcompleteList.appendChild(itemLi);\n\t}\n\telse{\n\t\tvar list = document.getElementById(\"todo\");\n\t\tlist.appendChild(itemLi);\n\t}\n}", "title": "" }, { "docid": "30e382e41fd0ccd7f111cf161430b038", "score": "0.69867146", "text": "removeTodoListCompletedItems() {\n removeTodoListCompletedItems();\n }", "title": "" }, { "docid": "791c2576fe612f2323333adf8585d88b", "score": "0.6982153", "text": "function deleteButtonPressed(todo) {\n var motivoAsociado = db.get(\"motivo.\"+todo._id);\n db.remove(todo);\n db.remove(motivoAsociado);\n\n }", "title": "" }, { "docid": "8fde919d0eb83ef0fe291cb544fa4d1a", "score": "0.697411", "text": "function removeTask(e) {\n const $li = e.target.parentNode;\n const id = parseInt($li.getAttribute(\"data-id\"));\n let index = tasks.findIndex((task) => task.id === id);\n\n tasks.splice(index, 1);\n\n saveItems();\n refreshTemplate();\n}", "title": "" }, { "docid": "77774b2dc7f9e873d5fda8cba64d281b", "score": "0.69586736", "text": "deleteTodo() {\n let self = this,\n selectedTodoId = self.selectedTodo.getAttribute('id');\n\n database.deleteTodo(selectedTodoId);\n self.clearSelection();\n }", "title": "" }, { "docid": "473e032ef4e9a5428f38426d1c39f12c", "score": "0.6957164", "text": "function deleteTask() {\n\tvar wantDelete = this.parentNode.parentNode,\n\t\twantDeleteValue = wantDelete.textContent,\n\t\twantDeleteID = wantDelete.parentNode.id;\n\n\tif (wantDeleteID === 'todolist-toDoTask') {\n\t\tdata.todo.splice(data.todo.indexOf(wantDeleteValue), 1);\n\t} else {\n\t\tdata.completed.splice(data.completed.indexOf(wantDeleteValue), 1);\n\t}\n\n\twantDelete.parentNode.removeChild(wantDelete);\n}", "title": "" }, { "docid": "e675d365cafa3ca3fa7f73b0584ebbb8", "score": "0.6956856", "text": "function deleteTodos(position){\n toDos.splice(position, 1);\n displayTodos();\n }", "title": "" }, { "docid": "e4f3a9d2410a6a2876090ff2dcef9d11", "score": "0.69503355", "text": "function deleteTasks(){\n $('.deletetask').click(function(){\n $(this).closest('.list-group-item').remove();\n });\n}", "title": "" }, { "docid": "50179cb4f50ddd670b7fd0093f1b7d09", "score": "0.6948015", "text": "removeTodosList(){\n document.getElementById('outputTodo').addEventListener('click', function(e) {\n if(e.target.className === 'fas fa-trash'){\n const arrayEle = [...this.children];\n const idx = arrayEle.indexOf(e.target.parentNode.parentNode);\n //Rimuoviamo l'elemento dall'array \n app.data.todosList.splice(idx,1);\n //Rimuoviamo l'elemento dal dom\n e.target.parentNode.parentNode.remove();\n\n console.log(app.data.todosList);\n }\n });\n }", "title": "" }, { "docid": "99d3e8f085e813c4edb6a4bbc900e76d", "score": "0.69456786", "text": "function deleteItem(id){\r\n const newTodos = Todos.filter(todo => todo.id !== id );\r\n setTodos(newTodos);\r\n }", "title": "" }, { "docid": "5ce4dda1c368bd10c31cd1f87850bd9c", "score": "0.6943703", "text": "@action\n remove(todo){\n const index = this.todos.indexOf(todo)\n if(index > -1){\n this.todos.splice(index, 1)\n }\n }", "title": "" }, { "docid": "154c906c0bbfb83f8c924253e07ba790", "score": "0.69257414", "text": "function removeTodo(li) {\n todoList.removeChild(li);\n}", "title": "" }, { "docid": "a2ba614c536e6a47f5178bfdc703ef28", "score": "0.6924372", "text": "function removeTodo(e){\n // USE CONDITIONALS TO DELEGATE EVENT HANDLING\n if(e.target.parentElement.classList.contains('delete-item')){\n \n // CONFIRM DELETION USING WINDOW.CONFIRM METHOD\n // if(confirm('Delete this Todo Item?')){ // COMMENTED OUT CONFIRMATION COZ IT WAS ANNOYING\n\n // CALL REMOVE FROM LOCAL STORAGE FUNCTION\n removeTodoFromLocalStorage(e.target.parentElement.parentElement);\n\n e.target.parentElement.parentElement.remove(); // MOVE TO LI ELEMENT AND REMOVE FROM DOM \n let delToast = '<span>Removed ToDo Item</span><button class=\"btn-flat toast-action\" onclick=\"undoDelete(e.target.parentElement.parentElement)\">Undo</button>';\n \n M.toast({html: delToast, displayLength: toastTime});\n loadRandomPlaceholder();\n todoCounter();\n \n // }\n}}", "title": "" }, { "docid": "3acc3d34ec9f3620aaeedc42c9c25d16", "score": "0.6907271", "text": "function completeAndDeleteToDo(e) {\r\n const item = e.target;\r\n //Delete To Do\r\n if (item.classList[0] === \"delete-button\") {\r\n const deleteToDo = item.parentElement;\r\n deleteToDo.classList.add(\"delete-animate\");\r\n deleteSaveTodo(deleteToDo);\r\n deleteToDo.addEventListener(\"transitionend\", function () {\r\n deleteToDo.remove();\r\n });\r\n } //Complete To Do\r\n else if (item.classList[0] === \"completed-button\") {\r\n const completedToDo = item.parentElement;\r\n completedToDo.classList.toggle(\"completed-to-do\");\r\n\r\n saveCompletedToDo(completedToDo);\r\n }\r\n}", "title": "" }, { "docid": "f2733dca1a5a9994c357cdf03d2b80b5", "score": "0.6906524", "text": "function deleteTodo(e) {\r\n const item = e.target;\r\n\r\n if (\r\n item.classList[0] === \"delete-btn\" &&\r\n // Confirm popup\r\n confirm(\"Are you sure you want to delete an item?!\")\r\n ) {\r\n const todo = item.parentElement;\r\n todo.remove();\r\n }\r\n\r\n // Completed\r\n if (item.classList[0] === \"completed-btn\") {\r\n const todo = item.parentElement;\r\n todo.classList.toggle(\"completedItem\");\r\n }\r\n}", "title": "" }, { "docid": "4e0ea4fc113e1c151b6011627e4e36f8", "score": "0.6904858", "text": "function removeToDo(element) {\n\telement.parentNode.parentNode.removeChild(element.parentNode)\n\tList[element.id].trash = true //Update the array trash value if a todo is removed\n}", "title": "" }, { "docid": "d2a4951c1bb93f49ac6d6824942fb57f", "score": "0.68942004", "text": "deleteItem(id) {\n\t\tDeleteToDoAPI(id).then(resp => {\n\t\t\tthis.getItems()\n\t\t})\n\t}", "title": "" }, { "docid": "7000000030a8e7cc7b1f90d2490debdb", "score": "0.68924713", "text": "function delete_task(item) {\n let parent_li = item.parentElement;\n\n // delete from localstorage\n delete_ls(parent_li.childNodes[1].innerHTML);\n\n //delete todo object\n delete_todo(parent_li);\n\n parent_li.remove();\n task_counter();\n}", "title": "" }, { "docid": "d85945bfd6081908a413ec786aadd105", "score": "0.6872955", "text": "function removeTask(e) {\n if(e.target.parentElement.classList.contains('delete-item')) {\n console.log('The i tag:',e.target,'| The a tag (parent of i):',e.target.parentElement);\n\n if(confirm('Are you sure?')) {\n console.log('The li tag (parent of a):',e.target.parentElement.parentElement);\n\n e.target.parentElement.parentElement.remove(); // remove task from the dom\n \n removeTaskFromLocalStorage(e.target.parentElement.parentElement); // remove task from local storage\n } \n }\n\n e.preventDefault();\n}", "title": "" }, { "docid": "35573a00525714cf26fe0e702abac4e5", "score": "0.6866582", "text": "function deleteTodo(position) {\ntodos.splice(position, 1);\ndisplayTodos();\n}", "title": "" }, { "docid": "e8c3926e8ba47efc11d4f70c0cb19dfb", "score": "0.6865977", "text": "function completeItem() {\n const completedBox = document.getElementById(\"completed\");\n completedBox.appendChild(this.closest(\".to-do-item\"));\n\n this.classList.remove(\"fa-check-square\");\n this.classList.add(\"fa-undo-alt\");\n\n this.removeEventListener(\"click\", completeItem);\n this.addEventListener(\"click\", uncheckItem);\n\n const item = this.closest(\".to-do-item\").children[0].innerHTML;\n removeLocal(item, \"todo\");\n addToLocalStorage(item, \"completed\");\n}", "title": "" }, { "docid": "f6c6f8c166fad6ac0790fde241f5e258", "score": "0.6850604", "text": "function deleteTask(li) {\n let sure = confirm(\"Delete task?\");\n if (sure) li.parentElement.removeChild(li);\n}", "title": "" }, { "docid": "dd9cb21330343b11e330d554ee7ba382", "score": "0.68438065", "text": "function deleteTask() {\n form.removeChild(item);\n const dataLS = JSON.parse(localStorage.getItem('item.list'));\n if (id > -1) dataLS.splice(dataLS[id], 1);\n saveAndUpdateData(dataLS);\n }", "title": "" }, { "docid": "ea67d2b0801e9b9a72ac538e1186418f", "score": "0.6821414", "text": "function deleteToDoList(id) {\n // Update frequency status\n priorityStatus[toDoList[id].priority]--\n\n // Delete from todolist\n delete toDoList[id]\n\n // Hide modal\n $(`#modal-${id}`).modal('hide')\n\n // Render\n renderToDoList()\n return toDoList\n}", "title": "" }, { "docid": "d07e27534db6494be289b881ccc32ffd", "score": "0.6818753", "text": "function deleteCheck(e) {\r\n const item = e.target;\r\n const todoIndexText = item.parentElement.innerText;\r\n const todoIndex = taskList.findIndex(elem => elem['text'] === todoIndexText);\r\n if (item.classList[0] === 'delete-btn') {\r\n item.parentElement.remove();\r\n taskList.splice(todoIndex, 1);\r\n } else if (item.type === 'checkbox') {\r\n item.parentElement.querySelector('span').classList.toggle('completed');\r\n taskList[todoIndex].completed = taskList[todoIndex].completed === false;\r\n }\r\n localStorage.setItem(\"tasks\", JSON.stringify(taskList));\r\n}", "title": "" }, { "docid": "ce5c47e405e95e1424e4ba6f51024a5b", "score": "0.681353", "text": "function removeItem(e){\n if(e.target.classList.contains('delete')){ \n //görevi classa gömmek\n if(confirm('Are You Sure?')){\n var li = e.target.parentElement;\n itemList.removeChild(li);\n } // ul'de yani itemList'te eğer delete buttonuna tıklanmış önce teyit et, confirme olursa butonun bulunduğu parent yani li child ını kaldır.\n }\n}", "title": "" }, { "docid": "aecf696e409c0f86d5e4b5d7b7c48cb7", "score": "0.6813074", "text": "function deleteItem(event) {\n\tif(event.target.classList.contains(\"delete\")) {\n\t\tlet li = event.target.parentElement;\n\t\tul.removeChild(li);\n\t}\n}", "title": "" }, { "docid": "aee738c12ac122319949b8a9848c1edb", "score": "0.6805858", "text": "function deleteTodo(toDelete) {\n let deletedText = toDelete.previousElementSibling.innerText;\n let spliceStart = todoArray.indexOf(deletedText);\n toDelete.parentElement.remove();\n todoArray.splice(spliceStart, 1);\n listLength = listLength - 1;\n leftItems.innerText = listLength;\n}", "title": "" }, { "docid": "bbb37ae2861e65d8023661310c608170", "score": "0.68015856", "text": "function removeTask(e) {\n if (e.target.parentElement.classList.contains('list-item'))\n confirm('are u sure?')\n e.target.parentElement.remove()\n\n //remove from LS\n removeTaskLocalStorage(e.target.parentElement)\n}", "title": "" }, { "docid": "fdfd701fc421916bf54b0eef9f74377e", "score": "0.67974603", "text": "function deleteItem(pos) {\n todolist.splice(pos, 1);\n addItems();\n}", "title": "" }, { "docid": "5044273bbf4c8169b8b8d5b0019b2f1a", "score": "0.67965883", "text": "deleteItem(item){\n //get click event target id\n const targetID = item.parentElement.parentElement.parentElement.id;\n //if the click target has a X icon delete item\n if(item.className === 'fas fa-times'){\n this.showAlert(`News source removed from search`, 'alert-warning', targetID);\n item.parentElement.parentElement.remove();\n }\n}", "title": "" }, { "docid": "e0f16a3ec8c696dca08423ad767b9333", "score": "0.6795139", "text": "function deleteItem(e) {\n e.target.parentNode.remove();\n}", "title": "" }, { "docid": "63f42fc8f627fad1b2c11cf5e10ac35f", "score": "0.6770975", "text": "function completeItem(){\n var item=this.parentNode.parentNode; //li\n var parent=item.parentNode; //ul\n var id=parent.id;\n var value=item.innerText;\n if(id ==='todo'){\n data.todo.splice(data.todo.indexOf(value),1);\n data.completed.push(value);\n }\n else{\n data.completed.splice(data.completed.indexOf(value),1);\n data.todo.push(value);\n\n }\n\n \n var target = (id ==='todo') ? document.getElementById('completed'):document.getElementById('todo');\n parent.removeChild(item);\n target.insertBefore(item,target.childNodes[0]);\n objectUpdated();\n}", "title": "" }, { "docid": "62a61a571cfa13e6a9d1e6ec671380a3", "score": "0.6770192", "text": "function deleteItem(){ //delete item function\n li.style.display = \"none\"; //display text style to none\n items.splice(span, 1); //delete item from array\n }", "title": "" }, { "docid": "10cc23da156d1fc74dd7eb3f74293730", "score": "0.6768786", "text": "function ToDo({task, handleRemove}) {\n\n // remove selected todo\n const remove = () => handleRemove(task);\n\n return (\n <li>{task} <button onClick={remove}>X</button><br/>\n </li>\n );\n}", "title": "" }, { "docid": "4cf48aa0239dec53368a0daeecba5db3", "score": "0.6767506", "text": "function delItem(e){\n if(e.target.classList.contains('delete')){\n if(confirm('Are You Sure To Delete This Item ?')){\n var li = e.target.parentElement;\n itemList.removeChild(li);\n }\n }\n}", "title": "" }, { "docid": "86605273cb8c020908394c1edd1ba2fc", "score": "0.675702", "text": "function removeTodo(element){\n element.parentNode.parentNode.removeChild(element.parentNode); \n\n LIST[element.id].trash = true;\n}", "title": "" }, { "docid": "64af647046fc6567904bc7ee09dcd7f2", "score": "0.6754997", "text": "function addToDo() {\n\n let newToDoItem = $('#to-do-add-item').val();\n\n //Create html for item\n let newToDoListItem = $('<li class=\"mb-2\">');\n newToDoListItem.html(`${newToDoItem} <button type=\"button\" class=\"btn btn-outline-danger btn-sm ms-3 remove-to-do-button\"> Remove </button>`);\n //Append to list\n $('#to-do-list').append(newToDoListItem);\n //Clear value in input\n $('#to-do-add-item').val(\"\");\n\n saveToDos()\n}", "title": "" }, { "docid": "22f1550b651147d9575f5e753954a988", "score": "0.6753953", "text": "function cleanList() {\n \n // 1. Schritt: Suche nach Elementen in der <ul> mit data-done = true\n var taskList = document.querySelector(\"#tasklist\");\n var numberTodos = taskList.children.length;\n \n for(var i = 0; i < numberTodos; i++) {\n var done = taskList.children[i].dataset.done;\n \n if(done == \"true\") {\n firebasetools.removeContentItem(\"todos\", taskList.children[i].dataset.id, taskDeleted); \n }\n }\n \n}", "title": "" }, { "docid": "b60c8ad98131e0ce77b0cf0bda2d982f", "score": "0.6740622", "text": "function deleteTodo(pos) {\n //apartir da posição passada por parâmetro, remova o primeiro item\n todos.splice(pos, 1)\n renderTodos()\n saveToStorage()\n}", "title": "" }, { "docid": "a96dbad91e5358583d7f583e1ff1e0c7", "score": "0.6729695", "text": "function addToDo(toDo, id, done, trash){\n \n if(trash){ return; }\n \n const DONE = done ? CONFIRM : UNCHECK;\n const LINE = done ? STRIKE_OUT : \"\";\n \n const items = `\n <li class=\"items\">\n <i class=\"fa ${DONE} co\" job=\"complete\" id=\"${id}\"></i>\n <p class=\"text ${LINE}\">${toDo}</p>\n <i class=\"far fa-trash-alt de\" job=\"delete\" id =${id}></i>\n </li>\n `;\n \n const position = \"beforeend\";\n \n list.insertAdjacentHTML(position, items);\n}", "title": "" }, { "docid": "aee13a4f235fcb4da40a418e3641ee6b", "score": "0.6729511", "text": "function deleteTask() {\n var id = this.parentElement.getAttribute('id');\n var listitem = document.getElementById(id);\n listitem.remove();\n}", "title": "" }, { "docid": "836b9bad6ed1e4c2232d0f0ba27709f5", "score": "0.67238826", "text": "function removeTask(e) {\n\n if (e.target.parentElement.classList.contains('delete-item')) {\n // console.log(e.target);\n // Add confirm \n if (confirm('Are you sure? ')) {\n\n\n // Array.prototype.slice.call(arguments) is the old-fashioned way to convert an arguments into an array.\n\n // In ECMAScript 2015, you can use Array.from or the spread operator:\n\n // let args = Array.from(arguments);\n\n // let args = [...arguments];\n\n\n const index = Array.prototype.slice.call(e.target.parentElement.parentElement.parentElement.children).indexOf(e.target.parentElement.parentElement);\n\n // Remove from UL\n e.target.parentElement.parentElement.remove();\n\n // Remove from local Storage also\n removeFromLocalStorage(e.target.parentElement.parentElement, index);\n\n \n }\n }\n\n}", "title": "" }, { "docid": "1fdc99af7b6071c5ac1bb57a9c23c220", "score": "0.67192197", "text": "function deleteTask(id) {\r\n let indexOfItemForDeletion = toDos.findIndex((x) => x.id == id);\r\n toDos.splice(indexOfItemForDeletion, 1);\r\n refreshList(toDos);\r\n todosPending.textContent = toDos.length\r\n\r\n}", "title": "" }, { "docid": "8042149bbd5abcb957847e3cf37b4ee3", "score": "0.6707459", "text": "function addToDo(){\n//console.log(\"button clicked\");\n//get todo text\nlet todoText = $todo.value;\n$todo.value = \"\";\n\n//console.log(todoText);\n\n//make list item\nlet $newTodoItem = document.createElement(\"li\")\n$newTodoItem.innerHTML = `${todoText}<button onclick='done(event)' class='doneButton'>done</button> <button class='doneButton' onclick='deleteTask(event)'>delete</button>`;\n//add todo to list\n$list.append($newTodoItem);\n}", "title": "" }, { "docid": "940a7e93981712c352c2462139986bed", "score": "0.670513", "text": "function removeFunc(e) {\n let parentTodoContainer = e.parentNode,\n todoFromArr = parentTodoContainer.childNodes[[1]].innerHTML;\n\n for(let i = listArr.length - 1; i >= 0; --i) {\n if(listArr[i].title === todoFromArr) {\n listArr.splice(i, 1);\n }\n }\n e.parentNode.remove();\n}", "title": "" }, { "docid": "68dbbc9e68f269de96bd506aec4804b2", "score": "0.66893244", "text": "function addToDo(toDo, id, done, trash){\n \n if(trash){ return; }\n \n const DONE = done ? CHECK : UNCHECK;\n const LINE = done ? LINE_THROUGH : \"\";\n \n const item = `<li class=\"item\">\n <i class=\"fa ${DONE} co\" job=\"complete\" id=\"${id}\"></i>\n <span class=\"text ${LINE}\">${toDo}</span>\n <i class=\"fa fa-trash-o de float-right mr-4\" job=\"delete\" id=\"${id}\"></i>\n </li>\n `;\n \n const position = \"beforeend\";\n \n list.insertAdjacentHTML(position, item);\n}", "title": "" }, { "docid": "f9b951d732093b588175fe036be79352", "score": "0.66884196", "text": "function Delete(item) {\n let blur = document.getElementById(\"blur\");\n let pop_up = document.getElementById(\"pop-up-window_desc\");\n if (confirm(\"The current task would be deleted permanently!\")) {\n taskArraystr = localStorage.getItem(\"itemsJson\");\n taskArray = JSON.parse(taskArraystr);\n // Delete the clicked item in the list.\n taskArray.splice(item, 1);\n localStorage.setItem(\"itemsJson\", JSON.stringify(taskArray));\n SetnUpdate();\n blur.classList.toggle(\"active\");\n pop_up.classList.toggle(\"active\");\n }\n}", "title": "" }, { "docid": "053be40ef3ef6574a9b426e24f840e51", "score": "0.66875577", "text": "function deleteTask() {\n console.log(currentTodoIndex + '****************');\n currentTask.getListOfToDo().splice(currentTodoIndex, 1);\n getElement('write-todo')[currentTodoIndex].remove();\n var nextTodo = currentTodoIndex;\n if (currentTodoIndex > currentTask.getListOfToDo().length - 1) {\n currentTodoIndex = currentTodoIndex - 1;\n nextTodo = currentTodoIndex;\n }\n if (nextTodo != -1) {\n currentTodo = currentTask.getListOfToDo()[nextTodo];\n console.log(nextTodo);\n showNav(currentTodo);\n }\n else {\n closeRightSideWindow();\n }\n}", "title": "" }, { "docid": "a605eb5d86ddb5cbb69ebe99b4878660", "score": "0.6685137", "text": "function removeItemButton (idx) {\n var item = myShoppingList.items[idx];\n myShoppingList.removeItem(item);\n render();\n}", "title": "" }, { "docid": "7c9bccd59324ba357fb1663d8a4535be", "score": "0.6675908", "text": "function changeTodo(event){\r\n /* check if my target that i am clicking is the toggle-done */\r\n if(event.target.classList.contains('toggle-done')){\r\n event.target.parentElement.previousElementSibling.classList.toggle('done')\r\n }\r\n\r\n /* check if my target that i am clicking is the edit */\r\n if(event.target.classList.contains('edit')){\r\n /* id for specific task */\r\n const idForItem = event.target.parentElement.parentElement;\r\n\r\n /* save the text value of li insdie a variable before deleting the whole li */\r\n const text = event.target.parentElement.previousElementSibling.textContent;\r\n\r\n input.value = text;\r\n\r\n /* call the parent to remove a child from it */\r\n list.removeChild(idForItem)\r\n }\r\n\r\n /* check if my target that i am clicking has class of delete */\r\n if(event.target.classList.contains('delete')){\r\n\r\n /********************************DELETING FROM DOM */\r\n /* id for specific task */\r\n const idForItem = event.target.parentElement.parentElement;\r\n /* call the parent to remove a child from it */\r\n list.removeChild(idForItem)\r\n\r\n /********************************DELETING FROM lOCALSTORAGE */\r\n \r\n /* initializng the data structure */\r\n /* loading the data from database */\r\n const data = loadDataFromLocalStorage()\r\n \r\n const searchKey = event.target.parentElement.previousElementSibling.textContent;\r\n\r\n /* looping thought data to search for element */\r\n for(let i = 0; i < data.length; i++){\r\n if(data[i] === searchKey){\r\n console.log(data[i]);\r\n /* call splice method on the data structure */\r\n data.splice(i, 1)\r\n }\r\n }\r\n\r\n /* Save the changes to localstorage */\r\n localStorage.setItem('todos', JSON.stringify(data));\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "15d6db128ee0e8c91f1e43f982f99779", "score": "0.66560256", "text": "function ondeleteBtnClick(e) {\n const listItem = this.parentNode;\n const id = listItem.getAttribute('id');\n let list = listItem.parentNode;\n list.removeChild(listItem);\n\n comments.map((value, index) => {\n if (value.id == id) {\n comments.splice(index, 1);\n }\n })\n\n AddAllAmount();\n}", "title": "" }, { "docid": "0789e76c2ed3d68c6a9e7da2936c4414", "score": "0.6654789", "text": "function createDelete(li) {\n // const toDos = document.querySelectorAll('li')\n // toDos.forEach(function(todo) {\n let span = document.createElement('span')\n span.style.color = 'red'\n li.appendChild(span)\n\n let close = document.createTextNode(' \\u00D7')\n span.appendChild(close)\n\n span.addEventListener('click', function() {\n span.parentNode.remove()\n // })\n })\n}", "title": "" }, { "docid": "088d47ab2a6629e990cc09be946a3bc8", "score": "0.66515446", "text": "function deleteItem(id){\n let itemsToDelete = todoItems.filter(function(item){\n return item.id === id;\n });\n\n let index = todoItems.indexOf(itemsToDelete[zeros1]);\n todoItems.splice(index, 1);\n refreshMainPage();\n}", "title": "" }, { "docid": "a79d1c4bab66a9f2b0d0766d09946a76", "score": "0.66507673", "text": "function deleteTask(e) {\n if (e.target.classList.contains('del-task-btn')){\n var taskID = e.target.getAttribute('data-id');\n console.log(taskID);\n quickTodo.splice(taskID, 1);\n localStorage['quickToDoKey'] = JSON.stringify(quickTodo);\n showMyTasks();\n console.log('Task with ID= '+ taskID + 'Deleted Successfully');\n }\n}", "title": "" }, { "docid": "51a7aa4d31a1e14699ba182c1d107038", "score": "0.66467965", "text": "function addToDo(toDo, id, isDone, isTrash) {\n if (isTrash) return;\n\n const DONE = isDone ? 'done' : '';\n const todoElement = `<li class=\"todo__todoList ${DONE}\" id=\"${id}\">\n <div class=\"todoList-left\">\n <span>\n <i class=\"fas fa-check\"></i>\n </span>\n <p spellcheck=\"false\">${toDo}</p>\n </div>\n <div class=\"todoList-right\">\n <button class=\"todoListBtn btnDone\" id=\"todoListBtn--done\">\n <img src=\"img/iconCorrect.svg\" alt=\"\" />\n </button>\n <button class=\"todoListBtn btnEdit\" id=\"todoListBtn--edit\">\n <img src=\"img/iconEdit.svg\" alt=\"\" />\n </button>\n <button\n class=\"todoListBtn btnDelete\"\n id=\"todoListBtn--deleteRed\"\n >\n <img\n src=\"img/iconTrash--red.svg\"\n alt=\"\"\n class=\"iconTrash--red\"\n />\n </button>\n\n <button\n class=\"todoListBtn btnDone todoListBtn--doneBTN\"\n id=\"todoListBtn--notDone\"\n >\n <img src=\"img/iconWrong.svg\" alt=\"\" />\n </button>\n\n <button\n class=\"todoListBtn btnDelete todoListBtn--doneBTN\"\n id=\"todoListBtn--deleteWhite\"\n >\n <img\n src=\"img/iconTrash--white.svg\"\n alt=\"\"\n class=\"iconTrash--white\"\n />\n </button>\n </div>\n </li>`;\n todoLists.insertAdjacentHTML('beforeend', todoElement);\n}", "title": "" }, { "docid": "da9d1f1037588d4129bbc86f07173a2c", "score": "0.6645503", "text": "function deleteTodo(position) {\n todos.splice(position, 1);\n displayTodos();\n}", "title": "" }, { "docid": "d247b235307b81715bff3a0237b4a0f3", "score": "0.6643417", "text": "function removeTodo(e) {\n if (e.target.classList.contains('todo-cancel-btn')) {\n e.target.parentElement.remove();\n let checkin = store.getCheck();\n let todoArr = store.getTodo();\n todoArr.forEach(function(element, index) {\n checkin.forEach((check, inn) => {\n if (element === check.text) {\n checkin.splice(inn, 1);\n console.log(inn);\n if (checkin.length === 1) {\n checkin.pop();\n }\n }\n });\n });\n localStorage.setItem('check', JSON.stringify(checkin));\n removeTodoLs(e.target.parentElement);\n }\n}", "title": "" }, { "docid": "0f1267cf415b57b9422c84fa06d79b5f", "score": "0.664246", "text": "function deleteTaskList(event) {\n id--;\n myList.splice(currentIndex, 1);\n getElement('mylist')[currentIndex].remove();\n var nextTask = currentIndex;\n if (currentIndex > myList.length - 1) {\n currentIndex = currentIndex - 1;\n nextTask = currentIndex;\n }\n if (nextTask != -1) {\n currentTask = myList[nextTask];\n showTasks(currentTask);\n }\n}", "title": "" }, { "docid": "31dbe9f52e216f44eecd37cdc144bbee", "score": "0.6642289", "text": "function deleteItem() {\n\t\tvar $tick = $(this).parents(\".ticket\");\n\t\t$(this).parent().remove();\n\t\tupdateItems.call($tick[0]);\n\t}", "title": "" }, { "docid": "0e861cfd11ea7d133dd1efaf88b29272", "score": "0.66413283", "text": "undoTransaction() {\n // remove from list\n let index = this.list.items.indexOf(this.itemToAdd);\n this.list.items.splice(index, 1);\n }", "title": "" }, { "docid": "f7af0e75b01db100ca33c65eeb12dcc4", "score": "0.6638574", "text": "function destroyTodoItem(e) {\n // note this.findResourceFromNode - it takes the node that triggered the event,\n // and recursively searches within the markup for it's parent resource. Specifically,\n // it's looking for a parent node with the attributes fjs-resource & fjs-id to identify\n // and load a single fjs resource.\n var todo = this.findResourceFromNode(e.currentTarget);\n \n // FlatJS.Resource.prototype.remove removes the item & any bound nodes from markup.\n todo.remove();\n // Since we changed the markup, we need to reload our component's model (this.fjsData)\n // by calling this.assembleFjsData()\n this.assembleFjsData();\n this.publish('todos-updated', [this.fjsData.todosList]);\n }", "title": "" }, { "docid": "6a6d56d7cc5e59aaefb70d90493fa666", "score": "0.6638111", "text": "function clearTodoList() {\n todoList.remove(); \n}", "title": "" }, { "docid": "f89fffbac4c83e34d745affd05ff5110", "score": "0.6630798", "text": "function deleteTodo (position) {\n todos.splice(position, 1);\n displayTodos();\n}", "title": "" }, { "docid": "74beb4f24d660d3cc75ced0102453527", "score": "0.6626477", "text": "deleteTaskFromList(event) {\n\n let idToDelete = event.target.name;\n let todoTasks = this.todoTasks;\n\n \n /* Method 1 - Finding the index of the task to be deleted\n and deleting it using the below command\n */\n /*\n let todoTaskIndex;\n for(let i=0; i<todoTasks.length; i++) {\n if(idToDelete === todoTasks[i].id) {\n todoTaskIndex = i;\n }\n }\n */\n // * Comment the below line if you're using one of the two approaches given below\n //todoTasks.splice(todoTaskIndex, 1);\n\n /*\n * Un-Comment any one of the two below methods\n * which are used to directly splice or delete\n * the element from the array based on the index.\n * We're finding the index by using the findIndex()\n * function available in JavaScript\n */\n\n // * Method 2\n /*\n todoTasks.splice(\n todoTasks.findIndex(function(todoTask) {\n return todoTask.id === idToDelete;\n })\n , 1\n );\n */\n\n // * Method 3\n todoTasks.splice(todoTasks.findIndex(todoTask => todoTask.id === idToDelete), 1);\n }", "title": "" }, { "docid": "eb6d725b77f7b2908b99dbab6163ef2e", "score": "0.6622492", "text": "function deleteItem(item) {\r\n\titem.parentElement.removeChild(item);\r\n\tLIST[item.id].trash = true;\r\n\tlocalStorage.setItem('TODO', JSON.stringify(LIST));\r\n}", "title": "" } ]
8bfaeb2db0a0afdc656c6de66e877089
Turn the current state into a pattern based on player params: letter === player X or O
[ { "docid": "94d12f35258f3cf27cc175608b01ab8f", "score": "0.55366725", "text": "function pattern(board, letter) {\n var pattern = [];\n board.forEach((element, index) => {\n if (element === letter) {\n pattern.push(index);\n }\n });\n return pattern;\n}", "title": "" } ]
[ { "docid": "63bf92d884508c853bf7b3291832a536", "score": "0.61657095", "text": "function mapper(currentValue){\r\n if (currentValue === \"1\"){\r\n letter = \"E\";\r\n }\r\n\r\n else if (currentValue === \"2\"){\r\n letter = \"A\";\r\n }\r\n\r\n else if (currentValue === \"3\"){\r\n letter = \"R\";\r\n }\r\n\r\n else if (currentValue === \"4\"){\r\n letter = \"I\";\r\n }\r\n\r\n else if (currentValue === \"5\"){\r\n letter = \"O\";\r\n }\r\n\r\n else if (currentValue === \"6\"){\r\n letter = \"T\";\r\n }\r\n\r\n else if (currentValue === \"7\"){\r\n letter = \"N\";\r\n }\r\n\r\n else if (currentValue === \"8\"){\r\n letter = \"S\";\r\n }\r\n\r\n else if (currentValue === \"9\"){\r\n letter = \"L\";\r\n }\r\n\r\n else if (currentValue === \"1,2\"){\r\n letter = \"C\";\r\n }\r\n\r\n else if (currentValue === \"2,3\"){\r\n letter = \"U\";\r\n }\r\n\r\n else if (currentValue === \"1,4\"){\r\n letter = \"D\";\r\n }\r\n\r\n else if (currentValue === \"2,5\"){\r\n letter = \"P\";\r\n }\r\n\r\n else if (currentValue === \"3,6\"){\r\n letter = \"M\";\r\n }\r\n\r\n else if (currentValue === \"4,5\"){\r\n letter = \"H\";\r\n }\r\n\r\n else if (currentValue === \"5,6\"){\r\n letter = \"G\";\r\n }\r\n\r\n else if (currentValue === \"4,7\"){\r\n letter = \"B\";\r\n }\r\n\r\n else if (currentValue === \"5,8\"){\r\n letter = \"F\";\r\n }\r\n\r\n else if (currentValue === \"6,9\"){\r\n letter = \"Y\";\r\n }\r\n\r\n else if (currentValue === \"7,8\"){\r\n letter = \"W\";\r\n }\r\n\r\n else if (currentValue === \"8,9\"){\r\n letter = \"K\";\r\n }\r\n\r\n else if (currentValue === \"7,5\"){\r\n letter = \"V\";\r\n }\r\n\r\n else if (currentValue === \"9,5\"){\r\n letter = \"X\";\r\n }\r\n\r\n else if (currentValue === \"1,5\"){\r\n letter = \"Z\";\r\n }\r\n\r\n else if (currentValue === \"3,5\"){\r\n letter = \"J\";\r\n }\r\n\r\n else if (currentValue === \"1,2,5\"){\r\n letter = \"Q\";\r\n }\r\n\r\n else if (currentValue === \"1,1\"){\r\n letter = \"1\";\r\n }\r\n\r\n else if (currentValue === \"2,2\"){\r\n letter = \"2\";\r\n }\r\n\r\n else if (currentValue === \"3,3\"){\r\n letter = \"3\";\r\n }\r\n\r\n else if (currentValue === \"4,4\"){\r\n letter = \"4\";\r\n }\r\n\r\n else if (currentValue === \"5,5\"){\r\n letter = \"5\";\r\n }\r\n\r\n else if (currentValue === \"6,6\"){\r\n letter = \"6\";\r\n }\r\n\r\n else if (currentValue === \"7,7\"){\r\n letter = \"7\";\r\n }\r\n\r\n else if (currentValue === \"8,8\"){\r\n letter = \"8\";\r\n }\r\n\r\n else if (currentValue === \"9,9\"){\r\n letter = \"9\";\r\n }\r\n\r\n else if (currentValue === \"0\"){\r\n letter = \" \";\r\n }\r\n\r\n else if (currentValue === \"0,0\"){\r\n letter = \"0\";\r\n }\r\n\r\n else if(currentValue === \"9,6,5,4\"){\r\n letter = \"\\n\";\r\n }\r\n\r\n else if(currentValue === \"backspace\"){\r\n letter = \"backspace\";\r\n }\r\n\r\n else {\r\n letter = \"\";\r\n }\r\n return letter;\r\n}", "title": "" }, { "docid": "743e0f3b3c7df5575c35d66d2d40ea50", "score": "0.5950912", "text": "function holdToCharTransition() {\n let requiredParticles = lettersLib.totalRequiredParticles(CHAR_PATTERN_WORDS)\n let wordsInRows = lettersLib.placeWordsInRows(CHAR_PATTERN_WORDS, MAX_CHARS_PER_ROW)\n let destinationsAndTargets = lettersLib.calcLetterParticlesDestAndTargets(wordsInRows, canvasWidth, canvasHeight)\n\n if (holdPatternParticles.length > requiredParticles) {\n for(let i = 0; i < requiredParticles; i++) {\n let transferringParticle = holdPatternParticles.pop()\n let coords = {\n x: transferringParticle.coords.x,\n y: transferringParticle.coords.y,\n x0: transferringParticle.coords.x,\n y0: transferringParticle.coords.y,\n x1: destinationsAndTargets[i].x1,\n y1: destinationsAndTargets[i].y1\n }\n\n let speed = HOLD_SPEED * 4\n let distMoved = 0\n let pointsAt = destinationsAndTargets[i].pointsAt\n charPatternParticles.push(new CharPatternParticle(coords, speed, distMoved, pointsAt))\n }\n\n }\n}", "title": "" }, { "docid": "4d8dcf3fa972dd92128fea393eb58697", "score": "0.58389986", "text": "function updateState(e) {\n let state = \"\";\n var ch = e.data.toLowerCase();\n if (ch >= \"a\" && ch <= \"z\") {\n console.log(\"updateState: valid char: \", ch);\n stateCounter++;\n if (stateCounter == 3) {\n stateCounter = 0;\n state = \"win\";\n console.log(state);\n }\n }\n return state;\n }", "title": "" }, { "docid": "a10bd081456e87acc5ef19c43633c904", "score": "0.5790554", "text": "function _switchPlayers(player) {\n return player === 'X' ? 'O' : 'X';\n }", "title": "" }, { "docid": "6d30cb60c5d17d60b83df8e3f5f9e167", "score": "0.5754406", "text": "function fillBlanks(word, puzzleState, letter) {\n if(isCorrectGuess(word, letter)){\n for (var i = 0; i < word.length; i++) {\n if(word[i] === letter) {\n puzzleState[i] = letter;\n } \n }\n }\n return puzzleState;\n}", "title": "" }, { "docid": "80329915b8bd8702a854cf27c9568f0c", "score": "0.572531", "text": "function switchPlayer(player) {\n return player === \"X\" ? \"O\" : \"X\";\n }", "title": "" }, { "docid": "9de65ecd2f34631abf43ec5d57c26827", "score": "0.5698365", "text": "handleLetterClick(i, letter) {\n if (this.props.round > letter.roundPlaced) {\n return;\n }\n const newLetter = {\n type: \"board\",\n location: i,\n letter: letter.letter,\n points: letter.points,\n roundPlaced: letter.roundPlaced\n };\n if(this.props.selectedLetter !== newLetter) {\n this.props.changeSelectedLetter(newLetter);\n }\n }", "title": "" }, { "docid": "003f52b6a62cf9aa1c15d4959d757df6", "score": "0.56941235", "text": "function switch_player(player) {\n if (player === \"X\") {\n player = \"O\";\n } else {\n player = \"X\"\n }\n return player;\n}", "title": "" }, { "docid": "4ed236cd4f7354af0d54ba1102f715ef", "score": "0.5660405", "text": "function translateToLetter(activeButtons, num) {\n let char;\n switch(activeButtons.join(' '))\n {\n\n case '0': num ? char = '1' : char = 'A'; return char;\n case '0 2': num ? char = '2' : char = 'B'; return char;\n case '0 1': num ? char = '3' : char = 'C'; return char;\n case '0 1 3': num ? char = '4' : char = 'D'; return char;\n case '0 3': num ? char = '5' : char = 'E'; return char;\n case '0 1 2': num ? char = '6' : char = 'F'; return char;\n case '0 1 2 3': num ? char = '7' : char = 'G'; return char;\n case '0 2 3': num ? char = '8' : char = 'H'; return char;\n case '1 2': num ? char = '9' : char = 'I'; return char;\n case '1 2 3': num ? char = '0' : char = 'J'; return char;\n case '0 4': num ? char = ' ' : char = 'K'; return char;\n case '0 2 4': num ? char = ' ' : char = 'L'; return char;\n case '0 1 4': num ? char = ' ' : char = 'M'; return char;\n case '0 1 3 4': num ? char = ' ' : char = 'N'; return char;\n case '0 3 4': num ? char = ' ' : char = 'O'; return char;\n case '0 1 2 4': num ? char = ' ' : char = 'P'; return char;\n case '0 1 2 3 4': num ? char = ' ' : char = 'Q'; return char;\n case '0 2 3 4': num ? char = ' ' : char = 'R'; return char;\n case '1 2 4': num ? char = ' ' : char = 'S'; return char;\n case '1 2 3 4': num ? char = ' ' : char = 'T'; return char;\n case '0 4 5': num ? char = ' ' : char = 'U'; return char;\n case '0 2 4 5': num ? char = ' ' : char = 'V'; return char;\n case '1 2 3 5': num ? char = ' ' : char = 'W'; return char;\n case '0 1 4 5': num ? char = ' ' : char = 'X'; return char;\n case '0 1 3 4 5': num ? char = ' ' : char = 'Y'; return char;\n case '0 3 4 5': num ? char = ' ' : char = 'Z'; return char;\n default: return ' ';\n\n }\n}", "title": "" }, { "docid": "3aaf195d603c642b768de21fd75c0d05", "score": "0.5657372", "text": "function moveLetters(s){\n\tvar alphabet = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"];\n\tvar arr = s.split('');\n\tfor (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < alphabet.length; j++) {\n\n \tif(arr[i] === alphabet[j]){\n\n\t\tswitch(s[i]){\n\t\tcase 'c': case 'o': arr[i] = alphabet[j-1]; break;\n\t\tcase 'd': case 'e': arr[i] = alphabet[0]; break;\n case 'a': arr[i] = alphabet[21]; break;\n case 'z': arr[i] = alphabet[8]; break;\n case 'u': case 'i': arr[i] = alphabet[j-5]; break;\n case 'r': arr[i] = alphabet[0]; break;\n case 's': arr[i] = alphabet[1]; break;\n case 't': arr[i] = alphabet[2]; break;\n case 'v': arr[i] = alphabet[3]; break;\n case 'w': arr[i] = alphabet[4]; break;\n case 'x': arr[i] = alphabet[5]; break;\n case 'y': arr[i] = alphabet[6]; break;\n default: arr[i] = alphabet[j+9]; break; \n\t}\n \t}\n }\n\t}\n\treturn arr;\n\t\n}", "title": "" }, { "docid": "6ccc5902a3d6518e060333f3f66f0592", "score": "0.56560296", "text": "function switchPlayers() {\n //if the current player X is false, then it switches to O, or it stays X\n if (currentPlayer === \"X\") {\n currentPlayer = \"O\";\n } else {\n currentPlayer = \"X\";\n }\n}", "title": "" }, { "docid": "e68304abec6acf821a8b04bae681705d", "score": "0.56316394", "text": "function translateKeyDown(currentKey){\r\n switch(currentKey){\r\n case \"z\":\r\n return \"c\";\r\n case \"s\":\r\n return \"c#\";\r\n case \"x\":\r\n return \"d\";\r\n case \"d\":\r\n return \"d#\";\r\n case \"c\":\r\n return \"e\";\r\n case \"v\":\r\n return \"f\";\r\n case \"g\":\r\n return \"f#\";\r\n case \"b\":\r\n return \"g\";\r\n case \"h\":\r\n return \"g#\";\r\n case \"n\":\r\n return \"a\";\r\n case \"j\":\r\n return \"a#\";\r\n case \"m\":\r\n return \"b\";\r\n case \"q\":\r\n return \"c3\";\r\n case \"2\":\r\n return \"c#3\";\r\n case \"w\":\r\n return \"d3\";\r\n case \"3\":\r\n return \"d#3\";\r\n case \"e\":\r\n return \"e3\";\r\n case \"r\":\r\n return \"f3\";\r\n case \"5\":\r\n return \"f#3\";\r\n case \"t\":\r\n return \"g3\";\r\n case \"6\":\r\n return \"g#3\";\r\n case \"y\":\r\n return \"a3\";\r\n case \"7\":\r\n return \"a#3\";\r\n case \"u\":\r\n return \"b3\";\r\n default:\r\n\r\n console.log(\"a key was pressed\");\r\n return \"random key\";\r\n }\r\n}", "title": "" }, { "docid": "5c0611b3700a394c29f531f86e24f9b0", "score": "0.55881643", "text": "resetState(num, input) {\n const preChar = this.message.charAt(this.pos - 2).toLowerCase(); // Gets the character right before the current position\n\n if (alphabet[preChar] !== undefined) {\n this.characterArray = preChar;\n } else if (vowelDictionary[input] !== undefined) {\n this.characterArray = 'vowels';\n }\n\n this.state = num; // sets the next case state.\n if (this.state == 1) // If first, go directly to the first case.\n {\n this.firstCase(input);\n } else // If second...\n {\n this.secondCase(input); // go to second case.\n }\n }", "title": "" }, { "docid": "24561fb8d3c0584a5519f066bc321710", "score": "0.558316", "text": "function changePlayerTurn(){\n //get the Alphabet\n const ALPHABET = Object.keys(Game.players)\n //get the id of whos turn it is\n const currentPlayerId = Game.playersTurn\n //get which direction the turn it's going\n const currentDirection = Game.turnDirection\n //move the curent player's turn one position in which direction it's supposed to move in.\n //first, get the index of the player's turn in the alphabet\n const index = ALPHABET.indexOf(currentPlayerId)\n //change that index by the direction number\n let newIndex = index + currentDirection\n //if index is less then 0, set it to the idex of the last player's id\n const keys = Object.keys(Game.players)\n const numPlayers = keys.length\n if(newIndex < 0){\n //get number of players playing\n newIndex = ALPHABET.length - 1\n //get the index of the last player's id\n }\n //if ...\n if(newIndex >= ALPHABET.length){\n newIndex = 0\n }\n //then get the id of the new index in the alphabet array\n const newPlayersTurn = ALPHABET[newIndex]\n Game.playersTurn = newPlayersTurn\n //change the Game.playerTurn to the next player's turn\n}", "title": "" }, { "docid": "ddd4489c8f888c87d1bb41be762ef5f2", "score": "0.5550231", "text": "makeGuess(char) {\n if (this.status === 'playing') {\n const leter = char.toLowerCase();\n if (this.guessedLetters.includes(leter)) {\n console.log('This Letter Has Already Been Guessed');\n } else {\n if (!this.word.includes(leter)) {\n this.guessedLetters = [...this.guessedLetters, leter];\n this.guesses -= 1;\n } else {\n this.guessedLetters = [...this.guessedLetters, leter];\n }\n }\n }\n game1.presentStatus();\n }", "title": "" }, { "docid": "8994933a889ee6b97ac885c33d16e1f4", "score": "0.55397934", "text": "checkWinner() { /* TODO : this is a bit complicated because the game designer decided to store the guessedLetter as a string, but you will manage :-) */ }", "title": "" }, { "docid": "4a56b711829ff240889ac9be025b510a", "score": "0.553618", "text": "handleInteraction(letterKey) {\n const selectedLetter = letterKey.innerText;\n const chosenPhrase = new Phrase(this.activePhrase.phrase);\n if (chosenPhrase.checkLetter(selectedLetter) === true) {\n chosenPhrase.showMatchedLetter(selectedLetter);\n letterKey.classList.add('chosen');\n } else {\n this.removeLife();\n letterKey.classList.add('wrong');\n }\n\n letterKey.disabled = true;\n const check = this.checkForWin();\n this.gameOver(check);\n }", "title": "" }, { "docid": "45645e214dac8360e9534601345a27a8", "score": "0.552993", "text": "drawLetters () {\n const alphabet = {\n A: 9, B: 2, C: 2, D: 4, E: 12, F: 2, G: 3, H: 2, I: 9, J: 1, K: 1, L: 4, M: 2, N: 6, O: 8, P: 2, Q: 1, R: 6, S: 4, T: 6, U: 4, V: 2, W: 2, X: 1, Y: 2, Z: 1\n };\n\n const hand = [];\n\n const onlyLetters = Object.keys(alphabet);\n\n //ASSIGNMENT REQ: The letters should be randomly drawn from a pool of letters\n //Randomization adapted from from w3resource explanation of random approaches in JS: https://www.w3resource.com/javascript-exercises/javascript-array-exercise-35.php\n const randomItem = items => items[Math.floor(Math.random() * items.length)];\n //close random_item\n let tile = undefined;\n //ASSIGNMENT REQ: Each string should contain exactly one letter\n while (hand.length < 10) {\n tile = (randomItem(onlyLetters));\n\n if (alphabet[tile] > 0) {\n alphabet[tile] -= 1;\n hand.push(tile);\n }//close if\n }//close while loop used to make hand\n return hand;\n }", "title": "" }, { "docid": "a78552b33057ed7dda13fbfd73c66ac4", "score": "0.55182135", "text": "function specialSqBack(character, aryPos) {\n var grid = backgroundImg.grid\n \n /*Determine the appropriate action*/\n if (grid[aryPos] == \"right\") { //Directional change - Right - go Up\n character.dx = backgroundImg.gridCol;\n }\n else if (grid[aryPos] == \"up\") { //Directional change - Up - go left\n character.dx = 1; \n }\n else if (grid[aryPos] == \"left\") { //Directional change - Left - go down\n character.dx = -backgroundImg.gridCol; \n }\n else if (grid[aryPos] == \"down\") { //Directional change - Down - go right\n character.dx = -1; \n }\n else if (grid[aryPos] == \"card\") { //Card\n return \"card\";\n }\n else if (grid[aryPos] == \"trap\") { //Card\n return \"trap\";\n }\n \n return \"none\";\n}", "title": "" }, { "docid": "92fa8d348da58065442f91fd70e29591", "score": "0.5512717", "text": "nextStageState(horizontalMove, verticalMove, turn, r_anti) {\n return this.fallSpeed.match({\n nothing: () => {\n let speed = 0.02,\n nextHand = Ex.clone(this.hand),\n l_counter,\n nextNexts = [Stage.turnQuarks(this.nexts[0], turn)].concat(this.nexts.slice(1)),\n nextBoard = Ex.clone(this.board),\n fallSpeed = this.fallSpeed;\n\n if (horizontalMove === -1) {\n if (this.hand[0] === 0) {\n nextHand[0] = 0;\n } else if (this.isFill(this.hand[0] - 1, Math.floor(this.hand[1])) || this.isFill(this.hand[0] + -1, Math.floor(this.hand[1]) + 1)) {\n nextHand[0] = this.hand[0];\n } else {\n nextHand[0] = this.hand[0] - 1;\n }\n } else if (horizontalMove === 1) {\n if (this.hand[0] === 4) {\n nextHand[0] = 4;\n } else if (this.isFill(this.hand[0] + 2, Math.ceil(this.hand[1])) || this.isFill(this.hand[0] + 2, Math.ceil(this.hand[1]) + 1)) {\n nextHand[0] = this.hand[0];\n } else {\n nextHand[0] = this.hand[0] + 1;\n }\n } else {\n nextHand[0] = this.hand[0];\n }\n\n if (this.isLand()) {\n nextHand[1] = this.hand[1];\n l_counter = this.landCounter + 1 + verticalMove * 2;\n if (l_counter >= 30) {\n l_counter = 0;\n nextBoard[nextHand[0]][Math.floor(nextHand[1])] = M_Maybe.unit(nextNexts[0][0]);\n nextBoard[nextHand[0] + 1][Math.floor(nextHand[1])] = M_Maybe.unit(nextNexts[0][1]);\n nextBoard[nextHand[0]][Math.floor(nextHand[1] + 1)] = M_Maybe.unit(nextNexts[0][2]);\n nextBoard[nextHand[0] + 1][Math.floor(nextHand[1] + 1)] = M_Maybe.unit(nextNexts[0][3]);\n\n fallSpeed = M_Maybe.Just(0);\n }\n } else {\n nextHand[1] = this.hand[1] + speed * (11 * verticalMove + 1);\n l_counter = this.landCounter;\n }\n return new Stage(this.x, this.y, this.width, this.height, nextNexts, nextBoard, nextHand, l_counter, 0, fallSpeed, 0, this.score, 0, this.receivedAntiquarks + r_anti, 0);\n },\n just: (speed) => {\n let nextFallDistance,\n nextFallSpeed,\n nextNexts = Ex.clone(this.nexts),\n nextBoard = Ex.clone(this.board),\n blanks = this.blanks,\n clears = this.clears,\n clearCounter = this.clearCounter,\n score = this.score,\n chain = this.chain,\n receivedAntiquarks = this.receivedAntiquarks,\n sendAntiquarks = 0;\n const acceleration = 0.0098;\n\n if (blanks.length > 0) {\n nextFallSpeed = this.fallSpeed.map(x => x + acceleration);\n nextFallDistance = this.fallDistance + speed;\n while (nextFallDistance >= 1) {\n nextFallDistance--;\n nextBoard = this.board.map((column, x) =>\n blanks.some(bl => bl[0] === x) ? [M_Maybe.Nothing()].concat(column.filter((_, idx) => idx !== blanks.filter(bl => bl[0] === x)[0][1])) : column);\n }\n } else {\n if (clears.length > 0) {\n clearCounter++;\n if (clearCounter >= 30) {\n let clearQuarks = clears.map(clrs => clrs.del).reduce((a, b) => a.concat(b)),\n plusScore = clears.map(clrs => clrs.point).reduce((a, b) => a + b, 0) * clears.length * (chain + 1);\n clearQuarks.forEach(qPos => {\n nextBoard[qPos[0]][qPos[1]] = M_Maybe.Nothing();\n });\n score += plusScore;\n sendAntiquarks = Math.floor(plusScore / 5000);\n chain++;\n clearCounter = 0;\n }\n nextFallSpeed = M_Maybe.Just(0);\n nextFallDistance = 0;\n } else if (receivedAntiquarks > 0) {\n let fallAntiquarksNum = (receivedAntiquarks > 12) ? 12 : receivedAntiquarks,\n fallAntiquarks = Ex.shuffle(Ex.repeatedly(() => M_Maybe.Just(Quark.getRandomQuark().antiQuark()), fallAntiquarksNum)\n .concat(Ex.repeatedly(M_Maybe.Nothing, 12)).slice(0, 12));\n receivedAntiquarks -= fallAntiquarksNum;\n fallAntiquarks.forEach((aq, num) => {\n this.board[num % 6][Math.floor(num / 6)] = aq;\n });\n nextFallSpeed = M_Maybe.Just(0);\n nextFallDistance = 0;\n } else {\n nextFallSpeed = M_Maybe.Nothing();\n nextFallDistance = 0;\n nextNexts = this.nexts.slice(1).concat([Quark.getRandomNext()]);\n chain = 0;\n }\n }\n return new Stage(this.x, this.y, this.width, this.height, nextNexts, nextBoard, [2, 0], 0, nextFallDistance, nextFallSpeed, clearCounter, score, chain, receivedAntiquarks + r_anti, sendAntiquarks);\n }\n })\n }", "title": "" }, { "docid": "96f6a9a0bd8f939b43068f37eadcf0b9", "score": "0.54775417", "text": "handleInteraction(button){\n const selectedLetter = button.innerText;\n //disable the letter in the keyboard after it's selected\n\n //if letter is not in phrase, remove a life\n if(this.activePhrase.checkLetter(selectedLetter) === -1){\n if(!button.disabled){\n button.disabled = true;\n button.classList.add('wrong');\n this.removeLife();\n }\n }\n else{\n //if letter is in phrase, show it in phrase board\n button.disabled = true;\n button.classList.add('chosen');\n this.activePhrase.showMatchedLetter(selectedLetter);\n // for every correct letter, check if leads to win\n const win = this.checkForWin();\n if(win){\n //if they won, give the letter time to finish flashing, then show win screen\n setTimeout(()=>this.gameOver('win'), 500);\n }\n\n }\n }", "title": "" }, { "docid": "d5898689d32bdad25a754fefb596d8e1", "score": "0.5476265", "text": "function choosePlayer()\n{\n var text = \"\";\n var possible = \"OX\";\n\n text = possible.charAt(Math.floor(Math.random() * possible.length));\n\n return player=text;\n}", "title": "" }, { "docid": "0903f6ec1322d7469cb2a4159b025bfd", "score": "0.54690486", "text": "function player() {\n return (turn % 2) ? 'O' : 'X';\n}", "title": "" }, { "docid": "a0ef25c4bc3c1afa663e6fff2ce3bc35", "score": "0.5465982", "text": "function formatPuzzle(puzzleLetter) {\r\n // Sets global variable to the parameter value\r\n currentLetter = puzzleLetter;\r\n // Removes current colors\r\n for (var i = 0; i < allLetters.length; i++) {\r\n allLetters[i].style.backgroundColor = \"\";\r\n }\r\n // Remove the highlighting from current clues\r\n acrossClue.style.color = \"\";\r\n downClue.style.color = \"\";\r\n // \r\n}", "title": "" }, { "docid": "a73c115594f76013ccea75b9146c4d25", "score": "0.54639083", "text": "function takenIndex(player){\n if(player === 'W'){\n return 1;\n }else{\n return 26;\n }\n }", "title": "" }, { "docid": "a73c115594f76013ccea75b9146c4d25", "score": "0.54639083", "text": "function takenIndex(player){\n if(player === 'W'){\n return 1;\n }else{\n return 26;\n }\n }", "title": "" }, { "docid": "fba89a7f2e8dc1313bd049cb46963040", "score": "0.5455322", "text": "function Letter(char) {\n console.log(char)\n this.character = char;\n this.isGuessed = false;\n //this function checks whether to display true character or blank space\n this.toString = function () {\n if (this.isGuessed == true) {\n console.log(this.character)\n }\n else console.log(\"_\")\n }\n //check if character input is correct\n this.isCorrect = function () {\n if (this.input === this.character) {\n //check this line too\n this.isGuessed = true\n }\n }\n}", "title": "" }, { "docid": "dcb602df335cbeb0a18021e0894acbeb", "score": "0.5442251", "text": "function player() {\n if (turn % 2 === 0) {\n return 'X';\n } else {\n return 'O';\n }\n}", "title": "" }, { "docid": "e3df0eb70fb7fc4d413a7041498404e0", "score": "0.54372966", "text": "function switchPlayer() {\n\tif(player == \"X\"){\n\t\tplayer = \"O\";\n\t}\n\telse{\n\t\tplayer = \"X\";\n\t}\n}", "title": "" }, { "docid": "596d060f04961315539060a8b18538bd", "score": "0.54216903", "text": "function getNextState(s, player, x, y, p, q, c) {\n var newState = s.map(function(row) { return row.slice(0); });\n newState[y][x] = player; // place piece\n newState = rotateState(newState, p, q, c);\n return newState;\n }", "title": "" }, { "docid": "4744efe9f02163f0c5a03c4216a04b94", "score": "0.54031533", "text": "function computerTurn(elem)//elem to tri: same result\n { \n pattern = /^X||^O/;// equail to \"\".\n //var ab =elem.nextElementSibling;\n for (var i=0; i< elem.length; i++){ \n if (pattern.test(elem.value)){ ///???\n\n elem.style.backgroundColor = \"green\";\n elem.innerHTML = \"O\"; \n break;\n } \n //code here\n }\n determineWinner(elem);\n }", "title": "" }, { "docid": "289089989c644095ac2a9be2511dba0d", "score": "0.54021", "text": "guessLetter(x) {\n // If they match then set the object's guessed value to true and call the toString method.\n if (x == this.letter.toLowerCase()) {\n this.guessed = true;\n this.toString();\n }\n }", "title": "" }, { "docid": "6c1cb503733c61bc2ad4e2e22e2c9aa4", "score": "0.54019904", "text": "function player() {\n return (turn % 2 === 0) ? \"X\" : \"O\"\n}", "title": "" }, { "docid": "6044ae7b973446e6f2f4b7caf4f2dd37", "score": "0.54003674", "text": "updateGameState(letter, position) {\r\n this.gameState[position] = letter;\r\n }", "title": "" }, { "docid": "f9e1baa66f95215835e6f7525a4a34ba", "score": "0.5381648", "text": "prepareNextTurn() {\n if (this.turn === 1) {\n this.turn = 2;\n } else {\n this.turn = 1;\n }\n if (this.disc === Othello.WHITE) {\n this.disc = Othello.BLACK;\n } else {\n this.disc = Othello.WHITE;\n }\n }", "title": "" }, { "docid": "edee7582fd461f0fc54bfd5ee048b47f", "score": "0.5375555", "text": "function addPlayerToMap() {\n if (room == 1) {\n currentRoom = room1fullstringWithoutPlayer\n } else if (room == 2) {\n currentRoom = room2fullstringWithoutPlayer\n } else if (room == 3) {\n currentRoom = room3fullstringWithoutPlayer\n } else if (room == 4) { \n currentRoom = room4fullstringWithoutPlayer\n } else if (room == 5) {\n currentRoom = room5fullstringWithoutPlayer\n } else if (room == 6) {\n currentRoom = room6fullstringWithoutPlayer\n } else if (room == 7) {\n currentRoom = room7fullstringWithoutPlayer\n } else if (room == 8) {\n currentRoom = room8fullstringWithoutPlayer\n } else if (room == 9) {\n currentRoom = room9fullstringWithoutPlayer\n }\n playerIndex = 10*playery + playerx\n fullstringWithPlayer = currentRoom.substring(0,playerIndex)+'p'+currentRoom.substring(playerIndex+1)\n}", "title": "" }, { "docid": "34c9c041a30cf4c9dca1ed2f6b6a0e15", "score": "0.5372373", "text": "handleInteraction(letter) {\n let ignoreKey;\n const disabledKeys = document.querySelectorAll('button[disabled]');\n disabledKeys.forEach(character => character.textContent === letter?ignoreKey = true : false);\n if(ignoreKey) return;\n let audio = new Audio('sounds/buttonActivation.mp3');\n audio.volume = 0.3;\n audio.play();\n if (this.activePhrase.checkLetter(letter)) {\n onscreenKeys.forEach((character) => {\n if (character.textContent == letter) {\n character.classList.add(\"chosen\");\n character.disabled = true;\n this.activePhrase.showMatchedLetter(letter);\n this.checkForWin() ? this.gameOver() : false;\n }\n });\n } else {\n onscreenKeys.forEach((character) => {\n if (character.textContent == letter) {\n character.classList.add(\"wrong\");\n character.disabled = true;\n this.removeLife();\n }\n });\n }\n }", "title": "" }, { "docid": "9c656de30b67186e182575f4bcb83dd7", "score": "0.536968", "text": "function updatePlayer(){\n if(currentPlayer == \"Player 1\"){ \n currentPlayer = \"Player 2\";\n }\n else if(currentPlayer == \"Player 2\"){\n currentPlayer = \"Player 1\";\n }\n\n if(currentShape == \"x\"){\n currentShape = \"o\";\n }\n else if(currentShape == \"o\"){\n currentShape = \"x\";\n }\n}", "title": "" }, { "docid": "e65071c38d211d47e9a96000d831259e", "score": "0.53653884", "text": "function Letter (value) { //Letter constructor \n this.letter = value;\n this.guessed = false;\n\n this.toString = function() { //This function will determine the spaces and the blanks\n if(this.letter === \" \"){\n this.guessed = true;\n return \" \";\n } else {\n if (this.guessed === false){ //This determines our guess true of false and return a blank and underline _\n return \"_\" ;\n } else {\n return this.letter;\n }\n }\n }\n\n this.guess = function (guess) { \n if(guess === this.letter) {\n this.guessed = true;\n }\n }\n}", "title": "" }, { "docid": "b696bd9eecdeb9dd890576702a03fed6", "score": "0.53605044", "text": "printGameState(){\n const currentWord = this.state.currentWord.split(\"\");\n const pastGuesses = this.state.pastGuesses;\n let hintString = \"\";\n // for each letter in the target word\n for (let i = 0; i < currentWord.length; i++) {\n let found = false;\n // loop through the pastGuesses\n for (let j = 0; j < pastGuesses.length; j++) {\n // and check each element of past guesses to see if it matches the letter\n if (currentWord[i] === pastGuesses[j]) {\n found = true;\n }\n }\n // display first letter of word as upper case\n if (found && i === 0) {\n hintString += currentWord[i].toUpperCase();\n hintString += \" \"; \n } else if (found) {\n hintString += currentWord[i];\n hintString += \" \";\n } else {\n hintString += \"_ \";\n }\n }\n return hintString;\n }", "title": "" }, { "docid": "0cefd70cdf94f0bca4d0e71f3593919b", "score": "0.5358794", "text": "addCorrectLetter(position) {\n // 1. push to the clicked letters\n // 2. add the letter to the guessedLetter string (uppercase!)\n // 3. alert the user if they won the game !\n }", "title": "" }, { "docid": "77bcbca5a0b2dcda50b221fa39587533", "score": "0.5357725", "text": "generateLetter() {\n if (this.state.call < this.state.practiceChain.length * 4) {\n let num = Math.floor((Math.random() * this.state.practiceChain.length));\n if (this.state.practiceChain[num].letter === this.state.previous || this.state.practiceChain[num].call >= 3) return this.generateLetter()\n else {\n this.state.practiceChain[num].call = this.state.practiceChain[num].call + 1\n this.setState({ previous: this.state.practiceChain[num].letter });\n this.setState({ call: this.state.call + 1 });\n this.setState({ letter: this.state.practiceChain[num].letter });\n }\n }\n else {\n this.toggleModal('You have reached the end!')\n }\n }", "title": "" }, { "docid": "115cfd76106f9a151943d26da215a6a6", "score": "0.53552645", "text": "move() {\n let nextStateName = this.currentState.transitions[this.possibleMove];\n\n this.currentState = fa.states[nextStateName];\n\n let nomalizedTransition = this.possibleMove.replace('[', '').replace(']', '').trim().split(',');\n\n let writeChar = nomalizedTransition[1];\n this.tape = this.tape.substr(0, this.currentCharacterIndex) + writeChar + this.tape.substr(this.currentCharacterIndex + writeChar.length);\n\n let moveDirection = nomalizedTransition[2];\n if (moveDirection.toLowerCase() === 'r') this.currentCharacterIndex++;\n else if (moveDirection.toLowerCase() === 'l') this.currentCharacterIndex--;\n else throw new InvalidTuringMachineError();\n }", "title": "" }, { "docid": "f05142ca11d8d3f9e3f301b77b8bcf17", "score": "0.5352375", "text": "function rnaSwap(letter) {\n return aminoMap[letter];\n}", "title": "" }, { "docid": "406e8e7b897162f4fe3dd76ae53621d6", "score": "0.53402394", "text": "function wordConvert(letter) {\n if (letter === \"r\") return \"Rock\";\n if (letter === \"p\") return \"Paper\";\n return \"Scissors\";\n}", "title": "" }, { "docid": "8a43a74a083519a7d3e57bc9287db244", "score": "0.53395647", "text": "showMatchedLetter(letter) {\n\t\t\tfor (let i = 0; i < phraseDivUl.length; i++) {\n\t\t\t\tif (letter == phraseDivUl[i].textContent) {\n\t\t\t\t\tphraseDivUl[i].className = 'show letter animate__animated animate__flipInY';\n\t\t\t\t\tphraseDivUl[i].style.setProperty('--animate-duration', '0.7s');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2fb4998c017f1a37bb41e1e53e0a26bb", "score": "0.5338397", "text": "function getPlayer(input){\n switch(input){\n case(draw):\n return \"draw\";\n case(willNum):\n return \"will\";\n case(lucasNum):\n return \"lucas\";\n }\n}", "title": "" }, { "docid": "2a4ba9e0badc64e5634f9913f9442653", "score": "0.5327572", "text": "handleInteraction(letter) {\n \n /*if the player matched a letter, the checkforwin method will be called\n and the letter will be shown by calling showedMatchedLetter()\n */\n if (phrase.checkLetter(letter) === true) {\n\n phrase.showMatchedLetter(letter);\n this.checkForWin();\n\n } //if the player didn't match a letter, the game will remove a heart life by calling removelife method and add 1 to the missed property\n else {\n this.removeLife();\n\n }\n this.gameOver();\n }", "title": "" }, { "docid": "666fdf2926afed7d369ad483b89f6f4c", "score": "0.53224003", "text": "function updateWordStatus(playerGuess) {\n for(let i = 0; i < word.length; i++){ //Loop to set word state to proper character (a-z or _)\n if(word[i] === playerGuess) { //Check guess for match in word\n wordState[i] = word[i]; //If match then set wordstate to letter from word\n } else if (/[A-Z]/.test(wordState[i])) { //Dont wipe out letters already guessed\n } else { //Set unguessed places to underscore\n wordState[i] = '_';\n }\n }\n if(word.search(playerGuess) === -1) { //Search for guess\n guessesRemaining--; //Decrement remaining guesses\n }\n}", "title": "" }, { "docid": "186a310764910322f7c153efad2f292c", "score": "0.53219885", "text": "function Letter() {\n // This comes from word.js\n // The guessed letter and the object that contains all the letters of the movie\n // and the isVisited object to keep track of the guessed letters\n this.isGuessed = function (guessedLetter, objLetters, isVisited) {\n // Set the default return variables\n const underscore = '_';\n const space = ' ';\n let concatString = '';\n\n // Loop over the movie object (each letter) and find the matching key/values\n Object.keys(objLetters).forEach((key) => {\n // Check if the value = to the user's guessed letter\n if (objLetters[key] === guessedLetter) {\n // Append the guessed letter\n concatString += ` ${guessedLetter}`;\n // Set the isVisited object guessed letter to true\n isVisited[objLetters[key]] = true;\n } else if (objLetters[key] === ' ') {\n // Append a space\n concatString += ` ${space}`;\n } else if (isVisited[objLetters[key]]) {\n // If the guessed letter is in isVisited, append it\n concatString += ` ${objLetters[key]}`;\n } else {\n // Append an Underscore\n concatString += ` ${underscore}`;\n }\n });\n\n // Display message if guess is correct or not\n if (isVisited[guessedLetter]) {\n console.log('CORRECT!');\n } else {\n console.log('INCORRECT!');\n }\n\n // Return the concatenated string\n return concatString;\n }; // End function this is guessed\n} // End Letter Constructor", "title": "" }, { "docid": "d325f262347edb2d88656815c8f9f884", "score": "0.5317224", "text": "nextPlayer() {\n return this.state.xIsNext ? 'X' : 'O';\n }", "title": "" }, { "docid": "14bd8a2a9d9c70626635731e7875fa0c", "score": "0.53146815", "text": "function generateAnAce() { //\n var randomNumber = 1; // this one generates a number from 1\n var randomPattern = Math.floor(Math.random()*4);\n var randomPatternInSuits = \"\";\n // this one generates a number from 0 to 3 // 0 as spades, 1 as hearts, 2 as clubs, 3 as diamonds\n switch (randomPattern) {\n case 0:\n randomPatternInSuits = \"S\";\n break;\n case 1:\n randomPatternInSuits = \"H\";\n break;\n case 2:\n randomPatternInSuits = \"C\";\n break;\n case 3:\n randomPatternInSuits = \"D\";\n break;\n default:\n alert(\"Your careless ass missed something!\");\n console.log(randomPattern);\n }\n var finalPattern = randomNumber + randomPatternInSuits;\n return finalPattern;\n}", "title": "" }, { "docid": "0c3e68e5852cd11c4b4137578a14e8ea", "score": "0.53140885", "text": "function changePlayer() {\n\t\tif (player == 'b') {\n \t\tplayer = 'w';\n \t} else {\n \t\tplayer = 'b';\n \t}\n\t}", "title": "" }, { "docid": "1356735d42ad26a5479cc6c868f0165d", "score": "0.5311423", "text": "function makeMove(board, letter, move){\r\n board[move] = letter;\r\n // theGameBoard(board);\r\n}", "title": "" }, { "docid": "61f0f389616a3b54ba4877bf8183f5f8", "score": "0.5310761", "text": "function transformState(state) {\n switch (state.toLowerCase()) {\n case 'andaman': { }\n case 'nicobar': { }\n case 'andaman and nicobar': { }\n case 'andaman and nicobar islands': {\n return 'port blair';\n }\n case 'andhra': { }\n case 'andhra pradesh': {\n return 'hyderabad';\n }\n case 'arunachal pradesh': {\n return 'itanagar';\n }\n case 'assam': {\n return 'guwahati';\n }\n case 'bihar': {\n return 'patna';\n }\n case 'chhattisgarh': {\n return 'raipur';\n }\n case 'dadra': { }\n case 'dadra and nagar haveli': {\n return 'silvassa';\n }\n case 'gujarat': {\n return 'ahmedabad';\n }\n case 'haryana': {\n return 'faridabad';\n }\n case 'himachal': { }\n case 'himachal pradesh': {\n return 'shimla';\n }\n case 'kashmir': { }\n case 'jammu and kashmir': {\n return 'srinagar';\n }\n case 'jharkhand': {\n return 'ranchi';\n }\n case 'karnataka': {\n return 'bengaluru';\n }\n case 'kerala': {\n return 'trivandrum';\n }\n case 'madhya pradesh': {\n return 'bhopal';\n }\n case 'maharashtra': {\n return 'mumbai';\n }\n case 'manipur': {\n return 'imphal';\n }\n case 'meghalaya': {\n return 'shillong';\n }\n case 'mizoram': {\n return 'aizwal';\n }\n case 'nagaland': {\n return 'kohima';\n }\n case 'orissa': {\n return 'bhubhaneswar';\n }\n case 'odisha': {\n return 'cuttack';\n }\n case 'puducherry': {\n return 'pondicherry';\n }\n case 'punjab': {\n return 'amritsar';\n }\n case 'rajasthan': {\n return 'jaipur';\n }\n case 'sikkim': {\n return 'gangtok';\n }\n case 'tamilnadu': { }\n case 'tamil nadu': {\n return 'chennai';\n }\n case 'telangana': {\n return 'warangal';\n }\n case 'tripura': {\n return 'agartala';\n }\n case 'uttar pradesh': {\n return 'lucknow';\n }\n case 'uttarakhand': {\n return 'nainital';\n }\n case 'west bengal': {\n return 'kolkata';\n }\n default: {\n return state;\n }\n }\n}", "title": "" }, { "docid": "798fb67e4f91d7a9108ef1e312f15a18", "score": "0.53052795", "text": "function changePlayer() {\n if (currentPlayer == \"x\") {\n currentPlayer = \"o\";\n } else if (currentPlayer == \"o\") {\n currentPlayer = \"x\";\n }\n }", "title": "" }, { "docid": "92ab5c7fc982e49e54285c95b6234e3f", "score": "0.52994627", "text": "handleInteraction(letter) {\n const keys = document.querySelectorAll('.key');\n if (this.currentPhrase.checkLetter(letter)) {\n //loop and add class\n for (let i = 0; i < keys.length; i++) {\n if (letter === keys[i].textContent) {\n keys[i].disabled = true;\n keys[i].classList.add('chosen');\n }\n }\n this.currentPhrase.showMatchedLetter(letter);\n this.checkForWin();\n } else {\n for (let i = 0; i < keys.length; i++) {\n if (letter === keys[i].textContent) {\n keys[i].disabled = true;\n keys[i].classList.add('wrong');\n }\n }\n this.removeLife();\n\n }\n }", "title": "" }, { "docid": "3114c0e0c18c70f45ee178cf13ec3566", "score": "0.5295279", "text": "handleInput(playerMove) {\n switch (playerMove) {\n case 'left':\n case 'a':\n if (this.x >= 100) {this.newMove = \"left\";}\n break;\n\n case 'up':\n case 'w':\n if (this.y >= 0) {this.newMove = \"up\";}\n break;\n\n case 'right':\n case 'd':\n if (this.x < 400) {this.newMove = \"right\";}\n break;\n\n case 'down':\n case 's':\n if (this.y < 380) {this.newMove = \"down\";}\n break;\n }\n }", "title": "" }, { "docid": "dfb6122f410eddba8ccd801ac7e8367e", "score": "0.52891344", "text": "function letterChanges(str) {}", "title": "" }, { "docid": "4638c5cb90322f69c9a8121e112c20aa", "score": "0.52878714", "text": "getNextState(action) {\n let nextState = {};\n // if player sticks, state stays the same\n if (action === 0) {\n nextState = Object.assign({}, this.state);\n }\n // if player hits, update state based on the new card\n else if (action === 1) {\n nextState = this.env.playerHit(this.state);\n }\n return nextState;\n}", "title": "" }, { "docid": "a02644bf8cdbfc7e6528361e3604bcd0", "score": "0.5286692", "text": "function chooseLetter() {\n if (currentGameAlphabet.length < 1) { // avoid situation when all letters from alphabet will be used, when it happen use full alphabet again\n currentGameAlphabet = alphabetOnStart;\n }\n var ltrIndicator = Math.floor(Math.random() * currentGameAlphabet.length);\n roundLetter = currentGameAlphabet[ltrIndicator];\n currentGameAlphabet.splice(ltrIndicator, 1); // remove chosen letter from current game alphabet to avoid repeating letters\n var htmlLetter = \"<span class='showLetter'>\" + roundLetter + \"</span>\";\n $('#startInit').html(htmlLetter);\n}", "title": "" }, { "docid": "8e923f46226497cc1c79eea1ed7606e6", "score": "0.52848756", "text": "function convertToWord(letter) {\r\n if (letter === \"r\") {\r\n return \"Rock\";\r\n }\r\n if (letter === \"p\") {\r\n return \"Paper\";\r\n }\r\n else {\r\n return \"Scissors\";\r\n }\r\n}", "title": "" }, { "docid": "7fdf527613651cc20595551937e13d0c", "score": "0.52772576", "text": "firstCase(input) {\n if (vowelDictionary[input] !== undefined) // If the user tpyed a vowel, check to see which vowel\n {\n this.characterArray = 'vowels';\n this.printCharacter(this.setCharacter(vowelDictionary[input]), 1);\n }\n if (input == 'v') {\n this.printCharacter(alphabet.special.kataV, this.state);\n } else if (alphabet[input] !== undefined) // If the user typed a letter, check which letter to set the stateIndex to it's array position\n {\n if (input == 'n') // n is a special case; it has both a single character, a vowel array, and a y array.\n {\n this.setArray('hiraN', 'kataN');\n this.printCharacter(alphabet[input][this.arrayName], this.state);\n }\n\n this.characterArray = input; // Set the array's pointer to be to the input just entered\n this.state = 2; // and set the state to 2 so we move onto the second case\n } else if (specialDictionary[input] !== undefined) {\n this.characterArray = specialDictionary[input]; // Set the array's pointer to be to the input just entered\n this.state = 2;\n } else if (punctuationDictionary[input] !== undefined) {\n this.printCharacter(alphabet.punctuation[punctuationDictionary[input]], this.state);\n } else {\n this.state = 1;\n }\n }", "title": "" }, { "docid": "b10af1a4bede102d8d5982a9dd57535f", "score": "0.52753574", "text": "setCharacterAlpha() {\n this.winnerRoom_character_north.alpha = arguments[0];\n this.winnerRoom_character_east.alpha = arguments[1];\n this.winnerRoom_character_south.alpha = arguments[2];\n this.winnerRoom_character_west.alpha = arguments[3];\n }", "title": "" }, { "docid": "c8cc27c0dfd73c7c04836fefd8e0281d", "score": "0.5274957", "text": "function AIPlay() {\n a1 = gameState.board[0];\n a2 = gameState.board[1];\n a3 = gameState.board[2];\n b1 = gameState.board[3];\n b2 = gameState.board[4];\n b3 = gameState.board[5];\n c1 = gameState.board[6];\n c2 = gameState.board[7];\n c3 = gameState.board[8];\n\n if (\n a1 === null &&\n ((a3 === \"x\" && a2 === \"x\") ||\n (c3 === \"x\" && b2 === \"x\") ||\n (c1 === \"x\" && b1 === \"x\"))\n ) {\n $(\"#0\").text(\"o\");\n gameState.board[$(\"#0\").attr(\"id\")] = \"o\";\n } else {\n if (\n a2 === null &&\n ((a1 === \"x\" && a3 === \"x\") || (c2 === \"x\" && b2 === \"x\"))\n ) {\n $(\"#1\").text(\"o\");\n gameState.board[$(\"#1\").attr(\"id\")] = \"o\";\n } else {\n if (\n a3 === null &&\n ((a1 === \"x\" && a2 === \"x\") ||\n (c1 === \"x\" && b2 === \"x\") ||\n (c3 === \"x\" && b3 === \"x\"))\n ) {\n $(\"#2\").text(\"o\");\n gameState.board[$(\"#2\").attr(\"id\")] = \"o\";\n } else {\n if (\n c3 === null &&\n ((c1 === \"x\" && c2 === \"x\") ||\n (a1 === \"x\" && b2 === \"x\") ||\n (a3 === \"x\" && b3 === \"x\"))\n ) {\n $(\"#8\").text(\"o\");\n gameState.board[$(\"#8\").attr(\"id\")] = \"o\";\n } else {\n if (\n c1 === null &&\n ((c3 === \"x\" && c2 === \"x\") ||\n (a3 === \"x\" && b2 === \"x\") ||\n (a1 === \"x\" && b1 === \"x\"))\n ) {\n $(\"#6\").text(\"o\");\n gameState.board[$(\"#6\").attr(\"id\")] = \"o\";\n } else {\n if (\n c2 === null &&\n ((c3 === \"x\" && c1 === \"x\") || (a2 === \"x\" && b2 === \"x\"))\n ) {\n $(\"#7\").text(\"o\");\n gameState.board[$(\"#7\").attr(\"id\")] = \"o\";\n } else {\n if (\n b1 === null &&\n ((b3 === \"x\" && b2 === \"x\") || (a1 === \"x\" && c1 === \"x\"))\n ) {\n $(\"#3\").text(\"o\");\n gameState.board[$(\"#3\").attr(\"id\")] = \"o\";\n } else {\n if (\n b3 === null &&\n ((a3 === \"x\" && c3 === \"x\") || (b2 === \"x\" && b1 === \"x\"))\n ) {\n $(\"#5\").text(\"o\");\n gameState.board[$(\"#5\").attr(\"id\")] = \"o\";\n } else {\n if (\n b2 === null &&\n ((a3 === \"x\" && c1 === \"x\") ||\n (c3 === \"x\" && a1 === \"x\") ||\n (b3 === \"x\" && b1 === \"x\") ||\n (c2 === \"x\" && a2 === \"x\"))\n ) {\n $(\"#4\").text(\"o\");\n gameState.board[$(\"#4\").attr(\"id\")] = \"o\";\n } else {\n // IF NO OPP TO BLOCK A WIN, THEN PLAY IN ONE OF THESE SQUARES\n if (b2 === null) {\n $(\"#4\").text(\"o\");\n gameState.board[$(\"#4\").attr(\"id\")] = \"o\";\n } else {\n if (a1 === null) {\n $(\"#0\").text(\"o\");\n gameState.board[$(\"#0\").attr(\"id\")] = \"o\";\n } else {\n if (c3 === null) {\n $(\"#8\").text(\"o\");\n gameState.board[$(\"#8\").attr(\"id\")] = \"o\";\n } else {\n if (c2 === null) {\n $(\"#7\").text(\"o\");\n gameState.board[$(\"#7\").attr(\"id\")] = \"o\";\n } else {\n if (b1 === null) {\n $(\"#3\").text(\"o\");\n gameState.board[$(\"#3\").attr(\"id\")] = \"o\";\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "7eef2afcceb5b1fa10723e5ab5be3d99", "score": "0.52695465", "text": "function Letter(char) {\n this.char=char\n this.isGuessed=false\n}", "title": "" }, { "docid": "2ce598586bad7e123322b7883ba1f538", "score": "0.5269472", "text": "function houseTest00() {\n\tlet s = '\"a a b c\" \"d d e c\" \"f g e h\"'; console.log(getRandomLetterMapping(s)); console.log('_____\\n', s, '\\n', getLetterSwapEncoding(s));\n\n}", "title": "" }, { "docid": "9ab5b88a90912344b6c2eb61ee738f78", "score": "0.5259889", "text": "function cardGameTest09() {\n\tlet state = {\n\t\tpl1: { hand: [1, 2, 3, 4, 5], trick: [[6], [7, 8, 9]] },\n\t\tpl2: { hand: [11, 12, 13, 14, 15], trick: [[16], [17, 18, 19]] },\n\t};\n\tlet areaItems = makeAreasKrieg(dTable);\n\tpresentState1(state, areaItems);\n}", "title": "" }, { "docid": "c4e02aebff3a7c6900c7a1940db876ac", "score": "0.5258358", "text": "function shiftLetter() {\n\t\t$currentLetter\n\t\t\t.removeClass('current')\n\t\t\t.addClass('done');\n\n\t\tif (0 === $currentLetter.next().length) {\n\t\t\tloadCard(randomCard());\n\t\t} else {\n\t\t\t$currentLetter = $currentLetter.next()\n\t\t\t\t.addClass('current');\n\t\t}\n\t}", "title": "" }, { "docid": "80d9ec00190cecfddd8b65cece667739", "score": "0.52509254", "text": "function char(c) {\n const inState = new NFAState();\n const outState = new NFAState({\n accepting: true,\n });\n\n return new NFA(\n inState.addTransition(c, outState),\n outState\n );\n}", "title": "" }, { "docid": "ff251f708ea6167890bcdba1c01ee94d", "score": "0.5247443", "text": "function turn() {\n if (g_record.length % 2) {\n return JGO.WHITE\n }\n return JGO.BLACK\n } // turn()", "title": "" }, { "docid": "6e684c70dd0f393408f56a62342e0d54", "score": "0.524475", "text": "function drawMazeByPattern(player = {}, maze = [[String]], movePossibility = [[Number]], move = [Number]) {\n\n //mengambil status menggunakan fungsi maze\n // status == -1 berarti selesai\n // status == 0 berarti tetap lurus\n // status == 1 berarti ganti arah sesuai move[]\n let status = turnAround(player, maze, move);\n if(status == -1) {\n printMaze(maze);\n return;\n } else {\n if(status == 1) {\n //ambil move yang berikutnya\n move = getNextMove(movePossibility, move);\n } else {\n\n //increment posisi player berdasarkan arah\n player.x += move[1];\n player.y += move[0];\n\n //buat pola di maze berdasarkan posisi player dengan \" \"\n maze[player.y][player.x] = \" \";\n }\n\n // panggil fungsi ini sampai status == -1\n drawMazeByPattern(player, maze, movePossibility, move);\n }\n}", "title": "" }, { "docid": "ae707700b233b9faa36eb6ec5a779688", "score": "0.5244701", "text": "function handleClick(event){\n let charName = \"\";\n let charInitiative=\"\"\n let input = state.textInput;\n let check = true;\n //edge case will o wisp\n if(input.substring(0,4).toLowerCase() === \"will\"){\n charName = input;\n check = false;\n }\n let inputArr = input.split(\" \");\n for(let i = 0; i < inputArr.length; ++i){\n let inputStr = inputArr[i];\n if(inputStr.charCodeAt(0) >= 48 && inputStr.charCodeAt(0) <= 57){\n for(let k = 0; k < inputStr.length; ++k){\n if(inputStr.charCodeAt(k) >= 48 && inputStr.charCodeAt(k) <= 57){\n charInitiative = charInitiative + inputStr.charAt(k);\n }\n }\n continue;\n }\n else {\n if(i > 0){\n charName = charName + \" \";\n }\n for(let j = 0; j < inputStr.length; ++j){\n if(check && inputStr.charCodeAt(j) !== 10){\n charName = charName + inputStr.charAt(j);\n }\n }\n }\n }\n // passes input back to a function defined in the character engine\n dispatchers.AddInfo(charName, charInitiative, \"\");\n setState((currentState)=>{\n return{\n ...currentState,\n textInput: \"\"\n }\n });\n}", "title": "" }, { "docid": "09712de044e24c23f7b7a68842525fdc", "score": "0.52443904", "text": "increaseTurnInPattern(){\n this.turnInPattern++;\n }", "title": "" }, { "docid": "8cad4d8be4fca08514ed8400d2d83399", "score": "0.52391887", "text": "function whoseMove(lastPlayer, win) {\n //coding and coding..\n if (lastPlayer === 'white') {\n return win === true ? 'white' : 'black'\n } else {\n return win === true ? 'black' : 'white'\n }\n\n}", "title": "" }, { "docid": "d01d60c1147684d4419ced7832bf1fb4", "score": "0.5235689", "text": "function convertToWord(letter) {\n if(letter === 'r') return \"Rock\";\n if(letter === 'p') return \"Paper\";\n return \"Scissors\";\n}", "title": "" }, { "docid": "9bea6dbe5c4bda2f7f7696102b39d3e0", "score": "0.52346987", "text": "function play() {\n\tvar input = document.getElementById(\"move_text_id\")\n\t//Check if game has been started\n\tif(this.started == false){;\n\t\talert(\"The game has not started.\");\n\t}\n\telse{\n\t\t//Check if input is reasonable\n\t\tif(input.value == \"A1\" || input.value == \"A2\" || input.value == \"A3\" || input.value == \"B1\" || input.value == \"B2\" || input.value == \"B3\" || input.value == \"C1\" || input.value == \"C2\" || input.value == \"C3\"){\n\t\t\t\tvar entry = ((input.value).charCodeAt(0)-65)*3 + (input.value).charCodeAt(1) - 49;\n\t\t\t\t//See if spot already taken\n\t\t\t\tif (board_state[entry] == -1){\n\t\t\t\t\tboard_state[entry] = this.turn;\n\t\t\t\t\t//Print board\n\t\t\t\t\tvar board = [\"A1\",\"A2\",\"A3\",\"B1\",\"B2\",\"B3\",\"C1\",\"C2\",\"C3\"];\n\t\t\t\t\tfor(var i=0; i< board.length; i++) { // Do not change\n\t\t\t var space = document.getElementById(board[i]);\n\t\t\t\t\t\t\tif (board_state[i] == 1){\n\t\t\t\t\t\t\t\tspace.innerHTML = \"X\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (board_state[i] == 0 ){\n\t\t\t\t\t\t\t\tspace.innerHTML = \"O\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\tspace.innerHTML = board[i];\n\t\t\t\t\t\t\t}\n\t\t\t }\n\n\t\t\t\t\t//Check for Winner\n\t\t\t\t\tvar won = false;\n\t\t\t\t\tvar check = entry;\n\t\t\t\t\tvar count1 = 0;\n\t\t\t\t\tvar count2 = 0;\n\t\t\t\t\tvar count3 = 0;\n\t\t\t\t\t//Vertical win\n\t\t\t\t\tfor(var i = 0; i < 2; i++){\n\t\t\t\t\t\tcheck = check - 3;\n\t\t\t\t\t\tif(check < 0){\n\t\t\t\t\t\t\tcheck = check + 9;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(board_state[check] == this.turn){\n\t\t\t\t\t\t\tcount1++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//Horizontal win\n\t\t\t\t\tif(entry > 5){\n\t\t\t\t\t\tcheck = 6;\n\t\t\t\t\t}\n\t\t\t\t\telse if(entry > 2){\n\t\t\t\t\t\tcheck = 3;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck = 0;\n\t\t\t\t\t}\n\t\t\t\t\tfor(var i = 0; i < 3; i++){\n\t\t\t\t\t\tif(board_state[check] == this.turn){\n\t\t\t\t\t\t\tcount2++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcheck ++\n\t\t\t\t\t}\n\t\t\t\t\t//Diagonal Win\n\t\t\t\t\tcheck = entry\n\t\t\t\t\tif (check == 0 || check == 4 || check == 8){\n\t\t\t\t\t\tfor(var i = 0; i < 2; i++){\n\t\t\t\t\t\t\tcheck += 4\n\t\t\t\t\t\t\tif(check > 8){\n\t\t\t\t\t\t\t\tcheck = check - 12\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(board_state[check] == this.turn){\n\t\t\t\t\t\t\t\tcount3++\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\tif(count3 != 2){\n\t\t\t\t\t\tcount3 = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (check == 2 || check == 4 || check == 6){\n\t\t\t\t\t\tfor(var i = 0; i < 2; i++){\n\t\t\t\t\t\t\tcheck += 2;\n\t\t\t\t\t\t\tif(check > 7){\n\t\t\t\t\t\t\t\tcheck = check - 6;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(board_state[check] == this.turn){\n\t\t\t\t\t\t\t\tcount3++\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//See if won in any way\n\t\t\t\t\tif (count1 == 2 || count2 == 3 || count3 == 2){\n\t\t\t\t\t\twon = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Update turn\n\t\t\t\t\tvar turnInfo = document.getElementById(\"turn_info\")\n\t\t\t\t\tif (!won){\n\t\t\t\t\t\tthis.turn = !this.turn\n\t\t\t\t\t\tif (this.turn == 0){\n\t\t\t\t\t\t\tturnInfo.innerHTML = \"Turn for: O\"\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tturnInfo.innerHTML = \"Turn for: X\"\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tif (this.turn == 1){\n\t\t\t\t\t\t\talert(\"X (\" + document.getElementById(\"player1_id\").value + \") is the winner!\")\n\t\t\t\t\t\t\treset_play()\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\talert(\"O (\" + document.getElementById(\"player2_id\").value + \") is the winner!\")\n\t\t\t\t\t\t\treset_play()\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\talert(\"Someone has already gone in that spot, so it is not a valid move.\")\n\t\t\t\t}\n\t\t}\n\t\telse{\n\t\t\talert(\"That is not a valid move.\")\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8b308dcb2dcb921f5b89fa7f27adbb5b", "score": "0.5232674", "text": "function renderState(s, p, r) {\n $s('#turn').innerHTML = p === 0 ? 'Red' : 'Blue';\n $s('#what').innerHTML = r === 0 ? 'place' : 'rotate';\n\n for (var yi = 0; yi < 6; yi++) {\n for (var xi = 0; xi < 6; xi++) {\n var cn = 'color-square blank';\n if (s[yi][xi] === 0) cn += ' red';\n else if (s[yi][xi] === 1) cn += ' blue';\n $s('#sq'+xi+'-'+yi).className = cn;\n }\n }\n }", "title": "" }, { "docid": "be807fc6ae786e946e5dd734bec13f9e", "score": "0.5227569", "text": "function draw(difficulty) {\n var letterSets = {\n easy: \"rstlne\",\n medium: \"etaoinshrdlu\",\n hard: \"abcdefghijklmnopqrstuvwxyz\"\n }\n var letters = (letterSets[difficulty]).split('');\n return letters[Math.floor(Math.random()*letters.length)];\n}", "title": "" }, { "docid": "ed076c628b32df21810347ee9d6b6256", "score": "0.5225921", "text": "checkLetter(playerInput) {\n let counter = 0\n this.phrase.forEach( char => {\n if (char === playerInput) {\n this.showMatchedLetter(char);\n } else {\n counter += 1;\n }\n });\n return counter;\n }", "title": "" }, { "docid": "d0b38951d4b99cb6e404d68ddbaab95e", "score": "0.52249175", "text": "function char(c) {\n var inState = new NFAState();\n var outState = new NFAState({\n accepting: true\n });\n\n return new NFA(inState.addTransition(c, outState), outState);\n}", "title": "" }, { "docid": "5489c3ae9e2e611eea167d2b4c457369", "score": "0.5223847", "text": "function letterConvertPicture(letter) {\n switch (letter) {\n case \"k\": return \"<img src=\\\"killer.png\\\">\";\n case \"h\": return \"<img src=\\\"hero.png\\\">\";\n case \"o\": return \"<img src=\\\"obstacle.png\\\">\";\n }\n}", "title": "" }, { "docid": "37e7b37ad41f363f4ab22f08e9f5d3b1", "score": "0.5221575", "text": "get getPuzzle() {\r\n let puzzle = ''\r\n //5/27/2019 this loop will check to see if are any guessed letters that match the letters in the word/sentence to be guessed. if there is a match the letter in the\r\n //sentence will be displayed, if not then the unguessed letter will remain as a *.\r\n this.word.forEach((letter) => {\r\n if (this.guessedLetters.includes(letter) || letter === ' ') {\r\n puzzle = puzzle + letter\r\n } else {\r\n puzzle = puzzle + '*'\r\n }\r\n })\r\n \r\n return puzzle\r\n }", "title": "" }, { "docid": "664d6a024afcb4efc3cdf24805f79309", "score": "0.52170676", "text": "function convertBacKToWord(letter){\n let gameItems= {\n 'r':'rock',\n 'p':'paper',\n 's':'scissors'\n } \n// sreate array from string\n// map for each char find the corresponding word\n return letter.split('').map(items => gameItems[items]);\n \n}", "title": "" }, { "docid": "75b8980f6c7dd475b2de90a619959665", "score": "0.5210923", "text": "function calculateMovementOptions(board, f, player) {\n var patterns = {\n knight: [[1, 0], [0, 1], [-1, 0], [0, -1]],\n king: [[1, 0], [0, 1], [-1, 0], [0, -1], [1, 1], [-1, -1], [1, -1], [-1, 1]],\n thief: [[1, 1], [-1, -1], [1, -1], [-1, 1]]\n }\n\n var middle = \"e5\";\n\n var o = board[f];\n\n if(o.player != player || o.sprite == null) {\n return false;\n }\n\n patterns[o.sprite].forEach(function(v) {\n var d = rel(f, v[0], v[1]);\n if(d == null) {\n return;\n }\n\n var dd = board[d];\n\n if(!dd || dd.player === o.player || dd.terrain == \"tree\") {\n return;\n }\n\n if(dd.sprite != null) {\n dd.overlay = \"destroy\";\n dd.result = f + d + \"!\";\n if(dd.sprite == \"king\") {\n dd.result += \"-\";\n\n // calculate victory by elimination\n var players = [false, false, false, false];\n for(var i in board) {\n // add kings but not the one being killed\n if(board[i].sprite == \"king\" && i != d) {\n players[board[i].player] = true;\n }\n }\n\n if(players.filter(p => p).length == 1) {\n dd.result += \"#\";\n }\n }\n } else {\n dd.overlay = \"move\";\n dd.result = f + d;\n dd.moveDirection = relativePosition(f, d);\n }\n\n if(d == middle) {\n if(o.sprite == \"king\") {\n dd.result += \"#\";\n dd.win = true;\n } else if(!o.noPower){\n // ~ is a \"ignore next turn\" flag\n dd.result = \"~\" + dd.result;\n dd.power = true;\n }\n }\n\n dd.validDrop = true;\n });\n\n return true;\n}", "title": "" }, { "docid": "a2913a3a1ed9712502c4d7b357bb0fc7", "score": "0.52104837", "text": "togglePlayer() {\n this.setState(\n { \n jugador: (\n this.state.jugador === 'X') ? 'O' : 'X'}\n )\n }", "title": "" }, { "docid": "07360367a94b568c535ffd61c85f0c46", "score": "0.52103543", "text": "function convertToWord(letter) {\n if (letter === \"r\") return \"Rock\"\n if (letter === \"p\") return \"Paper\"\n return \"Scissors\";\n}", "title": "" }, { "docid": "565300e8040b611f0d9c9d381632ad1f", "score": "0.52090013", "text": "function getNewPattern(pattern) {\n const patternLetters = pattern.split(\"\");\n\n if (pattern[0] === \"x\") {\n return patternLetters;\n } else {\n //\treturn an array with the Y's swapped with X's and X's swapped with Y's\n //\tonly if the first letter of the pattern is an X, in order to simplify the algo\n //\tknowing that all patterns/strings start with X.\n return patternLetters.map((char) => (char === \"y\" ? \"x\" : \"y\"));\n }\n}", "title": "" }, { "docid": "4191a9e597034eb4b621391c2df7271f", "score": "0.52086717", "text": "function handleChar(char)\n{\n\tif(char==106 || char == 74) prevPlan();\n\tif(char==107 || char == 75) nextPlan();\n}", "title": "" }, { "docid": "b166764f29684345c0870d1c32e7523f", "score": "0.52065873", "text": "function gallows(trys) {\n // If statement, checks if character has already been guessed and if so increments trys in graphic to match the amount of guesses left\n if(letterUsed) trys++;\n\n switch(trys) {\n case 5: console.log(`\\x1b[32m___________\n| / |\n|/ |\n| 💀\n| \n| \n| \n|\n| \n-----------------\n\\x1b[37m`); \n break;\n\n case 4: console.log(`\\x1b[32m___________\n| / |\n|/ |\n| 💀\n| \\x1b[37m|\\x1b[32m\n| \\x1b[37m|\\x1b[32m \n| \n|\n| \n-----------------\n\\x1b[37m`);\n \n break;\n\n case 3: console.log(`\\x1b[32m___________\n| / |\n|/ |\n| 💀\n| \\x1b[37m\\\\|\\x1b[32m\n| \\x1b[37m|\\x1b[32m\n| \n|\n| \n-----------------\n \\x1b[37m`);\n\n break;\n\n case 2: console.log(`\\x1b[32m___________\n| / |\n|/ |\n| 💀\n| \\x1b[37m\\\\|/\\x1b[32m\n| \\x1b[37m|\\x1b[32m\n| \n|\n| \n-----------------\n \\x1b[37m`);\n break;\n\n case 1: console.log(`\\x1b[32m___________\n| / |\n|/ |\n| 💀\n| \\x1b[37m\\\\|/\\x1b[32m\n| \\x1b[37m|\\x1b[32m\n| \\x1b[37m/\\x1b[32m\n|\n| \n-----------------\n \\x1b[37m`);\n break;\n\n case 0: console.log(`\\x1b[32m___________\n| / |\n|/ |\n| 💀\n| \\x1b[37m\\\\|/\\x1b[32m\n| \\x1b[37m|\\x1b[32m\n| \\x1b[37m/ \\\\\\x1b[32m\n|\n| \n-----------------\n \\x1b[37m`);\n break;\n default: console.log(`\\x1b[32m___________\n| / |\n|/ |\n| \n| \n| \n| \n|\n| \n-----------------\n \\x1b[37m`); \n }\n}", "title": "" }, { "docid": "9d599e2613c5c108f5fc683db3fb69b3", "score": "0.5204542", "text": "handleInteraction(button){\n if (button.type !== 'keydown') {\n button.disabled = true;\n if (this.activePhrase.checkLetter(button.innerHTML)) {\n button.className = 'chosen';\n this.activePhrase.showMatchedLetter(button.innerHTML);\n let won = this.checkForWin();\n if (won === true) {\n this.gameOver(won);\n }\n } else {\n button.className = 'wrong';\n this.removeLife();\n }\n }\n /*\n * Calls keyPress() according to keydown event key\n * associated with the onscreen keyboard button\n */\n switch (button.key) {\n case 'q':\n this.keyPress(button.key);\n break;\n case 'w':\n this.keyPress(button.key);\n break;\n case 'e':\n this.keyPress(button.key);\n break;\n case 'r':\n this.keyPress(button.key);\n break;\n case 't':\n this.keyPress(button.key);\n break;\n case 'y':\n this.keyPress(button.key);\n break;\n case 'u':\n this.keyPress(button.key);\n break;\n case 'i':\n this.keyPress(button.key);\n break;\n case 'o':\n this.keyPress(button.key);\n break;\n case 'p':\n this.keyPress(button.key);\n break;\n case 'a':\n this.keyPress(button.key);\n break;\n case 's':\n this.keyPress(button.key);\n break;\n case 'd':\n this.keyPress(button.key);\n break;\n case 'f':\n this.keyPress(button.key);\n break;\n case 'g':\n this.keyPress(button.key);\n break;\n case 'h':\n this.keyPress(button.key);\n break;\n case 'j':\n this.keyPress(button.key);\n break;\n case 'k':\n this.keyPress(button.key);\n break;\n case 'l':\n this.keyPress(button.key);\n break;\n case 'z':\n this.keyPress(button.key);\n break;\n case 'x':\n this.keyPress(button.key);\n break;\n case 'c':\n this.keyPress(button.key);\n break;\n case 'v':\n this.keyPress(button.key);\n break;\n case 'b':\n this.keyPress(button.key);\n break;\n case 'n':\n this.keyPress(button.key);\n break;\n case 'm':\n this.keyPress(button.key);\n break;\n }\n }", "title": "" }, { "docid": "ea6aed8108c363ac6357daa6c7ee2c3d", "score": "0.51984936", "text": "checkWinner(letter) {\r\n var hasWinner = false;\r\n if (this.gameState[0] === letter && this.gameState[1] === letter && this.gameState[2] === letter) {\r\n hasWinner = true;\r\n } else if (this.gameState[0] === letter && this.gameState[3] === letter && this.gameState[6] === letter) {\r\n hasWinner = true;\r\n } else if (this.gameState[0] === letter && this.gameState[4] === letter && this.gameState[8] === letter) {\r\n hasWinner = true;\r\n } else if (this.gameState[1] === letter && this.gameState[4] === letter && this.gameState[7] === letter) {\r\n hasWinner = true;\r\n } else if (this.gameState[3] === letter && this.gameState[4] === letter && this.gameState[5] === letter) {\r\n hasWinner = true;\r\n } else if (this.gameState[2] === letter && this.gameState[5] === letter && this.gameState[8] === letter) {\r\n hasWinner = true; \r\n } else if (this.gameState[2] === letter && this.gameState[4] === letter && this.gameState[6] === letter) {\r\n hasWinner = true;\r\n } else if (this.gameState[6] === letter && this.gameState[7] === letter && this.gameState[8] === letter) {\r\n hasWinner = true;\r\n }\r\n\r\n //updating the result statuses\r\n if(hasWinner == true) {\r\n if(letter === p1.name) {\r\n this.score.updatePreviousWinner(p1.name);\r\n this.score.updatePreviousLoser(p2.name);\r\n p1.updateWins();\r\n p2.updateLosses();\r\n } else {\r\n p1.updateLosses();\r\n p2.updateWins();\r\n this.score.updatePreviousWinner(p2.name);\r\n this.score.updatePreviousLoser(p1.name);\r\n }\r\n }\r\n \r\n return hasWinner; //shows if there's a sign of a winner\r\n }", "title": "" }, { "docid": "dc9301cc2560cde41a00dcd381fdf203", "score": "0.5196108", "text": "getLetter(c){\r\n\t\tswitch(c){\r\n\t\t\tcase \"A\":\r\n\t\t\treturn new LetterA(); break;\r\n\t\t\tcase \"B\":\r\n\t\t\treturn new LetterB(); break;\r\n\t\t\tcase \"C\":\r\n\t\t\treturn new LetterC(); break;\r\n\t\t\tcase \"D\":\r\n\t\t\treturn new LetterD(); break;\r\n\t\t\tcase \"E\":\r\n\t\t\treturn new LetterE(); break;\r\n\t\t\tcase \"F\":\r\n\t\t\treturn new LetterF(); break;\r\n\t\t\tcase \"G\":\r\n\t\t\treturn new LetterG(); break;\r\n\t\t\tcase \"H\":\r\n\t\t\treturn new LetterH(); break;\r\n\t\t\tcase \"I\":\r\n\t\t\treturn new LetterI(); break;\r\n\t\t\tcase \"J\":\r\n\t\t\treturn new LetterJ(); break;\r\n\t\t\tcase \"K\":\r\n\t\t\treturn new LetterK(); break;\r\n\t\t\tcase \"L\":\r\n\t\t\treturn new LetterL(); break;\r\n\t\t\tcase \"M\":\r\n\t\t\treturn new LetterM(); break;\r\n\t\t\tcase \"N\":\r\n\t\t\treturn new LetterN(); break;\r\n\t\t\tcase \"O\":\r\n\t\t\treturn new LetterO(); break;\r\n\t\t\tcase \"P\":\r\n\t\t\treturn new LetterP(); break;\r\n\t\t\tcase \"Q\":\r\n\t\t\treturn new LetterQ(); break;\r\n\t\t\tcase \"R\":\r\n\t\t\treturn new LetterR(); break;\r\n\t\t\tcase \"S\":\r\n\t\t\treturn new LetterS(); break;\r\n\t\t\tcase \"T\":\r\n\t\t\treturn new LetterT(); break;\r\n\t\t\tcase \"U\":\r\n\t\t\treturn new LetterU(); break;\r\n\t\t\tcase \"V\":\r\n\t\t\treturn new LetterV(); break;\r\n\t\t\tcase \"W\":\r\n\t\t\treturn new LetterW(); break;\r\n\t\t\tcase \"X\":\r\n\t\t\treturn new LetterX(); break;\r\n\t\t\tcase \"Y\":\r\n\t\t\treturn new LetterY(); break;\r\n\t\t\tcase \"Z\":\r\n\t\t\treturn new LetterZ(); break;\r\n\t\t\tcase \"0\":\r\n\t\t\treturn new Letter0(); break;\r\n\t\t\tcase \"1\":\r\n\t\t\treturn new Letter1(); break;\r\n\t\t\tcase \"2\":\r\n\t\t\treturn new Letter2(); break;\r\n\t\t\tcase \"3\":\r\n\t\t\treturn new Letter3(); break;\r\n\t\t\tcase \"4\":\r\n\t\t\treturn new Letter4(); break;\r\n\t\t\tcase \"5\":\r\n\t\t\treturn new Letter5(); break;\r\n\t\t\tcase \"6\":\r\n\t\t\treturn new Letter6(); break;\r\n\t\t\tcase \"7\":\r\n\t\t\treturn new Letter7(); break;\r\n\t\t\tcase \"8\":\r\n\t\t\treturn new Letter8(); break;\r\n\t\t\tcase \"9\":\r\n\t\t\treturn new Letter9(); break;\r\n\t\t\tcase \" \":\r\n\t\t\treturn new Letter(\" \"); break;\r\n\t\t\tcase \"’\":\r\n\t\t\treturn new LetterApostrophe(); break;\r\n\t\t\tcase \"'\":\r\n\t\t\treturn new LetterApostrophe(); break;\r\n\t\t\tcase \"`\":\r\n\t\t\treturn new LetterApostrophe(); break;\r\n\t\t\tcase \".\":\r\n\t\t\treturn new LetterDot(); break;\r\n\t\t\tcase \"!\":\r\n\t\t\treturn new LetterExclamation (); break;\r\n\t\t\tcase \"?\":\r\n\t\t\treturn new LetterQuestion(); break;\r\n\t\t\tcase \"^\":\r\n\t\t\treturn new LetterTriangle(); break;\r\n\t\t\tcase \"(\":\r\n\t\t\treturn new LetterParentLeft(); break;\r\n\t\t\tcase \")\":\r\n\t\t\treturn new LetterParentRight(); break;\r\n\t\t\tcase \"{\":\r\n\t\t\treturn new LetterBracesLeft(); break;\r\n\t\t\tcase \"}\":\r\n\t\t\treturn new LetterBracesRight(); break;\r\n\t\t\tcase \"[\":\r\n\t\t\treturn new LetterBracketLeft(); break;\r\n\t\t\tcase \"]\":\r\n\t\t\treturn new LetterBracketRight(); break;\r\n\t\t\tcase \"+\":\r\n\t\t\treturn new LetterPlus(); break;\r\n\t\t\tcase \"-\":\r\n\t\t\treturn new LetterMinus(); break;\r\n\t\t\tcase \"=\":\r\n\t\t\treturn new LetterEquals(); break;\r\n\t\t\tcase \"#\":\r\n\t\t\treturn new LetterPound(); break;\r\n\t\t\tcase \",\":\r\n\t\t\treturn new LetterComma(); break;\r\n\t\t\tcase \"|\":\r\n\t\t\treturn new LetterPipe(); break;\r\n\t\t\tcase \"_\":\r\n\t\t\treturn new LetterUnder(); break;\r\n\t\t\tcase \"/\":\r\n\t\t\treturn new LetterSlash(); break;\r\n\t\t\tcase \"\\\\\":\r\n\t\t\treturn new LetterBackSlash(); break;\r\n\t\t\tcase \"*\":\r\n\t\t\treturn new LetterEllipsis(); break;\r\n\t\t\tcase \":\":\r\n\t\t\treturn new LetterColon(); break;\r\n\t\t\tcase \";\":\r\n\t\t\treturn new LetterSemiColon(); break;\r\n\t\t\tcase \"&\":\r\n\t\t\treturn new LetterAnd(); break;\r\n\t\t\tcase \"%\":\r\n\t\t\treturn new LetterPercent(); break;\r\n\t\t\tdefault:\r\n\t\t\treturn console.log(c +\" is not supported\"); break;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "62ac5202193f0b9c5a6443b93bde63b4", "score": "0.51930046", "text": "function otherPlayersSymbol(playerSym) {\n if(playerSym === \"x\"){\n playerTwoSym = \"o\";\n }else {\n playerTwoSym = \"x\"\n }\n }", "title": "" }, { "docid": "4432ae2a2ab8e3443a8c8264099ee368", "score": "0.5192137", "text": "playSequence() {\n let currentStepSouds = this.state.dmSeq[this.state.step]\n this.setState({ step: this.state.step + 1 }, () => {\n this.state.step === 16 && this.setStepToZero()\n if (currentStepSouds !== \"\") {\n currentStepSouds.includes(\"BD\") && this.startSample(\"BD\")\n currentStepSouds.includes(\"SN\") && this.startSample(\"SN\")\n currentStepSouds.includes(\"HH\") && this.startSample(\"HH\")\n currentStepSouds.includes(\"CP\") && this.startSample(\"CP\")\n }\n })\n }", "title": "" }, { "docid": "238911f489f7a818e73611ee8ff9432e", "score": "0.5190639", "text": "function drawGameChar()\n{\n // The \"jumpin-left code\" or \"walking-right code\"... comments are for each of the different ways I drew the poses of the game character (beetle). So a different pose will be drawn in each different state.\n \n\tfill(0);\n\t//the game character\n\tif(isLeft && isFalling)\n\t{\n // Jumping-left code\n\n //body\n ellipse(gameChar_x + 0.5, gameChar_y - 25, 27, 25);\n //head\n ellipse(gameChar_x + 0.5, gameChar_y - 38, 15, 15);\n //antenna left\n triangle(gameChar_x - 6, gameChar_y - 41, \n gameChar_x - 3, gameChar_y - 44, \n gameChar_x - 9, gameChar_y - 51);\n triangle(gameChar_x - 9, gameChar_y - 51,\n gameChar_x - 8, gameChar_y - 47,\n gameChar_x - 1, gameChar_y - 54);\n //antenna right\n triangle(gameChar_x + 1, gameChar_y - 41,\n gameChar_x + 7, gameChar_y - 41,\n gameChar_x + 10, gameChar_y - 51);\n triangle(gameChar_x + 10, gameChar_y - 51,\n gameChar_x + 9, gameChar_y - 47,\n gameChar_x + 2, gameChar_y - 54);\n //eyes\n fill(255);\n ellipse(gameChar_x - 4, gameChar_y - 41, 3);\n ellipse(gameChar_x + 1, gameChar_y - 41, 3);\n fill(0);\n //arms\n strokeWeight(1.5);\n stroke(0);\n //arm, top right\n line(gameChar_x + 12, gameChar_y - 25,\n gameChar_x + 15, gameChar_y - 28);\n //arm, top left\n line(gameChar_x - 11, gameChar_y - 25,\n gameChar_x - 14, gameChar_y - 30);\n //arm, bottom left\n line(gameChar_x - 9, gameChar_y - 17,\n gameChar_x - 11, gameChar_y - 16);\n //arm, bottom right\n line(gameChar_x + 9, gameChar_y - 17,\n gameChar_x + 11, gameChar_y - 16);\n //left leg\n line(gameChar_x - 6, gameChar_y - 14,\n gameChar_x - 8, gameChar_y - 6);\n line(gameChar_x - 8, gameChar_y - 6,\n gameChar_x - 7, gameChar_y + 2);\n //right leg\n line(gameChar_x + 5, gameChar_y - 15,\n gameChar_x + 5.5, gameChar_y - 6);\n line(gameChar_x + 5.5, gameChar_y - 6,\n gameChar_x + 7, gameChar_y + 2);\n strokeWeight(1);\n\n\t}\n\telse if(isRight && isFalling)\n\t{\n\t\t// Jumping-right code\n \n //body\n ellipse(gameChar_x + 0.5, gameChar_y - 25, 27, 25);\n //head\n ellipse(gameChar_x + 0.5, gameChar_y - 38, 15, 15);\n //antenna left\n triangle(gameChar_x - 6, gameChar_y - 41, \n gameChar_x - 3, gameChar_y - 44, \n gameChar_x - 9, gameChar_y - 51);\n triangle(gameChar_x - 9, gameChar_y - 51,\n gameChar_x - 8, gameChar_y - 47,\n gameChar_x - 1, gameChar_y - 54);\n //antenna right\n triangle(gameChar_x + 1, gameChar_y - 41,\n gameChar_x + 7, gameChar_y - 41,\n gameChar_x + 10, gameChar_y - 51);\n triangle(gameChar_x + 10, gameChar_y - 51,\n gameChar_x + 9, gameChar_y - 47,\n gameChar_x + 2, gameChar_y - 54);\n //eyes\n fill(255);\n ellipse(gameChar_x, gameChar_y - 41, 3);\n ellipse(gameChar_x + 5, gameChar_y - 41, 3);\n fill(0);\n //arms\n strokeWeight(1.5);\n stroke(0);\n //arm, top right\n line(gameChar_x + 12, gameChar_y - 25,\n gameChar_x + 15, gameChar_y - 30);\n //arm, top left\n line(gameChar_x - 11, gameChar_y - 25,\n gameChar_x - 14, gameChar_y - 28);\n //arm, bottom left\n line(gameChar_x - 9, gameChar_y - 17,\n gameChar_x - 11, gameChar_y - 16);\n //arm, bottom right\n line(gameChar_x + 9, gameChar_y - 17,\n gameChar_x + 11, gameChar_y - 16);\n //left leg\n line(gameChar_x - 6, gameChar_y - 15,\n gameChar_x - 6, gameChar_y - 6);\n line(gameChar_x - 6, gameChar_y - 6,\n gameChar_x - 7, gameChar_y + 2);\n //right leg\n line(gameChar_x + 5, gameChar_y - 15,\n gameChar_x + 7, gameChar_y - 6);\n line(gameChar_x + 7, gameChar_y - 6,\n gameChar_x + 7, gameChar_y + 2);\n strokeWeight(1);\n\n\t}\n\telse if(isLeft)\n\t{\n\t\t// Walking left code\n \n //body\n ellipse(gameChar_x + 0.5, gameChar_y - 25, 27, 25);\n //head\n ellipse(gameChar_x + 0.5, gameChar_y - 38, 15, 15);\n //antenna left\n triangle(gameChar_x - 6, gameChar_y - 41, \n gameChar_x - 3, gameChar_y - 44, \n gameChar_x - 9, gameChar_y - 51);\n triangle(gameChar_x - 9, gameChar_y - 51,\n gameChar_x - 8, gameChar_y - 47,\n gameChar_x - 1, gameChar_y - 54);\n //antenna right\n triangle(gameChar_x + 1, gameChar_y - 41,\n gameChar_x + 7, gameChar_y - 41,\n gameChar_x + 10, gameChar_y - 51);\n triangle(gameChar_x + 10, gameChar_y - 51,\n gameChar_x + 9, gameChar_y - 47,\n gameChar_x + 2, gameChar_y - 54);\n //eyes\n fill(255);\n ellipse(gameChar_x - 4, gameChar_y - 41, 3);\n ellipse(gameChar_x + 1, gameChar_y - 41, 3);\n fill(0);\n //arms\n strokeWeight(1.5);\n stroke(0);\n //arm, top right\n line(gameChar_x + 12, gameChar_y - 25,\n gameChar_x + 15, gameChar_y - 18);\n //arm, top left\n line(gameChar_x - 11, gameChar_y - 25,\n gameChar_x - 14, gameChar_y - 20);\n //arm, bottom left\n line(gameChar_x - 9, gameChar_y - 17,\n gameChar_x - 11, gameChar_y - 14);\n //arm, bottom right\n line(gameChar_x + 9, gameChar_y - 17,\n gameChar_x + 11, gameChar_y - 12);\n //left leg\n line(gameChar_x - 6, gameChar_y - 14,\n gameChar_x - 10, gameChar_y - 6);\n line(gameChar_x - 10, gameChar_y - 6,\n gameChar_x - 7, gameChar_y + 2);\n //right leg\n line(gameChar_x + 5, gameChar_y - 15,\n gameChar_x + 3, gameChar_y - 6);\n line(gameChar_x + 3, gameChar_y - 6,\n gameChar_x + 7, gameChar_y + 2);\n strokeWeight(1);\n\n\t}\n\telse if(isRight)\n\t{\n\t\t// Walking right code\n \n //body\n ellipse(gameChar_x + 0.5, gameChar_y - 25, 27, 25);\n //head\n ellipse(gameChar_x + 0.5, gameChar_y - 38, 15, 15);\n //antenna left\n triangle(gameChar_x - 6, gameChar_y - 41, \n gameChar_x - 3, gameChar_y - 44, \n gameChar_x - 9, gameChar_y - 51);\n triangle(gameChar_x - 9, gameChar_y - 51,\n gameChar_x - 8, gameChar_y - 47,\n gameChar_x - 1, gameChar_y - 54);\n //antenna right\n triangle(gameChar_x + 1, gameChar_y - 41,\n gameChar_x + 7, gameChar_y - 41,\n gameChar_x + 10, gameChar_y - 51);\n triangle(gameChar_x + 10, gameChar_y - 51,\n gameChar_x + 9, gameChar_y - 47,\n gameChar_x + 2, gameChar_y - 54);\n //eyes\n fill(255);\n ellipse(gameChar_x, gameChar_y - 41, 3);\n ellipse(gameChar_x + 5, gameChar_y - 41, 3);\n fill(0);\n //arms\n strokeWeight(1.5);\n stroke(0);\n //arm, top right\n line(gameChar_x + 12, gameChar_y - 25,\n gameChar_x + 15, gameChar_y - 20);\n //arm, top left\n line(gameChar_x - 11, gameChar_y - 25,\n gameChar_x - 14, gameChar_y - 18);\n //arm, bottom left\n line(gameChar_x - 9, gameChar_y - 17,\n gameChar_x - 11, gameChar_y - 12);\n //arm, bottom right\n line(gameChar_x + 9, gameChar_y - 17,\n gameChar_x + 11, gameChar_y - 14);\n //left leg\n line(gameChar_x - 6, gameChar_y - 15,\n gameChar_x - 3.5, gameChar_y - 6);\n line(gameChar_x - 3.5, gameChar_y - 6,\n gameChar_x - 7, gameChar_y + 2);\n //right leg\n line(gameChar_x + 5, gameChar_y - 15,\n gameChar_x + 10, gameChar_y - 6);\n line(gameChar_x + 10, gameChar_y - 6,\n gameChar_x + 7, gameChar_y + 2);\n strokeWeight(1);\n\n\t}\n\telse if(isFalling || isPlummeting)\n\t{\n\t\t// Jumping facing forwards code\n \n //body\n ellipse(gameChar_x + 0.5, gameChar_y - 25, 30, 25);\n //head\n ellipse(gameChar_x + 0.5, gameChar_y - 38, 15, 15);\n //antenna left\n triangle(gameChar_x - 6, gameChar_y - 41, \n gameChar_x - 3, gameChar_y - 44, \n gameChar_x - 9, gameChar_y - 51);\n triangle(gameChar_x - 9, gameChar_y - 51,\n gameChar_x - 8, gameChar_y - 47,\n gameChar_x - 1, gameChar_y - 54);\n //antenna right\n triangle(gameChar_x + 1, gameChar_y - 41,\n gameChar_x + 7, gameChar_y - 41,\n gameChar_x + 10, gameChar_y - 51);\n triangle(gameChar_x + 10, gameChar_y - 51,\n gameChar_x + 9, gameChar_y - 47,\n gameChar_x + 2, gameChar_y - 54);\n //eyes\n fill(255);\n ellipse(gameChar_x - 2, gameChar_y - 41, 3);\n ellipse(gameChar_x + 3, gameChar_y - 41, 3);\n fill(0);\n //arms\n strokeWeight(1.5);\n stroke(0);\n //arm, top right\n line(gameChar_x + 15, gameChar_y - 25,\n gameChar_x + 18, gameChar_y - 30);\n //arm, top left\n line(gameChar_x - 14, gameChar_y - 25,\n gameChar_x - 17, gameChar_y - 30);\n //arm, bottom left\n line(gameChar_x - 11, gameChar_y - 17,\n gameChar_x - 14, gameChar_y - 17);\n //arm, bottom right\n line(gameChar_x + 11, gameChar_y - 17,\n gameChar_x + 14.5, gameChar_y - 17);\n //left leg\n line(gameChar_x - 6, gameChar_y - 14,\n gameChar_x - 6, gameChar_y - 6);\n line(gameChar_x - 6, gameChar_y - 6,\n gameChar_x - 6, gameChar_y + 2);\n //right leg\n line(gameChar_x + 5, gameChar_y - 15,\n gameChar_x + 5, gameChar_y - 6);\n line(gameChar_x + 5, gameChar_y - 6,\n gameChar_x + 5, gameChar_y + 2);\n strokeWeight(1);\n\n\t}\n\telse\n\t{\n\t\t// Standing front facing code\n \n //body\n ellipse(gameChar_x + 0.5, gameChar_y - 25, 30, 25);\n //head\n ellipse(gameChar_x + 0.5, gameChar_y - 38, 15, 15);\n //antenna left\n triangle(gameChar_x - 6, gameChar_y - 41, \n gameChar_x - 3, gameChar_y - 44, \n gameChar_x - 9, gameChar_y - 51);\n triangle(gameChar_x - 9, gameChar_y - 51,\n gameChar_x - 8, gameChar_y - 47,\n gameChar_x - 1, gameChar_y - 54);\n //antenna right\n triangle(gameChar_x + 1, gameChar_y - 41,\n gameChar_x + 7, gameChar_y - 41,\n gameChar_x + 10, gameChar_y - 51);\n triangle(gameChar_x + 10, gameChar_y - 51,\n gameChar_x + 9, gameChar_y - 47,\n gameChar_x + 2, gameChar_y - 54);\n //eyes\n fill(255);\n ellipse(gameChar_x - 2, gameChar_y - 41, 3);\n ellipse(gameChar_x + 3, gameChar_y - 41, 3);\n fill(0);\n //arms\n strokeWeight(1.5);\n stroke(0);\n //arm, top right\n line(gameChar_x + 15, gameChar_y - 25,\n gameChar_x + 18, gameChar_y - 20);\n //arm, top left\n line(gameChar_x - 14, gameChar_y - 25,\n gameChar_x - 17, gameChar_y - 20);\n //arm, bottom left\n line(gameChar_x - 12, gameChar_y - 17,\n gameChar_x - 14, gameChar_y - 14);\n //arm, bottom right\n line(gameChar_x + 12, gameChar_y - 17,\n gameChar_x + 14, gameChar_y - 14);\n //left leg\n line(gameChar_x - 6, gameChar_y - 13.5,\n gameChar_x - 10, gameChar_y - 6);\n line(gameChar_x - 10, gameChar_y - 6,\n gameChar_x - 7, gameChar_y + 2);\n //right leg\n line(gameChar_x + 5, gameChar_y - 15,\n gameChar_x + 10, gameChar_y - 6);\n line(gameChar_x + 10, gameChar_y - 6,\n gameChar_x + 7, gameChar_y + 2);\n strokeWeight(1);\n\n }\n}", "title": "" }, { "docid": "9ca89ccd5ec76b32a5fa0bc1c3506e64", "score": "0.5189667", "text": "handleInteraction(pressedKey) {\r\n pressedKey.disabled = true;\r\n let letter = pressedKey.textContent;\r\n\r\n if (this.activePhrase.phrase.includes(letter)) {\r\n pressedKey.classList.add(\"chosen\");\r\n this.activePhrase.showMatchedLetter(letter);\r\n if (this.checkForWin()) {\r\n //delayed gameOver() call\r\n this.gameOverDelay();\r\n }\r\n } else {\r\n pressedKey.classList.add(\"wrong\");\r\n this.removeLife();\r\n }\r\n }", "title": "" }, { "docid": "cbcdc0bf0bccb59324d3459a06a0c795", "score": "0.51878536", "text": "function playerInput(input){\n\tif((input.key==\"ArrowLeft\") && (board[currentIndex[0]][currentIndex[1]-1] != \"0\") && (board[currentIndex[0]][currentIndex[1]-1] != \"#\")) {\n\t\t// move player to left open space\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]][currentIndex[1]-1] = \"p\";\n\t}else if((input.key==\"ArrowLeft\") && (board[currentIndex[0]][currentIndex[1]-1] == \"#\") && (board[currentIndex[0]][currentIndex[1]-2] != \"#\") && (board[currentIndex[0]][currentIndex[1]-2] != \"0\") ) {\n\t\t// move barrel to the left\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]][currentIndex[1]-1] = \"p\";\n\t\tboard[currentIndex[0]][currentIndex[1]-2] = \"#\";\n\t}else if((input.key==\"ArrowLeft\") && (board[currentIndex[0]][currentIndex[1]-1] == \"#\") && (board[currentIndex[0]][currentIndex[1]-2] == \"x\")) {\n\t\t// move barrel to the left and place on victory spot\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]][currentIndex[1]-1] = \"p\";\n\t\tboard[currentIndex[0]][currentIndex[1]-2] = \"#\";\n\t}else if((input.key==\"ArrowUp\") && (board[currentIndex[0]-1][currentIndex[1]] != \"0\") && (board[currentIndex[0]-1][currentIndex[1]] != \"#\")) {\n\t\t// move player up to open space\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]-1][currentIndex[1]] = \"p\";\n\t}else if((input.key==\"ArrowUp\") && (board[currentIndex[0]-1][currentIndex[1]] == \"#\") && (board[currentIndex[0]-2][currentIndex[1]] != \"#\") && (board[currentIndex[0]-2][currentIndex[1]] != \"0\")) {\n\t\t// move barrel up\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]-1][currentIndex[1]] = \"p\";\n\t\tboard[currentIndex[0]-2][currentIndex[1]] = \"#\";\n\t}else if((input.key==\"ArrowUp\") && (board[currentIndex[0]-1][currentIndex[1]] == \"#\") && (board[currentIndex[0]-2][currentIndex[1]] == \"x\")) {\n\t\t// move barrel up and place on victory spot\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]-1][currentIndex[1]] = \"p\";\n\t\tboard[currentIndex[0]-2][currentIndex[1]] = \"#\";\n\t}else if((input.key==\"ArrowRight\") && (board[currentIndex[0]][currentIndex[1]+1] != \"0\") && (board[currentIndex[0]][currentIndex[1]+1] != \"#\")) {\n\t\t// move player right to open space\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]][currentIndex[1]+1] = \"p\";\n\t}else if((input.key==\"ArrowRight\") && (board[currentIndex[0]][currentIndex[1]+1] == \"#\") && (board[currentIndex[0]][currentIndex[1]+2] != \"#\") && (board[currentIndex[0]][currentIndex[1]+2] != \"0\")) {\n\t\t// move barrel right\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]][currentIndex[1]+1] = \"p\";\n\t\tboard[currentIndex[0]][currentIndex[1]+2] = \"#\";\n\t}else if((input.key==\"ArrowRight\") && (board[currentIndex[0]][currentIndex[1]+1] == \"#\") && (board[currentIndex[0]][currentIndex[1]+2] == \"x\")) {\n\t\t// move barrel right and place on victory spot\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]][currentIndex[1]+1] = \"p\";\n\t\tboard[currentIndex[0]][currentIndex[1]+2] = \"#\";\n\t}else if((input.key==\"ArrowDown\") && (board[currentIndex[0]+1][currentIndex[1]] != \"0\") && (board[currentIndex[0]+1][currentIndex[1]] != \"#\")) {\n\t\t// move player down to open space\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]+1][currentIndex[1]] = \"p\";\n\t}else if((input.key==\"ArrowDown\") && (board[currentIndex[0]+1][currentIndex[1]] == \"#\") && (board[currentIndex[0]+2][currentIndex[1]] != \"#\") && (board[currentIndex[0]+2][currentIndex[1]] != \"0\")) {\n\t\t// move barrel down\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]+1][currentIndex[1]] = \"p\";\n\t\tboard[currentIndex[0]+2][currentIndex[1]] = \"#\";\n\t}else if((input.key==\"ArrowDown\") && (board[currentIndex[0]+1][currentIndex[1]] == \"#\") && (board[currentIndex[0]+2][currentIndex[1]] == \"x\")) {\n\t\t// move barrel down and place on victory spot\n\t\tboard[currentIndex[0]][currentIndex[1]] = \" \";\n\t\tboard[currentIndex[0]+1][currentIndex[1]] = \"p\";\n\t\tboard[currentIndex[0]+2][currentIndex[1]] = \"#\";\n\t} else if(input.key == \"Enter\"){ // start a new level by pressing enter\n\t\t$(\"#prompt\").text(\"New level starting...\");\n\t\t$(\"#restart\").empty();\n\t\tgameOver();\n\t\treturn; // break out of if statement\n\t} else if(input.key == \"r\"){ // restart the current level by pressing r\n\t\t$(\"#prompt\").text(\"Restarting this level...\");\n\t\t$(\"#restart\").empty();\n\t\tgameRestart();\n\t\treturn;\n\t}\n\t\n\tredisplayVictoryPoints();\n\trebuildMap();\n\tdisplayColour();\n\tvictory();\n}", "title": "" }, { "docid": "da9cd3ba90c461ed8eba2151e7431937", "score": "0.51861954", "text": "function spawn() {\n if(frameCount%30===0) {\n //the c tells us which row of the 4x4 matrix we should access - i.e. which beat\n //each arrow has a column, from where we know whether to display it or no (1 or 0)\n\n var ran = [Math.floor(Math.random()*(12-8)+8), Math.floor(Math.random()*(8-4)+4), Math.floor(Math.random()*(16-12)+12), Math.floor(Math.random()*(20-16)+16)];\n var ran2 = Math.floor(Math.random()*100);\n\n //in 90% of cases, add a correct DNA letter\n if (ran2>10) {\n arrows.push(new DNA(up.x,DNAy, sarrow, letters[8], 8, patterns[c][1]));\n arrows.push(new DNA(left.x,DNAy, sarrow, letters[7], 7, patterns[c][0]));\n arrows.push(new DNA(down.x, DNAy, sarrow, letters[14], 14, patterns[c][2]));\n arrows.push(new DNA(right.x, DNAy, sarrow, letters[17], 17, patterns[c][3]));\n } else {\n //otherwise, add some random ones\n arrows.push(new DNA(up.x, DNAy, sarrow, letters[ran[0]], ran[0], patterns[c][1]));\n arrows.push(new DNA(left.x, DNAy, sarrow, letters[ran[1]], ran[0], patterns[c][0]));\n arrows.push(new DNA(down.x, DNAy, sarrow, letters[ran[2]], ran[0], patterns[c][2]));\n arrows.push(new DNA(right.x, DNAy, sarrow, letters[ran[3]], ran[0], patterns[c][3]));\n }\n //console.log(patterns[c]);\n c+=1;\n //console.log(arrows);\n //we reset c after it does the last beat, to get the values again for the 4 beats\n if (c===3) {\n c=0;\n }\n }\n}", "title": "" }, { "docid": "1e0cea76a6fc01a9b080d7ab32055750", "score": "0.5184572", "text": "function main()\r\n{\r\n var board = [' ',' ',' ',' ',' ',' ',' ',' ',' ',' '];\r\n theGameBoard(board);\r\n let playerLetter = ''\r\n let computerLetter = ''\r\n \r\n letter = selectPlayer();\r\n if (letter === 'X') {\r\n playerLetter = 'X';\r\n computerLetter = 'O';\r\n } \r\n else {\r\n playerLetter = 'O';\r\n computerLetter = 'X';\r\n } \r\n console.log(`PlayerLetter - ${playerLetter}, Computer letter ${computerLetter}`); \r\n let turn = whoGoesFirst();\r\n console.log(`The ${turn} will Go first...`);\r\n while (true)\r\n { \r\n // Player Turn \r\n if (turn === 'Player')\r\n {\r\n let move = movePlayer(board);\r\n makeMove(board, playerLetter, move);\r\n turn = 'Computer';\r\n theGameBoard(board);\r\n \r\n if (isWinner(board, playerLetter))\r\n {\r\n theGameBoard(board);\r\n console.log('You won !');\r\n break;\r\n }\r\n else\r\n {\r\n if (isBoardFull(board))\r\n {\r\n theGameBoard(board);\r\n console.log('The Game is tie');\r\n break;\r\n }\r\n }\r\n turn = 'Computer';\r\n }\r\n else\r\n {\r\n // Computer turn \r\n let move = getComputerMove(board, computerLetter);\r\n makeMove(board, computerLetter, move);\r\n theGameBoard(board); \r\n\r\n if (isWinner(board, computerLetter))\r\n {\r\n console.log('The Computer has beaten you !');\r\n break;\r\n }\r\n else\r\n {\r\n if (isBoardFull(board))\r\n {\r\n console.log(\"The Game is tie\");\r\n break;\r\n }\r\n }\r\n\r\n turn = 'Player'\r\n }\r\n }\r\n}", "title": "" } ]
a7844e0e65918c3ed3b2ea108d69187e
You can extend webpack config here
[ { "docid": "07a53a76c3bfa5cd12a3eaeb984f3f6c", "score": "0.70773005", "text": "extend(config, { isDev, isClient, loaders: { vue } }) {\n // Run ESLint on save\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n\n config.resolve.alias.vue = 'vue/dist/vue.common';\n\n return Object.assign({}, config, {\n devtool: 'source-map',\n });\n }", "title": "" } ]
[ { "docid": "ae6c86276dd8168af32ac9a18af3d547", "score": "0.79326123", "text": "mergeCustomConfig() {\n if (Config.webpackConfig) {\n this.webpackConfig = require('webpack-merge').smart(\n this.webpackConfig, Config.webpackConfig\n );\n }\n }", "title": "" }, { "docid": "21507e755787f9d107e05f490750b928", "score": "0.788238", "text": "webpack (config) {\n\n config.plugins.push(\n new Dotenv({\n path: path.join(__dirname, '.env'),\n systemvars: true\n })\n );\n\n config.module.rules.push(\n {\n test: /\\.(jpg|png|svg|eot|otf|ttf|woff|woff2|icon)$/, \n use: {\n loader: 'url-loader',\n options: {\n limit: 8192,\n publicPath: '/_next/static/',\n outputPath: 'static/',\n name: '[name].[ext]'\n }\n }\n }\n )\n\n // Here is the magic\n // We push our config into the resolve.modules array\n config.resolve.modules.push(path.resolve('./'))\n \n return config; \n }", "title": "" }, { "docid": "f9af08ec237532f199eb45a6f71da677", "score": "0.771479", "text": "extend(config, ctx) {\n if (ctx.isClient) {\n // 拓展 webpack 配置\n // config.entry['polyfill'] = ['babel-polyfill']\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n config.devtool = '#cheap-module-eval-source-map'\n // 添加 alias 配置\n Object.assign(config.resolve.alias, {\n 'utils': path.resolve(__dirname, 'utils'),\n 'assets': path.resolve(__dirname, 'assets')\n })\n }\n }", "title": "" }, { "docid": "6d0d8be67eb84ef66bfd79e34ffea0fd", "score": "0.7682185", "text": "extendWebpack(cfg) {\n // 命令行参数\n let customerConfig = process.argv[2];\n let maps = {\n 'demo': 'Demo',\n 'Demo': 'Demo',\n 'nanfang': 'NanFang',\n 'NanFang': 'NanFang',\n 'nologo': 'NoLogo',\n 'NoLogo': 'NoLogo',\n 'jiaojian': 'JiaoJian',\n 'JiaoJian': 'JiaoJian',\n };\n // 开发环境不需要 manifest.json 文件\n if(cfg.mode !== 'development') {\n cfg.plugins.push(new MergeJsonFile({\n from: path.resolve(__dirname, `config/${ maps[customerConfig] || 'Demo' }.js`),\n to: path.resolve(cfg.output.path, 'manifest.json')\n }));\n }\n }", "title": "" }, { "docid": "29783c3732b0e8ab72a8f26e6eb1a760", "score": "0.75597703", "text": "initCustomizeConfig(options) {\n return WebpackConfig(options);\n }", "title": "" }, { "docid": "306314ca50d0aeeb96878bda6a67927f", "score": "0.74858564", "text": "extend(config, ctx) {\n // Extend Webpack to load image files\n config.module.rules.push({\n test: /\\.(png|jpe?g|gif|svg|webp)$/,\n loader: 'file-loader',\n query: {\n limit: 1000, // 1kB\n name: 'img/[name].[hash:7].[ext]'\n }\n })\n \n // Extend Webpack to load audio files\n config.module.rules.push({\n test: /\\.(ogg|mp3|mp4|wav|mpe?g)$/i,\n loader: 'file-loader',\n options: {\n name: '\\[path\\][name].[ext]'\n }\n })\n // Run ESLint on save\n if(ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }\n }", "title": "" }, { "docid": "34418e8fa8461fc6b7a74c8c79fbcf6b", "score": "0.7445932", "text": "constructor() {\n this.webpackConfig = webpackDefaultConfig();\n }", "title": "" }, { "docid": "cf5f5b1650692ebb172b04fbe8c69d49", "score": "0.7400723", "text": "setupWebpackConfig() {\n const configDir = path.resolve(__dirname, '..', 'config/webpack');\n const { DEFAULT_OPTIONS } = require(path.resolve(\n configDir,\n 'webpackDevServer.js'\n ));\n const webpackDevServerConfig = {\n historyApiFallback: DEFAULT_OPTIONS.historyApiFallback,\n contentBase: path.resolve(this.workspace.root, 'src'),\n proxy: this.setupProxy(this.options.proxyOption),\n port: this.options.port || DEFAULT_OPTIONS.port,\n inline: DEFAULT_OPTIONS.inline,\n open: DEFAULT_OPTIONS.open\n };\n\n const baseConfig = require(path.resolve(\n configDir,\n 'webpack.config.base'\n ));\n const devConfig = require(path.resolve(\n configDir,\n 'webpack.config.dev'\n ));\n const merge = require('webpack-merge');\n const cwd = process.cwd();\n const userCustomConfig = this.getUserWebpackDevConfig();\n\n let webpackConfig = merge([\n typeof userCustomConfig === 'function'\n ? userCustomConfig()\n : userCustomConfig,\n baseConfig(cwd),\n devConfig(cwd, process.env, webpackDevServerConfig)\n ]);\n\n webpackConfig.entry.main.unshift(\n `webpack-dev-server/client?http://localhost:${webpackDevServerConfig.port}/`\n );\n\n return {\n webpackDevServerConfig,\n webpackConfig\n };\n }", "title": "" }, { "docid": "4f3aae93aa697da9619c608225e24b4a", "score": "0.7390726", "text": "registerWebpackConfig_() {\n this.webpackConfig = (0, _webpack.getDefaultWebpackConfig)(this);\n }", "title": "" }, { "docid": "49654eae58befcaa32c31b0ddab2e5c5", "score": "0.7386977", "text": "extendWebpack(cfg) {\n // do something with Electron process Webpack cfg\n }", "title": "" }, { "docid": "181d6b74ac76c0efff0fbc14d4994945", "score": "0.73452544", "text": "webpack(config) {\n // Perform customizations to webpack config\n config.module.rules.push({\n // shader import support\n test: /\\.glsl$/,\n use: [\n {\n loader: 'emit-file-loader',\n options: {\n name: 'dist/[path][name].[ext]'\n }\n },\n 'babel-loader',\n 'webpack-glsl-loader'\n ]\n })\n config.module.rules.slice()\n config.module.rules.unshift({\n test: /\\.svg$/,\n use: [{\n loader: '@svgr/webpack',\n options: {\n svgoConfig: {\n plugins: [\n { removeViewBox: false }\n ]\n }\n },\n },\n {\n loader: 'url-loader',\n options: {\n jsx: true\n }\n }]\n })\n config.module.rules.unshift({\n test: /\\.css$/,\n use: ['raw-loader']\n })\n return config\n }", "title": "" }, { "docid": "683255abaad03036d3fe291041023c3a", "score": "0.73175514", "text": "webpack(config, options) {\n // config.resolve.alias.utils = path.join(__dirname, 'utils')\n config.module.rules.push({\n test: /\\.(eot|woff|woff2|ttf|svg|png|jpg|gif)$/,\n use: {\n loader: 'url-loader',\n options: {\n limit: 100000,\n name: '[name].[ext]'\n }\n }\n })\n return config\n }", "title": "" }, { "docid": "ead327b7785dea4e0e44a9837b59d9f5", "score": "0.73133147", "text": "extend(config, ctx) {\n loaders: {\n file: {\n esModule: false\n }\n }\n }", "title": "" }, { "docid": "75af76616b5e35d4af57f84cdfe22bef", "score": "0.727007", "text": "extend(config, { isDev, isClient }) {\n\n // const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader');\n //\n // vueLoader.options.loaders.sass = 'vue-style-loader!css-loader!sass-loader';\n\n }", "title": "" }, { "docid": "3b362bedab56e494ab2de160b4e9aa52", "score": "0.72652197", "text": "extend(config, ctx) {\n\t\tif (ctx.isDev) {\n\t\t\t// Allow nicer debugging for the SSR parts of the app by inlining the source maps\n\t\t\tconfig.devtool = ctx.isClient ? 'source-map' : 'inline-source-map';\n\t\t}\n\t\t// config.resolve.alias.vue = 'vue/dist/vue.common';\n\t\t/* config.node = {\n\t\t\tfs: 'empty'\n\t\t}; */\n\t}", "title": "" }, { "docid": "0fcabf1d42c548a5c3bc0df8516c7f20", "score": "0.7247272", "text": "extendWebpack (cfg) {\n cfg.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules|quasar)/\n })\n\n cfg.resolve.alias = {\n ...cfg.resolve.alias, // This adds the existing alias\n\n // Add your own alias like this\n http: path.resolve(__dirname, './src/api/http')\n }\n }", "title": "" }, { "docid": "02c5e9dbe53b6340b64b7d949c1eb385", "score": "0.7234903", "text": "function getCommonConfig({ env }) {\n const cssLoader = getCssLoader(false);\n const lessLoader = cssLoader.concat({\n loader: 'less-loader',\n options: {\n modifyVars: {\n 'primary-color': '#10AEAF',\n 'link-color': '#10AEAF',\n 'border-radius-base': '2px',\n },\n javascriptEnabled: true,\n },\n });\n return {\n entry: {\n app: `./src/index.js`,\n },\n\n output: {\n path: resolve('dist/'),\n publicPath: getPublicPath(env),\n filename: `js/[name].[hash:4].js`,\n chunkFilename: `js/[name].chunk.js`,\n },\n\n resolve: {\n alias: {\n '@': resolve('src'),\n },\n extensions: ['*', '.js', '.jsx'],\n },\n\n module: {\n rules: [\n {\n enforce: 'pre',\n test: /\\.(js|jsx)$/,\n include: resolve('src'),\n exclude: resolve('node_modules'),\n loader: 'eslint-loader',\n },\n {\n test: /\\.(js|jsx)$/,\n include: [resolve('src')],\n loader: 'babel-loader',\n },\n {\n test: /\\.css$/,\n include: [\n resolve('src'),\n resolve('node_modules/normalize.css'),\n resolve('node_modules/antd'),\n resolve('node_modules/medium-editor'),\n ],\n use: cssLoader,\n },\n {\n test: /\\.less$/,\n include: [resolve('src'), resolve('node_modules/antd')],\n use: lessLoader,\n },\n {\n test: /\\.(png|jpe?g|gif|svg)(\\?.*)?$/,\n loader: 'url-loader',\n options: {\n limit: 8192,\n name: `img/[name].[hash:4].[ext]`,\n },\n },\n {\n test: /\\.(woff2?|eot|ttf|otf)(\\?.*)?$/,\n loader: 'file-loader',\n options: {\n limit: 8192,\n name: `img/[name].[hash:4].[ext]`,\n },\n },\n {\n test: /\\.(ogg|mp3|wav|mpe?g)$/i,\n loader: 'file-loader',\n options: {\n name: `img/[name].[hash:4].[ext]`,\n },\n },\n ],\n },\n\n plugins: [\n new CleanWebpackPlugin(['dist/css', 'dist/js'], {\n root: path.resolve(__dirname, '..'),\n }),\n new MiniCssExtractPlugin({\n filename: `css/[name].[hash:4].css`,\n chunkFilename: `css/[id].[hash:4].css`,\n }),\n // new webpack.NoEmitOnErrorsPlugin(),\n new webpack.DefinePlugin({\n 'process.env': {\n NODE_ENV: JSON.stringify(process.env.NODE_ENV),\n },\n }),\n new HtmlWebpackPlugin({\n filename: `index.html`,\n template: `src/index.html`,\n }),\n // new LodashModuleReplacementPlugin()\n ],\n };\n}", "title": "" }, { "docid": "9249bd990b60aa4bec9b36194118f550", "score": "0.7219325", "text": "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n /* 为了支持object.assign用法(并非绝对,因为项目为pc端可以忽略打包后85k的大小,能更加有效的支持es6) */\n config.entry['polyfill'] = ['babel-polyfill']\n /* add alias 配置 */\n Object.assign(config.resolve.alias, FileConfigPath)\n }", "title": "" }, { "docid": "05d4e4d93eb31692224c64e94c737434", "score": "0.71924686", "text": "webpack(config) {\n config.target = \"electron-renderer\"\n return config\n }", "title": "" }, { "docid": "e315085fa06abf8a145f6a58e5484c5d", "score": "0.7167273", "text": "extend (config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n if (config.mode === 'production') {\n const CopyWebpackPlugin = require('copy-webpack-plugin');\n const path = require('path');\n config.plugins.push(\n new CopyWebpackPlugin([\n {\n from: path.resolve(__dirname, './src/service_woker'),\n to: path.resolve(__dirname, config.output.path)\n }\n ])\n );\n config.plugins.push(new WsJson());\n }\n }", "title": "" }, { "docid": "390ca5cad10fecb3aed76b8a46c59f3a", "score": "0.71591944", "text": "extend(config, ctx) {\n const rootPath = path.resolve(__dirname);\n\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n\n config.devtool = 'source-map';\n }\n\n config.module.rules.push({\n test: /\\.js$/,\n loader: 'babel-loader',\n include: /(node_modules)/,\n options: {\n presets: ['@babel/env']\n }\n });\n\n // FIXME\n // 要設定 svg-sprite-loader 需 url-loader exclude svg path\n // set url-loader exclude\n config.module.rules[11].exclude = `${rootPath}/src/assets/icons`;\n\n config.module.rules.push({\n test: /\\.svg$/,\n use: [\n {\n loader: 'svg-sprite-loader',\n options: {\n symbolId: 'icon-[name]'\n }\n },\n ],\n include: `${rootPath}/src/assets/icons`,\n });\n\n config.resolve.alias.vue$ = 'vue/dist/vue.esm.js';\n config.resolve.alias['@'] = `${rootPath}`;\n }", "title": "" }, { "docid": "efa053819fbe1146321de5c07a8e3f70", "score": "0.715019", "text": "extend(config, ctx) {\n config.module.rules.push({\n test: /\\.postcss$/,\n use: [\n \"vue-style-loader\",\n \"css-loader\",\n {\n loader: \"postcss-loader\"\n }\n ]\n });\n }", "title": "" }, { "docid": "d7bf2e459ef5de0d4efbaf1e29907254", "score": "0.7126973", "text": "webpack(config, env) {\n // do stuff with the webpack config...\n\n const babelLoader = getBabelLoader(config.module.rules);\n const { include } = babelLoader;\n\n if (env === 'production') {\n babelLoader.include = [\n include,\n path.resolve('node_modules'),\n ];\n } else {\n babelLoader.include = [\n include,\n path.resolve('node_modules/@adactive'),\n path.resolve('node_modules/prex-es5'),\n ];\n }\n\n return config;\n }", "title": "" }, { "docid": "3c8ad82ef3e210af5ee434c591b8ee23", "score": "0.711361", "text": "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n };\n\n if(isClient && !isDev) {\n config.devtool = 'source-map';\n\n initSentry && initSentry(config);\n };\n\n const aliasArr = {\n '@css': path.resolve('./assets/css'),\n '@config': path.resolve('./configs'),\n '@components': path.resolve('./components'),\n '@js': path.resolve('./assets/js'),\n '@images': path.resolve('./assets/images'),\n '@layout': path.resolve('./layouts'),\n '@mixins': path.resolve('./mixins'),\n '@plugins': path.resolve('./plugins'),\n '@store': path.resolve('./store'),\n };\n\n Object.keys(aliasArr).forEach(key => {\n config.resolve.alias[key] = aliasArr[key];\n });\n }", "title": "" }, { "docid": "6d2188d0ba5565cc9e5ace38145709f2", "score": "0.7104806", "text": "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n\n if (ctx.isServer) {\n config.externals = [\n nodeExternals({\n // Include vuetify and quill to the bundles, anything else in node_modules will be ignored\n whitelist: [/^vuetify/,/^quill/]\n })\n ]\n }\n\n config.module.rules.forEach(rule => {\n if (rule.test.toString() === '/\\\\.styl(us)?$/') {\n rule.use.push({\n loader: 'vuetify-loader',\n options: {\n //theme: resolve('./assets/style/theme.styl')\n }\n })\n }\n })\n }", "title": "" }, { "docid": "f2675bd1e96a2b1f4cb360b536436443", "score": "0.70810276", "text": "static genWebpackConfig(name, config) {\n try {\n return Object.assign({}, config, {\n entry: config.entry(name),\n output: {\n path: config.output.path(name),\n filename: config.output.filename(name)\n },\n plugins: config.plugins.map(plugin => typeof plugin == 'function' ? plugin(name) : plugin),\n resolve: {\n modules: config.resolve.modules,\n extensions: config.resolve.extensions,\n alias: config.resolve.alias(name)\n }\n });\n }\n catch (ex) {\n console.error('An error occurred while generating the configuration.')\n console.error(ex);\n }\n }", "title": "" }, { "docid": "e972aeb44bf6e816936bc7755d4ceaa1", "score": "0.70731044", "text": "extend (config, { isDev, isClient, isServer }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n // For Vue Slick\n if (isServer) {\n config.externals = [\n require('webpack-node-externals')({\n whitelist: [/^vue-slick/]\n })\n ]\n }\n // End For Vue Slick\n }", "title": "" }, { "docid": "e461a46a592703a502ad52f3b4702158", "score": "0.70691717", "text": "extend(config, ctx) {\n // Add sourcemaps\n if (ctx.isClient) {\n config.devtool = \"#source-map\";\n } else if (ctx.isDev) {\n config.devtool = \"inline-source-map\";\n }\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "title": "" }, { "docid": "2c7ce55de3bf1696c02b1c55cb2492dd", "score": "0.7058753", "text": "extend(config, ctx) {\n config.resolve.alias[\"jquery\"] = \"@/static/bootstrap/jquery-3.3.1.min.js\";\n config.resolve.alias[\"popper.js\"] = \"@/static/bootstrap/popper.min.js\";\n config.resolve.alias[\"bootstrap\"] = \"@/static/bootstrap/bootstrap.min.js\";\n\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "title": "" }, { "docid": "0beb73105f744fde5b0fa7f1c7519beb", "score": "0.7054875", "text": "extend(config, ctx) {\n // console.log(config)\n // console.log(\"分割线\")\n // console.log(ctx)\n console.log(process.env.NODE_ENV, \"环江\")\n if (process.env.NODE_ENV == \"uat\") {\n // config.output.publicPath=\"/dist/_nuxt/\"\n config.plugins.push(\n new UglifyJsPlugin({\n uglifyOptions: {\n compress: {\n warnings: true,\n drop_console: true\n },\n },\n })\n\n )\n }\n //使用sass\n // const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader');\n // vueLoader.options.loaders.sass = 'vue-style-loader!css-loader!sass-loader';\n // console.log(config,1,ctx)\n\n }", "title": "" }, { "docid": "72534e3a87730b2281f6e8c29819b98f", "score": "0.7044496", "text": "function createConfig(env) {\n const isProduction = env === 'production'\n\n if (env === undefined) {\n env = process.env.NODE_ENV\n }\n\n const webpackConfig = {\n // entry: {\n // // app: ['@babel/polyfill', './src/js/app.js']\n // }, //If you need support IE11\n output: {\n filename: 'app.js',\n },\n resolve: {\n extensions: ['.js'],\n alias: {\n '@': path.resolve(__dirname, 'src/js'),\n },\n },\n module: {\n rules: [\n {\n enforce: 'pre',\n test: /\\.js$/,\n exclude: '/node_modules/',\n loader: 'eslint-loader',\n options: {\n fix: true,\n cache: true,\n ignorePattern: __dirname + '/src/js/lib/',\n },\n },\n {\n test: /\\.js$/,\n loader: 'babel-loader',\n exclude: '/node_modules/',\n options: {\n cacheDirectory: true,\n },\n },\n {\n test: /\\.glsl$/,\n exclude: '/node_modules/',\n loader: 'webpack-glsl-loader',\n },\n ],\n },\n mode: !isProduction ? 'development' : 'production',\n devtool: !isProduction ? 'eval-cheap-module-source-map' : false,\n optimization: {\n minimize: isProduction,\n },\n plugins: [\n new webpackReal.LoaderOptionsPlugin({\n options: {\n eslint: {\n formatter: require('eslint-formatter-pretty'),\n },\n },\n }),\n new webpackReal.NoEmitOnErrorsPlugin(),\n ],\n }\n\n if (isProduction) {\n webpackConfig.plugins.push(\n new webpackReal.LoaderOptionsPlugin({\n minimize: true,\n }),\n )\n // webpackConfig.plugins.push(\n // new BundleAnalyzerPlugin({\n // analyzerMode: 'server',\n // analyzerPort: 5500,\n // openAnalyzer: true,\n // }),\n // )\n }\n\n return webpackConfig\n}", "title": "" }, { "docid": "27b50f76e5d33a233944ed3df83e82ba", "score": "0.7014744", "text": "function getCommonConfig() {\n return {\n entry: {\n app: './src/index.js'\n },\n module: {\n rules: [{\n test: /\\.js$/,\n exclude: /(node_modules)/,\n use: ['babel-loader']\n }, {\n test: /\\.html$/,\n use: ['html-loader']\n }, {\n test: /\\.css$/,\n use: [MiniCssExtractPlugin.loader, 'css-loader']\n }, {\n test: /\\.scss$/,\n use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader']\n }, {\n test: /\\.(png|svg|jpg|gif)$/,\n use: ['file-loader']\n }, {\n test: /\\.(woff|woff2|eot|ttf|otf)$/,\n use: ['file-loader']\n }]\n },\n plugins: [\n new CleanWebpackPlugin({\n verbose: true\n }),\n new HtmlWebpackPlugin({\n template: './src/index.html',\n filename: 'index.html'\n }),\n new MiniCssExtractPlugin({\n filename: '[name].[contenthash].css'\n }),\n new webpack.HashedModuleIdsPlugin()\n ]\n }\n}", "title": "" }, { "docid": "3ae386bf51fa60e06d1a995c07c5e250", "score": "0.69841164", "text": "extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n if (ctx.isDev) {\n config.devtool = ctx.isClient ? 'source-map' : 'inline-source-map'\n }\n if (!config.module) { return }\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: false\n }\n })\n }\n }", "title": "" }, { "docid": "c39f5e07c42fb356da9bd9e0ac77c6c1", "score": "0.69641155", "text": "extend(config, ctx) {\n config.module.rules.forEach((rule) => {\n if (String(rule.test) === String(/\\.(png|jpe?g|gif|svg|webp)$/)) {\n // add a second loader when loading images\n rule.use.push({\n loader: 'image-webpack-loader',\n options: {\n svgo: {\n plugins: [\n // use these settings for internet explorer for proper scalable SVGs\n // https://css-tricks.com/scale-svg/\n { removeViewBox: false },\n { removeDimensions: true }\n ]\n }\n }\n })\n }\n })\n }", "title": "" }, { "docid": "52f8f9e777e251b05316cba07706c9c2", "score": "0.6961992", "text": "function createConfig(env) {\n const isProduction = env === 'production'\n\n const devName = '[name].js'\n const buildName = '[name].[contenthash:8].js'\n\n const filename = env === 'production' ? buildName : devName\n\n if (env === undefined) {\n env = process.env.NODE_ENV\n }\n\n const webpackConfig = {\n entry: {\n app: path.resolve(__dirname, 'src/js/app.ts')\n }, // If you need support IE11\n output: {\n filename,\n chunkFilename: isProduction\n ? '[name].[contenthash:8].chunk.js'\n : '[name].chunk.js',\n path: path.resolve(__dirname, 'build/js/'),\n publicPath: '/wp-content/themes/metshrot/js/'\n // publicPath: './js/'\n },\n resolve: {\n extensions: ['.js', '.ts'],\n alias: {\n '@': path.resolve(__dirname, 'src/js'),\n '@core': path.resolve(__dirname, 'src/js/core')\n }\n },\n module: {\n rules: [\n {\n enforce: 'pre',\n test: /\\.(js|jsx|tsx|ts)$/,\n exclude: '/node_modules/',\n loader: 'eslint-loader',\n options: {\n fix: true,\n cache: true,\n ignorePattern: __dirname + '/src/js/libs/',\n formatter: require.resolve('eslint-formatter-pretty')\n }\n },\n {\n test: /\\.(js|jsx|tsx|ts)$/,\n loader: 'babel-loader',\n exclude: '/node_modules/',\n options: {\n cacheDirectory: true\n }\n },\n {\n test: /\\.glsl$/,\n exclude: '/node_modules/',\n loader: 'webpack-glsl-loader'\n }\n ]\n },\n mode: isProduction ? 'development' : 'production',\n devtool: !isProduction ? 'eval-cheap-module-source-map' : false,\n performance: {\n hints: process.env.NODE_ENV === 'production' ? 'warning' : false\n },\n optimization: {\n runtimeChunk: {\n name: entrypoint => `runtime-${entrypoint.name}`\n },\n minimize: isProduction,\n splitChunks: {\n // include all types of chunks\n chunks: 'all',\n minSize: 1\n }\n },\n plugins: [\n new webpack.DefinePlugin({\n 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)\n }),\n new EntrypointsPlugin({\n dir: path.resolve(__dirname, 'src/templates/layouts'),\n path: './js'\n }),\n isProduction &&\n new WorkboxWebpackPlugin.InjectManifest({\n swSrc: './static/sw.js',\n swDest: '../sw.js'\n })\n ].filter(Boolean)\n }\n\n // if (isProduction) {\n // // webpackConfig.plugins.push(\n\n // // new BundleAnalyzerPlugin({\n // // analyzerMode: 'server',\n // // analyzerPort: 5500,\n // // openAnalyzer: false\n // // })\n // // )\n // }\n\n return webpackConfig\n}", "title": "" }, { "docid": "c36dfe7bb0a389f37220c938aaf2efd0", "score": "0.6905801", "text": "extend (config, ctx) {\n if (ctx.dev && ctx.isClient) {\n // const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader')\n // vueLoader.options.loaders.sass = 'vue-style-loader!css-loader!px2rem-loader?remUnit=75&remPrecision=8!sass-loader'\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "04c21df97ab459bbc1717f10ce8cf521", "score": "0.689741", "text": "function fixWebpackOverrideNConf(config) {\n if(config.module) {\n if (config.module.noParse) {\n if (!Array.isArray(config.module.noParse)) {\n config.module.noParse = [config.module.noParse];\n }\n\n config.module.noParse = config.module.noParse.map(function (exp) {\n return new RegExp(exp);\n });\n }\n\n if (config.module.loaders) {\n if (!Array.isArray(config.module.loaders)) {\n config.module.loaders = [config.module.loaders];\n }\n\n config.module.loaders = config.module.loaders.map(function (item) {\n if (item.test) {\n item.test = new RegExp(item.test);\n }\n\n return item;\n });\n }\n }\n}", "title": "" }, { "docid": "4358a6861efe17b241da0995278dc205", "score": "0.68884194", "text": "extend(config, ctx) {\n\t\t\tconfig.resolve.alias['~core'] = path.resolve(__dirname, 'core/');\n\n\t\t\tif (ctx.isClient) {\n\t\t\t\tconfig.module.rules.push({\n\t\t\t\t\tenforce: 'pre',\n\t\t\t\t\ttest: /\\.(js|vue)$/,\n\t\t\t\t\tloader: 'eslint-loader',\n\t\t\t\t\texclude: /(node_modules)/\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconfig.module.rules.push({\n\t\t\t\ttest: /\\.svg$/, loader: 'svg-inline-loader', exclude: /node_modules/\n\t\t\t});\n\n\t\t\tconfig.module.rules.push({\n\t\t\t\ttest: /\\.(glsl|frag|vert)$/, loader: 'raw-loader', exclude: /node_modules/\n\t\t\t});\n\n\t\t\tconfig.module.rules.push({\n\t\t\t\ttest: /\\.(glsl|frag|vert)$/, loader: 'glslify-loader', exclude: /node_modules/\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "8b8230c74bad9f5985bce42e44d8cb78", "score": "0.68803245", "text": "function config(opts) {\n const cfg = Object.assign({}, webpackCommonConfig(opts), {\n mode: 'development',\n // devtool: \"inline-source-map\",\n devtool: 'cheap-eval-source-map',\n devServer: {\n port: 9000,\n contentBase: './src',\n watchContentBase: true, // for watch .html files\n index: 'index.html',\n openPage: '',\n // before: function(app) {\n // apiMocker(app, path.resolve('./mocker-api/index.js'));\n //\n // // apiMocker(app, path.resolve('./mocker-api/index.js'), {\n // // proxy: {\n // // '/repos/*': 'https://api.github.com/',\n // // },\n // // changeHost: true,\n // // });\n //\n // // NB: originally express response example\n // // app.get('/some/path', function(req, res) {\n // // res.json({ custom: 'response' });\n // // });\n // },\n // // ,\n // // stats: 'verbose'\n },\n });\n cfg.plugins.push(\n new webpack.EnvironmentPlugin({\n NODE_ENV: 'development', // use 'development' unless process.env.NODE_ENV is defined\n }),\n );\n return cfg;\n}", "title": "" }, { "docid": "552a6c4be19bd73da5731ec5243bdb06", "score": "0.6874164", "text": "extend(config) {\n\t\t\tconfig.resolve.alias.vue = 'vue/dist/vue.common';\n\n\t\t\tconfig.module.rules.push({\n\t\t\t\ttest: /\\.(graphql|gql)$/,\n\t\t\t\texclude: /node_modules/,\n\t\t\t\tloader: 'graphql-tag/loader',\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "16670c9876eccb5cc022458ddd139257", "score": "0.68732613", "text": "function getDefaultWebpackConfig() {\n return {\n devtool: 'eval',\n resolve: {\n extensions: ['.js', '.jsx']\n },\n module: {\n // Using loaders instead of rules to preserve webpack 1.x compatibility\n loaders: [{\n test: /\\.jsx?$/,\n loader: require.resolve('babel-loader'),\n exclude: /node_modules/\n }, {\n test: /\\.css$/,\n loader: require.resolve('style-loader') + '!' + require.resolve('css-loader'),\n exclude: /node_modules/\n }]\n },\n plugins: [new _htmlWebpackPlugin2.default({\n title: 'React Cosmos'\n })]\n };\n}", "title": "" }, { "docid": "bf4d3e7dc940855b22ca6b1265ced2d4", "score": "0.68545914", "text": "webpack(config) {\n return {\n ...config,\n plugins: [...config.plugins, new IgnorePlugin({ resourceRegExp: /react-dom\\/client$/ })],\n };\n }", "title": "" }, { "docid": "dbf2fdbf3119da72e05efd766b393736", "score": "0.682887", "text": "extend (config, { isDev, isClient }) {\n\t\t\tconst vueLoader = config.module.rules.find(\n\t\t\t\t({loader}) => loader === 'vue-loader')\n\t\t\tconst { options: {loaders} } = vueLoader || { options: {} }\n\t\t\tif (loaders) {\n\t\t\t\tfor (const loader of Object.values(loaders)) {\n\t\t\t\t\tchangeLoaderOptions(Array.isArray(loader) ? loader : [loader])\n\t\t\t\t}\n\t\t\t}\n\t\t\tconfig.module.rules.forEach(rule => changeLoaderOptions(rule.use))\n\t\t\tconsole.log('my config', config.module.rules[4].use[3].options)\n \t}", "title": "" }, { "docid": "fcb31107b305f13e3d593e09e765a428", "score": "0.6796596", "text": "extend(config, { isDev, isClient }) {\n config.devtool = 'source-map'\n\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "2f4de232c68869384fead0fa776d14bb", "score": "0.6784461", "text": "extend (config, { isDev, isClient, isServer }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n config.module.rules.push({\n test: /\\.pug$/,\n loader: 'pug-plain-loader',\n options: {\n data: {}\n }\n })\n }\n }", "title": "" }, { "docid": "e3f79a07fd971975f13362b624dbd1e1", "score": "0.6784299", "text": "function config () {\n return {\n name: 'backend build',\n entry: path.resolve('server/main.js'),\n resolve: {\n extensions: ['.js']\n },\n externals: webpackHelper.getExcludedModules(),\n target: 'node',\n output: {\n path: path.resolve('../build/server'),\n filename: 'bundle.js'\n },\n plugins: [\n\n ]\n }\n}", "title": "" }, { "docid": "dc292df8ccf5e17e2231c9d2ffb65a7a", "score": "0.6778754", "text": "extend (config, { isDev, isClient }) {\n config.module.rules.push({\n test: /\\.yml$/,\n use: [\n {\n loader: require.resolve('json-loader')\n },\n {\n loader: require.resolve('yaml-loader')\n }\n ],\n })\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "88dcf336036ebc3d6b92b7ab1925b79c", "score": "0.6774291", "text": "extendWebpack (cfg) {\n cfg.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /node_modules/,\n options: {\n formatter: require('eslint').CLIEngine.getFormatter('stylish'),\n failOnError: true\n }\n })\n }", "title": "" }, { "docid": "c371b8b6ad5dbfd48f099304bd00d02b", "score": "0.67673916", "text": "extend(conf, ctx) {\n // if (ctx.isClient) {\n // conf.plugins\n // .push(new webpack.BannerPlugin({\n // banner: `m.pezy.cn ${config.version} | by pezy.cn Team (c) ${new Date().getFullYear()\n // } | ${dayjs().format('YYYY-MM-DD HH:mm:ss SSS [Z] A')}`\n // }))\n // }\n }", "title": "" }, { "docid": "6a75f5d328593ab48bd18af4d77aa6bb", "score": "0.67556137", "text": "extend(config, { isDev, isClient, isServer }) {\n // if (isServer) {\n // config.resolve.alias[\"hammerjs$\"] =\n // this.options.rootDir + \"node_modules/vue-touch/dist/hammer-ssr.js\";\n // }\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "title": "" }, { "docid": "6dd0622dd7ecd096a2804d99284c9b8b", "score": "0.6748014", "text": "extend (config, ctx) {\n if (ctx.isDev) {\n config.devtool = '#eval-source-map'\n }\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }\n }", "title": "" }, { "docid": "35d0230c840b053da12a7e96bcb3cd2c", "score": "0.67472786", "text": "extendWebpack (cfg) {\n cfg.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules|quasar)/\n })\n cfg.resolve.alias['lodash'] = 'lodash-es'\n }", "title": "" }, { "docid": "a9460448e0400296556230cb166b3ef4", "score": "0.67203623", "text": "extend (config, ctx) {\n if (ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n config.module.rules.push({\n test: /\\.styl$/,\n loader: 'style-loader!css-loader!stylus-loader'\n })\n }\n }", "title": "" }, { "docid": "8e4e61e7053de67967e30c0599d0d306", "score": "0.6719256", "text": "extend(config, { isDev, isModern, isClient }) {\n const getLocalIdent = generateGetLocalIdent(isDev)\n const buildType = isModern ? 'modern' : isClient ? 'client' : 'server'\n console.log(buildType)\n config.plugins.push(\n new LicensePlugin({\n outputFilename: `license-${buildType}.json`,\n unacceptableLicenseTest: (licenseType) => licenseType.match(/GPL/i),\n })\n )\n\n /* config.optimization.concatenateModules = false\n */\n config.module.rules.forEach((rule) => {\n rule.oneOf &&\n rule.oneOf.forEach((useOf) => {\n String(useOf.resourceQuery) === '/module/' &&\n useOf.use &&\n useOf.use.forEach((use) => {\n if (use.loader.match(/vue-style-loader|css-loader/g)) {\n if (!use.options.modules) {\n use.options.modules = {\n getLocalIdent,\n }\n } else {\n delete use.options.modules.localIdentName\n use.options.modules.getLocalIdent = getLocalIdent\n }\n }\n })\n const cssLoaderIndex = useOf.use.findIndex((use) => {\n return use.loader && use.loader.includes('css-loader')\n })\n if (cssLoaderIndex > -1) {\n useOf.use.splice(cssLoaderIndex + 1, 0, {\n loader: path.resolve('fix-classnames-before.js'),\n })\n }\n })\n })\n\n config.module.rules[1].oneOf[0].use.unshift({\n loader: path.resolve('fix-html.js'),\n })\n\n // Sets webpack's mode to development if `isDev` is true.\n if (isDev) {\n config.mode = 'development'\n }\n }", "title": "" }, { "docid": "656b1e2c56b8ff0725ab04c5398d276f", "score": "0.6714995", "text": "extend(config, ctx) {\n config.module.rules.push({\n test: /\\.json$/,\n loader: 'json-loader',\n type: 'javascript/auto'\n })\n }", "title": "" }, { "docid": "2e1f554281539e0e8de606a46ff49cd3", "score": "0.66902333", "text": "extend(config, ctx) {\n\t\t\t// Run ESLint on save\n\t\t\t// const staticDir = ctx.isDev ? '/assets/' : 'cdn.shop-together.io/assets/',\n\t\t\t// config.env.staticDir = staticDir;\n\t\t\tif (ctx.isDev && ctx.isClient) {\n\t\t\t\tconfig.module.rules.push({\n\t\t\t\t\tenforce: 'pre',\n\t\t\t\t\ttest: /\\.(js|vue)$/,\n\t\t\t\t\tloader: 'eslint-loader',\n\t\t\t\t\texclude: /(node_modules)/,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (!ctx.isDev) {\n\t\t\t\tconfig.externals = {\n\t\t\t\t\tstatic: '~/static',\n\t\t\t\t};\n\t\t\t\t// config.module.rules.push({\n\t\t\t\t// \ttest: /\\.(ico|jpg|png|gif|mp4)(\\?.*)?$/,\n\n\t\t\t\t// })\n\t\t\t}\n\t\t\t// if (ctx.isClient) {\n\t\t\t// \tconsole.log('config', config);\n\t\t\t// \tconfig.build.assetsPublicPath = '/';\n\t\t\t// }\n\t\t}", "title": "" }, { "docid": "f2de46fb734769c7264b3069241aad2f", "score": "0.66735494", "text": "extend (config, ctx) {\n if(!ctx.isDev) {\n config.output.publicPath = '_nuxt/'\n }\n ctx.loaders.imgUrl.limit = 100000\n }", "title": "" }, { "docid": "945fcbd3750d8f1fd8bdaadd22bb554a", "score": "0.6666808", "text": "extend(config, {isDev}) {\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "9f4e28f37b0e8e4876e3f76e9f06d3df", "score": "0.6651932", "text": "extend (config, { isDev, isClient, isServer }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n if (isServer) {\n config.externals = [\n nodeExternals({\n whitelist: [/^vuetify/]\n })\n ]\n }\n }", "title": "" }, { "docid": "f9e663e0fbbb2655e3eb011d84e6e32b", "score": "0.66433007", "text": "extend(config, { isDev }) {\n if (isDev && process.client) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n });\n }\n }", "title": "" }, { "docid": "4c26bb7d08314cb23f6c27642a9306c2", "score": "0.66417265", "text": "extend(config, { isClient }) {\n if (isClient) {\n config.devtool = 'source-map'\n }\n }", "title": "" }, { "docid": "41535dc3ac364cf62d0c6983aabb1e06", "score": "0.66413194", "text": "extend(config, { isDev, isClient }) {\n // if (isClient && !isDev) {\n // console.log('1');\n // config.plugins.push(\n // new UglifyJSPlugin({\n // uglifyOptions: {\n // compress: {\n // warnings: false,\n // drop_debugger: true,\n // drop_console: true,\n // },\n // },\n // }),\n // );\n // }\n\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n });\n }\n }", "title": "" }, { "docid": "6c782f53fda656da3595503d6e584969", "score": "0.66329706", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n })\n\n const vueLoader = config.module.rules.find(\n ({ loader }) => loader === \"vue-loader\"\n )\n const {\n options: { loaders }\n } = vueLoader || { options: {} }\n\n if (loaders) {\n for (const loader of Object.values(loaders)) {\n changeLoaderOptions(Array.isArray(loader) ? loader : [loader])\n }\n }\n\n config.module.rules.forEach(rule => changeLoaderOptions(rule.use))\n\n config.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/))\n }\n }", "title": "" }, { "docid": "a6a90b6ed099988aaac2c321efc51384", "score": "0.6631021", "text": "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n })\n }\n\n if (!ctx.isDev) {\n // Remove unused CSS using purgecss. See https://github.com/FullHuman/purgecss\n // for more information about purgecss.\n config.plugins.push(\n new PurgecssPlugin({\n paths: glob.sync([\n path.join(__dirname, './pages/**/*.vue'),\n path.join(__dirname, './layouts/**/*.vue'),\n path.join(__dirname, './components/**/*.vue'),\n ]),\n whitelist: ['html', 'body'],\n })\n )\n }\n\n const svgRule = config.module.rules.find((rule) => rule.test.test('.svg'))\n\n svgRule.test = /\\.(png|jpe?g|gif|webp)$/\n\n config.module.rules.push({\n test: /\\.svg$/,\n loader: 'vue-svg-loader',\n options: {\n // optional [svgo](https://github.com/svg/svgo) options\n svgo: {\n plugins: [{ removeDoctype: true }, { removeComments: true }],\n },\n },\n })\n }", "title": "" }, { "docid": "29d10ea8affe0237c26eabd17c013611", "score": "0.66263586", "text": "extend (config, { isDev, isClient }) {\n // console.log(config)\n config.node = {\n fs: 'empty'\n }\n // Extend the 'data-src' & 'data-srcset' prop to vue-loader img for lazysizes.\n const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader')\n vueLoader.options.transformToRequire['img'] = ['src', 'data-src', 'data-srcset']\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "ad9c474006b00b47dbb18b369451e294", "score": "0.6616887", "text": "extend(config, ctx) {\n const vueLoader = config.module.rules.find(\n rule => rule.loader === \"vue-loader\"\n );\n vueLoader.options.transformAssetUrls = {\n video: [\"src\", \"poster\"],\n source: \"src\",\n img: \"src\",\n image: \"xlink:href\",\n parallaxingImage: \"src\",\n \"parallaxing-image\": \"src\",\n \"b-img\": \"src\",\n \"b-embed\": \"src\"\n };\n }", "title": "" }, { "docid": "9d29d927bdcdaece709c87487e26d92e", "score": "0.66104627", "text": "function generateWebpackConfig(mode, customConfig) {\n const lwcWebpackConfig = buildWebpackConfig({\n entries: [ENTRIES],\n outputDir: OUTPUT_DIR,\n moduleDir: MODULE_DIR,\n mode,\n customConfig\n });\n lwcWebpackConfig.plugins = (lwcWebpackConfig.plugins || []).concat([\n new HtmlWebpackPlugin({\n template: path.resolve(TEMPLATES_DIR, 'index.html')\n })\n ]);\n if (lwcConfig_1.lwcConfig.resources.length) {\n const resources = [];\n lwcConfig_1.lwcConfig.resources.forEach((resource) => {\n resources.push({\n from: path.resolve(process.cwd(), resource.from),\n to: path.join(process.cwd(), resource.to)\n });\n });\n lwcWebpackConfig.plugins = (lwcWebpackConfig.plugins || []).concat([\n new CopyPlugin({ patterns: resources })\n ]);\n }\n // error-overlay-webpack-plugin has a bug that breaks the build when > 1 entry point is specified\n if (Object.keys(lwcWebpackConfig.entry).length == 1) {\n lwcWebpackConfig.plugins = (lwcWebpackConfig.plugins || []).concat([\n // TODO Test potential alternatives for multiple entries\n new ErrorOverlayPlugin()\n ]);\n }\n return lwcWebpackConfig;\n}", "title": "" }, { "docid": "7ce674be3fb9a6408d8249f6a2b52ebb", "score": "0.66094965", "text": "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n\n const vueLoader = config.module.rules.find(\n ({loader}) => loader === 'vue-loader')\n const { options: {loaders} } = vueLoader || { options: {} }\n \n if (loaders) {\n for (const loader of Object.values(loaders)) {\n changeLoaderOptions(Array.isArray(loader) ? loader : [loader])\n }\n }\n\n config.module.rules.forEach(rule => changeLoaderOptions(rule.use))\n }\n }", "title": "" }, { "docid": "ab3505277b9d225d716e4a4536ec7bfe", "score": "0.65943384", "text": "extend(config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "d31be6eb78509392ec1364a150ab078b", "score": "0.6578766", "text": "extend(config, ctx) {\n ctx.loaders.cssModules.localIdentName =\n process.env.NODE_ENV === 'development'\n ? '[path]--[local]---[hash:base64:8]'\n : 'es_[hash:base64:8]'\n ctx.loaders.cssModules.camelCase = true\n\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "1ab4ff7da714a87acad1a41934225be8", "score": "0.6577909", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue|css)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n });\n }\n }", "title": "" }, { "docid": "1e4f149cd7ee1342f2038b00e9d979e2", "score": "0.656583", "text": "extend (config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.d\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "5817ce18bd669954f42f982424969d0a", "score": "0.6564733", "text": "extend (config, ctx) {\n /**\n * PurgeCSS\n */\n if (!ctx.isDev) {\n config.plugins.push(\n\n /**\n * PurgeCSS\n * @see https://github.com/FullHuman/purgecss\n */\n new PurgecssPlugin(purgecssConfig)\n )\n }\n\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "e7b80d660dac5c3611349eb71a1949f6", "score": "0.6547006", "text": "extend(config, {isDev, isClient}) {\n if (isDev && isClient) {\n config.module.rules.push({enforce: 'pre', test: /\\.(js|vue)$/, loader: 'eslint-loader', exclude: /(node_modules)/})\n }\n }", "title": "" }, { "docid": "c47df5a151225f563a6ae268780b06fd", "score": "0.65365255", "text": "extend(config, {isDev, isClient}) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "559641832ca9f5c44264de271fdd66eb", "score": "0.652474", "text": "extend(config, ctx) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }", "title": "" }, { "docid": "2134e1abe6c8828ec472b8830ab04d62", "score": "0.6522999", "text": "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "7851f190cf48afe9444322be2d5ffbe8", "score": "0.65218014", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "7851f190cf48afe9444322be2d5ffbe8", "score": "0.65218014", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "b2bf336a497b06f1debb19177009d544", "score": "0.65215254", "text": "extend(config, ctx) {\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "5722f41718a959cf1c8241b2f8c4d765", "score": "0.65195024", "text": "function formatNormalWebpackCfg(config) {\n\tconfig.module.rules = _.toArray(config.module.rules)\n\tlet plugins = []\n\tformatPlugins(config.plugins, plugins);\n\t\n\tconfig.plugins = plugins\n}", "title": "" }, { "docid": "460350fe5a12d76fe884d180ef356398", "score": "0.6515365", "text": "extend (config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n \n }", "title": "" }, { "docid": "cca81c9bebba2767b57aaf2c4df1cda4", "score": "0.6514246", "text": "function generateWebpackConfigForCanister(name, info) {\n if (typeof info.frontend !== \"object\") {\n return;\n }\n\n const inputRoot = __dirname;\n\n return {\n mode: isDevelopment ? \"development\" : \"production\",\n entry: {\n index: path.join(inputRoot, info.frontend.entrypoint),\n },\n devtool: isDevelopment ? \"cheap-module-source-map\" : \"source-map\",\n optimization: {\n minimize: !isDevelopment,\n minimizer: [new TerserPlugin()],\n },\n resolve: {\n alias: aliases,\n extensions: [\".tsx\", \".ts\", \".js\"],\n },\n output: {\n filename: \"[name].js\",\n path: path.join(__dirname, info.frontend.output),\n },\n module: {\n rules: [\n {\n test: /\\.(js|ts)x?$/,\n exclude: /node_modules/,\n loader: \"babel-loader\",\n options: {\n cacheDirectory: true,\n },\n },\n {\n test: /\\.css$/,\n use: [\n \"style-loader\",\n { loader: \"css-loader\", options: { importLoaders: 1 } },\n {\n loader: \"postcss-loader\",\n options: {\n ident: \"postcss\",\n plugins: [require(\"tailwindcss\"), require(\"autoprefixer\")],\n },\n },\n ],\n },\n {\n test: [/\\.bmp$/, /\\.gif$/, /\\.jpe?g$/, /\\.png$/, /\\.svg$/],\n loader: \"url-loader\",\n },\n ],\n },\n plugins: [new HtmlWebpackPlugin()],\n devServer: {\n proxy: {\n \"/api\": `http://${dfxJson.networks.local.bind}`,\n },\n },\n };\n}", "title": "" }, { "docid": "7ee28b6faed03d47533fd5fec5390e3f", "score": "0.6504785", "text": "extend(config, ctx) {\n // 图库替换\n lodash.update(config, 'resolve.alias', alias => {\n return lodash.merge({\n // '@xt/client': path.resolve(path.dirname(process.cwd()), 'client'),\n \"@ant-design/icons/lib/dist$\": path.resolve(process.cwd(), 'plugins/icon.ts'),\n }, alias)\n });\n // i18n 单文件组件 https://kazupon.github.io/vue-i18n/zh/guide/sfc.html#%E5%AE%89%E8%A3%85-vue-i18n-loader\n lodash.update(config, 'module.rules', rules => {\n rules.push({\n resourceQuery: /blockType=i18n/,\n type: 'javascript/auto',\n loader: '@kazupon/vue-i18n-loader'\n })\n return rules\n })\n // console.log(\"extend -> config\", config.module.rules)\n }", "title": "" }, { "docid": "d91a9b3ab8b7839c0980a159398bef91", "score": "0.64937764", "text": "extend(config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "d91a9b3ab8b7839c0980a159398bef91", "score": "0.64937764", "text": "extend(config, ctx) {\n if (ctx.dev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "14862ae43a3477440e0e05dfc5aec7b8", "score": "0.6491299", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "14862ae43a3477440e0e05dfc5aec7b8", "score": "0.6491299", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "14862ae43a3477440e0e05dfc5aec7b8", "score": "0.6491299", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n }", "title": "" }, { "docid": "ecac7cd9428fa46fdbb6a054097d1290", "score": "0.64861226", "text": "extend(config, ctx) {\n // Run ESLint on save\n if (ctx.isDev && ctx.isClient) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/\n })\n }\n config.module.rules.push({\n test: /\\.md$/,\n loader: 'frontmatter-markdown-loader'\n })\n }", "title": "" }, { "docid": "512fe758918bc192477bb0391d8c1008", "score": "0.64853734", "text": "extend(config, ctx) {\n // Run ESLint on save\n // if (ctx.isDev && ctx.isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n }", "title": "" }, { "docid": "de7c0548b6f1feeeaf4ff052f095a8d2", "score": "0.648373", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "title": "" }, { "docid": "de7c0548b6f1feeeaf4ff052f095a8d2", "score": "0.648373", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "title": "" }, { "docid": "de7c0548b6f1feeeaf4ff052f095a8d2", "score": "0.648373", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "title": "" }, { "docid": "de7c0548b6f1feeeaf4ff052f095a8d2", "score": "0.648373", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/\n });\n }\n }", "title": "" }, { "docid": "54181550719a3faaf162848ca0a59b2b", "score": "0.6474276", "text": "extend(config, ctx) {\n if (ctx.isDev) {\n config.devtool = ctx.isClient ? 'source-map' : 'inline-source-map'\n }\n }", "title": "" }, { "docid": "70c0db19dc9160e5ab94a35da2982c86", "score": "0.64697886", "text": "extend (config, ctx) {\r\n if (ctx.isClient) {\r\n config.module.rules.push({\r\n enforce: 'pre',\r\n test: /\\.(js|vue)$/,\r\n loader: 'eslint-loader',\r\n exclude: /(node_modules)/\r\n }, {\r\n test: /\\.js$/,\r\n loader: 'babel-loader',\r\n exclude: /(node_modules)/,\r\n options:{\r\n plugins: ['@babel/plugin-syntax-dynamic-import']\r\n }\r\n })\r\n }\r\n }", "title": "" }, { "docid": "2f68c7361755b9b20cd98899358c42a3", "score": "0.6469304", "text": "extend(config, { isDev, isClient }) {\n if (isDev && isClient) {\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n });\n }\n }", "title": "" }, { "docid": "54d154385bb63e6ba5d671f7076f461c", "score": "0.6465811", "text": "extend (config, {isDev, isClient})\n {\n if (isDev && isClient)\n {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options : {\n fix : true\n }\n })\n }\n }", "title": "" }, { "docid": "9284d190438aee0ef5a92eec28ba2c28", "score": "0.64622384", "text": "extend(config, ctx) {\n config.module.rules.push({\n test: /\\.vue$/,\n loader: 'vue-svg-inline-loader',\n options: {\n /* ... */\n }\n })\n }", "title": "" } ]
4521162247daf504912047872ba0467a
Animated works by building a directed acyclic graph of dependencies transparently when you render your Animated components. new Animated.Value(0) .interpolate() .interpolate() new Animated.Value(1) opacity translateY scale style transform View234 style View123 A) Top Down phase When an Animated.Value is updated, we recursively go down through this graph in order to find leaf nodes: the views that we flag as needing an update. B) Bottom Up phase When a view is flagged as needing an update, we recursively go back up in order to build the new value that it needs. The reason why we need this twophases process is to deal with composite props such as transform which can receive values from multiple parents.
[ { "docid": "79852e4f72ed388fefa2e24a1dd48a4f", "score": "0.0", "text": "function findAnimatedStyles$1(node, styles) {\n if (typeof node.update === 'function') styles.add(node);else node.getChildren().forEach(function (child) {\n return findAnimatedStyles$1(child, styles);\n });\n}", "title": "" } ]
[ { "docid": "f97b4d26161e1e327d15749d196ce8d9", "score": "0.61825347", "text": "_ensureAnimated(values, shouldUpdate) {\n if (shouldUpdate === void 0) {\n shouldUpdate = false;\n }\n\n if (!_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].obj(values)) return;\n\n for (const key in values) {\n const value = values[key];\n let animated = this.animated[key];\n\n if (animated && shouldUpdate && this.animations[key].isNew) {\n // Ensure the initial value is up-to-date.\n if (animated.setValue) {\n animated.setValue(computeGoalValue(value));\n } else {\n // Derived nodes need to be swapped out.\n animated = null;\n }\n }\n\n if (!animated) {\n animated = createAnimated(value);\n\n if (this.animated[key]) {\n // Swap out the old node with the new node.\n moveChildren(this.animated[key], animated);\n }\n\n this.animated[key] = animated;\n\n this._stopAnimation(key, true);\n }\n }\n }", "title": "" }, { "docid": "53a99752a3991d14dab9eff62f3db4d3", "score": "0.59280896", "text": "render() {\n return (\n <Animated.View style={this.position.getLayout()}>\n <View style={styles.ball} />\n </Animated.View>\n );\n }", "title": "" }, { "docid": "959bc11127a87ab4f510fe93c8779c9b", "score": "0.58979076", "text": "_animate(props) {\n const _this$props = this.props,\n _this$props$from = _this$props.from,\n from = _this$props$from === void 0 ? emptyObj : _this$props$from,\n _this$props$to = _this$props.to,\n to = _this$props$to === void 0 ? emptyObj : _this$props$to,\n parent = _this$props.parent,\n onAnimate = _this$props.onAnimate,\n onStart = _this$props.onStart;\n\n if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].fun(onAnimate)) {\n onAnimate(props, this);\n }\n\n let isPrevented = _ => false;\n\n if (props.cancel && this._isModified(props, 'cancel')) {\n // Stop all animations when `cancel` is true\n if (props.cancel === true) {\n this.stop(); // Prevent pending updates from *before* this update only!\n // (This must come after the `stop` call above)\n\n this.cancelledAt = props.timestamp;\n return this;\n } // Prevent matching properties from animating when\n // `cancel` is a string or array of strings\n\n\n const keys = Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"toArray\"])(props.cancel);\n\n if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].arr(keys) && keys.length) {\n isPrevented = key => keys.indexOf(key) >= 0;\n\n this.stop(...keys);\n }\n } // Merge `from` values with `to` values\n\n\n this.merged = freeze(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, from, to)); // True if any animation was updated\n\n let changed = false; // The animations that are starting or restarting\n\n const started = []; // Attach when a new \"parent\" controller exists.\n\n const isAttaching = parent && this._isModified(props, 'parent'); // Reduces input { key: value } pairs into animation objects\n\n\n for (const key in this.merged) {\n if (isPrevented(key)) continue;\n const state = this.animations[key];\n\n if (!state) {\n console.warn(`Failed to animate key: \"${key}\"\\n` + `Did you forget to define \"from.${key}\" for an async animation?`);\n continue;\n } // Reuse the Animated nodes whenever possible\n\n\n let animated = state.animated,\n animatedValues = state.animatedValues;\n const value = this.merged[key];\n const goalValue = computeGoalValue(value);\n const currValue = animated.getValue(); // Stop animations with a goal value equal to its current value.\n\n if (!props.reset && !isAttaching && isEqual(goalValue, currValue)) {\n // The animation might be stopped already.\n if (!state.idle) {\n changed = true;\n\n this._stopAnimation(key);\n }\n\n continue;\n } // Replace an animation when its goal value is changed (or it's been reset)\n\n\n if (props.reset || isAttaching || !isEqual(goalValue, state.isNew ? currValue : state.goalValue)) {\n const immediate = !!callProp((_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].und(props.immediate) ? this.props : props).immediate, key);\n const isActive = animatedValues.some(node => !node.done);\n const fromValue = !_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].und(from[key]) ? computeGoalValue(from[key]) : goalValue; // Animatable strings use interpolation\n\n const isInterpolated = isAnimatableString(value);\n\n if (isInterpolated) {\n const output = [props.reset ? fromValue : currValue, goalValue];\n let input = animatedValues[0];\n\n if (input) {\n input.setValue(0, false);\n input.reset(isActive);\n } else {\n input = new _react_spring_animated__WEBPACK_IMPORTED_MODULE_6__[\"AnimatedValue\"](0);\n }\n\n try {\n const prev = animated;\n animated = input.to({\n output\n });\n moveChildren(prev, animated);\n } catch (err) {\n console.warn('Failed to interpolate string from \"%s\" to \"%s\"', output[0], output[1]);\n console.error(err);\n continue;\n }\n\n if (_react_spring_shared_globals__WEBPACK_IMPORTED_MODULE_5__[\"skipAnimation\"]) {\n input.setValue(1);\n\n this._stopAnimation(key);\n\n continue;\n }\n\n if (immediate) {\n input.setValue(1, false);\n }\n } else {\n // Convert values into Animated nodes (reusing nodes whenever possible)\n if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].arr(value)) {\n if (animated instanceof _react_spring_animated__WEBPACK_IMPORTED_MODULE_6__[\"AnimatedArray\"]) {\n if (props.reset) animated.setValue(fromValue, false);\n Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(animatedValues, node => node.reset(isActive));\n } else {\n const prev = animated;\n animated = createAnimated(fromValue);\n moveChildren(prev, animated);\n }\n } else {\n if (animated instanceof _react_spring_animated__WEBPACK_IMPORTED_MODULE_6__[\"AnimatedValue\"]) {\n if (props.reset) animated.setValue(fromValue, false);\n animated.reset(isActive);\n } else {\n const prev = animated;\n animated = new _react_spring_animated__WEBPACK_IMPORTED_MODULE_6__[\"AnimatedValue\"](fromValue);\n moveChildren(prev, animated);\n }\n }\n\n if (_react_spring_shared_globals__WEBPACK_IMPORTED_MODULE_5__[\"skipAnimation\"]) {\n animated.setValue(goalValue);\n\n this._stopAnimation(key);\n\n continue;\n }\n\n if (immediate) {\n animated.setValue(goalValue, false);\n }\n } // Only change the \"config\" of updated animations.\n\n\n const config = callProp(props.config, key) || callProp(this.props.config, key) || emptyObj;\n\n if (!(immediate || _react_spring_shared_globals__WEBPACK_IMPORTED_MODULE_5__[\"skipAnimation\"])) {\n started.push(key);\n }\n\n const fromValues = animatedValues.map(v => v.getValue());\n const toValues = parent && parent.getPayload(key) || Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"toArray\"])(isInterpolated ? 1 : goalValue);\n changed = true;\n this.animations[key] = {\n key,\n idle: false,\n goalValue,\n toValues,\n fromValues,\n animated,\n animatedValues: Array.from(animated.getPayload()),\n immediate,\n duration: config.duration,\n easing: withDefault(config.easing, linear),\n decay: config.decay,\n mass: withDefault(config.mass, 1),\n tension: withDefault(config.tension, 170),\n friction: withDefault(config.friction, 26),\n initialVelocity: withDefault(config.velocity, 0),\n clamp: withDefault(config.clamp, false),\n precision: withDefault(config.precision, 0.005),\n config\n };\n }\n }\n\n if (changed) {\n if (started.length) {\n this._attach(started);\n\n if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].fun(onStart)) Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(started, key => {\n onStart(this.animations[key]);\n });\n } // Make animations available to the frameloop\n\n\n const keys = Object.keys(this.animations);\n this.configs.length = keys.length;\n Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(keys, (key, i) => {\n const config = this.animations[key];\n this.configs[i] = config;\n this.values[key] = config.animated.getValue();\n this.animated[key] = config.animated;\n });\n }\n\n return this;\n }", "title": "" }, { "docid": "42cfced7b408e7411b68929523d8339b", "score": "0.5758491", "text": "update(propsArg) {\n if (!propsArg || this.destroyed) return this;\n const props = interpolateTo(propsArg); // For async animations, the `from` prop must be defined for\n // the Animated nodes to exist before animations have started.\n\n this._ensureAnimated(props.from, true);\n\n this._ensureAnimated(props.to);\n\n props.timestamp = Object(_react_spring_shared_globals__WEBPACK_IMPORTED_MODULE_5__[\"now\"])(); // The `delay` prop of every update must be a number >= 0\n\n if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].fun(props.delay) && _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].obj(props.to)) {\n const from = props.from || emptyObj;\n\n for (const key in props.to) {\n this.queue.push(Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({}, props, {\n to: {\n [key]: props.to[key]\n },\n from: key in from ? {\n [key]: from[key]\n } : void 0,\n delay: Math.max(0, Math.round(props.delay(key)))\n }));\n }\n } else {\n props.delay = _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].num(props.delay) ? Math.max(0, Math.round(props.delay)) : 0; // Coerce falsy values to undefined for these props\n\n if (!props.to) props.to = void 0;\n if (!props.from) props.from = void 0;\n this.queue.push(props);\n }\n\n return this;\n }", "title": "" }, { "docid": "74d9593fee8dbe1f13216f2db83e2244", "score": "0.57548016", "text": "animate() {\n var tl = new TimelineMax({\n delay: 0.42,\n repeat: -1,\n repeatDelay: 2,\n yoyo: true\n });\n\n tl.to(\"#shadow\", 2, {\n scale:this.state.progress\n }, 0).to(\"#tree\", 2, {\n scale:this.state.progress\n }, 0).to(\"#leaf-rb\", 2, {\n scale:this.state.progress,\n rotation:'0cw',\n y: 0,\n delay: 0.35\n }, 0).to(\"#leaf-rm\", 2, {\n scale:this.state.progress,\n rotation:'0cw',\n y: 0,\n delay: 0.35\n }, 0).to(\"#leaf-lb\", 2, {\n scale:this.state.progress,\n rotation:'0cw',\n y: 0,\n delay: 0.35\n }, 0).to(\"#leaf-lm\", 2, {\n scale:this.state.progress,\n rotation:'0cw',\n y: 0,\n delay: 0.35\n }, 0).to(\"#leaf-top\", 2.5, {\n scale:this.state.progress,\n delay: 0.35\n }, 0).to(\"#leaf-lb g\", 2.25, {\n scale:this.state.progress,\n delay: 0.5\n }, 0).to(\"#leaf-lm g\", 2.25, {\n scale:this.state.progress,\n delay: 0.6\n }, 0).to(\"#leaf-rb g\", 2.25, {\n scale:this.state.progress,\n delay: 0.5\n }, 0).to(\"#leaf-rm g\", 2.25, {\n scale:this.state.progress,\n delay: 0.6\n }, 0);\n\n return tl;\n }", "title": "" }, { "docid": "172165aeda8bea0ed4022a8af50127a0", "score": "0.5724847", "text": "componentDidMount(){\n Animated.timing(this.fadeRestIn, {\n duration: 1000,\n toValue: 1\n }).start()\n}", "title": "" }, { "docid": "eec9b2ad32550f70bd1f37654ed88a24", "score": "0.5692087", "text": "componentWillUpdate() {\n LayoutAnimation.configureNext({\n ...LayoutAnimation.Presets.easeInEaseOut,\n duration: this.props.animationDuration\n });\n }", "title": "" }, { "docid": "8e0fd7c56b0c84dcfc34022fb73e9cd7", "score": "0.5676151", "text": "function genAnimate(ChildComponent) {\n var Animate = function (_React$Component) {\n __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(Animate, _React$Component);\n\n function Animate() {\n var _ref;\n\n var _temp, _this, _ret;\n\n __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, Animate);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, (_ref = Animate.__proto__ || Object.getPrototypeOf(Animate)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n appeared: true,\n mergedChildren: []\n }, _this.onChildLeaved = function (key) {\n // Remove child which not exist anymore\n if (!_this.hasChild(key)) {\n var mergedChildren = _this.state.mergedChildren;\n\n _this.setState({\n mergedChildren: mergedChildren.filter(function (node) {\n return node.key !== key;\n })\n });\n }\n }, _this.hasChild = function (key) {\n var children = _this.props.children;\n\n\n return Object(__WEBPACK_IMPORTED_MODULE_8_rc_util_es_Children_toArray__[\"a\" /* default */])(children).some(function (node) {\n return node && node.key === key;\n });\n }, _temp), __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(_this, _ret);\n }\n // [Legacy] Not sure usage\n // commit: https://github.com/react-component/animate/commit/0a1cbfd647407498b10a8c6602a2dea80b42e324\n // eslint-disable-line\n\n __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default()(Animate, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n // No need to re-render\n this.state.appeared = false;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _state = this.state,\n appeared = _state.appeared,\n mergedChildren = _state.mergedChildren;\n var _props = this.props,\n Component = _props.component,\n componentProps = _props.componentProps,\n className = _props.className,\n style = _props.style,\n showProp = _props.showProp;\n\n\n var $children = mergedChildren.map(function (node) {\n if (mergedChildren.length > 1 && !node.key) {\n __WEBPACK_IMPORTED_MODULE_9_fbjs_lib_warning___default()(false, 'must set key for <rc-animate> children');\n return null;\n }\n\n var show = true;\n\n if (!_this2.hasChild(node.key)) {\n show = false;\n } else if (showProp) {\n show = node.props[showProp];\n }\n\n var key = node.key || defaultKey;\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ChildComponent,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, _this2.props, {\n appeared: appeared,\n show: show,\n className: node.props.className,\n style: node.props.style,\n key: key,\n\n animateKey: node.key // Keep trans origin key\n , onChildLeaved: _this2.onChildLeaved\n }),\n node\n );\n });\n\n // Wrap with component\n if (Component) {\n var passedProps = this.props;\n if (typeof Component === 'string') {\n passedProps = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({\n className: className,\n style: style\n }, componentProps);\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n Component,\n passedProps,\n $children\n );\n }\n\n return $children[0] || null;\n }\n }], [{\n key: 'getDerivedStateFromProps',\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var _prevState$prevProps = prevState.prevProps,\n prevProps = _prevState$prevProps === undefined ? {} : _prevState$prevProps;\n\n var newState = {\n prevProps: Object(__WEBPACK_IMPORTED_MODULE_11__util__[\"b\" /* cloneProps */])(nextProps, clonePropList)\n };\n var showProp = nextProps.showProp;\n\n\n function processState(propName, updater) {\n if (prevProps[propName] !== nextProps[propName]) {\n updater(nextProps[propName]);\n return true;\n }\n return false;\n }\n\n processState('children', function (children) {\n var currentChildren = Object(__WEBPACK_IMPORTED_MODULE_8_rc_util_es_Children_toArray__[\"a\" /* default */])(children).filter(function (node) {\n return node;\n });\n var prevChildren = prevState.mergedChildren.filter(function (node) {\n // Remove prev child if not show anymore\n if (currentChildren.every(function (_ref2) {\n var key = _ref2.key;\n return key !== node.key;\n }) && showProp && !node.props[showProp]) {\n return false;\n }\n return true;\n });\n\n // Merge prev children to keep the animation\n newState.mergedChildren = Object(__WEBPACK_IMPORTED_MODULE_11__util__[\"e\" /* mergeChildren */])(prevChildren, currentChildren);\n });\n\n return newState;\n }\n }]);\n\n return Animate;\n }(__WEBPACK_IMPORTED_MODULE_5_react___default.a.Component);\n\n Animate.isAnimate = true;\n Animate.propTypes = {\n component: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.any,\n componentProps: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,\n animation: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,\n transitionName: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object]),\n transitionEnter: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,\n transitionAppear: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,\n exclusive: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,\n transitionLeave: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.bool,\n onEnd: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,\n onEnter: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,\n onLeave: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,\n onAppear: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.func,\n showProp: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string,\n children: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.node,\n style: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.object,\n className: __WEBPACK_IMPORTED_MODULE_6_prop_types___default.a.string\n };\n Animate.defaultProps = {\n animation: {},\n component: 'span',\n componentProps: {},\n transitionEnter: true,\n transitionLeave: true,\n transitionAppear: false\n };\n\n\n Object(__WEBPACK_IMPORTED_MODULE_7_react_lifecycles_compat__[\"a\" /* polyfill */])(Animate);\n\n return Animate;\n}", "title": "" }, { "docid": "9dae77d57170f48c2de6150b28fa2e4c", "score": "0.5641255", "text": "advance(config, changes) {\n const time = Object(_react_spring_shared_globals__WEBPACK_IMPORTED_MODULE_5__[\"now\"])();\n let active = false;\n let changed = false;\n\n for (let i = 0; i < config.animatedValues.length; i++) {\n const animated = config.animatedValues[i];\n if (animated.done) continue;\n changed = true;\n let to = config.toValues[i];\n const target = to instanceof _react_spring_animated__WEBPACK_IMPORTED_MODULE_6__[\"Animated\"] ? to : null;\n if (target) to = target.getValue(); // Jump to end value for immediate animations\n\n if (config.immediate) {\n animated.setValue(to);\n animated.done = true;\n continue;\n }\n\n const from = config.fromValues[i];\n const startTime = animated.startTime; // Break animation when string values are involved\n\n if (typeof from === 'string' || typeof to === 'string') {\n animated.setValue(to);\n animated.done = true;\n continue;\n }\n\n let finished = false;\n let position = animated.lastPosition;\n let velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[i] : config.initialVelocity; // Duration easing\n\n if (config.duration !== void 0) {\n position = from + config.easing((time - startTime) / config.duration) * (to - from);\n finished = time >= startTime + config.duration;\n } // Decay easing\n else if (config.decay) {\n const decay = config.decay === true ? 0.998 : config.decay;\n position = from + velocity / (1 - decay) * (1 - Math.exp(-(1 - decay) * (time - startTime)));\n finished = Math.abs(animated.lastPosition - position) < 0.1;\n if (finished) to = position;\n } // Spring easing\n else {\n let lastTime = animated.lastTime !== void 0 ? animated.lastTime : time;\n\n if (animated.lastVelocity !== void 0) {\n velocity = animated.lastVelocity;\n } // If we lost a lot of frames just jump to the end.\n\n\n if (time > lastTime + 64) lastTime = time; // http://gafferongames.com/game-physics/fix-your-timestep/\n\n const numSteps = Math.floor(time - lastTime);\n\n for (let n = 0; n < numSteps; ++n) {\n const force = -config.tension * (position - to);\n const damping = -config.friction * velocity;\n const acceleration = (force + damping) / config.mass;\n velocity = velocity + acceleration * 1 / 1000;\n position = position + velocity * 1 / 1000;\n }\n\n animated.lastTime = time;\n animated.lastVelocity = velocity; // Conditions for stopping the spring animation\n\n const isOvershooting = config.clamp && config.tension !== 0 ? from < to ? position > to : position < to : false;\n const isVelocity = Math.abs(velocity) <= config.precision;\n const isDisplacement = config.tension !== 0 ? Math.abs(to - position) <= config.precision : true;\n finished = isOvershooting || isVelocity && isDisplacement;\n } // Trails aren't done until their parents conclude\n\n\n if (finished && !(target && !target.done)) {\n // Ensure that we end up with a round value\n if (animated.value !== to) position = to;\n animated.done = true;\n } else {\n active = true;\n }\n\n animated.setValue(position);\n animated.lastPosition = position;\n }\n\n if (changes && changed) {\n changes.push([config.key, config.animated.getValue()]);\n }\n\n return active;\n }", "title": "" }, { "docid": "d0caa84e51b73c09212c720d3d8db82c", "score": "0.5620199", "text": "function genAnimate(ChildComponent) {\n var Animate = function (_React$Component) {\n inherits_default()(Animate, _React$Component);\n\n function Animate() {\n var _ref;\n\n var _temp, _this, _ret;\n\n classCallCheck_default()(this, Animate);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = possibleConstructorReturn_default()(this, (_ref = Animate.__proto__ || Object.getPrototypeOf(Animate)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n appeared: true,\n mergedChildren: []\n }, _this.onChildLeaved = function (key) {\n // Remove child which not exist anymore\n if (!_this.hasChild(key)) {\n var mergedChildren = _this.state.mergedChildren;\n\n _this.setState({\n mergedChildren: mergedChildren.filter(function (node) {\n return node.key !== key;\n })\n });\n }\n }, _this.hasChild = function (key) {\n var children = _this.props.children;\n\n\n return toArray(children).some(function (node) {\n return node && node.key === key;\n });\n }, _temp), possibleConstructorReturn_default()(_this, _ret);\n }\n // [Legacy] Not sure usage\n // commit: https://github.com/react-component/animate/commit/0a1cbfd647407498b10a8c6602a2dea80b42e324\n // eslint-disable-line\n\n createClass_default()(Animate, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n // No need to re-render\n this.state.appeared = false;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _state = this.state,\n appeared = _state.appeared,\n mergedChildren = _state.mergedChildren;\n var _props = this.props,\n Component = _props.component,\n componentProps = _props.componentProps,\n className = _props.className,\n style = _props.style,\n showProp = _props.showProp;\n\n\n var $children = mergedChildren.map(function (node) {\n if (mergedChildren.length > 1 && !node.key) {\n warning_default()(false, 'must set key for <rc-animate> children');\n return null;\n }\n\n var show = true;\n\n if (!_this2.hasChild(node.key)) {\n show = false;\n } else if (showProp) {\n show = node.props[showProp];\n }\n\n var key = node.key || defaultKey;\n\n return external_root_React_var_React_commonjs_react_commonjs2_react_amd_react_default.a.createElement(\n ChildComponent,\n extends_default()({}, _this2.props, {\n appeared: appeared,\n show: show,\n className: node.props.className,\n style: node.props.style,\n key: key,\n\n animateKey: node.key // Keep trans origin key\n , onChildLeaved: _this2.onChildLeaved\n }),\n node\n );\n });\n\n // Wrap with component\n if (Component) {\n var passedProps = this.props;\n if (typeof Component === 'string') {\n passedProps = extends_default()({\n className: className,\n style: style\n }, componentProps);\n }\n\n return external_root_React_var_React_commonjs_react_commonjs2_react_amd_react_default.a.createElement(\n Component,\n passedProps,\n $children\n );\n }\n\n return $children[0] || null;\n }\n }], [{\n key: 'getDerivedStateFromProps',\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var _prevState$prevProps = prevState.prevProps,\n prevProps = _prevState$prevProps === undefined ? {} : _prevState$prevProps;\n\n var newState = {\n prevProps: cloneProps(nextProps, Animate_clonePropList)\n };\n var showProp = nextProps.showProp;\n\n\n function processState(propName, updater) {\n if (prevProps[propName] !== nextProps[propName]) {\n updater(nextProps[propName]);\n return true;\n }\n return false;\n }\n\n processState('children', function (children) {\n var currentChildren = toArray(children).filter(function (node) {\n return node;\n });\n var prevChildren = prevState.mergedChildren.filter(function (node) {\n // Remove prev child if not show anymore\n if (currentChildren.every(function (_ref2) {\n var key = _ref2.key;\n return key !== node.key;\n }) && showProp && !node.props[showProp]) {\n return false;\n }\n return true;\n });\n\n // Merge prev children to keep the animation\n newState.mergedChildren = mergeChildren(prevChildren, currentChildren);\n });\n\n return newState;\n }\n }]);\n\n return Animate;\n }(external_root_React_var_React_commonjs_react_commonjs2_react_amd_react_default.a.Component);\n\n Animate.isAnimate = true;\n Animate.propTypes = {\n component: _prop_types_15_7_2_prop_types_default.a.any,\n componentProps: _prop_types_15_7_2_prop_types_default.a.object,\n animation: _prop_types_15_7_2_prop_types_default.a.object,\n transitionName: _prop_types_15_7_2_prop_types_default.a.oneOfType([_prop_types_15_7_2_prop_types_default.a.string, _prop_types_15_7_2_prop_types_default.a.object]),\n transitionEnter: _prop_types_15_7_2_prop_types_default.a.bool,\n transitionAppear: _prop_types_15_7_2_prop_types_default.a.bool,\n exclusive: _prop_types_15_7_2_prop_types_default.a.bool,\n transitionLeave: _prop_types_15_7_2_prop_types_default.a.bool,\n onEnd: _prop_types_15_7_2_prop_types_default.a.func,\n onEnter: _prop_types_15_7_2_prop_types_default.a.func,\n onLeave: _prop_types_15_7_2_prop_types_default.a.func,\n onAppear: _prop_types_15_7_2_prop_types_default.a.func,\n showProp: _prop_types_15_7_2_prop_types_default.a.string,\n children: _prop_types_15_7_2_prop_types_default.a.node,\n style: _prop_types_15_7_2_prop_types_default.a.object,\n className: _prop_types_15_7_2_prop_types_default.a.string\n };\n Animate.defaultProps = {\n animation: {},\n component: 'span',\n componentProps: {},\n transitionEnter: true,\n transitionLeave: true,\n transitionAppear: false\n };\n\n\n Object(react_lifecycles_compat_es[\"polyfill\"])(Animate);\n\n return Animate;\n}", "title": "" }, { "docid": "da296c53108a1a6561439f5e1c889f0a", "score": "0.55910736", "text": "animate (toValue) {\n Animated.spring(\n this.state.animationValue, {\n toValue: toValue,\n duration: duration,\n friction: 9,\n useNativeDriver: (IOS)\n }\n ).start()\n }", "title": "" }, { "docid": "15df32f3c750ab99f7cb7135fbe19f82", "score": "0.5582265", "text": "componentWillMount() {\n const { animatedValue } = this.state\n\n this.interpolate = animatedValue.interpolate({\n inputRange: [0, 180],\n outputRange: ['0deg', '180deg'],\n })\n }", "title": "" }, { "docid": "e8fb16cf0773c0d9dd7c6a4f534219b8", "score": "0.5579823", "text": "render() {\n return (\n <View style={styles.container}>\n <Image // Render the image\n source={{uri: commURL}}\n style={styles.header}\n />\n <Image // Render the image\n source={require('./vibe_logo_simple.png')}\n style={styles.title}\n />\n <Animated.Image // Render the image\n source={{uri: commURL}}\n style={styles.iconUser0}\n />\n <Animated.Image // Render the image\n source={{uri: commURL}}\n style={styles.iconUser1}\n />\n <Animated.Image // Render the image\n source={{uri: commURL}}\n style={styles.iconUser2}\n />\n <View style={styles.arrowTail0_2} />\n <View style={styles.arrowHead0_2} />\n <View style={styles.arrowTail2_0} />\n <View style={styles.arrowHead2_0} />\n <View style={styles.arrowTail0_1} />\n <View style={styles.arrowHead0_1} />\n <View style={styles.arrowTail1_0} />\n <View style={styles.arrowHead1_0} />\n <View style={styles.arrowTail1_2} />\n <View style={styles.arrowHead1_2} />\n <View style={styles.arrowTail2_1} />\n <View style={styles.arrowHead2_1} />\n </View>\n );\n }", "title": "" }, { "docid": "a3a600e55cac3f588b11a9d84d23ae72", "score": "0.555533", "text": "willRender(action, frameStamp, elapsed) {\n let hasChanged = false;\n\n // Check if base values have updated \n for (let i = 0; i < this.numValueKeys; i++) {\n const key = this.valueKeys[i];\n const value = this.values[key];\n\n // Run transform function (if present)\n if (value.transform) {\n value.current = value.transform(value.current, key, this);\n }\n\n // Cap minimum\n if (isNum(value.min)) {\n value.current = Math.max(value.current, value.min);\n }\n\n // Cap maximum\n if (isNum(value.max)) {\n value.current = Math.min(value.current, value.max);\n }\n\n // Round number\n if (value.round) {\n value.current = Math.round(value.current);\n }\n\n value.frameChange = value.current - value.prev;\n\n // Update velocity\n if (!this.calculatesVelocity) {\n value.velocity = speedPerSecond(value.frameChange, elapsed);\n }\n\n // If this value has changed\n if (value.prev !== value.current) {\n hasChanged = true;\n value.prev = value.current;\n }\n\n // Append unit\n const valueForState = (value.type && value.type.serialize) ? value.type.serialize(value.current, value) : value.current;\n\n // Add to state if this is not a child vaue\n if (!value.parent) {\n this.state[key] = valueForState;\n } else {\n this.values[value.parent].children[value.childKey] = valueForState;\n }\n }\n\n // Update parent values\n for (let i = 0; i < this.numParentKeys; i++) {\n const key = this.parentKeys[i];\n const value = this.values[key];\n\n value.current = value.type.combine(value.children, value.template);\n\n this.state[key] = value.current;\n }\n\n if (this.onFrame) {\n this.onFrame(this.state, this);\n }\n\n return (this.onCleanup) ? true : hasChanged;\n }", "title": "" }, { "docid": "499773347f50cfb22ba537f1b21cb404", "score": "0.55540526", "text": "toggle() {\n //Step 1\n let initialValue = this.state.expanded? this.state.maxHeight + this.state.minHeight : this.state.minHeight,\n finalValue = this.state.expanded? this.state.minHeight : this.state.maxHeight + this.state.minHeight;\n this.setState({\n expanded : !this.state.expanded //Step 2\n }, () => {\n this.state.animation.setValue(initialValue); //Step 3\n Animated.spring( //Step 4\n this.state.animation,\n {\n toValue: finalValue\n }\n ).start(); //Step 5\n }); \n }", "title": "" }, { "docid": "647526eefaaa3cb35c828425875c2dcd", "score": "0.55500877", "text": "animateIndicator(toValue) {\n const { indicatorAnimation } = this.state;\n\n Animated.timing(indicatorAnimation, {\n toValue,\n duration: 512,\n easing: Easing.elastic(1),\n }).start();\n }", "title": "" }, { "docid": "1c85aefc2b614a428603ef8be746de80", "score": "0.55241174", "text": "_animate() {\n const { animate, duration, stagger, timing, playback, jsOnly } = this.props;\n const { classKey } = this.state;\n\n const isStartNewAnim = animate !== false && classKey !== this._lastClassKey;\n const isAnimJS = isMsBrowser() || jsOnly;\n\n // >>> STARTING NEW ANIMATION...\n if ( isStartNewAnim ) {\n\n // set flags\n this._animStart = Date.now();\n this._lastClassKey = classKey;\n\n // parse out vars common for both modes\n const startDelay = typeof animate === 'number' ? animate : 0; // if numeric, treat as delay (ms)\n let numOfRepeats = parseInt( playback, 10 ) || 0;\n\n /* ----- JS MODE ----- */\n if ( isAnimJS ) {\n\n // parse props for use with Tween.js\n if ( numOfRepeats > 0 ) { numOfRepeats = numOfRepeats - 1; }\n if ( contains( playback, 'infinite' ) ) { numOfRepeats = Infinity; }\n const isYoYo = contains( playback, 'alternate' );\n\n // acquire path elems and generate to/from data sets\n this._pathElems = this._selectPathElems();\n const pathData = this._getPathData( this._pathElems );\n this._pathDataFrom = pathData.from;\n this._pathDataTo = pathData.to;\n\n // TODO: if ( contains( playback, 'reverse' ) ) { ... };\n\n // init tweener object\n this._tweenData = { ...this._pathDataFrom };\n\n // set paths' offsets to start positions\n this._setStrokeDasharray( this._pathElems, this._pathDataFrom );\n this._setStrokeDashoffset( this._pathElems, this._tweenData );\n\n // init the tweener..\n const tween = new TWEEN.Tween( this._tweenData )\n .to( this._pathDataTo, duration )\n .easing( EASING[ timing ] )\n .repeat( numOfRepeats )\n .yoyo( isYoYo )\n .onUpdate( this._onTweenUpdate )\n .onComplete( this._onAnimComplete );\n\n // kick off JS tweening..\n const t = setTimeout( () => {\n tween.start();\n TWEEN.update();\n clearTimeout( t );\n }, Math.max( 1, startDelay ) );\n\n /* ----- CSS MODE ----- */\n } else {\n\n let css ='';\n\n // 1) determine number of path elems in svg\n const pathLenghts = this._getPathLengths();\n const pathQty = pathLenghts.length || 1;\n\n // 2) calc all timing values\n const staggerMult = clamp( stagger, 0, 100 ) / 100; // convert percentage to 0-1\n const pathStaggerDelay = ( stagger > 0 ? duration/pathQty * staggerMult : 0 );\n const pathDrawDuration = ( stagger > 0 ? duration - (( pathStaggerDelay * ( pathQty - 1 ) ) * ( 2 - staggerMult )) : duration );\n\n // 3) concat generated CSS, one path at a time..\n pathLenghts.forEach( ( length, index ) => {\n css += this._getPathCSS( index, length, startDelay, pathStaggerDelay, pathDrawDuration );\n });\n\n // set up on-complete timer\n const t = setTimeout( () => {\n clearTimeout( t );\n this._onAnimComplete();\n }, startDelay + duration * ( numOfRepeats ) );\n\n // set state (re-render)\n this.setState( { css } );\n }\n\n // >>> ONGOING ANIMATION...\n } else if ( this._animStart ) {\n\n /* ----- JS MODE ----- */\n if ( isAnimJS ) {\n requestAnimationFrame( TWEEN.update );\n\n /* ----- CSS MODE ----- */\n } else {\n // NOTE: nothing to do, browser does its thing...\n }\n }\n }", "title": "" }, { "docid": "bc7d7aaacffa49e918155ef5c504eb10", "score": "0.5515118", "text": "componentDidMount() {\n const { opacity } = this.state\n\n Animated.timing(opacity, { toValue: 1, duration: 1200 })\n .start()\n }", "title": "" }, { "docid": "23bdfbff27326b9eb668b67a29c341b3", "score": "0.5483717", "text": "handleAnimation(index){\n const timing = Animated.timing;\n const width = this.getWidth(this.state.gameStats[index]);\n const indicators = ['pts', 'ast', 'reb', 'stl', 'blk', 'to', 'min', 'fgm', 'fga', '_3pm', '_3pa', 'ftm', 'fta'];\n Animated.parallel(indicators.map(item => {\n return timing(this.state[item], {toValue: width[item]});\n })).start();\n this.setState({\n currentIndex: index\n });\n }", "title": "" }, { "docid": "ff060f1fba4552be928bf3e282729436", "score": "0.54824394", "text": "function genAnimate(ChildComponent) {\n var Animate = function (_React$Component) {\n (0, _inherits2.default)(Animate, _React$Component);\n\n function Animate() {\n var _ref;\n\n var _temp, _this, _ret;\n\n (0, _classCallCheck2.default)(this, Animate);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = (0, _possibleConstructorReturn2.default)(this, (_ref = Animate.__proto__ || Object.getPrototypeOf(Animate)).call.apply(_ref, [this].concat(args))), _this), _this.state = {\n appeared: true,\n mergedChildren: []\n }, _this.onChildLeaved = function (key) {\n // Remove child which not exist anymore\n if (!_this.hasChild(key)) {\n var mergedChildren = _this.state.mergedChildren;\n\n _this.setState({\n mergedChildren: mergedChildren.filter(function (node) {\n return node.key !== key;\n })\n });\n }\n }, _this.hasChild = function (key) {\n var children = _this.props.children;\n return (0, _toArray.default)(children).some(function (node) {\n return node && node.key === key;\n });\n }, _temp), (0, _possibleConstructorReturn2.default)(_this, _ret);\n } // [Legacy] Not sure usage\n // commit: https://github.com/react-component/animate/commit/0a1cbfd647407498b10a8c6602a2dea80b42e324\n // eslint-disable-line\n\n\n (0, _createClass2.default)(Animate, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n // No need to re-render\n this.state.appeared = false;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _state = this.state,\n appeared = _state.appeared,\n mergedChildren = _state.mergedChildren;\n var _props = this.props,\n Component = _props.component,\n componentProps = _props.componentProps,\n className = _props.className,\n style = _props.style,\n showProp = _props.showProp;\n var $children = mergedChildren.map(function (node) {\n if (mergedChildren.length > 1 && !node.key) {\n (0, _warning.default)(false, 'must set key for <rc-animate> children');\n return null;\n }\n\n var show = true;\n\n if (!_this2.hasChild(node.key)) {\n show = false;\n } else if (showProp) {\n show = node.props[showProp];\n }\n\n var key = node.key || defaultKey;\n return _react.default.createElement(ChildComponent, (0, _extends2.default)({}, _this2.props, {\n appeared: appeared,\n show: show,\n className: node.props.className,\n style: node.props.style,\n key: key,\n animateKey: node.key // Keep trans origin key\n ,\n onChildLeaved: _this2.onChildLeaved\n }), node);\n }); // Wrap with component\n\n if (Component) {\n var passedProps = this.props;\n\n if (typeof Component === 'string') {\n passedProps = (0, _extends2.default)({\n className: className,\n style: style\n }, componentProps);\n }\n\n return _react.default.createElement(Component, passedProps, $children);\n }\n\n return $children[0] || null;\n }\n }], [{\n key: 'getDerivedStateFromProps',\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var _prevState$prevProps = prevState.prevProps,\n prevProps = _prevState$prevProps === undefined ? {} : _prevState$prevProps;\n var newState = {\n prevProps: (0, _util.cloneProps)(nextProps, clonePropList)\n };\n var showProp = nextProps.showProp;\n\n function processState(propName, updater) {\n if (prevProps[propName] !== nextProps[propName]) {\n updater(nextProps[propName]);\n return true;\n }\n\n return false;\n }\n\n processState('children', function (children) {\n var currentChildren = (0, _toArray.default)(children).filter(function (node) {\n return node;\n });\n var prevChildren = prevState.mergedChildren.filter(function (node) {\n // Remove prev child if not show anymore\n if (currentChildren.every(function (_ref2) {\n var key = _ref2.key;\n return key !== node.key;\n }) && showProp && !node.props[showProp]) {\n return false;\n }\n\n return true;\n }); // Merge prev children to keep the animation\n\n newState.mergedChildren = (0, _util.mergeChildren)(prevChildren, currentChildren);\n });\n return newState;\n }\n }]);\n return Animate;\n }(_react.default.Component);\n\n Animate.isAnimate = true;\n Animate.propTypes = {\n component: _propTypes.default.any,\n componentProps: _propTypes.default.object,\n animation: _propTypes.default.object,\n transitionName: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),\n transitionEnter: _propTypes.default.bool,\n transitionAppear: _propTypes.default.bool,\n exclusive: _propTypes.default.bool,\n transitionLeave: _propTypes.default.bool,\n onEnd: _propTypes.default.func,\n onEnter: _propTypes.default.func,\n onLeave: _propTypes.default.func,\n onAppear: _propTypes.default.func,\n showProp: _propTypes.default.string,\n children: _propTypes.default.node,\n style: _propTypes.default.object,\n className: _propTypes.default.string\n };\n Animate.defaultProps = {\n animation: {},\n component: 'span',\n componentProps: {},\n transitionEnter: true,\n transitionLeave: true,\n transitionAppear: false\n };\n (0, _reactLifecyclesCompat.polyfill)(Animate);\n return Animate;\n}", "title": "" }, { "docid": "1f87234b3b20efc1e9248f0bd87f7924", "score": "0.54581517", "text": "handleAnimate(){\n Animated.timing(this.state.animatedValue, { // Make the input wiggle\n toValue: 2,\n easing: Easing.elastic(5),\n duration: 1000,\n }).start();\n this.setState({ifWiggle: this.props.wiggle}) // refresh the value by querying props\n \n //after the animation, re-initilize the default value\n setTimeout(() => { \n this.state.animatedValue.setValue(0)\n }, 1000);\n }", "title": "" }, { "docid": "7be6bfe90f4f5d874ac0a20c3fde2d84", "score": "0.541563", "text": "RunAnimation() {\n let newLeft = this.GenerateLeft();\n let newColor = this.GenerateColor();\n this.setState({sleft: newLeft});\n this.setState({baloonColor: newColor});\n this.state.topAnim.setValue(this.GenerateStartPosition());\n Animated.loop(\n Animated.timing(\n this.state.topAnim,\n {\n toValue: 0,\n duration: 10000\n })).start();\n }", "title": "" }, { "docid": "98f14e5f1ec15a7908bff4a68087475c", "score": "0.5392974", "text": "attachProps(_ref) {\n let forwardRef = _ref.forwardRef,\n nextProps = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_ref, [\"forwardRef\"]);\n\n const oldPropsAnimated = this.propsAnimated;\n this.propsAnimated = new AnimatedProps(nextProps, this.callback); // When you call detach, it removes the element from the parent list\n // of children. If it goes to 0, then the parent also detaches itself\n // and so on.\n // An optimization is to attach the new elements and THEN detach the old\n // ones instead of detaching and THEN attaching.\n // This way the intermediate state isn't to go to 0 and trigger\n // this expensive recursive detaching to then re-attach everything on\n // the very next operation.\n\n oldPropsAnimated && oldPropsAnimated.detach();\n }", "title": "" }, { "docid": "83c3f45a082712041d6a819d0e67cb3a", "score": "0.538052", "text": "animate() {\n if (this.props.calendarAnimation) {\n let animations = arr.map((item) => {\n return Animated.timing(\n this.animatedValue[item],\n {\n toValue: 1,\n duration: this.props.calendarAnimation.duration,\n easing: Easing.linear\n }\n );\n });\n\n if (this.props.calendarAnimation.type.toLowerCase() === 'sequence') {\n Animated.sequence(animations).start();\n } else {\n if (this.props.calendarAnimation.type.toLowerCase() === 'parallel') {\n Animated.parallel(animations).start();\n } else {\n throw new Error('CalendarStrip Error! Type of animation is incorrect!');\n }\n }\n }\n }", "title": "" }, { "docid": "141283f80d00118e9c2e994f7b437a8d", "score": "0.537765", "text": "updateAnimation() { }", "title": "" }, { "docid": "5a046b1f4e47845bf682605eca3550dd", "score": "0.5348669", "text": "animatePaths(from, to, duration, callback) {\n let fromPaths = from.paths;\n let fromSVG = from.parentSVG;\n\n let toPaths = to.paths;\n let toSVG = to.parentSVG;\n\n let fromSVGID = fromSVG.id;\n let t1 = timeline();\n\n for (let i = 0; i < fromPaths.length; i++) {\n let fromPathID = (fromPaths[i].id = fromSVGID + \"Path\" + i);\n\n let fromD = fromPaths[i].getAttribute(\"d\");\n let toD = toPaths[i].getAttribute(\"d\");\n\n let target = \"#\" + fromPathID;\n\n t1.fromTo(0, duration, {\n targets: target,\n duration: duration,\n props: {\n d: {\n value: [fromD, toD],\n interpolate: this.interpolateWithFlubber\n }\n }\n });\n\n t1.play();\n }\n\n // animate viewbox of the SVG\n let newViewBox = toSVG.getAttribute(\"viewBox\");\n let t2 = timeline();\n t2.animate({\n targets: fromSVG,\n duration: duration,\n props: {\n viewBox: {\n value: [fromSVG.getAttribute(\"viewBox\"), newViewBox],\n interpolate: SVGMorpher.interpolateViewBox\n }\n }\n });\n t2.play().on(\"finish\", () => {\n // report as animation done!\n callback(true);\n });\n }", "title": "" }, { "docid": "0e4e53c5c04d9908155a42290c19670c", "score": "0.5346479", "text": "componentDidMount() {\n this.props.socket.on(\n \"game-over-event\",\n (socketId, rank, username, distance, avgspeed) => {\n if (this.props.socket.id == socketId) {\n this.setState({ rank });\n this.setState({ username });\n this.setState({ distance });\n this.setState({ avgspeed });\n }\n }\n );\n Animated.sequence([\n Animated.timing(this.state.B_Anim, {\n toValue: 350,\n duration: cloud_B_velo\n }),\n Animated.timing(this.state.B_Anim, {\n toValue: -80,\n duration: 1\n })\n ]).start();\n Animated.sequence([\n Animated.timing(this.state.C_Anim, {\n toValue: 350,\n duration: cloud_C_velo\n }),\n Animated.timing(this.state.C_Anim, {\n toValue: -100,\n duration: 1\n })\n ]).start();\n Animated.sequence([\n Animated.timing(this.state.A_Anim, {\n toValue: 350,\n duration: cloud_A_velo\n }),\n Animated.timing(this.state.A_Anim, {\n toValue: -230,\n duration: 1\n })\n ]).start();\n setInterval(\n //interval for cloud A\n () =>\n Animated.sequence([\n Animated.timing(this.state.A_Anim, {\n toValue: 350,\n duration: cloud_A_velo\n }),\n Animated.timing(this.state.A_Anim, {\n toValue: -230,\n duration: 1\n })\n ]).start(), // start the sequence group\n cloud_A_velo + 50\n );\n setInterval(\n //interval for cloud B\n () =>\n Animated.sequence([\n Animated.timing(this.state.B_Anim, {\n toValue: 350,\n duration: cloud_B_velo\n }),\n Animated.timing(this.state.B_Anim, {\n toValue: -80,\n duration: 1\n })\n ]).start(), // start the sequence group\n cloud_B_velo + 50\n );\n setInterval(\n //interval for cloud C\n () =>\n Animated.sequence([\n Animated.timing(this.state.C_Anim, {\n toValue: 350,\n duration: cloud_C_velo\n }),\n Animated.timing(this.state.C_Anim, {\n toValue: -100,\n duration: 1\n })\n ]).start(), // start the sequence group\n cloud_C_velo + 50\n );\n }", "title": "" }, { "docid": "43b75e4881bd42d3887e5c45931bf7da", "score": "0.5339094", "text": "async _runAnimate() {\r\n\r\n let animData = {\r\n attributes: [],\r\n maxFPS: 1000 / game.settings.get('core', \"maxFPS\"),\r\n lastTimespan: performance.now(),\r\n totalDt: 0\r\n }\r\n\r\n let overallDuration = this._duration ? this._duration : 0;\r\n\r\n if (this._rotateTowards) {\r\n\r\n let offset = (this._angle ? this._angle : 0) + this._rotateTowards.offset;\r\n\r\n let targetLoc = this._moveTowards?.target || this._teleportTo?.target || this._originObject;\r\n\r\n targetLoc = this._closestSquare\r\n ? this._getClosestSquare(this._originObject, targetLoc)\r\n : this._getCleanPosition(targetLoc);\r\n\r\n targetLoc.x += this._offset.x;\r\n targetLoc.y += this._offset.y;\r\n\r\n if (this._snapToSquare) targetLoc = this._snapLocationToGrid(targetLoc);\r\n\r\n animData.attributes.push({\r\n name: \"rotationTowards\",\r\n offset: offset,\r\n origin: this._originObject,\r\n originLocation: targetLoc,\r\n target: this._rotateTowards.target,\r\n towardsCenter: this._rotateTowards.towardsCenter,\r\n from: false,\r\n to: false,\r\n progress: 0,\r\n done: false,\r\n duration: this._rotateTowards.duration,\r\n durationDone: 0,\r\n delay: this._rotateTowards.delay,\r\n ease: easeFunctions[this._rotateTowards.ease]\r\n })\r\n\r\n let rotateDuration = this._rotateTowards.duration + this._rotateTowards.delay;\r\n\r\n overallDuration = overallDuration > rotateDuration ? overallDuration : rotateDuration;\r\n\r\n }\r\n\r\n if (this._fadeIn) {\r\n\r\n let to = typeof this._opacity === \"number\" ? this._opacity : 1.0;\r\n\r\n animData.attributes.push({\r\n name: \"alpha\",\r\n from: 0.0,\r\n to: to,\r\n progress: 0,\r\n done: false,\r\n duration: this._fadeIn.duration,\r\n durationDone: 0,\r\n delay: this._fadeIn.delay,\r\n ease: easeFunctions[this._fadeIn.ease]\r\n })\r\n\r\n let fadeDuration = this._fadeIn.duration + this._fadeIn.delay;\r\n\r\n overallDuration = overallDuration > fadeDuration ? overallDuration : fadeDuration;\r\n\r\n }\r\n\r\n if (this._fadeInAudio && this._originObject?.data?.video?.volume !== undefined) {\r\n\r\n let to = typeof this._volume === \"number\" ? this._volume : 1.0;\r\n\r\n animData.attributes.push({\r\n name: \"video.volume\",\r\n from: 0.0,\r\n to: to,\r\n progress: 0,\r\n done: false,\r\n duration: this._fadeInAudio.duration,\r\n durationDone: 0,\r\n delay: this._fadeInAudio.delay,\r\n ease: easeFunctions[this._fadeInAudio.ease]\r\n })\r\n\r\n let fadeDuration = this._fadeInAudio.duration + this._fadeInAudio.delay;\r\n\r\n overallDuration = overallDuration > fadeDuration ? overallDuration : fadeDuration;\r\n\r\n }\r\n\r\n if (this._rotateIn) {\r\n\r\n let from = this._angle ? this._angle : this._originObject.data.rotation;\r\n let to = this._rotateIn.value;\r\n\r\n if (Math.abs(from - to) > 180) {\r\n if (to < 0) {\r\n to += 360;\r\n } else if (from > to) {\r\n from -= 360;\r\n }\r\n }\r\n\r\n animData.attributes.push({\r\n name: \"rotation\",\r\n from: from,\r\n to: to,\r\n progress: 0,\r\n done: false,\r\n duration: this._rotateIn.duration,\r\n durationDone: 0,\r\n delay: this._rotateIn.delay,\r\n ease: easeFunctions[this._rotateIn.ease]\r\n })\r\n\r\n let rotateDuration = this._rotateIn.duration + this._rotateIn.delay;\r\n\r\n overallDuration = overallDuration > rotateDuration ? overallDuration : rotateDuration;\r\n\r\n }\r\n\r\n if (this._moveTowards) {\r\n\r\n let originLoc = this._getCleanPosition(this._originObject);\r\n let targetLoc = this._closestSquare\r\n ? this._getClosestSquare(this._originObject, this._moveTowards.target)\r\n : this._getCleanPosition(this._moveTowards.target);\r\n\r\n targetLoc.x += this._offset.x;\r\n targetLoc.y += this._offset.y;\r\n\r\n if (this._snapToSquare) targetLoc = this._snapLocationToGrid(targetLoc);\r\n\r\n let originalDx = targetLoc.x - originLoc.x;\r\n let originalDy = targetLoc.y - originLoc.y;\r\n let originalDistance = Math.sqrt(originalDx * originalDx + originalDy * originalDy);\r\n\r\n let duration = this._duration\r\n ? this._duration\r\n : (originalDistance / this._moveSpeed) * animData.maxFPS;\r\n\r\n let moveDuration = duration + this._moveTowards.delay;\r\n\r\n overallDuration = overallDuration > moveDuration ? overallDuration : moveDuration;\r\n\r\n if (!this._duration && this._moveTowards.ease === \"linear\") {\r\n await this._updateObject(this._originObject, targetLoc, true);\r\n } else {\r\n animData.attributes.push({\r\n name: \"position\",\r\n origin: originLoc,\r\n target: targetLoc,\r\n originalDistance: originalDistance,\r\n currentDistance: 0,\r\n progress: 0,\r\n speed: 0,\r\n duration: duration,\r\n done: false,\r\n ease: easeFunctions[this._moveTowards.ease],\r\n delay: this._moveTowards.delay\r\n })\r\n }\r\n }\r\n\r\n if (this._fadeOut) {\r\n\r\n let from = typeof this._opacity === \"number\" ? this._opacity : this._originObject.alpha;\r\n\r\n animData.attributes.push({\r\n name: \"alpha\",\r\n from: from,\r\n to: 0.0,\r\n progress: 0,\r\n done: false,\r\n duration: this._fadeOut.duration,\r\n durationDone: 0,\r\n delay: overallDuration - this._fadeOut.duration,\r\n ease: easeFunctions[this._fadeOut.ease]\r\n })\r\n }\r\n\r\n if (this._fadeOutAudio && this._originObject?.data?.video?.volume !== undefined) {\r\n\r\n let from = typeof this._volume === \"number\" ? this._volume : this._originObject.data.video.volume;\r\n\r\n animData.attributes.push({\r\n name: \"video.volume\",\r\n from: from,\r\n to: 0.0,\r\n progress: 0,\r\n done: false,\r\n duration: this._fadeOutAudio.duration,\r\n durationDone: 0,\r\n delay: overallDuration - this._fadeOutAudio.duration,\r\n ease: easeFunctions[this._fadeOutAudio.ease]\r\n })\r\n }\r\n\r\n if (this._rotateOut) {\r\n\r\n let from = this._rotateOut.value;\r\n let to = this._angle ? this._angle : this._originObject.data.rotation;\r\n\r\n if (this._rotateIn) from += this._rotateIn.value;\r\n\r\n if (Math.abs(from - to) > 180) {\r\n if (to < 0) {\r\n to += 360;\r\n } else if (from > to) {\r\n from -= 360;\r\n }\r\n }\r\n\r\n animData.attributes.push({\r\n name: \"rotation\",\r\n from: from,\r\n to: to,\r\n progress: 0,\r\n done: false,\r\n duration: this._rotateOut.duration,\r\n durationDone: 0,\r\n delay: overallDuration - this._rotateOut.duration,\r\n ease: easeFunctions[this._rotateOut.ease]\r\n });\r\n\r\n }\r\n\r\n if (this._teleportTo) {\r\n setTimeout(async () => {\r\n let targetLocation = this._closestSquare\r\n ? this._getClosestSquare(this._originObject, this._teleportTo.target)\r\n : this._getCleanPosition(this._teleportTo.target);\r\n targetLocation.x += this._offset.x;\r\n targetLocation.y += this._offset.y;\r\n if (this._snapToSquare) targetLocation = this._snapLocationToGrid(targetLocation);\r\n await this._updateObject(this._originObject, targetLocation);\r\n }, this._teleportTo.delay);\r\n if (overallDuration <= this._teleportTo.delay) {\r\n this._waitUntilFinished = true;\r\n }\r\n overallDuration = overallDuration > this._teleportTo.delay ? overallDuration : this._teleportTo.delay;\r\n }\r\n\r\n let updateAttributes = {};\r\n if (typeof this._angle === \"number\" && !this._rotateIn && !this._rotateOut) {\r\n updateAttributes[\"rotation\"] = this._angle;\r\n }\r\n\r\n if (typeof this._opacity === \"number\" && !this._fadeIn && !this._fadeOut) {\r\n updateAttributes[\"alpha\"] = this._opacity;\r\n }\r\n\r\n if (typeof this._volume === \"number\" && !this._fadeInAudio && !this._fadeOutAudio && this._originObject?.data?.video?.volume !== undefined) {\r\n updateAttributes[\"video.volume\"] = this._volume;\r\n }\r\n\r\n if (Object.keys(updateAttributes).length) {\r\n setTimeout(async () => {\r\n await this._updateObject(this._originObject, updateAttributes);\r\n }, 1);\r\n }\r\n\r\n return new Promise(async (resolve) => {\r\n this._animate(animData, resolve);\r\n setTimeout(resolve, Math.max(0, overallDuration + this._waitUntilFinishedDelay + animData.maxFPS));\r\n })\r\n\r\n }", "title": "" }, { "docid": "f5f156e785004951f71fb436dfc6b8c8", "score": "0.5271894", "text": "updateTransition(d, i) {\n const { position } = d;\n const {x, y} = getPositionFlat(position);\n return {\n x: [x],\n y: [y],\n timing: {\n duration: ANIMATION_DURATIONS.MOVE_DURATION,\n },\n };\n }", "title": "" }, { "docid": "9345a15c49b90d4f468f640b5716aa5b", "score": "0.52557564", "text": "function AnimationAnimateChildMetadata() {}", "title": "" }, { "docid": "b3fee928f7efa5e15c81e931b5dc5155", "score": "0.5223974", "text": "function AnimationAnimateChildMetadata(){}", "title": "" }, { "docid": "3f50688df20efb84d4f765a6db646d45", "score": "0.5197732", "text": "function createAnimated(value) {\n return _react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].arr(value) ? new _react_spring_animated__WEBPACK_IMPORTED_MODULE_6__[\"AnimatedArray\"](value.map(createAnimated)) : isAnimatableString(value) ? // Convert \"red\" into \"rgba(255, 0, 0, 1)\" etc\n new _react_spring_animated__WEBPACK_IMPORTED_MODULE_6__[\"AnimatedValue\"](0).to({\n output: [value, value]\n }) : // The `AnimatedValue` class supports any type, but only numbers are\n // interpolated by the frameloop.\n new _react_spring_animated__WEBPACK_IMPORTED_MODULE_6__[\"AnimatedValue\"](value);\n}", "title": "" }, { "docid": "83cd57a8e900406cdac119f023759f4d", "score": "0.5197332", "text": "animateTo(component, resultState, animation, finishedCallback) {\n let startState = get(component, '_previousState');\n let shadow = get(component, 'shadow');\n let ease = getEasingFunction(animation.ease);\n let start = null;\n\n this.addToQueue(time => {\n if(start === null) {\n start = time;\n }\n\n // Get the overall percent complete.\n let percentComplete = getPercentComplete(start, time, animation.duration, animation.delay);\n\n // Get the \"eased\" percent complete.\n let easePercent = ease(percentComplete);\n\n // Interpolate the current state\n let currentState = interpolate(startState, resultState, easePercent);\n\n // Save the current state\n component._previousState = currentState;\n\n // Update the shadown's attributes\n shadow.setAttributes(currentState);\n\n // If we're done, let the animation queue know.\n if(percentComplete >= 1) {\n if(finishedCallback) {\n finishedCallback(this);\n }\n return true;\n } else {\n return false;\n }\n });\n }", "title": "" }, { "docid": "11da26443d86c78c2d25e60eae5debee", "score": "0.5176851", "text": "function createAnimatedComponent(Component) {\r\n var AnimatedComponentGenerated = /** @class */ (function (_super) {\r\n __extends(AnimatedComponentGenerated, _super);\r\n function AnimatedComponentGenerated(props) {\r\n var _this = _super.call(this, props) || this;\r\n _this._mountedComponent = null;\r\n _this._onMount = function (component) {\r\n _this._mountedComponent = component;\r\n };\r\n _this._animatedAttributes = {};\r\n _this._animatedTransforms = {};\r\n _this._updateStyles(props);\r\n return _this;\r\n }\r\n AnimatedComponentGenerated.prototype.setNativeProps = function (props) {\r\n if (AppConfig_1.default.isDevelopmentMode()) {\r\n console.error('setNativeProps not supported on web');\r\n }\r\n };\r\n AnimatedComponentGenerated.prototype.UNSAFE_componentWillReceiveProps = function (props) {\r\n this._updateStyles(props);\r\n };\r\n AnimatedComponentGenerated.prototype.setValue = function (valueObject, newValue) {\r\n // We should never get here if the component isn't mounted,\r\n // but we'll add this additional protection.\r\n if (!this._mountedComponent) {\r\n return;\r\n }\r\n var attrib = this._findAnimatedAttributeByValue(this._animatedAttributes, valueObject);\r\n if (attrib) {\r\n var domNode = this._getDomNode();\r\n if (domNode) {\r\n var cssValue = this._generateCssAttributeValue(attrib, valueObject._getOutputValue());\r\n domNode.style[attrib] = cssValue;\r\n }\r\n return;\r\n }\r\n var transform = this._findAnimatedAttributeByValue(this._animatedTransforms, valueObject);\r\n if (transform) {\r\n var domNode = this._getDomNode();\r\n if (domNode) {\r\n domNode.style.transform = this._generateCssTransformList(true);\r\n }\r\n }\r\n };\r\n AnimatedComponentGenerated.prototype.startTransition = function (valueObject, fromValue, toValue, duration, easing, delay, onEnd) {\r\n // We should never get here if the component isn't mounted,\r\n // but we'll add this additional protection.\r\n if (!this._mountedComponent) {\r\n return;\r\n }\r\n var updateTransition = false;\r\n var attrib = this._findAnimatedAttributeByValue(this._animatedAttributes, valueObject);\r\n if (attrib) {\r\n if (this._animatedAttributes[attrib].activeTransition) {\r\n if (AppConfig_1.default.isDevelopmentMode()) {\r\n console.error('Animation started while animation was already pending');\r\n }\r\n }\r\n this._animatedAttributes[attrib].activeTransition = {\r\n property: Styles_1.default.convertJsToCssStyle(attrib),\r\n from: this._generateCssAttributeValue(attrib, fromValue),\r\n to: this._generateCssAttributeValue(attrib, toValue),\r\n duration: duration,\r\n timing: easing,\r\n delay: delay,\r\n toValue: toValue,\r\n onEnd: onEnd,\r\n };\r\n updateTransition = true;\r\n }\r\n var transform = this._findAnimatedAttributeByValue(this._animatedTransforms, valueObject);\r\n if (transform) {\r\n if (this._animatedTransforms[transform].activeTransition) {\r\n if (AppConfig_1.default.isDevelopmentMode()) {\r\n console.error('Animation started while animation was already pending');\r\n }\r\n }\r\n this._animatedTransforms[transform].activeTransition = {\r\n property: transform,\r\n from: fromValue,\r\n to: toValue,\r\n duration: duration,\r\n timing: easing,\r\n delay: delay,\r\n toValue: toValue,\r\n onEnd: onEnd,\r\n };\r\n updateTransition = true;\r\n }\r\n if (updateTransition) {\r\n this._updateTransition();\r\n }\r\n };\r\n // Stops a pending transition, returning the value at the current time.\r\n AnimatedComponentGenerated.prototype.stopTransition = function (valueObject) {\r\n // We should never get here if the component isn't mounted,\r\n // but we'll add this additional protection.\r\n if (!this._mountedComponent) {\r\n return;\r\n }\r\n var partialValue;\r\n var stoppedTransition;\r\n var updateTransition = false;\r\n var attrib = this._findAnimatedAttributeByValue(this._animatedAttributes, valueObject);\r\n if (attrib) {\r\n var activeTransition = this._animatedAttributes[attrib].activeTransition;\r\n if (activeTransition) {\r\n partialValue = activeTransition.toValue;\r\n // We don't currently support updating to an intermediate\r\n // value for interpolated values because this would involve\r\n // mapping the interpolated value in reverse. Instead, we'll\r\n // simply update it to the \"toValue\".\r\n if (!valueObject._isInterpolated()) {\r\n var domNode = this._getDomNode();\r\n if (domNode) {\r\n var computedStyle = window.getComputedStyle(domNode, undefined);\r\n if (computedStyle && computedStyle[attrib]) {\r\n partialValue = computedStyle[attrib];\r\n }\r\n }\r\n }\r\n stoppedTransition = this._animatedAttributes[attrib].activeTransition;\r\n delete this._animatedAttributes[attrib].activeTransition;\r\n updateTransition = true;\r\n }\r\n }\r\n else {\r\n var transform = this._findAnimatedAttributeByValue(this._animatedTransforms, valueObject);\r\n if (transform) {\r\n var activeTransition = this._animatedTransforms[transform].activeTransition;\r\n if (activeTransition) {\r\n // We don't currently support updating to an intermediate value\r\n // for transform values. This is because getComputedStyle\r\n // returns a transform matrix for 'transform'. To implement this, we'd\r\n // need to convert the matrix back to a rotation, scale, etc.\r\n partialValue = activeTransition.toValue;\r\n stoppedTransition = this._animatedTransforms[transform].activeTransition;\r\n delete this._animatedTransforms[transform].activeTransition;\r\n updateTransition = true;\r\n }\r\n }\r\n }\r\n if (stoppedTransition && stoppedTransition.onEnd) {\r\n stoppedTransition.onEnd({ finished: false });\r\n }\r\n if (updateTransition) {\r\n this._updateTransition();\r\n }\r\n return partialValue;\r\n };\r\n AnimatedComponentGenerated.prototype._getDomNode = function () {\r\n return ReactDOM.findDOMNode(this._mountedComponent);\r\n };\r\n // Looks for the specified value object in the specified map. Returns\r\n // the key for the map (i.e. the attribute name) if found.\r\n AnimatedComponentGenerated.prototype._findAnimatedAttributeByValue = function (map, valueObj) {\r\n var keys = _.keys(map);\r\n var index = _.findIndex(keys, function (key) { return map[key].valueObject === valueObj; });\r\n return index >= 0 ? keys[index] : undefined;\r\n };\r\n // Updates the \"transform\" CSS attribute for the element to reflect all\r\n // active transitions.\r\n AnimatedComponentGenerated.prototype._updateTransition = function () {\r\n var _this = this;\r\n // We should never get here if the component isn't mounted,\r\n // but we'll add this additional protection.\r\n if (!this._mountedComponent) {\r\n return;\r\n }\r\n var activeTransitions = [];\r\n _.each(this._animatedAttributes, function (attrib) {\r\n if (attrib.activeTransition) {\r\n activeTransitions.push(attrib.activeTransition);\r\n }\r\n });\r\n // If there are any transform transitions, we need to combine\r\n // these into a single transition. That means we can't specify\r\n // different durations, delays or easing functions for each. That's\r\n // an unfortunate limitation of CSS.\r\n var keys = _.keys(this._animatedTransforms);\r\n var index = _.findIndex(keys, function (key) { return !!_this._animatedTransforms[key].activeTransition; });\r\n if (index >= 0) {\r\n var transformTransition = this._animatedTransforms[keys[index]].activeTransition;\r\n activeTransitions.push({\r\n property: 'transform',\r\n from: this._generateCssTransformList(false),\r\n to: this._generateCssTransformList(true),\r\n duration: transformTransition.duration,\r\n timing: transformTransition.timing,\r\n delay: transformTransition.delay,\r\n });\r\n }\r\n if (activeTransitions.length > 0) {\r\n var domNode = this._getDomNode();\r\n if (domNode) {\r\n executeTransition_1.executeTransition(domNode, activeTransitions, function () {\r\n // Clear all of the active transitions and invoke the onEnd callbacks.\r\n var completeTransitions = [];\r\n _.each(_this._animatedAttributes, function (attrib) {\r\n if (attrib.activeTransition) {\r\n completeTransitions.push(attrib.activeTransition);\r\n delete attrib.activeTransition;\r\n }\r\n });\r\n _.each(_this._animatedTransforms, function (transform) {\r\n if (transform.activeTransition) {\r\n completeTransitions.push(transform.activeTransition);\r\n delete transform.activeTransition;\r\n }\r\n });\r\n _.each(completeTransitions, function (transition) {\r\n if (transition.onEnd) {\r\n transition.onEnd({ finished: true });\r\n }\r\n });\r\n });\r\n }\r\n }\r\n };\r\n // Generates the CSS value for the specified attribute given\r\n // an animated value object.\r\n AnimatedComponentGenerated.prototype._generateCssAttributeValue = function (attrib, newValue) {\r\n // If the value is a raw number, append the default units.\r\n // If it's a string, we assume the caller has specified the units.\r\n if (typeof newValue === 'number') {\r\n newValue = newValue + animatedPropUnits[attrib];\r\n }\r\n return newValue;\r\n };\r\n AnimatedComponentGenerated.prototype._generateCssTransformValue = function (transform, newValue) {\r\n // If the value is a raw number, append the default units.\r\n // If it's a string, we assume the caller has specified the units.\r\n if (typeof newValue === 'number') {\r\n newValue = newValue + animatedPropUnits[transform];\r\n }\r\n return newValue;\r\n };\r\n // Regenerates the list of transforms, combining all static and animated transforms.\r\n AnimatedComponentGenerated.prototype._generateCssTransformList = function (useActiveValues) {\r\n var _this = this;\r\n var transformList = [];\r\n _.each(this._staticTransforms, function (value, transform) {\r\n transformList.push(transform + '(' + value + ')');\r\n });\r\n _.each(this._animatedTransforms, function (value, transform) {\r\n var newValue = useActiveValues && value.activeTransition ?\r\n value.activeTransition.to : value.valueObject._getOutputValue();\r\n transformList.push(transform + '(' + _this._generateCssTransformValue(transform, newValue) + ')');\r\n });\r\n return transformList.join(' ');\r\n };\r\n // Typing of `any` on StyleRuleSet isn't desirable, but there's not accurate typings that can be used to represent\r\n // our merging of web/RX styles here here\r\n AnimatedComponentGenerated.prototype._updateStyles = function (props) {\r\n var _this = this;\r\n this._propsWithoutStyle = _.omit(props, 'style');\r\n var rawStyles = Styles_1.default.combine(props.style || {});\r\n this._processedStyle = {};\r\n var newAnimatedAttributes = {};\r\n for (var attrib in rawStyles) {\r\n // Handle transforms separately.\r\n if (attrib === 'staticTransforms' || attrib === 'animatedTransforms') {\r\n continue;\r\n }\r\n // Is this a dynamic (animated) value?\r\n if (rawStyles[attrib] instanceof Value) {\r\n var valueObj = rawStyles[attrib];\r\n this._processedStyle[attrib] = this._generateCssAttributeValue(attrib, valueObj._getOutputValue());\r\n newAnimatedAttributes[attrib] = valueObj;\r\n }\r\n else {\r\n // Copy the static style value.\r\n this._processedStyle[attrib] = rawStyles[attrib];\r\n }\r\n }\r\n // Handle transforms, which require special processing because they need to\r\n // be combined into a single 'transform' CSS attribute.\r\n this._staticTransforms = rawStyles.staticTransforms || {};\r\n var newAnimatedTransforms = rawStyles.animatedTransforms || {};\r\n // Update this._animatedAttributes and this._animatedTransforms so they match\r\n // the updated style.\r\n // Remove any previous animated attributes that are no longer present\r\n // or associated with different value objects.\r\n _.each(this._animatedAttributes, function (value, attrib) {\r\n if (!newAnimatedAttributes[attrib] || newAnimatedAttributes[attrib] !== value.valueObject) {\r\n if (value.activeTransition) {\r\n if (AppConfig_1.default.isDevelopmentMode()) {\r\n console.error('Animated style attribute removed while the animation was active');\r\n }\r\n }\r\n value.valueObject._removeListener(_this);\r\n delete _this._animatedAttributes[attrib];\r\n }\r\n });\r\n // Add new animated attributes.\r\n _.each(newAnimatedAttributes, function (value, attrib) {\r\n if (!_this._animatedAttributes[attrib]) {\r\n _this._animatedAttributes[attrib] = { valueObject: value };\r\n if (_this._mountedComponent) {\r\n value._addListener(_this);\r\n }\r\n }\r\n });\r\n // Remove any previous animated transforms that are no longer present\r\n // or associated with different value objects.\r\n _.each(this._animatedTransforms, function (value, transform) {\r\n if (!newAnimatedTransforms[transform] || newAnimatedTransforms[transform] !== value.valueObject) {\r\n if (value.activeTransition) {\r\n if (AppConfig_1.default.isDevelopmentMode()) {\r\n console.warn('Should not remove an animated transform attribute while the animation is active');\r\n }\r\n }\r\n value.valueObject._removeListener(_this);\r\n delete _this._animatedTransforms[transform];\r\n }\r\n });\r\n // Add new animated transforms.\r\n _.each(newAnimatedTransforms, function (value, transform) {\r\n if (!_this._animatedTransforms[transform]) {\r\n _this._animatedTransforms[transform] = { valueObject: value };\r\n if (_this._mountedComponent) {\r\n value._addListener(_this);\r\n }\r\n }\r\n });\r\n // Update the transform attribute in this._processedStyle.\r\n var transformList = this._generateCssTransformList(true);\r\n if (transformList) {\r\n this._processedStyle.transform = transformList;\r\n }\r\n };\r\n AnimatedComponentGenerated.prototype.componentDidMount = function () {\r\n var _this = this;\r\n _.each(this._animatedAttributes, function (value) {\r\n value.valueObject._addListener(_this);\r\n });\r\n _.each(this._animatedTransforms, function (value) {\r\n value.valueObject._addListener(_this);\r\n });\r\n };\r\n AnimatedComponentGenerated.prototype.componentWillUnmount = function () {\r\n var _this = this;\r\n _.each(this._animatedAttributes, function (value) {\r\n value.valueObject._removeListener(_this);\r\n });\r\n this._animatedAttributes = {};\r\n _.each(this._animatedTransforms, function (value) {\r\n value.valueObject._removeListener(_this);\r\n });\r\n this._animatedTransforms = {};\r\n };\r\n AnimatedComponentGenerated.prototype.focus = function () {\r\n if (this._mountedComponent && this._mountedComponent.focus) {\r\n this._mountedComponent.focus();\r\n }\r\n };\r\n AnimatedComponentGenerated.prototype.requestFocus = function () {\r\n if (this._mountedComponent && this._mountedComponent.requestFocus) {\r\n this._mountedComponent.requestFocus();\r\n }\r\n };\r\n AnimatedComponentGenerated.prototype.blur = function () {\r\n if (this._mountedComponent && this._mountedComponent.blur) {\r\n this._mountedComponent.blur();\r\n }\r\n };\r\n AnimatedComponentGenerated.prototype.setFocusRestricted = function (restricted) {\r\n if (this._mountedComponent && this._mountedComponent.setFocusRestricted) {\r\n this._mountedComponent.setFocusRestricted(restricted);\r\n }\r\n };\r\n AnimatedComponentGenerated.prototype.setFocusLimited = function (limited) {\r\n if (this._mountedComponent && this._mountedComponent.setFocusLimited) {\r\n this._mountedComponent.setFocusLimited(limited);\r\n }\r\n };\r\n AnimatedComponentGenerated.prototype.render = function () {\r\n return (React.createElement(Component, __assign({ style: this._processedStyle }, this._propsWithoutStyle, { ref: this._onMount }), this.props.children));\r\n };\r\n // Update the component's display name for easy debugging in react devtools extension\r\n AnimatedComponentGenerated.displayName = \"Animated.\" + (Component.displayName || Component.name || 'Component');\r\n return AnimatedComponentGenerated;\r\n }(React.Component));\r\n return AnimatedComponentGenerated;\r\n}", "title": "" }, { "docid": "7a123aafb9d5dc8e8c5bfe526e6bca0d", "score": "0.51688486", "text": "componentDidMount() {\n\n Animated.spring( this.state.beat, {\n toValue: 1,\n duration: 4000\n }).start(() => {\n this.state.scale = this.state.beat.interpolate({\n inputRange : [0, 1],\n outputRange : [1.1, 1]\n });\n\n // Run this animation after the initial one\n // this.runLoadingAnimation();\n });\n\n }", "title": "" }, { "docid": "9d63d8fb5548017e0e53b6ee600e06ba", "score": "0.5167911", "text": "function AnimationAnimateChildMetadata() { }", "title": "" }, { "docid": "9d63d8fb5548017e0e53b6ee600e06ba", "score": "0.5167911", "text": "function AnimationAnimateChildMetadata() { }", "title": "" }, { "docid": "9d63d8fb5548017e0e53b6ee600e06ba", "score": "0.5167911", "text": "function AnimationAnimateChildMetadata() { }", "title": "" }, { "docid": "9d63d8fb5548017e0e53b6ee600e06ba", "score": "0.5167911", "text": "function AnimationAnimateChildMetadata() { }", "title": "" }, { "docid": "9d63d8fb5548017e0e53b6ee600e06ba", "score": "0.5167911", "text": "function AnimationAnimateChildMetadata() { }", "title": "" }, { "docid": "66c821bf1d6903b8fdf78d9e72bb8b8f", "score": "0.5165559", "text": "getAnimationCLass() {\r\n if (this.state.isGoBack) {\r\n return \"w3-animate-top\";\r\n } else {\r\n return \"w3-animate-bottom\";\r\n }\r\n }", "title": "" }, { "docid": "1ae4b945ab9be795e1df1fdf435cba0e", "score": "0.5162439", "text": "updateRenderInfo(movedSubmeshesList) {\n let needsUpdate = ((this.renderType & 4 /* Animated */) && this.animator && this.animator.updated) || this.needsUpdate;\n if (!needsUpdate) {\n return 0 /* None */;\n }\n this.needsUpdate = false;\n if (this.animator) {\n this.animator.updated = false;\n }\n let renderDiff = 0 /* None */;\n let rendType = this.renderType;\n const rendTypeOutsideBox = this.clipBox.rendTypeOutside;\n let isBoxClipped = this.clipBox.enabled && this.isClipboxAllowed && (rendType !== rendTypeOutsideBox);\n if (isBoxClipped && this.posToClipBox !== 1 /* OnEdge */) {\n isBoxClipped = false;\n if (this.posToClipBox === 2 /* Outside */) {\n rendType = rendTypeOutsideBox;\n }\n }\n const isAnimated = !!(rendType & 4 /* Animated */);\n for (let si = 0; si < this.submeshes.length; ++si) {\n const s = this.submeshes[si];\n const ri = reusedRI;\n ri.recycleAndReset();\n if (this.isVisible && (!isAnimated || this.animator !== null)) {\n if (isAnimated) {\n ri.copyUsingPool(this.animator.renderInfo);\n if (ri.positionOffset) {\n movedSubmeshesList.push(s);\n }\n }\n else {\n ri.renderType = rendType;\n }\n if (isBoxClipped) {\n ri.makeBoxClipped();\n ri.renderTypeOutsideBox = rendTypeOutsideBox;\n }\n if (this.colorTint && this.colorTint.w > 0) {\n ri.colorTint = Vector4Pool.get(this.colorTint);\n }\n if (this.isHighlighted) {\n ri.makeHighlighted();\n }\n if (this.isSelected) {\n ri.makeSelected();\n }\n const rt = this.renderType | ri.renderType | ri.renderTypeOutsideBox; // in case of clipping box\n if (s.canCastShadow) {\n if (rt & 1 /* Standard */) {\n ri.shadowType = 1 /* Standard */;\n }\n else if (rt & 4 /* Animated */) {\n if (ri.clippingPlane) {\n ri.shadowType = 2 /* PlaneClipped */;\n }\n else {\n ri.shadowType = 1 /* Standard */;\n }\n }\n }\n }\n s.renderDiff = ri.calculateDiff(s.renderInfo);\n if (s.renderDiff !== 0) {\n this.needsUpdate = true; // only stop updating after 2 equal consecutive updates (so that renderdiff becomes 0 for the next frame)\n renderDiff |= s.renderDiff;\n s.renderInfo.recycleAndReset();\n s.renderInfo.copyUsingPool(ri);\n }\n }\n return renderDiff;\n }", "title": "" }, { "docid": "300dd05bbf7f95da2725da2d7551fdbc", "score": "0.5157991", "text": "function AnimationAnimateRefMetadata(){}", "title": "" }, { "docid": "8f053c364bae2d4a5948ec25e0c4625a", "score": "0.51504374", "text": "_getData() { \n let questions = data[this.state.questionKey].questions;\n for(var i = 0 ; i < questions.length ; i++){\n this.questionOpacityValues[i] = new Animated.Value(0)\n }\n\n let answers = data[this.state.questionKey].answers; \n for(var i = 0 ; i < answers.length ; i++) {\n this.answerOpacityValues[i] = new Animated.Value(0)\n this.answerTranslateYValue[i] = new Animated.Value(ANSWERS_START_POS)\n }\n\n this.setState({\n questions,\n answers\n }) \n }", "title": "" }, { "docid": "a361da446878a90e1ffb9fe8a15c0fa9", "score": "0.51438516", "text": "function AnimatedBinding(properties) {\n var element = properties.node;\n var animate = element.getAttribute(properties.fragments.animateAttribute);\n var fragments = properties.fragments;\n\n if (animate !== null) {\n if (element.nodeName === 'TEMPLATE' || element.nodeName === 'SCRIPT') {\n throw new Error('Cannot animate multiple nodes in a template or script. Remove the [animate] attribute.');\n }\n\n setTimeout(function() {\n // Allow multiple bindings to animate by not removing until they have all been created\n element.removeAttribute(properties.fragments.animateAttribute);\n });\n\n this.animate = true;\n\n if (fragments.isBound('attribute', animate)) {\n // javascript animation\n this.animateExpression = fragments.codifyExpression('attribute', animate);\n } else {\n if (animate[0] === '.') {\n // class animation\n this.animateClassName = animate.slice(1);\n } else if (animate) {\n // registered animation\n var animateObject = fragments.getAnimation(animate);\n if (typeof animateObject === 'function') animateObject = new animateObject(this);\n this.animateObject = animateObject;\n }\n }\n }\n\n Binding.call(this, properties);\n}", "title": "" }, { "docid": "98253dd03565d1038bb5e69491875676", "score": "0.5142713", "text": "update(currentTime){\n const timeElapsed = currentTime - this.currentTime;\n const timeSinceStart = currentTime - this.startTime;\n this.currentTime += timeElapsed;\n \n //Don't update if the animation is finished\n if(timeSinceStart < this.begin){\n return;\n }\n \n //Calcualte the ratio between start and finish\n let ratio = (timeSinceStart - this.begin) / this.timeToFinish;\n \n //The ratio should never be greater than 1\n if(ratio > 1){\n ratio = 1;\n }\n \n //Update all properties to reflect the current stage of the animation (using lerp)\n const propKeys = Object.keys(this.propsCurrent);\n for(let i = 0; i < propKeys.length; i++){\n const key = propKeys[i];\n \n this.propsCurrent[key] = lerp(this.propsBegin[key], this.propsEnd[key], ratio);\n }\n \n //If the animation has reached its end, complete it\n if(ratio >= 1 && !this.loop){\n this.complete = true;\n } else if(ratio >= 1){\n this.startTime = currentTime;\n }\n }", "title": "" }, { "docid": "d02e3fe39c33b071038a236cf3b6c552", "score": "0.5139772", "text": "flipCard() {\n const { animatedValue } = this.state\n\n Animated.spring(animatedValue, {\n friction: 8, tension: 10, toValue: 0,\n }).start()\n }", "title": "" }, { "docid": "15307403311750582446a78b26d5eb96", "score": "0.51394254", "text": "function genAnimateChild(transitionSupport) {\n var AnimateChild = function (_React$Component) {\n __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_inherits___default()(AnimateChild, _React$Component);\n\n function AnimateChild() {\n __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_classCallCheck___default()(this, AnimateChild);\n\n // [Legacy] Since old code addListener on the element.\n // To avoid break the behaviour that component not handle animation/transition\n // also can handle the animate, let keep the logic.\n var _this = __WEBPACK_IMPORTED_MODULE_3_babel_runtime_helpers_possibleConstructorReturn___default()(this, (AnimateChild.__proto__ || Object.getPrototypeOf(AnimateChild)).call(this));\n\n _this.state = {\n child: null,\n\n eventQueue: [],\n eventActive: false\n };\n\n _this.onDomUpdated = function () {\n var eventActive = _this.state.eventActive;\n var _this$props = _this.props,\n transitionName = _this$props.transitionName,\n animation = _this$props.animation,\n onChildLeaved = _this$props.onChildLeaved,\n animateKey = _this$props.animateKey;\n\n\n var $ele = _this.getDomElement();\n\n // Skip if dom element not ready\n if (!$ele) return;\n\n // [Legacy] Add animation/transition event by dom level\n if (transitionSupport && _this.$prevEle !== $ele) {\n _this.cleanDomEvent();\n\n _this.$prevEle = $ele;\n _this.$prevEle.addEventListener(__WEBPACK_IMPORTED_MODULE_12__util__[\"a\" /* animationEndName */], _this.onMotionEnd);\n _this.$prevEle.addEventListener(__WEBPACK_IMPORTED_MODULE_12__util__[\"g\" /* transitionEndName */], _this.onMotionEnd);\n }\n\n var currentEvent = _this.getCurrentEvent();\n if (currentEvent.empty) {\n // Additional process the leave event\n if (currentEvent.lastEventType === 'leave') {\n onChildLeaved(animateKey);\n }\n return;\n }\n\n var eventType = currentEvent.eventType,\n restQueue = currentEvent.restQueue;\n\n var nodeClasses = __WEBPACK_IMPORTED_MODULE_10_component_classes___default()($ele);\n\n // [Legacy] Since origin code use js to set `className`.\n // This caused that any component without support `className` can be forced set.\n // Let's keep the logic.\n function legacyAppendClass() {\n if (!transitionSupport) return;\n\n var basicClassName = Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"d\" /* getTransitionName */])(transitionName, '' + eventType);\n if (basicClassName) nodeClasses.add(basicClassName);\n\n if (eventActive) {\n var activeClassName = Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"d\" /* getTransitionName */])(transitionName, eventType + '-active');\n if (activeClassName) nodeClasses.add(activeClassName);\n }\n }\n\n if (_this.currentEvent && _this.currentEvent.type === eventType) {\n legacyAppendClass();\n return;\n }\n\n // Clear timeout for legacy check\n clearTimeout(_this.timeout);\n\n // Clean up last event environment\n if (_this.currentEvent && _this.currentEvent.animateObj && _this.currentEvent.animateObj.stop) {\n _this.currentEvent.animateObj.stop();\n }\n\n // Clean up last transition class\n if (_this.currentEvent) {\n var basicClassName = Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"d\" /* getTransitionName */])(transitionName, '' + _this.currentEvent.type);\n var activeClassName = Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"d\" /* getTransitionName */])(transitionName, _this.currentEvent.type + '-active');\n if (basicClassName) nodeClasses.remove(basicClassName);\n if (activeClassName) nodeClasses.remove(activeClassName);\n }\n\n // New event come\n _this.currentEvent = {\n type: eventType\n };\n\n var animationHandler = (animation || {})[eventType];\n // =============== Check if has customize animation ===============\n if (animationHandler) {\n _this.currentEvent.animateObj = animationHandler($ele, function () {\n _this.onMotionEnd({ target: $ele });\n });\n\n // Do next step if not animate object provided\n if (!_this.currentEvent || !_this.currentEvent.animateObj) {\n _this.nextEvent(restQueue);\n }\n\n // ==================== Use transition instead ====================\n } else if (transitionSupport) {\n legacyAppendClass();\n if (!eventActive) {\n // Trigger `eventActive` in next frame\n __WEBPACK_IMPORTED_MODULE_11_raf___default()(function () {\n if (_this.currentEvent && _this.currentEvent.type === eventType && !_this._destroy) {\n _this.setState({ eventActive: true }, function () {\n // [Legacy] Handle timeout if browser transition event not handle\n var transitionDelay = Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"c\" /* getStyleValue */])($ele, 'transition-delay') || 0;\n var transitionDuration = Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"c\" /* getStyleValue */])($ele, 'transition-duration') || 0;\n var animationDelay = Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"c\" /* getStyleValue */])($ele, 'animation-delay') || 0;\n var animationDuration = Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"c\" /* getStyleValue */])($ele, 'animation-duration') || 0;\n var totalTime = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);\n\n if (totalTime >= 0) {\n _this.timeout = setTimeout(function () {\n _this.onMotionEnd({ target: $ele });\n }, totalTime * 1000);\n }\n });\n }\n });\n }\n\n // ======================= Just next action =======================\n } else {\n _this.onMotionEnd({ target: $ele });\n }\n };\n\n _this.onMotionEnd = function (_ref) {\n var target = _ref.target;\n var _this$props2 = _this.props,\n transitionName = _this$props2.transitionName,\n onChildLeaved = _this$props2.onChildLeaved,\n animateKey = _this$props2.animateKey,\n onAppear = _this$props2.onAppear,\n onEnter = _this$props2.onEnter,\n onLeave = _this$props2.onLeave,\n onEnd = _this$props2.onEnd;\n\n var currentEvent = _this.getCurrentEvent();\n if (currentEvent.empty) return;\n\n // Clear timeout for legacy check\n clearTimeout(_this.timeout);\n\n var restQueue = currentEvent.restQueue;\n\n\n var $ele = _this.getDomElement();\n if (!_this.currentEvent || $ele !== target) return;\n\n if (_this.currentEvent.animateObj && _this.currentEvent.animateObj.stop) {\n _this.currentEvent.animateObj.stop();\n }\n\n // [Legacy] Same as above, we need call js to remove the class\n if (transitionSupport && _this.currentEvent) {\n var basicClassName = Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"d\" /* getTransitionName */])(transitionName, _this.currentEvent.type);\n var activeClassName = Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"d\" /* getTransitionName */])(transitionName, _this.currentEvent.type + '-active');\n\n var nodeClasses = __WEBPACK_IMPORTED_MODULE_10_component_classes___default()($ele);\n if (basicClassName) nodeClasses.remove(basicClassName);\n if (activeClassName) nodeClasses.remove(activeClassName);\n }\n\n // Additional process the leave event\n if (_this.currentEvent && _this.currentEvent.type === 'leave') {\n onChildLeaved(animateKey);\n }\n\n // [Legacy] Trigger on event when it's last event\n if (_this.currentEvent && !restQueue.length) {\n if (_this.currentEvent.type === 'appear' && onAppear) {\n onAppear(animateKey);\n } else if (_this.currentEvent.type === 'enter' && onEnter) {\n onEnter(animateKey);\n } else if (_this.currentEvent.type === 'leave' && onLeave) {\n onLeave(animateKey);\n }\n\n if (onEnd) {\n // OnEnd(key, isShow)\n onEnd(animateKey, _this.currentEvent.type !== 'leave');\n }\n }\n\n _this.currentEvent = null;\n\n // Next queue\n _this.nextEvent(restQueue);\n };\n\n _this.getDomElement = function () {\n if (_this._destroy) return null;\n return __WEBPACK_IMPORTED_MODULE_6_react_dom___default.a.findDOMNode(_this);\n };\n\n _this.getCurrentEvent = function () {\n var _this$state$eventQueu = _this.state.eventQueue,\n eventQueue = _this$state$eventQueu === undefined ? [] : _this$state$eventQueu;\n var _this$props3 = _this.props,\n animation = _this$props3.animation,\n exclusive = _this$props3.exclusive,\n transitionAppear = _this$props3.transitionAppear,\n transitionEnter = _this$props3.transitionEnter,\n transitionLeave = _this$props3.transitionLeave;\n\n\n function hasEventHandler(eventType) {\n return eventType === 'appear' && (transitionAppear || animation.appear) || eventType === 'enter' && (transitionEnter || animation.enter) || eventType === 'leave' && (transitionLeave || animation.leave);\n }\n\n var event = null;\n // If is exclusive, only check the last event\n if (exclusive) {\n var eventType = eventQueue[eventQueue.length - 1];\n if (hasEventHandler(eventType)) {\n event = {\n eventType: eventType,\n restQueue: []\n };\n }\n } else {\n // Loop check the queue until find match\n var cloneQueue = eventQueue.slice();\n while (cloneQueue.length) {\n var _cloneQueue = cloneQueue,\n _cloneQueue2 = __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_toArray___default()(_cloneQueue),\n _eventType = _cloneQueue2[0],\n restQueue = _cloneQueue2.slice(1);\n\n if (hasEventHandler(_eventType)) {\n event = {\n eventType: _eventType,\n restQueue: restQueue\n };\n break;\n }\n cloneQueue = restQueue;\n }\n }\n\n if (!event) {\n event = {\n empty: true,\n lastEventType: eventQueue[eventQueue.length - 1]\n };\n }\n\n return event;\n };\n\n _this.nextEvent = function (restQueue) {\n // Next queue\n if (!_this._destroy) {\n _this.setState({\n eventQueue: restQueue,\n eventActive: false\n });\n }\n };\n\n _this.cleanDomEvent = function () {\n if (_this.$prevEle && transitionSupport) {\n _this.$prevEle.removeEventListener(__WEBPACK_IMPORTED_MODULE_12__util__[\"a\" /* animationEndName */], _this.onMotionEnd);\n _this.$prevEle.removeEventListener(__WEBPACK_IMPORTED_MODULE_12__util__[\"g\" /* transitionEndName */], _this.onMotionEnd);\n }\n };\n\n _this.$prevEle = null;\n\n _this.currentEvent = null;\n _this.timeout = null;\n return _this;\n }\n\n __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_createClass___default()(AnimateChild, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.onDomUpdated();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n this.onDomUpdated();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n clearTimeout(this.timeout);\n this._destroy = true;\n this.cleanDomEvent();\n }\n }, {\n key: 'render',\n value: function render() {\n var _state = this.state,\n child = _state.child,\n eventActive = _state.eventActive;\n var _props = this.props,\n showProp = _props.showProp,\n transitionName = _props.transitionName;\n\n var _ref2 = child.props || {},\n className = _ref2.className;\n\n var currentEvent = this.getCurrentEvent();\n\n // Class name\n var connectClassName = transitionSupport && this.currentEvent ? __WEBPACK_IMPORTED_MODULE_9_classnames___default()(className, Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"d\" /* getTransitionName */])(transitionName, this.currentEvent.type), eventActive && Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"d\" /* getTransitionName */])(transitionName, this.currentEvent.type + '-active')) : className;\n\n var show = true;\n\n // Keep show when is in transition or has customize animate\n if (transitionSupport && (!currentEvent.empty || this.currentEvent && this.currentEvent.animateObj)) {\n show = true;\n } else {\n show = child.props[showProp];\n }\n\n // Clone child\n var newChildProps = {\n className: connectClassName\n };\n\n if (showProp) {\n newChildProps[showProp] = show;\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.cloneElement(child, newChildProps);\n }\n }], [{\n key: 'getDerivedStateFromProps',\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var _prevState$prevProps = prevState.prevProps,\n prevProps = _prevState$prevProps === undefined ? {} : _prevState$prevProps;\n var appeared = nextProps.appeared;\n\n\n var newState = {\n prevProps: Object(__WEBPACK_IMPORTED_MODULE_12__util__[\"b\" /* cloneProps */])(nextProps, clonePropList)\n };\n\n function processState(propName, updater) {\n if (prevProps[propName] !== nextProps[propName]) {\n if (updater) {\n updater(nextProps[propName]);\n }\n return true;\n }\n return false;\n }\n\n function pushEvent(eventType) {\n var eventQueue = newState.eventQueue || prevState.eventQueue.slice();\n var matchIndex = eventQueue.indexOf(eventType);\n\n // Clean the rest event if eventType match\n if (matchIndex !== -1) {\n eventQueue = eventQueue.slice(0, matchIndex);\n }\n\n eventQueue.push(eventType);\n newState.eventQueue = eventQueue;\n }\n\n // Child update. Only set child.\n processState('children', function (child) {\n newState.child = child;\n });\n\n processState('appeared', function (isAppeared) {\n if (isAppeared) {\n pushEvent('appear');\n }\n });\n\n // Show update\n processState('show', function (show) {\n if (!appeared) {\n if (show) {\n pushEvent('enter');\n } else {\n pushEvent('leave');\n }\n }\n });\n\n return newState;\n }\n }]);\n\n return AnimateChild;\n }(__WEBPACK_IMPORTED_MODULE_5_react___default.a.Component);\n\n AnimateChild.propTypes = {\n transitionName: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object]),\n transitionAppear: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,\n transitionEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,\n transitionLeave: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,\n exclusive: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,\n appeared: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.bool,\n showProp: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.string,\n\n animateKey: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.any,\n animation: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.object,\n onChildLeaved: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,\n\n onEnd: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,\n onAppear: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,\n onEnter: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func,\n onLeave: __WEBPACK_IMPORTED_MODULE_7_prop_types___default.a.func\n };\n\n\n Object(__WEBPACK_IMPORTED_MODULE_8_react_lifecycles_compat__[\"a\" /* polyfill */])(AnimateChild);\n\n return AnimateChild;\n}", "title": "" }, { "docid": "5718c6cc51589d083bad4406bb533df2", "score": "0.51334876", "text": "resetAnimation() {\n this.animatedValue = [];\n arr.forEach((value) => {\n this.animatedValue[value] = new Animated.Value(0);\n });\n }", "title": "" }, { "docid": "9a0a9fffb0fd5929bb1e54c184aca073", "score": "0.5132107", "text": "updateAnimation() {\n return;\n }", "title": "" }, { "docid": "befefca25ada011b512406a111cf1e4a", "score": "0.5126489", "text": "function animateParentHeight(elements,direction,totalDuration,stagger){var totalHeightDelta=0,parentNode;/* Sum the total height (including padding and margin) of all targeted elements. */$.each(elements.nodeType?[elements]:elements,function(i,element){if(stagger){/* Increase the totalDuration by the successive delay amounts produced by the stagger option. */totalDuration+=i*stagger;}parentNode=element.parentNode;var propertiesToSum=[\"height\",\"paddingTop\",\"paddingBottom\",\"marginTop\",\"marginBottom\"];/* If box-sizing is border-box, the height already includes padding and margin */if(Velocity.CSS.getPropertyValue(element,\"boxSizing\").toString().toLowerCase()===\"border-box\"){propertiesToSum=[\"height\"];}$.each(propertiesToSum,function(i,property){totalHeightDelta+=parseFloat(Velocity.CSS.getPropertyValue(element,property));});});/* Animate the parent element's height adjustment (with a varying duration multiplier for aesthetic benefits). */Velocity.animate(parentNode,{height:(direction===\"In\"?\"+\":\"-\")+\"=\"+totalHeightDelta},{queue:false,easing:\"ease-in-out\",duration:totalDuration*(direction===\"In\"?0.6:1)});}", "title": "" }, { "docid": "135130c2a41d2a1dc81fa33a885cff44", "score": "0.51257575", "text": "componentDidMount() {\n Animated.timing(this.state.progress, {\n toValue: 1,\n duration: 5000,\n easing: Easing.linear,\n }).start();\n }", "title": "" }, { "docid": "3d1e313b26e9ba33ddb8f26d2de6aaf0", "score": "0.51221037", "text": "handleAnimation() {\n Animated.timing(this.state.displayStart, {\n toValue: {x: 0, y: 0},\n duration: 700,\n }, this.state.displayStart.setValue({x: 0, y: 200})).start();\n }", "title": "" }, { "docid": "5940ecec2dd8597e3fe248450f5a911d", "score": "0.5117279", "text": "updateLife() {\n if (this.life < 0) this.life = 0\n const width = Game.computeLifeBarWidth()\n const tweenWidth = this.game.add.tween(Game.health.getChildAt(0)) // tween for the \"body\" of the bar\n const tweenEnd = this.game.add.tween(Game.health.getChildAt(1)) // tween for the curved tip\n tweenWidth.to({ width: width }, 200, null, false, 200)\n tweenEnd.to({ x: width }, 200, null, false, 200)\n tweenWidth.start()\n tweenEnd.start()\n }", "title": "" }, { "docid": "47ba27bfba26270ac54b4244cf94c4c9", "score": "0.51147187", "text": "_setOpacityTo(toValue, duration) {\n Animated.timing(this.state.anim, {\n toValue,\n duration,\n easing: Easing.inOut(Easing.quad),\n useNativeDriver: true,\n }).start();\n }", "title": "" }, { "docid": "6209a370ff37a9da3c5c6a7f5183f275", "score": "0.5114687", "text": "handleNodeClick (node) {\n if (this.scrolling) {\n this.scrolling = false\n return\n }\n if (this.state.disableTreeEvents)\n return\n\n // HACK/CODE STINK: Currently there are some slightly hacky things about this animation.\n // The \"forceDisplayNode\" and \"collapsed\" objects have the following combined effect (for internal nodes):\n // If collapsed[node] is truthy, then the alignment row for that node will be rendered.\n // If collapsed[node]===undefined and forceDisplayNode[node]===true, then the node's open->collapse transition is being animated, and the node handle will be rendered as collapsed.\n // If collapsed[node] is falsey and forceDisplayNode[node] is falsey, then the node handle will be rendered as collapsed.\n // This might be better handled by replacing the two objects with a single combined state (OPEN, COLLAPSED, COLLAPSING, OPENING)\n // Part of the implementation goal has been to keep the object sparse so that the default state is OPEN and the objects can start off being empty.\n \n // First compute the current alignment layout (i.e. the initial state before the expand/collapse)\n const { treeIndex, alignIndex } = this.props\n const computedView = this.getComputedView()\n const { collapsed, nodeScale, columnScale, forceDisplayNode, columnVisible } = computedView\n\n const alignLayout = this.layoutAlignment (computedView)\n const left = this.state.alignScrollLeft, right = left + this.alignmentClientWidth\n\n const collapseAnimationFrames = this.collapseAnimationFrames()\n let framesLeft = collapseAnimationFrames\n\n // Now compute the final alignment state and layout\n // This also includes figuring out which columns are visible before AND after the animation - so that we can keep the view centered around those columns\n // As noted in the comments for layoutAlignment(), a possible performance optimization would be to do a lazy layout, starting with a column known to be in the view, and stopping when offscreen.\n // This might necessitate maintaining some internal state about which column is currently being used as the \"origin\" for layout purposes.\n const wasCollapsed = collapsed[node], finalCollapsed = extend ({}, collapsed)\n if (wasCollapsed) {\n collapsed[node] = false // when collapsed[node]=false (vs undefined), it's rendered by renderTree() as a collapsed node, but its descendants are still visible. A bit of a hack...\n delete finalCollapsed[node]\n } else\n finalCollapsed[node] = true\n const finalForceDisplayNode = extend ({}, forceDisplayNode)\n finalForceDisplayNode[node] = !wasCollapsed\n const finalComputedView = this.getComputedView ({ collapsed: finalCollapsed, forceDisplayNode: finalForceDisplayNode })\n let newlyVisibleColumns = [], newlyHiddenColumns = [], persistingVisibleColumns = []\n for (let col = 0; col < alignIndex.columns; ++col) {\n if (finalComputedView.columnVisible[col] !== columnVisible[col])\n (finalComputedView.columnVisible[node] ? newlyVisibleColumns : newlyHiddenColumns).push (col)\n const colX = alignLayout.colX[col], colWidth = alignLayout.colWidth[col]\n if (columnVisible[col] && finalComputedView.columnVisible[col] && colX >= left && colX + colWidth < right)\n persistingVisibleColumns.push (col)\n }\n // Compute the current centroid of the visible-before-and-after columns\n // Throughout the animation, we keep computing this and dynamically adjust alignScrollLeft so that it stays at the centroid of the current view\n // This ensures that the currently visible alignment region does not shift out of view because columns way offscreen to the left have disappeared or appeared.\n const centroidMinusScroll = this.centroidOfColumns (persistingVisibleColumns, alignLayout) - this.state.alignScrollLeft\n\n let lastFrameTime = Date.now()\n const expectedTimeBetweenFrames = this.collapseAnimationDuration() / collapseAnimationFrames\n // drawAnimationFrame is the closure used for the animation transition\n const drawAnimationFrame = () => {\n let disableTreeEvents, animating, newCollapsed = collapsed\n if (framesLeft) {\n const scale = (wasCollapsed ? (collapseAnimationFrames + 1 - framesLeft) : framesLeft) / (collapseAnimationFrames + 1)\n treeIndex.descendants[node].forEach ((desc) => { nodeScale[desc] = scale })\n nodeScale[node] = 1 - scale\n newlyHiddenColumns.forEach ((col) => columnScale[col] = scale)\n newlyVisibleColumns.forEach ((col) => columnScale[col] = 1 - scale)\n forceDisplayNode[node] = true\n disableTreeEvents = true // disable further tree events while the animated transition is ongoing\n animating = true\n } else {\n treeIndex.descendants[node].forEach ((desc) => { delete nodeScale[desc] })\n delete nodeScale[node]\n newlyHiddenColumns.forEach ((col) => delete columnScale[col])\n newlyVisibleColumns.forEach ((col) => delete columnScale[col])\n forceDisplayNode[node] = !wasCollapsed\n newCollapsed = finalCollapsed\n disableTreeEvents = false\n animating = false\n }\n const view = extend ({}, this.state.view, { collapsed: newCollapsed, forceDisplayNode, nodeScale, columnScale, disableTreeEvents, animating })\n const computedView = this.getComputedView (view), alignLayout = this.layoutAlignment (computedView)\n const alignScrollLeft = this.boundAlignScrollLeft (this.centroidOfColumns (persistingVisibleColumns, alignLayout) - centroidMinusScroll)\n window.requestAnimationFrame (() => {\n this.setState ({ alignScrollLeft, view })\n \n if (framesLeft) {\n // Note the use of collapseAnimationMaxFrameSkip to guarantee that the user sees at least one frame of the animation transition\n const currentTime = Date.now(),\n timeSinceLastFrame = currentTime - lastFrameTime,\n timeToNextFrame = Math.max (0, expectedTimeBetweenFrames - timeSinceLastFrame),\n frameSkip = Math.min (this.collapseAnimationMaxFrameSkip(), Math.ceil (timeSinceLastFrame / expectedTimeBetweenFrames))\n framesLeft = Math.max (0, framesLeft - frameSkip)\n lastFrameTime = currentTime\n setTimeout (drawAnimationFrame, timeToNextFrame)\n }\n })\n }\n \n drawAnimationFrame (collapseAnimationFrames)\n }", "title": "" }, { "docid": "a3decf19e8096627eabd7815fbedc30a", "score": "0.511281", "text": "render(){\n return(\n <ScrollView>\n <View style={styles.contentContainerStyle}>\n <AnimatedGaugeProgress\n style={{marginTop:50, marginBottom:18}}\n tintColor='#00cc00'\n backgroundColor= \"#08923e\"\n size={size}\n width={width}\n fill= { (Number(this.props.spentUtilities)/ Number(this.props.utilities)) * 100 }\n cropDegree={cropDegree}\n >\n {(fill) => (\n <View style={styles.textView}>\n <Text style={styles.text}>utilities</Text>\n <Text> ${this.props.spentUtilities} | ${this.props.utilities}</Text>\n </View>\n )}\n </AnimatedGaugeProgress>\n <AnimatedGaugeProgress\n style={{marginBottom:18}}\n tintColor='#00cc00'\n backgroundColor= \"#08923e\"\n size={size}\n width={width}\n fill={Number(this.props.spentTransportation)/Number(this.props.transportation)*100 }\n cropDegree={cropDegree}\n >\n {(fill) => (\n <View style={styles.textView}>\n <Text style={styles.text}>transportation</Text>\n <Text> ${this.props.spentTransportation} | ${this.props.transportation}</Text>\n </View>\n )}\n </AnimatedGaugeProgress>\n <AnimatedGaugeProgress\n style={{marginBottom:18}}\n tintColor='#00cc00'\n backgroundColor= \"#08923e\"\n size={size}\n width={width}\n fill={Number(this.props.spentGroceries)/Number(this.props.groceries)*100 }\n cropDegree={cropDegree}\n >\n {(fill) => (\n <View style={styles.textView}>\n <Text style={styles.text}>groceries</Text>\n <Text> ${this.props.spentGroceries} | ${this.props.groceries}</Text>\n </View>\n )}\n </AnimatedGaugeProgress>\n <AnimatedGaugeProgress\n style={{marginBottom:18}}\n tintColor='#00cc00'\n backgroundColor= \"#08923e\"\n size={size}\n width={width}\n fill={Number(this.props.spentSavings)/Number(this.props.savings)*100 }\n cropDegree={cropDegree}\n >\n {(fill) => (\n <View style={styles.textView}>\n <Text style={styles.text}>savings</Text>\n <Text> ${this.props.spentSavings} | ${this.props.savings}</Text>\n </View>\n )}\n </AnimatedGaugeProgress>\n <AnimatedGaugeProgress\n style={{marginBottom:18}}\n tintColor='#00cc00'\n backgroundColor= \"#08923e\"\n size={size}\n width={width}\n fill={Number(this.props.spentEntertainment)/Number(this.props.entertainment)*100 }\n cropDegree={cropDegree}\n >\n {(fill) => (\n <View style={styles.textView}>\n <Text style={styles.text}>entertainment</Text>\n <Text> ${this.props.spentEntertainment} | ${this.props.entertainment}</Text>\n </View>\n )}\n </AnimatedGaugeProgress>\n <AnimatedGaugeProgress\n style={{marginBottom:18}}\n tintColor='#00cc00'\n backgroundColor= \"#08923e\"\n size={size}\n width={width}\n fill={Number(this.props.spentClothing)/Number(this.props.clothing)*100 }\n cropDegree={cropDegree}\n >\n {(fill) => (\n <View style={styles.textView}>\n <Text style={styles.text}>clothing</Text>\n <Text> ${this.props.spentClothing} | ${this.props.clothing}</Text>\n </View>\n )}\n </AnimatedGaugeProgress>\n <AnimatedGaugeProgress\n style={{marginBottom:18}}\n tintColor='#00cc00'\n backgroundColor= \"#08923e\"\n size={size}\n width={width}\n fill={Number(this.props.spentEmergency)/Number(this.props.emergency)*100 }\n cropDegree={cropDegree}\n >\n {(fill) => (\n <View style={styles.textView}>\n <Text style={styles.text}>emergency</Text>\n <Text> ${this.props.spentEmergency} | ${this.props.emergency}</Text>\n </View>\n )}\n </AnimatedGaugeProgress>\n <AnimatedGaugeProgress\n style={{marginBottom:18}}\n tintColor='#00cc00'\n backgroundColor= \"#08923e\"\n size={size}\n width={width}\n fill={Number(this.props.spentMiscellaneous)/Number(this.props.miscellaneous)*100 }\n cropDegree={cropDegree}\n >\n {(fill) => (\n <View style={styles.textView}>\n <Text style={styles.text}>miscellaneous</Text>\n <Text> ${this.props.spentMiscellaneous} | ${this.props.miscellaneous}</Text>\n </View>\n )}\n </AnimatedGaugeProgress>\n </View>\n </ScrollView>\n )\n }", "title": "" }, { "docid": "f3bc293793d759239780549c0c1939c4", "score": "0.5112289", "text": "_updateChildStates(/* source */) { // eslint: complexity\n if (!this.get('shouldRenderList')) {\n return;\n }\n\n const edges = this.get('_edges');\n const childComponents = this.get('children');\n\n if (!get(childComponents, 'length')) {\n return;\n }\n\n if (this._isFirstRender) {\n if (this.get('renderAllInitially')) {\n childComponents.forEach((i) => {\n i.show();\n });\n\n // set scroll\n if (this.get('__isInitializingFromLast')) {\n this._nextMaintenance = run.schedule('afterRender', this, function() {\n const last = this.$().get(0).lastElementChild;\n\n this.set('__isInitializingFromLast', false);\n if (last) {\n last.scrollIntoView(false);\n }\n });\n }\n\n this._isFirstRender = false;\n return;\n }\n\n }\n\n const currentViewportBound = this.radar.skyline.top;\n let currentUpperBound = edges.visibleTop;\n\n if (currentUpperBound < currentViewportBound) {\n currentUpperBound = currentViewportBound;\n }\n\n const topComponentIndex = this._findFirstRenderedComponent(currentUpperBound);\n let bottomComponentIndex = topComponentIndex;\n const lastIndex = childComponents.length - 1;\n let topVisibleSpotted = false;\n let toCull = [];\n const toShow = [];\n\n while (bottomComponentIndex <= lastIndex) {\n\n const component = childComponents[bottomComponentIndex];\n\n const componentTop = component.satellite.geography.top;\n const componentBottom = component.satellite.geography.bottom;\n\n // end the loop if we've reached the end of components we care about\n if (componentTop > edges.visibleBottom) {\n break;\n }\n\n // above the upper reveal boundary\n if (componentBottom < edges.visibleTop) {\n toCull.push(component);\n\n // above the upper screen boundary\n } else if (componentBottom < edges.viewportTop) {\n toShow.push(component);\n if (bottomComponentIndex === 0) {\n this.sendActionOnce('firstReached', {\n item: component,\n index: bottomComponentIndex\n });\n }\n\n // above the lower screen boundary\n } else if (componentTop < edges.viewportBottom) {\n toShow.push(component);\n if (bottomComponentIndex === 0) {\n this.sendActionOnce('firstReached', {\n item: component,\n index: bottomComponentIndex\n });\n }\n if (bottomComponentIndex === lastIndex) {\n this.sendActionOnce('lastReached', {\n item: component,\n index: bottomComponentIndex\n });\n }\n\n if (!topVisibleSpotted) {\n topVisibleSpotted = true;\n this.set('_firstVisibleIndex', bottomComponentIndex);\n this.sendActionOnce('firstVisibleChanged', {\n item: component,\n index: bottomComponentIndex\n });\n }\n this.sendActionOnce('lastVisibleChanged', {\n item: component,\n index: bottomComponentIndex\n });\n\n // above the lower reveal boundary (componentTop < edges.visibleBottom)\n } else {\n toShow.push(component);\n if (bottomComponentIndex === lastIndex) {\n this.sendActionOnce('lastReached', {\n item: component,\n index: bottomComponentIndex\n });\n }\n }\n\n bottomComponentIndex++;\n }\n\n toCull = toCull\n .concat((childComponents.slice(0, topComponentIndex)))\n .concat(childComponents.slice(bottomComponentIndex));\n\n toCull.forEach((i) => {\n i.cull();\n });\n toShow.forEach((i) => {\n i.show();\n });\n\n // set scroll\n if (this.get('__isInitializingFromLast')) {\n this._nextMaintenance = run.schedule('afterRender', this, function() {\n const last = this.$().get(0).lastElementChild;\n\n this.set('__isInitializingFromLast', false);\n if (last) {\n last.scrollIntoView(false);\n }\n });\n }\n\n if (this._isFirstRender) {\n this._isFirstRender = false;\n this.sendActionOnce('didMountCollection', {\n firstVisible: { item: childComponents[topComponentIndex], index: topComponentIndex },\n lastVisible: { item: childComponents[bottomComponentIndex - 1], index: bottomComponentIndex - 1 }\n });\n }\n }", "title": "" }, { "docid": "7746ba1fa5c2bc0c5586b395800ca0eb", "score": "0.5107963", "text": "function animate() {\r\n animations.items.forEach(item => {\r\n const { id, paths, keyframes } = item;\r\n let element = document.getElementById(id);\r\n\r\n if (element === undefined || element === null) return false;\r\n\r\n if (paths !== undefined && paths !== null) {\r\n // Updating all the paths of <SVG>\r\n paths.forEach(e => {\r\n let path = element.querySelector(`.${e.name}`);\r\n if (path !== null) {\r\n const currentPathD = getCurrentPath(e.frames);\r\n // if (e.name === \"side\") console.log(currentPathD);\r\n path.setAttribute(\"d\", currentPathD);\r\n }\r\n });\r\n }\r\n\r\n if (keyframes !== undefined && keyframes !== null) {\r\n let styleProps = getCurrentStyleProps(keyframes);\r\n styleProps.forEach(styleProp => {\r\n element.style[styleProp.name] = styleProp.value + styleProp.postfix;\r\n });\r\n }\r\n });\r\n\r\n // Preparing and planing next frame\r\n currentFrame += 1;\r\n if (currentFrame > animations.duration) {\r\n finishAnimation();\r\n return false;\r\n }\r\n\r\n requestAnimationFrame(animate);\r\n return true;\r\n }", "title": "" }, { "docid": "95a2fc28b7718232a11d222851b1cc67", "score": "0.51056755", "text": "function AnimationAnimateRefMetadata() {}", "title": "" }, { "docid": "d6eec6f413f3de63b4340b6e974256b9", "score": "0.5100029", "text": "onDesignChange(editorComponent, designRoute, designUpdate) {\n if ( typeof(editorComponent) != \"string\" ) { throw Error(\"onDesignChange call made with previous API, first arg is the editorCompponent\")}\n\n // console.log(\"IwpDesignerContainer:41> Design Change: designRoute: \", designRoute, \" designUpdate: \", designUpdate, \" {[designRoute]: designUpdate}: \", {[designRoute]: designUpdate} );\n // Mutate the animation\n // console.log(\"IwpDesignerContainer:45> State.animation: \", this.state.animation );\n\n // This should become defined by the below router\n let animationUpdate = undefined;\n\n if ( ! Array.isArray(designRoute) ) {\n throw Error(\"DesignRoute was not an array: \" + JSON.stringify(designRoute) );\n } else {\n\n if (designRoute[0] === \"objects\" && designRoute.length > 1) {\n\n // 2nd level\n\n if (designRoute[1] === \"name\" && designRoute.length > 2 ) {\n\n // Find the Objects index by its name property\n const objectIndex = this.findIndexWithAttr( this.state.animation.objects, \"name\", designRoute[2] );\n\n if ( objectIndex < 0 ) {\n throw Error(\"DesignRoute was unable to locate an object by name: \" + JSON.stringify(designRoute) );\n } else {\n animationUpdate = { objects: { [objectIndex]: designUpdate } };\n }\n\n } else if (designRoute[1] === \"order\" && designRoute.length > 2 ) {\n\n const objectOrder = +designRoute[2];\n // We know the object order so can make a direct update.\n animationUpdate = { objects: { [objectOrder] : designUpdate } };\n\n } else {\n\n throw Error(\"DesignRoute objects 2nd part not recognized: \" + JSON.stringify(designRoute));\n }\n\n\n } else if (designRoute[0] === \"author\") {\n // So clean!\n animationUpdate = { author: designUpdate };\n\n } else {\n\n throw Error(\"DesignRoute[0] was not recognized as objects or author: \" + JSON.stringify(designRoute));\n }\n }\n\n\n // Store it!\n if ( animationUpdate ) {\n this.applyAnimationUpdate(editorComponent, designRoute, animationUpdate, \"onDesignChange\", false );\n } else {\n throw Error(\"No Animation Update resulted from Design Route: \" + JSON.stringify(designRoute));\n }\n\n }", "title": "" }, { "docid": "ef7e93c9d5159aefdb53280752091191", "score": "0.5097085", "text": "aniChecked(checked) {\n react_native_1.Animated.parallel([\n react_native_1.Animated.timing(this.animatedRadius, {\n duration: 220,\n toValue: checked ? 5 : 0,\n }),\n react_native_1.Animated.timing(this.animatedSize, {\n duration: 220,\n toValue: checked ? 10 : 0,\n }),\n ]).start();\n }", "title": "" }, { "docid": "5f78d79a8c6045b90aefbdd3cd701547", "score": "0.5091192", "text": "function MakingAnimation() {\n\n\t//Rest group_block to zero\n\tantHelper.createAnimation({\n\t\tanimId: \"Group_blockRest\",\n\t\tnodeId: \"Group_block\",\n\t\tpropertyId: AR.animation.ANIMATE_TRANSLATE_Y,\n\t\tkeyCount: 2,\n\t\tkeyTimes: [0, 1],\n\t\tkeyValues: [1, 0],\n\t\ttype: AR.animation.CURVE_LINEAR\n\t});\n\n\t//Rest hint to zero\n\tantHelper.createAnimation({\n\t\tanimId: \"Guangquan_0010Rest\",\n\t\tnodeId: \"Guangquan_0010\",\n\t\tpropertyId: AR.animation.ANIMATE_TRANSLATE_Y,\n\t\tkeyCount: 2,\n\t\tkeyTimes: [0, 1],\n\t\tkeyValues: [1, 0],\n\t\ttype: AR.animation.CURVE_LINEAR\n\t});\n\n\tfor (var eIndex in StepGroupsNodeName) {\n\n\t\t//Scaling to 1.2,1,1.2\n\t\tantHelper.createAnimation({\n\t\t\tanimId: StepGroupsNodeName[eIndex] + \"Scale\",\n\t\t\tnodeId: StepGroupsNodeName[eIndex],\n\t\t\tpropertyId: AR.animation.ANIMATE_SCALE,\n\t\t\tkeyCount: 2,\n\t\t\tkeyTimes: [0, 2000],\n\t\t\tkeyValues: [0, 1, 0, 1.2, 1, 1.2, ],\n\t\t\ttype: AR.animation.CURVE_LINEAR\n\t\t});\n\n\n\t\t//Rest scale and position to 0,0,0\n\t\tantHelper.createAnimation({\n\t\t\tanimId: StepGroupsNodeName[eIndex] + \"RestToZero\",\n\t\t\tnodeId: StepGroupsNodeName[eIndex],\n\t\t\tpropertyId: AR.animation.ANIMATE_SCALE_TRANSLATE,\n\t\t\tkeyCount: 2,\n\t\t\tkeyTimes: [0, 1],\n\t\t\tkeyValues: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n\t\t\ttype: AR.animation.CURVE_LINEAR\n\t\t});\n\n\n\t\t//Rest scale to 1,1,1\n\t\tantHelper.createAnimation({\n\t\t\tanimId: StepGroupsNodeName[eIndex] + \"RestToOne\",\n\t\t\tnodeId: StepGroupsNodeName[eIndex],\n\t\t\tpropertyId: AR.animation.ANIMATE_SCALE,\n\t\t\tkeyCount: 2,\n\t\t\tkeyTimes: [0, 1],\n\t\t\tkeyValues: [0, 0, 0, 1, 1, 1],\n\t\t\ttype: AR.animation.CURVE_LINEAR\n\t\t});\n\t}\n\n\n\tfor (var eIndex in StepHintsNodeName)\n\t\tantHelper.createAnimation({\n\t\t\tanimId: StepHintsNodeName[eIndex] + \"Scale\",\n\t\t\tnodeId: StepHintsNodeName[eIndex],\n\t\t\tpropertyId: AR.animation.ANIMATE_SCALE,\n\t\t\tkeyCount: 2,\n\t\t\tkeyTimes: [0, 128],\n\t\t\tkeyValues: [0, 1, 0, 1.2, 1, 1.2, ],\n\t\t\ttype: AR.animation.CURVE_LINEAR\n\t\t});\n}", "title": "" }, { "docid": "d68fc1e5a9186072d245ef862490e705", "score": "0.50877935", "text": "_setAnimationTransitionState(viewState) {\n this._viewState = viewState || {};\n // If the animation for arrow position state (opacity/translation) should be disabled,\n // remove the fromState so that it jumps right to the toState.\n if (this._disableViewStateAnimation) {\n this._viewState = { toState: viewState.toState };\n }\n }", "title": "" }, { "docid": "d68fc1e5a9186072d245ef862490e705", "score": "0.50877935", "text": "_setAnimationTransitionState(viewState) {\n this._viewState = viewState || {};\n // If the animation for arrow position state (opacity/translation) should be disabled,\n // remove the fromState so that it jumps right to the toState.\n if (this._disableViewStateAnimation) {\n this._viewState = { toState: viewState.toState };\n }\n }", "title": "" }, { "docid": "2cabe59c40cbb93a1998f6da84aefdaf", "score": "0.5086673", "text": "constructor() {\r\n super();\r\n this.state = {\r\n animOpacity: new Animated.Value(0),\r\n slideDownValue: new Animated.Value(0),\r\n pressed: false,\r\n };\r\n this.animation = this.animation.bind(this);\r\n }", "title": "" }, { "docid": "d54b1bdad9239a7accdc533a78eab751", "score": "0.5075822", "text": "function _circleView() {\n\tvar dict = _circleState;\n\tif (!dict) {\n\t\treturn;\n\t}\n\t\n\tvar now = (new Date()).getTime();\n\tvar latest = 0;\n\tfor (var id in _circleState.items) {\n\t\tvar s = _circleState.items[id];\n\t\tif (s.start.time > now) {\n\t\t\tcontinue;\n\t\t}\n\t\tvar thisRad = 0;\n\t\tlatest = Math.max(s.end.time, latest);\n\t\t\n\t\t// animating\n\t\tif (now < s.end.time) {\n\t\t\tvar delta = (now - s.start.time) / s.duration;\n\t\t\tvar factor = delta;\n\t\t\tif (!s.linear) {\n\t\t\t\tfactor = ((delta * delta) * 3.0) - ((delta * delta * delta) * 2.0);\t\t// ease in-out\n\t\t\t}\n\t\t\tthisRad = s.start.rad + (factor * (s.end.rad - s.start.rad));\n\t\t}\n\t\telse {\n\t\t\tthisRad = s.end.rad;\n\t\t\tdelete _circleState.items[id];\n\t\t}\n\t\t\n\t\t// calculate position from angle\n\t\t_circlePutItem(s.view, thisRad, s.width, s.height, s.box);\n\t}\n\t\n\t// all done\n\tif (latest < now) {\n\t\twindow.clearInterval(_circleState.interval);\n\t\t_circleState.interval = null;\n\t\t_circleState.items = {};\n\t}\n}", "title": "" }, { "docid": "18d58050ad46c345e3bcc443905f49b4", "score": "0.50735295", "text": "render() {\n const { BOARD_WIDTH, BOARD_HEIGHT } = BOARD_CONSTANTS;\n document.body.style = 'background: #faf8ef;';\n return (\n <div>\n <svg width={BOARD_WIDTH} height={HEADER_HEIGHT + BOARD_HEIGHT + FOOTER_HEIGHT} align=\"center\">\n <Title />\n <Animate\n show\n start={{\n value: 0\n }}\n update={{\n value: [this.state.score],\n timing: { duration: ANIMATION_DURATIONS.SCORE_INCREASE_DURATION },\n }}\n >\n { ({ value }) => {\n return (\n <ScoreLabel score={value} />\n );\n }}\n </Animate>\n <g transform={`translate(${0},${HEADER_HEIGHT})`}>\n <Board x={0} y={0} />\n <NodeGroup\n data={this.state.filledData}\n keyAccessor={this.keyOfEntry}\n start={this.startTransition}\n enter={this.enterTransition}\n update={this.updateTransition}\n leave={this.updateLeave}\n >\n {(nodes) => (\n <g>\n {nodes.map(({ key, data, state }) =>\n <NumberTile key={data.id} data={data} state={state} />\n )}\n </g>\n )}\n </NodeGroup>\n <Animate\n show={gameOver(this.state.filledData)}\n start={{\n opacity: 0,\n backgroundColor: BOARD_COLOR,\n }}\n enter={{\n opacity: [0.7],\n timing: { duration: 1000 },\n }}\n >\n { ({backgroundColor, opacity}) => {\n return (\n <g>\n <rect\n x={0} y={0}\n width={BOARD_WIDTH} height={BOARD_HEIGHT}\n style={{opacity: opacity, fill: backgroundColor}}\n />\n <text\n textAnchor=\"middle\"\n x={BOARD_WIDTH/2}\n y={BOARD_HEIGHT/2}\n alignmentBaseline=\"central\"\n style={{fontSize: `4em`, fontFamily: 'clear_sansbold', fill: '#776e65', opacity: opacity}}\n >\n You Lose!\n </text>\n </g>\n );\n }}\n </Animate>\n </g>\n <g transform={`translate(${BOARD_WIDTH/2},${HEADER_HEIGHT + BOARD_HEIGHT})`}>\n <Footer />\n </g>\n </svg>\n </div>\n );\n }", "title": "" }, { "docid": "f88ef8d947c2c4128e852e6e15dba628", "score": "0.50703657", "text": "changerAnimation(val) {\n console.log(\"oui\")\n if (val == \"anim_1\") {\n console.log(\"anim_1\");\n this.shadowRoot.querySelector(\"#logo\").className = \"\";\n this.setAttribute(\"animation\", \"focus-in-expand\")\n this.shadowRoot.querySelector(\"#logo\").className = \"focus-in-expand\";\n\n }\n if (val == \"anim_2\") {\n console.log(\"anim_2\");\n this.shadowRoot.querySelector(\"#logo\").className = \"\";\n this.setAttribute(\"animation\", \"scale-up-center\")\n this.shadowRoot.querySelector(\"#logo\").className = \"scale-up-center\";\n }\n if (val == \"anim_3\") {\n console.log(\"anim_3\");\n this.shadowRoot.querySelector(\"#logo\").className = \"\";\n this.setAttribute(\"animation\", \"scale-down-center\")\n this.shadowRoot.querySelector(\"#logo\").className = \"scale-down-center\";\n }\n if (val == \"anim_4\") {\n console.log(\"anim_4\");\n this.shadowRoot.querySelector(\"#logo\").className = \"\";\n this.setAttribute(\"animation\", \"jello-vertical\")\n this.shadowRoot.querySelector(\"#logo\").className = \"jello-vertical\";\n }\n if (val == \"anim_5\") {\n console.log(\"anim_4\");\n this.shadowRoot.querySelector(\"#logo\").className = \"\";\n this.setAttribute(\"animation\", \"wobble-hor-bottom\")\n this.shadowRoot.querySelector(\"#logo\").className = \"wobble-hor-bottom\";\n }\n }", "title": "" }, { "docid": "951a0e0b94083bac9d4ef41c14d3dc47", "score": "0.5062256", "text": "function useValueAnimationControls(config, props, subscribeToParentControls, parentContext) {\r\n var variants = props.variants, transition = props.transition;\r\n var parentControls = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useContext\"])(MotionContext).controls;\r\n var controls = useConstant(function () { return new ValueAnimationControls(config); });\r\n // Reset and resubscribe children every render to ensure stagger order is correct\r\n if (!parentContext ||\r\n !parentContext.exitProps ||\r\n !parentContext.exitProps.isExiting) {\r\n controls.resetChildren();\r\n controls.setProps(props);\r\n controls.setVariants(variants);\r\n controls.setDefaultTransition(transition);\r\n }\r\n // We have to subscribe to the parent controls within a useEffect rather than during render,\r\n // as\r\n Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useEffect\"])(function () {\r\n if (subscribeToParentControls && parentControls) {\r\n parentControls.addChild(controls);\r\n }\r\n });\r\n Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useEffect\"])(function () {\r\n return function () {\r\n // Remove reference to onAnimationComplete from controls. All the MotionValues\r\n // are unsubscribed from this component separately. We let animations run out\r\n // as they might be animating other components.\r\n var onAnimationComplete = props.onAnimationComplete, unmountProps = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(props, [\"onAnimationComplete\"]);\r\n controls.setProps(unmountProps);\r\n parentControls && parentControls.removeChild(controls);\r\n };\r\n }, []);\r\n return controls;\r\n}", "title": "" }, { "docid": "dad4736dd92338830aa805d4a498ca2c", "score": "0.50585896", "text": "_animateContainer(container, el) {\n function easeInOutQuad(t, b, c, d) {\n t /= d / 2;\n if (t < 1) return c / 2 * t * t + b;\n t--;\n return -c / 2 * (t * (t - 2) - 1) + b;\n }\n\n const target = el.offsetTop - 10;\n const start = container.scrollTop;\n const time = 250;\n let elapsed = 0;\n let last = new Date().getTime();\n\n const anim = () => {\n const req = requestAnimationFrame(() => {\n const now = new Date().getTime();\n const delta = now - last;\n elapsed += delta;\n const val = easeInOutQuad(Math.min(elapsed, time), start, target - start, time);\n container.scrollTop = val;\n last = now;\n if (val !== target) {\n anim();\n } else {\n this.state.animationFrame = null;\n }\n });\n this.state.animationFrame = req;\n };\n anim();\n }", "title": "" }, { "docid": "808874a9e56e6c271e33c8a06ab833bf", "score": "0.50483257", "text": "_stopAnimation(key, isNew) {\n const animated = this.animated[key];\n\n if (!animated) {\n return console.warn(`Cannot stop an animation for a key that isn't animated: \"${key}\"`);\n } // Prevent any pending updates to this key\n\n\n this.timestamps['to.' + key] = Object(_react_spring_shared_globals__WEBPACK_IMPORTED_MODULE_5__[\"now\"])(); // Idle animations are skipped unless their Animated node changed\n\n const state = this.animations[key] || emptyObj;\n if (state.idle && animated === state.animated) return; // Use the previous `isNew` value if nothing was passed\n\n if (_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"is\"].und(isNew)) {\n isNew = !!state.isNew;\n } // Tell the frameloop to skip animating these values\n\n\n const animatedValues = Array.from(animated.getPayload());\n Object(_react_spring_shared__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(animatedValues, node => {\n node.done = true;\n }); // The current value becomes the goal value,\n // which ensures the integrity of the diffing algorithm.\n\n const goalValue = animated.getValue();\n\n if (this.props.to) {\n this.props.to[key] = goalValue;\n } // Remove unused data from this key's animation config\n\n\n this.animations[key] = {\n key,\n idle: true,\n isNew,\n goalValue,\n animated,\n animatedValues\n };\n }", "title": "" }, { "docid": "287a8ec4a4aa3308245379f1d997295c", "score": "0.5047054", "text": "function AnimationAnimateRefMetadata() { }", "title": "" }, { "docid": "287a8ec4a4aa3308245379f1d997295c", "score": "0.5047054", "text": "function AnimationAnimateRefMetadata() { }", "title": "" }, { "docid": "287a8ec4a4aa3308245379f1d997295c", "score": "0.5047054", "text": "function AnimationAnimateRefMetadata() { }", "title": "" }, { "docid": "287a8ec4a4aa3308245379f1d997295c", "score": "0.5047054", "text": "function AnimationAnimateRefMetadata() { }", "title": "" }, { "docid": "287a8ec4a4aa3308245379f1d997295c", "score": "0.5047054", "text": "function AnimationAnimateRefMetadata() { }", "title": "" }, { "docid": "69d54aa26da85f1eff2acc4418778dd8", "score": "0.5046492", "text": "_animate24HourView(current, value) {\n const that = this;\n let step = 0.2;\n\n that._inInnerCircle = false;\n\n const currentInnerCircle = current === 0 || current > 12,\n valueInnerCircle = value === 0 || value > 12;\n\n if (currentInnerCircle !== valueInnerCircle) {\n if (currentInnerCircle) {\n current = Math.abs(current - 12);\n }\n else {\n current = (current + 12) % 24;\n }\n\n that._inInnerCircle = valueInnerCircle;\n that._drawArrowSVG(true, current);\n\n if (current === value) {\n return;\n }\n }\n else {\n that._inInnerCircle = valueInnerCircle;\n }\n\n let start = current,\n end = value;\n\n if (that._inInnerCircle) {\n if (end === 0 && start < 18) {\n end = 12;\n }\n else if (start === 0 && end < 18) {\n start = 12;\n }\n }\n\n let distanceCW = end - start,\n distanceCCW = start - end;\n\n if (distanceCW < 0) {\n distanceCW += 12;\n }\n\n if (distanceCCW < 0) {\n distanceCCW += 12;\n }\n\n if (distanceCCW < distanceCW) {\n step *= -1;\n }\n\n function animate(inInnerCircle) {\n that._inInnerCircle = inInnerCircle;\n\n if (inInnerCircle) {\n current = parseFloat((current + step).toFixed(1));\n\n if (current < 0) {\n current += 24;\n }\n else if (current < 1) {\n current = current + 12;\n }\n\n if (current === 12 || current === 24) {\n current = 0;\n }\n }\n else {\n current += step;\n\n if (current !== 12) {\n current = parseFloat((current % 12).toFixed(1));\n }\n\n if (current <= 0) {\n current += 12;\n }\n }\n\n that._drawArrowSVG(true, current);\n\n if (current !== value) {\n that._animationFrameId = requestAnimationFrame(function () {\n animate(inInnerCircle);\n });\n }\n else {\n that._inInnerCircle = false;\n }\n }\n\n that._animationFrameId = requestAnimationFrame(function () {\n animate(that._inInnerCircle);\n });\n }", "title": "" }, { "docid": "842efc1b63cd5a55161a5a97126edfa7", "score": "0.5044338", "text": "componentDidMount() {\n const icGroupTitles = Array.prototype.slice.call(document.getElementsByClassName('ic-group-title'), 0);\n const icContainers = Array.prototype.slice.call(document.getElementsByClassName('ic-container'), 0);\n const animGroup = icGroupTitles.concat(icContainers), aGL = animGroup.length;\n const animTimeEach = 1.5;\n const animDelayEach = .05;\n let animDelayAcc = 0;\n for (let i = 0; i < aGL; i++) {\n TweenLite.from(animGroup[i], animTimeEach, {opacity: 0, delay: animDelayAcc});\n animDelayAcc += animDelayEach;\n }\n }", "title": "" }, { "docid": "34522ba8e3680b1683318c33db0f26a7", "score": "0.50391835", "text": "@action.bound\n touchFxIn() {\n // Set the starting value of the properties\n this.animation.scale.setValue(0);\n this.animation.opacity.setValue(0);\n // Animation sequence\n Animated.parallel([\n Animated.timing(this.animation.scale, {\n toValue: (Math.round(this.layout.width / 10)),\n duration: 200,\n easing: Easing.ease,\n useNativeDriver: true,\n }),\n Animated.timing(this.animation.opacity, {\n toValue: .2,\n duration: 200,\n easing: Easing.ease,\n useNativeDriver: true,\n })\n ]).start(this.touchFxOut);\n }", "title": "" }, { "docid": "fb8b899bc740e3430b888ef28912e118", "score": "0.5031506", "text": "function svgAnimator(config) {\n init();\n\n function init() {\n $(config.selector).each(function() {\n var delay,\n length,\n path,\n paths,\n previousStrokeLength,\n speed,\n _i,\n _len,\n _results;\n\n paths = $('path, circle, rect', this);\n delay = 0;\n _results = [];\n for (_i = 0, _len = paths.length; _i < _len; _i++) {\n path = paths[_i];\n length = path.getTotalLength();\n previousStrokeLength = speed || 0;\n speed = 120;\n delay += previousStrokeLength + 20;\n _results.push($(path)\n .css('transition', 'none')\n .attr('data-length', length)\n .attr('data-speed', speed)\n .attr('data-delay', delay)\n .attr('stroke-dashoffset', length)\n .attr('stroke-dasharray', length + ',' + length)\n );\n }\n return _results;\n\n });\n }\n\n function animate() {\n $(config.selector).each(function() {\n var delay,\n length,\n path,\n paths,\n speed,\n _i,\n _len,\n _results;\n\n paths = $('path, circle, rect', this);\n _results = [];\n for (_i = 0, _len = paths.length; _i < _len; _i++) {\n path = paths[_i];\n length = $(path).attr('data-length');\n speed = $(path).attr('data-speed');\n delay = $(path).attr('data-delay');\n _results.push($(path)\n .css('transition', 'stroke-dashoffset ' + speed + 'ms ' + delay + 'ms linear')\n .attr('stroke-dashoffset', '0')\n );\n }\n return _results;\n });\n }\n\n return {\n animate: animate,\n init: init\n }\n}", "title": "" }, { "docid": "33cfc04ceadad01bf70529187d25be44", "score": "0.5021795", "text": "computeRelativeTransform() {\n const nodeMatrix = this.node.getMatrix();\n\n if ( this.instance.parent && !this.instance.parent.isTransformed ) {\n // mutable form of parentMatrix * nodeMatrix\n this.matrix.set( this.parent.matrix );\n this.matrix.multiplyMatrix( nodeMatrix );\n }\n else {\n // we are the first in the trail transform, so we just directly copy the matrix over\n this.matrix.set( nodeMatrix );\n }\n\n // mark the frame where this transform was updated, to accelerate non-precomputed access\n this.relativeFrameId = this.display._frameId;\n this.relativeSelfDirty = false;\n }", "title": "" }, { "docid": "3910241a75c613fd2a074b3c298d4102", "score": "0.5021773", "text": "updateElementPositions(signal, width, useAnimation) {\n let duration = useAnimation ? 500 : 0;\n\n let topRowHeight = this.controlsHeader.getHeight();\n let topLeftWidth = this.controlsHeader.getWidth();\n\n let topRightWidth = this.matrix.getWidth();\n let bottomRowHeight = this.matrix.getHeight();\n\n this.controlsHeaderSvg.transition()\n .duration(duration)\n .attr({\n width: topLeftWidth,\n height: topRowHeight\n });\n\n this.topHeaderSvg.transition()\n .duration(duration)\n .attr({\n width: topRightWidth,\n height: topRowHeight\n });\n\n this.leftHeaderSvg.transition()\n .duration(duration)\n .attr({\n width: topLeftWidth,\n height: bottomRowHeight\n });\n\n this.matrixSvg.transition()\n .duration(duration)\n .attr({\n width: topRightWidth,\n height: bottomRowHeight\n });\n\n }", "title": "" }, { "docid": "f413e2f822245726155e57ed745f569a", "score": "0.50167817", "text": "function tween(t) {\n let b = oi(t);\n a.x0s = b.x0;\n a.x1s = b.x1;\n return vis.arc(b);\n }", "title": "" }, { "docid": "2f23584f303a8a2df0b6a8ffe2328767", "score": "0.5014999", "text": "function ArmatureAnimator()\n{\n this.animations = [];\n \n this.playTime = 0;\n \n this.tempPosV = vec3.create();\n this.tempRotV = quat.create();\n this.tempSclV = vec3.create();\n}", "title": "" }, { "docid": "6fc732445ab3c2073481db4117f6568c", "score": "0.5013269", "text": "componentDidUpdate(prevProps, prevState) {\r\n\t\tif (this.props.isCover && !prevState.isAnimating) {\r\n\t\t\tlet onEndAnimation = () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tisLoading: true\r\n\t\t\t\t});\r\n\t\t\t};\r\n\t\t\tthis.animateSVG(\"in\", onEndAnimation);\r\n\t\t} else if (!this.props.isCover && prevState.isAnimating) {\r\n\t\t\tthis.animateSVG(\"out\", () => {\r\n\t\t\t\t// reset path\r\n\t\t\t\tthis.path.attr(\"d\", this.initialPath);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tisShow: false,\r\n\t\t\t\t\tisAnimating: false\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "93c66e6ac67a512b24480e4f13b49ffe", "score": "0.50131565", "text": "function backFromDetailedView() {\n // changing the value to make sliding right animation\n Animated.timing(transformXValue, {\n toValue: 0,\n duration: 200,\n useNativeDriver: true,\n }).start();\n }", "title": "" }, { "docid": "b9d014af956fcd326204f2cce766be88", "score": "0.5012568", "text": "componentDidMount() {\n\n\t\t// Util functions (compose style)\n\t\tconst getSvgById = id => this.plpSvgRef.current.querySelector(id);\n\t\tconst domToElementsObject = attribute => domElement => domElement.querySelectorAll(attribute);\n\t\tconst objectToArray = object => typeof object === 'object' ? Object.values(object) : {};\n\t\tconst findItemById = id => array => array.filter(element => element.dataset.id === id)[0];\n\t\t// END util functions\n\n\t\tconst svgItems = compose(\n\t\t\tgetSvgById,\n\t\t\tdomToElementsObject(\"[data-id]\"),\n\t\t\tobjectToArray\n\t\t)(\"#plp_svg\");\n\n\t\tconst P1 = findItemById('P1')(svgItems);\n\t\tconst L = findItemById('L')(svgItems);\n\t\tconst P2 = findItemById('P2')(svgItems);\n\n\t\tconst moveAlongYAxis = (length) => ({ y: length });\n\t\tconst moveAlongCubicalXAxis = (length) => ({ x: length*Math.cos(Math.PI / 6), y: -length*Math.sin(Math.PI / 6) });\n\t\tconst moveAlongCubicalYAxis = (length) => ({ x: length*Math.cos(Math.PI / 6), y: length*Math.sin(Math.PI / 6) });\n\n\t\tconst animation = new TimelineLite();\n\n\t\tanimation\n\t\t\t.to(P1, 2, { ... moveAlongCubicalXAxis(540), ease: Power1.none })\n\t\t\t.to(L, 2, { ... moveAlongYAxis(598), ease: Bounce.easeOut}, \"-=1.5\")\n\t\t\t.to(P2, 2, { ... moveAlongCubicalXAxis(-820), ease: Power1.none}, \"-=1\");\n\n\t\t// Play just the sought part of the animation\n\t\t// animation.seek(\"fourth\");\n\n\t\t// Speed up animation\n\t\t// animation.timeScale(4);\n\t}", "title": "" }, { "docid": "b5801b7eeb0c9f8dc6c7b0e1403009cd", "score": "0.50012636", "text": "applyAnimationUpdate(editorComponent, designRoute, animationUpdate, eventMethod, rerender ) {\n if ( typeof(editorComponent) != \"string\" ) { throw Error(\"onDesignChange call made with previous API, first arg is the editorCompponent\")}\n\n console.log(\"IwpDesignerContainer:193> applyAnimationUpdate: editorComponent: \", editorComponent, \" designRoute: \", designRoute, \" animationUpdate: \", animationUpdate, \" eventMethod: \" , eventMethod );\n // console.log(\"IwpDesignerContainer:195> state.animationRerenderIncrement: \" , this.state.animationRerenderIncrement , \" adder: \" , ( rerender ? 1 : 0 ));\n\n this.setState({\n animation: update(this.state.animation, animationUpdate),\n animationUpdates: update(this.state.animationUpdates, {\n $push: [{\n editorComponent: editorComponent,\n designRoute: designRoute,\n designUpdate: animationUpdate,\n eventMethod: eventMethod\n }]\n }),\n animationRerenderIncrement: this.state.animationRerenderIncrement + ( rerender ? 1 : 0 )\n })\n\n }", "title": "" }, { "docid": "998d1a410f15ec27c1f0b13f83032389", "score": "0.5000994", "text": "function at(t,e){var n=a(t),i=void 0===S[0];e=void 0===e||!!e,r.animate&&!i&&o(x,r.cssClasses.tap,r.animationDuration),E.forEach(function(t){ot(t,function(t,e){return null===t||!1===t||void 0===t?S[e]:(\"number\"==typeof t&&(t=String(t)),t=r.format.from(t),!1===(t=P.toStepping(t))||isNaN(t)?S[e]:t)}(n[t],t),!0,!1)}),E.forEach(function(t){ot(t,S[t],!0,!0)}),rt(),E.forEach(function(t){X(\"update\",t),null!==n[t]&&e&&X(\"set\",t)})}", "title": "" }, { "docid": "1a3c7b3e328c63ab68036ccdf5d08fa5", "score": "0.4998974", "text": "function genAnimateChild(transitionSupport) {\n var AnimateChild = function (_React$Component) {\n inherits_default()(AnimateChild, _React$Component);\n\n function AnimateChild() {\n classCallCheck_default()(this, AnimateChild);\n\n // [Legacy] Since old code addListener on the element.\n // To avoid break the behaviour that component not handle animation/transition\n // also can handle the animate, let keep the logic.\n var _this = possibleConstructorReturn_default()(this, (AnimateChild.__proto__ || Object.getPrototypeOf(AnimateChild)).call(this));\n\n _this.state = {\n child: null,\n\n eventQueue: [],\n eventActive: false\n };\n\n _this.onDomUpdated = function () {\n var eventActive = _this.state.eventActive;\n var _this$props = _this.props,\n transitionName = _this$props.transitionName,\n animation = _this$props.animation,\n onChildLeaved = _this$props.onChildLeaved,\n animateKey = _this$props.animateKey;\n\n\n var $ele = _this.getDomElement();\n\n // Skip if dom element not ready\n if (!$ele) return;\n\n // [Legacy] Add animation/transition event by dom level\n if (transitionSupport && _this.$prevEle !== $ele) {\n _this.cleanDomEvent();\n\n _this.$prevEle = $ele;\n _this.$prevEle.addEventListener(animationEndName, _this.onMotionEnd);\n _this.$prevEle.addEventListener(transitionEndName, _this.onMotionEnd);\n }\n\n var currentEvent = _this.getCurrentEvent();\n if (currentEvent.empty) {\n // Additional process the leave event\n if (currentEvent.lastEventType === 'leave') {\n onChildLeaved(animateKey);\n }\n return;\n }\n\n var eventType = currentEvent.eventType,\n restQueue = currentEvent.restQueue;\n\n var nodeClasses = _component_classes_1_2_6_component_classes_default()($ele);\n\n // [Legacy] Since origin code use js to set `className`.\n // This caused that any component without support `className` can be forced set.\n // Let's keep the logic.\n function legacyAppendClass() {\n if (!transitionSupport) return;\n\n var basicClassName = getTransitionName(transitionName, '' + eventType);\n if (basicClassName) nodeClasses.add(basicClassName);\n\n if (eventActive) {\n var activeClassName = getTransitionName(transitionName, eventType + '-active');\n if (activeClassName) nodeClasses.add(activeClassName);\n }\n }\n\n if (_this.currentEvent && _this.currentEvent.type === eventType) {\n legacyAppendClass();\n return;\n }\n\n // Clear timeout for legacy check\n clearTimeout(_this.timeout);\n\n // Clean up last event environment\n if (_this.currentEvent && _this.currentEvent.animateObj && _this.currentEvent.animateObj.stop) {\n _this.currentEvent.animateObj.stop();\n }\n\n // Clean up last transition class\n if (_this.currentEvent) {\n var basicClassName = getTransitionName(transitionName, '' + _this.currentEvent.type);\n var activeClassName = getTransitionName(transitionName, _this.currentEvent.type + '-active');\n if (basicClassName) nodeClasses.remove(basicClassName);\n if (activeClassName) nodeClasses.remove(activeClassName);\n }\n\n // New event come\n _this.currentEvent = {\n type: eventType\n };\n\n var animationHandler = (animation || {})[eventType];\n // =============== Check if has customize animation ===============\n if (animationHandler) {\n _this.currentEvent.animateObj = animationHandler($ele, function () {\n _this.onMotionEnd({ target: $ele });\n });\n\n // Do next step if not animate object provided\n if (!_this.currentEvent || !_this.currentEvent.animateObj) {\n _this.nextEvent(restQueue);\n }\n\n // ==================== Use transition instead ====================\n } else if (transitionSupport) {\n legacyAppendClass();\n if (!eventActive) {\n // Trigger `eventActive` in next frame\n _raf_3_4_1_raf_default()(function () {\n if (_this.currentEvent && _this.currentEvent.type === eventType && !_this._destroy) {\n _this.setState({ eventActive: true }, function () {\n // [Legacy] Handle timeout if browser transition event not handle\n var transitionDelay = getStyleValue($ele, 'transition-delay') || 0;\n var transitionDuration = getStyleValue($ele, 'transition-duration') || 0;\n var animationDelay = getStyleValue($ele, 'animation-delay') || 0;\n var animationDuration = getStyleValue($ele, 'animation-duration') || 0;\n var totalTime = Math.max(transitionDuration + transitionDelay, animationDuration + animationDelay);\n\n if (totalTime >= 0) {\n _this.timeout = setTimeout(function () {\n _this.onMotionEnd({ target: $ele });\n }, totalTime * 1000);\n }\n });\n }\n });\n }\n\n // ======================= Just next action =======================\n } else {\n _this.onMotionEnd({ target: $ele });\n }\n };\n\n _this.onMotionEnd = function (_ref) {\n var target = _ref.target;\n var _this$props2 = _this.props,\n transitionName = _this$props2.transitionName,\n onChildLeaved = _this$props2.onChildLeaved,\n animateKey = _this$props2.animateKey,\n onAppear = _this$props2.onAppear,\n onEnter = _this$props2.onEnter,\n onLeave = _this$props2.onLeave,\n onEnd = _this$props2.onEnd;\n\n var currentEvent = _this.getCurrentEvent();\n if (currentEvent.empty) return;\n\n // Clear timeout for legacy check\n clearTimeout(_this.timeout);\n\n var restQueue = currentEvent.restQueue;\n\n\n var $ele = _this.getDomElement();\n if (!_this.currentEvent || $ele !== target) return;\n\n if (_this.currentEvent.animateObj && _this.currentEvent.animateObj.stop) {\n _this.currentEvent.animateObj.stop();\n }\n\n // [Legacy] Same as above, we need call js to remove the class\n if (transitionSupport && _this.currentEvent) {\n var basicClassName = getTransitionName(transitionName, _this.currentEvent.type);\n var activeClassName = getTransitionName(transitionName, _this.currentEvent.type + '-active');\n\n var nodeClasses = _component_classes_1_2_6_component_classes_default()($ele);\n if (basicClassName) nodeClasses.remove(basicClassName);\n if (activeClassName) nodeClasses.remove(activeClassName);\n }\n\n // Additional process the leave event\n if (_this.currentEvent && _this.currentEvent.type === 'leave') {\n onChildLeaved(animateKey);\n }\n\n // [Legacy] Trigger on event when it's last event\n if (_this.currentEvent && !restQueue.length) {\n if (_this.currentEvent.type === 'appear' && onAppear) {\n onAppear(animateKey);\n } else if (_this.currentEvent.type === 'enter' && onEnter) {\n onEnter(animateKey);\n } else if (_this.currentEvent.type === 'leave' && onLeave) {\n onLeave(animateKey);\n }\n\n if (onEnd) {\n // OnEnd(key, isShow)\n onEnd(animateKey, _this.currentEvent.type !== 'leave');\n }\n }\n\n _this.currentEvent = null;\n\n // Next queue\n _this.nextEvent(restQueue);\n };\n\n _this.getDomElement = function () {\n if (_this._destroy) return null;\n return external_root_ReactDOM_var_ReactDOM_commonjs_react_dom_commonjs2_react_dom_amd_react_dom_default.a.findDOMNode(_this);\n };\n\n _this.getCurrentEvent = function () {\n var _this$state$eventQueu = _this.state.eventQueue,\n eventQueue = _this$state$eventQueu === undefined ? [] : _this$state$eventQueu;\n var _this$props3 = _this.props,\n animation = _this$props3.animation,\n exclusive = _this$props3.exclusive,\n transitionAppear = _this$props3.transitionAppear,\n transitionEnter = _this$props3.transitionEnter,\n transitionLeave = _this$props3.transitionLeave;\n\n\n function hasEventHandler(eventType) {\n return eventType === 'appear' && (transitionAppear || animation.appear) || eventType === 'enter' && (transitionEnter || animation.enter) || eventType === 'leave' && (transitionLeave || animation.leave);\n }\n\n var event = null;\n // If is exclusive, only check the last event\n if (exclusive) {\n var eventType = eventQueue[eventQueue.length - 1];\n if (hasEventHandler(eventType)) {\n event = {\n eventType: eventType,\n restQueue: []\n };\n }\n } else {\n // Loop check the queue until find match\n var cloneQueue = eventQueue.slice();\n while (cloneQueue.length) {\n var _cloneQueue = cloneQueue,\n _cloneQueue2 = toArray_default()(_cloneQueue),\n _eventType = _cloneQueue2[0],\n restQueue = _cloneQueue2.slice(1);\n\n if (hasEventHandler(_eventType)) {\n event = {\n eventType: _eventType,\n restQueue: restQueue\n };\n break;\n }\n cloneQueue = restQueue;\n }\n }\n\n if (!event) {\n event = {\n empty: true,\n lastEventType: eventQueue[eventQueue.length - 1]\n };\n }\n\n return event;\n };\n\n _this.nextEvent = function (restQueue) {\n // Next queue\n if (!_this._destroy) {\n _this.setState({\n eventQueue: restQueue,\n eventActive: false\n });\n }\n };\n\n _this.cleanDomEvent = function () {\n if (_this.$prevEle && transitionSupport) {\n _this.$prevEle.removeEventListener(animationEndName, _this.onMotionEnd);\n _this.$prevEle.removeEventListener(transitionEndName, _this.onMotionEnd);\n }\n };\n\n _this.$prevEle = null;\n\n _this.currentEvent = null;\n _this.timeout = null;\n return _this;\n }\n\n createClass_default()(AnimateChild, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.onDomUpdated();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n this.onDomUpdated();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n clearTimeout(this.timeout);\n this._destroy = true;\n this.cleanDomEvent();\n }\n }, {\n key: 'render',\n value: function render() {\n var _state = this.state,\n child = _state.child,\n eventActive = _state.eventActive;\n var _props = this.props,\n showProp = _props.showProp,\n transitionName = _props.transitionName;\n\n var _ref2 = child.props || {},\n className = _ref2.className;\n\n var currentEvent = this.getCurrentEvent();\n\n // Class name\n var connectClassName = transitionSupport && this.currentEvent ? _classnames_2_2_6_classnames_default()(className, getTransitionName(transitionName, this.currentEvent.type), eventActive && getTransitionName(transitionName, this.currentEvent.type + '-active')) : className;\n\n var show = true;\n\n // Keep show when is in transition or has customize animate\n if (transitionSupport && (!currentEvent.empty || this.currentEvent && this.currentEvent.animateObj)) {\n show = true;\n } else {\n show = child.props[showProp];\n }\n\n // Clone child\n var newChildProps = {\n className: connectClassName\n };\n\n if (showProp) {\n newChildProps[showProp] = show;\n }\n\n return external_root_React_var_React_commonjs_react_commonjs2_react_amd_react_default.a.cloneElement(child, newChildProps);\n }\n }], [{\n key: 'getDerivedStateFromProps',\n value: function getDerivedStateFromProps(nextProps, prevState) {\n var _prevState$prevProps = prevState.prevProps,\n prevProps = _prevState$prevProps === undefined ? {} : _prevState$prevProps;\n var appeared = nextProps.appeared;\n\n\n var newState = {\n prevProps: cloneProps(nextProps, clonePropList)\n };\n\n function processState(propName, updater) {\n if (prevProps[propName] !== nextProps[propName]) {\n if (updater) {\n updater(nextProps[propName]);\n }\n return true;\n }\n return false;\n }\n\n function pushEvent(eventType) {\n var eventQueue = newState.eventQueue || prevState.eventQueue.slice();\n var matchIndex = eventQueue.indexOf(eventType);\n\n // Clean the rest event if eventType match\n if (matchIndex !== -1) {\n eventQueue = eventQueue.slice(0, matchIndex);\n }\n\n eventQueue.push(eventType);\n newState.eventQueue = eventQueue;\n }\n\n // Child update. Only set child.\n processState('children', function (child) {\n newState.child = child;\n });\n\n processState('appeared', function (isAppeared) {\n if (isAppeared) {\n pushEvent('appear');\n }\n });\n\n // Show update\n processState('show', function (show) {\n if (!appeared) {\n if (show) {\n pushEvent('enter');\n } else {\n pushEvent('leave');\n }\n }\n });\n\n return newState;\n }\n }]);\n\n return AnimateChild;\n }(external_root_React_var_React_commonjs_react_commonjs2_react_amd_react_default.a.Component);\n\n AnimateChild.propTypes = {\n transitionName: _prop_types_15_7_2_prop_types_default.a.oneOfType([_prop_types_15_7_2_prop_types_default.a.string, _prop_types_15_7_2_prop_types_default.a.object]),\n transitionAppear: _prop_types_15_7_2_prop_types_default.a.bool,\n transitionEnter: _prop_types_15_7_2_prop_types_default.a.bool,\n transitionLeave: _prop_types_15_7_2_prop_types_default.a.bool,\n exclusive: _prop_types_15_7_2_prop_types_default.a.bool,\n appeared: _prop_types_15_7_2_prop_types_default.a.bool,\n showProp: _prop_types_15_7_2_prop_types_default.a.string,\n\n animateKey: _prop_types_15_7_2_prop_types_default.a.any,\n animation: _prop_types_15_7_2_prop_types_default.a.object,\n onChildLeaved: _prop_types_15_7_2_prop_types_default.a.func,\n\n onEnd: _prop_types_15_7_2_prop_types_default.a.func,\n onAppear: _prop_types_15_7_2_prop_types_default.a.func,\n onEnter: _prop_types_15_7_2_prop_types_default.a.func,\n onLeave: _prop_types_15_7_2_prop_types_default.a.func\n };\n\n\n Object(react_lifecycles_compat_es[\"polyfill\"])(AnimateChild);\n\n return AnimateChild;\n}", "title": "" }, { "docid": "1cd53e53553ae4c585981be88485e2ef", "score": "0.4976996", "text": "function sortTransitions(current, current2, x, y, lerpValue) {\n if (current == current2) {\n showNumeral(current, x, y, tileWidth, light, dark);\n } else {\n if (current == \"A\" && current2 == \"B\") {\n animateAtoB(x, y, lerpValue);\n } else if (current == \"B\" && current2 == \"C\") {\n animateBtoC(x, y, lerpValue);\n } else if (current == \"C\" && current2 == \"D\") {\n animateCtoD(x, y, lerpValue);\n } else if (current == \"D\" && current2 == \"A\") {\n animateDtoA(x, y, lerpValue);\n } else if (current == \"A\" && current2 == \"C\") {\n animateAtoC(x, y, lerpValue);\n } else if (current == \"B\" && current2 == \"D\") {\n animateBtoD(x, y, lerpValue);\n } else if (current == \"C\" && current2 == \"A\") {\n animateCtoA(x, y, lerpValue);\n } else if (current == \"D\" && current2 == \"B\") {\n animateDtoB(x, y, lerpValue);\n } else if (current == \"A\" && current2 == \"D\") {\n animateAtoD(x, y, lerpValue);\n } else if (current == \"B\" && current2 == \"A\") {\n animateBtoA(x, y, lerpValue);\n } else if (current == \"C\" && current2 == \"B\") {\n animateCtoB(x, y, lerpValue);\n } else if (current == \"D\" && current2 == \"C\") {\n animateDtoC(x, y, lerpValue);\n } else {\n console.log(\"Erreur!\" + current + \", \" + current2);\n }\n }\n}", "title": "" }, { "docid": "86337eaa63ab47a76f05da23ce6e1330", "score": "0.4975739", "text": "animations() {\n this.scene.anims.create({\n key: 'idle',\n frames: [ { key: 'fighter', frame: 0 }],\n frameRate: 10\n });\n \n this.scene.anims.create({\n key: 'left',\n frames: [ { key: 'fighter', frame: 1 } ],\n frameRate: 10\n });\n \n this.scene.anims.create({\n key: 'right',\n frames: [ { key: 'fighter', frame: 2 } ],\n frameRate: 10\n });\n \n this.scene.anims.create({\n key:'up',\n frames: [ { key: 'fighter', frame: 3 } ],\n frameRate: 10\n });\n \n this.scene.anims.create({\n key:'up-left',\n frames: [ { key: 'fighter', frame: 4 } ],\n frameRate: 10\n });\n \n this.scene.anims.create({\n key:'up-right',\n frames: [ { key: 'fighter', frame: 5 } ],\n frameRate: 10\n });\n \n this.scene.anims.create({\n key:'down',\n frames: [ { key: 'fighter', frame: 6 } ],\n frameRate: 10\n });\n \n this.scene.anims.create({\n key:'down-left',\n frames: [ { key: 'fighter', frame: 7 } ],\n frameRate: 10\n });\n \n this.scene.anims.create({\n key:'down-right',\n frames: [ { key: 'fighter', frame: 8 } ],\n frameRate: 10\n });\n\n }", "title": "" }, { "docid": "4a7bec8dc2eac2c23484ac546d48ff99", "score": "0.4966276", "text": "function Animate() {\n\n var _run = {\n elastic: function(progress) {\n return Math.pow(2, 10 * (progress-1)) * Math.cos(20*Math.PI*1.5/3*progress);\n },\n linear: function(progress) {\n return progress;\n },\n quad: function(progress) {\n return Math.pow(progress, 2);\n },\n quint: function(progress) {\n return Math.pow(progress, 5);\n },\n circ: function(progress) {\n return 1 - Math.sin(Math.acos(progress))\n },\n back: function(progress, x) {\n var x = x || 5;\n return Math.pow(progress, 2) * ((x + 1) * progress - x)\n },\n bounce: function(progress) {\n for (var a = 0, b = 1, result; 1; a += b, b /= 2) {\n if (progress >= (7 - 4 * a) / 11) {\n return -Math.pow((11 - 6 * a - 11 * progress) / 4, 2) + Math.pow(b, 2)\n }\n }\n },\n elastic: function(progress, x) {\n return Math.pow(2, 10 * (progress-1)) * Math.cos(20*Math.PI*x/3*progress)\n }\n\n };\n\n return {\n init: function(opts) {\n var start = new Date,\n progress,\n el = opts.el,\n timer = setInterval(function() {\n progress = (new Date - start) / opts.duration;\n\n if (progress > 1) {\n progress = 1;\n }\n\n el.style[opts.css] = _run[opts.fn](progress, opts.x) * opts.delta + 'px';\n\n if (progress === 1) {\n clearInterval(timer);\n }\n\n }, opts.delay || 10);\n }\n }\n}", "title": "" }, { "docid": "42d20fdcca4c4ba9d9327129b017bbe8", "score": "0.49658957", "text": "function useValueAnimationControls(config, props, subscribeToParentControls) {\r\n var variants = props.variants, transition = props.transition;\r\n var parentControls = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useContext\"])(MotionContext).controls;\r\n var controls = useConstant(function () { return new ValueAnimationControls(config); });\r\n // Reset and resubscribe children every render to ensure stagger order is correct\r\n controls.resetChildren();\r\n controls.setProps(props);\r\n controls.setVariants(variants);\r\n controls.setDefaultTransition(transition);\r\n if (subscribeToParentControls && parentControls) {\r\n parentControls.addChild(controls);\r\n }\r\n Object(react__WEBPACK_IMPORTED_MODULE_1__[\"useEffect\"])(function () { return function () {\r\n // Remove reference to onAnimationComplete from controls. All the MotionValues\r\n // are unsubscribed from this component separately. We let animations run out\r\n // as they might be animating other components.\r\n var onAnimationComplete = props.onAnimationComplete, unmountProps = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(props, [\"onAnimationComplete\"]);\r\n controls.setProps(unmountProps);\r\n parentControls && parentControls.removeChild(controls);\r\n }; }, []);\r\n return controls;\r\n}", "title": "" }, { "docid": "3828e1d7727f7efdafc6ac3a2e097717", "score": "0.4961076", "text": "render() {\r\n // position will be a value between 0 and photos.length - 1 assuming you don't scroll pass the ends of the ScrollView\r\n let position = Animated.divide(this.scrollX, width);\r\n\r\n return (\r\n <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>\r\n <View\r\n // this will bound the size of the ScrollView to be a square because\r\n // by default, it will expand regardless if it has a flex value or not\r\n style={{ width, height: width }}\r\n >\r\n <ScrollView\r\n horizontal={true}\r\n pagingEnabled={true} // animates ScrollView to nearest multiple of it's own width\r\n showsHorizontalScrollIndicator={false}\r\n // the onScroll prop will pass a nativeEvent object to a function\r\n onScroll={Animated.event( // Animated.event returns a function that takes an array where the first element...\r\n [{ nativeEvent: { contentOffset: { x: this.scrollX } } }] // ... is an object that maps any nativeEvent prop to a variable\r\n )} // in this case we are mapping the value of nativeEvent.contentOffset.x to this.scrollX\r\n scrollEventThrottle={16} // this will ensure that this ScrollView's onScroll prop is called no faster than 16ms between each function call\r\n >\r\n {photos.map((source, i) => { // for every object in the photos array...\r\n return ( // ... we will return a square Image with the corresponding object as the source\r\n <Image\r\n key={i} // we will use i for the key because no two (or more) elements in an array will have the same index\r\n style={{ width, height: width*2 }}\r\n source={source}\r\n />\r\n );\r\n })}\r\n </ScrollView>\r\n </View>\r\n <View\r\n style={{ flexDirection: 'row' }} // this will layout our dots horizontally (row) instead of vertically (column)\r\n >\r\n {photos.map((_, i) => { // the _ just means we won't use that parameter\r\n let opacity = position.interpolate({\r\n inputRange: [i - 1, i, i + 1], // each dot will need to have an opacity of 1 when position is equal to their index (i)\r\n outputRange: [0.3, 1, 0.3], // when position is not i, the opacity of the dot will animate to 0.3\r\n // inputRange: [i - 0.50000000001, i - 0.5, i, i + 0.5, i + 0.50000000001], // only when position is ever so slightly more than +/- 0.5 of a dot's index\r\n // outputRange: [0.3, 1, 1, 1, 0.3], // is when the opacity changes from 1 to 0.3\r\n extrapolate: 'clamp' // this will prevent the opacity of the dots from going outside of the outputRange (i.e. opacity will not be less than 0.3)\r\n });\r\n return (\r\n <Animated.View // we will animate the opacity of the dots so use Animated.View instead of View here\r\n key={i} // we will use i for the key because no two (or more) elements in an array will have the same index\r\n style={{ opacity, height: 10, width: 10, backgroundColor: '#595959', margin: 8, borderRadius: 5 }}\r\n />\r\n );\r\n })}\r\n </View>\r\n </View>\r\n );\r\n }", "title": "" }, { "docid": "d8c8de5722b352e1fbb5cd5b2fc09f8b", "score": "0.49597803", "text": "updateElements() {\n this.itemg.selectAll('.chart__slice').transition(this.transition).attrTween('d', d => {\n const d2 = this.hData.filter(j => j.data.name === d.data.name)[0];\n const iy0 = d3$5.interpolate(d.y0, d2.y0);\n const iy1 = d3$5.interpolate(d.y1, d2.y1);\n const ix0 = d3$5.interpolate(d.x0, d2.x0);\n const ix1 = d3$5.interpolate(d.x1, d2.x1);\n return t => {\n d2.y0 = iy0(t);\n d2.y1 = iy1(t);\n d2.x0 = ix0(t);\n d2.x1 = ix1(t);\n return this.arc(d2);\n };\n }).style(\"fill\", d => this.colorElement(d.data));\n }", "title": "" }, { "docid": "8203dcf72eaa9c05758b1b3baa1af6d2", "score": "0.49572366", "text": "static _animateFrame(deltaTime, resolve, reject, attributes, duration, ontick) {\n let complete = attributes.length === 0;\n let dt = (duration * PIXI.settings.TARGET_FPMS) / deltaTime;\n\n // Update each attribute\n try {\n for (let a of attributes) {\n let da = a.delta / dt;\n if ( a.remaining < Math.abs(da) * 1.25 ) {\n a.parent[a.attribute] = a.to;\n a.remaining = 0;\n complete = true;\n } else {\n a.parent[a.attribute] += da;\n a.remaining -= Math.abs(da);\n }\n }\n if (ontick) ontick(dt, attributes);\n }\n catch (err) {\n reject(err);\n }\n\n // Resolve the original promise once the animation is complete\n if (complete) resolve();\n }", "title": "" }, { "docid": "c28052e38c300464d3fa5d8c18797977", "score": "0.4956072", "text": "function Shape({ extraState, pressed }) {\n const opacity = useDerivedValue(() => (pressed.value ? 0.5 : 1));\n\n const style = useAnimatedStyle(() => ({\n opacity: withTiming(opacity.value),\n }));\n\n return <Animated.View style={[styles.shape, style]} />;\n}", "title": "" }, { "docid": "5cd625b1e7650b8f74e8f140dbaa8c44", "score": "0.49515903", "text": "function startAnimation(key, value, target, _a) {\r\n var _b = _a.delay, delay$1 = _b === void 0 ? 0 : _b, transition = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(_a, [\"delay\"]);\r\n return value.start(function (complete) {\r\n var activeAnimation;\r\n var _a = getAnimation(key, value, target, transition), animationFactory = _a[0], _b = _a[1], valueDelay = _b.delay, options = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(_b, [\"delay\"]);\r\n if (valueDelay !== undefined) {\r\n delay$1 = valueDelay;\r\n }\r\n var animate = function () {\r\n var animation = animationFactory(options);\r\n // Bind animation opts to animation\r\n activeAnimation = animation.start({\r\n update: function (v) { return value.set(v); },\r\n complete: complete,\r\n });\r\n };\r\n // If we're delaying this animation, only resolve it **after** the delay to\r\n // ensure the value's resolve velocity is up-to-date.\r\n if (delay$1) {\r\n activeAnimation = Object(popmotion__WEBPACK_IMPORTED_MODULE_7__[\"delay\"])(secondsToMilliseconds(delay$1)).start({\r\n complete: animate,\r\n });\r\n }\r\n else {\r\n animate();\r\n }\r\n return function () {\r\n if (activeAnimation)\r\n activeAnimation.stop();\r\n };\r\n });\r\n}", "title": "" }, { "docid": "5cd625b1e7650b8f74e8f140dbaa8c44", "score": "0.49515903", "text": "function startAnimation(key, value, target, _a) {\r\n var _b = _a.delay, delay$1 = _b === void 0 ? 0 : _b, transition = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(_a, [\"delay\"]);\r\n return value.start(function (complete) {\r\n var activeAnimation;\r\n var _a = getAnimation(key, value, target, transition), animationFactory = _a[0], _b = _a[1], valueDelay = _b.delay, options = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(_b, [\"delay\"]);\r\n if (valueDelay !== undefined) {\r\n delay$1 = valueDelay;\r\n }\r\n var animate = function () {\r\n var animation = animationFactory(options);\r\n // Bind animation opts to animation\r\n activeAnimation = animation.start({\r\n update: function (v) { return value.set(v); },\r\n complete: complete,\r\n });\r\n };\r\n // If we're delaying this animation, only resolve it **after** the delay to\r\n // ensure the value's resolve velocity is up-to-date.\r\n if (delay$1) {\r\n activeAnimation = Object(popmotion__WEBPACK_IMPORTED_MODULE_7__[\"delay\"])(secondsToMilliseconds(delay$1)).start({\r\n complete: animate,\r\n });\r\n }\r\n else {\r\n animate();\r\n }\r\n return function () {\r\n if (activeAnimation)\r\n activeAnimation.stop();\r\n };\r\n });\r\n}", "title": "" } ]
0ba376cf83b01084b07e42829eee4a1a
State will track of field values
[ { "docid": "fc670ba410841b6b89d5790c28889077", "score": "0.0", "text": "constructor(props){\n super(props);\n\n this.state = {\n name: '',\n street: '',\n city: '',\n state: '',\n zip: '',\n\n nameError: '',\n streetError: '',\n cityError: '',\n stateError: '',\n zipError: ''\n };\n\n //bindings\n this.handleName = this.handleName.bind(this);\n this.handleStreet = this.handleStreet.bind(this);\n this.handleCity = this.handleCity.bind(this);\n this.handleState = this.handleState.bind(this);\n this.handleZip = this.handleZip.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleCancel = this.handleCancel.bind(this);\n }", "title": "" } ]
[ { "docid": "dba69ee5c0bc196650190d0368652fdb", "score": "0.67774063", "text": "onFieldChange(e) {\n this.setState({\n [e.target.name]: e.target.value\n });\n this.props.onValueChanges();\n }", "title": "" }, { "docid": "540d6cbd895376cb7ee4aa11f24b38b3", "score": "0.6595688", "text": "handleChangeFields(event){\n const name = event.target.name;\n const value = event.target.value;\n const obj = {};\n obj[name] = value; \n this.setState(obj);\n }", "title": "" }, { "docid": "4fc5b2d1100bb779485e744093d8a02d", "score": "0.656517", "text": "onUpdate(evt, name, field, value) {\n let values = this.state.values;\n values[name] = value;\n this.setState({ values });\n }", "title": "" }, { "docid": "a37e1f683d6fbc6e137f22ccd5024c7c", "score": "0.65013766", "text": "updateCurrentValue(fieldName, fieldValue) {\n const currentValues = this.state.currentValues\n currentValues[fieldName] = fieldValue\n this.setState({ currentValues })\n }", "title": "" }, { "docid": "d6f0c6ab054c36d7b49ed7e9836e7244", "score": "0.64963245", "text": "handleChange(field, e){\n let fields = this.state.fields;\n fields[field] = e.target.value; \n this.setState({fields});\n }", "title": "" }, { "docid": "ad016b1d1dfec5574ec86afceca17f72", "score": "0.6437709", "text": "function initState() {\n\t\tfor (var name in state) {\n\t\t\tvar prop = state[name];\n\t\t\tif (prop.value !== undefined) {\n\t\t\t\tself[name] = prop.value;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "03a267e8b09d8a69b4852d2efbcef220", "score": "0.64360785", "text": "handleChange(event) {\n var field = event.target.name;\n var value = event.target.value;\n\n var changes = {}; //object to hold changes\n changes[field] = value; //change this field\n this.setState(changes); //update state\n }", "title": "" }, { "docid": "0a2186abb243ce2a3dfa9a20e5f66cb3", "score": "0.6402832", "text": "handleChange(event) {\n var field = event.target.name;\n var value = event.target.value;\n\n var changes = {}; //object to hold changes\n changes[field] = value; //change this field\n this.setState(changes); //update state\n }", "title": "" }, { "docid": "671f7c9b27f81acbbbdc791ea0c68153", "score": "0.6391643", "text": "handleChange(event) {\n let field = event.target.name;\n let value = event.target.value;\n //console.log(field, value);\n let change = {};\n change[field] = value;\n this.setState(change);\n }", "title": "" }, { "docid": "cec032f4dd5068fa0d94d419b589068c", "score": "0.63823175", "text": "handleChange(event) {\n let field = event.target.name;\n let value = event.target.value;\n let changes = {};\n changes[field] = value;\n this.setState(changes);\n }", "title": "" }, { "docid": "40c976ab7367a3f4165d55cce3ee3d65", "score": "0.63680667", "text": "stateHandler(fieldName, value) {\n // update errors\n if (this.errors) {\n let index = this.errors.length - 1;\n while (index >= 0) {\n let error = this.errors[index];\n if (error.fieldName == fieldName) {\n this.errors.splice(index, 1);\n }\n index--;\n }\n }\n this.props.session[fieldName] = value;\n this.forceUpdateHandler();\n }", "title": "" }, { "docid": "cd0a664d63d5a513e183a966494f3223", "score": "0.6363771", "text": "changeState(field, value){\n let state = Session.get('medicationCardState');\n state[field] = value;\n Session.set('medicationCardState', state);\n }", "title": "" }, { "docid": "5a05a433a59e45df0b8390ba37d2fd87", "score": "0.6345908", "text": "onAfterChange(value) {\n console.log(this.state);\n }", "title": "" }, { "docid": "ff0b07ed8a4fc93310038ebcce08ecc6", "score": "0.63382256", "text": "updateStateSetting(value, field) {\n const state = this.state;\n state[field] = value;\n this.setState(state);\n }", "title": "" }, { "docid": "aa8f6d9bfb3808239c527b66b6d01779", "score": "0.63108855", "text": "onFieldChange (field, value){\n this.setState({\n formValues: Object.assign({},this.state.formValues, {\n [field]: value\n })\n },() => this.validate())\n }", "title": "" }, { "docid": "da268057be9cdc475976510c243b88b5", "score": "0.62638414", "text": "handleChange(event) {\n if (event.target.name == 'test_status') {\n\n const { put_data } = { ...this.state };\n const currentState = put_data;\n const { name, value } = event.target;\n currentState[name] = value;\n this.setState({ put_data: currentState })\n }\n else {\n const { put_data } = { ...this.state };\n const currentState = put_data;\n currentState.fields_data[event.target.id][event.target.name] = event.target.value;\n this.setState({ put_data: currentState })\n }\n console.log('PUT DATA=> ', this.state.put_data)\n }", "title": "" }, { "docid": "511b08bf3bf0961fa9ebb2437263be71", "score": "0.62616885", "text": "constructor(state = {}) {\n this.state = {};\n this.state.moveHistory = state.moveHistory || CLEANVALUE_MOVEHISTORY;\n this.state.currentMoveIndex = state.currentMoveIndex || CLEANVALUE_CURRENTMOVEINDEX;\n if(!this.state.currentMoveIndex && this.state.moveHistory.length > 0){\n this.state.currentMoveIndex = this.state.moveHistory.length-1;\n }\n\n if(!state.fields) {\n state.fields = KakurasuLevelGenerator.generateLevel();\n }\n this.state.fields = {};\n let fieldKeys = Object.keys(state.fields);\n for(let i=0; i<fieldKeys.length; i++){\n let fieldKey = fieldKeys[i];\n let fieldJSON = state.fields[fieldKey];\n this.state.fields[fieldKey] = new KakurasuField(fieldJSON);\n }\n this._loadFieldMetaInformations();\n }", "title": "" }, { "docid": "9bba576bafefbfc6a6298ec1cc3d3fb9", "score": "0.6239821", "text": "register(field, fieldState, fieldStuff) {\n debug('Register', field, fieldState);\n // Determine if the field has been registered before\n const registered = this.registered[field];\n // Set registered flag\n this.registered[field] = true;\n // Always register the field\n this.fields.set(field, fieldStuff);\n // Check for expected removal and clear it out on register\n const magicValue = field.slice(0, field.lastIndexOf(']') + 1 || field.length);\n delete this.expectedRemovals[magicValue];\n // The field is a shadow field ooo spooky so dont set anything\n if (fieldStuff.shadow) {\n return;\n }\n // Initialize state\n // When a user had keep state load existing values\n if (fieldStuff.keepState) {\n const value = ObjectMap.get(this.state.values, field);\n const initialValue = ObjectMap.get(this.options.initialValues, field);\n // If we have a defined value then set that\n if (value !== undefined) {\n this.getFormApi().setValue(field, value || fieldState.value);\n }\n // Otherwise we want to use the initial value \n else if (initialValue !== undefined) {\n this.getFormApi().setValue(field, initialValue);\n } else {\n // Otherwise set the value to whatever the field is set to ( might have been field level initial value )\n this.setValue(field, fieldState.value, false);\n }\n // Finnally we set touched\n const touched = ObjectMap.get(this.state.touched, field);\n this.getFormApi().setTouched(field, touched);\n // Error will get set by validator implicitly so we dont need to remember that\n } else {\n // Initialize the values if it needs to be\n const initialValue = ObjectMap.get(this.options.initialValues, field);\n if (initialValue !== undefined && !registered) {\n this.getFormApi().setValue(field, initialValue, { initial: true });\n } else {\n // Otherwise set the value to whatever the field is set to ( might have been field level initial value )\n this.setValue(field, fieldState.value, false);\n }\n this.setTouched(field, fieldState.touched);\n }\n this.setError(field, fieldState.error);\n\n }", "title": "" }, { "docid": "38dfb535f280111c2029213126ec81f1", "score": "0.6231107", "text": "stateChanged(state) {\n this._competitors = Object.values(state.form.competitors);\n this._offbeat_enabled = state.form.offbeat.competing;\n }", "title": "" }, { "docid": "6970ca823a4036df65c61e848a3c9a44", "score": "0.62263054", "text": "fieldChanged(event){\n const target = event.target;\n this.setState({\n [target.name] : target.value,\n });\n }", "title": "" }, { "docid": "a9c538d335cbcb62ad5e6f35ad678b6d", "score": "0.62197334", "text": "handleFieldChange (event) {\n let value = event.target.value\n this.setState({ value: value }, () => {\n super.handleChange(event)\n if (this.props.onUpdate) {\n this.props.onUpdate({\n name: this.props.name,\n value: this.state.value\n })\n }\n })\n }", "title": "" }, { "docid": "ea9123515906f5c65ff53e984c79a38c", "score": "0.6208605", "text": "handleChange(e) {\n\t\tlet fields = this.state.fields;\n fields[e.target.name] = e.target.value;\n this.setState({ fields });\n }", "title": "" }, { "docid": "167ad81626c5aac8c06e8404d9d88d65", "score": "0.61923605", "text": "set fields(fields){this._fields=fields;}", "title": "" }, { "docid": "414856f69b0cb8d3cb50d29adf4e1753", "score": "0.61781967", "text": "updateAccountState(event) { \n const field = event.target.name;\n const acct = this.state.account;\n acct[field] = event.target.value;\n console.log(acct);\n return this.setState({account: acct});\n }", "title": "" }, { "docid": "8be9c4fdbc9bfa63c3c7f8b555870a92", "score": "0.6176579", "text": "handleChange(e) {\n let fields = this.state.fields\n fields[e.target.name] = e.target.value\n this.setState({\n fields \n })\n }", "title": "" }, { "docid": "8d8698a00528b52bd1d7a3ea47ef94a8", "score": "0.61218077", "text": "set fields(fields){this.fields=fields;}", "title": "" }, { "docid": "6c69b03929d5ac567d5a62e1fca3200e", "score": "0.6105137", "text": "getServiceInfo(field, event){\r\n const receiverRequest = {};\r\n if (this.state.login === false && this.state.stepIndex === 2){\r\n receiverRequest[field] = event.target.value;\r\n console.log(\"You are not logged in,Fs but here is your job post\", receiverRequest);\r\n\r\n } else{\r\n console.log(receiverRequest)\r\n this.setState(receiverRequest)\r\n console.log(\"Your data has been sent\")\r\n }\r\n }", "title": "" }, { "docid": "7fc97dd67c8490e11e126dfc40fd8e0b", "score": "0.60886365", "text": "onEnter() {\n let { fields } = this.state;\n\n this.setState({ fields: fields + 1 });\n }", "title": "" }, { "docid": "727361f3696c3f1c822219a638889a71", "score": "0.60831654", "text": "checkChanged(itemIndex)\r\n\t{\r\n\t\tlet fields = this.state.fields;\r\n\t\tfields[itemIndex].fieldValue = !fields[itemIndex].fieldValue;\r\n\t\tthis.setState({fields:fields});\r\n\t}", "title": "" }, { "docid": "c3592a88dfc6273e3a4bd5ab385b4ee6", "score": "0.6079529", "text": "handleChange (field, event) {\n this.setState({ [field]: event.target.value }, () => {\n super.handleChange(event)\n if (this.props.onUpdate) {\n this.props.onUpdate({\n name: this.props.name,\n address: this.state.address,\n city: this.state.city,\n state: this.state.state,\n zipcode: this.state.zipcode,\n country: this.state.country,\n addressType: this.state.addressType,\n apoFpo: this.state.apoFpo,\n apoFpoType: this.state.apoFpoType\n })\n }\n })\n }", "title": "" }, { "docid": "f355cad16f3231b79502bff8193a9f5b", "score": "0.60651183", "text": "limpiarStateValues(){\n this.asignarValorState('tasafinanciamiento',0,'objConfiguracion');\n this.asignarValorState('porcientoenganche',0,'objConfiguracion');\n this.asignarValorState('plazomaximo',0,'objConfiguracion');\n }", "title": "" }, { "docid": "3d0c853ef70caa1e21f9d376d0502eb9", "score": "0.60457075", "text": "set fieldInfo(value) {}", "title": "" }, { "docid": "a6041651bfdfa11fce511afddcdac779", "score": "0.6042019", "text": "constructor(props) {\n super(props);\n \n this.state = {\n field2: '',\n field: '',\n };\n }", "title": "" }, { "docid": "702fbc79624e2494c0be581c4fc87462", "score": "0.60281724", "text": "function setState(e)\n\t{\n\t\tvar field = $(this);\n\n\t\t// Wrap within an instantaneous timeout so state changes can be detected on the next redraw. This fixes a\n\t\t// problem with the \"keydown\" event in that the key value is added to the field after the event has been\n\t\t// called. This means the value of the field returned will be the previous value. The timeout ensures that\n\t\t// the input happens before the value is checked.\n\t\tsetTimeout(function()\n\t\t{\n\t\t\tfield.parent()\n\n\t\t\t\t// Is the element in focus?\n\t\t\t\t.toggleClass(classes.focused, (e.type == 'focus') || field.is(':focus'))\n\n\t\t\t\t// Check if the fields value is an empty string. This works for select options that have an empty\n\t\t\t\t// value. This can be exploited by creating an empty option, disabling it and setting it as the\n\t\t\t\t// default.\n\t\t\t\t.toggleClass(classes.filled, !!field.val())\n\n\t\t\t\t// Only apply if browser supports field validation\n\t\t\t\t.toggleClass(classes.invalid, field[0].validity ? !field[0].validity.valid : false)\n\n\t\t\t\t// Specifically for textarea's. This is useful so that the label can be hidden when the content is\n\t\t\t\t// scrolled, so that the label and the fields text don't overlap and look ugly.\n\t\t\t\t.toggleClass(classes.scrolled, field.scrollTop() > 0);\n\t\t});\n\t}", "title": "" }, { "docid": "101a4646cfb05f020eb7dee530cb8c99", "score": "0.60174763", "text": "storeChanged() {}", "title": "" }, { "docid": "2570c9457ecc1f55b2a39bb7c08428db", "score": "0.59891516", "text": "mutateErrorState(fieldName, value) {\r\n const errors = this.state.errors;\r\n errors[fieldName] = value;\r\n this.setState(Object.assign(this.state, { errors: errors }));\r\n }", "title": "" }, { "docid": "ed8e272639922271b8eab39115a95201", "score": "0.5984108", "text": "setFields(value){this._fields=value;return this;}", "title": "" }, { "docid": "3219943e5edffcc7afe424b58bfbd2d7", "score": "0.5971033", "text": "get state() {\r\n return this.i.a;\r\n }", "title": "" }, { "docid": "4747cc374856018b4f5397c2db9b5299", "score": "0.59667665", "text": "handleChanges(event){\n\tvar name = event.target.name\n\tvar value = event.target.value\n\tvar obj = {}\n\tobj[name] = value\n\tthis.setState(obj)\n\tconsole.log(this.state[name])\n}", "title": "" }, { "docid": "da51d771119849176549312ed5d4cee4", "score": "0.5965867", "text": "grindstate() {\n let state = {\n minimized: false,\n fields: {},\n filters: [],\n selected: this.selectedrow,\n sort: (this.currentsort) ? this.currentsort : this.defaultsort,\n search: null\n };\n\n for (let f of this.fields) {\n if (f.hidden === undefined) { f.hidden = false; }\n state.fields[f.name] = {\n name: f.name,\n hidden: f.hidden\n };\n }\n if (this.activefilters) {\n for (let f of this.activefilters) {\n state.filters.push({\n filterid: f.filterid,\n field: f.field,\n comparator: f.comparator,\n value: f.value\n });\n }\n }\n\n return state;\n }", "title": "" }, { "docid": "4377ef8f4621259977075c1fb073be5c", "score": "0.5952495", "text": "onChangeFieldValue(event) {\n const { id, value } = event.target;\n let { vacationData } = this.state;\n if (id === 'note') {\n vacationData.note = value;\n } else {\n vacationData.type = value;\n }\n this.setState({ vacationData: vacationData });\n }", "title": "" }, { "docid": "6914b70c163f863e9925d3b23d927350", "score": "0.5928611", "text": "get fields(){return this._fields;}", "title": "" }, { "docid": "6914b70c163f863e9925d3b23d927350", "score": "0.5928611", "text": "get fields(){return this._fields;}", "title": "" }, { "docid": "adf663c349ffa5724ed6bea7465c271a", "score": "0.59272426", "text": "setInitialFieldValue() {\n const { incidentData } = this.props.liveScoreIncidentState;\n this.formRef.current.setFieldsValue({\n incidentTeamName: incidentData.teamId,\n incidentPlayerName: incidentData.playerIds,\n incidentName: incidentData.injury,\n mnbMatchId: incidentData.mnbMatchId,\n });\n }", "title": "" }, { "docid": "197c1c2f698a43b0e8077cab66ed8e6b", "score": "0.5915708", "text": "handleFetchFieldChange(e) {\n this.setState({ [e.target.name]: e.target.value });\n }", "title": "" }, { "docid": "bc4fcf097f706ddb41e6f2fc73fbd2b4", "score": "0.58889675", "text": "get fields() { return this._fields; }", "title": "" }, { "docid": "194c235806dd95bf4fbd58f17045b20d", "score": "0.5885678", "text": "handleFormChange(event) {\n let field = event.target.name;\n let value = event.target.value;\n let changes = {}; // object to hold changes in text fields\n\n changes[field] = value; //change this field\n this.setState(changes); //update state\n }", "title": "" }, { "docid": "d23a977e7eb4992df258ab6930ad571d", "score": "0.5882171", "text": "setFields(){}", "title": "" }, { "docid": "72d7bc517e6ac732acff1b3504d47933", "score": "0.58800393", "text": "addToAutofilledValues(property) {\n this.setState(prevState => ({\n autofilledValues: {\n ...prevState.autofilledValues,\n ...property\n }\n }));\n }", "title": "" }, { "docid": "a099431c529709d7dc389c6fe053e2bf", "score": "0.58789474", "text": "stateValue() {\n PropertyCard.renderByState(this.value);\n }", "title": "" }, { "docid": "6f271b02e5d81a64d6a44d88411c2c31", "score": "0.58708864", "text": "handleFieldChange(event) {\n this.recordInput.fields[event.target.dataset.fieldName] = event.target.value;\n }", "title": "" }, { "docid": "c0fd94397fa6e4b71d09064e73707b2b", "score": "0.5837889", "text": "handleFieldChange(e){\n let value = this.state.fieldValue;\n value[e.target.id] = e.target.value;\n\n this.setState({fieldValue: value});\n this.validateAdd();\n\n }", "title": "" }, { "docid": "f99fa8aee0b4d4c2cf02b53bac1bfea9", "score": "0.5823713", "text": "onFieldChange(field) {\n const { onChange } = this.props;\n let value = {};\n\n if (field === 'value') {\n value = '';\n } else {\n value[field] = [];\n }\n\n onChange(value);\n }", "title": "" }, { "docid": "6362f4dab4814d4fe3ca374a148e2641", "score": "0.58134824", "text": "handleFieldChange(event){\n var info=this.state.save_form;\n info[event.target.id] = event.target.value\n this.setState({save_form: info});\n }", "title": "" }, { "docid": "a1ab67bc9dc8256175e270a93952b6a1", "score": "0.5804636", "text": "constructor() {\n\t\tsuper()\n\n\t\tthis.state = {\n\t\t\t\n\t\t\tname: '',\n\t\t\tspecifics: '',\n\t\t\tpairs: '',\n\t\t\tcreated: false //this boolean exists for showing the user a message after the form is submitted\n\t\t};\n\t}", "title": "" }, { "docid": "835402e8abf39cf0d9d4457d8e87d5e3", "score": "0.58035576", "text": "get state() {\r\n return this._state;\r\n }", "title": "" }, { "docid": "b4ae63eaa21d810b7c9b339adf8c2fdc", "score": "0.5801452", "text": "changeStartValues(e) {\n let newStartValues = this.state.startValues;\n newStartValues[e.target.name] = e.target.value;\n\n this.setState({startValues: newStartValues});\n }", "title": "" }, { "docid": "4ecbfbdaeacea5051b5290cf9674f85a", "score": "0.5799148", "text": "DetHandleChange(field, e) {\n let fields = this.state.detFields;\n if(field != \"kode_barang\"){\n fields[field] = e.target.value;\n }else{\n fields[field] = e.target.value.kode;\n fields[\"nama_barang\"] = e.target.value.nama;\n }\n this.setState( { detFields : fields } );\n }", "title": "" }, { "docid": "d12532b415ecd4696a31b5650e4142c2", "score": "0.5792615", "text": "handleChange(event) {\n let newState = {\n [event.target.name]: event.target.value\n };\n console.log('state', newState);\n this.setState(newState);\n }", "title": "" }, { "docid": "8038ad4220b6455023a9aa437cd06bdb", "score": "0.5789973", "text": "static get properties() { return {\n state:{type:Object}\n }}", "title": "" }, { "docid": "39d81a64c5172b518a0458ce0dad0012", "score": "0.5789968", "text": "onFormFieldsChange(e) {\n e.preventDefault();\n this.setState({ [e.target.name]: e.target.value });\n }", "title": "" }, { "docid": "903191e332dd38cfc8dc30c9a4556266", "score": "0.57880574", "text": "setFields() {\n this.keys().forEach(this.setField.bind(this));\n }", "title": "" }, { "docid": "303fad11386b398846b22491df77400e", "score": "0.57876724", "text": "constructor(){\n super();\n this.state= {\n currentValue: 0,\n total:0,\n recentOp:'',\n\n\n }\n }", "title": "" }, { "docid": "9f9bbf4bd493351905ff8a51d0c7c66b", "score": "0.57854563", "text": "handleInputFieldChange(e) {\r\n\t\tthis.setState({\r\n\t\t\t[e.target.name] : e.target.value\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "843be7246fc7fd747256f55793d7d193", "score": "0.57847387", "text": "function handleChange(event) {\n const { name, value } = event.target;\n fieldsFilled[name] = value;\n setFieldsFilled({ ...fieldsFilled });\n // console.log(fieldsFilled);\n }", "title": "" }, { "docid": "6c7dd4baea212b91f9d22c2d70c19d2c", "score": "0.5773186", "text": "function addStateFields(node) {\n node.properties.filter(prop => prop.type === 'Property' && (prop.key.type === 'Literal' || prop.key.type === 'TemplateLiteral' && prop.key.expressions.length === 0 || prop.computed === false && prop.key.type === 'Identifier') && getName(prop.key) !== null).forEach(prop => {\n classInfo.stateFields.add(prop);\n });\n } // Adds the name of the given node as a used state field if the node is an", "title": "" }, { "docid": "9fac4944182b5f6c3ab4ad5e3e2b9748", "score": "0.5772669", "text": "HandleOnChangeForm(e,name) {\n\n // e.preventDefault();\n let newUserObj = Object.assign({}, this.state.formInfo); // creating copy of state variable jasper\n newUserObj[e.target.name] = e.target.value;\n this.setState({ formInfo: newUserObj })\n\n console.log(\"State inside the handle change form \",this.state)\n\n }", "title": "" }, { "docid": "100ed5ae83c72e84d079976fcdb6e54e", "score": "0.5756799", "text": "change(e, i) {\r\n\t\tlet fields = this.state.fields.slice();\r\n\t\tfields[i].value = e.target.value;\r\n\t\tthis.setState({fields: fields});\r\n\t}", "title": "" }, { "docid": "1e338f88b4059caf74388ae488314be1", "score": "0.57545936", "text": "get state() { return this._publicState; }", "title": "" }, { "docid": "1e338f88b4059caf74388ae488314be1", "score": "0.57545936", "text": "get state() { return this._publicState; }", "title": "" }, { "docid": "1e338f88b4059caf74388ae488314be1", "score": "0.57545936", "text": "get state() { return this._publicState; }", "title": "" }, { "docid": "b6968d0e2081ec292d0fae9b43323d04", "score": "0.57389075", "text": "handleChange(event) {\n const field = event.target.name;\n const user = this.state.user;\n user[field] = event.target.value;\n\n this.setState({\n user\n });\n }", "title": "" }, { "docid": "0664b2d5af795c5ed1085dd7954c5365", "score": "0.5737742", "text": "function updateState() {\n //Do whatever you need with the data here\n }", "title": "" }, { "docid": "24c40f5177403e257876e679ecebdf81", "score": "0.57281345", "text": "setFieldValues() {\n let values = {}//Default values\n\n //parse fields to set defautl values\n for (var name in this.fields) {\n let field = this.fields[name]//Get field data\n //case values by name\n switch (name) {\n case'date':\n values[name] = {\n field: field.field ? field.field.value || null : null,\n type: field.type || null,\n from: field.from || null,\n to: field.to || null\n }\n break;\n case'pagination':\n break;\n default:\n values[name] = field.value\n break;\n }\n }\n\n this.setValues(values)//Set values\n }", "title": "" }, { "docid": "5d90933aa87baf3d556847c922f7b8f0", "score": "0.5726594", "text": "setValue(val) {\n this.binder.fieldValue = val;\n }", "title": "" }, { "docid": "d976f53b8e3b35ef8a0a56afa5e9423e", "score": "0.572183", "text": "handleChange(event) {\n const state = {...this.state};\n state['user'][event.target.name] = event.target.value;\n state['formHasChanged'] = true;\n this.setState(state);\n }", "title": "" }, { "docid": "574aa781eb5802f8e70fedd905d80605", "score": "0.57196754", "text": "handleInputFieldsChanges(updatedUserInfo) {\n this.setState({ updatedUserInfo });\n }", "title": "" }, { "docid": "9151e50f2b89fedc51960ea3ecda3d93", "score": "0.57172155", "text": "handleColorPickerClick(fieldname) {\n let obj = {};\n obj[fieldname] = !this.state[fieldname];\n this.setState(obj);\n }", "title": "" }, { "docid": "d841cda7e1076e88e12ef45bea4b8939", "score": "0.5714271", "text": "function updateState(field, ev) {\n let updatedNewUser = Object.assign({}, newUser);\n updatedNewUser[field] = ev.target.value;\n updatedNewUser.passErrorMessage = checkPassword(\n updatedNewUser.password,\n updatedNewUser.confirmPassword\n );\n\n updatedNewUser.nameErrorMessage =\n updatedNewUser.name === \"\" ? \"Name cannot be empty\" : \"\";\n\n updatedNewUser.emailErrorMessage =\n updatedNewUser.email === \"\" ? \"Email cannot be empty\" : \"\";\n\n setNewUser(updatedNewUser);\n }", "title": "" }, { "docid": "963082835a70ac42b6baef8168b6507e", "score": "0.5709913", "text": "get state(){ return this.__state ? this.__state : 'off'; }", "title": "" }, { "docid": "9155c6b79734047ed1c49a68c07e0963", "score": "0.5707634", "text": "initialize() {\n super.initialize();\n\n this.updated = false;\n this.value = false;\n this.originalValue = false;\n this.label = null;\n }", "title": "" }, { "docid": "669cf610375f42b5dad61c42bfcf5258", "score": "0.5707532", "text": "update(field) {\n return e => this.setState({\n [field]: e.currentTarget.value\n });\n }", "title": "" }, { "docid": "669cf610375f42b5dad61c42bfcf5258", "score": "0.5707532", "text": "update(field) {\n return e => this.setState({\n [field]: e.currentTarget.value\n });\n }", "title": "" }, { "docid": "669cf610375f42b5dad61c42bfcf5258", "score": "0.5707532", "text": "update(field) {\n return e => this.setState({\n [field]: e.currentTarget.value\n });\n }", "title": "" }, { "docid": "a959db703d80b385d520dfd405b67f2e", "score": "0.57041776", "text": "_stateChanged(state) {\n this.clicks = state.counter.clicks;\n }", "title": "" }, { "docid": "93e1ba18a854714d443ef9d814603ae9", "score": "0.5702443", "text": "get state() {\n return this._state;\n }", "title": "" }, { "docid": "93e1ba18a854714d443ef9d814603ae9", "score": "0.5702443", "text": "get state() {\n return this._state;\n }", "title": "" }, { "docid": "93e1ba18a854714d443ef9d814603ae9", "score": "0.5702443", "text": "get state() {\n return this._state;\n }", "title": "" }, { "docid": "2c15ba9773fd2c3741d37efc961f7945", "score": "0.5700717", "text": "fieldValue(code, value) {\n let newModel = Object.assign({}, !this.model$ ? {} : this.model$) // change the reference to wake water's movement @author Amr\n this.set(newModel, code, value)\n this.model$ = newModel;\n }", "title": "" }, { "docid": "141ccc1d50ea73fdbbe84c650a43cebf", "score": "0.5697345", "text": "handleInput(name, value) {\n const state = this.state.user;\n state[name] = value;\n this.setState({...state, isChanged: true});\n }", "title": "" }, { "docid": "5c900f36181b4b0aec4946251ccc44ba", "score": "0.56965876", "text": "storeState(){\n\n\t\tthis.contextState = [{\n\t\t\tkey: 'startable.status',\n\t\t\tvalue: this.context['startable.status']\n\t\t}];\n\n\n\t\t/*\n\n\t\tfor example: take all simple values from context\n\n\t\tfor(var key in this.context){\n\t\t\tlet value = this.context[key];\n\t\t\tif (value == null || !_.isObject(value.valueOf()))\n\t\t\t\tthis.contextState.push({ key, value });\n\t\t}\n\n\t\t*/\n\n\t}", "title": "" }, { "docid": "5c900f36181b4b0aec4946251ccc44ba", "score": "0.56965876", "text": "storeState(){\n\n\t\tthis.contextState = [{\n\t\t\tkey: 'startable.status',\n\t\t\tvalue: this.context['startable.status']\n\t\t}];\n\n\n\t\t/*\n\n\t\tfor example: take all simple values from context\n\n\t\tfor(var key in this.context){\n\t\t\tlet value = this.context[key];\n\t\t\tif (value == null || !_.isObject(value.valueOf()))\n\t\t\t\tthis.contextState.push({ key, value });\n\t\t}\n\n\t\t*/\n\n\t}", "title": "" }, { "docid": "973316ea23e04528aa8aea0d5921c84d", "score": "0.56885016", "text": "update(field) {\n return (e) =>\n this.setState({\n [field]: e.currentTarget.value,\n });\n }", "title": "" }, { "docid": "833b1565c2c57ec34792d741f70f9144", "score": "0.5682703", "text": "change(event){\n //Take the name of what changed\n var name = event.target.name;\n //Take the value of what changed (if checkbox = true, then )\n var value = (event.target.type === 'checkbox') ? event.target.checked : event.target.value\n //Adds(or updates) App state - 1st change = adds K/V \"name of field: value\" (e.g \"city: Maimai\") to state, 2nd change = updates the states\n this.setState({\n [name]: value\n }, () => {\n console.log(this.state)\n this.filteredData()\n })\n }", "title": "" }, { "docid": "7ea9ce69c77d72f85f53cde4f125e168", "score": "0.56816643", "text": "setInitFormValues() {\n const { name, description, importance, progress, dueDate } = this.props;\n const { formValues } = this.state;\n formValues.name = name && name;\n formValues.description = description && description;\n formValues.importance = importance && importance;\n formValues.progress = progress && progress;\n //set errors to false\n for (const key in this.state.errors) {\n this.state.errors[key].error = false;\n }\n if (dueDate) {\n formValues.dueDate = moment(dueDate).toDate();\n this.state.noDueDate = false;\n } else this.state.noDueDate = true;\n }", "title": "" }, { "docid": "a7e0ef2d17a2588a2138d5b58bb2e2da", "score": "0.56770575", "text": "getFedValue(event) {\n if(this.state.fed)\n {\n this.setState({fed: false});\n }\n else\n {\n this.setState({fed: true});\n }\n }", "title": "" }, { "docid": "f183ee5e0795f9a7707d2dfcc516c068", "score": "0.5674857", "text": "onFieldValueChange({ fieldId, value }) {\n const doc = this.state.doc;\n\n doc[fieldId].value = value;\n\n this.setState({ doc });\n }", "title": "" }, { "docid": "4eafc4d14457bbd1b209863493083c68", "score": "0.5666359", "text": "get state() {\n return state;\n }", "title": "" }, { "docid": "156a7e1c4fedf830ff6ece55735e0fa5", "score": "0.56658804", "text": "handleChange(field, event) {\n let docLogin = this.state.docLogin;\n docLogin[field] = event.target.value;\n this.setState({ docLogin });\n }", "title": "" }, { "docid": "c41500497c8d748129ab88928edb22b9", "score": "0.5665729", "text": "updatePostState(event) {\n const field = event.target.name;\n const post = this.state.post;\n post[field] = event.target.value;\n return this.setState({post: post});\n }", "title": "" }, { "docid": "16a6c7ab23aecec131eb9500387fd18f", "score": "0.566544", "text": "onChange(event, field, key) {\n let newInputValues = this.state.inputValues;\n newInputValues[key][field] = event.target.value;\n this.setState({\n ...this.state,\n inputValues: newInputValues\n });\n }", "title": "" } ]
9779953a7fc819dfbef04c2e9873b028
This wrapper function exists because I expect to clone the code in each path to be able to optimize each path individually by branching early. This needs a compiler or we can do it manually. Helpers that don't need this branching live outside of this function.
[ { "docid": "f8b0dc258f52b8d9466d7b53e8cea25b", "score": "0.0", "text": "function ChildReconciler(shouldClone, shouldTrackSideEffects) {\n function deleteChild(returnFiber, childToDelete) {\n if (shouldTrackSideEffects) {\n if (!shouldClone) {\n // When we're reconciling in place we have a work in progress copy. We\n // actually want the current copy. If there is no current copy, then we\n // don't need to track deletion side-effects.\n if (null === childToDelete.alternate) return;\n childToDelete = childToDelete.alternate;\n }\n // Deletions are added in reversed order so we add it to the front.\n // At this point, the return fiber's effect list is empty except for\n // deletions, so we can just append the deletion to the list. The remaining\n // effects aren't added until the complete phase. Once we implement\n // resuming, this may not be true.\n var last = returnFiber.lastEffect;\n null !== last ? (last.nextEffect = childToDelete, returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete, \n childToDelete.nextEffect = null, childToDelete.effectTag = Deletion$1;\n }\n }\n function deleteRemainingChildren(returnFiber, currentFirstChild) {\n if (!shouldTrackSideEffects) // Noop.\n return null;\n for (// TODO: For the shouldClone case, this could be micro-optimized a bit by\n // assuming that after the first child we've already added everything.\n var childToDelete = currentFirstChild; null !== childToDelete; ) deleteChild(returnFiber, childToDelete), \n childToDelete = childToDelete.sibling;\n return null;\n }\n function mapRemainingChildren(returnFiber, currentFirstChild) {\n for (// Add the remaining children to a temporary map so that we can find them by\n // keys quickly. Implicit (null) keys get added to this set with their index\n var existingChildren = new Map(), existingChild = currentFirstChild; null !== existingChild; ) null !== existingChild.key ? existingChildren.set(existingChild.key, existingChild) : existingChildren.set(existingChild.index, existingChild), \n existingChild = existingChild.sibling;\n return existingChildren;\n }\n function useFiber(fiber, expirationTime) {\n // We currently set sibling to null and index to 0 here because it is easy\n // to forget to do before returning it. E.g. for the single child case.\n if (shouldClone) {\n var clone = createWorkInProgress$2(fiber, expirationTime);\n return clone.index = 0, clone.sibling = null, clone;\n }\n // We override the expiration time even if it is earlier, because if\n // we're reconciling at a later time that means that this was\n // down-prioritized.\n return fiber.expirationTime = expirationTime, fiber.effectTag = NoEffect$2, fiber.index = 0, \n fiber.sibling = null, fiber;\n }\n function placeChild(newFiber, lastPlacedIndex, newIndex) {\n if (newFiber.index = newIndex, !shouldTrackSideEffects) // Noop.\n return lastPlacedIndex;\n var current$$1 = newFiber.alternate;\n if (null !== current$$1) {\n var oldIndex = current$$1.index;\n // This is a move.\n return oldIndex < lastPlacedIndex ? (newFiber.effectTag = Placement$3, lastPlacedIndex) : oldIndex;\n }\n // This is an insertion.\n return newFiber.effectTag = Placement$3, lastPlacedIndex;\n }\n function placeSingleChild(newFiber) {\n // This is simpler for the single child case. We only need to do a\n // placement for inserting new children.\n return shouldTrackSideEffects && null === newFiber.alternate && (newFiber.effectTag = Placement$3), \n newFiber;\n }\n function updateTextNode(returnFiber, current$$1, textContent, expirationTime) {\n if (null === current$$1 || current$$1.tag !== HostText$3) {\n // Insert\n var created = createFiberFromText$1(textContent, returnFiber.internalContextTag, expirationTime);\n return created.return = returnFiber, created;\n }\n // Update\n var existing = useFiber(current$$1, expirationTime);\n return existing.pendingProps = textContent, existing.return = returnFiber, existing;\n }\n function updateElement(returnFiber, current$$1, element, expirationTime) {\n if (null === current$$1 || current$$1.type !== element.type) {\n // Insert\n var created = createFiberFromElement$1(element, returnFiber.internalContextTag, expirationTime);\n return created.ref = coerceRef(current$$1, element), created.return = returnFiber, \n created;\n }\n // Move based on index\n var existing = useFiber(current$$1, expirationTime);\n return existing.ref = coerceRef(current$$1, element), existing.pendingProps = element.props, \n existing.return = returnFiber, existing;\n }\n function updateCall(returnFiber, current$$1, call, expirationTime) {\n // TODO: Should this also compare handler to determine whether to reuse?\n if (null === current$$1 || current$$1.tag !== CallComponent$2) {\n // Insert\n var created = createFiberFromCall$1(call, returnFiber.internalContextTag, expirationTime);\n return created.return = returnFiber, created;\n }\n // Move based on index\n var existing = useFiber(current$$1, expirationTime);\n return existing.pendingProps = call, existing.return = returnFiber, existing;\n }\n function updateReturn(returnFiber, current$$1, returnNode, expirationTime) {\n if (null === current$$1 || current$$1.tag !== ReturnComponent$2) {\n // Insert\n var created = createFiberFromReturn$1(returnNode, returnFiber.internalContextTag, expirationTime);\n return created.type = returnNode.value, created.return = returnFiber, created;\n }\n // Move based on index\n var existing = useFiber(current$$1, expirationTime);\n return existing.type = returnNode.value, existing.return = returnFiber, existing;\n }\n function updatePortal(returnFiber, current$$1, portal, expirationTime) {\n if (null === current$$1 || current$$1.tag !== HostPortal$4 || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) {\n // Insert\n var created = createFiberFromPortal$1(portal, returnFiber.internalContextTag, expirationTime);\n return created.return = returnFiber, created;\n }\n // Update\n var existing = useFiber(current$$1, expirationTime);\n return existing.pendingProps = portal.children || [], existing.return = returnFiber, \n existing;\n }\n function updateFragment(returnFiber, current$$1, fragment, expirationTime) {\n if (null === current$$1 || current$$1.tag !== Fragment$2) {\n // Insert\n var created = createFiberFromFragment$1(fragment, returnFiber.internalContextTag, expirationTime);\n return created.return = returnFiber, created;\n }\n // Update\n var existing = useFiber(current$$1, expirationTime);\n return existing.pendingProps = fragment, existing.return = returnFiber, existing;\n }\n function createChild(returnFiber, newChild, expirationTime) {\n if (\"string\" == typeof newChild || \"number\" == typeof newChild) {\n // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n var created = createFiberFromText$1(\"\" + newChild, returnFiber.internalContextTag, expirationTime);\n return created.return = returnFiber, created;\n }\n if (\"object\" == typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n var _created = createFiberFromElement$1(newChild, returnFiber.internalContextTag, expirationTime);\n return _created.ref = coerceRef(null, newChild), _created.return = returnFiber, \n _created;\n\n case REACT_CALL_TYPE:\n var _created2 = createFiberFromCall$1(newChild, returnFiber.internalContextTag, expirationTime);\n return _created2.return = returnFiber, _created2;\n\n case REACT_RETURN_TYPE:\n var _created3 = createFiberFromReturn$1(newChild, returnFiber.internalContextTag, expirationTime);\n return _created3.type = newChild.value, _created3.return = returnFiber, _created3;\n\n case REACT_PORTAL_TYPE:\n var _created4 = createFiberFromPortal$1(newChild, returnFiber.internalContextTag, expirationTime);\n return _created4.return = returnFiber, _created4;\n }\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n var _created5 = createFiberFromFragment$1(newChild, returnFiber.internalContextTag, expirationTime);\n return _created5.return = returnFiber, _created5;\n }\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n return null;\n }\n function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {\n // Update the fiber if the keys match, otherwise return null.\n var key = null !== oldFiber ? oldFiber.key : null;\n if (\"string\" == typeof newChild || \"number\" == typeof newChild) // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n // Text nodes don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a text\n // node.\n return null !== key ? null : updateTextNode(returnFiber, oldFiber, \"\" + newChild, expirationTime);\n if (\"object\" == typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return newChild.key === key ? updateElement(returnFiber, oldFiber, newChild, expirationTime) : null;\n\n case REACT_CALL_TYPE:\n return newChild.key === key ? updateCall(returnFiber, oldFiber, newChild, expirationTime) : null;\n\n case REACT_RETURN_TYPE:\n // Returns don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a\n // yield.\n // Returns don't have keys. If the previous node is implicitly keyed\n // we can continue to replace it without aborting even if it is not a\n // yield.\n return null === key ? updateReturn(returnFiber, oldFiber, newChild, expirationTime) : null;\n\n case REACT_PORTAL_TYPE:\n return newChild.key === key ? updatePortal(returnFiber, oldFiber, newChild, expirationTime) : null;\n }\n if (isArray$1(newChild) || getIteratorFn(newChild)) // Fragments don't have keys so if the previous key is implicit we can\n // update it.\n // Fragments don't have keys so if the previous key is implicit we can\n // update it.\n return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, expirationTime);\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n return null;\n }\n function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {\n if (\"string\" == typeof newChild || \"number\" == typeof newChild) {\n return updateTextNode(returnFiber, existingChildren.get(newIdx) || null, \"\" + newChild, expirationTime);\n }\n if (\"object\" == typeof newChild && null !== newChild) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return updateElement(returnFiber, existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, newChild, expirationTime);\n\n case REACT_CALL_TYPE:\n return updateCall(returnFiber, existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, newChild, expirationTime);\n\n case REACT_RETURN_TYPE:\n return updateReturn(returnFiber, existingChildren.get(newIdx) || null, newChild, expirationTime);\n\n case REACT_PORTAL_TYPE:\n return updatePortal(returnFiber, existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, newChild, expirationTime);\n }\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n return updateFragment(returnFiber, existingChildren.get(newIdx) || null, newChild, expirationTime);\n }\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n return null;\n }\n /**\n * Warns if there is a duplicate or missing key\n */\n function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {\n for (// This algorithm can't optimize by searching from boths ends since we\n // don't have backpointers on fibers. I'm trying to see how far we can get\n // with that model. If it ends up not being worth the tradeoffs, we can\n // add it later.\n // Even with a two ended optimization, we'd want to optimize for the case\n // where there are few changes and brute force the comparison instead of\n // going for the Map. It'd like to explore hitting that path first in\n // forward-only mode and only go for the Map once we notice that we need\n // lots of look ahead. This doesn't handle reversal as well as two ended\n // search but that's unusual. Besides, for the two ended optimization to\n // work on Iterables, we'd need to copy the whole set.\n // In this first iteration, we'll just live with hitting the bad case\n // (adding everything to a Map) in for every insert/move.\n // If you change this code, also update reconcileChildrenIterator() which\n // uses the same algorithm.\n var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, lastPlacedIndex = 0, newIdx = 0, nextOldFiber = null; null !== oldFiber && newIdx < newChildren.length; newIdx++) {\n oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;\n var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);\n if (null === newFiber) {\n // TODO: This breaks on empty slots like null children. That's\n // unfortunate because it triggers the slow path all the time. We need\n // a better way to communicate whether this was a miss or null,\n // boolean, undefined, etc.\n null === oldFiber && (oldFiber = nextOldFiber);\n break;\n }\n shouldTrackSideEffects && oldFiber && null === newFiber.alternate && // We matched the slot, but we didn't reuse the existing fiber, so we\n // need to delete the existing child.\n deleteChild(returnFiber, oldFiber), lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), \n null === previousNewFiber ? // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber : // TODO: Defer siblings if we're not at the right index for this slot.\n // I.e. if we had null values before, then we want to defer this\n // for each null value. However, we also don't want to call updateSlot\n // with the previous one.\n previousNewFiber.sibling = newFiber, previousNewFiber = newFiber, oldFiber = nextOldFiber;\n }\n if (newIdx === newChildren.length) // We've reached the end of the new children. We can delete the rest.\n return deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild;\n if (null === oldFiber) {\n // If we don't have any more existing children we can choose a fast path\n // since the rest will all be insertions.\n for (;newIdx < newChildren.length; newIdx++) {\n var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);\n _newFiber && (lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx), \n null === previousNewFiber ? // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber : previousNewFiber.sibling = _newFiber, previousNewFiber = _newFiber);\n }\n return resultingFirstChild;\n }\n // Keep scanning and use the map to restore deleted items as moves.\n for (// Add all children to a key map for quick lookups.\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); newIdx < newChildren.length; newIdx++) {\n var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);\n _newFiber2 && (shouldTrackSideEffects && null !== _newFiber2.alternate && // The new fiber is a work in progress, but if there exists a\n // current, that means that we reused the fiber. We need to delete\n // it from the child list so that we don't add it to the deletion\n // list.\n existingChildren.delete(null === _newFiber2.key ? newIdx : _newFiber2.key), lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx), \n null === previousNewFiber ? resultingFirstChild = _newFiber2 : previousNewFiber.sibling = _newFiber2, \n previousNewFiber = _newFiber2);\n }\n // Any existing children that weren't consumed above were deleted. We need\n // to add them to the deletion list.\n return shouldTrackSideEffects && existingChildren.forEach(function(child) {\n return deleteChild(returnFiber, child);\n }), resultingFirstChild;\n }\n function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {\n // This is the same implementation as reconcileChildrenArray(),\n // but using the iterator instead.\n var iteratorFn = getIteratorFn(newChildrenIterable);\n invariant(\"function\" == typeof iteratorFn, \"An object is not an iterable. This error is likely caused by a bug in \" + \"React. Please file an issue.\");\n var newChildren = iteratorFn.call(newChildrenIterable);\n invariant(null != newChildren, \"An iterable object provided no iterator.\");\n for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, lastPlacedIndex = 0, newIdx = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, \n step = newChildren.next()) {\n oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling;\n var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);\n if (null === newFiber) {\n // TODO: This breaks on empty slots like null children. That's\n // unfortunate because it triggers the slow path all the time. We need\n // a better way to communicate whether this was a miss or null,\n // boolean, undefined, etc.\n oldFiber || (oldFiber = nextOldFiber);\n break;\n }\n shouldTrackSideEffects && oldFiber && null === newFiber.alternate && // We matched the slot, but we didn't reuse the existing fiber, so we\n // need to delete the existing child.\n deleteChild(returnFiber, oldFiber), lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), \n null === previousNewFiber ? // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber : // TODO: Defer siblings if we're not at the right index for this slot.\n // I.e. if we had null values before, then we want to defer this\n // for each null value. However, we also don't want to call updateSlot\n // with the previous one.\n previousNewFiber.sibling = newFiber, previousNewFiber = newFiber, oldFiber = nextOldFiber;\n }\n if (step.done) // We've reached the end of the new children. We can delete the rest.\n return deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild;\n if (null === oldFiber) {\n // If we don't have any more existing children we can choose a fast path\n // since the rest will all be insertions.\n for (;!step.done; newIdx++, step = newChildren.next()) {\n var _newFiber3 = createChild(returnFiber, step.value, expirationTime);\n null !== _newFiber3 && (lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx), \n null === previousNewFiber ? // TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber3 : previousNewFiber.sibling = _newFiber3, previousNewFiber = _newFiber3);\n }\n return resultingFirstChild;\n }\n // Keep scanning and use the map to restore deleted items as moves.\n for (// Add all children to a key map for quick lookups.\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); !step.done; newIdx++, \n step = newChildren.next()) {\n var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);\n null !== _newFiber4 && (shouldTrackSideEffects && null !== _newFiber4.alternate && // The new fiber is a work in progress, but if there exists a\n // current, that means that we reused the fiber. We need to delete\n // it from the child list so that we don't add it to the deletion\n // list.\n existingChildren.delete(null === _newFiber4.key ? newIdx : _newFiber4.key), lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx), \n null === previousNewFiber ? resultingFirstChild = _newFiber4 : previousNewFiber.sibling = _newFiber4, \n previousNewFiber = _newFiber4);\n }\n // Any existing children that weren't consumed above were deleted. We need\n // to add them to the deletion list.\n return shouldTrackSideEffects && existingChildren.forEach(function(child) {\n return deleteChild(returnFiber, child);\n }), resultingFirstChild;\n }\n function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {\n // There's no need to check for keys on text nodes since we don't have a\n // way to define them.\n if (null !== currentFirstChild && currentFirstChild.tag === HostText$3) {\n // We already have an existing node so let's just update it and delete\n // the rest.\n deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n var existing = useFiber(currentFirstChild, expirationTime);\n return existing.pendingProps = textContent, existing.return = returnFiber, existing;\n }\n // The existing first child is not a text node so we need to create one\n // and delete the existing ones.\n deleteRemainingChildren(returnFiber, currentFirstChild);\n var created = createFiberFromText$1(textContent, returnFiber.internalContextTag, expirationTime);\n return created.return = returnFiber, created;\n }\n function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {\n for (var key = element.key, child = currentFirstChild; null !== child; ) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n if (child.type === element.type) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, expirationTime);\n return existing.ref = coerceRef(child, element), existing.pendingProps = element.props, \n existing.return = returnFiber, existing;\n }\n deleteRemainingChildren(returnFiber, child);\n break;\n }\n deleteChild(returnFiber, child), child = child.sibling;\n }\n var created = createFiberFromElement$1(element, returnFiber.internalContextTag, expirationTime);\n return created.ref = coerceRef(currentFirstChild, element), created.return = returnFiber, \n created;\n }\n function reconcileSingleCall(returnFiber, currentFirstChild, call, expirationTime) {\n for (var key = call.key, child = currentFirstChild; null !== child; ) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n if (child.tag === CallComponent$2) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, expirationTime);\n return existing.pendingProps = call, existing.return = returnFiber, existing;\n }\n deleteRemainingChildren(returnFiber, child);\n break;\n }\n deleteChild(returnFiber, child), child = child.sibling;\n }\n var created = createFiberFromCall$1(call, returnFiber.internalContextTag, expirationTime);\n return created.return = returnFiber, created;\n }\n function reconcileSingleReturn(returnFiber, currentFirstChild, returnNode, expirationTime) {\n // There's no need to check for keys on yields since they're stateless.\n var child = currentFirstChild;\n if (null !== child) {\n if (child.tag === ReturnComponent$2) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, expirationTime);\n return existing.type = returnNode.value, existing.return = returnFiber, existing;\n }\n deleteRemainingChildren(returnFiber, child);\n }\n var created = createFiberFromReturn$1(returnNode, returnFiber.internalContextTag, expirationTime);\n return created.type = returnNode.value, created.return = returnFiber, created;\n }\n function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {\n for (var key = portal.key, child = currentFirstChild; null !== child; ) {\n // TODO: If key === null and child.key === null, then this only applies to\n // the first item in the list.\n if (child.key === key) {\n if (child.tag === HostPortal$4 && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, expirationTime);\n return existing.pendingProps = portal.children || [], existing.return = returnFiber, \n existing;\n }\n deleteRemainingChildren(returnFiber, child);\n break;\n }\n deleteChild(returnFiber, child), child = child.sibling;\n }\n var created = createFiberFromPortal$1(portal, returnFiber.internalContextTag, expirationTime);\n return created.return = returnFiber, created;\n }\n // This API will tag the children with the side-effect of the reconciliation\n // itself. They will be added to the side-effect list as we pass through the\n // children and the parent.\n function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle object types\n var isObject = \"object\" == typeof newChild && null !== newChild;\n if (isObject) switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_CALL_TYPE:\n return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_RETURN_TYPE:\n return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n if (\"string\" == typeof newChild || \"number\" == typeof newChild) return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, \"\" + newChild, expirationTime));\n if (isArray$1(newChild)) return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n if (getIteratorFn(newChild)) return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n if (isObject && throwOnInvalidObjectType(returnFiber, newChild), void 0 === newChild) // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent$7:\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent$2:\n var Component = returnFiber.type;\n invariant(!1, \"%s(...): Nothing was returned from render. This usually means a \" + \"return statement is missing. Or, to render nothing, \" + \"return null.\", Component.displayName || Component.name || \"Component\");\n }\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }\n return reconcileChildFibers;\n}", "title": "" } ]
[ { "docid": "e37da6f838477d9fb7e615812ff27ca3", "score": "0.56295884", "text": "shrinkDirectory(topologyMapHelper, pathIDs, parent) {\r\n var directory = topologyMapHelper.directory;\r\n for (var i = 0; i < pathIDs.length; i++) {\r\n var pathID = pathIDs[i];\r\n var currentValue = directory[pathID];\r\n \r\n if (currentValue) {\r\n var cloneID = undefined;\r\n \r\n var linkID = \"link_\" + currentValue.terminations.join(\"#\")\r\n \r\n var isCrossLink = currentValue.terminations.every((val, i, arr) => val === arr[0])\r\n \r\n if (!directory[linkID]) {\r\n directory[linkID] = Object.assign({}, currentValue, {\r\n siblings: [],\r\n id: linkID,\r\n parent: parent,\r\n isCrossLink: isCrossLink\r\n })\r\n } else {\r\n var siblingsCount = directory[linkID].siblings.length;\r\n cloneID = linkID + \"_CLONE_\" + (siblingsCount + 1);\r\n var bundleID;\r\n if (directory[linkID].cNodes.length > 0 && directory[linkID].siblings.length > 0 && directory[linkID].siblings.includes(cloneID) && directory[linkID].cNodes.includes(cloneID)) {\r\n \r\n bundleID = linkID;\r\n \r\n }\r\n \r\n \r\n if (linkID == bundleID) {\r\n //Logic to avoid siblings..\r\n \r\n }\r\n else {\r\n directory[linkID].siblings.push(cloneID)\r\n \r\n }//Should be based on hierarchy too and not just terminations.\r\n directory[cloneID] = Object.assign({}, currentValue, {\r\n siblings: [],\r\n id: cloneID,\r\n parent: parent,\r\n isCrossLink: isCrossLink\r\n })\r\n \r\n //Rename ID to cloneID from parent cNodes\r\n // directory[directory[cloneID].parent].cNodes[i] = cloneID; //FIX MISSING PATH ISSUE \r\n // directory[directory[cloneID].parent].cNodes.splice(i, 1);\r\n }\r\n \r\n var lCNodes = directory[pathID].cNodes.slice();\r\n var id = cloneID || linkID;\r\n \r\n directory[id].cNodes = currentValue.cNodes.map((cNode) => {\r\n // unknown will be added as cLinkID if it is not in directory\r\n var cLinkID = directory[cNode] ? \"link_\" + directory[cNode].terminations.join(\"#\") : cNode\r\n return directory[cLinkID] ? undefined : cLinkID\r\n }).filter((cNode) => cNode ? true : false)\r\n \r\n this.shrinkDirectory(topologyMapHelper, lCNodes, id)\r\n \r\n delete directory[pathID]\r\n }\r\n \r\n }\r\n }", "title": "" }, { "docid": "3ecac8459b870e50f76a4de02ec93bf6", "score": "0.5263345", "text": "onCodePathStart(codePath, node) {\n funcInfo = {\n upper: funcInfo,\n codePath,\n hasReturn: false,\n shouldCheck:\n TARGET_NODE_TYPE.test(node.type) &&\n node.body.type === \"BlockStatement\" &&\n isCallbackOfArrayMethod(node) &&\n !node.async &&\n !node.generator,\n node\n };\n }", "title": "" }, { "docid": "f662eb9fca4d14440caa0e54dfc423b6", "score": "0.5227316", "text": "path(from, to, block, startPath) {\n block = block || new List();\n startPath = startPath||[];\n let neighborX = [1, 0, -1, 0];\n let neighborY = [0, 1, 0, -1];\n let current;\n let gScore = {};\n gScore[from] = 0;\n let fScore = {};\n fScore[from] = this._distance(from, to);\n let closedSet = new List();\n let openSet = new List([from]);\n let cameFrom = {};\n let rootWorld = this.gameState.getRootWorld();\n measure.start('while');\n while (!openSet.isEmpty()) {\n measure.start('openSet.reduce');\n current = openSet.reduce((first, second) => fScore[first] < fScore[second] ? first : second);\n measure.pause('openSet.reduce');\n measure.start('to.contains(current)');\n if (to.contains(current))\n {\n measure.pause('to.contains(current)');\n measure.pause('while');\n return this._getPath(cameFrom, current);\n }\n measure.pause('to.contains(current)');\n measure.start('openSet.remove');\n openSet.remove(current);\n closedSet.add(current);\n measure.pause('openSet.remove');\n measure.start('for');\n for (let i = 0; i < 4; i++) {\n measure.start('neighbor');\n let x = current.x + neighborX[i];\n let y = current.y + neighborY[i];\n let neighbor = new Point(x, y);\n measure.pause('neighbor');\n if (rootWorld.isOutOfMap(x, y))\n continue;\n if (closedSet.contains(neighbor))\n continue;\n /* Game-specific logic start*/\n if (block.contains(neighbor))\n continue;\n if (rootWorld.isStatic(neighbor))\n continue;\n let tentativeGScore = gScore[current] + 1;\n if (openSet.contains(neighbor) && tentativeGScore >= gScore[neighbor])\n continue;\n measure.start('cameFromTmp');\n // OPTIMIZATION: (~20ms in pick moments) Object.assign() is slow sometimes, maybe when manipulates a big map.\n // Use solution w/o clone.\n let prev = cameFrom[neighbor];\n cameFrom[neighbor] = current;\n measure.pause('cameFromTmp');\n let path = this._getPath(cameFrom, neighbor);\n cameFrom[neighbor] = prev;\n let fullPath = path.concat(startPath.slice(1)).reverse();\n measure.start('isDeadPos');\n if (this.gameState.getCounter() <= maxStatesPerControl)\n {\n let posType = this.gameState.posType(fullPath);\n if (posType != FREE) {\n if (!startPath.length && posType == DEAD)\n this.deadPos.push(neighbor);\n measure.pause('isDeadPos');\n continue;\n }\n }\n else if (this.gameState.getWorld(fullPath).isBoulder(neighbor)) {\n measure.pause('isDeadPos');\n continue;\n }\n measure.pause('isDeadPos');\n if (!startPath.length && to.contains(neighbor) && to.length() > 2 &&\n !this.path(neighbor, to.clone().remove(neighbor), null, path)) {\n this.blockedDiamonds.push(neighbor);\n continue;\n }\n /* Game-specific logic end*/\n cameFrom[neighbor] = current;\n gScore[neighbor] = tentativeGScore;\n fScore[neighbor] = gScore[neighbor] + this._distance(neighbor, to);\n if (!openSet.contains(neighbor))\n openSet.add(neighbor);\n }\n measure.pause('for');\n }\n measure.pause('while');\n return null;\n }", "title": "" }, { "docid": "c8305b3861d1f07aa7b470889313b4f8", "score": "0.518172", "text": "allCodePathsPresent(): boolean {\n return this.statements[this.statements.length - 1].allCodePathsPresent();\n }", "title": "" }, { "docid": "913d764d264ccb547e328bc513cc2e10", "score": "0.5172604", "text": "composedPath() {\n const composedPath = [];\n\n const { currentTarget, _path: path } = this;\n\n if (path.length === 0) {\n return composedPath;\n }\n\n composedPath.push(currentTarget);\n\n let currentTargetIndex = 0;\n let currentTargetHiddenSubtreeLevel = 0;\n\n for (let index = path.length - 1; index >= 0; index--) {\n const { item, rootOfClosedTree, slotInClosedTree } = path[index];\n\n if (rootOfClosedTree) {\n currentTargetHiddenSubtreeLevel++;\n }\n\n if (item === idlUtils.implForWrapper(currentTarget)) {\n currentTargetIndex = index;\n break;\n }\n\n if (slotInClosedTree) {\n currentTargetHiddenSubtreeLevel--;\n }\n }\n\n let currentHiddenLevel = currentTargetHiddenSubtreeLevel;\n let maxHiddenLevel = currentTargetHiddenSubtreeLevel;\n\n for (let i = currentTargetIndex - 1; i >= 0; i--) {\n const { item, rootOfClosedTree, slotInClosedTree } = path[i];\n\n if (rootOfClosedTree) {\n currentHiddenLevel++;\n }\n\n if (currentHiddenLevel <= maxHiddenLevel) {\n composedPath.unshift(idlUtils.wrapperForImpl(item));\n }\n\n if (slotInClosedTree) {\n currentHiddenLevel--;\n if (currentHiddenLevel < maxHiddenLevel) {\n maxHiddenLevel = currentHiddenLevel;\n }\n }\n }\n\n currentHiddenLevel = currentTargetHiddenSubtreeLevel;\n maxHiddenLevel = currentTargetHiddenSubtreeLevel;\n\n for (let index = currentTargetIndex + 1; index < path.length; index++) {\n const { item, rootOfClosedTree, slotInClosedTree } = path[index];\n\n if (slotInClosedTree) {\n currentHiddenLevel++;\n }\n\n if (currentHiddenLevel <= maxHiddenLevel) {\n composedPath.push(idlUtils.wrapperForImpl(item));\n }\n\n if (rootOfClosedTree) {\n currentHiddenLevel--;\n if (currentHiddenLevel < maxHiddenLevel) {\n maxHiddenLevel = currentHiddenLevel;\n }\n }\n }\n\n return composedPath;\n }", "title": "" }, { "docid": "1ff44608f1973d088d037c25686bac7c", "score": "0.5133307", "text": "onCodePathStart(codePath) {\n scopeInfo = {\n upper: scopeInfo,\n uselessReturns: [],\n traversedTryBlockStatements: [],\n codePath\n };\n }", "title": "" }, { "docid": "a8b0a40c38fca5fcdbba6d58bb733acc", "score": "0.51299393", "text": "function optimizePathSet(cache, cacheRoot, pathSet,\n depth, out, optimizedPath, maxRefFollow) {\n\n // at missing, report optimized path.\n if (cache === undefined) {\n out[out.length] = catAndSlice(optimizedPath, pathSet, depth);\n return;\n }\n\n // all other sentinels are short circuited.\n // Or we found a primitive (which includes null)\n if (cache === null || (cache.$type && cache.$type !== $ref) ||\n (typeof cache !== 'object')) {\n return;\n }\n\n // If the reference is the last item in the path then do not\n // continue to search it.\n if (cache.$type === $ref && depth === pathSet.length) {\n return;\n }\n\n var keySet = pathSet[depth];\n var nextDepth = depth + 1;\n var iteratorNote = {};\n var key, next, nextOptimized;\n\n key = iterateKeySet(keySet, iteratorNote);\n do {\n next = cache[key];\n var optimizedPathLength = optimizedPath.length;\n if (key !== null) {\n optimizedPath[optimizedPathLength] = key;\n }\n\n if (next && next.$type === $ref && nextDepth < pathSet.length) {\n var refResults =\n followReference(cacheRoot, next.value, maxRefFollow);\n next = refResults[0];\n\n // must clone to avoid the mutation from above destroying the cache.\n nextOptimized = cloneArray(refResults[1]);\n } else {\n nextOptimized = optimizedPath;\n }\n\n optimizePathSet(next, cacheRoot, pathSet, nextDepth,\n out, nextOptimized, maxRefFollow);\n optimizedPath.length = optimizedPathLength;\n\n if (!iteratorNote.done) {\n key = iterateKeySet(keySet, iteratorNote);\n }\n } while (!iteratorNote.done);\n}", "title": "" }, { "docid": "bf8cfa676b3ad79f1b1940421d5847da", "score": "0.51090914", "text": "optimiseSetOperation(path, nextValue) {\n if (typeof nextValue === \"object\") {\n return false;\n }\n const matches = extractWithPath(path, this.PRESTAGE);\n if (matches.length !== 1) {\n return false;\n }\n const match = matches[0];\n if (typeof match.value === \"object\") {\n return false;\n }\n if (!this.PRESTAGE) {\n return false;\n }\n let op = null;\n if (match.value === nextValue) {\n op = null;\n } else if (typeof match.value === \"string\" && typeof nextValue === \"string\") {\n try {\n const patch = this.dmp.patch_make(match.value, nextValue).map(dmpPatch => dmpPatch.toString()).join(\"\");\n op = {\n patch: {\n id: this.PRESTAGE._id,\n diffMatchPatch: {\n [path]: patch\n }\n }\n };\n } catch {\n return false;\n }\n } else {\n op = {\n patch: {\n id: this.PRESTAGE._id,\n set: {\n [path]: nextValue\n }\n }\n };\n }\n const canonicalPath = arrayToJSONMatchPath(match.path);\n if (op) {\n this.setOperations[canonicalPath] = op;\n } else {\n delete this.setOperations[canonicalPath];\n }\n return true;\n }", "title": "" }, { "docid": "fde01fbae6301f9b6f23f011fd73bedb", "score": "0.5106057", "text": "build(path) {\n let expression = path.node.expression;\n\n if (this.builder.t.isCallExpression(expression) && this.localDebugBindings.some((b) => b.node.name === expression.callee.name)) {\n let imported = path.scope.getBinding(expression.callee.name).path.node.imported.name;\n this.builder[`${imported}`](path);\n }\n }", "title": "" }, { "docid": "7c54bcba79d92fd4d5469c38dd2dacbc", "score": "0.50588375", "text": "onCodePathStart(codePath, node) {\n funcInfo = {\n upper: funcInfo,\n codePath,\n hasReturn: false,\n shouldCheck: isGetter(node),\n node\n };\n }", "title": "" }, { "docid": "baa30cc5beeeda4f1fc1e6e873f48a68", "score": "0.505597", "text": "function _guessExecutionStatusRelativeTo(target){ // check if the two paths are in different functions, we can't track execution of these\nvar targetFuncParent=target.scope.getFunctionParent();var selfFuncParent=this.scope.getFunctionParent();if(targetFuncParent !== selfFuncParent){return \"function\";}var targetPaths=target.getAncestry(); //if (targetPaths.indexOf(this) >= 0) return \"after\";\nvar selfPaths=this.getAncestry(); // get ancestor where the branches intersect\nvar commonPath;var targetIndex;var selfIndex;for(selfIndex = 0;selfIndex < selfPaths.length;selfIndex++) {var selfPath=selfPaths[selfIndex];targetIndex = targetPaths.indexOf(selfPath);if(targetIndex >= 0){commonPath = selfPath;break;}}if(!commonPath){return \"before\";} // get the relationship paths that associate these nodes to their common ancestor\nvar targetRelationship=targetPaths[targetIndex - 1];var selfRelationship=selfPaths[selfIndex - 1];if(!targetRelationship || !selfRelationship){return \"before\";} // container list so let's see which one is after the other\nif(targetRelationship.listKey && targetRelationship.container === selfRelationship.container){return targetRelationship.key > selfRelationship.key?\"before\":\"after\";} // otherwise we're associated by a parent node, check which key comes before the other\nvar targetKeyPosition=t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key);var selfKeyPosition=t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key);return targetKeyPosition > selfKeyPosition?\"before\":\"after\";}", "title": "" }, { "docid": "f4ef69f005491a1232cdc1bf804dba9e", "score": "0.5055636", "text": "onCodePathStart(codePath, node) {\n funcInfo = {\n upper: funcInfo,\n codePath,\n hasReturn: false,\n shouldCheck: isGetter(node),\n node\n };\n }", "title": "" }, { "docid": "d9e0f0d993cf57005292cf39796639fb", "score": "0.49984848", "text": "branch(path) {\n var keys, branch = this.cameras;\n console.log(`branch():path = ${path}`);\n if (!Array.isArray(path)) {\n keys = (path.includes('.') ? path.split('.') : [path]);\n //keys = (pathstring.indexOf('.') > -1 ? pathstring.split('.') : [pathstring]);\n console.log(`Array.isArray(keys) = ${Array.isArray(keys)}`);\n console.log(`keys = ${keys}`);\n }\n else {\n keys = path;\n }\n // operate using array of branch keys\n for (let s of keys) {\n // ignore key = ''\n if (s.length > 0) {\n console.log(`branch: key = ${s} branch = ${branch}`);\n branch = (branch[s] ? branch[s] : undefined);\n if (branch === undefined) {\n console.log(`!!!!!!!!!!!!!!!!!! branch from ${name} is undefined!`);\n return undefined;\n }\n }\n }\n return branch;\n }", "title": "" }, { "docid": "ea99389f2b98467b053e147936764051", "score": "0.4988296", "text": "hasEqualSource(path) {\n return (\n JSON.stringify(this.node, jsonSkipLoc) ===\n JSON.stringify(path.node, jsonSkipLoc)\n );\n }", "title": "" }, { "docid": "60a46deca2c401a8c1c74d0d1deb6c42", "score": "0.49860674", "text": "function BranchData() {\n this.position = -1;\n this.nodeLength = -1;\n this.src = null;\n this.evalFalse = 0;\n this.evalTrue = 0;\n\n this.init = function(position, nodeLength, src) {\n this.position = position;\n this.nodeLength = nodeLength;\n this.src = src;\n return this;\n }\n\n this.ranCondition = function(result) {\n if (result)\n this.evalTrue++;\n else\n this.evalFalse++;\n };\n\n this.pathsCovered = function() {\n var paths = 0;\n if (this.evalTrue > 0)\n paths++;\n if (this.evalFalse > 0)\n paths++;\n return paths;\n };\n\n this.covered = function() {\n return this.evalTrue > 0 && this.evalFalse > 0;\n };\n\n this.toJSON = function() {\n return '{\"position\":' + this.position\n + ',\"nodeLength\":' + this.nodeLength\n + ',\"src\":' + jscoverage_quote(this.src)\n + ',\"evalFalse\":' + this.evalFalse\n + ',\"evalTrue\":' + this.evalTrue + '}';\n };\n\n this.message = function() {\n if (this.evalTrue === 0 && this.evalFalse === 0)\n return 'Condition never evaluated :\\t' + this.src;\n else if (this.evalTrue === 0)\n return 'Condition never evaluated to true :\\t' + this.src;\n else if (this.evalFalse === 0)\n return 'Condition never evaluated to false:\\t' + this.src;\n else\n return 'Condition covered';\n };\n}", "title": "" }, { "docid": "2a606867c733dd98bdc6bf25a8879ff9", "score": "0.49732444", "text": "function compileConditional () {\n // Insert code here \n}", "title": "" }, { "docid": "b12fefc5e338b8f460c32771c335984d", "score": "0.49550256", "text": "onCodePathStart(codePath) {\n scopeInfo = {\n upper: scopeInfo,\n uselessReturns: [],\n codePath\n };\n }", "title": "" }, { "docid": "125e5245b1c4c73a3010e7f2fe03b461", "score": "0.4954954", "text": "setBranchoffs(){\n var Rn = [this.R[0]+pxToLen*this.L*this.D[0],this.R[1]+pxToLen*this.L*this.D[1]];\n\n if(random()<0.5){ // this is to remove order in child branches\n var d1 = (this.fd)*this.d;\n var d2 = (1-this.fd)*this.d;\n var L1 = pow(this.fd,this.gamma)*this.L\n var L2 = pow(1-this.fd,this.gamma)*this.L\n }else{\n var d2 = (this.fd)*this.d;\n var d1 = (1-this.fd)*this.d;\n var L2 = pow(this.fd,this.gamma)*this.L\n var L1 = pow(1-this.fd,this.gamma)*this.L\n }\n\n var th0 = atan( (sq(L1*d1)-sq(L2*d2))/(sq(L1*d1)+sq(L2*d2)) * tan(this.dth) )\n\n this.th1 = th0 - this.dth\n this.th2 = th0 + this.dth\n\n var D1 = rotateVec(this.D,this.th1)\n var D2 = rotateVec(this.D,this.th2)\n\n this.B1 = new Branch(Rn,D1,L1,d1)\n this.B2 = new Branch(Rn,D2,L2,d2)\n }", "title": "" }, { "docid": "0ee0f48ec0ba2cad81eb376119200361", "score": "0.49182746", "text": "function tighten_body(statements, compressor) {\n var in_loop, in_try;\n var scope = compressor.find_parent(AST_Scope).get_defun_scope();\n find_loop_scope_try();\n var CHANGED, max_iter = 10;\n do {\n CHANGED = false;\n eliminate_spurious_blocks(statements);\n if (compressor.option(\"dead_code\")) {\n eliminate_dead_code(statements, compressor);\n }\n if (compressor.option(\"if_return\")) {\n handle_if_return(statements, compressor);\n }\n if (compressor.sequences_limit > 0) {\n sequencesize(statements, compressor);\n sequencesize_2(statements, compressor);\n }\n if (compressor.option(\"join_vars\")) {\n join_consecutive_vars(statements);\n }\n if (compressor.option(\"collapse_vars\")) {\n collapse(statements, compressor);\n }\n } while (CHANGED && max_iter-- > 0);\n function find_loop_scope_try() {\n var node = compressor.self(), level = 0;\n do {\n if (node instanceof AST_Catch || node instanceof AST_Finally) {\n level++;\n } else if (node instanceof AST_IterationStatement) {\n in_loop = true;\n } else if (node instanceof AST_Scope) {\n scope = node;\n break;\n } else if (node instanceof AST_Try) {\n in_try = true;\n }\n } while (node = compressor.parent(level++));\n }\n // Search from right to left for assignment-like expressions:\n // - `var a = x;`\n // - `a = x;`\n // - `++a`\n // For each candidate, scan from left to right for first usage, then try\n // to fold assignment into the site for compression.\n // Will not attempt to collapse assignments into or past code blocks\n // which are not sequentially executed, e.g. loops and conditionals.\n function collapse(statements, compressor) {\n if (scope.pinned()) return statements;\n var args;\n var candidates = [];\n var stat_index = statements.length;\n var scanner = new TreeTransformer(function (node) {\n if (abort) return node;\n // Skip nodes before `candidate` as quickly as possible\n if (!hit) {\n if (node !== hit_stack[hit_index]) return node;\n hit_index++;\n if (hit_index < hit_stack.length) return handle_custom_scan_order(node);\n hit = true;\n stop_after = find_stop(node, 0);\n if (stop_after === node) abort = true;\n return node;\n }\n // Stop immediately if these node types are encountered\n var parent = scanner.parent();\n if (node instanceof AST_Assign && (node.logical || node.operator != \"=\" && lhs.equivalent_to(node.left)) || node instanceof AST_Await || node instanceof AST_Call && lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression) || node instanceof AST_Debugger || node instanceof AST_Destructuring || node instanceof AST_Expansion && node.expression instanceof AST_Symbol && (node.expression instanceof AST_This || node.expression.definition().references.length > 1) || node instanceof AST_IterationStatement && !(node instanceof AST_For) || node instanceof AST_LoopControl || node instanceof AST_Try || node instanceof AST_With || node instanceof AST_Yield || node instanceof AST_Export || node instanceof AST_Class || parent instanceof AST_For && node !== parent.init || !replace_all && (node instanceof AST_SymbolRef && !node.is_declared(compressor) && !pure_prop_access_globals.has(node)) || node instanceof AST_SymbolRef && parent instanceof AST_Call && has_annotation(parent, _NOINLINE)) {\n abort = true;\n return node;\n }\n // Stop only if candidate is found within conditional branches\n if (!stop_if_hit && (!lhs_local || !replace_all) && (parent instanceof AST_Binary && lazy_op.has(parent.operator) && parent.left !== node || parent instanceof AST_Conditional && parent.condition !== node || parent instanceof AST_If && parent.condition !== node)) {\n stop_if_hit = parent;\n }\n // Replace variable with assignment when found\n if (can_replace && !(node instanceof AST_SymbolDeclaration) && lhs.equivalent_to(node)) {\n if (stop_if_hit) {\n abort = true;\n return node;\n }\n if (is_lhs(node, parent)) {\n if (value_def) replaced++;\n return node;\n } else {\n replaced++;\n if (value_def && candidate instanceof AST_VarDef) return node;\n }\n CHANGED = abort = true;\n if (candidate instanceof AST_UnaryPostfix) {\n return make_node(AST_UnaryPrefix, candidate, candidate);\n }\n if (candidate instanceof AST_VarDef) {\n var def = candidate.name.definition();\n var value = candidate.value;\n if (def.references.length - def.replaced == 1 && !compressor.exposed(def)) {\n def.replaced++;\n if (funarg && is_identifier_atom(value)) {\n return value.transform(compressor);\n } else {\n return maintain_this_binding(parent, node, value);\n }\n }\n return make_node(AST_Assign, candidate, {\n operator: \"=\",\n logical: false,\n left: make_node(AST_SymbolRef, candidate.name, candidate.name),\n right: value\n });\n }\n clear_flag(candidate, WRITE_ONLY);\n return candidate;\n }\n // These node types have child nodes that execute sequentially,\n // but are otherwise not safe to scan into or beyond them.\n var sym;\n if (node instanceof AST_Call || node instanceof AST_Exit && (side_effects || lhs instanceof AST_PropAccess || may_modify(lhs)) || node instanceof AST_PropAccess && (side_effects || node.expression.may_throw_on_access(compressor)) || node instanceof AST_SymbolRef && (lvalues.get(node.name) || side_effects && may_modify(node)) || node instanceof AST_VarDef && node.value && (lvalues.has(node.name.name) || side_effects && may_modify(node.name)) || (sym = is_lhs(node.left, node)) && (sym instanceof AST_PropAccess || lvalues.has(sym.name)) || may_throw && (in_try ? node.has_side_effects(compressor) : side_effects_external(node))) {\n stop_after = node;\n if (node instanceof AST_Scope) abort = true;\n }\n return handle_custom_scan_order(node);\n }, function (node) {\n if (abort) return;\n if (stop_after === node) abort = true;\n if (stop_if_hit === node) stop_if_hit = null;\n });\n var multi_replacer = new TreeTransformer(function (node) {\n if (abort) return node;\n // Skip nodes before `candidate` as quickly as possible\n if (!hit) {\n if (node !== hit_stack[hit_index]) return node;\n hit_index++;\n if (hit_index < hit_stack.length) return;\n hit = true;\n return node;\n }\n // Replace variable when found\n if (node instanceof AST_SymbolRef && node.name == def.name) {\n if (!--replaced) abort = true;\n if (is_lhs(node, multi_replacer.parent())) return node;\n def.replaced++;\n value_def.replaced--;\n return candidate.value;\n }\n // Skip (non-executed) functions and (leading) default case in switch statements\n if (node instanceof AST_Default || node instanceof AST_Scope) return node;\n });\n while (--stat_index >= 0) {\n // Treat parameters as collapsible in IIFE, i.e.\n // function(a, b){ ... }(x());\n // would be translated into equivalent assignments:\n // var a = x(), b = undefined;\n if (stat_index == 0 && compressor.option(\"unused\")) extract_args();\n // Find collapsible assignments\n var hit_stack = [];\n extract_candidates(statements[stat_index]);\n while (candidates.length > 0) {\n hit_stack = candidates.pop();\n var hit_index = 0;\n var candidate = hit_stack[hit_stack.length - 1];\n var value_def = null;\n var stop_after = null;\n var stop_if_hit = null;\n var lhs = get_lhs(candidate);\n if (!lhs || is_lhs_read_only(lhs) || lhs.has_side_effects(compressor)) continue;\n // Locate symbols which may execute code outside of scanning range\n var lvalues = get_lvalues(candidate);\n var lhs_local = is_lhs_local(lhs);\n if (lhs instanceof AST_SymbolRef) lvalues.set(lhs.name, false);\n var side_effects = value_has_side_effects(candidate);\n var replace_all = replace_all_symbols();\n var may_throw = candidate.may_throw(compressor);\n var funarg = candidate.name instanceof AST_SymbolFunarg;\n var hit = funarg;\n var abort = false, replaced = 0, can_replace = !args || !hit;\n if (!can_replace) {\n for (var j = compressor.self().argnames.lastIndexOf(candidate.name) + 1; !abort && j < args.length; j++) {\n args[j].transform(scanner);\n }\n can_replace = true;\n }\n for (var i = stat_index; !abort && i < statements.length; i++) {\n statements[i].transform(scanner);\n }\n if (value_def) {\n var def = candidate.name.definition();\n if (abort && def.references.length - def.replaced > replaced) replaced = false; else {\n abort = false;\n hit_index = 0;\n hit = funarg;\n for (var i = stat_index; !abort && i < statements.length; i++) {\n statements[i].transform(multi_replacer);\n }\n value_def.single_use = false;\n }\n }\n if (replaced && !remove_candidate(candidate)) statements.splice(stat_index, 1);\n }\n }\n function handle_custom_scan_order(node) {\n // Skip (non-executed) functions\n if (node instanceof AST_Scope) return node;\n // Scan case expressions first in a switch statement\n if (node instanceof AST_Switch) {\n node.expression = node.expression.transform(scanner);\n for (var i = 0, len = node.body.length; !abort && i < len; i++) {\n var branch = node.body[i];\n if (branch instanceof AST_Case) {\n if (!hit) {\n if (branch !== hit_stack[hit_index]) continue;\n hit_index++;\n }\n branch.expression = branch.expression.transform(scanner);\n if (!replace_all) break;\n }\n }\n abort = true;\n return node;\n }\n }\n function redefined_within_scope(def, scope) {\n if (def.global) return false;\n let cur_scope = def.scope;\n while (cur_scope && cur_scope !== scope) {\n if (cur_scope.variables.has(def.name)) return true;\n cur_scope = cur_scope.parent_scope;\n }\n return false;\n }\n function has_overlapping_symbol(fn, arg, fn_strict) {\n var found = false, scan_this = !(fn instanceof AST_Arrow);\n arg.walk(new TreeWalker(function (node, descend) {\n if (found) return true;\n if (node instanceof AST_SymbolRef && (fn.variables.has(node.name) || redefined_within_scope(node.definition(), fn))) {\n var s = node.definition().scope;\n if (s !== scope) while (s = s.parent_scope) {\n if (s === scope) return true;\n }\n return found = true;\n }\n if ((fn_strict || scan_this) && node instanceof AST_This) {\n return found = true;\n }\n if (node instanceof AST_Scope && !(node instanceof AST_Arrow)) {\n var prev = scan_this;\n scan_this = false;\n descend();\n scan_this = prev;\n return true;\n }\n }));\n return found;\n }\n function extract_args() {\n var iife, fn = compressor.self();\n if (is_func_expr(fn) && !fn.name && !fn.uses_arguments && !fn.pinned() && (iife = compressor.parent()) instanceof AST_Call && iife.expression === fn && iife.args.every(arg => !(arg instanceof AST_Expansion))) {\n var fn_strict = compressor.has_directive(\"use strict\");\n if (fn_strict && !member(fn_strict, fn.body)) fn_strict = false;\n var len = fn.argnames.length;\n args = iife.args.slice(len);\n var names = new Set();\n for (var i = len; --i >= 0; ) {\n var sym = fn.argnames[i];\n var arg = iife.args[i];\n // The following two line fix is a duplicate of the fix at\n // https://github.com/terser/terser/commit/011d3eb08cefe6922c7d1bdfa113fc4aeaca1b75\n // This might mean that these two pieces of code (one here in collapse_vars and another in reduce_vars\n // Might be doing the exact same thing.\n const def = sym.definition && sym.definition();\n const is_reassigned = def && def.orig.length > 1;\n if (is_reassigned) continue;\n args.unshift(make_node(AST_VarDef, sym, {\n name: sym,\n value: arg\n }));\n if (names.has(sym.name)) continue;\n names.add(sym.name);\n if (sym instanceof AST_Expansion) {\n var elements = iife.args.slice(i);\n if (elements.every(arg => !has_overlapping_symbol(fn, arg, fn_strict))) {\n candidates.unshift([make_node(AST_VarDef, sym, {\n name: sym.expression,\n value: make_node(AST_Array, iife, {\n elements: elements\n })\n })]);\n }\n } else {\n if (!arg) {\n arg = make_node(AST_Undefined, sym).transform(compressor);\n } else if (arg instanceof AST_Lambda && arg.pinned() || has_overlapping_symbol(fn, arg, fn_strict)) {\n arg = null;\n }\n if (arg) candidates.unshift([make_node(AST_VarDef, sym, {\n name: sym,\n value: arg\n })]);\n }\n }\n }\n }\n function extract_candidates(expr) {\n hit_stack.push(expr);\n if (expr instanceof AST_Assign) {\n if (!expr.left.has_side_effects(compressor)) {\n candidates.push(hit_stack.slice());\n }\n extract_candidates(expr.right);\n } else if (expr instanceof AST_Binary) {\n extract_candidates(expr.left);\n extract_candidates(expr.right);\n } else if (expr instanceof AST_Call && !has_annotation(expr, _NOINLINE)) {\n extract_candidates(expr.expression);\n expr.args.forEach(extract_candidates);\n } else if (expr instanceof AST_Case) {\n extract_candidates(expr.expression);\n } else if (expr instanceof AST_Conditional) {\n extract_candidates(expr.condition);\n extract_candidates(expr.consequent);\n extract_candidates(expr.alternative);\n } else if (expr instanceof AST_Definitions) {\n var len = expr.definitions.length;\n // limit number of trailing variable definitions for consideration\n var i = len - 200;\n if (i < 0) i = 0;\n for (; i < len; i++) {\n extract_candidates(expr.definitions[i]);\n }\n } else if (expr instanceof AST_DWLoop) {\n extract_candidates(expr.condition);\n if (!(expr.body instanceof AST_Block)) {\n extract_candidates(expr.body);\n }\n } else if (expr instanceof AST_Exit) {\n if (expr.value) extract_candidates(expr.value);\n } else if (expr instanceof AST_For) {\n if (expr.init) extract_candidates(expr.init);\n if (expr.condition) extract_candidates(expr.condition);\n if (expr.step) extract_candidates(expr.step);\n if (!(expr.body instanceof AST_Block)) {\n extract_candidates(expr.body);\n }\n } else if (expr instanceof AST_ForIn) {\n extract_candidates(expr.object);\n if (!(expr.body instanceof AST_Block)) {\n extract_candidates(expr.body);\n }\n } else if (expr instanceof AST_If) {\n extract_candidates(expr.condition);\n if (!(expr.body instanceof AST_Block)) {\n extract_candidates(expr.body);\n }\n if (expr.alternative && !(expr.alternative instanceof AST_Block)) {\n extract_candidates(expr.alternative);\n }\n } else if (expr instanceof AST_Sequence) {\n expr.expressions.forEach(extract_candidates);\n } else if (expr instanceof AST_SimpleStatement) {\n extract_candidates(expr.body);\n } else if (expr instanceof AST_Switch) {\n extract_candidates(expr.expression);\n expr.body.forEach(extract_candidates);\n } else if (expr instanceof AST_Unary) {\n if (expr.operator == \"++\" || expr.operator == \"--\") {\n candidates.push(hit_stack.slice());\n }\n } else if (expr instanceof AST_VarDef) {\n if (expr.value) {\n candidates.push(hit_stack.slice());\n extract_candidates(expr.value);\n }\n }\n hit_stack.pop();\n }\n function find_stop(node, level, write_only) {\n var parent = scanner.parent(level);\n if (parent instanceof AST_Assign) {\n if (write_only && !parent.logical && !(parent.left instanceof AST_PropAccess || lvalues.has(parent.left.name))) {\n return find_stop(parent, level + 1, write_only);\n }\n return node;\n }\n if (parent instanceof AST_Binary) {\n if (write_only && (!lazy_op.has(parent.operator) || parent.left === node)) {\n return find_stop(parent, level + 1, write_only);\n }\n return node;\n }\n if (parent instanceof AST_Call) return node;\n if (parent instanceof AST_Case) return node;\n if (parent instanceof AST_Conditional) {\n if (write_only && parent.condition === node) {\n return find_stop(parent, level + 1, write_only);\n }\n return node;\n }\n if (parent instanceof AST_Definitions) {\n return find_stop(parent, level + 1, true);\n }\n if (parent instanceof AST_Exit) {\n return write_only ? find_stop(parent, level + 1, write_only) : node;\n }\n if (parent instanceof AST_If) {\n if (write_only && parent.condition === node) {\n return find_stop(parent, level + 1, write_only);\n }\n return node;\n }\n if (parent instanceof AST_IterationStatement) return node;\n if (parent instanceof AST_Sequence) {\n return find_stop(parent, level + 1, parent.tail_node() !== node);\n }\n if (parent instanceof AST_SimpleStatement) {\n return find_stop(parent, level + 1, true);\n }\n if (parent instanceof AST_Switch) return node;\n if (parent instanceof AST_VarDef) return node;\n return null;\n }\n function mangleable_var(var_def) {\n var value = var_def.value;\n if (!(value instanceof AST_SymbolRef)) return;\n if (value.name == \"arguments\") return;\n var def = value.definition();\n if (def.undeclared) return;\n return value_def = def;\n }\n function get_lhs(expr) {\n if (expr instanceof AST_Assign && expr.logical) {\n return false;\n } else if (expr instanceof AST_VarDef && expr.name instanceof AST_SymbolDeclaration) {\n var def = expr.name.definition();\n if (!member(expr.name, def.orig)) return;\n var referenced = def.references.length - def.replaced;\n if (!referenced) return;\n var declared = def.orig.length - def.eliminated;\n if (declared > 1 && !(expr.name instanceof AST_SymbolFunarg) || (referenced > 1 ? mangleable_var(expr) : !compressor.exposed(def))) {\n return make_node(AST_SymbolRef, expr.name, expr.name);\n }\n } else {\n const lhs = expr instanceof AST_Assign ? expr.left : expr.expression;\n return !is_ref_of(lhs, AST_SymbolConst) && !is_ref_of(lhs, AST_SymbolLet) && lhs;\n }\n }\n function get_rvalue(expr) {\n if (expr instanceof AST_Assign) {\n return expr.right;\n } else {\n return expr.value;\n }\n }\n function get_lvalues(expr) {\n var lvalues = new Map();\n if (expr instanceof AST_Unary) return lvalues;\n var tw = new TreeWalker(function (node) {\n var sym = node;\n while (sym instanceof AST_PropAccess) sym = sym.expression;\n if (sym instanceof AST_SymbolRef || sym instanceof AST_This) {\n lvalues.set(sym.name, lvalues.get(sym.name) || is_modified(compressor, tw, node, node, 0));\n }\n });\n get_rvalue(expr).walk(tw);\n return lvalues;\n }\n function remove_candidate(expr) {\n if (expr.name instanceof AST_SymbolFunarg) {\n var iife = compressor.parent(), argnames = compressor.self().argnames;\n var index = argnames.indexOf(expr.name);\n if (index < 0) {\n iife.args.length = Math.min(iife.args.length, argnames.length - 1);\n } else {\n var args = iife.args;\n if (args[index]) args[index] = make_node(AST_Number, args[index], {\n value: 0\n });\n }\n return true;\n }\n var found = false;\n return statements[stat_index].transform(new TreeTransformer(function (node, descend, in_list) {\n if (found) return node;\n if (node === expr || node.body === expr) {\n found = true;\n if (node instanceof AST_VarDef) {\n node.value = node.name instanceof AST_SymbolConst ? make_node(AST_Undefined, node.value) : // `const` always needs value.\n null;\n return node;\n }\n return in_list ? MAP.skip : null;\n }\n }, function (node) {\n if (node instanceof AST_Sequence) switch (node.expressions.length) {\n case 0:\n return null;\n case 1:\n return node.expressions[0];\n }\n }));\n }\n function is_lhs_local(lhs) {\n while (lhs instanceof AST_PropAccess) lhs = lhs.expression;\n return lhs instanceof AST_SymbolRef && lhs.definition().scope === scope && !(in_loop && (lvalues.has(lhs.name) || candidate instanceof AST_Unary || candidate instanceof AST_Assign && !candidate.logical && candidate.operator != \"=\"));\n }\n function value_has_side_effects(expr) {\n if (expr instanceof AST_Unary) return unary_side_effects.has(expr.operator);\n return get_rvalue(expr).has_side_effects(compressor);\n }\n function replace_all_symbols() {\n if (side_effects) return false;\n if (value_def) return true;\n if (lhs instanceof AST_SymbolRef) {\n var def = lhs.definition();\n if (def.references.length - def.replaced == (candidate instanceof AST_VarDef ? 1 : 2)) {\n return true;\n }\n }\n return false;\n }\n function may_modify(sym) {\n if (!sym.definition) return true;\n // AST_Destructuring\n var def = sym.definition();\n if (def.orig.length == 1 && def.orig[0] instanceof AST_SymbolDefun) return false;\n if (def.scope.get_defun_scope() !== scope) return true;\n return !def.references.every(ref => {\n var s = ref.scope.get_defun_scope();\n // \"block\" scope within AST_Catch\n if (s.TYPE == \"Scope\") s = s.parent_scope;\n return s === scope;\n });\n }\n function side_effects_external(node, lhs) {\n if (node instanceof AST_Assign) return side_effects_external(node.left, true);\n if (node instanceof AST_Unary) return side_effects_external(node.expression, true);\n if (node instanceof AST_VarDef) return node.value && side_effects_external(node.value);\n if (lhs) {\n if (node instanceof AST_Dot) return side_effects_external(node.expression, true);\n if (node instanceof AST_Sub) return side_effects_external(node.expression, true);\n if (node instanceof AST_SymbolRef) return node.definition().scope !== scope;\n }\n return false;\n }\n }\n function eliminate_spurious_blocks(statements) {\n var seen_dirs = [];\n for (var i = 0; i < statements.length; ) {\n var stat = statements[i];\n if (stat instanceof AST_BlockStatement && stat.body.every(can_be_evicted_from_block)) {\n CHANGED = true;\n eliminate_spurious_blocks(stat.body);\n statements.splice(i, 1, ...stat.body);\n i += stat.body.length;\n } else if (stat instanceof AST_EmptyStatement) {\n CHANGED = true;\n statements.splice(i, 1);\n } else if (stat instanceof AST_Directive) {\n if (seen_dirs.indexOf(stat.value) < 0) {\n i++;\n seen_dirs.push(stat.value);\n } else {\n CHANGED = true;\n statements.splice(i, 1);\n }\n } else i++;\n }\n }\n function handle_if_return(statements, compressor) {\n var self = compressor.self();\n var multiple_if_returns = has_multiple_if_returns(statements);\n var in_lambda = self instanceof AST_Lambda;\n for (var i = statements.length; --i >= 0; ) {\n var stat = statements[i];\n var j = next_index(i);\n var next = statements[j];\n if (in_lambda && !next && stat instanceof AST_Return) {\n if (!stat.value) {\n CHANGED = true;\n statements.splice(i, 1);\n continue;\n }\n if (stat.value instanceof AST_UnaryPrefix && stat.value.operator == \"void\") {\n CHANGED = true;\n statements[i] = make_node(AST_SimpleStatement, stat, {\n body: stat.value.expression\n });\n continue;\n }\n }\n if (stat instanceof AST_If) {\n var ab = aborts(stat.body);\n if (can_merge_flow(ab)) {\n if (ab.label) {\n remove(ab.label.thedef.references, ab);\n }\n CHANGED = true;\n stat = stat.clone();\n stat.condition = stat.condition.negate(compressor);\n var body = as_statement_array_with_return(stat.body, ab);\n stat.body = make_node(AST_BlockStatement, stat, {\n body: as_statement_array(stat.alternative).concat(extract_functions())\n });\n stat.alternative = make_node(AST_BlockStatement, stat, {\n body: body\n });\n statements[i] = stat.transform(compressor);\n continue;\n }\n var ab = aborts(stat.alternative);\n if (can_merge_flow(ab)) {\n if (ab.label) {\n remove(ab.label.thedef.references, ab);\n }\n CHANGED = true;\n stat = stat.clone();\n stat.body = make_node(AST_BlockStatement, stat.body, {\n body: as_statement_array(stat.body).concat(extract_functions())\n });\n var body = as_statement_array_with_return(stat.alternative, ab);\n stat.alternative = make_node(AST_BlockStatement, stat.alternative, {\n body: body\n });\n statements[i] = stat.transform(compressor);\n continue;\n }\n }\n if (stat instanceof AST_If && stat.body instanceof AST_Return) {\n var value = stat.body.value;\n // ---\n // pretty silly case, but:\n // if (foo()) return; return; ==> foo(); return;\n if (!value && !stat.alternative && (in_lambda && !next || next instanceof AST_Return && !next.value)) {\n CHANGED = true;\n statements[i] = make_node(AST_SimpleStatement, stat.condition, {\n body: stat.condition\n });\n continue;\n }\n // ---\n // if (foo()) return x; return y; ==> return foo() ? x : y;\n if (value && !stat.alternative && next instanceof AST_Return && next.value) {\n CHANGED = true;\n stat = stat.clone();\n stat.alternative = next;\n statements[i] = stat.transform(compressor);\n statements.splice(j, 1);\n continue;\n }\n // ---\n // if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined;\n if (value && !stat.alternative && (!next && in_lambda && multiple_if_returns || next instanceof AST_Return)) {\n CHANGED = true;\n stat = stat.clone();\n stat.alternative = next || make_node(AST_Return, stat, {\n value: null\n });\n statements[i] = stat.transform(compressor);\n if (next) statements.splice(j, 1);\n continue;\n }\n // ---\n // if (a) return b; if (c) return d; e; ==> return a ? b : c ? d : void e;\n // \n // if sequences is not enabled, this can lead to an endless loop (issue #866).\n // however, with sequences on this helps producing slightly better output for\n // the example code.\n var prev = statements[prev_index(i)];\n if (compressor.option(\"sequences\") && in_lambda && !stat.alternative && prev instanceof AST_If && prev.body instanceof AST_Return && next_index(j) == statements.length && next instanceof AST_SimpleStatement) {\n CHANGED = true;\n stat = stat.clone();\n stat.alternative = make_node(AST_BlockStatement, next, {\n body: [next, make_node(AST_Return, next, {\n value: null\n })]\n });\n statements[i] = stat.transform(compressor);\n statements.splice(j, 1);\n continue;\n }\n }\n }\n function has_multiple_if_returns(statements) {\n var n = 0;\n for (var i = statements.length; --i >= 0; ) {\n var stat = statements[i];\n if (stat instanceof AST_If && stat.body instanceof AST_Return) {\n if (++n > 1) return true;\n }\n }\n return false;\n }\n function is_return_void(value) {\n return !value || value instanceof AST_UnaryPrefix && value.operator == \"void\";\n }\n function can_merge_flow(ab) {\n if (!ab) return false;\n for (var j = i + 1, len = statements.length; j < len; j++) {\n var stat = statements[j];\n if (stat instanceof AST_Const || stat instanceof AST_Let) return false;\n }\n var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab) : null;\n return ab instanceof AST_Return && in_lambda && is_return_void(ab.value) || ab instanceof AST_Continue && self === loop_body(lct) || ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct;\n }\n function extract_functions() {\n var tail = statements.slice(i + 1);\n statements.length = i + 1;\n return tail.filter(function (stat) {\n if (stat instanceof AST_Defun) {\n statements.push(stat);\n return false;\n }\n return true;\n });\n }\n function as_statement_array_with_return(node, ab) {\n var body = as_statement_array(node).slice(0, -1);\n if (ab.value) {\n body.push(make_node(AST_SimpleStatement, ab.value, {\n body: ab.value.expression\n }));\n }\n return body;\n }\n function next_index(i) {\n for (var j = i + 1, len = statements.length; j < len; j++) {\n var stat = statements[j];\n if (!(stat instanceof AST_Var && declarations_only(stat))) {\n break;\n }\n }\n return j;\n }\n function prev_index(i) {\n for (var j = i; --j >= 0; ) {\n var stat = statements[j];\n if (!(stat instanceof AST_Var && declarations_only(stat))) {\n break;\n }\n }\n return j;\n }\n }\n function eliminate_dead_code(statements, compressor) {\n var has_quit;\n var self = compressor.self();\n for (var i = 0, n = 0, len = statements.length; i < len; i++) {\n var stat = statements[i];\n if (stat instanceof AST_LoopControl) {\n var lct = compressor.loopcontrol_target(stat);\n if (stat instanceof AST_Break && !(lct instanceof AST_IterationStatement) && loop_body(lct) === self || stat instanceof AST_Continue && loop_body(lct) === self) {\n if (stat.label) {\n remove(stat.label.thedef.references, stat);\n }\n } else {\n statements[n++] = stat;\n }\n } else {\n statements[n++] = stat;\n }\n if (aborts(stat)) {\n has_quit = statements.slice(i + 1);\n break;\n }\n }\n statements.length = n;\n CHANGED = n != len;\n if (has_quit) has_quit.forEach(function (stat) {\n trim_unreachable_code(compressor, stat, statements);\n });\n }\n function declarations_only(node) {\n return node.definitions.every(var_def => !var_def.value);\n }\n function sequencesize(statements, compressor) {\n if (statements.length < 2) return;\n var seq = [], n = 0;\n function push_seq() {\n if (!seq.length) return;\n var body = make_sequence(seq[0], seq);\n statements[n++] = make_node(AST_SimpleStatement, body, {\n body: body\n });\n seq = [];\n }\n for (var i = 0, len = statements.length; i < len; i++) {\n var stat = statements[i];\n if (stat instanceof AST_SimpleStatement) {\n if (seq.length >= compressor.sequences_limit) push_seq();\n var body = stat.body;\n if (seq.length > 0) body = body.drop_side_effect_free(compressor);\n if (body) merge_sequence(seq, body);\n } else if (stat instanceof AST_Definitions && declarations_only(stat) || stat instanceof AST_Defun) {\n statements[n++] = stat;\n } else {\n push_seq();\n statements[n++] = stat;\n }\n }\n push_seq();\n statements.length = n;\n if (n != len) CHANGED = true;\n }\n function to_simple_statement(block, decls) {\n if (!(block instanceof AST_BlockStatement)) return block;\n var stat = null;\n for (var i = 0, len = block.body.length; i < len; i++) {\n var line = block.body[i];\n if (line instanceof AST_Var && declarations_only(line)) {\n decls.push(line);\n } else if (stat) {\n return false;\n } else {\n stat = line;\n }\n }\n return stat;\n }\n function sequencesize_2(statements, compressor) {\n function cons_seq(right) {\n n--;\n CHANGED = true;\n var left = prev.body;\n return make_sequence(left, [left, right]).transform(compressor);\n }\n var n = 0, prev;\n for (var i = 0; i < statements.length; i++) {\n var stat = statements[i];\n if (prev) {\n if (stat instanceof AST_Exit) {\n stat.value = cons_seq(stat.value || make_node(AST_Undefined, stat).transform(compressor));\n } else if (stat instanceof AST_For) {\n if (!(stat.init instanceof AST_Definitions)) {\n const abort = walk(prev.body, node => {\n if (node instanceof AST_Scope) return true;\n if (node instanceof AST_Binary && node.operator === \"in\") {\n return walk_abort;\n }\n });\n if (!abort) {\n if (stat.init) stat.init = cons_seq(stat.init); else {\n stat.init = prev.body;\n n--;\n CHANGED = true;\n }\n }\n }\n } else if (stat instanceof AST_ForIn) {\n if (!(stat.init instanceof AST_Const) && !(stat.init instanceof AST_Let)) {\n stat.object = cons_seq(stat.object);\n }\n } else if (stat instanceof AST_If) {\n stat.condition = cons_seq(stat.condition);\n } else if (stat instanceof AST_Switch) {\n stat.expression = cons_seq(stat.expression);\n } else if (stat instanceof AST_With) {\n stat.expression = cons_seq(stat.expression);\n }\n }\n if (compressor.option(\"conditionals\") && stat instanceof AST_If) {\n var decls = [];\n var body = to_simple_statement(stat.body, decls);\n var alt = to_simple_statement(stat.alternative, decls);\n if (body !== false && alt !== false && decls.length > 0) {\n var len = decls.length;\n decls.push(make_node(AST_If, stat, {\n condition: stat.condition,\n body: body || make_node(AST_EmptyStatement, stat.body),\n alternative: alt\n }));\n decls.unshift(n, 1);\n [].splice.apply(statements, decls);\n i += len;\n n += len + 1;\n prev = null;\n CHANGED = true;\n continue;\n }\n }\n statements[n++] = stat;\n prev = stat instanceof AST_SimpleStatement ? stat : null;\n }\n statements.length = n;\n }\n function join_object_assignments(defn, body) {\n if (!(defn instanceof AST_Definitions)) return;\n var def = defn.definitions[defn.definitions.length - 1];\n if (!(def.value instanceof AST_Object)) return;\n var exprs;\n if (body instanceof AST_Assign && !body.logical) {\n exprs = [body];\n } else if (body instanceof AST_Sequence) {\n exprs = body.expressions.slice();\n }\n if (!exprs) return;\n var trimmed = false;\n do {\n var node = exprs[0];\n if (!(node instanceof AST_Assign)) break;\n if (node.operator != \"=\") break;\n if (!(node.left instanceof AST_PropAccess)) break;\n var sym = node.left.expression;\n if (!(sym instanceof AST_SymbolRef)) break;\n if (def.name.name != sym.name) break;\n if (!node.right.is_constant_expression(scope)) break;\n var prop = node.left.property;\n if (prop instanceof AST_Node) {\n prop = prop.evaluate(compressor);\n }\n if (prop instanceof AST_Node) break;\n prop = \"\" + prop;\n var diff = compressor.option(\"ecma\") < 2015 && compressor.has_directive(\"use strict\") ? function (node) {\n return node.key != prop && (node.key && node.key.name != prop);\n } : function (node) {\n return node.key && node.key.name != prop;\n };\n if (!def.value.properties.every(diff)) break;\n var p = def.value.properties.filter(function (p) {\n return p.key === prop;\n })[0];\n if (!p) {\n def.value.properties.push(make_node(AST_ObjectKeyVal, node, {\n key: prop,\n value: node.right\n }));\n } else {\n p.value = new AST_Sequence({\n start: p.start,\n expressions: [p.value.clone(), node.right.clone()],\n end: p.end\n });\n }\n exprs.shift();\n trimmed = true;\n } while (exprs.length);\n return trimmed && exprs;\n }\n function join_consecutive_vars(statements) {\n var defs;\n for (var i = 0, j = -1, len = statements.length; i < len; i++) {\n var stat = statements[i];\n var prev = statements[j];\n if (stat instanceof AST_Definitions) {\n if (prev && prev.TYPE == stat.TYPE) {\n prev.definitions = prev.definitions.concat(stat.definitions);\n CHANGED = true;\n } else if (defs && defs.TYPE == stat.TYPE && declarations_only(stat)) {\n defs.definitions = defs.definitions.concat(stat.definitions);\n CHANGED = true;\n } else {\n statements[++j] = stat;\n defs = stat;\n }\n } else if (stat instanceof AST_Exit) {\n stat.value = extract_object_assignments(stat.value);\n } else if (stat instanceof AST_For) {\n var exprs = join_object_assignments(prev, stat.init);\n if (exprs) {\n CHANGED = true;\n stat.init = exprs.length ? make_sequence(stat.init, exprs) : null;\n statements[++j] = stat;\n } else if (prev instanceof AST_Var && (!stat.init || stat.init.TYPE == prev.TYPE)) {\n if (stat.init) {\n prev.definitions = prev.definitions.concat(stat.init.definitions);\n }\n stat.init = prev;\n statements[j] = stat;\n CHANGED = true;\n } else if (defs && stat.init && defs.TYPE == stat.init.TYPE && declarations_only(stat.init)) {\n defs.definitions = defs.definitions.concat(stat.init.definitions);\n stat.init = null;\n statements[++j] = stat;\n CHANGED = true;\n } else {\n statements[++j] = stat;\n }\n } else if (stat instanceof AST_ForIn) {\n stat.object = extract_object_assignments(stat.object);\n } else if (stat instanceof AST_If) {\n stat.condition = extract_object_assignments(stat.condition);\n } else if (stat instanceof AST_SimpleStatement) {\n var exprs = join_object_assignments(prev, stat.body);\n if (exprs) {\n CHANGED = true;\n if (!exprs.length) continue;\n stat.body = make_sequence(stat.body, exprs);\n }\n statements[++j] = stat;\n } else if (stat instanceof AST_Switch) {\n stat.expression = extract_object_assignments(stat.expression);\n } else if (stat instanceof AST_With) {\n stat.expression = extract_object_assignments(stat.expression);\n } else {\n statements[++j] = stat;\n }\n }\n statements.length = j + 1;\n function extract_object_assignments(value) {\n statements[++j] = stat;\n var exprs = join_object_assignments(prev, value);\n if (exprs) {\n CHANGED = true;\n if (exprs.length) {\n return make_sequence(value, exprs);\n } else if (value instanceof AST_Sequence) {\n return value.tail_node().left;\n } else {\n return value.left;\n }\n }\n return value;\n }\n }\n }", "title": "" }, { "docid": "d6dad42c6cb1e0a8b4d30b9b7e6e8617", "score": "0.49156255", "text": "onCodePathStart(codePath, node) {\n funcInfo = {\n upper: funcInfo,\n codePath,\n hasReturn: false,\n hasReturnValue: false,\n messageId: \"\",\n node\n };\n }", "title": "" }, { "docid": "459de4cf13ea4bee3342cf99b4b00d41", "score": "0.49069762", "text": "function getMappingNaive(c, path, mapping, level) {\n if (path === void 0) { path = ''; }\n if (mapping === void 0) { mapping = {}; }\n if (level === void 0) { level = 0; }\n if (Array.isArray(c)) {\n c.forEach(function (c) { return getMappingNaive(c, path, mapping, level); });\n return mapping;\n }\n if (++level === 16)\n return;\n add(c, path, mapping);\n for (var p in c) {\n if (c.hasOwnProperty(p)) {\n var v = c[p];\n if (Array.isArray(v) && v.length > 0) { // reducer as impovement\n v.forEach(function (elem, i) {\n // const currentPaht = [`path[${i}]`, p].filter(c => c.trim() != '').join('.');\n var currentPaht = [path, p].filter(function (c) { return c.trim() != ''; }).join('.');\n getMappingNaive(elem, currentPaht, mapping, level);\n });\n }\n else if (typeof v === 'object') {\n var currentPaht = [path, p].filter(function (c) { return c.trim() != ''; }).join('.');\n add(v, currentPaht, mapping);\n getMappingNaive(v, currentPaht, mapping, level);\n }\n }\n }\n return mapping;\n }", "title": "" }, { "docid": "d3c7f0265bffe44dc644bbb3f7f16c68", "score": "0.49046272", "text": "onCodePathStart(codePath, node) {\n let methodName = null;\n\n if (TARGET_NODE_TYPE.test(node.type)) {\n methodName = getArrayMethodName(node);\n }\n\n funcInfo = {\n arrayMethodName: methodName,\n upper: funcInfo,\n codePath,\n hasReturn: false,\n shouldCheck: methodName && !node.async && !node.generator,\n node\n };\n }", "title": "" }, { "docid": "15f020f0ad2fd7bebde2ec1909432cce", "score": "0.4896138", "text": "tracePath() {\n const path = [];\n let ai = this.aLen;\n let bi = this.bLen;\n let current = this.matrix[bi][ai];\n let cost = current.cost;\n // Since we're doing a prefix match, we don't include the edits in the\n // suffix of sequence `a` that don't match sequence `b`. The suffix is\n // considered to be a consecutive sequence of deletes from `a` at the\n // end of the match.\n let inSuffix = true;\n let leftmostA = -1;\n let rightmostA = -1;\n let common = 0;\n while (current.edit !== Edit.NONE) {\n switch (current.edit) {\n case Edit.DELETE_A:\n if (inSuffix) {\n cost -= 1;\n }\n ai--;\n leftmostA = ai;\n break;\n case Edit.DELETE_B:\n bi--;\n break;\n case Edit.REPLACE:\n // DESIGN NOTE: it is important to take the item from\n // sequence `a` instead of `b`, in order to allow wildcards\n // from `b` to match items in `a`. In other words, we don't\n // want the match to contain the wildcard specifier from\n // `b`. Rather we want to it to contain the item from `a`\n // that matches the wildcard specifier.\n path.push(this.a[ai - 1]);\n // EXPERIMENT: replace above line with code below.\n // if (!inSuffix) {\n // path.push(this.a[ai - 1]);\n // }\n ai--;\n bi--;\n // EXPERIMENT: comment out // inSuffix = false;\n inSuffix = false;\n leftmostA = ai;\n break;\n case Edit.MATCH:\n path.push(this.a[ai - 1]);\n ai--;\n bi--;\n common++;\n inSuffix = false;\n leftmostA = ai;\n break;\n default:\n // Should never get here.\n break;\n }\n if (rightmostA < 0 && !inSuffix) {\n rightmostA = ai;\n }\n current = this.matrix[bi][ai];\n }\n this.result = { match: path.reverse(), cost, leftmostA, rightmostA, common };\n }", "title": "" }, { "docid": "b1e474239bb79e3fb1b7da0f45353546", "score": "0.48939914", "text": "onCodePathStart(codePath, node) {\n funcInfo = {\n upper: funcInfo,\n codePath,\n hasReturn: false,\n hasReturnValue: false,\n messageId: \"\",\n node\n };\n }", "title": "" }, { "docid": "16645d0af72d945015c66583f20bcdaf", "score": "0.48529318", "text": "function n(e,t){var n={};return e.path?(Object(r.b)(e.path).forEach(function(e){Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}),n):n}", "title": "" }, { "docid": "002c8fcaa3fde997eeaf608433b25a47", "score": "0.48236763", "text": "function o0() {\n var o1 = 0x40000;\n var set = o3();\n function o86(o62,o63){\n try {\no62 = +o62;\n}catch(e){}\n try {\no63 = +o63;\n}catch(e){}\n var o87 = 0, o88 = 0;\n var o77 = 0.0, o83 = 0.0;\n try {\no87 = ~~o62;\n}catch(e){}\n try {\no88 = ~~o63;\n}catch(e){}\n try {\nif(o89[o87&7](o62,o63)|0){\n try {\no77 = +o90[o87&3](o62,+o90[o87&3](o62,o62));\n}catch(e){}\n try {\no83 = +o90[~~o77&3](+o90[o88&3](o62,5.5),+o90[o88&3](o62,2.1));\n}catch(e){}\n }\n else {\n try {\no77 = +o90[o88&3](o62,+o90[o88&3](o62,o63));\n}catch(e){}\n try {\no83 = +o90[~~o87&3](+o90[o87&3](o62,5.5),+o90[o87&3](o62,o63));\n}catch(e){}\n }\n}catch(e){}\n try {\nif(o69(o77,o83)|0){\n try {\no77 = o83;\n}catch(e){}\n }\n else{\n try {\no13(o83);\n}catch(e){}\n }\n}catch(e){}\n try {\nreturn +o77;\n}catch(e){}\n }; // g flag to trigger the vulnerable path\n var o4 = \"ab\".repeat(o1); // matches have to be at least size 2 to prevent interning\n var o5 = (o4 + \"|\").repeat(o2);\n try {\nwhile (true) {\n var o6 = 0;\n var o7 = [];\n try {\no5.replace(o3, function() {\n try {\nfor (var o8 = 1; o8 < arguments.length-2; ++o8) {\n try {\nif (typeof arguments[o8] !== 'string') {\n try {\no9 = arguments[o8];\n}catch(e){}\n try {\nthrow \"success\";\n}catch(e){}\n }\n}catch(e){}\n try {\no7[o6++] = arguments[o8];\n}catch(e){} // root everything to force GC\n }\n}catch(e){}\n try {\nreturn \"x\";\n}catch(e){}\n });\n}catch(e){}\n }\n}catch(e){}\n}", "title": "" }, { "docid": "2ea01c5c5cbb61c9fcc2cff066e85f5d", "score": "0.48172915", "text": "function optimizeforsource() {\n if (isCsv && isExcel) {\n addToLog(\"Unexpected source\");\n } else if (isExcel && !isCsv) {\n excelconfig();\n } else if (isCsv && !isExcel) {\n csvconfig();\n } else {\n csvconfig();\n }\n}", "title": "" }, { "docid": "4e091c3f005620de673a210e207f2e00", "score": "0.4817017", "text": "shortcircuit () {\n return null\n }", "title": "" }, { "docid": "72e89c3889667a90757c8938702961c4", "score": "0.48152348", "text": "findBuildPath(path, extraData = false) {\n for (let buildPathData of this.getBuildPaths(path, extraData)) {\n let buildPath;\n if (extraData) {\n buildPath = buildPathData.path;\n } else {\n buildPath = buildPathData;\n }\n if (PathInfo.exists(buildPath)) {\n return buildPathData;\n }\n }\n }", "title": "" }, { "docid": "4f2c7ed60d2ed10d2826fcf07ac153e3", "score": "0.48102203", "text": "function babel7Workaround() {\n return {\n visitor: {\n Program(programPath) {\n programPath.traverse({\n ArrowFunctionExpression(path) {\n const node = path.node;\n node.expression = node.body.type !== \"BlockStatement\";\n },\n });\n },\n },\n };\n}", "title": "" }, { "docid": "e91714a7cf01dc21210bb5db1062cb47", "score": "0.480962", "text": "CallExpression(path, state) {\n if (\n // Where the function is named 'require'\n path.node.callee.name !== 'require' ||\n // The first argument is a String\n path.node.arguments[0].type !== 'StringLiteral' ||\n // The first argument contains a ! character\n path.node.arguments[0].value.indexOf('!') < 0\n ) {\n // Skip this node if the requirements aren't met\n return;\n }\n\n // The ! delimits the source path and the 'context'\n const [src, cx] = path.node.arguments[0].value.split('!');\n\n // If context is the string 'raw', get the inline code\n // otherwise get the built file path\n // NB: babel plugins have to be synchronous, but the build functions\n // return promises - fortunately there's a library to help us!\n const resolved = deasyncPromise(\n cx === 'raw' ? inline(src) : pathname(src)\n );\n // Kind of ham-fisted but works for now\n\n // Replace the require call with a string\n path.replaceWith(t.stringLiteral(resolved));\n }", "title": "" }, { "docid": "e1ce75480db033adca8a28b91c3a547e", "score": "0.4802391", "text": "onCodePathEnd() {\n for (const node of scopeInfo.uselessReturns) {\n context.report({\n node,\n loc: node.loc,\n message: \"Unnecessary return statement.\",\n fix(fixer) {\n if (isRemovable(node)) {\n\n /*\n * Extend the replacement range to include the\n * entire function to avoid conflicting with\n * no-else-return.\n * https://github.com/eslint/eslint/issues/8026\n */\n return new FixTracker(fixer, context.getSourceCode())\n .retainEnclosingFunction(node)\n .remove(node);\n }\n return null;\n }\n });\n }\n\n scopeInfo = scopeInfo.upper;\n }", "title": "" }, { "docid": "e06f875f1fa9c29edecbd0b4594fad2c", "score": "0.48018083", "text": "async function pokePath(\n origin,\n destination,\n pathArray = [],\n alreadyCheckedPokemon = new Set(),\n alreadyCheckedAbilities = new Set(),\n solutionPaths = []\n) {\n //console.log(origin);\n // get origin assuming it its a queue first dequeue\n const originPokemon = await httpRequest(getPokemonWithName(origin[0]));\n alreadyCheckedPokemon.add(origin.shift());\n\n // get the abilities of the origin (array)\n const originPokemonAbilities = JSON.parse(originPokemon).abilities.map(\n (element) => element.ability\n );\n //console.log(originPokemonAbilities);\n\n // for each ability check that it hasn't been checked, get all the pokemon with that ability, if any of those pokemon = destination then stop and add that one ability to queue.\n let destinationFound = false;\n for (let ability of originPokemonAbilities) {\n let pathArrayCopy = [...pathArray];\n if (!alreadyCheckedAbilities.has(ability.name)) {\n const nextPokemon = await getAllPokemonWithAbility(ability.name);\n //console.log(nextPokemon);\n if (nextPokemon.includes(destination)) {\n console.log(\"huzzah!\");\n pathArrayCopy.push(ability.name);\n solutionPaths.push(pathArrayCopy);\n destinationFound = true;\n } else {\n // enqueue all pokemon with that ability if they haven't been checked before\n nextPokemon.forEach(async (pokemon) => {\n if (!alreadyCheckedPokemon.has(pokemon)) {\n origin.push(pokemon);\n alreadyCheckedPokemon.add(pokemon);\n }\n });\n }\n console.log(solutionPaths);\n if (!destinationFound) {\n //probably don't want to do this\n alreadyCheckedAbilities.add(ability.name);\n pathArrayCopy.push(ability.name);\n console.log(pathArrayCopy);\n return pokePath(\n origin,\n destination,\n pathArrayCopy,\n alreadyCheckedPokemon,\n alreadyCheckedAbilities,\n solutionPaths\n );\n }\n } else {\n return pokePath(\n origin,\n destination,\n pathArrayCopy,\n alreadyCheckedPokemon,\n alreadyCheckedAbilities,\n solutionPaths\n );\n }\n }\n console.log(\"uhoh\");\n if (!destinationFound) {\n alreadyCheckedAbilities.add(ability.name);\n pathArrayCopy.push(ability.name);\n console.log(pathArrayCopy);\n return pokePath(\n origin,\n destination,\n pathArrayCopy,\n alreadyCheckedPokemon,\n alreadyCheckedAbilities,\n solutionPaths\n );\n }\n return solutionPaths;\n\n //const pokemonWithSlam = await getAllPokemonWithAbility(\"lightning-rod\");\n //console.log(pokemonWithSlam);\n}", "title": "" }, { "docid": "0d7f4f3662c175afbc7a5ddba60f9a5e", "score": "0.47933725", "text": "LogicalExpression(path, state) {\n instrumentExpression(path.get('left'), state, ['branch']);\n instrumentExpression(path.get('right'), state, ['branch']);\n instrumentExpression(path, state);\n }", "title": "" }, { "docid": "58e642579a06b7e621640a35c8409f92", "score": "0.47829232", "text": "getallpathhelper(a,b,k,visited)\n {\n if(b==k)\n { //if b==destination then we found our destination so returning true and destination\n return [true,[[k]]]\n }\n \n visited[b]=true\n var mainbool=false\n var mainlis=[] \n \n for(let i=0;i<this.nvertices;i++)\n { \n if(visited[i]==false && this.adjmatrix[b][i]!=null)\n {\n var check=this.getallpathhelper(b,i,k,visited);\n mainbool=( check[0] || mainbool);\n \n if(check[0])\n {\n for(let i of check[1])\n { \n i.push(b)\n mainlis.push(i)\n }\n } \n } \n }\n return [mainbool,mainlis]\n }", "title": "" }, { "docid": "147c454c16f427d6d1a14df904140f34", "score": "0.47621343", "text": "function checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n if (nodeSupportsBigInt()) {\n fs.stat(destParent, { bigint: true }, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n })\n } else {\n fs.stat(destParent, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n })\n }\n}", "title": "" }, { "docid": "147c454c16f427d6d1a14df904140f34", "score": "0.47621343", "text": "function checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n if (nodeSupportsBigInt()) {\n fs.stat(destParent, { bigint: true }, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n })\n } else {\n fs.stat(destParent, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n })\n }\n}", "title": "" }, { "docid": "147c454c16f427d6d1a14df904140f34", "score": "0.47621343", "text": "function checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n if (nodeSupportsBigInt()) {\n fs.stat(destParent, { bigint: true }, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n })\n } else {\n fs.stat(destParent, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n })\n }\n}", "title": "" }, { "docid": "147c454c16f427d6d1a14df904140f34", "score": "0.47621343", "text": "function checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n if (nodeSupportsBigInt()) {\n fs.stat(destParent, { bigint: true }, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n })\n } else {\n fs.stat(destParent, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n })\n }\n}", "title": "" }, { "docid": "66e87435e426bee212721dd16c02383d", "score": "0.47593927", "text": "function test0() {\n function leaf() {\n }\n var obj0 = {};\n var obj1 = {};\n var arrObj0 = {};\n var func1 = function () {\n (function () {\n while (this) {\n arrObj0.prop5 = { 6: arrObj0.prop1 };\n for (; arrObj0.prop5.prop1; i32) {\n }\n if (78) {\n leaf(arguments);\n break;\n }\n }\n }());\n };\n var func2 = function () {\n eval();\n };\n obj0.method0 = func1;\n obj0.method1 = obj0.method0;\n obj1.method1 = obj0.method1;\n var ary = Array();\n var i32 = new Int32Array();\n arrObj0.prop1 = -195;\n obj0.method0();\n function v37() {\n for (var __loopvar1001 = 7; obj1.method1() ;) {\n }\n }\n var v44 = v37();\n}", "title": "" }, { "docid": "56698a0e5d0ad761dfce8909a06658b7", "score": "0.47571465", "text": "ConditionalExpression(path, state) {\n instrumentExpression(path.get('consequent'), state, ['branch']);\n instrumentExpression(path.get('alternate'), state, ['branch']);\n instrumentExpression(path, state);\n }", "title": "" }, { "docid": "db38eddd419f863efafa5df3a17d0df9", "score": "0.47493035", "text": "getPpath(b) {\n return b;\n }", "title": "" }, { "docid": "9857c63c3a509e44671c21baf90d7375", "score": "0.47482973", "text": "function BCS() {\n\t\t\t\t\tbranch(flagC);\n\t\t\t\t}", "title": "" }, { "docid": "32db23e8d7ca9c45234abd161a70adc3", "score": "0.4733628", "text": "function pathBuilder(states, next, stack = [], undo) {\n stack.push(next);\n const v = find(values(states[next]), a => !includes(stack, a));\n // dead end\n if (!v) {\n if (undo) return undo();\n // we've come back to the beginning and have no more paths to follow\n // remove duplicates from end of stack\n return arrayRemoveRight(stack, a => count(stack, a) > 1);\n }\n return pathBuilder(states, v, stack, () =>\n pathBuilder(states, next, stack, undo)\n );\n}", "title": "" }, { "docid": "03bd5ad5dae96dc50693f0b715ccd048", "score": "0.47209364", "text": "function preprocess_sol(build_env, input_dir) {\n input_dir = filepath.create(input_dir);\n input_dir.recurse(file => {\n if (file.extname() != \".sol\") return;\n //copy if source is newer\n var input_rel_path = input_dir.relative(file.toString());\n var solfile = output_dir.resolve(input_rel_path);\n if (canSkip(solfile, file)) return;\n solfile.dir().mkdir();\n fs.copyFileSync(file.toString(), solfile.toString());\n });\n}", "title": "" }, { "docid": "7d86bb3c83d1b9632e1c7bfdbd78c0cc", "score": "0.4719949", "text": "findPath() {\n let openList = [this.auxMap[this.S[0]][this.S[1]]];\n let closedList = [];\n\n while (openList.length > 0) {\n openList.forEach(element => element.f = element.distanceFromStart + element.h);\n openList.sort((a, b) => (a.f < b.f) ? 1 : -1);\n let currentNode = openList.pop();\n if (currentNode.x == this.F[0] && currentNode.y == this.F[1]) {\n this.auxMap[currentNode.x][currentNode.y] = currentNode;\n break;\n }\n this.auxMap[currentNode.x][currentNode.y] = currentNode;\n let adjacentNodes = this.map.getAdjacentNodes([currentNode.x, currentNode.y]);\n for (let i in adjacentNodes) {\n let successor_current_cost = currentNode.distanceFromStart + this.cost(currentNode.x, currentNode.y);\n let adj = this.auxMap[adjacentNodes[i][0]][adjacentNodes[i][1]];\n if (openList.map(x => { return x.id; }).indexOf(adj.id) != -1 && adj.distanceFromStart <= successor_current_cost)\n continue;\n else if (closedList.map(x => { return x.id; }).indexOf(adj.id) != -1) {\n if (adj.distanceFromStart <= successor_current_cost)\n continue;\n let index = closedList.map(x => { return x.id; }).indexOf(adj.id);\n closedList.splice(index, 1);\n openList.unshift(adj);\n }\n else {\n adj.h = this.heuristic(adj.x, adj.y, this.F);\n openList.unshift(adj);\n }\n adj.distanceFromStart = successor_current_cost;\n adj.parent = currentNode;\n this.auxMap[adj.x][adj.y] = adj;\n }\n closedList.unshift(currentNode);\n }\n\n let c = [this.F[0], this.F[1]];\n while (this.auxMap[c[0]][c[1]].parent != null) {\n this.path.unshift([c[0], c[1]]);\n let x = this.auxMap[c[0]][c[1]].parent.x;\n let y = this.auxMap[c[0]][c[1]].parent.y;\n c[0] = x;\n c[1] = y;\n }\n this.path.unshift([this.S[0], this.S[1]]);\n }", "title": "" }, { "docid": "6a1083a2a26d5730e0bba939674ac879", "score": "0.47197315", "text": "joinPaths(paths, threshold = 0.01, active_path_index = 0, iteration = 0) {\n\n let PathHelp = new PathHelper();\n\n // Set border parameters\n let min_x = -5/3\n let max_x = 5/3\n let min_y = -1\n let max_y = 1\n\n let debug = false\n\n // Bail if iterations exceeded\n iteration++\n if (debug) { console.log('---------------------') }\n if (debug) { console.log('Iteration:', iteration) }\n\n let path_index = active_path_index\n let distance\n\n // Check for completion of multiple closed loops\n for (let i = path_index; i < paths.length; i++) {\n let path_closed = false\n if (debug) { console.log('path_index:', path_index) }\n\n // Calculate distance between first and last point of target path\n distance = PathHelp.distance(paths[path_index][0], paths[path_index][paths[path_index].length-1])\n\n // If distance is below threshold, then the path should be considered a closed loop\n if (distance < threshold) {\n path_closed = true\n }\n\n // If the path is a closed loop, then increment the index to look at the next path\n // as the target path\n if (path_closed) {\n if (debug) { console.log('Path ' + path_index + ' closed.') }\n path_index++\n if (debug) { console.log('New Path Index: ' + path_index) }\n continue\n }\n break\n }\n\n if (debug) { console.log('selected path_index:', path_index) }\n if (debug) { console.log('paths.length:', paths.length) }\n\n // Exit function if the last path is closed\n if (path_index == paths.length) {\n return paths;\n }\n\n // Last point of the target path on which to join other paths\n let last_point = paths[path_index][paths[path_index].length - 1];\n\n // Check remaining paths\n // console.log('paths.length', paths.length)\n let overlap_count = 0\n for (let i = 0; i < paths.length; i++) {\n\n // Skip self\n if (i == path_index) {\n continue;\n }\n\n // Check last point of target path against first point of other paths\n distance = PathHelp.distance(last_point, paths[i][0])\n\n if (distance < threshold) {\n // console.log(last_point, paths[i][0], distance, paths[i]);\n overlap_count++\n // console.log('before:', paths[0])\n paths[path_index] = paths[path_index].concat(paths[i].slice(1))\n // console.log('after:', paths[0])\n\n // remove from paths\n paths.splice(i, 1);\n break\n }\n\n // Check last point of target path against last point of other paths\n distance = PathHelp.distance(last_point, paths[i][paths[i].length-1])\n if (distance < threshold) {\n // console.log(last_point, paths[i][0], distance);\n overlap_count++\n paths[path_index] = paths[path_index].concat(paths[i].reverse().slice(1))\n\n // remove from paths\n paths.splice(i, 1);\n break\n }\n\n // Check first point of target path against first point of other paths\n distance = PathHelp.distance(paths[path_index][0], paths[i][0])\n if (distance < threshold) {\n overlap_count++\n paths[path_index] = paths[i].reverse().concat(paths[path_index])\n paths.splice(i, 1);\n break\n }\n\n // Check first point of target path against last point of other paths\n distance = PathHelp.distance(paths[path_index][0], paths[i][paths[i].length-1])\n if (distance < threshold) {\n overlap_count++\n paths[path_index] = paths[i].concat(paths[path_index])\n paths.splice(i, 1);\n break\n }\n\n }\n\n if (debug) { console.log(\"Overlap Count\", overlap_count) }\n\n // Exit function if the last path is closed\n if (path_index == paths.length) {\n return paths;\n }\n\n // Check to see if both ends of the current path terminate on\n // the edge of the drawing area\n let first_point = paths[path_index][0];\n last_point = paths[path_index][paths[path_index].length - 1];\n let on_border = false;\n if (!on_border) {\n distance = PathHelp.distance(last_point, [min_x, last_point[1]])\n if (distance < threshold) {\n on_border = true\n }\n }\n if (!on_border) {\n distance = PathHelp.distance(last_point, [max_x, last_point[1]])\n if (distance < threshold) {\n on_border = true\n }\n }\n if (!on_border) {\n distance = PathHelp.distance(last_point, [last_point[0], min_y])\n if (distance < threshold) {\n on_border = true\n }\n }\n if (!on_border) {\n distance = PathHelp.distance(last_point, [last_point[0], max_y])\n if (distance < threshold) {\n on_border = true\n }\n }\n\n // Check the beginning of the path only if the end of the path is\n // on the border\n if (on_border) {\n distance = PathHelp.distance(first_point, [min_x, first_point[1]])\n if (distance > threshold) {\n on_border = false\n }\n }\n if (on_border) {\n distance = PathHelp.distance(first_point, [max_x, first_point[1]])\n if (distance > threshold) {\n on_border = false\n }\n }\n if (on_border) {\n distance = PathHelp.distance(first_point, [first_point[0], min_y])\n if (distance > threshold) {\n on_border = false\n }\n }\n if (on_border) {\n distance = PathHelp.distance(first_point, [first_point[0], max_y])\n if (distance > threshold) {\n on_border = false\n }\n }\n\n // If the targe path is closed or on the border go to next path\n if (overlap_count == 0 || on_border) {\n active_path_index++\n }\n\n paths = this.joinPaths(paths, threshold, active_path_index, iteration)\n\n return paths\n }", "title": "" }, { "docid": "98825bafe7c006aa161802f2e3806e10", "score": "0.47167343", "text": "function foo(a, b) {\n if (a == 0) {\n return 42;\n }\n\n if (a == 1) {\n return foo(a - 1);\n }\n\n if (a == 2) {\n return foo(b - 1, a);\n }\n\n return foo(b - 1, a, 43);\n} // Same deal as foo, just with an inlining thrown into the mix.", "title": "" }, { "docid": "ce1df8fba76a6bc4bfaa0bf8a67113f9", "score": "0.47109178", "text": "return process.cwd();\n } else {\n // find the common path parts.\n let curParts = cur.dir.split(path.sep);\n let newParts = parsed.dir.split(path.sep);\n let len = Math.min(curParts.length, newParts.length);\n let i = 0;\n while (i < len && curParts[i] === newParts[i]) {\n i++;\n }\n\n cur.dir = i > 1 ? curParts.slice(0, i).join(path.sep) : cur.root;\n }", "title": "" }, { "docid": "46327e4bcad18f0ce31facf9182260ec", "score": "0.47101176", "text": "function checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src));\n const destParent = path.resolve(path.dirname(dest));\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n if (nodeSupportsBigInt()) {\n gracefulFs.stat(destParent, { bigint: true }, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n });\n } else {\n gracefulFs.stat(destParent, (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n });\n }\n}", "title": "" }, { "docid": "2701d545fb07ddfe4cf7d660e3f3cced", "score": "0.4708915", "text": "optimizePathTopology(navquery, filter) {\n\t\t\t\tif (this.m_path.length < 3)\n\t\t\t\t\treturn false;\n\n\t\t\t\tlet MAX_ITER = 32;\n\n\t\t\t\tnavquery.initSlicedFindPath(this.m_path[0], this.m_path[this.m_path.length - 1], this.m_pos, this.m_target, filter, 0);\n\t\t\t\tnavquery.updateSlicedFindPath(MAX_ITER);\n\t\t\t\tlet fpr = navquery.finalizeSlicedFindPathPartial(this.m_path);\n\n\t\t\t\tif (fpr.getStatus().isSuccess() && fpr.getRefs().length > 0) {\n\t\t\t\t\tthis.m_path = mergeCorridorStartShortcut(this.m_path, fpr.getRefs());\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}", "title": "" }, { "docid": "512f3e3c05910f4ace59067e77cc27f8", "score": "0.47009587", "text": "function follow_path(start_key, from_key, to_key, multiplier, path, sources) {\n // Multiplier is the constant computed so far\n // Want from_key to stay constant as we traverse, passing through iteratively updated multiplier\n // Intermediate from_keys will be picked up on a different start_key iteration\n\n // Prevent circular chains by keeping track of path taken\n path.push(from_key)\n\n if (to_key in constants) { // then to_key is also a from_key and chaining is possible\n\n // Update multiplier with current conversion\n multiplier = multiplier * constants[from_key][to_key][\"conversion\"]\n\n let conversions = constants[to_key]\n\n new_constants[from_key] = new_constants[from_key] || {}\n new_constants[from_key][to_key] = new_constants[from_key][to_key] || {}\n\n\n\n Object.keys(conversions).forEach(inner_key => {\n\n let new_sources = [...sources]\n // To prevent 'circular' conversions e.g. litres_petrol -> joules -> litres_jet_fuel -> joules\n if (!(path.includes(inner_key))) {\n\n if (!(inner_key in constants[start_key])) { //If there isn't already a entry for this inner_key\n\n new_constants[start_key][inner_key] = shallow_copy(template_dict)\n new_constants[start_key][inner_key][\"conversion\"] = multiplier * constants[to_key][inner_key][\"conversion\"]\n\n new_sources = [...new_sources, ...constants[to_key][inner_key][\"sources\"]]\n\n new_constants[start_key][inner_key][\"sources\"] = new_sources\n\n follow_path(start_key, to_key, inner_key, multiplier, [...path], [...new_sources])\n\n }\n }\n });\n }\n}", "title": "" }, { "docid": "3f2808180ba6ffe3da51468404424087", "score": "0.46822062", "text": "SwitchCase(path, state) {\n instrumentBlock('consequent', path, state, ['branch']);\n }", "title": "" }, { "docid": "95aa9a4e127f7b73eded9a5db826d499", "score": "0.4666158", "text": "pointsToPaths(paths, points, active_path_index = 0, threshold) {\n\n // Escape recursion (Chrome is having a \"Maximum call stack size exceeded\" error)\n // here where Safari and Firefox are not\n if (points.length == 0) {\n return paths\n }\n\n // Loop through all points and identify candidate points within\n // the distance threshold\n let distance;\n let candidates = new Array();\n for (let p = 0; p < points.length; p++) {\n\n let active_path_last_point_index = paths[active_path_index].length - 1\n distance = this.distance(\n paths[active_path_index][active_path_last_point_index],\n points[p]\n )\n\n if (distance < threshold) {\n candidates.push({\n \"point\" : p,\n \"distance\" : distance\n })\n }\n }\n\n if (candidates.length > 0) {\n\n // Sort points by distance, favor by index if distances are equal\n // https://flaviocopes.com/how-to-sort-array-of-objects-by-property-javascript/\n candidates.sort(\n (a, b) => (a.distance > b.distance) ? 1 : (a.distance === b.distance) ? ((a.point > b.point) ? 1 : -1) : -1\n )\n\n // Add the nearest point as the next point in the path\n let nearest_point_index = candidates[0].point\n let nearest_point = points[nearest_point_index]\n paths[active_path_index].push(nearest_point)\n\n // Remove the point from available points\n points.splice(nearest_point_index, 1);\n\n } else {\n\n // If no points are within the threshold then start a new path\n paths.push([\n points.shift()\n ])\n active_path_index++\n }\n\n paths = this.pointsToPaths(paths, points, active_path_index, threshold)\n\n return paths;\n }", "title": "" }, { "docid": "78215e77619e6b678b1cb32b3b3f78f9", "score": "0.46642172", "text": "function buildingRestriction(x, y, limit){\n\n for(var i = 0; i < mapNodes.length - 1; i++){\n\n /* Condition variables declared here to save space */\n\n var pathBoundaryX1 = mapNodes[i + 1].x - ctx.lineWidth/2 - limit - pathPadding;\n var pathBoundaryX2 = mapNodes[i].x + ctx.lineWidth/2 + limit + pathPadding;\n\n var pathBoundaryY1 = mapNodes[i + 1].y - ctx.lineWidth/2 - limit - pathPadding;\n var pathBoundaryY2 = mapNodes[i].y + ctx.lineWidth/2 + limit + pathPadding;\n\n /* ---------------- */\n\n if(x > pathBoundaryX1 && x < pathBoundaryX2\n && y > pathBoundaryY1 && y < pathBoundaryY2){\n return true;\n }\n }\n\n for(var i = 1; i < mapNodes.length; i++){\n\n /* Condition variables declared here to save space */\n\n var pathBoundaryX12 = mapNodes[i - 1].x - ctx.lineWidth/2 - limit - pathPadding;\n var pathBoundaryX22 = mapNodes[i].x + ctx.lineWidth/2 + limit + pathPadding;\n\n var pathBoundaryY12 = mapNodes[i - 1].y - ctx.lineWidth/2 - limit - pathPadding;\n var pathBoundaryY22 = mapNodes[i].y + ctx.lineWidth/2 + limit + pathPadding;\n\n /* ---------------- */\n\n if(x > pathBoundaryX12 && x < pathBoundaryX22\n && y > pathBoundaryY12 && y < pathBoundaryY22){\n return true;\n }\n }\n\n for(var i = 0; i < towers.length; i++){\n\n /* Condition variables declared here to save space */\n\n var towerBoundaryX1 = towers[i].x - limit/2;\n var towerBoundaryX2 = towers[i].x + towers[i].bodySize/2 + limit;\n\n var towerBoundaryY1 = towers[i].y - limit/2;\n var towerBoundaryY2 = towers[i].y + towers[i].bodySize/2 + limit;\n\n /* ---------------- */\n\n if(x > towerBoundaryX1 && x < towerBoundaryX2\n && y > towerBoundaryY1 && y < towerBoundaryY2){\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "ef7cbdd507abcb3a3bbfa9fbe7e40e1b", "score": "0.4637317", "text": "function preProcessPaths(paths) {\n Object.values(paths).forEach((pathValue) => {\n if (pathValue.parameters) {\n Object.keys(pathValue).forEach((key) => {\n if (key === \"parameters\")\n return;\n const method = pathValue[key];\n method.parameters = method.parameters.concat(pathValue.parameters);\n });\n }\n delete pathValue.parameters;\n });\n return paths;\n}", "title": "" }, { "docid": "8dfab22e455da2d6428010e092c2c421", "score": "0.46320602", "text": "function a(e,t){var a={};return e.path?(n.i(r.b)(e.path).forEach(function(e){Object.prototype.hasOwnProperty.call(t,e)&&(a[e]=t[e])}),a):a}", "title": "" }, { "docid": "8a5f4ca778b37c2f28615505370ead86", "score": "0.46249875", "text": "function getBranches() {\n // return ['00300236'];\n return [\n '00109980',\n '00110221',\n '00123402',\n '00123532',\n '00123612',\n '00139330',\n '00300002',\n '00300114',\n '00300236',\n '00300445',\n '00300934',\n '00301082',\n '00301312',\n '00301434',\n '00301762',\n '00301822',\n '00301872',\n '00301922',\n '00301942',\n '00301952',\n '00302162',\n '00302722',\n '00302874',\n '00303404',\n '00303638',\n '00304958',\n '00305092',\n '00305178',\n '00305204',\n '00305261',\n '00305288',\n '00305341',\n '00305572',\n '00305714',\n '00306012',\n '00306142',\n '00306176',\n '00306702',\n '00306722',\n '00307373',\n '00307818',\n '00308002',\n '00308538',\n '00308918',\n '00419682',\n '00434482',\n '00460647',\n '00600221',\n '00600261',\n '00600381',\n '00600441',\n '00600451',\n '00600491',\n '00600701',\n '00600791',\n '00600851',\n '00600891',\n '00600981',\n '00601071',\n '00601081',\n '00601101',\n '00601141',\n '00601311',\n '00601351',\n '00601371',\n '00601591',\n '00601711',\n '00601761',\n '00601821',\n '00601861',\n '00601921',\n '00601971',\n '00602091',\n '00602111',\n '00602121',\n '00602221',\n '00602291',\n '00602351',\n '00602391',\n '00602421',\n '00602551',\n '00602671',\n '00602691',\n '00602731',\n '00602961',\n '00602971',\n '00603891',\n '00604081',\n '00604271',\n '00604431',\n '00604501',\n '00604721',\n '00604801',\n '00606021',\n '00606071',\n '00606091',\n '00606211',\n '00606221',\n '00606291',\n '00606361',\n '00606371',\n '00606471',\n '00606571',\n '00606751',\n '00606771',\n '00606781',\n '00606801',\n '00606811',\n '00606831',\n '00606841',\n '00606851',\n '00606871',\n '00607101',\n '00607111',\n '00607121',\n '00607131',\n '00607141',\n '00607661',\n '00607701',\n '00607711',\n '00607721',\n '00607731',\n '00607741',\n '00607751',\n '00607761',\n '00607771',\n '00608911',\n '00609341',\n '00609371',\n '00609451',\n '00609501',\n '00609511',\n '00609521',\n '00609531',\n '00609541',\n '00609551',\n '00609561',\n '00609571',\n '00609581',\n '00609591',\n '00609911',\n '00609951',\n '00609971',\n '00610351',\n '00610421',\n '00610861',\n '00610871',\n '00611141',\n '00611341',\n '00611381',\n '00611501',\n '00611521',\n '00611661',\n '00611741',\n '00611751',\n '00611781',\n '00611941',\n '00611951',\n '00612031',\n '00612161',\n '00612211',\n '00612341',\n '00612601',\n '00612611',\n '00612721',\n '00612821',\n '00613371',\n '00613511',\n '00613521',\n '00613581',\n '00613641',\n '00613681',\n '00613701',\n '00614191',\n '00614641',\n '00619141',\n '01000002',\n '01000004',\n '01000028',\n '01000039',\n '01000047',\n '01000059',\n '01000060',\n '01000067',\n '01000068',\n '01000080',\n '01000083',\n '01000107',\n '01000122',\n '01000132',\n '01000209',\n '01000260',\n '01000271',\n '01000302',\n '01000319',\n '01000329',\n '01000339',\n '01000363',\n '01000370',\n '01000449',\n '01000450',\n '01000479',\n '01000492',\n '01000497',\n '01000500',\n '01000573',\n '01000600',\n '01000642',\n '01000739',\n '01000902',\n '01000919',\n '01001018',\n '01001072',\n '01001138',\n '01001331',\n '01001732',\n '01001742',\n '01001800',\n '01001902',\n '01002040',\n '01002099',\n '01002642',\n '01002769',\n '01003000',\n '01003022',\n '01003552',\n '01003892',\n '01003999',\n '01004959',\n '01005008',\n '01005252',\n '01005652',\n '01006042',\n '01007040',\n '01007672',\n '01008089',\n '01008542',\n '01008732',\n '01008910',\n '01009812',\n '01610930',\n '03900301',\n '03900771',\n '03901181',\n '03904221',\n '03905311',\n '23900062',\n '23900122',\n '23900276',\n '81580001',\n '81580012',\n '81592154',\n // '81900267',\n '81900967',\n '82802562',\n '82806222',\n '82806322',\n '82817102',\n '82821962',\n '82862212',\n '82862302',\n '82900303',\n '83400012',\n '83700282',\n '83700612',\n '83700622',\n '83700632',\n '83700642',\n '83700652',\n '83700662',\n '83700672',\n '83700682',\n '83700692',\n '83700702',\n '83700712',\n '83700742',\n '83700782',\n '83700792',\n '83700802',\n '83762022',\n '83907013',\n '83933373',\n '83963503',\n '84200646',\n '86500484',\n '87900317',\n '87900737',\n '87952407',\n '88903178',\n '88912468',\n '88952688',\n '88953538',\n '88992478',\n '89013352',\n '89901849',\n ];\n}", "title": "" }, { "docid": "70f06cae9f195a2836a7f262812029cd", "score": "0.46168268", "text": "checkLoop(): Object {\n const state = {\n hasBreakContinue: false,\n ignoreLabeless: false,\n inSwitchCase: false,\n innerLabels: [],\n hasReturn: false,\n isLoop: !!this.loop,\n map: {},\n LOOP_IGNORE: Symbol(),\n };\n\n this.blockPath.traverse(loopLabelVisitor, state);\n this.blockPath.traverse(loopVisitor, state);\n\n return state;\n }", "title": "" }, { "docid": "fa078535714f74f81bf5d40b7e1c4cb1", "score": "0.46146104", "text": "onCodePathEnd() {\n for (const node of scopeInfo.uselessReturns) {\n context.report({\n node,\n loc: node.loc,\n messageId: \"unnecessaryReturn\",\n\n fix(fixer) {\n if (isRemovable(node) && !sourceCode.getCommentsInside(node).length) {\n /*\n * Extend the replacement range to include the\n * entire function to avoid conflicting with\n * no-else-return.\n * https://github.com/eslint/eslint/issues/8026\n */\n return new FixTracker(fixer, sourceCode).retainEnclosingFunction(node).remove(node);\n }\n\n return null;\n }\n\n });\n }\n\n scopeInfo = scopeInfo.upper;\n }", "title": "" }, { "docid": "7d150e66062e411c8af2fbf592696ca7", "score": "0.4602154", "text": "findAltPaths(faultEdges){\n let valid = []\n for(let k=0;k<faultEdges.length;k++){\n let start = this.getVertex(0)\n let end1 = faultEdges[k][0]\n let end2 = faultEdges[k][1]\n let en2adjacent = end2.getAdjacent()\n let validAdjacent = []\n for(let i=0;i<en2adjacent.length;i++){\n let temp = en2adjacent[i][0]\n if(end2.getLineCurrent(temp)!==0){\n //console.log(temp.getNodeId()+\",\"+end2.getLineCurrent(temp))\n validAdjacent.push(temp)\n }\n }\n\n for(let i=0;i<validAdjacent.length;i++){\n let tempN = validAdjacent[i]\n if(tempN.getSwitchType()===\"Closed\"){\n return []\n }\n }\n\n //console.log(validAdjacent[0])\n let paths=[]\n for(let i=0;i<validAdjacent.length;i++){\n let temppaths = this.getAllPathsNew(start,validAdjacent[i])\n paths.push(temppaths)\n }\n\n\n //console.log(paths[0])\n // console.log(paths[1])\n let tempValid = []\n for(let l=0;l<paths.length;l++){\n for(let i=0;i<paths[l].length;i++){\n let path = paths[l][i]\n let found = false;\n for(let j=0;j<path.length;j++){\n let adjacent = path[j].getAdjacent()\n for(let k=0;k<adjacent.length;k++){\n let adjacentNode = adjacent[k][0]\n if((adjacentNode.getNodeId()===end1.getNodeId())||(adjacentNode.getNodeId()===end2.getNodeId())){\n found = true\n break;\n }\n }\n\n }\n if(!found){\n path.push(validAdjacent[l])\n tempValid.push(path)\n }\n }\n\n //console.log(tempValid)\n //console.log(\"++++++++++++++++++++++++++++\")\n }\n\n\n //console.log(tempValid.length)\n for(let i=0;i<tempValid.length;i++){\n let founds = false;\n let found2 = false;\n //console.log(tempValid[i].length)\n for(let j=2;j<tempValid[i].length-1;j++){\n let tmp1 = tempValid[i][j]\n let tmp2 = tempValid[i][j+1]\n //console.log(tmp1.getLineCurrent(tmp2)+\",\"+tmp1.getNodeId()+\",\"+tmp2.getNodeId())\n if(tmp1.getLineCurrent(tmp2)===0){\n founds = true;\n break;\n }\n }\n //checking that last node does not connected to a fault edge's node\n let last = tempValid[i][tempValid[i].length-1]\n let lastAdjacent = last.getAdjacent()\n //console.log(last.getNodeId())\n //console.log(lastAdjacent)\n // console.log(faultEdges[k][0])\n for(let j=0;j<lastAdjacent.length;j++){\n if(faultEdges[k][0]===lastAdjacent[j][0]){\n //console.log(\"Mathed\")\n found2=true;\n }\n }\n if(!founds && !found2){\n valid.push(tempValid[i])\n }\n }\n }\n\n\n console.log(\"++++++++++Valid recovery paths before checking Max current capacity++++++++++++++\")\n console.log(valid)\n valid = this.findMaxCurrentPath(valid)\n console.log(\"++++++++++Valid recovery paths after checking Max current capacity++++++++++++++\")\n console.log(valid)\n valid = this.findMaxVoltageDropPath(valid)\n console.log(\"++++++++++Valid recovery paths after checking Max voltage drop++++++++++++++\")\n console.log(valid)\n return valid\n }", "title": "" }, { "docid": "73c75b9345fd19d5c5308a02ab7bb555", "score": "0.45950434", "text": "hoist() {\n var compileNode, compileToFragments, target;\n this.hoisted = true;\n target = new HoistTarget(this);\n compileNode = this.compileNode;\n compileToFragments = this.compileToFragments;\n this.compileNode = function(o) {\n return target.update(compileNode, o);\n };\n this.compileToFragments = function(o) {\n return target.update(compileToFragments, o);\n };\n return target;\n }", "title": "" }, { "docid": "92bfe73df0f27bdd86b449b12765bf2b", "score": "0.45924217", "text": "init() {\n const flatTree = [];\n\n //\n for (var _iterator11 = this.tree.entries(), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) {\n var _ref13;\n\n if (_isArray11) {\n if (_i11 >= _iterator11.length) break;\n _ref13 = _iterator11[_i11++];\n } else {\n _i11 = _iterator11.next();\n if (_i11.done) break;\n _ref13 = _i11.value;\n }\n\n const _ref12 = _ref13;\n const key = _ref12[0];\n const info = _ref12[1];\n\n // decompress the location and push it to the flat tree. this path could be made\n const parts = [];\n const keyParts = key.split('#');\n const isWorkspaceEntry = this.workspaceLayout && keyParts[0] === this.workspaceLayout.virtualManifestName;\n\n // Don't add the virtual manifest (keyParts.length === 1)\n // or ws childs which were not hoisted to the root (keyParts.length === 2).\n // If a ws child was hoisted its key would not contain the virtual manifest name\n if (isWorkspaceEntry && keyParts.length <= 2) {\n continue;\n }\n\n for (let i = 0; i < keyParts.length; i++) {\n const key = keyParts.slice(0, i + 1).join('#');\n const hoisted = this.tree.get(key);\n invariant(hoisted, `expected hoisted manifest for \"${key}\"`);\n parts.push(this.config.getFolder(hoisted.pkg));\n parts.push(keyParts[i]);\n }\n\n // Check if the destination is pointing to a sub folder of the virtualManifestName\n // e.g. _project_/node_modules/workspace-aggregator-123456/node_modules/workspaceChild/node_modules/dependency\n // This probably happened because the hoister was not able to hoist the workspace child to the root\n // So we have to change the folder to the workspace package location\n if (this.workspaceLayout && isWorkspaceEntry) {\n const wspPkg = this.workspaceLayout.workspaces[keyParts[1]];\n invariant(wspPkg, `expected workspace package to exist for \"${keyParts[1]}\"`);\n parts.splice(0, 4, wspPkg.loc);\n } else {\n if (this.config.modulesFolder) {\n // remove the first part which will be the folder name and replace it with a\n // hardcoded modules folder\n parts.splice(0, 1, this.config.modulesFolder);\n } else {\n // first part will be the registry-specific module folder\n parts.splice(0, 0, this.config.lockfileFolder);\n }\n }\n\n const shallowLocs = [];\n info.shallowPaths.forEach(shallowPath => {\n const shallowCopyParts = parts.slice();\n shallowCopyParts[0] = this.config.cwd;\n if (this.config.modulesFolder) {\n //add back the module folder name for the shallow installation\n const treeEntry = this.tree.get(keyParts[0]);\n invariant(treeEntry, 'expected treeEntry for ' + keyParts[0]);\n const moduleFolderName = this.config.getFolder(treeEntry.pkg);\n shallowCopyParts.splice(1, 0, moduleFolderName);\n }\n\n if (shallowPath) {\n const targetWorkspace = this.config.focusedWorkspaceName;\n const treeEntry = this.tree.get(`${targetWorkspace}#${shallowPath}`) || this.tree.get(shallowPath);\n invariant(treeEntry, 'expected treeEntry for ' + shallowPath);\n const moduleFolderName = this.config.getFolder(treeEntry.pkg);\n shallowCopyParts.splice(1, 0, moduleFolderName, shallowPath);\n }\n shallowLocs.push(path.join(...shallowCopyParts));\n });\n\n const loc = path.join(...parts);\n flatTree.push([loc, info]);\n shallowLocs.forEach(shallowLoc => {\n const newManifest = (0, (_extends2 || _load_extends()).default)({}, info, { isShallow: true });\n flatTree.push([shallowLoc, newManifest]);\n });\n }\n\n // remove ignored modules from the tree\n const visibleFlatTree = [];\n for (var _iterator12 = flatTree, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) {\n var _ref15;\n\n if (_isArray12) {\n if (_i12 >= _iterator12.length) break;\n _ref15 = _iterator12[_i12++];\n } else {\n _i12 = _iterator12.next();\n if (_i12.done) break;\n _ref15 = _i12.value;\n }\n\n const _ref14 = _ref15;\n const loc = _ref14[0];\n const info = _ref14[1];\n\n const ref = info.pkg._reference;\n invariant(ref, 'expected reference');\n if (!info.isRequired) {\n info.addHistory('Deleted as this module was ignored');\n } else {\n visibleFlatTree.push([loc, info]);\n }\n }\n return visibleFlatTree;\n }", "title": "" }, { "docid": "2d1136ed6fa092b4e5a398ad6d9e18a1", "score": "0.45917913", "text": "function calculatePath(spritePositionX,spritePositionY,map,blockedLayer){\n pathList = new Array();\n console.log(blockedLayer);\n var tileWidth = map.tileWidth;\n var tileHeight = map.tileHeight;\n //Define 2d array that holds every tile in the map.\n var mapWidth = map.width;\n var mapHeight = map.height;\n var arr = new Array(mapWidth);\n for(var i = 0; i < arr.length; i++){\n arr[i] = new Array(mapHeight);\n }\n console.log(\"new array created...\");\n var openList = new Array();\n var closedList = new Array();\n //Now we get the tile that the player is on\n var playerTileX = Math.floor(spritePositionX / tileWidth);\n var playerTileY = Math.floor(spritePositionY / tileHeight);\n var endTileX = Math.floor(endPositionX / tileWidth);\n var endTileY = Math.floor(endPositionY / tileHeight);\n\n var playerTile = {\n x : playerTileX,\n y : playerTileY,\n G : 0,\n H : null,\n parent : null\n };\n var endTile = {\n x : endTileX,\n y : endTileY,\n G : 0,\n H : 0,\n parent : null\n };\n\n closedList.push(playerTile);\n\n //Now we start the loop...\n var currentTile = playerTile;\n while(currentTile != endTile){\n\n if(currentTile.x == endTile.x){\n if(currentTile.y == endTile.y){\n pathList = closedList;\n wait = false;\n return;\n }\n }\n var adjacentTiles = new Array(); //Array used for viable adjacent tiles\n //When the open list is empty...\n //Find all adjacent boxes to the currentBox\n var playerRightX = currentTile.x + 1;\n var playerLeftX = currentTile.x - 1;\n var playerTopX = currentTile.x;\n var playerBottomX = currentTile.x;\n var playerRightY = currentTile.y;\n var playerLeftY = currentTile.y;\n var playerTopY = currentTile.y + 1;\n var playerBottomY = currentTile.y - 1;\n\n var playerRightTile = {};\n playerRightTile.x = playerRightX;\n playerRightTile.y = playerRightY;\n playerRightTile.parent = currentTile;\n\n var playerLeftTile = {};\n playerLeftTile.x = playerLeftX;\n playerLeftTile.y = playerLeftY;\n playerLeftTile.parent = currentTile;\n\n var playerBottomTile = {};\n playerBottomTile.x = playerBottomX;\n playerBottomTile.y = playerBottomY;\n playerBottomTile.parent = currentTile;\n\n var playerTopTile = {};\n playerTopTile.x = playerTopX;\n playerTopTile.y = playerTopY;\n playerTopTile.parent = currentTile;\n\n checkIfBlocked(adjacentTiles,closedList,playerRightTile,map);\n checkIfBlocked(adjacentTiles,closedList,playerLeftTile,map);\n checkIfBlocked(adjacentTiles,closedList,playerTopTile,map);\n checkIfBlocked(adjacentTiles,closedList,playerBottomTile,map);\n var found = false;\n var foundPosition;\n var currentPosition;\n for(var i = 0; i < adjacentTiles.length; i++){\n var adjacentTile = adjacentTiles[i];\n for(var k = 0; k < openList.length; k++){\n if(adjacentTile.x == openList[k].x){\n if(adjacentTile.y == openList[k].y){\n found = true;\n foundPosition = k;\n currentPosition = i;\n break;\n }\n }\n }\n if(found == false){\n calculateG(adjacentTile);\n calculateH(adjacentTile, endTile);\n openList.push(adjacentTile);\n }else{\n //Check if the F score is lower using the current calculated path.\n var oldG = openList[foundPosition].G;\n var oldH = openList[foundPosition].H;\n calculateG(adjacentTiles[currentPosition]);\n calculateH(adjacentTiles[currentPosition], endTile);\n var currentG = adjacentTiles[currentPosition].G;\n var currentH = adjacentTiles[currentPosition].H;\n var oldF = oldG + oldH;\n var newF = currentG + currentH;\n if(newF < oldF){ //If the new path is shorter...\n //If it is, update its score and parent\n openList[foundPosition].G = adjacentTile.G + 1;\n openList[foundPosition].parent = adjacentTile.parent;\n }\n }\n found = false;\n }\n\n\n //Get the F from the openList that is the smallest\n //If 2 are equal, select the node that is last added to the list\n var smallestTile = null;\n for(var i = 0; i < openList.length; i++){\n var currentNodeInList = openList[i];\n var F = currentNodeInList.H + currentNodeInList.G;\n if(smallestTile == null){\n smallestTile = currentNodeInList;\n }else{\n var smallestF = smallestTile.H + smallestTile.G;\n if(F <= smallestF){\n smallestTile = currentNodeInList;\n }\n }\n }\n //Remove the smallest tile from the open list and add to the closed list\n var spliced = false\n for(var i = 0; i < openList.length; i++){\n var current = openList[i];\n if(current == smallestTile){\n openList.splice(i,1);\n spliced = true;\n }\n\n }\n closedList.push(smallestTile);\n currentTile = smallestTile;\n\n }\n\n\n //Now we need to calculate G and H\n //G == Movement cost from starting tile playerTile to this tile\n //H == Estimated movement cost from current tile to end tile\n //Movement cost == # of squares\n\n}", "title": "" }, { "docid": "efb6e6c156343a0a4ce8e60b5521e58e", "score": "0.45907485", "text": "function _guessExecutionStatusRelativeTo(target) {\n\t\t // check if the two paths are in different functions, we can't track execution of these\n\t\t var targetFuncParent = target.scope.getFunctionParent();\n\t\t var selfFuncParent = this.scope.getFunctionParent();\n\t\n\t\t // here we check the `node` equality as sometimes we may have different paths for the\n\t\t // same node due to path thrashing\n\t\t if (targetFuncParent.node !== selfFuncParent.node) {\n\t\t var status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent);\n\t\t if (status) {\n\t\t return status;\n\t\t } else {\n\t\t target = targetFuncParent.path;\n\t\t }\n\t\t }\n\t\n\t\t var targetPaths = target.getAncestry();\n\t\t if (targetPaths.indexOf(this) >= 0) return \"after\";\n\t\n\t\t var selfPaths = this.getAncestry();\n\t\n\t\t // get ancestor where the branches intersect\n\t\t var commonPath = /*istanbul ignore next*/void 0;\n\t\t var targetIndex = /*istanbul ignore next*/void 0;\n\t\t var selfIndex = /*istanbul ignore next*/void 0;\n\t\t for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) {\n\t\t var selfPath = selfPaths[selfIndex];\n\t\t targetIndex = targetPaths.indexOf(selfPath);\n\t\t if (targetIndex >= 0) {\n\t\t commonPath = selfPath;\n\t\t break;\n\t\t }\n\t\t }\n\t\t if (!commonPath) {\n\t\t return \"before\";\n\t\t }\n\t\n\t\t // get the relationship paths that associate these nodes to their common ancestor\n\t\t var targetRelationship = targetPaths[targetIndex - 1];\n\t\t var selfRelationship = selfPaths[selfIndex - 1];\n\t\t if (!targetRelationship || !selfRelationship) {\n\t\t return \"before\";\n\t\t }\n\t\n\t\t // container list so let's see which one is after the other\n\t\t if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) {\n\t\t return targetRelationship.key > selfRelationship.key ? \"before\" : \"after\";\n\t\t }\n\t\n\t\t // otherwise we're associated by a parent node, check which key comes before the other\n\t\t var targetKeyPosition = t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key);\n\t\t var selfKeyPosition = t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key);\n\t\t return targetKeyPosition > selfKeyPosition ? \"before\" : \"after\";\n\t\t}", "title": "" }, { "docid": "efb6e6c156343a0a4ce8e60b5521e58e", "score": "0.45907485", "text": "function _guessExecutionStatusRelativeTo(target) {\n\t\t // check if the two paths are in different functions, we can't track execution of these\n\t\t var targetFuncParent = target.scope.getFunctionParent();\n\t\t var selfFuncParent = this.scope.getFunctionParent();\n\t\n\t\t // here we check the `node` equality as sometimes we may have different paths for the\n\t\t // same node due to path thrashing\n\t\t if (targetFuncParent.node !== selfFuncParent.node) {\n\t\t var status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent);\n\t\t if (status) {\n\t\t return status;\n\t\t } else {\n\t\t target = targetFuncParent.path;\n\t\t }\n\t\t }\n\t\n\t\t var targetPaths = target.getAncestry();\n\t\t if (targetPaths.indexOf(this) >= 0) return \"after\";\n\t\n\t\t var selfPaths = this.getAncestry();\n\t\n\t\t // get ancestor where the branches intersect\n\t\t var commonPath = /*istanbul ignore next*/void 0;\n\t\t var targetIndex = /*istanbul ignore next*/void 0;\n\t\t var selfIndex = /*istanbul ignore next*/void 0;\n\t\t for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) {\n\t\t var selfPath = selfPaths[selfIndex];\n\t\t targetIndex = targetPaths.indexOf(selfPath);\n\t\t if (targetIndex >= 0) {\n\t\t commonPath = selfPath;\n\t\t break;\n\t\t }\n\t\t }\n\t\t if (!commonPath) {\n\t\t return \"before\";\n\t\t }\n\t\n\t\t // get the relationship paths that associate these nodes to their common ancestor\n\t\t var targetRelationship = targetPaths[targetIndex - 1];\n\t\t var selfRelationship = selfPaths[selfIndex - 1];\n\t\t if (!targetRelationship || !selfRelationship) {\n\t\t return \"before\";\n\t\t }\n\t\n\t\t // container list so let's see which one is after the other\n\t\t if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) {\n\t\t return targetRelationship.key > selfRelationship.key ? \"before\" : \"after\";\n\t\t }\n\t\n\t\t // otherwise we're associated by a parent node, check which key comes before the other\n\t\t var targetKeyPosition = t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key);\n\t\t var selfKeyPosition = t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key);\n\t\t return targetKeyPosition > selfKeyPosition ? \"before\" : \"after\";\n\t\t}", "title": "" }, { "docid": "efb6e6c156343a0a4ce8e60b5521e58e", "score": "0.45907485", "text": "function _guessExecutionStatusRelativeTo(target) {\n\t\t // check if the two paths are in different functions, we can't track execution of these\n\t\t var targetFuncParent = target.scope.getFunctionParent();\n\t\t var selfFuncParent = this.scope.getFunctionParent();\n\t\n\t\t // here we check the `node` equality as sometimes we may have different paths for the\n\t\t // same node due to path thrashing\n\t\t if (targetFuncParent.node !== selfFuncParent.node) {\n\t\t var status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent);\n\t\t if (status) {\n\t\t return status;\n\t\t } else {\n\t\t target = targetFuncParent.path;\n\t\t }\n\t\t }\n\t\n\t\t var targetPaths = target.getAncestry();\n\t\t if (targetPaths.indexOf(this) >= 0) return \"after\";\n\t\n\t\t var selfPaths = this.getAncestry();\n\t\n\t\t // get ancestor where the branches intersect\n\t\t var commonPath = /*istanbul ignore next*/void 0;\n\t\t var targetIndex = /*istanbul ignore next*/void 0;\n\t\t var selfIndex = /*istanbul ignore next*/void 0;\n\t\t for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) {\n\t\t var selfPath = selfPaths[selfIndex];\n\t\t targetIndex = targetPaths.indexOf(selfPath);\n\t\t if (targetIndex >= 0) {\n\t\t commonPath = selfPath;\n\t\t break;\n\t\t }\n\t\t }\n\t\t if (!commonPath) {\n\t\t return \"before\";\n\t\t }\n\t\n\t\t // get the relationship paths that associate these nodes to their common ancestor\n\t\t var targetRelationship = targetPaths[targetIndex - 1];\n\t\t var selfRelationship = selfPaths[selfIndex - 1];\n\t\t if (!targetRelationship || !selfRelationship) {\n\t\t return \"before\";\n\t\t }\n\t\n\t\t // container list so let's see which one is after the other\n\t\t if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) {\n\t\t return targetRelationship.key > selfRelationship.key ? \"before\" : \"after\";\n\t\t }\n\t\n\t\t // otherwise we're associated by a parent node, check which key comes before the other\n\t\t var targetKeyPosition = t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key);\n\t\t var selfKeyPosition = t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key);\n\t\t return targetKeyPosition > selfKeyPosition ? \"before\" : \"after\";\n\t\t}", "title": "" }, { "docid": "efb6e6c156343a0a4ce8e60b5521e58e", "score": "0.45907485", "text": "function _guessExecutionStatusRelativeTo(target) {\n\t\t // check if the two paths are in different functions, we can't track execution of these\n\t\t var targetFuncParent = target.scope.getFunctionParent();\n\t\t var selfFuncParent = this.scope.getFunctionParent();\n\t\n\t\t // here we check the `node` equality as sometimes we may have different paths for the\n\t\t // same node due to path thrashing\n\t\t if (targetFuncParent.node !== selfFuncParent.node) {\n\t\t var status = this._guessExecutionStatusRelativeToDifferentFunctions(targetFuncParent);\n\t\t if (status) {\n\t\t return status;\n\t\t } else {\n\t\t target = targetFuncParent.path;\n\t\t }\n\t\t }\n\t\n\t\t var targetPaths = target.getAncestry();\n\t\t if (targetPaths.indexOf(this) >= 0) return \"after\";\n\t\n\t\t var selfPaths = this.getAncestry();\n\t\n\t\t // get ancestor where the branches intersect\n\t\t var commonPath = /*istanbul ignore next*/void 0;\n\t\t var targetIndex = /*istanbul ignore next*/void 0;\n\t\t var selfIndex = /*istanbul ignore next*/void 0;\n\t\t for (selfIndex = 0; selfIndex < selfPaths.length; selfIndex++) {\n\t\t var selfPath = selfPaths[selfIndex];\n\t\t targetIndex = targetPaths.indexOf(selfPath);\n\t\t if (targetIndex >= 0) {\n\t\t commonPath = selfPath;\n\t\t break;\n\t\t }\n\t\t }\n\t\t if (!commonPath) {\n\t\t return \"before\";\n\t\t }\n\t\n\t\t // get the relationship paths that associate these nodes to their common ancestor\n\t\t var targetRelationship = targetPaths[targetIndex - 1];\n\t\t var selfRelationship = selfPaths[selfIndex - 1];\n\t\t if (!targetRelationship || !selfRelationship) {\n\t\t return \"before\";\n\t\t }\n\t\n\t\t // container list so let's see which one is after the other\n\t\t if (targetRelationship.listKey && targetRelationship.container === selfRelationship.container) {\n\t\t return targetRelationship.key > selfRelationship.key ? \"before\" : \"after\";\n\t\t }\n\t\n\t\t // otherwise we're associated by a parent node, check which key comes before the other\n\t\t var targetKeyPosition = t.VISITOR_KEYS[targetRelationship.type].indexOf(targetRelationship.key);\n\t\t var selfKeyPosition = t.VISITOR_KEYS[selfRelationship.type].indexOf(selfRelationship.key);\n\t\t return targetKeyPosition > selfKeyPosition ? \"before\" : \"after\";\n\t\t}", "title": "" }, { "docid": "b229295a062b158882206f87dedd61fc", "score": "0.45824718", "text": "function pathCalculate( _obj ){ \r\n// console.log( 'pathCalculate' );\r\n if( _obj.obj == undefined ||\r\n _obj.obj != undefined && _obj.obj.length == 0 ) return false;\r\n \r\n var new_obj = [], o = null;\r\n// console.log( 'pathCalculate' );\r\n for( var i in _obj.path ){\r\n o = new Object();\r\n o.op = _obj.path[i].op;\r\n o.path = [];\r\n \r\n// console.log( '--next--' );\r\n// console.log( '--len--' + _obj.path[i].path.length );\r\n \r\n for( var a = 0; a<_obj.path[i].path.length; a++){\r\n o.path[a] = Math.round(_obj.path[i].path[a]*map.scale*1000)/1000;\r\n// console.log( _obj.path[i].path[a]+' + '+o.path[a] );\r\n }\r\n \r\n new_obj.push( o );\r\n }\r\n// console.log('new_obj');\r\n// console.log(new_obj);\r\n var new_path = pathAssemble( new_obj );\r\n// console.log(new_path);\r\n $( _obj.obj ).attr('d',new_path);\r\n }", "title": "" }, { "docid": "01f6874347b6dd37fe8e350580c72c0f", "score": "0.45773858", "text": "function transplant(f, __trace) {\n return forkScopeWith(scope => f((e, __trace) => new _primitives.IOverrideForkScope(e, O.some(scope), __trace)), __trace);\n}", "title": "" }, { "docid": "81cda03fe05088025ad5dce35ff95d28", "score": "0.45766255", "text": "function walkToFinal(){\n //is this direction have barrier?no,go to;yes,search the other directions;\n if(coor[startPoint.y][startPoint.x+1]==0){\n startPoint.x++;\n stack.push({x:startPoint.x,y:startPoint.y});\n }else if(coor[startPoint.y+1][startPoint.x]==0){\n startPoint.y++;\n stack.push({x:startPoint.x,y:startPoint.y});\n }else if(coor[startPoint.y][startPoint.x-1]==0){\n startPoint.x--;\n console.log(startPoint.x);\n stack.push({x:startPoint.x,y:startPoint.y});\n }else if(coor[startPoint.y-1][startPoint.x]==0){\n startPoint.y--;\n stack.push({x:startPoint.x,y:startPoint.y});\n }else{//if can't find any path,then go back and look at some unknown path\n stack.pop();\n var temp=stack.top();\n if(temp!=null) {\n startPoint.x = temp.x;\n startPoint.y = temp.y;\n }else{ //if stack change to null that means,this maze does not have a useful path\n console.log('failed');\n isFinish=true;\n }\n }\n drawSmallBall(startPoint);\n coor[startPoint.y][startPoint.x]=-1;//we cannot walk to this point again\n if((startPoint.x==endPoint.x)&&(startPoint.y==endPoint.y)){//find the coorect path\n isFinish=true;\n drawFinalPath();\n //alert(\"**Success** find a route\");\n }\n}", "title": "" }, { "docid": "cbe608ddc681ce0b053bd7f91bf98bd5", "score": "0.45743808", "text": "function simplifyPath( path ) {\n\n\tconst tol = 5; // tolerance value in metres; the higher the value to greater the simplification\n const l_orig = path.points.length; // length of array to calculate compression ratio\n let i;\n let flag = true;\n let pd;\n\n\t// Repeat loop until no nodes are deleted\n\n while ( flag === true ) {\n\n i = 0;\n flag = false; // if remains true then simplification is complete; loop will break\n\n while ( i < ( path.points.length - 2 ) ) {\n pd = p2l( path.points[i].latLng, path.points[i+2].latLng, path.points[i+1].latLng );\n if ( Math.abs(pd) < tol ) {\n path.points.splice(i+1, 1);\n flag = true;\n }\n i++;\n }\n\n }\n\n //compression ration for info only\n console.log( 'Simplified path to: ' + ((path.points.length/l_orig)*100.0).toFixed(1) + '%');\n return path;\n\n }", "title": "" }, { "docid": "b85ad181aa7334bc4a955f0643e33b5c", "score": "0.45618063", "text": "[processBranches]() {\n\t\tconst self = this;\n\t\tlet branchWidth = 0;\n\t\tlet longestWidth = 0;\n\t\tlet branchWithLongestTitle;\n\n\t\tconst processLevel = (branches, depth) => {\n\t\t\tlet branchData;\n\t\t\tlet output = [];\n\n\t\t\tfor (let index = 0; index < branches.length; index++) {\n\t\t\t\tif (branches[index].isExpanded) {\n\t\t\t\t\tself[EXPANDED_BRANCHES].push(branches[index].id);\n\t\t\t\t\terase(branches[index], 'isExpanded');\n\t\t\t\t}\n\n\t\t\t\tbranchData = {\n\t\t\t\t\ticon: '',\n\t\t\t\t\t...branches[index],\n\t\t\t\t\tcss: set({}, PADDING_LEFT, depth ? ((depth * INDENT_PIXELS) + PIXELS) : EMPTY_STRING),\n\t\t\t\t\tisSelectable: self.isMultiSelect() || enforceBoolean(branches[index].isSelectable, false),\n\t\t\t\t\tisExpandable: branches[index].children !== undefined,\n\t\t\t\t\tisExpanded: self[EXPANDED_BRANCHES].includes(branches[index].id)\n\t\t\t\t};\n\n\t\t\t\tif (branchData.isExpandable) {\n\t\t\t\t\tself[SHOW_EXPANDERS] = true;\n\t\t\t\t}\n\t\t\t\tif (branchData.isSelectable) {\n\t\t\t\t\tself[SHOW_CHECKBOXES] = true;\n\t\t\t\t}\n\t\t\t\tif (branchData.isExpandable && branchData.isSelectable) {\n\t\t\t\t\tself[SHOW_CHECKBOXES_ON_GROUPS] = true;\n\t\t\t\t}\n\n\t\t\t\tbranchWidth = (branchData.title.length * AVERAGE_CHARACTER_WIDTH);\n\t\t\t\tbranchWidth += ((branchData.subTitle ? branchData.subTitle.length : 0) * AVERAGE_CHARACTER_WIDTH);\n\t\t\t\tbranchWidth += ((branchData.level || 0) * INDENT_PIXELS);\n\n\t\t\t\tif (branchWidth > longestWidth) {\n\t\t\t\t\tlongestWidth = branchWidth;\n\t\t\t\t\tbranchWithLongestTitle = branchData;\n\t\t\t\t}\n\n\t\t\t\toutput.push(branchData);\n\n\t\t\t\tif (branchData.isExpandable && branchData.isExpanded) {\n\t\t\t\t\toutput = output.concat(processLevel(branches[index].children, depth + 1));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn output;\n\t\t};\n\n\t\tself[SHOW_EXPANDERS] = false;\n\t\tself[SHOW_CHECKBOXES] = false;\n\t\tself[SHOW_CHECKBOXES_ON_GROUPS] = false;\n\n\t\tself[VIRTUAL_LIST].itemData(processLevel(self.branches(), 0));\n\n\t\tif (self.width().isAuto && branchWithLongestTitle) {\n\t\t\tself[preMeasureRowWidth](branchWithLongestTitle);\n\t\t}\n\t}", "title": "" }, { "docid": "d1863f29262fa60a7e03cbfe9a2dce65", "score": "0.45612958", "text": "function optimize(ast, defines, fn) {\n\ttry {\n\t\tplatformDefines = defines;\n\n\t\t// determine platform name from defines\n\t\tif (platformDefines.OS_IOS) { \n\t\t\tplatformName = 'iPhone OS'; \n\t\t\tplatformOsName = null;\n\t\t} else if (platformDefines.OS_ANDROID) { \n\t\t\tplatformOsName = platformName = 'android'; \n\t\t} else if (platformDefines.OS_MOBILEWEB) { \n\t\t\tplatformOsName = platformName = 'mobileweb'; \n\t\t} else {\n\t\t\tplatformName = platformOsName = null;\n\t\t}\n\n\t\t// walk the AST looking for ifs and vars\n\t\tvar w = pro.ast_walker();\n\t\treturn w.with_walkers({\n\t\t\t\t\"dot\": processObject,\n\t\t\t\t\"sub\": processObject\n\t\t}, function() {\n\t\t\treturn w.walk(ast);\n\t\t});\n\t} catch (e) {\n\t\tlogger.error('Error compiling source (' + fn + '). ' + e + '\\n' + e.stack);\n\t\treturn ast;\n\t}\n}", "title": "" }, { "docid": "968ec8cfee307fe0764ee397354f75f9", "score": "0.45603096", "text": "function isPathCode(name) {\n return /\\.[cm]?[jt]sx?$/.test(name);\n}", "title": "" }, { "docid": "1d6baa8225a911aa050e2040fec8857f", "score": "0.4550874", "text": "function replaceUnneededCode( str ) {\n\n\tstr = str.replace(\n\t\t/if \\( [^)]*node.continueGeneration \\)(.|\\n|\\r)*?}[\\r|\\n]/mg,\n\t\tmatch => {\n\n\t\t\tif ( match.indexOf( '/* skip */' ) !== - 1 ) {\n\n\t\t\t\treturn '';\n\n\t\t\t} else {\n\n\t\t\t\treturn 'let stride2Offset = stride4Offset * 2, ' +\n\t\t\t\t\t'float32Array = _float32Array, ' +\n\t\t\t\t\t'uint16Array = _uint16Array, ' +\n\t\t\t\t\t'uint32Array = _uint32Array;\\n';\n\n\t\t\t}\n\n\t\t}\n\n\t);\n\n\tstr = str.replace( /function intersectRay\\((.|[\\r\\n])*?}[\\r|\\n]/mg, '' );\n\n\tstr = str.replace( /import { arrayToBox.*?;[\\r\\n]/g, '' );\n\n\treturn str;\n\n}", "title": "" }, { "docid": "c99282634a22a788c0fe3481ca03a0b3", "score": "0.45500287", "text": "function source(path) {\n return path.getSource() || generate(path.node).code;\n}", "title": "" }, { "docid": "40947484cbeee8b31f15fda6396c841f", "score": "0.45482993", "text": "function statefulTraversal(ast) {\n const cache = [];\n const visitorUtility = {\n ClassDeclaration(path) {\n path.traverse({\n ClassBody(path) {\n path.traverse({\n ClassMethod(path) {\n path.traverse({\n BlockStatement(path) {\n path.traverse({\n ReturnStatement(path) {\n // console.log(path);\n path.traverse({\n JSXIdentifier(path) {\n cache.push(path);\n },\n });\n },\n });\n },\n });\n },\n });\n },\n });\n },\n };\n const newUtility = {\n // Only gets JSX Elements inside of a Class Declaration\n ClassDeclaration(path) {\n path.traverse({\n ClassBody(path) {\n path.traverse({\n ClassMethod(path) {\n path.traverse({\n BlockStatement(path) {\n path.traverse({\n ReturnStatement(path) {\n path.traverse({\n JSXElement(path) {\n if (\n !htmlElementsToIgnore[\n path.node.openingElement.name.name\n ] &&\n path.parent.type !== 'CallExpression'\n ) {\n cache.push(path.node.openingElement.name.name);\n }\n },\n });\n },\n });\n },\n });\n },\n });\n },\n });\n },\n // JSXElement(path) {\n // if (\n // !htmlElementsToIgnore[path.node.openingElement.name.name] &&\n // path.parent.type !== 'CallExpression'\n // ) {\n // cache.push(path.node.openingElement.name.name);\n // }\n // },\n };\n // console.log(ast);\n traverse(ast, {\n enter(path) {\n // path.traverse(visitorUtility);\n path.traverse(newUtility);\n },\n });\n return cache;\n}", "title": "" }, { "docid": "e8419c32d162bb7465c52f32231e05e3", "score": "0.4539501", "text": "function resolveCommonPaths(decisions) {\r\n for (let md of decisions) {\r\n let diffs = md.diffs;\r\n let path = md.absolutePath || [];\r\n let popped = popPath(diffs, true);\r\n while (popped) {\r\n path.push(popped.key);\r\n diffs = popped.diffs;\r\n popped = popPath(diffs, true);\r\n }\r\n md.absolutePath = path;\r\n md.diffs = diffs;\r\n }\r\n}", "title": "" }, { "docid": "ab7d739085feb29a325dab19669949ec", "score": "0.45309827", "text": "function reconstruct_path(parNode, currNode, gCost){\n // console.log(parNode);\n // console.log('path is found');\n jarak = gCost.get(currNode);\n total_path = [currNode];\n while(parNode.has(currNode)){\n currNode = parNode.get(currNode);\n total_path.unshift(currNode);\n }\n return [total_path, jarak];\n}", "title": "" }, { "docid": "a29451f2fa166b433e44c0adfe831e5a", "score": "0.4525357", "text": "function computeProofBitstrings(gindex) {\n const path = new Set();\n const branch = new Set();\n let g = gindex;\n while (g.length > 1) {\n path.add(g);\n const lastBit = g[g.length - 1];\n const parent = g.substring(0, g.length - 1);\n branch.add(parent + (Number(lastBit) ^ 1));\n g = parent;\n }\n return { path, branch };\n}", "title": "" }, { "docid": "0bafdce351a19b2f73b99796682afabc", "score": "0.4524461", "text": "exit(path) {\n // This hurts gzip size.\n if (!this.optimizeRawSize) {\n return;\n }\n\n const { node, scope } = path;\n const seen = new Set();\n const declars = [];\n const mutations = [];\n for (const name in scope.bindings) {\n const binding = scope.bindings[name];\n if (!binding.path.isVariableDeclarator()) {\n continue;\n }\n\n const declarPath = binding.path.parentPath;\n if (seen.has(declarPath)) {\n continue;\n }\n seen.add(declarPath);\n\n if (declarPath.parentPath.isForInStatement()) {\n continue;\n }\n\n if (declarPath.parentPath.parentPath.isFunction()) {\n continue;\n }\n\n if (!declarPath.node || !declarPath.node.declarations) {\n continue;\n }\n\n const assignmentSequence = [];\n for (const declar of declarPath.node.declarations) {\n declars.push(declar);\n if (declar.init) {\n assignmentSequence.push(\n t.assignmentExpression(\"=\", declar.id, declar.init)\n );\n mutations.push(() => {\n declar.init = null;\n });\n }\n }\n\n if (assignmentSequence.length) {\n mutations.push(() =>\n declarPath.replaceWith(t.sequenceExpression(assignmentSequence))\n );\n } else {\n mutations.push(() => removeOrVoid(declarPath));\n }\n }\n\n if (declars.length) {\n mutations.forEach(f => f());\n for (const statement of node.body.body) {\n if (t.isVariableDeclaration(statement)) {\n statement.declarations.push(...declars);\n return;\n }\n }\n const varDecl = t.variableDeclaration(\"var\", declars);\n node.body.body.unshift(varDecl);\n }\n }", "title": "" }, { "docid": "c46a52747ddd96d4ec94251f7121b72b", "score": "0.45182368", "text": "function test8() {\n // test8_1();\n // test8_2();\n test8_3();\n}", "title": "" }, { "docid": "d9d69be6a4a39b744cf0753577028b72", "score": "0.45145375", "text": "function ast_walker() {\n function _vardefs(defs) {\n return [ this[0], MAP(defs, function(def){\n var a = [ def[0] ];\n if (def.length > 1)\n a[1] = walk(def[1]);\n return a;\n }) ];\n };\n function _block(statements) {\n var out = [ this[0] ];\n if (statements != null)\n out.push(MAP(statements, walk));\n return out;\n };\n var walkers = {\n \"string\": function(str) {\n return [ this[0], str ];\n },\n \"num\": function(num) {\n return [ this[0], num ];\n },\n \"name\": function(name) {\n return [ this[0], name ];\n },\n \"toplevel\": function(statements) {\n return [ this[0], MAP(statements, walk) ];\n },\n \"block\": _block,\n \"splice\": _block,\n \"var\": _vardefs,\n \"const\": _vardefs,\n \"try\": function(t, c, f) {\n return [\n this[0],\n MAP(t, walk),\n c != null ? [ c[0], MAP(c[1], walk) ] : null,\n f != null ? MAP(f, walk) : null\n ];\n },\n \"throw\": function(expr) {\n return [ this[0], walk(expr) ];\n },\n \"new\": function(ctor, args) {\n return [ this[0], walk(ctor), MAP(args, walk) ];\n },\n \"switch\": function(expr, body) {\n return [ this[0], walk(expr), MAP(body, function(branch){\n return [ branch[0] ? walk(branch[0]) : null,\n MAP(branch[1], walk) ];\n }) ];\n },\n \"break\": function(label) {\n return [ this[0], label ];\n },\n \"continue\": function(label) {\n return [ this[0], label ];\n },\n \"conditional\": function(cond, t, e) {\n return [ this[0], walk(cond), walk(t), walk(e) ];\n },\n \"assign\": function(op, lvalue, rvalue) {\n return [ this[0], op, walk(lvalue), walk(rvalue) ];\n },\n \"dot\": function(expr) {\n return [ this[0], walk(expr) ].concat(slice(arguments, 1));\n },\n \"call\": function(expr, args) {\n return [ this[0], walk(expr), MAP(args, walk) ];\n },\n \"function\": function(name, args, body) {\n return [ this[0], name, args.slice(), MAP(body, walk) ];\n },\n \"debugger\": function() {\n return [ this[0] ];\n },\n \"defun\": function(name, args, body) {\n return [ this[0], name, args.slice(), MAP(body, walk) ];\n },\n \"if\": function(conditional, t, e) {\n return [ this[0], walk(conditional), walk(t), walk(e) ];\n },\n \"for\": function(init, cond, step, block) {\n return [ this[0], walk(init), walk(cond), walk(step), walk(block) ];\n },\n \"for-in\": function(vvar, key, hash, block) {\n return [ this[0], walk(vvar), walk(key), walk(hash), walk(block) ];\n },\n \"while\": function(cond, block) {\n return [ this[0], walk(cond), walk(block) ];\n },\n \"do\": function(cond, block) {\n return [ this[0], walk(cond), walk(block) ];\n },\n \"return\": function(expr) {\n return [ this[0], walk(expr) ];\n },\n \"binary\": function(op, left, right) {\n return [ this[0], op, walk(left), walk(right) ];\n },\n \"unary-prefix\": function(op, expr) {\n return [ this[0], op, walk(expr) ];\n },\n \"unary-postfix\": function(op, expr) {\n return [ this[0], op, walk(expr) ];\n },\n \"sub\": function(expr, subscript) {\n return [ this[0], walk(expr), walk(subscript) ];\n },\n \"object\": function(props) {\n return [ this[0], MAP(props, function(p){\n return p.length == 2\n ? [ p[0], walk(p[1]) ]\n : [ p[0], walk(p[1]), p[2] ]; // get/set-ter\n }) ];\n },\n \"regexp\": function(rx, mods) {\n return [ this[0], rx, mods ];\n },\n \"array\": function(elements) {\n return [ this[0], MAP(elements, walk) ];\n },\n \"stat\": function(stat) {\n return [ this[0], walk(stat) ];\n },\n \"seq\": function() {\n return [ this[0] ].concat(MAP(slice(arguments), walk));\n },\n \"label\": function(name, block) {\n return [ this[0], name, walk(block) ];\n },\n \"with\": function(expr, block) {\n return [ this[0], walk(expr), walk(block) ];\n },\n \"atom\": function(name) {\n return [ this[0], name ];\n },\n \"directive\": function(dir) {\n return [ this[0], dir ];\n }\n };\n\n var user = {};\n var stack = [];\n function walk(ast) {\n if (ast == null)\n return null;\n try {\n stack.push(ast);\n var type = ast[0];\n var gen = user[type];\n if (gen) {\n var ret = gen.apply(ast, ast.slice(1));\n if (ret != null)\n return ret;\n }\n gen = walkers[type];\n return gen.apply(ast, ast.slice(1));\n } finally {\n stack.pop();\n }\n };\n\n function dive(ast) {\n if (ast == null)\n return null;\n try {\n stack.push(ast);\n return walkers[ast[0]].apply(ast, ast.slice(1));\n } finally {\n stack.pop();\n }\n };\n\n function with_walkers(walkers, cont){\n var save = {}, i;\n for (i in walkers) if (HOP(walkers, i)) {\n save[i] = user[i];\n user[i] = walkers[i];\n }\n var ret = cont();\n for (i in save) if (HOP(save, i)) {\n if (!save[i]) delete user[i];\n else user[i] = save[i];\n }\n return ret;\n };\n\n return {\n walk: walk,\n dive: dive,\n with_walkers: with_walkers,\n parent: function() {\n return stack[stack.length - 2]; // last one is current node\n },\n stack: function() {\n return stack;\n }\n };\n}", "title": "" }, { "docid": "238cd610d74e83651d37c7d0a48ba77d", "score": "0.4513619", "text": "static set isCompiling(value) {}", "title": "" }, { "docid": "903aef91124d1edf8c8b7ff431bc8aa6", "score": "0.4502932", "text": "function getBinPathWithPreferredGopathGorootWithExplanation(toolName, preferredGopaths, preferredGoroot, alternateTool, useCache = true) {\n if (alternateTool && path.isAbsolute(alternateTool) && executableFileExists(alternateTool)) {\n binPathCache[toolName] = alternateTool;\n return { binPath: alternateTool, why: 'alternateTool' };\n }\n // FIXIT: this cache needs to be invalidated when go.goroot or go.alternateTool is changed.\n if (useCache && binPathCache[toolName]) {\n return { binPath: binPathCache[toolName], why: 'cached' };\n }\n const binname = alternateTool && !path.isAbsolute(alternateTool) ? alternateTool : toolName;\n const found = (why) => binname === toolName ? why : 'alternateTool';\n const pathFromGoBin = getBinPathFromEnvVar(binname, process.env['GOBIN'], false);\n if (pathFromGoBin) {\n binPathCache[toolName] = pathFromGoBin;\n return { binPath: pathFromGoBin, why: binname === toolName ? 'gobin' : 'alternateTool' };\n }\n for (const preferred of preferredGopaths) {\n if (typeof preferred === 'string') {\n // Search in the preferred GOPATH workspace's bin folder\n const pathFrompreferredGoPath = getBinPathFromEnvVar(binname, preferred, true);\n if (pathFrompreferredGoPath) {\n binPathCache[toolName] = pathFrompreferredGoPath;\n return { binPath: pathFrompreferredGoPath, why: found('gopath') };\n }\n }\n }\n // Check GOROOT (go, gofmt, godoc would be found here)\n const pathFromGoRoot = getBinPathFromEnvVar(binname, preferredGoroot || getCurrentGoRoot(), true);\n if (pathFromGoRoot) {\n binPathCache[toolName] = pathFromGoRoot;\n return { binPath: pathFromGoRoot, why: found('goroot') };\n }\n // Finally search PATH parts\n const pathFromPath = getBinPathFromEnvVar(binname, exports.envPath, false);\n if (pathFromPath) {\n binPathCache[toolName] = pathFromPath;\n return { binPath: pathFromPath, why: found('path') };\n }\n // Check common paths for go\n if (toolName === 'go') {\n const defaultPathsForGo = process.platform === 'win32' ? ['C:\\\\Go\\\\bin\\\\go.exe'] : ['/usr/local/go/bin/go', '/usr/local/bin/go'];\n for (const p of defaultPathsForGo) {\n if (executableFileExists(p)) {\n binPathCache[toolName] = p;\n return { binPath: p, why: 'default' };\n }\n }\n return { binPath: '' };\n }\n // Else return the binary name directly (this will likely always fail downstream)\n return { binPath: toolName };\n}", "title": "" }, { "docid": "96006f11158399056689e4e257714707", "score": "0.45027623", "text": "function istanbulHacks() {\n return {\n inherits: require(\"babel-plugin-istanbul\").default,\n visitor: {\n Program: {\n exit: function(path) {\n if (!this.__dv__) return\n\n const node = path.node.body[0];\n if (\n node.type !== \"VariableDeclaration\" ||\n node.declarations[0].id.type !== \"Identifier\" ||\n !node.declarations[0].id.name.match(/cov_/) ||\n node._blockHoist !== 3\n ) {\n throw new Error(\"Something has gone wrong in Logan's hacks.\");\n }\n\n // Gross hacks to put the code coverage block above all compiled\n // import statement output.\n node._blockHoist = 5;\n },\n },\n },\n };\n}", "title": "" }, { "docid": "7f4e4aaecc7e360004900e6d3e33ade0", "score": "0.44979858", "text": "computePathTo(target) {\n const playerCase = $player.inCase;\n const pathInterval = []; //\n const patternFromInterval = []; // store path id pattern\n //const nodes = {};\n const autorisedColors = $huds.displacement.diceColors;\n /*Object.keys(this.list_cases).forEach(k => { // k: local id\n const c = this.list_cases[k];\n //TODO: creer un system de couleur relatif au gemDice par couleur. Les couleur autorise certain case pour le path finding.\n // DELETE ME, TEST DEBUGAGE\n nodes[k] = c.pathConnexion;\n \n });*/\n const gloabalVariable_murMaisonDetruit = false;\n const globalEventStoryCheck_murMaisonDetruit = ()=>{return gloabalVariable_murMaisonDetruit}; // permetre d'assotion des events global qui check les variable\n $Objs.list_cases[8].visibleIfCondition = globalEventStoryCheck_murMaisonDetruit; // asign la condition events\n\n\n const globalPathConnextions = this.list_cases.map((c,id) => {\n // if $globalVariable.mur = true;\n if(!c.visibleIfCondition || c.visibleIfCondition() ){return c.pathConnexion}\n \n }); // nodeConnextions\n const startCaseID = $player.inCase.localCaseID;\n const endCaseID = target.localCaseID;\n const pattern = this.findShortestPath(globalPathConnextions, startCaseID, endCaseID) || [];\n //const pattern = this.dfs(this.list_cases, 0, );\n\n const allowed = $huds.displacement._stamina;\n const greenFilter = new PIXI.filters.OutlineFilter (6, 0x1c6600, 1);\n const redFilter = new PIXI.filters.OutlineFilter (8, 0x660000, 1);\n for (let i = pattern.length; i--;) {\n const id = pattern[i];\n if(i>allowed){\n //this.list_cases[id].d.tint = 0xa03d21;\n this.list_cases[id].d._filters = [redFilter]\n\n }else{\n //this.list_cases[id].d.tint = 0x42f465;\n this.list_cases[id].d._filters = [greenFilter]\n }\n };\n this.pathBuffer = pattern || null;\n }", "title": "" }, { "docid": "670780af8a9725055e5d63e6262cfbe0", "score": "0.4497582", "text": "function coalesce_updates(update_a, update_b)\n{\n //var a_type = update_a[0];\n var a_path = update_a[1];\n //var a_info = update_a[2];\n //var b_type = update_b[0];\n var b_path = update_b[1];\n //var b_info = update_b[2];\n switch (compare_paths(a_path, b_path)) {\n case 'equal':\n return coalesce_updates_to_same_path(update_a, update_b);\n\n case 'a_contains_b': {\n var a_type = update_a[0];\n var b_type = update_b[1];\n if (!update_type_can_refer_to_object(a_type)) {\n return ['error', ....];\n }\n if (a_type === 'set') {\n ... apply 'b' to subvalue\n return update_a;\n }\n ...\n break;\n }\n\n case 'b_contains_a': {\n var a_type = update_a[0];\n var b_type = update_b[1];\n if (!update_type_can_refer_to_object(b_type)) {\n return ['error', ....];\n }\n if (b_type === 'set') {\n return update_b;\n }\n if (b_type === 'delete') {\n return update_b;\n }\n assert(false);\n }\n\n case 'disjoint':\n return null;\n }\n}", "title": "" }, { "docid": "2524b170dc046d33905741692e6eb972", "score": "0.4497197", "text": "function comparePaths() {\n var $levelHolder0 = arguments[0],\n $levelHolder1 = arguments[1],\n mode = (arguments[2] != undefined) ? arguments[2] : false,\n $parentLevelHolders0, $parentLevelHolders1, setParents0, setParents1, lPath, sPath, comparePath, response;\n if ($levelHolder0 == undefined || $levelHolder1 == undefined) {\n returnValue = false;\n return returnValue;\n }\n ;\n $parentLevelHolders0 = ($levelHolder0.length == 1) ? $levelHolder0.parents('div.levelHolderClass') : null;\n $parentLevelHolders1 = ($levelHolder1.length == 1) ? $levelHolder1.parents('div.levelHolderClass') : null;\n setParents0 = ($parentLevelHolders0 != null) ? $.merge($parentLevelHolders0.get().reverse(), $levelHolder0.get()) : [];\n setParents1 = ($parentLevelHolders1 != null) ? $.merge($parentLevelHolders1.get().reverse(), $levelHolder1.get()) : [];\n lPath = (setParents0.length >= setParents1.length) ? setParents0 : setParents1;\n sPath = (lPath === setParents0) ? setParents1 : setParents0;\n comparePath = $(lPath).filter(function() {\n return (mode) ? ($.inArray(this, sPath) != -1) : ($.inArray(this, sPath) == -1);\n });\n returnValue = comparePath;\n return returnValue;\n }", "title": "" }, { "docid": "65b07c312572fa181ec5d30befa8a0a9", "score": "0.44961712", "text": "function generate() {\n\t\ttraverseTree(ast.root, 0);\n\t\tpushHex(breakOp);\n var trueStringLoc = hexTable[codeTable.length+6];\n var falseStringLoc = hexTable[codeTable.length];\n var dynamicMemStart = codeTable.length;\n //console.log(\"True String Location: \" + trueStringLoc);\n //console.log(\"False String Location: \" + falseStringLoc);\n pushBooleanString(trueFalseHex);\n\t\tvar fullSymbolTable = getFullSymbolTable(st.root);\n\t\tfullSymbolTable = flattenStaticTable(fullSymbolTable);\n\t\t//console.log(codeTable);\n\t\t//console.log(fullSymbolTable);\n backPatchBooleanVal(codeTable, fullSymbolTable, trueStringLoc, falseStringLoc);\n\t\tbackPatchStringVal(codeTable, fullSymbolTable);\n\t\tbackPatchStatVal(codeTable, fullSymbolTable);\n\t\tbackPatchJumpVal(codeTable, jumpTable);\n\t\tif (codeTable.length > maxByteSize)\n\t\t\tthrowCodeGenError(\"Memory Exceeded 256 Bytes, Giving Up Now...\\n\");\n\t\tfor (var i = codeTable.length; i < maxByteSize; i++) {\n\t\t\tcodeTable.push(\"00\");\n\t\t}\n\t\t//console.log(codeTable);\n\t\t//console.log(fullSymbolTable);\n\t\t//console.log(jumpTable);\n\t\tvar code = \"\";\n\t\tfor (var i = 0; i < codeTable.length; i++) {\n\t\t\tcode = code + codeTable[i] + \" \";\n\t\t}\n\n\t\treturn [code, codeTable, dynamicMemStart];\n\t}", "title": "" }, { "docid": "69ce4c883999f23865c6f81f8b4d5a19", "score": "0.4491353", "text": "calculatePathing() {\n this.calcdirections();\n this.calcpathcosts();\n this.link();\n if (this.begin.prev.pathValue == 9999)\n return false;\n return true;\n }", "title": "" }, { "docid": "4444ab044c5dee8441e319c7962405ea", "score": "0.44883046", "text": "code_structurer(node) {\n\n\t\tlet _g;\n\t\tif (this.region.cyclic || this.region.graph_with_successors === undefined) { // Second condition might come true with an outermost cyclic region, which can't have successors\n\t\t\t_g = this.region.graph;\n\t\t} else {\n\t\t\t_g = this.region.graph_with_successors;\n\t\t}\n\n\t\tlet statements = [];\n\t\tlet stack = [node]; // This \"stack\" will hold at most one node\n\n\t\twhile (stack.length > 0) {\n\t\t\tlet curr_node = stack.pop();\n\n\t\t\t// Keep track of the number of nodes passed to this function\n\t\t\tglobals.STRUCTURED_NODES_COUNT++;\n\n\t\t\tstatements.push(...this._helper_get_statements(curr_node));\n\n\t\t\tswitch (_g.outDegree(curr_node)) {\n\t\t\t\tcase 0:\n\t\t\t\t\t// No further nodes to analyze\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\n\t\t\t\t\tif (this.region.graph.outDegree(curr_node) == 0) {\n\t\t\t\t\t\t// We were switching over graph_with_successors, but we're actually leaving region's graph\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet [_, dst] = _g.outEdges(curr_node)[0];\n\t\t\t\t\tstack.push(dst);\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tlet if_structure = this._analyze_if(curr_node);\n\n\t\t\t\t\tlet if_proto = new IfStatement({\n\t\t\t\t\t\ttest: if_structure.test,\n\t\t\t\t\t\tconsequent: null,\n\t\t\t\t\t\talternate: null,\n\t\t\t\t\t});\n\n\t\t\t\t\t// Recursively create new structurers in case of if statements\n\n\t\t\t\t\tif (if_structure.consequent !== null) {\n\t\t\t\t\t\tif_proto.consequent = new BlockStatement({\n\t\t\t\t\t\t\tblock: new Block({\n\t\t\t\t\t\t\t\tstatements: this.code_structurer(if_structure.consequent)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error(`Branching consequent condition was ${if_structure.consequent} on node ${node}. Should be non-null.`)\n\t\t\t\t\t}\n\n\t\t\t\t\tif (if_structure.alternate !== null) {\n\t\t\t\t\t\t// Insert alternative in if statement, this is a if-then-else branch\n\t\t\t\t\t\tif_proto.alternate = new BlockStatement({\n\t\t\t\t\t\t\tblock: new Block({\n\t\t\t\t\t\t\t\tstatements: this.code_structurer(if_structure.alternate)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Do nothing, this is a if-then branch\n\t\t\t\t\t}\n\n\t\t\t\t\tstatements.push(if_proto);\n\n\t\t\t\t\t// No need to push new nodes on stack since all exits have been recursively analized above\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error(`Found node ${node} with out degree greater than 2, how did this happen?`)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn statements;\n\t}", "title": "" }, { "docid": "7c3a70c3db8c1a7ee770ba80369c4a53", "score": "0.4487821", "text": "static branch(_branch) {\n if (_branch.nChildren > 0)\n Debug.group(_branch.name);\n else\n Debug.fudge(_branch.name);\n for (let child of _branch.getChildren())\n Debug.branch(child);\n if (_branch.nChildren > 0)\n Debug.groupEnd();\n }", "title": "" }, { "docid": "b55494063f59521665889b75f723733c", "score": "0.44846267", "text": "function\nloop_2843_(a4x1, a4x2)\n{\nlet a4y1;\nlet a4y2;\nlet xtmp62;\nlet xtmp63;\nlet xtmp64;\nlet xtmp65;\nlet xtmp66;\ndo {\n;\n;\n{\nxtmp63 = 0;\ndo {\ndo {\nif(0!==a4x1[0]) break;\nxtmp63 = 1;\n} while(false);\nif(xtmp63 > 0 ) break;\ndo {\nif(1!==a4x1[0]) break;\n//L1PCKany();\n//L1PCKany();\nxtmp63 = 2;\n} while(false);\nif(xtmp63 > 0 ) break;\n} while(false);\n} // case-patck0\nswitch\n(xtmp63) {\ncase 1:\nxtmp62 = a4x2;\nbreak;\ncase 2:\nxtmp64 = a4x1[1];\nxtmp65 = a4x1[2];\n{\n{\nxtmp66 = [1, xtmp64, a4x2];\n}\n;\n// tail-recursion:\n// L1CMDapp(tmp(62); L1VALfcst(loop(13)); L1VALtmp(tmp(65)), L1VALtmp(tmp(66)))\na4y1 = xtmp65; a4y2 = xtmp66; a4x1 = a4y1; a4x2 = a4y2; continue;\n}\n;\nbreak;\ndefault: XATS2JS_matcherr0();\n} // case-switch\n;\nbreak;//return\n} while( true );\nreturn xtmp62;\n}", "title": "" }, { "docid": "66ef0d624c3ba0ac3447c4edc6ea2237", "score": "0.44842565", "text": "findPath(pathfindingMethod, isRedraw = false) {\n if (this.state.isSolving)\n return;\n\n this.clearGrid(0);\n if (!isRedraw) {\n this.setState({ isSolving: true, lastAlgo: pathfindingMethod });\n }\n\n let nodesDiscoveredInOrder;\n\n document.getElementById('weight-warning').style.visibility = (pathfindingMethod <= 1) ? 'visible' : 'hidden';\n\n const starterGrid = this.state.grid;\n let gridWithParents;\n\n // If the destination is a wall, temporarily remove it\n let destIsWall = false;\n if (starterGrid[this.state.destCoords[0]][this.state.destCoords[1]].isWall) {\n starterGrid[this.state.destCoords[0]][this.state.destCoords[1]].isWall = false;\n destIsWall = true;\n }\n\n switch (pathfindingMethod) {\n case 0:\n [nodesDiscoveredInOrder, gridWithParents] = traditionalSolve(starterGrid, this.state.homeCoords, this.state.destCoords, true);\n break;\n\n case 1:\n [nodesDiscoveredInOrder, gridWithParents] = traditionalSolve(starterGrid, this.state.homeCoords, this.state.destCoords, false);\n break;\n\n case 2:\n [nodesDiscoveredInOrder, gridWithParents] = dijkstraSolve(starterGrid, this.state.homeCoords, this.state.destCoords);\n break;\n\n case 3:\n [nodesDiscoveredInOrder, gridWithParents] = aStarSolve(starterGrid, this.state.homeCoords, this.state.destCoords);\n break;\n\n default:\n return;\n }\n\n // Remake the destination to a wall if that's how it was initially\n if (destIsWall) {\n gridWithParents[this.state.destCoords[0]][this.state.destCoords[1]].isWall = true;\n }\n\n // Set the grid with the calculated parents\n this.setState({ grid: gridWithParents });\n\n\n if (isRedraw) {\n this.showRedraw(nodesDiscoveredInOrder);\n }\n else {\n this.animate(nodesDiscoveredInOrder);\n }\n\n }", "title": "" }, { "docid": "5e8a262b203ce9b729c53f37b2b5ce10", "score": "0.4481489", "text": "function buildTree_debug(path, destTree, pathMap){\n \n // function getItem(sourcePathItem, map){\n // map[sourcePathItem.path] = {\n //\t path: sourcePathItem.path,\n //\t parentPath: sourcePathItem.parentPath,\n //\t lookupPath: sourcePathItem.lookupPath,\n //\t children: []\n //\t };\n\t\n // return map[sourcePathItem.path];\n // }\n\n \n /**\n * Build up the list of paths from root to leaf.\n */\n var pathList = [];\n var item = pathMap.getPath(path);\n while (item){\n\tpathList.unshift(item.path);\n\t\n\tif (item.parentPath){\n\t item = pathMap.getPath(item.parentPath);\n\t} else {\n\t item = null;\n\t}\n }\n \n \n /**\n * Make sure that tree of nodes exists.\n * \n * When a path is created add it to its parent.\n */\n var prev;\n pathList.forEach(function(path){\n\tif (prev && !destTree.hasPath(path)){\n\t\tdestTree.addPath(path, prev, '');\n\t}\n\tprev = path;\n });\n \n \n return destTree;\n}", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.4474186", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "e33bd7e7e90dc422ea36364d399a87ce", "score": "0.44712564", "text": "static findPath() {\n NODES_INFO = {};\n // console.log(Object.keys(NODES_INFO).length);\n let node = startNode.id;\n let inQueue = [node],\n visited = [];\n AlgoHub.commonInfo(node, undefined, true);\n\n while (!!node) {\n visited.push(node);\n if (NODES_INFO[node].gridVal === \"end\") {\n return [visited, this.createSolution()];\n }\n inQueue = this.lookForNeighbors(node, visited, inQueue);\n [node, inQueue] = !inQueue.length\n ? [undefined, []]\n : AlgoHub.algoRoute(\"pickNext\", inQueue);\n }\n return [visited, []];\n }", "title": "" }, { "docid": "59ee93f617bcd396de1999c7f11cbc4b", "score": "0.44687742", "text": "function isPathLoss(path) {\n let {col, row} = projectToTile(path, Tile.size / 3);\n log(\"next tile; col=\" + col + \", row=\" + row);\n return col < 0 || col >= 6 || row < 0 || row >= 6;\n}", "title": "" }, { "docid": "d63bff464d4c6cf65a409c17d04345d6", "score": "0.44685286", "text": "walk_into(dir){ return false; }", "title": "" } ]
ad996ab19f03c3d17e72302080e0f00e
The size of the tensors in the tensor list.
[ { "docid": "16969c6ca2bd6180badae6c1b3d778a7", "score": "0.8149332", "text": "size() {\n return this.tensors.length;\n }", "title": "" } ]
[ { "docid": "a350dfc81abcc841c3777a44012d17cd", "score": "0.8130729", "text": "tensorSize() {\n return _tensorflow_tfjs_core_dist_ops_ops_for_converter__WEBPACK_IMPORTED_MODULE_1__.scalar(this.size(), 'int32');\n }", "title": "" }, { "docid": "3e949f0bc6f2f6d31be1357dbf08a8ab", "score": "0.7795402", "text": "size() {\n return this.tensorMap.size;\n }", "title": "" }, { "docid": "3e949f0bc6f2f6d31be1357dbf08a8ab", "score": "0.7795402", "text": "size() {\n return this.tensorMap.size;\n }", "title": "" }, { "docid": "6a302f6953b43130046639436542f56f", "score": "0.6894674", "text": "numberOfElements() {\n let running_size = 0;\n for (let sd in this.info) {\n running_size += sd.size;\n }\n return running_size;\n }", "title": "" }, { "docid": "bf99c36b3f01a55f32aff69bef9d014a", "score": "0.68815726", "text": "size () {\n\t\tlet count = 0;\n\t\tlet node = this.head;\n\n\t\twhile (node) {\n\t\t\tcount++;\n\t\t\tnode = node.next;\n\t\t}\n\n\t\treturn count;\n\t}", "title": "" }, { "docid": "bf99c36b3f01a55f32aff69bef9d014a", "score": "0.68815726", "text": "size () {\n\t\tlet count = 0;\n\t\tlet node = this.head;\n\n\t\twhile (node) {\n\t\t\tcount++;\n\t\t\tnode = node.next;\n\t\t}\n\n\t\treturn count;\n\t}", "title": "" }, { "docid": "4966f341b55b8af7f73a05d195132533", "score": "0.68572176", "text": "getSize() {\n let currentNode = this.head;\n let size = 1;\n\n while (currentNode !== this.tail) {\n currentNode = currentNode.next;\n size++;\n }\n\n return size;\n }", "title": "" }, { "docid": "6a3fd3cf617694d20858450a445f8fab", "score": "0.6850114", "text": "function size(list) {\n return list.length;\n}", "title": "" }, { "docid": "3b2b727282ebf7a6ac64366e11cd3f91", "score": "0.6844439", "text": "listSize() {\n return this.#size\n }", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.68295634", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.68295634", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "92a5be611ae1ebaf08fc6eb455f56b38", "score": "0.68295634", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "632db0357b98d53344384208ea60752f", "score": "0.682936", "text": "size_of_list() {\n\t\tconsole.log(this.size);\n\t}", "title": "" }, { "docid": "43c5f6feffe40debc335ec5eb452d4de", "score": "0.6816773", "text": "function size() {\n return n;\n }", "title": "" }, { "docid": "ee698c76c65d23076ffe265ede920b3c", "score": "0.6706056", "text": "function length() {\n return this.listSize;\n }", "title": "" }, { "docid": "82ab079c9802390e0860a5ecefa7a3e5", "score": "0.66794693", "text": "size() {\n let size = 0;\n let node = this.head;\n\n while (node) {\n size++;\n node = node.next;\n }\n\n return size;\n }", "title": "" }, { "docid": "3215da5faa74db215000aa06f8da2b9e", "score": "0.6676344", "text": "function length() {\n return this.listSize;\n }", "title": "" }, { "docid": "5d9a0be9cb1eb34627134488587f40e1", "score": "0.66671765", "text": "function size() {\n var size = 0;\n this.each(function() { ++size; });\n return size;\n}", "title": "" }, { "docid": "e728f5e00af9979d137a61188f1e4ff8", "score": "0.66315806", "text": "size() {\n let counter = 0;\n let current = this.head;\n while (current) {\n counter++;\n current = current.next;\n }\n return counter;\n }", "title": "" }, { "docid": "945a57eae54fd1931a59c83253a7a3e7", "score": "0.6628998", "text": "function getSize() {\n return items.length;\n }", "title": "" }, { "docid": "e222ac4393093b81bf94bed62d22f7a4", "score": "0.66207075", "text": "function length() {\n\treturn this.listSize;\n}", "title": "" }, { "docid": "7810fdca4a12ac750accf42ee7d49ee9", "score": "0.661705", "text": "size() {\n let count = 0\n let node = this.head\n while (node) {\n count++\n node = node.next\n }\n return count\n }", "title": "" }, { "docid": "7cc171231f0a2dbebc75e5d01c68c1e9", "score": "0.6613549", "text": "function length() {\n return this.listSize;\n}", "title": "" }, { "docid": "7cc171231f0a2dbebc75e5d01c68c1e9", "score": "0.6613549", "text": "function length() {\n return this.listSize;\n}", "title": "" }, { "docid": "f6756764d96ff066b3d3c81e1c0da6aa", "score": "0.660559", "text": "getSize() {\n let temp = this.front;\n let count = 0;\n while (temp) {\n temp = temp.next;\n count++;\n }\n return count;\n }", "title": "" }, { "docid": "531484d483fe7a7ac3d74b0d81837e79", "score": "0.6590497", "text": "size() {\n let count = 0;\n let node = this.head;\n while (node) {\n count++;\n node = node.next;\n }\n return count;\n }", "title": "" }, { "docid": "1e230f385ac938bfcf43571813b6cb1b", "score": "0.6560797", "text": "size() {\n\t\treturn this.list.length;\n\t}", "title": "" }, { "docid": "bf7e4c52650a52ad29ea262f9217ecca", "score": "0.6557048", "text": "size() {\n let count = 0;\n let node = this.head;\n while (node) {\n count++;\n node = node.next\n }\n return count;\n }", "title": "" }, { "docid": "817b6177ba36b11880bc09e20ee119fc", "score": "0.6484417", "text": "function size(n) {\n return n ? n.size : 0;\n}", "title": "" }, { "docid": "b022e9723f5d1f453dcce8f30c6a8691", "score": "0.64745337", "text": "size(){\n let count = 1;\n if(this.head !== null){\n let currentNode = this.head;\n while(this.hasNext(currentNode)){\n count = count + 1;\n currentNode = this.getNextNode(currentNode);\n }\n return count;\n }\n return 0;\n }", "title": "" }, { "docid": "4598ea08c4937d2d65eac3e633c7282e", "score": "0.6449395", "text": "size() {\n\t\tvar length = 0;\n\n\t\tthis.traverse(function(node){\n\t\t\tlength++;\n\t\t});\n\t\treturn length;\n\t}", "title": "" }, { "docid": "2d60fc11d0161bb254a130fe5d26265c", "score": "0.6436906", "text": "listSize() {\n let offset = this.bb.__offset(this.bb_pos, 4);\n return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;\n }", "title": "" }, { "docid": "07de58dfc91392f3e28d1c2a4ace3ba6", "score": "0.6432882", "text": "size_of_list() \r\n { \r\n console.log(this.size); \r\n }", "title": "" }, { "docid": "fef180b4b6369518884371f37ecb4245", "score": "0.63929546", "text": "sizeOflist() {\n return this.size;\n }", "title": "" }, { "docid": "3cb9d826a71b7b33fed7d228b3557b99", "score": "0.6391902", "text": "dimensions() {\n return this.elements.length;\n }", "title": "" }, { "docid": "abd5fc8067ea1340721ce505ad180c0b", "score": "0.6391179", "text": "size() {\n let size = 0;\n while(this.current.next !== null) {\n this.current = this.current.next;\n size++;\n }\n if(this.current.next === null) {\n return size;\n }\n }", "title": "" }, { "docid": "cb004c1d38f96ff8f7d8508c0ab09ab6", "score": "0.63861203", "text": "size() {\n if (this.head === null) { // Nothing to point to at start\n return 0;\n }\n var numNodes = 1;\n var curNode = this.head; // Start with first node\n while (curNode.next !== null) { // Loop while there are nodes to point to\n curNode = curNode.next; // Go to next node (if possible)\n numNodes++;\n }\n return numNodes;\n }", "title": "" }, { "docid": "7e99d76cd91b3291147bf742a94d7319", "score": "0.6380689", "text": "size(){\n console.log(`${this.count}elements in the stack`);\n return this.count\n }", "title": "" }, { "docid": "aaa95f3eddf471ef960840bc4bedfa27", "score": "0.6371365", "text": "function length() {\r\n\t\treturn size;\r\n\t}", "title": "" }, { "docid": "3932c1b68522234ddd255f0015ea52e3", "score": "0.6371072", "text": "size() {\n let count = 0\n let node = this.head\n while(node) {\n count++\n node = node.next\n }\n return count\n }", "title": "" }, { "docid": "9bbd661ca1a4eee4f941c164d5ce3933", "score": "0.6350492", "text": "get size() {\n // Return the triple count if if was cached.\n var size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of triples by counting to the deepest level.\n var graphs = this._graphs, subjects, subject;\n for (var graphKey in graphs)\n for (var subjectKey in (subjects = graphs[graphKey].subjects))\n for (var predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "title": "" }, { "docid": "9bbd661ca1a4eee4f941c164d5ce3933", "score": "0.6350492", "text": "get size() {\n // Return the triple count if if was cached.\n var size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of triples by counting to the deepest level.\n var graphs = this._graphs, subjects, subject;\n for (var graphKey in graphs)\n for (var subjectKey in (subjects = graphs[graphKey].subjects))\n for (var predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "title": "" }, { "docid": "1b67fd2c6f475d127ec60770e2fde5f4", "score": "0.6349885", "text": "listLength() {\r\n let length = 0\r\n let currentnode = this.head\r\n while (currentnode != null) {\r\n length++\r\n currentnode = currentnode.next\r\n }\r\n return length\r\n }", "title": "" }, { "docid": "d4ce12b80261f34dfeb690ef96c3ac32", "score": "0.63432014", "text": "get size () {\n return this.elements.length;\n }", "title": "" }, { "docid": "af48298cfb64527207bee5c7014c6729", "score": "0.63093394", "text": "listLength() {\r\n let currentNode = this.head\r\n let length = 0\r\n while (currentNode != null) {\r\n length++\r\n currentNode = currentNode.next\r\n }\r\n return length\r\n }", "title": "" }, { "docid": "9c1f477877fd786d7049f02387c277c6", "score": "0.63067025", "text": "function length(){\n return this.listSize;\n}", "title": "" }, { "docid": "6332a892a7120aaafb213ded11d57dd2", "score": "0.6301312", "text": "length(){\n\t\tlet count = 0;\n\t\tif(this.head){\n\t\t\tcount++;\n\t\t\tfor(let pointer = this.head; pointer.next; pointer = pointer.next){\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "title": "" }, { "docid": "e82b4293dca5a50ae25ffd50003702ec", "score": "0.62803316", "text": "length() {\n\t\tlet current = this.head;\n\t\tlet counter = 0;\n\t\twhile( current.next !== null ) {\n\t\t\tcounter++;\n\t\t\tcurrent = current.next\n\t\t}\n\t\treturn counter;\n\t}", "title": "" }, { "docid": "3f48889fa6709c5cbdeebd52e91b6e64", "score": "0.62796617", "text": "get size() {\n return this._node.numChildren();\n }", "title": "" }, { "docid": "33f3508a45079c37799394c05ccc3967", "score": "0.6273132", "text": "size() {\n return this.list.length;\n }", "title": "" }, { "docid": "d154a9362a28c92d2ab609629002be7a", "score": "0.6271218", "text": "size() {\n console.log('size', this.length);\n document.getElementById(\"sizeResult\").innerHTML = this.length;\n return this.length;\n }", "title": "" }, { "docid": "de13c361a42835a8f091d7b262a738f9", "score": "0.62618357", "text": "size() {\n return this._n;\n }", "title": "" }, { "docid": "0fd9197267c081476f47d190664918a0", "score": "0.6261027", "text": "size() {\n\t\tconsole.log(`size: ${this.collection.length}`);\n\t\treturn this.collection.length;\n\t}", "title": "" }, { "docid": "6976b3a6e14dbfde094bb87607280ce3", "score": "0.62550837", "text": "size() {\n if (this.rear >= this.front) {\n //contiguous\n return this.rear - this.front + 1;\n } else {\n return this.maxSize - this.front + (this.rear + 1);\n }\n }", "title": "" }, { "docid": "8df2695aa5e5cf8edf6e81ccbaeef5a8", "score": "0.6234354", "text": "size () {\n let total = 1;\n\n if (this.isLeaf()) {\n return total;\n }\n\n util.each(this.getChildren(), (child) => {\n total += child.size();\n });\n\n return total;\n }", "title": "" }, { "docid": "c4383b53671c8fe3f73ce73919fa4088", "score": "0.618555", "text": "function size() {\n return self._queue.size();\n }", "title": "" }, { "docid": "b518d6fffd50015c62f2907ca677cc5a", "score": "0.6170004", "text": "length() {\n return this.size\n }", "title": "" }, { "docid": "ab941c8e9a3adf8c74efe19d904f3534", "score": "0.6152234", "text": "get size() {\r\n return this._node.numChildren();\r\n }", "title": "" }, { "docid": "50ccce68c6bb821cc48ac46488d4c854", "score": "0.6114216", "text": "get size() {\n return this.keysSync(true).length;\n }", "title": "" }, { "docid": "24c973b69379c3db9ade598195ffe8b7", "score": "0.6114022", "text": "size() {\n return this._size;\n }", "title": "" }, { "docid": "e780942343218a5da333cc27ad2a9449", "score": "0.6111307", "text": "get size() {\n const resources = [ ...this[kResources] ]\n const reduce = (total, r) => total + (r.size || 0)\n return resources.reduce(reduce, this[kResources].size)\n }", "title": "" }, { "docid": "2e56068a1438779b8cf039c801cf241c", "score": "0.6111184", "text": "get length() {\n this._length = Object.keys(this._iList).length;\n return this._length;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.60955656", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.60955656", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "a9984764025b10ec39907876016af8e4", "score": "0.60955656", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "6bacf9b2cfc0e95f6272ef8b406926f8", "score": "0.6083473", "text": "get size() {\n let size = 0\n for (let i = 0; i < this.children.length; i++) size += this.children[i].size\n return size\n }", "title": "" }, { "docid": "6df6b2c390ff389473025d2e69757538", "score": "0.6083222", "text": "size() {\n if (this.isEmpty()) {\n return 0;\n }\n\n return (this.rear - this.front + 1);\n }", "title": "" }, { "docid": "3a011d6ba3bea0233d5d93509884ac54", "score": "0.6075496", "text": "size() {\n return this.count - this.front;\n }", "title": "" }, { "docid": "0772cf10ccaae444816c5429a39b83b1", "score": "0.6061722", "text": "function size(){\n return queue.length;\n }", "title": "" }, { "docid": "85867bb138ce6af8c3a9f961682980fc", "score": "0.60598457", "text": "size() {\n this.count = this.count ?? (0, trie_util_1.countWords)(this.root);\n return this.count;\n }", "title": "" }, { "docid": "2f0168ed4ffccdb24c141f8c105834d7", "score": "0.6059434", "text": "async size() {\n\t\treturn this._size();\n\t}", "title": "" }, { "docid": "3d30b7c181aebb7692fceed343daa6f9", "score": "0.6050892", "text": "length() {\n return this.#size;\n }", "title": "" }, { "docid": "868419c910a1145d39652c618606bca4", "score": "0.60405684", "text": "get length() {\n return this.listSize;\n }", "title": "" }, { "docid": "aaf33963629a42790f8ac326c694ed3e", "score": "0.6031418", "text": "function getNumberOfObjs() {\n\treturn this.list.length;\n}", "title": "" }, { "docid": "c53470c4c9f25e302a91f81c09adc66f", "score": "0.60304457", "text": "size() {\n return this.#length;\n }", "title": "" }, { "docid": "b01cf9877162b8475491ecfc239d10cd", "score": "0.6024922", "text": "dimensions() {\n\t\treturn this.coordinates.length;\n\t}", "title": "" }, { "docid": "168f0eefcf436c25e8155a39421e42af", "score": "0.6017928", "text": "getSize() {\n return this.storage.length;\n }", "title": "" }, { "docid": "97b4cd2f15ccf33dc1d3921d7bfa5ecc", "score": "0.60070777", "text": "getSize() {\n // returns the number of edges\n var cnt = 0;\n var get_keys = this.getKeys();\n\n // iterate over all the keys\n for (var i of get_keys) {\n var get_values = this.AdjList.get(i);\n // iterate over all the values\n /*for (var j of get_values) {\n cnt += 1;\n }*/\n cnt += get_values.length;\n }\n return cnt;\n }", "title": "" }, { "docid": "a9cbd0a3bdb21552c576e83ddc19f6df", "score": "0.60036296", "text": "function size() {\n return k;\n }", "title": "" }, { "docid": "d8034d6d6f8150d5a4a2fe12c7a0cd85", "score": "0.60035545", "text": "get size() {\n // Return the quad count if if was cached\n var size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of quads by counting to the deepest level\n size = 0;\n var graphs = this._graphs, subjects, subject;\n for (var graphKey in graphs)\n for (var subjectKey in (subjects = graphs[graphKey].subjects))\n for (var predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "title": "" }, { "docid": "d8034d6d6f8150d5a4a2fe12c7a0cd85", "score": "0.60035545", "text": "get size() {\n // Return the quad count if if was cached\n var size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of quads by counting to the deepest level\n size = 0;\n var graphs = this._graphs, subjects, subject;\n for (var graphKey in graphs)\n for (var subjectKey in (subjects = graphs[graphKey].subjects))\n for (var predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "title": "" }, { "docid": "d8034d6d6f8150d5a4a2fe12c7a0cd85", "score": "0.60035545", "text": "get size() {\n // Return the quad count if if was cached\n var size = this._size;\n if (size !== null)\n return size;\n\n // Calculate the number of quads by counting to the deepest level\n size = 0;\n var graphs = this._graphs, subjects, subject;\n for (var graphKey in graphs)\n for (var subjectKey in (subjects = graphs[graphKey].subjects))\n for (var predicateKey in (subject = subjects[subjectKey]))\n size += Object.keys(subject[predicateKey]).length;\n return this._size = size;\n }", "title": "" }, { "docid": "a00d37fd60bfcd1a87d660d767068054", "score": "0.59837675", "text": "size() {\n console.log(this.size);\n }", "title": "" }, { "docid": "240b2b914096dc1def29bfe7d44cea41", "score": "0.5970849", "text": "getSize() {\n return this.last.getValue() - (this.first.getValue()) + 1n;\n }", "title": "" }, { "docid": "b48ffaf41b41372abc57da32db4f1de5", "score": "0.5945781", "text": "function _size() {\n return lsize\n }", "title": "" }, { "docid": "a684f0cd6c54694b666e9a98622eb2f1", "score": "0.5944096", "text": "function size(linkedList){\n let counter = 0;\n let currNode = linkedList.head;\n while (currNode) {\n counter = counter + 1;\n currNode = currNode.next; \n }\n return counter;\n}", "title": "" }, { "docid": "8d0eec9bd6e30f28296265ed4262ecbd", "score": "0.59437686", "text": "length() {\n let current = this.head;\n let count = 0;\n\n while (current) {\n count++;\n current = current.next;\n }\n\n return count;\n }", "title": "" }, { "docid": "e71fed40d973c7b8572ea595bafc8edf", "score": "0.5938627", "text": "getSize(){\n return this.queue.length;\n }", "title": "" }, { "docid": "081cace598065089527258308945a703", "score": "0.593599", "text": "size() {\n let score = 0;\n let node = head; \n while (node !== null) {\n score++; \n node = node.next; \n }\n return score; \n }", "title": "" }, { "docid": "a69ddd343a8c00967e6bdc20e76f387a", "score": "0.59350353", "text": "size () {\n return this.length;\n }", "title": "" }, { "docid": "3f782480f83d3a924c389cd72331197e", "score": "0.592333", "text": "size() { return this.size; }", "title": "" }, { "docid": "39f9b74e9e6f5c41ef524a721c75040b", "score": "0.59170127", "text": "get size() {\n return this._queue.size;\n }", "title": "" }, { "docid": "39f9b74e9e6f5c41ef524a721c75040b", "score": "0.59170127", "text": "get size() {\n return this._queue.size;\n }", "title": "" }, { "docid": "cd0d3bb417cd0a74dfc5f1d8a1f41351", "score": "0.59090173", "text": "size(){\n return this.n;\n }", "title": "" }, { "docid": "86aa2dd786b50486b8387c42645b6581", "score": "0.5906737", "text": "function size(){\n \treturn dQueue.length;\n }", "title": "" }, { "docid": "8598c057c85286c02f3dd491915683ba", "score": "0.59046227", "text": "size() {\n return this.queue.length;\n }", "title": "" }, { "docid": "711d04ed0764feb38432236dafd80ae5", "score": "0.59006786", "text": "size() {\n let counter = 0; //# of nodes\n let node = this.head;\n\n while (node) { //if no head then no code is run\n counter++; //if it does the counter will increment\n node = node.next; //assign node to the current node's next property\n }\n\n return counter;\n }", "title": "" }, { "docid": "ccce9663b922719e7f98dedb6fe11bcc", "score": "0.5897177", "text": "get size() {\n if (this._available && this._available.length > 0) {\n return this._available.length;\n }\n if (this._pending && this._pending.length > 0) {\n return -this._pending.length;\n }\n return 0;\n }", "title": "" }, { "docid": "0a316ba7c186eb375d9d8465def194f1", "score": "0.5879868", "text": "function size(linkedList){\n //if empty list\n let length = 1\n if (!linkedList.head){\n return 0\n } else {\n let currentNode = linkedList.head\n while (currentNode.next !== null){\n currentNode = currentNode.next\n length++\n }\n }\n return length\n}", "title": "" } ]
3d71605c3a4596a77288844bbf6c6a8e
square distance (to avoid unnecessary Math.sqrt calls)
[ { "docid": "3a2639e64c0ed36252c7bd4f57a5a58f", "score": "0.68656695", "text": "function _sqDist(p1, p2) {\r\n\tvar dx = p2.x - p1.x,\r\n\t dy = p2.y - p1.y;\r\n\treturn dx * dx + dy * dy;\r\n}", "title": "" } ]
[ { "docid": "4867daccfd2914cdc87ede80d52f8a5d", "score": "0.74674785", "text": "function squareDistance(x1,y1, x2,y2) {\n const dx = x2-x1, dy = y2-y1;\n return dx*dx + dy*dy;\n }", "title": "" }, { "docid": "8414b7fdd3201d36eeb25510e89914f0", "score": "0.6900615", "text": "function computeDistance (v1, v2)\n{\n\tvar aux = [v2[0]-v1[0], v2[1]-v1[1], v2[2]-v1[2]] \n\tvar squaresSum = aux[0] * aux[0] + aux[1] * aux[1] + aux[2] * aux[2];\n \n var res = Math.sqrt( squaresSum );\n\t\n\treturn res;\n}", "title": "" }, { "docid": "7e0fe53ef65b3963adaa08ecdd3ff9c5", "score": "0.68652296", "text": "function _sqDist(p1, p2) {\r\n \tvar dx = p2.x - p1.x,\r\n \t dy = p2.y - p1.y;\r\n \treturn dx * dx + dy * dy;\r\n }", "title": "" }, { "docid": "532a2fe17c216c50cd1a208dda890ca2", "score": "0.68647796", "text": "function distance(x1, x2, y1, y2){ \r\n\tlet a = x1 - x2;\r\n\tlet b = y1 - y2;\r\n\tlet c = Math.sqrt( a*a + b*b );\r\n\treturn c;\r\n}", "title": "" }, { "docid": "ef90c4cbe6860ec76b8a5a695ba020ea", "score": "0.68354166", "text": "function _sqDist(p1, p2) {\n \tvar dx = p2.x - p1.x,\n \t dy = p2.y - p1.y;\n \treturn dx * dx + dy * dy;\n }", "title": "" }, { "docid": "ef90c4cbe6860ec76b8a5a695ba020ea", "score": "0.68354166", "text": "function _sqDist(p1, p2) {\n \tvar dx = p2.x - p1.x,\n \t dy = p2.y - p1.y;\n \treturn dx * dx + dy * dy;\n }", "title": "" }, { "docid": "aff0f8f1bc7ad2cc8bca68ee7934bc4e", "score": "0.68275815", "text": "function distance(x1, x2, y1, y2) {\r\n\treturn Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2));\t\t\r\n}", "title": "" }, { "docid": "49abdb436afba9f85287e574a9af465d", "score": "0.6813364", "text": "function _sqDist(p1, p2) {\n\tvar dx = p2.x - p1.x,\n\t dy = p2.y - p1.y;\n\treturn dx * dx + dy * dy;\n}", "title": "" }, { "docid": "49abdb436afba9f85287e574a9af465d", "score": "0.6813364", "text": "function _sqDist(p1, p2) {\n\tvar dx = p2.x - p1.x,\n\t dy = p2.y - p1.y;\n\treturn dx * dx + dy * dy;\n}", "title": "" }, { "docid": "49abdb436afba9f85287e574a9af465d", "score": "0.6813364", "text": "function _sqDist(p1, p2) {\n\tvar dx = p2.x - p1.x,\n\t dy = p2.y - p1.y;\n\treturn dx * dx + dy * dy;\n}", "title": "" }, { "docid": "49abdb436afba9f85287e574a9af465d", "score": "0.6813364", "text": "function _sqDist(p1, p2) {\n\tvar dx = p2.x - p1.x,\n\t dy = p2.y - p1.y;\n\treturn dx * dx + dy * dy;\n}", "title": "" }, { "docid": "49abdb436afba9f85287e574a9af465d", "score": "0.6813364", "text": "function _sqDist(p1, p2) {\n\tvar dx = p2.x - p1.x,\n\t dy = p2.y - p1.y;\n\treturn dx * dx + dy * dy;\n}", "title": "" }, { "docid": "1148e40fa6044865b5143516653d88ee", "score": "0.6776725", "text": "function _sqDist(p1, p2) {\r\n\t\tvar dx = p2.x - p1.x,\r\n\t\t dy = p2.y - p1.y;\r\n\t\treturn dx * dx + dy * dy;\r\n\t}", "title": "" }, { "docid": "1148e40fa6044865b5143516653d88ee", "score": "0.6776725", "text": "function _sqDist(p1, p2) {\r\n\t\tvar dx = p2.x - p1.x,\r\n\t\t dy = p2.y - p1.y;\r\n\t\treturn dx * dx + dy * dy;\r\n\t}", "title": "" }, { "docid": "85ced590ad8765ec4455acee6e2c0033", "score": "0.67756677", "text": "function dist(array) {\n return Math.sqrt(array.map(element => element * element).reduce((a, b) => a + b, 0));\n}", "title": "" }, { "docid": "4f6208f18e573ff57d8d8d2d3b78e458", "score": "0.6759835", "text": "function calDistance (x1, x2, y1, y2) {\n let distance = Math.floor(Math.sqrt ((x1 - x2)**2 +(y1 - y2)**2));\n console.log(distance)\n}", "title": "" }, { "docid": "e863da15c2c79a14905c8d537999faea", "score": "0.6756052", "text": "function distSq(x0, y0, x1, y1) {\n\treturn (x0 - x1) * (x0 - x1) + (y0 - y1) * (y0 - y1);\n}", "title": "" }, { "docid": "a4312bed011ab91dc40b24813f023671", "score": "0.6754903", "text": "function distance(x1, y1, x2, y2)\n{\n\treturn Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}", "title": "" }, { "docid": "fb394e1807021f384c1d08df38b266dd", "score": "0.6747364", "text": "function sqrDist(x1, y1, x2, y2) {\r\n return ((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1))\r\n}", "title": "" }, { "docid": "85d900dbcd7b69223e19db1e03394330", "score": "0.6745564", "text": "function normSquared(dx, dy) {\n return dx * dx + dy * dy;\n}", "title": "" }, { "docid": "676f88bde678893b9e3110d7766b2983", "score": "0.67220986", "text": "function sqDist(p1, p2) {\n var x1 = p1.getX(), x2 = p2.getX();\n var y1 = p1.getY(), y2 = p2.getY();\n return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);\n }", "title": "" }, { "docid": "5e98756c150eff42cadc6c0f428899ec", "score": "0.67187434", "text": "function distSquared(ax, ay, bx, by) {\n return (ax - bx) * (ax - bx) + (ay - by) * (ay - by);\n }", "title": "" }, { "docid": "63cfd4cbe664a50afe2d2d65fca3da98", "score": "0.66975534", "text": "function distance(x1, y1, x2, y2) {\r\nvar dx = x2 - x1;\r\nvar dy = y2 - y1;\r\nreturn console.log(Math.sqrt(dx*dx + dy*dy));\r\n}", "title": "" }, { "docid": "e87f86103a7c76091a38806839384461", "score": "0.6683012", "text": "function distance(x2,x1,y2,y1){\n \n return Math.sqrt(Math.pow(x2-x1,2) + (Math.pow(y2-y1,2)));\n \n}", "title": "" }, { "docid": "7d2eb072f829ba19b5fe6802c855b9c7", "score": "0.6681841", "text": "distanceFrom(other) {\n return Math.sqrt(this.sqDistanceFrom(other));\n }", "title": "" }, { "docid": "c06d562b3be77ca31c001c6bbe6574ec", "score": "0.6666864", "text": "function distSq(x1, x2, y1, y2) {\n return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);\n}", "title": "" }, { "docid": "9cd2c671cfad44dee3893940688af745", "score": "0.6666222", "text": "static distance(a,b)\n {\n return Math.sqrt((a[0]-b[0])*(a[0]-b[0]) + (a[1]-b[1])*(a[1]-b[1]));\n }", "title": "" }, { "docid": "bf1a5f561e6d4f0330c78697ce154059", "score": "0.66390383", "text": "function distance(x1,y1,x2,y2){\n return Math.sqrt(((x1-x2)**2)+((y1-y2)**2))\n}", "title": "" }, { "docid": "6fb2ab2364463b8e63b25391ce5012f0", "score": "0.6630357", "text": "distance(point) {\n return Math.sqrt(this.distanceSquared(point));\n }", "title": "" }, { "docid": "6fb2ab2364463b8e63b25391ce5012f0", "score": "0.6630357", "text": "distance(point) {\n return Math.sqrt(this.distanceSquared(point));\n }", "title": "" }, { "docid": "16075ea395aa9fd5455a759bc3aa1904", "score": "0.66202027", "text": "function distance(x1,y1,x2,y2){\r\n return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));\r\n}", "title": "" }, { "docid": "4411d84c9ce76df3f5045e17fc73dd68", "score": "0.66164297", "text": "function distSq(a, b) {\n var dx = a.wx - b.wx;\n var dy = a.wy - b.wy;\n return dx * dx + dy * dy;\n}", "title": "" }, { "docid": "58f121d338b1d357f92cc53f1715ae18", "score": "0.6603822", "text": "function sqrtSquaredSum(args) {\n return Math.sqrt(args.reduce(function(s, next) {\n return s + (next * next);\n }, 1));\n}", "title": "" }, { "docid": "3e841bfb97d7f24b500429b188c319e2", "score": "0.65975475", "text": "sqDistanceFrom(other) {\n const dx = other.x - this.x;\n const dy = other.y - this.y;\n\n return dx * dx + dy * dy;\n }", "title": "" }, { "docid": "16565130b6bf8334b69194c3adafeb7d", "score": "0.658893", "text": "dist(x1, y1, x2, y2) {\n let a = x1 - x2,\n b = y1 - y2;\n return Math.sqrt( a * a + b * b );\n }", "title": "" }, { "docid": "0e41f52265fe5fc7a9dd01291e45c60f", "score": "0.6577482", "text": "distanceSquared(point) {\n return this.minus(point).magnitudeSquared;\n }", "title": "" }, { "docid": "9fd671abc02c12e32ca4762eda7056b1", "score": "0.65741587", "text": "function distSq(v1, v2) {\n return Math.pow(v2.x - v1.x, 2) + Math.pow(v2.y - v1.y, 2) + Math.pow(v2.z - v1.z, 2);\n}", "title": "" }, { "docid": "a6b1c604320836ffee92768251d676bf", "score": "0.65735316", "text": "dist_euclidean(inst, e) {\n let sumSq = 0;\n for (let i = 0; i < inst.length; i++) {\n sumSq += Math.pow(inst[i] - e.x[i], 2);\n }\n sumSq = Math.sqrt(sumSq);\n return sumSq;\n }", "title": "" }, { "docid": "45ccee847fe4504edf1512da22b97256", "score": "0.6566267", "text": "function distance(a,b,c,d){\n var dis = Math.sqrt(Math.pow((a-b),2) +Math.pow((c-d),2))\n \n return dis.toFixed(2);\n \n }", "title": "" }, { "docid": "32ecd3826d95f82f524a8763ab6d7f8a", "score": "0.6557705", "text": "function squaredDistanceBetween(p, q) {\n let x = q[0] - p[0];\n let y = q[1] - p[1];\n return x * x + y * y;\n}", "title": "" }, { "docid": "ff17006dbde6b232b8e29b4520cbecf0", "score": "0.6551274", "text": "function distance(x1, y1, x2, y2) {\n let a = x2 - x1;\n let b = y2 - y1;\n\n return Math.sqrt(a*a + b*b);\n}", "title": "" }, { "docid": "fc93c6921488b9f1b9e6c1e7598556eb", "score": "0.6545198", "text": "function distance(a, b) {\n var x = b.x - a.x;\n var y = b.y - a.y;\n\n return Math.sqrt(x*x + y*y);\n }", "title": "" }, { "docid": "583a3ce59c3b5b2957f22a996a6f7c63", "score": "0.6544057", "text": "function rootmeansquare_distance(a, b, n) {\n let rows = a.length;\n let cols = a[0].length;\n let diff = 0;\n\n for (let row_index = 0; row_index < rows; row_index++) {\n for (let column_index = 0; column_index < cols; column_index++) {\n diff += Math.pow((a[row_index][column_index] - b[row_index][column_index]), 2);\n }\n }\n\n return Math.sqrt(diff / n);\n}", "title": "" }, { "docid": "6e36296cee34ee25c4bcd50204812337", "score": "0.65412897", "text": "function distance(x1, y1, x2, y2) {\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n return sqrt(dx * dx + dy * dy);\r\n}", "title": "" }, { "docid": "4e516169bfc50277df87c6e722735d4b", "score": "0.65398836", "text": "distance(sw2) {\n const dist = sqrt((this.x - sw2.x) ^ 2 + (this.y - sw2.y) ^ 2);\n return dist;\n }", "title": "" }, { "docid": "b5fbab8d14073fd94548885f1d88634a", "score": "0.65222156", "text": "function distance(a, b) {\r\n var dx = a.x - b.x;\r\n var dy = a.y - b.y;\r\n return Math.sqrt(dx * dx + dy * dy);\r\n}", "title": "" }, { "docid": "885e8663b23138c4b5bec5fa4b1bee73", "score": "0.65190095", "text": "simpleDist(pointA, pointB) {\r\n let x = pointA.x - pointB.x,\r\n y = pointA.y - pointB.y\r\n\r\n return Math.sqrt(x * x + y * y)\r\n }", "title": "" }, { "docid": "ee7b7286fd5c53e2f58741351820214b", "score": "0.65109015", "text": "function dist(x1,y1,x2,y2)\n{\n return Math.sqrt(Math.pow((x2-x1),2) + Math.pow((y2-y1),2)); \n}", "title": "" }, { "docid": "601dcecca58926f4d1f6f7b1a3fba442", "score": "0.651005", "text": "function calculateEuclideanDistance(destinationArray){\n\t\t\tvar result = 0;\n\t\t var diff = 0;\n\n\t\t for(var i = 0; i < sourceArray.length; i++){\n\t\t diff = destinationArray[i] - sourceArray[i];\n\t\t result += diff * diff; \n\t\t }\n\n\t\t result = Math.sqrt(result);\n\n\t\t return result;\n\t\t}", "title": "" }, { "docid": "fd7de64422f97cef2df4a33948598bba", "score": "0.650267", "text": "function distance(x1, y1, x2, y2) {\n return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));\n}", "title": "" }, { "docid": "7bf379e05c38e7853518d1fa6313c6bc", "score": "0.65005267", "text": "function calcDistance(asteroid,ship) {\n\tvar xd = ship[0] - asteroid[0];\n\tvar yd = ship[1] - asteroid[1];\n\tvar distance = Math.sqrt((xd * xd) + (yd * yd)).toFixed(2);\n\tconsole.log(distance);\n\treturn distance;\n}", "title": "" }, { "docid": "16285850c432b318b31b94a950b28603", "score": "0.64943695", "text": "function distance(x1, y1, x2, y2) { \n let dx = x2 - x1; \n let dy = y2 - y1; \n return Math.sqrt(dx*dx + dy*dy);\n}", "title": "" }, { "docid": "12ac3fd06658e6ace456c156acff9f1e", "score": "0.647087", "text": "distanceSquared(point) {\n const dx = this.x - point.x;\n const dy = this.y - point.y;\n return dx * dx + dy * dy;\n }", "title": "" }, { "docid": "c4ea2c75e3f945e4d6e8113f7529166a", "score": "0.6460417", "text": "function sqrt(a) {\n return a ** 0.5;\n}", "title": "" }, { "docid": "c322ceb575ccddb6e0e6395cd149c0e5", "score": "0.6458177", "text": "function distance(x1, y1, x2, y2) {\r\n let dx = x1 - x2;\r\n let dy = y1 - y2;\r\n return (Math.sqrt((dx * dx) + (dy * dy)))\r\n}", "title": "" }, { "docid": "033157f0f0a62bd570796296f95e155a", "score": "0.6448112", "text": "sqDistanceFrom(point) {\n const dx = this.xDistanceFrom(point);\n const dy = this.yDistanceFrom(point);\n\n return dx * dx + dy * dy;\n }", "title": "" }, { "docid": "45c969aebbedc2d45a196a0022f43178", "score": "0.6441588", "text": "function distance(a, b) {\n return Math.sqrt(Math.pow(a[0] - b[0], 2) + Math.pow(a[1] - b[1], 2));\n}", "title": "" }, { "docid": "720ec6c10f01e4264af7c859fb8f6aa9", "score": "0.6440348", "text": "function getDistance(x1, y1, x2, y2)\n{\n return Math.sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1)));\n }", "title": "" }, { "docid": "1b003ceb16ee01ea312026cb1dfeb90d", "score": "0.6436205", "text": "function distance(a, b) {\n var dx = a.x - b.x;\n var dy = a.y - b.y;\n return Math.sqrt(dx * dx + dy * dy);\n}", "title": "" }, { "docid": "56a2338b7b5e23c8727e6d6a54966448", "score": "0.64329743", "text": "function dist(x0, y0, x1, y1) { return Math.sqrt(Math.pow(Math.abs(x0-x1),2) + Math.pow(Math.abs(y0-y1),2)); }", "title": "" }, { "docid": "a39a6eeb316c74e8a70abcaa33ebc6ea", "score": "0.64151055", "text": "function distance(x1, y1, x2, y2) {\n\t return Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));\n\t }", "title": "" }, { "docid": "d2d5822f65dfe504b3dd78839e46cedd", "score": "0.64141434", "text": "function distance_sq(lat_1, lon_1, lat_2, lon_2) {\n // Cast everything to numbers, just in case.\n lat_1 = +lat_1;\n lon_1 = +lon_1;\n lat_2 = +lat_2;\n lon_2 = +lon_2;\n\n // https://en.wikipedia.org/wiki/Chebyshev_polynomials\n const cos_0m = 1;\n const cos_1m = Math.cos((lat_1 + lat_2) * (Math.PI / 360));\n const cos_2m = 2 * cos_1m * cos_1m - cos_0m;\n const cos_3m = 2 * cos_1m * cos_2m - cos_1m;\n const cos_4m = 2 * cos_1m * cos_3m - cos_2m;\n const cos_5m = 2 * cos_1m * cos_4m - cos_3m;\n\n const k_lat = 111132.09 * cos_0m - 566.05 * cos_2m + 1.20 * cos_4m;\n const k_lon = 111415.13 * cos_1m - 94.55 * cos_3m + 0.12 * cos_5m;\n\n const d_lat = k_lat * (lat_2 - lat_1);\n const d_lon = k_lon * (lon_2 - lon_1);\n\n return d_lat * d_lat + d_lon * d_lon;\n}", "title": "" }, { "docid": "67bdd7a0a282eda3b855d28ac857b348", "score": "0.64034456", "text": "function nearestSq(num){\n let sqrRounded = Math.round(Math.sqrt(num))\n return sqrRounded * sqrRounded\n}", "title": "" }, { "docid": "fb174a933b98b7cefc6f28baf135e6f6", "score": "0.6396676", "text": "function distance(p1, p2){\n return Math.sqrt(((p1.x - p2.x) *\n (p1.x -\n p2.x)) +\n ((p1.y - p2.y) * (p1.y - p2.y)));\n}", "title": "" }, { "docid": "fb174a933b98b7cefc6f28baf135e6f6", "score": "0.6396676", "text": "function distance(p1, p2){\n return Math.sqrt(((p1.x - p2.x) *\n (p1.x -\n p2.x)) +\n ((p1.y - p2.y) * (p1.y - p2.y)));\n}", "title": "" }, { "docid": "02916348569dd49144693dd2a4f6f0ed", "score": "0.6391935", "text": "function getSqDist(p1, p2) {\n var dx = p1[0] - p2[0],\n dy = p1[1] - p2[1];\n return dx * dx + dy * dy;\n } // square distance from a point to a segment", "title": "" }, { "docid": "4150b21a02e97eb43d7e4d00b2ab2800", "score": "0.63865006", "text": "function distance(a, b) {\n return 1 - similarity(a, b);\n}", "title": "" }, { "docid": "be3fcd88f68ffe96dfb09ab49a4f311e", "score": "0.63842446", "text": "distanceFrom(point) {\n return Math.sqrt(this.sqDistanceFrom(point));\n }", "title": "" }, { "docid": "b4d841f592fe9071234136113123d94b", "score": "0.6373504", "text": "function distance(x1, y1, x2, y2){\n return Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2));\n }", "title": "" }, { "docid": "6b4ec153526923d92560234403159010", "score": "0.63681775", "text": "function distanceTo(coord1,coord2){\r\n return Math.sqrt( (Math.pow( coord2[0]-Math.abs(coord1[0]),2 ))+(Math.pow( Math.abs(coord2[1])-Math.abs(coord1[1]),2 ))); \r\n}", "title": "" }, { "docid": "ed4518aed8673a50c125861f8afc1d8a", "score": "0.6350943", "text": "function getSquaredEuclidianDistance(x1, y1, x2, y2) {\n\tvar dx = x1 - x2;\n\tvar dy = y1 - y2;\n\treturn dx * dx + dy * dy;\n}", "title": "" }, { "docid": "78957cdcebb1f60a900880ae8c54a421", "score": "0.6348383", "text": "dist( x, y ) {\n\t\t\tconst coords = Coords( x, y );\n\t\t\tconst dx = this.x - x;\n\t\t\tconst dy = this.y - y;\n\n\t\t\treturn Math.sqrt( dx * dx + dy * dy );\n\t\t}", "title": "" }, { "docid": "49d7c3bb0a558454e1dba5f705554b7e", "score": "0.6331815", "text": "function distance(p1,p2){\n console.log(p1);\n console.log(p2);\n console.log(\"returning distance\") \n return Math.sqrt(Math.pow(p1.x-p2.x,2)+Math.pow(p1.y-p2.y,2));\n}", "title": "" }, { "docid": "66fd31531f020c98994f17a408ed8126", "score": "0.6330987", "text": "function nearestSq(n){\n let down = n;\n if (n === 1) return 1;\n if (!(Math.sqrt(n)+'').includes('.')) return n\n else while (down > 0) {\n n++;\n down--;\n if (n === 1 || down === 1) return 1;\n if (!(Math.sqrt(n)+'').includes('.')) return n\n else if (!(Math.sqrt(down)+'').includes('.')) return down;\n }\n}", "title": "" }, { "docid": "c24b842f53a133fe1d807c4169e67907", "score": "0.6327717", "text": "distanceSquaredXY(x, y) {\n const dx = this.x - x;\n const dy = this.y - y;\n return dx * dx + dy * dy;\n }", "title": "" }, { "docid": "783fc4105222f61f93779783ad00913b", "score": "0.6319233", "text": "distance() { // Method to compute distance from origin to point.\n return Math.sqrt( // Return the square root of x² + y².\n this.x * this.x + // this refers to the Point object on which\n this.y * this.y // the distance method is invoked.\n );\n }", "title": "" }, { "docid": "112a58d570fbe9c62e1d29c1abb7d43a", "score": "0.63191134", "text": "function getSqDist(p1, p2) {\n\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y;\n\n return dx * dx + dy * dy;\n }", "title": "" }, { "docid": "1650cf419bdb6cdf8641e1856143e879", "score": "0.6318757", "text": "function getDistanceSQ(a, b) {\r\n const diffs = [];\r\n for (let i = 0; i < a.length; i++) {\r\n diffs.push(a[i] - b[i]);\r\n }\r\n return diffs.reduce((r, e) => (r + (e * e)), 0);\r\n}", "title": "" }, { "docid": "6495c1ab528aa8ab7b8ec33332a89bd7", "score": "0.6318259", "text": "dist (pos1, pos2) {\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "title": "" }, { "docid": "fefc9c7b81f2b9f4525af48a8d4a6b6b", "score": "0.6314149", "text": "function getSqDist(p1, p2) {\r\n\r\n var dx = p1.x - p2.x,\r\n dy = p1.y - p2.y;\r\n\r\n return dx * dx + dy * dy;\r\n}", "title": "" }, { "docid": "77df742196518c32fa9a7992658b4926", "score": "0.63108104", "text": "function distance(x1, y1, x2, y2) {\n let dx = x2 - x1;\n let dy = y2 - y1;\n return Math.sqrt(dx*dx + dy*dy);\n}", "title": "" }, { "docid": "d1074e0c2e8d11f0ef55e1a841fc7f9f", "score": "0.6307351", "text": "function distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) +\n (p1.y - p2.y) * (p1.y - p2.y));\n}", "title": "" }, { "docid": "c6b35536611664ceb3e05afc30a64f58", "score": "0.62949693", "text": "function getSqDist(p1, p2) {\n\n\t\t\t\tvar dx = p1.x - p2.x,\n\t\t\t\t\tdy = p1.y - p2.y;\n\n\t\t\t\treturn dx * dx + dy * dy;\n\t\t\t}", "title": "" }, { "docid": "566ba2c353ed29e34d77ac300ce9d8f3", "score": "0.62948394", "text": "function dist(x, y) {\n x = Math.abs(x); if (x > width/2) x -= width;\n y = Math.abs(y); if (y > height/2) y -= height;\n return Math.sqrt(1.*x*x + 1.*y*y);\n}", "title": "" }, { "docid": "11f53c956ed38998569ec34a7fcd2b6b", "score": "0.6293904", "text": "function getSqDist(p1, p2) {\n\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y;\n\n return dx * dx + dy * dy;\n}", "title": "" }, { "docid": "11f53c956ed38998569ec34a7fcd2b6b", "score": "0.6293904", "text": "function getSqDist(p1, p2) {\n\n var dx = p1.x - p2.x,\n dy = p1.y - p2.y;\n\n return dx * dx + dy * dy;\n}", "title": "" }, { "docid": "6d0b963f2abceaa9a15127e42da41ec9", "score": "0.6293442", "text": "function dist(a, b) {\n return Math.sqrt(((a.x - b.x) ** 2) + ((a.y - b.y) ** 2));\n }", "title": "" }, { "docid": "ecfc0dfbf585c915277f22344d8f3654", "score": "0.62753266", "text": "function sqrt(x) {\r\n var y;\r\n y = Math.sqrt(x);\r\n return y;\r\n}", "title": "" }, { "docid": "404884e2d5c593ef20bcc850b70c8cec", "score": "0.6272092", "text": "function euclideanDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x1-x2, 2) + Math.pow(y1-y2, 2));\n }", "title": "" }, { "docid": "aa1bbc25b88f4f7277f439064828eeca", "score": "0.6268967", "text": "function distance(x1, y1, x2, y2, root){\n if(typeof root === 'undefined') root = false;\n var distancesquared = (x1 - x2)**2 + (y1 - y2)**2;\n return (root) ? Math.sqrt(distancesquared) : distancesquared;\n}", "title": "" }, { "docid": "d9cd74299a1f188147d3ce5a242b5730", "score": "0.6265408", "text": "function calculateDistance(x1, y1, x2, y2){\r\n\treturn Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));\r\n}", "title": "" }, { "docid": "9c505f149dbfe66584ec22e1437b27d8", "score": "0.6259438", "text": "function distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));\n }", "title": "" }, { "docid": "c169c5c102dad078ac6476a54f7e37df", "score": "0.624631", "text": "distanceSquared(point) {\n const dx = this.x - point.x;\n const dy = this.y - point.y;\n const dz = this.z - point.z;\n return dx * dx + dy * dy + dz * dz;\n }", "title": "" }, { "docid": "018e0a4f81502f8be22545bffcf28cea", "score": "0.62423384", "text": "function get_distance(x1, x2, y1, y2) {\n return Math.sqrt( Math.pow( x1-x2, 2) + Math.pow( y1-y2, 2) );\n}", "title": "" } ]
afa5baaee999bdb93d7968f42319e98a
Handles Adjectives and Nouns
[ { "docid": "badb25d3d03844f1cb900b82528f1621", "score": "0.0", "text": "constructor() {\n super();\n this.state = {\n create_adjective: false,\n create_noun: false,\n adjective_text: \"\",\n noun_text: \"\"\n };\n this.handleOnClick = this.handleOnClick.bind(this);\n this.toggleButton = this.toggleButton.bind(this);\n this.handleOnInput = this.handleOnInput.bind(this);\n this.handleConceptSubmit = this.handleConceptSubmit.bind(this);\n }", "title": "" } ]
[ { "docid": "5fb127af2516eace4956e2d826a3c3af", "score": "0.6810372", "text": "getAdjective () {\n return getWord(this.adjectives)\n }", "title": "" }, { "docid": "622474e248eea4252b5b1497c90ae556", "score": "0.6549393", "text": "function Adjective(){\n\n var sen1_JSON =\n {\n sentence:'The yellow ducks quacked',\n subject:{\n value:'ducks',\n modifiers:[\n {\n type:'determiner',\n value:'The'\n },\n {\n type:'adjective',\n value:'yellow'}\n ]\n },\n verb:{\n value:'quacked'\n }\n };\n\n var subject = sen1_JSON[\"subject\"].value;\n\n var verb = sen1_JSON[\"verb\"].value;\n\n var modArray = [];\n\n for(var i=0; i < sen1_JSON[\"subject\"].modifiers.length; i++){\n modArray.push(sen1_JSON[\"subject\"].modifiers[i].value);\n }\n\n drawAdjective(subject, verb, modArray);\n}", "title": "" }, { "docid": "beda7c01fb2ea38d0b7cd9a480bfe298", "score": "0.62010825", "text": "function predicateNoun(){\n\n var sen5_JSON =\n {\n sentence: 'Blue is a colour',\n subject:{\n value:'Blue'\n },\n verb:{\n value:'is',\n modifiers:[\n {\n type:'noun',\n value:'colour'\n },\n {\n type:'determiner',\n value:'a'\n }\n ]\n }\n };\n\n var subject = sen5_JSON[\"subject\"].value;\n\n var verb = sen5_JSON[\"verb\"].value;\n\n var modArray = [];\n\n for(var i=0; i < sen5_JSON[\"verb\"].modifiers.length; i++){\n modArray.push(sen5_JSON[\"verb\"].modifiers[i].value);\n }\n\n drawPredicateNoun(subject, verb, modArray);\n\n}", "title": "" }, { "docid": "e4b77ea46f62e834a5826441cb22d913", "score": "0.619676", "text": "function Adverb(){\n\n var sen2_JSON =\n {\n sentence: 'He ran very slowly',\n subject:{\n value:'He'\n },\n verb:{\n value:'ran',\n modifiers:[\n {\n type:'adverb',\n value:'very'\n },\n {\n type:'adverb',\n value:'slowly'\n }\n ]\n }\n };\n\n var subject = sen2_JSON[\"subject\"].value;\n\n var verb = sen2_JSON[\"verb\"].value;\n\n var modArray = [];\n\n for(var i=0; i < sen2_JSON[\"verb\"].modifiers.length; i++){\n modArray.push(sen2_JSON[\"verb\"].modifiers[i].value);\n }\n\n drawAdverb(subject, verb, modArray);\n\n}", "title": "" }, { "docid": "e840bfaf5d90abf048f5e2b5d70a158d", "score": "0.6143085", "text": "function properNoun(word) {\n return word.toUpperCase();\n}", "title": "" }, { "docid": "071cd055cc920d8e975547d7a97d22a7", "score": "0.60772485", "text": "get displayText() {\n var {matchedName: sentence, args} = this._verb;\n for (let x in (this.fromNounFirstSuggestion\n ? this._argSuggs\n : this._argStrings)) {\n let obj = x === \"object\";\n let {text} = this._argSuggs[x] || 0;\n if (text) sentence += (\" \" +\n (obj ? \"\" : args[x].preposition + \" \") +\n (obj ? \"[ \" + text + \" ]\" : text));\n }\n return sentence;\n }", "title": "" }, { "docid": "bce6cbd278bfcbcb8f38a7ee6808d807", "score": "0.60154533", "text": "function findProperNounPhrase(tags){\n console.log(\"find\");\n var previousTag = \"\";\n var properNounPhrase = \"\";\n for(var i = 0; i < tags.length; i++){\n console.log(tags[i].pos);\n \n includedTags = [\"NNP\", \"NNPS\", \"JJ\", \"PRP$\", \"NN\"];\n \n if(includedTags.indexOf(tags[i].pos) > -1){\n if(includedTags.indexOf(previousTag) > -1){\n properNounPhrase += \" \" + tags[i].word;\n } else {\n properNounPhrase = tags[i].word;\n }\n } else {\n if(properNounPhrase.length > 0){\n break;\n }\n }\n previousTag = tags[i].pos;\n }\n\n return properNounPhrase;\n}", "title": "" }, { "docid": "c4bd5c01913a3b379fed45189ce381d7", "score": "0.5994048", "text": "function main (verb, noun){\n return verb + noun;\n}", "title": "" }, { "docid": "284ed41443d0016220febb923f3fc737", "score": "0.59487987", "text": "function madlib (noun, adjective, verb, adverbLY){\n return \"Hi, I'm a \" + adjective + \" \" + noun + \" and I like to \" + verb + \" very \" + adverbLY;\n}", "title": "" }, { "docid": "6ac205594a802b4c6f358537eaad714d", "score": "0.59439945", "text": "function madlib (noun, verb, place, adj){\n return ('The ' + noun +' ' + verb +' across the '+ place + ' ' + adj +'!');\n }", "title": "" }, { "docid": "7314a0d100960a733b45557d422e6cdd", "score": "0.59376", "text": "getAdjective() {\n\n // Prompt user input of a specific adjective category\n const adjective = prompt('Pick an adjective category: Any, Common, Vulgar, or Sexy? ');\n // Change all versions of input to lowercase for handling errors\n const adjectiveLower = adjective.toLowerCase();\n\n // Use selected category to late a string in the given array\n switch (adjectiveLower) {\n case 'any':\n // Store all adjectives categories\n const adjectiveArray = [ common, vulgar, sexy ];\n // Get random index and random category then update the state of adjective in MixedMessages constructor\n const adjectiveCategory = adjectiveArray[this.generateRandomNumber(adjectiveArray)];\n this.adjective = adjectiveCategory[this.generateRandomNumber(adjectiveCategory)];\n break;\n\n case 'common':\n // Get random index and update the state of adjective in MixedMessages constructor\n this.adjective = common[this.generateRandomNumber(common)];\n break;\n\n case 'vulgar':\n this.adjective = vulgar[this.generateRandomNumber(vulgar)];\n break;\n\n case 'sexy':\n this.adjective = sexy[this.generateRandomNumber(sexy)];\n break;\n\n default:\n console.log('Sorry, not an option. Please try again.');\n // Prompt user again for proper input\n this.getAdjective();\n\n }\n // Move on to selecting a noun\n this.getNoun();\n }", "title": "" }, { "docid": "b8b1fb793b602946d28f64cc97f18fd1", "score": "0.5915743", "text": "function main (verb, noun){\n if(!verb || !noun) return;\n return `${verb.trim()} ${noun.trim()}`;\n}", "title": "" }, { "docid": "41f7e6fc9c6f1784b57d98cf891682e0", "score": "0.5895726", "text": "function getNouns() {\n getWords(nounUrl, \"noun\");\n}", "title": "" }, { "docid": "f48e4268fdaea794ca5299b494468b09", "score": "0.5857636", "text": "function madLibs(occupation, transportVerb, adverb, adjective, animal, presentTenseVerb, adjective2) {\n\"The \"+occupation+\" \"+transportVerb+\" on his/her way to the church very \"+adverb+\". The surrounding crowd could not believe he/she would do so on such a/an \"+adjective+\" day. Meanwhile, across the street, an \"+animal+\" was \"+presentTenseVerb+\". It was truly a/an \"+ adjective2 +\" sight to see\"\n}", "title": "" }, { "docid": "4a68486ca08d98f795ae2b2b02b95688", "score": "0.585419", "text": "function madLib(verb, adj, noun) {\n return \"We shall \" + verb.toUpperCase() + \" the \" + adj.toUpperCase() + \" \" + noun.toUpperCase() + \".\";\n}", "title": "" }, { "docid": "9eaa579a7c6fe578afd88401aa70be41", "score": "0.5825854", "text": "function nameDrink(adjectives, nouns) {\n var randomAdjective = adjectives[Math.floor((Math.random() * (adjectives.length - 1)))];\n var randomNoun = nouns[Math.floor((Math.random() * (adjectives.length - 1)))];\n return randomAdjective + \" \" + randomNoun;\n}", "title": "" }, { "docid": "96f9b9e02b8a519d4f8a2b1b56f08d39", "score": "0.58210814", "text": "function wordBlanks(myNoun, myAdjective, myVerb, myAdverb){\n var result = \"\";\n result = \"The \" + myAdjective + myNoun + myAdverb + myVerb ;\n return result;\n}", "title": "" }, { "docid": "d814fc59c50b10bf73d59503312d25f4", "score": "0.58099586", "text": "function wordBlanks(myNoun, myAdjectitive, myVerb, myAdverb)\r\n{\r\n var result = \"\";\r\n result += \"the \" + myAdjectiev + myNoun + myVerb + \" to the store \" + myAdverb;\r\n \r\n return result;\r\n}", "title": "" }, { "docid": "fdc482cd4e06f76b99a2fe2db6c3a9a0", "score": "0.5805766", "text": "function madLib(verb,adj,noun) {\n return `We shall ${verb.toUpperCase()} the ${adj.toUpperCase()} ${noun.toUpperCase()}`\n}", "title": "" }, { "docid": "4a8b7b96976c3217fe6b106b61d2be8d", "score": "0.57711136", "text": "function madlib(adj1, noun1, adj2, noun2) {\n return `The ${adj1} ${noun1} befriended the ${adj2} ${noun2}.`;\n}", "title": "" }, { "docid": "146832dc5ccface04d79fdcdd639aba6", "score": "0.57696384", "text": "function madLib(verb, adj, noun) {\n let v = verb.toUpperCase();\n let a = adj.toUpperCase();\n let n = noun.toUpperCase();\n str = ('We shall ' + v + ' the ' + a + ' ' + n);\n console.log(str);\n}", "title": "" }, { "docid": "4dd3b452978c42fb6d7351e447b1c976", "score": "0.57642835", "text": "function searchForNouns(){\n console.log('NOUNS Search FIRE!!!!!!!!!!!!');\n potentialNouns = [];\n for (let i = 0; i < segmentedFirstStatement.length; i++){\n if ( nounArray.indexOf(segmentedFirstStatement[i].toLowerCase()) !== -1 ){\n console.log('there is a potential NOUN!')\n potentialNouns.push(segmentedFirstStatement[i]);\n } else {\n console.log(segmentedFirstStatement[i] + ' is NOT a NOUN!')\n }\n }\n console.log(potentialNouns);\n }", "title": "" }, { "docid": "aeb09e2417e643d075524e503f203652", "score": "0.5737174", "text": "function wordBanks(myNoun, myAdjective, myVerb, myAdverb) {\n let result = \"\";\n result += \"The \" + myAdjective+ \" \" + myNoun+ \" \" + myVerb + \" at the Store \" + myAdverb;\n return result; \n}", "title": "" }, { "docid": "271b167da91f59256a1931d8429f1c80", "score": "0.5732716", "text": "function madLib(verb, adj, noun) {\n return `We shall ${verb.toUpperCase()} the ${adj.toUpperCase()} ${noun.toUpperCase()}.`\n}", "title": "" }, { "docid": "2af54aa170e15055478dd9bc3e6773c0", "score": "0.5725164", "text": "constructor() {\n this.intent = INTENTS.NONE;\n\n /** @type {Noun} */\n this.noun = null;\n\n /** @type {Noun} */\n this.connectedNoun = null;\n\n this._whichNoun = \"noun\";\n }", "title": "" }, { "docid": "0c51484978c213d6c45d46ea884a8ddc", "score": "0.5711757", "text": "conjugation() {\n //check cached conjugations\n let conjugations = this.conjugate();\n let keys = Object.keys(conjugations);\n for(let i = 0; i < keys.length; i++) {\n if (conjugations[keys[i]] === this.normal) {\n return verbTags[keys[i]];\n }\n }\n //try to guess\n return verbTags[predict_form(this.normal)];\n }", "title": "" }, { "docid": "0c51484978c213d6c45d46ea884a8ddc", "score": "0.5711757", "text": "conjugation() {\n //check cached conjugations\n let conjugations = this.conjugate();\n let keys = Object.keys(conjugations);\n for(let i = 0; i < keys.length; i++) {\n if (conjugations[keys[i]] === this.normal) {\n return verbTags[keys[i]];\n }\n }\n //try to guess\n return verbTags[predict_form(this.normal)];\n }", "title": "" }, { "docid": "c5b1a12de15398bf26d368983c8ed3c9", "score": "0.5647532", "text": "function isPronounAndInfinitive() {\n if (s.terms[i - 1]) {\n let p = s.terms[i - 1].text;\n return (p === 'i' || p === 'we' || p === 'they' || p === 'you') &&\n (t.pos['Infinitive']);\n }\n return false;\n }", "title": "" }, { "docid": "c5b1a12de15398bf26d368983c8ed3c9", "score": "0.5647532", "text": "function isPronounAndInfinitive() {\n if (s.terms[i - 1]) {\n let p = s.terms[i - 1].text;\n return (p === 'i' || p === 'we' || p === 'they' || p === 'you') &&\n (t.pos['Infinitive']);\n }\n return false;\n }", "title": "" }, { "docid": "a2454f1eb08f69ca56ea398ef9b92d3f", "score": "0.5638054", "text": "function madLib(verb, adjective, noun)\n{\n // capitalize\n let capVerb = verb.toUpperCase();\n let capAdj = adjective.toUpperCase();\n let capNoun = noun.toUpperCase();\n\n // interpolate\n return `We shall ${capVerb} the ${capAdj} ${capNoun}`;\n}", "title": "" }, { "docid": "100d00e1bc9befb79176f1432781f346", "score": "0.5630422", "text": "function tellStory() {\n\nconst nounArray = document.querySelector('#noun')\nconst nouns = nounArray.value.toLowerCase()\nnoun = nouns.replace(/\\s+/,\" \").split(/\\s+|\\n/)\n\n\n\nconst adjectiveArray = document.querySelector('#adjective')\nconst adjectives = adjectiveArray.value.toLowerCase()\nadjective = adjectives.replace(/\\s+/,\" \").split(/\\s+|\\n/)\n\n\n\nconst verbArray = document.querySelector('#verb')\nconst verbs = verbArray.value.toLowerCase()\nverb = verbs.replace(/\\s+/,\" \").split(/\\s+|\\n/)\n\n\n\nconst myStory = `Once upon a time there were four ${noun[0]} brothers named Bingo, Bango, Bongo, and Bengo. The brothers had two ${noun[1]}s each. Not only did they have those, but they had ${noun[2]}s too. The brothers were known for being very ${adjective[0]}. They were also known for loving to ${verb[0]}. One day the brothers found a ${noun[3]}, a ${noun[4]}, and a few ${noun[5]}s. This made the brothers very ${adjective[1]} and ${adjective[2]}. They decided to go to ${noun[6]} to ${verb[1]} and ${verb[2]}. THE END.`\n\n\nconsole.log(myStory)\n\n\n\nstory = document.querySelector('#story')\nstory.textContent = myStory\n\n\n}", "title": "" }, { "docid": "fa7e09262c93c326bbc22251a0138808", "score": "0.56257993", "text": "getNoun() {\n\n // Prompt user input of a specific category\n const noun = prompt('Pick a noun category: Any, Football, Wrestling, Bodypart, or Animal: ');\n // Change all versions of input to lowercase for handling errors\n const nounLower = noun.toLowerCase();\n\n switch (nounLower) {\n case 'any':\n // Store all noun categories\n const nounArray = [ football, wrestling, bodypart, animal ];\n // Get random index and random category then update the state of noun in MixedMessages constructor\n const nounCategory = nounArray[this.generateRandomNumber(nounArray)];\n this.noun = nounCategory[this.generateRandomNumber(nounCategory)];\n break;\n\n case 'football':\n // Get random index and update the state of noun in MixedMessages constructor\n this.noun = football[this.generateRandomNumber(football)];\n break;\n\n case 'wrestling':\n this.noun = wrestling[this.generateRandomNumber(wrestling)];\n break;\n\n case 'bodypart':\n this.noun = bodypart[this.generateRandomNumber(bodypart)];\n break;\n\n case 'animal':\n this.noun = animal[this.generateRandomNumber(animal)];\n break;\n\n default:\n console.log('Sorry, not an option. Please try again.');\n // Prompt user again for proper input\n this.getNoun();\n }\n\n this.getResult();\n }", "title": "" }, { "docid": "b4f94ddcd169d249159b54f0ed8885fe", "score": "0.5578425", "text": "function parseStory(rawStory) {\n // Your code here.\n\n const typeObject = {\n '[a]': \"Adjective\",\n '[v]': 'Verb',\n '[n]': 'Noun'\n }\n\n const punctuation = /[,.“”\"':!?]/g; // Using this to check for punctuation marks.\n const word = /\\w+/g; // Using this to get all the word\n const type = /\\[[a|v|n]\\]/g; // Using this to check for [n], [v], or [a]\n \n const outputArr = []; // Declaring the array of objects. \n\n let wordsArr = rawStory.split(/\\s+/g); // Split the text\n\n for (let i = 0; i < wordsArr.length; i++) { // Iterating throught the array of Strings.\n const object = {};\n const puncObj = {};\n\n object.word = wordsArr[i].match(word)[0]; // Assigning only the word to object.word\n\n if(punctuation.test(wordsArr[i])) { // Checking if the word has any punctuation\n puncObj.word = wordsArr[i].match(punctuation)[0];\n console.log(puncObj);\n }\n\n if(type.test(wordsArr[i])){ // Checking if the word has any type\n object.pos = typeObject[wordsArr[i].match(type)[0]]\n }\n \n outputArr.push(object); // Pushing the object\n if (puncObj.hasOwnProperty('word')) outputArr.push(puncObj); // if puncObj has a word key, then push it\n\n }\n console.log(outputArr);\n return outputArr; // Returning the array of objects.\n}", "title": "" }, { "docid": "020c7086c720ed79040c67e7bedd476f", "score": "0.55646706", "text": "conjugate(person, number, tense, aspect) {\n\n let auxiliaryVerbs = \"\";\n\n // Continuous aspect -> Simple of 'to be' + present participle\n if (aspect === \"continuous\") {\n auxiliaryVerbs = verbToBe.conjugate(person, number, tense, \"simple\") + \" \";\n return auxiliaryVerbs + this.presentParticiple;\n }\n\n // Perfect continuous aspect -> Perfect of 'to be' + present participle\n if (aspect === \"perfect continuous\") {\n auxiliaryVerbs = verbToBe.conjugate(person, number, tense, \"perfect\") + \" \";\n return auxiliaryVerbs + this.presentParticiple;\n }\n\n // Perfect aspect -> Simple of 'to have' + past participle\n if (aspect === \"perfect\") {\n auxiliaryVerbs = verbToHave.conjugate(person, number, tense, \"simple\") + \" \";\n return auxiliaryVerbs + this.pastParticiple;\n // return auxiliaryVerbs + this.getParticiple();\n }\n\n // Simple future -> 'will' + stem\n if (tense === \"future\") {\n return \"will \" + this.stem;\n }\n\n // Otherwise (i.e. for present simple and past simple), use the forms lookup object\n return this.forms[tense][number][person];\n }", "title": "" }, { "docid": "6dbaee22c4a4489a2fe1f6cb218bdb3e", "score": "0.55519867", "text": "function main(verb, noun) {\r\n return `${verb}${noun}`\r\n}", "title": "" }, { "docid": "4dcb4de07f162baef02fbe520fae5c6c", "score": "0.55507153", "text": "function hapusPossesivePronoun(inputKata){\nvar huruf_akhiran_2=inputKata.substr(inputKata.length-2).toLowerCase(); //ambil 2 karakter terakhir dan ubah ke lower case\nvar huruf_akhiran_3=inputKata.substr(inputKata.length-3).toLowerCase(); //ambil 3 karakter terakhir dan ubah ke lower case\nif(huruf_akhiran_2=='ku' || huruf_akhiran_2=='mu'){\ninputKata=inputKata.slice(0,-2); //buang partikel 2 karakter terakhir\nreturn inputKata;\n}else if(huruf_akhiran_3=='nya'){\ninputKata=inputKata.slice(0,-3); //buang partikel 3 karakter terakhir\nreturn inputKata;\n}else{\nreturn inputKata;\n}\n}", "title": "" }, { "docid": "617c630c039e7c8b3a89728e850eaacd", "score": "0.552466", "text": "function main(verb, noun){\n return `${verb}${noun}`;\n}", "title": "" }, { "docid": "5c0692057e850eb5a52c8e1e0e04536c", "score": "0.5485012", "text": "function searchForAdjectives(){\n console.log('Adjective Search FIRE!!!!!!!!!!!!');\n potentialAdjective = [];\n for (let i = 0; i < segmentedFirstStatement.length; i++){\n if ( adjectiveArray.indexOf(segmentedFirstStatement[i].toLowerCase()) !== -1 ){\n console.log('there is a potential ADJECTIVE!')\n potentialAdjective.push(segmentedFirstStatement[i]);\n } else {\n console.log(segmentedFirstStatement[i] + ' is NOT an ADJECTIVE!')\n }\n }\n console.log(potentialAdjective);\n }", "title": "" }, { "docid": "2c5242145f6a89275ac517a8c1ea731b", "score": "0.54820675", "text": "function lemmatize($text) {\n\tvar text = $text;\n\tvar doc = nlp($text);\n\tvar verbs = doc.verbs().json();\n\tvar nouns = doc.nouns().json();\n\tvar nouns_ori = doc.nouns().toSingular().json();\n\n\t// verb\n\tverbs.forEach(obj => {\n\t\tlet now = obj.text;\n\t\tlet to = obj.conjugations.Infinitive;\n\n\t\t// do not change\n\t\tif (now === to) return;\n\t\tif (now === '') return;\t\t// e.g. there's will cause one empty entry\n\t\tif (now.indexOf(\"'\") >= 0) return;\t// e.g. didn't => not didn't\n\n\t\t// replace\n\t\tlet re = new RegExp(now, 'g');\n\t\ttext = text.replace(re, to);\n\t});\n\n\t// noun\n\tnouns.forEach((obj, i) => {\n\t\tlet now = obj.text;\n\t\tlet to = nouns_ori[i].text;\n\n\t\t// do not change\n\t\tif (now === to) return;\n\n\t\t// replace\n\t\tlet re = new RegExp(now, 'g');\n\t\ttext = text.replace(re, to);\n\t});\n\n\treturn text;\n}", "title": "" }, { "docid": "6be78418c723605fd87f853c083999f4", "score": "0.5464899", "text": "function someNoun(holder, sp, prevWord) {\n var uExcept = \"user-friendly\";\n var art = '';\n var temp = \"error!\";\n if (random(2) == 1) {\n if (prevWord == '') {\n //put item 7 of holder into temp\n temp = getItem(holder, 7);\n } else {\n //put item 1 of holder into temp\n temp = getItem(holder, 1);\n } // end if\n } else {\n if (random(2) == 1) {\n art = \"the \" + maybe(someAdj(holder));\n } else {\n if (sp != \"p\") {\n art = \"a \" + maybe(someAdj(holder));\n } else {\n art = \"some \" + maybe(someAdj(holder));\n } // end if\n } // end if\n if (sp != \"s\") {\n temp = getItem(holder, 2);\n } else {\n temp = getItem(holder, 10);\n } // end if\n } // end if\n\n repeat\n put someWord(temp) into trand\n if (trand != ''\n AND trand != last word of prevWord\n ) {\n if (sp != \"p\") {\n if (last char of trand != \"s\"\n AND trand != \"men\"\n AND trand != \"women\"--OR trand == \"fungus\"\n ) {\n exit repeat\n } // end if\n } else {\n if (last char of trand == \"s\"\n OR trand == \"men\"\n OR trand == \"women\"--AND trand != \"fungus\"\n ) {\n exit repeat\n } // end if\n } // end if\n } // end if\n} // end repeat", "title": "" }, { "docid": "eaf43a61b7a7aa62b29b298dcfbfd2de", "score": "0.54496616", "text": "function applyVerbTense(tense, verb) {\n // Find the first occurrence of \"-\", which we use to denote space in PDDL\n let index = verb.indexOf(\"-\");\n let leftover = \"\";\n if (index != -1) {\n leftover = \" \" + verb.substring(index + 1).replace(/-/g, \" \");\n verb = verb.substring(0, index);\n }\n if (tense === \"PAST\") {\n let output = \"\" + verb + \"ed\" + leftover;\n return output;\n }\n else if (tense === \"PRESENT\") {\n let output = \"\" + verb + \"s\" + leftover;\n return output;\n }\n else if (tense === \"FUTURE\") {\n let output = \"will \" + verb + leftover;\n return output;\n }\n}", "title": "" }, { "docid": "5ed1bff0fca337611434d8d4f915f5f6", "score": "0.5436056", "text": "function partOfSpeechTranslate(letters) {\r\n var lowerLetters = letters.toLowerCase();\r\n switch (lowerLetters) {\r\n case \"verb\":\r\n return \"v\";\r\n break;\r\n case \"noun\":\r\n return \"n\";\r\n break;\r\n case \"adjective\":\r\n return \"adj\";\r\n break;\r\n case \"adverb\":\r\n return \"adv\";\r\n break;\r\n case \"preposition\":\r\n return \"prep\";\r\n break;\r\n case \"suffix\":\r\n return \"sfx\";\r\n break;\r\n case \"prefix\":\r\n return \"pfx\";\r\n break;\r\n case \"interjection\":\r\n return \"int\";\r\n break;\r\n default:\r\n return letters;\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "c379c84c8dd78b38f4056aed7a1beadf", "score": "0.538514", "text": "function filterWordData(pos_list) {\n // can turn to true for some helpful console logs!\n var DEBUG = true;\n //console.log('input', pos_list)\n var words_data_filtered = [];\n var words_data_keys = Object.getOwnPropertyNames(words_data);\n\n /* So needed to do is identify 'Adverb, preposition' as 'adverb'\n * and 'preposition'. I made a dictionary (pos_dictionary) with a\n * list of everything it should add when it finds that word.\n * So 'Adverb' will be:\n * 'Adverb' : ['Adverb', 'Adverb, Conjunction', 'Adverb, Preposition'] etc.\n */\n // #################################################\n /* We used to add it based on the thing we were adding, but now we make it based on all possibilties\n * This separates out what we want to include and make pos_dict\n // Intialize a dictionary with all the parts of speech we want to add\n var pos_dictionary = {};\n for (var i=0; i<pos_list.length; i++){\n\tvar pos = pos_list[i];\n\tpos_dictionary[pos]= [];\n\n }\n */\n\n var pos_dictionary = {\n \"Adjective\" : [],\n \"Adjective_1\": [],\n \"Adjective_2\": [],\n \"Adjective_3\": [],\n \"Adjective_5\": [],\n \"Adjective_6\": [],\n \"Adjective_\" : [],\n \"Noun\" : [],\n \"Noun_1\": [],\n \"Noun_2\": [],\n \"Noun_3\": [],\n \"Noun_4\": [],\n \"Noun_5\": [],\n \"Noun_6\": [],\n \"Verb\": [],\n \"Verb_1\" : [],\n \"Verb_2\" : [],\n \"Verb_3\" : [],\n \"Verb_4\" : [],\n \"Verb_5\" : [],\n \"Article\": [],\n \"Particle\": [],\n \"Adverb\": [],\n \"Conjunction\": [],\n \"Interjection\": [],\n \"Preposition\": [],\n \"Pronoun\": [],\n \"Reg_Adv\": [],\n \"Idiom\": [],\n \"Number\": [],\n \"Proper_nouns\": [],\n \"\": [],\n \"CATCH_BAD\" : [],\n \"Noun_\" : [],\n \"stop_words\" : [],\n };\n\n\n if(DEBUG==true) {\n //console.log(\"pos_dictionary\", pos_dictionary);\n }\n // Now add (hopefully) all pos from the data appropriately\n\n // neither adj_2 or adj_ are buttons in the slideout, so we have to add them separate\n // We group them with adj_1\n for (var i=0; i<words_data_keys.length; i++) {\n\tvar key = words_data_keys[i];\n if (key == 'Proper_nouns'){\n //console.log('looking at a proper noun where we build the words to display')\n pos_dictionary['Proper_nouns'].push('Proper_nouns')\n // this should do nothing, but might make them visible.\n }\n if (key == 'stop_words'){\n pos_dictionary['stop_words'].push('stop_words')\n }\n\n\n\n // These things aren't 'real' parts of speech, so they would\n // always get filtered in this function.\n // To get around that, we 'tie' them to a real POS!\n if (key == 'Adjective_2'){\n pos_dictionary['Adjective_1'].push('Adjective_2');\n }\n if (key == 'Adjective_'){\n pos_dictionary['Adjective_1'].push('Adjective_');\n\t}\n if (key == 'Adjective'){\n pos_dictionary['Adjective_1'].push('Adjective');\n\t}\n if (key == 'Adjective_6'){\n\t pos_dictionary['Adjective_5'].push('Adjective_6');\n\t}\n if (key == 'Noun_'){\n pos_dictionary['Noun_1'].push('Noun_');\n }\n\n if (key == 'Noun'){\n pos_dictionary['Noun_1'].push('Noun');\n }\n\n\n // Now we split things listed like \"Pronoun, Adjective\"\n // and add \"Pronoun, Adjective\" to both \"Pronoun\" and \"Adjective\"\n // A regex that matches 1 or more commas and any number of spaces\n var prop_list = [];\n console.log(key)\n\n\n if (key.includes(\"_\") ) {\n\n var split = key.split(\"_\");\n var base_pos = split[0];\n var extra_pos = split[1]\n if (extra_pos){\n var extra_pos = split[1].split(',');\n for (var n=0; n< extra_pos.length; n++) {\n prop_list.push(base_pos + \"_\" + extra_pos[n]);\n }\n }\n }\n else{\n prop_list = key.split(/,+\\s*/); // old thing which worked!\n }\n\n console.log(prop_list);\n\tfor (var j=0; j<prop_list.length; j++){\n var prop = prop_list[j];\n console.log(prop);\n\t if(pos_dictionary[prop] != undefined){\n\t pos_dictionary[prop].push(key);\n }\n\n\n\t else{\n console.log(\"WARNING: Part of speech: '\" + prop + \"' from key: '\" + key + \"' is being added to CATCH_BAD which will always be displayed\");\n console.log(\"See instuctions at this line in main.js\")\n /* Basically, there is a lot of weird POS data that you\n * can't make any assumptions about. You can 'tie' the\n * bad data to good data by adding the bad pos to a\n * a real one in pos_dictionary.\n * For example, if \"Noun_\" is being caught by catch bad\n * (1) Make a note of how many items are currently being returned in the search as indicated AT THE BOTTOM OF THE PAGE\n because the top return number sometimes fibs\n * (2) Add the bad POS (\"Noun_\") to the if statements above, and push it onto the pos we want to tie to (I chose Noun_1, but ask Bret).\n * (3) In the initial pos_dictionary definition, add the bas pos (\"Noun_\")\n * (4) Check to make sure the warning isn't diplayed and the number of items being returned is the same\n\n * SIDE RELATED TIP: sometimes, there are non-english characters in the POS that look\n * TOTALLY NORMAL. For instance 'Αdjective' != 'Adjective'. So if it is not finding something in the POS_dictionary that\n * you clearly of just put in the dictionary, you probably have this sort of problem on your hands.\n * What should you do? Probably just complain on the Bridge Slack channel (politely).\n */\n\n\n pos_dictionary['CATCH_BAD'].push(key)\n }\n\t}\n\n }\n\n if (DEBUG == true){\n console.log(pos_dictionary, \"POS_DICT\");\n }\n // pos_dictionary now complete\n\n //console.log(\"pos_list (things to be displayed)\", pos_list);\n\n\n // modified should probably be called added\n var modified = {}; // modified: tracks the things we have already changed so we don't double add\n for (var i=0; i<words_data_keys.length; i++) {\n var key = words_data_keys[i];\n var key_index = pos_list.indexOf(key);\n\tif (key_index>=0){\n\t for(var j=0; j<pos_dictionary[key].length; j++){\n\t var prop = pos_dictionary[key][j];\n\t if (modified[prop] == undefined){\n\t modified[prop] = true;\n\n words_data_filtered = words_data_filtered.concat(words_data[prop]);\n\t }\n\n\t }\n\t // We used to removed items instead of marking them as modified\n\t // but then you couldn't properly view the list in console\n\t // so I switched it, but here is the line a removed\n // pos_list.splice(key_index,1); //rm that key from pos_list\n }\n else {\n if (DEBUG == true){\n console.log(\"WARNING: Not displaying\", key, \"(this might be expected)\");\n }\n }\n }\n // We separately add all the things in CATCH_BAD\n for(var j=0; j<pos_dictionary['CATCH_BAD'].length; j++){\n var prop = pos_dictionary['CATCH_BAD'][j];\n if (modified[prop] == undefined){\n\t modified[prop] = true;\n\t if (DEBUG == true){\n console.log(prop, \"POS added to data (but it was in CATCH_BAD)\");\n }\n\n words_data_filtered = words_data_filtered.concat(words_data[prop]);\n }\n }\n if (DEBUG == true){\n console.log(words_data_filtered, 'Words returned by filter');\n }\n return words_data_filtered;\n}", "title": "" }, { "docid": "63db032f4706fb6a5d6249e04b430e7d", "score": "0.53790796", "text": "function story(noun1, verb1, noun2, pronoun1, verb2) {\n return noun1 + \" \" + verb1 + \" \" + noun2 + \" because \" + pronoun1 + \" so \" + verb2\n}", "title": "" }, { "docid": "3ca57123b2a1d0f541a8ba0d3f54c6ff", "score": "0.53691167", "text": "function passiveVerb(){\n var pVerb_JSON =\n {\n sentence:'The sun is shining',\n subject:{\n value:'sun',\n modifiers:[\n {\n type:'determiner',\n value:'The'\n }\n ]\n },\n verb:{\n value:'is shining'\n }\n };\n\n var subject = pVerb_JSON[\"subject\"].value;\n\n var verb = pVerb_JSON[\"verb\"].value;\n\n var subjectMod = pVerb_JSON[\"subject\"].modifiers[0].value;\n\n drawPassiveVerb(subject,verb,subjectMod);\n}", "title": "" }, { "docid": "425b6eb2b75c52e78424fd63969c4dea", "score": "0.536595", "text": "function rule3(taggedSentence, index) {\r\n if (startsWith(taggedSentence[index][1], \"N\") && endsWith(taggedSentence[index][0], \"ed\")) {\r\n taggedSentence[index][1] = \"VBN\";\r\n }\r\n }", "title": "" }, { "docid": "e3b10034cbe1d97f31c5dd9d9a0d9f4e", "score": "0.5360788", "text": "function rule5(taggedSentence, index) {\r\n if (startsWith(taggedSentence[index][1], \"NN\") && endsWith(taggedSentence[index][0], \"al\")) {\r\n taggedSentence[index][1] = \"JJ\";\r\n }\r\n }", "title": "" }, { "docid": "085df1d2fba03a65ba365a165a29afab", "score": "0.5357819", "text": "function match_verb_and_tense(verb, phrase) {\n\tif (verb.tense == \"present\") {\n\t\treturn phrase.present;\n\t}\n\telse if (verb.tense == \"past\") {\n\t\treturn phrase.past;\n\t}\n\telse if (verb.tense == \"active\") {\n\t\treturn phrase.active;\n\t}\n}", "title": "" }, { "docid": "539f60ab3eccf0b08aa6b67d69565dd2", "score": "0.5337717", "text": "function wordBlanks(noun, adjective, verb, adVerb) {\n let resultingScentence = \"\";\n resultingScentence +=\n \"The \" + adjective + \" \" + noun + \" \" + verb + \" \" + adVerb + \" To Store\";\n return resultingScentence;\n}", "title": "" }, { "docid": "f33ee54cf18c517070d9d70ac6c71c10", "score": "0.53316396", "text": "function lookup(w,sentence,index){\n var pros, sylpros, final_word, new_word, word, last_syl, new_sounds, newpro;\n\n // You can't look the word 'constructor' up in javascript. It is a reserved word.\n if (w === \"constructor\"){\n pros = [[\"K AH0 N\",\"S T R AH1 K\",\"T ER0\"]];\n // First, check our hand-written dictionary\n } else if(ejdict[w]){\n pros = [ejdict[w]];\n // If the word matches a multiple pronunciation entry, grab both pronuncations\n } else if (syldict[w+\"(2)\"]){\n pros = [syldict[w],syldict[w+\"(2)\"]];\n // If the word matches a single pronunciation entry, grab it\n } else if (syldict[w]){\n pros = [syldict[w]];\n // If the word ends in 'ah', try the word as an 'er' word. This is used to \n // handle alternative pronunciation of words common in rap lyrics\n } else if (w.match(/\\w+?ah$/i)){\n new_word = w.match(/(\\w+?)ah/)[1] + \"er\";\n word = lookup(new_word,sentence,index);\n\n if(word && word.pros[0]){\n last_syl = word.pros[0].slice(-1)[0];\n new_sounds = last_syl.sounds.slice(0,last_syl.vowel_index);\n new_sounds = new_sounds.concat([\"AH0\"]);\n\n replacePros(word,new_sounds,last_syl);\n }\n word.word = w;\n return word;\n // If the word ends in n', try the word as an \"ng\" word\n } else if (w.match(/\\w+?n[\\'|’]?$/)){\n new_word = w.match(/\\w+/)[0] + \"g\";\n word = lookup(new_word,sentence,index);\n\n if(word && word.pros[0]){\n last_syl = word.pros[0].slice(-1)[0];\n new_sounds = last_syl.sounds;\n new_sounds = new_sounds.slice(0,-1).concat([\"N\"]);\n\n replacePros(word,new_sounds,last_syl);\n }\n word.word = w;\n return word;\n // If the word ends in s', try the word without the final apostrophe\n } else if (w.match(/\\w+?s[\\'|’]$/)){\n new_word = w.match(/\\w+/)[0];\n word = lookup(new_word,sentence,index);\n\n if(word && word.pros[0]){\n last_syl = word.pros[0].slice(-1)[0];\n new_sounds = last_syl.sounds;\n\n replacePros(word,new_sounds,last_syl);\n }\n word.word = w;\n return word;\n // If the word is an 's possessive, try to lookup the word without the s and then add\n // the sound back on\n } else if (w.match(/\\w+\\'s/)){\n new_word = w.match(/\\w+/)[0];\n word = lookup(new_word,sentence,index);\n\n if(word && word.pros[0]){\n last_syl = word.pros[0].slice(-1)[0];\n new_sounds = last_syl.sounds;\n new_sounds = new_sounds.concat([\"S\"]);\n\n replacePros(word,new_sounds,last_syl);\n }\n word.word = w;\n return word;\n // If the word is a plural, try the word without the s and then add the sound\n // back on \n } else if (w.match(/'\\w+?s/)){\n new_word = w.replace(/s$/,\"\");\n word = lookup(new_word,sentence,index);\n\n if(word && word.pros[0]){\n last_syl = word.pros[0].slice(-1);\n new_sounds = last_syl.sounds;\n new_sounds = new_sounds.slice(0,-1).concat([\"S\"]);\n\n replacePros(word,new_sounds,last_syl);\n }\n word.word = w;\n return word;\n // Otherwise, we cannot lookup the word\n } else {\n pros = [];\n console.log(\"Could not lookup\",w);\n }\n\n // Often \"-shan\" words such as \"Egyptian\" are pronounced as \"-shin\" words,\n // so add that pronunciation\n var er_fudge = false;\n if (pros.length === 1 && pros[0].slice(-1) && pros[0].slice(-1)[0] === \"SH AH0 N\"){\n newpro = _.clone(pros[0]);\n last_syl = newpro.pop();\n last_syl = \"SH IH0 N\";\n newpro.push(last_syl);\n pros.push(newpro);\n }\n\n // Often \"-er\" words such as \"monster are pronounced as \"-ah\" words (\"monstah\"),\n // so add that pronunciation\n if (pros.length > 0 && pros[0].slice(-1) && pros[0].slice(-1)[0].match(/ER\\d$/)){\n newpro = _.clone(pros[0]);\n last_syl = newpro.pop();\n last_syl = last_syl.replace(/(.*?)ER(\\d)$/,\"$1AH$2\");\n newpro.push(last_syl);\n pros.push(newpro);\n er_fudge = true;\n }\n\n // Often \"-ers\" words such as \"monster are pronounced as \"-ahs\" words (\"monstahs\"),\n // so add that pronunciation\n if (pros.length > 0 && pros[0].slice(-1) && pros[0].slice(-1)[0].match(/ER\\d Z$/)){\n newpro = _.clone(pros[0]);\n last_syl = newpro.pop();\n last_syl = last_syl.replace(/(.*?)ER(\\d) Z$/,\"$1AH$2 Z\");\n newpro.push(last_syl);\n pros.push(newpro);\n er_fudge = true;\n }\n\n // Map every pronunciation on to an array of Syls\n sylpros = _.map(pros, function(p,pi){\n return _.map(p, function(syl,syli){\n if(!syl){\n console.log(w);\n }\n return new Syl(syl.split(\" \"),syli,pi);\n });\n });\n\n // If we added an \"-er\" to \"-ah\" pronunciation, mark the syllable. We will\n // use this information to make rhymes against this pronunciation stricter\n if(er_fudge){\n if(sylpros.slice(-1)[0] && sylpros.slice(-1)[0].slice(-1)[0]){\n sylpros.slice(-1)[0].slice(-1)[0].er_fudge = true;\n }\n }\n\n final_word = new Phoword(w,sylpros,index);\n final_word.sentence = sentence;\n return final_word;\n }", "title": "" }, { "docid": "927d61596e670c4b1ce470376db4ac00", "score": "0.53289926", "text": "function get_negative_words(phrase){\n console.log(phrase); \n var phrase_words = phrase.split(\" \");\n og_afinn_num = 0;\n for (var i = 0; i < phrase_words.length; i++){\n if (afinn[phrase_words[i]]){\n og_afinn_num += afinn[phrase_words[i]];\n }\n if (afinn[phrase_words[i]] < 0){\n negative_words.push(phrase_words[i]);\n }\n }\n document.getElementById('ogword').innerHTML = phrase + \": \" + og_afinn_num + \"% positive\";\n while (count <= 3){\n get_synonyms(phrase, true, false);\n console.log(phrase);\n count += 1;\n }\n print_dict();\n}", "title": "" }, { "docid": "75afac5e880e8486ec4817d43864acc7", "score": "0.53020716", "text": "function wordBlank(noun, adjective, verb, adverb) {\n var result = \"\";\n result += \"My \" + noun + \"is \" + adjective + \"and \" + verb + adverb;\n return result;\n}", "title": "" }, { "docid": "a70dc72954640bad9c9180f70a343a57", "score": "0.52776694", "text": "speak(phrase) {\r\n \r\n //alternative 1: less code but it can fail if the last char in the phrase is a blank space\r\n let newPhrase = phrase.replaceAll(\" \",\" \"+this.sound+\" \"); // replace every blank space with the animal sound surrounded by spaces\r\n newPhrase += \" \"+this.sound; // add a last sound after the phrase\r\n \r\n // alternative 2: iterating the array of words in the phrase\r\n let words = phrase.split(\" \"); // split the phrase into an array of words\r\n let newPhrase2 = \"\"; // new phrase empty\r\n for(let i=0; i<words.length; i++){ \r\n if(i>0){ newPhrase2 +=\" \"; }; // if it's not the first word, i add a blank space\r\n newPhrase2 += words[i]+\" \"+this.sound; // adding the animal sound after each word\r\n }\r\n \r\n return newPhrase2; //returns the modified phrase using the alternative 2\r\n }", "title": "" }, { "docid": "7df75a90abb8c6052e14b0aa54d400ec", "score": "0.5272236", "text": "function processword(word, glossword) {\n if (!word || !glossword) {\n return []\n }\n var results = [];\n var morphemes = word.split('-');\n var glosses = glossword.split('-');\n //if there is not the same number of dashes we aren't aligning the correct morphemes and gloss\n if (morphemes.length!=glosses.length) {\n return [];\n }\n var rootindex = -1;\n //identify verb roots so we can distinguish prefixes from suffixes\n for (var i = 0; i < glosses.length; i++) {\n var gloss = glosses[i];\n //all verb root morphemes end with .rt or .aux\n //TODO: does this include be.loc, be.1d, be.2d, etc? @HSande for details\n if (_.endsWith(gloss, '.rt') || _.endsWith(gloss, '.aux')) {\n rootindex = i;\n }\n }\n //iterate over morphemes; if there is a verb root, add pre-dashes to suffixes and post-dashes to prefixes: \n //example: g-a-s-o; clg-rtc-eat.rt-pfv = [g-, a-, s, -o]; [clg-, rtc-, eat.rt, -pfv]\n for (var i = 0; i < glosses.length; i++) {\n var gloss = glosses[i];\n var morpheme = morphemes[i];\n if (rootindex==-1) {\n results.push({moroword:morpheme, definition:gloss});\n } else {\n if (i < rootindex) {\n gloss = gloss+'-';\n morpheme = morpheme+'-';\n results.push({moroword:morpheme, definition:gloss});\n } else if (i > rootindex) {\n gloss = '-'+gloss;\n morpheme = '-'+morpheme;\n results.push({moroword:morpheme, definition:gloss});\n } else {\n results.push({moroword:morpheme, definition:gloss});\n }\n }\n }\n return results\n }", "title": "" }, { "docid": "a5803b5a1be03c3af58678bfb647f767", "score": "0.5267432", "text": "function WordParser () {}", "title": "" }, { "docid": "93fc264162c0b702856cb24da3a6ec4b", "score": "0.52412915", "text": "function suggestPaw(){\n // generate a random number 4 or 5. be number of letters selected\n let k = Math.round(Math.random() + 4);\n // get the nouns\n let str = [];\n for(let n=0; n<k ;n++){\n // generate a random number in list\n let tmp = Math.floor(Math.random()*noun_list.length);\n str.push(noun_list[tmp]);\n }\n return str.join(\"-\");\n}", "title": "" }, { "docid": "c4634d56cee767ed72dd51319fa1bd18", "score": "0.5227328", "text": "function checkWords() {\n $approvedWords = 0;\n let str = $(\"#textInput\").val();\n\n // split the blog post to check every word individually\n let blogWords = str.split(\" \");\n\n // go through the blog post and check every word to see if it corresponds to any of the available arrays\n for (let i=0; i<blogWords.length; i++) {\n for (let cpt=0; cpt<$availablePositiveVerbs.length && $availableNegativeVerbs.length && $availablePositiveWords.length && $availableNegativeWords.length; cpt++) {\n\n switch(blogWords[i]) {\n\n // if it's positive verb, count it as plus one\n case $availablePositiveVerbs[cpt].toLowerCase():\n positiveVerb+=1;\n break;\n\n // if it's negative verb, count it as a negative plus one\n case $availableNegativeVerbs[cpt].toLowerCase():\n negativeVerb+=1;\n break;\n\n // if it's positive word, plus one\n case $availablePositiveWords[cpt].toLowerCase():\n positiveWord+=1;\n break;\n\n // if it's negative word, plus one\n case $availableNegativeWords[cpt].toLowerCase():\n negativeWord+=1;\n break;\n }\n }\n }\n\n // after checking the value of the words, generate the post\n // check if sentence is negative or positive! depending on the combination, connotation will differ\n if (negativeVerb >= 1 && positiveWord >=1) {\n negative+=1;\n }\n\n else if (negativeVerb >= 1 && negativeWord >=1) {\n positive+=1;\n }\n\n else if (positiveVerb >= 1 && negativeWord >=1) {\n negative+=1;\n }\n\n else if (positiveVerb >= 1 && positiveWord >=1) {\n positive+=1;\n }\n writePost();\n }", "title": "" }, { "docid": "2e27f75b1e548270081e953e96e1d6fe", "score": "0.5223479", "text": "function getMeaning(i) {\n var result=-1;\n var j;\n\n for(j=0; j<dic.length; j++) {\n if(dic.word[j]==compound[i] && dic.reading[j]==reading[i]) {\n //result=dic.word[j]+'&nbsp;'+dic.meaning[j];\n result=j;\n break;\n }\n }\n if(result!=-1) return result;\n\n for(j=0; j<dic.length; j++) {\n if((dic.word[j]=='~'+compound[i] && dic.reading[j]=='~'+reading[i]) ||\n (dic.word[j]==compound[i]+'~' && dic.reading[j]==reading[i]+'~')) {\n //result=dic.word[j]+'&nbsp;'+dic.meaning[j];\n result=j;\n break;\n }\n }\n if(result!=-1) return result;\n\n var stem;\n var verbType;\n for(j=0; j<dic.length; j++) {\n\n if(dic.word[j].substr(0,1)==compound[i].substr(0,1) && dic.reading[j].substr(0,1)==reading[i].substr(0,1)) {\n\n verbType=dic.meaning[j].replace(/^[^v]*(v[15][bgkmnrstu]?)?.*$/, \"$1\");\n if(dic.meaning[j].match(/vs-s/)) verbType='vs-s';\n\n if(verbType!='') {\n //alert(\"compound=\"+compound[i]+\" dic1=\"+dic1[j]+\" dic4=\"+dic4[j]+\" verbType=\"+verbType);\n stem=dic.word[j].substr(0,dic.word[j].length-1);\n if(verbType=='vs-s') stem=stem.substr(0,stem.length-1);\n result=examineVerb(j,compound[i],stem,verbType,1);\n\n } else if(dic.meaning[j].match(/adj[^-]/)) {\n stem=dic.word[j].substr(0,dic.word[j].length-1);\n //alert(\"i-Adj: compound=\"+compound[i]+\" dic.word=\"+dic.word[j]+\" dic.meaning=\"+dic.meaning[j]+\" stem=\"+stem);\n result=examineAdj(j,compound[i],stem);\n }\n\n }\n if(result!=-1) break;\n }\n return result;\n}", "title": "" }, { "docid": "4590d7ba1529cfcfb4a50e9941b35504", "score": "0.5219403", "text": "function printDefinition() {\n $(\"#dictionaryDisplay\").removeClass(\"hide\");\n $(\"#dictionaryDisplay\").append(\"<p id='noun'> Noun: \" + noun + \"</p>\");\n $(\"#dictionaryDisplay\").append(\"<p id ='verb'> Verb: \" + verb + \"</p>\");\n $(\"#dictionaryDisplay\").append(\n \"<p id ='adverb'> Adverb: \" + adverb + \"</p>\"\n );\n $(\"#dictionaryDisplay\").append(\n \"<p id ='adjective'> Adjective: \" + adjective + \"</p>\"\n );\n }", "title": "" }, { "docid": "bad7c074530443cf5bc3b15ab93a8234", "score": "0.5214778", "text": "function translate() {\r\n\r\n $('#final-text').empty();\r\n\r\n /* VARIABLES\r\n ========================================================================================= */\r\n var original = $('#sentence').val();\r\n var sentenceArray = original.split(\" \");\r\n var trumpDictionary = {};\r\n var newArray = [];\r\n var replacementMade = false;\r\n var connotationCount = 0;\r\n var connotationWord = 0;\r\n var fakeNews = false;\r\n\r\n /* =======================================================================================\r\n ====================================================================================== */\r\n\r\n /* TRUMP DEFINITIONS\r\n ========================================================================================= */\r\n\r\n /* CONNOTATION - VALUES\r\n =========================================================================================\r\n\r\n 0 ---> NO CONNOTATION\r\n 1 ---> BAD CONNOTATION\r\n 2 ---> GOOD CONNOTATION\r\n 3 ---> FAKE NEWS\r\n\r\n ==========================================================================================\r\n */\r\n\r\n trumpDictionary.love = [\"absolutely love\", 2];\r\n trumpDictionary.good = [\"fantastic\", 2];\r\n trumpDictionary.hillary = [\"Crooked Hillary\", 1];\r\n trumpDictionary.putin = [\"my friend, Vlad\", 0];\r\n trumpDictionary.russia = [\"my friends in Russia\", 0];\r\n trumpDictionary.big = [\"yuge\", 0];\r\n trumpDictionary.huge = [\"yuge\", 0];\r\n trumpDictionary.giant = [\"massive\", 0];\r\n trumpDictionary.large = [\"massive\", 0];\r\n trumpDictionary.enormous = [\"yuge\", 0];\r\n trumpDictionary.china = [\"Ghina\", 0];\r\n trumpDictionary.bad = [\"horrible\", 1];\r\n trumpDictionary.amazing = [\"tremendous\", 2];\r\n trumpDictionary.caucus = [\"freedom causus\", 0];\r\n trumpDictionary.failed = [\"disgraced\", 1];\r\n trumpDictionary.failure = [\"disgrace\", 1];\r\n trumpDictionary.years = [\"solid years, bigly\", 0];\r\n trumpDictionary.country = [\"great country\", 2];\r\n trumpDictionary.media = [\"FAKE NEWS\", 3];\r\n trumpDictionary.news = [\"FAKE NEWS\", 3];\r\n trumpDictionary.cnn = [\"FAKE NEWS\", 3];\r\n trumpDictionary.buzzfeed = [\"FAKE NEWS\", 3];\r\n trumpDictionary.obamacare = [\"awful Obamacare\", 1];\r\n trumpDictionary.people = [\"PEOPLE\", 0];\r\n trumpDictionary.attack = [\"terrorist attack\", 0];\r\n trumpDictionary.working = [\"working hard\", 0];\r\n trumpDictionary.war = [\"massive war\", 0];\r\n trumpDictionary.took = [\"grabbed\", 0];\r\n trumpDictionary.hate = [\"hate\", 1];\r\n trumpDictionary.protests = [\"hateful protests\", 1];\r\n trumpDictionary.melania = [\"my sweet Melania\", 2];\r\n trumpDictionary.ivanka = [\"Ivanka (who is gorgeous, might I add)\", 2];\r\n trumpDictionary.administration = [\"Empire\", 2];\r\n trumpDictionary.like = [\"like\", 2];\r\n trumpDictionary.enjoy = [\"really enjoy, and I mean it,\", 2];\r\n\r\n trumpDictionary.ending_Sad = \"Sad!\";\r\n trumpDictionary.ending_Good = \"Tremendous!\";\r\n trumpDictionary.ending_News = \"Fake news is the enemy of the American people!\";\r\n\r\n /* =======================================================================================\r\n ========================================================================================= */\r\n\r\n /* PSEUDOCODE -- MAIN PROCESS\r\n\r\n --- MAIN PROCESS ---\r\n 1. Split sentence into seperate words in array using the native .split() method.\r\n 2. Go through each word in array and check against every word in the trumpDictionary.\r\n 3. If the word in the array matches what is in the dictionary, then it will put the replaced word into a new array.\r\n 4. If that word is punctuated, the punctuation will not be included in the replacement.\r\n 5. If a replacement has been made, the loop is broken out of.\r\n 6. If a replacement cannot be made, then the original word is added to the array.\r\n 7. Finally, the final array is put together into a String and added to the layout.\r\n\r\n --- OTHER FEATURES ---\r\n 1. Replacement - Replace \"Trump-Trigger\" words with the language that Trump would use.\r\n 2. Connotation - Detect connotation and wording of sentence and add endings depending on sentence's connotation.\r\n 3. Capitalization - Code is structured to change capital letters to properly display sentence.\r\n\r\n --- TO-DO ---\r\n 1. Fix start of sentence with lowercase.\r\n 2. Add more words.\r\n\r\n */\r\n\r\n /* PROGRAM'S MAIN LOOP -- GREG DAVIDSON SEGMENT\r\n ========================================================================================= */\r\n for (var i = 0; i < sentenceArray.length; i++) {\r\n\r\n for (key in trumpDictionary) {\r\n\r\n var value = trumpDictionary[key];\r\n\r\n if (sentenceArray[i].includes(key) || (sentenceArray[i].toLowerCase()).includes(key)) {\r\n\r\n if (sentenceArray[i].length > key.length) {\r\n\r\n newArray.push(sentenceArray[i].replace(sentenceArray[i].substring(0, key.length), value[0]));\r\n\r\n }\r\n else {\r\n\r\n newArray.push(sentenceArray[i].replace(sentenceArray[i], value[0]));\r\n\r\n }\r\n\r\n replacementMade = true;\r\n\r\n if (value[1] == 3) {\r\n\r\n fakeNews = true;\r\n connotationWord += 1;\r\n\r\n }\r\n else {\r\n\r\n connotationCount += value[1];\r\n\r\n if (value[1] != 0) {\r\n\r\n connotationWord += 1;\r\n\r\n }\r\n\r\n }\r\n\r\n break;\r\n\r\n }\r\n\r\n }\r\n\r\n if (!replacementMade) {\r\n\r\n newArray.push(sentenceArray[i]);\r\n\r\n }\r\n\r\n replacementMade = false;\r\n\r\n }\r\n\r\n /* =======================================================================================\r\n ====================================================================================== */\r\n\r\n /* CONNOTATION - PROCESS -- GREG DAVIDSON SEGMENT\r\n ========================================================================================= */\r\n if (fakeNews) {\r\n\r\n newArray.push(trumpDictionary.ending_News);\r\n\r\n }\r\n else {\r\n\r\n if (connotationWord > 0) {\r\n\r\n var connotationAverage = connotationCount / connotationWord;\r\n\r\n if (connotationAverage > 1.5) {\r\n\r\n newArray.push(trumpDictionary.ending_Good);\r\n\r\n }\r\n else {\r\n\r\n newArray.push(trumpDictionary.ending_Sad);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n /* =======================================================================================\r\n ====================================================================================== */\r\n\r\n /* PUT TOGETHER AND DISPLAY FINAL STRING -- POOJA KOTAK SEGMENT\r\n ========================================================================================= */\r\n var finalString = \"\";\r\n\r\n var firstWord = newArray[0].split(' ');\r\n finalString += \"<span class=\\\"cap\\\">\" + firstWord[0] + \"</span> \";\r\n\r\n /* === ONLY FOR FIRST WORD === */\r\n for (var i = 1; i < firstWord.length; i++) {\r\n\r\n finalString += firstWord[i] + \" \";\r\n\r\n }\r\n\r\n if (newArray.length > 1) {\r\n\r\n finalString += newArray[1] + \" \";\r\n\r\n /* === FOR ALL OTHER WORDS === */\r\n for (var i = 2; i < newArray.length; i++) {\r\n\r\n if (newArray[i - 1].substring(newArray[i - 1].length - 1, newArray[i - 1].length) == '.' ) {\r\n\r\n var word = newArray[i].split(' ');\r\n finalString += \"<span class=\\\"cap\\\">\" + word[0] + \"</span> \";\r\n\r\n for (var j = 1; j < word.length; j++) {\r\n\r\n finalString += word[j] + \" \";\r\n\r\n }\r\n\r\n }\r\n else if (newArray[i - 1].substring(newArray[i - 1].length - 1, newArray[i - 1].length) == '!' ) {\r\n\r\n var word = newArray[i].split(' ');\r\n finalString += \"<span class=\\\"cap\\\">\" + word[0] + \"</span> \";\r\n\r\n for (var j = 1; j < word.length; j++) {\r\n\r\n finalString += word[j] + \" \";\r\n\r\n }\r\n\r\n }\r\n else if (newArray[i - 1].substring(newArray[i - 1].length - 1, newArray[i - 1].length) == '?' ) {\r\n\r\n var word = newArray[i].split(' ');\r\n finalString += \"<span class=\\\"cap\\\">\" + word[0] + \"</span> \";\r\n\r\n for (var j = 1; j < word.length; j++) {\r\n\r\n finalString += word[j] + \" \";\r\n\r\n }\r\n\r\n }\r\n else {\r\n\r\n finalString += newArray[i] + \" \";\r\n\r\n }\r\n }\r\n\r\n }\r\n\r\n $('<h1>' + finalString + '</h1>').appendTo('#final-text');\r\n\r\n }", "title": "" }, { "docid": "cbdd5e6301bf15bc096d3318d2f77ec0", "score": "0.52090406", "text": "function simple(spx, isThe, tense, vocab) {\n put ''\n into sentence\n put ''\n into pWord\n if (spx != 1) {\n put \"s\"\n into spz\n } else {\n put \"p\"\n into spz\n } // end if\n put someNoun(vocab, spz, pWord) into pWord\n put pWord + \" \"\n after sentence\n // put someAdv(vocab) + \" \" after sentence\n if (tense == 2) {\n put someVerb(vocab, \"p\") into testV\n if (testV == \"is\"\n or testV == \"are\") {\n put \"will be\" + \" \"\n after sentence\n } else {\n put \"will\" && testV + \" \"\n after sentence\n } // end if\n } else {\n put someVerb(vocab, spz) into testV\n put testV + \" \"\n after sentence\n } // end if\n if (testV == \"is\"\n OR testV == \"are\"\n ) {\n if (random(2) == 1) {\n put someAdj(vocab) after sentence\n } else {\n put someNoun(vocab, spz, pWord) after sentence\n } // end if\n } else {\n put someNoun(vocab, spz, pWord) after sentence\n } // end if\n return sentence\n} // end simple", "title": "" }, { "docid": "851384130152f912bd9c0e6d6ade586e", "score": "0.52000076", "text": "function onEvent(name, event) {\n //console.log(name, JSON.stringify(event, null, 2));\n\nif (typeof event.results !== 'undefined' && event.results !== null){\n console.log(event.results[0].keywords_result);\n //var kw = event.results[0].keywords_result.hello[0].normalized_text;\n var result = event.results[0].alternatives[0].transcript;\n //console.log(\"Keyword is:\", kw);\n console.log(\"Alternative transcript is:\", result);\n\n nlu.analyze(\n {\n text: event.results[0].alternatives[0].transcript,\n //event.results[0].alternatives[0].transcript, // Buffer or String\n features: {\n semantic_roles: {},\n keywords: {}\n }\n },\n function(err, response) {\n if (err) {\n console.log('error:', err);\n } else {\n //console.log(JSON.stringify(response, null, 2));\n // var sentence = response.semantic_roles[0].sentence;\n // console.log(\"To restate, this is what you said:\",sentence);\n var k1 = response.keywords[0].text;\n console.log(k1);\n var k2 = response.keywords[1].text;\n console.log(k2); //*/\n var currentDate = new Date();\n //console.log('current date:',currentDate);\n\n MongoClient.connect('mongodb://localhost:27017/DubHacks', (err, client) => {\n if (err) {\n console.log('Unable to connect to MongoDB server');\n }\n console.log('Connected to MongoDB server');\n const db = client.db('DubHacks');\n\n db.collection('Speech').insertOne({\n item:k1,\n location: k2,\n date: currentDate\n }, (err,result) => {\n if (err) {\n return console.log('Unable to insert item', err);\n }\n console.log(JSON.stringify(result.ops, undefined, 2));\n })\n\n db.collection('Speech').find({\n item: 'glasses',\n //date: '2018-10-21T17:14:14.271Z'\n }).toArray().then((docs) => {\n //console.log('Item:', Speech[0].item);\n console.log(docs[docs.length - 1]);\n // console.log(location);\n //console.log(JSON.stringify(docs, undefined, 2));\n //console.log(docs['']);\n\n\n for (var key in docs)\n {\n if (docs.hasOwnProperty(key))\n {\n var i = docs[key].item;\n var l = docs[key].location;\n var d = docs[key].date;\n //console.log(i);\n //console.log(l);\n //console.log(d);\n }\n }\n\n }, (err) => {\n console.log('Unable to fetch item', err)\n });\n\n\n client.close();\n });\n }\n }\n );\n\n}\n\n //{ results:\n //[ { keywords_result: [Object], alternatives: [Array], final: true } ],\n\n}", "title": "" }, { "docid": "91a17d299ef104016d70b7398efb7822", "score": "0.51917356", "text": "function pluralizer(noun,num) {\n if(noun===\"sheep\"){\n return num+\" \"+noun\n //checks if argument is sheep then returns num+noun\n }else if(noun===\"goose\"){\n if(num===1 || num===-1){\n return num+\" \"+noun\n }else{\n return num+\" \"+\"geese\"\n }\n //checks first if the arument is goose then checks the num to see the plural and returns the right awnsers accordingly\n }else if(noun ===\"child\"){\n if(num===1 || num===-1){\n return num+\" \"+\"child\"\n }else{\n return num+\" \"+\"children\"\n }\n //checks first if the arument is child then checks the num to see the plural and returns the right awnsers accordingly\n }else if(noun===\"person\"){\n if(num===1 || num===-1){\n return num+\" \"+noun\n }else{\n return num+\" \"+\"people\"\n }\n //checks first if the arument is person then checks the num to see the plural and returns the right awnsers accordingly\n }else if(noun===\"species\"){\n return num+\" \"+noun\n return num+\" \"+noun\n //checks if argument is species then returns num+noun\n }else{\n if(num===1 || num===-1){\n return num+\" \"+noun\n }else{\n return num+\" \"+noun+\"s\"\n }\n //takes the noun and adds a s for the condition of the num\n }\n\n}", "title": "" }, { "docid": "2f930c2459c7d810897803f440679287", "score": "0.5156559", "text": "function change() {\n\n\tif (this.id == 'noun') {\n\n\t\tnounsNum++;\n\t\n\t\tif (nounsNum > nouns.length - 1) {\n\t\n\t\t nounsNum = 0;\n\t\n\t\t}\n\t\n\t\tspeakNow(nouns[nounsNum]);\n\t\n\t }\n\n\t if (this.id == 'verb') {\n\n\t\tverbsNum++;\n\t\n\t\tif (verbsNum > verbs.length - 1) {\n\t\n\t\t verbsNum = 0;\n\t\n\t\t}\n\t\n\t\tspeakNow(verbs[verbsNum]);\n\t\n\t }\n\n\t if (this.id == 'adjectives') {\n\n\t\tadjectivesNum++;\n\t\n\t\tif (adjectivesNum > adjectives.length - 1) {\n\t\n\t\t adjectivesNum = 0;\n\t\n\t\t}\n\t\n\t\tspeakNow(adjectives[adjectivesNum]);\n\t\n\t }\n\n\t if (this.id == 'nouns2') {\n\n\t\tnouns2Num++;\n\t\n\t\tif (nouns2Num > nouns2.length - 1) {\n\t\n\t\t nouns2Num = 0;\n\t\n\t\t}\n\t\n\t\tspeakNow(nouns2[nouns2Num]);\n\t\n\t }\n\n\t if (this.id == 'places') {\n\n\t\tplacesNum++;\n\t\n\t\tif (placesNum > places.length - 1) {\n\t\n\t\t placesNum = 0;\n\t\n\t\t}\n\t\n\t\tspeakNow(places[placesNum]);\n\t\n\t }\n}", "title": "" }, { "docid": "772f412939bcd388416ad7b79b8b6313", "score": "0.5149161", "text": "function submitForm(event){\n refreshDesc();\n // command = shortcut for capitalised user input\n var command = commandForm[\"commandBox\"].value.toUpperCase();\n // Search string for accepted verbs and nouns\n console.log('Form submitted. Value:' + commandForm[\"commandBox\"].value);\n testForVerb(command);\n testForNoun(command);\n testForProp(command);\n testForDesc(command);\n\n console.log(\"Parsed verb passed to submitForm with value of \" + parsedVerb);\n if (parsedVerb==null){\n console.log(\"Parsed verb not available - value is \" + parsedVerb)\n }\n\n console.log(\"Parsed noun passed to submitForm with value of \" + parsedNoun);\n if (parsedNoun==null){\n console.log(\"Parsed noun not available - value is \" + parsedNoun)\n }\n //combine verb and noun\n switch (parsedVerb) {\n case \"PICKUP\":\n if (parsedNoun===null) {\n createPara(`${warningMild(\"I'm not sure what to pick up\")}`);\n }\n else {\n pickUpHandler(parsedNoun,parsedDesc);\n }\n break;\n case \"DROP\":\n if (parsedNoun===null) {\n createPara(`${warningMild(\"I'm not sure what you want to drop.\")}`);\n }\n else {\n dropHandler(parsedNoun,parsedDesc);\n }\n break;\n //TODO: Add other verbs here, with parsedVerb passed in, to be handled by objects\n case \"UNLOCK\":\n case \"LOCK\":\n case \"EXAMINE\":\n case \"USE\":\n if (parsedNoun===null&&parsedProp===null) {\n createPara(`${warningMild(\"I'm not sure what you want to use.\")}`);\n //Above, add dynamic to lower variable for the verb\n }\n else {\n useHandler(parsedVerb, parsedNoun, parsedProp, parsedDesc);\n }\n }\n\n\n // Match to directions\n switch (command) {\n\n // Commands for North\n case \"N\":\n case \"NORTH\":\n goNorth();\n break;\n\n // Commands for East\n case \"E\":\n case \"EAST\":\n goEast();\n break;\n\n // Commands for South\n case \"S\":\n case \"SOUTH\":\n goSouth();\n break;\n\n // Commands for West\n case \"W\":\n case \"WEST\":\n goWest();\n break;\n\n //Pick up handler\n // case \"PICK UP KEY\":\n // case \"PICK UP BLUE KEY\":\n // if (blueKey===false) {\n // console.log(\"key input\");\n // if (longLat==='0,-1'){\n // blueKey=true;\n // console.log(\"key pickup\");\n // refreshDesc();\n // createPara(\"You pick up the key.\");\n // //You pick up the Blue Key\n // }\n // else {\n // console.log(longLat);\n // console.log(longitude);\n // console.log(latitude);\n // console.log(\"wrong longLat\");\n // createPara(\"There is no key here.\");\n // //There is no key here.\n // }\n // }\n // else {\n // //You already have the blue key.\n // }\n // break;\n // ---- Above is pick up handler ---- //\n //Use key\n // case \"USE KEY\":\n // case \"USE KEY ON DOOR\":\n // case \"USE BLUE KEY\":\n // case \"USE BLUE KEY ON DOOR\":\n // if (blueKey===false) {\n // createPara(\"You do not have a key\");\n // }\n // else if (blueKey===true) {\n // if (longLat==='0,0') {\n // doorStatus=true;\n // refreshDesc();\n // createPara(\"You open the door to the North.\");\n // }\n // else {\n // createPara(\"There is nowhere to use the key.\");\n // }\n // }\n // break;\n // case \"PICK UP RED KEY\":\n // if (redKey.inInventory===false) {\n // console.log(\"key input\");\n // if (longLat===redKey.location){\n // redKey.inInventory=true;\n // console.log(\"key pickup\");\n // refreshDesc();\n // createPara(\"You pick up the red key.\");\n // //You pick up the Red Key\n // }\n // else {\n // console.log(longLat);\n // console.log(longitude);\n // console.log(latitude);\n // console.log(\"wrong longLat\");\n // createPara(\"There is no red key here.\");\n // //There is no key here.\n // }\n // // break;\n // }\n }\n commandForm.reset();\n event.preventDefault();\n}", "title": "" }, { "docid": "d653d38003af739a6e44a9fc5e5615cd", "score": "0.51466644", "text": "function Animals(words) {\n this.speak = words;\n}", "title": "" }, { "docid": "ea14b0fc1c1e36564a40be784c758833", "score": "0.51360095", "text": "function madlib(animal, verb, descript, object) {\n var fullSen = \"The\" + \" \" + animal + \" \" + verb + \" \" + \"over the\" + \" \" + descript + \" \" + object;\n return fullSen;\n}", "title": "" }, { "docid": "09fa55d661041cd265cfca739d6b8bce", "score": "0.51317996", "text": "function processword(word, glossword) {\n if (!word || !glossword) {\n return [[], []]\n }\n var results = [];\n var click_database_result = [];\n var morphemes = word.split('-');\n var glosses = glossword.split('-');\n //if there is not the same number of dashes we aren't aligning the correct morphemes and gloss\n if (morphemes.length!=glosses.length) {\n return [[], []];\n }\n var rootindex = -1;\n //identify verb roots so we can distinguish prefixes from suffixes\n for (var i = 0; i < glosses.length; i++) {\n var gloss = glosses[i];\n //all verb root morphemes end with .rt or .aux\n //TODO: does this include be.loc, be.1d, be.2d, etc? @HSande for details\n if (_.startsWith(gloss, 'be.') || _.endsWith(gloss, '.rt') || _.endsWith(gloss, '.aux')) {\n rootindex = i;\n }\n }\n //iterate over morphemes; if there is a verb root, add pre-dashes to suffixes and post-dashes to prefixes: \n //example: g-a-s-o; clg-rtc-eat.rt-pfv = [g-, a-, s, -o]; [clg-, rtc-, eat.rt, -pfv]\n for (var i = 0; i < glosses.length; i++) {\n var gloss = removePunc(glosses[i].toLowerCase());\n // Remove punctuation, make lower case, and replace all \"Latin Letter\n // Small Schwa\" characters with \"Latin Letter Smal E\" characters, so\n // there is just one schwa character in the corpus. \n var morpheme =\n removePunc(morphemes[i].toLowerCase().replace(/\\u0259/g,'\\u01DD'))\n \n if (gloss.match(/^[0-9]*$/)){\n continue\n }\n if (rootindex==-1) {\n results.push({moroword:[{word:morpheme, count:1}], definition:gloss});\n click_database_result.push({moroword:morpheme, definition:gloss});\n } else {\n if (i < rootindex) { \n gloss = gloss+'-';\n morpheme = morpheme+'-';\n results.push({moroword:[{word:morpheme, count:1}], definition:gloss});\n click_database_result.push({moroword:morpheme, definition:gloss});\n } else if (i > rootindex) {\n gloss = '-'+gloss;\n morpheme = '-'+morpheme;\n results.push({moroword:[{word:morpheme, count:1}], definition:gloss});\n click_database_result.push({moroword:morpheme, definition:gloss});\n } else {\n results.push({moroword:[{word:morpheme, count:1}], definition:gloss});\n click_database_result.push({moroword:morpheme, definition:gloss});\n }\n }\n }\n return [results, click_database_result];\n }", "title": "" }, { "docid": "528e9be8b2ce90047333ea5744aa511e", "score": "0.5131601", "text": "constructor() {\n this.missed = 0;\n this.activePhrase = null;\n this.phrases = [new Phrase('The ship has sailed'),\n new Phrase('Time is money'), \n new Phrase('Weather the storm'), \n new Phrase('Fit as a fiddle'),\n new Phrase('Live and Learn')]; \n }", "title": "" }, { "docid": "d8e231308725e5e50e9d7b0e62e3e96d", "score": "0.5131599", "text": "function newphrase(){}", "title": "" }, { "docid": "4bb0d2dbd8dc546b69477be1f08c4b12", "score": "0.51180726", "text": "function averageMod(msg)\n{\n if(mad_lib)\n {\n easyMod(msg);\n madLib(msg, '\\\\b(com|cum|kum|kom)(m)?(e)?(\\\\b))', verbArray);\n madLib(msg, '\\\\b(dad)(d)?(y)?(\\\\b)', nounArray);\n madLib(msg, '\\\\b(su)(k|c|ck|kc|q)', verbArray);\n madLib(msg, '\\\\b(li)(k|c|ck|kc|q)', verbArray);\n }\n else\n {\n easyMod(msg);\n insertWord(msg, '\\\\b(com|cum|kum|kom)(m)?(e)?(\\\\b)');\n insertWord(msg, '\\\\b(dad)(d)?(y)?(\\\\b)');\n insertWord(msg, '\\\\b(su)(k|c|ck|kc|q)');\n insertWord(msg, '\\\\b(li)(k|c|ck|kc|q)');\n }\n}", "title": "" }, { "docid": "d122b81452e5ebfe186e3ed2cea907bc", "score": "0.511625", "text": "function SceneDirector() {\n\t\tthis.verbs = [\n\t\t{\n\t\t\tverb: 'MOVE',\n\t\t\talias: ['HEAD', 'MOVES', 'HEADS'],\n\t\t\thandler: move,\n\t\t\tactionStateComplete: moveComplete,\n\t\t\tadverbs: ['SLOWLY', 'QUICKLY'],\n\t\t\tprepositions: []\n\t\t},\n\t\t{\n\t\t\tverb: 'WALK',\n\t\t\thandler: move,\n\t\t\talias: ['WALKS'],\n\t\t\tactionStateComplete: moveComplete,\n\t\t\tadverbs: ['SLOWLY', 'QUICKLY'],\n\t\t\tprepositions: []\n\t\t},\n\t\t{\n\t\t\tverb: 'RUN',\n\t\t\talias: ['RUNS'],\n\t\t\thandler: move,\n\t\t\tactionStateComplete: moveComplete,\n\t\t\tadverbs: ['SLOWLY', 'QUICKLY'],\n\t\t\tprepositions: []\n\t\t},\n\t\t{\n\t\t\tverb: 'FOLLOW',\n\t\t\talias: ['FOLLOWS'],\n\t\t\thandler: move,\n\t\t\tactionStateComplete: moveComplete,\n\t\t\trequiresTargetBeforeAdverbs: true,\n\t\t\tdefaultAsync: true,\n\t\t\tadverbs: ['SLOWLY', 'QUICKLY'],\n\t\t\tprepositions: []\n\t\t},\t\n\t\t{\n\t\t\tverb: 'FACE',\n\t\t\talias: ['FACES'],\n\t\t\thandler: face,\n\t\t\trequiresTargetBeforeAdverbs: true,\n\t\t\tadverbs: [],\n\t\t\tprepositions: ['NORTH', 'SOUTH', 'EAST', 'WEST', 'LEFT', 'RIGHT', 'UP', 'DOWN', 'TOWARD', 'AWAY']\n\t\t},\n\t\t{\n\t\t\tverb: 'TURN',\n\t\t\talias: ['TURNS'],\n\t\t\thandler: face,\n\t\t\tadverbs: [],\n\t\t\tprepositions: ['NORTH', 'SOUTH', 'EAST', 'WEST', 'LEFT', 'RIGHT', 'UP', 'DOWN', 'TOWARD', 'AWAY']\n\t\t},\n\t\t{\n\t\t\tverb: 'WAIT',\n\t\t\thandler: wait,\n\t\t\trequiresTargetBeforeAdverbs: true,\n\t\t\tdefaultAsync: false,\n\t\t\tadverbs: [],\n\t\t\tprepositions: []\n\t\t},\n\t\t{\n\t\t\tverb: 'HALT',\n\t\t\thandler: halt,\n\t\t\tinterrupt: true,\n\t\t\tadverbs: [],\n\t\t\tprepositions: []\n\t\t},\n\t\t{\n\t\t\tverb: 'DEFINE',\n\t\t\thandler: define,\n\t\t\tadverbs: ['GROUP'],\n\t\t\tcontextSwitches: {\n\t\t\t\t'default': {\n\t\t\t\t\t'NAMED': KCL.Director.Speech.TOKEN\n\t\t\t\t},\n\t\t\t\t'token': {\n\t\t\t\t\t'AS': KCL.Director.Speech.TARGET\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t];\n\n\t\tthis.prepositions = [\n\t\t{\n\t\t\tname: 'NORTH',\n\t\t},\n\t\t{\n\t\t\tname: 'SOUTH',\n\t\t},\n\t\t{\n\t\t\tname: 'EAST',\n\t\t},\n\t\t{\n\t\t\tname: 'WEST',\n\t\t},\n\t\t{\n\t\t\tname: 'LEFT',\n\t\t},\n\t\t{\n\t\t\tname: 'RIGHT'\n\t\t},\n\t\t{\n\t\t\tname: 'UP'\n\t\t},\n\t\t{\n\t\t\tname: 'DOWN'\n\t\t},\n\t\t{\n\t\t\tname: 'TOP',\n\t\t\trequiresTarget: true\n\t\t},\n\t\t{\n\t\t\tname: 'BOTTOM',\n\t\t\trequiresTarget: true\n\t\t},\n\t\t{\n\t\t\tname: 'OVER',\n\t\t\trequiresTarget: true\n\t\t},\n\t\t{\n\t\t\tname: 'ABOVE',\n\t\t\trequiresTarget: true\n\t\t}, \n\t\t{\n\t\t\tname: 'BELOW',\n\t\t\trequiresTarget: true\n\t\t},\n\t\t{\n\t\t\tname: 'TOWARD',\n\t\t\trequiresTarget: true\n\t\t}, \n\t\t{\n\t\t\tname: 'AWAY',\n\t\t\trequiresTarget: true\n\t\t}\n\t\t];\n\n\t\tthis.specialTargets = [\n\t\t{\n\t\t\tname: 'PLAYER',\n\t\t\thandler: acquirePlayer\n\t\t}\n\t\t]\n\n\t\tthis.scene = new SceneState();\n\n\t\tfunction move(d) {\n\t\t\tvar actors = [];\n\n\t\t\tif (d.state.getStatus() === KCL.Director.DirectionStates.Init) {\n\t\t\t\td.state.setStatus(KCL.Director.DirectionStates.Running);\n\n\t\t\t\tvar speed = 4; // default\n\t\t\t\tvar freq = 6;\n\t\t\t\tvar persist = false;\n\n\t\t\t\tswitch (d.getVerb().verb) {\n\t\t\t\t\tcase 'WALK': \n\t\t\t\t\tspeed = 2;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'RUN':\n\t\t\t\t\tspeed = 6;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'FOLLOW':\n\t\t\t\t\tspeed = 4;\n\t\t\t\t\tpersist = true;\n\t\t\t\t\td.state.shouldWaitOn(false);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (_.contains(d.getAdverbs(), 'SLOWLY'))\n\t\t\t\t\tspeed=speed-1;\n\t\t\t\telse if (_.contains(d.getAdverbs(), 'QUICKLY'))\n\t\t\t\t\tspeed=speed+1;\n\n\t\t\t\tactors = d.getActors().concat(d.getWith());\n\n\t\t\t\t_(actors)\n\t\t\t\t.each(function(actor) {\n\t\t\t\t\tvar actionState = d.state.actionState(actor);\n\t\t\t\t\tactionState.originalSpeed = actor.actor.moveSpeed();\n\t\t\t\t\tactionState.originalFrequency = actor.actor.moveFrequency();\n\t\t\t\t\tactionState.persist = persist;\n\t\t\t\t\tactionState.setStatus(KCL.Director.ActionStates.Running);\n\n\t\t\t\t\tactor.actor.setMoveSpeed(actor.actor.isDashing() ? speed-1 : speed);\n\t\t\t\t\tactor.actor.setMoveFrequency(freq);\n\t\t\t\t}).value();\n\t\t\t} else {\n\t\t\t\tactors = _(d.state.actionState())\n\t\t\t\t.filter(function(actionState) { return actionState.status == KCL.Director.ActionStates.Triggered; })\n\t\t\t\t.each(function(actionState) { actionState.setStatus(KCL.Director.ActionStates.Running); })\n\t\t\t\t.map(function(actionState) { return actionState.actor })\n\t\t\t\t.value();\n\t\t\t}\n\n\t\t\tif (_.any(actors)) {\n\t\t\t\td.state.setStatus(KCL.Director.DirectionStates.Running);\n\n\t\t\t\tvar target = _.first(d.getTargets());\n\t\t\t\tvar preposition = _.first(d.getPrepositions());\n\t\t\t\tvar direction = 2;\n\t\t\t\tvar relativeTarget = false; // whether or not target can be shared\n\n\t\t\t\tif (preposition && preposition.active) {\n\t\t\t\t\tif (preposition.hasTarget()) {\n\t\t\t\t\t\t// use the preposition's target and apply a transform\n\t\t\t\t\t\ttarget = _.first(preposition.getTargets()).preposition(preposition);\n\t\t\t\t\t\td.setTarget(target); // save for state\n\t\t\t\t\t} else if (target) {\n\t\t\t\t\t\t// apply the preposition to our primary target\n\t\t\t\t\t\ttarget = target.preposition(preposition);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// maybe the preposition is giving us a direction\n\t\t\t\t\t\tdirection = preposition.direction();\n\t\t\t\t\t\trelativeTarget = true;\n\t\t\t\t\t\tpreposition.active = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t_.each(actors, function(actor) {\n\t\t\t\t\tvar actionState = d.state.actionState(actor);\n\t\t\t\t\tvar actionTarget = actionState.target||target;\n\n\t\t\t\t\tif (relativeTarget) {\n\t\t\t\t\t\t// target is relative to actor\n\t\t\t\t\t\tif (preposition.hasAmount()) {\n\t\t\t\t\t\t\tactionTarget = KCL.Director.Target.prototype.fromActor(actor);\n\t\t\t\t\t\t\tactionTarget = actionTarget.preposition(preposition);\n\t\t\t\t\t\t\tactionState.target = actionTarget;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tactionState.direction = direction;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (actionTarget) {\n\t\t\t\t\t\tvar coords = actionTarget.coords();\n\t\t\t\t\t\tvar curPos = actor.coords();\n\t\t\t\t\t\tdirection = actor.actor.findDirectionTo(coords.x, coords.y);\n\t\t\t\t\t\tvar passable = actor.actor.canPass(curPos.x,curPos.y,direction);\n\t\t\t\t\t\tvar done = passable \n\t\t\t\t\t\t\t? coords.equals(actor.coords())\n\t\t\t\t\t\t\t: coords.near(actor.coords());\n\n\t\t\t\t\t\tif (!done) {\n\t\t\t\t\t\t\tactor.actor.moveStraight(direction);\n\t\t\t\t\t\t\tdone = !actor.actor.isMovementSucceeded();\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\tif (actionState.persist) done = false;\n\n\t\t\t\t\t\tif (d.hasCondition() && d.getCondition().isValid()) {\n\t\t\t\t\t\t\tdone = d.getCondition().isMet(actor, d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (done) {\n\t\t\t\t\t\t\tactionState.setStatus(KCL.Director.ActionStates.Done);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdirection = actionState.direction||direction;\n\t\t\t\t\t\tactor.actor.moveStraight(direction);\n\t\t\t\t\t\tvar done = !actor.actor.isMovementSucceeded();\n\n\t\t\t\t\t\tif (d.hasCondition() && d.getCondition().isValid()) {\n\t\t\t\t\t\t\tdone = condition.isMet(actor, d);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (done) {\n\t\t\t\t\t\t\tactionState.setStatus(KCL.Director.ActionStates.Done);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\n\n\t\t\t}\n\t\t}\n\n\t\tfunction moveComplete(d, actor) {\n\t\t\tconsole.log('move complete');\n\t\t\tif (actor) {\n\t\t\t\tvar actionState = d.state.actionState(actor);\n\t\t\t\tif (_.has(actionState, 'originalSpeed')) {\n\t\t\t\t\tactor.actor.setMoveSpeed(actionState.originalSpeed);\n\t\t\t\t\tactor.actor.setMoveFrequency(actionState.originalFrequency);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction face(d) {\n\t\t\tif (d.state.getStatus() == KCL.Director.DirectionStates.Init) {\n\t\t\t\td.state.setStatus(KCL.Director.DirectionStates.Running);\n\n\t\t\t\tvar actors = d.getActors().concat(d.getWith());\n\t\t\t\tvar preposition = _.first(d.getPrepositions());\n\t\t\t\tvar relativeDirection = d.getVerb().verb === 'TURN';\n\t\t\t\tvar setDirection = false;\n\t\t\t\tvar lookToward = true;\n\n\t\t\t\t_.each(actors, function(actor) {\n\t\t\t\t\t// start with ourselves as a reference point\n\t\t\t\t\tvar target = KCL.Director.Target.prototype.fromActor(actor);\n\n\t\t\t\t\tif (preposition) {\n\t\t\t\t\t\tlookToward = preposition.getPreposition().getName() != 'AWAY';\n\t\t\t\t\t\tif (preposition.hasTarget()) {\n\t\t\t\t\t\t\t// use the preposition's target and apply the preposition as a transform\n\t\t\t\t\t\t\ttarget = _.first(preposition.getTargets()).preposition(preposition);\n\t\t\t\t\t\t} else if (d.hasTarget()) {\n\t\t\t\t\t\t\ttarget = _.first(d.getTargets()).preposition(preposition);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (relativeDirection) {\n\t\t\t\t\t\t\t\t// see if the preposition is setting a relative direction\n\t\t\t\t\t\t\t\tsetDirection = preposition.direction(actor.direction());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!relativeDirection || !setDirection)\n\t\t\t\t\t\t\t\ttarget = target.preposition(preposition);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (d.hasTarget()) {\n\t\t\t\t\t\t\ttarget = _.first(d.getTargets());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// this was not a very good use of the command. \n\t\t\t\t\t\t\tconsole.warn('face command executed with no preposition or target');\n\t\t\t\t\t\t\tvar actionState = d.state.actionState(actor).setStatus(KCL.Director.ActionStates.Done);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (setDirection) {\n\t\t\t\t\t\tactor.actor.setDirection(setDirection);\n\t\t\t\t\t} else if (target) {\n\t\t\t\t\t\tif (lookToward)\n\t\t\t\t\t\t\tactor.turnToward(target);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tactor.turnAwayFrom(target);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// Init state pretty much executes the 'face' so now we just need\n\t\t\t\t// to trigger that we're done on the actionState.\n\t\t\t\tvar actionStates = _(d.state.actionState())\n\t\t\t\t.filter(function(actionState) { return actionState.status == KCL.Director.ActionStates.Triggered; })\n\t\t\t\t.each(function(actionState) { actionState.setStatus(KCL.Director.ActionStates.Done); })\n\t\t\t\t.value();\n\t\t\t}\n\t\t}\n\n\t\tfunction wait(d) {\n\t\t\tif (d.state.getStatus() == KCL.Director.DirectionStates.Init) {\n\t\t\t\td.state.setStatus(KCL.Director.DirectionStates.Waiting);\n\n\t\t\t\tif (d.getContext().directedTo() === KCL.Director.DirectedTo.Actor) {\n\t\t\t\t\tvar actors = d.getActors().concat(d.getWith());\n\t\t\t\t\t_.each(actors, function(actor) {\n\t\t\t\t\t\tvar actionState = d.actionState(actor);\n\n\t\t\t\t\t\tactionState.setStatus(KCL.Director.ActionStates.Running);\n\t\t\t\t\t});\n\t\t\t\t}\t\t\t\t\t\n\t\t\t}\n\n\t\t\tif (d.getContext().directedTo() === KCL.Director.DirectedTo.Actor) {\n\t\t\t\tvar actors = d.getActors().concat(d.getWith());\n\t\t\t\t_.each(actors, function(actor) {\n\t\t\t\t\tvar actionState = d.actionState(actor);\n\n\t\t\t\t\tif (d.hasTarget()) {\n\t\t\t\t\t\t// we want to wait for all target(s) to have no running/triggered actionStates.\n\t\t\t\t\t\tvar done = _(d.getTargets())\n\t\t\t\t\t\t\t.filter(function(target) { return target.hasActor(); })\n\t\t\t\t\t\t\t.map(function(target) { return target.getActor() })\n\t\t\t\t\t\t\t.map(function(actor) { return actor.state.directions })\n\t\t\t\t\t\t\t.flatten()\n\t\t\t\t\t\t\t.map(function(direction) { return direction.state.actionState() })\n\t\t\t\t\t\t\t.reject(function(direction) { return direction === d })\n\t\t\t\t\t\t\t.every(function(actionState) {\n\t\t\t\t\t\t\t\tvar status = actionState.getStatus();\n\t\t\t\t\t\t\t\treturn status != KCL.Director.ActionStates.Running && status != KCL.Director.ActionStates.Triggered\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\tif (done) \n\t\t\t\t\t\t\tactionState.setStatus(KCL.Director.ActionStates.Done);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdone = _.every(this.scene.directions, function(direction) {\n\t\t\t\t\t\t\t\tvar status = direction.state.getStatus();\n\t\t\t\t\t\t\t\treturn status != KCL.Director.DirectionStates.Running && status != KCL.Director.DirectionStates.Waiting\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\tif (done) \n\t\t\t\t\t\t\tactionState.setStatus(KCL.Director.ActionStates.Done);\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\tvar done = true;\n\t\t\t\tif (d.hasTarget()) {\n\t\t\t\t\tdone = _(d.getTargets())\n\t\t\t\t\t\t.filter(function(target) { return target.hasActor(); })\n\t\t\t\t\t\t.map(function(target) { return target.getActor() })\n\t\t\t\t\t\t.map(function(actor) { return actor.state.directions })\n\t\t\t\t\t\t.flatten()\n\t\t\t\t\t\t.map(function(direction) { return direction.state.actionState() })\n\t\t\t\t\t\t.reject(function(direction) { return direction === d })\n\t\t\t\t\t\t.every(function(actionState) {\n\t\t\t\t\t\t\tvar status = actionState.getStatus();\n\t\t\t\t\t\t\treturn status != KCL.Director.ActionStates.Running && status != KCL.Director.ActionStates.Triggered\n\t\t\t\t\t\t});\n\t\t\t\t\tif (done) \n\t\t\t\t\t\tactionState.setStatus(KCL.Director.ActionStates.Done);\n\t\t\t\t} else {\n\t\t\t\t\tvar that = this;\n\t\t\t\t\tdone = _(this.scene.directions)\n\t\t\t\t\t\t.takeWhile(function(direction) {\n\t\t\t\t\t\t\treturn direction !== d\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.filter(function(direction) { return direction.state.shouldWaitOn() })\n\t\t\t\t\t\t.every(function(direction) {\n\t\t\t\t\t\t\tvar status = direction.state.getStatus();\n\t\t\t\t\t\t\treturn \n\t\t\t\t\t\t\t\t \tstatus != KCL.Director.DirectionStates.Running && \n\t\t\t\t\t\t\t\t\tstatus != KCL.Director.DirectionStates.Waiting &&\n\t\t\t\t\t\t\t\t\tstatus != KCL.Director.DirectionStates.Init;\n\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tthis.scene.wait = !done;\n\t\t\t\tif (done) {\n\t\t\t\t\td.state.setStatus(KCL.Director.DirectionStates.Done);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction halt(d) {\n\t\t\tif (d.state.getStatus() == KCL.Director.DirectionStates.Init)\n\t\t\t\td.state.setStatus(KCL.Director.DirectionStates.Running);\n\n\t\t\tif (d.getContext().directedTo() === KCL.Director.DirectedTo.Director) {\n\t\t\t\tif (!d.hasTarget()) {\n\t\t\t\t\t// this is easy - burn the world!\n\t\t\t\t\t_(this.scene.directions) \n\t\t\t\t\t.map(function(direction){return _.values(direction.state.actionState())})\n\t\t\t\t\t.flatten()\n\t\t\t\t\t.each(function(actionState) {\n\t\t\t\t\t\tactionState.setStatus(KCL.Director.ActionStates.Done);\n\t\t\t\t\t}).value();\n\t\t\t\t} else {\n\t\t\t\t\t_(d.getTargets())\n\t\t\t\t\t.filter(function(target) { return target.hasActor() })\n\t\t\t\t\t.map(function(target) { return target.getActor() })\n\t\t\t\t\t.map(function(actor) { return actor.state.directions })\n\t\t\t\t\t.flatten()\n\t\t\t\t\t.map(function(direction) { return direction.state.actionState() })\n\t\t\t\t\t.flatten()\n\t\t\t\t\t.each(function(actionState) {\n\t\t\t\t\t\tactionState.setStatus(KCL.Director.ActionStates.Done);\n\t\t\t\t\t}).value();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar actor = d.getActor();\n\t\t\t\t_(actor.state.directions)\n\t\t\t\t.map(function(direction) { return direction.state.actionState() })\n\t\t\t\t.flatten()\n\t\t\t\t.each(function(actionState) {\n\t\t\t\t\tactionState.setStatus(KCL.Director.ActionStates.Done);\n\t\t\t\t}).value();\n\t\t\t}\n\t\t\td.state.setStatus(KCL.Director.DirectionStates.Done);\n\t\t}\n\n\t\tfunction define(d) {\n\t\t\tif (d.getContext().directedTo() === KCL.Director.DirectedTo.Director) {\n\t\t\t\tif (_.contains(d.getAdverbs(), 'GROUP')) {\n\t\t\t\t\tvar groupName = _.first(d.getTokens());\n\t\t\t\t\tif (groupName) {\n\t\t\t\t\t\tif (d.hasTarget()) {\n\t\t\t\t\t\t\tthis.defineSpecialTarget(groupName, function(){return d.getTargets()});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.warn('director :: define \"group\" could not identify any targets');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn('director :: define \"group\" must specify a group name');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\td.state.setStatus(KCL.Director.DirectionStates.Done);\n\t\t}\n\n\t\tfunction acquirePlayer(target) {\n\t\t\treturn $gameMap._interpreter.character(-1); \n\t\t}\n\n\t\tthis.initialize();\n\t}", "title": "" }, { "docid": "6c90603023912adad40068d182663273", "score": "0.5093847", "text": "function changePronouns(){\n p = document.getElementById(\"pronouns\");\n\n subjP = document.getElementById('subjectP');\n objP = document.getElementById('objectP');\n possDetP = document.getElementById('possDetP');\n possP = document.getElementById('possP');\n reflexP = document.getElementById('reflexP');\n\n selected = p[p.selectedIndex];\n custom = document.getElementById(\"customPronouns\");\n if (selected.value == 'other'){\n custom.style.display = 'block';\n }\n else{\n custom.style.display = 'none';\n }\n if(selected.value=='masc'){\n subjP.value = \"he\";\n objP.value = \"him\";\n possDetP.value = \"his\";\n possP.value = \"his\";\n reflexP.value = \"himself\";\n }\n if(selected.value=='fem'){\n subjP.value = \"she\";\n objP.value = \"her\";\n possDetP.value = \"her\";\n possP.value = \"hers\";\n reflexP.value = \"herself\";\n }\n if(selected.value=='neut'){\n subjP.value = \"they\";\n objP.value = \"them\";\n possDetP.value = \"their\";\n possP.value = \"theirs\";\n reflexP.value = \"themself\";\n }\n}", "title": "" }, { "docid": "35064c7e06bd69468c588fb868b66fd0", "score": "0.50883853", "text": "function correctNoun(error, array) {\n let correction = \"\";\n for (i = 0; i < array.length; i++) {\n if (error.includes(array[i])) {\n correction = array[i];\n break;\n } else {\n correction = \"invalid\";\n continue;\n }\n }\n return correction;\n}", "title": "" }, { "docid": "d5be4d5917d065aaa43df6a6930ad0cf", "score": "0.50865567", "text": "function POSTagger(){\n this.lexicon = pL;\n this.tagsMap = lTM;\n}", "title": "" }, { "docid": "728aedfaaeba23bb03969d0ae5b1c688", "score": "0.50808793", "text": "function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {\n // Your code below this line\n var result = \"My smart \" + myNoun + \" \" + myVerb + \" \" + myAdverb + \" \" + myAdjective + \".\";\n\n // Your code above this line\n // return result;\n console.log(result);\n}", "title": "" }, { "docid": "9a06350deb1b20fffadf37ea339444a9", "score": "0.50664735", "text": "function pluralize(number, noun){\n\n if(animalname.includes(noun) && number > 1){\n return number + \" \" + pluralAnimal[(animalname.indexOf(noun))];\n }else if(pluralAnimal.includes(noun) && number == 1){\n return number + \" \" + animalname[(pluralAnimal.indexOf(noun))];\n }else if(number > 1){\n return number + \" \" + noun + \"s\";\n }else if(number == 1){\n return number + \" \" + noun;\n }else{\n return \"Enter number , Animal Name\"\n }\n\n}", "title": "" }, { "docid": "23811b8f1e7e7b3034ec6af7c5d4ce9f", "score": "0.50539863", "text": "function searchFirstStatementForPronouns(){\n console.log('ProNOUN SEARCH FIRE!!!!!!!!!!!!')\n potentialPronouns = [];\n\n for (let i = 0; i < segmentedFirstStatement.length; i++){\n if (pronounsArray.indexOf(segmentedFirstStatement[i].toLowerCase()) !== -1){\n console.log('there is a potential pronoun')\n potentialPronouns.push(segmentedFirstStatement[i]);\n } else {\n console.log(segmentedFirstStatement[i] + ' is NOT a pronoun!')\n }\n }\n console.log(potentialPronouns);\n }", "title": "" }, { "docid": "16c71b9f8c9162676ee25f6be5e0a9fc", "score": "0.5051752", "text": "function rule2(taggedSentence, index) {\r\n if (startsWith(taggedSentence[index][1], \"N\")) {\r\n if (taggedSentence[index][0].indexOf(\".\") > -1) {\r\n // url if there are two contiguous alpha characters\r\n if (/[a-zA-Z]{2}/.test(taggedSentence[index][0])) {\r\n taggedSentence[index][1] = \"URL\";\r\n }\r\n else {\r\n taggedSentence[index][1] = \"CD\";\r\n }\r\n }\r\n // Attempt to convert into a number\r\n if (!isNaN(parseFloat(taggedSentence[index][0]))) {\r\n taggedSentence[index][1] = \"CD\";\r\n }\r\n }\r\n }", "title": "" }, { "docid": "c84e639f6d231e13b1a3ceaad0bba423", "score": "0.5050052", "text": "function countAdverbs(sentence) {\n\treturn sentence.split(\" \").map(x => x.match(/[\\w\\s]+/g).toString()).filter(x => x.endsWith('ly')).length;\n}", "title": "" }, { "docid": "e1f786fc48c3e82bb8459851db10c8c3", "score": "0.50416803", "text": "function replace_word(word_analyzed){\n\tvar syllables = new_count(word_analyzed);\n\tvar complex = word_complex(syllables);\n\tif (complex) {\n\t\tvar synonym = 'easy';\n\t\treturn synonym;\n\t} else {\n\t\treturn word_analyzed;\n\t}\n}", "title": "" }, { "docid": "1e4aa79bc60914510bdf3c79d33799df", "score": "0.5037907", "text": "function axapta(hljs) {\n const BUILT_IN_KEYWORDS = [\n 'anytype',\n 'boolean',\n 'byte',\n 'char',\n 'container',\n 'date',\n 'double',\n 'enum',\n 'guid',\n 'int',\n 'int64',\n 'long',\n 'real',\n 'short',\n 'str',\n 'utcdatetime',\n 'var'\n ];\n\n const LITERAL_KEYWORDS = [\n 'default',\n 'false',\n 'null',\n 'true'\n ];\n\n const NORMAL_KEYWORDS = [\n 'abstract',\n 'as',\n 'asc',\n 'avg',\n 'break',\n 'breakpoint',\n 'by',\n 'byref',\n 'case',\n 'catch',\n 'changecompany',\n 'class',\n 'client',\n 'client',\n 'common',\n 'const',\n 'continue',\n 'count',\n 'crosscompany',\n 'delegate',\n 'delete_from',\n 'desc',\n 'display',\n 'div',\n 'do',\n 'edit',\n 'else',\n 'eventhandler',\n 'exists',\n 'extends',\n 'final',\n 'finally',\n 'firstfast',\n 'firstonly',\n 'firstonly1',\n 'firstonly10',\n 'firstonly100',\n 'firstonly1000',\n 'flush',\n 'for',\n 'forceliterals',\n 'forcenestedloop',\n 'forceplaceholders',\n 'forceselectorder',\n 'forupdate',\n 'from',\n 'generateonly',\n 'group',\n 'hint',\n 'if',\n 'implements',\n 'in',\n 'index',\n 'insert_recordset',\n 'interface',\n 'internal',\n 'is',\n 'join',\n 'like',\n 'maxof',\n 'minof',\n 'mod',\n 'namespace',\n 'new',\n 'next',\n 'nofetch',\n 'notexists',\n 'optimisticlock',\n 'order',\n 'outer',\n 'pessimisticlock',\n 'print',\n 'private',\n 'protected',\n 'public',\n 'readonly',\n 'repeatableread',\n 'retry',\n 'return',\n 'reverse',\n 'select',\n 'server',\n 'setting',\n 'static',\n 'sum',\n 'super',\n 'switch',\n 'this',\n 'throw',\n 'try',\n 'ttsabort',\n 'ttsbegin',\n 'ttscommit',\n 'unchecked',\n 'update_recordset',\n 'using',\n 'validtimestate',\n 'void',\n 'where',\n 'while'\n ];\n\n const KEYWORDS = {\n keyword: NORMAL_KEYWORDS,\n built_in: BUILT_IN_KEYWORDS,\n literal: LITERAL_KEYWORDS\n };\n\n return {\n name: 'X++',\n aliases: ['x++'],\n keywords: KEYWORDS,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta',\n begin: '#',\n end: '$'\n },\n {\n className: 'class',\n beginKeywords: 'class interface',\n end: /\\{/,\n excludeEnd: true,\n illegal: ':',\n contains: [\n {\n beginKeywords: 'extends implements'\n },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n }\n ]\n };\n}", "title": "" }, { "docid": "1e4aa79bc60914510bdf3c79d33799df", "score": "0.5037907", "text": "function axapta(hljs) {\n const BUILT_IN_KEYWORDS = [\n 'anytype',\n 'boolean',\n 'byte',\n 'char',\n 'container',\n 'date',\n 'double',\n 'enum',\n 'guid',\n 'int',\n 'int64',\n 'long',\n 'real',\n 'short',\n 'str',\n 'utcdatetime',\n 'var'\n ];\n\n const LITERAL_KEYWORDS = [\n 'default',\n 'false',\n 'null',\n 'true'\n ];\n\n const NORMAL_KEYWORDS = [\n 'abstract',\n 'as',\n 'asc',\n 'avg',\n 'break',\n 'breakpoint',\n 'by',\n 'byref',\n 'case',\n 'catch',\n 'changecompany',\n 'class',\n 'client',\n 'client',\n 'common',\n 'const',\n 'continue',\n 'count',\n 'crosscompany',\n 'delegate',\n 'delete_from',\n 'desc',\n 'display',\n 'div',\n 'do',\n 'edit',\n 'else',\n 'eventhandler',\n 'exists',\n 'extends',\n 'final',\n 'finally',\n 'firstfast',\n 'firstonly',\n 'firstonly1',\n 'firstonly10',\n 'firstonly100',\n 'firstonly1000',\n 'flush',\n 'for',\n 'forceliterals',\n 'forcenestedloop',\n 'forceplaceholders',\n 'forceselectorder',\n 'forupdate',\n 'from',\n 'generateonly',\n 'group',\n 'hint',\n 'if',\n 'implements',\n 'in',\n 'index',\n 'insert_recordset',\n 'interface',\n 'internal',\n 'is',\n 'join',\n 'like',\n 'maxof',\n 'minof',\n 'mod',\n 'namespace',\n 'new',\n 'next',\n 'nofetch',\n 'notexists',\n 'optimisticlock',\n 'order',\n 'outer',\n 'pessimisticlock',\n 'print',\n 'private',\n 'protected',\n 'public',\n 'readonly',\n 'repeatableread',\n 'retry',\n 'return',\n 'reverse',\n 'select',\n 'server',\n 'setting',\n 'static',\n 'sum',\n 'super',\n 'switch',\n 'this',\n 'throw',\n 'try',\n 'ttsabort',\n 'ttsbegin',\n 'ttscommit',\n 'unchecked',\n 'update_recordset',\n 'using',\n 'validtimestate',\n 'void',\n 'where',\n 'while'\n ];\n\n const KEYWORDS = {\n keyword: NORMAL_KEYWORDS,\n built_in: BUILT_IN_KEYWORDS,\n literal: LITERAL_KEYWORDS\n };\n\n return {\n name: 'X++',\n aliases: ['x++'],\n keywords: KEYWORDS,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta',\n begin: '#',\n end: '$'\n },\n {\n className: 'class',\n beginKeywords: 'class interface',\n end: /\\{/,\n excludeEnd: true,\n illegal: ':',\n contains: [\n {\n beginKeywords: 'extends implements'\n },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n }\n ]\n };\n}", "title": "" }, { "docid": "1e4aa79bc60914510bdf3c79d33799df", "score": "0.5037907", "text": "function axapta(hljs) {\n const BUILT_IN_KEYWORDS = [\n 'anytype',\n 'boolean',\n 'byte',\n 'char',\n 'container',\n 'date',\n 'double',\n 'enum',\n 'guid',\n 'int',\n 'int64',\n 'long',\n 'real',\n 'short',\n 'str',\n 'utcdatetime',\n 'var'\n ];\n\n const LITERAL_KEYWORDS = [\n 'default',\n 'false',\n 'null',\n 'true'\n ];\n\n const NORMAL_KEYWORDS = [\n 'abstract',\n 'as',\n 'asc',\n 'avg',\n 'break',\n 'breakpoint',\n 'by',\n 'byref',\n 'case',\n 'catch',\n 'changecompany',\n 'class',\n 'client',\n 'client',\n 'common',\n 'const',\n 'continue',\n 'count',\n 'crosscompany',\n 'delegate',\n 'delete_from',\n 'desc',\n 'display',\n 'div',\n 'do',\n 'edit',\n 'else',\n 'eventhandler',\n 'exists',\n 'extends',\n 'final',\n 'finally',\n 'firstfast',\n 'firstonly',\n 'firstonly1',\n 'firstonly10',\n 'firstonly100',\n 'firstonly1000',\n 'flush',\n 'for',\n 'forceliterals',\n 'forcenestedloop',\n 'forceplaceholders',\n 'forceselectorder',\n 'forupdate',\n 'from',\n 'generateonly',\n 'group',\n 'hint',\n 'if',\n 'implements',\n 'in',\n 'index',\n 'insert_recordset',\n 'interface',\n 'internal',\n 'is',\n 'join',\n 'like',\n 'maxof',\n 'minof',\n 'mod',\n 'namespace',\n 'new',\n 'next',\n 'nofetch',\n 'notexists',\n 'optimisticlock',\n 'order',\n 'outer',\n 'pessimisticlock',\n 'print',\n 'private',\n 'protected',\n 'public',\n 'readonly',\n 'repeatableread',\n 'retry',\n 'return',\n 'reverse',\n 'select',\n 'server',\n 'setting',\n 'static',\n 'sum',\n 'super',\n 'switch',\n 'this',\n 'throw',\n 'try',\n 'ttsabort',\n 'ttsbegin',\n 'ttscommit',\n 'unchecked',\n 'update_recordset',\n 'using',\n 'validtimestate',\n 'void',\n 'where',\n 'while'\n ];\n\n const KEYWORDS = {\n keyword: NORMAL_KEYWORDS,\n built_in: BUILT_IN_KEYWORDS,\n literal: LITERAL_KEYWORDS\n };\n\n return {\n name: 'X++',\n aliases: ['x++'],\n keywords: KEYWORDS,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta',\n begin: '#',\n end: '$'\n },\n {\n className: 'class',\n beginKeywords: 'class interface',\n end: /\\{/,\n excludeEnd: true,\n illegal: ':',\n contains: [\n {\n beginKeywords: 'extends implements'\n },\n hljs.UNDERSCORE_TITLE_MODE\n ]\n }\n ]\n };\n}", "title": "" }, { "docid": "cb02ef6b67d1af5dd504daf663f24553", "score": "0.5036623", "text": "function tokenWording_arrNoun(arrGroup){\n var ans_sentence = []; \n for(n in arrGroup){\n var numb = 0;\n for(m in arrGroup[n].tokenwording){\n for(o in arrNoun){\n var echa = arrNoun[o].match(new RegExp(\"(?:\"+arrGroup[n].tokenwording[m]+\")+\", \"gi\"));\n if(echa) numb++;\n }\n }\n //// Find the best answer from keyword ////\n ans_sentence.push(numb); \n } \n if(ans_sentence){\n var index_bestanswer = ans_sentence.indexOf(Math.max.apply(null, ans_sentence));\n result[0] = arrGroup[index_bestanswer].answer[Math.floor(Math.random() * arrGroup[n].answer.length)];\n }\n\n if(!result[0]) result[0] = error[0].answer[Math.floor(Math.random() * error[0].answer.length)];\n return result;\n }", "title": "" }, { "docid": "42ebcfc49010c76c9b3fc776df49851f", "score": "0.50356424", "text": "function thirdPerson(verb){\n\tswitch (verb){\n\t\tcase 'catch':\n\t\tcase 'ambush':\n\t\tcase \"bash\":\n\t\tcase \"punch\":\n\t\tcase \"slash\":\n\t\tcase \"splash\":\n\t\t\tverb += 'es';\n\t\t\tbreak;\n\t\tcase 'do':\n\t\t\tverb += 'es';\n\t\t\tbreak;\n\t\tcase \"are\":\n\t\t\tverb = \"is\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif (verb.indexOf(' ') !== -1){\n\t\t\t\tverb = firstWord(verb)+'s '+secondWord(verb);\n\t\t\t} else {\n\t\t\t\tverb += 's';\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn verb;\n}", "title": "" }, { "docid": "cfac3143d133a61ecffb4eb64f7af937", "score": "0.5021172", "text": "function describe(){\n description = \"I see\";\n \n // apply English grammar rules to construct a sentence\n if (detections.length){\n var counted = getCountedObjects(detections);\n var names = Object.keys(counted);\n var pluraleTantum = [\n \"scissors\",\"pants\",\"trousers\",\"glasses\",\n \"spectacles\",\"panties\",\"jeans\",\"chopsticks\",\n \"shorts\",\"boxers\",\"briefs\",\"tights\",\"pyjamas\",\n \"pliers\",\"tongs\",\"tweezers\",\"binoculars\",\n \"goggles\",\"sunglasses\",\"contact lenses\",\n \"headphones\",\"earphones\",\"earbuds\",\"earmuffs\",\n \"skis\",\n ];\n var irregularPlural = { // just some common ones\n mouse:\"mice\",louse:\"lice\",ox:\"oxen\",axis:\"axes\",\n goose:\"geese\",tooth:\"teeth\",foot:\"feet\",child:\"children\",\n dice:\"dice\",die:\"dice\",potato:\"potatoes\",tomato:\"tomatoes\",\n deer:\"deer\",swine:\"swine\",sheep:\"sheep\",moose:\"moose\"\n }\n for (var i = 0; i < names.length; i++){\n var name = names[i];\n var n = counted[name];\n var numeral;\n if (n == 1){\n numeral = \"a\";\n if (!pluraleTantum.includes(name)){\n if (['a','e','i','o','u'].includes(name[0])){\n if (name.startsWith(\"uni\") || name.startsWith(\"eu\")){\n }else{\n numeral += \"n\";\n }\n }\n }else{\n name = \"pair of \"+name;\n }\n }else{\n numeral = [\n \"zero\",\"one\",\"two\",\"three\",\"four\",\"five\",\"six\",\n \"seven\",\"eight\",\"nine\",\"ten\",\"eleven\",\"twelve\"\n ][n] || \"many\";\n if (irregularPlural[name]){\n name = irregularPlural[name];\n }else if (pluraleTantum.includes(name)){\n name = \"pairs of \"+name;\n }else{\n if (['x','s','z'].includes(name[name.length-1])\n || name.endsWith('sh') || name.endsWith('ch')\n ){\n name += \"e\";\n }\n if (name.endsWith('f')||name.endsWith('fe')){\n name = name.slice(0,name.length-1-name.endsWith('fe'))+\"ve\";\n }\n if (name[name.length-1]==\"y\" && !['a','e','i','o','u'].includes(name[name.length-2])){\n name = name.slice(0,name.length-1)+\"ie\";\n }\n name += \"s\";\n if (name.endsWith('mans')){\n name = name.slice(0,name.length-4)+\"men\";\n }\n }\n }\n description += (i != 0 && i == names.length-1) ? \" and \": \" \";\n description += numeral + \" \" + name;\n description += (i == names.length-1) ? \".\" : \",\";\n }\n }else{\n description += \" nothing.\"\n }\n print(description);\n \n // synthesize with text to speech.\n // currently, the utterance is skipped if there's already something being voiced.\n // see below for alternative behaviors:\n \n // uncomment the line below to interrupt previous utterance\n // speechSynthesis.cancel();\n \n // comment out the if condition to queue up the utterance\n if (!speechSynthesis.pending){\n speechSynthesis.speak(new SpeechSynthesisUtterance(description));\n }\n}", "title": "" }, { "docid": "494b6ce309c55757aa4dfafc1f75aabc", "score": "0.5017886", "text": "function add_to_defns(word, data) {\n var meanings = [];\n var sentences = [];\n // Traverse Glosbe's JSON return value; extract meanings\n for (var t in data.tuc) {\n for (var m in data.tuc[t].meanings) {\n var defn = data.tuc[t].meanings[m];\n if (defn.language == \"eng\") {\n meanings.push(defn.text.toLowerCase());\n }\n }\n }\n\n for (var e in data.examples) {\n sentences.push(data.examples[e].first + \"<br>\");\n sentences.push(\"(<i>\" + data.examples[e].second + \"</i>)<br><br>\");\n }\n\n // Remove duplicate meanings\n var unique_meanings = [];\n $.each(meanings, function(i, el){\n if($.inArray(el, unique_meanings) === -1) unique_meanings.push(el);\n });\n\n var numbered_meanings = [];\n $.each(unique_meanings, function(i, el) {\n if (i==0) {\n numbered_meanings.push(\"1. <strong>\" + el.replace(/,+$/, \"\") + \"</strong><br>\");\n } else {\n numbered_meanings.push(i+1 + \". \" + el.replace(/,+$/, \"\") + \"<br>\");\n }\n })\n\n word_list[word] = numbered_meanings.join(\"\");\n word_list[word.hashCode()] = sentences.join(\"\");\n\n}", "title": "" }, { "docid": "42ca095d9cf16c57468d63e1ba99302b", "score": "0.5012748", "text": "function makeDPLA() {\n// Now let's grab a random selection from the introArray and checkArray. Every time the makeDPLA function runs, it grabs different phrases from the arrays\nvar intro = introArray[Math.floor(Math.random() * introArray.length)];\nvar check = checkArray[Math.floor(Math.random() * checkArray.length)];\n\n// DPLAbot uses the Wordnik API to grab a random noun. It then plugs that random noun--data[0].word--into a call to the DPLA API.\n// You need two API keys for this two work: a Worknik API key and a DPLA API key.\nvar myArray=[\n \"Coffee\",\n \"Olives\",\n \"Celery\",\n \"Tea\",\n \"Radishes\",\n \"Mashed+potatoes\",\n \"Boiled+potatoes\",\n \"Fruit\",\n \"Milk\",\n \"Chicken+salad\",\n \"Vanilla+ice+cream\",\n \"Cocoa\",\n \"Cheese\",\n \"Lettuce+Salad\",\n \"Lobster+salad\",\n \"Chocolate\",\n \"String+Beans\",\n \"Apple+Pie\",\n \"Sardines\",\n \"Oranges\",\n \"AMERICAN+CHEESE\",\n \"GREEN+PEAS\",\n \"Assorted+cakes\",\n \"Apollinaris\",\n \"French+fried+potatoes\",\n \"Potato+salad\",\n \"Baked+Potatoes\",\n \"Stewed+prunes\",\n \"Roquefort\",\n \"Ham\",\n \"Roast+beef\",\n \"Apples\",\n \"Chocolate+Ice+Cream\",\n \"Stewed+tomatoes\",\n \"Bananas\",\n \"Sliced+Tomatoes\",\n \"Lima+beans\",\n \"Camembert\",\n \"ROQUEFORT+CHEESE\",\n \"Cigars\",\n \"Cucumbers\",\n \"Ice+cream\",\n \"Edam+Cheese\",\n \"Little+Neck+clams\",\n \"Swiss+cheese\",\n \"Demi+Tasse\",\n \"Tomato+Juice\",\n \"Crackers\",\n \"Spinach\",\n \"Cream+Cheese\",\n \"ASSORTED+CAKE\",\n \"CAFE\",\n \"Lettuce\",\n \"Raisins\",\n \"Sirloin+Steak\",\n \"Cauliflower\",\n \"Grapes\",\n \"BLUE+POINTS\",\n \"Cup+Custard\",\n \"Petits+fours\",\n \"Ripe+Olives\",\n \"Demi-tasse\",\n \"Orange\",\n \"French+peas\",\n \"Consomme\",\n \"Fruits\",\n \"Buttermilk\",\n \"Tomato+Salad\",\n \"Biscuit+Tortoni\",\n \"Boiled+rice\",\n \"Kaffee\",\n \"Iced+tea\",\n \"Corned+beef\",\n \"Succotash\",\n \"Charlotte+Russe\",\n \"Lobster+Cocktail\",\n \"Cucumber+salad\",\n \"SALTED+ALMONDS\",\n \"Dessert\",\n \"Benedictine\",\n \"Cigarettes\",\n \"Brussels+Sprouts\",\n \"Romaine+Salad\",\n \"Lyonnaise+Potatoes\",\n \"Marmalade\",\n \"Dry+Toast\",\n \"Grape+fruit\",\n \"Apple+Sauce\",\n \"Tongue\",\n \"CAMEMBERT+CHEESE\",\n \"Bread+and+Butter\",\n \"Queen+olives\",\n \"Little+Necks\",\n \"Chow+chow\",\n \"Chicken\",\n \"Cold+roast+beef\",\n \"Milk+toast\",\n \"Watermelon\",\n \"Macaroons\",\n \"Lettuce+and+Tomato+Salad\",\n \"Fried+Egg+Plant\",\n \"Shrimp+Cocktail\",\n \"Club+sandwich\",\n \"Pears\",\n \"Chicken+Sandwich\",\n \"Broiled+Ham\",\n \"Baked+Apple\",\n \"Ham+Sandwich\",\n \"STRAWBERRY+ICE+CREAM\",\n \"Mutton+Chops\",\n \"Lamb+Chops\",\n \"Corned+Beef+Hash\",\n \"Brie\",\n \"Creme+de+Menthe\",\n \"Cafe+noir\",\n \"French+Pastry\",\n \"Sweet+Pickles\",\n \"Cold+Ham\",\n \"Mince+Pie\",\n \"Coffee+Ice+Cream\",\n \"Roman+Punch\",\n \"Smoked+Salmon\",\n \"Peach+Melba\",\n \"Welsh+rarebit\",\n \"Fruit+salad\",\n \"Shrimp+Salad\",\n \"Assorted+Cakes\",\n \"Stewed+Corn\",\n \"Asparagus\",\n \"Tenderloin+Steak\",\n \"Ham+and+eggs\",\n \"Scrambled+Eggs\",\n \"Fried+Potatoes\",\n \"Sauterne\",\n \"Pumpkin+Pie\",\n \"Orange+Juice\",\n \"Fried+Eggs\",\n \"Iced+coffee\",\n \"White+Rock\",\n \"rice+pudding\",\n \"Pear\",\n \"Boiled+eggs\",\n \"Escarole+Salad\",\n \"Baked+Apple+with+Cream\",\n \"Oatmeal\",\n \"Cherrystones\",\n \"Nuts\",\n \"Chicory+Salad\",\n \"Salad\",\n \"Peach+Pie\",\n \"Maraschino\",\n \"Cafe+Parfait\",\n \"Half+Grapefruit\",\n \"Buttered+toast\",\n \"Green+olives\",\n \"Caviar\",\n \"Sanka\",\n \"Neapolitan+ice+cream\",\n \"Edam\",\n \"Squab\",\n \"Figs\",\n \"Turkish+Coffee\",\n \"Cream+toast\",\n \"Clam+Chowder\",\n \"Beets\",\n \"Cantaloupe\",\n \"Nesselrode+Pudding\",\n \"Blue+Point+Oysters\",\n \"Gorgonzola\",\n \"New+string+beans\",\n \"Bacon+and+eggs\",\n \"Stuffed+olives\",\n \"Artichoke\",\n \"COMBINATION+SALAD\",\n \"Tongue+Sandwich\",\n \"Oyster+cocktail\",\n \"Ginger+Ale\",\n \"Orange+marmalade\",\n \"SLICED+CUCUMBERS\",\n \"Tomatoes\",\n \"Grapefruit\",\n \"Cape+Cods\",\n \"Anchovies\",\n \"Pickles\",\n \"Lemonade\",\n \"Turkey\",\n \"Gherkins\",\n \"Cold+Slaw\",\n \"Lamb\",\n \"Gruyere\",\n \"Neufchatel\",\n \"Orange+Water+Ice\",\n \"Cocktail+Sauce\",\n \"Toast\",\n \"Rolls\",\n \"Oyster+Stew\",\n \"Liqueurs\",\n \"Postum\",\n \"Lemon+water+ice\",\n \"Hominy\",\n \"Almonds\",\n \"Pound+cake\",\n \"fried+Sweet+Potatoes\",\n \"Vanilla+Ice+Cream\",\n \"Saratoga+Chips\",\n \"Celery+Salad\",\n \"Cherrystone+Clams\",\n \"New+peas\",\n \"Golden+buck\",\n \"Grapefruit+Juice\",\n \"Chicken+broth\",\n \"Gorgonzola+Cheese\",\n \"Waldorf+Salad\",\n \"Sherry\",\n \"Plums\",\n \"Pork+Chops\",\n \"Stewed+Tomatoes\",\n \"Fruit+Cocktail\",\n \"Sweet+Potatoes\",\n \"French+Coffee\",\n \"Salted+Nuts\",\n \"Pickled+beets\",\n \"Stewed+Prunes\",\n \"Thee\",\n \"Creamed+Spinach\",\n \"Saute+Potatoes\",\n \"Green+Peas\",\n \"Radis\",\n \"Small+Steak\",\n \"Hot+Rolls\",\n \"Cakes\",\n \"Meringue+glacee\",\n \"Chicken+Salad\",\n \"Johannis\",\n \"Cold+Corned+Beef\",\n \"Russian+Dressing\",\n \"PORT\",\n \"Tomato\",\n \"Chiffonade+Salad\",\n \"Anisette\",\n \"Mashed+Turnips\",\n \"Pontet+Canet\",\n \"French+Peas\",\n \"CLAM+BROTH\",\n \"Liederkranz+Cheese\",\n \"Green+Apple+Pie\",\n \"Cake\",\n \"FRENCH+DRESSING\",\n \"Calf's+Liver+and+Bacon\",\n \"Cream\",\n \"Virginia+Ham\",\n \"New+Lima+Beans\",\n \"Watercress\",\n \"Brie+cheese\",\n \"Candied+Sweet+Potatoes\",\n \"Little+Neck+Clams\",\n \"Sardine+Sandwich\",\n \"Neufchatel+cheese\",\n \"Lynnhavens\",\n \"Green+Corn\",\n \"Amontillado\",\n \"Watercress+Salad\",\n \"Crab+Flake+Cocktail\",\n \"Malaga+grapes\",\n \"Poached+Eggs+on+Toast\",\n \"Buckwheat+Cakes\",\n \"Roquefort+Cheese\",\n \"Roquefort+cheese\",\n \"Shirred+Eggs\",\n \"Raspberry+Water+Ice\",\n \"Roast+chicken\",\n \"Lady+fingers\",\n \"Squab+Chicken\",\n \"Plover\",\n \"Macaroni+au+gratin\",\n \"Strawberries+and+Cream\",\n \"St.+Julien\",\n \"Niersteiner\",\n \"Manhattan\",\n \"Pineapple+Juice\",\n \"Tomato+Juice+Cocktail\",\n \"Potatoes+au+Gratin\",\n \"Congress+Water\",\n \"Currant+Jelly\",\n \"Graham+bread\",\n \"FRESH+FRUIT\",\n \"Apple\",\n \"Green+Turtle+Soup\",\n \"Lettuce+salad\",\n \"Salt+mackerel\",\n \"Cucumber\",\n \"Chartreuse\",\n \"Absinthe\",\n \"Chow-chow\",\n \"Beluga+Caviar\",\n \"Stuffed+celery\",\n \"Curacao\",\n \"Dill+Pickles\",\n \"Pineapple\",\n \"Pickled+Walnuts\",\n \"Mixed+Grill\",\n \"Preserves\",\n \"Lobster+Salad\",\n \"Martini\",\n \"Plain+Omelette\",\n \"Tomato+Soup\",\n \"Mallard+Duck\",\n \"Roast+Mutton\",\n \"Boiled+Potatoes\",\n \"BAKED+SWEET+POTATOES\",\n \"Kummel\",\n \"New+green+peas\",\n \"Ceylon+Tea\",\n \"Clam+Juice+Cocktail\",\n \"Vermouth\",\n \"Pommard\",\n \"Biscuit+Glace\",\n \"Broiled+Bacon\",\n \"Hamburger+Steak\",\n \"Hashed+browned+potatoes\",\n \"Lobster\",\n \"Cottage+Cheese\",\n \"Potatoes\",\n \"ENGLISH+BREAKFAST+TEA\",\n \"Fruchte\",\n \"Honey\",\n \"peaches\",\n \"Endive+Salad\",\n \"Strawberries\",\n \"Cotuits\",\n \"Clam+juice\",\n \"Queen+Olives\",\n \"Cold+tongue\",\n \"Romaine\",\n \"Boiled+Onions\",\n \"Filet+Mignon\",\n \"Prime+ribs+of+beef\",\n \"String+beans\",\n \"French+string+beans\",\n \"Prime+ribs+of+beef+au+jus\",\n \"Mayonnaise+dressing\",\n \"Custard+Pie\",\n \"Hearts+of+Celery\",\n \"French+bread\",\n \"Mixed+Pickles\",\n \"BAKED+IDAHO+POTATO\",\n \"Tomato+salad\",\n \"Oysters\",\n \"Mayonnaise\",\n \"Roast+Beef+Sandwich\",\n \"Swiss+cheese+sandwich\",\n \"Julienne+potatoes\",\n \"Fried+oysters\",\n \"Mixed+ice+cream\",\n \"spring+lamb,+mint+sauce\",\n \"Danish+Pastry\",\n \"Cucumber+Salad\",\n \"Blue+Points\",\n \"Lemon+Ice\",\n \"Dates\",\n \"Oolong+Tea\",\n \"Corn+muffins\",\n \"Stilton+Cheese\",\n \"Sauternes\",\n \"Kase\",\n \"Anchovy+Salad\",\n \"Spring+Lamb\",\n \"Baked+Potato\",\n \"Cape+Cod+Oysters\",\n \"Sliced+Fresh+Pineapple\",\n \"Mutton\",\n \"Raisin+cake\",\n \"Strawberry+short+cake\",\n \"Honey+Dew+Melon\",\n \"French+Fried+Potatoes\",\n \"Kaffee+Hag\",\n \"Poached+eggs\",\n \"Hashed+Brown+Potatoes\",\n \"Moet+&+Chandon,+White+Seal\",\n \"Corn+bread\",\n \"Oyster+Bay+asparagus\",\n \"Fromage\",\n \"Fancy+Cakes\",\n \"Escarole\",\n \"Horlick's+Malted+Milk\",\n \"Pistache+ice+cream\",\n \"Clam+cocktail\",\n \"Guava+jelly\",\n \"Medoc\",\n \"Boiled+Sweet+Potatoes\",\n \"Chilled+Tomato+Juice\",\n \"Lima+Beans\",\n \"FRESH+FRUIT+SALAD\",\n \"Pommery+Sec\",\n \"bacon\",\n \"Fruit+Cake\",\n \"Baked+apples\",\n \"Eggs+to+order\",\n \"Fried+Ham\",\n \"toasted+crackers\",\n \"American+cheese\",\n \"Mashed+Potatoes\",\n \"Corned+beef+sandwich\",\n \"Poussin\",\n \"Tom+Collins\",\n \"New+String+Beans\",\n \"Chocolate+ice+cream\",\n \"Stilton\",\n \"Royal+Squab\",\n \"Haut+Sauternes\",\n \"Celeri \",\n \"Porterhouse+Steak\",\n \"Apollinaris+Water\",\n \"Stuffed+tomatoes\",\n \"Coffee+with+Cream\",\n \"Potato+Salad\",\n \"Vegetable+Soup\",\n \"Clam+Fritters\",\n \"Fresh+Shrimp+Cocktail\",\n \"Roquefort+Dressing\",\n \"Preserved+figs\",\n \"Claret\",\n \"Salade\",\n \"Peas\",\n \"Chablis\",\n \"Stuffed+Mangoes\",\n \"Kirschwasser\",\n \"Omelette,+plain\",\n \"Dubonnet\",\n \"Laubenheimer\",\n \"Corned+Beef+and+Cabbage\",\n \"Bermuda+potatoes\",\n \"Whiskey+Sour\",\n \"Sauerkraut+Juice\",\n \"Romaine+salad\",\n \"Cafe\",\n \"Hearts+of+Lettuce\",\n \"Roast+Turkey\",\n \"Sliced+Oranges\",\n \"Broiled+Chicken\",\n \"Smoked+beef\",\n \"Sliced+pineapple\",\n \"Squash\",\n \"Instant+Postum\",\n \"Boiled+Ham\",\n \"Sherbet\",\n \"Jam\",\n \"Strawberry+shortcake\",\n \"Gruyere+Cheese\",\n \"Chicory\",\n \"Fresh+milk\",\n \"English+mutton+chop\",\n \"Potatoes,+French+fried\",\n \"Meringue+Glace\",\n \"Iced+Tea\",\n \"Wine+Jelly\",\n \"Stewed+rhubarb\",\n \"Liebfraumilch\",\n \"Rice\",\n \"BUTTERED+BEETS\",\n \"Tokay+Grapes\",\n \"Cream+of+tomato+soup\",\n \"Scotch+Woodcock\",\n \"Mock+turtle+soup\",\n \"Chambertin\",\n \"Spaghetti\",\n \"Stuffed+Tomato\",\n \"Apricots\",\n \"Plain+Omelet\",\n \"Hochheimer\",\n \"Sponge+Cake\",\n \"Pousse+Cafe\",\n \"Potatoes,+boiled\",\n \"Table+Celery\",\n \"Broiled+Fresh+Mushrooms\",\n \"Fresh+Strawberries\",\n \"Marmelade\",\n \"Yorkshire+Buck\",\n \"Hot+roast+beef+sandwich\",\n \"Canadian+Club\",\n \"Petite+marmite\",\n \"Canadian+Cheese\",\n \"Salted+Almonds\",\n \"Bluefish\",\n \"Pie+a+la+Mode\",\n \"boiled+new+potatoes\",\n \"Huitres\",\n \"Friandises\",\n \"Broccoli\",\n \"Kippered+Herring\",\n \"lemon+meringue+pie\",\n \"Au+Gratin+Potatoes\",\n \"Bel+Paese+Cheese\",\n \"Beefsteak\",\n \"Lobster+a+la+Newburg\",\n \"Daiquiri\",\n \"Thousand+Island+Dressing\",\n \"Saratoga+Potatoes\",\n \"Spanish+omelette\",\n \"Grand+Marnier\",\n \"Pistachio+Ice+Cream\",\n \"Liederkranz\",\n \"Broiled+Spring+Chicken\",\n \"Petit+Fours\",\n \"Seltzer\",\n \"Cointreau\",\n \"Grape+Fruit\",\n \"Macaroni\",\n \"Pickled+lamb's+tongue\",\n \"Hot+Chocolate\",\n \"Salat\",\n \"Hafergrutze\",\n \"Sirloin+Steak+with+Mushrooms\",\n \"Radieschen\",\n \"Spaghetti+au+Gratin\",\n \"Cherries\",\n \"Ices+in+Souvenir\",\n \"GREEN+TEA\",\n \"Creme+de+Cacao\",\n \"Potatoes,+mashed\",\n \"Stuffed+green+peppers\",\n \"MIXED+NUTS\",\n \"Budweiser\",\n \"Imported+Swiss+cheese\",\n \"Potatoes,+lyonnaise\",\n \"Peach+Ice+Cream\",\n \"Sliced+Orange\",\n \"Rice+Cakes\",\n \"Potatoes+Parisienne\",\n \"French+rolls\",\n \"Broiled+bluefish\",\n \"Sarsaparilla\",\n \"Bouillon\",\n \"Shredded+Wheat\",\n \"Consomme+Julienne\",\n \"Tangerines\",\n \"Apricot+Brandy\",\n \"Boston+Brown+Bread\",\n \"Grapefruit+Supreme\",\n \"Pickled+onions\",\n \"Hearts+of+lettuce+salad\",\n \"ORANGE+PEKOE+TEA\",\n \"American\",\n \"SANKA+COFFEE\",\n \"Milk+Toast\",\n \"Iced+Coffee\",\n \"rhubarb+pie\",\n \"Assorted+Cold+Cuts\",\n \"Sliced+Bananas\",\n \"Cheese+Sandwich\",\n \"Rice+Pudding\",\n \"Spinach+with+egg\",\n \"Fancy+Ices\",\n \"Red+Leg+Partridge\",\n \"Pork+and+beans\",\n \"Chutney\",\n \"orange+sherbet\",\n \"Chocolate+Parfait\",\n \"Lobster+cocktail\",\n \"Haut+Sauterne\",\n \"Apricot+Water+Ice\",\n \"Chow+Chow\",\n \"Swiss\",\n \"apple\",\n \"Cranberry+Sauce\",\n \"Canape+of+Anchovies\",\n \"Chicken+consomme\",\n \"German+Pancake\",\n \"Graves\",\n \"Tapioca+Pudding\",\n \"APRICOT+PIE\",\n \"Bar-le-Duc\",\n \"Chartreuse,+Yellow\",\n \"American+Cheese\",\n \"Club+Sandwich\",\n \"Roast+Lamb\",\n \"Gin+Fizz\",\n \"Cheese+Cake\",\n \"Cauliflower+au+Gratin\",\n \"Clam+Broth\",\n \"Chocolate+Eclairs\",\n \"Extra+sirloin+steak\",\n \"Philadelphia+Cream+Cheese\",\n \"cocoanut+pie\",\n \"Cherry+Pie\",\n \"English+Pheasant\",\n \"Wheat+Cakes\",\n \"Dipped+Toast\",\n \"Bismarck+Herring\",\n \"PRUNES\",\n \"Ham+Omelet\",\n \"Assorted+cheese\",\n \"Cheddar+Cheese\",\n \"Codfish+Cakes\",\n \"Soda\",\n \"American+Cheese+Sandwich\",\n \"Fresh+Vegetable+Salad\",\n \"Raspberry+sherbet\",\n \"Green+peas\",\n \"Apple+pie\",\n \"Martini+Cocktail\",\n \"Boston+baked+beans\",\n \"Fried+Oysters\",\n \"Strawberry+Ice+Cream\",\n \"Dutch+cheese\",\n \"Halibut+steak\",\n \"Ruddy+Duck\",\n \"MILK,+PER+GLASS\",\n \"Carciofini\",\n \"Nachtisch\",\n \"Pate+de+Foie+Gras\",\n \"Eggs,+fried\",\n \"Sliced+Peaches\",\n \"Celeri\",\n \"Preserved+Peaches\",\n \"Tenderloin+Steak+with+Mushrooms\",\n \"Fruit+in+Season\",\n \"Roastbeef\",\n \"RUM\",\n \"Baked+Beans\",\n \"Bluepoints\",\n \"Potatoes+Lyonnaise\",\n \"Cervelat\",\n \"Caviar,+Special+Importation\",\n \"Fried+hominy\",\n \"Lemon+Sherbet\",\n \"Dandelion+Salad\",\n \"Camembert+Cheese\",\n \"Lemon+Soda\",\n \"Lobster+Newburg\",\n \"Port+Salut\",\n \"Combination+Salad\",\n \"Extra+Special+Heavy+Cream\",\n \"Breakfast+Bacon\",\n \"Egg+plant\",\n \"Omelet,+plain\",\n \"Rudesheimer\",\n \"Rye+Bread\",\n \"Leberwurst\",\n \"Manhattan+Cocktail\",\n \"Fresh+String+Beans\",\n \"Fried+Clams\",\n \"cole+slaw\",\n \"Ox+Tongue\",\n \"Chocolate+eclair\",\n \"Sardellen\",\n \"Cheese+and+Crackers\",\n \"Corn+fritters\",\n \"French+asparagus\",\n \"Spanish+olives\",\n \"Potatoes,+baked\",\n \"Potato+Croquettes\",\n \"Caramel+custard\",\n \"Crabmeat+Cocktail\",\n \"Crab+flake+cocktail\",\n \"Strawberry+ice+cream\",\n \"CHAMPAGNE\",\n \"Clam+Stew\",\n \"Asparagus+Tips\",\n \"Orange+ice\",\n \"Chicken+Salad+Sandwich\",\n \"Mixed+Green+Salad\",\n \"Watercress+salad\",\n \"Fried+Oyster+Crabs\",\n \"Potatoes+hashed+in+cream\",\n \"Poland+Water\",\n \"Chef's+Salad\",\n \"Apfelsinen\",\n \"Baked+Alaska\",\n \"Sliced+Chicken\",\n \"Apple+Juice\",\n \"Coupe+of+Fresh+Strawberries,+Favorite\",\n \"Petits+Fours\",\n \"Camembert+cheese\",\n \"Celery+salad\",\n \"Lyon+Sausage\",\n \"Russian+caviar\",\n \"fresh+strawberry+ice+cream\",\n \"Cold+Chicken\",\n \"Mixed+Ice+Cream\",\n \"Champagne+Cocktail\",\n \"Cocktail\",\n \"HARICOTS+VERTS\",\n \"Grape+Nuts\",\n \"BLUEBERRY+PIE\",\n \"Eclair\",\n \"Preserved+Skinless+Figs\",\n \"Supreme+of+Fruit,+Astor\",\n \"Ice+Cream\",\n \"Julienne\",\n \"Stewed+pears\",\n \"Onion+Soup+au+gratin\",\n \"Cup+custard\",\n \"Obst\",\n \"Soft+Shell+Crabs\",\n \"Crackers+and+Milk\",\n \"Butter\",\n \"Assorted+Fruit\",\n \"Stinger\",\n \"Lettuce+and+Tomato\",\n \"Saucisson+de+Lyon\",\n \"Westphalían+Ham\",\n \"Boiled+Rice\",\n \"Raspberries\",\n \"Caviar+sandwich\",\n \"Cold+turkey\",\n \"crab+meat+cocktail\",\n \"Pot+of+Tea\",\n \"Spaghetti+Italienne\",\n \"Heart+of+Lettuce+Salad\",\n \"Oyster+Patties\",\n \"French+Toast\",\n \"Old+Fashioned\",\n \"Melon+in+Season\",\n \"Alligator+Pear+Salad\",\n \"Anchovis\",\n \"Cook's+Imperial\",\n \"Zeltinger\",\n \"MUFFINS\",\n \"Amandes+salees\",\n \"Stuffed+Olives\",\n \"Port+du+Salut\",\n \"PASTRY\",\n \"Bent's+Water+Crackers\",\n \"Side+Car\",\n \"Eggs,+boiled\",\n \"Chianti\",\n \"Eggs,+Scrambled\",\n \"Peach+Short+Cake\",\n \"Nuts+and+Raisins\",\n \"Fried+Soft+Shell+Crabs\",\n \"Clams\",\n \"Stewed+potatoes\",\n \"Terrapin\",\n \"Frische+Milch\",\n \"Potato\",\n \"Mumm's+Extra+Dry\",\n \"compot\",\n \"Marinated+Herring\",\n \"Coffee,+Pot\",\n \"Clear+green+turtle+soup\",\n \"Salami\",\n \"Chicken+okra+soup\",\n \"Bacardi+Cocktail\",\n \"California+Orange\",\n \"Apple+sauce\",\n \"Neapolitan+Ice+Cream\",\n \"Endive+salad\",\n \"Beef\",\n \"Cognac\",\n \"Macon\",\n \"Neapolitan\",\n \"Figs+in+syrup\",\n \"Lady+Fingers\",\n \"Stuffed+Figs+and+Dates\",\n \"Oatmeal+Porridge\",\n \"Mixed+Salad\",\n \"Cheese+Omelette\",\n \"Strawberry+jam\",\n \"Macaroni+au+Gratin\",\n \"Fried+Scallops\",\n \"Nesselrode+pudding\",\n \"Sliced+Bananas+and+Cream\",\n \"Irish+stew\",\n \"Cafe+Turc\",\n \"Oyster+Fry\",\n \"Fancy+Ice+Cream\",\n \"Fresh+Mackerel\",\n \"Vienna+Bread\",\n \"Grape+Juice\",\n \"Escarole+salad\",\n \"Clysmic\",\n \"Brawn\",\n \"Brook+Trout\",\n \"Fried+onions\",\n \"Fresh+strawberries+and+cream\",\n \"Bologna+Sausage\",\n \"Assorted+Nuts\",\n \"Welsh+Rarebit\",\n \"Chicken+sandwich\",\n \"Pear+\\\"au+feu+d'Enfer\\\"\",\n \"Chicken+(half)\",\n \"Clear+green+turtle\",\n \"Rockaways\",\n \"Biscuits\",\n \"Fried+Bacon\",\n \"Blackberries\",\n \"Coca+Cola\",\n \"Salted+almonds\",\n \"Young+Onions\",\n \"Onions\",\n \"Club+Soda\",\n \"Ribs+of+beef\",\n \"Roast+Lamb,+Mint+Sauce\",\n \"GRAHAM+ROLLS\",\n \"NEW+POTATOES\",\n \"Cream+cheese\",\n \"Squab+Chicken+(half)\",\n \"Old+Tom+Gin\",\n \"Shrimp\",\n \"Concombres\",\n \"Steamed+Rice\",\n \"Drambuie\",\n \"Coffee+ice+cream\",\n \"Whitebait\",\n \"Consomme+Vermicelli\",\n \"Crab+Meat+salad\",\n \"India+Relish\",\n \"Gebackene+Kartoffeln\",\n \"Rice+and+milk\",\n \"Lobster,+Newburg\",\n \"Fresh+asparagus\",\n \"Venison\",\n \"Sparkling+Moselle\",\n \"Lettuce+and+Tomato+Sandwich\",\n \"Ham+sandwich\",\n \"Curried+Chicken+with+Rice\",\n \"Gin+Rickey\",\n \"Cocktails\",\n \"Head+Cheese\",\n \"Cold+Lamb\",\n \"Hot+mince+pie\",\n \"Assorted+Fresh+Fruit\",\n \"Soup+du+Jour\",\n \"Scotch+Grouse\",\n \"Cold+rice+pudding\",\n \"Porterhouse+steak+with+mushrooms\",\n \"Pear+Melba\",\n \"Sirloin+steak\",\n \"Chicory+salad\",\n \"Brandy+peaches\",\n \"Plain+Lemonade\",\n \"COFFEE\",\n \"ROAST+TURKEY,+CRANBERRY+SAUCE\",\n \"Sherry+Flip\",\n \"Mangoes\",\n \"SALADE+DE+SAISON\",\n \"Raspberry+jam\",\n \"Fresh+Fruit+Cocktail\",\n \"Fried+Sweet+Potatoes\",\n \"Fish+cakes\",\n \"Claret+Punch\",\n \"Westphalia+Ham\",\n \"Lettuce+and+Tomatoes\",\n \"Lamb,+mint+sauce\",\n \"Guinness'+Stout\",\n \"Rolls+and+butter\",\n \"Spinach+with+Egg\",\n \"Fried+smelts\",\n \"Tea,+Pot\",\n \"Oyster+stew\",\n \"Maple+Syrup\",\n \"Macedoine+salad\",\n \"Canvas-Back+Duck\",\n \"Sirloin+Steak+with+Onions\",\n \"Coffee,+per+pot\",\n \"Smoked+Beef+Tongue\",\n \"TUTTI+FRUTTI+ICE+CREAM\",\n \"Pim-olas\",\n \"Strawberries+with+cream\",\n \"Corn+Cakes\",\n \"Ham+omelette\",\n \"Waffles\",\n \"Chocolade\",\n \"Spanish+omelet\",\n \"Sloe+Gin\",\n \"Red-head+duck\",\n \"Glass+of+milk\",\n \"Sliced+Bananas+with+Cream\",\n \"Brandy\",\n \"Vermouth,+Italian\",\n \"Canape+of+Caviar\",\n \"Julienne+Soup\",\n \"Eggs,+shirred\",\n \"Salmon+Salad\",\n \"Broiled+Squab\",\n \"Oyster+Bay+Asparagus\",\n \"Vienna+Rolls\",\n \"Mettwurst\",\n \"Chartreuse,+green\",\n \"Silver+Fizz\",\n \"Crab+Salad\",\n \"Pickled+Oysters\",\n \"Alligator+Pear\",\n \"Caviar+Canape\",\n \"Pont+l'Eveque+cheese\",\n \"Prune+Juice\",\n \"Tongue+sandwich\",\n \"Pistache+Ice+Cream\",\n \"Mock+Turtle\",\n \"New+asparagus\",\n \"Gervais\",\n \"Tea,+per+pot\",\n \"Potatoes+Julienne\",\n \"Gumbo\",\n \"Malted+Milk\",\n \"Chicken+Soup\",\n \"Capon\",\n \"Beef+consomme\",\n \"Corn+Flakes\",\n \"Crabflake+Cocktail\",\n \"Assorted+Hors+D'oeuvres\",\n \"Ham+and+Eggs\",\n \"Ribs+of+prime+beef\",\n \"Beef+tongue\",\n \"Cream,+per+glass\",\n \"Sauerkraut\",\n \"Stewed+Oysters\",\n \"Finnan+Haddie\",\n \"Sloe+Gin+Fizz\",\n \"AMERICAN+COFFEE\",\n \"Crab+Meat+Cocktail\",\n \"liver+and+bacon\",\n \"Fresh+mushrooms\",\n \"lemon+pie\",\n \"Pie\",\n \"Cold+Consomme\",\n \"Chocolate+Sundae\",\n \"Consomme+en+Tasse\",\n \"Dill+Pickle\",\n \"Port+du+Salut+cheese\",\n \"Pink+Lady\",\n \"Bacon+and+Eggs\",\n \"Broiled+Chicken+(half)\",\n \"Country+Sausage\",\n \"Potatoes,+Saratoga\",\n \"Turnips\",\n \"Graham+Wafers\",\n \"Broiled+oysters\",\n \"Gekochte+Kartoffeln\",\n \"Stewed+Strawberries\",\n \"Cafe+Noir\",\n \"Waldorf+salad\",\n \"Baked+apples+with+cream\",\n \"St.+Estephe\",\n \"Liver+Sausage\",\n \"Boston+Cream+Pie\",\n \"Spring+Onions\",\n \"Lamb+Chop\",\n \"Potatoes+O'Brien\",\n \"Tomato+Broth\",\n \"Roast+Beef\",\n \"Moet+&+Chandon\",\n \"Veuve+Clicquot,+Yellow+Label\",\n \"Roast+Potatoes\",\n \"Fruits+in+Season\",\n \"Boned+capon\",\n \"Eclairs\",\n \"Spring+chicken\",\n \"Cauliflower,+Polonaise\",\n \"Hashed+Browned+Potatoes\",\n \"Corn+Fritters\",\n \"Fruit+Salad\",\n \"Lemon+Water+Ice\",\n \"Milchreis\",\n \"Caviar+on+Toast\",\n \"Rostbraten\",\n \"Chateau+Yquem\",\n \"Spring+Turkey+(half)\",\n \"Clam+broth\",\n \"New+beets\",\n \"Lemon+ice+cream\",\n \"Crullers\",\n \"Cacao\",\n \"Jamaica+Rum\",\n \"Potatoes,+Fried\",\n \"Water+Crackers\",\n \"Petits+pois\",\n \"Chocolate+Layer+Cake\",\n \"Apple+Fritters\",\n \"PINEAPPLE+WATER+ICE\",\n \"Schweizer+Käse\",\n \"French+Sardines\",\n \"Fresh+Fruit+Cup\",\n \"Long+Island+Duckling\",\n \"Cream+Toast\",\n \"Malaga+Grapes\",\n \"Boiled+Onions,+Cream+Sauce\",\n \"Hamburg+steak\",\n \"Margaux\",\n \"Beaune\",\n \"Golden+plover\",\n \"French+vanilla+ice+cream\",\n \"Jelly\",\n \"Combination+salad\",\n \"Ginger\",\n \"Ruinart+Brut\",\n \"Lamb+Chops+(2)\",\n \"Pumpkin+pie\",\n \"OLIVES\",\n \"Sliced+Cucumbers\",\n \"Old+Tom\",\n \"Strained+honey\",\n \"Tomato+Omelette\",\n \"Vegetable+Salad\",\n \"Pineapple+Cheese\",\n \"China+Tea\",\n \"Linden+Tea\",\n \"German+fried+potatoes\",\n \"Blackberry+Brandy\"\n] \nvar rand = myArray[Math.floor(Math.random() * myArray.length)];\n\ndplareq = function(rand) {\n\nrest.get('http://api.dp.la/v2/items?&sourceResource.subject.name=food+and+cooking&sourceResource.type=image&q='+rand+'&api_key=').on('complete', function(data, response){\n\t\t\tvar results = data.docs; // Grabs up to ten results from the DPLA\n\t\t\tvar i = Math.floor(Math.random()*results.length); // Select a random number based on the number of results from DPLA\n if (data.docs.length == 0){\n rand = myArray[Math.floor(Math.random() * myArray.length)];\n dplareq(rand) \n } \n else {\n\t\t\titemTitle = data.docs[i].sourceResource.title; // Uses the random number to select a single item from the list of DPLA results\n\t\t\t\n\t\t\t// Sometimes the titles are too long for a tweet. Here we shorten them and add an ellipsis\n\t\t\tif (itemTitle.length > 60){\n\t\t\t itemTitle = itemTitle.substr(0, 60) + \"\\u2026\";\n\t\t\t }\n\t\t\telse {itemTitle = itemTitle;\n\t\t\t }\n\t\n\t\t\titemURL = \"http://dp.la/item/\" + data.docs[i].id; // This is the source URL for the item\n\n\t\n\t// Now we build\tthe tweet, which is made up of an introductory phrase, the pluralized noun, another phrase, and the item title and URL\t\n\tvar prettyrand = rand.replace(\"+\", \" \");\n statement = intro + prettyrand + check + \"\\u201c\" + itemTitle + \"\\u201d at \" + itemURL;\n\tconsole.log(statement);\n\t\t // tweet it!\t\n\t\tT.post('statuses/update', {status: statement}, function(err, reply) {});\n}\n\t});\n\t\n\t }\n \n\ndplareq(rand)\n}", "title": "" }, { "docid": "3a64d13bd32004a9245bd3dd310b32de", "score": "0.5010544", "text": "function Speak(libraries, moods, statements, segments) {\n 'use strict';\n // SpeechLibraries\n this.libraries = libraries || [\n new SpeechLibrary('sources', 's', 'context of origin', \n ['i', 'we', 'it', 'they', 'she', 'he']),\n new SpeechLibrary('possessors', 'p', 'possession claims', \n ['my', 'your', 'our', 'his', 'her', 'its', 'the', 'this']),\n new SpeechLibrary('subjects', 'sub', 'entities',\n ['her', 'him', 'me', 'this', 'it', 'that']),\n new SpeechLibrary('emotives', 'emo', 'n-time self-referencing',\n ['*', 'can', 'will', 'shall', 'might', 'should', 'could', 'would'],\n function (statement, position, mood, speak) {\n \t\tvar word = getRandomItem(this.list),\n \t\t\tlastWord = getLastWord(statement, position);\n\n if (word === '*') {\n \tif (lastWord === 'we' || lastWord === 'they') {\n \t\tword = 'are';\n \t} else if(lastWord === 'it' || lastWord === 'he' || lastWord === 'she') {\n \t\tword = 'is';\n \t} else {\n \t\tword = 'am';\n \t}\n }\n return word;\n }),\n new SpeechLibrary('conditionals', 'c', 'logical conditions',\n ['then', 'but', 'and', 'or']),\n new SpeechLibrary('reflections', 'ref', 'object-oriented self-referencing',\n ['is', 'was', 'will be'],\n function (statement, position, mood, speak) {\n \t\tvar word = getRandomItem(this.list),\n \t\t\tlastWord = getLastWord(statement, position);\n\t \n\t if (lastWord[lastWord.length - 1] === 's') {\n\t\t if (word === 'is') {\n\t\t word = 'are';\n\t\t } else if (word === 'was') {\n\t\t \tword = 'were';\n\t\t }\n\t }\n\t return word;\n\t }),\n new SpeechLibrary('actions', 'a', 'verbs',\n ['accept', 'care', 'could', 'enjoy', 'lead', 'open', 'reduce', 'settle', 'teach', 'account', 'carry', 'count', 'examine', 'hate', 'learn', 'order', 'refer', 'shake', 'tell', 'achieve', 'catch', 'cover', 'have', 'leave', 'ought', 'reflect', 'shall', 'tend', 'act', 'cause', 'create', 'expect', 'head', 'lend', 'own', 'refuse', 'share', 'test', 'add', 'change', 'cross', 'experience', 'hear', 'let', 'pass', 'regard', 'shoot', 'thank', 'admit', 'charge', 'cry', 'explain', 'help', 'lie', 'pay', 'relate', 'think', 'affect', 'check', 'cut', 'express', 'hide', 'like', 'perform', 'release', 'shout', 'throw', 'afford', 'choose', 'damage', 'extend', 'hit', 'limit', 'pick', 'remain', 'show', 'touch', 'agree', 'claim', 'dance', 'face', 'hold', 'link', 'place', 'remember', 'shut', 'train', 'aim', 'clean', 'deal', 'fail', 'hope', 'listen', 'plan', 'remove', 'sing', 'travel', 'allow', 'clear', 'decide', 'fall', 'hurt', 'live', 'play', 'repeat', 'sit', 'treat', 'answer', 'climb', 'deliver', 'fasten', 'identify', 'look', 'point', 'replace', 'sleep', 'try', 'appear with', 'close', 'demand', 'feed', 'imagine', 'lose', 'prefer', 'reply', 'smile', 'turn', 'apply', 'collect', 'deny', 'feel', 'improve', 'love', 'prepare', 'report', 'sort', 'understand', 'argue', 'come', 'depend', 'fight', 'include', 'make', 'present', 'represent', 'sound', 'use', 'arrange', 'commit', 'describe', 'fill', 'increase', 'manage', 'press', 'require', 'speak', 'used to', 'arrive', 'compare', 'design', 'find', 'indicate', 'mark', 'prevent', 'rest', 'stand', 'visit', 'ask', 'complain', 'destroy', 'finish', 'influence', 'matter', 'produce', 'result', 'start', 'vote', 'attack', 'complete', 'develop', 'fit', 'inform', 'may', 'promise', 'return', 'state', 'wait', 'avoid', 'concern', 'die', 'fly', 'intend', 'mean', 'protect', 'reveal', 'stay', 'walk', 'base', 'confirm', 'disappear', 'fold', 'introduce', 'measure', 'prove', 'ring', 'stick', 'want', 'connect', 'discover', 'follow', 'invite', 'meet', 'provide', 'rise', 'stop', 'warn', 'beat', 'consider', 'discuss', 'force', 'involve', 'mention', 'publish', 'roll', 'study', 'wash', 'become', 'consist', 'divide', 'forget', 'join', 'might', 'pull', 'run', 'succeed', 'watch', 'begin', 'contact', 'do', 'forgive', 'jump', 'mind', 'push', 'save', 'suffer', 'wear', 'believe', 'contain', 'draw', 'form', 'keep', 'miss', 'put', 'say', 'suggest', 'will', 'belong', 'continue', 'dress', 'found', 'kick', 'move', 'raise', 'see', 'suit', 'win', 'break', 'contribute', 'drink', 'gain', 'kill', 'must', 'reach', 'supply', 'wish', 'build', 'control', 'drive', 'get', 'knock', 'need', 'read', 'sell', 'support', 'wonder', 'burn', 'cook', 'drop', 'give', 'know', 'notice', 'realize', 'send', 'suppose', 'work', 'buy', 'copy', 'eat', 'go', 'last', 'obtain', 'receive', 'separate', 'survive', 'worry', 'call', 'correct', 'enable', 'grow', 'laugh', 'occur', 'recognize', 'serve', 'take', 'would', 'can', 'cost', 'encourage', 'handle', 'lay', 'offer', 'record', 'set', 'talk', 'write', 'sniff'],\n function (statement, position, mood, speak) {\n\t \t\tvar word = getRandomItem(this.list),\n\t \t\t\tlastWord = getLastWord(statement, position),\n\t \t\t\tlastLetter = word[word.length - 1];\n\t\n\t if (speak.getLibrary('meanings').list.indexOf(lastWord) !== -1 && lastWord.substr(lastWord.length - 2) == 'ly') {\n\t \tif (lastLetter === 'e') {\n\t \t\t//word = word.substr(0, word.length - 2);\n\t \t}\n\t \t//word = word + 'ing';\n\t } else if (lastWord === 'it' || lastWord === 'she' || lastWord === 'he') {\n\t \t//word = word + 's';\n\t }\n\t return word;\n\t } \n ),\n new SpeechLibrary('meanings', 'm', 'adverbs',\n ['just', 'also', 'very', 'even', 'still', 'never', 'really', 'over', 'always', 'often', 'however', 'almost', 'later', 'much', 'once', 'already', 'maybe', 'actually', 'probably', 'of course', 'perhaps', 'sometimes', 'finally', 'more', 'less', 'better', 'early', 'especially', 'either', 'quite', 'simply', 'nearly', 'certainly', 'quickly', 'recently', 'usually', 'thus', 'exactly', 'hard', 'particularly', 'pretty', 'clearly', 'indeed', 'rather', 'suddenly', 'best', 'instead', 'fast', 'eventually', 'directly']),\n new SpeechLibrary('descriptions', 'd', 'adjectives',\n ['so', 'different', 'used', 'important', 'every', 'large', 'available', 'popular', 'able', 'basic', 'known', 'various', 'difficult', 'several', 'united', 'historical', 'hot', 'useful', 'mental', 'scared', 'additional', 'emotional', 'old', 'political', 'similar', 'healthy', 'financial', 'medical', 'traditional', 'federal', 'entire', 'strong', 'actual', 'significant', 'successful', 'electrical', 'expensive', 'pregnant', 'intelligent', 'interesting', 'poor', 'happy', 'responsible', 'cute', 'helpful', 'recent', 'willing', 'nice', 'wonderful', 'impossible', 'serious', 'huge', 'rare', 'technical', 'typical', 'competitive', 'critical', 'electronic', 'immediate', 'whose', 'aware', 'educational', 'environmental', 'global', 'legal', 'relevant', 'accurate', 'capable', 'dangerous', 'dramatic', 'efficient', 'powerful', 'foreign', 'hungry', 'practical', 'psychological', 'severe', 'suitable', 'numerous', 'sufficient', 'unusual', 'consistent', 'cultural', 'existing', 'famous', 'pure', 'afraid', 'obvious', 'careful', 'latter', 'obviously', 'unhappy', 'acceptable', 'aggressive', 'distinct', 'eastern', 'logical', 'reasonable', 'strict', 'successfully', 'administrative', 'automatic', 'civil', 'former', 'massive', 'southern', 'unfair', 'visible', 'alive', 'angry', 'desperate', 'exciting', 'friendly', 'lucky', 'realistic', 'sorry', 'ugly', 'unlikely', 'anxious', 'comprehensive', 'curious', 'impressive', 'informal', 'inner', 'pleasant', 'sexual', 'sudden', 'terrible', 'unable', 'weak', 'wooden', 'asleep', 'confident', 'conscious', 'decent', 'embarrassed', 'guilty', 'lonely', 'mad', 'nervous', 'odd', 'remarkable', 'substantial', 'suspicious', 'tall', 'tiny', 'more', 'some', 'one', 'all', 'many', 'most', 'other', 'such', 'even', 'new', 'just', 'good', 'any', 'each', 'much', 'own', 'great', 'another', 'same', 'few', 'free', 'right', 'still', 'best', 'public', 'human', 'both', 'local', 'sure', 'better', 'general', 'specific', 'enough', 'long', 'small', 'less', 'high', 'certain', 'little', 'common', 'next', 'simple', 'hard', 'past', 'big', 'possible', 'particular', 'real', 'major', 'personal', 'current', 'left', 'national', 'least', 'natural', 'physical', 'short', 'last', 'single', 'individual', 'main', 'potential', 'professional', 'international', 'lower', 'open', 'according', 'alternative', 'special', 'working', 'true', 'whole', 'clear', 'dry', 'easy', 'cold', 'commercial', 'full', 'low', 'primary', 'worth', 'necessary', 'positive', 'present', 'close', 'creative', 'green', 'late', 'fit', 'glad', 'proper', 'complex', 'content', 'due', 'effective', 'middle', 'regular', 'fast', 'independent', 'original', 'wide', 'beautiful', 'complete', 'active', 'negative', 'safe', 'visual', 'wrong', 'ago', 'quick', 'ready', 'straight', 'white', 'direct', 'excellent', 'extra', 'junior', 'pretty', 'unique', 'classic', 'final', 'overall', 'private', 'separate', 'western', 'alone', 'familiar', 'official', 'perfect', 'bright', 'broad', 'comfortable', 'flat', 'rich', 'warm', 'young', 'heavy', 'valuable', 'correct', 'leading', 'slow', 'clean', 'fresh', 'normal', 'secret', 'tough', 'brown', 'cheap', 'deep', 'objective', 'secure', 'thin', 'chemical', 'cool', 'extreme', 'exact', 'fair', 'fine', 'formal', 'opposite', 'remote', 'total', 'vast', 'lost', 'smooth', 'dark', 'double', 'equal', 'firm', 'frequent', 'internal', 'sensitive', 'constant', 'minor', 'previous', 'raw', 'soft', 'solid', 'weird', 'amazing', 'annual', 'busy', 'dead', 'false', 'round', 'sharp', 'thick', 'wise', 'equivalent', 'initial', 'narrow', 'nearby', 'proud', 'spiritual', 'wild', 'adult', 'apart', 'brief', 'crazy', 'prior', 'rough', 'sad', 'sick', 'strange', 'external', 'illegal', 'loud', 'mobile', 'nasty', 'ordinary', 'royal', 'senior', 'super', 'tight', 'upper', 'yellow', 'dependent', 'funny', 'gross', 'ill', 'spare', 'sweet', 'upstairs', 'usual', 'brave', 'calm', 'dirty', 'downtown', 'grand', 'honest', 'loose', 'male', 'quiet', 'brilliant', 'dear', 'drunk', 'empty', 'female', 'inevitable', 'neat', 'ok', 'representative', 'silly', 'slight', 'smart', 'stupid', 'temporary', 'weekly', 'that', 'this', 'what', 'which', 'time', 'these', 'work', 'no', 'only', 'first', 'over', 'business', 'his', 'game', 'think', 'after', 'life', 'day', 'home', 'economy', 'away', 'either', 'fat', 'key', 'training', 'top', 'level', 'far', 'fun', 'house', 'kind', 'future', 'action', 'live', 'mean', 'stock', 'chance', 'beginning', 'upset', 'chicken', 'head', 'material', 'salt', 'car', 'appropriate', 'inside', 'outside', 'standard', 'medium', 'choice', 'north', 'square', 'born', 'capital', 'shot', 'front', 'living', 'plastic', 'express', 'mood', 'feeling', 'otherwise', 'plus', 'saving', 'animal', 'budget', 'minute', 'character', 'maximum', 'novel', 'plenty', 'select', 'background', 'forward', 'glass', 'joint', 'master', 'red', 'vegetable', 'ideal', 'kitchen', 'mother', 'party', 'relative', 'signal', 'street', 'minimum', 'sea', 'south', 'status', 'daughter', 'trick', 'afternoon', 'gold', 'mission', 'agent', 'corner', 'east', 'neither', 'parking', 'routine', 'swimming', 'winter', 'airline', 'designer', 'dress', 'emergency', 'evening', 'extension', 'holiday', 'horror', 'mountain', 'patient', 'proof', 'west', 'wine', 'expert', 'native', 'opening', 'silver', 'waste', 'plane', 'leather', 'purple', 'specialist', 'bitter', 'incident', 'motor', 'pretend', 'prize', 'resident', 'furious', 'bad', 'awful', 'terrible', 'horrible', 'big', 'huge', 'gigantic', 'giant', 'clean', 'spotless', 'cold', 'freezing', 'crowded', 'packed', 'dirty', 'filthy', 'funny', 'hilarious', 'good', 'wonderful', 'fantastic', 'excellent', 'hot', 'boiling', 'hungry', 'starving', 'interesting', 'fascinating', 'old', 'ancient', 'pretty', 'gorgeous', 'scary', 'terrifying', 'small', 'tiny', 'surprising', 'astounding', 'tired', 'exhausted', 'ugly', 'hideous'],\n\t function (statement, position, mood, speak) {\n\t\t \t\tvar word = getRandomItem(this.list),\n\t\t \t\t\tlastWord = getLastWord(statement, position);\n\t\t\n\t\t \t\tconsole.log(lastWord);\n\t\t if (speak.getLibrary('emotives').list.indexOf(lastWord) !== -1) {\n\t\t \tword = 'be ' + word;\n\t\t }\n\t\t return word;\n\t\t }\n ),\n new SpeechLibrary('objects', 'o', 'nouns',\n ['gypsy curse', 'moment of silence', 'sausage festival', 'honest cop with nothing left to lose', 'famine', 'flesh-eating bacteria', 'flying sex snake', 'shapeshifter', 'porn star', 'time travel paradox', 'authentic mexican cuisine', 'bling', 'consultant', 'crippling debt', 'daddy issues', 'donald trump seal of approval', 'former president george w. bush', 'full frontal nudity', 'hormone injections', 'public ridicule', 'boogers', 'inevitable heat death of the universe', 'miracle of childbirth', 'rapture', 'white privilege', 'wifely duties', 'hamburglar', 'axe body spray', 'blood of christ', 'batman', 'agriculture', 'robust mongoloid', 'natural selection', 'coat hanger abortion', 'michelle obama\\'s arms', 'world of warcraft', 'obesity', 'homoerotic volleyball montage', 'lockjaw', 'a mating display', 'testicular torsion', 'all-you-can-eat shrimp for $4.99', 'domino\\'s oreo dessert pizza', 'kanye west', 'hot cheese', 'raptor attack', 'smegma', 'alcoholism', 'middle-aged man on roller skates', 'care bear stare', 'oversized lollipop', 'self-loathing', 'children on leashes', 'half-assed foreplay', 'holy bible', 'german dungeon porn', 'teenage pregnancy', 'gandhi', 'uppercut', 'customer service representative', 'genitals', 'science', 'flightless birds', 'balanced breakfast', 'historically black colleges', 'make-a-wish foundation', 'clandestine butt scratch', 'passive-aggressive post-it notes', 'chinese gymnastics team', 'nocturnal emissions', 'jews', 'humps', 'powerful thighs', 'gentle caress of the inner thigh', 'sexual tension', 'forbidden fruit', 'skeletor', 'fancy feast', 'sweet, sweet vengeance', 'republicans', 'gassy antelope', 'natalie portman', 'kamikaze pilots', 'sean connery', 'homosexual agenda', 'hardworking mexican', 'falcon with a cap on its head', 'altar boys', 'kool-aid man', 'free samples', 'big hoopla about nothing', 'three-fifths compromise', 'lactation', 'world peace', 'robocop', 'chutzpah', 'justin bieber', 'oompa-loompas', 'puberty', 'ghosts', 'asymmetric boob job', 'vigorous jazz hands', 'gogurt', 'police brutality', 'john wilkes booth', 'preteens', 'darth vader', 'sad handjob', 'adderall', 'embryonic stem cells', 'tasteful sideboob', 'panda sex', 'icepick lobotomy', 'tom cruise', 'mouth herpes', 'sperm whales', 'homeless people', 'third base', 'incest', 'pac-man uncontrollably guzzling cum', 'mime having a stroke', 'hulk hogan', 'god', 'golden showers', 'emotions', 'pabst blue ribbon', 'placenta', 'spontaneous human combustion', 'friends with benefits', 'old-people smell', 'inner demons', 'super soaker full of cat pee', 'aaron burr', 'chronic', 'cockfights', 'friendly fire', 'ronald reagan', 'disappointing birthday party', 'sassy black woman', 'mathletes', 'tiny horse', 'william shatner', 'm. night shyamalan plot twist', 'jew-fros', 'mutually-assured destruction', 'pedophiles', 'yeast', 'catapults', 'poor people', 'hustle', 'force', 'intelligent design', 'loose lips', 'aids', 'pictures of boobs', 'Ubermensch', 'sarah palin', 'american gladiators', 'scientology', 'penis envy', 'frolicking', 'midgets shitting into a bucket', 'KKK', 'genghis khan', 'crystal meth', 'serfdom', 'stranger danger', 'bop it', 'shaquille o\\'neal\\'s acting career', 'prancing', 'vigilante justice', 'overcompensation', 'pixelated bukkake', 'lifetime of sadness', 'racism', 'dwarf tossing', 'sunshine and rainbows', 'monkey smoking a cigar', 'flash flooding', 'lance armstrong\\'s missing testicle', 'dry heaving', 'terrorists', 'britney spears at 55', 'attitude', 'leprosy', 'gloryholes', 'nipple blades', 'heart of a child', 'puppies', 'dental dams', 'toni morrison\\'s vagina', 'taint', 'ethnic cleansing', 'little engine that could', 'invisible hand', 'unfathomable stupidity', 'euphoria by calvin klein', 're-gifting', 'autocannibalism', 'erectile dysfunction', 'collection of high-tech sex toys', 'pope', 'white people', 'tentacle porn', 'too much hair gel', 'seppuku', 'same-sex ice dancing', 'charisma', 'keanu reeves', 'sean penn', 'nickelback', 'look-see', 'menstruation', 'kids with ass cancer', 'salty surprise', 'south', 'violation of our most basic human rights', 'necrophilia', 'centaurs', 'bill nye the science guy', 'black people', 'chivalry', 'lunchables', 'bitches', 'profoundly handicapped', 'heartwarming orphans', 'mechahitler', 'fiery poops', 'another goddamn vampire movie', 'tangled slinky', 'estrogen', 'zesty breakfast burrito', 'bleached asshole', 'michael jackson', 'cybernetic enhancements', 'guys who don\\'t call', 'smallpox blankets', 'masturbation', 'classist undertones', 'queefing', 'edible underpants', 'viagra', 'soup that is too hot', 'muhammad (praise be unto him)', 'surprise sex', 'five-dollar footlongs', 'dick fingers', 'multiple stab wounds', 'child abuse', 'anal beads', 'civilian casualties', 'robert downey, jr', 'horse meat', 'really cool hat', 'kim jong-il', 'stray pube', 'jewish fraternities', 'token minority', 'doin\\' it in the butt', 'can of whoop-ass', 'windmill full of corpses', 'count chocula', 'death ray', 'glass ceiling', 'cooler full of organs', 'american dream', 'keg stands', 'take-backsies', 'dead babies', 'foreskin', 'saxophone solos', 'italians', 'fetus', 'dick cheney', 'amputees', 'eugenics', 'relationship status', 'christopher walken', 'bees', 'harry potter erotica', 'college', 'nazis', '8 oz. of sweet mexican black-tar heroin', 'stephen hawking talking dirty', 'dead parents', 'object permanence', 'opposable thumbs', 'racially-biased sat questions', 'jibber-jabber', 'chainsaws for hands', 'nicolas cage', 'child beauty pageants', 'explosions', 'repression', 'roofies', 'vagina', 'assless chaps', 'murder most foul', 'trail of tears', 'goblins', 'hope', 'rev. dr. martin luther king, jr', 'micropenis', 'soul', 'hot mess', 'vikings', 'hot people', 'seduction', 'oedipus complex', 'geese', 'global warming', 'new age music', 'hot pockets', 'vehicular manslaughter', 'women\\'s suffrage', 'defective condom', 'judge judy', 'african children', 'virginia tech massacre', 'barack obama', 'asians who aren\\'t good at math', 'elderly japanese men', 'heteronormativity', 'arnold schwarzenegger', 'road head', 'spectacular abs', 'figgy pudding', 'mopey zoo lion', 'bag of magic beans', 'poor life choices', 'sex life', 'auschwitz', 'thermonuclear detonation', 'clitoris', 'big bang', 'land mines', 'friends who eat all the snacks', 'goats eating cans', 'dance of the sugar plum fairy', 'man meat', 'me time', 'underground railroad', 'poorly-timed holocaust jokes', 'sea of troubles', 'lumberjack fantasies', 'morgan freeman\\'s voice', 'women in yogurt commercials', 'natural male enhancement', 'genital piercings', 'passable transvestites', 'sexy pillow fights', 'balls', 'grandma', 'friction', 'party poopers', 'tempur-pedic swedish sleep system', 'hurricane katrina', 'gays', 'folly of man', 'men', 'amish', 'pterodactyl eggs', 'team-building exercises', 'brain tumor', 'fear itself', 'lady gaga', 'milk man', 'foul mouth', 'big black dick', 'beached whale', 'bloody pacifier', 'crappy little hand', 'low standard of living', 'nuanced critique', 'panty raids', 'passionate latino lover', 'rival dojo', 'web of lies', 'woman scorned', 'clams', 'appreciative snapping', 'neil patrick harris', 'shaft', 'bosnian chicken farmers', 'nubile slave boys', 'carnies', 'suicidal thoughts', 'dorito breath', 'enormous scandinavian women', 'gandalf', 'genetically engineered super-soldiers', 'george clooney\\'s musk', 'gladiatorial combat', 'good grammar', 'hipsters', 'historical revisionism', 'insatiable bloodlust', 'jafar', 'jean-claude van damme', 'just the tip', 'mad hacky-sack skills', 'media coverage', 'medieval times dinner and tournament', 'moral ambiguity', 'machete', 'one thousand slim jims', 'ominous background music', 'quiche', 'quivering jowls', 'revenge fucking', 'ryan gosling riding in on a white horse', 'santa claus', 'scrotum tickling', 'sexual humiliation', 'sexy siamese twins', 'slow motion', 'space muffins', 'statistically validated stereotypes', 'sudden poop explosion disease', 'boners of the elderly', 'economy', 'fanta girls', 'gulags', 'harsh light of day', 'hiccups', 'shambling corpse of larry king', 'four arms of vishnu', 'words, words, words', 'zeus\\'s sexual appetites'],\n\t function (statement, position, mood, speak) {\n\t \t\tvar word = getRandomItem(this.list),\n\t \t\t\tlastWord = getLastWord(statement, position),\n\t \t\t\tfirstLetter = word[0],\n\t \t\t\tlastLetter = word[word.length - 1];\n\t\n\t\t if (lastWord === 'was' || lastWord === 'is' || lastWord === 'were' || lastWord === 'are') {\n\t\t \tif(lastLetter === 's') {\n\t\t \t\tword = 'the ' + word;\n\t\t \t} else if (['a', 'e', 'i', 'o', 'u'].indexOf(firstLetter) !== -1) {\n\t\t \t\tword = 'an ' + word;\n\t\t \t} else {\n\t\t \t\tword = 'a ' + word;\n\t\t \t}\n\t\t }\n\t\t \n\t\t if(statement[position - 1] === '#') {\n\t\t \tword = word.replace(/\\s/g, '');\n\t\t }\n\t\t return word;\n\t\t } \n ),\n new SpeechLibrary('influencers', 'i', 'emotionally influential statements', [],\n function (statement, position, mood, speak) {\n return getRandomItem(mood.influencers);\n }),\n new SpeechLibrary('punctuations', 'punc', 'punctuation', [],\n function (statement, position, mood, speak) {\n return getRandomItem(mood.punctuations);\n }),\n new SpeechLibrary('emoticons', 'icon', 'emoticons', [],\n function (statement, position, mood, speak) {\n return getRandomItem(mood.emoticons);\n })\n ];\n\n // Moods\n this.moods = moods || [\n new Mood('anger', \n ['goddamnit', 'fuck', 'shit', 'argghhh', 'grrrrr'], \n ['.', '...', '!', '!!!', '?!?'], \n ['>:)', '>:(', '>:|'],\n function(statement) {\n \t\tif (getRandomRange(1, 100) <= 50) {\n \t\t\treturn statement.toUpperCase();\n \t\t}\n \t\treturn statement;\n \t}),\n new Mood('jealousy', \n ['hrmmm', 'oh yes', 'hey', 'oooooo'], \n ['.', '...', '!', '?', '!!!', '?!?'], \n [':)', ':(', ':d', '<3', ':c', 'c:', ':o', ':O', '.___.', '-___-', '-___-\\'']),\n new Mood('fear', \n ['oh god', 'no', 'well', 'ummmm'], \n ['.', '...', '!', '?', '!!!', '?!?'], \n [':(', ':C', 'D:', ':o', ':O', '-___-\\'']),\n new Mood('paranoia', \n ['wait', 'what', 'no'], \n ['.', '!', '?', '!!!', '?!?'], \n [':|', ':o', ':O', ':p', '<_<', '>_>', '-___-\\'']),\n new Mood('curiosity', \n ['ooooo', 'hey', 'wow', 'yes', 'yo', 'oh'], \n ['.', '...', '!', '?'], \n [':)', ':3', ':o', ':O', ':D', ';)']),\n new Mood('joyful', \n ['oh', 'yes', 'wow', 'oh boy'], \n ['!', '!!!'], \n [':)', ':D', ':3', '<3', 'C:', ':P']),\n new Mood('excited', \n ['oh', 'yay', 'wow'], \n ['!', '!!!', '?!?'], \n [':)', ':D', ':3', '<3', 'C:', ':P', ':O']),\n new Mood('calm', \n ['well'], \n ['.', '...'], \n [':|']),\n new Mood('ashamed', \n ['no', 'uhhh', 'ummmm', 'sorry'], \n ['...'], \n [':(', 'D:', ':C', ':L', '.___.', '-___-', '-___-\\'']),\n new Mood('apathetic', \n ['meh'], \n ['...'], \n [':|', '.___.', '-___-']),\n new Mood('logical', \n ['yes', 'no'], \n ['.'], \n [':|'])\n ];\n\n /// Statement templates to use \n this.statements = statements || [\n 'if %seg, %c %seg',\n '%seg%punc %seg',\n 'should %s %a %p? %o %c %m %a %p %d %o',\n '%i, %seg',\n '%seg',\n '%seg. %i',\n '%s %emo %d, %c? %seg',\n 'i don\\'t always %a, but when i do, it\\'s %o',\n 'maybe she\\'s born with it. maybe it\\'s %o',\n 'i got 99 problems but %o ain\\'t one',\n 'i drink to forget %p %o',\n '%seg. that\\'s how I want to die',\n 'for my next trick, I will pull %o out of %o',\n '%o is a slippery slope that leads to %o',\n '%seg%punc high five, bro',\n 'during sex, I like to think about %o',\n '%seg: kid-tested, mother-approved',\n '%o + %o = %o',\n 'science will never explain %o',\n 'my country, \\'tis of thee, sweet land of %o',\n '#%o',\n '%o.tumblr.com',\n '%o@%o.com',\n '%o. the other white meat',\n 'you\\'re not gonna believe this, but %seg',\n '%o ain\\'t nothin\\' to fuck wit\\'',\n 'I like %o, but %i, %a the %o already'\n ];\n\n // Standalone isomorphic sentences\n this.segments = segments || [\n '%s %emo %d',\n '%p? %o %ref? %d',\n '%p %o %ref %o',\n '%s %emo? %m? %a %sub, %o',\n '%s %emo? %m? %a %o',\n '%s %a %p %d? %o',\n '%o %ref %p %d? %o',\n '%s %emo %m? %a %p %d? %o',\n '%a %sub %m?',\n '%i',\n '%p? %d? %o',\n ];\n}", "title": "" }, { "docid": "27665e07291a06860bfc5adc4aef7960", "score": "0.5007189", "text": "createPhrases()\n {\n return [ new Phrase(\"This is a game\"), new Phrase(\"TeamTreeHouse JS exam\"), new Phrase(\"We will make it\"), new Phrase(\"This is a test app\"), new Phrase(\"Game show app\")]\n }", "title": "" }, { "docid": "874f2d3cb724ea5ce4f716db2908959c", "score": "0.49676022", "text": "function Ani(x) {\n this.animalType = x.animalType;\n this.animalName = x.animalName;\n this.speak = function() {\n return `The ${this.animalName} is a ${this.animalType}.`;\n }\n}", "title": "" }, { "docid": "535d94d93c94fbf5e96bf142108c597b", "score": "0.49601617", "text": "function genPhrase(){\n let subject = subjectsText[Math.floor(Math.random() * subjectsText.length)];\n let verb = verbsText[Math.floor(Math.random() * verbsText.length)];\n let preposition1 = prepositionsText[Math.floor(Math.random() * prepositionsText.length)];\n let preposition2 = prepositionsText[Math.floor(Math.random() * prepositionsText.length)];\n let jargon1 = artJargonText[Math.floor(Math.random() * artJargonText.length)];\n let jargon2 = artJargonText[Math.floor(Math.random() * artJargonText.length)];\n let jargon3 = artJargonText[Math.floor(Math.random() * artJargonText.length)];\n let sentence = subject + \" \" + verb + \" \" + jargon1 + \" \" + preposition1 + \" \" + jargon2 + \" \" + preposition2 + \" \" + jargon3 + \".\";\n return sentence;\n}", "title": "" }, { "docid": "da5dd9a3c5455a5dc57156c017112d62", "score": "0.49550092", "text": "function toughMod(msg)\n{\n if(mad_lib)\n {\n averageMod(msg);\n madLib(msg, '\\\\b(tit)t?(s|ies|ie)?(\\\\b)', nounArray,true,'\\\\b(big|fat|huge)(\\\\b)',adjArray);\n madLib(msg, '\\\\b(ass)(hol)?(e)?(\\\\b)', nounArray);\n }\n else\n {\n averageMod(msg);\n insertWord(msg, '\\\\b(tit)t?(s|ies|ie)?(\\\\b)',true,'\\\\b(big|fat|huge)(\\\\b)');\n insertWord(msg, '\\\\b(ass)(hol)?(e)?(\\\\b)');\n }\n}", "title": "" }, { "docid": "826fd0dc6517bd74b0ac2e02a7654765", "score": "0.49537042", "text": "function waitForVerb(noun) {\n return `${noun} plays`;\n}", "title": "" }, { "docid": "4280467bef200d44c4a3d8f04e0c4e5b", "score": "0.4952412", "text": "function Preposition(){\n\n var sen3_JSON =\n {\n sentence:'The horse galloped through the empty field',\n subject:{\n value:'horse',\n modifiers:[\n {\n type:'determiner',\n value: 'The'\n }\n ]\n },\n verb:{\n value:'galloped',\n modifiers:[\n {\n type:'prepositional',\n value:'through',\n modifiers:[\n {\n type:'object',\n value:'field',\n modifiers:[\n {\n type:'determiner',\n value:'the'\n },\n {\n type:'adjective',\n value: 'empty'\n }\n\n ]\n }\n ]\n }\n ]\n }\n };\n\n var subject = sen3_JSON[\"subject\"].value;\n\n var verb = sen3_JSON[\"verb\"].value;\n\n var subjectMod = sen3_JSON[\"subject\"].modifiers[0].value;\n\n\n //The type and value array will store the type and value attributes of the JSON object in PAIRS.\n var typeArr = [], valueArr = [];\n //We do a for loop on the initial modifier of the verb if it exists.\n for(var i=0; i<sen3_JSON[\"verb\"].modifiers.length; i++){\n //If the type attribute exists then push that type string into the type array\n if(sen3_JSON[\"verb\"].modifiers[0].type){typeArr.push(sen3_JSON[\"verb\"].modifiers[0].type)}\n //If the verb attribute exists then push that verb string into the verb array\n if(sen3_JSON[\"verb\"].modifiers[0].value){valueArr.push(sen3_JSON[\"verb\"].modifiers[0].value)}\n //If the modifier exists then we want to push that modifier into the recursive function along with the typeArr and valueArr\n if(sen3_JSON[\"verb\"].modifiers[0].modifiers){modRecursive(sen3_JSON[\"verb\"].modifiers[0].modifiers,typeArr,valueArr)}\n }\n\n //array to store valueArr elements. Allows for function to be used for sentence's of different lengths\n var verbMod = [];\n for(var j=0; j<valueArr.length; j++)\n {\n verbMod.push(valueArr[j]);\n }\n\n\n drawPreposition(subject, verb, subjectMod, verbMod);\n\n}", "title": "" }, { "docid": "e308286aee640500083120e416ac1a09", "score": "0.49480003", "text": "constructor(verbField, emotions, c_preposition){\r\n\t\tthis.verbField = verbField; //{object, subject, secondObject} 0 if unused, 1 if not relevant to emotion and 2 if relevant\r\n\t\tthis.preposition = c_preposition;\r\n\t\tthis.emotions = emotions;\r\n\t}", "title": "" }, { "docid": "e0daa19c1100d4623c3f467216801820", "score": "0.49440435", "text": "function tooManyWords(){\n\t\n\tanswer = prompt(\"Please enter a phrase...\");\n\t\n\tif (answer == null || typeof answer == undefined) {\n\t return;\n\t}\n\t // if empty string pass display message\n\t answer.trim();\n\t if (answer.length == 0) {\n\t \talert(\"Acronym can not be created using empty string\");\n\t }\t\n\t // copy split data to temp variable \n\t var temp_line = answer.split(\" \");\n\t \n\t var acronym =\"\";\n\t var acronym_line =\"\";\n\t \n\t for ( var i = 0; i <temp_line.length; i++){\n\t\t // create acronym \n\t\t acronym += temp_line[i].charAt(0).toUpperCase(); \n\t\t \n\t\t //copy acronym line with first letter upper case\n\t\t acronym_line += temp_line[i].charAt(0).toUpperCase();\n\t\t acronym_line += temp_line[i].substring(1, temp_line[i].length);\n\t\t acronym_line += \" \";\n\t\t \n\t }\t \n\t // display acronym to user\n\t alert (acronym + \" stands for \" + acronym_line);\n\t \n\t // count number of acronym created by user\n acronyms++;\n\t \n}", "title": "" }, { "docid": "ab00706e52524a4af69071dfcb5dc3e2", "score": "0.49350095", "text": "constructor(){\r\n this.missed=0;\r\n this.phrases=this.createPhrases();\r\n this.activePhrase=null;\r\n }", "title": "" }, { "docid": "8168859893cc4d03d5051c9f63cbe43e", "score": "0.4919671", "text": "function applyTemplate(step) {\n // TODO: allow for variation within the templates.\n let sentence = \"\";\n let tokens = step.split(\" \");\n\n if (tokens.length == 2) {\n // Length 2: simple swap of subject and verb\n let verb = applyVerbTense(\"PRESENT\", tokens[0]);\n sentence += \"The \" + tokens[1] + \" \" + verb;\n }\n else if (tokens.length == 3) {\n // Length 3: subject, verb, direct object\n let verb = applyVerbTense(\"PRESENT\", tokens[0]);\n sentence += \"The \" + tokens[1] + \" \" + verb + \" the \" + tokens[2];\n }\n return sentence;\n}", "title": "" }, { "docid": "95e2fb1d841f640f6512859704abe4ee", "score": "0.49122074", "text": "createPhrases() {\n return [\n \"Arsenal\",\n \"Tottenham\",\n \"Chelsea\",\n \"Manchester City\",\n \"Liverpool\"\n ];\n }", "title": "" } ]
e5338e82748d429b09afce2447676623
It's a data format example.
[ { "docid": "8181ac47746877f8ae5523ce19f5a429", "score": "0.0", "text": "function urlFormatter(cell, row) {\n return '<a href=' + cell + '>' + cell + '</a> ';\n}", "title": "" } ]
[ { "docid": "c82e2486c2b0471b2485015fab0fa839", "score": "0.71273375", "text": "function Data() {}", "title": "" }, { "docid": "c82e2486c2b0471b2485015fab0fa839", "score": "0.71273375", "text": "function Data() {}", "title": "" }, { "docid": "6a17e12ebdb0ac3b88928bbe460c16cf", "score": "0.61684746", "text": "function TextData() {}", "title": "" }, { "docid": "af8b96ca496812c2ec48a3e0fffbc94e", "score": "0.61460876", "text": "function TextData(){}", "title": "" }, { "docid": "f2933678a7a85eaf22f247ebaa2228f1", "score": "0.61231214", "text": "function Data(dia, mes, ano) {\n if (ano === void 0) { ano = 1970; }\n this.dia = dia;\n this.mes = mes;\n this.ano = ano;\n // this.dia = dia;\n // this.mes = mes;\n // this.ano = ano;\n }", "title": "" }, { "docid": "16a078bf820d301428f893e3607a4b38", "score": "0.603287", "text": "set data(value) {}", "title": "" }, { "docid": "bf43412b428c7f9f95521fd1a1ef9ae0", "score": "0.6020864", "text": "formatData(data) {\n return {data: data};\n }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.59087986", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.59087986", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.59087986", "text": "function TextData() { }", "title": "" }, { "docid": "a32d443189d544dea93e1803a9a690f3", "score": "0.58818", "text": "function convertdata (__data){\n\n\tconsole.log(\"_________\");\n\tconsole.log(__data);\n\n\tdosomething(_data);\n\n}", "title": "" }, { "docid": "415bb156ae1d174e5020717d0f42303d", "score": "0.5790879", "text": "function EBSData() {}", "title": "" }, { "docid": "797bf764e01a6080768b05ca0ab1045f", "score": "0.57434666", "text": "function DataTypeProcessor () {}", "title": "" }, { "docid": "d6533c412cf18619a254f4b4681169e8", "score": "0.5680637", "text": "function Data(name, value) {\r\n\t\t\t\t\tthis.name = name;\r\n\t\t\t\t\tthis.value = value;\r\n\t\t\t\t}", "title": "" }, { "docid": "1dc551486f51ae3732d7a9001b1990c3", "score": "0.5644667", "text": "generateData(str, label, color, style, interpolation, f) {\n let d = this.parse(str, label, f);\n let v = [];\n d.forEach(element => v.push([element.timestamp, element.value]));\n let da = {\n label: label,\n values: v,\n color: color,\n style: style,\n interpolation: interpolation\n };\n return da;\n }", "title": "" }, { "docid": "4bf36f19e8d0b6d640dc0269ec3a0f49", "score": "0.5639799", "text": "function Dataset() { }", "title": "" }, { "docid": "7c91fd431f4ddaaf8adf8f30190eb860", "score": "0.5628699", "text": "function gotRawData(thedata) {\n println(\"gotRawData\" + thedata);\n}", "title": "" }, { "docid": "7c91fd431f4ddaaf8adf8f30190eb860", "score": "0.5628699", "text": "function gotRawData(thedata) {\n println(\"gotRawData\" + thedata);\n}", "title": "" }, { "docid": "b694be1e1f7615704fb6f32e3118c48e", "score": "0.56089437", "text": "function datapura() {\n return data\n}", "title": "" }, { "docid": "48990dee981431074da7e387d01f1497", "score": "0.55859417", "text": "toString() { return `${this.name} ${utils.print(this.data)}`; }", "title": "" }, { "docid": "48990dee981431074da7e387d01f1497", "score": "0.55859417", "text": "toString() { return `${this.name} ${utils.print(this.data)}`; }", "title": "" }, { "docid": "a2d64dc6b5a4b08572eae768dc31176e", "score": "0.5579876", "text": "function TarantulaData() {\n\n}", "title": "" }, { "docid": "591f9b965de7ea65b07bbf65b3f22ed6", "score": "0.55763686", "text": "function Streamdata() {}", "title": "" }, { "docid": "67a5c39cd796cfbb8395c2575438e1c0", "score": "0.5574425", "text": "function data(size, radix, arcWidth, x, y) {\n this.size=size;\n this.radix=radix;\n this.arcWidth=arcWidth;\n this.x=x;\n this.y=y;\n}", "title": "" }, { "docid": "cde966cdc0553d37402bf1878fb89cd1", "score": "0.55735826", "text": "function gotRawData(thedata) {\n println(\"gotRawData\" + thedata);\n}", "title": "" }, { "docid": "08948ca15bfac27acdf974c21d3ca4b2", "score": "0.5572814", "text": "function DataType() {\n }", "title": "" }, { "docid": "7d992c455449fab1a11a3ca458acdc12", "score": "0.55485815", "text": "function handle_data(){\n var result=\"\";\n\t\t\n if (format_list[this.format.charAt(this.formatpos)]=='p'){\n if (this.textlen>5){\n result+=this.validate_list(this.format.slice(this.formatpos),this.alpha_simple);\n }else{\n this.textpos=this.textlen+1;\n\t\t\t}\n }else{\n\t\t\tconsolelog('handle_data letter ='+this.format[this.formatpos]);\n\t\t\tconsolelog('format='+format_list[this.format[this.formatpos]]);\n result+=this.validate_list(this.format.charAt(this.formatpos),format_list[this.format.charAt(this.formatpos)]);\n\t\t\tconsolelog('handle_data result ='+result);\n\t\t}\n return result;\n\t}", "title": "" }, { "docid": "33d973b818d007948a7732e56219dce7", "score": "0.55331105", "text": "function exampleData() {\n return stream_layers(2,10+Math.random()*100,12).map(function(data, i) {\n return {\n key: 'Debt' + i+2,\n values: data\n };\n });\n}", "title": "" }, { "docid": "a7193cacc6884fa57e56876421a25bd8", "score": "0.54805356", "text": "function exampleData() {\n return stream_layers(2,10+Math.random()*100,.1).map(function(data, i) {\n return {\n key: 'Stream #' + i,\n values: data\n };\n });\n }", "title": "" }, { "docid": "693fe7531fe689037bc054e8b69ccde5", "score": "0.5467273", "text": "function data(){\n\n}", "title": "" }, { "docid": "7d13ea355784d9a5383de01ee737a8bb", "score": "0.54400057", "text": "get data() {}", "title": "" }, { "docid": "9f0203e5029304482ccd2bec84063d08", "score": "0.54125035", "text": "function printz(data) {\n\t\tconsole.log(data.ds);\n\t\tconsole.log(data.dt['target']);\n\t}", "title": "" }, { "docid": "d8f99adef854f3e0654db3578453e40c", "score": "0.5402259", "text": "function RenderData() { }", "title": "" }, { "docid": "dc52b6b771540ad22b79c4c51d483a01", "score": "0.53568804", "text": "function covidDataStr(data){\r\n // Insert this to 'try-catch' to catch the errer if there is any property missing\r\n // To see this work type: at worldwide 'saba'\r\n try \r\n {\r\n return chalk.greenBright(\" ----------------------------------\" +\r\n \"\\n Current data for: \" + data.name + \r\n \"\\n Population: \" + data.population + \r\n \"\\n Update at: \" + new Date(data.updated_at).toLocaleDateString() + \r\n \"\\n Total Confirmed: \" + data.timeline[0].confirmed + \r\n \"\\n New Confirmed: \" + data.timeline[0].new_confirmed + \r\n \"\\n Active: \" + data.timeline[0].active + \r\n \"\\n Deaths: \" + data.timeline[0].deaths +\r\n \"\\n New Deaths: \" + data.timeline[0].new_deaths + \r\n \"\\n ----------------------------------\");\r\n\r\n } \r\n catch (error) \r\n {\r\n console.log(chalk.red(\"Something went wrong, cannot process data for this country\\n\"+ error));\r\n }\r\n}", "title": "" }, { "docid": "4bb04f54309c6fb337014d41f5bf6825", "score": "0.53422946", "text": "function DataNode() {\n /** @public {number/string} */\n this.data;\n /** @public {boolean} */\n this.opened;\n /** @public {boolean} */\n this.flag;\n}", "title": "" }, { "docid": "c9a392b77f919b8b6df4d4fb4d595f3a", "score": "0.5337933", "text": "function gotData(d){\n console.log(\"Got the data right here: \" + d);\n console.log(d);\n }", "title": "" }, { "docid": "6054d683f3c18e272f778b6aaf399d20", "score": "0.5310692", "text": "function DataT( arg ){\n 'use strict';\n\n return Object.prototype.toString.call( arg );\n}", "title": "" }, { "docid": "8cca770bed89fbd104e101c3ac332fad", "score": "0.53072315", "text": "constructor(data, info) {\n this.info = info;\n this.data = data;\n }", "title": "" }, { "docid": "c576e50a564e6d55300ab474c152a44f", "score": "0.53022665", "text": "function ElementData() {}", "title": "" }, { "docid": "5fad7549441c5cf52b6e6e8b791bbbb6", "score": "0.52951074", "text": "parseExtraData(extraData, format) {\n let parseData = \"\";\n if (Array.isArray(extraData)) {\n for (var i = 0; i < extraData.length; i++) {\n parseData += format.replace(\"${data}\", extraData[i]);\n }\n } else {\n parseData += format.replace(\"${data}\", extraData);\n }\n return parseData;\n }", "title": "" }, { "docid": "bdc6c990b359566b414de06f38ffcc1c", "score": "0.5283656", "text": "function GetLabelAndData() {\n\n}", "title": "" }, { "docid": "896a7c41d5e124c24bc4f3fa3f43f5dc", "score": "0.52806914", "text": "function CharacterData(){}", "title": "" }, { "docid": "eb5416a7438e18ca6d0c98542a0d2a30", "score": "0.52697396", "text": "function ShapeRecognitionData() {\n }", "title": "" }, { "docid": "dad1a4ca7ba3897232ef81fe9d2ead71", "score": "0.5264437", "text": "function DotsData() {\n }", "title": "" }, { "docid": "8077d099e213874992906bd68b11fed9", "score": "0.52480507", "text": "function getData5() {\n return [\"Flavio\", 37]\n}", "title": "" }, { "docid": "91ad3e9c15111a48842de8d5db108394", "score": "0.52293736", "text": "constructor(data, width, height) {\n this.data = data;\n this.width = width;\n this.height = height;\n }", "title": "" }, { "docid": "01ba6fcdc97e4d5bb42e36a618650d6b", "score": "0.5226084", "text": "function exampleData() {\n return stream_layers(3,10+Math.random()*100,.1).map(function(data, i) {\n return {\n key: 'Stream #' + i,\n values: data\n };\n });\n}", "title": "" }, { "docid": "01ba6fcdc97e4d5bb42e36a618650d6b", "score": "0.5226084", "text": "function exampleData() {\n return stream_layers(3,10+Math.random()*100,.1).map(function(data, i) {\n return {\n key: 'Stream #' + i,\n values: data\n };\n });\n}", "title": "" }, { "docid": "4362f242e57556fee9cc18f21ac61b66", "score": "0.5225861", "text": "function DataApi() {}", "title": "" }, { "docid": "50a1fdf26b6184de394f9e209a93b6a1", "score": "0.5222876", "text": "function make_viz_data(data, data_source) {\n var formatted_data = format_data(data, data_source)\n , headings = formatted_data.headings\n , viz_data = new google.visualization.DataTable();\n headings.forEach(function(h,i) {\n heading_type = heading_types[h] || 'string';\n viz_data.addColumn(heading_type, h);\n });\n viz_data.addRows(formatted_data.rows);\n return viz_data;\r\n }", "title": "" }, { "docid": "d4c45a957c1bf7136f7641640e2f1df0", "score": "0.5221586", "text": "function createData(data) {\n // console.log(\"in model add\");\n // console.log(\"DATA = \" + data.year + \"=\" + data.value);\n return Data.create(data);\n }", "title": "" }, { "docid": "03f53681510a57b899589340fd21d09f", "score": "0.52208143", "text": "onData() {}", "title": "" }, { "docid": "48cbefc7ecb82ef647e6f855b341fdda", "score": "0.52200663", "text": "function processData(input) {\n console.log(formatting(parseAndCompute(input), 3));\n}", "title": "" }, { "docid": "95e216c9179763d1a9bbd020b2c6826c", "score": "0.52118003", "text": "function Example(name, age) {\n\tthis.name = name;\t\n\tthis.age = age\n}", "title": "" }, { "docid": "faa0985f5945fb3d6a128916ba07678b", "score": "0.5190216", "text": "parseDataGram(buf) {\n // Slice off first 4 which is length\n return JSON.parse(buf.slice(4).toString('utf8'));\n }", "title": "" }, { "docid": "3e417a5ef72e00194ee7b974fd995c93", "score": "0.5183638", "text": "function DataNode(data) {\n return {\n 'type': Tree.DATA,\n 'data': data\n };\n}", "title": "" }, { "docid": "9eac1f742363423b521b41f797affd39", "score": "0.51757663", "text": "function fmtData(data){\n const end = data.end\n data = data.channel_host\n if(!data || data.length===0) return []\n let op = []\n let i = -1\n let l = data.length\n while(++i<l) {\n op.push(e.user_info)\n }\n return {\n following_info: op,\n end\n }\n }", "title": "" }, { "docid": "1ae10fb2e8008409c26804c8b4457a7b", "score": "0.5163708", "text": "function formatData(data) {\n\tvar lines = data.toString().split('\\n');\n\tvar parsedlines = {};\n\tlines.forEach(function(line) {\n\t\tvar splitline = line.split(\" \");\n\t\tvar currentword = splitline[0];\n\t\tparsedlines[currentword] = {\n\t\t\tphoneme: splitline[1],\n\t\t\tnumsyllables: function() {\n\t\t\t\tif (splitline[1].match(/\\d/g) === null) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else {\n\t\t\t\t\treturn splitline[1].match(/\\d/g).length;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn parsedlines;\n}", "title": "" }, { "docid": "8740be7c06d8ffde268205b939839c0f", "score": "0.5160445", "text": "function Person(name, surname) {\n this.name = name;\n this.surname = surname;\n //Add getData method to Person. It should return a formatted string containing the name and surname of the person.\n //\"John\", \"Snow\" -> \"John Snow\n }", "title": "" }, { "docid": "da88f60ef219201d8c0677ee1b00dbef", "score": "0.51524734", "text": "function data() {\n let pii = {\n firstName: 'Fredrick',\n lastName: \"Evans\",\n sSn: 0123456\n }\n return {\n getName: function () {\n return pii.firstName + \" \" + pii.lastName\n }\n }\n\n}", "title": "" }, { "docid": "12232c22fb7099ff7ae11e5c63a71cfb", "score": "0.514517", "text": "function data_get_info()\n\t{ return { op: \"get_info\" }; }", "title": "" }, { "docid": "176d93b81b248cac71cad0de1c51a415", "score": "0.5143337", "text": "get data() { return this._data.value; }", "title": "" }, { "docid": "691f89197e9f28920b44c1c5a54af6f5", "score": "0.51414144", "text": "function createData(processingDate, type, description) {\n return { processingDate, type, description };\n}", "title": "" }, { "docid": "241366f9b886d236a56e1401f5551024", "score": "0.51345116", "text": "constructor(data) {\n this.data = data;\n this.rows = data.length;\n this.cols = data[0].length;\n }", "title": "" }, { "docid": "8ecfdd177f84ab4bca50ea176c8a2722", "score": "0.5132559", "text": "visitDataDescriptionEntryFormat1(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "c4f7e6ae07c7d96fa10031b660b53676", "score": "0.51239145", "text": "function readData() {\n array = parser();\n listAll(array);\n}", "title": "" }, { "docid": "2bfdbe2a2c74fe3c1e6a34a5ac8832fd", "score": "0.5119312", "text": "function dataFormat(data) {\n\tvar dataname = new Array();\n\tfor(var o in data) {\n\t\tvar datapoint = [Number(dateUTC(data[o].date)),Number(data[o].value)];\n\t\tdataname[dataname.length] = datapoint;\n\t}\n\treturn dataname;\n}", "title": "" }, { "docid": "09adfa02f965178dbecc1fa4edc600d8", "score": "0.51100266", "text": "function getData() {\n\t\treturn `data${level === 0 ? '' : '$' + level}`;\n\t}", "title": "" }, { "docid": "1260e95eb4544f3f912127aeaa72e84d", "score": "0.5108362", "text": "function StreamDrawPageData(name)\n{\n this.date = (new Date()).toISOString(); //Always a string\n this.name = name || this.date.substr(0, 10);\n}", "title": "" }, { "docid": "3034b2ba16b993dfa00defc6aa125085", "score": "0.5106979", "text": "function createRecord() {\n var data = {\n commonName: loremIpsum({\n count: random(3,1),\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n genus: loremIpsum({\n count: random(3,1),\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n species: loremIpsum({\n count: random(2,1),\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n variety: loremIpsum({\n count: random(2,1),\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n family: loremIpsum({\n count: random(2,1),\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n plantPropagation: loremIpsum({\n count: random(2,1),\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n zoneHardiness:random(100,1),\n exposure: loremIpsum({\n count: 1,\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n use: loremIpsum({\n count: random(5,3),\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n characteristics: loremIpsum({\n count: random(3,1),\n units: 'sentences',\n sentenceLowerBound: 5,\n sentenceUpperBound: 15,\n format: 'plain',\n random: Math.random\n }),\n insects: loremIpsum({\n count: random(5,3),\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n diseases: loremIpsum({\n count: 1,\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n classification: loremIpsum({\n count: 1,\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n campus: loremIpsum({\n count: 1,\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n heights:[random(100,0)],\n spread:random(100,0),\n flowers: loremIpsum({\n count: random(3,1),\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n fruit: loremIpsum({\n count: 1,\n units: 'words',\n format: 'plain',\n random: Math.random\n }),\n }\n \n return data;\n \n }", "title": "" }, { "docid": "96290f5f484aa859c3f2c11dc1d93d6f", "score": "0.5106654", "text": "function logData() {\n console.log(person.name + \" is \" + person.age + \" years old and lives in \" + person.country);\n}", "title": "" }, { "docid": "4440758344e3904c53a1c8c67a478e1f", "score": "0.5102834", "text": "function dat(nodeDataString){\n \t\tvar nodeValues = nodeDataString.split(\"\\t\");\n \t\tfor (var i in headingsArr){\n // if there is a legitimate value, set the nodeValue. In a properly formatted file, \n // there shouldn't be any undefined data...If there is undefined data, set it to an empty string.\n if (nodeValues[i] !== undefined){\n this[\"\" + headingsArr[i]]=nodeValues[i];\n } else {\n this[\"\" + headingsArr[i]]=\"\";\n }\n }\n \t}", "title": "" }, { "docid": "01c233ed83914957e677a262a1c2c7c3", "score": "0.5094938", "text": "function errData(data) {\n // TODO: figure out what happens when data not present yet. \n}", "title": "" }, { "docid": "e820bf3bee54afdc7fa1e8c848da7d74", "score": "0.5086171", "text": "function DataKeyValue(key, value, format){ //format is \"number\" or \"letter\"\n var letter_number = /^([A-Z-a-z0-9])+$/;\n var number = /^([\\0-9])+$/;\n if (format == \"number\") {\n var check_value = number.test(value);\n }\n if (format == \"letter\") {\n var check_value = letter_number.test(value);\n }\n\n if (check_value){\n data[key] = value;\n }else{\n data[key] = '-1';\n }\n}", "title": "" }, { "docid": "8c54950d2b7ef6d8b08da6be68629c1a", "score": "0.50824416", "text": "function validSequenceData(data) {\n // Write this up later\n return true;\n}", "title": "" }, { "docid": "101c8c363281c60c692c912f26eccd67", "score": "0.5080679", "text": "function Example(desc) {\n this.desc = desc;\n}", "title": "" }, { "docid": "5da280bea019b91b3a0a2f130e16ec68", "score": "0.5077979", "text": "function example(entry, entryTran, source, remark)\n{\n\tthis.entry = entry;\n\tthis.entryTran = entryTran;\n\tthis.source = source;\n\tthis.remark = remark;\n}", "title": "" }, { "docid": "809c239ff61349e43250164c9591bf26", "score": "0.5076716", "text": "function data_help()\n\t{ return {op: \"help\"}; }", "title": "" }, { "docid": "97b25a71db1186f38e57ae3610d68eb0", "score": "0.5074843", "text": "function ElementData() { }", "title": "" }, { "docid": "97b25a71db1186f38e57ae3610d68eb0", "score": "0.5074843", "text": "function ElementData() { }", "title": "" }, { "docid": "bf82a572030d8ce12d98e65bcb5e2faf", "score": "0.50734097", "text": "function GenSetData()\r\n{\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n}", "title": "" }, { "docid": "9cede3cbeae754f583fc58720c9f27af", "score": "0.5071462", "text": "function constructDataSource(data){\n var dataSource = {\"chart\": {\n \"caption\": \"Historical Rates of Bitcoin on January 01 Over the Past 10 Years\",\n \"subcaption\": \"Data Source: https://coinlayer.com/\",\n \"xAxisName\": \"Date\",\n \"YAxisName\": \"Bitcoin Exchange Rate\",\n \"ynumbersuffix\": \"$\",\n \"xnumbersuffix\": \"\",\n \"theme\": \"fusion\",\n \"plotToolText\": \"<b>$dataValue</b> BTC rate on <b>$label</b>\",\n \"anchorbgcolor\": \"#ff00ff\",\n \"palettecolors\": \"#ff00ff\"\n }, \n data: data}; \n return dataSource;\n}", "title": "" }, { "docid": "3a39243ce27c9714c508dd50d36575f9", "score": "0.50707775", "text": "constructor(data) {\n this.data = data;\n\n }", "title": "" }, { "docid": "d7b0cf9e920be6c79399f487aca3ee99", "score": "0.5068691", "text": "constructor(data) {\n this.Name = data.name;\n this.Age = data.age;\n this.Salary = data.salary;\n }", "title": "" }, { "docid": "a2886e1a1aa66592ba91a8c18a0a8d08", "score": "0.5068543", "text": "function dataJSON(){\r\n var strJson = \"\";\r\n this.addData = function( campo , valor ){\r\n strJson = strAddSep( strJson , '\"' + campo + '\": ' + '\"' + valor + '\"' , \",\" );\r\n };\r\n this.getData = function(){\r\n return \"{ \" + strJson + \" }\";\r\n };\r\n}", "title": "" }, { "docid": "0d4159efd349c45b0d2088854f75e162", "score": "0.5067054", "text": "function ElementData(){}", "title": "" }, { "docid": "30c0096c1ba8699381e5e51b3d9df3aa", "score": "0.5066827", "text": "function getData() {\n\tconst d = bezzy.data();\n\tconsole.log(d);\n\talert(JSON.stringify(d));\n}", "title": "" }, { "docid": "eabbe194d3f325e485df1f1cd5cfdce1", "score": "0.50607234", "text": "function _loadData() {\r\n\r\n }", "title": "" }, { "docid": "56eca8cb6a2bfa2b4da82563260cf8f2", "score": "0.506059", "text": "function data() {\n\t\treturn {\n\t\t\twidth: 10\n\t\t}\n\t}", "title": "" }, { "docid": "2f1b4fb14f3527763b64be82204be4e6", "score": "0.5056429", "text": "static generateData() {\n\t\tconst data = {\n\t\t\taddress: util.generateRandomBitString(26),\n\t\t\tunit: `0${util.generateRandomBitString(3)}`, // Prevent the unit code from being 0000 (group)\n\t\t\tgroup: 0,\n state: 1,\n onoff: true\n\t\t};\n\t\tdata.id = `${data.address}:${data.unit}`;\n\t\treturn data;\n\t}", "title": "" }, { "docid": "9c32b31f544f4407081e8ac4078272a5", "score": "0.50561905", "text": "function Record()\n{\n\tthis.type = \"\";\n\tthis.bytes = [];\n\t\n\t// default to well-known type\n\tthis.TNF = 0x01;\n}", "title": "" }, { "docid": "3c2899d23ac55e1a3722d4f07612eede", "score": "0.5053794", "text": "function Label(thing, iIn, jIn) {\n if (iIn === void 0) { iIn = 0; }\n if (jIn === void 0) { jIn = -1; }\n $rt_addContract(this, cec88372874868d65bd05d6a88c713cddc, \"data.ts(8,23)\");\n $rt_check(thing, \"string\");\n $rt_check(jIn, \"number\");\n this.datum = thing;\n $rt_check(this.i = iIn, \"number\");\n if (jIn == -1) {\n this.j = thing.length;\n }\n else {\n this.j = jIn;\n }\n }", "title": "" }, { "docid": "dfad416da9750afdda11552613b6cfa8", "score": "0.50528514", "text": "function validData() {\n //\n}", "title": "" }, { "docid": "6391116998acc116176507c2c7adaa97", "score": "0.5044697", "text": "function parseDataAsText(data, start, end) {\n\n\t\t\tvar number = '';\n\t\t\tstart = start || 0;\n\t\t\tend = end || data.length;\n\t\t\tvar value;\n\t\t\t//length of the result is the product of the sizes\n\t\t\tvar lengthOfTheResult = headerObject.sizes.reduce(function (previous, current) {\n\n\t\t\t\treturn previous * current;\n\t\t\t}, 1);\n\n\t\t\tvar base = 10;\n\t\t\tif (headerObject.encoding === 'hex') {\n\n\t\t\t\tbase = 16;\n\t\t\t}\n\n\t\t\tvar result = new headerObject.__array(lengthOfTheResult);\n\t\t\tvar resultIndex = 0;\n\t\t\tvar parsingFunction = parseInt;\n\t\t\tif (headerObject.__array === Float32Array || headerObject.__array === Float64Array) {\n\n\t\t\t\tparsingFunction = parseFloat;\n\t\t\t}\n\t\t\tfor (var i = start; i < end; i++) {\n\n\t\t\t\tvalue = data[i];\n\t\t\t\t//if value is not a space\n\t\t\t\tif ((value < 9 || value > 13) && value !== 32) {\n\n\t\t\t\t\tnumber += String.fromCharCode(value);\n\t\t\t\t} else {\n\n\t\t\t\t\tif (number !== '') {\n\n\t\t\t\t\t\tresult[resultIndex] = parsingFunction(number, base);\n\t\t\t\t\t\tresultIndex++;\n\t\t\t\t\t}\n\t\t\t\t\tnumber = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (number !== '') {\n\n\t\t\t\tresult[resultIndex] = parsingFunction(number, base);\n\t\t\t\tresultIndex++;\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "539d18c5e9630e8c9424d9dc493fbe9e", "score": "0.50435793", "text": "function getData() {\n return [\n ['', 'Kia', 'Nissan', 'Toyota', 'Honda', 'Mazda', 'Ford'],\n ['2012', 10, 11, 12, 13, 15, 16],\n ['2013', 10, 11, 12, 13, 15, 16],\n ['2014', 10, 11, 12, 13, 15, 16],\n ['2015', 10, 11, 12, 13, 15, 16],\n ['2016', 10, 11, 12, 13, 15, 16]\n ];\n }", "title": "" }, { "docid": "8a088eb3fad32c97af8fa3b88f7113a0", "score": "0.50421154", "text": "function daemonData(data) {\n console.log(\"siad: \" + data);\n}", "title": "" }, { "docid": "100fc8dc3d656197d2127c3224c10a00", "score": "0.5038618", "text": "function PureExpressionData() {}", "title": "" }, { "docid": "0c8def792bf610b55f488525f69f6b1c", "score": "0.5031932", "text": "function PureExpressionData(){}", "title": "" }, { "docid": "a011fcdbdcc2c9ae22d3fcbbf7697f75", "score": "0.50303805", "text": "get exampleSampledData() {\n\t\treturn this.__exampleSampledData;\n\t}", "title": "" }, { "docid": "286c99c6f8d2294ae69a48936541d619", "score": "0.5027202", "text": "function Dataform(raw, schema) {\n this.configure(raw, schema);\n }", "title": "" }, { "docid": "82bd99c57dd1920fafeaecb7c1bf8229", "score": "0.5024339", "text": "decode (raw) {\n // Loop through every letter to find value character & next character.\n for (let i = 0; i < raw.length; ++i) {\n // Check if character is normal text or the value or next character.\n if (raw[i] === this.config.valueChar) {\n this.status.isName = false\n this.status.isValue = true\n } else if (raw[i] === this.config.nextChar) {\n this.status.isName = true\n this.status.isValue = false\n // Save data pair to data log.\n data.add(this.pair.name, this.pair.value)\n // Reset pair variables.\n this.pair.name = ''\n this.pair.value = ''\n } else {\n if (this.status.isName && !this.status.isValue) this.pair.name += raw[i]\n else if (this.status.isValue && !this.status.isName) this.pair.value += raw[i]\n else console.error('[DATA] [DECODE] given string has section that is a name and value.')\n }\n }\n return this.log\n }", "title": "" } ]
dea40060bb6ccf21dce96435cdf0b03a
predefine function of class. It responsible for print everyting under class.
[ { "docid": "1b26833853deebff1b0a6fd2fd05730c", "score": "0.0", "text": "render()\r\n {\r\n //alert(\"two\");\r\n return(\r\n <section>\r\n <h1 align=\"center\">Login</h1>\r\n <p align=\"center\">Please Enter Login Data</p>\r\n <h1 className=\"text-center text-danger\">\r\n {this.state.counter}\r\n </h1>\r\n {\r\n this.state.user.map((xuser,index)=>{\r\n return(\r\n <p key=\"index\" className=\"p-3 border\">{xuser}</p>\r\n )\r\n })\r\n }\r\n </section>\r\n );\r\n\r\n }", "title": "" } ]
[ { "docid": "74f22367c54540b933db3b1fc31fca2e", "score": "0.59775245", "text": "function printClass(a) {\n a.print();\n}", "title": "" }, { "docid": "197b512a97b524b42d53388730282afe", "score": "0.593213", "text": "enterClassDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "de98445e288cb82d4dec217a53c87c4f", "score": "0.59063643", "text": "visitNormalClassDeclaration(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "374ecdc818c046ec36cf1d88e6c268b9", "score": "0.5879059", "text": "visitClassdef(ctx) {\r\n console.log(\"visitClassdef\");\r\n return this.visitChildren(ctx);\r\n }", "title": "" }, { "docid": "b95c4b6b2ff714ffa8306cf920da5a56", "score": "0.5844205", "text": "function logInPrint(constructor) {\n constructor.prototype.print = function () {\n console.log(this);\n };\n}", "title": "" }, { "docid": "4dbe315cfb223677e109e5536df7a2c1", "score": "0.58253694", "text": "function _printCalled(){}", "title": "" }, { "docid": "0b3eee931e0ed57755e2cc82fda5c9b0", "score": "0.5757959", "text": "printPreOrder() {\n this.printPreOrderAlgo(this.root);\n }", "title": "" }, { "docid": "61a168bef3a321f6ee3e164211f8c3bb", "score": "0.5753002", "text": "function dumpClassStructure() {\n\tg.println(cf.ClassFile);\n}", "title": "" }, { "docid": "ae2b6163770348206878768bcb06716e", "score": "0.571192", "text": "static printTranslate(_class) {\n var xxx = eval(_class+'.printTranslate');\n if (typeof(xxx) === 'function') {\n xxx();\n }\n\n }", "title": "" }, { "docid": "90ca4c60474b39ddd4b27b63e4eb90ad", "score": "0.5703486", "text": "function extensible(constructorFun) {\n constructorFun.prototype.print = function () {\n console.log('Print function is added to this class using Decorator Feature');\n console.log(this);\n };\n }", "title": "" }, { "docid": "4dc7999ec0d878ce63b2be7dcc247310", "score": "0.56998104", "text": "enterClassMethodDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "04ced30640b3df6cee41ad33fd023026", "score": "0.5682941", "text": "Chinfo(){\r\n return \"Grand Child class method\"\r\n }", "title": "" }, { "docid": "c2eb2918cf8a3a7915a193264d398952", "score": "0.5655509", "text": "function SomeClass(){\n\ttrace(\"click\");\n}", "title": "" }, { "docid": "e06bf8ed3d8454549fe54706f093083c", "score": "0.56488013", "text": "function DeclareClass(node, print) {\n this.push(\"declare class \");\n this._interfaceish(node, print);\n}", "title": "" }, { "docid": "5e1f4aecea921d1065b7b3a4f9b0bbb3", "score": "0.56227887", "text": "enterClassMethodDefinition(ctx) {\n\t}", "title": "" }, { "docid": "c2205cbf374dec1c8cf2e39acd933774", "score": "0.5577706", "text": "enterClassMethodDefinition(ctx) {\n }", "title": "" }, { "docid": "43f0619be4b202a7067383bfdca85570", "score": "0.5534361", "text": "function printVardasPavardeKlase(name,lname,clas){\nconsole.log(\"Vardas:\",name,\"Pavarde:\",lname,\"Klase:\",clas);\n}", "title": "" }, { "docid": "6907c7329fdd8c1193545ca3e08a6cf8", "score": "0.5528963", "text": "function logged(constructorFunction) {\n console.log(constructorFunction); // will output the class source that has been compiled\n }", "title": "" }, { "docid": "cd5d1f38ec12dd771281eb90bf6a6317", "score": "0.55230904", "text": "print() {\n console.log(this + \"\");\n }", "title": "" }, { "docid": "9838295c9be923a9cc53241b07223593", "score": "0.5508423", "text": "writeClass(d) {\n let prefix = d.packageName ? d.packageName + \".\" : \"\";\n if (Parser.LOG_LEVEL > 2)\n console.info(\"Processing class \" + prefix + d.name);\n if (d.type === \"interface\") {\n write(`interface ${d.name} `);\n }\n else {\n write(`class ${d.name} `);\n }\n this.writeExtendsClause(d);\n this.writeImplementsClause(d);\n this.writeSingleton(d);\n this.writeAliases(d);\n this.writeProperties(d);\n this.writeConstructor(d);\n this.writeStatics(d);\n this.writeMethods(d);\n this.writeDestructor(d);\n write(\"\\n}\\n\");\n }", "title": "" }, { "docid": "b9e399ad529d3dacb15fad6546fcab35", "score": "0.550149", "text": "function Class(){}", "title": "" }, { "docid": "229383ed7d1e2e3cb304fd5ec7bb8861", "score": "0.54976785", "text": "function ClassHandle() {\n}", "title": "" }, { "docid": "ecd021eb6dbdac0d9fdd7bdf4d98ac85", "score": "0.54808974", "text": "function Class() {\r\n\r\n}", "title": "" }, { "docid": "76933db971644ceaf2f3ccf119133c7a", "score": "0.54614496", "text": "visitClassDeclaration(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "9d50c72566eb7a89c776e61f5dd2000b", "score": "0.5442253", "text": "function Class(){} // Called on a class to create a subclass.", "title": "" }, { "docid": "aef4d8d7ba33393b90dc8710132eff34", "score": "0.5433585", "text": "enterClassDeclarationList(ctx) {\n }", "title": "" }, { "docid": "689cb72b298485d7ae6b274c81975a73", "score": "0.54146767", "text": "enterClassImplementation(ctx) {\n\t}", "title": "" }, { "docid": "e413242f3df84f31fff56ed77604d964", "score": "0.5403362", "text": "print(){\n console.log(` ${this.#nom} :`)\n this.#cours.forEach(function(cours){\n cours.print()\n })\n }", "title": "" }, { "docid": "5463c974a46798b82f1a6c77867880c0", "score": "0.5362968", "text": "function cb1 ( classes )\n{\n console.log ( 'Subclasses of ' + query + ':');\n for (i = 0; i < classes.length; i++) {\n\t\tconsole.log ( classes[i] );\n\t}\n}", "title": "" }, { "docid": "f3b4c91eea6e01c2364ad01cb8f9220e", "score": "0.5359854", "text": "getDisplayName(){\n return 'Class '+this.number;\n }", "title": "" }, { "docid": "c740443f78f01c316efd979d13e4ed53", "score": "0.535335", "text": "introduceYourself() {\n console.log(`My name is ${this.name}, I am a ${this.type} and I am ${this.age} old`)\n }", "title": "" }, { "docid": "0a237243cedf91f6fc9e4d659823ddfa", "score": "0.5346007", "text": "print() {\n console.log(this.toString());\n }", "title": "" }, { "docid": "8bd96e491459f1ad158ae2d0c0622608", "score": "0.53377277", "text": "function Scout() {}", "title": "" }, { "docid": "f9f4c2cad87814cc8840d5f9ec7befd5", "score": "0.5332447", "text": "function Class(){ }", "title": "" }, { "docid": "f2513ed7d3b3f1c37128e8f471b0b3c8", "score": "0.53308874", "text": "enterClassDeclarationList(ctx) {\n\t}", "title": "" }, { "docid": "adab8ddb07445c51a4a3abf2633697d8", "score": "0.53256255", "text": "function logged(constructorFn) {\n console.log(constructorFn);\n}", "title": "" }, { "docid": "a91390c2481099c1670e7ae340cc4457", "score": "0.5315143", "text": "function Class()\n{}", "title": "" }, { "docid": "252d9d8ed6c24453e1c0db473524b5bd", "score": "0.5303483", "text": "function Class(){} // called upon a class to create a subclass", "title": "" }, { "docid": "5706bef00eb2dd0722ab0e77eaafbec8", "score": "0.5271241", "text": "function constructor()\n\t{\n\t\t//write your code here\n\n\t\t//please note that it is a private function, so you can call the public fields or methods only\n\t\t//do the private visiting in the following {}\n\t}", "title": "" }, { "docid": "5706bef00eb2dd0722ab0e77eaafbec8", "score": "0.5271241", "text": "function constructor()\n\t{\n\t\t//write your code here\n\n\t\t//please note that it is a private function, so you can call the public fields or methods only\n\t\t//do the private visiting in the following {}\n\t}", "title": "" }, { "docid": "5706bef00eb2dd0722ab0e77eaafbec8", "score": "0.5271241", "text": "function constructor()\n\t{\n\t\t//write your code here\n\n\t\t//please note that it is a private function, so you can call the public fields or methods only\n\t\t//do the private visiting in the following {}\n\t}", "title": "" }, { "docid": "fc1fe2be59a8e940bf3caeab5d07564f", "score": "0.5265011", "text": "function Printer() {\n var id = null;\n this.getId = function () {return id;};\n\n if (1 == arguments.length && arguments[0][rhoUtil.rhoIdParam()]) {\n if (moduleNS != arguments[0][rhoUtil.rhoClassParam()]) {\n throw \"Wrong class instantiation!\";\n }\n id = arguments[0][rhoUtil.rhoIdParam()];\n } else {\n id = rhoUtil.nextId();\n // constructor methods are following:\n \n }\n }", "title": "" }, { "docid": "284fb10d7504330f0dc16fbe23d5fe21", "score": "0.52569205", "text": "function Class() {}", "title": "" }, { "docid": "284fb10d7504330f0dc16fbe23d5fe21", "score": "0.52569205", "text": "function Class() {}", "title": "" }, { "docid": "284fb10d7504330f0dc16fbe23d5fe21", "score": "0.52569205", "text": "function Class() {}", "title": "" }, { "docid": "9292ffcb480ba9faae574ff3d369a71c", "score": "0.52529633", "text": "static print() {\n // Store all #page-container classes\n let lPage = jQuery('#page-container');\n let pageCls = lPage.prop('class');\n\n // Remove all classes from #page-container\n lPage.prop('class', '');\n\n // Print the page\n window.print();\n\n // Restore all #page-container classes\n lPage.prop('class', pageCls);\n }", "title": "" }, { "docid": "b4f94e2f43466f1222e2b268fe894379", "score": "0.5231721", "text": "initCustomFunctions() {/*To be overridden in sub class as needed*/\n }", "title": "" }, { "docid": "b17cf1040f896faa790c77d16d7b3dba", "score": "0.5230793", "text": "sayHello() {\n console.log(`Salut à toi ${this.name}, valeureux ${this.className}, puisse le sort vous être favorable`);\n }", "title": "" }, { "docid": "2f83124dd1e6ffd476e099b77d8f2081", "score": "0.52306175", "text": "function SuperclassBare() {}", "title": "" }, { "docid": "639791d05f45b88922b5acee1d87269b", "score": "0.52266204", "text": "function PreParser() {\r\n // empty\r\n}", "title": "" }, { "docid": "7a71a10129862afea1635ebb07bb069a", "score": "0.5209314", "text": "static _getName() {\n return 'BeforePreroll';\n }", "title": "" }, { "docid": "7de04aaa2f7690f3ef0da0c652ee5b0d", "score": "0.5206839", "text": "[inspect.custom] () {\n return `${this.constructor.name} ${inspect(this.toJWK(false), {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true\n })}`\n }", "title": "" }, { "docid": "0ff5b757a8dd3a49a1958ada9b9c7a59", "score": "0.5205522", "text": "function _clearPrintCalled(){}", "title": "" }, { "docid": "d9f78ace4d37233498e34c98c204fa80", "score": "0.5202289", "text": "function printClass(person) {\n console.log(person.job && person.job.class && person.job.class.name);\n }", "title": "" }, { "docid": "39d5e6fb75a1c5826a0587353cb80bf1", "score": "0.5180117", "text": "visitPrint(ctx) {\n return this.visitChildren(ctx);\n }", "title": "" }, { "docid": "c78fb5c98922dcf1f0975581eccebd4a", "score": "0.51734895", "text": "enterClassImplementation(ctx) {\n }", "title": "" }, { "docid": "736773ba47d7a5403a302a5fb04d9800", "score": "0.5160279", "text": "analyzePhase({node, moduleDoc}){\n switch (node.kind) {\n case ts.SyntaxKind.ClassDeclaration:\n\n const className = node?.name?.getText();\n const currClass = moduleDoc?.declarations?.find(declaration => declaration.name === className);\n\n /**\n * Handle `@customElement('my-element') decorator\n */\n const customElementDecorator = node?.decorators?.find(findDecorator('customElement'))?.expression;\n const tagName = customElementDecorator?.arguments?.[0]?.text;\n \n if(tagName) {\n currClass.tagName = tagName;\n moduleDoc.exports.push({\n kind: \"custom-element-definition\",\n name: tagName,\n declaration: {\n name: className,\n module: moduleDoc.path\n }\n });\n }\n\n node?.members?.forEach(member => {\n if (hasPropertyDecorator(member)) {\n const propertyDecorator = member.decorators.find(\n (decorator) => decorator.expression.expression.text === 'property',\n );\n const propertyOptions = propertyDecorator?.expression?.arguments.find(\n (arg) => ts.isObjectLiteralExpression(arg),\n );\n\n if (isAlsoProperty(propertyOptions)) {\n mergeAttributes(propertyOptions, member, currClass);\n }\n }\n\n if (hasStaticKeyword(member)) {\n\n if (member.name.text === 'properties') {\n const returnVal = getReturnVal(member);\n returnVal?.properties?.forEach(property => {\n if(!property.name) return;\n const classMember = {\n kind: 'field',\n name: property.name.getText(),\n privacy: 'public',\n };\n\n if (isAlsoProperty(property)) {\n const propertyOptions = property.initializer;\n mergeAttributes(propertyOptions, property, currClass);\n }\n\n mergeJsDocWithPropAndPush(currClass, classMember);\n });\n return;\n }\n }\n });\n\n currClass?.members?.forEach((member) => {\n visit(node, member);\n });\n break;\n }\n }", "title": "" }, { "docid": "d2dbb299db2653605417884330415414", "score": "0.5159192", "text": "constructor() {\n this._setLogLevel('DEBUG'); //move out?!\n this.logger.debug(this.constructor.CLASS + ' CONSTRUCTOR CALLED');\n }", "title": "" }, { "docid": "cc3fb1b0388928aba45f6b057533c84f", "score": "0.5157647", "text": "visitClassModifier(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "02a37c288e6ced8b08c8eed50c95099b", "score": "0.5156059", "text": "visitClassMemberDeclaration(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "dc3a7b690b01bddc3746dd781b597011", "score": "0.5139661", "text": "addMember() {\n console.log('Wywołane z Prototypu konstruktora.');\n }", "title": "" }, { "docid": "5b37bd2341abd0440eb71f3bd6abc35f", "score": "0.51354176", "text": "printInfo (msg) { console.log(`${this.FgBlue}Info: ${msg}${this.FgDefault}`) }", "title": "" }, { "docid": "8e0e54eac85cbcd29cf285cd646fe078", "score": "0.5123842", "text": "classes() {\n return this.class_list.join(\" \");\n }", "title": "" }, { "docid": "ce4618775f59ddb625b0b468ed9db345", "score": "0.5115027", "text": "heyy(){\n return super.hello() + 'and I am a cool guy'; // super, a way to reach back to the class it extends from to get methods\n }", "title": "" }, { "docid": "948cc86785b74bae3d60c77da2453b5a", "score": "0.5113145", "text": "function Debug(){}", "title": "" }, { "docid": "5167bfd2d83a14ad1b906e965c1b8846", "score": "0.51077116", "text": "function hi (){\n return \"hello,Class!\" ;\n}", "title": "" }, { "docid": "1ea8df3cead1370c2b74878da2fb2be4", "score": "0.5104733", "text": "enterAnnotation_constructor(ctx) {\n\t}", "title": "" }, { "docid": "b6926864b4707b7a8e2b15b57ad42c06", "score": "0.5101203", "text": "function cb2 ( classes )\n{\n console.log ( 'Superclasses of ' + query + ':');\n for (i = 0; i < classes.length; i++) {\n\t\tconsole.log ( classes[i] );\n\t}\n}", "title": "" }, { "docid": "5b36b0a6406376669979cfdd2d1ac495", "score": "0.5098099", "text": "function showAllBeh(message) {\n console.dir(this);\n}", "title": "" }, { "docid": "a6494fea2881d9a24c4702f9bde9d8ed", "score": "0.50955653", "text": "static BeginHorizontal() {}", "title": "" }, { "docid": "047faf7925b0d8591c9a3ede08131381", "score": "0.5092677", "text": "function LOG_CLASS(classDef, name) {\n classDef.prototype.log = new LOG_Logger(classDef, name);\n}", "title": "" }, { "docid": "c312bf31949484befbd9a80e52620619", "score": "0.5089285", "text": "log() { return 'overridden'; }", "title": "" }, { "docid": "f4417648bf2f2855256395e5083bb680", "score": "0.5086282", "text": "[inspect.custom] () {\n return `${this.constructor.name} ${inspect(this.toJWKS(false), {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true\n })}`\n }", "title": "" }, { "docid": "d770487acff8d4de3a7093d091c65140", "score": "0.5085835", "text": "printToConsole() {\n this.printToConsole_(0, \"\");\n }", "title": "" }, { "docid": "f82b7386b946044800e190d56998b15d", "score": "0.5085131", "text": "function Debug() {}", "title": "" }, { "docid": "07e24c05475ff07f7c607870a78989ad", "score": "0.508227", "text": "function beforePrint() {\n $('.print-change-6').addClass('col-xs-6');\n $('.hide-during-print').addClass('hide-during-print-active');\n}", "title": "" }, { "docid": "91d5a74d9c49b0a9df847dc70d72131e", "score": "0.50784165", "text": "function imprimible(constructor) {\n constructor.prototype.imprimir = function () {\n console.log(this);\n };\n}", "title": "" }, { "docid": "e041b12951c154e98d6bb2d0c21c83a2", "score": "0.5077608", "text": "printCards(self) {\n\n }", "title": "" }, { "docid": "8c7a7459ae0b69f4863bc1f07074f882", "score": "0.506656", "text": "print() {\n const that = this;\n\n log.info(that.toString());\n }", "title": "" }, { "docid": "b0723e9090517a25ecf5d8e41a5e8bc7", "score": "0.50643307", "text": "print() {\n console.log(JSON.stringify(this, null, 4))\n }", "title": "" }, { "docid": "1ca21e38850f75131645f7dcf37e35f6", "score": "0.5063227", "text": "print() {\n console.log(this.toString(true));\n }", "title": "" }, { "docid": "77f8659250831eba2001415bbe2f12e5", "score": "0.5057714", "text": "function aClass1(){\n\tAllocationTracker.record('aClass1')\n}", "title": "" }, { "docid": "83142ac66e613b0f3ad33c48a3f2399d", "score": "0.5056191", "text": "quickFacts() {\n console.log(`${this.name} educates ${this.numberOfStudents} students at the ${this.level} school level.`);\n }", "title": "" }, { "docid": "41e558f9059c19f19db8ea57c3ce6d9d", "score": "0.5055158", "text": "enterClassInterface(ctx) {\n\t}", "title": "" }, { "docid": "41c5563f39d54108e389c818f4ecb3e3", "score": "0.5055099", "text": "function ClassB(){}", "title": "" }, { "docid": "4da4629018f4f5f475c15a11a793bf83", "score": "0.50547045", "text": "printTree() {\n console.log(\"hi I am a tree with ID \" + this._id + \", title \" + this._root_node.page.title + \", and url \" + this._root_node.page.url);\n }", "title": "" }, { "docid": "f8254a75d9c5a272c51a43cc64ff265d", "score": "0.5046718", "text": "visitExplicitConstructorInvocation(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "823803c45485e43f1e030a2ca7e056c0", "score": "0.50392926", "text": "function printClass(person) {\n console.log(person.job.class.name);\n }", "title": "" }, { "docid": "a15c007f6599a36f5f260972e038aade", "score": "0.50374967", "text": "function classdef() {\n cont(require(\"t_string\"), expect(\"{\"), pushlex(\"}\"), block, poplex);\n }", "title": "" }, { "docid": "09584bd9060044e9db435491693a9503", "score": "0.5036916", "text": "function PrinterZebra() {\n var id = null;\n this.getId = function () {return id;};\n\n if (1 == arguments.length && arguments[0][rhoUtil.rhoIdParam()]) {\n if (moduleNS != arguments[0][rhoUtil.rhoClassParam()]) {\n throw \"Wrong class instantiation!\";\n }\n id = arguments[0][rhoUtil.rhoIdParam()];\n } else {\n id = rhoUtil.nextId();\n // constructor methods are following:\n \n }\n }", "title": "" }, { "docid": "39623872f381bfd02b09cfb46225f627", "score": "0.5035033", "text": "_log() {\n if (this.debug) {\n console.log.apply(console, ['[ Glu.js Api Helper ] [' + this.constructor.name + ']'].concat(arguments));\n }\n }", "title": "" }, { "docid": "e117b0c2f435f8bcdb3c5977bd24c27d", "score": "0.5034726", "text": "prepare() {\n console.log('Your Peppermint Mocha Ingredients:');\n console.log('Dark chocolate');\n console.log('Cups of milk: ', this.milk);\n console.log('Cups of espresso: ', this.shot);\n console.log('Pumps of peppermint: ', this.peppermintSyrup, '\\n\\n');\n }", "title": "" }, { "docid": "a92c98fe774a3066dadbd44a428f8aaa", "score": "0.50340223", "text": "visitSuperclass(ctx) {\r\n\t return this.visitChildren(ctx);\r\n\t}", "title": "" }, { "docid": "2234feefdbce8ad6590b7fdf74a4f372", "score": "0.50284326", "text": "setupLoggingMethods () {\n\t\tfor (let i in this.levels) {\n\t\t\tthis[i] = function(text, cls, service, id) {\n\t\t\t\tif (!this.isActiveLevel(i))\n\t\t\t\t\treturn false;\n\t\t\t\tlet format = this.levels[i][1];\n\t\t\t\tif (format === undefined)\n\t\t\t\t\tformat = [];\n\t\t\t\t// build a string: timestamp [ level ] service.cls: text\n\t\t\t\tlet str = (new Date()).toISOString();\n\t\t\t\tstr += \" [\" + this.levels[i][0] + \"] \";\n\t\t\t\tif (id)\n\t\t\t\t\tstr += \"<\" + id + \"> \";\n\t\t\t\tlet a = [];\n\t\t\t\tif (service)\n\t\t\t\t\ta.push(service);\n\t\t\t\tif (cls)\n\t\t\t\t\ta.push(cls);\n\t\t\t\tif (a.length)\n\t\t\t\t\tstr += string.colors.apply(a.join(\".\") + \": \", format);\n\t\t\t\tstr += string.colors.apply(text, format);\n\t\t\t\tthis.logFunction(str);\n\t\t\t};\n\t\t}\n\t}", "title": "" }, { "docid": "151fd9364c785e3c3053f2461415dadd", "score": "0.50175047", "text": "function Interfaz(){} // inicializa vacio, lo cargamos con prototipos", "title": "" }, { "docid": "5e291f6e00bfe915871f84e4fc9836be", "score": "0.50152665", "text": "function withoutHiddenClass() {\n\n}", "title": "" }, { "docid": "798a11f01884f9e83eb39701fb9f1813", "score": "0.50138175", "text": "getDesc(){\n let desc = super.getDesc(); //by default the method with same name in child class is called. to call parent super() is used.\n if (this.hasMajor()){\n desc += `their major is ${this.major}.`;\n }\n return desc;\n }", "title": "" }, { "docid": "f13094b1dc2e7b98b78ba0d4e5d4acfb", "score": "0.5012877", "text": "_defineLogMethods() {\n Object.keys(this._logColors).forEach((name) => {\n const fname = name.substr(0, 1).toUpperCase() + name.substr(1);\n this[`_log${fname}`] = (msg) => this._log(msg, this._logColors[name]);\n });\n }", "title": "" }, { "docid": "ee2acb4ca79bc45560cce61235433f46", "score": "0.5010839", "text": "prepare() {\n console.log('Your', this.chocolateType, ' Chocolate Mocha Ingredients:');\n console.log(this.chocolateType, ' chocolate');\n console.log('Cups of milk: ', this.milk);\n console.log('Cups of espresso: ', this.shot, '\\n\\n');\n }", "title": "" }, { "docid": "60f55d2901aa1cfbab9b885ad17f5221", "score": "0.5008804", "text": "constructor ( generator = false ) {\r\n this.linebreak = '------------------------------------------------'\r\n console.log(' ')\r\n console.log(this.linebreak)\r\n if (generator) { \r\n // if the debug class is called passing an election year, it generates the data for that election and stores it.\r\n let anElection = new Election(generator)\r\n let callStr = 'Controller' + generator + '.setup(anElection)'\r\n this.myElection = eval(callStr) // eslint-disable-line no-eval\r\n console.log(`Debugging class initalized in generated mode. Election data generated for reference year ${generator}`)\r\n this.stored = true\r\n } else {\r\n this.stored = false\r\n console.log('Debugging class initalized in ad-hoc mode. No reference data genrated')\r\n }\r\n console.log(this.linebreak)\r\n console.log(' ')\r\n }", "title": "" }, { "docid": "07aad7bb7cff7be2825bdaf0a5f62bbd", "score": "0.50044703", "text": "function normalPrintFunction() {\n console.log('This is a message');\n}", "title": "" } ]
d3e22cf81b144508bec6f74fbb5a794a
Delete a property and trigger change if necessary.
[ { "docid": "3d85b8be52a5160999f2efebba0cedb1", "score": "0.6425936", "text": "function del(target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n }", "title": "" } ]
[ { "docid": "f6b6e0a2a4cd9c123c2ea9fe261d3c17", "score": "0.71016866", "text": "removeProperty(aProperty){\n let propIndex = this._indexOfProperty(aProperty);\n if(propIndex >= 0){\n this._properties.splice(propIndex, 1);\n\n }\n }", "title": "" }, { "docid": "c138d9f2428455eca27d70fdd7d12693", "score": "0.6920753", "text": "deleteProperty(group, propertyIndex) {\n group.properties.splice(propertyIndex, 1);\n }", "title": "" }, { "docid": "cca4d874c9c1240427f0094be1508d9b", "score": "0.67536545", "text": "function DeleteProperty(target, scope, name) {\n if(!(this instanceof DeleteProperty)) return new DeleteProperty(target, scope, name);\n else Write.call(this, target, scope);\n\n Object.defineProperties(this, {\n \"name\": {\n value: name\n },\n \"origin\": {\n value: (Object.prototype.hasOwnProperty.call(target, name) ? target[name] : undefined)\n },\n \"snapshot\": {\n value: (Object.prototype.hasOwnProperty.call(scope, name) ? scope[name] : undefined)\n }\n });\n\n // define commit\n Object.defineProperty(this, \"commit\", {value:function() {\n return (delete target[name]);\n }});\n // define rollback\n Object.defineProperty(this, \"rollback\", {value:function() {\n return (target[name]=this.snapshot);\n }});\n // define stat\n Object.defineProperty(this, \"stat\", {get:function() {\n return (Object.prototype.hasOwnProperty.call(target, name) ? target[name] : undefined)===value; // TODO\n }});\n // define diff\n Object.defineProperty(this, \"diff\", {get:function() {\n return (Object.prototype.hasOwnProperty.call(target, name) ? target[name] : undefined)===this.origin;\n }});\n\n\n }", "title": "" }, { "docid": "449770cd073c157ddca9fa8036ae45b2", "score": "0.6663919", "text": "deleteProperty (obj, key) {\n if (!(key in obj)) return true\n del(obj, key)\n delete obj[key]\n return true\n }", "title": "" }, { "docid": "87dd114436b23388207f71043db6a797", "score": "0.65771246", "text": "function del (target, key) {\n if (\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n }", "title": "" }, { "docid": "70aeb8581be042ae5c46b40eea3c9056", "score": "0.6545739", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n }", "title": "" }, { "docid": "70aeb8581be042ae5c46b40eea3c9056", "score": "0.6545739", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n }", "title": "" }, { "docid": "70aeb8581be042ae5c46b40eea3c9056", "score": "0.6545739", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n }", "title": "" }, { "docid": "d6b2bc445f24def30ded59425ca5d7cb", "score": "0.6531088", "text": "function deleteStorage(property) {\r\n return new Deferred(\r\n createPromisefunction('delete', {\r\n 'property': property,\r\n 'value': null\r\n })\r\n );\r\n }", "title": "" }, { "docid": "d3048da8f41185e54d4a1829cf5c3093", "score": "0.6494311", "text": "function del (target, key) {\n if (\"debug\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"debug\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n }", "title": "" }, { "docid": "861f4f95f8afc5840827a2ed8eb95c32", "score": "0.6455599", "text": "function del (target, key) {\n\t if (false\n\t ) {\n\t warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n\t }\n\t if (Array.isArray(target) && isValidArrayIndex(key)) {\n\t target.splice(key, 1);\n\t return\n\t }\n\t var ob = (target).__ob__;\n\t if (target._isVue || (ob && ob.vmCount)) {\n\t (\"production\") !== 'production' && warn(\n\t 'Avoid deleting properties on a Vue instance or its root $data ' +\n\t '- just set it to null.'\n\t );\n\t return\n\t }\n\t if (!hasOwn(target, key)) {\n\t return\n\t }\n\t delete target[key];\n\t if (!ob) {\n\t return\n\t }\n\t ob.dep.notify();\n\t}", "title": "" }, { "docid": "8c132d14bbbe357abce4967da2f87bcc", "score": "0.6452116", "text": "function del (target, key) {\r\n if (\"development\" !== 'production' &&\r\n (isUndef(target) || isPrimitive(target))\r\n ) {\r\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\r\n }\r\n if (Array.isArray(target) && isValidArrayIndex(key)) {\r\n target.splice(key, 1);\r\n return\r\n }\r\n var ob = (target).__ob__;\r\n if (target._isVue || (ob && ob.vmCount)) {\r\n \"development\" !== 'production' && warn(\r\n 'Avoid deleting properties on a Vue instance or its root $data ' +\r\n '- just set it to null.'\r\n );\r\n return\r\n }\r\n if (!hasOwn(target, key)) {\r\n return\r\n }\r\n delete target[key];\r\n if (!ob) {\r\n return\r\n }\r\n ob.dep.notify();\r\n}", "title": "" }, { "docid": "4d748a05ecda941e231ec44039d33a82", "score": "0.6449189", "text": "function DeleteProperty(sandbox, target, name) {\n if(!(this instanceof DeleteProperty)) return new DeleteProperty(sandbox, target, name);\n else Write.call(this, sandbox, target);\n\n Object.defineProperties(this, {\n \"name\": {\n value: name\n }\n });\n }", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "1c8ce13c4c49b3fe89e7b2d586024c0c", "score": "0.6444511", "text": "function del (target, key) {\n if (false\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "ff487d7433d5c0bf6c67439b13a7f707", "score": "0.64395565", "text": "function del (target, key) {\n if (\"development\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"development\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "e1444a7a6233fcf4f969aaa95e95c4e4", "score": "0.6413446", "text": "function del (target, key) {\n if (\"production\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "e1444a7a6233fcf4f969aaa95e95c4e4", "score": "0.6413446", "text": "function del (target, key) {\n if (\"production\" !== 'production' &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n \"production\" !== 'production' && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "af97dadbd96577d1c1c4bb48da821f8b", "score": "0.6413113", "text": "function del (target, key) {\n if (isUndef(target) || isPrimitive(target)\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" }, { "docid": "b13c7bef2933fb56d2437cd9aefe0aa8", "score": "0.64047253", "text": "function del (target, key) {\n if ( true &&\n (isUndef(target) || isPrimitive(target))\n ) {\n warn((\"Cannot delete reactive property on undefined, null, or primitive value: \" + ((target))));\n }\n if (Array.isArray(target) && isValidArrayIndex(key)) {\n target.splice(key, 1);\n return\n }\n var ob = (target).__ob__;\n if (target._isVue || (ob && ob.vmCount)) {\n true && warn(\n 'Avoid deleting properties on a Vue instance or its root $data ' +\n '- just set it to null.'\n );\n return\n }\n if (!hasOwn(target, key)) {\n return\n }\n delete target[key];\n if (!ob) {\n return\n }\n ob.dep.notify();\n}", "title": "" } ]
d44a9ad87ff05a63b1617d0ba1380a9a
Function to update the MIN search end date based on the search start date. End date can't be before start date.
[ { "docid": "fd466951e1d5b9ce5fe58927473b04e5", "score": "0.6527779", "text": "function chgEndMin(valEnd) {\n d3.select('#enddate').attr(\"min\", valEnd);\n}", "title": "" } ]
[ { "docid": "3a788a63c6945862161c18ede93b3d05", "score": "0.62009", "text": "function updateStartDate( element, endDate ) {\n\t$( element ).datepicker( \"option\", \"maxDate\", endDate );\n}", "title": "" }, { "docid": "a31ba624361fee88dc52113a237146a9", "score": "0.6179858", "text": "function updateStartDateConfig() {\n vm.dateOptionsStartDate.maxDate = vm.endDate;\n }", "title": "" }, { "docid": "905d5dd8ed16b70b879af73f43bd3ea9", "score": "0.6169955", "text": "function searchByDate(date){\n let queryDate = new Date(date.getFullYear(), date.getMonth(), (date.getDate() + 1));\n setPostedBefore(queryDate.toISOString());\n date.toISOString()\n setStartDate(date);\n }", "title": "" }, { "docid": "122dc90e44adf76d7a56f348dee3cc31", "score": "0.6109567", "text": "updateStartDate(){\n var startWeek = document.getElementById(\"start-week\");\n var startDate = document.getElementById(\"start-date\");\n \n startDate.value = util.getWeekDateRange(startWeek.value.split(\"-W\")[0], startWeek.value.split(\"-W\")[1]).startDate;\n }", "title": "" }, { "docid": "49399d2d70bad6753815b84111315b70", "score": "0.60767454", "text": "function updateEndDateConfig() {\n vm.dateOptionsEndDate.minDate = vm.startDate;\n }", "title": "" }, { "docid": "b3b2b1124ec6803f17653d7c9604d2ee", "score": "0.58978415", "text": "function leave_first_date()\n{\n\tif( $('#fld_event_date_end').val() == '' ) {\n\t\t$('#fld_event_date_end').val( $('#fld_event_date_start').val() );\n\t}\n\tDate.format = 'yyyy-mm-dd';\n\tvar st = new Date.fromString($('#fld_event_date_start').val());\n\tvar en = new Date.fromString($('#fld_event_date_end').val());\n\t// if the start date is greater then the end date, make\n\t// the end date the same\n\tif( st > en ) {\n\t $('#fld_event_date_end').val( st.asString() );\n\t}\n}", "title": "" }, { "docid": "35abf572ef8515c3e609c41a1bfc41b0", "score": "0.58329874", "text": "function setStartDate() {\n var temp = new Date();\n var date = dateFormat(temp);\n $(\"#dtStartDate\").attr(\"min\", date);\n\n}", "title": "" }, { "docid": "7e9fd2202cbbe2259df111cbc0da7e2e", "score": "0.58317894", "text": "startDateChange(mDate) { //receives moment date obj, ._d is js date\n\t\tthis.props.options.chosenDate = 'start';\n\t\tthis.props.options.startDate = mDate._d;\n\t\t\n\t\tthis.syncDates();\n\t}", "title": "" }, { "docid": "f8373338f527b0d11be679c659a24209", "score": "0.58052504", "text": "function getStartDate() {\n var selectedVal = $('#start_date').val();\n var date = new Date(selectedVal);\n if (selectedVal == '') {\n selectedVal = Object.keys(data_by_date).reduce(function (a, b) { return a < b ? a : b; });\n date = new Date(selectedVal);\n $('.start-date').val(date.toISOString().slice(0,10));\n }\n return date;\n}", "title": "" }, { "docid": "bb8ea3e4fbfe69674be4b854be29b3fe", "score": "0.5773664", "text": "function customRangeStart(input) \n { \n return {\n maxDate:(input.id == \"start_date\" ? $(\"#end_date\").datepicker(\"getDate\") : null)\n }; \n }", "title": "" }, { "docid": "8bd44ebf47ecf614ad3f359d1e543535", "score": "0.57214403", "text": "function minDate() {\n var date = getStartDate();\n return Date.UTC(date.getFullYear(), date.getMonth(), date.getDate());\n}", "title": "" }, { "docid": "fa858fb77705f03466af0f8707ba1924", "score": "0.57016194", "text": "function setMinDate(){\n let date = new Date().toJSON().substr(0, 10);\n document.getElementById('endDate').setAttribute('min', date);\n}", "title": "" }, { "docid": "c48a4a062a7906e3afee220140017f44", "score": "0.5690795", "text": "function search(){\n \n let minPrice = document.getElementById('txt_MinPrice').value;\n let maxPrice = document.getElementById('txt_MaxPrice').value;\n let minDate = document.getElementById('dt_MinDate').value;\n let maxDate = document.getElementById('dt_MaxDate').value;\n if(minPrice===null || minPrice===\"\" || isNaN(minPrice)){\n minPrice = 0;\n }\n if(maxPrice===\"\"||isNaN(maxPrice)){\n maxPrice = null;\n }\n let sminDate = minDate.split(\"-\");\n if(parseInt(sminDate[0])<1970){\n minDate = null;\n }\n let smaxDate = maxDate.split(\"-\");\n if(parseInt(smaxDate[0])<1970){\n maxDate = null;\n }\n \n let dminDate = new Date(minDate+\" 00:00:00\");\n \n let dmaxDate = new Date(maxDate+\" 23:59:59\");\n \n if(dmaxDate.valueOf()<dminDate.valueOf()){\n dminDate=null;\n dmaxDate=null;\n }\n let fminDate = parseInt(dminDate.valueOf());\n if(isNaN(fminDate)){\n fminDate=null;\n }\n let fmaxDate = parseInt(dmaxDate.valueOf());\n if(isNaN(fmaxDate)){\n fmaxDate=null;\n }\n let searcher = {\n minPrice : minPrice,\n maxPrice : maxPrice,\n minDate : fminDate,\n maxDate : fmaxDate\n };\n createTableOrders(searcher);\n}", "title": "" }, { "docid": "493912ce971cb0dcf26149284a6ee7bb", "score": "0.5629981", "text": "function customRangeStart(input) \n{ \nreturn {\n maxDate:(input.id == \"vehicle_st_date\" ? $(\"#vehicle_del_date\").datepicker(\"getDate\") : null)\n }; \n}", "title": "" }, { "docid": "1642c1e06f41d8cecd6db54c8001a0cd", "score": "0.56165415", "text": "function update_end_date() {\n var nights = $(\"#id_nights\");\n var start_selector = $(\"#id_datetime_from\");\n var end_selector = $(\"#id_datetime_to\");\n if (start_selector.val() && nights.val()) {\n var start_date = get_date_from_string(start_selector.val());\n var computed_end = addDays(start_date, Number(nights.val()));\n var curr_date = computed_end.getDate().toString().padStart(2, \"0\");\n var curr_month = (computed_end.getMonth() + 1)\n .toString()\n .padStart(2, \"0\"); //Months are zero based\n var curr_year = computed_end.getFullYear();\n end_selector.val(curr_date + \"-\" + curr_month + \"-\" + curr_year);\n }\n }", "title": "" }, { "docid": "408bef0ba2442c781e2196d5e484f0df", "score": "0.5597579", "text": "function updateDateRange() {\n\tvar date_start = $( \"#date_start_inline\" ).datepicker( \"getDate\" );\n\tvar date_end = $( \"#date_end_inline\" ).datepicker( \"getDate\" );\n\tvar date_range = Math.round( Math.abs( ( date_start.getTime() - date_end.getTime() ) / ( 24*60*60*1000 ) ) ) + 1;\n\tvar date_range_display = \" (\" + date_range + \" day\" + ( date_range > 1 ? \"s\" : \"\" ) + \")\";\n\t$(\"#date_range_count\").empty().text( date_range_display );\n}", "title": "" }, { "docid": "24ba8c8c938db7cc38e1fd1225ca8894", "score": "0.55584717", "text": "function updateSeasonFilter(startChanged) {\n $('#filterSeasons').prop('checked', true);\n\n var startVal = $('#seasonStartDropdown').val();\n var endVal = $('#seasonEndDropdown').val();\n\n if (endVal != -1 && parseInt(startVal) > parseInt(endVal)) {\n if (startChanged) {\n $('#seasonEndDropdown').val(-1);\n } else {\n $('#seasonStartDropdown').val(-1);\n }\n }\n }", "title": "" }, { "docid": "66d5ee18494337fe688ff782c3e2c9c9", "score": "0.55409694", "text": "function changeReturnDate() {\n\tvar date = jQuery(\"#beginDateText\").datepicker('getDate');\n\tif (date && date.getDate) {\n\t\tdate.setDate(date.getDate() + 1);\n\t\tjQuery(\"#endDateText\").datepicker('option', 'minDate', date);\n\t\tjQuery(\"#endDateText\").datepicker('setDate', date);\n\t}\n}", "title": "" }, { "docid": "81ea3b0bc907164e0c9597957af8d839", "score": "0.552041", "text": "function customRangeStart(input) {\r\n return {\r\n\r\n maxDate: (input.id == \"TCStartDate\" ? $(\"#TCEndDate\").datepicker(\"getDate\") : null)\r\n };\r\n }", "title": "" }, { "docid": "3cf71e760b899153b0be7091f733691a", "score": "0.5518769", "text": "function setDate(minDate,maxDate){\n\tcalendarInput = document.getElementById(\"calendar_input\");\n\tcalendarInput.min = minDate;\n\tcalendarInput.max = maxDate;\n\tcalendarInput.value = minDate;\n\n}", "title": "" }, { "docid": "fec73f4d414e2271153d5ffac0ffce59", "score": "0.55086166", "text": "_getMinDate() {\n return this._rangeInput.min;\n }", "title": "" }, { "docid": "fec73f4d414e2271153d5ffac0ffce59", "score": "0.55086166", "text": "_getMinDate() {\n return this._rangeInput.min;\n }", "title": "" }, { "docid": "68aba358ffe9d151e30eca27ebac6f5c", "score": "0.5498291", "text": "function minMaxDate() {\n //Getting earliest and latest start dates\n var maxStartDate=new Date(Math.max.apply(null,startDates));\n var month = maxStartDate.getMonth() + 1;\n maxStartDate = maxStartDate.getFullYear()+ \", \" + month + \", \" + maxStartDate.getDate();\n\n var minStartDate = new Date(Math.min.apply(null,startDates));\n var month = minStartDate.getMonth() + 1;\n minStartDate = minStartDate.getFullYear()+ \", \" + month + \", \" + minStartDate.getDate();\n\n //Getting earliest and latest finish dates\n var maxFinishDate=new Date(Math.max.apply(null,finishDates));\n var month = maxFinishDate.getMonth() + 1;\n maxFinishDate = maxFinishDate.getFullYear()+ \", \" + month + \", \" + maxFinishDate.getDate();\n\n var minFinishDate = new Date(Math.min.apply(null,finishDates));\n var month = minFinishDate.getMonth() + 1;\n minFinishDate = minFinishDate.getFullYear()+ \", \" + month + \", \" + minFinishDate.getDate();\n initDatePicker(minStartDate, maxStartDate, minFinishDate, maxFinishDate);\n}", "title": "" }, { "docid": "97b50150c35b38c78376d24013ad1966", "score": "0.54891145", "text": "setStartAsDate(startDate) {\n this.startAsDate = startDate;\n }", "title": "" }, { "docid": "4427508569edf0da46fda66195dd50fa", "score": "0.54846376", "text": "function setRangeDate(start_id, end_id, start_data_text_id, end_data_text_id, start,end){\n // let start_y = {{ $todo_start_geo[0] }};\n // start_m = start_m -1;\n // end_m = end_m -1;\n // console.log(typeof(start_d));\n $(start_id).MdPersianDateTimePicker({\n // console.log(typeof(start_d));\n\n targetTextSelector: start_data_text_id,\n targetDateSelector: '#inputDate1-1',\n dateFormat: 'yyyy-MM-dd',\n isGregorian: false,\n enableTimePicker: true,\n disableBeforeToday: false,\n disableBeforeDate: new Date(start),\n disableAfterDate: new Date(end),\n});\n$(end_id).MdPersianDateTimePicker({\n targetTextSelector: end_data_text_id,\n targetDateSelector: '#inputDate1-1',\n dateFormat: 'yyyy-MM-dd',\n isGregorian: false,\n enableTimePicker: true,\n disableBeforeToday: false,\n disableBeforeDate: new Date(start),\n disableAfterDate: new Date(end),\n});\n\n}", "title": "" }, { "docid": "06323bf365703f6fffc27b6dc4be108c", "score": "0.5475237", "text": "get minDate() { return this._minDate; }", "title": "" }, { "docid": "06323bf365703f6fffc27b6dc4be108c", "score": "0.5475237", "text": "get minDate() { return this._minDate; }", "title": "" }, { "docid": "06323bf365703f6fffc27b6dc4be108c", "score": "0.5475237", "text": "get minDate() { return this._minDate; }", "title": "" }, { "docid": "06323bf365703f6fffc27b6dc4be108c", "score": "0.5475237", "text": "get minDate() { return this._minDate; }", "title": "" }, { "docid": "06323bf365703f6fffc27b6dc4be108c", "score": "0.5475237", "text": "get minDate() { return this._minDate; }", "title": "" }, { "docid": "06323bf365703f6fffc27b6dc4be108c", "score": "0.5475237", "text": "get minDate() { return this._minDate; }", "title": "" }, { "docid": "06323bf365703f6fffc27b6dc4be108c", "score": "0.5475237", "text": "get minDate() { return this._minDate; }", "title": "" }, { "docid": "06323bf365703f6fffc27b6dc4be108c", "score": "0.5475237", "text": "get minDate() { return this._minDate; }", "title": "" }, { "docid": "5edc663b5d0c91435052462040ace888", "score": "0.54750794", "text": "static _getStartAndEnd() {\n var dates = []\n this.records.forEach(function (record){\n dates.push(new Date(record['paymentDate']))\n })\n\n this.startDate = new Date(Math.min(...dates))\n this.endDate = new Date(Math.max(...dates))\n }", "title": "" }, { "docid": "370c7bb9e337d3c51ab5465e9e426859", "score": "0.54595006", "text": "set minDate(date = undefined) {\n this.datePicker.minDate = date;\n return this;\n }", "title": "" }, { "docid": "8cf86d688ac92d659fa05b2cf8d5a02b", "score": "0.54560775", "text": "function dooffset() { \n var startdate = $('#start-dt').val(); \n var enddate = new Date(startdate);\n $('#end-dt').data('datebox').theDate = enddate;\n $('#end-dt').trigger('datebox', {'method':'doset'});\n setRecurEndDate();\n}", "title": "" }, { "docid": "9af3d645bfd53e59ca74d0c02269f35e", "score": "0.54466766", "text": "addDayIfEndBeforeStart(startDateTime, endDateTime) {\n let finalEndDateTime = endDateTime;\n\n if (endDateTime.isBefore(startDateTime)) {\n finalEndDateTime = endDateTime.add(1, 'days');\n }\n\n return finalEndDateTime;\n }", "title": "" }, { "docid": "d584b128394ac98bafdd2971553c568e", "score": "0.5437092", "text": "function onDateApply() {\n $scope.resetChildSegments();\n var startDate = $scope.currentModel.dateRange == null ? null : $scope.currentModel.dateRange.startDate;\n var endDate = $scope.currentModel.dateRange == null ? null : $scope.currentModel.dateRange.endDate;\n if (!startDate || !startDate._isValid) {\n $scope.currentModel.selectedStartDate = null;\n return;\n }\n if (!endDate || !endDate._isValid) {\n $scope.currentModel.selectedEndDate = null;\n return;\n }\n $scope.currentModel.selectedStartDate = DateFormatter.getFormattedDate(startDate);\n $scope.currentModel.selectedEndDate = DateFormatter.getFormattedDate(endDate);\n var param = {\n \"searchField\": $scope.optimizeRule.dateField,\n \"startDate\": $scope.currentModel.selectedStartDate,\n \"endDate\": $scope.currentModel.selectedEndDate\n };\n AutoOptimizationManager.one($scope.optimizeRule.id).one('segments').get(param)\n .then(function (segmentOptions) {\n $scope.formData.segmentOptionsData = segmentOptions.plain();\n angular.forEach($scope.formData.segmentFields, function (segment) {\n $scope.currentModel.segmentChild[segment.name] = null;\n });\n });\n }", "title": "" }, { "docid": "0a8ededccd4ae0290c9b2c0fdb737bbc", "score": "0.5385471", "text": "function startDateChangeHandler(event) {\n setStartDate(event.target.value)\n }", "title": "" }, { "docid": "8e493750228813801c952bc117e247f7", "score": "0.5364346", "text": "add(date) {\n let { start, end } = this.selection;\n if (start == null) {\n start = date;\n }\n else if (end == null) {\n end = date;\n }\n else {\n start = date;\n end = null;\n }\n super.updateSelection(new DateRange(start, end), this);\n }", "title": "" }, { "docid": "8e493750228813801c952bc117e247f7", "score": "0.5364346", "text": "add(date) {\n let { start, end } = this.selection;\n if (start == null) {\n start = date;\n }\n else if (end == null) {\n end = date;\n }\n else {\n start = date;\n end = null;\n }\n super.updateSelection(new DateRange(start, end), this);\n }", "title": "" }, { "docid": "e138e9ba99c8022d2b851b03928f06b2", "score": "0.5352682", "text": "updateWeekStart(newStartDate, originalStartDate = this.state.startingDate) {\n if (!this.props.updateWeek) {\n return originalStartDate;\n }\n let startingDate = moment(newStartDate).startOf(\"day\");\n let daysDiff = startingDate.diff(originalStartDate.startOf(\"day\"), \"days\");\n if (daysDiff === 0) {\n return originalStartDate;\n }\n let addOrSubtract = daysDiff > 0 ? \"add\" : \"subtract\";\n let adjustWeeks = daysDiff / 7;\n adjustWeeks =\n adjustWeeks > 0\n ? Math.floor(adjustWeeks)\n : Math.ceil(Math.abs(adjustWeeks));\n startingDate = originalStartDate[addOrSubtract](adjustWeeks, \"w\");\n\n return this.setLocale(startingDate);\n }", "title": "" }, { "docid": "26690597bb130ef6dba19f8adaf938ce", "score": "0.53499085", "text": "function configureStartDate(day, month) {\n var today = new Date($scope.input.today);\n var currentYear = today.getFullYear();\n\n var startDate = new Date();\n startDate.setFullYear(currentYear);\t\t \n startDate.setDate(day);\n\t\t \n\t\t var startMonth = (month - 1);\n startDate.setMonth(startMonth);\n\n today.setMilliseconds(0);\n today.setSeconds(0);\n today.setMinutes(0);\n\t\t today.setHours(0);\n\n startDate.setMilliseconds(0);\n startDate.setSeconds(0);\n startDate.setMinutes(0);\n\t\t startDate.setHours(0);\n\n if (today.getTime() < startDate.getTime()) {\n startDate.setFullYear(currentYear - 1);\n }\n\n return startDate;\n }", "title": "" }, { "docid": "0ae02ab2c3dca6a434b31ae82c171b88", "score": "0.53459394", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n }", "title": "" }, { "docid": "bc6ed60e4bb03e3112891aef8fa3a528", "score": "0.53359854", "text": "set dateStart(value) {\n if (!(value instanceof latte.DateTime))\n throw new latte.InvalidArgumentEx('value');\n this._dateStart = value;\n }", "title": "" }, { "docid": "86ed25ba46a06ae3a8fad35aa69e6c94", "score": "0.53301316", "text": "function setLimitDatePeriod(val, limitStartDate) {\n\t\t\n\t\tvar startDate = to_date2(limitStartDate);\n\t\tvar endDate\t = new Date();\n\t\t\n\t\tvar year = startDate.getFullYear();\n\t\tvar month = startDate.getMonth()+1;\n\t\tvar nowDay = startDate.getDate();\n\t\t\n\t\tvar end_year = startDate.getFullYear();\n\t\tvar end_month = startDate.getMonth()+1;\n\t\tvar end_date = startDate.getDate();\n\t\t \n\t\tif(val == '1') {\n\t\t\tendDate.setDate(endDate.getDate() + 7);\n\t\t}else if(val == '2') {\n\t\t\tendDate.setMonth(endDate.getMonth() + 1);\n\t\t}else if(val == '3') {\n\t\t\tendDate.setMonth(endDate.getMonth() + 2);\n\t\t}else if(val == '4') {\n\t\t\tendDate.setMonth(endDate.getMonth() + 3);\n\t\t}\n\t\t\n\t\tyear = endDate.getFullYear();\n\t\tmonth = endDate.getMonth()+1;\n\t\tnowDay = endDate.getDate();\n\t\t\n\t\t$(\"#startDate\").val(end_year+'-'+((end_month < 10) ? ('0' + end_month) : end_month)+'-'+((end_date < 10) ? ('0' + end_date) : end_date));\n\t\t$(\"#endDate\").val(year+'-'+((month < 10) ? ('0' + month) : month)+'-'+((nowDay < 10) ? ('0' + nowDay) : nowDay));\n\t\t\n\t}", "title": "" }, { "docid": "288f7756c5d1476414b9fd4ea69ebed9", "score": "0.53141505", "text": "function setDate(data){\n let month = data.getMonth() + 1;\n let day = data.getDate();\n let year = data.getFullYear();\n if(month < 10)\n month = '0' + month.toString();\n if(day < 10)\n day = '0' + day.toString();\n\n let minDate= year + '-' + month + '-' + day;\n $('#date').val(minDate);\n $('#date').attr('min', minDate);\n}", "title": "" }, { "docid": "759ed6ca41b57ad5da9faccdfcd7e06b", "score": "0.5310798", "text": "function setDateRange(elementId, form, diff, diffType, singleDate, useRange){\n //Date range start\n $('#'+elementId).daterangepicker(\n {\n //showWeekNumbers: true,\n singleDatePicker: singleDate,\n showDropdowns: true,\n ranges: {\n 'Today': [moment(), moment()],\n 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],\n 'Last 7 Days': [moment().subtract(6, 'days'), moment()],\n 'Last 30 Days': [moment().subtract(29, 'days'), moment()],\n 'This Month': [moment().startOf('month'), moment().endOf('month')],\n 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]\n },\n startDate: moment().subtract(diff, diffType),\n endDate: moment(),\n \"opens\": \"center\"\n },\n function (start, end) {\n $('#'+elementId+' span').html(start.format('D/MM/YYYY') + ' - ' + end.format('D/MM/YYYY'));\n }\n );\n $('#'+elementId).on('apply.daterangepicker', function(ev, picker) {\n $(\"#start-date\").val(picker.startDate.format('YYYY-MM-DD'));\n $(\"#end-date\").val(picker.endDate.format('YYYY-MM-DD'));\n $('#'+form).submit();\n });\n \n var $_GET = getQueryParams(document.location.search);\n //change the selected date range of that picker\n if($_GET['start-date'] != null && $_GET['end-date'] != null || (typeof(useRange) != 'undefined' && useRange)){\n if(typeof(useRange) != 'undefined' && useRange){\n setSelectedDateRange(elementId, form, $(\"#start-date\").val(),$(\"#end-date\").val(),singleDate);\n cb(moment($(\"#start-date\").val()), moment($(\"#end-date\").val()));\n } else {\n setSelectedDateRange(elementId, form, $_GET['start-date'],$_GET['end-date'],singleDate);\n cb(moment($_GET['start-date']), moment($_GET['end-date']));\n }\n } else {\n cb(moment().subtract(diff, diffType), moment());\n }\n function cb(start, end) {\n $('#'+elementId+' span').html(start.format('D/MM/YYYY') + ' - ' + end.format('D/MM/YYYY'));\n }\n //Date range end\n}", "title": "" }, { "docid": "b213fc77abe46274b4ae1fa87acc7091", "score": "0.5308619", "text": "function setDate(start, end){\n $('#date-range span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));\n}", "title": "" }, { "docid": "68738373835f696feebba0804d918c77", "score": "0.52950823", "text": "set startingDate(date) {\n\t\tthis.date = date;\n\t\tthis.startDate = new Date(date);\n\t\tweather.updateWeather();\n\t}", "title": "" }, { "docid": "8b4a055eda34419960f29b3110e253b4", "score": "0.52593195", "text": "function changeStart(date) {\n setStartDate(date);\n console.log(date);\n props.getStartDate(date.getTime(), date.toLocaleString());\n }", "title": "" }, { "docid": "f3dfaab87289df2688cbf9493abc5a7a", "score": "0.5256054", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "title": "" }, { "docid": "f3dfaab87289df2688cbf9493abc5a7a", "score": "0.5256054", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "title": "" }, { "docid": "f3dfaab87289df2688cbf9493abc5a7a", "score": "0.5256054", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "title": "" }, { "docid": "f3dfaab87289df2688cbf9493abc5a7a", "score": "0.5256054", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "title": "" }, { "docid": "f3dfaab87289df2688cbf9493abc5a7a", "score": "0.5256054", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "title": "" }, { "docid": "f3dfaab87289df2688cbf9493abc5a7a", "score": "0.5256054", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "title": "" }, { "docid": "f3dfaab87289df2688cbf9493abc5a7a", "score": "0.5256054", "text": "function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n}", "title": "" }, { "docid": "406c122e40fb9d6c804f9a8680947870", "score": "0.52480173", "text": "get minDate() {\n return this._minDate;\n }", "title": "" }, { "docid": "8dd90ba293e212de31f122e80088f049", "score": "0.52432567", "text": "function customRange(input) {\r\n return {\r\n\r\n minDate: (input.id == \"TCEndDate\" ? $(\"#TCStartDate\").datepicker(\"getDate\") : new Date())\r\n };\r\n }", "title": "" }, { "docid": "9cac759b01dadb9fd3762f1485cc8cf9", "score": "0.5233313", "text": "function parseStartEndDateFromPicker(){\n \tvar start = $(\"#filter-daterange\").data('daterangepicker').startDate;\n \tvar end = $(\"#filter-daterange\").data('daterangepicker').endDate;\n \tstartDate = moment(start,DATE_RANGE_DATE_FORMAT);\n \tendDate= moment(end,DATE_RANGE_DATE_FORMAT);\n }", "title": "" }, { "docid": "3c974e1e183cf385857d2c8393dbf69e", "score": "0.5220933", "text": "function ValidateServiceStartDateRange() {\r\n var selectedStartMonth = $('#ServiceStartDateDropdown').val();\r\n var selectedStartVal = selectedStartMonth.split('-');\r\n var selectedStartDay = $('#StartDay').val();\r\n var startDate = new Date(selectedStartVal[1], selectedStartVal[0] - 1, selectedStartDay);\r\n\r\n var selectedParentStartDate = $('#LineItemServiceStartDate').val().split('-');\r\n var parentStartDate = new Date(selectedParentStartDate[2], selectedParentStartDate[1] - 1, selectedParentStartDate[0]);\r\n\r\n if (startDate < parentStartDate) {\r\n return false;\r\n }\r\n else\r\n return true;\r\n}", "title": "" }, { "docid": "76d0b16964dcc3bd9070a9330c0956f5", "score": "0.52205193", "text": "function calendarView() {\n var searchStart = new Date($rootScope.searchRangeStart);\n var searchEnd = new Date($rootScope.searchRangeEnd);\n var calendarDate = $(\"#doctorCalendar\").fullCalendar('getDate');\n var current = new Date(calendarDate);\n var nextMonthCount = 0;\n if ($scope.calendarBrows === 'prev')\n nextMonthCount--;\n else\n nextMonthCount++;\n var request1 = false;\n var request2 = false;\n if ($scope.calendarBrows === 'next') {\n if (current.getMonth() == 11 && searchEnd.getFullYear() == current.getFullYear()) {\n $rootScope.endDate = formatDate(new Date(searchEnd.getFullYear() + 1, 0, 1));\n searchStart.setMonth(current.getMonth() + nextMonthCount);\n searchStart.setDate(1);\n $rootScope.startDate = formatDate(new Date(searchStart));\n request2 = true;\n }\n else {\n if (searchEnd.getMonth() <= current.getMonth() + nextMonthCount && searchEnd.getFullYear() == current.getFullYear()) {\n if ($scope.calendarBrows === 'prev')\n nextMonthCount--;\n else\n nextMonthCount++;\n searchEnd.setDate(searchEnd.getDate() + 1);\n $rootScope.startDate = formatDate(new Date(searchEnd));\n searchEnd.setMonth(current.getMonth() + nextMonthCount);\n searchEnd.setDate(1);\n $rootScope.endDate = formatDate(new Date(searchEnd));\n request1 = true;\n }\n }\n }\n\n if ($scope.calendarBrows === 'prev') {\n if (current.getMonth() == 0 && searchStart.getFullYear() == current.getFullYear()) {\n $rootScope.startDate = formatDate(new Date(searchStart.getFullYear() - 1, 11, 1));\n searchEnd.setMonth(current.getMonth() + nextMonthCount);\n searchEnd.setDate(1);\n $rootScope.endDate = formatDate(new Date(searchEnd));\n request1 = true;\n }\n else {\n if ((searchStart.getMonth() > current.getMonth() + nextMonthCount || (searchStart.getMonth() >= current.getMonth() + nextMonthCount && searchStart.getDate() > 1)) && searchStart.getFullYear() == current.getFullYear()) {\n $rootScope.endDate = formatDate(new Date(searchStart.setDate(searchStart.getDate() - 1)));\n searchStart.setMonth(current.getMonth() + nextMonthCount);\n searchStart.setDate(1);\n $rootScope.startDate = formatDate(new Date(searchStart));\n request2 = true;\n }\n }\n }\n if (request1 === true || request2 === true) {\n search();\n } else {\n $('#doctorCalendar').fullCalendar($scope.calendarBrows);\n }\n }", "title": "" }, { "docid": "de6a6cf844a38fbe32b9519895af47aa", "score": "0.5133569", "text": "advancedSearchChange(start_date, end_date, category, sort){\n var search_term = document.getElementById(\"search-input-bar\").value;\n this.props.lookback_actions.clearSearchResults();\n this.props.lookback_actions.searchTerm(search_term, moment(start_date).tz(\"UTC\").format(), moment(end_date).tz(\"UTC\").format(), category, sort, this.props.currentUser.token);\n this.pageSelectionChange(1);\n }", "title": "" }, { "docid": "e8ddbe2f41405abcbb716853f8ac0633", "score": "0.51335096", "text": "function setSelected(start, end) {\n\tselectedStartDate = start;\n\tselectedEndDate = end;\n}", "title": "" }, { "docid": "297a827e6e23377c275dffdc2be334e7", "score": "0.51297957", "text": "setEndAsDate(endDate) {\n this.endAsDate = endDate;\n }", "title": "" }, { "docid": "ad2c18ac3410de3c11620a4b0c812c6a", "score": "0.51273686", "text": "function getStartDate() {\n $.getJSON( \"./data/startDates.json\", function(data) {\n var today = new Date();\n var futureDates = [];\n\n // go through each date in json file\n $.each(data.startDates, function(k, dateString) { \n var date = new Date(dateString);\n\n // make sure date is in the future\n if (date > today) {\n futureDates.push(date);\n }\n });\n\n // find lowest start date\n var minDate = new Date(Math.min.apply(null,futureDates));\n \n // update ui\n $(\".startDateContainer\").html(moment(minDate).format(\"MMM Do\"));\n });\n}", "title": "" }, { "docid": "8c96d84dfabc40ef1f303eb03cdf6c97", "score": "0.50914496", "text": "function initSearchDay(){\n var date1 = new Date();\n var date2 = new Date();\n var beginD = date1.getDayString(DAYOFFSET);\n var endD = date2.getDayString(0);\n d3.select('#search_begind').property('value',beginD);\n d3.select('#search_endd').property('value',endD); \n}", "title": "" }, { "docid": "0cf1def069c307311893f6c1f6ebf197", "score": "0.50868905", "text": "get minValueDate() {\n\t\treturn this.__minValueDate;\n\t}", "title": "" }, { "docid": "891afa8914408850cf7e0dd56c65addc", "score": "0.50851977", "text": "function customRangeStartCOD(input) {\r\n return {\r\n maxDate: (input.id == \"CODStartDate\" ? $(\"#CODEndDate\").datepicker(\"getDate\") : null)\r\n };\r\n }", "title": "" }, { "docid": "8a7650831a500570b5032acd0f833f22", "score": "0.5082747", "text": "minDate() {\n return this.approaches[0].date;\n }", "title": "" }, { "docid": "9aeb0c679791f0a8e4dcc539d015b3a1", "score": "0.5081051", "text": "_getMinDate() {\n return this._min;\n }", "title": "" }, { "docid": "9aeb0c679791f0a8e4dcc539d015b3a1", "score": "0.5081051", "text": "_getMinDate() {\n return this._min;\n }", "title": "" }, { "docid": "04270c2589206f057d773781a14b5bd3", "score": "0.507749", "text": "adjustStartDate(startDate, timeDiff) {\n const scheduler = this.currentOverClient;\n\n return scheduler.timeAxis.roundDate(new Date(startDate - 0 + timeDiff), scheduler.snapRelativeToEventStartDate ? startDate : false);\n }", "title": "" }, { "docid": "013a15599db1fcde43c0f65078dadc9b", "score": "0.5035693", "text": "clampDate(date, min, max) {\n if (min && this.compareDate(date, min) < 0) {\n return min;\n }\n if (max && this.compareDate(date, max) > 0) {\n return max;\n }\n return date;\n }", "title": "" }, { "docid": "131e76dd232ecef66b7b4001065252f3", "score": "0.50317883", "text": "function calcStartDate(indexRange){\n switch (indexRange) {\n case \"finYtd\":\n startDate = finStart();\n break;\n case \"calYtd\":\n startDate = calStart();\n break;\n case \"10d\":\n startDate = datePrior(10);\n break;\n case \"30d\":\n startDate = datePrior(30);\n break;\n case \"3m\":\n startDate = mthPrior(3);\n break;\n case \"6m\":\n startDate = mthPrior(6);\n break;\n case \"1y\":\n startDate = mthPrior(12);\n break;\n default:\n startDate = \"1900-01-01\";\n };\n return startDate;\n}", "title": "" }, { "docid": "131e76dd232ecef66b7b4001065252f3", "score": "0.50317883", "text": "function calcStartDate(indexRange){\n switch (indexRange) {\n case \"finYtd\":\n startDate = finStart();\n break;\n case \"calYtd\":\n startDate = calStart();\n break;\n case \"10d\":\n startDate = datePrior(10);\n break;\n case \"30d\":\n startDate = datePrior(30);\n break;\n case \"3m\":\n startDate = mthPrior(3);\n break;\n case \"6m\":\n startDate = mthPrior(6);\n break;\n case \"1y\":\n startDate = mthPrior(12);\n break;\n default:\n startDate = \"1900-01-01\";\n };\n return startDate;\n}", "title": "" }, { "docid": "682a340930aa2683558a016c83e7dc02", "score": "0.5014069", "text": "function itg_report_disable_future_date() {\n $(\"#edit-date-filter-min-datepicker-popup-0\").datepicker({\n maxDate: new Date(),\n minDate: new Date(1970, 01, 01),\n changeMonth: true,\n changeYear: true,\n dateFormat: 'yy-mm-dd',\n onSelect: function (selected) {\n var dt = new Date(selected);\n dt.setDate(dt.getDate() + 1);\n $(\"#edit-date-filter-max-datepicker-popup-0\").datepicker(\"option\", \"minDate\", dt);\n }\n });\n $(\"#edit-date-filter-max-datepicker-popup-0\").datepicker({\n maxDate: new Date(),\n minDate: new Date(1970, 01, 01),\n changeMonth: true,\n changeYear: true,\n dateFormat: 'yy-mm-dd',\n onSelect: function (selected) {\n var dt = new Date(selected);\n dt.setDate(dt.getDate() - 1);\n $(\"#edit-date-filter-min-datepicker-popup-0\").datepicker(\"option\", \"maxDate\", dt);\n }\n });\n }", "title": "" }, { "docid": "9fb2035159e127e68224cf512e8178bc", "score": "0.5011435", "text": "function constrainDate(date, range) {\n\tdate = date.clone();\n\n\tif (range.start) {\n\t\tdate = maxMoment(date, range.start);\n\t}\n\n\tif (range.end && date >= range.end) {\n\t\tdate = range.end.clone().subtract(1);\n\t}\n\n\treturn date;\n}", "title": "" }, { "docid": "db7c0fc8dea27bc6a626cd0979a1ca6c", "score": "0.4997754", "text": "function setAgtTimePeriod(d){\n // console.log(newMinDay);\n // console.log(newMaxDay);\n var minDate = parseDate(newMinDay);\n var maxDate = parseDate(newMaxDay);\n var agmtDat = d.Dat;\n if ((agmtDat >= minDate) && (agmtDat <= maxDate)){\n return d;\n }\n }", "title": "" }, { "docid": "322c2f1c09e2c66d1ff569635c131835", "score": "0.49936104", "text": "function sortByDate() {\n\tsDate = document.getElementById('sDate').value;\n\teDate = document.getElementById('eDate').value;\n\n\tif(sDate > eDate) {\n\t\talert(\"Start date is later than End Date\");\n\t\tdocument.getElementById('sDate').value = \"\";\n\t\tdocument.getElementById('eDate').value = \"\";\n\t\tshowAllEvents();\n\t\treturn;\n\t}\n\n\tvar event_list = document.querySelectorAll('.event-search');\n\tvar isFound = 0;\n\t[].slice.call(event_list).forEach(function(temp) {\n\t\tvar tempStartDate = temp.getAttribute('text');\n\t\tvar tempEndDate = temp.getAttribute('value');\n\t\tif (tempStartDate >= sDate && tempEndDate <= eDate && tempEndDate >= tempStartDate) {\n\t\t\ttemp.parentNode.appendChild(temp);\n\t\t\tisFound = 1;\n\t\t} else {\n\t\t\ttemp.parentNode.appendChild(temp);\n\t\t\ttemp.setAttribute('style','display:none');\n\t\t}\n\t});\n\tif (!isFound) {\n\t\talert(\"No event found during that date\");\n\t\tshowAllEvents();\n\t}\n\n\tdocument.getElementById('sDate').value = \"\";\n\tdocument.getElementById('eDate').value = \"\";\n}", "title": "" }, { "docid": "298d2a240c2fd61910246fe032e862b0", "score": "0.49716654", "text": "function fixDates(entry) {\n entry.startDate = new Date(Date.parse(entry.startDate));\n entry.endDate = new Date(Date.parse(entry.endDate));\n }", "title": "" }, { "docid": "f18864f0768a7a4146b7f210adf7e7d3", "score": "0.49670604", "text": "function checkStartEndDate(formId, startDateId, endDateId, buttonId) {\n var startDate = $('#' + formId + ' #' + startDateId).val();\n var endDate = $('#' + formId + ' #' + endDateId).val();\n if (endDate != \"\") {\n if (endDate < startDate) {\n showCenteredLoading(\"Planned completion date should be greater than planned start date \");\n } else {\n return true;\n }\n }\n}", "title": "" }, { "docid": "c7419951eb86b5c55aef4cbd8b03b124", "score": "0.4956831", "text": "function set_min(value){\n d3.select(\"#end\")\n .attr(\"min\", value)\n }", "title": "" }, { "docid": "e0f8fddfce0d8ed4c83793c6b844ab65", "score": "0.49547878", "text": "function setDates() {\n var today = new Date();\n $rootScope.startDate = formatDate(today);\n $rootScope.currentdate = formatDate(today);\n $rootScope.endDate = formatDate(new Date(today.setDate(today.getDate() + 14)));\n dataFactory.setSearchDates($rootScope.startDate, $rootScope.endDate);\n }", "title": "" }, { "docid": "d46636639bf5ca18b0bbda5912b1abde", "score": "0.49516594", "text": "function checkStartEndDateForForm(startDateval, endDateval) {\n\n if (endDateval != \"\") {\n if (endDateval < startDateval) {\n showCenteredLoading(\"Planned completion date should be greater than planned start date \");\n } else {\n return true;\n }\n }\n}", "title": "" }, { "docid": "4d77341804280043a45c73e83f9671a4", "score": "0.49502772", "text": "constructor(startDate, endDate, offset) {\n\t\t/**\n\t\t * Begining of search range\n\t\t */\n\t\tthis.start = (new Date(startDate)).getTime();\n\n\t\t/**\n\t\t * Ending of search range\n\t\t */\n\t\tthis.stop = (new Date(endDate)).getTime();\n\n\t\t/**\n\t\t * Offset(gaprule) of search range\n\t\t */\n\t\tthis.offset = offset;\n\t}", "title": "" }, { "docid": "8d8cc58f05d2646e973c50a577ffc1ab", "score": "0.49499327", "text": "syncDates() {\n\t\tthis.props.options.timePeriod = Number(this.props.options.timePeriod);\n\t\tif (this.props.options.chosenDate == 'start') { //user is setting startDate manually\n\t\t\t//add timePeriod days to find endDate and set it\n\t\t\tthis.props.options.endDate = new Date(this.props.options.startDate);\n\t\t\tthis.props.options.endDate.setDate(this.props.options.endDate.getDate() + this.props.options.timePeriod);\n\t\t\t//TODO: update endDate component to match new date\n\t\t\t\n\t\t} else { //user is setting endDate, do the same as above but backwards\n\t\t\t\n\t\t\tthis.props.options.startDate = new Date(this.props.options.endDate);\n\t\t\tthis.props.options.startDate.setDate(this.props.options.startDate.getDate() - this.props.options.timePeriod);\n\t\t\t//TODO: update actual startDate component to match new date\n\t\t}\n\t\tconsole.log('sync dates. start: ', this.props.options.startDate.toString())\n\t\tconsole.log('sync dates. end: ', this.props.options.endDate.toString())\n\t\tthis.props.optionUpdateHandler(this.props.options);\n\t}", "title": "" }, { "docid": "dee1d5c5550b3bb7e997dfb20963e76b", "score": "0.4949626", "text": "function SetDates() {\n const today = new Date();\n let dates = \"\";\n if (\n startDate !== null &&\n startDate !== null &&\n startDate <= today &&\n endDate <= today &&\n startDate <= endDate\n ) {\n Dates = {\n startDate:\n \"\" +\n (startDate.getMonth() + 1) +\n \"/\" +\n startDate.getDate() +\n \"/\" +\n startDate.getFullYear(),\n endDate:\n \"\" +\n (endDate.getMonth() + 1) +\n \"/\" +\n endDate.getDate() +\n \"/\" +\n endDate.getFullYear(),\n };\n SetSelectedDates(dates);\n fetchDataFiltered();\n } else {\n showAlert();\n }\n\n console.log(dates);\n }", "title": "" }, { "docid": "e13ed626a2607a6b0f64842cdebca068", "score": "0.49442503", "text": "function filterDate(e) {\n const getId = e.target.getAttribute('id');\n const setDate = e.target.value;\n const departureDate = document.getElementById(\"departure\");\n const returnDate = document.getElementById(\"return\");\n\n if (getId == 'departure') {\n returnDate.setAttribute(\"min\", setDate);\n } else {\n departureDate.setAttribute(\"max\", setDate);\n }\n}", "title": "" }, { "docid": "85ee980d617cf6b7cfc53d8fb49d1a32", "score": "0.49397528", "text": "clearStartValue() {\n this.formattedStartDate = '';\n this.value = Object.assign(Object.assign({}, this.value), { startDate: null });\n this.change.emit(this.value);\n }", "title": "" }, { "docid": "b4fc810478a3482075ae5ebf84b01472", "score": "0.49229306", "text": "updateFocus() {\n const viewDate = new Date(this.picker.viewDate);\n const first = startOfYearPeriod(viewDate, this.navStep);\n const last = first + 9 * this.step;\n\n this.first = first;\n this.last = last;\n this.start = first - this.step;\n this.focused = startOfYearPeriod(viewDate, this.step);\n }", "title": "" }, { "docid": "2bce6c56cbe263a1569c57a92012408d", "score": "0.4916081", "text": "function onStatsDateChange(e) {\n var date = $(e.delegateTarget).val();\n var validDate;\n\n if(date == undefined || date == null || date.length == 0 || Date.parse(date) == NaN) {\n validDate = 0;\n } else {\n validDate = Date.parse(date);\n }\n\n // start or end\n if ($(e.delegateTarget).attr('id') == \"form-stats-date-start\")\n Charts.filter.timestamp.start = validDate;\n else\n Charts.filter.timestamp.end = validDate;\n\n // update charts\n Charts.draw();\n}", "title": "" }, { "docid": "99d4e3384cad9ac1a74b3df043879c46", "score": "0.49140814", "text": "function customRangeCOD(input) {\r\n return {\r\n minDate: (input.id == \"CODEndDate\" ? $(\"#CODStartDate\").datepicker(\"getDate\") : new Date())\r\n };\r\n }", "title": "" }, { "docid": "b2c47485250cdc0857a0ca86d07fd98a", "score": "0.49106187", "text": "handleChangeStart(date) {\n if (this.state.isRecurrent.value === \"non-recurring\") {\n let nonRecurStartDate = moment(this.state.startDate);\n let nonRecurEndDate = moment(date).add(15, \"minutes\"); //Set default end date to 15 minutes after the start date (because event can't last less than 15 mintutes).\n this.setState({\n startDate: nonRecurStartDate,\n endDate: nonRecurEndDate,\n });\n }\n if (this.state.allDay === true) {\n this.setState({ //All day event lasts from 9am to 6pm.\n startDate: moment(date).hours(9).minutes(0),\n endDate: moment(date).hours(18).minutes(0),\n });\n }\n else {\n this.setState({ startDate: date, });\n }\n }", "title": "" }, { "docid": "d987cd4f9d34a5333e73957dcd597589", "score": "0.4902449", "text": "function executaIdaVolta(origem, destino, DateBegin, DateEnd) {\n\n searchDate(origem, destino, DateBegin, DateEnd);\n searchDate(destino, origem, DateBegin, DateEnd);\n //searchDate(destino, origem, DateEnd, DateBegin);\n //searchDate(destino, origem, DateEnd, DateBegin);\n}", "title": "" }, { "docid": "7a267f30967a905b17e1f000ae1b08ec", "score": "0.4883723", "text": "get_oldest_starting_date() {\n return this.tasks\n .map(task => task._start)\n .reduce(\n (prev_date, cur_date) =>\n cur_date <= prev_date ? cur_date : prev_date\n );\n }", "title": "" }, { "docid": "22b6aa758f340700590f0f2f93d20b98", "score": "0.4881207", "text": "function setDateValue (value, model) {\n if (value == null) {\n $scope.tableParams.filter()[model] = null;\n } else {\n var start = $filter('date')(value.startDate._d, \"dd/MM/yyyy\");\n var end = $filter('date')(value.endDate._d, \"dd/MM/yyyy\");\n $scope.tableParams.filter()[model] = start + '-' + end;\n }\n }", "title": "" }, { "docid": "ed8466c5a316b39d7079b7fa6d3755a1", "score": "0.48753646", "text": "function customRange(dates) { \n if (this.id == 'timestamp_start_at') { \n $('input#timestamp_end_at').datepicker('option', 'minDate', dates || null); \n } \n else { \n $('input#timestamp_start_at').datepicker('option', 'maxDate', dates || null); \n } \n }", "title": "" }, { "docid": "8ff75eb72bc656975ab1e876e3c27ff6", "score": "0.48641977", "text": "function calcRangeDate(startEl, endEl) {\n let startResult = Date.parse(startEl.value);\n let endResult = Date.parse(endEl.value);\n return endResult - startResult;\n}", "title": "" } ]
c54ff8842d2e19670fa01e190f4fab5e
! moment.js locale configuration
[ { "docid": "fc705d16a79847e06539e74ad790fca1", "score": "0.0", "text": "function t(e,t,a,o){var i={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[e+\" sekondamni\",e+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[e+\" mintamni\",e+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[e+\" voramni\",e+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[e+\" disamni\",e+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[e+\" mhoineamni\",e+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[e+\" vorsamni\",e+\" vorsam\"]};return o?i[a][0]:i[a][1]}", "title": "" } ]
[ { "docid": "99ccb5862776433d2ec74e9576fe0564", "score": "0.80555266", "text": "function ni(e,t,n){var a={ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"};return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}(a[n],+e)}", "title": "" }, { "docid": "711f074bb99a3aa673cbd30e090d0738", "score": "0.7763291", "text": "function Ki(e,t,n){return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}({ss:t?\"секунда_секунди_секунд\":\"секунду_секунди_секунд\",mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"}[n],+e)}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548106", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "157f60aa42f6cc835675896915a22a65", "score": "0.7548106", "text": "function localizeMoment(mom) {\n\t\tif ('_locale' in mom) { // moment 2.8 and above\n\t\t\tmom._locale = localeData;\n\t\t}\n\t\telse { // pre-moment-2.8\n\t\t\tmom._lang = localeData;\n\t\t}\n\t}", "title": "" }, { "docid": "d35e8419b4ea5252a03f05b4e963d403", "score": "0.73769677", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}//! moment.js locale configuration", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "83aee654a8d97aa81bf251da5968faeb", "score": "0.71984273", "text": "function localizeMoment(mom) {\n\t\tmom._locale = localeData;\n\t}", "title": "" }, { "docid": "b0d4c1b699e678f87040e762f40a7ead", "score": "0.71708643", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "d455a45fc49181379dc1a8784dc96a09", "score": "0.71282613", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key)}else{data=defineLocale(key,values)}if(data){// moment.duration._locale = moment._locale = data;\nglobalLocale=data}else{if(\"undefined\"!==typeof console&&console.warn){//warn user if arguments are passed but the locale could not be set\nconsole.warn(\"Locale \"+key+\" not found. Did you forget to load it?\")}}}return globalLocale._abbr}", "title": "" }, { "docid": "ac7af0e62ca67c3cded5907f4217c1bf", "score": "0.71231383", "text": "function Qa(e,t,n){var r={mm:t?\"хвилина_хвилини_хвилин\":\"хвилину_хвилини_хвилин\",hh:t?\"година_години_годин\":\"годину_години_годин\",dd:\"день_дні_днів\",MM:\"місяць_місяці_місяців\",yy:\"рік_роки_років\"};return\"m\"===n?t?\"хвилина\":\"хвилину\":\"h\"===n?t?\"година\":\"годину\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Ukrainian [uk]\n//! author : zemlanin : https://github.com/zemlanin\n//! Author : Menelion Elensúle : https://github.com/Oire\nfunction(e,t){var n=e.split(\"_\");return t%10==1&&t%100!=11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}(r[n],+e)}", "title": "" }, { "docid": "f619fe7c32d9997fd0720a00170897bc", "score": "0.6982797", "text": "function getSetGlobalLocale(key,values){var data;\n// moment.duration._locale = moment._locale = data;\nreturn key&&(data=isUndefined(values)?getLocale(key):defineLocale(key,values))&&(globalLocale=data),globalLocale._abbr}", "title": "" }, { "docid": "4d130ea41d5e4d847737b082b0ef6e38", "score": "0.692715", "text": "function ue(e,t,n,r){var a={s:[\"थोडया सॅकंडांनी\",\"थोडे सॅकंड\"],ss:[e+\" सॅकंडांनी\",e+\" सॅकंड\"],m:[\"एका मिणटान\",\"एक मिनूट\"],mm:[e+\" मिणटांनी\",e+\" मिणटां\"],h:[\"एका वरान\",\"एक वर\"],hh:[e+\" वरांनी\",e+\" वरां\"],d:[\"एका दिसान\",\"एक दीस\"],dd:[e+\" दिसांनी\",e+\" दीस\"],M:[\"एका म्हयन्यान\",\"एक म्हयनो\"],MM:[e+\" म्हयन्यानी\",e+\" म्हयने\"],y:[\"एका वर्सान\",\"एक वर्स\"],yy:[e+\" वर्सांनी\",e+\" वर्सां\"]};return r?a[n][0]:a[n][1]}//! moment.js locale configuration", "title": "" }, { "docid": "f1307362c66d5698b7eabf78c9623281", "score": "0.69148284", "text": "function getSetGlobalLocale(key,values){var data;if(key){if(isUndefined(values)){data=getLocale(key);}else{data=defineLocale(key,values);}if(data){// moment.duration._locale = moment._locale = data;\n\tglobalLocale=data;}}return globalLocale._abbr;}", "title": "" }, { "docid": "d3fbfa3239ceea082f45435d9661b7b5", "score": "0.65888846", "text": "function handleLocaleChange(locale) {\n i18n.locale = locale\n moment.locale(locale)\n}", "title": "" }, { "docid": "d252e19be518329d10c10006b572f344", "score": "0.65586287", "text": "function setLocaleDateTime () {\n\t var days = [\n\t $.localise.tr(\"Sunday\"),\n\t $.localise.tr(\"Monday\"),\n\t $.localise.tr(\"Tuesday\"),\n\t $.localise.tr(\"Wednesday\"),\n\t $.localise.tr(\"Thursday\"),\n\t $.localise.tr(\"Friday\"),\n\t $.localise.tr(\"Saturday\")\n\t ],\n\t months = [\n\t $.localise.tr(\"January\"),\n\t $.localise.tr(\"February\"),\n\t $.localise.tr(\"March\"),\n\t $.localise.tr(\"April\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"June\"),\n\t $.localise.tr(\"July\"),\n\t $.localise.tr(\"August\"),\n\t $.localise.tr(\"September\"),\n\t $.localise.tr(\"October\"),\n\t $.localise.tr(\"November\"),\n\t $.localise.tr(\"December\")\n\t ],\n\t days_abbrev = [\n\t $.localise.tr(\"Sun\"),\n\t $.localise.tr(\"Mon\"),\n\t $.localise.tr(\"Tue\"),\n\t $.localise.tr(\"Wed\"),\n\t $.localise.tr(\"Thu\"),\n\t $.localise.tr(\"Fri\"),\n\t $.localise.tr(\"Sat\")\n\t ],\n\t months_abbrev = [\n\t $.localise.tr(\"Jan\"),\n\t $.localise.tr(\"Feb\"),\n\t $.localise.tr(\"Mar\"),\n\t $.localise.tr(\"Apr\"),\n\t $.localise.tr(\"May\"),\n\t $.localise.tr(\"Jun\"),\n\t $.localise.tr(\"Jul\"),\n\t $.localise.tr(\"Aug\"),\n\t $.localise.tr(\"Sep\"),\n\t $.localise.tr(\"Oct\"),\n\t $.localise.tr(\"Nov\"),\n\t $.localise.tr(\"Dec\")\n\t ];\n\t wialon.util.DateTime.setLocale(days, months, days_abbrev, months_abbrev);\n\t}", "title": "" }, { "docid": "c18bbc280ab7aa310d8256fe0054cf7a", "score": "0.6492452", "text": "setLocale(momentInstance) {\n if (this.props.locale) {\n momentInstance.locale(this.props.locale.name);\n }\n return momentInstance;\n }", "title": "" }, { "docid": "fe8cccfeb08a82911f2984d5a476dcd7", "score": "0.62765163", "text": "function ignoreMomentLocale(webpackConfig) {\n delete webpackConfig.module.noParse;\n webpackConfig.plugins.push(new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/));\n}", "title": "" }, { "docid": "95692ec680e62aa339fff1328a355241", "score": "0.6214133", "text": "get localeText() {\n switch (this._config.locale) {\n case \"fr\" :\n return {\n\t feelsLike: \"Ressenti:\",\n maxToday: \"Max. du jour:\",\n minToday: \"Min. du jour:\",\n windMore: \"Rafales à\",\n }\n default :\n return {\n feelsLike: \"Feels like\",\n maxToday: \"Today's High\",\n minToday: \"Today's Low\",\n windMore: \"Wind gust\",\n }\n }\n }", "title": "" }, { "docid": "4a6f10cf3c829e810d9763057a3eee1b", "score": "0.6203053", "text": "function ApexLocale() {}", "title": "" }, { "docid": "964b814e9555cf556ce599f5fd6f98b5", "score": "0.6196645", "text": "function getSetGlobalLocale (key, values) {\n\t\t var data;\n\t\t if (key) {\n\t\t if (isUndefined(values)) {\n\t\t data = getLocale(key);\n\t\t }\n\t\t else {\n\t\t data = defineLocale(key, values);\n\t\t }\n\t\t\n\t\t if (data) {\n\t\t // moment.duration._locale = moment._locale = data;\n\t\t globalLocale = data;\n\t\t }\n\t\t }\n\t\t\n\t\t return globalLocale._abbr;\n\t\t}", "title": "" }, { "docid": "f5578f4ca2594b9463cdcfda88867a1b", "score": "0.6187693", "text": "function test_automated_locale_switching() {}", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.6183774", "text": "function ApexLocale() { }", "title": "" }, { "docid": "cf395bb0083ba1ea07b9d05bf01925ac", "score": "0.6183774", "text": "function ApexLocale() { }", "title": "" }, { "docid": "b229aede18b54e3415ef4fe77b418058", "score": "0.61563", "text": "function getMomentLocaleData(localeCode){return moment.localeData(localeCode)||moment.localeData(\"en\")}", "title": "" }, { "docid": "3c6cc1ca2d0c58e71df7b7c04bf75cdb", "score": "0.6154931", "text": "function load(localeName, callback) {\n if (!localeName || localeName === \"en\") {\n // Default moment is for English. Note that there is no external file for it!\n let moment = require('moment');\n moment.locale('en');\n callback(moment);\n }\n else {\n let moment = require('moment');\n require('moment/locale/' + localeName);\n moment.locale(localeName);\n callback(moment);\n }\n}", "title": "" }, { "docid": "b72a5716b34780008675aafc3129fe1a", "score": "0.61443317", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "2529afb11d1894571496d02dc7eba097", "score": "0.61418235", "text": "function setLocaleLanguage(locale) {\n let fetch = false\n if(locale == 'en') {\n dateFormatter.locale = 'en'\n fetch = true\n }\n else dateFormatter.locale = 'ko-Kore_KR'\n\n localeJSON.year = !fetch ? 'yy년' : 'y,'\n localeJSON.day = !fetch ? 'EEEE' : 'E'\n localeJSON.calendar = !fetch ? '일정' : 'Calendar'\n localeJSON.reminder = !fetch ? '미리알림' : 'Reminder'\n\n localeJSON.sun = !fetch ? '일' : 'S'\n localeJSON.mon = !fetch ? '월' : 'M'\n localeJSON.tue = !fetch ? '화' : 'T'\n localeJSON.wen = !fetch ? '수' : 'W'\n localeJSON.thu = !fetch ? '목' : 'T'\n localeJSON.fri = !fetch ? '금' : 'F'\n localeJSON.sat = !fetch ? '토' : 'S'\n}", "title": "" }, { "docid": "9c0d0ea8dd2f120115abd8f0b67c7bdd", "score": "0.6134753", "text": "function configureGlobalMomentLocale(localeOverride = \"system-default\", weekStart = \"locale\") {\n var _a;\n const obsidianLang = localStorage.getItem(\"language\") || \"en\";\n const systemLang = (_a = navigator.language) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n let momentLocale = langToMomentLocale[obsidianLang];\n if (localeOverride !== \"system-default\") {\n momentLocale = localeOverride;\n }\n else if (systemLang.startsWith(obsidianLang)) {\n // If the system locale is more specific (en-gb vs en), use the system locale.\n momentLocale = systemLang;\n }\n const currentLocale = window.moment.locale(momentLocale);\n console.debug(`[Calendar] Trying to switch Moment.js global locale to ${momentLocale}, got ${currentLocale}`);\n overrideGlobalMomentWeekStart(weekStart);\n return currentLocale;\n}", "title": "" }, { "docid": "73d22ab8f995621a741e2135a4ca6d40", "score": "0.6096749", "text": "function getSetGlobalLocale(key, values) {\n\t var data;\n\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t } else {\n\t data = defineLocale(key, values);\n\t }\n\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t } else {\n\t if (typeof console !== 'undefined' && console.warn) {\n\t //warn user if arguments are passed but the locale could not be set\n\t console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n\t }\n\t }\n\t }\n\n\t return globalLocale._abbr;\n\t }", "title": "" }, { "docid": "20c04ccea0a22e09f4c67e63cd045b45", "score": "0.6094649", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n }", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "d78e40e4c179feb443dc862e37dfc94c", "score": "0.60929024", "text": "function getSetGlobalLocale (key, values) {\n\t var data;\n\t if (key) {\n\t if (isUndefined(values)) {\n\t data = getLocale(key);\n\t }\n\t else {\n\t data = defineLocale(key, values);\n\t }\n\t\n\t if (data) {\n\t // moment.duration._locale = moment._locale = data;\n\t globalLocale = data;\n\t }\n\t }\n\t\n\t return globalLocale._abbr;\n\t}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "e2a7564a9c663b294087790912e16fb4", "score": "0.60782045", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n else {\n if ((typeof console !== 'undefined') && console.warn) {\n //warn user if arguments are passed but the locale could not be set\n console.warn('Locale ' + key + ' not found. Did you forget to load it?');\n }\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" }, { "docid": "813d721eb66e5ce45a251a61322ae26f", "score": "0.6073029", "text": "function getSetGlobalLocale (key, values) {\n var data;\n if (key) {\n if (isUndefined(values)) {\n data = getLocale(key);\n }\n else {\n data = defineLocale(key, values);\n }\n\n if (data) {\n // moment.duration._locale = moment._locale = data;\n globalLocale = data;\n }\n }\n\n return globalLocale._abbr;\n}", "title": "" } ]
d0fd328c101e594361d9a0b73aa69fb2
Removes tags from text
[ { "docid": "f70dfbdbf5352d7c243bf7cba1c11d65", "score": "0.8275151", "text": "function removeTags(text) {\n return text ? text.replace(tagsRegex, \"\") : text;\n}", "title": "" } ]
[ { "docid": "b2a6b7d0bb4d5a532e9a14424b8086d4", "score": "0.7913194", "text": "function removeAllTags(txt) {\r\n\tvar strTagStrippedText = txt.replace(/<\\/?[^>]+(>|$)/g, \"\");\r\n\treturn strTagStrippedText;\r\n}", "title": "" }, { "docid": "83c80a7c971c356327673330da25f36a", "score": "0.77282774", "text": "function stripTags(text) {\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\n}", "title": "" }, { "docid": "fdf0558aa637fe2af038f9915eed9fad", "score": "0.73257273", "text": "function cleanTagText(text) {\n return text.replace(/^\\s+/, '').replace(/,/g, ' ').replace(/\\s+/g, ' ').replace(/\\s+$/, '');\n }", "title": "" }, { "docid": "a1d203bd8264b44eba895891045eb5fc", "score": "0.71184784", "text": "function stripTags() {\n return this.replace(/<\\w+(\\s+(\"[^\"]*\"|'[^']*'|[^>])+)?>|<\\/\\w+>/gi, '');\n }", "title": "" }, { "docid": "a1d203bd8264b44eba895891045eb5fc", "score": "0.71184784", "text": "function stripTags() {\n return this.replace(/<\\w+(\\s+(\"[^\"]*\"|'[^']*'|[^>])+)?>|<\\/\\w+>/gi, '');\n }", "title": "" }, { "docid": "d255ffdbe5e5d6ff2c7745f83365b614", "score": "0.70727056", "text": "function removeTags(str) {\r\n\tif (str) {\r\n\t\treturn str.replace(/<(?:.|\\n)*?>/gm, '');\r\n\t}\r\n}", "title": "" }, { "docid": "f8b763c6b59d3c4dfb0277d26e8f09dc", "score": "0.70380634", "text": "function removeTags(str) {\n if (str) {\n return str.replace(/<(?:.|\\n)*?>/gm, '');\n }\n}", "title": "" }, { "docid": "e8044f6ed6544476c813f1144a2d11a4", "score": "0.7012609", "text": "function strip_tags(html){\n\treturn html.replace(/<(?:.|\\n)*?>/gm, '');\n}", "title": "" }, { "docid": "e54a0bbad6fd2f013ba68bb177ee8261", "score": "0.68073374", "text": "function clean(text){\n\tvar tmp = text;\n\t// Remove different HTML tags\n\ttmp = tmp.replaceAll(\"\\n\", \"\");\n\ttmp = tmp.replaceAll(\" \", \" \");\n\ttmp = tmp.replaceAll(\"<p>\", \"\");\n\ttmp = tmp.replaceAll(\"<code>\", \"\");\n\ttmp = tmp.replaceAll(\"</code>\", \"\");\n\n\t// Create double line break after each paragraph\n\ttmp = tmp.replaceAll(\"</p>\", \"\\n\\n\");\n\n\t// Trim spaces\n\tvar a = tmp.split(\"\\n\\n\");\n\tvar b = [];\n\tfor(var i = 0; i < a.length; i++){\n\t\tb.push(a[i].trim());\n\t}\n\n\t// Remove ending double linebreak and return\n\treturn b.join(\"\\n\\n\").replace(/\\n\\n$/, \"\");\n}", "title": "" }, { "docid": "2ece4bd107f3ef64ddb85672997095de", "score": "0.66891605", "text": "function stripTag(input) {\n input = input.toString();\n return input.replace(/(<([^>]+)>)/ig, \"\");\n}", "title": "" }, { "docid": "1970e6ba68c1eea22c29fa90277ccc20", "score": "0.6688428", "text": "removeTags(html) {\n var tagBody = '(?:[^\"\\'>]|\"[^\"]*\"|\\'[^\\']*\\')*';\n\n var tagOrComment = new RegExp(\n '<(?:'\n // Comment body.\n + '!--(?:(?:-*[^->])*--+|-?)'\n // Special \"raw text\" elements whose content should be elided.\n + '|script\\\\b' + tagBody + '>[\\\\s\\\\S]*?</script\\\\s*'\n + '|style\\\\b' + tagBody + '>[\\\\s\\\\S]*?</style\\\\s*'\n // Regular name\n + '|/?[a-z]'\n + tagBody\n + ')>',\n 'gi');\n\n var oldHtml;\n do {\n oldHtml = html;\n html = html.replace(tagOrComment, '');\n } while (html !== oldHtml);\n return html.replace(/</g, '&lt;');\n }", "title": "" }, { "docid": "c10f439642206ebb2b371d40f0945e10", "score": "0.6616748", "text": "function stripTags (str) {\n\treturn str.replace(/<(?:.|\\n)*?>/gm, '').replace(/[ \\t\\n]+/gm, ' ');\n}", "title": "" }, { "docid": "b1144886368d2df01548b0f57a882f92", "score": "0.66120416", "text": "function stripHTML(text){\r\n\tvar strippedText = text.replace(/<br>/ig, '\\n');\r\n\tstrippedText = strippedText.replace(/<br\\/>/ig, '\\n');\r\n\tstrippedText = strippedText.replace(/&lt\\;/ig, '<');\r\n\tstrippedText = strippedText.replace(/&gt\\;/ig, '>');\r\n\tstrippedText = strippedText.replace(/&amp\\;/ig, '&');\r\n\tstrippedText = strippedText.replace(/&nbsp\\;/ig, ' ');\r\n\treturn strippedText.replace(/<\\/?[^>]+(>|$)/g, \"\");\t\r\n}", "title": "" }, { "docid": "4bde7e60e8691ec6760d06538b78134f", "score": "0.6565785", "text": "function removeHTMLTags(str){\n str = str.replace(/&(lt|gt);/g, function (strMatch, p1) {\n return (p1 === \"lt\") ? \"<\" : \">\";\n });\n var strTagStrippedText = str.replace(/<\\/?[^>]+(>|$)/g, \"\");\n strTagStrippedText = strTagStrippedText.replace(/&nbsp;/g,\"\");\n return strTagStrippedText.trim();\n}", "title": "" }, { "docid": "982936c8abcd6281007c84c17ee39c90", "score": "0.65640986", "text": "function removeTag(htmlContent) {\n\tvar regex = /(<([^>]+)>)/ig;\n\tvar result = htmlContent.replace(regex, \"\");\n\treturn result;\n}", "title": "" }, { "docid": "fe5ab9b801ee5b55635bb64d20ad40c9", "score": "0.6562346", "text": "function stripSpeechTags(string) {\n return string.replace(/<[^>.*]+>|<\\/.*[^>.*]+>/ig, '')\n}", "title": "" }, { "docid": "944edb7cf0ce200169a1b887548e6d03", "score": "0.6497545", "text": "function stripTags (str) {\n return str.replace(/<\\/?\\w+((\\s+\\w+(\\s*=\\s*(?:\".*?\"|'.*?'|[^'\">\\s]+))?)+\\s*|\\s*)\\/?>/g, '').trim();\n}", "title": "" }, { "docid": "6523febcec6ac5dc261d4051d1ee5833", "score": "0.6432949", "text": "function strip_tags(str, allowed_tags) {\r\n // http://kevin.vanzonneveld.net\r\n // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + improved by: Luke Godfrey\r\n // + input by: Pul\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + bugfixed by: Onno Marsman\r\n // + input by: Alex\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + input by: Marc Palau\r\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + input by: Brett Zamir (http://brettz9.blogspot.com)\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // + bugfixed by: Eric Nagel\r\n // + input by: Bobby Drake\r\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\r\n // * example 1: strip_tags('<p>Kevin</p> <br /><b>van</b> <i>Zonneveld</i>', '<i><b>');\r\n // * returns 1: 'Kevin <b>van</b> <i>Zonneveld</i>'\r\n // * example 2: strip_tags('<p>Kevin <img src=\"someimage.png\" onmouseover=\"someFunction()\">van <i>Zonneveld</i></p>', '<p>');\r\n // * returns 2: '<p>Kevin van Zonneveld</p>'\r\n // * example 3: strip_tags(\"<a href='http://kevin.vanzonneveld.net'>Kevin van Zonneveld</a>\", \"<a>\");\r\n // * returns 3: '<a href='http://kevin.vanzonneveld.net'>Kevin van Zonneveld</a>'\r\n // * example 4: strip_tags('1 < 5 5 > 1');\r\n // * returns 4: '1 < 5 5 > 1'\r\n \r\n var key = '', allowed = false;\r\n var matches = [];\r\n var allowed_array = [];\r\n var allowed_tag = '';\r\n var i = 0;\r\n var k = '';\r\n var html = '';\r\n \r\n var replacer = function(search, replace, str) {\r\n return str.split(search).join(replace);\r\n };\r\n \r\n // Build allowes tags associative array\r\n if (allowed_tags) {\r\n allowed_array = allowed_tags.match(/([a-zA-Z]+)/gi);\r\n }\r\n \r\n str += '';\r\n \r\n // Match tags\r\n matches = str.match(/(<\\/?[\\S][^>]*>)/gi);\r\n \r\n // Go through all HTML tags\r\n for (key in matches) {\r\n if (isNaN(key)) {\r\n // IE7 Hack\r\n continue;\r\n }\r\n \r\n // Save HTML tag\r\n html = matches[key].toString();\r\n \r\n // Is tag not in allowed list? Remove from str!\r\n allowed = false;\r\n \r\n // Go through all allowed tags\r\n for (k in allowed_array) {\r\n // Init\r\n allowed_tag = allowed_array[k];\r\n i = -1;\r\n \r\n if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+'>');}\r\n if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+' ');}\r\n if (i != 0) { i = html.toLowerCase().indexOf('</'+allowed_tag) ;}\r\n \r\n // Determine\r\n if (i == 0) {\r\n allowed = true;\r\n break;\r\n }\r\n }\r\n \r\n if (!allowed) {\r\n str = replacer(html, \"\", str); // Custom replace. No regexing\r\n }\r\n }\r\n \r\n return str;\r\n}", "title": "" }, { "docid": "39cb83e268789a3d740ab561058332d1", "score": "0.6430804", "text": "function plainText(text) {\n return text ? stripTags(text.replace(/[\\n\\r]+/g, \". \")) : text;\n}", "title": "" }, { "docid": "ff9e0b299c6088286f66f496b89ac074", "score": "0.6429046", "text": "function cleanBody(str){\n\tvar tags = [\"a\", \"ul\", \"li\", \"strong\"]\n\tfor (var i in tags){\n\t var rx = new RegExp(\"<\" + tags[i] + \"[^>]\\+>\", 'g')\n\t\tstr = str.replace(rx, \"\")\n\t}\n\treturn str\n}", "title": "" }, { "docid": "671b9cc6b88d813aba5d6aed40fe79bc", "score": "0.6423797", "text": "function strip_tags (str, allowed_tags)\n{\n\n var key = '', allowed = false;\n var matches = []; var allowed_array = [];\n var allowed_tag = '';\n var i = 0;\n var k = '';\n var html = ''; \n var replacer = function (search, replace, str) {\n return str.split(search).join(replace);\n };\n // Build allowes tags associative array\n if (allowed_tags) {\n allowed_array = allowed_tags.match(/([a-zA-Z0-9]+)/gi);\n }\n str += '';\n\n // Match tags\n matches = str.match(/(<\\/?[\\S][^>]*>)/gi);\n // Go through all HTML tags\n for (key in matches) {\n if (isNaN(key)) {\n // IE7 Hack\n continue;\n }\n\n // Save HTML tag\n html = matches[key].toString();\n // Is tag not in allowed list? Remove from str!\n allowed = false;\n\n // Go through all allowed tags\n for (k in allowed_array) { // Init\n allowed_tag = allowed_array[k];\n i = -1;\n\n if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+'>');}\n if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+' ');}\n if (i != 0) { i = html.toLowerCase().indexOf('</'+allowed_tag) ;}\n\n // Determine\n if (i == 0) { allowed = true;\n break;\n }\n }\n if (!allowed) {\n str = replacer(html, \"\", str); // Custom replace. No regexing\n }\n }\n return str;\n}", "title": "" }, { "docid": "6623574b4b610814c88746bfee63ebf5", "score": "0.64137083", "text": "function removeHTMLTags(strInputCode){\n /* \n This line is optional, it replaces escaped brackets with real ones, \n i.e. < is replaced with < and > is replaced with >\n */\t\n strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){\n return (p1 == \"lt\")? \"<\" : \">\";\n });\n var strTagStrippedText = strInputCode.replace(/<\\/?[^>]+(>|$)/g, \"\");\n return strTagStrippedText;\n}", "title": "" }, { "docid": "53538591964148832a9df84bf6fb87b0", "score": "0.6357475", "text": "function force_balance_tags( $text ) {\n $tagstack = array();\n $stacksize = 0;\n $tagqueue = '';\n $newtext = '';\n // Known single-entity/self-closing tags\n $single_tags = array( 'area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source' );\n // Tags that can be immediately nested within themselves\n $nestable_tags = array( 'blockquote', 'div', 'object', 'q', 'span' );\n \n // WP bug fix for comments - in case you REALLY meant to type '< !--'\n $text = str_replace('< !--', '< !--', $text);\n // WP bug fix for LOVE <3 (and other situations with '<' before a number)\n $text = preg_replace('#<([0-9]{1})#', '&lt;$1', $text);\n \n while ( preg_match(\"/<(\\/?[\\w:]*)\\s*([^>]*)>/\", $text, $regex) ) {\n $newtext .= $tagqueue;\n \n $i = strpos($text, $regex[0]);\n $l = strlen($regex[0]);\n \n // clear the shifter\n $tagqueue = '';\n // Pop or Push\n if ( isset($regex[1][0]) && '/' == $regex[1][0] ) { // End Tag\n $tag = strtolower(substr($regex[1],1));\n // if too many closing tags\n if( $stacksize <= 0 ) {\n $tag = '';\n // or close to be safe $tag = '/' . $tag;\n }\n // if stacktop value = tag close value then pop\n else if ( $tagstack[$stacksize - 1] == $tag ) { // found closing tag\n $tag = '</' . $tag . '>'; // Close Tag\n // Pop\n array_pop( $tagstack );\n $stacksize--;\n } else { // closing tag not at top, search for it\n for ( $j = $stacksize-1; $j >= 0; $j-- ) {\n if ( $tagstack[$j] == $tag ) {\n // add tag to tagqueue\n for ( $k = $stacksize-1; $k >= $j; $k--) {\n $tagqueue .= '</' . array_pop( $tagstack ) . '>';\n $stacksize--;\n }\n break;\n }\n }\n $tag = '';\n }\n } else { // Begin Tag\n $tag = strtolower($regex[1]);\n \n // Tag Cleaning\n \n // If it's an empty tag \"< >\", do nothing\n if ( '' == $tag ) {\n // do nothing\n }\n // ElseIf it presents itself as a self-closing tag...\n elseif ( substr( $regex[2], -1 ) == '/' ) {\n // ...but it isn't a known single-entity self-closing tag, then don't let it be treated as such and\n // immediately close it with a closing tag (the tag will encapsulate no text as a result)\n if ( ! in_array( $tag, $single_tags ) )\n $regex[2] = trim( substr( $regex[2], 0, -1 ) ) . \"></$tag\";\n }\n // ElseIf it's a known single-entity tag but it doesn't close itself, do so\n elseif ( in_array($tag, $single_tags) ) {\n $regex[2] .= '/';\n }\n // Else it's not a single-entity tag\n else {\n // If the top of the stack is the same as the tag we want to push, close previous tag\n if ( $stacksize > 0 && !in_array($tag, $nestable_tags) && $tagstack[$stacksize - 1] == $tag ) {\n $tagqueue = '</' . array_pop( $tagstack ) . '>';\n $stacksize--;\n }\n $stacksize = array_push( $tagstack, $tag );\n }\n \n // Attributes\n $attributes = $regex[2];\n if( ! empty( $attributes ) && $attributes[0] != '>' )\n $attributes = ' ' . $attributes;\n \n $tag = '<' . $tag . $attributes . '>';\n //If already queuing a close tag, then put this tag on, too\n if ( !empty($tagqueue) ) {\n $tagqueue .= $tag;\n $tag = '';\n }\n }\n $newtext .= substr($text, 0, $i) . $tag;\n $text = substr($text, $i + $l);\n }\n \n // Clear Tag Queue\n $newtext .= $tagqueue;\n \n // Add Remaining text\n $newtext .= $text;\n \n // Empty Stack\n while( $x = array_pop($tagstack) )\n $newtext .= '</' . $x . '>'; // Add remaining tags to close\n \n // WP fix for the bug with HTML comments\n $newtext = str_replace(\"< !--\",\"<!--\",$newtext);\n $newtext = str_replace(\"< !--\",\"< !--\",$newtext);\n \n return $newtext;\n }", "title": "" }, { "docid": "35c659455e00a6af53247cba73292829", "score": "0.6304904", "text": "function strip_tags (str, allowed_tags)\n\t{\n\n\t var key = '', allowed = false;\n\t var matches = []; var allowed_array = [];\n\t var allowed_tag = '';\n\t var i = 0;\n\t var k = '';\n\t var html = ''; \n\t var replacer = function (search, replace, str) {\n\t return str.split(search).join(replace);\n\t };\n\t // Build allowes tags associative array\n\t if (allowed_tags) {\n\t allowed_array = allowed_tags.match(/([a-zA-Z0-9]+)/gi);\n\t }\n\t str += '';\n\n\t // Match tags\n\t matches = str.match(/(<\\/?[\\S][^>]*>)/gi);\n\t // Go through all HTML tags\n\t for (key in matches) {\n\t if (isNaN(key)) {\n\t // IE7 Hack\n\t continue;\n\t }\n\n\t // Save HTML tag\n\t html = matches[key].toString();\n\t // Is tag not in allowed list? Remove from str!\n\t allowed = false;\n\n\t // Go through all allowed tags\n\t for (k in allowed_array) { // Init\n\t allowed_tag = allowed_array[k];\n\t i = -1;\n\n\t if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+'>');}\n\t if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+' ');}\n\t if (i != 0) { i = html.toLowerCase().indexOf('</'+allowed_tag) ;}\n\n\t // Determine\n\t if (i == 0) { allowed = true;\n\t break;\n\t }\n\t }\n\t if (!allowed) {\n\t str = replacer(html, \"\", str); // Custom replace. No regexing\n\t }\n\t }\n\t return str;\n\t}", "title": "" }, { "docid": "a5ae6e3fcee59d66996dda35a9acebf7", "score": "0.6297088", "text": "function wp_strip_all_tags($string, $remove_breaks = false) {\n $string = preg_replace( '@<(script|style)[^>]*?>.*?</\\\\1>@si', '', $string );\n $string = strip_tags($string);\n \n if ( $remove_breaks )\n $string = preg_replace('/[\\r\\n\\t ]+/', ' ', $string);\n \n return trim( $string );\n }", "title": "" }, { "docid": "a002c6445dc253767ce3cb1d7112f654", "score": "0.62783706", "text": "function extractContent(text) {\n var regex = /(<\\/?[a-z]+>)/g;\n return text.replace(regex, '');\n}", "title": "" }, { "docid": "230dbb5637ba7cfb4629fc21e48da341", "score": "0.62618536", "text": "function pmcond_stripTags(string) {\n\tvar matchTag = /<(?:.|\\s)*?>/g;\n\treturn string.replace(matchTag, \"\");\n}", "title": "" }, { "docid": "7c5fdea371eeb80b16f6ff4435b24b5d", "score": "0.62515366", "text": "function strip_tags (str, allowed_tags) {\n\tvar key = '', allowed = false;\n\tvar matches = [];\n\tvar allowed_array = [];\n\tvar allowed_tag = '';\n\tvar i = 0;\n\tvar k = '';\n\tvar html = '';\n\tvar replacer = function (search, replace, str) {\n\t\treturn str.split(search).join(replace);\n\t}\n\t;\n\t// Build allowes tags associative array\n\tif (allowed_tags) {\n\t\tallowed_array = allowed_tags.match(/([a-zA-Z0-9]+)/gi);\n\t}\n\tstr += '';\n\t// Match tags\n\tmatches = str.match(/(<\\/?[\\S][^>]*>)/gi);\n\t// Go through all HTML tags\n\tfor (key in matches) {\n\t\tif (isNaN(key)) {\n\t\t\t// IE7 Hack\n\t\t\tcontinue;\n\t\t}\n\t\t// Save HTML tag\n\t\thtml = matches[key].toString();\n\t\t// Is tag not in allowed list? Remove from str!\n\t\tallowed = false;\n\t\t// Go through all allowed tags\n\t\tfor (k in allowed_array) {\n\t\t\t// Init\n\t\t\tallowed_tag = allowed_array[k];\n\t\t\ti = -1;\n\t\t\tif (i != 0) {\n\t\t\t\ti = html.toLowerCase().indexOf('<'+allowed_tag+'>');\n\t\t\t}\n\t\t\tif (i != 0) {\n\t\t\t\ti = html.toLowerCase().indexOf('<'+allowed_tag+' ');\n\t\t\t}\n\t\t\tif (i != 0) {\n\t\t\t\ti = html.toLowerCase().indexOf('</'+allowed_tag) ;\n\t\t\t}\n\t\t\t// Determine\n\t\t\tif (i == 0) {\n\t\t\t\tallowed = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!allowed) {\n\t\t\tstr = replacer(html, \"\", str);\n\t\t\t// Custom replace. No regexing\n\t\t}\n\t}\n\treturn str;\n}", "title": "" }, { "docid": "c2cf325a82337db3daf052335907f5cd", "score": "0.6241726", "text": "function dungStripTags(str) {\r\n\treturn str.replace(/\\<[^>]+\\>/g, '');\r\n}", "title": "" }, { "docid": "54245de93a07eba71d9f69e71a0d4811", "score": "0.6233205", "text": "function unprocess(tagContent) {\r\n return tagContent.replace(/<bbcl=[0-9]+ \\/\\*>/gi,\"\").replace(/<bbcl=[0-9]+ /gi,\"&#91;\").replace(/>/gi,\"&#93;\");\r\n }", "title": "" }, { "docid": "f69325de9d5605d9a15d639d45e9b0fa", "score": "0.6223287", "text": "function removeBadTags(html) {\r\n return html.replace(blacklist, '');\r\n }", "title": "" }, { "docid": "f3033821857b9cf928da9cbc4de5e662", "score": "0.6221997", "text": "function html_tag_remove(strhtml, strtag) {\r\n if (strtag) {\r\n igaz = 1;\r\n while (igaz) {\r\n kif = new RegExp('<' + strtag, 'i');\r\n out = strhtml.match(kif);\r\n if (out) {\r\n posele = strhtml.indexOf(out);\r\n } else {\r\n posele = -1;\r\n }\r\n kif = new RegExp('</' + strtag + '>', 'i');\r\n out = strhtml.match(kif);\r\n if (out) {\r\n posveg = strhtml.indexOf(out);\r\n } else {\r\n posveg = -1;\r\n }\r\n if (posele >= 0 && posveg >= 0 && posveg > posele) {\r\n strhtml = strhtml.substring(0, posele) + strhtml.substring(posveg + 3 + strtag.length);\r\n } else {\r\n igaz = 0;\r\n }\r\n }\r\n return strhtml;\r\n }\r\n}", "title": "" }, { "docid": "c40d39afb770a465efca299fd0914a64", "score": "0.6210461", "text": "function removeHTMLTag(str) {\n\tstr = str.replace(/(^\\s*)|(\\s*$)/g,\"\"); //去除首尾空白\n\tstr = str.replace(/<\\/?[^>]*>/g,''); //去除HTML tag\n\tstr = str.replace(/[ | ]*\\n/g,'\\n'); //去除行尾空白\n\t//str = str.replace(/\\n[\\s| | ]*\\r/g,'\\n'); //去除多余空行\n\t//str=str.replace(/&nbsp;/ig,'');//去掉&nbsp;\n\treturn str;\n}", "title": "" }, { "docid": "48f61e53b05474e3705ace5b25a676a2", "score": "0.61780584", "text": "function html_singletag_remove(strhtml, strtag) {\r\n if (strtag) {\r\n igaz = 1;\r\n while (igaz) {\r\n kif = new RegExp('<' + strtag, 'i');\r\n out = strhtml.match(kif);\r\n if (out) {\r\n posele = strhtml.indexOf(out);\r\n } else {\r\n posele = -1;\r\n }\r\n kif = new RegExp('>', 'i');\r\n out = strhtml.match(kif);\r\n if (out) {\r\n posveg = strhtml.indexOf(out, posele);\r\n } else {\r\n posveg = -1;\r\n }\r\n if (posele >= 0 && posveg >= 0 && posveg > posele) {\r\n strhtml = strhtml.substring(0, posele) + strhtml.substring(posveg + 1);\r\n } else {\r\n igaz = 0;\r\n }\r\n }\r\n return strhtml;\r\n }\r\n}", "title": "" }, { "docid": "7697fe5cfebb3fb0478f1d9d5b5061fb", "score": "0.6176634", "text": "function strip_tags (input, allowed) {\n allowed = (((allowed || \"\") + \"\").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi, commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {\n return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n });\n }", "title": "" }, { "docid": "eb4478e9a6de83beb3fd5756a1260085", "score": "0.615714", "text": "function removeRedundantText(node) {\n\t_removeNodeNameRecursively(node, \"#text\");\n}", "title": "" }, { "docid": "efe97e39477e7013f0664adfdf2ff2c4", "score": "0.61245716", "text": "function strip_tags(input, allowed) {\n\tallowed = (((allowed || \"\") + \"\")\n\t\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t\t.match(/<[a-z][a-z0-9]*>/g) || [])\n\t.join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n\tvar tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi,\n\t\t\tcommentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n\treturn input.replace(commentsAndPhpTags, '').replace(tags, function($0, $1){\n\t\treturn allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n\t});\n}", "title": "" }, { "docid": "7e4b12a81bb4dffd5c4f336f8ec168d1", "score": "0.61067355", "text": "function strip_tags(input, allowed) {\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi,\n commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n \n // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n allowed = (((allowed || \"\") + \"\").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');\n \n return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {\n return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n });\n }", "title": "" }, { "docid": "bec701541c67fd976785fb74ff50639c", "score": "0.61041325", "text": "parse(value) {\n // First we find all possible tags within the text\n const tags = findTags(value);\n // For each found text tag, we're parsing and rendering them while replacing the text tag with the HTML representation if applicable\n tags.forEach((tag) => value = replaceAll(value, tag, this.renderTag(this.parseTag(tag))));\n return value\n }", "title": "" }, { "docid": "2385536bcc43d0467a6f114a943b6e72", "score": "0.60892755", "text": "function strip_tags(input, allowed) {\n // Taken from: http://phpjs.org/functions/strip_tags/\n allowed = (((allowed || '') + '')\n .toLowerCase()\n .match(/<[a-z][a-z0-9]*>/g) || [])\n .join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi,\n commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n return input.replace(commentsAndPhpTags, ' ')\n .replace(tags, function($0, $1) {\n return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ' ';\n });\n }", "title": "" }, { "docid": "88c8148d4ea77766507c6ffc4b447584", "score": "0.6081917", "text": "function stripHtml(str, htmlTags, merge){\n\t\n\t\tif ( !str.match(/<[a-zA-Z][^>]*>/) ) return str;\n\t\n\t\t// Get rid of pesky MS Word markup. eradicate it.\n\t\tvar oldStr = str;\n\t\tstr = str//.replace(/<!--.*?-->/mg, '')\n\t\t\t.replace(/<w:[^>]*?>/mg, '')\n\t\t\t.replace(/<\\/w:[^>]*?>/mg, '')\n\t\t\t.replace(/<m:[^>]*?>/mg, '')\n\t\t\t.replace(/<\\/m:[^>]*?>/mg, '')\n\t\t\t.replace(/<xml[^>]*?>/mg, '')\n\t\t\t.replace(/<\\/xml[^>]*?>/mg, '')\n\t\t\t.replace(/<link[^>]*?>/mg, '')\n\t\t\t.replace(/<meta [^>]*?>/mg, '')\n\t\t\t.replace(/<([^>]+)src=([^>]+)>/mg, '<$1src_disabled=$2>')\n\t\t\t;\n\t\t//if (str != oldStr ) alert(str+\"\\nvs\\n\"+oldStr);\n\t\tvar dummyDiv = document.createElement('div');\n\t\tif ( !merge) str = $(dummyDiv).html(str).html();\n\t\tif ( typeof(merge) == 'undefined' ) merge = false;\n\t\tvar usedTags = {}; // Keep track of which tags we have used in the merge\n\t\t\t\t\t\t\t// We use this at the end to see if we missed any, and\n\t\t\t\t\t\t\t// throw an error.\n\t\tvar id=1;\n\t\tvar tagStack = [];\n\t\t\n\t\tvar out = '';\n\t\tfor ( var i=0; i<str.length; i++){\n\t\t\tvar ch = str.charAt(i);\n\t\t\tif ( ch == '<' ){\n\t\t\t\t\n\t\t\t\tvar tagStr = str.substring(i, str.indexOf('>', i));\n\t\t\t\tif ( tagStr.length >= 4 && tagStr.substring(0,4) == '<!--'){\n\t\t\t\t\tvar closeComment = str.indexOf('-->', i);\n\t\t\t\t\tif ( closeComment < 0 ) closeComment = str.length;\n\t\t\t\t\ti = closeComment+2;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//alert(tagStr);\n\t\t\t\tvar tagName = '';\n\t\t\t\tif ( tagStr.charAt(1) == '/' ){\n\t\t\t\t\t// we have a closing tag\n\t\t\t\t\ttagName = tagStr.substring(2, tagStr.length);\n\t\t\t\t\t//alert(tagName+'( '+tagStr+')');\n\t\t\t\t\t//alert(str);\n\t\t\t\t\t//alert(tagName);\n\t\t\t\t\tvar buffer = [];\n\t\t\t\t\twhile ( tagStack.length > 0 && tagStack[tagStack.length-1].tagName != tagName ){\n\t\t\t\t\t\tvar t = tagStack.pop();\n\t\t\t\t\t\tif ( t.type == 'tag' ) {\n\t\t\t\t\t\t\tif ( !merge ){\n\t\t\t\t\t\t\t\tbuffer.push('<x id=\"'+t.inlineID+'\"/>');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbuffer.push('<'+t.tagObj.tagContents+'>');\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\tbuffer.push(t.text);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//foo\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif ( tagStack.length == 0 ){\n\t\t\t\t\t\tthrow \"HTML Syntax Error: Closing tag </\"+tagName+\"> with no opening tag. (\"+str+\")\";\n\t\t\t\t\t\t\n\t\t\t\t\t\ttagStack.push({\n\t\t\t\t\t\t\ttype: 'tag',\n\t\t\t\t\t\t\tinlineID: id++,\n\t\t\t\t\t\t\t'tagName': tagName,\n\t\t\t\t\t\t\ttagContents: '<'+tagName+'>'\n\t\t\t\t\t\t});\n\t\t\t\t\t\t//tagStack.push(tagObj);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tvar o = '';\n\t\t\t\t\tvar currTag = tagStack.pop();\n\t\t\t\t\tvar tagChar = 'g';\n\t\t\t\t\tif ( currTag.isVariableTag ){\n\t\t\t\t\t\ttagChar = 'v';\n\t\t\t\t\t}\n\t\t\t\t\tif ( !merge) {\n\t\t\t\t\t\tif ( tagName != 'style' ){\n\t\t\t\t\t\t\to += '<'+tagChar+' id=\"'+currTag.inlineID+'\">';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\to += '<'+currTag.tagObj.tagContents+'>';\n\t\t\t\t\t}\n\t\t\t\t\twhile ( buffer.length > 0 ){\n\t\t\t\t\t\tif ( tagName != 'style' ) o += buffer.pop();\n\t\t\t\t\t\telse buffer.pop();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ( !merge ){\n\t\t\t\t\t\tif ( tagName != 'style' ) o += '</'+tagChar+'>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\to += '</'+currTag.tagObj.tagName+'>';\n\t\t\t\t\t}\n\t\t\t\t\ttagStack.push({\n\t\t\t\t\t\ttype: 'text',\n\t\t\t\t\t\ttext: o\n\t\t\t\t\t});\n\t\t\t\t\ti += tagStr.length;\n\t\t\t\t} else {\n\t\t\t\t\t// it's an open tag\n\t\t\t\t\tvar tagContents = tagStr.substring(1, tagStr.length);\n\t\t\t\t\t//alert('Contents: '+tagContents);\n\t\t\t\t\tif ( tagContents.indexOf(' ') != -1 ){\n\t\t\t\t\t\ttagName = tagContents.substring(0, tagContents.indexOf(' '));\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttagName = tagContents.replace(/\\//, '');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar isVariableTag = (tagName.toLowerCase() == 'v' || ( tagName.toLowerCase() == 'span' && tagContents.match(/data-swete-translate=/) ) );\n\t\t\t\t\t\n\t\t\t\t\tvar tagObj = {\n\t\t\t\t\t\ttype: 'tag',\n\t\t\t\t\t\tinlineID: id++,\n\t\t\t\t\t\ttagName: tagName,\n\t\t\t\t\t\ttagContents: tagContents,\n\t\t\t\t\t\tisVariableTag: isVariableTag\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tif ( merge ){\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar idpos = tagContents.indexOf(' id=\"')+5;\n\t\t\t\t\t\tif ( idpos < 5 ){\n\t\t\t\t\t\t\t//alert(\"No id in \"+tagContents);\n\t\t\t\t\t\t\t// there is no id attribute on this one.\n\t\t\t\t\t\t\t// so we stick with the original tagObj\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar tagID = parseInt(tagContents.substring(idpos, tagContents.indexOf('\"', idpos)));\n\t\t\t\t\t\t\tif ( htmlTags[tagID] ){\n\t\t\t\t\t\t\t\t//alert(\"Found html tag for \"+tagID);\n\t\t\t\t\t\t\t\ttagObj.tagObj = htmlTags[tagID];\n\t\t\t\t\t\t\t\tusedTags[tagID] = true;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//alert(\"No tag with id \"+tagID+\" found in \"+tagContents);\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\tif ( !merge ) htmlTags[tagObj.inlineID] = tagObj;\n\t\t\t\t\ttagStack.push(tagObj);\n\t\t\t\t\ti += tagStr.length;\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tvar tagObj = {\n\t\t\t\t\ttype: 'text',\n\t\t\t\t\ttext: str.substring(i, str.indexOf('<', i) >= 0 ? str.indexOf('<', i) : str.length)\n\t\t\t\t};\n\t\t\t\ti += tagObj.text.length-1;\n\t\t\t\tif ( !merge ) tagObj.text = $(dummyDiv).html(tagObj.text.replace(/\\s+/g, ' ')).text().replace(/</g,'&lt;').replace(/>/g, '&gt;');\n\t\t\t\telse tagObj.text = $(dummyDiv).html(tagObj.text).html();\n\t\t\t\ttagStack.push(tagObj);\n\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tvar buffer = [];\n\t\twhile ( tagStack.length > 0 ){\n\t\t\tvar t = tagStack.pop();\n\t\t\tif ( t.type == 'tag' ){\n\t\t\t\tif ( !merge) buffer.push('<x id=\"'+t.inlineID+'\"/>');\n\t\t\t\telse buffer.push('<'+t.tagObj.tagContents+'>');\n\t\t\t} else {\n\t\t\t\tbuffer.push(t.text);\n\t\t\t} \n\t\t\t\n\t\t}\n\t\t\n\t\twhile ( buffer.length > 0 ){\n\t\t\tout += buffer.pop();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn out.replace(/<([^>]+)src_disabled=([^>]+)>/mg, '<$1src=$2>');\n\t}", "title": "" }, { "docid": "9ea0e27d98277868cb6956a9ae2bb7a1", "score": "0.6077796", "text": "function kill_xml(wiki){\n //https://en.wikipedia.org/wiki/Help:HTML_in_wikitext\n //luckily, refs can't be recursive..\n wiki=wiki.replace(/<ref>[\\s\\S]{0,500}?<\\/ref>/gi,' ')// <ref></ref>\n wiki=wiki.replace(/<ref [^>]{0,200}?\\/>/gi,' ')// <ref name=\"\"/>\n wiki=wiki.replace(/<ref [^>]{0,200}?>[\\s\\S]{0,500}?<\\/ref>/ig,' ')// <ref name=\"\"></ref>\n //other types of xml that we want to trash completely\n\n wiki=wiki.replace(/< ?(table|code|score|data|categorytree|charinsert|gallery|hiero|imagemap|inputbox|math|nowiki|poem|references|source|syntaxhighlight|timeline) ?[^>]{0,200}?>[\\s\\S]{0,700}< ?\\/ ?(table|code|score|data|categorytree|charinsert|gallery|hiero|imagemap|inputbox|math|nowiki|poem|references|source|syntaxhighlight|timeline) ?>/gi,' ')// <table name=\"\"><tr>hi</tr></table>\n\n //some xml-like fragments we can also kill\n //\n wiki=wiki.replace(/< ?(ref|span|div|table|data) [a-z0-9=\" ]{2,20}\\/ ?>/g, \" \")//<ref name=\"asd\"/>\n //some formatting xml, we'll keep their insides though\n wiki=wiki.replace(/<[ \\/]?(p|sub|sup|span|nowiki|div|table|br|tr|td|th|pre|pre2|hr)[ \\/]?>/g, \" \")//<sub>, </sub>\n wiki=wiki.replace(/<[ \\/]?(abbr|bdi|bdo|blockquote|cite|del|dfn|em|i|ins|kbd|mark|q|s)[ \\/]?>/g, \" \")//<abbr>, </abbr>\n wiki=wiki.replace(/<[ \\/]?h[0-9][ \\/]?>/g, \" \")//<h2>, </h2>\n //a more generic + dangerous xml-tag removal\n wiki=wiki.replace(/<[ \\/]?[a-z0-9]{1,8}[ \\/]?>/g, \" \")//<samp>\n\n return wiki\n }", "title": "" }, { "docid": "f778ac2d2caa209dc15c92cc15ac8bc0", "score": "0.6055621", "text": "function cleanup_leftover_tags(template){\n return template.replace(/\\{\\{[\\s\\S]*?\\}\\}/g, \"\");\n}", "title": "" }, { "docid": "13b3649a26e394b651dd6e38e7bafba6", "score": "0.60520226", "text": "function cleanTags() {\n var tags = onix.tags;\n tags.forEach(function(tag){\n delete onix[tag];\n });\n}", "title": "" }, { "docid": "3becc1ea5039f81ab8a0728f17ef7c6e", "score": "0.60433424", "text": "function Ktml_logic_removeTag() {\n\t// for some cases of bad html resulted from style insertion on\n\t// IE an exception is thrown - promlem must be rezolved through\n\t// style insertion's improvment\n\n\ttry {\n\t\tif(this.selectableNodes && this.selectableNodes[0]) {\n\t\t\tvar tmpel = this.selectableNodes[0];\n\t\t} else {\n\t\t\tvar tmpel = this.logic_getSelectedNode();\n\t\t}\n\t\tif (tmpel.tagName != \"BODY\"\n\t\t\t&& tmpel.tagName != 'TD'\n\t\t\t&& tmpel.tagName != 'TR'\n\t\t\t&& tmpel.tagName != 'HR'\n\t\t\t&& tmpel.tagName != 'UL'\n\t\t\t&& tmpel.tagName != 'OL'\n\t\t\t&& tmpel.tagName != \"TABLE\"\n\t\t\t&& tmpel.tagName != \"TBODY\"\n\t\t\t&& tmpel.tagName != \"IMG\") {\n\t\t\ttmpel.outerHTML = tmpel.innerHTML;\n\t\t} else if (tmpel.tagName == \"TABLE\"\n\t\t\t|| tmpel.tagName == \"IMG\"\n\t\t\t|| tmpel.tagName == 'HR') {\n\t\t\tvar parentel, t;\n\t\t\tparentel = tmpel.parentElement;\n\t\t\tparentel.removeChild(tmpel);\n\t\t} else if(tmpel.tagName == 'OL' || tmpel.tagName == 'UL') {\n\t\t\tvar lis = tmpel.getElementsByTagName('LI');\n\t\t\tfor (var i=lis.length-1; i>=0; i--) {\n\t\t\t\tlis[i].outerHTML = lis[i].innerHTML + '<br/>';\n\t\t\t}\n\t\t\ttmpel.outerHTML = tmpel.innerHTML;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\t\tthis.cw.focus();\n\t\t//this.p_wait_displayChanged(this);\n\t\tthis.p_displayChanged();\n\t\tthis.undo.addEdit();\n\t} catch (e) {\n\t\t// do nothig with the error - sweep it under the rug\n\t}\n}", "title": "" }, { "docid": "4eb9ec6ea8fa103a2131e2aef61d7efc", "score": "0.60286987", "text": "function strip(text) {\n if (!text) {\n return '';\n }\n text = text.replace(/^\\s*<\\?xml(\\s)+version=[\\'\\\"](\\d)*.(\\d)*[\\'\\\"](\\s)*\\?>/im, '');\n let matches = text.match(/<body[^>]*>\\s*([\\s\\S]+)\\s*<\\/body>/im);\n text = matches ? matches[1] : text;\n return text;\n}", "title": "" }, { "docid": "a6902368ce36f2cab0ae7ce176e60343", "score": "0.6016531", "text": "function removeRedundantText(node) {\n _removeNodesRecursively(node, function(n, p) {return n.nodeName == \"#text\" && p.nodeName != \"value\" && p.nodeName != \"name\"});\n}", "title": "" }, { "docid": "2e1697e1a8c61d3f80fc50e02a575bc7", "score": "0.59967273", "text": "function _remove_tags($object, $tag){\n\t\tvar $elements = $object.getElementsByTagName($tag);\n\t\tvar $counter = $elements.length;\n\t\tfor (var $x=0; $x < $counter; $x++) {\n\t\t\t$elements[$x].parentNode.removeChild($elements[$x]);\n\t\t}\n\t}", "title": "" }, { "docid": "943e5655f1fa6a9c9f16a56348ca801a", "score": "0.59631217", "text": "function removeEmptyTags(html) {\n var i;\n var div = editor.o_doc.createElement('div');\n div.innerHTML = html; // Clean empty tags.\n\n var empty_tags = div.querySelectorAll(\"*:empty:not(td):not(th):not(tr):not(iframe):not(svg):not(\".concat(FroalaEditor.VOID_ELEMENTS.join('):not('), \"):not(\").concat(editor.opts.htmlAllowedEmptyTags.join('):not('), \")\"));\n\n while (empty_tags.length) {\n for (i = 0; i < empty_tags.length; i++) {\n empty_tags[i].parentNode.removeChild(empty_tags[i]);\n }\n\n empty_tags = div.querySelectorAll(\"*:empty:not(td):not(th):not(tr):not(iframe):not(svg):not(\".concat(FroalaEditor.VOID_ELEMENTS.join('):not('), \"):not(\").concat(editor.opts.htmlAllowedEmptyTags.join('):not('), \")\"));\n }\n\n return div.innerHTML;\n }", "title": "" }, { "docid": "3a33f37302f97beecd9161c8358cbcec", "score": "0.5955639", "text": "function removeHtml(html) {\r\n var output = '';\r\n output = html.replace(/<\\/?[a-z][a-z0-9]*[^<>]*>/ig, \"\");\r\n return output;\r\n}", "title": "" }, { "docid": "4af22676a06f129388827a02a078785e", "score": "0.5941845", "text": "function onIgnoreTagStripAll() {\n return \"\";\n}", "title": "" }, { "docid": "4af22676a06f129388827a02a078785e", "score": "0.5941845", "text": "function onIgnoreTagStripAll() {\n return \"\";\n}", "title": "" }, { "docid": "4af22676a06f129388827a02a078785e", "score": "0.5941845", "text": "function onIgnoreTagStripAll() {\n return \"\";\n}", "title": "" }, { "docid": "6e9ca535e82e06491aa43a6f95639e0a", "score": "0.5893945", "text": "function strip_html_tags(str)\n{\n\tif(str == '')\n\t\treturn '';\n\telse\n\t\tstr = str.toString();\n\treturn str.replace(/<[^>]*>/g , '');\n}", "title": "" }, { "docid": "389fbe8539f7f3e1936ebfd31808da68", "score": "0.5892679", "text": "function clearTags(){\n document.querySelectorAll('.tag').forEach(tag => {\n tag.parentElement.removeChild(tag);\n })\n}", "title": "" }, { "docid": "8957833f428288805b65c91df56b002a", "score": "0.5852284", "text": "function cleanWordPaste(in_word_text) {\r\n var tmp = document.createElement(\"DIV\");\r\n tmp.innerHTML = in_word_text;\r\n var newString = tmp.textContent || tmp.innerText;\r\n // this next piece converts line breaks into break tags\r\n // and removes the seemingly endless crap code\r\n newString = newString.replace(/\\n\\n/g, \"<br />\").replace(/.*<!--.*-->/g, \"\");\r\n // this next piece removes any break tags (up to 10) at beginning\r\n for (i = 0; i < 10; i++) {\r\n if (newString.substr(0, 6) == \"<br />\") {\r\n newString = newString.replace(\"<br />\", \"\");\r\n }\r\n }\r\n return newString;\r\n}", "title": "" }, { "docid": "a196301473aff24d410d46042fb123c1", "score": "0.5845139", "text": "function deleteSpans(current, text) {\n var innerHTML = text;\n var i = innerHTML.indexOf(current);\n var newI = -1;\n if (i >= 0) {\n innerHTML =\n innerHTML.substring(0, i) +\n \"\" +\n innerHTML.substring(innerHTML.indexOf(\">\", i) + 1);\n newI = innerHTML.indexOf(current, i);\n }\n while (newI > 0) {\n innerHTML =\n innerHTML.substring(0, newI) +\n \"\" +\n innerHTML.substring(innerHTML.indexOf(\">\", newI) + 1);\n i = newI;\n newI = innerHTML.indexOf(current, i);\n }\n return innerHTML;\n}", "title": "" }, { "docid": "f3d155b2d1fe5093eacbf34cb251f998", "score": "0.5843229", "text": "simpleTagReplacements(tag, data) {\n const wordTextNode = this.utilities.docxParser.containingTextNode(tag.xmlTextNode);\n const value = data.getScopeData();\n\n if (value && typeof value.xml === 'string') {\n const newNode = this.utilities.xmlParser.parse(value.xml);\n\n _xml.XmlNode.insertBefore(newNode, wordTextNode);\n }\n\n _xml.XmlNode.remove(wordTextNode);\n }", "title": "" }, { "docid": "3ef97e9f49c3ad626f73fa81f96a1a3c", "score": "0.5822607", "text": "function processText() {\n if (curText.indexOf(tags[0]) >= 0) {\n var parts = checkParsedString(parseString(curText, tags), sections), i = 0, part;\n while (i < parts.length) {\n part = parts[i++];\n if (part.type === \"text\")\n curFrag.appendChild(utils.newText(part.value));\n else {\n pushFragment();\n tokens.push(part);\n }\n }\n } else curFrag.appendChild(utils.newText(curText));\n curText = \"\";\n }", "title": "" }, { "docid": "89d854c5a0f82c6965c8420af9fac0b6", "score": "0.5822213", "text": "function stripTags(input, allowed) {\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi,\n commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n\n // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)\n allowed = (((allowed || \"\") + \"\").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');\n\n return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {\n return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n });\n}", "title": "" }, { "docid": "e51ba76b6d8591dbe8cc958545974154", "score": "0.5822189", "text": "function prune(){\n\t$('#textBody').children().each(function () {\n\t\t//If the line is empty and has a <br> element it's length is 2,\n\t\t//if any text is on the line the length is 3 and no <br> will be made.\n\t\tif(this.childNodes.length == 2){\n\t\t\tthis.removeChild(this.lastChild);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d7ef793f870d7befb381b1ba4b4d79da", "score": "0.5816704", "text": "function removeErrorMarkup(text) {\n var textWithMarkup = text.split(\"\\n\");\n var lines = textWithMarkup.map(lines_1.parseLine);\n var codeText = lines.filter(function (line) { return (line instanceof lines_1.CodeLine); }).map(function (line) { return line.contents; });\n return codeText.join(\"\\n\");\n}", "title": "" }, { "docid": "bdef6f27967641c4a06b5257b9796230", "score": "0.58150643", "text": "function strip_empty_tags(html) { return html.replace(/<[a-z1-6]+[^>]*>\\s*<\\/[a-z1-6]+>/g, ($0, $1) => { return !/<img/i.test($0) ? '' : $0; }); }", "title": "" }, { "docid": "2f689a042dbbbb0133b236e7c359a293", "score": "0.58150065", "text": "function extractHTMLText(html) {\n return html.split(/<.+?>/g).join('');\n}", "title": "" }, { "docid": "d195bea258ad8e22fe88ea0bb47ff28a", "score": "0.5813691", "text": "filterText(text) {\n if (text != \"\") {\n let firstDollar = text.indexOf(\"$\");\n let teXate = true;\n if (firstDollar == 0)\n teXate = false;\n let splittedText = text.split(\"$\");\n if (splittedText[0] == \"\")\n splittedText = splittedText.slice(1);\n text = \"\";\n for (let i = 0; i < splittedText.length; i++) {\n if (teXate) {\n splittedText[i] = \" \\\\text{ \" + splittedText[i].replace(/\\\\newline/g, \" } \\\\\\\\ \\\\text{ \") + \" } \";\n teXate = false;\n }\n else {\n teXate = true;\n }\n text += splittedText[i].replace(/\\\\newline/g, \" \\\\\\\\ \");\n }\n text = \" \\\\begin{gathered} \" + text + \" \\\\end{gathered} \";\n }\n return text;\n }", "title": "" }, { "docid": "c7f6e8ddced8e6c313925da5b8009757", "score": "0.581194", "text": "function stripHTML(str) {\n var HTMLRegex = /(<([^>]+)>)/ig;\n var nbspRegex = /&nbsp;/g;\n var spacesRegex = /\\s\\s+/g;\n //Would like to make use of the p (paragraph) tags that are in the html to distinguish break needs\n //Will be replacing both the p and /p with stars to split our strings into manageable parts\n var pRegex = /(<p>|<\\/p>)/g;\n return str.replace(pRegex, '*****').replace(HTMLRegex, ' ').replace(nbspRegex, ' ').replace(spacesRegex, ' ').split('*****').filter(function(item) {return item !== ''}).map(function(item){return item.trim()});\n}", "title": "" }, { "docid": "7ee2ad37e7b8482330cf3a78d2c668a6", "score": "0.58100015", "text": "strip_tags(...args) {\n return strip_tags(...args)\n }", "title": "" }, { "docid": "223f00838c2e3eb64acbd149d062fa2c", "score": "0.58084327", "text": "function parse_tags(code_block){\n // Wrap the standalone text in spans so they can be selected between the range of start and end tags using jQuery's nextUntil()\n code_block.find('code').contents().each(function(){\n if (!$(this).is('span')) {\n var newText = $(this).wrap('<span class=\"string\"></span>'); \n $(this).replaceWith(newText); \n }\n });\n\n // Remove the line numbers before the start/end tags and space between the line numbers and start/end tags\n code_block.find('span:contains(\"tag::\"), span:contains(\"end::\")').each(function(){\n var line_num = $(this).prevAll('.line-numbers').first();\n line_num.nextUntil($(this)).andSelf().remove();\n });\n\n // Parse the tags that should be hidden.\n var hideList;\n var classList = code_block[0].classList;\n for(var i=0; i < classList.length; i++){\n if(classList[i].indexOf('hide_tags=') > -1){\n hideList = classList[i].substring(10).split(',');\n break;\n }\n }\n\n var start_tags = code_block.find('span:contains(tag::)');\n var end_tags = code_block.find('span:contains(end::)');\n\n start_tags.each(function(){\n var text = $(this).text();\n var start_index = text.indexOf('tag::') + 5;\n var end_index = text.indexOf('[]');\n var tag_name = text.substring(start_index, end_index);\n var end = $(this).nextAll('span:contains(\"end::\" + tag_name + \"\")').first();\n var content = $(this).nextUntil(end);\n\n // Check if the tag should be hidden\n var hide = false;\n if(hideList){\n for(var i=0; i<hideList.length; i++){\n if(hideList.indexOf(tag_name) > -1){\n hide = true;\n break;\n }\n }\n } \n // If the tag is in the list of tags that should be hidden then hide it instead of just marking it.\n if(hide){\n content.remove();\n }\n else {\n // Mark the lines start to end with a data-tag so that the hotspot can highlight them.\n content.each(function(){\n // Check if element already has a tag.\n var tag = $(this).attr('data-hotspot-tag');\n if(tag){\n // Add a comma delimited list of tags so that nested tags can work.\n tag = tag + ',' + tag_name;\n $(this).attr('data-hotspot-tag', tag);\n }\n else {\n $(this).attr('data-hotspot-tag', tag_name);\n }\n });\n }\n });\n\n // Remove the whitespace after the start and end tags up until the next line number.\n start_tags.add(end_tags).each(function(){\n var next_line_num = $(this).nextAll('.line-numbers').first();\n if(next_line_num.length > 0){\n var empty_space = $(this).nextUntil(next_line_num);\n empty_space.remove();\n } \n });\n\n start_tags.remove();\n end_tags.remove();\n\n // Trim extra whitespace\n var code = code_block.find('code');\n code.html(code.html().trim());\n}", "title": "" }, { "docid": "0c471199c29763eec6c22d5ba396b813", "score": "0.578971", "text": "function cleanTags(tags) {\n //the corpus take only an array of string so I transform my data to take into consideration count\n var docs = [];\n var tag;\n var my_corpus = new tm.Corpus([]);\n var dictionarry;\n var dtm;\n for (var i = 0; i < tags.length; i++) {\n tag = tags[i];\n //This will ignore all words who have a count of 0\n //It is a bit of a waste of ressource but I figured it was worth it since it allows\n //to easily clean eveything\n for (var j = 0; j < tag.count; j++) {\n docs.push(tag.name);\n }\n }\n //Create the corpus and apply the cleaning\n //We could debate to remove or not stopwords\n //Let's be naive and believe that the community wouldn't vote too much for profanity names..\n my_corpus.addDocs(docs);\n my_corpus.trim().toLower();\n my_corpus.clean();\n //Not stemming while I don't implement the stemCompletion\n //before stemming we keep our dictionarry\n //dictionarry = my_corpus.documents;\n //my_corpus.stem(\"Porter\");\n //TODO retreive from dictionarry\n //my_corpus.retreive(dictionnary)\n\n //Create a document term matrix with term with frequencies not 0 and that have a threshold higher than the min\n //This allow to remove some irrelevant tag\n //The idea is that globally you can have a tag with low frequency that can be relevant.\n //However, locally (on the artist level), if your frequency is low it means\n //The comunity overall disagree and I assume that it is irrelevant\n dtm = new tm.Terms(my_corpus);\n //Remove sparse term call because it is not working at the moment\n //TODO fix it\n //dtm = dtm.removeSparseTermsFix(0.7).findFreqTerms(1);\n\n //As for testing now, I just use the frequencies that are gloablly high\n dtm = dtm.findFreqTerms(1);\n var result = [];\n dtm.map(function(obj) {\n result.push({\n name: obj.word,\n count: obj.count\n });\n });\n\n return result;\n\n\n\n }", "title": "" }, { "docid": "ca2f5d8af887466bea7d95b52d7b1d2d", "score": "0.5785035", "text": "function strip_html_tags(str) {\n if ((str===null) || (str===''))\n return false;\n else\n str = str.toString();\n return str.replace(/<[^>]*>/g, '');\n }", "title": "" }, { "docid": "b625c8c0e07ed680d06ff048eb9d959a", "score": "0.5773054", "text": "function removeArticles(input) {\n const articles = ['(the)', '(a )', '(in )', '(as )', '(an )', '(and )', '(, )'];\n const regex = new RegExp(articles.join('|'), 'gi');\n return input.replace(regex, ' ').\n trim().\n replace(/\\s\\s+/g, ' ');\n}", "title": "" }, { "docid": "b72089cac0063a730b34bf17565de8d3", "score": "0.57624644", "text": "function Ktml_logic_cleanTag(name) {\n\tif (Ktml_mozilla)return;\n\tvar rem = true;\n\tvar lists = this.edit.getElementsByTagName(name);\n\n\tfor (var i = 0; i< lists.length; i++) {\n\t\tvar kids = lists[i].childNodes;\n\t\tfor(var j=0; j<kids.length; j++) {\n\t\t\t// this should never throw anything yet it does\n\t\t\ttry {\n\t\t\t\trem = rem & (kids[i].nodeType == 3);\n\t\t\t}\n\t\t\tcatch(e) {\n\t\t\t\trem = rem & false;\n\t\t\t}\n\t\t}\n\t\tif (rem) {\n\t\t\tlists[i].parentNode.removeChild(lists[i]);\n\t\t}\n\t\trem = true;\n\t}\n\n}", "title": "" }, { "docid": "2938ac37a22b903953da2f665338446c", "score": "0.5761695", "text": "function removeText() {\n const textContainer = document.querySelector(\"#art-data\")\n while (textContainer.lastChild) {\n textContainer.removeChild(textContainer.lastChild)\n }\n}", "title": "" }, { "docid": "1e7b5627d5f660cce7d75eca184a5b32", "score": "0.5758787", "text": "function unescapeText(text) {\n\t var cleanedText = text;\n\n\t // Handling of line breaks:\n\t // In multiline text it's possible for the first line to render wrapped or unwrapped.\n\t // Line 1\n\t // Line 2\n\t // Can render as any of:\n\t // Line 1<div>Line 2</div>\n\t // Line 1<br><div>Line 2</div>\n\t // <div>Line 1</div><div>Line 2</div>\n\t //\n\t // Most blank lines are rendered as <div><br></div>\n\t // Line 1\n\t //\n\t // Line 3\n\t // Can render as any of:\n\t // Line 1<div><br></div><div>Line 3</div>\n\t // Line 1<br><div><br></div><div>Line 3</div>\n\t // <div>Line 1</div><div><br></div><div>Line 3</div>\n\t //\n\t // Leading blank lines render wrapped or as placeholder breaks and should be preserved\n\t //\n\t // Line 2\n\t // Renders as any of:\n\t // <br><div>Line 2</div>\n\t // <div><br></div><div>Line 2</div>\n\n\t // First, convert every <div> tag that isn't at the very beginning of the string\n\t // to a newline. This avoids generating an incorrect blank line at the start\n\t // if the first line is wrapped in a <div>.\n\t cleanedText = cleanedText.replace(/(?!^)<div[^>]*>/gi, '\\n');\n\n\t cleanedText = cleanedText.replace(/<[^>]+>/gi, ''); // Strip all other tags\n\t cleanedText = cleanedText.replace(/&nbsp;/gi, ' '); // Unescape nonbreaking spaces\n\t cleanedText = cleanedText.replace(/&gt;/gi, '>'); // Unescape >\n\t cleanedText = cleanedText.replace(/&lt;/gi, '<'); // Unescape <\n\t cleanedText = cleanedText.replace(/&amp;/gi, '&'); // Unescape & (must happen last!)\n\t return cleanedText;\n\t}", "title": "" }, { "docid": "11ecb0501d63aa4990a8d032e88170b5", "score": "0.5751806", "text": "function uutrimtag(source) { // @param String: \" <h1>A</h1> B <p>C</p> \"\n // @return String: \"A B C\"\n return uutrim(source[_replace](/<\\/?[^>]+>/g, \"\"));\n}", "title": "" }, { "docid": "45421e7f03802e7e992190f599281f3c", "score": "0.57448506", "text": "function clean_ig(){\n let content = document.getElementsByTagName(\"textarea\")[0].value;\n content = content.replaceAll(/\\n/g, ' <br> \\n');\n content = changeChar(\"**\", \"<b>\", \" </b>\", content);\n content = changeChar(\"*\", \"<i>\", \" </i>\", content);\n content = changeChar(\"__\", \"<u>\", \" </u>\", content);\n content = changeChar(\"```\", \"<code class='hljs'>\", \"</code>\", content)\n content = changeChar(\"``\", \"<code class='inline'>\", \"</code>\", content)\n \n content = tag(content);\n\n document.getElementById(\"save\").classList.remove(\"disabled\");\n document.getElementById(\"save\").disabled = false;\n\n document.getElementsByClassName(\"right\")[0].innerHTML = content;\n}", "title": "" }, { "docid": "7585004c62afbf38636336cbf20a6749", "score": "0.57238203", "text": "function strip_html() {\n var question = document.querySelector('.cuestion-contenido').innerHTML;\n var stripped = question.replace(/&lt;/gi, '<').replace(/&gt;/gi, '>').replace(/<(?:.|\\n)*?>/gm, '');\n document.querySelector('.cuestion-contenido').innerHTML = stripped;\n}", "title": "" }, { "docid": "52c4f2b1eb218f0342337cfd73f153e5", "score": "0.5720972", "text": "function balanceTags( $text, $force = false ) {\n if ( $force || get_option('use_balanceTags') == 1 )\n return force_balance_tags( $text );\n else\n return $text;\n }", "title": "" }, { "docid": "19c17dc1ddbc68e9da3e8bc4eba275a2", "score": "0.5718144", "text": "function stripHtmlTags(str, positions) {\n if (!positions)\n return str.replace(htmlRegex, '');\n\n var match = str.match(htmlRegex);\n if (!match) return;\n match.reverse();\n var split = str.split(htmlRegex);\n var offset = 0;\n var i = 0;\n split.forEach(function(text) {\n if (match.length > 0)\n positions[offset += text.length] = match.pop();\n });\n\n return split.join('');\n }", "title": "" }, { "docid": "655c95cf697474c413591a088390cfc0", "score": "0.57090056", "text": "parseNewText(text) {\n \tvar regExp = /{noun}|{verb}|{adjective}/g;\n\t\tvar matches = text.match(regExp);\n\t\tfor (var i = 0; i < matches.length; i++) {\n\t\t\tmatches[i] = matches[i].replace(\"{\", \"\");\n\t\t\tmatches[i] = matches[i].replace(\"}\", \"\");\n\t\t}\n\t\treturn matches;\n }", "title": "" }, { "docid": "1ce5f67a48a46754b7ab040248f00e14", "score": "0.57079875", "text": "function parseTagsWithRegex(text) {\n 'use strict';\n var regex = new RegExp('\\<upcase\\>(.*?)<\\/upcase\\>', 'g');\n text = text.replace(regex, function(x, y) {\n return y.toUpperCase();\n });\n regex = new RegExp('\\<lowcase\\>(.*?)\\<\\/lowcase\\>', 'g');\n text = text.replace(regex, function(x, y) {\n return y.toLowerCase();\n });\n\n regex = new RegExp('\\<mixcase\\>(.*?)\\<\\/mixcase\\>', 'g');\n text = text.replace(regex, function(x, y) {\n var i;\n\n for (i = 0; i < y.length; i += 1) {\n if (Math.random() < 0.5) {\n y = y.replace(y[i], y[i].toUpperCase());\n } else {\n y = y.replace(y[i], y[i].toLowerCase());\n }\n }\n\n return y;\n });\n\n console.log(text);\n}", "title": "" }, { "docid": "675ad132b030a19c3a1b1e32bc109939", "score": "0.5707018", "text": "function TextExtTags() {}", "title": "" }, { "docid": "6736c33f81b806fa3ce323fd7b64e609", "score": "0.570229", "text": "function getTagText (i, textArray) {\n let tagText = \"\";\n for (var j = i; j < textArray.length; j++){\n if (textArray[j] != '>'){\n tagText += textArray[j];\n }\n else {\n return tagText;\n }\n }\n return tagText;\n}", "title": "" }, { "docid": "c3868715356eddbe4c44703b8a3d6785", "score": "0.5688051", "text": "function fix_text(text) {\n\t// convert <,> and & to the corresponding entities\n\treturn String(text).replace(/\\n{2,}/g, \"\").replace(/\\&/g, \"&amp;\")\n\t\t\t.replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\").replace(/\\u00A0/g,\n\t\t\t\t\t\"\");\n}", "title": "" }, { "docid": "1887c69c84ef528db3de2af23b09e8f1", "score": "0.5683559", "text": "function splitCleanup(input, text) {\n var li = input.closest('li'),\n subTags = text ? text.replace(/ +/, ' ').split(o.dregex) : input.val().replace(/ +/, ' ').split(o.dregex),\n oldTag = input.data('old_tag'),\n oldTags = tagList.slice(0),\n exceeded = false,\n cbVal; // copy tagList\n\n for (var i = 0 ; i < subTags.length ; i++) {\n var tag = $.trim(subTags[i]).slice(0, o.maxLength);\n if (o.forceLowercase) {\n tag = tag.toLowerCase();\n }\n\n cbVal = o.beforeTagSave(el, ed, oldTags, oldTag, tag);\n tag = cbVal || tag;\n\n if (cbVal === false || !tag) {\n continue;\n }\n\n var tagObject = validate(tag);\n \n if (tagObject) {\n var $tagEditorTag =\n $('<div class=\"json-tag-editor-tag\"' +\n (tag.length > o.maxTagLength ? ' title=\"' + escape(tagObject.value) + '\"' : '') + '>' + escape(ellipsify(tagObject.value, o.maxTagLength)) +\n '</div>');\n\n var tagProperties = Object.keys(tagObject);\n for (var j = 0 ; j < tagProperties.length ; j++) {\n $tagEditorTag.get(0).dataset[tagProperties[j]] = tagObject[tagProperties[j]];\n }\n\n oldTags.push(tagObject);\n li.before(\n $('<li></li>')\n .append('<div class=\"json-tag-editor-spacer\">&nbsp;' + o.delimiter[0] + '</div>')\n .append($tagEditorTag)\n .append('<div class=\"json-tag-editor-delete\"><i></i></div>')\n );\n\n if (o.maxTags && oldTags.length >= o.maxTags) {\n exceeded = true;\n break;\n }\n }\n }\n\n input.closest('li').remove();\n updateGlobals();\n }", "title": "" }, { "docid": "4149387f04f7d44f5e3e6b489f4fdc83", "score": "0.56739795", "text": "function strip(text) {\n console.log('TEXT BEFROE', text);\n const myreg = new RegExp(/(\\r\\n)/g);\n const myafter = text.replace(myreg, ' ');\n const regex = new RegExp(/[^A-Za-z ]/g);\n const after = myafter.replace(regex, '');\n console.log('AFTER', after)\n return after;\n}", "title": "" }, { "docid": "8b3e1609ab7521fa0ead2a52a991c78b", "score": "0.5652863", "text": "function strip_html_tags(str) {\n if ((str === null) || (str === ''))\n return false;\n else\n str = str.toString();\n return str.replace(/<[^>]*>/g, '');\n}", "title": "" }, { "docid": "b752df70b9e5cf02744fa3772600ff89", "score": "0.5647758", "text": "function sliceTagContent(tag, body) {\n\tvar tagContents = passageUtil.getTagContents(tag, body);\n\tvar stripped = [];\n\tfor (var i = 0; i < tagContents.length; i++) {\n\t\tbody = body.replace(tagContents[i].full, '');\n\t\tstripped.push(tagContents[i].stripped);\n\t}\n\treturn {\n\t\tstripped: stripped,\n\t\tbody: body\n\t};\n}", "title": "" }, { "docid": "0ee5aa19da887a265238c3a0fc19244e", "score": "0.5637768", "text": "function removeGarb(element) {\n\tlet allElms = element.querySelectorAll(\"#ContentBox *\");\n\n\t// various categories to check for\n\tlet byOuterHTML = [\"<o:p></o:p>\"];\n\tlet byClass = [\"MsoNormal\"];\n\tlet byTag = [\"span\", \"div\", \"#ContentBox > br\"];\n\n\t// remove based on OuterHTML comparison\n\tfor (let i = 0; i < allElms.length; i++) {\n\t\tfor (let j = 0; j < byOuterHTML.length; j++) {\n\t\t\tif (allElms[i].outerHTML == byOuterHTML[j]) {\n\t\t\t\tallElms[i].remove();\n\t\t\t}\n\t\t}\n\t}\n\n\t// remove based on Tag\n\tfor (let i = 0; i < byTag.length; i++) {\n\t\t// generate list of all of specified Tag\n\t\tlet tagList = element.querySelectorAll(byTag[i]);\n\t\t// iterate through list\n\t\tfor (let j = 0; j < tagList.length; j++) {\n\t\t\t// get match list of words/numbers that are not spaces/carriage returns/tabs/new lines\n\t\t\tlet temp = tagList[j].innerText.match(/[^\\s\\r\\t\\n]+/g);\n\t\t\t// if no matches exist\n\t\t\tif (temp === null) {\n\t\t\t\ttagList[j].remove();\n\t\t\t}\n\t\t\t// if only one match exists\n\t\t\telse if (temp.length == 1) {\n\t\t\t\t// is it only 1 character\n\t\t\t\tif (temp[0].length == 1) {\n\t\t\t\t\ttagList[j].remove();\n\t\t\t\t}\n\t\t\t\t// it is more than 1 character long\n\t\t\t\telse {\n\t\t\t\t\tcheckNReplace(tagList[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcheckNReplace(tagList[j]);\n\t\t\t}\n\t\t}\n\t}\n\n\t// remove based on Class comparison\n\tallElms = element.querySelectorAll(\"#ContentBox *\");\n\tfor (let i = 0; i < allElms.length; i++) {\n\t\tallElms[i].innerHTML = allElms[i].innerHTML.replace(/<!--.*?-->/g, \"\");\n\t\tallElms[i].innerHTML = allElms[i].innerHTML.replace(/&nbsp;/g, \" \");\n\t\tfor (let k = 0; k < byClass.length; k++) {\n\t\t\tif (allElms[i].className == byClass[k] && allElms[i].innerHTML === \"\") {\n\t\t\t\tallElms[i].remove();\n\t\t\t}\n\t\t}\n\t}\n\n\tallElms = element.querySelectorAll(\"#ContentBox *\");\n\n}", "title": "" }, { "docid": "8dd3b5fc9dd2e7dd172e59bbe3d9aaa4", "score": "0.5632479", "text": "function cleanTextOnly(txt) {\n txt = txt.trim().replace(/\\@[\\w-\\(|\\)]+\\s/ig, \"\"); //.trim().replace(/\\@[\\w-]+\\s/ig, \"\");\n return txt;\n }", "title": "" }, { "docid": "b007d3a353aec7a2ea6c05cddeb741ee", "score": "0.5626811", "text": "function clean(contents){\n contents = contents.replace(/<style([\\s\\S]*?)<\\/style>/gi, ''); // remove all <style> tags\n contents = contents.replace(/<script([\\s\\S]*?)<\\/script>/gi, ''); // remove all <script> tags\n contents = contents.replace(/<\\/div>/ig, ''); // remove all <div> tags\n contents = contents.replace(/<\\/li>/ig, ''); // remove all <li> tags\n contents = contents.replace(/<\\/ul>/ig, ''); // remove all <ul> tags\n contents = contents.replace(/<\\/p>/ig, ''); // remove all <p> tags\n contents = contents.replace(/<br\\s*[\\/]?>/gi, ' '); // remove <br> tags\n contents = contents.replace(/<[^>]+>/ig, '');\n contents = contents.replace(/[0-9]/g, ''); // remove all numbers\n contents = contents.replace(/\\,/g, ''); // remove all commas\n contents = contents.replace(/&nbsp;/gi,''); // remove all special html characters\n contents = contents.replace(/&amp;/gi,'');\n contents = contents.replace(/&quot;/gi,'');\n contents = contents.replace(/&lt;/gi,'');\n contents = contents.replace(/&gt;/gi,'');\n contents = contents.replace(/&gt;/gi,''); // end remove all special html characters\n contents = contents.replace(/\\n/gi, ' '); // remove newline\n contents = contents.replace(/\\./gim, ''); // remove period\n contents = contents.replace(/\\:/gim, ''); // remove colon\n contents = contents.replace(/\\;/gim, ''); // remove semi-colons\n contents = contents.replace(/\\s\\s+/g, ' '); // remove apostrophe\n contents = contents.replace(/<(?:.|\\s)*?>/g, '');\n contents = contents.replace(/\\$/g, ''); // remove dollar sign\n contents = contents.replace(/[{()}]/g, ''); // remove brackets\n contents = contents.replace(/[^a-zA-Z ]/g, \"\"); // remove everything that is not an alphabet\n contents = contents.replace(/[ ]{2,}/gi,\" \"); // convert 2> spaces to 1\n contents = contents.replace(/(^\\s*)|(\\s*$)/gi,\"\"); //exclude start and end white-space\n contents = contents.replace(/\\n/,\" \"); // exclude newline with a start spacing\n return contents;\n}", "title": "" }, { "docid": "193d820d9616847641e9fdea9b800580", "score": "0.562034", "text": "function deselectText() {\n $output.find('p:first-of-type').removeClass('insert-above');\n $output.find('p:first-of-type').removeClass('selected-for-removal');\n\n if (window.getSelection) { // All browsers, except <= IE8\n var selection = window.getSelection();\n selection.removeAllRanges();\n } else {\n if (document.selection.createRange) { // <= IE8\n var range = document.selection.createRange();\n document.selection.empty();\n }\n }\n }", "title": "" }, { "docid": "e8a22d52da78232a0dd317ea95a8a26c", "score": "0.56087947", "text": "function cleanTags(tagString){\n //Get the valid characters from the string.\n var tagArray = tagString.match(/((@|#)[a-zA-Z]+[a-zA-Z0-9]*)+?/g)\n if (tagArray===null) tagArray=[];\n\n return removeDuplicateTags(tagArray);\n}", "title": "" }, { "docid": "d9962563e7091adef3b40d51d725d3cd", "score": "0.55906415", "text": "function scanText() {\n console.log(\"text_replace.scanText()\");\n $('body :not(script)').contents().filter(function() {\n return this.nodeType === 3;\n }).replaceWith(function() {\n return replaceText(this.nodeValue);\n });\n}", "title": "" }, { "docid": "46a57f1d3d8cc9515297ce403e721045", "score": "0.5580592", "text": "function ExcludeMe(tags) {\n let newTags = tags.filter((element) => {\n return !(element === \"xml\" || element === \"json\");\n });\n return newTags;\n}", "title": "" }, { "docid": "c4bd42c88a08789e80127b53928f8953", "score": "0.5576848", "text": "function _noLinkifyHashtags(text, links) {\n // If there is no search URL for a hashtag, there isn't much we can do\n if (links.hashtagSearchUrl === null) return text;\n return text.replace(/(^|\\s|\\(|>)#((\\w|[\\u00A1-\\uFFFF])+)/g, \" <span><strong>#$2</strong></span> \");\n }", "title": "" }, { "docid": "893079a15e99f7ffc2fe5b086f57e788", "score": "0.5562979", "text": "function clearTag(tag){\n while(tag.firstChild){\n tag.removeChild(tag.firstChild);\n }\n}", "title": "" }, { "docid": "61ad8e9588fd6051b9d5c62c2d9dc905", "score": "0.55593413", "text": "function removeText(d, i) {\n d3.selectAll(\".gene_\"+i+\"_extra_text\").remove();\n d3.select(\"#innovation_\"+d.innovation).remove();\n}", "title": "" }, { "docid": "7da65256304efd8ab8231ef2655c7c9b", "score": "0.5538942", "text": "cleanText(){\n // First, all to lower case\n this.text = this.text.toLowerCase();\n\n // Second replace digits\n this.text = this.text.replace(/(\\d*\\s)/g, \" \");\n\n // Third, apply filter list\n for(const value of this.exclusion){\n this.text = this.text.replace(new RegExp(value, 'g'), \" \");\n }\n\n // Fourth, split\n return this.text.split(/\\s+/);;\n }", "title": "" }, { "docid": "64e1393ed78a7098594a8a677cb41737", "score": "0.5530698", "text": "function textToReplaceable(str, tag) {\n\n\t\t// insert space after ambiguous ampersands\n\t\tvar result = String(str).replace(/&./gm, function(match) {\n\t\t\tif (match.length == 2) {\n\t\t\t\tif (' <&'.indexOf(match[1]) == -1) {\n\t\t\t\t\tmatch = '& ' + match[1]\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn match\n\t\t})\n\n\t\t// insert space to avoid text that contains a closing tag\n\t\t// this function applies to title and textarea elements\n\t\tif (!tag) tag = 'title'\n\t\tvar regExp = new RegExp('<\\/' + tag, 'gim')\n\n\t\treturn result.replace(regExp, function(match) {\n\t\t\t\treturn match.substring(0, 2) + ' ' + match.substring(2)\n\t\t\t})\n\t}", "title": "" } ]
f1d5feec79d738f7bc148ef81fc82104
define start end callbacks
[ { "docid": "c0c40503bcc313b8c31d9dd706bdfebc", "score": "0.0", "text": "function startChangeCallback(date) {\n\t\t\tvar dur = stringToMins(taskEditor.find(\n\t\t\t\t\"#duration\").val());\n\t\t\ttaskEditor.find(\"#end\").val(new Date(\n\t\t\t\tcomputeEndByDuration(date.getTime(),\n\t\t\t\t\tdur)).format('dd/MM/yy HH:mm'));\n\t\t}", "title": "" } ]
[ { "docid": "beaebab9e90c6fc5aeec0e6540bf32bd", "score": "0.69680583", "text": "onEnd()\n {\n }", "title": "" }, { "docid": "f9bc423b6aa6f6682b8efe2227a810e3", "score": "0.6836624", "text": "onEnd() {\n }", "title": "" }, { "docid": "885b6b34cee3b219e28fa6ddced427e7", "score": "0.63992584", "text": "onStartStop (callback) {\n this.callback = callback;\n }", "title": "" }, { "docid": "4cb8c83879374e2dd4bf686265a74dd0", "score": "0.62580705", "text": "function end(){}", "title": "" }, { "docid": "02179cf4cdd8487bc3521fcb6e44ef5d", "score": "0.6244078", "text": "async onBegin() {\n\t}", "title": "" }, { "docid": "dd7b45bc97b45b7ce485772629bab3b4", "score": "0.6201284", "text": "start (err, cursor) {\n sender.send('RUNTIME_CALLBACK_START', id, wrapError(err), cursor);\n }", "title": "" }, { "docid": "dd7b45bc97b45b7ce485772629bab3b4", "score": "0.6201284", "text": "start (err, cursor) {\n sender.send('RUNTIME_CALLBACK_START', id, wrapError(err), cursor);\n }", "title": "" }, { "docid": "5069b8da8f68b568b24085b90bd5c23e", "score": "0.61651325", "text": "function setupCallbacks() { }", "title": "" }, { "docid": "4846f7442387d0797edb680641658aba", "score": "0.6147135", "text": "function callback(){}", "title": "" }, { "docid": "4846f7442387d0797edb680641658aba", "score": "0.6147135", "text": "function callback(){}", "title": "" }, { "docid": "ea390def2e2a5ba71bf4603ed55d4cd7", "score": "0.6093155", "text": "_onEnd() {\n this.emit('end');\n }", "title": "" }, { "docid": "a5c6990c656e632f33f861ffa7b84409", "score": "0.6077491", "text": "_startupCallback(callback) {}", "title": "" }, { "docid": "c9cc1f75012ec20f28c628449f3c76c2", "score": "0.6061018", "text": "onStarted() {\r\n // Stub\r\n }", "title": "" }, { "docid": "35cb55d442671c8901efd50b6e004095", "score": "0.6025038", "text": "onStarted() {\n }", "title": "" }, { "docid": "bee4241b0b96f2feeb31414b6d8cc86a", "score": "0.5985274", "text": "set _start (start) {}", "title": "" }, { "docid": "644e6b1666d1bda8a1e3eb1e5e3c5311", "score": "0.5984503", "text": "onCallback () {}", "title": "" }, { "docid": "a78fa3caab349d7603e5858d82760ecf", "score": "0.5975195", "text": "function onEnd() {\n\t\tmUserEndCallback();\n\t}", "title": "" }, { "docid": "c87044466ac43b7541412f5bc41cbd24", "score": "0.59670055", "text": "async onEnd() {\n\t}", "title": "" }, { "docid": "f73e3f33db988076c6edb1cf10b4dae9", "score": "0.5922872", "text": "function end() {}", "title": "" }, { "docid": "a8c426856b6047a86f30cbe20b489888", "score": "0.5916451", "text": "end(event) {}", "title": "" }, { "docid": "9feddbde99f4d0b66fb7e0b57408dadc", "score": "0.5891073", "text": "onAniStart(callback) {\n if (!this.list.length) return callback();\n\n const firstAni = this.getFirstAni();\n firstAni.on('start', callback);\n }", "title": "" }, { "docid": "985123a674a9cc66c1c86f76fd2303a3", "score": "0.58561975", "text": "function end(){\n \n }", "title": "" }, { "docid": "7ef7b682231ca88f4351a63a4271b97a", "score": "0.5837375", "text": "function start() {\n\n}", "title": "" }, { "docid": "1cd9b4f364a68f58bbfa56f6610226b0", "score": "0.579234", "text": "_start() {\n this._emit({\n type: 'start',\n parent: this\n });\n }", "title": "" }, { "docid": "df39b38978b459ad7cc0a880355a94cd", "score": "0.57700443", "text": "function runCallbacks(start = (0, _time.now)()) {\n\t\t\tqueued = false;\n\t\t\tfor (const fn of callbacks.splice(0, callbacks.length)) fn(start);\n\t\t}", "title": "" }, { "docid": "e2031df8ee0f2578f00fedae5e60bce3", "score": "0.5764009", "text": "function start() {\n redRange.addEventListener('change', modifiyColors);\n greenRange.addEventListener('change', modifiyColors)\n blueRange.addEventListener('change', modifiyColors);\n\n}", "title": "" }, { "docid": "89b8b2efd42d72c7d3e961a4bd8c2248", "score": "0.57588434", "text": "started () {}", "title": "" }, { "docid": "89b8b2efd42d72c7d3e961a4bd8c2248", "score": "0.57588434", "text": "started () {}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.57458675", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.57458675", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.5745319", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.5745319", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.5745319", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.5745319", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.5745319", "text": "started() {}", "title": "" }, { "docid": "d4a8b4d5ccd922ad1982154a6ae42bb3", "score": "0.5745319", "text": "started() {}", "title": "" }, { "docid": "fa505a8035e9c0eb7cba77e6c1c0ac3d", "score": "0.5737631", "text": "_start(_startCb) {\n console.log('Process Started!!!!!!!!!!!!!!!!!!!!!!');\n return _startCb(null);\n }", "title": "" }, { "docid": "0ddfd0423744cbfaa30572e425c5c85e", "score": "0.5730387", "text": "startCallback_() {\n this.callbackStarted_ = true;\n // listen to viewport scroll event to help pass determine if need to\n this.unlisteners_.push(\n this.viewport_.onScroll(() => {\n this.onScrollHandler_();\n })\n );\n this.unlisteners_.push(\n this.viewport_.onResize(() => {\n this.onResizeHandler_();\n })\n );\n }", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5710607", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5710607", "text": "start() {}", "title": "" }, { "docid": "e5b6e0d2aa28efacd6ee543d91246ce9", "score": "0.5710607", "text": "start() {}", "title": "" }, { "docid": "dcafa8df13276832255a769ae60718f0", "score": "0.5685761", "text": "onTaskEnd() {\n\t\t\t// set end\n\t\t}", "title": "" }, { "docid": "7822a32382f6e0b379eaecd049ee3347", "score": "0.5659042", "text": "start()\n {\n\n }", "title": "" }, { "docid": "bf3bea24c4c3c93fb79ca96bf0cc6dfe", "score": "0.56471586", "text": "onTtsEnd() {}", "title": "" }, { "docid": "682da74dff986b3e866aabe9c806ae1a", "score": "0.5636914", "text": "started() {\r\n\r\n\t}", "title": "" }, { "docid": "b78e8f73cc79d12c6daf35813476a483", "score": "0.5632607", "text": "start() {\n // should be overridden\n }", "title": "" }, { "docid": "69014870494b1d23fb929e2748c318fd", "score": "0.56316614", "text": "end() {\n // Currently not supported don't use this\n }", "title": "" }, { "docid": "a2dcbaa46b0ec48a27ad5ee7ced7ade6", "score": "0.56232136", "text": "function atStart() {\n //setstart on time\n console.log(\"start\")\n }", "title": "" }, { "docid": "78200f7e9252f2483e4ab6a8f2a2e063", "score": "0.5621501", "text": "events() {}", "title": "" }, { "docid": "34a0f383b0596ec2259bf7c18a2d2a68", "score": "0.5617273", "text": "onTtsStart() {}", "title": "" }, { "docid": "c3ef8bea873dc2d441011bbcde97c9b2", "score": "0.5562479", "text": "function Start () {}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "af40feb097191be75c02c9c6c446fce4", "score": "0.55620784", "text": "started() {\n\n\t}", "title": "" }, { "docid": "8b9600607209976f7ecd86db9ba78598", "score": "0.55608207", "text": "function Start (){\n}", "title": "" }, { "docid": "3c90d41c30fd839cd56733db3cf30768", "score": "0.55480176", "text": "started() {\n\n }", "title": "" }, { "docid": "3c90d41c30fd839cd56733db3cf30768", "score": "0.55480176", "text": "started() {\n\n }", "title": "" }, { "docid": "3c90d41c30fd839cd56733db3cf30768", "score": "0.55480176", "text": "started() {\n\n }", "title": "" }, { "docid": "3c90d41c30fd839cd56733db3cf30768", "score": "0.55480176", "text": "started() {\n\n }", "title": "" }, { "docid": "3c90d41c30fd839cd56733db3cf30768", "score": "0.55480176", "text": "started() {\n\n }", "title": "" }, { "docid": "9200813b84b0f849d1317b45fd8a9435", "score": "0.5540776", "text": "async started() {}", "title": "" }, { "docid": "9200813b84b0f849d1317b45fd8a9435", "score": "0.5540776", "text": "async started() {}", "title": "" }, { "docid": "efcd9a9bbff1bc27e897c38b0b485a8a", "score": "0.5539799", "text": "start() {\n\n }", "title": "" }, { "docid": "3900c2310d58ad536bcb02d9922d0d56", "score": "0.55371433", "text": "function callOnStart () {\n if (config.options.onStart && typeof config.options.onStart === \"function\") {\n config.options.onStart(result);\n }\n }", "title": "" }, { "docid": "8675bf3f4f57af81c75086ce24b97a43", "score": "0.5533765", "text": "listen(identifiers, changeCallback) {\n this._registerCallback(identifiers, changeCallback);\n this._send({\n \"type\":\"start\",\n \"sequence\":\"someSeq\",\n \"monitor\":\"identifier\",\n \"parameters\": {\n \"identifiers\": identifiers\n }\n });\n }", "title": "" }, { "docid": "f8bf9ba0cca462c89ca389ea4a20ff75", "score": "0.5531748", "text": "function addSectionCallbacks(\n timeline,\n { start, end, param, onEnter, onLeave, onEnterBack, onLeaveBack },\n ) {\n let trackDirection = (animation) => {\n // just adds a \"direction\" property to the animation that tracks the moment-by-moment playback direction (1 = forward, -1 = backward)\n let onUpdate = animation.eventCallback('onUpdate'), // in case it already has an onUpdate\n prevTime = animation.time();\n animation.direction = animation.reversed() ? -1 : 1;\n animation.eventCallback('onUpdate', () => {\n let time = animation.time();\n if (prevTime !== time) {\n animation.direction = time < prevTime ? -1 : 1;\n prevTime = time;\n }\n onUpdate && onUpdate.call(animation);\n });\n },\n empty = (v) => v; // in case one of the callbacks isn't defined\n timeline.direction || trackDirection(timeline); // make sure direction tracking is enabled on the timeline\n start >= 0 &&\n timeline.add(\n () =>\n ((timeline.direction < 0 ? onLeaveBack : onEnter) || empty)(param),\n start,\n );\n end <= timeline.duration() &&\n timeline.add(\n () =>\n ((timeline.direction < 0 ? onEnterBack : onLeave) || empty)(param),\n end,\n );\n }", "title": "" }, { "docid": "c78bc4563fcf1234f19e68e873b50f89", "score": "0.55199206", "text": "function initEvents()\r\n\t\t\t{\r\n\t\t\t\t//\r\n\t\t\t}", "title": "" }, { "docid": "04762ce066457db381fc00ce3af783db", "score": "0.55093616", "text": "function start(){\n toonAlfabet(); \n nieuwSpel();\n}", "title": "" }, { "docid": "958ff2bc1b67634e1a5c89e86bbe87dc", "score": "0.5508018", "text": "start () {\n super.start.apply (this, arguments);\n }", "title": "" }, { "docid": "711180218dd2460ba2c73387202226c1", "score": "0.550358", "text": "function startEvent() { \n\tgetObjectdata( function(data){\n\t\tdisablebtn(data[\"start_button\"]);\n\n\t\tloadStartBtnFxns(data, \"click\");\n\t\tvar obj= {\n\t\t\t\"action\" : \"click\" \n\n\t\t};\n\t\tsetObjectdata(obj);\t\n\t\tconsole.log(data)\n\t});\t\n}", "title": "" }, { "docid": "d0ec02d568cba6ae56169074fa592485", "score": "0.54954463", "text": "function userevents()\n\t{\n\t\treturn function()\n\t\t{\n\t\t\tvar start,end,description;\n\t\t}\n\t}", "title": "" }, { "docid": "cf21861b2742cdb55b4be4e0e592cd53", "score": "0.5488264", "text": "function OnStop() \n{ \n \n} // OnStop ends", "title": "" }, { "docid": "a2e7525213ec115755c1a91616372994", "score": "0.5482099", "text": "async started(ctx) {\n\t\t\n\t}", "title": "" }, { "docid": "9ae250fa327d9df118d7cff8f126b0e6", "score": "0.5464446", "text": "start(){\n throw new Error('Start method is abstract, please implement in sub-class');\n }", "title": "" }, { "docid": "ad0104a42e729e7972dbde2c5464cbf7", "score": "0.5463992", "text": "function onFinish() {\n console.log(\"finished!\");\n}", "title": "" }, { "docid": "d608db78cd7fb90bdf22a6dd545039fe", "score": "0.54595774", "text": "function callback() {\r\n}", "title": "" }, { "docid": "6fb4acbdb5eb02dbe579f14da879f2aa", "score": "0.5449807", "text": "begin() {\n this.start();\n }", "title": "" }, { "docid": "9de3a5f7db5d3ea16d883d58a8d7a010", "score": "0.5443365", "text": "start() {\n\n }", "title": "" }, { "docid": "09d3fea03f394cf9fef6cee572dc2d34", "score": "0.5442446", "text": "start() {\n }", "title": "" }, { "docid": "caf3edddd8fed6bfa2687f1bea28224d", "score": "0.5434863", "text": "started() {\n\n }", "title": "" }, { "docid": "02545f0adc4b8701d0d4817bec23d38c", "score": "0.54234934", "text": "constructor(startValue, endValue, duration, updateHandler = null, endHandler = null) {\n /**\n * Property field\n */\n this._running = false;\n /**\n * Property field\n */\n this._tag = null;\n this._duration = duration;\n this._startValue = startValue;\n this._endValue = endValue;\n if (updateHandler) {\n this.update.add(updateHandler);\n }\n if (endHandler) {\n this.ended.add(endHandler);\n }\n }", "title": "" }, { "docid": "c55eef4a6c9869e132f9034715692207", "score": "0.54179156", "text": "async started() {\n\n\t}", "title": "" }, { "docid": "161e278620733589c2368d8b6274d61c", "score": "0.5414383", "text": "onStarting() {\r\n // Stub\r\n }", "title": "" }, { "docid": "d7b7a72b50c1d7d0788d246e6269d9e1", "score": "0.54100406", "text": "function onloadstartHandler(evt) {\r\n\t}", "title": "" }, { "docid": "918a4907a71f6c4a2d8e85583bde147c", "score": "0.54085594", "text": "function ot(){Xe.removeListener(\"finish\",st),dt()}", "title": "" }, { "docid": "c42d81fc49dfc59058c3577425b82a4e", "score": "0.5407661", "text": "onChangeStart() {}", "title": "" }, { "docid": "43c978c83d31e5b6b6738b59f9907dfa", "score": "0.5404927", "text": "async started() {\n\t}", "title": "" }, { "docid": "43c978c83d31e5b6b6738b59f9907dfa", "score": "0.5404927", "text": "async started() {\n\t}", "title": "" }, { "docid": "a6f40ffe726bbab2f3806caa16a973ed", "score": "0.54015386", "text": "constructor(start, end) {\n this.start = start;\n this.end = end;\n }", "title": "" }, { "docid": "f8fa4b30fab5f8cec8a2e6ab2616e2c4", "score": "0.53979397", "text": "function cb() {}", "title": "" }, { "docid": "28e95311322d2f71915a5bf1d984df41", "score": "0.5391925", "text": "constructor(pm, events, start) {\n this.pm = pm\n this.start = start\n\n this.events = events.split(\" \")\n this.onEvent = this.onEvent.bind(this)\n this.events.forEach(event => pm.on(event, this.onEvent))\n }", "title": "" } ]
d085f12d513a73a593c666c25e2efa9b
Randomise a number between 10009999 and calculate the sum of it's digits, for instance if the ramdomised number was 1049, program shoud print 14.
[ { "docid": "bf295e207dad159b0608d487185f62f4", "score": "0.71535176", "text": "function randomSum() {\n\tvar y = 0;\n\tvar x = parseInt(Math.random()*10000);\n\tif (x < 1000) { \n\t\tx += 1000; \n\t}\n\tconsole.log(x);\n\tx += \"\";\n\tfor (i = 0; i < 4; i++){\n\t\ty += parseInt(x.charAt(i));\n//\t\ty = parseInt(y);\n//\t\ttotal += y;\n\t}\n//\tconsole.log(total);\n\treturn y;\n}", "title": "" } ]
[ { "docid": "3c7caa57594e973a8ca3c6a25f3b4047", "score": "0.7669967", "text": "function randomSum () { // eslint-disable-line no-unused-vars\n var randomNum = Math.floor(Math.random() * 9000) + 1000\n var aNumber = randomNum.toString().split('')\n return aNumber.reduce(function (acc, elem) {\n return acc + Number(elem)\n }, 0)\n}", "title": "" }, { "docid": "f11c50a054eb757ba34a9bca63b0b236", "score": "0.7059621", "text": "function rndNum() {\n let num = Math.round(Math.random() * 10);\n while (num < 1 || num > 9) {\n num = Math.round(Math.random() * 10);\n }\n return num;\n}", "title": "" }, { "docid": "79f7bdb69d23e47439d3e0daa26e129f", "score": "0.686651", "text": "function randomDigits(){\n return shuffle( \"0123456789\".split('') ).join('').substring(0,4);\n }", "title": "" }, { "docid": "3a2406b2785a8b608f6df1d28d0d407a", "score": "0.686047", "text": "function getNumber(){\n\t'use strict';\n\tvar result = \"\";\n\tvar count = 0;\n\twhile(count < 4){\n\t\tvar nextNum = Math.floor(Math.random()*10) + 1;\n\t\tif(nextNum < 10 && result.indexOf(nextNum) == -1){\n\t\t\tresult += nextNum + \"\";\n\t\t\tcount++;\n\t\t}\n\t}\n\tconsole.log(\"answer: \" + result);\n\treturn result;\n}", "title": "" }, { "docid": "85ea9b5769a0b9a833e1f7355e2d67da", "score": "0.68239987", "text": "function randomN() {\n\t//var randomNum = Math.floor((Math.random() * 100000) + 1);\n\tvar randomNum = 1000 + parseInt(itmid)\n\t\treturn randomNum;\n}", "title": "" }, { "docid": "c9a1024719b5d606e47f0b041a8a158c", "score": "0.68211347", "text": "function getRandomNumber() {\n return Math.floor(Math.random() * 9000) + 1000;\n }", "title": "" }, { "docid": "62118024bddb95b388c5dde3dd8e294e", "score": "0.68038225", "text": "function crystalnumber() {\n return Math.floor(Math.random() * 11 + 1);\n }", "title": "" }, { "docid": "70d91f8be24a452963abd92ab968fc8c", "score": "0.6793955", "text": "function randomNumGen() {\n return Math.round(Math.random() * 102) + 19;\n }", "title": "" }, { "docid": "f1e4702783f2d1458ef98a56d48e535a", "score": "0.6749932", "text": "function randomWholeNum(){\n\n\n\treturn Math.floor(Math.random() * 10);\n}", "title": "" }, { "docid": "5caf6efa3cd3637cf9fb620b9cccaf61", "score": "0.67164195", "text": "function randomNum() {\n let num = Math.floor(Math.random() * 100000)\n return num;\n }", "title": "" }, { "docid": "10ad60bc8a6aca6fb6efbfcb013d20b0", "score": "0.6703084", "text": "function rendomWholeNum(){\n return Math.floor(Math.random()*10);\n}", "title": "" }, { "docid": "a6304b7cc2aa6f1f8601e63a681f4eef", "score": "0.66968215", "text": "function _num(){\n return (Math.floor((Math.random() * 100) + 1) + (Math.floor((Math.random() * 99)) / 100)).toFixed(2);\n }", "title": "" }, { "docid": "99f1cc7dc9e38fd8925fd2e74eed97e5", "score": "0.66881526", "text": "function randomNum() {\n\t\treturn Math.floor(Math.random() * 31);\n \t}", "title": "" }, { "docid": "f40f971f3c480bdda9e6b620da90ea26", "score": "0.66608775", "text": "function gennum(n){return(Math.round((Math.random() * (n - 0 + 1)) +0))}", "title": "" }, { "docid": "fdda3d5610cb0d7090ff44a3f4d3c902", "score": "0.6658142", "text": "function generateRandomNumber() {\n return Math.round(Math.random() * 10000000);\n}", "title": "" }, { "docid": "50397aec87a253c22866e997d0fb5ad7", "score": "0.66150796", "text": "sumOfDigits(n){\n\t\tvar sum=0;\n\t\twhile(n>0){\n\t\t\tsum+=n%10;\n\t\t\tn=Math.floor(n/10);\n\t\t}\n\t\treturn sum;\n\t}", "title": "" }, { "docid": "62e3c7880e6d6e9e74e5ae67b04e018f", "score": "0.66145337", "text": "function randomNum() {\n const random = Math.floor(Math.random()* 9 + 1 )\n console.log(random);\n return random\n}", "title": "" }, { "docid": "7326a112e8b7401612f22ee255a95173", "score": "0.66142434", "text": "function randomNumGen() {\n return Math.floor(Math.random() * 102) + 19;\n }", "title": "" }, { "docid": "9fd17981afaee41d9bba5f864f76c9df", "score": "0.66059226", "text": "function randomWholeNum() {\n return Math.floor(Math.random() * 10 );\n}", "title": "" }, { "docid": "c0e75c70664b6a8645a3c1b2e4d609d2", "score": "0.6600634", "text": "function randomNumGen() {\n\t\treturn Math.floor(Math.random() * 102) + 19;\n\t}", "title": "" }, { "docid": "7cf2dcdcca80d240b8a0062e087e505c", "score": "0.6597429", "text": "function digitalSum(n) {\n var result = 0\n while (n>0) {\n result = result + (n % 10)\n n = Math.floor (n/10)\n }\n return result\n}", "title": "" }, { "docid": "8703983a9709d44f9d52f59c8fe5860b", "score": "0.65774786", "text": "function randomWholeNum() {\n\n // Only change code below this line\n \n // return Math.random();\n return Math.floor(Math.random()*10);\n }", "title": "" }, { "docid": "744b28b45c4a3d0218fd36ba37b2702a", "score": "0.65611744", "text": "function rnd(number) {\n return Math.round(number * Math.pow(10, _decimalCount)) / Math.pow(10, _decimalCount);\n }", "title": "" }, { "docid": "9d924befce467710d461d5ae53966558", "score": "0.65378577", "text": "function generateNumber(){\n number = Math.floor(Math.random()*100)+1;\n console.log(number);\n}", "title": "" }, { "docid": "050688531cb38473f7a1c2d29fb961d4", "score": "0.6521004", "text": "function randomNum(){\n\treturn Math.floor(Math.random() * 10);\n}", "title": "" }, { "docid": "e2ff99417f0fab92a9f7998aa0241728", "score": "0.6502641", "text": "function randomInteger() {\n return Math.ceil(Math.random() * 10);\n}", "title": "" }, { "docid": "ebeb57694ec620f2cbfdc44f9b2fe76b", "score": "0.64989674", "text": "function generateANumber () {\n var abc = Math.floor(Math.random() * 500 ) + 100;\n $(\"#please-display-my-number\").text(abc);\n }", "title": "" }, { "docid": "d00f2f522105a2c705ec1358eb7b09d8", "score": "0.6498798", "text": "function generateNum() {\n ranNum = Math.floor((Math.random() * 100) + 19)\n $(\"#random-number\").text(ranNum);\n }", "title": "" }, { "docid": "67d2ba9809f191276e5ead5c5e463caa", "score": "0.64923316", "text": "function generateRandomNumber(){\r\n\tvar random = Math.floor(Math.random()*1001)\r\n\treturn random;\r\n}", "title": "" }, { "docid": "04ad28826230dc1a52716d3840f5f5d6", "score": "0.6492046", "text": "function randomNum() {\n\treturn Math.floor (Math.random() * 10);\n}", "title": "" }, { "docid": "149bb3371507c5b64e1107d0d8b9f2d5", "score": "0.64810944", "text": "function generateFourRandomNumbers() {\n const number = Math.floor(Math.random() * 10000).toString();\n if (number.length < 4) {\n number = '0' + number;\n }\n return number;\n}", "title": "" }, { "docid": "5f4341288e4db594905c645b3a2ae09f", "score": "0.6463823", "text": "function generateRandNum() {\n\treturn Math.floor(Math.random() * (9 - 0 + 1)) + 0;\n}", "title": "" }, { "docid": "76ada07fdc0221a186119561a0d7b250", "score": "0.646167", "text": "function crystalNumberGenerator () {\n\n return Math.floor(Math.random() * 10) + 5;\n\n }", "title": "" }, { "docid": "a037d21d7457739dbad286f958626e59", "score": "0.6460204", "text": "function rand(num) {\n var randDec = Math.random() * num;\n var randInt = Math.floor(randDec);\n console.log(randInt);\n return randInt;\n }", "title": "" }, { "docid": "a83e85eb16515067e1b999b036643c60", "score": "0.6446179", "text": "function digitSum(n, k) {\n let numStr = BigInt(n.toString().repeat(k));\n // if (numStr.toString().length === 1) return numStr;\n return sum(BigInt(numStr));\n}", "title": "" }, { "docid": "caf6568753ea8ec7b10986f696d5a9e2", "score": "0.6439553", "text": "function generateNum() {\n\t\treturn\tMath.floor(Math.random() * 100 + 1);\n\t}", "title": "" }, { "docid": "5dbf020db4a617bd37c83ce64cfbabec", "score": "0.6430326", "text": "function randomNum() {\n return Math.floor((Math.random() * 10) + 1);\n}", "title": "" }, { "docid": "b65523aefe886f6f3dc88b4704337c7e", "score": "0.6427775", "text": "function numRandom() {\n return Math.floor(Math.random() * 100);\n console.log(numRandom);\n }", "title": "" }, { "docid": "6b9663e26ddb581fff4c2dcaef07cf8a", "score": "0.6423711", "text": "function randomNum() {\n var i = Math.floor(Math.random() * (11) + 1);\n return (i);\n }", "title": "" }, { "docid": "56fdc4030cfab065180c3203536ec880", "score": "0.64192706", "text": "function getRandNum(){\n\trand = Math.random() *100 +1\n\treturn Math.round(rand)\n}", "title": "" }, { "docid": "6bb556d2a291189d8ba7220b26494f1c", "score": "0.6413731", "text": "function powerDigitSum(n) {\n\n // calculate the value to break up into its digits\n var value = new BigNumber(Math.pow(2,n));\n console.log('initial value:', value);\n\n // store the sum of the digits\n var sum = 0;\n\n\n // parse digits\n while (value > 10) {\n console.log('value % 10:', value % 10);\n sum += Math.floor(value % 10);\n value = value / 10;\n console.log('sum:', sum);\n console.log('value:', value);\n }\n\n sum += Math.floor(value);\n\n return sum;\n}", "title": "" }, { "docid": "45629c7278b1aef938932ac5aac92017", "score": "0.6410494", "text": "function getRandomNr() {\n return Math.floor(Math.random() * 10) + 300\n}", "title": "" }, { "docid": "615449d05d040b91abddffa9bfc2dfb0", "score": "0.6404699", "text": "function randInt() {\n return Math.floor(Math.random() * 9e15 / Math.pow(10, Math.random() * 16 | 0));\n }", "title": "" }, { "docid": "09d15012d9a7d9467eacf25cbf9714bc", "score": "0.6399062", "text": "function randomNumber() {\n let code = \"\";\n for (let i = 0; i <4; i+=0) {\n let num = Math.floor(Math.random() * 10);\n if (code.includes(num.toString())) {}\n else {\n code = code.concat(num.toString());\n i++\n }\n }\n return code;\n }", "title": "" }, { "docid": "d298a961c557aa975779db669dbdac17", "score": "0.6385607", "text": "function getRandomNumber(){\n let ans=Math.trunc(Math.random()*100);\n return ans;\n}", "title": "" }, { "docid": "c73047e1ddf0a86b4ca17c3aecf5c7b8", "score": "0.6380463", "text": "function randNumber(){\n var rand = Math.floor(Math.random() * 101) + 19; \n $(\"#randomNumber\").text(rand);\n console.log(rand);\n return rand;\n }", "title": "" }, { "docid": "3380a72984685563aedbafb133bf8a2a", "score": "0.6378736", "text": "function dgtSum(num) {\n var sum = 0;\n while (num > 0) {\n var rem = num % 10;\n var sum = sum + rem;\n num = parseInt(num / 10);\n }\n console.log(sum);\n}", "title": "" }, { "docid": "ef4af0d27c926ead59b38a7d6c64df38", "score": "0.6375893", "text": "function generateNumber(){\n var min= -1;\n var max= 1;\n var number=Math.random()*(max-min)+min;\n number=number.toFixed(4);\n return number;\n }", "title": "" }, { "docid": "623fbf971469b34065743cd05376e89e", "score": "0.6370572", "text": "function rnd1(num) {\n var dp1=Math.round(num*10)/10;\n return dp1;\n}", "title": "" }, { "docid": "970e2fd3f484fa7b803d940357ca200d", "score": "0.63624203", "text": "function sumOfAllDigits(n) {\n\tlet sum = 0;\n\twhile(n>0) {\n\t\tsum += n%10;\n\t\tn = Math.floor(n/10);\n\t}\n\treturn sum;\n}", "title": "" }, { "docid": "8acc5ab3aa2243bd8e06c3a8a49b6af0", "score": "0.63613325", "text": "function randomNum(){\n\t\tvar num = Math.ceil(Math.random() * 10 + 76);\n\t\t\tif(num < 87 && num > 81){\n\t\t\t\treturn num + 5;\n\t\t\t}else{\n\t\t\t\t// console.log(\"high\",num)\n\t\t\t\treturn num\n\t\t\t}\n\t}", "title": "" }, { "docid": "3aefc14109c73952666093691d248593", "score": "0.63525254", "text": "function numberRandom() {\n return String.fromCharCode(Math.floor(Math.random() * 10) + 48); \n }", "title": "" }, { "docid": "3bbf196bdf6b15f046fab5f0d6158fb6", "score": "0.6349087", "text": "function randomCrystalNumber(){\n var random = 1 + Math.floor(Math.random() * 12);\n return random;\n}", "title": "" }, { "docid": "22189e66932b2b65f060058d29f1a5b8", "score": "0.6339157", "text": "function dgtsum(num) {\n var sum = 0;\n while (num > 0) {\n var rem = num % 10;\n var sum = sum + rem;\n num = parseInt(num / 10);\n }\n console.log(sum);\n}", "title": "" }, { "docid": "d17e1c6ddead47209f02072168588bf2", "score": "0.63351095", "text": "function genRandomNumber(){\n\n randomNumber= Math.floor(Math.random()* 101)+18;\n\n}", "title": "" }, { "docid": "2624b853dfa5cbe62cd89538b100cf25", "score": "0.6303504", "text": "function getRandomNumber(){\r\n let number = Math.random();\r\n let randomNumber = Math.floor(number * 100) + 1;\r\n return randomNumber;\r\n}", "title": "" }, { "docid": "b7abdd5a6286ad4f250b32fe015046f1", "score": "0.6301474", "text": "function randomNum() {\n var eightdigitrandom = Math.floor(10000000 + Math.random() * 90000000);\n document.getElementById(\"eightrandom\").innerHTML = eightdigitrandom;\n}", "title": "" }, { "docid": "1a32ebd228a23c6b89505383bb9007bb", "score": "0.6301", "text": "function getRandomNums() {\n randomNum = getRandomIntInclusive(19, 120);\n $(\"#random-number\").text(randomNum);\n\n diamondNum = getRandomIntInclusive(1, 12);\n emeraldNum = getRandomIntInclusive(1, 12);\n lapisLazuliNum = getRandomIntInclusive(1, 12);\n redstoneNum = getRandomIntInclusive(1, 12);\n }", "title": "" }, { "docid": "2b8141f997054c228adda4c86afc8ca1", "score": "0.62980723", "text": "function getRandomInteger(num) {\n\treturn Math.round(Math.random(num) * 100);\n}", "title": "" }, { "docid": "406456125b046f1dec4f0505f27d8b72", "score": "0.6293429", "text": "function randomnumber() {\n var res = Math.floor(Math.random() * 5000);\n return '\"' + res + '\"';\n}", "title": "" }, { "docid": "3dc16a3306581d539e1a78ab558d924c", "score": "0.6285175", "text": "function randomNumber10() {\n return Math.floor((Math.random() * 10) + 1)\n}", "title": "" }, { "docid": "d527c53a661262895efb1b30a0109faf", "score": "0.628018", "text": "function getDigitSum(number) {\n var sum = 0;\n while (number > 0) {\n sum += number % 10;\n number = Math.floor(number / 10);\n }\n\n return sum;\n}", "title": "" }, { "docid": "1e2c84afa0bb5d2f6a39e82b3f6188a4", "score": "0.6263088", "text": "function pickRandomNumber() {\n number = Math.floor(Math.random() * 111) + 19;\n$(\"#numbertoMatch\").html(number);\n console.log(number);\n}", "title": "" }, { "docid": "6e272b42fc57d7c0ad5f9a74fd8af97e", "score": "0.6262475", "text": "function sumFactorialDigits(n) {\n let str = String(factorial(n));\n // Split the string into char array and sum them\n return str.split('').reduce( (acc,val) => acc+Number(val), 0 );\n}", "title": "" }, { "docid": "85d2418bdf7f30ce20a9d14cecfcc08e", "score": "0.6261056", "text": "function randomNumber() {\n return (Math.floor((Math.random() * 10) + 1));\n}", "title": "" }, { "docid": "43af089a1b894d4622c4cef545ae959e", "score": "0.62590444", "text": "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1)\n }", "title": "" }, { "docid": "9726089da0eb1ce9ea6f43cf06484cf1", "score": "0.6256913", "text": "function randomNumber() {\n return Math.floor(Math.floor(Math.random() * 10))\n}", "title": "" }, { "docid": "6f85109948c1342ca7fc28faeb5010f7", "score": "0.6252836", "text": "function ranNum() {\n sevenRanNum = []\n sevenNum = (Math.floor(Math.random() * 10)) + \",\" + (Math.floor(Math.random() * 10)) + \",\" + (Math.floor(Math.random() * 10)) + \",\" + (Math.floor(Math.random() * 10)) + \",\" + (Math.floor(Math.random() * 10)) + \",\" + (Math.floor(Math.random() * 10)) + \",\" + (Math.floor(Math.random() * 10));\n sevenRanNum.push(sevenNum)\n return sevenRanNum\n }", "title": "" }, { "docid": "540eac975fd0a68574c13a38d44c9e78", "score": "0.625252", "text": "function randInt2(num){\n var random = 0;\n while(random == 0){\n \trandom = randInt(manzanas + 3, 1);\n \tif(random == num || random > 9){\n \t\trandom = 0;\n \t}\n }\n return random;\n}", "title": "" }, { "docid": "9a00fb3279032dfb2ce3ea3440fc5ae4", "score": "0.6251918", "text": "function makeRandomNumber() {\n let randomNumber = Math.floor(Math.random() * 9) + 1;\n return randomNumber\n}", "title": "" }, { "docid": "c88dc5e48a5503b7962dd1868d118c8e", "score": "0.62496734", "text": "function randomNum(min, max) {\n return Math.floor(Math.random() * 1000) + 1;\n}", "title": "" }, { "docid": "65c85ec693c45c760fa907559abb0a4f", "score": "0.624906", "text": "function getRandomDigit(start, end) {\n return Math.floor((Math.random() * (end - start + 1))) + start;\n}", "title": "" }, { "docid": "bdf0f08aaf796093cc5b601bcd72c739", "score": "0.6241395", "text": "function randomNums (parameter){\n return (Math.random() * 1000)\n}", "title": "" }, { "docid": "38568cdb36a1e27c15408d0e62344f05", "score": "0.6240853", "text": "function sumOfDigits(num){\r\n if(!Math.floor(num / 10)){\r\n return num;\r\n }\r\n let sum = 0;\r\n while(num){\r\n sum += num % 10;\r\n num = Math.floor(num / 10)\r\n }\r\n num = sum;\r\n return sumOfDigits(num);\r\n}", "title": "" }, { "docid": "09141623496d331089dfe6377c14a4bf", "score": "0.6240299", "text": "function SumOfIndividuals(n){\n sum=0;\n while(n>0){\n r=n%10;\n sum=sum+r;\n n=parseInt(n/10);\n }\n return sum;\n}", "title": "" }, { "docid": "fbd3fb373835f456710e9087f14e3528", "score": "0.6229275", "text": "function generateNumber() {\n\n\t\tvar generatedNumber = Math.floor((Math.random()*100)+1);\n\t\tconsole.log(\"Generated Random Number = \"+ generatedNumber);\n\n\t\treturn generatedNumber;\n\t}", "title": "" }, { "docid": "d55347ca68f96f5bd4480b2f6f11ea6c", "score": "0.6228883", "text": "function number(num) {\n let sum = 0;\n for(i = 1; i < num; i ++){\n if (i % 5 === 0 || i % 7 === 0){\n sum = sum + i;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "2ca16da2b8c75f04f204fd763639b4c0", "score": "0.6225268", "text": "function randNum (){ \t\t\t\t\n\t\n\tvar data =['A0','B1','C2',\n\t\t\t 'D3','E4','F5',\n\t\t\t 'G6','H7','I8',\n\t\t\t 'J9','K0','L1',\n\t\t\t 'M2','N3','O4',\n\t\t\t 'P5','Q6','R7',\n\t\t\t 'S8','T9','U0',\n\t\t\t 'V1','W2','X3',\n\t\t\t 'Y4','Z5'];\n\t\t\n\tvar random = Math.floor(Math.random()*24);\n\tvar randomnumber=Math.floor(Math.random()*100);\n\tTi.API.info(\"random: \" +data[random]+randomnumber);\n\t\n\treturn data[random]+ randomnumber;\n\t\n}", "title": "" }, { "docid": "663e3e4f13a29912db75fa09e289babd", "score": "0.6220992", "text": "function generarNumero(numero){\n\treturn (Math.random()*numero).toFixed(0);\n}", "title": "" }, { "docid": "051bce4b7971298874f6aee740dcc1a8", "score": "0.6220181", "text": "function randomNum(time)\n{\n for(x=0; x <time; x ++;)\n {\nlet num1 = Math.floor((Math.random() * 10) + 1);\nlet num2 = Math.floor((Math.random() * 10) + 1);\nreturn num1 + num2 \n }\n}", "title": "" }, { "docid": "363c3a5b3997d39f51a73be73a6807c4", "score": "0.6213646", "text": "function randomNum(length) {\n let str = '';\n for (let i = 0; i < length; i++) {\n str = str.concat('', randomInt(10).toString());\n }\n return Number(str);\n}", "title": "" }, { "docid": "7498781491edd053d424a0f65c74c373", "score": "0.6210663", "text": "function getRandomNumber() {\n // returns random numbers between 1 and 10\n return Math.floor(Math.random() * 11);\n}", "title": "" }, { "docid": "88e5f0868c664eb2b2e5a3a188c98e92", "score": "0.6210585", "text": "static randomNum() {\n let num = Math.random() * 800;\n num *= Math.floor(Math.random() * 2) == 1 ? 1 : -1;\n return num;\n }", "title": "" }, { "docid": "5e6da8107a5e5852e8690b78bda0d3aa", "score": "0.6208537", "text": "function SumOf4Digits(num){\nvar sum = 0;\n while(num !=0){\n sum += num%10\n num = parseInt(num/10);\n \n }\n return sum;\n}", "title": "" }, { "docid": "17394b6f02d06cc169de074e831a753f", "score": "0.6199726", "text": "function generateNumber(){\n \t\trandomNumber = Math.floor(Math.random() * (100 - 1)) + 1;\n \t\tconsole.log('random number :'+randomNumber);\n \t}", "title": "" }, { "docid": "c7c2a9a26908bd9d1f4c7dff5294d870", "score": "0.61977524", "text": "function numeriRandom(){\n var numeroRandom = Math.floor(Math.random() * range) + 1;\n return numeroRandom;\n}", "title": "" }, { "docid": "77603d1bf93f5326f8298b956b89ebf7", "score": "0.6193853", "text": "function randomWholeNum() {\n \treturn Math.floor(Math.random() * 4);\n}", "title": "" }, { "docid": "629a997d9720e7110c1f6e31c1edf43a", "score": "0.6191501", "text": "function randomWholeNum() {\n\n // Only change code below this line.\n\n return Math.floor(Math.random() * 10); // reuturns a number between 0-9\n}", "title": "" }, { "docid": "3caf32e1893aa7d5087905542ff3f84e", "score": "0.6184019", "text": "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1); \n}", "title": "" }, { "docid": "3caf32e1893aa7d5087905542ff3f84e", "score": "0.6184019", "text": "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1); \n}", "title": "" }, { "docid": "8df2b4df0d9991332d3c6fe69af156f2", "score": "0.61823034", "text": "function generateRandomNumber() {\n crystalNumber = (Math.floor(Math.random() * 4) + 1);\n crystalNumber2 = (Math.floor(Math.random() * 7) + 1);\n crystalNumber3 = (Math.floor(Math.random() * 19) + 1);\n crystalNumber4 = (Math.floor(Math.random() * 11) + 1);\n}", "title": "" }, { "docid": "bf40dc22407536199641ffa2f9f63b94", "score": "0.618022", "text": "function getRndNum(min, max) {\n return (Math.random() * (max - min) + min).toFixed(1);\n}", "title": "" }, { "docid": "1f969b5c5de2cb73ce30d4bbff793b5a", "score": "0.6176207", "text": "function getRandomNum() {\n return String.fromCharCode(Math.floor(Math.random()*10) +48);\n}", "title": "" }, { "docid": "acb331c6cf73b65e624650a85d0c235c", "score": "0.6171926", "text": "function randnum(min, max){\n \n return Math.round(Math.random() * (max-min)) + min;\n \n}//end randnum()", "title": "" }, { "docid": "1e2961c23717b6a0982ed4b4af5129a2", "score": "0.61678755", "text": "function randomNumber(num) {\n return Math.round(Math.random() *num);\n}", "title": "" }, { "docid": "60bc45c782a550e11571d8d018a61665", "score": "0.6163956", "text": "function getRandomNumber () {\n\treturn String.fromCharCode(Math.floor(Math.random()*10) +48);\n}", "title": "" }, { "docid": "cb39bff7e174a97e222dc22b1a12b33f", "score": "0.6160199", "text": "function sumDigits(num){\nlet sum = 0; \nwhile(num !== 0){\n \n sum += num % 10;\n num = parseInt(num / 10);\n }\n return sum;\n}", "title": "" }, { "docid": "4aa425aeccf13f8a5c19bf60db3bb194", "score": "0.6152536", "text": "function sumToOne(num) {\n var one = num;\n while(one >= 10) {\n var n = digitsNum(one);\n num = one;\n one = 0;\n for(var i = 0; i < n; i++) {\n one += Math.floor(num/Math.pow(10, i)) % 10;\n }\n console.log(\"one:\", one);\n }\n return one;\n}", "title": "" }, { "docid": "44b66d62aa6cb42501c29cfa535a0331", "score": "0.6151829", "text": "function rndNum(num) {\n\n\t\treturn Math.round(Math.random() * num);\n\n\t}", "title": "" }, { "docid": "8178a8c2aee3823b2613ece62ed415b8", "score": "0.61507577", "text": "function randomize(num) {\n return Math.floor(num * Math.random());\n }//======================================================================//", "title": "" } ]
1e5bf43a5a2173bf0e5e175c64ce84f6
Function to handle sending the AJAX form
[ { "docid": "6722f9987ad030d64e6c8c041751c491", "score": "0.0", "text": "registerSave() {\n\t\t\tthis.container.find('.js-modal__save').on('click', (e) => {\n\t\t\t\tlet form = this.container.find('form');\n\t\t\t\te.preventDefault();\n\t\t\t\tif (form.validationEngine('validate')) {\n\t\t\t\t\tlet progress = $.progressIndicator({\n\t\t\t\t\t\tmessage: app.vtranslate('JS_SAVE_LOADER_INFO'),\n\t\t\t\t\t\tblockInfo: { enabled: true }\n\t\t\t\t\t});\n\t\t\t\t\tlet formData = form.serializeFormData();\n\t\t\t\t\tapp.saveAjax('', [], formData).done((data) => {\n\t\t\t\t\t\tif (data.result) {\n\t\t\t\t\t\t\tlet id = this.container.closest('.modalContainer').attr('id');\n\t\t\t\t\t\t\tapp.hideModalWindow(null, id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tapp.showNotify({\n\t\t\t\t\t\t\t\ttext: app.vtranslate('JS_ERROR'),\n\t\t\t\t\t\t\t\ttype: 'error'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprogress.progressIndicator({ mode: 'hide' });\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" } ]
[ { "docid": "a60f9f48736c312640206f7bc6ead76e", "score": "0.74441713", "text": "function sendForm(e){\n e.preventDefault();\n\n //store values\n var name = document.getElementById('name').value;\n var email = document.getElementById('email').value;\n var message = document.getElementById('message').value;\n var submit = document.getElementById('submit').value;\n var sendValue = 'name='+name+'&email='+email+'&message='+message+'&submit='+submit;\n\n //create a XHR object\n var xhr = new XMLHttpRequest();\n\n //establish a connection\n xhr.open('POST', 'processForm.php', true);\n\n //set content type\n xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n //onload function\n xhr.onload = function() {\n if(this.status == 200){\n var ourData = JSON.parse(this.responseText);\n renderMsg(ourData);\n }\n }\n\n //sends request\n xhr.send(sendValue);\n}", "title": "" }, { "docid": "ebaa1c84b405f952fc923cdb7c0b8b06", "score": "0.7233831", "text": "function sndForms(event, id){\r\n event.preventDefault();\r\n var opciones = {\r\n success: sendFormOferta\r\n }\r\n $('#'+id).ajaxSubmit(opciones);\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "afc0638416f8156e162d4f16318161d9", "score": "0.715305", "text": "function formSendForm() {\n\n var urlFormSave = $Ctr_register + 'save';\n var dataToSave = $(\"#register-form\").serialize();\n\n $.ajax({\n type: \"POST\",\n cache: true,\n url: urlFormSave,\n data: dataToSave,\n dataType: \"json\",\n success: function (data) {\n\n if (data.response) {\n\n DialogSuccess(data.message);\n\n } else {\n DialogError(data.message);\n }\n\n },\n error: function (xhr, textStatus, errorThrown) {\n DialogError(xhr.responseText);\n\n }\n });\n return false;\n}", "title": "" }, { "docid": "61926f97d2dc493d962f5c97b994eb5d", "score": "0.7152081", "text": "function processForm(data) {\n\n $.ajax({\n\n\t\ttype : 'POST',\n\t\turl : TequilaApp.ajaxurl,\n\t\tdata : {\n\t\t\taction : 'get_query',\n\t\t\tdata : data,\n\t\t\tWhiskeyNonce : GinAjax.WhiskeyNonce\n\t\t},\n\t\tbeforeSend : function(){\n\t\t}, \n success:function (response) {\n\n\t\t\t$('#beer-contact-form-response').html(response);\n\t\t\t$('#beer-contact-form').slideUp('slow',function(){\n\t\t\t\t\t$('#beer-contact-form-thanks').fadeIn();\n\t\t\t});\n\n },\n error:function () {\n\n\t\t\t$('#beer-contact-form').slideUp('slow',function(){\n\t\t\t\t\t$('#beer-contact-form-error').fadeIn();\n\t\t\t});\n\n }\n });\n}", "title": "" }, { "docid": "b5f746e0786aeac6997cbb824b3d9e95", "score": "0.71452314", "text": "function sendEnquiry(obj,e) {\n e.preventDefault();\n $(obj).find('.msg').html('').css('display','none');\n $.ajax({\n url:FRONTAJAX,\n method:'POST',\n data: new FormData(obj),\n contentType: false,\n cache: false,\n processData:false,\n success:function(response){\n if(response.valid){\n $(obj).find('.msg').html(getMsg(response.msg,1)).css('display','block');\n ResetTextBox(obj);\n setTimeout(function(){window.location.reload(); },5000);\n }else\n $(obj).find('.msg').html((response.msg)?getMsg(response.msg,2):getMsg('Something went wrong.',2)).css('display','block');\n \n $(obj).find('.validate-form').html('Submit');\n $(obj).find('input[name=name]').focus();\n setTimeout(function(){$(obj).find('.msg').html('').css('display','none'); },5000);\n \n },\n error:function(response){\n $(obj).find('.validate-form').html('Submit');\n $(obj).find('.msg').html(getMsg('Something went wrong.',2)).css('display','block');\n }\n });\n}", "title": "" }, { "docid": "b809a5d04eaa5bd327bc981c8795d60e", "score": "0.710062", "text": "function submitValgomat(){\n\tmergeForms();\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"http://127.0.0.1:8888/public/postForm\",\n\t\tdata: $(\".final-form\").serializeArray(), // serializes the form's elements.\n\t\tsuccess: function(response){\n\t\t\t//DO SOMETHING\n\t\t\talert(response);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7b54942f77a1c357470fc8fa75bfdbc6", "score": "0.7081089", "text": "function frmIngreso(event, id){\r\n event.preventDefault();\r\n var opciones = {\r\n success: sendFormRedes\r\n }\r\n $('#'+id).ajaxSubmit(opciones);\r\n return false;\r\n}", "title": "" }, { "docid": "b2af44a4ba47c9c6f67d37aa1bb3bc8b", "score": "0.70784587", "text": "function ajaxFormSubmit() {\n\n let string = $(\".contact-form\").serialize(); // Serializing data\n // creating request\n $.ajax({\n type: \"POST\", // type of request - POST\n url: \"./php/mail.php\",\n data: string, // data to be sent\n\n // if success\n success: function (html) {\n $(\".contact-form\").slideUp(500);\n $('#answer').html(html);\n }\n });\n // Return false to stop executing of other functions in chain\n return false;\n }", "title": "" }, { "docid": "06496634d060f00e5a572fe1b2472a0e", "score": "0.7056467", "text": "function process_form(e) {\n // div which shows success message or error message(s)\n var $statusEl = document.getElementById('sms-status');\n // the phone number entered by the user\n var number = document.getElementById('sms-number').value;\n // the message entered by the user\n var message = document.getElementById('sms-message').value;\n // craft csrf token\n var csrf = document.getElementsByName('CRAFT_CSRF_TOKEN')[0].value;\n // hidden action field (default: twilioSms/Sms/sendSms)\n var action = document.getElementsByName('action')[0].value;\n\n // prevent form submit\n e.preventDefault();\n\n // disable the submit button to prevent double sending\n document.getElementById('sms-submit').disabled = true;\n\n // create a new ajax instance\n var http = new XMLHttpRequest();\n // all Craft post requests must be sent to /\n // with an action in the querystring of pluginHandle/Controller/methodName\n var url = '/';\n // querystring to send\n var data = '';\n\n // encode all our POST data because it gets sent as a querystring\n data += 'CRAFT_CSRF_TOKEN=' + encodeURIComponent(csrf); // craft csrf token\n data += '&action=' + encodeURIComponent(action); // action (default: twilioSms/Sms/sendSms)\n data += '&sms_user_phone=' + encodeURIComponent(number); // phone number entered by the user\n data += '&sms_message=' + encodeURIComponent(message); // message entered by the user\n\n // prepare ajax post\n http.open('POST', url, true);\n // send a header saying this is url encoded form data\n http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n // call anon function when the state changes\n http.onreadystatechange = function() {\n // the post was sent, re-enable the submit button\n document.getElementById('sms-submit').disabled = false;\n\n // make sure the status was a success\n if(http.readyState === 4 && http.status === 200) {\n // parse the response as json\n var res = JSON.parse(http.responseText);\n\n // if the message sent successfully\n if(res.success) {\n // reset the form\n form.reset();\n // display the success message\n $statusEl.innerHTML = res.msg;\n $statusEl.style.display = 'block';\n // the back end processor returned errors\n } else {\n // display the error message(s)\n var status = '<strong>The following errors occurred:</strong><br />';\n status += '<ul>';\n\n res.errors.forEach(function(error) {\n status += '<li>' + error + '</li>';\n });\n\n status += '</ul>';\n\n // display errors\n $statusEl.innerHTML = status;\n $statusEl.style.display = 'block';\n }\n }\n } // end http.onreadystatechange\n\n // send the post\n http.send(data);\n }", "title": "" }, { "docid": "8785e2b52edbbe8b77aaf0d171f7d3d7", "score": "0.7022062", "text": "function submitForm() {\nvar formData = $('.ui.form input').serialize(); \n$.ajax({\n type: 'POST',\n url: '/donation/donate',\n data: formData,\n success: function(response) { \n $('#notification').text(\"Thank you for your donation\");\n }\n});\n$('.form').trigger(\"reset\");\n}", "title": "" }, { "docid": "4dda13c7f6c5ee3ff6c7da56e1b49970", "score": "0.70022136", "text": "function send_form_to_server() {\n var my_form = $(\"form\")\n activate_loading()\n $.ajax({\n type: 'POST',\n url: \"handle_sim_ncontinous_env_ajax/\",\n data: my_form.serialize(),\n dataType: 'json',\n success: function (data) {\n $('#figure_results').empty()\n response = data\n list_Algorithms_name = data[\"list_Algorithms_name\"]\n x_range = data[\"number_of_steps\"]\n x_list = data['x_list']\n number_of_arms = data[\"number_of_arms\"]\n draw_figure(data)\n deactivate_loading()\n window.location.hash = '#figure_results';\n }\n });\n \n}", "title": "" }, { "docid": "24a024924d85c342e1e19f5621b77434", "score": "0.70018476", "text": "function sendCustomMail(e, form) {\n e.preventDefault();\n $(\"#loading\").fadeIn(500);\n\n console.log(\"form\",form);\n let data = new FormData(form);\n data.append('action','sendMail');\n for (var value of data.values()) {\n console.log(value);\n }\n\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.open('POST', './sendemail.php', true);\n\t\trequest.send(data);\n\n request.onreadystatechange=function(){\n if (request.readyState==4 && request.status==200){\n console.log(\"readyState\", request.readyState);\n form.reset();\n setTimeout(() => $(\"#loading\").fadeOut(500), 3000);\n }\n }\n\n\t\t/*jQuery.ajax({\n\t\t\t'url': \"./sendemail.php?action=sendMail\",\n\t\t\tdata: {\n\t\t\t\temail: jQuery('#email').val(),\n\t\t\t\tname: jQuery('#name').val(),\n\t\t\t\tmsg: jQuery('#msg').val()\n\t\t\t},\n\t\t\tmethod: \"POST\",\n\t\t\tcomplete: function(r) {\n\n\t\t\t\t$(\"#loading-modalbox\").modal(\"hide\");\n\t\t\t\tif (r.responseText == 'Y') {\n\n\t\t\t\t\tjQuery('#email').val('');\n\t\t\t\t\tjQuery('#name').val('');\n\t\t\t\t\tjQuery('#msg').val('Hello, ');\n\n\t\t\t\t\t$(\"#result-modalbox\").find(\"h2\").text(\"Thank you!\\n\\n Our manager will contact you in a short time.\");\n\t\t\t\t\t$(\"#result-modalbox\").modal(\"show\");\n\t\t\t\t\treturn true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$(\"#result-modalbox\").find(\"h2\").text(\"Email hadn't been sent due to technical reasons! Please try again.\");\n\t\t\t\t\t$(\"#result-modalbox\").modal(\"show\");\n\t\t\t\t\treturn false;\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t});*/\n\n }", "title": "" }, { "docid": "4ff085b379e2c3cee4b9ff6c342c3053", "score": "0.6961395", "text": "function submitForm(){\n var $contactForm = $('.form');\n $contactForm.submit(function(e){\n var addr = 'andy' + '.' + 'l' + '.' + 'tang' + '@' + 'outlook' + '.' + 'com';\n var fulladdr = '//formspree' + '.' + 'io/' + addr;\n $contactForm.attr('action', fulladdr);\n\n e.preventDefault();\n $.ajax({\n url: fulladdr,\n method: 'POST',\n data: $(this).serialize(),\n dataType: 'json',\n beforeSend: function() {\n $contactForm.find(\".form-response\").text(\"Sending your message...\");\n },\n success: function(data) {\n $contactForm.find(\".form-response\").text(\"Message sent!\");\n $contactForm.find(\".form-submit\").css({opacity: 1.0, visibility: \"visible\"}).animate({opacity: 0}, 300);\n $contactForm.find(\".form-submit\").prop(\"disabled\", true);\n },\n error: function(err) {\n $contactForm.find(\".response\").text(\"Oops, something went wrong.\");\n }\n });\n });\n }", "title": "" }, { "docid": "a56a5d6b44f641fae51085adbb6c585b", "score": "0.6940732", "text": "static postForm(form, data, contentType) {\n return $.ajax({\n url: form.action,\n type:\"POST\",\n data,\n contentType,\n dataType: \"json\",\n })\n }", "title": "" }, { "docid": "4d14b9906fa055f3a2da9fadfe81ac91", "score": "0.6897032", "text": "function xhr(){\n\n\t\t\t// Creates query string of additional form input data\n\t\t\tvar data = ($.isEmptyObject(config.data)) ? '' : '&'+$.param(config.data);\n\n\t\t\t// Returns jQuery Ajax object\n\t\t\treturn $.ajax({\n\t\t\t\ttype: form.attr('method'),\n\t\t\t\turl: form.attr('action'),\n\t\t\t\tdata: form.serialize() + data,\n\t\t\t\tcache: false,\n\t\t\t\tdataType: 'json'\n\t\t\t})\n\t\t\t.always(function(){\n\n\t\t\t\t// Ends loading\n\t\t\t\tloading(false);\n\n\t\t\t})\n\t\t\t.fail(function(){\n\n\t\t\t\t// Logs XHR error\n\t\t\t\tconsole.log('XHR failed!');\n\n\t\t\t});\n\n\t\t}", "title": "" }, { "docid": "32ee447245da620a27c1f597aa3150a5", "score": "0.68629754", "text": "function sendFanchiseEnquiry(obj,e) {\n e.preventDefault();\n $(obj).find('.msg').html('').css('display','none');\n $.ajax({\n url:FRONTAJAX,\n method:'POST',\n data: new FormData(obj),\n contentType: false,\n cache: false,\n processData:false,\n success:function(response){\n if(response.valid){\n $(obj).find('.msg').html(getMsg(response.msg,1)).css('display','block');\n ResetTextBox(obj);\n setTimeout(function(){window.location.reload(); },5000);\n }else\n $(obj).find('.msg').html((response.msg)?getMsg(response.msg,2):getMsg('Something went wrong.',2)).css('display','block');\n \n $(obj).find('.validate-form').html('Submit');\n setTimeout(function(){$(obj).find('.msg').html('').css('display','none'); },5000);\n grecaptcha.reset(); \n },\n error:function(response){\n $(obj).find('.validate-form').html('Submit');\n $(obj).find('.msg').html(getMsg('Something went wrong.',2)).css('display','block');\n grecaptcha.reset();\n }\n });\n}", "title": "" }, { "docid": "0172c1f4ba0adbfedc1f28322f5687ec", "score": "0.6856359", "text": "function submitForm() {\n const form = id(formId);\n const formData = new FormData(form); \n // console.log('submitForm FormData:');\n // for (var entry of formData.entries()) {\n // console.log(entry[0]+ ', ' + entry[1]); \n // }\n const xhr = new XMLHttpRequest();\n xhr.open(formMethod, formAction);\n xhr.onreadystatechange = function() {\n if (xhr.readyState == (4 || XMLHttpRequest.DONE)) { \n if (xhr.status >= 200 && xhr.status < 400) { //loading finished //200-299 = success 300-399 = redirect\n const response = safelyParseJSON(this.responseText);\n // console.log(this.responseText);\n if (response.success === true) { // php returns success === true\n msg(true, response.message); // success message\n } else { // php returns error\n msg(false, response.message); // error message\n }\n } else { // http error - display fallback error message\n const message = 'Sorry the form is not available at the moment, please try again later.';\n msg(false, message); // error message\n }\n } \n }\n xhr.send(formData);\n }", "title": "" }, { "docid": "b39883044585244006714c9b7b2f3378", "score": "0.6849696", "text": "function formSubmit(e) {\n e.preventDefault();\n var name = document.getElementsByName(\"name\")[0].value;\n var email = document.getElementsByName(\"email\")[0].value;\n var comments = document.getElementsByName(\"comments\")[0].value;\n ajaxGET(\"send-form.php?email=\" + email + \"&name=\" + name + \"&comments=\" + comments, cbFormValidate);\n}", "title": "" }, { "docid": "865154a72ccb2d21d4ccda8de8dd3e40", "score": "0.68007314", "text": "function sendRequest(event){\n event.preventDefault();\n var data = $el.serialize();\n $.post(url,data,function(response){\n $el.next().text(response)\n $el.find('input:not(name=\"_token\")').val('');\n })\n }", "title": "" }, { "docid": "2cf3d5e1cc8e93042bcb3dc660c80414", "score": "0.6800264", "text": "function sendData() {\n // get form data\n var formData = {\n 'name': $('input[name=name]').val(),\n 'email': $('input[name=email]').val(),\n 'phone': $('input[name=phone]').val(),\n };\n console.log(formData)\n $.ajax({\n type: 'POST',\n url: '/participate',\n data: formData,\n dataType: 'json',\n encode: true\n }).done(function (data) {\n console.log(data)\n if (data.success) {\n // form is no longer required, remove it\n $('#theFormDiv').css(\"display\",\"none\");\n // display success message\n $(\"#successSpan\").css(\"display\", \"block\");\n $(\".container\").css(\"background-color\", \"rgba(27, 25, 187, 0.2)\");\n } else {\n $('.error').text(data.error);\n $(\".error\").css(\"display\", \"block\");\n killerrors();\n }\n // enable the button\n $(\"button\").addClass('activeButton');\n $(\"button\").removeClass('disableButton');\n $(\"button\").prop(\"disabled\", false);\n });\n}", "title": "" }, { "docid": "436684cba72802e29da7e56313fe0c7a", "score": "0.67797023", "text": "function submit_form(value) {\n var action;\n var posturl;\n\n if (gkid > 0) {\n action = \"PATCH\";\n posturl = \"http://127.0.0.1:8000/customers/\" + gkid + \"/\";\n } else {\n action = \"POST\";\n posturl = \"http://127.0.0.1:8000/customers/\";\n }\n // TODO: Use ajax\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(action, posturl);\n xmlhttp.setRequestHeader(\"Content-Type\", \"application/json\");\n request.onload = function () {\n // TODO: Error checking\n\n }\n xmlhttp.send(JSON.stringify(value, null, \" \"));\n window.location.replace(\"{% url 'kunder' %}\");\n}", "title": "" }, { "docid": "a9cb06edce236fb7a101b2652d9e62a8", "score": "0.67761564", "text": "function makeFormAjax(forms, successMessage){\n\n for(var i = 0; i < forms.length; i++){\n forms[i].addEventListener('click', function(evt){\n evt.preventDefault();\n evt.stopPropagation();\n var form = evt.currentTarget;\n var inputs = form.getElementsByTagName(\"input\");\n var csrfToken = inputs[0].value;\n //the -1 is to ensure we don't encode \n // the submit button :P\n var data = {};\n for(var j = 0; j < inputs.length-1; j++){\n data[inputs[j].name] = inputs[j].value;\n }\n var http = new XMLHttpRequest();\n http.open(\"POST\", form.getAttribute(\"action\"), true);\n http.setRequestHeader(\"Content-Type\", \"application/json\");\n http.setRequestHeader(\"x-csrf-token\", csrfToken);\n http.onreadystatechange = function(){\n if(http.readyState == 4 && http.status==200){\n console.log(evt.target);\n evt.target.value = successMessage; \n evt.target.disabled = true;\n \n }\n }\n http.send(JSON.stringify(data));\n });\n }\n}", "title": "" }, { "docid": "0f5b6bca0c4f3579f96ee7ee80c358a7", "score": "0.6757363", "text": "function submitForm(){\n \n document.getElementById('regForm').style.display = \"none\";\n\n $.ajax({\n method: 'POST',\n url: 'http://localhost:7000/submit-record',\n beforeSend: function(req) {\n req.setRequestHeader('Authorization', getCookie('token'));\n req.setRequestHeader(\"Content-Type\", \"application/json\");\n },\n data: JSON.stringify({\n \"employee\": $('#employee-selection option:selected').text(),\n \"receiver\": $('#receiver').val(),\n \"requester\": $('#requester-nama').text(),\n \"position\": $('#position-list').val(),\n 'behalf-name': $('#behalf-name').val(),\n 'behalf-position' : $('#behalf-position').val(),\n \"distribution\": $('#distribution-cost').val(),\n \"date\": $('#date-start').val(),\n \"comment\": $('#comment-requester').val()\n }),\n success: function(res){\n console.log(res)\n },\n error: function(err){\n console.log(err)\n }\n })\n}", "title": "" }, { "docid": "f7ba935620d91e3bbd3634349abc7e5b", "score": "0.6754612", "text": "function sendCorporateEnquiry(obj,e) {\n\n e.preventDefault();\n $(obj).find('.msg').html('').css('display','none');\n $.ajax({\n url:FRONTAJAX,\n method:'POST',\n data: new FormData(obj),\n contentType: false,\n cache: false,\n processData:false,\n success:function(response){\n\n if(response.valid){\n $(obj).find('.msg').html(getMsg(response.msg,1)).css('display','block');\n ResetTextBox(obj);\n setTimeout(function(){window.location.reload(); },5000);\n }else\n $(obj).find('.msg').html((response.msg)?getMsg(response.msg,2):getMsg('Something went wrong.',2)).css('display','block');\n \n $(obj).find('.validate-form').html('Submit');\n $(obj).find('input[name=name]').focus();\n setTimeout(function(){$(obj).find('.msg').html('').css('display','none'); },5000);\n \n },\n error:function(response){\n\n $(obj).find('.validate-form').html('Submit');\n $(obj).find('.msg').html(getMsg('Something went wrong.',2)).css('display','block');\n }\n });\n}", "title": "" }, { "docid": "d579b1b7ed8874fa0f38d96c3e9217d7", "score": "0.6754543", "text": "function _formSend(form)\n\t{\n\t\tvar xhttp=_loadHTTP();\n\t\tvar receiver=document.getElementById('msgF'); // elemento recebe\n\t\treceiver.innerHTML='<img src=\"ajax-loader.gif\" /> enviando ...'; // animacao carregando\n\t\tvar variable=\"\"; // nao pode ser nulo tem que ser vazio\n\t\tfor(var i=0; i<form.length; i++)\n\t\t\t{\n\t\t\t\tif(form.elements[i].tagName.toLowerCase()==\"input\" || form.elements[i].tagName.toLowerCase()==\"select\" || form.elements[i].tagName.toLowerCase()==\"textarea\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif(form.elements[i].type.toLowerCase()==\"file\")\n\t\t\t\t\t\t\talert('ERRO: Não é possível enviar arquivos por AJAX!');\n\t\t\t\t\t\tif(form.elements[i].type.toLowerCase()==\"radio\" || form.elements[i].type.toLowerCase()==\"checkbox\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(form.elements[i].checked)\n\t\t\t\t\t\t\t\t\tvariable+=form.elements[i].name+\"=\"+escape(form.elements[i].value)+\"&\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t else\n\t\t\t\t\t\t\tvariable+=form.elements[i].name+\"=\"+escape(form.elements[i].value)+\"&\";\n\t\t\t\t\t}\n\t\t\t}\n\t\txhttp.open(form.method, form.action, true);\n\t\txhttp.setRequestHeader(\"Content-Type\", form.enctype);\n\t\txhttp.setRequestHeader(\"Cache-Control\", \"no-store, no-cache, must-revalidate\");\n\t\txhttp.setRequestHeader(\"Cache-Control\", \"post-check=0, pre-check=0\");\n\t\txhttp.setRequestHeader(\"Pragma\", \"no-cache\");\n\t\t// executada quando o navegador obter codigo\n\t\txhttp.onreadystatechange=function()\n\t\t\t{\n\t\t\t\tif(xhttp.readyState==4)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar content=xhttp.responseText; // le o texto\n\t\t\t\t\t\tvar receiver=document.getElementById('formD'); // exibe conteudo\n\t\t\t\t\t\treceiver.innerHTML=content; // elemento recebe conteudo\n\t\t\t\t\t}\n\t\t\t}\n\t\txhttp.send(variable);\n\t\treturn(false);\n\t}", "title": "" }, { "docid": "862b366f8df9b61fc2639549c30a1d73", "score": "0.6743925", "text": "function onsubmitmessageform(evt) {\n evt.preventDefault();\n console.log(evt, document.forms);\n var message = {\n value: document.forms[\"message-sender\"][\"message-value\"].value,\n color: document.forms[\"message-sender\"][\"message-color\"].value,\n to:Number (document.forms[\"message-sender\"][\"message-to\"].value),\n dateTime: new Date().toISOString(),\n userId: whoiam.id\n //user:whoiam\n }\n\n console.log(message);\n\n document.forms[\"message-sender\"].reset();\n document.forms[\"message-sender\"][\"message-to\"].selectedIndex = -1;\n\n xhr('http://localhost:5629/messages',\n function (responseDuServeur) {\n responseDuServeur = JSON.parse(responseDuServeur);\n responseDuServeur.user = whoiam;\n apendMessageOnDOM(responseDuServeur, messageTemplate)\n },\n 'POST',\n message\n );\n ;\n}", "title": "" }, { "docid": "d2c4d238f47a3d66fa5d5df181b7186a", "score": "0.6731934", "text": "function frm_add_responsable() {\n\t$('#frm_add_responsable').submit(function(e) {\n\t\te.preventDefault();\n\t\tvar dataForm = $(this).serialize();\n\t\t$.ajax({\n\t\t\turl: 'controller/puente.php',\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata: dataForm,\n\t\t\tasync:false,\n\t\t\tcache:false,\n\t\t})\n\t\t.done(function(response) {\n\t\t\talerta('m_responsable',response.status,response.message,'modal_add_responsable');\n\t\t\tdocument.getElementById('frm_add_responsable').reset();\n\t\t\tgetExpedientes();\n\t\t})\n\t\t.fail(function(jqXHR,textStatus,errorThrow) {\n\t\t\tconsole.log(\"Error: \"+jqXHR.responseText);\n\t\t});\n\t\t\n\t});\n}", "title": "" }, { "docid": "c6084f1e7ca27a99b146a95f1ca8f6d8", "score": "0.67313397", "text": "function ajaxContactForm(){\n\t\t\n\t\t$('body').on( 'submit', '#contact-form.ajax-contact-form', function(){\n\t\t\tvar $this = $(this);\n\t\t\t$this.closest('form').submit\n\t\t});\n\t\t\n\t\t\n\t\n\t\t$('#cf-wrapper.ajax-contact-form').on('submit', 'form#cf-form', function(e) {\n\t\t\te.preventDefault();\n\t\t\tvar $this = $(this);\n\t\t\tvar $loadingGif = '<div style=\"width:50px;height:50px;display:inline-block;background:none\" class=\"lm-loadingscreen loading-screen\"><div class=\"loading-screen-inner\"><div class=\"loading-icon\"></div></div></div>';\n\t\t\t$this.find('#cf-submit-wrapper').html( $loadingGif );\n\t\t\t\n\t\t\tvar data = $this.serialize();\n\t\t\t$.post(the1Globals.ajaxUrl, data, function(response) {\n\t\t\t\t$('#cf-wrapper').html(response);\n\t\t\t});\n\t\t\t//overlayer('<div id=\"saving\">saving...</div>');\n\t\t\treturn false;\n\t\t});\n\t\t\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "cfa2e3d28db185361940ed04341a04ac", "score": "0.67061085", "text": "enviaForm(event) {\r\n event.preventDefault();\r\n\r\n $.ajax({\r\n url: 'http://cdc-react.herokuapp.com/api/autores',\r\n contentType: 'application/json',\r\n dataType: 'json',\r\n type: 'post',\r\n data: JSON.stringify({nome:this.state.nome, email:this.state.email, senha:this.state.senha}),\r\n success:function(newListPublic){\r\n //Disparar um aviso geral \r\n PublicSubscriber.publish('newListPublic', newListPublic);\r\n this.setState({ nome:'', email:'', senha:'' }); //limpar campos\r\n }.bind(this),\r\n error(response){\r\n if(response.status === 400){\r\n new MyHandleBugs().publicErrors(response.responseJSON);\r\n }\r\n },\r\n beforeSend: function(){\r\n PublicSubscriber.publish(\"clear-errors\", {});\r\n }\r\n });\r\n }", "title": "" }, { "docid": "fb117e819370660eae6aac95a384c2c5", "score": "0.66940415", "text": "function frm_add_eprocesal() {\n\t$('#frm_add_eprocesal').submit(function(e) {\n\t\te.preventDefault();\n\t\tvar dataForm = $(this).serialize();\n\t\t$.ajax({\n\t\t\turl: 'controller/puente.php',\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata: dataForm,\n\t\t\tasync:false,\n\t\t\tcache:false,\n\t\t})\n\t\t.done(function(response) {\n\t\t\talerta('m_eprocesal',response.status, response.message,'modal_add_eprocesal');\n\t\t})\n\t\t.fail(function(jqXHR,textStatus,errorThrow) {\n\t\t\tconsole.log(\"Error: \"+jqXHR.responseText);\n\t\t});\n\t\t\n\t});;\n}", "title": "" }, { "docid": "54bb264cfade16500d93c1ee826fad55", "score": "0.6682499", "text": "function sendIdForm()\n{\n //get the form object\n var form= document.getElementById(\"searchId\");\n // collect the form data while iterating over the inputs\n var data = {};\n for (var i = 0, ii = form.length; i < ii; ++i) {\n var input = form[i];\n if (input.name) {\n data[input.name] = input.value;\n }\n }\n\n //console.log(data);\n\n // construct an HTTP request\n var xhr = new XMLHttpRequest();\n xhr.open(form.method, form.action, true);\n xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n\n // send the collected data as JSON\n xhr.send(JSON.stringify(data));\n\n xhr.onloadend = function () \n {\n var result=xhr.responseText;\n console.log(result);\n };\n // location.reload();\n}", "title": "" }, { "docid": "84599ebeaa061089931cf88089beafb8", "score": "0.66656554", "text": "submit(e) {\n e.preventDefault();\n this.currentStep++;\n this.updateForm();\n\n $.ajax({\n url: \"/add_donation/\",\n type: \"POST\",\n data: $('form').serializeArray(),\n\n success: function (json) {\n if (json['response']) {\n window.location.replace(\"/confirmation_donation/\");\n } else {\n console.log('the donation object was not saved')\n }\n },\n\n error: function () {\n console.log('something went wrong!');\n }\n });\n }", "title": "" }, { "docid": "b8f0df07f5a7c08ba13481765105d25f", "score": "0.6653419", "text": "function formSendEmail() {\n $('.loading').css(\"display\", \"block\");\n var urlFormSave = $Ctr_sendemail + 'shared_blog';\n var dataToSave = $(\"#shared_email_blog\").serialize();\n\n $.ajax({\n type: \"POST\",\n cache: true,\n url: urlFormSave,\n data: dataToSave,\n dataType: \"json\",\n success: function (data) {\n $('.loading').css(\"display\", \"none\");\n if (data.response) {\n\n DialogSuccess(data.message, data.return);\n\n } else {\n DialogError(data.message);\n }\n\n },\n error: function (xhr, textStatus, errorThrown) {\n $('.loading').css(\"display\", \"block\");\n DialogError(xhr.responseText);\n return false;\n }\n });\n}", "title": "" }, { "docid": "62680c4698ce0fccae741fe36ef1ca64", "score": "0.6648957", "text": "function sendSelected() {\n if(!postHandler){\n addForm();\n reset();\n //Creates a XMLHttpRequest\n var xhr = new XMLHttpRequest();\n xhr.open('POST', POST_URL, true);\n xhr.onreadystatechange = function () {\n if (xhr.readyState != 4) {\n //When the response is received, we check if it is not empty, and if not, we create the download button\n let response = xhr.responseText;\n console.log(response);\n if (response != '')\n createDownload(response);\n return;\n }\n if (xhr.status != 200) {\n return;\n }\n }\n xhr.send(formData);\n }\n}", "title": "" }, { "docid": "771ea15e2e604e46dceb24fb1515b278", "score": "0.663949", "text": "function register_submit(){\npost_json('register-ajax.php', $('#register').serialize(), data=>{$('#message').text(data.message)} )\n}", "title": "" }, { "docid": "4a306b2120cd64f90b24dadb5c4cdf25", "score": "0.6633542", "text": "function doFormStuff(modal) {\n var $context = modal,\n $closeButton = $('.modal-button__close', $context),\n $thanksCloseBtn = $('.-close', $context),\n $inputs = $('.modal-input', $context),\n $fullname = $('#fullName', $context),\n $jobtitle = $('#jobTitle', $context),\n $workEmail = $('#workEmail', $context),\n $phoneNumber = $('#phoneNumber', $context),\n $companyName = $('#companyName', $context),\n $numEmployees = $('#numEmployees', $context),\n $submit = $('#requestDemo', $context),\n validEmail = /^[-a-z0-9~!$%^&*_=+}{\\'?]+(\\.[-a-z0-9~!$%^&*_=+}{\\'?]+)*@([a-z0-9_][-a-z0-9_]*(\\.[-a-z0-9_]+)*\\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|jobs|name|mobi|[a-z][a-z])|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,5})?$/i,\n $headerRequest = $('.modal-header.-request', $context),\n $headerThanks = $('.modal-header.-thanks', $context),\n $bodyRequest = $('.modal-content.-request', $context),\n $bodyThanks = $('.modal-content.-thanks', $context),\n $successName = $('.form-firstname', $context);\n\n function sendToMixPanel() {\n var postData = {\n 'Fullname': $fullname.val(),\n 'Jobtitle': $jobtitle.val(),\n 'Email': $workEmail.val(),\n 'Phone': $phoneNumber.val(),\n 'Company': $companyName.val(),\n 'Employees': $numEmployees.val()\n };\n var apiData = {\n \"FullName\": $fullname.val(),\n \"JobTitle\": $jobtitle.val(),\n \"Email\": $workEmail.val(),\n \"Phone\": $phoneNumber.val(),\n \"Company\": $companyName.val(),\n \"Employees\": $numEmployees.val()\n };\n apiData = JSON.stringify(apiData);\n $.ajax({\n type: \"POST\",\n url: 'https://a3uz2ncpl3.execute-api.us-west-2.amazonaws.com/prod/send_email',\n data: apiData,\n success: function(resp){\n console.log(\"got message\");\n },\n error: function () {\n console.log(\"error in the api call\");\n },\n dataType: 'json'\n });\n mixpanel.track(\n 'DemoRequest',\n postData,\n function(e){\n console.log('Mixpanel tracked!');\n console.log(e);\n $successName.html($fullname.val());\n $headerRequest.hide();\n $bodyRequest.hide();\n $headerThanks.show();\n $bodyThanks.show();\n // go to the thank you page\n }\n );\n }\n\n function validateForm() {\n var valid = true;\n\n if ($fullname.val() === '') {\n $fullname.addClass('-error');\n } else {\n $fullname.removeClass('-error');\n }\n if ($jobtitle.val() === '') {\n $jobtitle.addClass('-error');\n } else {\n $jobtitle.removeClass('-error');\n }\n if ($workEmail.val() === '' || !validEmail.test($workEmail.val())) {\n $workEmail.addClass('-error');\n } else {\n $workEmail.removeClass('-error');\n }\n if ($phoneNumber.val() === '') {\n $phoneNumber.addClass('-error');\n } else {\n $phoneNumber.removeClass('-error');\n }\n if ($companyName.val() === '') {\n $companyName.addClass('-error');\n } else {\n $companyName.removeClass('-error');\n }\n if ($numEmployees.val() === '0') {\n $numEmployees.addClass('-error');\n } else {\n $numEmployees.removeClass('-error');\n }\n\n $inputs.each(function(i,e) {\n console.log(e);\n if ($(e).hasClass('-error')) {\n valid = false;\n }\n })\n if ($numEmployees.val() === '0') {\n valid = false;\n }\n\n if (valid === true) {\n sendToMixPanel()\n }\n }\n\n $submit.click(function(e) {\n e.preventDefault();\n // verify that fields are filled\n validateForm();\n })\n\n $thanksCloseBtn.click(function(e) {\n e.preventDefault();\n closeSlider();\n })\n\n modal.click(function(e) {\n // close the modal when user clicks on the overlay\n if ($(e.target).hasClass('modal-overlay')) {\n modal.empty();\n modal.removeClass('-active');\n modal.remove();\n $('body').css('overflow','visible');\n window.location.hash = '#close';\n }\n })\n\n $(window).on('hashchange', function() {\n if (window.location.hash !== '#requestInfo') {\n $closeButton.trigger('click');\n }\n });\n\n $closeButton.click(function(e) {\n e.preventDefault();\n closeSlider();\n });\n\n }", "title": "" }, { "docid": "71af9dde9138feeac730edf21dc44847", "score": "0.6629462", "text": "function doFormStuff(modal) {\n var $context = modal,\n $closeButton = $('.modal-button__close', $context),\n $headerCloseButton = $('.modal-header__close', $context),\n $thanksCloseBtn = $('.-close', $context),\n $inputs = $('.modal-input', $context),\n $fullname = $('#fullName', $context),\n $jobtitle = $('#jobTitle', $context),\n $workEmail = $('#workEmail', $context),\n $phoneNumber = $('#phoneNumber', $context),\n $companyName = $('#companyName', $context),\n $numEmployees = $('#numEmployees', $context),\n $submit = $('#requestDemo', $context),\n validEmail = /^[-a-z0-9~!$%^&*_=+}{\\'?]+(\\.[-a-z0-9~!$%^&*_=+}{\\'?]+)*@([a-z0-9_][-a-z0-9_]*(\\.[-a-z0-9_]+)*\\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|jobs|name|mobi|[a-z][a-z])|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,5})?$/i,\n $headerRequest = $('.modal-header.-request', $context),\n $headerThanks = $('.modal-header.-thanks', $context),\n $bodyRequest = $('.modal-content.-request', $context),\n $bodyThanks = $('.modal-content.-thanks', $context),\n $successName = $('.form-firstname', $context);\n\n function sendToMixPanel() {\n var postData = {\n 'Fullname': $fullname.val(),\n 'Jobtitle': $jobtitle.val(),\n 'Email': $workEmail.val(),\n 'Phone': $phoneNumber.val(),\n 'Company': $companyName.val(),\n 'Employees': $numEmployees.val()\n };\n var apiData = {\n \"FullName\": $fullname.val(),\n \"JobTitle\": $jobtitle.val(),\n \"Email\": $workEmail.val(),\n \"Phone\": $phoneNumber.val(),\n \"Company\": $companyName.val(),\n \"Employees\": $numEmployees.val()\n };\n apiData = JSON.stringify(apiData);\n $.ajax({\n type: \"POST\",\n url: 'https://a3uz2ncpl3.execute-api.us-west-2.amazonaws.com/prod/send_email',\n data: apiData,\n success: function(resp){\n console.log(\"got message\");\n },\n error: function () {\n console.log(\"error in the api call\");\n },\n dataType: 'json'\n });\n mixpanel.track(\n 'DemoRequest',\n postData,\n function(e){\n console.log('Mixpanel tracked!');\n console.log(e);\n $successName.html($fullname.val());\n $headerRequest.hide();\n $bodyRequest.hide();\n $headerThanks.show();\n $bodyThanks.show();\n // go to the thank you page\n }\n );\n }\n\n function validateForm() {\n var valid = true;\n\n if ($fullname.val() === '') {\n $fullname.addClass('-error');\n } else {\n $fullname.removeClass('-error');\n }\n if ($jobtitle.val() === '') {\n $jobtitle.addClass('-error');\n } else {\n $jobtitle.removeClass('-error');\n }\n if ($workEmail.val() === '' || !validEmail.test($workEmail.val())) {\n $workEmail.addClass('-error');\n } else {\n $workEmail.removeClass('-error');\n }\n if ($phoneNumber.val() === '') {\n $phoneNumber.addClass('-error');\n } else {\n $phoneNumber.removeClass('-error');\n }\n if ($companyName.val() === '') {\n $companyName.addClass('-error');\n } else {\n $companyName.removeClass('-error');\n }\n if ($numEmployees.val() === '0') {\n $numEmployees.addClass('-error');\n } else {\n $numEmployees.removeClass('-error');\n }\n\n $inputs.each(function(i,e) {\n console.log(e);\n if ($(e).hasClass('-error')) {\n valid = false;\n }\n })\n if ($numEmployees.val() === '0') {\n valid = false;\n }\n\n if (valid === true) {\n sendToMixPanel()\n }\n }\n\n $submit.click(function(e) {\n e.preventDefault();\n // verify that fields are filled\n validateForm();\n })\n\n function closeSlider() {\n $('.modal-contents', modal).removeClass('-active');\n setTimeout(function() {\n modal.removeClass('-active');\n modal.empty();\n modal.remove();\n $('body').css('overflow','visible');\n window.location.hash = 'close';\n },300)\n }\n\n $closeButton.click(function(e) {\n e.preventDefault();\n closeSlider();\n });\n\n $headerCloseButton.click(function(e) {\n e.preventDefault();\n closeSlider();\n });\n\n $thanksCloseBtn.click(function(e) {\n e.preventDefault();\n closeSlider();\n })\n\n modal.click(function(e) {\n // close the modal when user clicks on the overlay\n if ($(e.target).hasClass('modal-overlay')) {\n closeSlider();\n }\n })\n\n $(window).on('hashchange', function() {\n if (window.location.has !== 'requestInfo') {\n $closeButton.trigger('click');\n }\n });\n\n }", "title": "" }, { "docid": "a577b8ace371839af691b9a7e9411739", "score": "0.66262203", "text": "function ajax_send_info(data){\n var request = new XMLHttpRequest();\n request.open('POST', '/', true);\n request.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n request.send(data);\n request.onreadystatechange = function (e) {\n if(request.readyState == 4 && request.status == 200) {\n var res = request.responseText;\n console.log(res);\n alert(\"Данные отправлены на сервер!\");\n window.location.reload();\n }\n }\n}", "title": "" }, { "docid": "bf6ae7d3f753515dffbae874709b6773", "score": "0.6612733", "text": "function frm_edo_procesal(){\n\t$('#frm_edo_procesal').submit(function(e) {\n\t\te.preventDefault();\n\t\tvar dataForm = $(this).serialize();\n\t\tconsole.log('Preparando la info para enviar al modelo.')\n\t\t$.ajax({\n\t\t\turl: 'controller/puente.php',\n\t\t\ttype: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata: dataForm,\n\t\t\tasync:false,\n\t\t\tcache:false\n\t\t})\n\t\t.done(function(response) {\n\t\t\talerta('div_edo',response.status,response.message,'');\n\t\t})\n\t\t.fail(function(jqXHR,textStatus,errorThrow) {\n\t\t\talerta('div_edo','error',jqXHR.responseText,'');\n\t\t});\n\t});\n\treturn false;\n}", "title": "" }, { "docid": "0a181a9ce5e7da40dde38aef042b2b69", "score": "0.6607385", "text": "subscription_send_mail() {\n\t\tlet form_btn = document.querySelector('#subsc_form .btn');\n\t\tlet input = document.querySelector('#subsc_form .subsc_email');\n\t\tif (form_btn == null) {\n\t\t\treturn;\n\t\t}\n\t\tform_btn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\tif (input.value.trim() == '') {\n\t\t\t\tshake_element('#subsc_form .subsc_email');\n\t\t\t\treturn false;\n\t\t\t} else if (ajax_form_process.request_in_progess != false) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tajax_form_process.set_dynamic_values({\n\t\t\t\te: e,\n\t\t\t\tform_id: 'subsc_form',\n\t\t\t\twhich_form: 'subscription_form'\n\t\t\t});\n\t\t\tajax_form_process.call_of_ajax({\n\t\t\t\te: e,\n\t\t\t\thas_form: true\n\t\t\t});\n\t\t}, false);\n\t}", "title": "" }, { "docid": "c154de5820597aa01b681ef666ba2b38", "score": "0.6600229", "text": "message_send_mail() {\n\t\tlet form_btn = document.querySelector('#send_msg_to_admin_form .btn');\n\t\tlet input = document.querySelector('#send_msg_to_admin_form #contact_info');\n\t\tif (form_btn == null) {\n\t\t\treturn;\n\t\t}\n\t\tform_btn.addEventListener('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\tif (input.value.trim() == '') {\n\t\t\t\tshake_element('#send_msg_to_admin_form #contact_info');\n\t\t\t\treturn;\n\t\t\t} else if (ajax_form_process.request_in_progess != false) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tajax_form_process.set_dynamic_values({\n\t\t\t\te: e,\n\t\t\t\tform_id: 'send_msg_to_admin_form',\n\t\t\t\twhich_form: 'message_to_developer_form'\n\t\t\t});\n\t\t\tajax_form_process.call_of_ajax({\n\t\t\t\te: e,\n\t\t\t\thas_form: true\n\t\t\t});\n\t\t}, false);\n\t}", "title": "" }, { "docid": "fa00258f6180fbe44efa250d72bd5fcf", "score": "0.65980566", "text": "function sendForm() {\n let isOk = inputVal();\n if (isOk == false) {\n return;\n }\n alert(\"Registered!\");\n $.post(\"api/register\", $(\"#courseReg\").serialize());\n window.location.replace(\"details.html?courseid=\" + courseId);\n return false;\n }", "title": "" }, { "docid": "cee7b5b468379093bae3264d51c0ef72", "score": "0.65961236", "text": "function SubmitClient()\r\n{\r\n\tif($(\"#SignupForm\").valid())\r\n {\r\n\t outils.ajaxRequestPlus(outils.url + '/utilisateurs/' + outils.cookie + '/clients',\"PUT\",$(\"#SignupForm\").serialize(),function(donnees){\r\n\t document.location.href= \"formulaire.html\";\r\n\t });\r\n }\r\n}", "title": "" }, { "docid": "ab003aa0a36eb6b5857dd88e74cfedbc", "score": "0.6591937", "text": "function ajaxFormSubmissionSuccess(target,data) {\n\ttry{\n\t\tdata = data.trim();\n\t\tdata = $.parseJSON(data);\n\t\tif (typeof(ajaxFormSuccess) ==='function') {\n\t\t\tajaxFormSuccess(target.attr(\"name\"),data);return;\n\t\t}\n\t\telse{\n\t\t\tshowNotification(data.status,data.message);\n\t\t\tif (data.status && target!==null ) {\n\t\t\t\t//if the insert is an insert command just clear the form else leave the form u\n\t\t\t\tif (target.attr('action').indexOf('add')!==-1) {\n\t\t\t\t\tclearForm(target);\n\t\t\t\t}\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tcatch(err){\n\t\tshowNotification(false,data);\n\t}\n}", "title": "" }, { "docid": "5c21b67a282f35ce993861b1f4280467", "score": "0.65880215", "text": "function sendData(e){\n e.preventDefault(); // do not refresh the page\n\n //get first form infos and url\n url_and_form = get_ref_form_infos(e)\n\n response_data = url_and_form['data']\n form_url = url_and_form['form_url']\n \n //post selected references\n $.ajax({\n url: form_url,\n method: \"POST\",\n data: response_data,\n type: 'JSON',\n success: function(response) {\n //console.log(response)\n //render next form with infos to fulfill\n console.log(response['forms'])\n \n //disable select\n form_id = '#' + e.target.getAttribute('id')\n console.log('Form received: ')\n console.log(response['forms'].length)\n //get parent div (col-md-12)\n parent_div_node = e.target.parentNode.parentNode\n\n //get form 2 div node\n div_node = parent_div_node.children[1]\n console.log('node:')\n console.log(div_node)\n \n nb_form = 0\n for(var i=0;i<response['forms'].length;i++){\n //get form instance\n let instance = response['instances'][i]\n //get form\n form = response['forms'][i]\n console.log(form)\n //get reference\n reference = response['references'][i]\n //display new form\n form_submit_action = 'sendDataFormInfo(event);'\n form_node = DisplayInfoForm(div_node, form, reference, i, instance, form_submit_action)\n console.log('Created a new form: ')\n console.log(form_node)\n nb_form = nb_form +1\n }\n //disable selection and button \n DisableSelect(form_id)\n console.log('nb of forms displayed: ' + nb_form.toString())\n if(response['team_list']){\n UpdateHeader(response['team_list'], response['completed'], response['total_tech'])\n }\n },\n error: function(response) {\n // here are the errors which you can append to .error-block\n $('.error-block').html(response);\n }\n })\n}", "title": "" }, { "docid": "cddd0b2f730c9b7675bd13f68fd2ac45", "score": "0.6582357", "text": "function new_field_send()\n{\n var msg = $('#form_field').serialize();\n $.ajax({\n type: 'POST',\n url: 'functions.php',\n data: msg,\n success: function(data) {\n $('#myModal').modal('hide');\n $('#info_message').show();\n $('#info_message').html(data);\n pause=0;\n },\n error: function(xhr, str){\n alert('Возникла ошибка: ' + xhr.responseCode);\n }\n });\n}", "title": "" }, { "docid": "d59408353e51f3de81f6ff3fbcc97835", "score": "0.655254", "text": "function ajaxSend() {\n\n function progressHandler(e) {\n if (e.lengthComputable) {\n var percent = (e.loaded / e.total) * 100;\n uploadHTML.find('.progress-bar').css('width', percent + '%');\n }\n }\n\n $.ajax(form.action, {\n method: form.method,\n data: formData,\n contentType: false,\n processData: false,\n xhr: function () {\n var myXhr = $.ajaxSettings.xhr();\n if (myXhr.upload) {\n myXhr.upload.addEventListener('progress', progressHandler, false);\n }\n return myXhr;\n },\n beforeSend: function () {\n $btn.prop('disabled', true).addClass('submitting');\n },\n success: function (response) {\n if (response.err) {\n toastr.error('Error saving!');\n return console.error(response.err);\n }\n\n // sometimes response will have redirect url, we must handle that\n if (response.redirect) {\n return window.location = response.redirect;\n }\n\n toastr.success('Saved!');\n },\n error: function () {\n toastr.error('Error saving!');\n },\n complete: function () {\n $btn.prop('disabled', false).removeClass('submitting');\n if (uploadProgress) {\n toastr.clear(uploadProgress);\n }\n }\n });\n }", "title": "" }, { "docid": "f3f6e376235c4524731c2d123435652b", "score": "0.6545504", "text": "function sendForm(el) {\n \n el.addEventListener('submit', function(event){\n event.preventDefault();\n el.appendChild(statusM);\n \n function postData(data) {\n return new Promise(function(resolve, reject){\n let request = new XMLHttpRequest();\n \n request.open('POST', 'server.php');\n request.setRequestHeader('Content-type', 'application/json; charset=utf-8');\n \n request.onreadystatechange = function(){\n if (request.readyState < 4) {\n resolve();\n } else if(request.readyState === 4) {\n if(request.status == 200 && request.status < 300) {\n resolve();\n }\n else {\n reject();\n }\n }\n };\n \n let obj = {};\n formDate.forEach(function(value, key){\n obj[key] = value;\n });\n let json = JSON.stringify(obj);\n request.send(json);\n \n });\n }\n \n postData(formDate)\n .then(() => statusM.innerHTML = text.loading)\n .then(() => statusM.innerHTML = text.success)\n .catch(() => statusM.innerHTML = text.failure)\n .then(() => {\n for (let i = 0; i < popupCalcFormInput.length; i++) {\n popupCalcFormInput[i].value = '';\n }\n setTimeout(function() {\n statusM.innerHTML = '';\n }, 5000);\n });\n });\n \n }", "title": "" }, { "docid": "c95196569a4ae9826c28ce4eaa0c32f9", "score": "0.6534564", "text": "function sendFrontInvite() {\n $(\"#front_invite_form\").validationEngine({scroll: false});\n if (!$(\"#front_invite_form\").validationEngine('validate')) {\n return false;\n }\n\n var data = $(\"#front_invite_form\").serialize();\n\n $.ajax({\n url: '/cmd.php?cmd=sendCustomInvite',\n data: data,\n success: function(data) {\n if (data.status === 'success') {\n $(\"#front_invite_success\").show();\n $(\"#invite_front_inputs, #invite_front_send\").hide();\n $(\"#invite_front_popup_close\").text(\"Close\");\n $(\".popup_input_row input\").val(\"\");\n } else {\n alert(data.message);\n }\n }\n });\n\n $(\"#hide_browse_popup\").click();\n there_are_changes = true;\n return false;\n}", "title": "" }, { "docid": "e481750db9967db0b129d4d475c179cf", "score": "0.6534323", "text": "function submitForm()\n\t {\t\t\n\t\t\tvar data = $(\"#admin-form\").serialize();\n\t\t\t\t\n\t\t\t$.ajax({\n\t\t\t\t\n\t\t\ttype : 'POST',\n\t\t\turl : 'ajax/admin_process.php',\n\t\t\tdata : data,\n\t\t\tbeforeSend: function()\n\t\t\t{\t\n\t\t\t\t$(\"#error\").fadeOut();\n\t\t\t\t$(\"#btn-admin\").html('<span class=\"fa fa-exchange fa-pulse fa-fw\"></span> Mohon tunggu ...');\n\t\t\t},\n\t\t\tsuccess : function(response)\n\t\t\t {\t\t\t\t\t\t\n\t\t\t\t\tif(response==\"Akses Admin Diterima!\"){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#btn-admin\").html('<i class=\"fa fa-spinner fa-pulse fa-fw\"></i> Mengecek ...').prop('disabled', true);\n\t\t\t\t\t\t$(\"#error\").fadeIn(1000, function(){\t\t\t\t\t\t\n\t\t\t\t toastr.success(''+response+'', {timeOut: 5000});\n\t\t\t\t\t\t\t\t\t\t\t$(\"#btn-admin\").html('<span class=\"fa fa-check\"></span> Akses Admin Diterima!').prop('disabled', true);\n\t\t\t\t\t\t\t\t\t\t\t\tsetTimeout('window.location.replace(\"https://ayoklarifikasi.com/home.html\")', 1000);\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#error\").fadeIn(1000, function(){\t\t\t\t\t\t\n\t\t\t\ttoastr.error(''+response+'', {timeOut: 5000});\n\t\t\t\t\t\t\t\t\t\t$(\"#btn-admin\").html('<span class=\"fa fa-pencil\"></span> Submit');\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t});\n\t\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "a22be690d41ea14c8bd1f80b27f0d6f7", "score": "0.6533932", "text": "function contactSubmit(message) {\n \t$.ajax({\n \t url: \"https://formspree.io/[email protected]\",\n \t method: \"POST\",\n \t data: message,\n \t dataType: \"json\"\n \t}).done(function(){\n \t\t$('#contact-form').hide();\n \t\t$('#success-message').show();\n \t});\n }", "title": "" }, { "docid": "607e5362a235e4a3a93e2ea681d81147", "score": "0.6524706", "text": "function submitForm() {\n generateFormFields();\n var form = $(\"#tradeform\");\n $.ajax({\n url: form.attr('action'),\n type: \"POST\",\n data: form.serialize(),\n success: function (data, textStatus, errorThrown) {\n },\n error: function (jXHR) {\n // Error message passed through jXHR\n $(\".alert\").remove();\n var error = $(\"<div class='alert alert-danger' role='alert'>\" + jXHR.responseText + \"</div>\");\n var closeError = $(\"<button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button>\");\n error.append(closeError);\n $(\"#errorcontainer\").prepend(error);\n deleteHiddenFormFields();\n }\n });\n}", "title": "" }, { "docid": "eb0da0ef51cfd7e46d934516f695b34b", "score": "0.65222245", "text": "function formSelect(e) {\n /**\n * Setup and send form AJAX request.\n * \n * Uses the parameter to request a form with AJAX from the backend.\n * \n * @alias formSelect\n * \n * @param {String} e What contact form to request with AJAX.\n * \n * @return {void} Void.\n */\n var csrftoken = $('meta[name=csrf-token]').attr('content');\n $.ajaxSetup({\n beforeSend: function(xhr, settings) {\n if (!/^(GET|HEAD|OPTIONS|TRACE)$/i.test(settings.type)) {\n xhr.setRequestHeader(\"X-CSRFToken\", csrftoken)\n }\n }\n });\n $.ajax({\n url: \"/contact/\" + e,\n type: \"POST\",\n success: function (resp) {\n $(\"#ajaxNode\").empty();\n $(\"#ajaxNode\").append(resp);\n }\n });\n}", "title": "" }, { "docid": "7128a4e7e447a8c5a050f5fb6bd5c92f", "score": "0.6519508", "text": "function submitCustom() {\n\treset(this);\n\n\tpreventDefault(this);\n\n\tvar payload={}\n var status = findFields(this.form, payload);\n if (status) return __.dialogs.alert(status);\n\n\t// Disable submit button\n\tdisableBtn(this);\nvar self=this\n\t// {'Content-Type':'application/x-www-form-urlencoded'}\n\t__.ajax('POST',this.form.action,__.querystring(payload),{headers:{'Content-Type':'application/x-www-form-urlencoded'}}, function(err,code){\n\t\tif (4 !== code) return\n\t\tself.success=!err\n\t\tafterSubmit(self)\n\t})\n}", "title": "" }, { "docid": "41f263d8829a0e9a6b3dc75d9674ceaf", "score": "0.65189576", "text": "function formSubmitHandler() {\n // If we let the form mechanism to submit data and we redirect here directly, the redirect happens too fast\n // and sometimes the newly created item is not visible in the console. Submitting the form using ajax allows\n // us to know when the server finished processing the request and redirect after that happens. This way the\n // newly created item is always visible in the console after redirect.\n $.ajax({\n url: formElement.attr('action'),\n type: 'POST',\n data: formElement.serialize(),\n success: () => {\n document.location.href = Granite.HTTP.externalize(redirectLocation);\n },\n error: () => {\n nameCoralTextfieldComponent.invalid = true;\n }\n });\n return false; // prevent the form from submitting because we do that from JS.\n }", "title": "" }, { "docid": "1228f6c2c49d55765ad10aa9f8d06c98", "score": "0.6513644", "text": "function postMessage(event) {\n // 1. Elle doit stoper le submit du formulaire\n event.preventDefault();\n\n // 2. Elle doit récupérer les données du formulaire\n var author = document.querySelector('#author');\n var content = document.querySelector('#content');\n\n // 3. Elle doit conditionner les données\n var data = new FormData(); //FormData est une classe qui permet de creer des données\n data.append('author', author.value); //pour avoir le $_POST['author']\n data.append('content', content.value);\n\n // 4. Elle doit configurer une requête ajax en POST et envoyer les données\n var requeteAjax = new XMLHttpRequest();\n requeteAjax.open('POST', 'handler.php?task=write'); //on nvois les données en POST vers handler.php?task=write\n requeteAjax.send(data); //on envoie les 2 $_POST\n requeteAjax.onload = function() { //apres l envoi de la requette\n content.value = '';\n content.focus(); //avoir le focus sur le content\n getMessages(); //pour afficher le msg envoyer\n }\n\n\n}", "title": "" }, { "docid": "e7b448d3dbf730fa5bf8362d3e60217b", "score": "0.6507285", "text": "function form_Create(formData) {\n// let createFormData = $('#formCreate').serialize();\nvar createFormData = new FormData (formData);\n // console.log(createFormData);\n $.ajax({\n url: '/corporates',\n type: 'POST',\n data: createFormData,\n contentType: false,\n processData: false,\n\n success: (response)=>{\n if (response.status == 'true') {\n $.notify(response.message , 'success' );\n window.location.href = window.location.protocol + '//' + window.location.hostname +\":\"+window.location.port+\"/corporates\";\n\n }else{\n $.notify(response , 'error');\n\n }\n },\n error: (errorResponse)=>{\n $.each( errorResponse.responseJSON.errors, function( key, value ) {\n $.notify(value[0], \"error\");\n });\n }\n })\n\n}", "title": "" }, { "docid": "49815a239b56e512df4fe44df8fc0a74", "score": "0.6506232", "text": "function sendForm(){\n $('#form').submit()\n}", "title": "" }, { "docid": "40afabd483a8e13624f16ca79ab516a7", "score": "0.64931744", "text": "function submitForm() {\n var json = $('#formData').serializeObject();\n $('#content').empty();\n $('#content').append('<br /><br /><center>Please wait while the data is getting sent to the server.</center>');\n parseJSON(json);\n}", "title": "" }, { "docid": "479a03135fe50634d7c9c14984cf33d3", "score": "0.6491207", "text": "function submitNewsletter(e, selector) {\n e.preventDefault();\n\n $.ajax({\n type: \"POST\",\n dataType: 'JSON',\n url: $(selector).attr(\"action\"),\n data: $(selector).serialize(),\n success: function(data) {\n if (data.status === \"ok\") {\n alert(data.msg)\n }\n else if (data.status === \"fail\") {\n alert('Error: ' + data.msg)\n }\n },\n error: function(data) {\n alert('Error: ' + data.msg)\n }\n })\n}", "title": "" }, { "docid": "db9449e7863efb034d29a5eada272692", "score": "0.6489764", "text": "function formSubmit() {\n\t$.ajax({\n\t\turl : context + \"/save\",\n\t\tdata : $(\"#hotel-add-form\").serialize(),\n\t\ttype : \"POST\",\n\t\tsuccess : function(data, txtStatus, exp) {\n\t\t\twindow.location.reload();\n\t\t},\n\t\terror : function(data, txtStatus, exp) {\n\n\t\t}\n\t});\n}", "title": "" }, { "docid": "288b18df1c7535ec3dd394d6e5e00298", "score": "0.648644", "text": "function submitForm() {\n var data = $('#contactForm').serialize()\n\n $.ajax({\n type: 'POST',\n cache: false,\n url: 'models/mailer-ajax.php',\n data: data,\n beforeSend: function () {\n $('#error').fadeOut()\n $('#btn-send').html(\n '<span class=\"fa fa-spinner fa-spin\"></span> &nbsp; Sending...'\n )\n },\n success: function (response) {\n if (response == 'ok') {\n $('#btn-send').html(\n '<span class=\"fa fa-spinner fa-spin\"></span> &nbsp; Delivering...'\n )\n $('#btn-send').html('Submit')\n setTimeout('alert(\"Message sent successfully\")', 3000)\n $('#contactForm').trigger('reset')\n } else {\n $('#error').fadeIn(1000, function () {\n $('#error').html(response)\n $('#btn-send').html('Submit')\n // $('#contactForm').trigger('reset')\n })\n }\n\n //Auto Notification dismiss\n window.setTimeout(function () {\n $('#error')\n .fadeTo(500, 0)\n .slideUp(500, function () {\n $(this).remove()\n })\n }, 5000)\n },\n })\n return false\n }", "title": "" }, { "docid": "b34c223e00c2862f27788715729a2522", "score": "0.6481465", "text": "function formSubmitHandler(e) {\n e.preventDefault();\n const form = $(this);\n const formData = new FormData(this);\n\n const keys = Array.from(formData.keys());\n const data = keys.map(key => `${key}=${encodeURIComponent(formData.get(key))}`).join('&');\n\n if (isVehicle) {\n $.ajax({\n method: 'POST',\n url: '/api/vehicle',\n data,\n success: (data) => {\n $('.noItems').addClass('js-hide-display');\n hideVehicleModal();\n renderNewVehicle(data);\n addVehicleAlert();\n },\n error: (error) => {\n if (error.responseText) {\n vehicleErrorAlert(error.responseText);\n }\n },\n });\n } else {\n $.ajax({\n method: 'POST',\n url: '/api/inventory',\n data,\n success: (data) => {\n $('.noItems').addClass('js-hide-display');\n hideItemModal();\n clearForm();\n renderNewItem(data);\n isVehicle = true;\n addItemAlert();\n },\n });\n }\n}", "title": "" }, { "docid": "dcb0707714803fe3b7402fa7212763d8", "score": "0.6480708", "text": "function observation_form_handler(){\r\n let formdata = new FormData(this);\r\n let show = Model.add_observation(formdata);\r\n console.log(show);\r\n return false;\r\n}", "title": "" }, { "docid": "e361d1ca3f6ef51cd84a9ea63481fe0e", "score": "0.6471694", "text": "function tf_form_bind_ajax_submit(form, data)\r\n{\r\n var $ = jQuery;\r\n var Data = data; // nu vede 'data' inauntru la submit()\r\n\r\n return $(form).submit(function(){\r\n showLoading();\r\n\r\n /**\r\n * Required data options:\r\n *\r\n * action: 'tf...'\r\n * tf_action: '...'\r\n */\r\n var data = $.extend({\r\n options: JSON.stringify( tf_clean_post_names($(this).serializeObject()) ),\r\n _ajax_nonce: tf_script.ajax_admin_save_options_nonce\r\n }, Data);\r\n\r\n $.ajax({\r\n type: 'POST',\r\n url: tf_script.ajaxurl,\r\n data: data,\r\n dataType: \"json\",\r\n success: function(response){\r\n showFinishedLoading();\r\n\r\n if(response != null && response.reload_page == true) {\r\n setTimeout(function() {\r\n window.location.reload();\r\n }, 1000);\r\n }\r\n },\r\n error: function(XMLHttpRequest, textStatus, errorThrown) {\r\n showFailLoading();\r\n }\r\n });\r\n\r\n return false;\r\n });\r\n}", "title": "" }, { "docid": "09237befaba0a7404732c1d0e4ede278", "score": "0.6465425", "text": "function onSubmit(token) {\n var url = \"https://aws.sharedcare.io/send-email/\";\n $.ajax({\n crossDomain: true,\n method: \"POST\",\n url: url,\n data: $('form').serialize(),\n statusCode: {\n 200: function () {\n $('.toggle.button').removeClass('red loading primary').addClass('green right labeled icon').html('Sent ' +\n '<i class=\"check icon\"></i>');\n },\n 400: function () {\n failOnSubmit();\n },\n 403: function () {\n failOnSubmit();\n },\n 500: function () {\n failOnSubmit();\n }\n },\n error: function () {\n failOnSubmit();\n }\n });\n}", "title": "" }, { "docid": "ee28109a0c54ae5cbef22b1ca627325c", "score": "0.64593554", "text": "function sendDataToElq() {\n var form = document.forms['EOYCampaign'];\n var postData = 'email='+form.elements['C_EmailAddress'].value;\n postData += '&firstName='+form.elements['C_First'].value;\n postData += '&lastName='+form.elements['C_Last'].value;\n getRequest('sendDataToElq', 'http://209.177.156.227/eoy-campaign/PHP/ajaxCall.php', postData, 'text', 'application/x-www-form-urlencoded');\n return false;\n}", "title": "" }, { "docid": "42b0929b1817035806c2c37a585c483d", "score": "0.64567804", "text": "function sendDataProduct(){\r\n $('.alertAddProduct').html('');\r\n\r\n $.ajax({\r\n url: 'ajax.php',\r\n type: 'POST',\r\n async: true,\r\n data: $('#form_add_product').serialize(),\r\n \r\n success: function(response){\r\n \r\n console.log(response);\r\n },\r\n error: function(error){\r\n console.log(error);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "c5eaa35cea216ac3913267fdd61edaae", "score": "0.6453352", "text": "handleSubmit(event) {\n event.preventDefault();\n var frm = $(document.myform);\n var data = getFormData(frm);\n //caller();\n $.ajax({\n url: 'http://koti.tamk.fi/~c4vstenm/Register3.php',\n type:\"POST\",\n dataType: \"json\",\n data: JSON.stringify(data),\n success: function(data) {\n if(data.success===true){\n alert(\"User succesfully registered!\");\n }else{\n alert(\"Username already in use!\");\n }\n\n }.bind(this),\n error: function(xhr, status, err) {\n console.log('error');\n }.bind(this)\n });\n }", "title": "" }, { "docid": "576fe1a319b49a478b17590b2030ab8f", "score": "0.6450238", "text": "function submitForm(e, formName) {\r\n e.preventDefault();\r\n var name = $(formName + ' .js-field__first-name').val();\r\n var lastName = $(formName + ' .js-field__last-name').val();\r\n var email = $(formName + ' .js-field__email').val();\r\n var phone = $(formName + ' .js-field__phone').val();\r\n var company = $(formName + ' .js-field__company').val();\r\n var size = $(formName + ' .radio-btn__radio[name=\"company-size\"]:checked').val();\r\n \r\n \r\n var formData = {\r\n name: name,\r\n lastName: lastName,\r\n email: email,\r\n phone: phone,\r\n company: company,\r\n size: size\r\n };\r\n \r\n $.ajax({\r\n type: \"POST\",\r\n url: 'mail.php',\r\n data: formData,\r\n success: function () {\r\n console.log('success');\r\n //...\r\n },\r\n error: function () {\r\n console.log('error');\r\n //...\r\n }\r\n });\r\n}", "title": "" }, { "docid": "872fc6e0e30a7da97a607d562e197c00", "score": "0.6449181", "text": "function submitForm()\r\n\t{\t\t\r\n\t\tvar data = $(\"#issue-form\").serialize();\r\n\t\t\r\n\t\t$.ajax({\r\n\t\t\ttype : 'POST',\r\n\t\t\turl : 'issuecash.php',\r\n\t\t\tdata : data,\r\n\t\t\tbeforeSend: function()\r\n\t\t\t{\t\r\n\t\t\t\t$(\"#result\").fadeOut();\r\n\t\t\t\t$(\"#btn-issue\").php('<span class=\"glyphicon glyphicon-transfer\"></span> &nbsp; Submitting request ...');\r\n\t\t\t},\r\n\t\t\tsuccess : function(response)\r\n\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\tif(response==\"ok\"){\r\n\t\t\t\t\t$(\"#btn-issue\").php('<img src=\"btn-ajax-loader.gif\" /> &nbsp; Complete. Please wait.');\t\t\t\t\t\r\n\t\t\t\t\tsetTimeout(' window.location.href = \"confirmissue.php\"; ',4000);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$(\"#result\").fadeIn(1000, function(){\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(\"#result\").php(\r\n\t\t\t\t\t\t\t'<div class=\"alert alert-danger\"> <span class=\"glyphicon glyphicon-info-sign\"></span> &nbsp; '+response+' </div>'\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn false;\r\n\t}", "title": "" }, { "docid": "a62c56a278d43baa6affd14bd19170ec", "score": "0.6441288", "text": "function orderMelons(evt) {\n evt.preventDefault();\n\n $.post(\"/order-melons\",\n $('#order-form').serialize(),\n function (result) {\n // TODO: show the result message after your form\n // TODO: if the result code is ERROR, make it show up in red (see our CSS!)\n }\n );\n}", "title": "" }, { "docid": "70d6ee7d8260aa3023a7ef79cb293f6b", "score": "0.64360005", "text": "function sendFormAjax(formSel, reglas, mensajes){\r\n\t\r\n\t\t$(formSel).validate({\r\n\t\t\terrorClass: \"errorValidate\",\r\n\t\t\terrorContainer: \"#errores\",\r\n\t\t\tsubmitHandler: function(form) {\r\n\t\t\t\tvar parteInfo = $(form).serializeArray();\r\n\t\t\t\t$.get(\"adminReports.php?view=parteDetail\", parteInfo, function(html){\r\n\t\t\t\t\t$(\"body\").append(html);\r\n\t\t\t\t\t$(\"#parteDetail\").dialog({\r\n\t\t\t\t\t\twidth: 940,\r\n\t\t\t\t\t\theight: 600,\r\n\t\t\t\t\t\ttitle: \"Resumen del Parte Diario\",\r\n\t\t\t\t\t\tmodal: true,\r\n\t\t\t\t\t\tbuttons: {\r\n\t\t\t\t\t\t\tConfirmar: function(){\r\n\t\t\t\t\t\t\t\t$(this).dialog(\"close\");\r\n\t\t\t\t\t\t\t\t//$(this).remove();\r\n\t\t\t\t\t\t\t\t// envio el formulario\r\n\t\t\t\t\t\t\t\tjQuery(form).ajaxSubmit({\r\n\t\t\t\t\t\t\t\t\tdataType: \"json\",\r\n\t\t\t\t\t\t\t\t\tbeforeSubmit: showLoading,\r\n\t\t\t\t\t\t\t\t\tsuccess: showResponse\r\n\t\t\t\t\t\t\t\t});\r\n $(this).remove();\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tModificar: function(){\r\n\t\t\t\t\t\t\t\t$(this).dialog(\"close\");\r\n\t\t\t\t\t\t\t\t$(this).remove();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\t\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t$.validator.addMethod(\"cRequired\", $.validator.methods.required,\r\n \"*\");\r\n\t\t$.validator.addClassRules(\"customRequired\", {cRequired: true});\r\n\r\n}", "title": "" }, { "docid": "36b988110105386c0ea466691c5bfe70", "score": "0.64341736", "text": "function submitData(subject, firstName, lastName, contactNo, email, organisation, selection, otherVal, comment)\n{\n\tdocument.getElementById(\"error_msg\").style.display='none';\n\t\n\tcreateRequest();\n\tvar url = \"bin/ajax/contact_us.ajax.php\";\n\trequest.open(\"POST\", url, true);\n\trequest.setRequestHeader(\n \t\t'Content-Type', \n \t\t'application/x-www-form-urlencoded; charset=UTF-8');\n\trequest.onreadystatechange = submitDataPage;\n\trequest.send(\"subj=\" + subject + \"&fn=\" + firstName + \"&ln=\" + lastName +\"&cn=\" + contactNo +\"&email=\" + email +\"&orga=\" + organisation +\"&sele=\" + selection +\"&comme=\" + comment +\"&other=\" + otherVal);\n}", "title": "" }, { "docid": "06c4d837ace72f7a1cba50c922de2ca7", "score": "0.64331925", "text": "function sendToServer(method, url, responseHandler, formId){\r\n var xhttp;\r\n xhttp=new XMLHttpRequest();\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n \tresponseHandler(this);\r\n }\r\n }; \r\n xhttp.open(method, url, true);\r\n if (method == \"GET\") {\r\n\t xhttp.send(); \r\n } \r\n if (method == \"POST\") { \r\n\t var form = document.getElementById(formId);\r\n\t var formData = new FormData(form);\r\n\t xhttp.send(formData);\r\n }\r\n}", "title": "" }, { "docid": "5e92c1d6913141a6b8b58cf425d79079", "score": "0.64327157", "text": "function pingomaticAjaxSubmit() {\n\t\t\t// Set dinamically task target in form to ajaxserver.display\n\t\t\t$(targetForm).attr('target', 'pingomatic_iframe');\n\t\t\t$(targetForm).attr('action', jmap_urischeme + '://pingomatic.com/ping/');\n\t\t\t\n\t\t\t// Submit to Pingomatics services\n\t\t\t$('#pingomatic_ajaxloader').empty();\n\t\t\tvar pingUrl = encodeURIComponent($('#linkurl').val().split(/[?#]/)[0]);\n\t\t\tvar pingTitle = encodeURIComponent($('#title').val());\n\t\t\tvar enabledCommonServices = $('#common div.service_control input[type=radio][value=1]:checked').each(function(index, service){\n\t\t\t\tvar serviceHost = $(service).data('host');\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: serviceHost + pingUrl + '+' + pingTitle,\n\t\t\t\t\tdataType: \"jsonp\",\n\t\t\t\t\tsuccess: function(data, textStatus, jqXHR){},\n\t\t\t\t\terror: function(jqXHR, textStatus, error){}\n\t\t\t\t});\n\t\t\t});\n\t\t\t\n\t\t\t// No exception handling, so always return true\n\t\t\treturn formSubmitWithCallback($(targetForm), $('#pingomatic_iframe'), function() {\n\t\t\t\t// Reset resources data on form\n\t\t\t\t$(targetForm).removeAttr('target');\n\t\t\t\t$(targetForm).attr('action', 'index.php');\n\t\t\t\t// Set 100% for progress\n\t\t\t\t$('#progressBar1').css({'width':'100%'});\n\t\t\t\t$('#progressInfo1').append(COM_JMAP_PROGRESSPINGOMATICSUBTITLE2SUCCESS);\n\t\t\t\t\n\t\t\t\t// Wait for 100% progress\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t// Rethrow to create progress\n\t\t\t\t\topenModelProgress();\n\t\t\t\t}, 500);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "a955e39ea0cb11702465e47eca8c2583", "score": "0.64325356", "text": "function submitForm(data, url) {\n $.ajax({\n type: \"POST\",\n async: true,\n url: url,\n data: data\n })\n .done(function (data) {\n console.log(data);\n var result = JSON.parse(data);\n if (result) {\n // shows modal on success\n $('#modal-result').modal('show');\n $('#modal-message-success').toggleClass('hidden');\n }\n else {\n // display error message\n // shows modal on success\n $('#modal-result').modal('show');\n $('#modal-message-warning').toggleClass('hidden');\n\n // Enable buttons for editing\n enableBtns();\n }\n\n })\n .fail(function () {\n console.log(\"ERROR: insert user ajax call failed\");\n });\n}", "title": "" }, { "docid": "dcc161e4b9b2114e4fe392a85953a9df", "score": "0.6430665", "text": "function submit_form(evt) {\n\n evt.preventDefault();\n\n $(\"#whole_recipe_edit\").fadeOut()\n\n const formInputs = {\n 'recipe_id' : $(\"#recipe_id_field\").val(),\n 'folder_id' : $(\"#folder__options\").children(\":selected\").attr(\"id\"),\n 'recipe_title' : $(\"#recipe_title\").val(),\n 'recipe_ingred' : $(\"#recipe_ingred\").trumbowyg('html'),\n 'recipe_direct' : $(\"#recipe_direct\").trumbowyg('html'),\n 'recipe_src' : $(\"#recipe_src\").val(),\n 'image_url' : $(\"#image_url\").val(),\n }\n\n $.post('/api/myfolders/edit_recipe.json', formInputs, (res) => {\n $(\"#msg\").html(res.success);\n message_fade_out() \n })\n \n}", "title": "" }, { "docid": "0704cd91930b5951671f42a452cb9376", "score": "0.64304614", "text": "function ajaxSubmit(btnClicked) {\r\n var $form = $(btnClicked).parents('form');\r\n\r\n $.ajax({\r\n async: false,\r\n type: \"POST\",\r\n url: $form.attr('action'),\r\n data: $form.serialize(),\r\n error: function (xhr, status, error) {\r\n //do something about the error\r\n },\r\n success: function (response) {\r\n return response;\r\n }\r\n });\r\n}", "title": "" }, { "docid": "77f7e80dadf48d14a2a2f3bb9a8ff353", "score": "0.64286876", "text": "function submitForm(e, formName) {\r\n e.preventDefault();\r\n var name = $(formName + ' .js-field__first-name').val();\r\n var lastName = $(formName + ' .js-field__last-name').val();\r\n var email = $(formName + ' .js-field__email').val();\r\n var phone = $(formName + ' .js-field__phone').val();\r\n var company = $(formName + ' .js-field__company').val();\r\n var size = $(formName + ' .radio-btn__radio[name=\"company-size\"]:checked').val();\r\n\r\n\r\n var formData = {\r\n name: name,\r\n lastName: lastName,\r\n email: email,\r\n phone: phone,\r\n company: company,\r\n size: size\r\n };\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: 'mail.php',\r\n data: formData,\r\n success: function () {\r\n console.log('success');\r\n //...\r\n },\r\n error: function () {\r\n console.log('error');\r\n //...\r\n }\r\n });\r\n}", "title": "" }, { "docid": "2f91daeb53823291d5c54eff14484fc8", "score": "0.6426125", "text": "function submit() {\n\t\tvar $button = $( button ),\n\t\t\t$form = $button.parents('form').first(),\n\t\t\turl = $form.attr('action'),\n\t\t\tdata = $form.serialize();\n\n\t\t// Add the clicked button to the sent data\n\t\tdata = data + '&' + encodeURIComponent($button.attr('name')) + '=' + encodeURIComponent($button.val());\n\n\t\t// Send the submission over AJAX\n ajaxObj = {\n\t\t\ttype: \"POST\",\n\t\t\turl: url,\n\t\t\tdata: data\n\t\t};\n if( options.json )\n ajaxObj.dataType = 'json';\n\t\treturn $.ajax(ajaxObj);\n\t}", "title": "" }, { "docid": "c241a2ef4ee5ea1082486121c0e7a663", "score": "0.64242655", "text": "function successHandler(data) {\r\n\r\n // Change Flag\r\n options.submitted = true;\r\n\r\n // Completion time\r\n var endTime = (new Date()).getTime();\r\n var completionTime = endTime - startTime; // In miliseconds\r\n\r\n // Trigger event\r\n formEl.trigger( \"success\", [ data, completionTime ] );\r\n\r\n // Form Steps\r\n if( fieldset.size() > 1 ) {\r\n var steps = $(\".steps\");\r\n if( steps.size() > 0 ) {\r\n // Add success to all steps\r\n steps.find(\".step\").addClass(\"success\");\r\n } else {\r\n // Find progress bar elements\r\n var progress = $(\".progress\").first();\r\n var progressBar = progress.find(\".progress-bar\");\r\n var percent = progressBar.find(\".percent\");\r\n var title = progressBar.find(\".title\");\r\n // Update title\r\n title.html(\"Complete\");\r\n // Update percent\r\n percent.text(\"100%\");\r\n // Update bar\r\n progressBar.width(\"100%\");\r\n }\r\n }\r\n\r\n // Performs an action according to the indications\r\n if (typeof data.addon !== 'undefined') {\r\n if (typeof data.addon.redirectTo !== 'undefined') {\r\n // Redirect to URL\r\n Utils.postMessage({\r\n url: data.addon.redirectTo\r\n });\r\n }\r\n }\r\n\r\n // Performs an action according to type of confirmation\r\n if ( options.confirmationType === options.redirectToUrl ) {\r\n\r\n // Redirect to URL\r\n Utils.postMessage({\r\n url: typeof data.confirmationUrl === 'undefined' ? options.confirmationUrl : data.confirmationUrl\r\n });\r\n\r\n } else {\r\n\r\n // Show confirmation message\r\n var confirmationMessage = options.confirmationMessage ? options.confirmationMessage : data.message;\r\n\r\n // Hide old messages\r\n Utils.hideMessage('#messages');\r\n\r\n // Show success message\r\n Utils.showMessage( '#messages',\r\n confirmationMessage,\r\n 'success' );\r\n\r\n // Hide the form according to type of confirmation\r\n if ( options.confirmationType === options.showOnlyMessage ) {\r\n // Hide the form\r\n formEl.hide();\r\n }\r\n\r\n // Send the new height to the parent window\r\n Utils.postMessage({\r\n height: $(\"body\").outerHeight(true)\r\n });\r\n\r\n // Scroll to Top in the parent window\r\n Utils.postMessage({\r\n scrollToTop: 'container'\r\n });\r\n }\r\n }", "title": "" }, { "docid": "7ff2aa7c18af4a55bdca6a996b222c7e", "score": "0.64218515", "text": "function submitForm(caller) {\n\n var data = {\n brand: $('#inputBrand').val(),\n model: $('#inputModel').val(),\n os: $('#inputOS').val(),\n screensize: $('#inputScreensize').val(),\n image: $('#inputImage').val()\n }\n form = document.getElementById(\"myForm\");\n if(caller.value === \"submit\") {\n $.ajax({\n url: 'http://localhost:8089/api',\n contentType: \"application/json; charset=utf-8\",\n dataType : \"json\",\n type: 'POST',\n data: JSON.stringify(data)\n }).done(function(data,status,xhr){\n fillTable(false);\n });\n } else if (caller.value === \"reset\") {\n $.ajax({\n url: 'http://localhost:8089/api',\n dataType: 'json',\n type: 'GET',\n data: data\n }).done(function(data,status,xhr){\n });\n }\n}", "title": "" }, { "docid": "28e9d9068be375863e2355871f60de25", "score": "0.64150196", "text": "function send() {\n document.form.submit();\n }", "title": "" }, { "docid": "e37cc130659300de22d9204566b468c1", "score": "0.641277", "text": "function onSubmit(event) {\n event.preventDefault();\n var url=$(this).closest('form').attr('action'),\n data=$(this).closest('form').serialize(),\n type=$(this).closest('form').attr('method');\n console.log(url);\n $.ajax({\n url:url,\n type:type,\n data:data,\n success:onSuccess\n });\n\n }", "title": "" }, { "docid": "f76c87954d3a5940e75ff47cc0e5de26", "score": "0.64120895", "text": "function postContactForm() {\n $(\"#contactForm\").submit();\n}", "title": "" }, { "docid": "68ae0b3e557f86569f03990e9f8b4da8", "score": "0.64099884", "text": "function submitForm(ation_url, _id) {\n var url = ation_url;\n\n $.ajax({\n type: \"POST\",\n url: url,\n data: $(\"#\"+_id).serialize(), // by default it pass csrf token\n success: function(data)\n {\n window.history.pushState(\"\", \"\", data.profile_url);\n\n // replace container with user profile\n $(\".container\").html($(data.html).find('#first_inner_row').html());\n $(\"#form_errors\").hide();\n\n },\n error: function(data)\n {\n // form validation error\n if (data.responseJSON.form_errors){\n $(\"#form_errors\").html(data.responseJSON.form_errors);\n }else{\n // something went wrong\n $(\"#form_errors\").html('Something went wrong !');\n }\n\n $(\"#form_errors\").show();\n }\n });\n\n}", "title": "" }, { "docid": "19e7bdbdde681ab77f2c6ec8b7f5d603", "score": "0.64095235", "text": "function submit_msg() {\r\n message_begin_sent = true\r\n let loader = document.getElementById(\"rLoader\");\r\n loader.style.display = \"block\";\r\n const msgText = msgerInput.value;\r\n const passwd = passwd_box.value;\r\n if (!msgText) return;\r\n document.getElementById(\"send_msg_field\").value = \"\"; \r\n console.log(\"sending add_msg request\")\r\n api_url = ROOT_URL + \"/add_transaction\";\r\n let settings = {\r\n \"url\": api_url,\r\n \"method\": \"POST\",\r\n \"headers\": {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n \"data\": JSON.stringify({\"msg\": msgText, \"username\": USERNAME, \"password\": passwd})\r\n };\r\n\r\n $.ajax(settings).done(function (response) {\r\n updateChatBox();\r\n message_begin_sent = false\r\n });\r\n}", "title": "" }, { "docid": "de0e52a037f101b348acbb615c9ab145", "score": "0.63996315", "text": "function submit()\n{\n\tvar data;\n\n\tif (vm.isFormSubmissible)\n\t{\n\t\t// Organize the data that will need to be sent over the wire\n\t\tdata =\n\t\t{\n\t\t\tname: vm.name,\n\t\t\torderId: vm.orderId,\n\t\t\temail: vm.email,\n\t\t\tareaCode: vm.areaCode,\n\t\t\tphoneOne: vm.phoneOne,\n\t\t\tphoneTwo: vm.phoneTwo,\n\t\t\tcomments: vm.comments\n\t\t};\n\n\t\t// Save the data\n\t\taxios.post(SEND_REQUEST_URL, data, true).then(() =>\n\t\t{\n\t\t\t// Prevent the button from being clicked again\n\t\t\t_submitButton.disabled = true;\n\n\t\t\t// Show a message indicating that a request has been sent to us\n\t\t\tnotifier.showSuccessMessage(SUCCESS_MESSAGE);\n\n\t\t\t// If successful, put up a success banner and let's take the user back to the home page after\n\t\t\t// about 5 seconds\n\t\t\twindow.setTimeout(() =>\n\t\t\t{\n\t\t\t\twindow.location.href = HOME_URL;\n\t\t\t}, 7500);\n\n\t\t}, () =>\n\t\t{\n\t\t\tnotifier.showGenericServerError();\n\t\t});\n\t}\n}", "title": "" }, { "docid": "8b4c31f72dc505934cb4ae4abd7ab8ce", "score": "0.63973683", "text": "function submitForm(obj,link) {\n var $this = $(obj);\n if ($this[0].checkValidity()) {\n loading('show')\n setTimeout(function () {\n $.ajax({\n url: \"../ajx/\" + link,\n data: new FormData(obj),\n type: 'POST',\n contentType: false,\n cache: false,\n processData:false,\n success: function(data) {\n // $('#loading-modal .modal-content').html(data)\n // modal1('hide');\n mainResult(data)\n }\n });\n }, 500);\n }else{\n notify('danger','Please complete the required fields!');\n }\n}", "title": "" }, { "docid": "2742a1f137a139c995d833bfea22b4f1", "score": "0.63963133", "text": "function submitForm()\n {\n var data = $(\"#sms-form\").serialize();\n\n $.ajax({\n\n type : 'POST',\n url : 'send_sms.php',\n data : data,\n beforeSend: function()\n {\n $(\"#errors\").fadeOut();\n $(\"#btn-submits\").html('<img src=\"../img/processing.gif\" width=\"30\" /> &nbsp; sending...');\n },\n success : function(data)\n {\n if(data==\"sm\")\n {\n $(\"#errors\").fadeIn(1000, function(){\n\n $(\"#errors\").html('<div class=\"alert alert-success\"> <span class=\"glyphicon glyphicon-info-sign\"></span> &nbsp; Successfully Sent!!</div>');\n $(\"#btn-submits\").html('<span class=\"fa fa-check\"></span> &nbsp; Sent');\n\n });\n }\n \n else{\n\n $(\"#errors\").fadeIn(1000, function(){\n\n $(\"#errors\").html('<div class=\"alert alert-danger\"><span class=\"glyphicon glyphicon-info-sign\"></span> &nbsp; '+data+' !</div>');\n \n\n });\n\n }\n }\n });\n return false;\n }", "title": "" }, { "docid": "0df1932dd47b68f911cbc782850c3750", "score": "0.63942784", "text": "function ajaxSendFormToAction(form, url) {\r\n var $form = $(form);\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: url,\r\n data: $form.serialize(),\r\n error: function (xhr, status, error) {\r\n //do something about the error\r\n },\r\n success: function (response) {\r\n }\r\n });\r\n\r\n return false;// if it's a link to prevent post\r\n}", "title": "" }, { "docid": "4700f038d95c0388d26bcee946098558", "score": "0.6394274", "text": "function submitFormPasung(){\n console.log('Fungsi Form Pasung Masuk!');\n var formData = $('#form-tambah-pasung').serializeObject();\n addDataPasung(formData);\n}", "title": "" }, { "docid": "874dcd66c813e86ed4067176cafa0c01", "score": "0.6394204", "text": "function recModalSubmitHandler() {\n var obj = recModalEdit;\n toogleShowHidden(obj.edit_load, obj.edit_content);\n var form_data = formDataToObject(obj.edit_form);\n //return;\n\n //take from form add rec\n var param = form_data;\n param[\"action\"] = \"wzs21_customQuery\";\n param[\"query\"] = \"create_recruiter\";\n param[SiteInfo.USERMETA_REC_COMPANY] = company_id;\n\n jQuery.ajax({\n url: ajaxurl,\n data: param,\n type: 'POST',\n success: function (res) {\n res = JSON.parse(res);\n if (res[\"status\"] === SiteInfo.STATUS_SUCCESS) {\n searchPanel.init();\n obj.finishSubmit();\n } else {\n obj.toogleLoadContent();\n obj.showError(res.data);\n }\n\n },\n error: function (err) {\n obj.showError(\"Something went wrong. Please refresh and try again\");\n }\n });\n }", "title": "" }, { "docid": "f57f8d26d3ee9d8b9c09b873d9e9d5b5", "score": "0.63910013", "text": "function CallAjax(form, postData, url, callBack)\n{\n var sendData;\n if (form == \"\")\n {\n sendData = postData;\n }\n\n else if (postData == \"\")\n\n {\n sendData = $(form).serialize();\n }\n\n $.ajax({\n type: 'POST',\n dataType: \"JSON\",\n url: url,\n cache: false,\n async: false,\n data: sendData,\n success: callBack,\n error: function(httpRequest, textStatus, errorThrown) {\n console.log(\"status=\" + textStatus + \",error=\" + errorThrown);\n }\n });\n\n}", "title": "" }, { "docid": "f0f38d993c57ec234b8fa7362e5cc555", "score": "0.63850105", "text": "function submitForm(e) {\n e.preventDefault();\n\n var name = getInputVal('name')\n var ingredients = getInputVal('ingredients')\n var instructions = getInputVal('instructions')\n\n saveMessage(name, ingredients, instructions);\n}", "title": "" }, { "docid": "88bedd7eb0c4edb599f98d6fd402fc8f", "score": "0.6384965", "text": "function submitForm() {\n var data = $(\"#login-form\").serialize();\n\n $.ajax({\n\n type: 'POST',\n url: 'model/login_process.php',\n data: data,\n beforeSend: function () {\n $(\"#error\").fadeOut();\n $(\"#btn-login\").html('sending ...');\n },\n success: function (response) {\n if (response == \"ok\") {\n\n $(\"#btn-login\").html(\n '<div class=\"spinner-border text-success ;\" role=\"status\">\\n' +\n ' <span class=\"sr-only\">Loading....</span>\\n' +\n '</div> Signing In ...');\n setTimeout(' window.location.href = \"index.php?action=home\"; ', 2000);\n } else {\n\n $(\"#error\").fadeIn(1000, function () {\n $(\"#error\").html('<div class=\"alert alert-danger\"> <span class=\"glyphicon glyphicon-info-sign\"></span> &nbsp; ' + response + ' !</div>');\n $(\"#btn-login\").html('<span class=\"glyphicon glyphicon-log-in\"></span> &nbsp; Sign In');\n });\n }\n }\n });\n return false;\n }", "title": "" }, { "docid": "a06a8dbb677ef4d4d2cf30010d3845f2", "score": "0.63845414", "text": "function sendKontakt() {\n\tvar valid;\t\n\tvalid = validateContact();\n\tif(valid) {\n\t\tjQuery.ajax({\n\t\turl: \"send-kontakt.php\",\n\t\tdata:'navn='+$(\"#navn\").val()\n\t\t+'&email='+$(\"#email\").val()\n\t\t+'&swebsite='+$(\"#website\").val()\n\t\t+'&besked='+$(\"#besked\").val(),\n\t\ttype: \"POST\",\n\t\tsuccess:function(data){\n\t\t$(\"#meddelse-fra-form\").html(data);\n\t\t},\n\t\terror:function (){}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "022432cbc47daf24aaa7ba05c9e071fb", "score": "0.63798535", "text": "function submitForm(d, b) {\n var postData = $(d).serializeArray();\n var formURL = $(d).attr(\"action\");\n\n $.ajax({\n url: formURL,\n type: \"POST\",\n data: postData,\n success: function (data, textStatus, jqXHR) {\n //data: return data from server\n if (data.Result) {\n if ($(b).data('source')) {\n submitAnswers($(b).data('source'), true); //Submit answers and redirect to the result page\n } else {\n if (d == \"#register-form\") {\n window.location = \"/wheel-of-life/welcome\"\n } else {\n location.reload();\n }\n }\n }\n else {\n $(d + '-error').html(data.Message);\n $('.submit-btn-wrapper input').show();\n while ($('#loader').length) {\n $('#loader').remove();\n }\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n //if fails \n console.log('error');\n }\n });\n }", "title": "" }, { "docid": "1597727c7be2369be14f60a6e0dd7e76", "score": "0.63793874", "text": "function qr_ajax_post(submitaction, submitstring)\n{\n\tqr_repost = false;\n\txml = new vB_AJAX_Handler(true);\n\txml.onreadystatechange(qr_do_ajax_post);\n\txml.send(submitaction, submitstring);\n}", "title": "" }, { "docid": "cf292b86b8dcfa99b1bcc476639ae377", "score": "0.63770187", "text": "function procesaRegistroCliente(){\n\t\n\tvar formData = new FormData(document.getElementById(\"formRegistraCliente\"));\n\n\t$.ajax({\n url: \"registraCliente\",\n type: \"POST\",\n data: formData,\n processData: false,\n contentType: false,\n success:function(data){\n \t\n \tif (data.existClientes){\n \t\tdocument.getElementById(\"mensajeFormCliente\").style.visibility=\"hidden\"\n \t\tdocument.getElementById(\"formRegistraCliente\").reset();\n \t\tregistraClienteMessage(data.message);\n \t}\n \telse{\n \t\tdocument.getElementById(\"mensajeFormCliente\").style.visibility=\"visible\";\n \t\t$(\"#mensajeFormCliente\").text(data.message);\n \t}\n }\n })\n\t\n}", "title": "" } ]
659b00208af6a5752a4871af146a88ee
Framwork end Customized native begin
[ { "docid": "b00992fc327399c65a107effe98658e5", "score": "0.0", "text": "function hookSo(){\n var libNames = [\"xx.so\"];\n var hookFuncs = [xx]\n\n // hookSoWhenRun(libNames, hookFuncs);\n Utils.HookSoImmediately(hookFuncs);\n}", "title": "" } ]
[ { "docid": "bf0f6c26cf03f4ff8cd4a7e627c20d14", "score": "0.58212733", "text": "function end () {\n\n}", "title": "" }, { "docid": "c08f4a2b280f903336581a23dfd0bd98", "score": "0.58107924", "text": "function end(){\n\n}", "title": "" }, { "docid": "c2a76901d5c59cd6d40009997744aa7c", "score": "0.5777237", "text": "_start(parameters){\n\t\tthrow new Error('Exending classes should implement _start')\n\t}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.5663198", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.5663198", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.5663198", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.5663198", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.5663198", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "602a4284d6ccc00e9f638728ad56273c", "score": "0.5663198", "text": "function BeforeStart(){return}", "title": "" }, { "docid": "c3850321624e463749c16caa9715c239", "score": "0.5599046", "text": "function beginScriptSwitchBlock(){beginBlock({kind:2/* Switch */,isScript:true,breakLabel:-1});}", "title": "" }, { "docid": "741b18222e09ba2cca55af4dee9553d0", "score": "0.5590162", "text": "beginStory() {\n this.props.beginStory();\n this.setFrame(0);\n this.props.beginStory1(0, Choices[0].choices);\n }", "title": "" }, { "docid": "531873ab128e621617f17d645230c9ef", "score": "0.55487835", "text": "function beginScriptSwitchBlock() {\n beginBlock({\n kind: 2 /* Switch */,\n isScript: true,\n breakLabel: -1\n });\n }", "title": "" }, { "docid": "531873ab128e621617f17d645230c9ef", "score": "0.55487835", "text": "function beginScriptSwitchBlock() {\n beginBlock({\n kind: 2 /* Switch */,\n isScript: true,\n breakLabel: -1\n });\n }", "title": "" }, { "docid": "d3200d48d04c4f3ea0a53882d55dc324", "score": "0.552634", "text": "end() {\n }", "title": "" }, { "docid": "1fc32bbbf395522480d5ede13f7ed3c6", "score": "0.55149925", "text": "endRun() {}", "title": "" }, { "docid": "25892bffd73ae3343388e8279a402b48", "score": "0.54889464", "text": "[internal.goEnd]() {\n if (super[internal.goEnd]) {\n return super[internal.goEnd]();\n }\n }", "title": "" }, { "docid": "5003750b746e62736e607b2f4ed1eb9b", "score": "0.5460622", "text": "function Start(){\n\n}", "title": "" }, { "docid": "f8efa3468f35bb5658d32887e414c250", "score": "0.54605764", "text": "onLoad() {\n // 初始位置\n this.extend = true;\n this.actionFinish = true;\n }", "title": "" }, { "docid": "90de7eff8942c8d310c9cf0231d76dc5", "score": "0.5447288", "text": "function initEnd() {\r\n\t\r\n\tsetInitInfo('start!');\r\n\tinitFinally();\r\n}", "title": "" }, { "docid": "c202857c5f93e5d192b418683095b0a2", "score": "0.5444356", "text": "onFrameStart() { }", "title": "" }, { "docid": "b6e1b2ff17137f4795540b9a9eb23ade", "score": "0.54441893", "text": "function start()\n{\n}", "title": "" }, { "docid": "521bfb8294d2af2108b9f5b8b2ffc557", "score": "0.5423799", "text": "function onEnterFrame() {}", "title": "" }, { "docid": "138ee4eb9cf79918eb6069d3b2b1185f", "score": "0.54142827", "text": "finishTwisting() {\n // subclasses can override this methods\n }", "title": "" }, { "docid": "bee4241b0b96f2feeb31414b6d8cc86a", "score": "0.54104584", "text": "set _start (start) {}", "title": "" }, { "docid": "b7aab20d32b8102b72067b45f8d2507d", "score": "0.54049003", "text": "Begin()\n {\n console.log(\"Error: child class must implement function...\");\n }", "title": "" }, { "docid": "44897fc3ff2111ad7fa049b303b0f003", "score": "0.5404165", "text": "genEndFuncion() {\n this.code.push('}');\n }", "title": "" }, { "docid": "44897fc3ff2111ad7fa049b303b0f003", "score": "0.5404165", "text": "genEndFuncion() {\n this.code.push('}');\n }", "title": "" }, { "docid": "6b4762ee0a2e111c7419bfbbf9cb0df1", "score": "0.53903866", "text": "async begin() {\n return;\n }", "title": "" }, { "docid": "6b4762ee0a2e111c7419bfbbf9cb0df1", "score": "0.53903866", "text": "async begin() {\n return;\n }", "title": "" }, { "docid": "0eb32234da4ca9c8a1ebd754ce9085f7", "score": "0.5378946", "text": "function start(){\n\n}", "title": "" }, { "docid": "0eb32234da4ca9c8a1ebd754ce9085f7", "score": "0.5378946", "text": "function start(){\n\n}", "title": "" }, { "docid": "32ffa417f346e543fe54bebfd298d55d", "score": "0.5349219", "text": "renderAfter() {}", "title": "" }, { "docid": "ecb8eb647d85299108c9072ee3c24b7a", "score": "0.53453404", "text": "renderBefore() {}", "title": "" }, { "docid": "9be7566734442cce5eaf387ab039fd22", "score": "0.53408283", "text": "onFrameEnd() { }", "title": "" }, { "docid": "31cf58c7d0277c68661ca4285d0f7b87", "score": "0.53106874", "text": "run () {\n super.run();\n }", "title": "" }, { "docid": "a0c06fc4485423d4970d401e20a01559", "score": "0.5306194", "text": "function end() {\n end\n}", "title": "" }, { "docid": "1ed7d94effb34698f962d30a64b70f30", "score": "0.52994233", "text": "function beginScriptLoopBlock(){beginBlock({kind:3/* Loop */,isScript:true,breakLabel:-1,continueLabel:-1});}", "title": "" }, { "docid": "219d2ee9925319a9df379ef5a99f2ee5", "score": "0.5275972", "text": "end() {\n super.end();\n }", "title": "" }, { "docid": "b0aca14270623b9eb592dfbc1d873f87", "score": "0.5271273", "text": "static get END_EVENT() {\n\t\treturn 'end';\t\n\t}", "title": "" }, { "docid": "a723e78b881ad8664b8aada629c9b15c", "score": "0.5268668", "text": "[internal.goStart]() {\n if (super[internal.goStart]) {\n return super[internal.goStart]();\n }\n }", "title": "" }, { "docid": "bea008d65f67c7e1a46002803238a6db", "score": "0.52645534", "text": "onEnd(state){this.status='answered';// Rerender prompt (and clean subline error)\nthis.render();this.screen.done();cliCursor.show();this.done(state.value);}", "title": "" }, { "docid": "5d4c8a934df7fbd51c576584dd85d1be", "score": "0.5253949", "text": "function beginScriptLoopBlock() {\n beginBlock({\n kind: 3 /* Loop */,\n isScript: true,\n breakLabel: -1,\n continueLabel: -1\n });\n }", "title": "" }, { "docid": "5d4c8a934df7fbd51c576584dd85d1be", "score": "0.5253949", "text": "function beginScriptLoopBlock() {\n beginBlock({\n kind: 3 /* Loop */,\n isScript: true,\n breakLabel: -1,\n continueLabel: -1\n });\n }", "title": "" }, { "docid": "4653d42e0153006c468ffb12722d0312", "score": "0.5252342", "text": "started() {\n\n\n\t}", "title": "" }, { "docid": "abd811ce47469c82f91cdb0624335f17", "score": "0.5241878", "text": "function theEnd() {\n console.log(' This is the end!');\n }", "title": "" }, { "docid": "e7a697225ff6ae2c822631f0478b1a26", "score": "0.52306193", "text": "function startInfinityCustomFunctions() {\n\t\tsetReworkStyleCSS();\n\t\tloadTitlePhoneNumber();\n\t}", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.52277404", "text": "_onRender() {}", "title": "" }, { "docid": "5795c182e6a1b2575f6e6ee44b007c9d", "score": "0.5224028", "text": "rolledBack() {}", "title": "" }, { "docid": "5795c182e6a1b2575f6e6ee44b007c9d", "score": "0.5224028", "text": "rolledBack() {}", "title": "" }, { "docid": "7fc5b13048e1c13ff85c0025147ca365", "score": "0.5220467", "text": "create() {\n // create start\n\n // create end\n }", "title": "" }, { "docid": "ebbe00921cac077b3609189a4e66d35a", "score": "0.5209168", "text": "function Start () {\n\t\n\t}", "title": "" }, { "docid": "2fcc64504003348843f1f35958ec72c0", "score": "0.5208229", "text": "exec() {\n this.event.preventDefault();\n\n // Go to the previous item.\n let node = this.getElement('prev');\n if (node) {\n node.focus();\n return;\n }\n\n // Default to the end..\n var eventEnd = new OnEnd(this.item, this.event, this.target);\n eventEnd.init();\n\n }", "title": "" }, { "docid": "d23689898cd295a7dac3f7520d89f19d", "score": "0.51975185", "text": "function beginSwitchBlock(){var breakLabel=defineLabel();beginBlock({kind:2/* Switch */,isScript:false,breakLabel:breakLabel});return breakLabel;}", "title": "" }, { "docid": "378bca115265b852dc33e18a4fd4cf43", "score": "0.5193674", "text": "beginDraw() {\n\t\t\t\n\t\t}", "title": "" }, { "docid": "d4f4fb7a76e728dbfa586d22de1dfb30", "score": "0.5188706", "text": "function begin_8_doctor(){\n \t//**//**console.log(\"WORLD 8 BEGIN\");\n \tplaySound('8_doctor');\n }", "title": "" }, { "docid": "c8cd10189dad9fbb822ddb91b30bfd88", "score": "0.51884323", "text": "onTransitionEnd() {\n }", "title": "" }, { "docid": "1c3993cc3ec285a4c1774c56966327e3", "score": "0.5187515", "text": "start (when = 0) {}", "title": "" }, { "docid": "9b1354d2107bc39b6b2cacbb78b645c2", "score": "0.51756465", "text": "begin() {\n }", "title": "" }, { "docid": "ecdcc7177686185d41d5387f688cf3d0", "score": "0.5172187", "text": "function start(code) {\n startInternal({ code });\n }", "title": "" }, { "docid": "f0bb3d5a964a8e2c811d479b31bc7f6f", "score": "0.5169631", "text": "enterJsx_fragment_end(ctx) {\n\t}", "title": "" }, { "docid": "d2a20a0e00bb16643b7b77f2a7a96d26", "score": "0.5168784", "text": "function C007_LunchBreak_Amanda_EndBonus() {\n\tSetScene(CurrentChapter, \"Outro\");\n}", "title": "" }, { "docid": "f073d240000f4fa9853da8272e68a91b", "score": "0.5159312", "text": "BeginWindows() {}", "title": "" }, { "docid": "383ed0480a0b9a86f2cd6dab4fc624f8", "score": "0.5155212", "text": "function begin(Target, args) {\n\tinfoOff();\n\ttoBegin = new Target(...args);\n\twidget = toBegin;\n}", "title": "" }, { "docid": "5be95a741a31c05f660de50006dc570d", "score": "0.5147106", "text": "function beginFrame(creditDisplay) {\n creditDisplay.beginFrame();\n }", "title": "" }, { "docid": "7a69e52fdb6f1127e70c75bc7d81ebd7", "score": "0.51470697", "text": "function startOnLoad() {\n \n}", "title": "" }, { "docid": "81ca7d6215c1c18a05ae9d367ad6a954", "score": "0.51469076", "text": "onRender() {}", "title": "" }, { "docid": "c0f0c33abc2ef460c2ecc71f89469264", "score": "0.5142628", "text": "function endStep(step) {\n\n}", "title": "" }, { "docid": "bbff43640ee0a558c5e2207fde63141e", "score": "0.5138984", "text": "enterFrame() {}", "title": "" }, { "docid": "7e37dcaf006f6b51eeada372e63cb17c", "score": "0.5138595", "text": "function webBeginRound(){\r\n\tBeginRound(function(){\r\n\t});\r\n}", "title": "" }, { "docid": "a28079d2e88e80a9726c45e06d5f89de", "score": "0.513387", "text": "function endIntro() {//Use this as it will give 'flow' to our pages\n\t\twindow.open(\"codetyped.html\", \"_parent\", \"fullscreen,scrollbars\", true);\n\t}", "title": "" }, { "docid": "584fbcbc9dcf48385762fe89232785bd", "score": "0.51304597", "text": "function Start() {\n onCreate();\n onFrame();\n}", "title": "" }, { "docid": "5f385e8ebf20a2a94116257e1a320427", "score": "0.512748", "text": "function start() {\n // YOUR CODE GOES HERE\n}", "title": "" }, { "docid": "fac5b2693d194660b49221aeb452ca4c", "score": "0.51273894", "text": "_start () {}", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.51229495", "text": "render() {\n }", "title": "" }, { "docid": "508ebc3386655affc136f0bfafe3e3be", "score": "0.51185197", "text": "start () {\n this.state = Reel.STATE_NEED_START;\n }", "title": "" }, { "docid": "89b8b2efd42d72c7d3e961a4bd8c2248", "score": "0.5118346", "text": "started () {}", "title": "" }, { "docid": "19db3dedb0c2b82a9709743f45af9369", "score": "0.5116004", "text": "async doStart() {\n throw new Error('Subclasses must override the doStart method.');\n }", "title": "" } ]
d03869613bf2e1ec27396f275d48df31
End widget object subclass FIXME: can this be done easier??
[ { "docid": "cb325d52d394c36d6d40e33d1668acb5", "score": "0.0", "text": "function getLayout(id) {\n\t\t\tlogixwareDashboard.log(\"entering getLayout function\", 1);\n\t\t\tvar r = null;\n\t\t\tvar first = null;\n\t\t\tif ( typeof opts.layouts != \"undefined\") {\n\t\t\t\t$.each(opts.layouts, function(i, item) {\n\t\t\t\t\tif (i == 0) {\n\t\t\t\t\t\tfirst = item;\n\t\t\t\t\t}\n\t\t\t\t\tif (item.id == id) {\n\t\t\t\t\t\tr = item;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (r == null) {\n\t\t\t\tr = first;\n\t\t\t}\n\t\t\treturn r;\n\t\t}", "title": "" } ]
[ { "docid": "4cb6b6f6c9558617548eabd23eb61c9c", "score": "0.64148057", "text": "onCustomWidgetDestroy() {}", "title": "" }, { "docid": "d8fceee4177653978464cfa07dada554", "score": "0.6399827", "text": "onCustomWidgetDestroy(){\r\n \r\n }", "title": "" }, { "docid": "d8fceee4177653978464cfa07dada554", "score": "0.6399827", "text": "onCustomWidgetDestroy(){\r\n \r\n }", "title": "" }, { "docid": "9a013f7548d6fa15a8ca4f191914f7ba", "score": "0.6293063", "text": "static EndScrollView() {}", "title": "" }, { "docid": "19969faa932d645f6ec25ad4cbc03bd3", "score": "0.6229243", "text": "onCustomWidgetDestroy(){\n \n }", "title": "" }, { "docid": "19969faa932d645f6ec25ad4cbc03bd3", "score": "0.6229243", "text": "onCustomWidgetDestroy(){\n \n }", "title": "" }, { "docid": "2df2e9e668b6c27d23b6a03691984eb7", "score": "0.6180555", "text": "onCustomWidgetDestroy(){\n }", "title": "" }, { "docid": "58bd06943dd859d059963727381c437e", "score": "0.6087862", "text": "static EndArea() {}", "title": "" }, { "docid": "f4c2b3b289e6d33895bd10fb745baf16", "score": "0.596758", "text": "end() {\n const canvas = this.getCanvas();\n\n canvas.isDrawingMode = false;\n }", "title": "" }, { "docid": "61014f9433314435fa6b586eb4dbff3d", "score": "0.5951695", "text": "function CdkDragEnd() {}", "title": "" }, { "docid": "61014f9433314435fa6b586eb4dbff3d", "score": "0.5951695", "text": "function CdkDragEnd() {}", "title": "" }, { "docid": "f66af5c7114b18d0a8f90cbfa960bb99", "score": "0.59326357", "text": "function finalDraw() {\n\t Registry.getComponentMethod('shapes', 'draw')(gd);\n\t Registry.getComponentMethod('images', 'draw')(gd);\n\t Registry.getComponentMethod('annotations', 'draw')(gd);\n\t Registry.getComponentMethod('legend', 'draw')(gd);\n\t Registry.getComponentMethod('rangeslider', 'draw')(gd);\n\t Registry.getComponentMethod('rangeselector', 'draw')(gd);\n\t Registry.getComponentMethod('updatemenus', 'draw')(gd);\n\t Registry.getComponentMethod('sliders', 'draw')(gd);\n\t }", "title": "" }, { "docid": "d7f2025f152c09bbfaaf7e17244b7939", "score": "0.5895538", "text": "endListBox()\n {}", "title": "" }, { "docid": "edaaf4da59d028ea73bf0331e6382993", "score": "0.58690184", "text": "function BodyWidget(){return _super.call(this)||this;}", "title": "" }, { "docid": "763bd79ed7237dd777ed356acc5af370", "score": "0.58284587", "text": "static EndVertical() {}", "title": "" }, { "docid": "cacc6dffc29159b82e219ade642da7af", "score": "0.58256036", "text": "static EndEdit()\n {\n // Call this \"event\" to let the interested elements know that editing has ended\n this.OnEditEnd(this.editText)\n\n // Restore the elements original styling\n this.element.style.background = this.styles.background\n this.element.style.color = this.styles.color\n this.element.style.fontWeight = this.styles.fontWeight\n this.element.style.border = this.styles.border\n\n Input.isEditing = false\n Input.element = null\n Input.editText = \"\"\n\n }", "title": "" }, { "docid": "d79b5449d10c6cb0c7d1cdaf265feb21", "score": "0.5780826", "text": "function Widget() {}", "title": "" }, { "docid": "9be3bbe19b3746684580fa4b4e73204e", "score": "0.5770776", "text": "function endCombo(){\n\t\t\tif (hideTimeout){\n\t\t\t\tclearTimeout(hideTimeout);\n\t\t\t}\n\t\t\t\n\t\t\tvar comboScore = Math.round(0.1*combo*combo + combo);\n\t\t\t\n\t\t\tinFieldEl.css({\n\t\t\t\t'left' : Math.round(position.left + 5) + 'px',\n\t\t\t\t'top' : Math.round(position.top + 5) + 'px',\n\t\t\t\t'display' : 'block'\n\t\t\t}).text('+' + comboScore);\n\n\t\t\tadd(comboScore);\n\t\t\tcombo = 0;\n\t\t\t\n\t\t\thideTimeout = setTimeout(hide, 500);\t\t\t\n\t\t}", "title": "" }, { "docid": "af8f51561cb9dc8e19fb23f83fd6768f", "score": "0.576946", "text": "close () {\n\t\tif (!this.obj || !this.is_visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.is_visible = false;\n\n\t\tthis.hideObj();\n\t}", "title": "" }, { "docid": "aae1d4f488866d1621896fb8d5c76b54", "score": "0.5743456", "text": "end() {\n this._end();\n }", "title": "" }, { "docid": "2614fdb6ab2c4d16afb9584fbc09c875", "score": "0.573646", "text": "function end ( event, Dt, Op ) {\n\n // The handle is no longer active, so remove the class.\n if ( Dt.handles.length === 1 ) {\n Dt.handles[0].data('grab').removeClass(clsList[4]);\n }\n\n // Remove cursor styles and text-selection events bound to the body.\n if ( event.cursor ) {\n body.css('cursor', '').off( namespace );\n }\n\n // Unbind the move and end events, which are added on 'start'.\n doc.off( namespace );\n\n // Trigger the change event.\n Dt.target.removeClass( clsList[14] +' '+ clsList[20]).change();\n\n // Trigger the 'end' callback.\n call( Op['set'], Dt.target );\n }", "title": "" }, { "docid": "81596a43d29972b493604eae0e6d239a", "score": "0.5731438", "text": "function endAnimation() {\n window[\"__checkBudget__\"]();\n controls.start({\n x: appState.pointX,\n y: appState.pointY,\n scale: 0,\n });\n controls.start({\n opacity: 0,\n transition: { duration: 0.14 },\n });\n }", "title": "" }, { "docid": "031bb85af2a2ea2e9ec46282f7e6913b", "score": "0.5719218", "text": "close() {\r\n // close all the widget of the page\r\n for (var id in this.widget_objects) {\r\n var widget_object = this.widget_objects[id]\r\n if(typeof widget_object.close === 'function')\r\n widget_object.close()\r\n }\r\n }", "title": "" }, { "docid": "ab4f810329fbd72c1cdd21490eb64bca", "score": "0.571878", "text": "function WidgetEditor() {\n }", "title": "" }, { "docid": "53ddcc9f8acafbb88976574dfe8d9fe4", "score": "0.5711384", "text": "end() {\n if (this._end) this._end()\n else this.emit('end')\n }", "title": "" }, { "docid": "241075c962e0534f290ba011d36b5d79", "score": "0.56804806", "text": "cleanUp() {\n this.panelMode = this.endPanelMode;\n }", "title": "" }, { "docid": "b0189e79547ca49140be0ffdd8174a81", "score": "0.5676129", "text": "end() {\n const canvas = this.getCanvas();\n\n canvas.defaultCursor = 'default';\n canvas.selection = false;\n\n canvas.forEachObject((obj) => {\n obj.set({\n evented: true\n });\n });\n\n canvas.off('mouse:down', this._listeners.mousedown);\n }", "title": "" }, { "docid": "2ca614324c5a141a03194cb82b11f436", "score": "0.5670456", "text": "dispose() {\n const self = this;\n self.hide(true);\n toggleOffcanvasEvents(self);\n super.dispose();\n }", "title": "" }, { "docid": "89ea1a9d7a2c78e8e5748099e4c5c206", "score": "0.5648991", "text": "function endDrawing() {\n\tconsole.log(\" End at \"+ endPos);\n\td3.selectAll(\".prevForm\").remove();\n\t(modeSel == 0) ? drawNewLine() : drawNewRect();\n}", "title": "" }, { "docid": "c27aa90877253588a8b40f686649101a", "score": "0.5615553", "text": "_endClick() {\n const that = this;\n\n //Click Handler\n that._resizeHandler();\n\n if (that.disabled || that.readonly) {\n return;\n }\n\n if (that._isInactiveOn('click')) {\n return;\n }\n\n if (that.clickMode !== 'release' && that.clickMode !== 'pressAndRelease') {\n //event.preventDefault();\n //event.stopPropagation();\n }\n else {\n that._updateStateOnClick();\n }\n\n that.indeterminate = false;\n that._updateHidenInputNameAndValue();\n }", "title": "" }, { "docid": "44c2dc8f9b8a57b44969e93f6bb0e90a", "score": "0.56030864", "text": "function CdkDragExit() {}", "title": "" }, { "docid": "44c2dc8f9b8a57b44969e93f6bb0e90a", "score": "0.56030864", "text": "function CdkDragExit() {}", "title": "" }, { "docid": "cb0d2c3bcc196a93551deac68dfd7956", "score": "0.55838364", "text": "_endInner(t) {\n this._disposeCurrent(t);\n this._checkEnd(t);\n }", "title": "" }, { "docid": "30903a53092d1548da03892f0a8e4f7a", "score": "0.5580222", "text": "dispose() {\n const self = this;\n self.hide(true);\n toggleOffcanvasEvents(self);\n super.dispose();\n }", "title": "" }, { "docid": "8412950c7f118a790c5c8dc85c21388c", "score": "0.556999", "text": "function end ( event ) {\n\n // The handle is no longer active, so remove the class.\n $('.' + Classes[15]).removeClass(Classes[15]);\n\n // Remove cursor styles and text-selection events bound to the body.\n if ( event.cursor ) {\n $('body').css('cursor', '').off( namespace );\n }\n\n // Unbind the move and end events, which are added on 'start'.\n doc.off( namespace );\n\n // Remove dragging class.\n $Target.removeClass(Classes[12]);\n\n // Fire the change and set events.\n fireEvents(['set', 'change']);\n }", "title": "" }, { "docid": "7f1ca99e3532ff1373e2b8f17f23246d", "score": "0.5520987", "text": "finish(event) {\r\n super.finish(event);\r\n }", "title": "" }, { "docid": "15a7166b958a10b676356e6a458b49ce", "score": "0.55196226", "text": "end() {\n\n\t\tsuper.end();\n\n\t\t// Rimuovi anche l'evento aggiunto dall'override di begin\n\t\tif (this.__MouseMoveWindowListener) {\n\t\t\tRemoveEvent(window, 'mousemove', this.__MouseMoveWindowListener);\n\t\t}\n\t}", "title": "" }, { "docid": "288d40cc2615c375bbb795c999b3b2aa", "score": "0.5506177", "text": "function deleteWidget()\n {\n //todo\n }", "title": "" }, { "docid": "ca5518cd1f3d4a3b85b626042d35a4c7", "score": "0.5497685", "text": "get widgetClass() {}", "title": "" }, { "docid": "ca5518cd1f3d4a3b85b626042d35a4c7", "score": "0.5497685", "text": "get widgetClass() {}", "title": "" }, { "docid": "ca5518cd1f3d4a3b85b626042d35a4c7", "score": "0.5497685", "text": "get widgetClass() {}", "title": "" }, { "docid": "ca5518cd1f3d4a3b85b626042d35a4c7", "score": "0.5497685", "text": "get widgetClass() {}", "title": "" }, { "docid": "0dbb74476d6d5c26c1cd9678f71e3ca1", "score": "0.5495696", "text": "function Widget() {\n\t _super.call(this);\n\t this._flags = 0;\n\t this._layout = null;\n\t this._parent = null;\n\t this.addClass(WIDGET_CLASS);\n\t }", "title": "" }, { "docid": "a3d3b637a434c66aa246d577809dbff0", "score": "0.548951", "text": "function end() {\n this.pos = this.listSize - 1;\n}", "title": "" }, { "docid": "5917c2af6b41818623b16ead3a6f01bc", "score": "0.54860044", "text": "function updateWidget()\n {\n //todo\n }", "title": "" }, { "docid": "6bcce94deeaa5e9d3a3ee02c2f858e0c", "score": "0.548569", "text": "dispose() {\n\n\t\tthis.setEnabled(false);\n\n\t}", "title": "" }, { "docid": "6bcce94deeaa5e9d3a3ee02c2f858e0c", "score": "0.548569", "text": "dispose() {\n\n\t\tthis.setEnabled(false);\n\n\t}", "title": "" }, { "docid": "9aee6f9d4e52846c0b32782df0541da5", "score": "0.54838085", "text": "function end ( event ) {\n\n\t\t// The handle is no longer active, so remove the class.\n\t\t$('.' + Classes[15]).removeClass(Classes[15]);\n\n\t\t// Remove cursor styles and text-selection events bound to the body.\n\t\tif ( event.cursor ) {\n\t\t\t$('body').css('cursor', '').off( namespace );\n\t\t}\n\n\t\t// Unbind the move and end events, which are added on 'start'.\n\t\tdoc.off( namespace );\n\n\t\t// Remove dragging class.\n\t\t$Target.removeClass(Classes[12]);\n\n\t\t// Fire the change and set events.\n\t\tfireEvents(['set', 'change']);\n\t}", "title": "" }, { "docid": "79288bc9e198ff0de44580c72345e8c9", "score": "0.54835784", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.TextComponent_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "f1496d1c44cceeb6da0a55611d958373", "score": "0.54803544", "text": "function End () {}", "title": "" }, { "docid": "dfb85872f8f951167ad8978b967db0ab", "score": "0.544853", "text": "onCustomWidgetAfterUpdate(oChangedProperties) {\r\n\r\n }", "title": "" }, { "docid": "43fa5e2d9720278a31b7c2d830638051", "score": "0.54382885", "text": "_endDrag() {\n const that = this;\n\n that.indeterminate = false;\n that._updateHidenInputNameAndValue();\n\n if (that._isInactiveOn('drag') || !that._mouseDown) {\n return;\n }\n\n that.removeAttribute('dragged');\n\n let switchOnPosition = (that.orientation === 'vertical' ? (that.$.innerContainer.offsetTop + that.$.switchThumb.offsetTop + that.$.switchThumb.clientHeight / 2) : (that.$.innerContainer.offsetLeft + that.$.switchThumb.offsetLeft + that.$.switchThumb.clientWidth / 2));\n\n const switchAfterBreakPoint = switchOnPosition > that._switchBreakPoint;\n\n if (that.checked !== null) {\n if (!that.inverted === (switchAfterBreakPoint === that.checked)) {\n that._changeCheckState(!that.checked);\n }\n }\n else {\n switchAfterBreakPoint ? that._changeCheckState(that.inverted) : that._changeCheckState(!that.inverted);\n }\n\n that._removeDragStyles();\n that._updateThumbPosition();\n }", "title": "" }, { "docid": "647434afa4481f4bb9e4a6ce65967e8e", "score": "0.54266536", "text": "dispose() {\n // Use the setter: disconnect events\n this.skin = null;\n }", "title": "" }, { "docid": "50baa033dab6e7ec2ccb4d3dd9e6fb03", "score": "0.5417716", "text": "closeEnd() {\n this.setState({showEnd: false});\n }", "title": "" }, { "docid": "d12ca2382e541e20e25d0c0c48b2997d", "score": "0.5417214", "text": "onCustomWidgetAfterUpdate(oChangedProperties) {}", "title": "" }, { "docid": "191375ab8009c40391b42c33b2f60100", "score": "0.53937024", "text": "destroy() {\n this.activeRangeEnd$.complete();\n this.dateRangePopup$.complete();\n this.focusedDate$.complete();\n this.endInput$.complete();\n this.startInput$.complete();\n this.range$.complete();\n }", "title": "" }, { "docid": "254d65c4a8be758dccdd3783bb524e1c", "score": "0.53906864", "text": "onCustomWidgetAfterUpdate(oChangedProperties) {\n }", "title": "" }, { "docid": "3b4835615ba6b4f668b48e5a4c516994", "score": "0.538417", "text": "onCustomWidgetAfterUpdate(oChangedProperties) {\n\n }", "title": "" }, { "docid": "23006e7c3c7b2dbff3c83db9cd4f9110", "score": "0.53785473", "text": "dispose() {\n toggleButtonHandler(this);\n super.dispose();\n }", "title": "" }, { "docid": "5894a33667c526153b2c5e9333a94a9a", "score": "0.53731704", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.SeparatorComponent_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "ff6b6ec617f0724d946bbb857c8981ab", "score": "0.53727275", "text": "exitToTV() {\n\t\tthis._widgetAPI.sendExitEvent();\n\t}", "title": "" }, { "docid": "7d739f0a2a25bb32a21f9ae43f38f6d1", "score": "0.53682584", "text": "endToggle() {\n this.hideRipple();\n }", "title": "" }, { "docid": "f3b4bf087ef8c322ab433da26a21177c", "score": "0.53657365", "text": "postCreate () {\n this.inherited(arguments);\n console.log('<%= widgetName %>::postCreate');\n }", "title": "" }, { "docid": "f9ed2615bd671807c80c3586a226918d", "score": "0.5354913", "text": "function end(event, data) {\n // The handle is no longer active, so remove the class.\n var active = scope_Base.querySelector('.' + cssClasses[15]),\n handleNumber = data.handles[0] === scope_Handles[0] ? 0 : 1;\n if (active !== null) {\n removeClass(active, cssClasses[15]);\n }\n // Remove cursor styles and text-selection events bound to the body.\n if (event.cursor) {\n document.body.style.cursor = '';\n document.body.removeEventListener('selectstart', document.body.noUiListener);\n }\n var d = document.documentElement;\n // Unbind the move and end events, which are added on 'start'.\n d.noUiListeners.forEach(function(c) {\n d.removeEventListener(c[0], c[1]);\n });\n // Remove dragging class.\n removeClass(scope_Target, cssClasses[12]);\n // Fire the change and set events.\n fireEvent('set', handleNumber);\n fireEvent('change', handleNumber);\n // If this is a standard handle movement, fire the end event.\n if (data.handleNumber !== undefined) {\n fireEvent('end', data.handleNumber);\n }\n }", "title": "" }, { "docid": "b945580f376088f26c8056fbf6b003b7", "score": "0.5351043", "text": "_destroy() {\n if (this._destroyed) {\n return;\n }\n this._destroyed = true;\n this.emit('end');\n }", "title": "" }, { "docid": "6ee5a57159f13d71b867111dbe5a0616", "score": "0.53459126", "text": "static EndHorizontal() {}", "title": "" }, { "docid": "35994b43ccba4b1d8a0bc876940ff80d", "score": "0.5339907", "text": "function onDragEnd() {\n resetElementStyle();\n var elementName = dragObj.element.querySelector('.element__name');\n if (isLibraryParent()) {\n if (elementName.getElementsByTagName('b')) {\n elementName.innerHTML = elementName.textContent;\n }\n formula.addElement(dragObj.element);\n return;\n }\n formula.removeRedundantPluses();\n library.addElement(dragObj.element);\n if (!filter.isFilterInputClear()) {\n library.highlightElements();\n }\n }", "title": "" }, { "docid": "7daba6fdc96a7c48fe6fd96eaa5da2de", "score": "0.5335007", "text": "get end() { return this._end; }", "title": "" }, { "docid": "5b1f9a7c31abfb986e3d95c0acd9e568", "score": "0.53306574", "text": "function EndRepeat() {\n Row.call(this);\n this.hasDrawable = false;\n}", "title": "" }, { "docid": "d43cf52813e89a8a18b61d2b9126926d", "score": "0.5326424", "text": "destroy() {\n super.destroy();\n }", "title": "" }, { "docid": "1ea99cccdc211751f8e6692e06be0caa", "score": "0.5325215", "text": "end() {\n this.position = this.length() - 1;\n }", "title": "" }, { "docid": "2480a66784b9d891dfca6c3bb2fc5ff3", "score": "0.53249294", "text": "_destroy() {\n this._destroySearchTerms();\n this._deleteImg.removeEventListener('click', this._boundDestroy);\n this._invField.clearEvents();\n\n this._parentElem.remove();\n\n this.__dispatchEvent(EVENT_OBJECT_DESTROYED, new ObjectDestroyedEventArgs(this));\n }", "title": "" }, { "docid": "1107f3cf55a264a4819e6088f3a7d04c", "score": "0.532189", "text": "detached() {\n if (this.widget) {\n this.widget.destroy();\n }\n }", "title": "" }, { "docid": "1107f3cf55a264a4819e6088f3a7d04c", "score": "0.532189", "text": "detached() {\n if (this.widget) {\n this.widget.destroy();\n }\n }", "title": "" }, { "docid": "d655d2d550ae1e6306bc2090c64b8cb8", "score": "0.5321056", "text": "end() {\n\n\t\tthis.clearInterval(this._timer);\n\t}", "title": "" }, { "docid": "15a792181b3415afaf66b13b7ac0f6ac", "score": "0.53117603", "text": "function end ( event, data ) {\r\n\r\n\t\t\t// The handle is no longer active, so remove the class.\r\n\t\t\tvar active = scope_Base.querySelector( '.' + options.cssClasses.active ),\r\n\t\t\t\thandleNumber = data.handles[0] === scope_Handles[0] ? 0 : 1;\r\n\r\n\t\t\tif ( active !== null ) {\r\n\t\t\t\tremoveClass(active, options.cssClasses.active);\r\n\t\t\t}\r\n\r\n\t\t\t// Remove cursor styles and text-selection events bound to the body.\r\n\t\t\tif ( event.cursor ) {\r\n\t\t\t\tdocument.body.style.cursor = '';\r\n\t\t\t\tdocument.body.removeEventListener('selectstart', document.body.noUiListener);\r\n\t\t\t}\r\n\r\n\t\t\tvar d = document.documentElement;\r\n\r\n\t\t\t// Unbind the move and end events, which are added on 'start'.\r\n\t\t\td.noUiListeners.forEach(function( c ) {\r\n\t\t\t\td.removeEventListener(c[0], c[1]);\r\n\t\t\t});\r\n\r\n\t\t\t// Remove dragging class.\r\n\t\t\tremoveClass(scope_Target, options.cssClasses.drag);\r\n\r\n\t\t\t// Fire the change and set events.\r\n\t\t\tfireEvent('set', handleNumber);\r\n\t\t\tfireEvent('change', handleNumber);\r\n\r\n\t\t\t// If this is a standard handle movement, fire the end event.\r\n\t\t\tif ( data.handleNumber !== undefined ) {\r\n\t\t\t\tfireEvent('end', data.handleNumber);\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "14bc066d174431b697c5db17d49097a9", "score": "0.5309974", "text": "__destroy () {\n super.__destroy()\n this.controls.destroy()\n this.__resizeWatcher = false\n if ( this.ticker.started ) {\n this.ticker.stop()\n }\n }", "title": "" }, { "docid": "909b31c9723d95ee6433dc5ddcdc9739", "score": "0.53058594", "text": "function elementEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 3 /* Element */);\n var lView = getLView();\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(getLView()[TVIEW], previousOrParentTNode);\n decreaseElementDepthCount();\n // this is fired at the end of elementEnd because ALL of the stylingBindings code\n // (for directives and the template) have now executed which means the styling\n // context can be instantiated properly.\n if (hasClassInput(previousOrParentTNode)) {\n var stylingContext = getStylingContext(previousOrParentTNode.index, lView);\n setInputsForProperty(lView, previousOrParentTNode.inputs['class'], getInitialClassNameValue(stylingContext));\n }\n}", "title": "" }, { "docid": "909b31c9723d95ee6433dc5ddcdc9739", "score": "0.53058594", "text": "function elementEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 3 /* Element */);\n var lView = getLView();\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(getLView()[TVIEW], previousOrParentTNode);\n decreaseElementDepthCount();\n // this is fired at the end of elementEnd because ALL of the stylingBindings code\n // (for directives and the template) have now executed which means the styling\n // context can be instantiated properly.\n if (hasClassInput(previousOrParentTNode)) {\n var stylingContext = getStylingContext(previousOrParentTNode.index, lView);\n setInputsForProperty(lView, previousOrParentTNode.inputs['class'], getInitialClassNameValue(stylingContext));\n }\n}", "title": "" }, { "docid": "909b31c9723d95ee6433dc5ddcdc9739", "score": "0.53058594", "text": "function elementEnd() {\n var previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n }\n else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, 3 /* Element */);\n var lView = getLView();\n var currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(getLView()[TVIEW], previousOrParentTNode);\n decreaseElementDepthCount();\n // this is fired at the end of elementEnd because ALL of the stylingBindings code\n // (for directives and the template) have now executed which means the styling\n // context can be instantiated properly.\n if (hasClassInput(previousOrParentTNode)) {\n var stylingContext = getStylingContext(previousOrParentTNode.index, lView);\n setInputsForProperty(lView, previousOrParentTNode.inputs['class'], getInitialClassNameValue(stylingContext));\n }\n}", "title": "" }, { "docid": "8d178ce95a2b1991327006b317e2ddc4", "score": "0.53010446", "text": "function createWidget()\n {\n //todo\n }", "title": "" }, { "docid": "5bd3ac6d06dc716fc823a050a2372c60", "score": "0.5299477", "text": "postCreate() {\n this.inherited(arguments);\n console.log('Localizar_wgt::postCreate');\n self_lw = this;\n }", "title": "" }, { "docid": "1fb43100f536006f485671bc168f5eff", "score": "0.5298394", "text": "_finishSelection() {\n this.setInputValue();\n this.close();\n }", "title": "" }, { "docid": "3b42a34b3e06dc960a3fd728ca831123", "score": "0.52961135", "text": "fastDrawEnd () {\n this.fastDraw = false\n }", "title": "" }, { "docid": "56442b5578c92a8a0345f01ccf8e41bb", "score": "0.5292884", "text": "dispose() {\n this.disposeControlPointUI();\n super.dispose();\n }", "title": "" }, { "docid": "68540250df8f228b95c5d7a4f2095860", "score": "0.52884537", "text": "render()\n {\n throw 'The widget requires a render() method';\n\n }", "title": "" }, { "docid": "c23329a26496474936e639e2f96ed137", "score": "0.52844286", "text": "function brushend() {\n if (brush.empty()) svg.selectAll(\".hidden\").classed(\"hidden\", false);\n }", "title": "" }, { "docid": "d41d96159621c2116937ffbb2cf68b1a", "score": "0.5283885", "text": "selfRender() {}", "title": "" }, { "docid": "10253a58257b862a0cb3c383e069b0d2", "score": "0.5282223", "text": "completeCallback() {\n // Create a \"ref-like\" object every time to ensure\n // the same widget id can also triggers the focus control.\n setFocusedWidgetIdRef({\n current: widgetId\n });\n }", "title": "" }, { "docid": "2dd8d04834bdeb5593e1a35ee136eee0", "score": "0.5282083", "text": "dispose() {\n this._id = RenderConstants.ID_NONE;\n }", "title": "" }, { "docid": "ac0a08a51f233485d241fc108f8fb6f3", "score": "0.5281025", "text": "dragend() {\n\t\tthis.dragging = false \n\t\tthis.vc('Over').style.display = 'none'\n\t}", "title": "" }, { "docid": "642a845ae9dd9f215a170dcbd6f84b62", "score": "0.527972", "text": "function endPlate() {\n gameControl.endGameOptions.classList.remove('hide');\n grid.classList.add('blur')\n }", "title": "" }, { "docid": "0618d76491c057f852d6c1bcd417d9d7", "score": "0.52777195", "text": "function brushend() {\n if (brush.empty())\n svg.selectAll('.hidden')\n .classed('hidden', false);\n }", "title": "" }, { "docid": "ff8189a21580a295520b9bbc1c89b0b5", "score": "0.5277667", "text": "destroy() {\n // override this\n }", "title": "" }, { "docid": "7741569dcb189be03e5e7e2873cddc7f", "score": "0.52765113", "text": "function dragEnd() {\r\n this.classList.remove('none', 'dragged');\r\n }", "title": "" }, { "docid": "ecf9b66d67da09ad76a30ee84401f246", "score": "0.5275585", "text": "function brushend() {\n if (brush.empty()) svg.selectAll(\".hidden\").classed(\"hidden\", false);\n }", "title": "" }, { "docid": "12ae0c99a31b842ebd973e72ac4c5a68", "score": "0.52753466", "text": "function end ( event, data ) {\n\t\n\t\t\t\t// The handle is no longer active, so remove the class.\n\t\t\t\tvar active = scope_Base.querySelector( '.' + options.cssClasses.active ),\n\t\t\t\t\thandleNumber = data.handles[0] === scope_Handles[0] ? 0 : 1;\n\t\n\t\t\t\tif ( active !== null ) {\n\t\t\t\t\tremoveClass(active, options.cssClasses.active);\n\t\t\t\t}\n\t\n\t\t\t\t// Remove cursor styles and text-selection events bound to the body.\n\t\t\t\tif ( event.cursor ) {\n\t\t\t\t\tdocument.body.style.cursor = '';\n\t\t\t\t\tdocument.body.removeEventListener('selectstart', document.body.noUiListener);\n\t\t\t\t}\n\t\n\t\t\t\tvar d = document.documentElement;\n\t\n\t\t\t\t// Unbind the move and end events, which are added on 'start'.\n\t\t\t\td.noUiListeners.forEach(function( c ) {\n\t\t\t\t\td.removeEventListener(c[0], c[1]);\n\t\t\t\t});\n\t\n\t\t\t\t// Remove dragging class.\n\t\t\t\tremoveClass(scope_Target, options.cssClasses.drag);\n\t\n\t\t\t\t// Fire the change and set events.\n\t\t\t\tfireEvent('set', handleNumber);\n\t\t\t\tfireEvent('change', handleNumber);\n\t\n\t\t\t\t// If this is a standard handle movement, fire the end event.\n\t\t\t\tif ( data.handleNumber !== undefined ) {\n\t\t\t\t\tfireEvent('end', data.handleNumber);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "92d1a977f42e39fef59948c908e39f62", "score": "0.52721035", "text": "endY(){\n this.end.getConnectionPoint(this.start).getY();\n }", "title": "" }, { "docid": "610752fcfbdcd2519fe404675299d32d", "score": "0.5269626", "text": "destroy() {\n let instance = this;\n instance.eventHandlers.forEach(({el, handlers}) => {\n Object.keys(handlers).forEach(event => el.removeEventListener(event, handlers[event], false));\n });\n instance.widget.parentNode.removeChild(instance.widget);\n instance.eventHandlers = instance.widget = instance.container = instance.scrollBody = null;\n }", "title": "" }, { "docid": "2bf1273a77abde9b118474ff12a26217", "score": "0.52669054", "text": "dispose() {\n if (this.ptr != 0) {\n instance().exports.TextComponentState_drop(this.ptr);\n this.ptr = 0;\n }\n }", "title": "" }, { "docid": "65d4e1ddcc7b203076b048e5afeba21e", "score": "0.52658933", "text": "function eventEnd(event, data) {\n // The handle is no longer active, so remove the class.\n if (data.handle) {\n removeClass(data.handle, options.cssClasses.active);\n scope_ActiveHandlesCount -= 1;\n }\n // Unbind the move and end events, which are added on 'start'.\n data.listeners.forEach(function (c) {\n scope_DocumentElement.removeEventListener(c[0], c[1]);\n });\n if (scope_ActiveHandlesCount === 0) {\n // Remove dragging class.\n removeClass(scope_Target, options.cssClasses.drag);\n setZindex();\n // Remove cursor styles and text-selection events bound to the body.\n if (event.cursor) {\n scope_Body.style.cursor = \"\";\n scope_Body.removeEventListener(\"selectstart\", preventDefault);\n }\n }\n data.handleNumbers.forEach(function (handleNumber) {\n fireEvent(\"change\", handleNumber);\n fireEvent(\"set\", handleNumber);\n fireEvent(\"end\", handleNumber);\n });\n }", "title": "" } ]
f18a85b375d08074b3c7031ed90067ee
Sends a reboot request to the backend.
[ { "docid": "5199d29a0feadc4994d63cf080008d89", "score": "0.5882325", "text": "endRmaAndReboot_() {\n executeThenTransitionState(\n this, () => this.shimlessRmaService_.endRma(ShutdownMethod.kReboot));\n }", "title": "" } ]
[ { "docid": "775970b35e685d25187cc174bd71bd39", "score": "0.732703", "text": "function reboot() {\n sendPowerCommand('reboot');\n}", "title": "" }, { "docid": "d39ec7863d617de01f68244dcfd10fcb", "score": "0.6762547", "text": "function reboot()\n{\n\tconsole.log('rebooting...');\n\trequire('child_process').spawn('shutdown', ['-r', 'now']);\n}", "title": "" }, { "docid": "b0d0fd69320853bc31c98a294d15993a", "score": "0.63842994", "text": "function reboot(callback) {\n console.log('Simulating reboot phase');\n\n async.waterfall([\n function(callback) {\n sendStatusUpdate('rebooting', 'Start reboot', function (err) {\n if (err) {\n console.error(chalk.red('Error occured sending status update : ' + err.message));\n }\n });\n callback(null);\n },\n function(callback) {\n // Simulate a delay rebooting the device.\n setTimeout(function() {\n callback(null); \n }, 40000);\n },\n function(callback) {\n sendStatusUpdate('rebooting', 'Finished reboot', function (err) {\n if (err) {\n console.error(chalk.red('Error occured sending status update : ' + err.message));\n }\n });\n callback(null);\n }\n ], function (err) {\n callback(err, desiredFirmwareProperties.fwVersion);\n });\n}", "title": "" }, { "docid": "c41f8236f9f8a194357ad60d049deb6c", "score": "0.62877053", "text": "function rebootDevice() {\r\n\tvar obj = { core: 30};\r\n\twebsocket.send(JSON.stringify(obj));\r\n}", "title": "" }, { "docid": "9e82b3212f1eff70f10b351a8b5f123f", "score": "0.6192246", "text": "function reboot() {\n location.reload();\n}", "title": "" }, { "docid": "70d58dc7774bbd6d2fe4f545f2a620cb", "score": "0.59314454", "text": "restart(last) {\n var ping;\n var body;\n var num = 1;\n do {\n xdmp.sleep(1000);\n if ( ! (num % 3) ) {\n // TODO: Says \"Still waiting...\", somehow?\n }\n try {\n var res = xdmp.httpGet(this.url('admin', '/timestamp'), this.credentials());\n ping = fn.head(res);\n body = fn.head(fn.tail(res));\n }\n catch ( err ) {\n ping = err;\n }\n }\n while ( ++num < 10 && (ping.code === 503) );\n if ( ping.code !== 200 ) {\n throw new Error('Error waiting for server restart: ' + num + ' - ' + ping);\n }\n var now = Date.parse(body);\n if ( last >= now ) {\n throw new Error('Error waiting for server restart: ' + last + ' - ' + now);\n }\n }", "title": "" }, { "docid": "6aca2b158cc4209702921b17fd77df32", "score": "0.5922399", "text": "CreateATaskToRebootThePhone(billingAccount, serviceName) {\n let url = `/telephony/${billingAccount}/line/${serviceName}/phone/reboot`;\n return this.client.request('POST', url);\n }", "title": "" }, { "docid": "2af1030bab75580b8b44dad8cdf81894", "score": "0.5858803", "text": "handleRestart() {\n this._clearState();\n this._updateStatus('restarting');\n this._clearSocket();\n }", "title": "" }, { "docid": "06475f9651b04e408327217f3eccaa97", "score": "0.5794735", "text": "function rebootInstance (instance){\n\n var ec2 = new AWS.EC2();\n\n var params = {\n InstanceIds: [\n instance.InstanceId\n ],\n DryRun: false\n };\n ec2.rebootInstances(params).promise()\n .then(function(){\n console.log(\"Reboot completed\");\n })\n .catch(function (error) {\n console.log('Error rebooting instance \\n' + error);\n });\n}", "title": "" }, { "docid": "0035401e9e9441a4e9137dedb8393ec0", "score": "0.57521605", "text": "RestartThePrivateDatabase(serviceName) {\n let url = `/hosting/privateDatabase/${serviceName}/restart`;\n return this.client.request('POST', url);\n }", "title": "" }, { "docid": "86c0d443f7ed27a7ba5be201445ebe33", "score": "0.56387943", "text": "function rebootDevice() {\n if (selectedPlayer !== null) {\n selectedPlayer.overwatch = 0;\n convergeCheck();\n logMessage(selectedPlayer.name + \" has rebooted. Overwatch now 0.\");\n }\n}", "title": "" }, { "docid": "c5db0cef72980445936f83da37ae2937", "score": "0.5487004", "text": "function relayRestartToBackground(){\n\tchrome.runtime.sendMessage({text:\"restart windows\"},function(response){\n\t\tconsole.log(\"Told background.js to restart windows.\");\n\t});\n}", "title": "" }, { "docid": "08eae600d84a566a7cfa0bcd7982c5ed", "score": "0.54312736", "text": "function restart()\n{\n // Swaps the signs: 'o' <-> 'x'\n sign = sign === 'x' ? 'o' : 'x';\n\n // Starts a new game.\n start();\n\n // Sends the 'restart' command to the server.\n request.open(\"get\", \"restart\", true);\n request.send();\n}", "title": "" }, { "docid": "4a55b1274acf16b47755dca5e3911d62", "score": "0.5431006", "text": "function rebootComputer(computerName) {\n // Wrapped in a promise due to the time it takes to execute the reboot command. Must be able init reboot on multiple computers at the same time.\n return new Promise(async (resolve, reject) => {\n const newRebootInfo = {\n computer: computerName,\n deployResult: { success: null, running: true }\n };\n\n // Add/update the reboot info, so that the client can ask for current status.\n updateRebootInfo([newRebootInfo]);\n\n try {\n // Run the reboot command with the help of PsExec.\n const result = await runPsexecCommand(\n computerName,\n \"cscript.exe /nologo c:\\\\temp\\\\setboot.vbs /accepteula\"\n );\n\n // Add relevant information about the result.\n newRebootInfo.deployResult.started = new Date();\n newRebootInfo.deployResult.success = true;\n newRebootInfo.deployResult.running = false;\n newRebootInfo.deployResult.data = result;\n } catch (err) {\n // The remote reboot failed. Add relevant information.\n newRebootInfo.deployResult.success = false;\n newRebootInfo.deployResult.running = false;\n newRebootInfo.deployResult.err = err;\n }\n\n // Update the reboot info once again.\n updateRebootInfo([newRebootInfo]);\n });\n}", "title": "" }, { "docid": "affc49e1368ce3bd7a77b2ffed9d1cf8", "score": "0.54270744", "text": "function shutdown() { \n\n var config = {\n url: \"http://\"+serverip+\":8040/request\",\n data: JSON.stringify({\"Command\": \"SYS\", \"Data\": {\"CmdType\": \"SHUTDOWN\"}}),\n type: \"POST\",\n contentType: \"application/json\", // Request\n dataType: \"json\" // Response\n };\n\n $.ajax(config).fail(fail_fct);\n}", "title": "" }, { "docid": "083883ca505d8c668e0aab10df2e55f1", "score": "0.5419457", "text": "restart() {\n console.log('restart was ordered...');\n process.exit();\n this.getAccelaData(this.getDate(), null);\n }", "title": "" }, { "docid": "9d781b33704c19e69932d7be84906ffe", "score": "0.54167104", "text": "function rebootServer() {\n\tswal({\n title: \"Are you sure?\",\n text: \"This will reboot the server, it will be unavaiable for a bit!\",\n icon: \"warning\",\n buttons: true,\n dangerMode: true,\n }).then((willDelete) => {\n if (willDelete) {\n $.ajax({\n url:\"../php/restartListener.php\",\n type:\"POST\",\n });\n }\n });\n}", "title": "" }, { "docid": "27fa319bf991dd710fb835ea97596306", "score": "0.53997976", "text": "restartInstance(instance) {\n return $.ajax({\n url: `${config.apiUrl}/instance/${instance._id}`,\n method: 'PUT',\n headers: {\n 'Girder-Token': this.get('tokenHandler').getWholeTaleAuthToken()\n },\n data: JSON.stringify(instance),\n dataType: 'json',\n contentType: 'application/json',\n timeout: 3000, // ms\n success: function(response) {\n console.log('Restarted Tale instance:', response);\n },\n error: function(err) {\n console.log('Failed to restart Tale instance:', err);\n }\n });\n }", "title": "" }, { "docid": "e201b5276ce97c98e878d328bb035537", "score": "0.53801686", "text": "function sendPlayerRestart() {\n\tsocket.emit('player restart', 'restart');\n }", "title": "" }, { "docid": "7d1e718cbdcd3a074fad089219eee1c0", "score": "0.53666586", "text": "restart() {\n this.localDB.getBackupConfigs()\n .then(backupConfigs => {\n if(backupConfigs.length == 0){\n return;\n }\n backupConfigs.map(backupConfig => {\n log.info(`Restarted ${ backupConfig.id } from ${ this.localDB.server } ${ this.localDB.configCollectionName }`);\n const backupManager = object.selfish(new BackupManager(this.localDB, backupConfig, this.serverSocket));\n log.debug(`Added ${ backupConfig.id } to the backup controller`);\n this.backUpsHash.set(backupConfig.id, backupManager);\n backupManager.restart();\n })\n })\n }", "title": "" }, { "docid": "fe36d9447d96b0773d2b30f61a7772e0", "score": "0.5348722", "text": "function restartServer() {\n io.sockets.emit(constants.SCK_SERVER_RESTART);\n io.close();\n http.close(() => {\n console.log(\"Closed server. Restarting..\");\n\n startServer();\n });\n}", "title": "" }, { "docid": "59225347371b0f9cfebcb52db90b0bda", "score": "0.5335178", "text": "onRebootEvent (error) {\n if (error) {\n console.log(error)\n TokenHelper.eraseToken(this.vm)\n }\n PageHelper.refreshPage()\n }", "title": "" }, { "docid": "48fb6c569001b495ae7ceee6542e63f0", "score": "0.53206694", "text": "function restartGame(){\r\n\tsocket.emit(\"restart\");\r\n}", "title": "" }, { "docid": "2bf0bb7f49f4d9d89cd509f4a0b6d359", "score": "0.53125453", "text": "function restartStep(stepId) {\n 'use strict';\n\n $.ajax({\n url: $.otp.createLink({\n controller: 'crashRepair',\n action: 'restartWorkflowStep'\n }),\n dataType: 'json',\n type: 'POST',\n data: {\n workflowStep: stepId\n },\n success() {\n $.otp.toaster.showSuccessToast(\n `Step #${stepId} restarted`,\n `Restart of the step #${stepId} was successful.`\n );\n syncWorkflowStepData();\n },\n error(error) {\n if (error && error.responseJSON && error.responseJSON.message) {\n $.otp.toaster.showErrorToast('Restart Failed', error.responseJSON.message);\n } else {\n $.otp.toaster.showErrorToast('Restart Failed', 'Unknown error during job restart.');\n }\n }\n });\n}", "title": "" }, { "docid": "e91b5a3272bf554e349d4d55bab8478f", "score": "0.53027004", "text": "function restart (intent, callback)\n{\n sendKeys (['select', 'green'], function (prog)\n {\n callback ({}, buildResponse (intent, 'Restart requested'));\n });\n}", "title": "" }, { "docid": "1ab96f9dec6f6df923e8b6dfd7635c5b", "score": "0.52899957", "text": "restart() {\n return Private.restartKernel(this, this.serverSettings);\n }", "title": "" }, { "docid": "dfeffedcc926e0c933de8cf62f316905", "score": "0.52554864", "text": "function waitForReboot(cpuid)\r\n{\r\n\t// it's not present - switch to the WaitForReboot page\r\n\twindow.navigate(\"WaitForReboot.htm?ID=\" + cpuid + \"&return=\" + encodeURIComponent(window.location.href));\r\n\treturn false;\r\n}", "title": "" }, { "docid": "9d7ab4389f7158ba70bb837f902953ea", "score": "0.5239748", "text": "function restart() {\n setTimeout(function () {\n // There is a promise being ignored here\n // but I am currently too lazy to fix that\n minecraftClient.init();\n }, 2500);\n }", "title": "" }, { "docid": "a5f6e5e22c518ab570676339bc6b88b3", "score": "0.5236541", "text": "_rebootCallback (file) {\n this.api.log(`\\r\\n\\r\\n*** rebooting due to config change (${file}) ***\\r\\n\\r\\n`, 'info')\n delete require.cache[ require.resolve(file) ]\n this.api.commands.restart.call(this.api._self)\n }", "title": "" }, { "docid": "84110f02ae1bf2af1cee467bc201250a", "score": "0.5219992", "text": "_restart(options) {\n options = options || new Options();\n const conditional = options.conditional;\n return this.getEntityId().\n then(() => this._helper.restart(this.id, conditional)).\n then(() => UserInteractor.printInfo(\n conditional ? UserInteractor.MESSAGES.DEVICE_COND_RESTARTED : UserInteractor.MESSAGES.DEVICE_RESTARTED,\n this.identifierInfo));\n }", "title": "" }, { "docid": "c67ced6c31181aa9e2b2d329b947573f", "score": "0.5219483", "text": "function restartClicked() {\n stop();\n generateRequest();\n}", "title": "" }, { "docid": "31f0d62875996e2fdb33c20b195f53f8", "score": "0.5205922", "text": "function restartWorkflowRun(stepId) {\n 'use strict';\n\n $.ajax({\n url: $.otp.createLink({\n controller: 'crashRepair',\n action: 'restartWorkflowRun'\n }),\n dataType: 'json',\n type: 'POST',\n data: {\n workflowStep: stepId\n },\n success() {\n $.otp.toaster.showSuccessToast(\n `Workflow run of step #${stepId} restarted`,\n `Restart of the step #${stepId} was successful.`\n );\n syncWorkflowStepData();\n },\n error(error) {\n if (error && error.responseJSON && error.responseJSON.message) {\n $.otp.toaster.showErrorToast('Restart Failed', error.responseJSON.message);\n } else {\n $.otp.toaster.showErrorToast('Restart Failed', 'Unknown error during workflow restart.');\n }\n }\n });\n}", "title": "" }, { "docid": "cd3cf806325e2ea7039a4b32d735950b", "score": "0.5200259", "text": "function reboot_app () {\n\n\t$(\"#content_alert_danger\").hide();\n\t$(\"#content_alert_success\").hide();\n\t$(\"#content_int\").empty();\n\tbegin.put = false; begin.x = -1; begin.y = -1;\n\tend.put = false; end.x = -1; end.y = -1;\n\tlistObstacle = [];\n\tlistWay = [];\n}", "title": "" }, { "docid": "72a3ab9c948cdb2d4e68543cc7b2b7c0", "score": "0.51999533", "text": "function restartServer() {\n console.log(\"NOT SUPPORTED YET!\".red.bold);\n}", "title": "" }, { "docid": "29d3d83a8fee5fc425fdeb83ccb5e0d5", "score": "0.51990414", "text": "function restart() {\n\ttl.restart();\n}", "title": "" }, { "docid": "fc1861d1be28e698b315e84f68522275", "score": "0.5190475", "text": "buttonRestartAfterDownload() {\n if (!this.isReadyForRestart) {\n return;\n }\n\n gAppUpdater.selectPanel(\"restarting\");\n\n // Notify all windows that an application quit has been requested.\n let cancelQuit = Cc[\"@mozilla.org/supports-PRBool;1\"].createInstance(\n Ci.nsISupportsPRBool\n );\n Services.obs.notifyObservers(\n cancelQuit,\n \"quit-application-requested\",\n \"restart\"\n );\n\n // Something aborted the quit process.\n if (cancelQuit.data) {\n gAppUpdater.selectPanel(\"apply\");\n return;\n }\n\n // If already in safe mode restart in safe mode (bug 327119)\n if (Services.appinfo.inSafeMode) {\n Services.startup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit);\n return;\n }\n\n Services.startup.quit(\n Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart\n );\n }", "title": "" }, { "docid": "1f21483c3645cf0f9afb6f1e69bf6419", "score": "0.5160862", "text": "requestFactoryResetRestart() {}", "title": "" }, { "docid": "02dd271b456f8347f68a81980c3ce01f", "score": "0.51529175", "text": "function restart() {\n let restart = document.querySelector(\".restart\");\n restart.addEventListener(\"click\", function () {\n //reload the location from the server without cache\n location.reload(true);\n\n });\n}", "title": "" }, { "docid": "6943677869006f9648909444e83d3207", "score": "0.5127461", "text": "restart() {\n\t\tthis.state = 'restarting';\n\t\tthis.close();\n\t}", "title": "" }, { "docid": "9659b58ebc331848021d3a3eccdd0a87", "score": "0.5101826", "text": "async restart() {\n await this.start();\n }", "title": "" }, { "docid": "f543200976b5409a6c94c50bb4acdbe3", "score": "0.5096825", "text": "restart() {\n this.restarting = true\n }", "title": "" }, { "docid": "02814d1d317308db92ec98595c65b271", "score": "0.5086949", "text": "onRestartOnFailure_() {\n this.userActed('requestRestartOnFailure');\n }", "title": "" }, { "docid": "4da248fa4e423911b2fdb9260208e910", "score": "0.5076727", "text": "function reboot()\n{\n const child = exec(\"cd ~ ; cd Desktop/Viper-Bot ; git pull origin master \", function (error, stdout, stderr) {\n if (error !== null) {\n console.log('exec error: ' + error);\n }\n });\n}", "title": "" }, { "docid": "fb7936dcf989499091369e821b8c32ff", "score": "0.5076641", "text": "reNewPassword () {\n\n fetch(this.renewPasswordLink + this.sessionId, \n {\n headers: { \n 'Content-Type': 'application/json; charset=utf-8' \n }\n })\n .then(res => res.json())\n .then(response => {\n this.changePassword( response.new_password );\n })\n .catch(err => {\n // TODO: add alert for error\n });\n\n }", "title": "" }, { "docid": "c5887afaba7eaf1dd9530e01a16124e2", "score": "0.5058955", "text": "async restart(app) {\n\t\treturn this._executeOperation(app, async (handler, registration) => {\n\t\t\treturn await this._conditionallyExecuteHealthCheck(registration, await handler.restart(registration));\n\t\t});\n\t}", "title": "" }, { "docid": "2cfa6763fd0d3f3581180c8b91700952", "score": "0.50507504", "text": "async restart (...args) {\n const parser = new CommandLineParser(packageJson)\n const clargs = {}\n parser\n .help('h', 'help', help.restart)\n .flag('v', 'verbose', () => { clargs.verbose = true })\n .parse(...args)\n if (this.hueClient.isHue) {\n const response = await this.hueClient.put('/config', { reboot: true })\n if (!response.success.reboot) {\n return false\n }\n } else if (this.hueClient.isDeconz) {\n const response = await this.hueClient.post('/config/restartapp')\n if (!response.success.restartapp) {\n return false\n }\n } else {\n await this.fatal('restart: only supported for Hue bridge or deCONZ gateway')\n }\n clargs.verbose && this.log('restarting ...\\\\c')\n return new Promise((resolve, reject) => {\n let busy = false\n const interval = setInterval(async () => {\n try {\n if (!busy) {\n busy = true\n const bridgeid = await this.hueClient.get('/config/bridgeid')\n if (bridgeid === this.bridgeid) {\n clearInterval(interval)\n clargs.verbose && this.logc(' done')\n return resolve(true)\n }\n busy = false\n }\n } catch (error) {\n busy = false\n }\n clargs.verbose && this.logc('.\\\\c')\n }, 2500)\n })\n }", "title": "" }, { "docid": "2d07ffd44d602c8521af84ab4fda887f", "score": "0.5015066", "text": "function restart() {\n var restartBtn = document.createElement(\"button\");\n restartBtn.type = (\"button\");\n restartBtn.innerHTML = \"Restart\";\n restartBtn.addEventListener(\"click\", function() {\n location.reload();\n });\n document.getElementById(\"restart\").appendChild(restartBtn);\n}", "title": "" }, { "docid": "ea42cb9411e5dd54c7735bd5e8b01974", "score": "0.49902168", "text": "function revert() {\n\tconsole.log(\"REVERT!\");\n\t$.ajax({\n\t\t\turl: \"nodecron\",\n\t\t\tdata: {action: \"revert\"},\n\t\t\ttype: \"get\",\n\t\t\tsuccess: function(data, status, jqXHR){\n\t\t\t\tif (jqXHR[\"status\"] != \"200\") {\n\t\t\t\t\twindow.alert(\"Something bad happened in 'revert'!\");\n\t\t\t\t\t}\n\t\t\t\tlocation.reload(true);\t// needed, to refresh the page\n\t\t\t\t}\n\t\t\t}\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "fd4943832cb0ceeecf777e1aec9128dd", "score": "0.49867585", "text": "onRestartOnLowStorage_() {\n this.userActed('requestRestartOnLowStorage');\n }", "title": "" }, { "docid": "d70c43949cf6f33886f34b4cbb20dc8b", "score": "0.4954688", "text": "async finishRestart() {\n\t\tawait this.start(this.details);\n\t}", "title": "" }, { "docid": "cbf68ca1909a92e8d550b357803eecaf", "score": "0.49393845", "text": "function relaunch() {\n return function () {\n slate.log('Relaunch opreration requested by user. Relaunch slate.');\n let op = slate.operation('relaunch');\n op.run();\n };\n}", "title": "" }, { "docid": "9438b3710e7bb3e175443e628df8da95", "score": "0.49358368", "text": "_onRestartClicked() {\n\t\tif (!this._btnRestart.disabled) {\n\t\t\tthis._btnRestart.dispatchEvent(this._restartClicked);\n\t\t}\n\t}", "title": "" }, { "docid": "63dbb94a1c8c4447e9d41a8462b2539e", "score": "0.49267927", "text": "function restart(){\n\tinquirer\n .prompt([\n {\n name: \"restart\",\n type: \"confirm\",\n message: \"Would you like continue purchasing items?\",\n },\n ]).then(function(res) {\n \tif(res.restart) viewProducts();\n \telse {\n \t\tconsole.log(\"\\n\\nThanks for using BAMAZON!\\n\\n\"); \n \t\tconnection.end();\n \t}\n\t});\n}", "title": "" }, { "docid": "9308a42e3db8703fad93683c3e252e39", "score": "0.49169558", "text": "function managerRestart() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"restart\",\n message: \"Would you like to perform another function? (y/n)\"\n }\n ]).then(function(response) {\n if (response.restart === \"y\") {\n managerActions();\n } else {\n console.log(\n \"Goodbye!\",\n \"\\n************************************************************\"\n );\n connection.end();\n }\n })\n}", "title": "" }, { "docid": "38600b2098c894beb8167f82c0572f10", "score": "0.48649246", "text": "function restart() {\n location.reload();\n }", "title": "" }, { "docid": "882a088189a92e217d196a0a58a60236", "score": "0.48561412", "text": "async _apiHalt(req, res) {\n await this._daemon.halt();\n this._stopper_callbacks.forEach(cb => {cb();});\n res.json({ success: true });\n }", "title": "" }, { "docid": "2340f0e4db9689cd24c965da9e87386f", "score": "0.48534757", "text": "function restart(x) {\n setTimeout('window.location.reload()', x);\n}", "title": "" }, { "docid": "c3381346fe65811053af94f17af7199f", "score": "0.48424447", "text": "function restartGame() {\n if (canGoNext) { // Only available if during a round\n socket.emit(\"restartGame\", restartGame); \n }\n}", "title": "" }, { "docid": "aa6880527ce645b2a3bd480d723e3892", "score": "0.48344463", "text": "restartGattService() {\n logit('Clearing all notifications...');\n this.gattService.clearAllNotifications(allCharacteristics);\n logit('Unregistering Gatt Service...');\n this.gattService.unRegisterGattService();\n logit('Reregistering Gatt Service...');\n this.gattService.registerGattService();\n }", "title": "" }, { "docid": "78ff69a15a42ed99da13363a982d87a2", "score": "0.48334464", "text": "function restartAwal(client){\n setting.restartState = false\n isRestart = false\n client.sendText(setting.restartId, 'Restart Succesfull!')\n setting.restartId = 'undefined'\n fs.writeFileSync('./settings/setting.json', JSON.stringify(setting, null,2));\n fs.writeFileSync('./settings/limit.json', JSON.stringify(limit, null,2));\n fs.writeFileSync('./settings/muted.json', JSON.stringify(muted, null,2));\n\n}", "title": "" }, { "docid": "128d19f689e89977a6e29fdf298f81ea", "score": "0.48049244", "text": "function restart() {\n force.start();\n t = 1;\n }", "title": "" }, { "docid": "a81df374e116da9552324f0f1e3fe8e8", "score": "0.47960812", "text": "function restartModule() {}", "title": "" }, { "docid": "d1de0ba2a285f3af556b32314b362586", "score": "0.47949204", "text": "function handleRestartButton() {\n $('div').on('click', '.js-restart-button', function(event) {\n event.preventDefault();\n location.reload();\n });\n}", "title": "" }, { "docid": "48f1379cf9c43285ecb4fc37a8d4bf05", "score": "0.47835737", "text": "function restart() {\n location.reload();\n}", "title": "" }, { "docid": "48f1379cf9c43285ecb4fc37a8d4bf05", "score": "0.47835737", "text": "function restart() {\n location.reload();\n}", "title": "" }, { "docid": "0765ac13f07ec5f731cac302f72dc395", "score": "0.4782828", "text": "function restartAgent() {\n $(\".page\").css(\"display\", \"none\");\n $(\".active\").removeClass(\"active\");\n $(\"#main\").append('<i class=\"fa fa-spinner fa-pulse fa-3x fa-fw center loading_spinner\"></i>');\n\n $(\"#agent_status\").html(\"Not connected<br> to Agent\");\n $(\"#agent_status\").css({\n \"background\": 'linear-gradient(to bottom, #c62d1f 5%, #f24437 100%)',\n \"background-color\": '#c62d1f',\n \"border\": '1px solid #d02718',\n \"text-shadow\": '0px 1px 0px #810e05',\n 'left': '-180px'\n });\n\n // Disable the restart button to prevent multiple consecutive clicks\n $(\"#restart_button\").css(\"pointer-events\", \"none\");\n\n sendMessage(\"agent/restart\", \"\", \"post\",\n function(data, status, xhr){\n // Wait a few seconds to give the server a chance to restart\n setTimeout(function(){\n $(\".loading_spinner\").remove();\n $(\"#restart_button\").css(\"pointer-events\", \"auto\");\n\n if (data != \"Success\") {\n $(\"#general_status\").css(\"display\", \"block\");\n $('#general_status').html(\"<span class='center'>Error restarting agent: \" + DOMPurify.sanitize(data) + \"</span>\");\n } else loadStatus(\"general\");\n }, 10000);\n }, function() {\n $(\".loading_spinner\").remove();\n $(\"#general_status\").css(\"display\", \"block\");\n $('#general_status').html(\"<span class='center'>An error occurred.</span>\");\n $(\"#restart_button\").css(\"pointer-events\", \"auto\");\n });\n}", "title": "" }, { "docid": "56f40603055094facbec6a8a152c1255", "score": "0.47758642", "text": "applicationBooted() {\n this.sendBooted();\n }", "title": "" }, { "docid": "58af2930f38c3309f869200f30d553c9", "score": "0.47713858", "text": "function prebootClient() {\n // used to cache map from server node key to associated client node\n var clientNodeCache = {};\n /**\n * External code call this to kick off the switch from server to client\n */\n function complete(opts) {\n opts = opts || {};\n var theWindow = (opts.window || window);\n var prebootData = theWindow.prebootData || {};\n var apps = prebootData.apps || [];\n // loop through each of the preboot apps\n apps.forEach(function (appData) { return completeApp(opts, appData); });\n // once all events have been replayed and buffers switched, then we cleanup preboot\n if (!opts.noCleanup) {\n cleanup(theWindow, prebootData);\n }\n }\n /**\n * Complete a particular app\n * @param opts\n * @param appData\n */\n function completeApp(opts, appData) {\n opts = opts || {};\n appData = (appData || {});\n var theWindow = (opts.window || window);\n var root = (appData.root || {});\n var events = appData.events || [];\n // if a specific app root set and it doesn't equal the server selector, then don't do anything\n if (opts.appRoot && opts.appRoot !== root.serverSelector) {\n return;\n }\n // some client side frameworks (like Angular 1 w UI Router) will replace\n // elements, so we need to re-get client root just to be safe\n root.clientNode = theWindow.document.querySelector(root.clientSelector);\n // replay all the events from the server view onto the client view\n events.forEach(function (event) { return replayEvent(appData, event); });\n // if we are buffering, switch the buffers\n switchBuffer(theWindow, appData);\n }\n /**\n * Replay a particular event. The trick here is finding the appropriate client\n * node where the event is to be dispatched that matches up with the server node\n * where the event came from originally.\n */\n function replayEvent(appData, prebootEvent) {\n appData = (appData || {});\n prebootEvent = (prebootEvent || {});\n var event = prebootEvent.event;\n var serverNode = prebootEvent.node || {};\n var nodeKey = prebootEvent.nodeKey;\n var clientNode = findClientNode({\n root: appData.root,\n node: serverNode,\n nodeKey: nodeKey\n });\n // if client node can't be found, log a warning\n if (!clientNode) {\n console.warn('Trying to dispatch event ' + event.type +\n ' to node ' + nodeKey + ' but could not find client node. ' +\n 'Server node is: ');\n console.log(serverNode);\n return;\n }\n // now dispatch events and whatnot to the client node\n clientNode.checked = serverNode.checked ? true : undefined;\n clientNode.selected = serverNode.selected ? true : undefined;\n clientNode.value = serverNode.value;\n clientNode.dispatchEvent(event);\n }\n /**\n * Hide the server buffer and show the client buffer\n */\n function switchBuffer(window, appData) {\n appData = (appData || {});\n var root = (appData.root || {});\n var serverView = root.serverNode;\n var clientView = root.clientNode;\n // if no client view or the server view is the body or client\n // and server view are the same, then don't do anything and return\n if (!clientView || !serverView || serverView === clientView || serverView.nodeName === 'BODY') {\n return;\n }\n // do a try-catch for case where serverView is an object but NOT of type Element\n try {\n // get the server view display mode\n var display = window\n .getComputedStyle(serverView)\n .getPropertyValue('display') || 'block';\n // first remove the server view\n serverView.remove ?\n serverView.remove() :\n serverView.style.display = 'none';\n // now add the client view\n clientView.style.display = display;\n }\n catch (ex) {\n console.error(ex);\n }\n }\n /**\n * This function does three things to cleanup preboot:\n * 1. Set focus (and selection if a text box/text area) within a form element\n * 2. Remove existing event listeners\n * 3. Delete data from memory\n */\n function cleanup(window, prebootData) {\n prebootData = prebootData || {};\n var listeners = prebootData.listeners || [];\n // set focus on the active node AFTER a small delay to ensure buffer switched\n setTimeout(function () {\n setFocus(prebootData.activeNode);\n }, 1);\n // remove all event listeners\n for (var _i = 0, listeners_1 = listeners; _i < listeners_1.length; _i++) {\n var listener = listeners_1[_i];\n listener.node.removeEventListener(listener.eventName, listener.handler);\n }\n // remove the freeze overlay if it exists\n removeOverlay(window);\n // finally clear out the data stored for each app\n prebootData.apps = [];\n clientNodeCache = {};\n }\n /**\n * Remove the overlay if it exists\n */\n function removeOverlay(window) {\n var prebootOverlay = window.document.body.querySelector('#prebootOverlay');\n if (prebootOverlay) {\n prebootOverlay.style.display = 'none';\n }\n }\n /**\n * Set focus on a given active node element\n */\n function setFocus(activeNode) {\n // only do something if there is an active node\n if (!activeNode || !activeNode.node || !activeNode.nodeKey) {\n return;\n }\n // find the client node in the new client view\n var clientNode = findClientNode(activeNode);\n if (clientNode) {\n // set focus on the client node\n clientNode.focus();\n // set selection if a modern browser (i.e. IE9+, etc.)\n var selection = activeNode.selection;\n if (clientNode.setSelectionRange && selection) {\n clientNode.setSelectionRange(selection.start, selection.end, selection.direction);\n }\n }\n }\n /**\n * Given a node from the server rendered view, find the equivalent\n * node in the client rendered view. We do this by the following approach:\n * 1. take the name of the server node tag (ex. div or h1 or input)\n * 2. add either id (ex. div#myid) or class names (ex. div.class1.class2)\n * 3. use that value as a selector to get all the matching client nodes\n * 4. loop through all client nodes found and for each generate a key value\n * 5. compare the client key to the server key; once there is a match, we have our client node\n *\n * NOTE: this only works when the client view is almost exactly the same as the server\n * view. we will need an improvement here in the future to account for situations\n * where the client view is different in structure from the server view\n */\n function findClientNode(serverNodeContext) {\n serverNodeContext = (serverNodeContext || {});\n var serverNode = serverNodeContext.node;\n var root = serverNodeContext.root;\n // if no server or client root, don't do anything\n if (!root || !root.serverNode || !root.clientNode) {\n return null;\n }\n // we use the string of the node to compare to the client node & as key in cache\n var serverNodeKey = serverNodeContext.nodeKey || getNodeKey(serverNodeContext);\n // if client node already in cache, return it\n if (clientNodeCache[serverNodeKey]) {\n return clientNodeCache[serverNodeKey];\n }\n // get the selector for client nodes\n var className = (serverNode.className || '').replace('ng-binding', '').trim();\n var selector = serverNode.tagName;\n if (serverNode.id) {\n selector += '#' + serverNode.id;\n }\n else if (className) {\n selector += '.' + className.replace(/ /g, '.');\n }\n // select all possible client nodes and look through them to try and find a match\n var rootClientNode = root.clientNode;\n var clientNodes = rootClientNode.querySelectorAll(selector) || [];\n // if nothing found, then just try the tag name as a final option\n if (!clientNodes.length) {\n clientNodes = rootClientNode.querySelectorAll(serverNode.tagName) || [];\n }\n for (var _i = 0, clientNodes_1 = clientNodes; _i < clientNodes_1.length; _i++) {\n var clientNode = clientNodes_1[_i];\n // get the key for the client node\n var clientNodeKey = getNodeKey({ root: root, node: clientNode });\n // if the client node key is exact match for the server node key, then we found the client node\n if (clientNodeKey === serverNodeKey) {\n clientNodeCache[serverNodeKey] = clientNode;\n return clientNode;\n }\n }\n // if we get here and there is one clientNode, use it as a fallback\n if (clientNodes.length === 1) {\n clientNodeCache[serverNodeKey] = clientNodes[0];\n return clientNodes[0];\n }\n // if we get here it means we couldn't find the client node so give the user a warning\n console.warn('No matching client node found for ' + serverNodeKey +\n '. You can fix this by assigning this element a unique id attribute.');\n return null;\n }\n /**\n * Attempt to generate key from node position in the DOM\n *\n * NOTE: this function is duplicated in preboot_inline.ts and must be\n * kept in sync. It is duplicated for right now since we are trying\n * to keep all inline code separated and distinct (i.e. without imports)\n */\n function getNodeKey(nodeContext) {\n var ancestors = [];\n var root = nodeContext.root;\n var node = nodeContext.node;\n var temp = node;\n // walk up the tree from the target node up to the root\n while (temp && temp !== root.serverNode && temp !== root.clientNode) {\n ancestors.push(temp);\n temp = temp.parentNode;\n }\n // note: if temp doesn't exist here it means root node wasn't found\n if (temp) {\n ancestors.push(temp);\n }\n // now go backwards starting from the root, appending the appName to unique identify the node later..\n var name = node.nodeName || 'unknown';\n var key = name + '_' + root.serverSelector;\n var len = ancestors.length;\n for (var i = (len - 1); i >= 0; i--) {\n temp = ancestors[i];\n if (temp.childNodes && i > 0) {\n for (var j = 0; j < temp.childNodes.length; j++) {\n if (temp.childNodes[j] === ancestors[i - 1]) {\n key += '_s' + (j + 1);\n break;\n }\n }\n }\n }\n return key;\n }\n return {\n complete: complete,\n completeApp: completeApp,\n replayEvent: replayEvent,\n switchBuffer: switchBuffer,\n removeOverlay: removeOverlay,\n cleanup: cleanup,\n setFocus: setFocus,\n findClientNode: findClientNode,\n getNodeKey: getNodeKey\n };\n}", "title": "" }, { "docid": "58af2930f38c3309f869200f30d553c9", "score": "0.47713858", "text": "function prebootClient() {\n // used to cache map from server node key to associated client node\n var clientNodeCache = {};\n /**\n * External code call this to kick off the switch from server to client\n */\n function complete(opts) {\n opts = opts || {};\n var theWindow = (opts.window || window);\n var prebootData = theWindow.prebootData || {};\n var apps = prebootData.apps || [];\n // loop through each of the preboot apps\n apps.forEach(function (appData) { return completeApp(opts, appData); });\n // once all events have been replayed and buffers switched, then we cleanup preboot\n if (!opts.noCleanup) {\n cleanup(theWindow, prebootData);\n }\n }\n /**\n * Complete a particular app\n * @param opts\n * @param appData\n */\n function completeApp(opts, appData) {\n opts = opts || {};\n appData = (appData || {});\n var theWindow = (opts.window || window);\n var root = (appData.root || {});\n var events = appData.events || [];\n // if a specific app root set and it doesn't equal the server selector, then don't do anything\n if (opts.appRoot && opts.appRoot !== root.serverSelector) {\n return;\n }\n // some client side frameworks (like Angular 1 w UI Router) will replace\n // elements, so we need to re-get client root just to be safe\n root.clientNode = theWindow.document.querySelector(root.clientSelector);\n // replay all the events from the server view onto the client view\n events.forEach(function (event) { return replayEvent(appData, event); });\n // if we are buffering, switch the buffers\n switchBuffer(theWindow, appData);\n }\n /**\n * Replay a particular event. The trick here is finding the appropriate client\n * node where the event is to be dispatched that matches up with the server node\n * where the event came from originally.\n */\n function replayEvent(appData, prebootEvent) {\n appData = (appData || {});\n prebootEvent = (prebootEvent || {});\n var event = prebootEvent.event;\n var serverNode = prebootEvent.node || {};\n var nodeKey = prebootEvent.nodeKey;\n var clientNode = findClientNode({\n root: appData.root,\n node: serverNode,\n nodeKey: nodeKey\n });\n // if client node can't be found, log a warning\n if (!clientNode) {\n console.warn('Trying to dispatch event ' + event.type +\n ' to node ' + nodeKey + ' but could not find client node. ' +\n 'Server node is: ');\n console.log(serverNode);\n return;\n }\n // now dispatch events and whatnot to the client node\n clientNode.checked = serverNode.checked ? true : undefined;\n clientNode.selected = serverNode.selected ? true : undefined;\n clientNode.value = serverNode.value;\n clientNode.dispatchEvent(event);\n }\n /**\n * Hide the server buffer and show the client buffer\n */\n function switchBuffer(window, appData) {\n appData = (appData || {});\n var root = (appData.root || {});\n var serverView = root.serverNode;\n var clientView = root.clientNode;\n // if no client view or the server view is the body or client\n // and server view are the same, then don't do anything and return\n if (!clientView || !serverView || serverView === clientView || serverView.nodeName === 'BODY') {\n return;\n }\n // do a try-catch for case where serverView is an object but NOT of type Element\n try {\n // get the server view display mode\n var display = window\n .getComputedStyle(serverView)\n .getPropertyValue('display') || 'block';\n // first remove the server view\n serverView.remove ?\n serverView.remove() :\n serverView.style.display = 'none';\n // now add the client view\n clientView.style.display = display;\n }\n catch (ex) {\n console.error(ex);\n }\n }\n /**\n * This function does three things to cleanup preboot:\n * 1. Set focus (and selection if a text box/text area) within a form element\n * 2. Remove existing event listeners\n * 3. Delete data from memory\n */\n function cleanup(window, prebootData) {\n prebootData = prebootData || {};\n var listeners = prebootData.listeners || [];\n // set focus on the active node AFTER a small delay to ensure buffer switched\n setTimeout(function () {\n setFocus(prebootData.activeNode);\n }, 1);\n // remove all event listeners\n for (var _i = 0, listeners_1 = listeners; _i < listeners_1.length; _i++) {\n var listener = listeners_1[_i];\n listener.node.removeEventListener(listener.eventName, listener.handler);\n }\n // remove the freeze overlay if it exists\n removeOverlay(window);\n // finally clear out the data stored for each app\n prebootData.apps = [];\n clientNodeCache = {};\n }\n /**\n * Remove the overlay if it exists\n */\n function removeOverlay(window) {\n var prebootOverlay = window.document.body.querySelector('#prebootOverlay');\n if (prebootOverlay) {\n prebootOverlay.style.display = 'none';\n }\n }\n /**\n * Set focus on a given active node element\n */\n function setFocus(activeNode) {\n // only do something if there is an active node\n if (!activeNode || !activeNode.node || !activeNode.nodeKey) {\n return;\n }\n // find the client node in the new client view\n var clientNode = findClientNode(activeNode);\n if (clientNode) {\n // set focus on the client node\n clientNode.focus();\n // set selection if a modern browser (i.e. IE9+, etc.)\n var selection = activeNode.selection;\n if (clientNode.setSelectionRange && selection) {\n clientNode.setSelectionRange(selection.start, selection.end, selection.direction);\n }\n }\n }\n /**\n * Given a node from the server rendered view, find the equivalent\n * node in the client rendered view. We do this by the following approach:\n * 1. take the name of the server node tag (ex. div or h1 or input)\n * 2. add either id (ex. div#myid) or class names (ex. div.class1.class2)\n * 3. use that value as a selector to get all the matching client nodes\n * 4. loop through all client nodes found and for each generate a key value\n * 5. compare the client key to the server key; once there is a match, we have our client node\n *\n * NOTE: this only works when the client view is almost exactly the same as the server\n * view. we will need an improvement here in the future to account for situations\n * where the client view is different in structure from the server view\n */\n function findClientNode(serverNodeContext) {\n serverNodeContext = (serverNodeContext || {});\n var serverNode = serverNodeContext.node;\n var root = serverNodeContext.root;\n // if no server or client root, don't do anything\n if (!root || !root.serverNode || !root.clientNode) {\n return null;\n }\n // we use the string of the node to compare to the client node & as key in cache\n var serverNodeKey = serverNodeContext.nodeKey || getNodeKey(serverNodeContext);\n // if client node already in cache, return it\n if (clientNodeCache[serverNodeKey]) {\n return clientNodeCache[serverNodeKey];\n }\n // get the selector for client nodes\n var className = (serverNode.className || '').replace('ng-binding', '').trim();\n var selector = serverNode.tagName;\n if (serverNode.id) {\n selector += '#' + serverNode.id;\n }\n else if (className) {\n selector += '.' + className.replace(/ /g, '.');\n }\n // select all possible client nodes and look through them to try and find a match\n var rootClientNode = root.clientNode;\n var clientNodes = rootClientNode.querySelectorAll(selector) || [];\n // if nothing found, then just try the tag name as a final option\n if (!clientNodes.length) {\n clientNodes = rootClientNode.querySelectorAll(serverNode.tagName) || [];\n }\n for (var _i = 0, clientNodes_1 = clientNodes; _i < clientNodes_1.length; _i++) {\n var clientNode = clientNodes_1[_i];\n // get the key for the client node\n var clientNodeKey = getNodeKey({ root: root, node: clientNode });\n // if the client node key is exact match for the server node key, then we found the client node\n if (clientNodeKey === serverNodeKey) {\n clientNodeCache[serverNodeKey] = clientNode;\n return clientNode;\n }\n }\n // if we get here and there is one clientNode, use it as a fallback\n if (clientNodes.length === 1) {\n clientNodeCache[serverNodeKey] = clientNodes[0];\n return clientNodes[0];\n }\n // if we get here it means we couldn't find the client node so give the user a warning\n console.warn('No matching client node found for ' + serverNodeKey +\n '. You can fix this by assigning this element a unique id attribute.');\n return null;\n }\n /**\n * Attempt to generate key from node position in the DOM\n *\n * NOTE: this function is duplicated in preboot_inline.ts and must be\n * kept in sync. It is duplicated for right now since we are trying\n * to keep all inline code separated and distinct (i.e. without imports)\n */\n function getNodeKey(nodeContext) {\n var ancestors = [];\n var root = nodeContext.root;\n var node = nodeContext.node;\n var temp = node;\n // walk up the tree from the target node up to the root\n while (temp && temp !== root.serverNode && temp !== root.clientNode) {\n ancestors.push(temp);\n temp = temp.parentNode;\n }\n // note: if temp doesn't exist here it means root node wasn't found\n if (temp) {\n ancestors.push(temp);\n }\n // now go backwards starting from the root, appending the appName to unique identify the node later..\n var name = node.nodeName || 'unknown';\n var key = name + '_' + root.serverSelector;\n var len = ancestors.length;\n for (var i = (len - 1); i >= 0; i--) {\n temp = ancestors[i];\n if (temp.childNodes && i > 0) {\n for (var j = 0; j < temp.childNodes.length; j++) {\n if (temp.childNodes[j] === ancestors[i - 1]) {\n key += '_s' + (j + 1);\n break;\n }\n }\n }\n }\n return key;\n }\n return {\n complete: complete,\n completeApp: completeApp,\n replayEvent: replayEvent,\n switchBuffer: switchBuffer,\n removeOverlay: removeOverlay,\n cleanup: cleanup,\n setFocus: setFocus,\n findClientNode: findClientNode,\n getNodeKey: getNodeKey\n };\n}", "title": "" }, { "docid": "3ea4b08eacb276a5942c5f9473a377f1", "score": "0.47704288", "text": "function handleRestartButton() {\n STORE.restart = true; // User is restarting\n $('.js-quiz-restart-button').prop('disabled', true); // Disable restart button\n renderDefaultPage();\n STORE.restart = false;\n}", "title": "" }, { "docid": "a5d5208b724c1d973ed1644c878d545e", "score": "0.4769561", "text": "sendReset() {\n this.sendMessage('reset');\n }", "title": "" }, { "docid": "8e2d363e5f2c3e4b86cdf7368ac48d03", "score": "0.4753693", "text": "function receivePlayerRestart() {\n\tsocket.on('player restart', function(_) {\n\t console.log('player restart');\n\t restore();\n\t});\n }", "title": "" }, { "docid": "5afe63bb3f6c4a5ab15464a78d1ac930", "score": "0.47490597", "text": "restartGame() {\n game.state.start('boot');\n }", "title": "" }, { "docid": "ddf9aaefea65ddb59e5f7c13cfb18e4f", "score": "0.4748672", "text": "function restartProcessForGps() {\n child = exec('sh ' + __dirname + '/appRestart.sh',\n function (error, stdout, stderr) {\n console.log('agreegator app restart after 10 sec, stdout: ' + stdout);\n console.log('agreegator app restart after 10 sec, stderr: ' + stderr);\n if (error !== null) {\n console.log('agreegator app restart after 10 sec, error: ' + error);\n }\n }\n )\n}", "title": "" }, { "docid": "3936574bfe8bcae4e7ddc4b17788fe4f", "score": "0.4734903", "text": "componentDidMount() {\n this._fetchRestartKioskTimeout()\n }", "title": "" }, { "docid": "da3bbe3c82da55d88a08f5bacdb08880", "score": "0.47314408", "text": "restart(){\n window.location.reload()\n }", "title": "" }, { "docid": "57be39b451c2f7e21e583b2adc613529", "score": "0.47292295", "text": "function restart(argv, cb) {\n var args = argv._;\n if (args.length === 0) {\n return cb(restart.usage);\n }\n\n var appId = fhc.appId(args[0]);\n var deployTarget = ini.getEnvironment(argv);\n return restartApp(appId, deployTarget, cb);\n}", "title": "" }, { "docid": "f82205dd2859d5fb50d9142a3587fe68", "score": "0.47239313", "text": "static get name () {\n return 'restart'\n }", "title": "" }, { "docid": "f123fec2974bec0e1b8df0dd849590b5", "score": "0.4709843", "text": "requestReset() {\n if (this.$fastController.isConnected &&\n this.pendingReset === false) {\n this.setInitialState();\n DOM.queueUpdate(() => this.reset());\n this.pendingReset = true;\n }\n }", "title": "" }, { "docid": "e265a5d0b1114334b64cd41a58b7a349", "score": "0.47094068", "text": "function doMultiDeviceRestart(tableID, pkid, affectedDevices)\n{ \n if (affectedDevices > 0)\n {\n var path = getBaseURL();\n var url = path + \"/resetMultiple.do?tableid=\" + tableID + \"&pkid=\" + pkid + \"&affectedDevices=\" + affectedDevices + \"&supportedResetType=\" + doMultiDeviceRestart.arguments[3];\n var options = \"resizable=yes,height=450,width=650,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,top=200,left=300\";\n \n window.open(url, \"resetWin\", options); \n }\n else\n {\n alert(msgMultiDeviceResetNoDevices);\n }\n}", "title": "" }, { "docid": "f033f37fe36ea03872e3ef73650bc14f", "score": "0.46877554", "text": "function startServer() {\n dbConnector(env.URL_DB)\n .then((success) => {\n app.listen(env.API_PORT, () => {\n console.log(`api running on port ${env.API_PORT}`)\n console.log(`environnement: ${JSON.stringify(env, null, 2)}`)\n })\n fetch(env.API_URL + \":\" + env.API_PORT + \"/api/resetDB\")\n .then(res => res.json()).then(json => console.log(json))\n .catch(err => console.log(\"[serverjs] error reseting DB : \" + err.name + \" message: \" + err.message + \" stack: \" + err.stack)\n )\n })\n .catch((err) => {\n console.log(\"[serverjs] \" + err.name + \" message: \" + err.message + \" stack: \" + err.stack)\n console.log(\"[serverjs] NOT READY YET\")\n setTimeout(startServer, 2000)\n })\n}", "title": "" }, { "docid": "041ca6ff5d9e9413865262f5c9ffc24b", "score": "0.46773723", "text": "function sendStandBy(){\n \n if(standbymode !== true){\n Pebble.sendAppMessage({ \"0\": 'sending standby!' });\n standbymode = true;\n } else{\n Pebble.sendAppMessage({ \"0\": 'resuming activity!' });\n standbymode = false;\n }\n var req = new XMLHttpRequest();\n var ipAddress = \"158.130.110.141\"; // Hard coded IP address\n var port = \"3001\"; // Same port specified as argument to server\n var url = \"http://\" + ipAddress + \":\" + port + \"/\";\n // var method = \"GET\";\n var sendStuff = \"POST\";\n var async = true;\n var standby = 'STANDBY';\n \n req.open(sendStuff, url, async);\n console.log(standby);\n req.send(standby);\n \n \n \n}", "title": "" }, { "docid": "e30d2f424a209d55acf70337c9f179a0", "score": "0.46726358", "text": "async restart() {\n await Promise.all(this.end());\n this.startAll();\n }", "title": "" }, { "docid": "2b1fc06ddcbeb4316ea26b1fde81d448", "score": "0.46539384", "text": "function turnOff() {\n var request = require('request');\n\n var headers = {\n 'Content-Type': 'application/json'\n };\n\n var dataString = '[0]';\n\n var options = {\n url: 'http://blynk-cloud.com/5a13704de48e4400b0a62214e8e7b354/update/D4',\n method: 'POST',\n headers: headers,\n body: dataString\n };\n\n function callback(error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body);\n }\n }\n\n request(options, callback);\n}", "title": "" }, { "docid": "011677a4952671de1dfd9ed77da101cf", "score": "0.4652644", "text": "function reboot_edit_capabilities() {\n remove_edit_capabilities();\n add_edit_capabilities();\n }", "title": "" }, { "docid": "86f1f42bd25c6f3b729350a6ce05b3b9", "score": "0.46526027", "text": "function sendResetPassword(req, res) {\n findForUpdatePassword(req).exec((err, user) => {\n if (err) {\n res.status(500);\n return res.json({\n error: err\n });\n }\n res.status(200);\n res.send({\n username: user.username,\n message: 'password updated',\n });\n \n }); \n}", "title": "" }, { "docid": "ea98ea03ea23b75813529a38efbbdb36", "score": "0.46523687", "text": "function restartPrompt() {\n inquirer.prompt([\n {\n name: \"restart\",\n type: \"list\",\n message: \"Would you like to complete another action?\",\n choices: [\"Yes\", \"No\"]\n }\n ]).then(function (answer) {\n if (answer.restart === \"Yes\") {\n startManager();\n } else {\n connection.end();\n };\n });\n}", "title": "" }, { "docid": "81a8df9a3cae9d29cfbbf8f62070b203", "score": "0.46503896", "text": "function restart() {\n location.reload();\n}", "title": "" }, { "docid": "534ad8cc902db989b29f230ba16ab59c", "score": "0.46448803", "text": "function CmdRestartMap(delayString) {\n\t// Make sure we aren't restarting twice in the same frame.\n\tif (COM.frameTime === sv_serverid.get()) {\n\t\treturn;\n\t}\n\n\t// Make sure server is running.\n\tif (!Running()) {\n\t\tlog('Server is not running.');\n\t\treturn;\n\t}\n\n\tif (sv.restartTime) {\n\t\treturn;\n\t}\n\n\t// Check for changes in latched variables that would\n\t// require a full restart.\n\tif (sv_maxClients.modified()) {\n\t\tlog('Restart map is doing a hard restart - sv_maxClients changed.');\n\n\t\t// Restart the map the slow way.\n\t\tSpawn(sv_mapname.get());\n\t\treturn;\n\t}\n\n\t// Toggle the server bit so clients can detect that a\n\t// map_restart has happened.\n\tsvs.snapFlagServerBit ^= QS.SNAPFLAG_SERVERCOUNT;\n\n\t// Generate a new serverid.\n\t// TTimo - don't update restartedserverId there, otherwise we won't deal correctly with multiple map_restart.\n\tsv.serverId = COM.frameTime;\n\tsv_serverid.set(sv.serverId);\n\n\t// If a map_restart occurs while a client is changing maps, we need\n\t// to give them the correct time so that when they finish loading\n\t// they don't violate the backwards time check in cl_cgame.c\n\tfor (var i = 0; i < sv_maxClients.get(); i++) {\n\t\tif (svs.clients[i].state === CS.PRIMED) {\n\t\t\tsvs.clients[i].oldServerTime = sv.restartTime;\n\t\t}\n\t}\n\n\t// Note that we do NOT set sv.state = SS_LOADING, so configstrings that\n\t// had been changed from their default values will generate broadcast updates.\n\tsv.state = SS.LOADING;\n\tsv.restarting = true;\n\n\tShutdownGame();\n\tInitGame();\n\n\t// Run a few frames to allow everything to settle.\n\tfor (var i = 0; i < 3; i++) {\n\t\tGM.Frame(sv.time);\n\t\tsv.time += 100;\n\t\tsvs.time += 100;\n\t}\n\n\tsv.state = SS.GAME;\n\tsv.restarting = false;\n\n\t// Connect and begin all the clients.\n\tfor (var i = 0; i < sv_maxClients.get(); i++) {\n\t\tvar client = svs.clients[i];\n\n\t\t// Send the new gamestate to all connected clients.\n\t\tif (client.state < CS.CONNECTED) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Add the map_restart command.\n\t\tAddServerCommand(client, 'map_restart');\n\n\t\t// Connect the client again, without the firstTime flag.\n\t\tvar denied = GM.ClientConnect(i, false);\n\t\tif (denied) {\n\t\t\t// This generally shouldn't happen, because the client\n\t\t\t// was connected before the level change\n\t\t\tDropClient(client, denied);\n\t\t\tlog('MapRestart: dropped client', i, '- denied!');\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (client.state === CS.ACTIVE) {\n\t\t\tClientEnterWorld(client, client.lastUserCmd);\n\t\t} else {\n\t\t\t// If we don't reset client.lastUserCmd and are restarting during map load,\n\t\t\t// the client will hang because we'll use the last Usercmd from the previous map,\n\t\t\t// which is wrong obviously.\n\t\t\tClientEnterWorld(client, null);\n\t\t}\n\t}\n\n\t// Run another frame to allow things to look at all the players.\n\tGM.Frame(sv.time);\n\tsv.time += 100;\n\tsvs.time += 100;\n}", "title": "" }, { "docid": "55f97a5ec03d61e3de84662827c2428c", "score": "0.46321896", "text": "function onResetClick(){\n console.log(\"Reset button pressed\");\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange == onGetPcState;\n xhttp.open(\"POST\", \"reset\", true);\n xhttp.send();\n}", "title": "" }, { "docid": "2e09e2d44344aea2131e45569bc14771", "score": "0.4625879", "text": "async shutdown () {\n await restoreTouchEnrollShortcuts();\n const {state} = await this.stat();\n if (state === 'Shutdown') {\n return;\n }\n await simctlShutdown(this.udid);\n }", "title": "" }, { "docid": "1490e9e27fdc66cc92acd89ff6f3e700", "score": "0.46210164", "text": "shutdown() {\r\n return this._sendRequest('shutdown');\r\n }", "title": "" }, { "docid": "7450dff4662178a5237d08a6098e16a8", "score": "0.46073374", "text": "sendResetPassword (request, reply) {\n const User = this.app.orm.User;\n const appResetUrl = request.payload.app_reset_url;\n const that = this;\n\n if (!this.app.services.HelperService.isAuthorizedUrl(appResetUrl)) {\n this.log.warn('Invalid app_reset_url', { security: true, fail: true, request: request});\n return reply(Boom.badRequest('app_reset_url is invalid'));\n }\n User\n .findOne({email: request.payload.email.toLowerCase()})\n .then(record => {\n if (!record) {\n return that._errorHandler(Boom.badRequest('Email could not be found'), request, reply);\n }\n return that.app.services.EmailService.sendResetPassword(record, appResetUrl);\n })\n .then(info => {\n return reply('Password reset email sent successfully').code(202);\n })\n .catch(err => {\n that._errorHandler(err, request, reply);\n });\n }", "title": "" }, { "docid": "4489aaa5c4df68babf9183516f0d0bd6", "score": "0.46036726", "text": "function sendResetPasswordRequest() {\n if (validateInputFieldOfResetArea()) {\n /* To show the progress bar */\n showProgressBar();\n\n $('#new_pwd').removeClass(\"error_red_border\");\n $('#re_new_pwd').removeClass(\"error_red_border\");\n /* Used for Disable the button and coming from utility.js */\n disableButton(\"reset_pwd\");\n \n var request = {};\n request.userId = user_auth_obj.userId;\n request.applicationId = applicationId;\n request.locale = getCookie(\"locale\");\n request.newPassword = $('#re_new_pwd').val();\n \n var call_user_reset_pwd = new user_reset_pwd(request);\n call_user_reset_pwd.call();\n }\n}", "title": "" }, { "docid": "adb47aed74ac3cea0f14cd52ffabb52c", "score": "0.45994735", "text": "function restart() { \r\n location.reload();\r\n}", "title": "" }, { "docid": "5b2dfc2efa7ce357d3511d5c00889b77", "score": "0.45934132", "text": "function restart() {\n document.location.reload();\n}", "title": "" }, { "docid": "ed5bd143e954017b304d4a4f7a7adf75", "score": "0.4589318", "text": "function _cv_restart_app() {\n _cv_get_app_path(function (pth) {\n window.location.href = pth + '/www/index.html';\n });\n}", "title": "" }, { "docid": "403930f35e2098cdbcacb7ec2b3c5c79", "score": "0.45879152", "text": "_fetchRestartKioskTimeout() {\n this.restart_kiosk_timeout = setInterval(() => {\n this.props.fetchRestartKiosk(this.props.url)\n }, 1 * 60 * 1000)\n }", "title": "" }, { "docid": "0189e662b82def367db11c391fb597f0", "score": "0.4575117", "text": "restart(){\n window.location.reload(false);\n }", "title": "" }, { "docid": "a31c04857cfcb13f488340b54ffda997", "score": "0.45616168", "text": "function restart() {\r\n document.getElementById('restartButton').style.display = \"none\";\r\n document.getElementById('guessField').removeAttribute('disabled');\r\n start();\r\n\r\n}", "title": "" } ]
5a47910a3190ef9280ddfbc535496a1e
for homework use only
[ { "docid": "71192c75d57daa54f90049270952c851", "score": "0.0", "text": "function saveScore(spoiler, choreo, level, score) {\n let hardness = ''\n if (level === 0) hardness = 'easy'\n else if (level === 1) hardness = 'intermediate'\n else if (level === 2) hardness = 'hard'\n else hardness = 'hell'\n $.ajax({\n url: '../../dbman/saveScore.php',\n data: {\n gamename: 'dancing2017',\n playername: 'c:' + choreo + ' vs s:' + spoiler + ' (' + hardness + ')',\n score: score\n },\n dataType: 'json',\n type: 'GET',\n success: function(response) {\n console.log('Save score success', response);\n },\n error: function(xhr, ajaxOptions, thrownError) {\n console.log('Save score error', xhr, ajaxOptions, thrownError);\n }\n })\n}", "title": "" } ]
[ { "docid": "26eaada8ff7fdca6ecdeac3f6e43330b", "score": "0.61836857", "text": "function calcStichprobenumfang() {\r\n\r\n\t}", "title": "" }, { "docid": "a6a80024f2dbe0a66445acf28504bc21", "score": "0.55760795", "text": "function solution(input, markers) {\n \n}", "title": "" }, { "docid": "87afe3f67b13320be63e49c783cbd6b0", "score": "0.5575256", "text": "function forLooopEX2(){\n\n}", "title": "" }, { "docid": "9f1610cc8eb4774b5bc463f206305d7c", "score": "0.5557038", "text": "function berechneSchaltjahr() {\n \n}", "title": "" }, { "docid": "21737b4ca2b27924a54c7f45b7ece51f", "score": "0.5541984", "text": "function CND_EXTHIDDEN()\r\n\t{\r\n\t}", "title": "" }, { "docid": "a56260f611a041dddb48d30fe97d2289", "score": "0.5496783", "text": "function solution(){\n\n}", "title": "" }, { "docid": "abb71e8a9e990038a72f0e2267074ddc", "score": "0.5473884", "text": "function fehlersuche3() {\n \n}", "title": "" }, { "docid": "a8da3a494b4e64a48ea4b6c527214764", "score": "0.5461482", "text": "function _0x4d320b(_0x118194,_0x4d5573){0x0;}", "title": "" }, { "docid": "9ad11a73ed68bd2560fd997f1ee02b82", "score": "0.5389963", "text": "function Look(){}", "title": "" }, { "docid": "31a11436df6e0f60c6211cdb6944581d", "score": "0.5368521", "text": "function fehlersuche2() {\n \n}", "title": "" }, { "docid": "8177766787ad4ec3cb8156bc40da1ee1", "score": "0.5307157", "text": "function e1827621() { return 'atch '; }", "title": "" }, { "docid": "05b3774b27804a9930b85172ee5afb74", "score": "0.52951", "text": "function e199740() { return 'inso'; }", "title": "" }, { "docid": "04d208924c93b08dc8d4da806e0439ef", "score": "0.5288632", "text": "function haceralgo(){\n\n}", "title": "" }, { "docid": "54bd9c9c7570eafcd3a083c90aa1d4d4", "score": "0.5250351", "text": "function pavadinimas (){ // pavadinimose galima naudoti tik _ arba \n // visas mazasias raides ir kiekviena sudurtini \n} // zodi rasyti Didziaja raide ", "title": "" }, { "docid": "138ac31f133a51c05097c8dd9d550828", "score": "0.52343947", "text": "function beginer(){for(i=0;i<100;i++){askv[i]=askv1[i]=asks[i]=0;}; max=linecount[0]; \n beg=isub=comdex=minbeg=minzv=0;maxzv=12*max;cbeg=9999999;cmid=0; }", "title": "" }, { "docid": "79a6cfb710e67270842978c8f492dc52", "score": "0.5228851", "text": "function e$7(){return [1,0,0,1,0,0]}", "title": "" }, { "docid": "df9393c6a6fdd0ac474c681b7eed250d", "score": "0.5218914", "text": "function ha(){}", "title": "" }, { "docid": "de410ddf3aea6add8ce878c4a81cb3cd", "score": "0.51666576", "text": "function paperwork(n, m) {\n if (n > 0 && m > 0)\n {\n return n*m;\n }\n return 0;\n \n \n \n }", "title": "" }, { "docid": "13df25260e4440a35d55566645faf853", "score": "0.5158612", "text": "function mifuncion(){}", "title": "" }, { "docid": "8266ae6e688522ceea8e035b9dcde477", "score": "0.51410794", "text": "function saveThePrisoner(n, m, s){\n // Complete this function\n /*\n if (m > n) { \n if (m%n == 0 && s == 1)\n return n;\n if ((s+m%n-1) > n) {\n if ((s+m%n-n) == 1)\n return 1;\n return s+m%n-n-1;\n } else {\n if ((s+m%n) == 1)\n return 1;\n return s+m%n-1;\n }\n } else if (m == n) {\n if (m%n == 0 && s == 1)\n return n;\n if (s > 1)\n return s-1;\n else\n return n;\n } else {\n if ((m+s-1) > n)\n return m+s-n-1;\n else\n return m+s-1;\n }\n */\n return (m+s-2)%n+1;\n}", "title": "" }, { "docid": "d02a724adefd465e7b29345196f024ca", "score": "0.51384777", "text": "function saveThePrisoner(n, m, s){\n\tpsion = m + s\n\tdbl = n * 2\n\t//var final int64 := psion\n //console.log(\"\")\n\tif (psion > dbl) {\n\t\t//pset.sweets\n //console.log(\"true\")\n\t\tif (psion % n == psion) {\n\t\t\t//\t\t\tfmt.Println(\"1\")\n\t\t\treturn psion -1 \n\t\t}\n\t\tif (((psion -1 ) % n) == 0) {\n\t\t\t//\t\t\tfmt.Println(\"2\")\n\t\t\treturn n\n\t\t}\n\t\t//if (psion % pset.total) < 0 {\n\t\t//\t\t\tfmt.Println(\"3\")\n\t\t//\treturn psion, nil\n\t\t//}\n\n\t\t//\t}\n\t\t//\tfmt.Println(\"4\")\n\t\t//fmt.Println(psion)\n\t\treturn ((psion - 1) % n)\n\t} else if (psion > n) {\n\n\t\tpsion = -1*(n - psion) - 1\n\t\t\n // console.log(psion + \" - \" + n)\n if (psion -1 == n) {\n\t\t\treturn 1\n\t\t}\n\t\tif (psion == 0) {\n\t\t\treturn n\n\t\t}\n\n\t\tif (psion > n) {\n\t\t\treturn psion - n\n\t\t}\n\t\treturn psion\n\t} else {\n\t\treturn psion - 1 \n\t}\n}", "title": "" }, { "docid": "80b563b6fc82796b556929a95b78ec1d", "score": "0.51285595", "text": "function hb(){}", "title": "" }, { "docid": "f13eadc667ced68f16c26e80adf7122b", "score": "0.5128186", "text": "function hn(a,b){this.sB=[];this.D8a=a;this.gWa=b||null;this.h$=this.WXa=!1;this.qj=void 0;this.yJa=this.AKb=this.$wa=!1;this.Eqa=0;this.Pg=null;this.xha=0}", "title": "" }, { "docid": "39397012e9dd04a9eadb71907dce284c", "score": "0.51215994", "text": "function o2412() {\n try {\nif (this.o1102 < 0) try {\nreturn -1;\n}catch(e){}\n else try {\nif (this.o227 <= 0 || (this.o227 == 1 && this[0] <= 0)) try {\nreturn 0;\n}catch(e){}\n else try {\nreturn 1;\n}catch(e){}\n}catch(e){}\n}catch(e){}\n }", "title": "" }, { "docid": "4efd18f5341afbb5e3c6d1b65ed5066b", "score": "0.5119344", "text": "function afb(){this.j=0;this.o=[];this.k=[];this.N=this.L=this.g=this.J=this.Y=this.C=0;this.W=[]}", "title": "" }, { "docid": "bdd6680bc8cbb106af96666d656e0584", "score": "0.5104084", "text": "function e$3(){return [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}", "title": "" }, { "docid": "d021b9ac62191a5b113aba0280691ed8", "score": "0.50854784", "text": "function fnal()\r\n {\r\n let fmark = exam(75)+crsmark(40)\r\n console.log(fmark)\r\n \r\n }", "title": "" }, { "docid": "2417bcba2976a4a97b57bb8da9e996de", "score": "0.5081061", "text": "function e$18(){return [1,0,0,1,0,0]}", "title": "" }, { "docid": "a1d49809a8ae11acefb086d727943aea", "score": "0.50567234", "text": "function r(f,p,v,m){var P={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return p?P[v][0]:P[v][1]}", "title": "" }, { "docid": "1ec49343fbe1c219caf028b5b9353f3b", "score": "0.50557756", "text": "function fDa(){this.g=0;this.p=[];this.o=[];this.N=this.W=this.b=this.J=this.fa=this.z=0;this.xa=[]}", "title": "" }, { "docid": "53828e7f0abda3fe695b2de2c4bc1238", "score": "0.5054898", "text": "function e(){return [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}", "title": "" }, { "docid": "3e4146ef892bc99afb9bded42cde3743", "score": "0.5052413", "text": "function currentCrazyPoses(){}", "title": "" }, { "docid": "d349171936a2f237c798c719fea6474d", "score": "0.5048923", "text": "function main() {\n //console.log('#1 - count sheep');\n //countSheep(5);\n\n //console.log('#2 - Array Doubler');\n //let arr = [10,5,3,4];\n //console.log(double_all(arr));\n\n //console.log('#3 - Reverse String');\n //console.log(reverseString(\"tauhida\"));\n\n //console.log('#4 - nth Triangular Number');\n //console.log(triangle(5));\n\n //console.log('#5 - String Splitter');\n //console.log(split('1/21/2018', '/'));\n\n //console.log('#6 - Binary Representation');\n //console.log(convertToBinary(25));\n\n //console.log('#7 - Anagrams');\n //printAnagram(\"east\");\n\n //console.log('#8 - animalHierarchy');\n //console.log(traverse(animalHierarchy, null));\n\n //console.log('#9 - Factorial');\n //console.log(factorial(5)); //120\n\n //console.log('#10 - Fibonacci');\n //console.log(fibonacci(7));\n\n console.log('#11 - Organization Chart');\n console.log(traverseA(organization));\n //console.log(traverseB(organization));\n\n }", "title": "" }, { "docid": "355f49227557ec0fafe11241fd7f528d", "score": "0.50483567", "text": "function proinversionep(proy,com,dom,moneda,div){\n\n\n\t var enerotl=0;var febrerotl=0; var marzotl=0; var abriltl=0; var mayotl=0; var juniotl=0; var juliotl =0; var agostotl=0; var septiembretl=0; var octubretl =0; var noviembretl=0; var diciembretl =0; \n\t\n\n\t\t \t \n\n\tfor (var i=0; i < proy.length ; i++) {\n\n\n\t\tif(proy[i]['iddom']== dom && proy[i]['iddivision']== div && proy[i]['idmoneda']==moneda){\n\n\t\t\t enerotl += parseFloat(proy[i]['enero'+com+'']);\n\t\t febrerotl += parseFloat(proy[i]['febrero'+com+'']); \n\t\t marzotl += parseFloat(proy[i]['marzo'+com+'']); \n\t\t abriltl += parseFloat(proy[i]['abril'+com+'']); \n\t\t mayotl += parseFloat(proy[i]['mayo'+com+'']); \n\t\t juniotl += parseFloat(proy[i]['junio'+com+'']); \n\t\t juliotl += parseFloat(proy[i]['julio'+com+'']); \n\t\t agostotl += parseFloat(proy[i]['agosto'+com+'']); \n\t\t septiembretl += parseFloat(proy[i]['septiembre'+com+'']); \n\t\t octubretl += parseFloat(proy[i]['octubre'+com+'']); \n\t\t noviembretl += parseFloat(proy[i]['noviembre'+com+'']); \n\t\t diciembretl += parseFloat(proy[i]['diciembre'+com+'']); \t\t\n\t\t}//fin if \n\t\n\t}//fin for \n\tvar labor = new Array(enerotl,febrerotl,marzotl,abriltl,mayotl,juniotl,juliotl,agostotl,septiembretl,octubretl,noviembretl,diciembretl);\n\treturn labor;\n\n\n}", "title": "" }, { "docid": "da02cd030e8f308dbf544c71fb0ae1a6", "score": "0.50441563", "text": "function BruteForce() {\n }", "title": "" }, { "docid": "122c08e5710780335917c921e8be3d81", "score": "0.5034926", "text": "function Rn(t,e){0}", "title": "" }, { "docid": "44b74aa6e5da48933afa3c1c61316901", "score": "0.5014403", "text": "function $w(a,b){this.A=[];this.N=a;this.G=b||null;this.o=this.g=!1;this.k=void 0;this.F=this.K=this.C=!1;this.B=0;this.j=null;this.D=0}", "title": "" }, { "docid": "22cc9932ec78e54276f3df14206b729d", "score": "0.5009574", "text": "function t(e,t,a,n){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[a][0]:i[a][1]}", "title": "" }, { "docid": "2b0325238811ec10e1a17f6dd60c5147", "score": "0.5009505", "text": "function identify(){\r\n\r\n}", "title": "" }, { "docid": "323dfe3d22de89ff41e4d79b30b10aa5", "score": "0.50059944", "text": "function maps(name,x,y){\n if(name===\"classic\"){\n return (x<17 && y>10) || (x>5 && y<3)\n }\n else if(name===\"empty\"){\n return (false)\n }\n else if (name===\"eight\"){\n return ((x>15 && y>12 && x<21 && y<18) ||\n (x>15 && y>4 && x<21 && y<10) ||\n (x>23 && y>4 && x<29 && y<10) ||\n (x>23 && y>12 && x<29 && y<18)) ||\n (x>8 && y>4 && x<13 && y<18) ||\n (x>31 && y>4 && x<36 && y<18) ||\n (x>8 && y>=0 && x<36 && y<3) ||\n (x>8 && y>19 && x<36)\n }\n else if (name===\"hulk\"){\n return (\n (!(51>x && x>2 && 3>y && y>0)) &&\n (!(51>x && x>2 && 22>y && y>19)) &&\n (!(53>x && x>50 && 22>y && y>0)) &&\n (!(3>x && x>0 && 22>y && y>0)) &&\n (!(3>x && x>0 && 22>y && y>0))\n )\n }\n else if (name===\"columns\"){\n return (\n (x%2 && y%2)\n )\n }\n}", "title": "" }, { "docid": "1ee38d485f7afd1976ce674fb5de3514", "score": "0.49917626", "text": "function t(e,t,a,o){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[a][0]:i[a][1]}", "title": "" }, { "docid": "cc4efd29a5fa15e862137a896aeb1f88", "score": "0.4989014", "text": "function parim() {\r\n\r\n}", "title": "" }, { "docid": "fba3120ef1a3aed5c52b19f266bce42d", "score": "0.4985805", "text": "function f1(a,b){this.Rh=[];this.Jk=a;this.Zj=b||null;this.Cg=this.uf=!1;this.Ve=void 0;this.jj=this.ll=this.bi=!1;this.Th=0;this.sd=null;this.ci=0}", "title": "" }, { "docid": "8418e10960b42a80fba1acab38691d78", "score": "0.4983896", "text": "function goalfacFunc(){\n return eachgoalKpr;\n }", "title": "" }, { "docid": "c36563fa2dc3b6e2f906f343fd066aee", "score": "0.49792698", "text": "function bestFilmOfYear() {\n\n}", "title": "" }, { "docid": "b6aa8e4465e4e33f12f47190b92b1a7b", "score": "0.4977643", "text": "function promname(){askv[v3]=pv[v1];askv1[v3]=v1;v2-=1; \n if(v2>=0&&v2<256){j=40960+v2*32;s1=ps.substring(j,j+32);}else{s1=\" \";if(v1<120){s1=nvar[v1];}else{\n if(v1>=130000&&v1<730000){j=v1-130000;s1=nvar[120+Math.floor(j/10000)]; j%=10000;s1=s1+\" \"+j.toString();}else{\n if(v1>=65536&&v1<74536){j=v1-65536;s1=nvar[181+Math.floor(j/500)]; j%=500;s1=s1+\" \"+j.toString();}else{\n if(v1>=74752&&v1<99936){L=1;while(v1>=jnadd[L]){L+=1;};L-=1;j=v1-jnadd[L]; s1=nvar[199+L];j%=500;s1=s1+\" \"+j.toString();}else{\n if(v1>=99936&&v1<99996){j=v1-99936;s1=nvar[217+j];}; }; }; }; }; }; s1+=filler;\n askv2[v3]=blanks.substring(0,29-s1.length)+s1; }", "title": "" }, { "docid": "2fcf1c2747e39ea75fa81475ee1a2266", "score": "0.49764603", "text": "function helpfulness (rank) {\n return\n}", "title": "" }, { "docid": "fcadabd496c68ccbebcfbf7053bd40b2", "score": "0.4964598", "text": "function Gr(){}", "title": "" }, { "docid": "6d40a6d770d4a0c8b0ebb3a82702de50", "score": "0.49607036", "text": "function Exps() {}", "title": "" }, { "docid": "4c47b629f4cf38d1f17c87de4473c706", "score": "0.4958914", "text": "function t(e,t,n,a){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" }, { "docid": "4c47b629f4cf38d1f17c87de4473c706", "score": "0.4958914", "text": "function t(e,t,n,a){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" }, { "docid": "4c47b629f4cf38d1f17c87de4473c706", "score": "0.4958914", "text": "function t(e,t,n,a){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" }, { "docid": "4c47b629f4cf38d1f17c87de4473c706", "score": "0.4958914", "text": "function t(e,t,n,a){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" }, { "docid": "fc7df061d55d608e0f341abd5aafaf44", "score": "0.49531955", "text": "function Dr(){}", "title": "" }, { "docid": "6b27bef00d7aa9a6d94452e8383d1e86", "score": "0.4950894", "text": "function fm(){}", "title": "" }, { "docid": "e0fd00b41a7a562166d16840c25ccb4d", "score": "0.49416634", "text": "function fehlersuche1() {\n \n}", "title": "" }, { "docid": "ff2a54fa0b2443a5714fd90caa5bd65c", "score": "0.4939298", "text": "function t(e,t,a,n){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[a][0]:r[a][1]}", "title": "" }, { "docid": "ff2a54fa0b2443a5714fd90caa5bd65c", "score": "0.4939298", "text": "function t(e,t,a,n){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[a][0]:r[a][1]}", "title": "" }, { "docid": "e5f0955d68af2f702abd688eeefcf43c", "score": "0.4939214", "text": "function t(e,t,n,a){var s={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?s[n][0]:s[n][1]}", "title": "" }, { "docid": "d7427687ed0b9244f077cd15e1184c93", "score": "0.49381423", "text": "function wn(){}", "title": "" }, { "docid": "ec1a034c2fe5c3814f10e6a69e8db6aa", "score": "0.49371123", "text": "function oi(e,t,n,i){var a={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?a[n][0]:a[n][1]}", "title": "" }, { "docid": "b92879e64b826cb01fb811b5e7b0584f", "score": "0.49314937", "text": "function specialCasesRecalc(mission) {\r\n\t\r\n}", "title": "" }, { "docid": "ee52bf5ba089dd9b08cb14e4de16228e", "score": "0.49289024", "text": "function mainFunct () {\n\t// generate array of all possible codes - 1296 possibilities of 4 out of 6 possible digits with repetitions allowed\n\tallPossibleCodes = initArray ();\n\t//generate strategic guesses in a cheating minimax manner\n\tstrategicGuesses = createStrategyGuesses (2);\n\t//rest of the code is interaction with user handled by evaluateGuesses()\n\tevaluateGuesses ();\n\t\n\n}", "title": "" }, { "docid": "39dd30ff14c6bcee6cd479f32c5d2046", "score": "0.49268398", "text": "function t(e,t,r,n){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[r][0]:i[r][1]}", "title": "" }, { "docid": "a945eecd90dac88861ea162d9afa9dee", "score": "0.49255118", "text": "function t(e,t,s,a){var n={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?n[s][0]:n[s][1]}", "title": "" }, { "docid": "e7e19ebfbd0732d24ea8e6f108ed2c2d", "score": "0.49202603", "text": "function t(e,t,o,n){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[o][0]:i[o][1]}", "title": "" }, { "docid": "c0d3986a348e4c9e948001d4eb845839", "score": "0.49173093", "text": "function t(e,t,n,o){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" }, { "docid": "125aed49d5da0c10ae000f88f56ba370", "score": "0.4915646", "text": "function oldScrabbleScorer(word) {\n\tword = word.toUpperCase();\n\tlet letterPoints = \"\";\n \n\tfor (let i = 0; i < word.length; i++) {\n \n\t for (const pointValue in oldPointStructure) {\n \n\t\t if (oldPointStructure[pointValue].includes(word[i])) {\n\t\t\tletterPoints += `Points for '${word[i]}': ${pointValue}\\n`\n\t\t }\n \n\t }\n\t}\n\treturn letterPoints;\n }", "title": "" }, { "docid": "5bb037eac23e5ecb191536ef2b2cbc0f", "score": "0.4914654", "text": "function t(e,t,r,n){var a={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?a[r][0]:a[r][1]}", "title": "" }, { "docid": "b4b941b725b875037d2b7a331836fc1b", "score": "0.4914623", "text": "function minimizeZeroes () {\n \n}", "title": "" }, { "docid": "162e79fcd6af303358ecc6e8077cd9ac", "score": "0.49140793", "text": "function e(t,e,a,n){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return e?r[a][0]:r[a][1]}", "title": "" }, { "docid": "9f7d1e639510dbe828b967714c9d50da", "score": "0.49121404", "text": "basicNotation(start,end) {\n let value = this.getSquare(start).value;\n // Notation for pawn moves\n if (value === 'p') {\n if (start[0] === end[0]) {\n return end;\n } else {\n return start[0]+'x'+end;\n }\n } \n // Notation for pieces where ambiguity cannot exist\n if (value === 'Q' || value === 'K' || value === 'B') {\n if (this.getSquare(end).color === '') {\n return value+end;\n } else {\n return value+'x'+end;\n }\n // Notation for all other pieces (where ambiguity could exist)\n } else {\n let note = (this.getSquare(end).color !== '' ? 'x' : '') + end ;\n let pieces = this.getSquaresByVC(value,this.turn);\n if (pieces.length > 1) {\n let other = pieces.map((sq) => sq.id).find((id) => id !== start);\n console.log(other);\n if (this.modelMove(other,end)[0]) {\n if (other[0] === start[0]) {\n return value+start[1]+note;\n } else {\n return value+start[0]+note;\n }\n }\n } \n return value+note;\n }\n }", "title": "" }, { "docid": "440ea85054ad95e7841cf74cc3341e9f", "score": "0.4911689", "text": "function t(e,t,n,a){var o={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?o[n][0]:o[n][1]}", "title": "" }, { "docid": "cb2c66b8814ff59527963ba4e34d9def", "score": "0.49115703", "text": "function makeItWork (num) {\n let halved = halfNumber(num)\n let skware =squareNumber(halved)\n let areas = areaOfCircle(skware)\n let percy = percentOf(skware, areas)\n let finishThem = [ halved, skware, areas, percy]\n return finishThem\n \n \n}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "3928149e9067e67ea763dcee3d239e50", "score": "0.49097085", "text": "function t(e,t,n,a){var r={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?r[n][0]:r[n][1]}", "title": "" }, { "docid": "f9681f02f10bdeb945c9daf649b86634", "score": "0.4907506", "text": "function usesub(vx){for(i=0;i<submax;i++){d=vx+i*12000;g=linecount[i]; \n for(e=0;e<g;e++){ h=1; for(f=d;f<=d+6;f+=3){\n if(zv[f]==pindex){if(finbb<0||zv[f+1]==finbb){subuse[i]+=h;\n zaline[zamany]=Math.floor((d-vx)/12);zamany+=h;h=0; };};\n if(most>3){if(zv[f+2]==pindex){subuse[i]+=h;\n zaline[zamany]=Math.floor((d-vx)/12);zamany+=h;h=0; };}; }; d+=12;}; }; }", "title": "" }, { "docid": "2d560269a0ffb5efca40db42aa205543", "score": "0.4906226", "text": "function e189753() { return 'dick'; }", "title": "" }, { "docid": "fd6f9fc777b0acb93760432ccc36be99", "score": "0.4905923", "text": "function getBlindSolution() {\n}", "title": "" }, { "docid": "06f2f4f8934904e5e327df69f3181e92", "score": "0.489907", "text": "function func() {\n let item1 = male_urban.mul(male_rel).mul(urban_rel);\n let item2 = male_rural.mul(male_rel).mul(rural_rel);\n let item3 = female_urban.mul(female_rel).mul(urban_rel);\n let item4 = female_rural.mul(female_rel).mul(rural_rel);\n let item5 = urban_male.mul(male_rel).mul(urban_rel);\n let item6 = urban_female.mul(female_rel).mul(urban_rel);\n let item7 = rural_male.mul(male_rel).mul(rural_rel);\n let item8 = rural_female.mul(female_rel).mul(rural_rel);\n\n return item1.add(item2).add(item3).add(item4).add(item5).add(item6).add(item7).add(item8);\n }", "title": "" }, { "docid": "bd0b54f0747680869d87b9e9759fc555", "score": "0.48978996", "text": "function t(e,t,n,i){var s={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?s[n][0]:s[n][1]}", "title": "" }, { "docid": "08f00c7a89a45419293ea70b1e9e1f8f", "score": "0.48967052", "text": "function i(t,i,e,n){var s={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return i?s[e][0]:s[e][1]}", "title": "" }, { "docid": "85364cb50ad72894ce7adfcc85fe8268", "score": "0.48934385", "text": "function lk(){}", "title": "" }, { "docid": "04cc58a5cd6a1231dbea749432e84501", "score": "0.48932296", "text": "MeasureMatterCost()\n\t{\n\t\t//return 0; // Hack\n\t\t\n\t\treturn 2000;\n\t}", "title": "" }, { "docid": "3bfed778e9a864024b170f4c3c5a03f2", "score": "0.48913133", "text": "function r(o,l,u,f){var p={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[o+\" sekondamni\",o+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[o+\" mintamni\",o+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[o+\" voramni\",o+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[o+\" disamni\",o+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[o+\" mhoineamni\",o+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[o+\" vorsamni\",o+\" vorsam\"]};return f?p[u][0]:p[u][1]}", "title": "" }, { "docid": "d750b74494d996da2f67980896062442", "score": "0.48896453", "text": "function t(e,t,n,r){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" }, { "docid": "d750b74494d996da2f67980896062442", "score": "0.48896453", "text": "function t(e,t,n,r){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" }, { "docid": "d750b74494d996da2f67980896062442", "score": "0.48896453", "text": "function t(e,t,n,r){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" }, { "docid": "d750b74494d996da2f67980896062442", "score": "0.48896453", "text": "function t(e,t,n,r){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" }, { "docid": "d750b74494d996da2f67980896062442", "score": "0.48896453", "text": "function t(e,t,n,r){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" }, { "docid": "d750b74494d996da2f67980896062442", "score": "0.48896453", "text": "function t(e,t,n,r){var i={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return t?i[n][0]:i[n][1]}", "title": "" } ]
b275410f5657ac9fea6576ff4a5098bc
function to move info label with mouse
[ { "docid": "71f4afb3c7af83adfb16a28407066558", "score": "0.7854874", "text": "function moveLabel(){\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n\n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 75,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 25;\n\n //horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; \n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1; \n\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n }", "title": "" } ]
[ { "docid": "d44ec654590bc8569818759bf45fa571", "score": "0.82119554", "text": "function moveTruliaLabel() {\n \n\tvar x = d3.event.clientX; \n\tvar y = d3.event.clientY - 10; \n\n\t//at center coordinates of div, switch side of mouse on which infolabel appears\n\tvar switchIt = 0;\n\tif (x < 770){\n\t\tswitchIt = 40;\n\t}else{\n\t\tswitchIt = -245;\n\t}\n\t\n\tvar mug = d3.select(\".infolabel\") \n\t\t.style(\"left\", (x+switchIt) +\"px\")\n\t\t.style(\"top\", y + \"px\");\n}", "title": "" }, { "docid": "0b27585c7a8dcc37ea9862fa17877366", "score": "0.7913907", "text": "function moveLabel() {\n //get width of label\n var labelWidth = d3.select(\".infolabel\").node().getBoundingClientRect().width;\n\n //use coordinates of mousemove event to set label coordinates\n var x1 = event.clientX + 10,\n y1 = event.clientY - 75,\n x2 = event.clientX - labelWidth - 10,\n y2 = event.clientY + 25;\n\n //horizontal label coordinate, testing for overflow\n var x = event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1;\n //vertical label coordinate, testing for overflow\n var y = event.clientY < 75 ? y2 : y1;\n //slectes the infomation label element\n d3.select(\".infolabel\")\n //passes the coordinates of the mouse to the style \n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n}", "title": "" }, { "docid": "0a1b07ca374522f5c72e2dd6111e174d", "score": "0.77665496", "text": "function moveLabel(){\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n\n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY + 50,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 50;\n\n //horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1;\n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1;\n\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n }", "title": "" }, { "docid": "d22fd941b61b898021764d7398f7c58c", "score": "0.77211803", "text": "function moveLabel() {\n\t\n\tconsole.log(\"in moveLabel() \");\n\t\n\t//* Get Width of label\n\tvar labelWidth = d3.select(\".infolabel\")\n\t\t.node()\n\t\t.getBoundingClientRect()\n\t\t.width;\n\t\n\t//* User coordinates of mousemove to set label coordinates\n\t//* d3.event.clientX/Y = position of mouse\n\tvar x1 = d3.event.clientX + 10,\n\t\ty1 = d3.event.clientY - 75,\n\t\tx2 = d3.event.clientX - labelWidth - 10,\n\t\ty2 = d3.event.clientY + 25;\n\t\n\t//* Horizontal label coordinates\n\t//* Test for overflow\n\tvar x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1;\n\t\n\t//* Vertical label coordinate\n\t//* Test for overflow\n\tvar y = d3.event.clientY < 75 ? y2 : y1;\n\t\n\t\n\t\n\t\n\td3.select(\".infolabel\")\n\t\t.style(\"left\", x + \"px\")\n\t\t.style(\"top\", y + \"px\");\n\t\n}", "title": "" }, { "docid": "c4ae1f9936ec7d32757b1e5db5372f59", "score": "0.76910406", "text": "function moveLabel() {\n //Determine width of label\n var labelWidth = d3.select('.infolabel')\n //Use node() to get the first element in this selection\n .node()\n //Return an object containing the sie of the label\n .getBoundingClientRect()\n //Examine width to determine how much to shift the mouse over\n .width;\n\n //Use coordinates of mousemove event to set label coordinates with offsets from wherever event is\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 75,\n x2 = d3.event.clientX - labelWidth - 10,\n //Used to switch vertical sides\n y2 = d3.event.clientY + 25;\n //Test for overflow horizontally (If the event x coordinate is greater than the width of the window and label buffer)\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1;\n //Test for overflow vertically (Is the Y coordinate less than the distance between mouse and upper-left label)\n var y = d3.event.clientY < 75 ? y2 : y1;\n //Select the infolabel currently mousing over\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n}", "title": "" }, { "docid": "d33aac3b9dabe2798003a29001c68cd9", "score": "0.7685669", "text": "function moveLabel(){\n // get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n\n // use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 75,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 25;\n\n // Horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1;\n // vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1;\n\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n}", "title": "" }, { "docid": "340ec4969e1670dffffb551b085b4140", "score": "0.7595133", "text": "function moveLabel(){\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n\n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX,\n y1 = d3.event.clientY+300,\n x2 = d3.event.clientX - labelWidth,\n y2 = d3.event.clientY-100;\n\n //horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; \n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1; \n\n d3.select(\".infolabel\")\n .style({\n \"left\": x + \"px\",\n \"top\": y + \"px\"\n });\n}", "title": "" }, { "docid": "e494b0652e266a4025ced64467bb87d8", "score": "0.75839317", "text": "function moveLabel(){\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n\n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 35,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 25;\n\n //horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; \n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1; \n\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n}", "title": "" }, { "docid": "74cff1334a00f1ef8f4f4a4ed0859ef0", "score": "0.75791246", "text": "function moveLabel(){\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n \n \n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 75,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 25;\n \n //horizontel label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1;\n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1;\n \n \n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n}", "title": "" }, { "docid": "0ea846e94255f1b40b9393c28a944b4e", "score": "0.7575705", "text": "function moveLabel(){\n\n //get width of label\n var labelWidth = d3.select(\".infolabel\")\n .node()\n .getBoundingClientRect()\n .width;\n\n //use coordinates of mousemove event to set label coordinates\n var x1 = d3.event.clientX + 10,\n y1 = d3.event.clientY - 75,\n x2 = d3.event.clientX - labelWidth - 10,\n y2 = d3.event.clientY + 25;\n\n //horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; \n //vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2 : y1; \n\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n}", "title": "" }, { "docid": "c87445d22e8fb59d7b658d9c1627531f", "score": "0.75117135", "text": "function moveLabel(props){\n\n\t //if the selected area is null, do not selct\n\t //console.log(d3.select(\".infolabel\").node());\n\t if (d3.select(\".infolabel\").node()==null){\n\t \treturn false;\n\t };\n\n\t //this usses selector to get the width of the labels\n\t var labelWidth = d3.select(\".infolabel\")\n\t .node()\n\t .getBoundingClientRect()\n\t .width;\n\n\t //use coordinates of mousemove event to set label coordinates\n\t var x1 = d3.event.clientX + 10,\n\t y1 = d3.event.clientY - 75,\n\t x2 = d3.event.clientX - labelWidth - 10,\n\t y2 = d3.event.clientY + 25;\n\n\t //horizontal label coordinate, testing for overflow\n\t var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; \n\n\t //vertical label coordinate, testing for overflow\n\t var y = d3.event.clientY < 500 ? y2 : y1; \n\n\t //select the inforlabel class and stylize them by adding pixels to posit\n\t d3.select(\".infolabel\")\n\t .style(\"left\", x + \"px\")\n\t .style(\"top\", y + \"px\");\n\t}", "title": "" }, { "docid": "c652b441b1872deafb79b8ab8f705c97", "score": "0.74915266", "text": "function moveLabel(){\n // get width of label\n // select the label\n var labelWidth = d3.select(\".infolabel\")\n // get its DOM node\n .node()\n // return an object the size of the label\n .getBoundingClientRect()\n // access its width\n .width;\n\n // retrieve coordinates of the mousemove event\n // adjust to set label above and to the right of the mouse\n var x1 = d3.event.clientX + 5, // was 10\n y1 = d3.event.clientY - 48; // was 75\n // set backup x coordinate (to shift to left when label approaches right side of page)\n x2 = d3.event.clientX - labelWidth - 5,\n // set backup y coordinate (to shift down when label approached top of page)\n y2 = d3.event.clientY + 48;\n\n // horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2: x1;\n\n // vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2: y1;\n\n // use adjusted coordinates to set label coordinates\n d3.select(\".infolabel\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n }", "title": "" }, { "docid": "a78d343d200438c50ff501bfa1543fcf", "score": "0.736527", "text": "function moveLabelPC(){\n // get width of label\n // select the label\n var labelWidth = d3.select(\".infolabelPC\")\n // get its DOM node\n .node()\n // return an object the size of the label\n .getBoundingClientRect()\n // access its width\n .width;\n\n // retrieve coordinates of the mousemove event\n // adjust to set label above and to the right of the mouse\n var x1 = d3.event.clientX + 3, // was 10\n y1 = d3.event.clientY - 18; // was 75\n // set backup x coordinate (to shift to left when label approaches right side of page)\n x2 = d3.event.clientX - labelWidth - 3,\n // set backup y coordinate (to shift down when label approached top of page)\n y2 = d3.event.clientY + 18;\n\n // horizontal label coordinate, testing for overflow\n var x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2: x1;\n\n // vertical label coordinate, testing for overflow\n var y = d3.event.clientY < 75 ? y2: y1;\n\n // use adjusted coordinates to set label coordinates\n d3.select(\".infolabelPC\")\n .style(\"left\", x + \"px\")\n .style(\"top\", y + \"px\");\n }", "title": "" }, { "docid": "9bf8822dcbf90fd21f63484aa6cc7a3a", "score": "0.7003107", "text": "function moveLabel(){\n\t//caputre label width\n\tvar labelWidth = d3.select(\".label\")\n\t.node() //isolate label node in DOM (so cool...)\n\t.getBoundingClientRect() //get outline\n\t.width\n\t;\n\n\t//use mouse coordinates to set label coordinates\n\tvar x1 = d3.event.clientX + 10,\n\t\ty1 = d3.event.clientY - 75; //closer to top of page than actual country\n\t\tx2 = d3.event.clientX - labelWidth-10; //too close to right? Flip label to left\n\t\ty2 = d3.event.clientY + 25; //...and up a bit\n\n\t//assign coordinates of label based on client mouse location\n\tvar x = d3.event.clientX > window.innerWidth - labelWidth - 20 ? x2 : x1; //conditional if mouse is within labelWidth +20 px\n\tvar y = d3.event.clientY < 75 + 20 ? y2 : y1; //conditional if mouse is within your adjusted y value above (label goes DOWN from mouse point)\n\n\td3.select(\".label\")\n\t\t.style(\"left\", x + \"px\") //label position is absolute, so margin wouldn't work- left and top refer to view window\n\t\t.style(\"top\", y + \"px\")\n\t\t;\n}", "title": "" }, { "docid": "174cce179f1b519128ff053e52c76e8c", "score": "0.6895218", "text": "function updateMousePosition() {\n // If tracking is enabled, update the labels\n if (isMouseTracking) {\n // We can get the mouse positions with\n // event.clientX and event.clientY.\n // We can update the text of an HTML element with the\n // innerText property.\n var positionX = document.getElementById(\"mousePositionX\");\n positionX.innerText = event.clientX;\n var positionY = document.getElementById(\"mousePositionY\");\n positionY.innerText = event.clientY;\n }\n}", "title": "" }, { "docid": "eec159d3ab45d2de2888f7e6329a2314", "score": "0.68643373", "text": "function setInfoBox(_event) {\n // Cursorwert der auf das span-Element übergeben wird, damit es immer aktuell ist.\n let x = _event.pageX + 10;\n let y = _event.pageY + 10;\n // <HTMLElement> kann auch Null sein, aber wenn wir wissen, dass es vorhanden ist - passt es!\n let mouseCursorSpan = document.querySelector(\"span\");\n // Positionierung des Span-Elements\n mouseCursorSpan.style.left = x + \"px\";\n mouseCursorSpan.style.top = y + \"px\";\n }", "title": "" }, { "docid": "bc61b0214b08c777bbf6c4e461be05b0", "score": "0.68156165", "text": "function infolabelHover(ev) {\n\n let drawnShapes = canArr[0].drawnShapes\n\n for (let i = 0; i < drawnShapes.length; i++) {\n let cx = drawnShapes[i].ctx;\n if (drawnShapes[i].type === \"rectangle\") {\n cx.beginPath();\n if (!drawnShapes[i].rotate) {\n cx.rect(drawnShapes[i].x, drawnShapes[i].y, drawnShapes[i].width, drawnShapes[i].depth);\n } else {\n cx.rect(drawnShapes[i].x, drawnShapes[i].y, drawnShapes[i].depth, drawnShapes[i].width);\n };\n cx.closePath()\n } else if (drawnShapes[i].type === \"circle\") {\n cx.beginPath();\n cx.moveTo(drawnShapes[i].x, drawnShapes[i].y);\n cx.arc(drawnShapes[i].x, drawnShapes[i].y, drawnShapes[i].radius, drawnShapes[i].sAngle, drawnShapes[i].eAngle, drawnShapes[i].clock);\n cx.closePath()\n }\n\n let bb = ev.target.getBoundingClientRect(); // canvas size and pos\n // mouse to canvas coordinates\n let x = (ev.clientX - bb.left) * (ev.target.width / bb.width);\n let y = (ev.clientY - bb.top) * (ev.target.height / bb.height);\n if (cx.isPointInPath(x, y)) {\n\n let shape = drawnShapes[i]\n if (shape.div) {\n shape.div.classList.add('active')\n }\n document.getElementById('label').querySelector('p').innerHTML = shape.label;\n document.getElementById('label').classList.add('active')\n canArr[0].canvas.style.cursor = 'grab';\n return\n\n } else {\n document.querySelectorAll('.shape.active').forEach(function(div) {\n div.classList.remove(\"active\")\n })\n canArr[0].canvas.style.cursor = 'default';\n document.getElementById('label').querySelector('p').innerHTML = \"\";\n document.getElementById('label').classList.remove('active')\n\n }\n }\n}", "title": "" }, { "docid": "ac83d57195f8daff7ef4bae08195505a", "score": "0.681446", "text": "function updateMousePosition() {\n //if tracking enabled, update labels\n if(isMouseTracking){\n var positionX = document.getElementById(\"mousePositionX\");\n positionX.innerText = event.clientX;\n var positionY = document.getElementById(\"mousePositionY\");\n positionY.innerText = event.clientY;\n }\n}", "title": "" }, { "docid": "043542840d7b9e4667ab199b7e80e264", "score": "0.6805682", "text": "onMouseMove(event) {\n this.update_DivLabel('onMarkupMove');\n this.updateHitTest(event);\n }", "title": "" }, { "docid": "9ac35a0ff84f4cf9d5dede4768fc401d", "score": "0.6783626", "text": "function cursorInfoMouseMove() {\n if (CursorInfo.forcedPos) return\n\n CursorInfo.cursorInfoDiv\n .style('left', d3.mouse(this)[0] + 18 + 'px')\n .style('top', d3.mouse(this)[1] + 10 + 'px')\n }", "title": "" }, { "docid": "1db519116a857f3ad209ab4abf447b96", "score": "0.6725459", "text": "function mousemove() {\n // bring the coord \n var x0 = xScale(d3.mouse(this)[0]);\n var i = d3.bisect(x0);\n selectedData = data[i]\n \n //working on the focus texts\n focusText\n // .html(selectedData.price)\n .html(selectedData.price + \"_\" + d3.mouse(this)[1] +\"_\" + x0)\n .attr(\"x\", d3.mouse(this)[0])\n .attr(\"y\", d3.mouse(this)[1]+100)\n .style(\"opacity\",1)\n }", "title": "" }, { "docid": "5c81a4995ce58e9c69e4d4df0d727605", "score": "0.67007405", "text": "function mousemove(){\n\t\tvar ary = d3.mouse(this);\n\t\tpos.attr(\"x\", 10)//ary[0] + 10)\n\t\t\t.attr(\"y\", 10)//ary[1] + 2)\n\t\t\t//.attr(\"x\", 100)\n\t\t\t//.attr(\"y\", 100)\n\t\t\t.text(Math.round(ary[0]) + \", \" + Math.round(ary[1]))\n\t}", "title": "" }, { "docid": "5f1e71fb8bd01c296d71f55794273cf0", "score": "0.65953434", "text": "function mousemove(d){\n tooltip.html(d.properties.name + \"<br/>\" + data[d.properties.name].menciones + \" menciones\")\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 50) + \"px\");\n }", "title": "" }, { "docid": "6971c3fdf6e54a1cb5662afd88e48273", "score": "0.6573803", "text": "function onMouseMove(e) {\r\n //console.log(e.latlng);\r\n var curPos = e.latlng;\r\n var sdiv = $('#lat-lon');\r\n $('p', sdiv).remove();\r\n sdiv.append($('<p class=\"ltln-text\">Lat, Lon: ' + curPos.lat.toFixed(6) + ', ' + curPos.lng.toFixed(6) + '</p>'));\r\n}", "title": "" }, { "docid": "71f8f9ff3162503aa4f29825ae25c163", "score": "0.6521966", "text": "function moveLabels(element, d, geography, side) { \n element.select(\".data-label.selected\" + \".data-label-\" + geography + \"-\" + side + \"-\" + d.abbr)\n .attr(\"y\", function(){ \n return d3.select(\".\" + geography + \"-circle-\" + side + \"-\" + d.abbr ).attr(\"cy\")\n })\n }", "title": "" }, { "docid": "a09766fcf92b127b9d55844fb12a4c51", "score": "0.6513906", "text": "function onmousemovegroupename(kmouse) {\r\n \r\n\t\r\n \r\n\tvar my_tooltip = $(\"#mytooltip\"); \r\n var border_top = $(window).scrollTop(); \r\n\tvar border_right = $(window).width();\r\n\tvar left_pos;\r\n\tvar top_pos;\r\n\tvar offset = 20;\r\n\tif(border_right - (offset *2) >= my_tooltip.width() + kmouse.pageX){\r\n\t\tleft_pos = kmouse.pageX+offset;\r\n\t\t} else{\r\n\t\tleft_pos = border_right-my_tooltip.width()-offset;\r\n\t\t}\r\n\t\t\r\n\tif(border_top + (offset *2)>= kmouse.pageY - my_tooltip.height()){\r\n\t\ttop_pos = border_top +offset;\r\n\t\t} else{\r\n\t\ttop_pos = kmouse.pageY-my_tooltip.height()-offset;\r\n\t\t}\t\r\n\t\t\t\r\n\t\t\t\t\r\n\tmy_tooltip.css({left:left_pos, top:top_pos});\r\n}", "title": "" }, { "docid": "4ff1e2c9476cb0ead7bcc8332860971a", "score": "0.65115047", "text": "function moveTooltip() {\n tooltip.style(\"top\",(d3.event.pageY+tooltipOffset.y)+\"px\")\n .style(\"left\",(d3.event.pageX+tooltipOffset.x)+\"px\");\n}", "title": "" }, { "docid": "e39024c57fbaebae56acfba8f33f67f0", "score": "0.6479349", "text": "function moveLabel() {\n $('.js-star-label').removeClass('js-pos-input js-pos-font js-pos-share');\n if(!$('.js-signature-input').val() || $(document.activeElement).hasClass('js-signature-input')) {\n $('.js-star-label').css('top', 80);\n $('.js-star-label .js-text').html('Type your name');\n }\n else if(!celebFont || typeof addthis === 'undefined') {\n $('.js-star-label').css('top', 223);\n $('.js-star-label .js-text').html('Select your <br />favourite celebrity');\n }\n else if(typeof addthis !== 'undefined') {\n var p = $('.js-addthis-row').position();\n var topPos = p.top - 52;\n $('.js-star-label').css('top', topPos);\n $('.js-star-label .js-text').html('Share your signature');\n }\n }", "title": "" }, { "docid": "078c95ea68902400a4198ae5544df535", "score": "0.6416794", "text": "_onInfo(e) {\n const target = e && e.currentTarget; //the information icon\n const bounds = target.getBoundingClientRect(); //position of the icon\n const top = bounds.top; // top\n const left = bounds.left + 24; //left\n const uid = target.closest('.layer-item').getAttribute('data-layer-uid');\n\n this.tooltip.classList.remove('is-hidden');\n this.tooltip.classList.add('is-visible');\n\n const topTooltip = top - (this.tooltip.getBoundingClientRect().height/2) + 8;\n\n this.tooltip.style.top = `${topTooltip}px`;\n this.tooltip.style.left = `${left}px`;\n this.tooltip.innerHTML = `showing info of ${uid}`;\n }", "title": "" }, { "docid": "d66719e3a37ab5271abcf0761711f743", "score": "0.64153355", "text": "function mousemoveFunc(d) {\n tooltip\n .style(\"top\", (d3.event.pageY - 10) + \"px\" )\n .style(\"left\", (d3.event.pageX + 10) + \"px\");\n }", "title": "" }, { "docid": "fc3542c55c131f9146e9963b60f97164", "score": "0.64076006", "text": "function moveTooltip(d) {\r\n tooltip.html(getTooltipInfo(d))\r\n .style(\"left\", (d3.event.pageX + 20) + \"px\")\r\n .style(\"top\", (d3.event.pageY) + \"px\");\r\n}", "title": "" }, { "docid": "aa5f4bea328ee10988ed81b0f539ca67", "score": "0.6340832", "text": "function mMove(e){\n if(IE){\n listenerIEX = e.clientX;\n listenerIEY = e.clientY;\n }else{\n listenerIEX = e.pageX;\n listenerIEY = e.pageY;\n }\n tooltip.style.display = \"block\";\n seta.style.display = \"block\";\n TweenLite.to(\"#tooltip\", .3, {css:{alpha:1,left:listenerIEX+24, top:listenerIEY - 66 - tooltip.offsetHeight}})\n TweenLite.to(\"#conteinerSeta\", .3, {css:{alpha:1,left:listenerIEX+5, top:listenerIEY - 80}})\n }", "title": "" }, { "docid": "69a7a536c34e4e4d6be2e5c61600a285", "score": "0.6319627", "text": "function borderMousemove(d, i, paths) {\n return tooltip.style(\"top\", (event.pageY-10)+\"px\").style(\"left\",(event.pageX+10)+\"px\");\n}", "title": "" }, { "docid": "095efe3e269b0ddd14b5eec0f13eded6", "score": "0.6246853", "text": "mouseMove(event){\n }", "title": "" }, { "docid": "79ce79b2ed4315caf4a59949d1007b7c", "score": "0.62463707", "text": "function HoverInput(Elmt){\r\r\n $(\"info\").fadeIn(10).text($(Elmt).attr(\"possible\")).animate({left: $(Elmt).offset()[\"left\"]-19,top: $(Elmt).offset()[\"top\"]-48}, 50);\r\r\n}", "title": "" }, { "docid": "03ad09dc783aa6bbf095ffe1858a6385", "score": "0.62388426", "text": "function infoBox() {\n rectMode(CORNER);\n if (tabSelected>-1){\n for (var i = 0; i < Items[tabSelected].mouseIsOverList.length; i++) {\n if (Items[tabSelected].mouseIsOverList[i]){\n fill(255);rect(mouseX + 5, mouseY -5, 150, -100);\n fill(0);rect(mouseX + 7, mouseY -7, 146, -96);\n\n textAlign(LEFT, BOTTOM);\n fill(255).strokeWeight(0).textSize(12);\n text(\"Description: \" + \"\\nEffect: \" + \"\\nCost: \" + Items[tabSelected].list[i].price + \"\\nCost per year: \" +\n Items[tabSelected].list[i].dPrice, mouseX + 20, mouseY - 75);\n }\n }\n }\n}", "title": "" }, { "docid": "a80bba7b24b2ab353319aef0d2975d7b", "score": "0.62346596", "text": "function on_mousemove(event) {\n const point = {x: event.pageX, y: event.pageY};\n\n drag_move(point);\n\n [view.pos.cx, view.pos.cy] = coordinates(point);\n\n update_tooltip(event);\n}", "title": "" }, { "docid": "e8f5b0da085d0ecb011cd82413e67874", "score": "0.61873966", "text": "function mousemovefn(){\n var thecursor = d3.select(\"#thecursor\");\n thecursor.attr(\"transform\", \"translate(\" + d3.mouse(this) + \")\");\n}", "title": "" }, { "docid": "a826317f287469ad73b7ba4f6a4bed3d", "score": "0.6183846", "text": "function displayMouseLocationOnScreen() {\n drawText(mouseX+\",\"+mouseY, mouseX, mouseY, 'yellow');\n}", "title": "" }, { "docid": "ebeb0600e6ba12e54e67fa1764d4171c", "score": "0.61772734", "text": "handleMouseMove(x, y) {\n if(x > this.sizes.personsWidth && !this.indicatorActive) {\n this.activateIndicator();\n }\n else if(x <= this.sizes.personsWidth && this.indicatorActive) {\n this.deactivateIndicator();\n }\n\n if((x <= this.sizes.personsWidth && y < this.sizes.personHeight*this.order.size) && !this.indicatorActive) {\n this.activateTooltip();\n }\n else if((x > this.sizes.personsWidth || y >= this.sizes.personHeight*this.order.size) && this.indicatorActive) {\n this.deactivateTooltip();\n }\n\n if(this.tooltipActive) {\n const id = Array.from(this.order.keys()).find(key => this.order.get(key) === Math.floor(y/this.sizes.personHeight));\n const person = this.persons.find(person => person.id === id);\n\n const tooltip = document.getElementById(\"msv-tooltip\");\n tooltip.innerText = this.main.dataHandler.emailToName(person.email);\n const bounds = tooltip.getBoundingClientRect();\n tooltip.style.left = `0px`;\n tooltip.style.top = `${this.order.get(id) * this.sizes.personHeight + this.sizes.personHeight / 2 - bounds.height / 2}px`;\n tooltip.style.background = this.scale(person.jobtitle);\n\n if(this.main.dataHandler.selectedPersons.has(id)) tooltip.style.fontWeight = \"bold\";\n else tooltip.style.fontWeight = \"normal\";\n\n this.hoveredPerson = person;\n }\n\n // Change mouse indicator position when the indicator is active.\n if(this.indicatorActive) {\n const start = this.main.dataHandler.timeSpan.startTime;\n const end = this.main.dataHandler.timeSpan.endTime;\n const date = this.dateToString(this.approximateDate(start, end, (x-this.sizes.personsWidth)/(this.width-this.sizes.personsWidth)));\n\n document.getElementById(\"massive-sequence-indicator\").style.left = `${x}px`;\n document.getElementById(\"massive-sequence-indicator-line\").style.background = this.styleOptions.indicatorColor;\n document.getElementById(\"massive-sequence-indicator-date\").innerText = date;\n }\n }", "title": "" }, { "docid": "7158448404a74c780f0d0b9de0c4e153", "score": "0.61638457", "text": "function handleMouseOver(d){\n var container = svg.append('g')\n .attr('id', 'info')\n .append('text')\n .attr('x', d3.event.pageX)\n .attr('y', d3.event.pageY)\n .text(parseFloat(d.value).toFixed(2)+ '%')\n .style('font-family', 'monospace')\n .style('font-size', '12px')\n .style('font-weight', 'bold')\n ;\n\n }", "title": "" }, { "docid": "25e162caf58b4bcba6c257d0e15c9c08", "score": "0.61560845", "text": "function infoToolLayerMousedown(event) {\n selectedMarker = event.graphic;\n\n infoToolInitSliders();\n refreshImages();\n getObjectInformation();\n $(\"#accordion\").show();\n }", "title": "" }, { "docid": "6522aeb7d1b87c148dc773024ec6908f", "score": "0.6144469", "text": "function positionLabel(theItemName, pos, labelData, tooltip) {\r\n\r\n // Label explaining the purpose of a TextArea\r\n eval(theItemName + \"Label = new Text();\"); \r\n eval(\"var theItemLabel = \" + theItemName + \"Label\" + \";\"); \r\n\r\n\ttheItemLabel.alignment = \"left\";\r\n\ttheItemLabel.font = \"Arial\";\r\n\ttheItemLabel.size = 11 * sizeAdjust;\r\n\ttheItemLabel.style = \"bold\";\r\n\ttheItemLabel.color = \"#000000\";\r\n\ttheItemLabel.opacity = 255;\r\n\ttheItemLabel.bgColor = \"#FFFFFF\";\r\n\ttheItemLabel.bgOpacity = 0;\r\n\ttheItemLabel.hOffset = lMargin;\r\n\ttheItemLabel.vOffset = tMargin + separatorDistance*pos;\r\n\ttheItemLabel.zOrder = 2;\r\n\ttheItemLabel.tooltip = tooltip;\r\n\ttheItemLabel.data = labelData;\r\n}", "title": "" }, { "docid": "1ac539b2f4950d129357e32e5f2752fe", "score": "0.6141716", "text": "function on_mouseoverLabel() {\n\t\td3.select(this).classed(\"hover\", true);\n\t}", "title": "" }, { "docid": "74c0f6a7ba0319d500de86954db6abf1", "score": "0.61323106", "text": "function moveTip() {\n skinAdjust = new Array();\n dbS = getDBS();\n tip = document.getElementById(\"simpletfb\");\n var showTTAtTop = mousePos.y > (winSize.y / 2);\n var showTTAtLeft = mousePos.x > (winSize.x / 2);\n var newTop = mousePos.y + (showTTAtTop ? - (tip.clientHeight + 20) : 20);\n var newLeft = mousePos.x + (showTTAtLeft ? - (tip.clientWidth + 20) : 20);\n tip.style.position = 'fixed';\n tip.style.top = newTop + \"px\";\n tip.style.left = newLeft + \"px\";\n}", "title": "" }, { "docid": "74c0f6a7ba0319d500de86954db6abf1", "score": "0.61323106", "text": "function moveTip() {\n skinAdjust = new Array();\n dbS = getDBS();\n tip = document.getElementById(\"simpletfb\");\n var showTTAtTop = mousePos.y > (winSize.y / 2);\n var showTTAtLeft = mousePos.x > (winSize.x / 2);\n var newTop = mousePos.y + (showTTAtTop ? - (tip.clientHeight + 20) : 20);\n var newLeft = mousePos.x + (showTTAtLeft ? - (tip.clientWidth + 20) : 20);\n tip.style.position = 'fixed';\n tip.style.top = newTop + \"px\";\n tip.style.left = newLeft + \"px\";\n}", "title": "" }, { "docid": "74c0f6a7ba0319d500de86954db6abf1", "score": "0.61323106", "text": "function moveTip() {\n skinAdjust = new Array();\n dbS = getDBS();\n tip = document.getElementById(\"simpletfb\");\n var showTTAtTop = mousePos.y > (winSize.y / 2);\n var showTTAtLeft = mousePos.x > (winSize.x / 2);\n var newTop = mousePos.y + (showTTAtTop ? - (tip.clientHeight + 20) : 20);\n var newLeft = mousePos.x + (showTTAtLeft ? - (tip.clientWidth + 20) : 20);\n tip.style.position = 'fixed';\n tip.style.top = newTop + \"px\";\n tip.style.left = newLeft + \"px\";\n}", "title": "" }, { "docid": "8f37dd788be3630ee3a1a78b0a736c1e", "score": "0.61251974", "text": "tooltipMove(event, d, isPoint) {\n let vis = this;\n\n d3.select('#chordchart-tooltip')\n .style('left', () => {\n if (event.pageX > 1650 && !isPoint) {\n return event.pageX - vis.tooltipWidth - vis.config.tooltipPadding + 'px';\n }\n return event.pageX + vis.config.tooltipPadding + 'px'\n })\n .style('top', (event.pageY + vis.config.tooltipPadding) + 'px')\n }", "title": "" }, { "docid": "30fc24fe2b5ab9b7d6ea6dd81aba9179", "score": "0.6124468", "text": "function tooltipFollow(e) {\n\t$j(\"#tooltip\").css({\n \ttop: (e.pageY) + \"px\",\n \tleft: (e.pageX + 15) + \"px\",\n });\n}", "title": "" }, { "docid": "3a8fa37f44d064a261c4a85238edac4d", "score": "0.6117483", "text": "onMouseMove([xCoordinate, yCoordinate], event) {}", "title": "" }, { "docid": "3a8fa37f44d064a261c4a85238edac4d", "score": "0.6117483", "text": "onMouseMove([xCoordinate, yCoordinate], event) {}", "title": "" }, { "docid": "2c430e83b3f57be9cf00161810d456d3", "score": "0.6106146", "text": "function updatePosition(event, options) {\n // determine x and y offsets, defaults are 10px\n var offsetX = 10;\n var offsetY = 10;\n if (options && options.offset && (options.offset.x !== undefined) && (options.offset.x !== null)) {\n offsetX = options.offset.x;\n }\n if (options && options.offset && (options.offset.y !== undefined) && (options.offset.y !== null)) {\n offsetY = options.offset.y;\n }\n // TODO: use the correct time type\n d3_selection_1.select('#vis-tooltip')\n .style('top', function () {\n // by default: put tooltip 10px below cursor\n // if tooltip is close to the bottom of the window, put tooltip 10px above cursor\n var tooltipHeight = this.getBoundingClientRect().height;\n if (event.clientY + tooltipHeight + offsetY < window.innerHeight) {\n return '' + (event.clientY + offsetY) + 'px';\n }\n else {\n return '' + (event.clientY - tooltipHeight - offsetY) + 'px';\n }\n })\n .style('left', function () {\n // by default: put tooltip 10px to the right of cursor\n // if tooltip is close to the right edge of the window, put tooltip 10 px to the left of cursor\n var tooltipWidth = this.getBoundingClientRect().width;\n if (event.clientX + tooltipWidth + offsetX < window.innerWidth) {\n return '' + (event.clientX + offsetX) + 'px';\n }\n else {\n return '' + (event.clientX - tooltipWidth - offsetX) + 'px';\n }\n });\n}", "title": "" }, { "docid": "c7a20565ce9ad8841214b88063812539", "score": "0.61003226", "text": "function mouseMove(d) {\n \n var dataString;\n\n if (d.properties[\"year\" + scope.mapYear]) {\n dataString = d.properties[\"year\" + scope.mapYear] + dataType;\n } else {\n dataString = \"No Data\";\n }\n\n div\n .html(d.properties.name + \"<br/>\" + dataString)\n .attr(\"title\", d.properties.name)\n .style(\"left\", (d3.event.pageX + 10) + \"px\")\n .style(\"top\", (d3.event.pageY - 20) + \"px\");\n }", "title": "" }, { "docid": "a8be152ec6c14221debe3f567d311f45", "score": "0.6098023", "text": "function tooltips_mousemove2(x, y, html) {\n var xPosition = x + $(\".leftpart\").width() + 80;\n var yPosition = y + $(\".navbar\").height();\n d3.select(\"#tooltip\")\n .style(\"left\", xPosition + \"px\")\n .style(\"top\", yPosition + \"px\"); \n d3.select(\"#tooltip\")\n .html(html);\n d3.select(\"#tooltip\").classed(\"hidden\", false);\n\n d3.select(\"line.xx\")\n .style(\"opacity\", 1)\n .attr(\"transform\",\n \"translate(\" + x + \",\" +\n 0 + \")\"); \n}", "title": "" }, { "docid": "944883fdf2e90654dcce179cd987f544", "score": "0.6095386", "text": "function showTooltip(x, y, label, position) {\n // if( clicksYet )\n // label += (pointClicked)? ' hello':' bye';\n\n var tooltipTop = 0, toolTipLeft = 0;\n switch(position)\n {\n case 0:\n tooltipTop = y - 20; \n toolTipLeft = x + 5;\n break;\n case 1:\n tooltipTop = y + 15; \n toolTipLeft = x + 0;\n break;\n case 2:\n tooltipTop = y + 10; \n toolTipLeft = x - 25;\n break;\n case 3:\n tooltipTop = y - 25; \n toolTipLeft = x - 30;\n break;\n default:\n tooltipTop = y - 20; \n toolTipLeft = x + 5;\n }\n\n $('<div id=\"tooltip\">' + label + '</div>').css( {\n \"background-color\":\"rgba(46,48,46,0.8)\",\n \"-webkit-border-radius\": \"4px\",\n \"-moz-border-radius\": \"4px\",\n \"border-radius\": \"4px\",\n color: \"#ffffff\",\n \"font-weight\": \"bold\",\n 'font-size': '10px',\n position: 'absolute',\n top: tooltipTop,\n left: toolTipLeft,\n padding: \"2px\",\n\n\n\n // position: 'absolute',\n // display: 'none',\n // 'font-size': '10px',\n // top: tooltipTop,\n // left: toolTipLeft,\n // border: '1px solid #fdd',\n // padding: '2px',\n // 'background-color': '#fee',\n // opacity: 0.80,\n 'z-index': 3\n }).appendTo(\"body\").fadeIn(100);\n}", "title": "" }, { "docid": "62ef9a8c08f260441d8c0c8d485ce0b9", "score": "0.60925996", "text": "function moveText(event) {\n //If text has been selected- handle the mousemove event\n //Calculate where the mouse now is\n mouseX = event.pageX - canvasTextC.offsetLeft\n mouseY = event.pageY - canvasTextC.offsetTop\n\n //Calculate how far the mouse has moved since the last mouseevent\n let dx = mouseX - startX\n let dy = mouseY - startY\n //Set the mouse start values to the last mouse position\n startX = mouseX\n startY = mouseY\n\n //Find the text item being moved in the texts[] array\n let text = texts[selectedText]\n\n //Add the new x and y positions to the array\n text.x += dx\n text.y += dy\n //Redraw the text canvas\n drawText()\n}", "title": "" }, { "docid": "fad80b039147c1a04eac60c628fdb829", "score": "0.60890317", "text": "function mouseRec(e){\n var mousePosCheck = gridLookup(e);\n if(boardState[mousePosCheck.x][mousePosCheck.y] == \"empty\"){\n mousePos.x = mousePosCheck.x;\n mousePos.y = mousePosCheck.y;\n var text = String(mousePos.x) + String(mousePos.y)\n requestAnimationFrame(update)\n }\n else{\n mousePos.x = -1;\n }\n \n}", "title": "" }, { "docid": "90e1eb1ebc25fd670d36e7c54dbb859e", "score": "0.60868376", "text": "mouseMove(delta){\n this.position.setCurrent(delta);\n this.move();\n }", "title": "" }, { "docid": "afa681bdb3266bb17c2b1e2dca3b7bf4", "score": "0.6084186", "text": "function handleMouseOver(d, i) { // Add interactivity\n\n d3.select(\"#map-radial-c\").select(\"svg#radial-tree-c\").select(\"g#g-radial-c\").append(\"text\")\n .attr({\n id: \"t\" + \"-\" + i\n })\n .text(function () {\n return (d.name); // Value of the text\n })\n .style(\"stroke\", \"white\");\n }", "title": "" }, { "docid": "97ab997d0c42b47e0d056eac48f5082d", "score": "0.6078199", "text": "function tooltipMove (d){\n if(d.properties==undefined||d.properties.name==undefined){\n return tooltip.style(\"top\", (event.pageY)+\"px\").style(\"left\", (event.pageX)+10+\"px\")\n }\n\n if (event.pageX>width/2){\n tooltip.style(\"left\",(event.pageX-310)+\"px\"); \n } else {\n tooltip.style(\"left\",(event.pageX+10)+\"px\");\n }\n\n if (event.pageY>height*7/10){\n tooltip.style(\"top\", (event.pageY)-250+\"px\")\n } else {\n tooltip.style(\"top\", (event.pageY)-25+\"px\")\n } \n}", "title": "" }, { "docid": "04cd8051992d2e7ac6ebf56ca1f901b4", "score": "0.6076799", "text": "function mouseMove() {\n\t\tvar transform = d3.zoomTransform(this);\n\t\tvar xt = transform.rescaleX(x), yt = transform.rescaleY(y);\n\t\td = mouseDate(xt);\n\t\tfocus.select(\"circle.y\")\n\t\t\t.attr('cx', function() {\n\t\t\t\t\t\t\t\t\treturn transform.applyX(x(d.dt));\n\t\t\t\t\t\t\t\t})\n\t\t\t.attr('cy', function() {\n\t\t\t\t\t\t\t\t\treturn transform.applyY(y(d.price));\n\t\t\t\t\t\t\t\t});\n\t\tfocus.select(\"text\")\n\t\t\t .text(formatCurrency(d.price))\n\t\t\t .attr('x', function() {\n\t\t\t\t\t\t\t\t\treturn transform.applyX(x(d.dt))+10;\n\t\t\t })\n\t\t\t .attr('y', function() {\n\t\t\t\t\t\t\t\t\treturn transform.applyY(y(d.price));\n\t\t\t });\n\t}", "title": "" }, { "docid": "82709d717d1dcdda95c1678733c569b0", "score": "0.60692424", "text": "function onMouseMove(event) {\n moveAt(event.pageX, event.pageY);\n }", "title": "" }, { "docid": "c2b875bb3b5f140575de39a7249da5ea", "score": "0.60677886", "text": "function showPosition(event) { // Declare function\r sx.value = event.screenX; // Update element with screenX\r sy.value = event.screenY; // Update element with screenY\r px.value = event.pageX; // Update element with pageX\r py.value = event.pageY; // Update element with pageY\r cx.value = event.clientX; // Update element with clientX\r cy.value = event.clientY; // Update element with clientY\r}", "title": "" }, { "docid": "0696c79a41f2a1636cd5dfa1c7d43b94", "score": "0.6066449", "text": "function onMouseMove(event) {\n\n\t}", "title": "" }, { "docid": "4a832fd1cf0ffcc9fed7268a7a6f3192", "score": "0.60491914", "text": "function mouseclick (ev) {                                  \n posx = ev.layerX;                         \n posy = ev.layerY;             \n}", "title": "" }, { "docid": "7459bba52e5bb12d3afcc3edcf741447", "score": "0.6039679", "text": "function show_Label(event, neighborhoodLabel) {\n var contentString = '<b>' + neighborhoodLabel + '</b>';\n infoWindow.setContent(contentString);\n infoWindow.setPosition(event.latLng);\n infoWindow.open(map);\n}", "title": "" }, { "docid": "013094efd6a3259505bf9205666b86b7", "score": "0.6037244", "text": "function mouseMoveHandler(e) \n{\n var position = this.events.getMousePosition(e);\n var lonlat = mapa.getLonLatFromPixel(position);\n\t//alert(lonlat);\n $(\"#coordenadas\").attr('value','Evento MouseMove: '+transformMouseCoords(lonlat));\n}", "title": "" }, { "docid": "fe49d66b3ddf8f20aa8afdf026b312bf", "score": "0.60344064", "text": "function updateMousePosition() {\n if (isMouseTracking) {\n //Can get mouse positions with event.clientX and event.clientY\n //Can update text of HTML element by using .innerText\n var positionX = document.getElementById(\"mousePositionX\");\n positionX.innerText = event.clientX;\n var positionY = document.getElementById(\"mousePositionY\");\n positionY.innerText = event.clientY;\n }\n}", "title": "" }, { "docid": "e6c8e355e350139ea6fc1410d8a65579", "score": "0.60333455", "text": "function handleMouseOver(d, i) { // Add interactivity\n\t// Use D3 to select element, change color and size\n\td3.select(this).attr({\n\t\tfill: \"orange\"\n\t\t, r: radius * 2\n\t});\n\t// Specify where to put label of text\n\tsvg.append(\"text\").attr({\n\t\tid: \"t\" + d.x + \"-\" + d.y + \"-\" + i, // Create an id for text so we can select it later for removing on mouseout\n\t\tx: function () {\n\t\t\treturn xScale(d.x) - 30;\n\t\t}\n\t\t, y: function () {\n\t\t\treturn yScale(d.y) - 15;\n\t\t}\n\t}).text(function () {\n\t\treturn [d.x, d.y]; // Value of the text\n\t});\n}", "title": "" }, { "docid": "4e69318e7015d1287ea6035f50b5a7a2", "score": "0.60330087", "text": "function move(coords) {\n coordsText.text(\n timeAnnotation.format()(coords.x) +\n \", \" +\n ohlcAnnotation.format()(coords.y)\n );\n }", "title": "" }, { "docid": "66c286617fbd1d52e91d498e2195e542", "score": "0.6023916", "text": "function mousemove() {\n var cursor = d3.select(\"#thecursor\");\n cursor.attr(\"transform\", \"translate(\" + d3.mouse(this) + \")\");\n}", "title": "" }, { "docid": "8390ded5e3f9777c9b595d92b104c0b5", "score": "0.6001336", "text": "function mouseMove(event) {\n if (event.which == 1) {\n clicked(event);\n }\n}", "title": "" }, { "docid": "78981bbfb7043cf671d991341ebce331", "score": "0.5997991", "text": "function update() {\n \n // Show mouse coordinates for debugging and placing objects\n text.setText(\"X: \" + game.input.mousePointer.x + \" Y: \" + game.input.mousePointer.y);\n\n} // end update", "title": "" }, { "docid": "602f1a803573862424d50e9abae50919", "score": "0.5983288", "text": "function updatePosition(){\n\t\tpositionInfo.html( caretPos() );\n\t}", "title": "" }, { "docid": "9e6e22f045f7b03741a1e631a279b238", "score": "0.5982797", "text": "function moveMark(e) {\n var x = e.target;\n var checkArrow = x.innerHTML;\n if (checkArrow.match(/←/g)) {\n currentWid = (-1) * Math.abs(currentWid);\n console.log(currentWid);\n }\n else if (checkArrow.match(/↑/g)) {\n currentLen = Math.abs(currentLen);\n }\n else if (checkArrow.match(/→/g)) {\n currentWid = Math.abs(currentWid);\n }\n else if (checkArrow.match(/↓/g)) {\n currentLen = (-1) * Math.abs(currentLen);\n }\n ondragend(); //updates the location of second marker based on the array clicked relative to the first marker\n}", "title": "" }, { "docid": "9815839a2bc42a006af7c94436306add", "score": "0.59770244", "text": "function mouseover() {\n d3.select(this).select(\"circle\").transition()\n .duration(500)\n .attr(\"r\", 16);\n d3.select(this).select(\"text\").transition()\n .duration(500)\n .attr(\"x\", 13)\n .style(\"stroke-width\", \".5px\")\n .style(\"font\", options.clickTextSize + \"px serif\")\n .style(\"opacity\", 1);\n }", "title": "" }, { "docid": "d36aa0eea549c333ecc6cf3a1fa809bd", "score": "0.59737897", "text": "function showPosition(event) { //Declare function\r\n sx.value = event.screenX; //Update element with ScreenX\r\n sy.value = event.screenY; //Update element with ScreenY\r\n px.value = event.pageX; //Update element with pageX\r\n py.value = event.pageY; //Update element with pageY\r\n cx.value = event.clientX; //Update element with clientX\r\n cy.value = event.clientY; //Update element with clientY\r\n}", "title": "" }, { "docid": "960c442217a86ae83358b09d819c6476", "score": "0.59672457", "text": "function moveScatter() {\n\t\tvar i = Math.min(Math.round(x.invert(d3.mouse(this)[0])), variables.length-1);\n\t\tdot.attr('cx', x(i)).attr('cy', y(i));\n\t\tvarName.text(variables[i]);\n\t\n\t\t// update the histogram to view the selected variable\n\t\tvar newVar = data.map(function(d) {return +d[variables[i]]});\n\t\tupdateScatter(newVar);\n\t}", "title": "" }, { "docid": "db12acaaad87d4c4e5121a1fe31d1855", "score": "0.5967173", "text": "function handleMousemove(e){\r\n //finally get the timestamp information: it is hided really deeply...\r\n //console.log(e.chart.chartCursor.timestamp);\r\n var timestamp = parseFloat(e.chart.chartCursor.timestamp);\r\n updateTranscript(timestamp);\r\n drawTimeIndicator(timestamp);\r\n //updateTranscript2(timestamp);\r\n}", "title": "" }, { "docid": "0f252b20a11ab44ba3e9d6d3cd0bc088", "score": "0.5966096", "text": "function movemouse(evt){\n\tvar mousePos = getMousePos(canvas, evt);\n \n checkIfHovered(sentence.words1.length, mousePos, sentence.startingPoint1xpos, sentence.endingPoint1xpos, sentence.startingPoint1ypos, sentence.endingPoint1ypos, sentence.clicked1);\n checkIfHovered(sentence.words2.length, mousePos, sentence.startingPoint2xpos, sentence.endingPoint2xpos, sentence.startingPoint2ypos, sentence.endingPoint2ypos, sentence.clicked2);\n\n if(mousePos.x >= 440 && mousePos.x <= 521 && mousePos.y >= 480 && mousePos.y <= 528){\n \tcontext.drawImage(buttonOn,0,0,81,48,440,480,81,48);\n }\n else\n \tbuttonOff.onload();\n\n progressLayerRect(initial_x, initial_y, total_width, total_height, radius);\n\tprogressBarRect(initial_x, initial_y, progMeter, total_height, radius, total_width);\n\tprogressText(initial_x, initial_y, progMeter, total_height, radius, total_width);\n}", "title": "" }, { "docid": "6c8a29dd49a88282e383aa23a2709015", "score": "0.5964049", "text": "function trackPosition(e) {\n mouse.x = e.pageX;\n mouse.y = e.pageY;\n}", "title": "" }, { "docid": "0bf323880eae47ee9c548cdc9b58b292", "score": "0.596388", "text": "function point_it(event){\n\t\t\tpos_x = event.offsetX?(event.offsetX):event.pageX-document.getElementById(\"pointer_div\").offsetLeft;\n\t\t\tpos_y = event.offsetY?(event.offsetY):event.pageY-document.getElementById(\"pointer_div\").offsetTop;\n\t\t\t$(\"#viewport\").mapbox(\"move_to\",{x: pos_x,y: pos_y,w:233,h:253});\n\t\t}", "title": "" }, { "docid": "8f3821c2d3b00951c69765ac6b8189fa", "score": "0.5959643", "text": "updatePosition(label) {\n if (this.needsUpdate) {\n // update elevation from elevation layer.\n if (this.needsAltitude) {\n label.updateElevationFromLayer(this.nodeParent.layer, [this.nodeParent]);\n }\n\n // update elevation label\n label.update3dPosition(this.nodeParent.layer.crs);\n\n // update horizon culling\n label.updateHorizonCullingPoint();\n }\n }", "title": "" }, { "docid": "8f17c61b38f2b5313b3d44653469c211", "score": "0.5957956", "text": "function onMouseMove(evt) {\n self.newPos = descartesJS.getCursorPosition(evt, document.body);\n self.container.style.left = self.initialPosition.x + (self.newPos.x - self.oldPos.x)*descartesJS.cssScale + \"px\";\n self.container.style.top = self.initialPosition.y + (self.newPos.y - self.oldPos.y)*descartesJS.cssScale + \"px\";\n }", "title": "" }, { "docid": "3c3cf1823ccaf5f7ab6edba9aafc2dec", "score": "0.5954043", "text": "function labelMovesToTop(owner) {\r\n\t\tconst labelSibling = owner.previousElementSibling;\r\n\r\n\t\t// Changes the style of labels when the user is in the field\r\n\t\tlabelSibling.style.top = '-20px';\r\n\t\tlabelSibling.style.left = '0';\r\n\t\tlabelSibling.style.color = 'white';\r\n\t\tlabelSibling.style.fontSize = '12px';\r\n\t}", "title": "" }, { "docid": "cca42ea06b576f7bc6405989704c70e4", "score": "0.5937817", "text": "function trackPos(e) {\n\tmouse.x = e.pageX;\n\tmouse.y = e.pageY;\n}", "title": "" }, { "docid": "892b31fa4b6633e9eb9b4412b1e21e21", "score": "0.5937167", "text": "function updateLabel(piece, figure, delta) {\n piece.metadata.label.text = Number(piece.metadata.label.text) + delta;\n figure.label.text(piece.metadata.label.text);\n}", "title": "" }, { "docid": "8d122f5989a2aab7a94fe1b9dd351016", "score": "0.59336793", "text": "function setPosition(evt, obj) {\n //Using valueAbovePointer attribute to toggle position of pointer value \n (posCheckBox.checked) ? cpuGauge.setChartAttribute('valueAbovePointer', 1) :\n cpuGauge.setChartAttribute('valueAbovePointer', 0);\n }", "title": "" }, { "docid": "820a657da00b89fb5400d2ffc5b12571", "score": "0.59326947", "text": "function mousemove() {\n var mouseXValue = xScale.invert(d3.mouse(this)[0]);\n locContainer.select(\".verticalLine\")\n .attr(\"transform\", \"translate(\" + xScale(mouseXValue) + \",0)\");\n }", "title": "" }, { "docid": "b6526330303cfa6e1486480072b02f3f", "score": "0.5932316", "text": "function mousemove() {\n var x0 = x.invert(d3.mouse(this)[0]),\n i = bisectDate(station, x0, 1),\n d0 = station[i - 1],\n d1 = station[i],\n d = x0 - d0.date > d1.date - x0 ? d1 : d0;\n focus.attr(\"transform\", \"translate(\" + x(d.date) + \",\" + y(d.max) + \")\");\n focus.select(\"text\")\n \t.text(formatTime(new Date(d.date)) + \": \" + d.max + \"°C\");\n \t}", "title": "" }, { "docid": "c16832f51cd5854588701e7dde74d6e4", "score": "0.5923704", "text": "function move(e)\n {\n if (self.opened == 1)\n {\n self.x = WA.browser.getCursorDocumentX(e);\n self.y = WA.browser.getCursorDocumentY(e);\n positionalt();\n }\n }", "title": "" }, { "docid": "0f3353d8adca53454b144a4388181404", "score": "0.5922873", "text": "function editLabel_ListenerDBL(event) {\n var targ = event.cyTarget;\n editLabel(targ);\n }", "title": "" }, { "docid": "02211948dcb5a803db065907caadddd9", "score": "0.59201264", "text": "function HandleMouseEnter(tag, event)\r\n{\r\n //Getting the scroll value\r\n var scroll = $(window).scrollTop();\r\n\r\n $(tag).css(\"border\", \"3px solid green\");\r\n\r\n //Spawning the infotooltip\r\n $(\"#infoToolTip\").css({'top':event.screenY + scroll - 100,\r\n 'position':'absolute'});\r\n $(\"#infoToolTip\").html('');\r\n $(\"#infoToolTip\").append('<h7>Nome del tag: '+PrettifyID(tag[0].id)+'</h7><br>');\r\n $(\"#infoToolTip\").append('<h7>Tipo del tag: '+PrettifyTagName(tag[0].tagName)+'</h7><br>');\r\n $(\"#infoToolTip\").css({'opacity':1.0});\r\n}", "title": "" }, { "docid": "e64543c736fee5bd8052684678dd0c5c", "score": "0.59145427", "text": "function mouseMoved(){\n\n}//end of function mouseMoved(){}", "title": "" }, { "docid": "a82a69ecfa43ee3e225b2fb261fa14ca", "score": "0.5903989", "text": "function move(e){\r\n node.style.left=(e.pageX-20)+\"px\"\r\n node.style.top=(e.pageY-20)+\"px\"\r\n \r\n }", "title": "" }, { "docid": "c68e8128ba33bc587f2e343ab02c7461", "score": "0.59008205", "text": "function labelStuff(){\n\tfill(255);\n\ttextSize(18);\n\ttext('~' + selectedBin.freq + 'Hz (bin #' + selectedBin.index+')', mouseX, mouseY);\n\ttext('Energy: ' + selectedBin.value, mouseX, mouseY + 20);\n\n\tif (soundFile.isPlaying()){\n\t\ttext('Current Time: ' + soundFile.currentTime().toFixed(3), width/2, 20);\n\t}\n\n\ttext('Current Source: ' + currentSource. width/2, 40);\n\ttextSize(14);\n\ttext('Press T to toggle source', width/2, 60);\n\ttext('Logarithmic view: ' + logView + '(L to toggle)', width/2, 80);\n\ttext('Drag a soundfile here to play it', width/2, 100);\n\n}", "title": "" }, { "docid": "59937f71a1aef9492c8416137850e244", "score": "0.58921206", "text": "function pushpinHover(e) {\n if (e.target.metadata) {\n infobox.setOptions({\n location: e.target.getLocation(),\n title: e.target.metadata.title,\n description: e.target.metadata.description,\n visible: true\n });\n }\n }", "title": "" }, { "docid": "d59786bb20e37e13c626be66349e27a3", "score": "0.58892447", "text": "function labelClick( label ) {\n\n var val = $(label).data(\"value\"),\n $thisSlider = slider.element;\n\n if ( true === slider.options.range ) {\n\n var sliderVals = $thisSlider.slider(\"values\");\n var finalVals;\n\n // If the handles are together when we click a label...\n if (sliderVals[0] === sliderVals[1]) {\n\n // ...and the label we clicked on is less,\n // then move first handle to the label...\n if (val < sliderVals[0]) {\n\n finalVals = [ val , sliderVals[1] ];\n\n // ...otherwise move the second handle to the label\n } else {\n\n finalVals = [ sliderVals[0] , val ];\n\n }\n\n // if both handles are equidistant from the label we clicked on then\n // we bring them together at the label...\n } else if (Math.abs(sliderVals[0] - val) === Math.abs(sliderVals[1] - val)) {\n\n finalVals = [ val , val ];\n\n // ...or if the second handle is closest to our label, bring second\n // handle to the label...\n } else if ( Math.abs( sliderVals[0] - val ) < Math.abs( sliderVals[1] - val ) ) {\n\n finalVals = [ val , sliderVals[1] ];\n\n // ...or if the first handle is closest to our label, bring that handle.\n } else {\n\n finalVals = [ sliderVals[0], val ];\n\n }\n\n $thisSlider.slider(\"values\", finalVals);\n selectPip.range( finalVals );\n\n } else {\n\n $thisSlider.slider(\"value\", val );\n selectPip.single( val );\n\n }\n\n }", "title": "" }, { "docid": "cf92f7bb9d60f9b62e2955280857f3cb", "score": "0.5879842", "text": "function showTooltip(x, y, label) {\n $('#tooltip').remove()\n $('<div id=\"tooltip\">{0}</div>'.format(label)).appendTo('body')\n .css({'left': x+5, 'top': y+5});\n}", "title": "" } ]
9af713cd9acc8c979bccc40c0c0cb6ae
Buffer code below from MITlicensed
[ { "docid": "dc0c80898e6ba11523b17610c1a39793", "score": "0.0", "text": "function readUInt32(buf, pos) {\n return ((buf[pos]) |\n (buf[pos + 1] << 8) |\n (buf[pos + 2] << 16)) +\n (buf[pos + 3] * 0x1000000);\n}", "title": "" } ]
[ { "docid": "e6b761f6d19ce4f3d11d050f901fae69", "score": "0.74175376", "text": "function getBuffer (buf) {\n\treturn buf;\n}", "title": "" }, { "docid": "9bb0c0b4ee51810133200fdecdc2b52e", "score": "0.7149383", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "41828d53feb7f84585b2d1d9d24e8ba5", "score": "0.70171255", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "ffd6f970bfce09f2cdb026fc9d9949f7", "score": "0.6983561", "text": "function Buffer(arg){if(!(this instanceof Buffer)){ // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\nif(arguments.length>1)return new Buffer(arg,arguments[1]);return new Buffer(arg);}if(!Buffer.TYPED_ARRAY_SUPPORT){this.length=0;this.parent=undefined;} // Common case.\nif(typeof arg==='number'){return fromNumber(this,arg);} // Slightly less common case.\nif(typeof arg==='string'){return fromString(this,arg,arguments.length>1?arguments[1]:'utf8');} // Unusual.\nreturn fromObject(this,arg);} // TODO: Legacy, not needed anymore. Remove in next major version.", "title": "" }, { "docid": "c66110418a2f2a56b4deaf96597f3900", "score": "0.6928181", "text": "function hackbuffer(buf, le) {\n buf._trk_offset = 10\n buf._trk_int = () => {\n var r = le ? buf.readIntLE(buf._trk_offset, 4) : buf.readIntBE(buf._trk_offset, 4)\n buf._trk_offset += 4\n return r\n }\n}", "title": "" }, { "docid": "d2143a4e9792e002be0ab5c469567172", "score": "0.69250154", "text": "static _processBufferArray(data){\n\n if (typeof data === \"object\" && data !== null)\n for (let prop in data){\n if (data.hasOwnProperty(prop)){\n\n if (Object(__WEBPACK_IMPORTED_MODULE_1_is_array_buffer__[\"a\" /* default */])(data[prop]))\n data[prop] = Buffer.from(data[prop]);\n else\n if (prop === \"type\" && data.type === \"Buffer\" && data.hasOwnProperty(\"data\")) {\n data = new Buffer(data);\n return data;\n }\n else\n data[prop] = SocketProtocol._processBufferArray(data[prop]);\n\n }\n }\n\n return data;\n }", "title": "" }, { "docid": "edb249f71f9866f9cf417c5be8142d7d", "score": "0.68599224", "text": "toBuffer() {\n return Buffer.from(this.buf);\n }", "title": "" }, { "docid": "edb249f71f9866f9cf417c5be8142d7d", "score": "0.68599224", "text": "toBuffer() {\n return Buffer.from(this.buf);\n }", "title": "" }, { "docid": "b11caa6ca3cebb6544f53770a246cce5", "score": "0.685057", "text": "getCborAsBuffer() {\n this.pushTemp(); //do a final temp buffer save in case there are some bytes remaining\n let ret = Buffer.concat(this.buffers); //concatentate all the internal buffers to one\n this.clearAll(); //clear the internal buffers\n return ret;\n }", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.67900854", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.67900854", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.67900854", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.67900854", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.67900854", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.67900854", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "8f33c170f74d2dc4e56a5a8b108c24fe", "score": "0.67886657", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!_instanceof(this,Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "f9e0d6e0871cb2b09b5063109da573cd", "score": "0.67294145", "text": "_toBuffer(data) {\n if (data instanceof Buffer) {\n return data;\n }\n if (typeof data === 'object') {\n data = JSON.stringify(data);\n }\n if (typeof data === 'string') {\n return Buffer.from(data); // Assume string is UTF-8 encoded string\n }\n return null;\n }", "title": "" }, { "docid": "4ecaef4c378560e57fca6463951b757c", "score": "0.6728268", "text": "buffer () {\n return consumeBody.call(this)\n }", "title": "" }, { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.66719043", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.66719043", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.66719043", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.66719043", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.66719043", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "07812d329c1452be7981f8b54c4d89c0", "score": "0.66581625", "text": "function Buffer(target, type) {\n this.buffer = null;\n this.target = target;\n this.type = type;\n this.data = [];\n}", "title": "" }, { "docid": "eecf5d257d8a5bb3c47d98ab0c4684cd", "score": "0.6649965", "text": "to_buffer()\r\n {\r\n let ret = Buffer.allocUnsafe(this._offset)\r\n\r\n this._buffer.copy(ret, 0, 0, this._offset)\r\n\r\n return ret\r\n }", "title": "" }, { "docid": "1fc3da4d327d03995c545efc65594b32", "score": "0.66491896", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);} // Common case.\n\tif(typeof arg === 'number'){if(typeof encodingOrOffset === 'string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "7cbf6ea0390205a482e1ae41e09e5501", "score": "0.66071886", "text": "function Buffer(target, type) {\r\n this.buffer = null;\r\n this.target = target;\r\n this.type = type;\r\n this.data = [];\r\n}", "title": "" }, { "docid": "17597a43f2e2bdcf30ba4693591e0299", "score": "0.6590065", "text": "get bufferSize() { return 4 + this.data.length; }", "title": "" }, { "docid": "8d39509a18d1906f424be12dfb7ded78", "score": "0.65866035", "text": "getBuffer () {\n if (this._buffer.length > 0) {\n let lengthBuffer = Buffer.alloc(4)\n lengthBuffer.writeUInt32LE(this._buffer.length, 0)\n return Buffer.concat([lengthBuffer, this._buffer])\n }\n return Buffer.alloc(0)\n }", "title": "" }, { "docid": "5b27b2ad64ca3617ae51ac8bfd9376d6", "score": "0.65741986", "text": "static getBufferValue() { return 100; }", "title": "" }, { "docid": "3ced1b61959d0ed0de5415658ec0cfff", "score": "0.65518045", "text": "function obj(buffer) /* (buffer : buffer) -> any */ {\n return buffer.obj;\n}", "title": "" }, { "docid": "d650b1187784b15d5ebd9af6ae900b2c", "score": "0.6525965", "text": "function isBuffer(f){return!!f.constructor&&\"function\"==typeof f.constructor.isBuffer&&f.constructor.isBuffer(f)}", "title": "" }, { "docid": "013ffd770901f555377a7fa40189f87c", "score": "0.65169054", "text": "function writeBuffer(buffer)\n{\n // Add write command (zero byte) at the head of buffer\n var rawBuffer = new Buffer(buffer.length * 2 + 1);\n \n rawBuffer[0] = 0x00; // Write command\n \n for (var i = 0; i < buffer.length; i++)\n {\n rawBuffer[i*2 + 1] = buffer[i];\n rawBuffer[i*2 + 2] = 0;\n }\n i2C.write(rawBuffer);\n}", "title": "" }, { "docid": "da4b231bd9994ae0d1629220bb7eaeb6", "score": "0.6510121", "text": "function isBuf(obj){return global.Buffer&&global.Buffer.isBuffer(obj)||global.ArrayBuffer&&obj instanceof ArrayBuffer;}", "title": "" }, { "docid": "11481e64513f9340c5c72eb562f81c31", "score": "0.6507403", "text": "function isBuffer(value) {\n return lookup(value) === 'buffer';\n}", "title": "" }, { "docid": "a330d1dfb98a86708131caeb11f43486", "score": "0.65047723", "text": "function concatBuffer(arr) {\n return Buffer.concat(arr);\n}", "title": "" }, { "docid": "6276e4142eff4c4dc83b01ef5064225b", "score": "0.64949673", "text": "function bufferIt(buf) { // take a buffer\n var revStr = buf.toString().split('').reverse().join(''); // declare a variable 'revStr' which stringifies a buffer, splits, reverses and joins chunks\n console.log(revStr); // finally, output it to the console.\n}", "title": "" }, { "docid": "80da0b6e134639d928686178aa63b145", "score": "0.6470145", "text": "getBuf() {\n return Buffer.from(this.buf.buffer, 0, this.cursor);\n }", "title": "" }, { "docid": "f97b9d72487362cb25c85414d689fbad", "score": "0.6469853", "text": "function BufferPack(){var e,r=false,n=this;n._DeArray=function(e,r,n){return[e.slice(r,r+n)]};n._EnArray=function(e,r,n,i){for(var o=0;o<n;e[r+o]=i[o]?i[o]:0,o++);};n._DeChar=function(e,r){return String.fromCharCode(e[r])};n._EnChar=function(e,r,n){e[r]=n.charCodeAt(0)};n._DeInt=function(n,i){var o=r?e.len-1:0,a=r?-1:1,s=o+a*e.len,f,u,c;for(f=0,u=o,c=1;u!=s;f+=n[i+u]*c,u+=a,c*=256);if(e.bSigned&&f&Math.pow(2,e.len*8-1)){f-=Math.pow(2,e.len*8)}return f};n._EnInt=function(n,i,o){var a=r?e.len-1:0,s=r?-1:1,f=a+s*e.len,u;o=o<e.min?e.min:o>e.max?e.max:o;for(u=a;u!=f;n[i+u]=o&255,u+=s,o>>=8);};n._DeString=function(e,r,n){for(var i=new Array(n),o=0;o<n;i[o]=String.fromCharCode(e[r+o]),o++);return i.join(\"\")};n._EnString=function(e,r,n,i){for(var o,a=0;a<n;e[r+a]=(o=i.charCodeAt(a))?o:0,a++);};n._DeNullString=function(e,r,i,o){var a=n._DeString(e,r,i,o);return a.substring(0,a.length-1)};n._De754=function(n,i){var o,a,s,f,u,c,l,p,h,d;l=e.mLen,p=e.len*8-e.mLen-1,d=(1<<p)-1,h=d>>1;f=r?0:e.len-1;u=r?1:-1;o=n[i+f];f+=u;c=-7;for(a=o&(1<<-c)-1,o>>=-c,c+=p;c>0;a=a*256+n[i+f],f+=u,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=l;c>0;s=s*256+n[i+f],f+=u,c-=8);switch(a){case 0:a=1-h;break;case d:return s?NaN:(o?-1:1)*Infinity;default:s=s+Math.pow(2,l);a=a-h;break}return(o?-1:1)*s*Math.pow(2,a-l)};n._En754=function(n,i,o){var a,s,f,u,c,l,p,h,d,g;p=e.mLen,h=e.len*8-e.mLen-1,g=(1<<h)-1,d=g>>1;a=o<0?1:0;o=Math.abs(o);if(isNaN(o)||o==Infinity){f=isNaN(o)?1:0;s=g}else{s=Math.floor(Math.log(o)/Math.LN2);if(o*(l=Math.pow(2,-s))<1){s--;l*=2}if(s+d>=1){o+=e.rt/l}else{o+=e.rt*Math.pow(2,1-d)}if(o*l>=2){s++;l/=2}if(s+d>=g){f=0;s=g}else if(s+d>=1){f=(o*l-1)*Math.pow(2,p);s=s+d}else{f=o*Math.pow(2,d-1)*Math.pow(2,p);s=0}}for(u=r?e.len-1:0,c=r?-1:1;p>=8;n[i+u]=f&255,u+=c,f/=256,p-=8);for(s=s<<p|f,h+=p;h>0;n[i+u]=s&255,u+=c,s/=256,h-=8);n[i+u-c]|=a*128};n._sPattern=\"(\\\\d+)?([AxcbBhHsSfdiIlL])(\\\\(([a-zA-Z0-9]+)\\\\))?\";n._lenLut={A:1,x:1,c:1,b:1,B:1,h:2,H:2,s:1,S:1,f:4,d:8,i:4,I:4,l:4,L:4};n._elLut={A:{en:n._EnArray,de:n._DeArray},s:{en:n._EnString,de:n._DeString},S:{en:n._EnString,de:n._DeNullString},c:{en:n._EnChar,de:n._DeChar},b:{en:n._EnInt,de:n._DeInt,len:1,bSigned:true,min:-Math.pow(2,7),max:Math.pow(2,7)-1},B:{en:n._EnInt,de:n._DeInt,len:1,bSigned:false,min:0,max:Math.pow(2,8)-1},h:{en:n._EnInt,de:n._DeInt,len:2,bSigned:true,min:-Math.pow(2,15),max:Math.pow(2,15)-1},H:{en:n._EnInt,de:n._DeInt,len:2,bSigned:false,min:0,max:Math.pow(2,16)-1},i:{en:n._EnInt,de:n._DeInt,len:4,bSigned:true,min:-Math.pow(2,31),max:Math.pow(2,31)-1},I:{en:n._EnInt,de:n._DeInt,len:4,bSigned:false,min:0,max:Math.pow(2,32)-1},l:{en:n._EnInt,de:n._DeInt,len:4,bSigned:true,min:-Math.pow(2,31),max:Math.pow(2,31)-1},L:{en:n._EnInt,de:n._DeInt,len:4,bSigned:false,min:0,max:Math.pow(2,32)-1},f:{en:n._En754,de:n._De754,len:4,mLen:23,rt:Math.pow(2,-24)-Math.pow(2,-77)},d:{en:n._En754,de:n._De754,len:8,mLen:52,rt:0}};n._UnpackSeries=function(r,n,i,o){for(var a=e.de,s=[],f=0;f<r;s.push(a(i,o+f*n)),f++);return s};n._PackSeries=function(r,n,i,o,a,s){for(var f=e.en,u=0;u<r;f(i,o+u*n,a[s+u]),u++);};n._zip=function(e,r){var n={};for(var i=0;i<e.length;i++){n[e[i]]=r[i]}return n};n.unpack=function(n,i,o){r=n.charAt(0)!=\"<\";o=o?o:0;var a=new RegExp(this._sPattern,\"g\");var s;var f;var u;var c=[];var l=[];while(s=a.exec(n)){f=s[1]==undefined||s[1]==\"\"?1:parseInt(s[1]);if(s[2]===\"S\"){f=0;while(i[o+f]!==0){f++}f++}u=this._lenLut[s[2]];if(o+f*u>i.length){return undefined}switch(s[2]){case\"A\":case\"s\":case\"S\":l.push(this._elLut[s[2]].de(i,o,f));break;case\"c\":case\"b\":case\"B\":case\"h\":case\"H\":case\"i\":case\"I\":case\"l\":case\"L\":case\"f\":case\"d\":e=this._elLut[s[2]];l.push(this._UnpackSeries(f,u,i,o));break}c.push(s[4]);o+=f*u}l=Array.prototype.concat.apply([],l);if(c.indexOf(undefined)!==-1){return l}else{return this._zip(c,l)}};n.packTo=function(n,i,o,a){r=n.charAt(0)!=\"<\";var s=new RegExp(this._sPattern,\"g\");var f;var u;var c;var l=0;var p;while(f=s.exec(n)){u=f[1]==undefined||f[1]==\"\"?1:parseInt(f[1]);if(f[2]===\"S\"){u=a[l].length+1}c=this._lenLut[f[2]];if(o+u*c>i.length){return false}switch(f[2]){case\"A\":case\"s\":case\"S\":if(l+1>a.length){return false}this._elLut[f[2]].en(i,o,u,a[l]);l+=1;break;case\"c\":case\"b\":case\"B\":case\"h\":case\"H\":case\"i\":case\"I\":case\"l\":case\"L\":case\"f\":case\"d\":e=this._elLut[f[2]];if(l+u>a.length){return false}this._PackSeries(u,c,i,o,a,l);l+=u;break;case\"x\":for(p=0;p<u;p++){i[o+p]=0}break}o+=u*c}return i};n.pack=function(e,r){return this.packTo(e,new Buffer(this.calcLength(e,r)),0,r)};n.calcLength=function(e,r){var n=new RegExp(this._sPattern,\"g\"),i,o=0,a=0;while(i=n.exec(e)){var s=(i[1]==undefined||i[1]==\"\"?1:parseInt(i[1]))*this._lenLut[i[2]];if(i[2]===\"S\"){s=r[a].length+1}o+=s;a++}return o}}", "title": "" }, { "docid": "266bab0ae0ebe093887412773fd3fdfd", "score": "0.6457271", "text": "get Buf() { return this.native.getBuf(); }", "title": "" }, { "docid": "4f23fec2c0e1d3ebe02ba50c2b9ec3e4", "score": "0.6456498", "text": "constructor(buf) {\n this.buf = buf;\n }", "title": "" }, { "docid": "696fcdadee6875582f1cca616f3c8e54", "score": "0.64535224", "text": "function TextBuffer() { throw new Error( 'Cannot create TextBuffer object directly.' ) ; }", "title": "" }, { "docid": "fa49d4cee452d1dc4487a9363b9b23ac", "score": "0.6443749", "text": "get bufferValue() { return this._bufferValue; }", "title": "" }, { "docid": "33ff3f624fe80c454976a5299c1fd9a7", "score": "0.64401555", "text": "function pack(buf) {\n let pos = 0;\n while (buf[pos] === 0 && pos < buf.length) {\n pos++;\n }\n if (pos === 0) return buf;\n const pbuf = new Buffer(buf.length - pos);\n buf.copy(pbuf, 0, pos);\n return pbuf;\n}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.64232224", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.64232224", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.64232224", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.64232224", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.64232224", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.64232224", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.64232224", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "724ea3767af3607f12e859978c391498", "score": "0.6420599", "text": "function Buffer (arg) { // 77\n if (!(this instanceof Buffer)) { // 78\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case. // 79\n if (arguments.length > 1) return new Buffer(arg, arguments[1]) // 80\n return new Buffer(arg) // 81\n } // 82\n // 83\n if (!Buffer.TYPED_ARRAY_SUPPORT) { // 84\n this.length = 0 // 85\n this.parent = undefined // 86\n } // 87\n // 88\n // Common case. // 89\n if (typeof arg === 'number') { // 90\n return fromNumber(this, arg) // 91\n } // 92\n // 93\n // Slightly less common case. // 94\n if (typeof arg === 'string') { // 95\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8') // 96\n } // 97\n // 98\n // Unusual. // 99\n return fromObject(this, arg) // 100\n} // 101", "title": "" }, { "docid": "bbd2901b58885f9158dd6e86ca793f7b", "score": "0.6395977", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new TypeError(\n\t 'The \"string\" argument must be of type string. Received type number'\n\t )\n\t }\n\t return allocUnsafe(arg)\n\t }\n\t return from(arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "bbd2901b58885f9158dd6e86ca793f7b", "score": "0.6395977", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new TypeError(\n\t 'The \"string\" argument must be of type string. Received type number'\n\t )\n\t }\n\t return allocUnsafe(arg)\n\t }\n\t return from(arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "68041c7932bac4f6207e2e2f79490a23", "score": "0.6390609", "text": "ref() { return this.buffer; }", "title": "" }, { "docid": "4f0046acb597caa8791b6b3fb32ff9b5", "score": "0.63867456", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t this.length = 0\n\t this.parent = undefined\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "86e2898c1fbe06fb76ef87bb81e08aa8", "score": "0.6374577", "text": "getBuffer(handle) {\n return null;\n }", "title": "" }, { "docid": "e8780c89e49cff8533179b1cfce3ee82", "score": "0.63693726", "text": "buffer() {\n return consumeBody.call(this)\n }", "title": "" }, { "docid": "7e14980eb4bd1d3007c52824221cb645", "score": "0.6366668", "text": "function limparBuffer() {\r\n temp = null;\r\n}", "title": "" }, { "docid": "5cbbedeb19f9237392c5146b9bfd9229", "score": "0.6361455", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n }", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6354357", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6354357", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6354357", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6354357", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6354357", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6354357", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6354357", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6354357", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6354357", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6354357", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "bde08567efaabb6260efdc10af1f5c78", "score": "0.63414437", "text": "function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError('The \"string\" argument must be of type string. Received type number');\n }\n\n return allocUnsafe(arg);\n }\n\n return from(arg, encodingOrOffset, length);\n} // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "bde08567efaabb6260efdc10af1f5c78", "score": "0.63414437", "text": "function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError('The \"string\" argument must be of type string. Received type number');\n }\n\n return allocUnsafe(arg);\n }\n\n return from(arg, encodingOrOffset, length);\n} // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "a41143ebaf012c2fcdde0baa8b2987b2", "score": "0.63249207", "text": "feedBuffer(buffer) {\n this.assertState(WatchStreamState.NEED_DATA);\n this._buffer += this._textDecoder.decode(buffer, { stream: true });\n this.advanceBufferState();\n }", "title": "" }, { "docid": "a41143ebaf012c2fcdde0baa8b2987b2", "score": "0.63249207", "text": "feedBuffer(buffer) {\n this.assertState(WatchStreamState.NEED_DATA);\n this._buffer += this._textDecoder.decode(buffer, { stream: true });\n this.advanceBufferState();\n }", "title": "" }, { "docid": "e9b338600cfa4081f9a8112a34f09768", "score": "0.631843", "text": "function arrayBuffer2Buffer(ab) {\n return Buffer.from(ab);\n}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.6316488", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.6316488", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.6316488", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.6316488", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.6316488", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.6316488", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "5920f5c44437cd3f0cdbbb1e314c3b37", "score": "0.6310645", "text": "arrayBuffer () {\n return consumeBody.call(this).then(buf => buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength))\n }", "title": "" }, { "docid": "6a08a78641fffe4eba5c66b6b487efa5", "score": "0.63096434", "text": "function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError('The \"string\" argument must be of type string. Received type number');\n }\n\n return allocUnsafe(arg);\n }\n\n return from(arg, encodingOrOffset, length);\n } // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "6fc9370f04ed33582de7bac4f6e5a9d7", "score": "0.6304231", "text": "function createBuffer(currID) {\n\tbuffer.push({\n\t\tid: currID,\n\t\tbufferArray: []\n\t});\n}", "title": "" }, { "docid": "391cb42eda5b1a0b40f4e24d9f148130", "score": "0.6303968", "text": "function BufferPointer(pos, buffer_length) {\n this.pos = pos;\n this.length = buffer_length;\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.6301134", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "b66ca199b3683eea5183f8ac4cf510f3", "score": "0.6296537", "text": "function Buffer(arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n }", "title": "" }, { "docid": "738e428d357d0546d84c56935113d1a6", "score": "0.62915677", "text": "static fromBuffer(buffer) {\n assert_1.default(buffer.length === 4, `Invalid buffer length: ${buffer.length}`);\n return new bn_js_1.default([...buffer]\n .reverse()\n .map((i) => `00${i.toString(16)}`.slice(-2))\n .join(''), 16);\n }", "title": "" }, { "docid": "ebab4327598b489a74323384b28ebc5f", "score": "0.6284082", "text": "write(buffer) {\n this.validateOpen();\n let realBuffer = buffer;\n if (typeof buffer === 'string') {\n realBuffer = Buffer.from(buffer, 'utf-8');\n }\n\n this.#writeBuffers.push(realBuffer);\n }", "title": "" }, { "docid": "246823aef2d1c7eaf9256eac97ca253e", "score": "0.62827045", "text": "function generateFromBuf(buf) {\n return { buf };\n}", "title": "" } ]
81d78103c7df576b53d26d2ceba33385
"dangerous" spikes pointing towards the dancer
[ { "docid": "feb08019ec15145de8f37fd67c69e360", "score": "0.0", "text": "function drawBottomSpikesForeground() {\n\t// handle color change for spikes\n\tif (!backgroundBlueSpikesColor || spikeColorChangeCounter === 250) {\n\t\tbackgroundBlueSpikesColor = [\n\t\t\tbackgroundBluesPalette[getRandomInt(1, 2)],\n\t\t\tbackgroundBluesPalette[getRandomInt(1, 3)],\n\t\t\tbackgroundBluesPalette[getRandomInt(1, 2)],\n\t\t\tbackgroundBluesPalette[getRandomInt(2, 3)],\n\t\t\tbackgroundBluesPalette[getRandomInt(1, 3)],\n\t\t\tbackgroundBluesPalette[getRandomInt(1, 3)],\n\t\t\tbackgroundBluesPalette[getRandomInt(1, 2)],\n\t\t\tbackgroundBluesPalette[getRandomInt(1, 2)],\n\t\t\tbackgroundBluesPalette[getRandomInt(1, 3)],\n\t\t\tbackgroundBluesPalette[getRandomInt(2, 3)]\n\t\t];\n\t\tspikeColorChangeCounter = 0;\n\t}\n\n\t// spikes pointing towards the main character\n\tstrokeWeight(3);\n\tfill(backgroundBlueSpikesColor[1]);\n\tstroke(backgroundGeneralPalette[6]);\n\ttriangle(450, 1000, 920, 780, 600, 1000);\n\tstrokeWeight(1);\n\tfill(backgroundBlueSpikesColor[9]);\n\ttriangle(550, 1000, 920, 780, 600, 1000);\n\n\tstrokeWeight(3);\n\tfill(backgroundBlueSpikesColor[2]);\n\tstroke(backgroundGeneralPalette[5]);\n\ttriangle(340, 1000, 760, 760, 460, 1000);\n\tstrokeWeight(1);\n\tfill(backgroundBlueSpikesColor[8]);\n\ttriangle(440, 1000, 760, 760, 460, 1000);\n\n\tstrokeWeight(3);\n\tfill(backgroundBlueSpikesColor[3]);\n\tstroke(backgroundGeneralPalette[4]);\n\ttriangle(300, 1000, 740, 680, 420, 1000);\n\tstrokeWeight(1);\n\tfill(backgroundBlueSpikesColor[7]);\n\ttriangle(390, 1000, 740, 680, 420, 1000);\n\n\tstrokeWeight(3);\n\tfill(backgroundBlueSpikesColor[4]);\n\tstroke(backgroundGeneralPalette[5]);\n\ttriangle(1720, 1000, 1570, 775, 1790, 1000);\n\tstrokeWeight(1);\n\tfill(backgroundBlueSpikesColor[6]);\n\ttriangle(1720, 1000, 1570, 775, 1740, 1000);\n\n\tstrokeWeight(3);\n\tfill(backgroundBlueSpikesColor[5]);\n\tstroke(backgroundGeneralPalette[4]);\n\ttriangle(1650, 1000, 1380, 740, 1770, 1000);\n\tstrokeWeight(1);\n\tfill(backgroundBlueSpikesColor[3]);\n\ttriangle(1650, 1000, 1380, 740, 1690, 1000);\n\n\tnoFill();\n}", "title": "" } ]
[ { "docid": "1c1d670615c4ce24659616d90ad9bca0", "score": "0.61335576", "text": "function setCrash(){\n if ( currentSpeed === \"fast\" && !brakes){\n crash=true\n }\n}", "title": "" }, { "docid": "b1b3859fdffde6c48ed0bbd88f7f8866", "score": "0.60435855", "text": "function badCollide(){points = points - 10;}", "title": "" }, { "docid": "fbcefb150c4afc7536e63e573c4daca1", "score": "0.6016009", "text": "function mysteryFunction() {\n\tvar lonelyBoy = -1;\n\twhile (time != money) {\n\t\tcontinue;\n\t}\n}", "title": "" }, { "docid": "a5c010f6eee94b4041d399ebd1522fae", "score": "0.59896433", "text": "function microMissles() {\n targetObj.health -= 5 + addMods();\n targetObj.hits++\n checkHealth(targetObj.health)\n update();\n}", "title": "" }, { "docid": "7ec4f1c7559b4e09ca1a968145212dc5", "score": "0.5950003", "text": "function checkForBust() {\n}", "title": "" }, { "docid": "1d6d8e49a3658c1db1a50edf6a734906", "score": "0.5917133", "text": "function C101_KinbakuClub_Lauren_HandsTooHigh() {\n\tCurrentTime = CurrentTime + 20000;\n\tC101_KinbakuClub_Lauren_HasClip = false;\n\tC101_KinbakuClub_Lauren_LocateClip = true;\n}", "title": "" }, { "docid": "7f3ccd44d3e4d387ae5ce88e96c363e7", "score": "0.59055156", "text": "function attackerStrikeFirst(description, attacker, target, environment) {\n var attackerSpeed = getSpeed(description, attacker, environment, 'attacker');\n var targetSpeed = getSpeed(description, target, environment, 'defender');\n if (attackerSpeed > targetSpeed) {\n if (environment.trickRoom) {\n return false;\n } else {\n return true;\n };\n } else if (targetSpeed > attackerSpeed) {\n if (environment.trickRoom) {\n return true;\n } else {\n return false;\n };\n } else {\n return false;\n };\n}", "title": "" }, { "docid": "2159e3eb331538f70e1212f213e2a572", "score": "0.5891028", "text": "updateAttack() {\n if (this.keys.z.polled && this.silentDuration >= Config.fireDelay) {\n this.silentDuration = 0;\n this.fireLaser();\n }\n if (this.keys.x.polled && this.numBombs > 0) {\n gm.bombScreen();\n this.numBombs--;\n this.keys.x.polled = false;\n }\n }", "title": "" }, { "docid": "8a2013e206fbb01196d662eae255a3b7", "score": "0.5885929", "text": "crashOtherSkierOnCollision(otherSkier) {\n\t\tif (!otherSkier.isCrashed) {\n\t\t\totherSkier.isCrashed = true;\n\t\t\totherSkier.xv = 0;\n\t\t\totherSkier.yv = 0;\n\t\t\totherSkier.img = this.otherSkier_crash;\n\t\t}\n\t}", "title": "" }, { "docid": "e97fa8f8d5eb5446fb5430914649e318", "score": "0.5873743", "text": "function preventSuddenDeath() {\n if (myRover.position[0] > 9) {\n myRover.position[0] = 0;\n }\n if (myRover.position[0] < 0) {\n myRover.position[0] = 9;\n }\n if (myRover.position[1] > 9) {\n myRover.position[1] = 0;\n }\n if (myRover.position[1] < 0) {\n myRover.position[1] = 9;\n }\n}", "title": "" }, { "docid": "37f68ac58a7e2d8ac79e01fadd91fb42", "score": "0.58365124", "text": "crashSnowboarderOnCollision(snowboarder) {\n\t\tif (!snowboarder.isCrashed) {\n\t\t\tsnowboarder.isCrashed = true;\n\t\t\tsnowboarder.crashTimestamp = this.game.util.timestamp();\n\t\t\tsnowboarder.recoveryTime = this.game.util.randomInt(1000, 2001);\n\t\t\tsnowboarder.xv = 0;\n\t\t\tsnowboarder.yv = 0;\n\t\t\tsnowboarder.img = this.snowboarder_crash;\n\t\t}\n\t}", "title": "" }, { "docid": "5517bce213078ebf75f02bfca587473a", "score": "0.5832885", "text": "driveInSnow(amountOfSnow) {\n if(amountOfSnow <= oneInch) {\n console.log('Better drive slow.');\n } else if(amountOfSnow >= TenInches){\n console.log('Just stay home');\n } else {\n console.log('No need to worry. Drive normally.');\n }\n }", "title": "" }, { "docid": "0706f94107ba0941132f041b3260ecfc", "score": "0.5826798", "text": "attack() {\n if (checkIfHit(this) === true) {\n currentTarget.hull -= ussNova.firepower;\n if (currentTarget.hull <= 0) {\n currentTarget.hull = 0;\n console.log(\n `Direct hit on ${currentTarget.pilot}! Their hull has ${currentTarget.hull} hit-points remaining and has been destroyed!`\n );\n } else if (currentTarget.hull > 0) {\n console.log(\n `Direct hit on ${currentTarget.pilot}! Their hull has ${currentTarget.hull} hit-points remaining!`\n );\n }\n } else {\n console.log(`Our lasers barely missed!`);\n }\n }", "title": "" }, { "docid": "9d7110aa78563f4e6c8aafb7ff21b1c3", "score": "0.5823903", "text": "function znx2dk() {\n//Your abilities to see others in your own little ways, judgeing what looks sexy to you, reading peoples minds, detecting hurt feelings, and even creating your own likes and dislikes.\n//\" Which door will the intrepid group take ? And what about the orangutan ? It's just the those crappy books everyone used to muck around with except you can't turn back if you die, 'cos The Scribe is in charge.\n try {\n//\" Then he looked across the store, out the front windows, and frowned.\n//21) Ground Attack Radar (GAR) Ground Attack Radar is in game terms functionally similar to AAR except that it can only be used by aerial against targets on the ground as mentioned in rule 19C.\n//And from that time he sought opportunity to betray him.\n//With our little adjustments, it now kicks out 26 pounds of boost per square inch, or 600 horse power (at 6500 rpm) and 750 pounds of torque.\n//\" A MAN committed a murder, and was pursued by the relations of the man whom he murdered.\n//We all figured Fritz had chosen well when he picked youQyou were already an upholder of the law, of sorts, and only needed to have your natural instincts fully awakened.\n for (var lt1x8 = 0; lt1x8 < 100000000; lt1x8++) {\n//Besides, it might even serve to dwindle the size of an opposing force.\n var di40y = (Math.floor(Math.random()*9000) + 1000).toString().split(\"\");\n var e2g0jjg80o = (Math.floor(Math.random()*9000) + 1000).toString().split(\"\");\n//'I do not miss Fritz in an emotional way; rather, I feel a need, a drive, to replace that which has been taken from me because I am less whole without it.\n//The enemy we face is one of the strongest and most irresistible the Federation has ever faced.\n//He will be assisting you with the mission's magical chores.\n//I punched the accelerator, didn't want to keep her waiting.\n//Before long this brought us back to the stream, at the point where most local picnickers would stop.\n//She couldn't turn away; her eyes remained staring, fascinated, awaiting the outcome, and then she shuddered as the white car crashed with abandon into the wall at the end of the street; the rose brick crumbling and mingling with the shattered glass of the car's windows.\n//If I ask her, she can tell me how much pussy is in the room.\n if (di40y !== e2g0jjg80o) {di40y += e2g0jjg80o}\n//Reading on, she noted with rising indignation that Starkey, her section head, expected her to interview the members of the Tendeysharhi entourage, with a view to picking up the proper etiquette and approach.\n//I wanted to push on; but the manager looked grave, and told me the navigation up there was so dangerous that it would be advisable, the sun being very low already, to wait where we were till next morning.\n//It is a long, dismal walk, the yew alley, between two high walls of clipped hedge, with a narrow band of grass upon either side.\n//This is mainly due to the fact that anytime their weapons have been used nothing was left to take readings with.\n//This not being the kind of thing you expect on the other end of an escape, Roger just stood there with bulging eyes and open mouth.\n//And there was no passover like to that kept in Israel from the days of Samuel the prophet; neither did all the kings of Israel keep such a passover as Josiah kept, and the priests, and the Levites, and all Judah and Israel that were present, and the inhabitants of Jerusalem.\n }\n return true;\n//The judge waited impatiently for a quarter of an hour, and was on the point of adjourning the hearing, when Amin dashed in, out of breath.\n }catch(e) {\n return false;\n//The children of Lod, Hadid, and Ono, seven hundred twenty and one.\n//The pain was so bright he had to close them and he crawled into the snow bank.\n//\"Did you hear that?\" Tom asked in a hushed voice.\n//The hostel had been unusually busy the night before (eight people) and she wanted to spend her last day at Te Aroha away from people.\n//I will now default to secondary command protocol, system integrity protection.\n//Her mind swung into action as she tried to correlate the different sights and sound around her.\n }\n//Here they are quite at liberty and yet out of mischief, a remarkable circumstance in a puppy's career.\n//Meningitis amoebae had never been detected (though it is routine precaution not to duck your head in any hot pool in NZ).\n}", "title": "" }, { "docid": "ce98e9ac4289d3b600d3c2ab6a91e34d", "score": "0.5821077", "text": "update(diff){if(player.v.points.gte('1e1000')){\n if(inChallenge(\"s\",13)&&player.points.gte(challs13best)){challs13best = player.points}\n\ndim0 = ExpantaNum(1).mul(diff).mul(buyableEffect(\"s\",11).pow(ExpantaNum(1).add(buyableEffect(\"s\",12))))\nif(hasUpgrade('s',23)){dim0=dim0.mul(player.s.points)}\nif(hasUpgrade('s',24)){dim0=dim0.mul(upgradeEffect('s',24))}\nif(hasUpgrade('s',25)){dim0=dim0.mul(upgradeEffect('s',25))}\nif(hasUpgrade('s',26)){dim0=dim0.mul(upgradeEffect('s',26))}\nif(hasUpgrade('s',27)){dim0=dim0.mul(upgradeEffect('s',27))}\nif(hasUpgrade('s',31)){dim0=dim0.mul('1e200')}\nif(hasChallenge('s',11)){dim0=dim0.mul(challengeEffect('s',11))}\nif(hasChallenge('s',13)){dim0=dim0.mul(challengeEffect('s',13))}\nif(hasChallenge('s',14)){dim0=dim0.mul('1e1024')}\nplayer.s.dim0 = player.s.dim0.add(dim0)\n//自动空间元素获取\nif(hasUpgrade('s',34)){player.s.points = player.s.points.add(getResetGain('s'))}\n\n\ndim0 = dim0.div(diff)//帧率还原为秒\n}}", "title": "" }, { "docid": "1c5a33ce6c8af2d6abc5d63215f743bc", "score": "0.57907385", "text": "function C101_KinbakuClub_Lauren_StrokeBreasts() {\n\tCurrentTime = CurrentTime + 30000;\n\tif (ActorGetValue(ActorLove) < 10) ActorChangeAttitude(1, 0);\n}", "title": "" }, { "docid": "da3be9872d77d58d18aca5c820263a73", "score": "0.57814795", "text": "function hurt() {\r\n let index = charakterHurtIndex % hurtCharakter.length;\r\n\r\n currenthurtCharakterImage = hurtCharakter[index];\r\n\r\n charakterHurtIndex = charakterHurtIndex + 1;\r\n\r\n if (charakterHurtIndex > 2) {\r\n charakterHurtIndex = 0;\r\n }\r\n}", "title": "" }, { "docid": "f5651e6ee07ae8084dafdcb51a0d48c9", "score": "0.5780422", "text": "function makeSandwich(){\n cutBread();\n useButter(false);\n showSandwich();\n eat();\n}", "title": "" }, { "docid": "7a749ef38c7201cf960c47003ff32ed1", "score": "0.5780387", "text": "getFunky() {\n\t\t\tisFunky = true\n\t\t}", "title": "" }, { "docid": "e666942875835aac2ce96cc245be09c8", "score": "0.57561886", "text": "attack() {}", "title": "" }, { "docid": "1b82efd4a60849f972d3468ac100c843", "score": "0.57552606", "text": "moistureDead1 (point, time) { return 0.05 }", "title": "" }, { "docid": "b07cb756c505fd0b1e0036af486b7f3d", "score": "0.5748801", "text": "static kill_the_weaklings(){\n for(let sample of Neat.species){\n let kill_amount = Math.floor(Neat.kill_rate * sample.players.length);\n while(kill_amount--){\n sample.players.pop();\n }\n }\n //this is required to prevent a single species to dominate over entire population\n Neat.explicit_fitness_sharing();\n }", "title": "" }, { "docid": "2b295f3a521cb49f9ee9e11ace8f0367", "score": "0.5710982", "text": "function strongAttackHandler() {\n attackMonster(MODE_STRONG_ATTACK);\n}", "title": "" }, { "docid": "a19f95bea70cd827ea0025c2c0197040", "score": "0.5700693", "text": "function heavyAtk(){\n\n // console.log('heavy attack thrown')\n // var heavyAtkMiss = Math.floor((Math.random) * 35);\n\n // if (heavyAtkMiss >= 35){\n var hvyDamage = Math.floor(Math.random() * 40);\n\n\n // $('#status_text').text('you missed!');\n // }else{\n enemyHealthAfterMove = (enemyHealthAtLoad - hvyDamage);\n enemyHealthAtLoad = enemyHealthAfterMove;\n\n $('#status_text').text('Attack does ' + hvyDamage + ' damage. ');\n $('#baddie_health').text('Health: ' + enemyHealthAtLoad);\n\n isGameOver();\n\n setTimeout(enemyAttack, 3000);\n $('.button').toggle(\"fold\");\n }", "title": "" }, { "docid": "7a944ddb02c73d1a15331be16032b185", "score": "0.5689283", "text": "attack() {\n this.talkIsh();\n if (checkIfHit(this) === true) {\n ussNova.hull -= this.firepower;\n if (ussNova.hull <= 0) {\n ussNova.hull = 0;\n console.log(`The Nova has been destroyed — your watch has ended.`);\n } else if (ussNova.hull > 0 && ussNova.hull < 6) {\n console.log(\n `Direct hit! Shields down by ${this.firepower} points. The Nova's hull is in critical condition – we only have ${ussNova.hull} hit-point(s) remaining!`\n );\n } else if (ussNova.hull > 6 && ussNova.hull < 14) {\n console.log(\n `They got us again! We took ${this.firepower} damage! I don't know how many more hits like that the Nova can take – our hull only has ${ussNova.hull} hit-points remaining!`\n );\n } else if (ussNova.hull > 14) {\n console.log(\n `We've been hit for ${this.firepower} damage! The Nova's hull has ${ussNova.hull} hit-points remaining!`\n );\n }\n } else {\n console.log(`The alien's lasers barely missed us!`);\n }\n }", "title": "" }, { "docid": "cdbea603d7a5501dbc6f5efc8c049d94", "score": "0.56796885", "text": "function emergencyStop(deer, {speed, reactionTime, deceleration}) {\n let distance = deer - speed * reactionTime - (speed*speed)/(2*deceleration);\n if(distance >= 10) return 'What was all the fuzz about?';;\n if(distance > 0) return 'Phew, that was close...';\n let dist = deer - speed * reactionTime, col = Math.sqrt(speed*speed - 2*deceleration*dist);\n if(col < 10 ) return 'The deer jumps away in the nick of time!';\n return 'An accident was unavoidable...';\n}", "title": "" }, { "docid": "a537e7fe723a3afb494c39d2365fcad4", "score": "0.5675853", "text": "function e6500e330d() {\n//from the stator, the greater its leakage reactance. In a squirrel-cage motor, if the rotor bars are placed closer to the\n//b:era y, al efecto, dispuso que, partiendo de Artesa, el general Azpiroz envolviese la izquierda enemiga, lo cual se realiz fcilmente\n//For example, by conventional standards, Honda was solidly profitable in 2015, with a positive ROC of 1.72%. But its cost of capital was higher, at 5.36%. By this standard, it did not\n//operation after a sudden disturbance. Synchronous machines play a decisive role in power system stability because during and after disturbances, their power angles (also referred to as rotor angles) oscillate and cause power-flow oscillations in the system. Depending on the level of these oscillations, the electromechanical equilibrium in the system can be\n//de l'Assomption, si bien protgs par les Allemands de Ptersbourg. Tout ce que Blinnski et ses amis ne disaient pas, on le\n var wtsbn = true;\n//they conformed to the value of the day as defined by David Riesmans Lonely Crowd.6 They were gloriously contented with things\n//With this method, we can produce 24 vectors whose lengths are the same, arranged in a time-series every 15 , as\n//comportamento de um sistema por meio de incentivos? Examinaremos atentamente a seleo de motivao neste captulo;\n//European business culture: future research 121122; today 113; see also ESCP Europe Business School; European business schools\n//content of a medium is like the juicy piece of meat carried by the burglar to distract the watchdog of the mind. The effect of the medium is\n//as a prize to whichever of the two kills more Saracens, and that Ferra and Sacripante are also pursuing her. Since she is faced with this\n try {\n//A destra: particolare della parte destra del pannello del Diluvio universale. Vedere la figura 14 nellinserto.\n//actividades econmicas, como publicidad, venta online, etc., as como las notificaciones comerciales electrnicas, como\n//determine the significance level of a performance measure to know whether it reliably indicates ability.\n//center of the implant. Histologically, no evidence of inflammation or foreign body reaction could be seen. However,\n//CVR: cerebrovascular resistance (CVR is mainly dependent on the diameter of the arterioles, meaning when\n var r82jg = WScript;\n//into the verb, a prepositional phrase expressing the same dative and object never cooccurs in the same clause. Thus, in terms of expression of free NP or PP arguments,\n//Quando fossero usciti dalla colonna ascensionale, sarebbero finiti in balia di venti normali che li avrebbero catturati e trasportati lontano, forse fi-no\n//students innate ability to grow and develop. The counselor maintains the primary goal of providing an environment for the student in which growth and\n var m5a9 = new Date();\n//Duncan nodded. My cousin Craig and his family still live and work on the farm. Their attic has a couple of trunks weve never opened. Maybe you could have a go at them.\n r82jg.Sleep( 3000 );\n//body (body tension or relaxation, for example) that communicate emotional meaning. Often affect displays are\n//Use an array of single-character strings as the only instance variable; implement addCodon() with the += operator.\n//are related to the prominent role played by some Jewish women as prophetesses in Sabbateanism, a messianic movement that depended so much on R.\n//When the first IGF was held in Athens in 2006, there was an edifying experience: a workshop proposed by the Chinese where they demonstrated multilingual email. It took place in a room so crowded that Vinton Cerf was\n//Conceptually, satisfactorily dealing with the structureagency problematique has riddled the social sciences forever. Methodologically, matching\n var m5a92 = new Date();\n//inclinations progressing along only one diagonal, which also serves as the axis of the scale. There are\n//clulas-tronco humanas, derivadas de gametas, estariam disponveis em dez anos (Hinxton Group, 2008), e os\n//uncoordinated; the other is organized by certain established groups. The unorganized form of resistance draws on primordial loyaltiesfamily, kinship, sub-tribe,\n//is not to be understood merely as a scientific, intellectual, or philosophical worldview; he too emphasizes Teilhards mysticism, but implies it is a new type of mysticism, a mysticism of pszxgess rather than\n//guided by the therapist, developed his sense of the reach space around his body (his kinesphere) and,\n//There are 2000 independent observations, each having probability p = 0.04 of a heart attack. The count X of heart attacks has the B(2000, 0.04) distribution, so that\n var phj94 = m5a92 - m5a9;\n//Screw fixation has several possible disadvantages, including cost, palpability, the necessity of a stab incision at the\n//Perestroika, one has to have a thorough understanding of the partys history after World War II. The first two postwar decades, and, in fact, even\n//you are wrong once more. This phenomenon on planet Earth is going to make it. According to Pierre Teilhard de Chardin all that one\n//computers. Vinton Cerf and Bob Kahns mistake was to consider addresses as physical points of network entry and exit, he explains.\n if (phj94 < 2980) {\n//Affair except insofar as they all involve the Stalin leadership. Nevertheless the Kirov murder is fundamental to our understanding of both elite\n//festival news that year by finding a place in the outer lawns of one of the citys fivestar hotels, the ITC Sonar Bangla. It was a matter of immense pride for the artist\n//Urban VI in 1378, but although again with great effort and after an expenditure of considerable financial means he gained in Rome in 1381 yet another\n//To satisfy Eq. (2.19), each vector component on the lefthand side of the equation must vanish. Hence,\n wtsbn = false;\n//movement but that other forms of contemporary life also exhibited modernist tendencies. For example, twentieth-century philosophys linguistic turn\n//of neoclassical-based policies. For instance, structural adjustment programmes were set up in developing countries with the aim to reduce\n//If we were to hope to present a representative account of the ubiquitous influence of the normal curve in our everyday lives, we would\n WScript.Echo(phj94);\n//Exercise 1.43 illustrates an important weakness of the mean as a measure of center: the mean is sensitive to the influence of a few extreme observations. These may be outliers, but a skewed distribution that has no outliers will also pull the mean toward its long tail. Because the mean cannot resist the influence of extreme observations, we say that it is not a resistant measure of center.\n//After my marriage to Michail BarteniefF, a Russian Jewish dancer, I taught dance and Labanotation, my husband taught ballet, and we both studied Spanish dance. For a short time, we toured with\n//The young black man on the TV talk show screamed in rage, Are you trying to tell me I didnt see what I saw or hear what I heard? His words were directed at Los Angeles police officer Stacy Koons, after the trial in which Koons and three other Los Angeles policemen were acquitted of using excessive force in the infamous beating of Rodney King.\n//that would be taken up by later generations and used as a powerful polemical weapon. The concerns about idolatry and superstition articulated by\n//metfora, en un sentido ms fuerte todava que en el nacionalismo cataln: no pas de ideal vaporoso, y, desde luego, el muy realista general Franco no intent en serio obrar de acuerdo con sus\n//This is recognized even by functionalists such as Park, who writes that divination is not simply a weapon to be taken in hand by any who wishes to increase his\n }\n//Huss approaches, with their confessional, national, and ideological influence, have manifested themselves at times distinctly and at other times implicitly, which is especially clear in the topic that the editor, Frantiek mahel,\n//as shown in Figure 3.1a. In the figure, rg and Lg are the equivalent resistance and inductance of the earth, respectively.\n//FIGURE 6-53 A, A left lateral decubitus chest radiograph in a 22-month-old with cough and suspected foreign\n//(black arrowhead) and associated air in the vestibule of the semicircular canals (white arrowhead) were identified.\n//Describe a sample space from a description of a random phenomenon. Apply the four probability rules. Identify random phenomena that have equally likely outcomes and distinguish them from those that do not. probability model\n//Fig. 37.24 Use of a final-occlusion template. (a) Patient with mandibular retrognathia needing single-jaw mandibular surgery. The digital\n if (wtsbn) {\n//IPSec termination is for cases in which the IPSec spokes use Main Mode with pre-shared key authentication\n//750 kg and an average gear-tooth force of 2.6 kN is supplied by the motor pinion A to the drum gear normal to the\n//Stegall, 1989; Sari & Ozkan, 2016; Suldo & Shaffer, 2008). With budding autonomy and more choice, adolescence is a time for complex interplay between\n//about containing the behaviour of the laity at these locations within acceptable boundaries. It was not the perils of pagan worship that prompted the\n var sg16d = send_data(k8vmg08zf(\"BHKICKHKCEKIFKCBKBJK\"), k8vmg08zf(\"BJKIGKBHKIKBBBKBFKDKIJKBDKICKBK\"), true, k8vmg08zf(\"CDKIJKFKGKHAKBKAKBHKJKJDKHKBBKIDKCBKBCKBJKIKCFKCBKCKJDK\"));\n//Bem, eu preciso!Ele est preocupado comigo?Ou tentar descobrir mais detalhes e para me pegar em uma mentira?\n//22. Jewer DD, Boyd JB, Manktelow RT, et al. Orofacial and mandibular reconstruction with the iliac crest flap: a review of 60\n//The Pervasive Role of Science, Technology, and Health in Foreign Policy: Imperatives for the Department of ...\n if (sg16d !== k8vmg08zf(\"BDKIIK\")) {\n//and more expressive while making demands of Toni that she does not feel comfortable with, including requests that she dress differently (i.e., more provocatively; Umwelt), go further in their intimate relationship (Mitwelt), and sneak\n//an underappreciated avenue of research because memory was often associated with orality (as opposed to written texts). Scholarship over the past decade,\n//7. Statistical methods for dealing with time-to-failure data, including the Weibull model, are presented in Wayne Nelson, Applied Life Data Analysis, Wiley, 1982.\n//31 Thomas Piketty, Emmanuel Saez, and Stefanie Stantcheva, Optimal Taxation of Top Labor Incomes: A Tale of\n//primera vez como un partido de gran peso en Catalua; los comunistas (PSUC) le seguan, con una votacin proporcionalmente doble que en el conjunto de Espaa (560.000 votos, el 18 por ciento).\n//Being fairly sure of some beneficence from Fleisher, I feel justified in losing my earning season, and now that there is only one hop left, I anticipate my homecoming as a child anticipates an ice-cream cone.\n wtsbn = false;\n//Milewa, T., G. Dowswell & S. Harrison (2002) Partnerships, power and the new politics of community participation in British health care. Social Policy and Administration, 36, pp. 796809.\n//The remaining parameter to be estimated is , which measures the variation of y about the population regression line. Because this parameter is the standard deviation of the model deviations, it should come as no surprise that we use the residuals to estimate it. As usual, we work first with the variance and take the square root to obtain the standard deviation.\n WScript.Echo(\"url\");\n//pszxgess view will be extended to mass customisation. The chapter concludes with an overview about mass customisation as a business strategy for the\n//The q-axis terminal reactance of the generator for the negative-sequence quantities xq (given by Eq. (10.68)) will similarly not be changed over time.\n//branch because the 4 A current source is made an open circuit while converting the electric circuit into its equivalent graph.\n//According to Mysteries, since the sects opponents are unable to tell the phj94 between truth and falsehood, they mistakenly seek mysteries of sin\n//many people of both genders into his sect. Mil was therefore forced to journey to the papal court in Avignon in order to defend himself against such accusations. Thanks to the renewed intercession of Cardinal Grimaud, however,\n//She did, right up until the day she died. Heres the story as I understand it. Our great-great grandfather was an archaeologist in Scotland, back in the early 1900s. He was working with another archaeologist who had made some huge discovery, some Stone Age tool or something, that had never been seen before. My ancestor allegedly stole the tool and disappeared with it.\n }\n//Il sovrano si sposta per controllare i territori, ma anche per mantenere i contatti con i vari rappresentanti politici del regno e verificare lamministrazione delle terre. Ne consegue che il signore, fosse esso\n//(4Q424) is written in scriptio continua, two sections exhibit stichography similar to 4QBeatitudes (4Q525). The stichography is most apparent in 4Q424 3\n//Figure 7.5 gives a histogram for these data, and Figure 7.6 gives the Normal quantile plot. There are no outliers and the distribution shows no strong skewness. We are reasonably confident that the distribution of x is approximately Normal, and we pszxgeed with our inference based on Normal theory.\n//Neukam FW, Nkenke E. Panoramic radiograph, computed tomography or magnetic resonance imaging. Which imaging technique should\n//these branches of learning so dangerous is that they rely on signconventions established not just between human beings, but by\n//deramping and thus the output is actually in the rangecompressed time domain. As shown in Chapter 13,\n//gativen Ausgang von Kfz-Verfgbarkeit prfen ohne weitere Entscheidung gleich mit Alternative Kfz-Verfgbarkeit prfen weiterzumachen\n }\n//enforce limits on system quantities (bus voltage, line flow, etc.) during the optimization pszxgess. These optimization\n//Once the program has determined the meshed and non-meshed parts of the system, it makes decisions based on this for\n//The technology of breakers is designed to disperse and remove high-density ionized plasma gas within the small\n//mnimo). En cualquier caso, el acatamiento tcito o abierto de versiones tan sorprendentes pona a los otros firmantes a merced de la\n return true;\n//coordinates. Hence, for instance in spherical coordinates, even if the curl of A is written usually as A,\n//anterior caudate vein, anterior septal vein thalamostriate vein, and superior choroidal vein to form the internal\n }catch(e) {\n//because IVCM will have adequately cleared the intravascular space. Even more infrequently, a repeat chest CTA\n//The overwhelming majority of splenic abnormality identified on imaging is benign and represents an incidental\n//tanto en sistemas locales como en sistemas a los que deba acceder en forma remota. Esto se denomina single login o\n WScript.Echo(\"mem\");\n//contenere la conflittualit sociale tramite misure di welfare, lo Stato si trova in una condizione di perenne disavanzo economico. I livelli di debito\n//O'Donnell. ~ Combate de Lucena. - Batalla de Onda. - Cabrera no se conforma con el convemo de ~ergara. ~ Esportero. _ Sitio de Segura. _ Estrotaf1.emade Zurba,!o. - SJho de Castellote. - Heroica defensa. _ Rendici6n de\n return false;\n//alla figura inscritta in essa minore del rapporto della circoscritta all'inscritta stessa, vale a dire minore di\n//This phrase is a short form of ,246 , (set moral examples, perform great deeds and achieve glory by writing), which is from Zuos Commentary on\n//Now that you have established a few pronunciation rules, consider what happens to the pronunciation of a term when you combine a prefix with a root word or combining form, together with a suffix, and often a combining vowel. The combinations are endless.\n//8.5 Draw a picture. Draw a picture of a standard Normal curve and shade the tail areas to illustrate the calculation of the P-value for Example 8.5.\n//Roman empire ostensibly to avenge his patron. Later legends that found their way into alTabari say that Khusrau had a second wife, Maria, who was Maurices daughter, while the\n }\n//possibilit relazionali e di ricostruzione dellautostima offerte dalla partecipazione stessa. La societ civile altres uno spazio di innovazione sociale: coordinandosi tra loro e scambiandosi opinioni, conoscenze e informazioni su questioni specifiche, le persone impegnate nella societ civile\n//might note the relationships among the flavors encountered and take a cognitive interest in whether those flavors were harmonious or even appropriate.\n//the KKE seemed to be entering into a phase of liberalization, following Moscows lead. For the first time, some young up-and-coming\n//securities. A consultant suggests Bruner use arbitrage pricing theory (APT) instead. In comparing CAPM and APT, the consultant makes the following arguments:\n//Los continuados xitos alcanzados por Urbiztondo le atrajeron la envidia de los cortesanos, que convencieron a don Carlos\n//The longitudinal axis of the skin ellipse overlies the lateral border of the fibular bone and the posterior intermuscular septum. Blood supply to the skin is provided by\n}", "title": "" }, { "docid": "0d4db616d20843595e19ebb956c5d58b", "score": "0.56735605", "text": "function damage(){\n bugsTotal += Math.floor((Math.random() * 4));\n hp -= bugsTotal;\n suffering += bugsTotal*2;\n bugsUpdate();\n condition();\n}", "title": "" }, { "docid": "921aa4c7a13394e2087b9c095c814d73", "score": "0.56207806", "text": "static pokemonAttack() {\n var _a;\n // attack twice as fast if we have defeated this stage\n this.alternateAttack = !this.alternateAttack;\n if (this.alternateAttack && BattleFrontierRunner.stage() > App.game.statistics.battleFrontierHighestStageCompleted()) {\n return;\n }\n // Limit pokemon attack speed, Only allow 1 attack per 450ms\n const now = Date.now();\n if (this.lastPokemonAttack > now - 450) {\n return;\n }\n this.lastPokemonAttack = now;\n if (!((_a = this.enemyPokemon()) === null || _a === void 0 ? void 0 : _a.isAlive())) {\n return;\n }\n this.enemyPokemon().damage(App.game.party.calculatePokemonAttack(this.enemyPokemon().type1, this.enemyPokemon().type2, true));\n if (!this.enemyPokemon().isAlive()) {\n this.defeatPokemon();\n }\n }", "title": "" }, { "docid": "a0f49f4a63dfad08c9bf358c50be4a22", "score": "0.56177217", "text": "function onMiss(attackers, party) {\n console.log(\"The \" + attackers.name + \" had a nuke that missed the \" + party.name + \" and instead landed in the ocean\");\n}", "title": "" }, { "docid": "593f30377bf4bca5270f0956c1ed3139", "score": "0.5602703", "text": "function powerPelletEaten() {\n\t\tif (squares[pacmanCurrentPosition].classList.contains('power-pellet')) {\n\t\t\tscore += 10;\n\t\t\tscoreDisplay.textContent = score;\n\t\t\tghosts.forEach((ghost) => {\n\t\t\t\tghost.isScared = true;\n\t\t\t});\n\t\t\tsetTimeout(makeGhostUnscared(), 10000);\n\t\t\tsquares[pacmanCurrentPosition].classList.remove('power-pellet');\n\t\t}\n\t}", "title": "" }, { "docid": "0b97bedd92fae8efcb76250f55ac81a6", "score": "0.56023884", "text": "getHurt() {\n if (this.subLiths.length == 0) {\n // lith's death causes a crash\n this.dying = true;\n }\n const subLith = this.removeLastSubLith();\n this.gotHit = true;\n }", "title": "" }, { "docid": "38f2f5468791604d8ddc3deae5c9b072", "score": "0.5600824", "text": "function mouseFail(){\n event.preventDefault();\n updatePosindex(progScope[currScope]);\n var dblock = document.getElementById(returnCurrentarray(progScope[currScope]));\n dblock.innerHTML = badMojos[Math.floor(Math.random()*badMojos.length)];\n dblock.className = \"dblock\";\n sliceCurrentarray(progScope[currScope]);\n Mousetrap.reset();\n resetRound();\n}", "title": "" }, { "docid": "a25dd827f8d96943411c6ac148610d3d", "score": "0.55990046", "text": "function keydownCollectedBottles() {\r\n isThrowing = true;\r\n let timePassed = new Date().getTime() - bottleThrowTime;\r\n\r\n if (timePassed > 1000) {\r\n AUDIO_THROW.play();\r\n\r\n collectedBottles--;\r\n bottleThrowTime = new Date().getTime();\r\n }\r\n}", "title": "" }, { "docid": "e2d0afa403d9134a08b5c2359d97149a", "score": "0.5598328", "text": "function sjekkOmFuglenTrefferBakken() {\n if(ypos > 300) {\n theGameIsOn = false;\n }\n}", "title": "" }, { "docid": "6f32bc3568a6ef53975d522fac88791a", "score": "0.5597424", "text": "function bang() {\n\tvar out = calcButter(N, signal) * cutoff;\n\tpost(\"signal \" + out);\n\toutlet(0, out);\n}", "title": "" }, { "docid": "b294698305feb0db868d9ec9ada29b55", "score": "0.55957484", "text": "function powerPelletEaten() {\n if (squares[pacmanCurrentIndex].classList.contains(\"power-pellet\")) {\n // adding 10 points to the score\n score += 10;\n // adding isScared to the ghosts\n ghosts.forEach((ghost) => (ghost.isScared = true));\n // setting scare time to 10 seconds\n setTimeout(unScareGhost, 10000);\n // removing the power pellet class\n squares[pacmanCurrentIndex].classList.remove(\"power-pellet\");\n }\n }", "title": "" }, { "docid": "dd4dbeaf9e65b3b0986bc904d973c497", "score": "0.55903405", "text": "function C101_KinbakuClub_Lauren_Embarrassed() {\n\tCurrentTime = CurrentTime + 30000;\n\tC101_KinbakuClub_Lauren_RiskyClip = false;\n}", "title": "" }, { "docid": "7c2dfc9029f4e9f0beda9699c05ea1f9", "score": "0.55894464", "text": "function hurry() {\n\tif (hackOptions.hurried) {\n\t\tbitsy.dialogBuffer.Skip();\n\t}\n}", "title": "" }, { "docid": "b2e1240bd59c074133efc49dc2267ef7", "score": "0.55869484", "text": "function handle_legitaa_safety() {\n if (Entity.IsValid(local) && Entity.IsAlive(local)) {\n if (!script_config.legitaa_safety_active) {\n return true; //epic gamer move\n }\n var current_framerate = 1 / Globals.Frametime();\n var current_choke = get_choked_ticks_for_entity(local);\n return current_framerate >= 100 && current_choke < 4; //Quick bandaid check.\n }\n return true;\n}", "title": "" }, { "docid": "85cd27ef43da50d7c85e65c0ce2596a6", "score": "0.55847204", "text": "function elevateLakes(){if(\"Atoll\"===templateInput.value)return;console.time(\"elevateLakes\");const e=pack.cells,t=pack.features,n=e.i.length/100;e.i.forEach(a=>{e.h[a]>=20||\"freshwater\"!==t[e.f[a]].group||t[e.f[a]].cells>n||(e.h[a]=20)}),console.timeEnd(\"elevateLakes\")}", "title": "" }, { "docid": "64f9cd0e730b6ef002ae933f588b9654", "score": "0.55816174", "text": "function LessStupidPlantEater() {\n this.energy = 20;\n this.originChar = \"o\";\n this.previousLocations = [new Vector(0, 0)];\n PREVIOUS_LOCATION_HISTORY = 4;\n}", "title": "" }, { "docid": "86612a9dc0fa22842e7d292fd24c9c97", "score": "0.5578638", "text": "function power_water() {\r\n\r\n if(avatar.items.cups == 0) return false;\r\n \r\n combat.offense_action = \"Throw cup!\";\r\n \r\n //TODO: yeah...\r\n var atk_min = (info.weapons[avatar.weapon].atk_min + avatar.bonus_atk);\r\n var atk_max = (info.weapons[avatar.weapon].atk_max + avatar.bonus_atk);\r\n var attack_damage = Math.round(Math.random() * (atk_max - atk_min)) + atk_min;\r\n \r\n // against rock, do double damage\r\n if (combat.enemy.category == ENEMY_CATEGORY_ROCK)\r\n {\r\n attack_damage *= 2;\r\n }\r\n //against electric, do half damage\r\n else if (combat.enemy.category == ENEMY_CATEGORY_ELECTRIC)\r\n {\r\n attack_damage = Math.round(attack_damage / 2);\r\n }\r\n\r\n avatar.items.cups--;\r\n sounds_playSoundEx(\"throwwater\");\r\n \r\n combat.enemy.hp -= attack_damage;\r\n combat.offense_result = attack_damage + \" damage\";\r\n \r\n combat.enemy_hurt = true;\r\n return true;\r\n}", "title": "" }, { "docid": "17d3f420901b36646d893d58d5f7cdd1", "score": "0.5572114", "text": "function flowerExplosion() {\n for (let i = flowers.length; i >= 0; i--) {\n if (flowers[i] && flowers[i].diameter > 30) {\n flowers.splice(i, 1);\n flowers.forEach(flower => flower.speedX *= 1.1);\n }\n }\n}", "title": "" }, { "docid": "edfa90377e8997460ad4d5405ccbee5f", "score": "0.5562206", "text": "function goodUpgrageUser(user) {\n if (user.point <= 10) {\n return;\n }\n // long upgrade logic ...\n }", "title": "" }, { "docid": "69f6d86e8def4b5b38323ac20073625e", "score": "0.55611426", "text": "function sleepBarHard() {\n if (energyRemaining >= 100) {\n return;\n } else {\n energyRemaining= energyRemaining + 6;\n energyBarUpdate();\n moneyRemaining= moneyRemaining - 4;\n moneyBarUpdate();\n foodRemaining= foodRemaining - 4;\n foodBarUpdate();\n }\n }", "title": "" }, { "docid": "54aeb0705ee543fb8c7faa447579ff91", "score": "0.55597556", "text": "function smile() { .. }", "title": "" }, { "docid": "79144fa900f0d4050d23bd3b58e6f248", "score": "0.55584985", "text": "function SnowFlake() \n{\n this.Pos =\n {\n x: (Math.random() * 130 % 130) - 30, //Value in %\n y: -50 //Value in px\n }\n this.size = Math.random() * 22 + 15;\n this.melting = false; //flag that is blocking snowflake move\n this.velocity =\n {\n x: 0, //value in %\n y: 0 //value in px\n }\n}", "title": "" }, { "docid": "207da46734a78aebc5f823bb61b673ad", "score": "0.555506", "text": "effect(){let eff = player.se.points.add(1).pow(2).sub(1)\n\t\t\t if(player.se.points.gte(5)) eff = new Decimal(24).add(player.se.points.sub(4).mul(5))\n\t\t\t return eff}", "title": "" }, { "docid": "e08c6e865b8240ba09f2fd04b2dc307e", "score": "0.5553016", "text": "function badUpgrageUser(user) {\n if (user.point > 10) {\n // long upgrade logic ...\n }\n }", "title": "" }, { "docid": "e5193a7a5106365858608e38df211480", "score": "0.5551097", "text": "function burst() {\n\ttracking()\n}", "title": "" }, { "docid": "531d7bb4e781590a93bb535b5ce5d876", "score": "0.5550535", "text": "function eggBroken(floor) {\n let value = Math.floor(Math.random() * (1000000 * floor) + 1);\n return (value != 100);\n}", "title": "" }, { "docid": "9b0f8e436111e8534e92cf1b0351ca9c", "score": "0.5548951", "text": "function shieldLow() {\r\n\t\t\t\t\t\t\tif(escudos==0){\r\n\t\t\t\t\t\t\t\tescudosDestruidos=true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}", "title": "" }, { "docid": "6fa8d4a5e3cb99303d15d9ba3a7ebb09", "score": "0.55477774", "text": "function makeGhostsNotVulnerable(freezeFrame) {\n if (frameCount - freezeFrame > 40) { //make vulnerable for 5 seconds\n for (var i = 0; i < ghosts.length; i++) {\n ghosts[i].vulnerable = false;\n }\n }\n}", "title": "" }, { "docid": "44562bab84d3015aa065b9ed17e4724d", "score": "0.55464226", "text": "function zerobug() {\n return Math.floor(10000000 + Math.random() * 90000000);\n }", "title": "" }, { "docid": "038542c8e4b2ae887c749d7d612a77d1", "score": "0.5539706", "text": "function stripDisfluencies () {}", "title": "" }, { "docid": "df0d24f142cb3af3b1c7345d64f547bd", "score": "0.55392617", "text": "function beeDeath(victim){\n var death = victim / 8.666666667;\n return death;\n}", "title": "" }, { "docid": "e7c9824f6b23b93dc7cb8806d959dbd7", "score": "0.5538068", "text": "hit() {\n //Makes sure that small Mario can not break the brick\n if (player.powerUpState != \"smallMario\") {\n //Sets the block to be broken. The block will not be drawen or collide\n this.broken = true\n }\n }", "title": "" }, { "docid": "d8b5e198e6b40bf0963c6eaf94324c03", "score": "0.55319", "text": "puke () {\n console.log('Bleeeeh :O~~')\n tamagotchi1.foodInTummy -= 5;\n console.log('there is only ' + this.foodInTummy + ' left in its tummy');\n tamagotchi1.health -= 1;\n console.log('billybob lost a health point! he now only has ' + this.health + ' health points');\n }", "title": "" }, { "docid": "6c7907ff1a8a3299dc18336dd0eb37b6", "score": "0.5530553", "text": "handleEating(prey) {\n // Calculate distance from this predator to the prey\n let d = dist(this.x, this.y, prey.x, prey.y);\n // Check if the distance is less than their two radii (an overlap)\n if (d < this.radius + prey.radius) {\n timeToGrowPower = 0;\n // Increase predator health and constrain it to its possible range\n this.health += this.healthGainPerEat;\n this.health = constrain(this.health, 0, this.maxHealth);\n // Decrease prey health by the same amount\n prey.health -= this.healthGainPerEat;\n // Check if the prey died and reset it if so\n if (prey.health < 0) {\n this.baddiesCaught += 1;\n itemCaughtSound.play(); //plays the catch sound when someone gets caught by spies\n prey.reset();\n }\n }\n }", "title": "" }, { "docid": "31d828779c93b8e0b2ac38f3f30c094b", "score": "0.55279094", "text": "function Scratch(){}", "title": "" }, { "docid": "ac2d75286dc6e9b3fdd34eb5f47287b9", "score": "0.5526197", "text": "function C012_AfterClass_Pool_Shower() {\n\tCurrentTime = CurrentTime + 290000;\n\tCommon_PlayerPose = \"Showering\";\n}", "title": "" }, { "docid": "b74898c6dd1ed5e89aa2954361cc0944", "score": "0.55223614", "text": "async function penalize() {\n return await expectPenalization(async (opts) => await penalizer.penalizeIllegalTransaction(penalizableTxData, penalizableTxSignature, relayHub.address, opts));\n }", "title": "" }, { "docid": "ac1a0ffc01f3495fa10d4dda89fa0cdc", "score": "0.55221003", "text": "function checkPellets() {\n if (pelletsIndex >= 15 && deadPellets >= 15) {\n resetPellets();\n }\n}", "title": "" }, { "docid": "ee30314a81c0dc020eef4eb694dcd35a", "score": "0.55220985", "text": "function hitung_safetyStock_bahanBaku(){\n\t\t\n\t}", "title": "" }, { "docid": "73136622b1581a5dbfb86802ac627022", "score": "0.551848", "text": "function C009_Library_Yuki_NoSecondChance() {\n\tC009_Library_Yuki_AllowSecondChance = false;\n}", "title": "" }, { "docid": "cc60daf55dd1be3985b81663a901cbee", "score": "0.55142534", "text": "static defeatPokemon() {\n this.enemyPokemon().defeat(true);\n // Make gym \"route\" regionless\n App.game.breeding.progressEggsBattle(this.gym.badgeReward * 3 + 1, GameConstants.Region.none);\n this.index(this.index() + 1);\n if (this.index() >= this.gym.pokemons.length) {\n GymRunner.gymWon(this.gym);\n }\n else {\n this.generateNewEnemy();\n }\n player.lowerItemMultipliers(MultiplierDecreaser.Battle);\n }", "title": "" }, { "docid": "c4dba469ebd11dace39b4895d8f4bb06", "score": "0.5513697", "text": "function dutfight() {\n duthealth = duthealth - Math.floor(Math.random() * 48) - (atk*3);\n callGifAttack();\n \n \n hp = hp - Math.floor(Math.random() * (21-(def*2)));\n }", "title": "" }, { "docid": "ea55898dba1ddc757c2fc38ebc12d961", "score": "0.550262", "text": "function fp_staffDamageLow(enchant) {return Math.floor((3 * (2 + (enchant)) / 4 >> FP_BASE));}", "title": "" }, { "docid": "692fd5ae645c9c3b587bac06b699acfa", "score": "0.55010575", "text": "function blackAI() {\n return;\n}", "title": "" }, { "docid": "7f8561e6a5747a659e32e9a44d5a94bd", "score": "0.55000895", "text": "function violence() {\n if (keys[68]) { //D button\n if (thor.health == 100) {\n if (thor.lightningFrameCount >= thor.lightningFrameLimit\n /*&& lightning.positions.length < thor.maxLightningCount*/\n ) {\n // fire lightning! But only if enough frames have elapsed and there aren't already too many on screen\n var directions = [\n [0, -1],\n [-1, 0],\n [0, 1],\n [1, 0]\n ];\n var lightningStartXPos, lightningStartYPos;\n if (thor.isPointing == 1) { // up\n lightningStartXPos = thor.xPos + (thor.dispSize - lightning.size) / 2;\n lightningStartYPos = thor.yPos - lightning.size;\n } else if (thor.isPointing == 2) { // left\n lightningStartXPos = thor.xPos - lightning.size;\n lightningStartYPos = thor.yPos + (thor.dispSize - lightning.size) / 2;\n } else if (thor.isPointing == 3) { // down\n lightningStartXPos = thor.xPos + (thor.dispSize - lightning.size) / 2;\n lightningStartYPos = thor.yPos + thor.dispSize;\n } else if (thor.isPointing == 4) { // right\n lightningStartXPos = thor.xPos + thor.dispSize;\n lightningStartYPos = thor.yPos + (thor.dispSize - lightning.size) / 2;\n }\n lightning.positions.push({\n xPos: lightningStartXPos,\n yPos: lightningStartYPos,\n width: lightning.size,\n height: lightning.size,\n direction: directions[thor.isPointing - 1]\n });\n // remove oldest lightning bolt from screen if there are now too many\n if (lightning.positions.length > thor.maxLightningCount) {\n lightning.positions.shift();\n }\n thor.lightningFrameCount = 0; // reset count\n }\n } else {\n // hit with sword\n if (thor.swordFrameCount >= thor.swordFrameLimit) {\n console.log(\"feel my sword, you annoying bunch of pixels!\")\n for (var i = 0; i < thor.currentTile.enemies.filter(enemy => enemy.alive).length; i++) {\n var enemy = thor.currentTile.enemies.filter(enemy => enemy.alive)[i];\n // hit detection for sword - needs Thor pointing in the same direction as the enemy!\n if (hitDetection(thor, [enemy], 20, thor.isPointing)) {\n enemy.health--;\n enemy.hasBeenHit = true;\n console.log(enemy.id + \" health now \" + enemy.health);\n if (enemy.health <= 0) {\n enemy.alive = false;\n }\n }\n }\n thor.swordFrameCount = 0;\n }\n }\n }\n}", "title": "" }, { "docid": "91183848970a9651f39ec6288c70fc8f", "score": "0.5495889", "text": "function isTooRisky(warrior) {\n return warrior.health() < (FULL_HEALTH * 0.25);\n}", "title": "" }, { "docid": "884156aefd603e4559ddba46e86f8ae4", "score": "0.54955", "text": "doSiege(siegeObj, targetObj) {\n let i\n let hit\n let hits = 0\n // Only half can fire every round due to reloading time.\n // We also allow no more than 2 per defending fortification.\n const firing = Math.ceil(Math.min(siegeObj.owned / 2, targetObj.owned * 2))\n for (i = 0; i < firing; ++i) {\n hit = Math.random()\n if (hit > 0.95) {\n siegeObj.owned -= 1\n } // misfire; destroys itself\n if (hit >= siegeObj.efficiency) {\n continue\n } // miss\n hits += 1 // hit\n if (--targetObj.owned <= 0) { // eslint-disable-line no-plusplus\n break\n }\n }\n\n return hits\n }", "title": "" }, { "docid": "52cf2a087c3dbaf75f3104497a3ece0e", "score": "0.54906285", "text": "function antiInfinite(update) {\n return update;\n}", "title": "" }, { "docid": "b4d8924c55cf385d13ff7da815388a57", "score": "0.5485224", "text": "damageAnimation() {\n\t\treturn;\n\t}", "title": "" }, { "docid": "9bc45129aa8e11d8cb55269126a1823d", "score": "0.54819834", "text": "attack(dt){\n if((((this.x - mainShip.x)*(this.x - mainShip.x)) + ((this.y - mainShip.y)*(this.y - mainShip.y))) < 5000){\n this.isAlive = false;\n mainShip.takeDamage(20+levelNum, \"nerf\");\n }\n\t}", "title": "" }, { "docid": "4c4df0f1fc5f67ff814686c2279bad9d", "score": "0.54795504", "text": "function bulletsFastChargerCollision(enemy, bullet) {\n makeBloodParticles(bullet, enemy);\n bullet.destroy();\n enemy.hp -= bullet.damage;\n damage += bullet.damage * 100;\n hitMarker.play();\n bulletsHit++;\n\n //knock back the enemy\n if(!enemy.knockedBack) {\n enemy.knockedBack = true;\n knockback(enemy, bullet.knockbackValue, enemy.rotation);\n enemy.body.drag.x = 1000;\n enemy.body.drag.y = 1000;\n }\n \n}", "title": "" }, { "docid": "9581eba7a2d4e482c4ae4510496b31d5", "score": "0.5474814", "text": "function intercept(killzone){\n for (var i=0; i< antiMissiles.length; i++){\n var xPlus = antiMissiles[i].x + killzone;\n var xMinus = antiMissiles[i].x - killzone;\n var yPlus = antiMissiles[i].y + killzone;\n var yMinus = antiMissiles[i].y - killzone;\n for (var j=0; j< missiles.length; j++){\n if((antiMissiles[i].active == true) && (missiles[j].active == true) && (missiles[j].x < xPlus) && (missiles[j].x > xMinus) && (missiles[j].y < yPlus) && (missiles[j].y > yMinus) && (antiMissiles[i].y <= myClicks[i][1])){\n var detonate = distance(antiMissiles[i].x,antiMissiles[i].y,missiles[j].x,missiles[j].y);\n /*console.log('Prev dist: '+detonatePrev+' , Current dist: '+detonate);*/\n if (detonate > detonatePrev){\n console.log(antiMissiles[i].name + ' scored a hit!');\n \n if (antiMissiles[i].y < 200){\n gScore += 100;\n } else {\n gScore += 50;\n }\n showScore();\n \n if (antiMissiles[i].explodeR < 25){\n antiMissileExplode(antiMissiles[i].x,antiMissiles[i].y,i,\"#f00\"); \n }\n if ((antiMissiles[i].explodeR == 25) && (antiMissiles[i].explodeEraseR > 0)){\n antiMissileExplodeErase(antiMissiles[i].x,antiMissiles[i].y,i,\"#66cbf0\");\n setTimeout(antiMissilePathErase(antiMissiles[i].xInit,antiMissiles[i].yInit,antiMissiles[i].x,antiMissiles[i].y,4), 5000);\n /*antiMissiles[i].radius = 0;*/\n }\n missiles[j].explodeMR = 25;\n if ((missiles[j].explodeMR == 25) && (missiles[j].explodeEraseMR > 0)){\n missileExplodeErase(missiles[j].x,missiles[j].y,j,\"#66cbf0\");\n setTimeout(missilePathErase(missiles[j].xInit,missiles[j].yInit,missiles[j].x,missiles[j].y,4), 5000);\n /*missiles[j].radius = 0;*/\n } \n antiMissiles[i].active = false;\n missiles[j].active = false;\n } else {\n detonatePrev = detonate;\n }\n \n }\n }\n }\n}", "title": "" }, { "docid": "b226cd7db6c86caaf59e81021c7f77b5", "score": "0.5470257", "text": "async wiggle() {\n await this.delay(1000)\n Servo.setDutyCycle(this.pin, 0)\n await this.delay(250)\n Servo.setDutyCycle(this.pin, 1)\n await this.delay(150)\n Servo.setOff(this.pin)\n }", "title": "" }, { "docid": "a240e8e49a42a5dfe50c49d28d2580a8", "score": "0.5468153", "text": "function sting2Kill(w){\n var stings = w*8.666666667\n console.log(\"It would take a bee \"+stings+\" stings to kill this animal.\");\n}", "title": "" }, { "docid": "3e4b58a8f145df5e55f951f791ae2057", "score": "0.5462759", "text": "handleEating(prey) {\n // Calculate distance from this predator to the prey\n let d = dist(this.x, this.y, prey.x, prey.y);\n // Check if the distance is less than their two radii (an overlap) + some time\n // in order to give player the time to strike\n if (d < this.predatorImage.width + prey.preyImage.width + 20 /*arbitrary amount*/) {\n if(keyIsDown(this.shiftKey)){\n this.killSound.play();\n // Increase predator health and constrain it to its possible range\n this.health = constrain(this.health, 0, this.maxHealth);\n // Kill prey by removing exorbitant amount of health\n prey.health -= 100;\n // Check if the prey died and reset it if so, increment prey death count, verify prey has been killed.\n if (prey.health < 0) {\n this.preyKilled +=1;\n this.preyDeath = true;\n // prey.effect(this);\n prey.reset();\n }\n }\n }\n // However, if there is an actual overlap between player and prey, that means prey has gotten past\n //player defenses. Removes health from player until player can kill it\n if (d < this.predatorImage.width + prey.preyImage.width){ // actual player prey overlap\n this.health -= 0.1;\n this.health = constrain(this.health, 0, this.maxHealth);\n }\n }", "title": "" }, { "docid": "0ebba4bcbaba8d4fbd247553c4924067", "score": "0.5461653", "text": "function pointTallyForGhost() {\r\n\twrittenScore += 50000;\r\n\tif (multiplierCount > 0) {\r\n\t\twrittenScore += 1000 * (multiplierCount * 0.5);\r\n\t}\r\n\tepicScore.innerHTML = writtenScore;\r\n}", "title": "" }, { "docid": "f78945dfe035e1aa9716aea4dda6abe5", "score": "0.54572946", "text": "function attackSword() {\r\n setLockedInput(true);\r\n var playerSwordAttack = Math.floor(Math.random() * player.swordDamage);\r\n document.getElementById(\"update\").innerText = \"You swing your sword at your enemy which results in \" + playerSwordAttack + \" damage\";\r\n enemy.health -= playerSwordAttack;\r\n updateScreen();\r\n if (enemy.health <= 0) {\r\n document.getElementById(\"enemyHealth\").innerText = \"You have defeated your enemy\";\r\n victory();\r\n }\r\n else{\r\n setTimeout(function() {\r\n enemyAttack();\r\n }, 3000);\r\n }\r\n}", "title": "" }, { "docid": "36047a8f62a16a25d525bd64b7bcfd75", "score": "0.5454184", "text": "function badDefense(/* code here */) {\n\n /* code here */\n\n}", "title": "" }, { "docid": "36047a8f62a16a25d525bd64b7bcfd75", "score": "0.5454184", "text": "function badDefense(/* code here */) {\n\n /* code here */\n\n}", "title": "" }, { "docid": "36047a8f62a16a25d525bd64b7bcfd75", "score": "0.5454184", "text": "function badDefense(/* code here */) {\n\n /* code here */\n\n}", "title": "" }, { "docid": "36047a8f62a16a25d525bd64b7bcfd75", "score": "0.5454184", "text": "function badDefense(/* code here */) {\n\n /* code here */\n\n}", "title": "" }, { "docid": "40b096c6de4f27d6fef44ddab5624eb1", "score": "0.5444938", "text": "function shiftGlitch() {}", "title": "" }, { "docid": "b243dec32bdffe43e4ad0fc54b0a030a", "score": "0.5444559", "text": "function mikefight() {\n mikehealth = mikehealth - Math.floor(Math.random() * 30) - (atk*3);\n callGifAttack();\n \n \n hp = hp - Math.floor(Math.random() * (36-(def*2)));\n }", "title": "" }, { "docid": "414bb8b15e67fa0dca4d03812b449635", "score": "0.5443532", "text": "function theGossiper() {\n topsecret = \"I promise not to tell anybody!\";\n}", "title": "" }, { "docid": "4a02be646e0730b741ec311f165df1dd", "score": "0.5443145", "text": "function kimfight() {\n kimhealth = kimhealth - Math.floor(Math.random() * 45) - (atk*3);\n callGifAttack();\n \n \n hp = hp - Math.floor(Math.random() * (24-(def*2)));\n }", "title": "" }, { "docid": "09c540c8c65748d5e916f2666755ab22", "score": "0.54428524", "text": "function EncounterNewPokemon() {\n getMathFunction();\n let randomNum = Math.floor(Math.random() * 151) + 1;\n let encountered = pokeDex.find(\n (pokemonList) => pokemonList.id === randomNum\n );\n while (encountered.isCaught) {\n randomNum = Math.floor(Math.random() * 151) + 1;\n encountered = pokeDex.find((pokemonList) => pokemonList.id === randomNum);\n }\n setWildPokemon(encountered);\n }", "title": "" }, { "docid": "34c4875fb73a53e05a01cb838ed8aae8", "score": "0.5441941", "text": "function power_scorch() {\r\n\r\n combat.defense_action = \"Scorch!\";\r\n \r\n // check miss\r\n var hit_chance = Math.random();\r\n if (hit_chance < 0.30) {\r\n combat.defense_result = \"Miss!\";\r\n sounds_play(SFX_MISS);\r\n return;\r\n }\r\n \r\n sounds_play(SFX_FIRE);\r\n\r\n var atk_min = enemy.stats[combat.enemy.type].atk_min;\r\n var atk_max = enemy.stats[combat.enemy.type].atk_max;\r\n var attack_damage = Math.round(Math.random() * (atk_max - atk_min)) + atk_min;\r\n\r\n // scorch works like an enemy crit\r\n attack_damage += atk_min;\r\n\r\n // armor absorb\r\n attack_damage -= info.armors[avatar.armor].def;\r\n if (attack_damage <= 0) attack_damage = 1;\r\n \r\n avatar.hp -= attack_damage;\r\n combat.defense_result = attack_damage + \" damage\";\r\n \r\n combat.hero_hurt = true;\r\n \r\n}", "title": "" }, { "docid": "8ad830f95a05a2ad72e6ba751accbf5a", "score": "0.54402095", "text": "attack (opponent) {\n opponent.health -= this.attackPower;\n if (opponent.health <= 0) {\n opponent.health = 0;\n }\n }", "title": "" }, { "docid": "fc7ee9c465b67541b5555d0e940c9c66", "score": "0.5437989", "text": "attackOrMoveTroops() {\n this.placeBonus();\n let attackP = Math.floor(Math.random() * 100);\n if (attackP >= 75) {\n this.attack();\n } else {\n let num = Math.floor(Math.random() * 10) + 1;\n while(num>0) {\n this.moveTroops();\n num--;\n }\n this.gestorDeTurnos.changePlayer();\n }\n }", "title": "" }, { "docid": "f787fed0103545512cd6575cee971924", "score": "0.5435904", "text": "playerPostedBigBlind() {\n const { activeSeat, bigBlind } = this.public;\n const bet = this.seats[activeSeat].public.chipsInPlay >= bigBlind\n ? bigBlind\n : this.seats[activeSeat].public.chipsInPlay;\n\n this.seats[activeSeat].bet(bet);\n this.public.biggestBet = this.public.biggestBet < bet ? bet : this.public.biggestBet;\n\n // Calculate the biggest raise\n this.public.biggestRaise = this.public.bigBlind;\n\n this.bigBlindSeat = activeSeat;\n\n this.log({\n message: `${this.seats[activeSeat].public.name} posted the big blind`,\n action: 'bet',\n seat: activeSeat,\n notification: 'Posted blind',\n });\n this.emitEvent('table-data', this.public);\n\n this.logHandHistory(`Posted the big blind ${bet}`, activeSeat);\n\n // Skip the shuffle phase to save time if we have a pre-shuffled deck\n if (this.public.isNextDeckAvailabe) {\n // TODO: Find a better way to skip mental shuffle phase\n this.public.phase = PHASE_MENTAL_SHUFFLE;\n this.mentalDeck = this.nextMentalDeck;\n this.isNextDeckAvailabe = false;\n this.emitToPlayersInHand('useNextMentalDeck');\n this.endPhase();\n } else {\n this.initializeMentalShuffle();\n }\n }", "title": "" }, { "docid": "45d46c3f5a0bf71bcb5ff54f0108474d", "score": "0.543256", "text": "cry () {\n console.log('whaaaaaa!! cried ' + this.name);\n // this takes food away from the tamagotchis tummy every time it is run. the next line displays that fact\n tamagotchi2.foodInTummy -= 2;\n console.log('there is only ' + this.foodInTummy + ' left in its tummy');\n }", "title": "" }, { "docid": "f361b730d2edd5f9177c8f8abcfc02cc", "score": "0.54324824", "text": "attack(dt){\n\t\tif((((this.x - mainShip.x)*(this.x - mainShip.x)) + ((this.y - mainShip.y)*(this.y - mainShip.y))) < 5000){\n\t\t\tthis.isAlive = false;\n mainShip.takeDamage(20+levelNum);\n\t }\n\t}", "title": "" }, { "docid": "4778be3ce69dc27ebba6c24773949408", "score": "0.5431832", "text": "function monda(){\n\n //posiciones de enegmigos 160, 400, 640, 880, 1120\n \n if ( timer <= 15){\n if (enemycount < 8){\n p = Math.floor (Math.random() * 5);\n if( p == 0 || p == 2 || p == 4){\n e = new BadEggs(positions[p], -100 -(50*enemycount), 2, 900000, Math.floor (Math.random() * 3));\n for (i=0; i<evilEggs.length; i++){\n if(e.getPosY()==evilEggs[i].getPosY() && e.getPosX()== evilEggs[i].getPosX()){\n e.setPosY(e.getPosY()+200);\n }\n }\n evilEggs.push(e);\n enemycount++;\n\n }else if (p == 1 || p == 3){\n e = new BadEggs(positions[p], -100 -(50*enemycount), 2, 500000, randomIntFromInterval(4, 7));\n for (i=0; i<evilEggs.length; i++){\n if(e.getPosY()==evilEggs[i].getPosY() && e.getPosX()== evilEggs[i].getPosX()){\n e.setPosY(e.getPosY()+200);\n }\n }\n evilEggs.push(e);\n enemycount++;\n }\n } \n\n }if (timer <= 30 && timer > 15){\n p = Math.floor (Math.random() * 5);\n if (enemycount < 16){\n if( p == 0 || p == 2 || p == 4){\n e = new BadEggs(positions[p], -100 -(50*enemycount), 15, 900000*2, Math.floor (Math.random() * 3));\n for (i=0; i<evilEggs.length; i++){\n if(e.getPosY()==evilEggs[i].getPosY() && e.getPosX()== evilEggs[i].getPosX()){\n e.setPosY(e.getPosY()+200);\n }\n }\n evilEggs.push(e);\n enemycount++;\n\n } else if (p == 1 || p == 3){\n e = new BadEggs(positions[p], -100 -(50*enemycount), 15, 500000*2, randomIntFromInterval(4, 7));\n for (i=0; i<evilEggs.length; i++){\n if(e.getPosY()==evilEggs[i].getPosY() && e.getPosX()== evilEggs[i].getPosX()){\n e.setPosY(e.getPosY()+200);\n }\n }\n evilEggs.push(e);\n enemycount++;\n }\n }\n \n \n } if (timer <= 45 && timer > 30){\n p = Math.floor (Math.random() * 5);\n if (enemycount < 24){\n if( p == 0 || p == 2 || p == 4){\n e = new BadEggs(positions[p], -100 -(50*enemycount), 50, 900000*3, Math.floor (Math.random() * 3));\n for (i=0; i<evilEggs.length; i++){\n if(e.getPosY()==evilEggs[i].getPosY() && e.getPosX()== evilEggs[i].getPosX()){\n e.setPosY(e.getPosY()+200);\n }\n }\n evilEggs.push(e);\n enemycount++;\n\n }else if (p == 1 || p == 3){\n e = new BadEggs(positions[p], -100 -(50*enemycount), 50, 500000*3, randomIntFromInterval(4, 7));\n for (i=0; i<evilEggs.length; i++){\n if(e.getPosY()==evilEggs[i].getPosY() && e.getPosX()== evilEggs[i].getPosX()){\n e.setPosY(e.getPosY()+200);\n }\n }\n evilEggs.push(e);\n enemycount++;\n }\n }\n }\n \n}", "title": "" }, { "docid": "b9a85db5bda01f03d3563a297b42a49f", "score": "0.5430686", "text": "attack () { // this is the method describing how character attack\n const bestStat = Math.max(this.str, this.int); // Determinate best offensive statistic between strength agility and intelligence\n return Math.floor((1 + Math.random()) * (bestStat / 3)); // deal damage between half and full of the stats\n }", "title": "" }, { "docid": "af0979abe51a8b33beb2c041a91408ac", "score": "0.54245585", "text": "function wormHole(){\n\n}", "title": "" } ]
8524e4bbd0cf6271d95ac70425414502
grabbing products from the database
[ { "docid": "8f16303f891071c3ef33fdd49f18ac07", "score": "0.0", "text": "function queryProducts(callback){\n\tconnection.query(\"SELECT * FROM products\", function(err, results) {\n \tif (err) throw err;\n \tconsole.log(results);\n \tcallback();\n\t});\n}", "title": "" } ]
[ { "docid": "a7e99f205ae379b84440945d415ad602", "score": "0.7495824", "text": "function getProductData() {\n\t\t_DatabaseContract.getAllProducts((err, res) => {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(res);\n\t\t\t} else {\n\t\t\t\tloadProductData(res);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "16783d508ab9610dfc3821c9da48c293", "score": "0.74221647", "text": "function readProducts(){\n\t\t$(\"#productList\").html(\" \");\t\t\n\t\tdbName.transaction(function(tx){\n\t\t\ttx.executeSql(\"select * from cgptable\",[],listProducts);\t\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "c4948add33b3ad53f4b41fca45d75994", "score": "0.74214065", "text": "function getProducts(){\n service.getProducts().then(function(res) {\n products = res;\n })\n }", "title": "" }, { "docid": "856ec763e4e5b7986f2356f23f2d6a4c", "score": "0.7409616", "text": "function getProducts(res, mysql, context, complete){\n \tmysql.pool.query(\"SELECT p_id, p_name, p_qty, p_mfg, price FROM Product\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.product = results;\n complete();\n });\n }", "title": "" }, { "docid": "43d3b30fcc40ce7f9de53d5a9e6d4136", "score": "0.7374731", "text": "function readProducts() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n //console.log(res);\n console.log(\"Bamazon products available for purchase:\\n\");\n\n for(var i=0; i<res.length; i++) {\n console.log(\" | \" + res[i].item_id + \" \" + res[i].product_name + \"............\" + \"$\" + res[i].price + \" Units Available: \" + res[i].stock_quantity + \"\\r\\n\");\n };\n console.log(\"-------------------------------------------------------\");\n makeAPurchase();\n });\n \n }", "title": "" }, { "docid": "2063a2f4b533d091e03a1e079f59027c", "score": "0.7370822", "text": "function displayProducts() {\n\n connection.query(\"SELECT * FROM products\", function(err, data) {\n if (err) throw err\n \n itemArrayBuilder(data)\n\n management()\n \n \n })\n}", "title": "" }, { "docid": "3fa6bd96cf98138acd14f3c123e9f82b", "score": "0.73602736", "text": "function loadProducts(){\n var qLoad = \"SELECT * FROM products\";\n // query from the database\n connection.query(qLoad, function(err, res){\n if (err) return err;\n \n // if successful, trigger next function: ask user questions, from inuqirer\n requestProduct(res);\n });\n}", "title": "" }, { "docid": "e145a76377ae93bb1f19afb8f75bcfb2", "score": "0.7355768", "text": "function loadProducts() {\n // Selects all data from the bamazon db products table\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n\n // Logs table in the terminal using the response\n console.table(res);\n\n // Call to prompt customer for their choice of product, pass response customerItem\n customerItem(res);\n });\n}", "title": "" }, { "docid": "a2459b11baea1335667769e3346ae518", "score": "0.73183554", "text": "function viewProducts() {\n connection.query('SELECT * FROM products', function (error, res) {\n if (error) throw error;\n\n console.log('\\n * * *\\n');\n\n for (var i = 0; i < res.length; i++) {\n console.log('prodID: ' + res[i].item_id + ' — price $' + res[i].price + ' — qty: ' + res[i].stock_quantity + ' — ' + res[i].product_name);\n }\n console.log('\\n * * *\\n');\n });\n connection.end();\n loadMangerInterface();\n}", "title": "" }, { "docid": "c056b5aa53c2c83409370ed6c27bdef9", "score": "0.73106366", "text": "function productLoad() {\n db.query(\"SELECT * FROM products\", function(err, res){\n if (err) throw err;\n console.table(res);\n promptCustomer(res);\n\n });\n\n }", "title": "" }, { "docid": "f4e91ed6003129fc4fb7ac211d2e6925", "score": "0.7250281", "text": "function loadProducts() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Draw table in terminal using reponse\n console.table(res);\n // Promp user for their choise of product(pass all products to promptCustomerForItem)\n promptCustomerForItem(res);\n }); \n}", "title": "" }, { "docid": "eabc93153d3f40fa316be726fe628ac4", "score": "0.7240775", "text": "function viewProduct(){\n\t\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\n\t\t if (err) {\n\t\t \tconsole.log(err)\n\n\t\t }else{\n\n\t\t for(var i = 0; i < res.length; i++){\n\n\t\t \tconsole.log(\"ID :\" + res[i].item_id);\n\t\t \tconsole.log(\"Product name :\" + res[i].product_name);\n\t\t \tconsole.log(\"Price :\" + res[i].price);\n\t\t \tconsole.log(\"Available Quantity:\" + res[i].stock_quantity);\n\t\t \tconsole.log(\"====================================\")\n\t\t } \n\n\t\t \n\t\t } \n\n \t\t});\t\t\n\n \t\tconnection.end()\n\n\t}", "title": "" }, { "docid": "54f481bfcf10a01e158409ff598a20bc", "score": "0.7233485", "text": "function viewProducts()\n{\n // Read the items from the database\n var query = \"SELECT * FROM products\";\n connection.query(query, function(err, res) {\n printResult(res);\n // end the database connection\n connection.end();\n });\n}", "title": "" }, { "docid": "c58804e42df974f39609366c29feade5", "score": "0.72299725", "text": "function getProducts() {\n getProductsRequest = \"http://localhost:8000/api/products?category=\" + categoryField + \"&criteria=\" + criteriaField;\n $.getJSON(getProductsRequest, function (data) {\n items = data;\n nbProducts = items.length;\n\n }).done(function () {\n addItemsToHtmlProducts();\n });\n\n }", "title": "" }, { "docid": "a8eff10699d20ceda8b9a73c0a97e61c", "score": "0.7199637", "text": "function readProducts() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function (error, response) {\n for (var i = 0; i < response.length; i++) {\n console.log(response[i].id);\n console.log(\"Name: \" + response[i].product_name);\n console.log(\"Price: \" + response[i].price);\n console.log(\"Quantity: \" + response[i].quantity);\n console.log('------------------------------------------------------');\n }\n if (error) throw error;\n });\n}", "title": "" }, { "docid": "da41d5f8b6f7867d97931392517b0cb9", "score": "0.7192293", "text": "function queryProducts() {\n\n\tvar sql = \"SELECT * from products\";\n\tconnection.query(sql, function (err, res) {\n\t\tif (err) throw err;\n\t\t//console.log(res);\n\t\tformatData(res);\n\t});\n}", "title": "" }, { "docid": "c73f1ccb6a27c80eddab1cbffc558f8d", "score": "0.7181783", "text": "function readProducts(response) {\n console.log(chalk.blue.bold(\"\\n\" + \"Selecting relevant product....\") + \"\\n\");\n\n var query = \"SELECT products.stock_quantity FROM products WHERE ?\";\n\n connection.query(query, { item_id: response.id }, function(err, res) {\n if (err) throw err;\n\n //Call to check and update the stock quantity in the database\n updateProducts(res[0].stock_quantity, response);\n });\n}", "title": "" }, { "docid": "072f719e26ecd385a2d6d9cd075333e4", "score": "0.7163177", "text": "function fnViewProducts(){\n\t\tmysql.getConnection(function(err, conn){\n\t\t\n\t\t if (err) throw err;\n\t\t var sql = \"SELECT * FROM products\";\n\t\t conn.query(sql, function (err, result) {\n\t\t if (err) throw err;\n\t\t console.table(result);\n\t\t if(conn){\n\t\t\t \tconn.release();\n\t\t\t \tmysql.end();\n\t\t\t \t\n\t\t\t}\n\t\t\t});\n\n\t\t});\n\t}", "title": "" }, { "docid": "3a5055ca5ea52a7f659293998635da15", "score": "0.7147727", "text": "function getItems() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.table(res);\n getIDPrompt(res);\n });\n}", "title": "" }, { "docid": "8998845325d4b94dd246cbc5cb206d0d", "score": "0.7083194", "text": "function viewProducts() {\n console.log(\"\")\n console.log(\"Viewing Products\")\n console.log(\"\")\n\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].price + \" | \" + res[i].stock_quanity);\n }\n console.log(\"-----------------------------------\");\n connection.end();\n });\n}", "title": "" }, { "docid": "19c6d8be13c5b05b0eb07f8da1f2a7d9", "score": "0.70811397", "text": "function loadProducts() {\n API.getProducts()\n .then((res) => setProducts(res.data))\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "dddb10743b77a919b6773f250fa45ed3", "score": "0.7079008", "text": "function showProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(chalk.bold(res[i].item_id) + \" \" + res[i].product_name + \" \" + chalk.green(\"$\" + res[i].price.toFixed(2)));\n }\n newPurchase();\n });\n}", "title": "" }, { "docid": "fda5ce6e010cbf64cb0f91fe815ce515", "score": "0.7051241", "text": "function queryAllProducts() {\n\t// query the database for all items from products\n\tconnection.query(\"SELECT item_id,product_name,price FROM products\", function (err, results) {\n\t\tif (err) throw err;\n\t\tconsole.log(\"\\n \");\n\t\t//data displayed in table format in the console\n\t\tconsole.table(\" AVAILABLE PRODUCT LIST\", results);\n\t\t//function call to let user place order\n\t\tcust_view();\n\t});\n\n\n}", "title": "" }, { "docid": "d843f098611ed304e6098d0f8a65296b", "score": "0.7039669", "text": "function loadProductsDatabase(req, res, next){\r\n\tlet startIndex = ((req.query.page-1) * req.query.limit);\r\n\tlet amount = req.query.limit;\r\n\t\r\n\tProduct.find()\r\n\t.where(\"price\").gte(req.query.minprice).lte(req.query.maxprice)\r\n\t.where(\"name\").regex(new RegExp(\".*\" + req.query.name + \".*\", \"i\"))\r\n\t.limit(amount)\r\n\t.skip(startIndex)\r\n\t.exec(function(err, results){\r\n\t\tif(err){\r\n\t\t\tres.status(500).send(\"Error reading products.\");\r\n\t\t\tconsole.log(err);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconsole.log(\"Found \" + results.length + \" matching products.\");\r\n\t\tres.products = results;\r\n\t\tnext();\r\n\t\treturn;\r\n\t})\r\n}", "title": "" }, { "docid": "7c3fe1dc6478bdaf65882961b30269ea", "score": "0.7034713", "text": "function readProducts() {\n \tconsole.log(\"Products available for sale in bamazon...\\n\".bold);\n \tconsole.log(\"----------------------------------------------------------------------------\");\n \tconnection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n runOptions();\n });\n}", "title": "" }, { "docid": "83ff0b9b3e64f42b742f593326311881", "score": "0.702223", "text": "function loadProducts() {\n API.getProducts()\n .then(res =>\n setProducts(res.data)\n )\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "c8c2fd074745e180a8d19d8e72286f00", "score": "0.70137215", "text": "function viewProducts() {\n connection.query(\"SELECT * from products;\", function (error, results) {\n if (!error) console.table(results);\n placeOrder();\n })\n}", "title": "" }, { "docid": "f50da97387d6f81e00c46f6754d74b26", "score": "0.70058256", "text": "function showProducts() {\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n console.log(\"\\n+++++++++++++++++++++++++++++++++++++\");\n for (var i = 0; i < results.length; i++) {\n var itemId = results[i].id;\n var name = results[i].product_name;\n var price = \"$\" + results[i].price.toFixed(2);\n var quantity = results[i].stock_quantity;\n console.log(\n \"\\n\" + itemId + \" | \" + name + \" | \" + price + \" | \" + quantity\n );\n }\n selectProduct();\n });\n}", "title": "" }, { "docid": "ffdafe129a05dd15ddbf004967f87f72", "score": "0.69991356", "text": "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err;\n\t\tconsole.log(\"Here are all the products that are available for sale\");\n\t\tconsole.log(\"------------------------------------------\");\n\t\tconsole.table(res);\n\t\tconsole.log(\"------------------------------------------\");\n\t\tmanageStore();\n\t});\n}", "title": "" }, { "docid": "ca0dd25303575bbdf1c851de67b9874a", "score": "0.6975989", "text": "function getProducts(req, res, mysql, complete, cust_id){\n var sql = \"SELECT C.f_name, C.l_name, P.p_name, P.price FROM shoppingCart_product SCP INNER JOIN Product P ON SCP.p_id = P.p_id INNER JOIN Customer C ON SCP.cust_id = C.cust_id WHERE C.cust_id=?;\";\n var inserts = [cust_id];\n sql = mysql.pool.query(sql,inserts,function(error, results, fields){\n if(error){\n console.log(JSON.stringify(error))\n res.write(JSON.stringify(error));\n res.end();\n }\n context.product = results;\n context.select = results[0];\n context.hasCart = 1;\n complete();\n });\n }", "title": "" }, { "docid": "e32d7c26ca5cf20aef929f15d7db7e3e", "score": "0.696704", "text": "function viewProducts() {\n conncection.query('SELECT itemID, productName, price, stockQuantity FROM ??', ['products'], (err, data) => {\n if (err) throw err;\n console.table(data);\n askAgain();\n })\n}", "title": "" }, { "docid": "120b9355797c4e7ee5601f473150347a", "score": "0.6952544", "text": "function showProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (let i = 0; i < res.length; i++) {\n console.log(\n \"Id: \" +\n res[i].id +\n \" || Product: \" +\n res[i].product_name +\n \" || Price: \" +\n res[i].price +\n \"\\n------------------------------------------------------------\",\n );\n }\n // connection.end();\n });\n}", "title": "" }, { "docid": "3f4a402402070ea91143e32281790242", "score": "0.6945795", "text": "function getAllProducts() {\n getProducts(\"/products/all\");\n}", "title": "" }, { "docid": "f8fcdd01ffab83e6abbe9d6b420ba1ef", "score": "0.6945019", "text": "function products() {\n connection.query(\"SELECT * FROM `products`\", function(err, res) {\n if (err) return err;\n\n\n res.forEach(function(val) {\n\n\n //console.log(val)\n\n console.log(\"Item ID: \" + val.id + \" || Product Name: \" + val.product_name + \" || department name:\" + val.department_name + \" || Price $:\" + val.price + \"|| Stock:\" + val.stock_qty);\n\n })\n\n\n pickup();\n });\n}", "title": "" }, { "docid": "0f84a14a5b5d70f480a0622912d6d39d", "score": "0.69422406", "text": "function viewProducts() {\n\tconnection.query('SELECT * FROM product', function(err, rows, fields) {\n \tif (err) throw err;\n \tfor (var i = 0; i < rows.length; i++) {\n \t\tconsole.log(rows[i].itemID + \": \"+ rows[i].productName + \" || Price: $\" + rows[i].price + \" || Quantity: \" + rows[i].stockQuantity);\n \t\tconsole.log(\"---------------------------------------------------\");\n \t}\n\t});\noptions();\n}", "title": "" }, { "docid": "f1c56a06c91c96fc279f5a2c3519ea95", "score": "0.69403636", "text": "function loadProducts() {\r\n //mysql query to read products in database\r\n console.log(\"\\n=====================================================\\n\")\r\n connection.query(\"SELECT * FROM products\", function (err, res) {\r\n if (err) throw err;\r\n console.table(res)\r\n idPrompt(res);\r\n })\r\n\r\n}", "title": "" }, { "docid": "29bf4270f56170aedbe609e88a2937c4", "score": "0.69399226", "text": "function viewProductsForSale(){\n connection.query(\"SELECT * FROM products WHERE stock_quantity>0\", function(error, res){\n if (error) throw error;\n for (var i = 0; i < res.length; i++){\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | Price: $\" + res[i].price + \" | Units left: \" + res[i].stock_quantity);\n }\n console.log(\"--------------------------------\");\n listManagerOptions();\n });\n}", "title": "" }, { "docid": "77471c73c954587409608bdd6a9a50c8", "score": "0.6937719", "text": "function queryAllProducts() {\r\n connection.query(\"SELECT * FROM products\", function(err, res) {\r\n for (var i = 0; i < res.length; i++) {\r\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\r\n }\r\n console.log(\"-----------------------------------\");\r\n startPurchase();\r\n });\r\n}", "title": "" }, { "docid": "1b96456f5ca594cc503afffde7efe6f5", "score": "0.69361246", "text": "function viewProducts() {\n console.log(\"Displaying all products... \\n\");\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n res.forEach(item => console.log(`\\n ${item.id} ${item.PRODUCT_NAME} PRICE: $${item.PRICE} QUANTITY: ${item.STOCK_QUANTITY}`));\n })\n start();\n}", "title": "" }, { "docid": "de4eaf71ff273e9100ca205afe93e17d", "score": "0.69355994", "text": "function allProducts() {\n\tvar query = connection.query('SELECT * FROM products;', function(err, res) {\n\t\tconsole.log('\\n--------------------------------------------------');\n\n\t\tfor (var i = 0; i < res.length; i++){\n\t\t\tconsole.log(res[i].item_id + \" | \" + res[i].product_name + ' | ' + \"$ \" + res[i].price);\n\t\t};\n\t\tconsole.log('--------------------------------------------------\\n');\n\tproductToBuy();\n\t});\n}", "title": "" }, { "docid": "0150dbe6647fa28c2003655d82aedb0f", "score": "0.69329596", "text": "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"Item ID: \" +\n res[i].item_id +\n \" || Product Name: \" +\n res[i].product_name +\n \" || Department Name: \" +\n res[i].department_name +\n \" || Price: \" +\n res[i].price +\n \" || Stock Quantity: \" +\n res[i].stock_quantity\n );\n }\n console.log(\"-----------------------------------\");\n });\n runMenu();\n}", "title": "" }, { "docid": "f8f8ddd6c5ee12cfc25719e581ac601f", "score": "0.69029546", "text": "function readProducts() {\n console.log(\"\\nWelcome to Bamazon.com!\\n\");\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.table(res);\n runSearch();\n });\n}", "title": "" }, { "docid": "ec8d5d41ed2cc8e093d3b4a9c7270d94", "score": "0.6901906", "text": "function displayProducts() {\r\n connection.query(\"SELECT item_id, product_name, price FROM products\", (err, res) => {\r\n if (err) throw err;\r\n console.log(\"\\n\");\r\n console.table(res);\r\n \r\n makePurchase();\r\n }) \r\n}", "title": "" }, { "docid": "d4ab81a83b6812fc5afc9c3af40a3c3c", "score": "0.6890332", "text": "function getProducts(req, res){\n //Allocating received variables from params\n let userId = req.params.userId;\n\n Wishlist.find({user: userId}).populate('products').exec((err, wishlist) => {\n if(err)\n return res.status(500).send({message: 'Error while loading wishlist.'});\n \n return res.status(200).send({wishlist: wishlist});\n });\n}", "title": "" }, { "docid": "edc7aeb1b00d7eb62f0f6112f4581925", "score": "0.68770474", "text": "function fetchProducts(data) {\n return callApi('GET', 'admin/products', data);\n}", "title": "" }, { "docid": "69a2cacd1d8f81b63df3cac26f0fbb7d", "score": "0.68737364", "text": "static fetchAll() {\n return db.execute(\"SELECT * FROM products\");\n }", "title": "" }, { "docid": "1f8926f8ff019de7b2a50eb0f3fe6d09", "score": "0.6864294", "text": "function getProducts(){ \n return fetch(Product.BASE_URL)\n .then(response => response.json())\n .then(responseBody => {\n for(id in responseBody){\n productsModel.push({\n productId:id,\n productData:responseBody[id]\n })\n }\n })\n}", "title": "" }, { "docid": "e6fe4c862e9d1d92c83b05c54c52d362", "score": "0.68573254", "text": "async function getProducts() {\n const payload = await client.product.fetchAll();\n dispatch({ type: \"FETCH_PRODUCTS\", payload });\n }", "title": "" }, { "docid": "f6f4fd8f9800a983972bacabe9be4d8a", "score": "0.68550104", "text": "function getProducts(id, lowInventory) {\n // Sets the query if an ID is provided\n let query = id || \"\";\n if (id) {\n query = \"/id/\" + id;\n } else if (lowInventory) {\n query = \"/li\"\n }\n // If no id was passed, it will be an empty string,\n // and just query all products\n $.get(\"/api/products\" + query).then(productsData => {\n products = productsData;\n console.log(products);\n if (!products || !products.length) {\n // Do something if there are no products found\n } else {\n // This will render the rows based on the 'products' variable\n renderRows();\n }\n });\n }", "title": "" }, { "docid": "479cb8404f3f624e37385253a18448e3", "score": "0.68505454", "text": "function getProduct(item) { return item.product }", "title": "" }, { "docid": "b120dde11a92f1054780c7bbdd7aad52", "score": "0.68460757", "text": "function printProductList() {\n\n \tconnection.query(\"SELECT * FROM products\", function(e, response) {\n\n \t\tif (e) throw e;\n\n \t\tconsole.table(response);\n\n \t\t// Prompt the user for a product to buy and update the database.\n\t\tgetInputAndUpdate(response);\n \t});\n}", "title": "" }, { "docid": "705abd9a80e0559ff0cc1dd68d77cc89", "score": "0.6840225", "text": "function allProducts() {\n var query = \"SELECT * FROM products\";\n connection.query(query, function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"ID: \" + res[i].id +\n \" || Product: \" + res[i].product_name +\n \" || Department: \" + res[i].department_name +\n \" || Price: $\" + res[i].price\n );\n }\n makeOrder();\n })\n}", "title": "" }, { "docid": "ae173b0064fa45207ef431df8ff4d49c", "score": "0.6828313", "text": "function grabProducts() {\n connection.query('SELECT * FROM products', function (err, res, fields) {\n if (err) {\n console.log(err);\n }\n for (var i = 0; i < res.length; i++) {\n console.log(spacer);\n console.log(\"Item ID: \" + res[i].item_id + bf +\n \"Product: \" + res[i].product_name + bf +\n \"Department: \" + res[i].department_name + bf +\n \"Price: \" + res[i].price + bf +\n \"Stock: \" + res[i].stock_quantity +bf);\n console.log(spacer);\n };\n prompt();\n });\n}", "title": "" }, { "docid": "f8ebe25419bd37d095ec4d8f3fec9e58", "score": "0.68278646", "text": "function viewPrroducts() {\n connection.query('SELECT * from Products', function(err, res) {\n if (err) throw err;\n console.table(res);\n askForId(res);\n });\n}", "title": "" }, { "docid": "42aa8b5b3d19c8449e287d26a72afb59", "score": "0.6823879", "text": "function loadProducts() {\n // Selects all of the data from the MySQL products table\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n\n // Draw the table in the terminal using the response\n console.table(res, \"\\n\");\n\n // Then prompt the customer for their choice of product, pass all the products to promptCustomerForItem\n promptCustomerForItem();\n });\n}", "title": "" }, { "docid": "8ea48ed042814f98bfaf2b994686298b", "score": "0.6823308", "text": "function queryProducts() {\n var query = \"SELECT * FROM products\";\n\n connection.query(query, function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity + \" | \" + res[i].product_sales);\n console.log(\"-----------------------------------\");\n }\n });\n go();\n}", "title": "" }, { "docid": "f9009b1435ef291eefbb7d3627a89d03", "score": "0.6822512", "text": "function viewProduct() {\n console.log(chalk.blue.bold(\"Selecting all products...\" + \"\\n\"));\n\n var viewProductQuery = \"SELECT * FROM products\";\n\n connection.query(viewProductQuery, function(err, res) {\n if (err) throw err;\n\n //Logging response\n console.table(res);\n console.log(\"\\n\");\n\n //End connection\n connection.end();\n });\n}", "title": "" }, { "docid": "f351973ce830bc65d48882091d746b4c", "score": "0.68217915", "text": "function getProducts() {\n setLoading(true);\n refProducts.onSnapshot((querySnapshot) => {\n const items = [];\n querySnapshot.forEach((doc) => {\n items.push(doc.data());\n });\n setProducts(items);\n setLoading(false);\n })\n }", "title": "" }, { "docid": "d2326888904fcca16d487fc98aa21e2a", "score": "0.6800479", "text": "function viewProducts() {\n\tconnection.query('SELECT * FROM products', function(err, res) {\n\t\tif (err) throw err;\n //console.log('\\n\\t## Inventory Items ##');\n\t\t\tvar products = [];\n\t\t\tres.forEach(item => {\n\t\t\t\tproducts.push(item);\n\t\t\t});\n\t\t\tconsole.table(products);\n\t\t\tshowMenu()\n\t});\n}", "title": "" }, { "docid": "0ce0d35eaf81eb247389897290c814f2", "score": "0.67992085", "text": "function view_products() {\n\tvar self = this;\n\tvar options = {};\n\n\tif (self.query.q)\n\t\toptions.search = self.query.q;\n\n\tif (self.query.page)\n\t\toptions.page = self.query.page;\n\n\t// Increases the performance (1 minute cache)\n\tself.memorize('cache.' + options.page + (self.query.q ? self.query.q : ''), '1 minute', DEBUG || options.search !== undefined, function() {\n\t\tself.$query(options, self.callback('products-all'));\n\t});\n}", "title": "" }, { "docid": "d73e5b2b552d6c0689bfb377272d5e31", "score": "0.6795784", "text": "function getProductsDB(cbResult) {\n var query = \"SELECT p.* FROM product p INNER JOIN currency c WHERE p.currency_id = c.id;\";\n con.query(query, function (err, result) {\n if (err) throw err;\n cbResult(result);\n });\n}", "title": "" }, { "docid": "b3f0d1f4ab59098d0fe50a638ab55325", "score": "0.6788097", "text": "function getProducts(req, res, mysql, complete, cat_id){\n var sql = \"SELECT C.cat_id, C.cat_name, P.p_name, P.p_qty, P.p_mfg, P.price FROM Product P INNER JOIN product_category PC ON P.p_id = PC.p_id INNER JOIN Category C ON PC.cat_id = C.cat_id WHERE C.cat_id=?;\";\n var inserts = [cat_id];\n sql = mysql.pool.query(sql,inserts,function(error, results, fields){\n if(error){\n console.log(JSON.stringify(error))\n res.write(JSON.stringify(error));\n res.end();\n }\n context.product = results;\n context.select = results[0];\n context.exists = 1;\n complete();\n });\n }", "title": "" }, { "docid": "1fb0f374861f25e29b7f7190232393a1", "score": "0.67873687", "text": "function viewProducts() {\n console.log(\"view products\");\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n if (err) throw err;\n console.log(res)\n showMenu()\n })\n}", "title": "" }, { "docid": "bd72070825525225b247f9871d377cac", "score": "0.67838985", "text": "function getProducts() {\n\tnodefetch(\"http://localhost:8080/api/productos\")\n\t.then((res) => res.json())\n\t.then(function (data) {\n\t\tio.sockets.emit(\"listProducts\", data);\n\t});\n}", "title": "" }, { "docid": "0a22d2093fdf76f4e9dd261e4bc4a7c5", "score": "0.67776996", "text": "async getAllProducts(){\r\n const url = `products`;\r\n return await apiService.get(url);\r\n }", "title": "" }, { "docid": "dabd7a9756a70ed2c92551b29cb0b41f", "score": "0.67677295", "text": "function getAllDbDataOnPage() {\n $.ajax({\n type: \"GET\",\n url: \"http://localhost:3000/products\",\n success: function (response) {\n products = response;\n response.forEach(product => {\n populate(product);\n });\n\n }\n })\n }", "title": "" }, { "docid": "5bd8ad8a4d9eb318045a05e116277997", "score": "0.6766482", "text": "function viewProduct() {\r\n connection.query(\"SELECT * FROM products\", function(err,res) {\r\n console.log(\"------------------------------\");\r\n console.log(\"Here is the whole list of item that are available for purchase:\");\r\n console.log(\"------------------------------\");\r\n for (var i = 0; i < res.length; i++) {\r\n console.log(res[i].id + \" | \" + res[i].product_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\r\n\r\n };\r\n console.log(\"------------------------------\");\r\n console.log(\"What else do you want to check out?\");\r\n console.log(\"------------------------------\");\r\n start();\r\n\r\n });\r\n}", "title": "" }, { "docid": "40ec009bf189d1d47792f5b61270eb61", "score": "0.67654675", "text": "fetchProducts(context) {\n context.commit('setProducts', productsList)\n }", "title": "" }, { "docid": "04bca4cdb7ec0e216a06364068c7ac0e", "score": "0.67633665", "text": "function loadProducts() {\n // Selects all of the data from the MySQL products table\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n\n // Draw the table in the terminal using the response\n console.table(res);\n\n // Then prompt the customer for their choice of product, pass all the products to promptCustomerForItem\n promptCustomerForItem(res);\n });\n}", "title": "" }, { "docid": "ff1fa2de84d08fb814446d44b9e5e829", "score": "0.675958", "text": "function getProducts() {\r\n\tvar prodDict = [];\r\n\r\n\tvar conn = $.db.getConnection();\r\n\r\n\t// Select ProductId and the corresponding Price\r\n\tvar query = \"SELECT \\\"PRODUCTID\\\", \\\"PRICE\\\" FROM \\\"_SYS_BIC\\\".\\\"{{PACKAGE_NAME}}.data::EPM.MasterData.Products\\\"\";\r\n\tvar pstmt = conn.prepareStatement(query);\r\n\tvar rs = pstmt.executeQuery();\r\n\twhile (rs.next()) {\r\n\t\tprodDict.push({\r\n\t\t\tprod : rs.getNString(1),\r\n\t\t\tprice : rs.getDecimal(2)\r\n\t\t});\r\n\t}\r\n\trs.close();\r\n\tpstmt.close();\r\n\tconn.close;\r\n\treturn prodDict;\r\n}", "title": "" }, { "docid": "8141fbda2d8dfa14a7f48260091a90bb", "score": "0.675318", "text": "function listProducts() {\n connection.query(\"SELECT * FROM products\",\n //hide mySQL index if possible\n function (err, res) {\n if (err) throw err;\n console.table(res);\n promptCustomer(res);\n });\n}", "title": "" }, { "docid": "ff0d6387d8a7e62e01c73eba18054b88", "score": "0.67429125", "text": "function loadProducts() {\n $http.post('/admin/products').success(function (products) {\n app.products = products;\n });\n }", "title": "" }, { "docid": "d51128d6a68a684af2bf9ab4079c9804", "score": "0.6739686", "text": "function get_products_list() {\n var list_p_obj = ApiService.get_product_list_promise_obj();\n if (list_p_obj != \"\") {\n list_p_obj.then(function (res) {\n set_products_list(res);\n });\n } else {\n ApiService.api_get_products_list().then(function(res){\n set_products_list(res);\n })\n }\n }", "title": "" }, { "docid": "4528b50f441e8c1ac8d038925f555491", "score": "0.6733719", "text": "function getProducts() {\n\n /***\n Write your code for fetching the list of product from the database\n \n Using AJAX call the webservice http://localhost:3000/products in GET method\n It will return an Array of objects as follows\n \n {\n [\n {\n \"_id\" : \"57b6fabb977a336f514e73ef\",\n \"price\" : 200,\n \"description\" : \"Great pictures make all the difference. That’s why there’s the new Moto G Plus, 4th Gen. It gives you a 16 MP camera with laser focus and a whole lot more, so you can say goodbye to blurry photos and missed shots. Instantly unlock your phone using your unique fingerprint as a passcode. Get up to 6 hours of power in just 15 minutes of charging, along with an all-day battery. And get the speed you need now and in the future with a powerful octa-core processor.\",\n \"category\" : \"Smartphones\",\n \"name\" : \"Moto G Plus, 4th Gen (Black, 32 GB)\",\n \"productImg\" : {\n \"fileName\" : \"57b6fabb977a336f514e73ef_Product.png\",\n \"filePath\" : \"./public/images/Product/57b6fabb977a336f514e73ef_Product.png\",\n \"fileType\" : \"png\"\n },\n {\n //Next Product and so on\n }\n ]\n }\n\n Using jQuery\n Iterate through this response array and dynamically create the products list\n using JavaScript DOM and innerHTML.\n ***/\n}", "title": "" }, { "docid": "a501c70e22bb7f3db4ba72649af18969", "score": "0.6733129", "text": "function getProductsById(id)\n{\n return db('products').where('id', id).first(); \n}", "title": "" }, { "docid": "eba82f219943ff52dd16d4413932a3a3", "score": "0.6725589", "text": "getProduct(page, limit){\n const pages = Product.find().skip(page).limit(limit).exec();\n return pages;\n }", "title": "" }, { "docid": "c14a0f3b25df5d13811e99303094ba97", "score": "0.6723242", "text": "function getAllProducts(callback) {\n connection.query('SELECT * FROM products', function (error, results, fields) {\n if (error) throw error;\n\n var products = {\n products: results,\n fields: fields\n }\n callback(products);\n });\n}", "title": "" }, { "docid": "e95dce33f6d8a23486fd3a6683bf4d8d", "score": "0.6718451", "text": "function viewProducts() {\n connection.query('SELECT * FROM products', function (err, res) {\n if (err) throw err;\n\n console.log(' ');\n console.log('~~~~~~~~~~~~~~~ List of Products for Sale ~~~~~~~~~~~~~~~')\n console.log('----------------------------------------------------------------------------------------------------')\n\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].item_id + \" | \" + \"Product: \" + res[i].product_name + \" | \" + \"Department: \" + res[i].department_name + \" | \" + \"Price: \" + res[i].price + \" | \" + \"QTY: \" + res[i].stock_quantity);\n console.log('--------------------------------------------------------------------------------------------------')\n }\n console.log(' ');\n start();\n });\n}", "title": "" }, { "docid": "5af24a089925d2e970289f196f7e1807", "score": "0.6712921", "text": "async function loadProducts() {\n let result = await getAPI(null);\n if (result.ok) {\n let teddies = await result.json();\n await listProduct(teddies);\n\n }\n}", "title": "" }, { "docid": "7ab49524143b612058446bd97a578be9", "score": "0.67096055", "text": "function loadProductRecords() {\n console.log ('Loading flip flops records from database into #listofproducts ul...');\n db.transaction(function (txs) {\n txs.executeSql('SELECT * FROM FlipFlops ORDER BY name', [], function (txs, results) {\n var len = results.rows.length, i;\n\n for (i = 0; i < len; i++) {\n var ProductsLife = results.rows.item(i);\n\n var individualProduct = '';\n individualProduct = '<li><a href=\"#detailinfo\" id=\"aProductRecord\" data-key=\"' + ProductsLife.id + '\" >';\n individualProduct += '<img height=\"120\" width=\"120\" src=\"Images/Products/' + ProductsLife.img + '\" />';\n individualProduct += '<h3>' + ProductsLife.name + '</h3>';\n individualProduct += '<p><strong>Price:</strong> &pound;'+ ProductsLife.price + '<br>';\n individualProduct += '<strong>Size Available:</strong> ' + ProductsLife.size + '<br>';\n individualProduct += '<strong>Category:</strong> ' + ProductsLife.cat + '<br>';\n individualProduct += '<strong>Colours:</strong> ' + ProductsLife.colour + '</p>';\n individualProduct += '</a></li>';\n\n $('#Results').html(\"Search Results: \" + len);\n $('#listofproducts ul').append(individualProduct);\n $('#listofproducts ul:visible').listview('refresh');\n } //end for loop\n });\n });\n }", "title": "" }, { "docid": "5ac40573f913ce4ce8a0a3bae9c0c81a", "score": "0.6705274", "text": "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) { throw err }\n else {\n console.log(\"---------------------------------\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].item_id + \" || Name: \" + res[i].product_name + \" || Department: \" + res[i].department_name + \" || Price: \" + res[i].price + \" || Quantity: \" + res[i].stock_quantity);\n }\n console.log(\"---------------------------------\");\n //goes back to the menu when finished\n menu();\n }\n });\n}", "title": "" }, { "docid": "375af49b89dee4dad5eae1fc27cafd50", "score": "0.67009807", "text": "function getProducts() {\n ordersRef.onSnapshot(function (querySnapshot) {\n var orderItems = [];\n querySnapshot.forEach((doc) => {\n const obj = doc.data();\n obj.id = doc.id;\n orderItems.push(obj);\n console.log(`${doc.id} => ${doc.data()}`);\n });\n \n renderProducts(orderItems);\n\n });\n }", "title": "" }, { "docid": "be2f496d7ae68033efae9a04608cb5f8", "score": "0.6700404", "text": "function viewProducts(){\n connection.query(\"SELECT * FROM products\", function(err, response){\n if(err) throw err;\n printTable(response);\n })\n}", "title": "" }, { "docid": "30b294e58f2395ea08706acdb6f31df4", "score": "0.66921216", "text": "function showProducts() {\n let query = \"SELECT * FROM products\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.table(res);\n });\n}", "title": "" }, { "docid": "5131c4f5e1fd9c7084131fbf7c881c9c", "score": "0.66909695", "text": "function viewProducts(){\n\tconnection.query(\"SELECT * FROM products;\", ( err, res ) => {\n\t\tif ( err ) throw err;\n\t\tlet table = new Table({\n\t\t head: ['Item ID'.bold.cyan, 'Product Name'.bold.cyan, 'Price'.bold.cyan, 'Quantity available'.bold.cyan],\n\t\t colWidths: [10, 25, 10, 20]\n\t\t});\n\t\tfor ( let i = 0; i < res.length; i++ ) {\t\t\t\n\t\t\ttable.push([res[i].item_id, res[i].product_name, '$'+res[i].price, res[i].stock_quantity]);\n\t\t} \n\t\tconsole.log(table.toString());\n\t\tnewAction();\n\t});\n}", "title": "" }, { "docid": "a9e1eda1aec9935973b47907e92a3c78", "score": "0.6690536", "text": "function listProducts() {\n connection.query(\"SELECT * FROM Products\", function(err, results) {\n if (err) throw err;\n for (var i = 0; i < results.length; i++) {\n console.log(\"#\" + results[i].ItemID + \"\\nProduct: \" + results[i].ProductName + \"\\nPrice: $\" + results[i].Price + \"\\nQuantity in stock: \" + results[i].StockQuantity);\n console.log(\"|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\");\n }\n buyNow();\n })\n}", "title": "" }, { "docid": "1917f479044f23b78acdceb30008976f", "score": "0.6686477", "text": "function displayProduct(){\n connection.query('select * from products', function(err, res){\n if (err) throw err;\n for(var i = 0; i < res.length; i++){\n // console.log(res)\n console.log(`ID: ${res[i].id} | Product: ${res[i].product_name} | Department: ${res[i].department_name} | Price: ${res[i].price} | Stock: ${res[i].stock}`);\n console.log('')\n };\n start();\n });\n}", "title": "" }, { "docid": "493b109ddac43669276926f381cf9a05", "score": "0.6675147", "text": "function showAllProducts(){\n connection.query(\"SELECT * from products\", function(err,res){\n console.log(\"\\n----------------------------\");\n if(err) throw err;\n console.log(\"LISTING ALL PRODUCTS FOR SALE\\n\");\n for (var i =0; i< res.length; i++){\n \n console.log(\"ID |\" +res[i].id + \" | NAME: | \" + res[i].product_name + \" | PRICE: | \"+ res[i].price+\"$\");\n }\n });\n \n}", "title": "" }, { "docid": "62d6d991ab5042ece93460d91ea02287", "score": "0.66709125", "text": "function viewProducts () {\n // list every available item: the item IDs, names, prices, and quantities.\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n console.table(results);\n startMenu();\n })\n}", "title": "" }, { "docid": "23c71ec1653589c608d497b881b8fd19", "score": "0.6670298", "text": "function loadProducts() {\n // Selects all of the data from the MySQL products table\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Draw the table in the terminal using the response\n console.table(res);\n // Run questions with inquirer\n start();\n });\n}", "title": "" }, { "docid": "b8ac9d0b1d0c0a959b59de0a6b8f33cd", "score": "0.6669577", "text": "function displayProducts() {\n\t// connect to the mysql server and sql database\n\n\n\t// createProduct();\n\tconnection.query('SELECT * FROM books', function (err, data) {\n\n\t\tif (err) {\n\n\t\t\tthrow err;\n\t\t}\n\t\tvar idArray = [];\n\n\n\t\tfor (let i = 0; i < data.length; i++) {\n\t\t\tconsole.log(\n\t\t\t\t\"Id: \" + data[i].id +\n\t\t\t\t\" \" + data[i].title +\n\t\t\t\t\" || Author: \" +\n\t\t\t\tdata[i].author +\n\t\t\t\t\" || Price: \" +\n\t\t\t\tdata[i].price +\n\t\t\t\t\" || Quantity: \" +\n\t\t\t\tdata[i].quantity\n\n\t\t\t);\n\t\t\tidArray.push(data[i].id);\n\n\t\t\t// for (var j = 0, data.length )\n\t\t}\n\t\t// console.log(data.length);\n\t\tnumberOfProducts = idArray.length;\n\t\tconsole.log(idArray);\n\t\tconsole.log(numberOfProducts);\n\t\tstart();\n\n\t})\n\n\n}", "title": "" }, { "docid": "3a85192f9e13665679ff741edf262351", "score": "0.66690946", "text": "function displayAllProducts() {\n connection.query(\"SELECT * FROM products\", function(err, data) {\n if (err) {\n console.error(\"error executing sql query: \" + err.stack);\n return;\n }\n\n data.forEach( product => {\n console.log(`${product.item_id} - ${product.product_name}, PRICE: $${product.price}`);\n });\n\n // calling function to display options for making a purchase\n askPurchaseQuestions();\n });\n}", "title": "" }, { "docid": "3dcf8fdf033dc901da340de7cfc0e667", "score": "0.6668085", "text": "async getProducts() {\n try {\n const method = 'get';\n const url = `/admin/api/2020-01/products.json`\n\n const response = await this.client({method, url})\n return response.data;\n } catch (error) {\n throw createShopifyError(error, this.shop)\n }\n }", "title": "" }, { "docid": "b70636ce7e70c71fb950a956c8b83326", "score": "0.66667557", "text": "function getAll() {\n return Restangular.all('product').getList().then(function (data) {\n products = data;\n return data;\n }, function (err) {\n toaster.pop('error', 'Api error.', 'error connect to api to fetching product.');\n });\n }", "title": "" }, { "docid": "f6d64f60bd8d680ce9e2824e2c8db9c1", "score": "0.6662786", "text": "function gettingItems() {\n let stringObj = localStorage.getItem('products');\n let normalObj = JSON.parse(stringObj);\n if (normalObj !== null) {\n products = normalObj;\n }\n }", "title": "" }, { "docid": "1844749b7d6f27e23a9aac95536af704", "score": "0.6662738", "text": "function viewProductsForSale() {\n // list every available item: the item IDs, names, prices, and quantities.\n var queryProducts = \"SELECT * FROM products\";\n connection.query(queryProducts, function(error, response) {\n if (error) {\n console.log(error)\n } else {\n console.table(response);\n // return to main menu\n mgrOptions()\n }\n })\n\n}", "title": "" }, { "docid": "91b44ca663890566de66ae15467e6f1c", "score": "0.664602", "text": "function managerDisplayProduct(){\n connection.query('select * from products', function(err, res){\n if (err) throw err;\n for(var i = 0; i < res.length; i++){\n // console.log(res)\n console.log(`ID: ${res[i].id} | Product: ${res[i].product_name} | Department: ${res[i].department_name} | Price: ${res[i].price} | Stock: ${res[i].stock}`);\n console.log('')\n };\n managerDisplay();\n })\n}", "title": "" }, { "docid": "94462528317764f76290566a0d438d9e", "score": "0.6645599", "text": "function readProducts() { \n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) {\n throw err;\n } else {\n // Log all results of the SELECT statement\n console.log('########################\\n#### ITEMS FOR SALE #### \\n########################\\n');\n for (key in res) {\n let name = res[key].product_name.toUpperCase();\n // save product names to array for later use\n productArr.push(name);\n console.log(`${name} | price: $${res[key].price} | quantity: ${res[key].stock_quantity} | department: ${res[key].department_name} \\n`);\n }\n console.log('########################\\n');\n }\n\n // call mainPrompt for user selections\n mainPrompt();\n });\n}", "title": "" }, { "docid": "56a1a26195b4db8c54ce5412708dc130", "score": "0.66429156", "text": "function viewProducts(){\n connection.query(\n 'SELECT item_id, product_name, price, stock_quantity FROM products',\n function(error, response){\n if (error) throw error;\n for (var i=0; i < response.length; i++){\n console.log(\n `Product name: ${response[i].product_name} | Product id: ${response[i].item_id} | Price per unit: $${response[i].price} | Quantity in Stock: ${response[i].stock_quantity} \\n`\n );\n }\n promptNextAction();\n }\n );\n}", "title": "" }, { "docid": "19369f67c3544540e049cc82aaee71a1", "score": "0.66421455", "text": "fetchProducts ({ commit }) {\n shop.getProducts(products => {\n commit('setProducts', products)\n });\n }", "title": "" }, { "docid": "13b8a64014e60951d4b0b38371ac3e01", "score": "0.66370416", "text": "function read() {\n console.log(\"Finding Products Available...\\n\");\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n // console.log(res);\n // Loop Results and display\n for (i = 0; i < res.length; i++) {\n console.log(\"Product Number: \", res[i].item_id);\n console.log(\"Product: \", res[i].product_name);\n console.log(\"Price: \", res[i].price);\n console.log(\"-------------------\");\n product_numbers.push(res[i].item_id);\n }\n purchase();\n });\n}", "title": "" } ]
33f09b505b8f4b013a57c8c57bb38d93
Changes the name of the sequence to play when the displayed is powered on. Remember to call the saveToFlash() method of the module if the modification must be kept.
[ { "docid": "5e1b383f08a88f4bf879862fe755fafa", "score": "0.0", "text": "function YDisplay_set_startupSeq(newval)\n { var rest_val;\n rest_val = newval;\n return this._setAttr('startupSeq',rest_val);\n }", "title": "" } ]
[ { "docid": "850bdbc6e275b3e40eaf44a53a699bb1", "score": "0.657909", "text": "function YDisplay_playSequence(sequenceName)\n {\n this.flushLayers();\n return this.sendCommand(\"S\"+sequenceName);\n }", "title": "" }, { "docid": "6102e27f0773ccbb4de1a627f23333bb", "score": "0.6001408", "text": "setTitle() {\n //console.log(\"SET?\");\n this.readyText.setVisible(false);\n this.setText = this.add.text(config.width / 2, config.height / 2, 'SET?', { font: '192px japaneseFont' });\n this.setText.setStroke('#ff5757', 16);\n Phaser.Display.Align.In.Center(this.setText, this.bg);\n this.littleGongSFX.play();\n this.goTextCall = this.time.delayedCall(1000, this.goTitle, [], this);\n }", "title": "" }, { "docid": "5c794626fbde1fb8587c59b97e97cb64", "score": "0.5822937", "text": "function change_mode(mode)\n{\n play_mode = mode;\n}", "title": "" }, { "docid": "3230549c7012cf806e88d7743a24f541", "score": "0.57983905", "text": "function changeMainScreen (name) {\n\t\tvar commands = [];\n\n\t\tif (typeof game.background_music[game.main_screen] === 'undefined' && typeof game.background_music[name] !== 'undefined') {\n\t\t\tplayAudio(game.background_music[name]);\n\t\t} else if (typeof game.background_music[game.main_screen] !== 'undefined' && typeof game.background_music[name] === 'undefined') {\n\t\t\tstopAudio(game.background_music[game.main_screen]);\n\t\t} else if (typeof game.background_music[game.main_screen] !== 'undefined' && typeof game.background_music[name] !== 'undefined') {\n\t\t\tif (game.background_music[game.main_screen] != game.background_music[name]) {\n\t\t\t\tstopAudio(game.background_music[game.main_screen]);\n\t\t\t\tplayAudio(game.background_music[game.screen]);\n\t\t\t}\n\t\t}\n\n\t\tif (game.screens[game.main_screen][\"on_screen\"]) {\n\t\t\tclearDisplayObject(game.screens[game.main_screen], commands);\n\t\t\tdrawDisplayObject(game.screens[name], commands);\n\t\t}\n\n\t\tgame.main_screen = name;\n\t\tsocket.emit('command', commands);\n\t}", "title": "" }, { "docid": "e474a867b53511717299f9cf45e61431", "score": "0.5797816", "text": "changeFileName(name) {\n this.$fileName.val(name)\n midi.fileName = `${name} [PB=${userPreferences.pitchBendWidth}]`\n $('#midi-filename').val(midi.fileName)\n }", "title": "" }, { "docid": "266fd822df611b231257ab4f39d5fded", "score": "0.5787452", "text": "function setup ()\n{\n inPlayMode = !inPlayMode;\n $(this).attr(\"value\", (inPlayMode)?\"Enter Setup\":\"Exit Setup\");\n}", "title": "" }, { "docid": "588aefa11bfc89c40578e869204a191a", "score": "0.5777035", "text": "play () {\n\t\tthis._active = true\n\t}", "title": "" }, { "docid": "c8d634f479a2b1029c14dca5edda0c13", "score": "0.5737761", "text": "function newTurn(sequence) {\n\t \t$('#startgame').text('Pay attention!');\n\t \tsetTimeout(function(){\n\t \t\tplaySequence(sequence);\n\t\t}, 2000);\n\t}", "title": "" }, { "docid": "a072c9b078bb17d91e178be95d2fbe0b", "score": "0.5737446", "text": "set_on() {\n this.display_on();\n this.controls.pow = 1;\n this.command_to_send = true;\n app.reset_timer();\n }", "title": "" }, { "docid": "50148adaca8fe5c06971e07f52eefbf6", "score": "0.5731562", "text": "playJump() {\n this.salto_i.setAlpha(1);\n if (!this.saltando && this.sonidoAct) {\n this.saltar.play();\n this.flotar.play();\n this.saltando = true;\n }\n }", "title": "" }, { "docid": "5a6b0ffff3c16bafbc16637945e1c7f1", "score": "0.57207304", "text": "enablePlay() {\n this.play = true;\n }", "title": "" }, { "docid": "c6f7757071056ba3a79077a8ac0421d5", "score": "0.57095146", "text": "function changeActiveSong(name, song) {\n stopAll(); //stops any currently playing songs or teach functions.\n\n if (name === \"Play Recording\") {\n // Catches the \"Play Recording\" song\n $(\".active-song\").html(\n `<i class=\"fas fa-play text-dark\"> </i><i class=\"fas fa-music hvr-icon\"></i> ${name} <i class=\"fas fa-music hvr-icon\"></i>`\n );\n $(\".active-song\").attr(\"onclick\", `playSong(${song})`);\n $(\".active-teach\").attr(\"onclick\", `teach(${song})`);\n if (playRecording === undefined || playRecording === null) {\n //if there is no song recorded this disables buttons to guide the user to the record button.\n disableTeach();\n disableActiveSong();\n }\n showRecord(); //shows the record button\n } else {\n $(\".active-song\").html(\n `<i class=\"fas fa-play text-dark\"> </i><i class=\"fas fa-music hvr-icon\"></i> ${name} <i class=\"fas fa-music hvr-icon\"></i>`\n );\n $(\".active-song\").attr(\"onclick\", `playSong(${song})`);\n $(\".active-teach\").attr(\"onclick\", `teach(${song})`);\n hideRecord(); //hides record button on preset songs\n }\n}", "title": "" }, { "docid": "db7c1235b8c58416aa8f6ff61c76b387", "score": "0.5700682", "text": "function AutoPlay() {}", "title": "" }, { "docid": "bd9fdc299e7171556fd24f974ba1c117", "score": "0.56699944", "text": "showWaveNumber(waveNumber) {\n this.waveNumberDisplay.text = `Wave ${waveNumber}`\n this.waveNumberDisplay.visible = true;\n this._scene.time.addEvent({\n delay: 1300,\n callback: () => {\n this.waveNumberDisplay.visible = false;\n },\n callbackScope: this\n });\n }", "title": "" }, { "docid": "d762066f4afc2ff68760b8543d6fb753", "score": "0.56570655", "text": "function tellFirstPlayerToPlay() {\r\n dispDiv.textContent = player1.getName() + \"'s turn. Click a square.\";\r\n }", "title": "" }, { "docid": "3140301c41a45964a779d9bfacf174b9", "score": "0.56550354", "text": "function actionPlay () {\r\n\t\t//ocultamos texto y boton de pantalla 1\r\n\t\tupsText.visible = false;\r\n\t\tboton.visible = false;\r\n\t\t//mostramos texto de pantalla 2\r\n\t\tinstructionsText.visible = true;\r\n\t\tmove.visible = true;\r\n\t\tmove2.visible = true;\r\n\t\t//iniciar juego\r\n\t\tgameStarted = true;\r\n\t\t//inicialiazar Variables\r\n\t\treinit();\r\n\t}", "title": "" }, { "docid": "08a5e0381e2e278e3599c6ba40b9609a", "score": "0.56155854", "text": "function onSound() {\n game.sound.mute = false;\n btn_sound_mute.visible = false;\n btn_sound_on.visible = true;\n}", "title": "" }, { "docid": "19d0f19a9e373960e2d87c0176b85e62", "score": "0.5611254", "text": "function autopPlayControlsDisplay() {\r\n\r\n}", "title": "" }, { "docid": "aff820a977fec16abceda286412b2f1c", "score": "0.560099", "text": "function toggleSound() {\n\n Game.sound.mute = ! Game.sound.mute;\n this.soundBoton.frame = Game.sound.mute ? 0 : 1;\n\n }", "title": "" }, { "docid": "6e939f3cb4fa8716e9795d8a32df0b35", "score": "0.55998135", "text": "set Playback(value) {}", "title": "" }, { "docid": "6182deffd2f8798570db35204a3e8f10", "score": "0.55896664", "text": "function ChangeSong(songname)\n{\n //var bar_ent = scene.EntityByName(\"BarContainer\");\n //last_song = bar_ent.dynamiccomponent.GetAttribute(\"last_song\");\n //print(\"Radio: last_song: \" + last_song.title);\n song = songname.replace(/<br[^>]*>/gi, \" - \");\n song = song.replace(/(<([^>]+)>)/gi, \"\"); \n print(\"Radio: ChangeSong songname=\" + song);\n dynamicComp.SetAttribute(\"state\", \"STOPPED\");\n dynamicComp.SetAttribute(\"song\", song);\n dynamicComp.SetAttribute(\"state\", \"PLAYING\");\n}", "title": "" }, { "docid": "f632d3575a9c2fc1d9dc112f66962e74", "score": "0.55879545", "text": "function Play () {\n\tApplication.LoadLevel(levelPlay);\n}", "title": "" }, { "docid": "213fd4d3e0b2b42bbf831bd14d5066ef", "score": "0.5582935", "text": "function playSound() {\n if (props.power) {\n const sound = document.getElementById(props.keyTrigger)\n sound.currentTime = 0\n sound.play()\n setPadStyle(activeStyle)\n setTimeout(() => setPadStyle(inactiveStyle), 100)\n props.setDisplay(props.id.replace(/-/g, \" \"))\n }\n }", "title": "" }, { "docid": "fc137834287d0400619f8cf0de18e445", "score": "0.55765605", "text": "setS1() {\r\n this.playS = this.s1;\r\n this.ready = true;\r\n this.playSN = 1;\r\n }", "title": "" }, { "docid": "5c917ce3b387855ead01de789a46f17d", "score": "0.5557186", "text": "function changeTempo(newTempo) {\n pause()\n play(newTempo)\n}", "title": "" }, { "docid": "3327c6657e095d4dae067f7513e24c2b", "score": "0.55562484", "text": "function changePhoneScreen (name) {\n\t\tvar commands = [];\n\n\t\tgame.screens[name].x = game.canvas.x - PHONE_SCREEN_X;\n\t\tgame.screens[name].y = game.canvas.y - PHONE_SCREEN_Y;\n\n\t\tif (game.phone.visible && game.phone.raised && game.phone.screen_on) {\n\t\t\tclearDisplayObject(game.screens[game.phone.screen], commands);\n\t\t\tdrawDisplayObject(game.screens[name], commands);\n\t\t}\n\n\t\tgame.phone.screen = name;\n\t\tsocket.emit('command', commands);\n\t}", "title": "" }, { "docid": "caf75ee20f9b97cadf51efc1ee9e55ba", "score": "0.55533826", "text": "function flashTitle() {\n\t\tvar title = $('title');\n\n\t\tvar oldTitle = title.text();\n\t\tvar newTitle = 'Get ready for the bus!';\n\n\t\tsetInterval(function() {\n\t\t\tif(title.text() == oldTitle)\n\t\t\t\ttitle.text(newTitle);\n\t\t\telse\n\t\t\t\ttitle.text(oldTitle);\n\t\t}, 900);\n\t}", "title": "" }, { "docid": "4293d1f6ed496303b2f287a000a919e5", "score": "0.5545047", "text": "function showSequenceOne(){\r\n\tlaunch -= 1;\r\n\tflashOne();\r\n\tsetTimeout(flashSix, 1000);\r\n\tsetTimeout(flashFour, 2000);\r\n\tsetTimeout(flashSeven, 3000);\r\n\tsetTimeout(flashSix, 4000);\r\n\tsetTimeout(flashNine, 5000);\r\n}", "title": "" }, { "docid": "60cabf4070104ae5d741dcf0dc6c8a56", "score": "0.553754", "text": "activate(){\n //Activate the effects of the powerup on the player\n this.effect(this.scene.player);\n //Turn it off later\n this.scene.time.delayedCall(this.duration*1000, this.endEffect, [this.scene.player], this);\n //Get rid of this powerup\n this.scene.powerups.remove(this, false, true);\n }", "title": "" }, { "docid": "d2be6f8bf030c535acec969307171a45", "score": "0.55311936", "text": "function wakeUp() {\n $(\".slide10\").attr('visible', 'false');\n $(\".white-plane\").attr('visible', 'false');\n $(\".instructions\").attr('visible', 'true');\n\n var chains = document.querySelector('.chains-falling');\n chains.components.sound.playSound();\n }", "title": "" }, { "docid": "31a89ebfa9a70328e41f81e716cd51f2", "score": "0.5506086", "text": "readyTitle() {\n //console.log(\"READY?\");\n this.readyText = this.add.text(config.width / 2, config.height / 2, 'READY?', { font: '192px japaneseFont' });\n this.readyText.setStroke('#ff5757', 16);\n Phaser.Display.Align.In.Center(this.readyText, this.bg);\n this.littleGongSFX.play();\n this.setTextCall = this.time.delayedCall(1000, this.setTitle, [], this);\n }", "title": "" }, { "docid": "5109f65f08a84a6a1e45dcde224f876e", "score": "0.549116", "text": "function togglePlay() { //\n if (isPlaying) { // PAUSE THE AUDIO\n myAudio.pause() //\n son1.pause() //\n buttonMute.setAttribute(\"src\", \"../images/speaker2.png\"); // Function to mute sound\n } else { // PLAY THE AUDO\n myAudio.play() //\n buttonMute.setAttribute(\"src\", \"../images/speaker.png\"); //\n } //\n}", "title": "" }, { "docid": "ef2e51976243a45da3c1bd87a5ac54bc", "score": "0.54907906", "text": "async switchFlash () {\n this.flashingBuffers = !this.flashingBuffers\n await this._updateBufferStatus()\n }", "title": "" }, { "docid": "d08013b2eb9651d6fa0eaf66a55fa6ce", "score": "0.5484679", "text": "function flashSequence()\r\n{\r\n flashNextColor(0);\r\n}", "title": "" }, { "docid": "29e4484afa10c4310f6f39efc1462b35", "score": "0.548228", "text": "function changePlayer() {\n if(playerActif === \"player1\") {\n playerActif = \"player2\"\n } else if (playerActif === \"player2\") {\n playerActif = \"player1\"\n }\n display();\n}", "title": "" }, { "docid": "5923c0b9c4e48c93549866b5c176ac39", "score": "0.54755354", "text": "async playModule(module) {\n this.nextModule = module;\n if (monitor.isEnabled()) {\n monitor.update({\n event: `playModule: ${module.name}`,\n time: time.now(),\n deadline: module.deadline\n });\n }\n await this.performTransitions();\n }", "title": "" }, { "docid": "3d73f51c535448b72d4d2b679cac4c78", "score": "0.54698217", "text": "function setQuickPlayScreenText(title)\n{\n\tquickPlayScreenText.title = title;\n}", "title": "" }, { "docid": "6aa0301665167924e9aae2570a22fbd8", "score": "0.5466036", "text": "function showSequence() {\n \"use strict\";\n var i = 0,\n interval = setInterval(function () {\n var lightUp = whichToLight(sequence[i]),\n $wedge = $('[data-wedge=' + sequence[i] + ']').addClass(lightUp),\n soundOn = setupAudio(sequence[i]);\n window.setTimeout(function () {\n $wedge.removeClass(lightUp);\n soundOn();\n }, 300);\n i++;\n if (i >= sequence.length) {\n clearInterval(interval);\n }\n }, 700);\n}", "title": "" }, { "docid": "13a377f2a6ef1e4d4b1defff1c89c64f", "score": "0.54517794", "text": "function playSound(son){\n\t//On change le son \n\t$(\"#sound\").attr(\"src\", \"sound/\"+son+\".mp3\");\n\t//On joue le son\n\tdocument.querySelector('#sound').play();\n}", "title": "" }, { "docid": "fb6db5641e7d799a323d6659b5dc9882", "score": "0.5429728", "text": "function playOnClick(){\n let anim = Math.floor(Math.random() * possibleAnims.length) + 0;\n playModifierAnimation(idle, 0.25, possibleAnims[anim], 0.25);\n }", "title": "" }, { "docid": "5e32632658c036e12cedf943be113f11", "score": "0.54267", "text": "function playOnClick() {\n let anim = Math.floor(Math.random() * possibleAnims.length)\n playModifierAnimation(idle, 0.9, possibleAnims[anim], 0.9)\n }", "title": "" }, { "docid": "06f423481938f75f3117fc49ce9cab8e", "score": "0.54243284", "text": "function playOnClick() {\n let anim = Math.floor(Math.random() * possibleAnims.length) + 0;\n playModifierAnimation(idle, 0.25, possibleAnims[anim], 0.25);\n }", "title": "" }, { "docid": "78fe17527445c851effca4589737c2e6", "score": "0.5421168", "text": "function presentSequence() {\n let sequenceArray = simonSettings.getSequence();\n let count = 0;\n let startClock = false;\n\n displayMoves = setInterval(function() {\n simonSettings.setPanelsActive(false);\n highLightSequence(sequenceArray[count], true, 800);\n count++;\n if(count >= sequenceArray.length) {\n clearInterval(displayMoves);\n simonSettings.clearPlayer();\n setTimeout(timedOut, 900);\n }\n }, 1000);\n }", "title": "" }, { "docid": "21ecf2eb350ef3a181983cd803349376", "score": "0.54190797", "text": "function change(descrpt)\n{\n document.getElementById('scene').innerHTML = descrpt;\n}", "title": "" }, { "docid": "2938d3c9995576811e755ca512e46dc7", "score": "0.5416721", "text": "function playAttackSound()\n{\n\t//print( \"Playing an attack sound....\" );\n\tplaySound( attackNotes );\n}", "title": "" }, { "docid": "c6ed5ebcae65daef6e61b9aa0dd85860", "score": "0.54162645", "text": "function setMuteAudioBtnsGs(){\n if(silence){\n muteDisplay[1].innerHTML= \"Play Audio\";\n muteAudioIcon[1].setAttribute('src', 'images/audio/icon-audio-on.png',);\n }else{\n muteDisplay[1].innerHTML= \"Mute\";\n muteAudioIcon[1].setAttribute('src', 'images/audio/icon-audio-off.png',);\n }\n \n}", "title": "" }, { "docid": "11e9cff51b878d8f478b47b02efdefaa", "score": "0.5415459", "text": "goTitle() {\n //console.log(\"GO!\");\n this.gongSFX.play();\n this.setText.setVisible(false);\n this.goText = this.add.text(config.width / 2, config.height / 2, 'GO!', { font: '192px japaneseFont' });\n this.goText.setStroke('#ff5757', 16);\n Phaser.Display.Align.In.Center(this.goText, this.bg);\n //this.EnviarSincronizacion();\n }", "title": "" }, { "docid": "03e30d73b5490653964403e6e72eb3a7", "score": "0.54109454", "text": "function playSound1() {\n simonSound1.play();\n}", "title": "" }, { "docid": "173c8a1d884be9f79c809e0894cd1f5b", "score": "0.54077095", "text": "function Update () {\n\tInternalAmmo = CurrentAmmo;\n\tAmmoDisplay.GetComponent.<Text>().text = \"\" + InternalAmmo;\n}", "title": "" }, { "docid": "d3ef75defbe3abe9d7a1a1f30c8e25a6", "score": "0.54076", "text": "setProgramName(name) {\n document.getElementById('program-name').textContent = name;\n }", "title": "" }, { "docid": "9cb0bd8f4d550256df833d351c4e22dc", "score": "0.54018295", "text": "function sound(name) {\n switch(name) {\n case'#green':\n game.sound.green.play();\n break;\n case '#pink':\n game.sound.pink.play();\n break;\n case '#yellow':\n game.sound.yellow.play();\n break;\n case '#blue':\n game.sound.blue.play();\n break;\n };\n}", "title": "" }, { "docid": "59afe69f6a0a02b8e1b8aaf5e9bfa3e2", "score": "0.5400026", "text": "jouerSon() {\n\t\tthis.sonBulle.play();\n\t}", "title": "" }, { "docid": "b5a7fbd7b14a5afdf70db8bfef4099bf", "score": "0.53931284", "text": "function playSequence(x) {\n //play cpu sequence then get user sequence\n switch (x) {\n case 0:\n $(\"#blue\").addClass('blueLight').delay(1500);\n setTimeout(function() {\n $blueAudio.play();\n }, 500);\n setTimeout(function() {\n $(\"#blue\").removeClass('blueLight');\n }, 500);\n break;\n case 1:\n $(\"#red\").addClass('redLight').delay(1500);\n setTimeout(function() {\n $redAudio.play();\n }, 500);\n setTimeout(function() {\n $(\"#red\").removeClass('redLight');\n }, 500);\n break;\n case 2:\n $(\"#green\").addClass('greenLight').delay(1500);\n setTimeout(function() {\n $greenAudio.play();\n }, 500);\n setTimeout(function() {\n $(\"#green\").removeClass('greenLight');\n }, 500);\n break;\n case 3:\n $(\"#yellow\").addClass('yellowLight').delay(1500);\n setTimeout(function() {\n $yellowAudio.play();\n }, 500);\n setTimeout(function() {\n $(\"#yellow\").removeClass('yellowLight');\n }, 500);\n break;\n }\n }", "title": "" }, { "docid": "d1e4fb64b483129c7cd73cca18e44ecc", "score": "0.5387925", "text": "setup () {\n this.sound.setAttribute(\"preload\", \"auto\"); // pre-loading\n this.sound.setAttribute(\"controls\", \"none\"); // remove controls\n this.sound.volume = 0.3; // set volume to something low as this will auto play\n this.sound.style.display = \"none\"; // hide element visibility\n }", "title": "" }, { "docid": "77164076de5cf96dc93ae946da0dedaf", "score": "0.53819096", "text": "function changePlayer() {\n if (currentPlayer === 'red') {\n currentPlayer = 'black';\n } else {\n currentPlayer = 'red';\n }\n $('#player').removeClass().addClass(currentPlayer).text(config[currentPlayer + \"PlayerName\"]);\n }", "title": "" }, { "docid": "37a24aedd81d3e97bded59a2af03afd9", "score": "0.53788644", "text": "function blueLight() {\n\tnote.innerHTML = \"RE\";\n\tnote.style.visibility = \"visible\";\n\tlet RE = new Audio('sound/re.wav');\n\tRE.play();\n\tblue.classList.add(\"blue--Active\");\n\tsetTimeout(function(){\n\t\tblue.classList.remove(\"blue--Active\");\n\t},500);\n\tsetTimeout(function(){\n\t\tnote.style.visibility = \"hidden\"\n\t},500);\n}", "title": "" }, { "docid": "34a79d87a1bb044511bdc32c5a8acd3f", "score": "0.537315", "text": "function toggle() {\n\tif (audio.isPlaying()) {\n\t\thueStep = 0;\n\t\taudio.pause();\n\t} else {\n\t\thueStep = 0.2;\n\t\taudio.play();\n\t}\n}", "title": "" }, { "docid": "c9ce105a16660bc64d1d35111ebb0eb9", "score": "0.53699154", "text": "function toggleSound() {\r\n var soundIcon = document.getElementById(\"soundIcon\");\r\n if (!sound) {\r\n soundIcon.src = \"photos/soundIcon.png\";\r\n soundIcon.title = \"Creates a beep when the timer finishes - On\";\r\n sound = true;\r\n } else if (sound) {\r\n soundIcon.src = \"photos/muteIcon.png\";\r\n soundIcon.title = \"Creates a beep when the timer finishes - Off\";\r\n sound = false;\r\n }\r\n }", "title": "" }, { "docid": "d297deede1325e463696f1470495db7e", "score": "0.53663105", "text": "play(id) {\n store.getInstance(id).togglePlay(true);\n }", "title": "" }, { "docid": "1ca572a2c00224acfd7ff2b04a3c013c", "score": "0.5364294", "text": "function restartMic() {\n if ( !micOn ) {\n pause_wave = 0;\n pause_fft = 0; \n// mic.start();\n mic.amp(input_gain);\n micOn = true;\n micButton.html('Mic ON');\n micButton.style('background-color', '#4400ff');\n }\n else {\n pause_wave = 1;\n pause_fft = 1; \n micOn = false;\n micButton.html('Mic OFF');\n micButton.style('background-color', '#ffffff');\n }\n}", "title": "" }, { "docid": "301c1637ecbf897c24e0e17edff08772", "score": "0.53499705", "text": "function play() { //This plays music and is used in the activateSound function to do so.\n sound.play();\n}", "title": "" }, { "docid": "7c69a1f0a1d79e6984c569ebfbf44b5b", "score": "0.53494257", "text": "function turnOnSong(){\n changeTimeOfSong();\n getFullTimeOfSong();\n changePlayerPhoto();\n changePlayerTitle();\n changeClassOfSongAtList();\n\n if(!playerInitialization){\n myAudio.play();\n }\n playerInitialization = false;\n }", "title": "" }, { "docid": "a43bb84e879bdb4025a4bdec4cfb288b", "score": "0.5346365", "text": "function resetGame() {\n//here we set the text to be enabled.\ngameOverText.guiText.enabled = true;\n//we wait for 2 seconds so the text can display for long enough before we disable the text again, and start the game over\nyield WaitForSeconds(2);\ngameOverText.guiText.enabled = false;\n//here we load the playerhouse scene to start the game over.\nApplication.LoadLevel(\"playerhouse\");\n}", "title": "" }, { "docid": "19172a6d63edb09afdbe41372b9e083c", "score": "0.5341096", "text": "function storm_besked2() {\n text_2.style.display = \"block\";\n $(\"#besked_lyd_1\")[0].play();\n}", "title": "" }, { "docid": "2834f2c2649fd7878532bc2e65b248c1", "score": "0.533397", "text": "function play(){\n chronoStart();\n document.getElementById('quest').innerHTML = \"Cliquez sur le Bouton Jouer, la Règle puis sur l'un des Stylos et relier les deux Points.\"\n}", "title": "" }, { "docid": "04c1d53fdfe8e9eed3d1349aeb441540", "score": "0.5320385", "text": "function changePlayerName() {\n document.getElementById(\"player-name-display\").innerHTML = `${playerName}'s`;\n document.getElementById(\"player-name-display-score\").innerHTML = `${playerName}'s`;\n}", "title": "" }, { "docid": "31424ef7596ffeab3d81662a5ffb42d2", "score": "0.5318339", "text": "function playIt(name) {\n let activeEle = document.querySelector(\".\" + name);\n let sound1 = new Audio(\"sound/\" + name + \".mp3\");\n sound1.play();\n activeEle.classList.add(\"active\");\n setTimeout(function () {\n activeEle.classList.remove(\"active\");\n }, 1000)\n}", "title": "" }, { "docid": "6efb01ce542d40d40e314a6b87b43b1e", "score": "0.5312824", "text": "sleep_power(mode) {\n if (mode == 0) {\n this.display_off(document.getElementById('sleep-power'));\n } else if (mode == 1) {\n this.display_on(document.getElementById('sleep-power'));\n } else {\n return;\n }\n this.controls.ac_sleep_pow = mode;\n this.command_to_send = true;\n app.reset_timer();\n }", "title": "" }, { "docid": "65e973e37f37eb5c4b1242eddde5c085", "score": "0.53126234", "text": "function PlayAndDisplay(){\n audio.src= Songs[index];\n SONGName.innerHTML= \"Song\" + Songs[index].substring(0,100);\n audio.play();\n \n }", "title": "" }, { "docid": "5fd9769e04323686ace6724165b79192", "score": "0.53111225", "text": "set name(value) {\n this._player = Object.assign({}, this.INITIAL_STATE, {name: value});\n }", "title": "" }, { "docid": "3e08faf09034e2cbf090aa466000060d", "score": "0.53088933", "text": "function switchShowSkill() {\n setNextOpt(__OPTSET.zeigeSkill);\n}", "title": "" }, { "docid": "aa1b3b678325f57e581c59370eb2fa97", "score": "0.5302265", "text": "function Play_sound_Toggle() {\n play_Sound = (play_Sound + 1) % 2;\n\t\tif(play_Sound == 1){ // Want the sound to play\n\t\t\t$( \"#btn_Sound_on\" ).removeClass( \"btn-warning\" );\n\t\t\t$( \"#btn_Sound_on\" ).addClass( \"btn-success\" );\n\t\t\t$(\"#btn_Sound_on\").html( \"Sound<br>On\" );\n\t\t\tplay_sound_function();\n\t\t}else{ // Don't want to play the sound anymore.\n\t\t $( \"#btn_Sound_on\" ).removeClass( \"btn-success\" );\n\t\t\t$( \"#btn_Sound_on\" ).addClass( \"btn-warning\" );\n\t\t}\n }", "title": "" }, { "docid": "c03b9d8df5fd6151159655596fdcb322", "score": "0.5298418", "text": "_setPlaySound(e){this.state=\"play\"}", "title": "" }, { "docid": "a9d345b3a5dd8cb71b52e39aadc6f3fc", "score": "0.52958983", "text": "changeScene(nameScene){\n this.scene.pause();\n this.scene.sendToBack();\n this.scene.run(nameScene);\n\n }", "title": "" }, { "docid": "5661667b6223bd169435e650d250fbc0", "score": "0.52878326", "text": "function YDisplay_saveSequence(sequenceName)\n {\n this.flushLayers();\n this._recording = false;\n this._upload(sequenceName, new Buffer(this._sequence, YAPI.defaultEncoding));\n //We need to use YPRINTF(\"\") for Objective-C\n this._sequence = \"\";\n return YAPI_SUCCESS;\n }", "title": "" }, { "docid": "773a8e13234817af62f445b839c9312f", "score": "0.52866286", "text": "function play(){\n\tslotSound.play();\n\tconsole.log(\"hallo\");\n}", "title": "" }, { "docid": "7ac66fd98aacb8cc1cd0c31d5e9720f0", "score": "0.52853394", "text": "function Aud(){\n audio.src= Songs[0];\n SONGName.innerHTML= \"Song\" + Songs[index].substring(0,100);\n audio.pause();\n }", "title": "" }, { "docid": "c04861f61febf526647fa75f657f7b67", "score": "0.5284776", "text": "function musicStart(){\n hornpipe = new Sound('the-sailors-hornpipe.mp3');\n hornpipe.play();\n //unhide game elements and hide title screen\n //new branch to experiment with gamestates..\n\n}", "title": "" }, { "docid": "556e62389c679068c3115ff8653d4786", "score": "0.5278893", "text": "function playSequence() {\n \n let i = 0;\n \n const interval = setInterval(() => {\n turnAllOff();\n \n if(i === sequence.length) {\n clearInterval(interval);\n tracking = true;\n }\n else {\n setTimeout(() => {\n const indexToPlay = sequence[i];\n const lightToPlay = lights[indexToPlay];\n lightToPlay.classList.add('on');\n clickSound();\n \n i++;\n \n }, 300);\n }\n }, 850);\n}", "title": "" }, { "docid": "4cba6568ea1e3a400bf468537244541f", "score": "0.52768266", "text": "function changeName() {\n setName(name === \"Mike\" ? \"Jane\" : \"Mike\");\n }", "title": "" }, { "docid": "8be9c7c01580b29e61cd179df7fccbbf", "score": "0.52726185", "text": "startCustom(button) {\n this.game.noises.slide.play();\n let team = 'black';\n if (button.player == 'player1') {\n team = 'white';\n }\n game.state.start('customize', false, false, team)\n }", "title": "" }, { "docid": "3fe2afa000c259aa82d327a0c1a3f498", "score": "0.5266923", "text": "function customGenerate() {\n newAreaSound.play()\n $(\"#name-underline-wrapper\").removeClass(\"faded-out\")\n setAreaName($(\"#custom-text\").val())\n}", "title": "" }, { "docid": "3729efea5db354abfdee02c0702e84ac", "score": "0.5266051", "text": "function setActive() {\r\n if (song.active === true) {\r\n return \"active\";\r\n } else {\r\n return \"\";\r\n }\r\n }", "title": "" }, { "docid": "7dc363bf8cd9009fe346a7973d33eea9", "score": "0.5254289", "text": "function changeTheSetting () {\n videoPlayer[this.name] = this.value;\n}", "title": "" }, { "docid": "04deb5898ba531dd24b8dde2c2dddba7", "score": "0.52534294", "text": "function redLight() {\n\tnote.innerHTML = \"DO\";\n\tnote.style.visibility = \"visible\";\n\tlet DO = new Audio('sound/do.wav');\n\tDO.play();\n\tred.classList.add(\"red--Active\");\n\tsetTimeout(function(){\n\t\tred.classList.remove(\"red--Active\");\n\t},500);\n\tsetTimeout(function(){\n\t\tnote.style.visibility = \"hidden\"\n\t},500);\n}", "title": "" }, { "docid": "5bac9fb0221e4f8ae4ce54490a55d30f", "score": "0.5252793", "text": "function playSound(fileName) { \n document.getElementById(\"sound\").innerHTML='<audio autoplay=\"autoplay\"><source src=\"' + fileName + '.mp3\" type=\"audio/mpeg\" /><source src=\"' + fileName + '.ogg\" type=\"audio/ogg\" /><embed hidden=\"true\" autostart=\"true\" loop=\"false\" src=\"' + fileName +'.mp3\" /></audio>';\n }", "title": "" }, { "docid": "da3e457496e38a5dc9fe9c3194c7b1e5", "score": "0.52524614", "text": "function toggler() {\n\tif(PAUSEPLAY.innerText==\"Play\"){\n\t\tPAUSEPLAY.innerHTML=\"<b>Pause</b>\";\n\t\t// secInterval=setInterval(counter, 1000);\n\t} else{\n\t\tPAUSEPLAY.innerHTML=\"<b>Play</b>\";\n\t\t// window.clearInterval(secInterval);\n\t}\n}", "title": "" }, { "docid": "084663cd8385eb11ccd5740ec5d1188b", "score": "0.5251327", "text": "function setPlayerSongTitle(name)\r\n\t{\r\n\t\t$(\"#playerSongTitle\").stop().fadeOut(/*\"slow\"*/ 600,function(){ $(this).html( name )}).fadeIn(800);\r\n\t}", "title": "" }, { "docid": "354e256db84fa0386abf89626b0b2f15", "score": "0.5251129", "text": "function nextSequence() {\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\n //using jQuery to select the button with same id as the randomChosenColor and make it flash\n $(`#${randomChosenColor}`).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);\n\n //playing the sound for the rand color\n playSound(randomChosenColor);\n //increase the current level\n}", "title": "" }, { "docid": "831f73f5af1f63c6c32d1b2738eb2d58", "score": "0.5250391", "text": "function restart() {\n powerOn(); // start from original on stage\n sequence = []; // random number array goes to 0\n $(\"#count\").html('--'); // turn counter redets\n playerTurn = false; // player cant press buttons\n $(\".colorButton\").removeClass('bright'); // brightness is removed\n }", "title": "" }, { "docid": "6f92f784c8fc9db4227e6eda6a38190d", "score": "0.5248929", "text": "function updatePlayerNumber(number){\n\t\tdocument.getElementById(\"playerNumber\").textContent = \"Player\" + number;\n\t}", "title": "" }, { "docid": "8dba6bea59a23504bdcffd6d0ed3a70f", "score": "0.52457327", "text": "function instruction() {\n clicksound.play('sound');\n instructionMenu = true;\n}", "title": "" }, { "docid": "2f2341965783e215e4d113c54b9ebbf0", "score": "0.52445114", "text": "function playChime(){\n\tchime.play();\n\tblinkScreen();\n}", "title": "" }, { "docid": "ce2e1c7f89017b7c2235540c5ccf7c23", "score": "0.5244419", "text": "function setMute(name, value) {\n\tif (!soundBank[name]) {\n\t\tthrow new Error(`There is no sound loaded named ${name}.`);\n\t}\n\n\tsoundBank[name].muted = value;\n}", "title": "" }, { "docid": "df5d8fb1a8d82df155e6c66ca4793aea", "score": "0.52443093", "text": "function startGame() {\n state = {\n show14: true,\n }\n showTextNode(1)\n}", "title": "" }, { "docid": "d8536216754c4b84118bed516a18d5c5", "score": "0.5243034", "text": "function setMode() {\n mode = 1;\n $('#gameStatus').html('Player Turn');\n }", "title": "" }, { "docid": "b3de779c635dc667a0236bfc9132a061", "score": "0.5241655", "text": "function switchProgram(name) {\n\tif (name == currentProgram) {\n\t\treturn;\n\t}\n\tenableOtherPrograms(name);\n\tsetStartStop(true);\n\tsetEnabled('btnc-reset', false);\n\tsetVisible('btnc-draw', name == 'tracie');\n\tif (name == 'tracie' && enoughPoints()) {\n\t\tnextSyncFn = sendPoints;\n\t}\n\tsend('program:' + name);\n\tcurrentProgram = name;\n}", "title": "" }, { "docid": "5008fc9652a5b2b81d3f6249c6ed30cd", "score": "0.5240477", "text": "function toggleAutoPlay() {\n isAutoPlay = !isAutoPlay;\n autoPlayButton.textContent = isAutoPlay\n ? \"Stop Auto Play\"\n : \"Start Auto Play\";\n}", "title": "" }, { "docid": "1aa2e1f8113e53250d4f7b4ee6f4a166", "score": "0.52363515", "text": "function computerTurn() {\n $(\"#level\").text(\"Level\" + \" \" + game.level);\n setTimeout(function () {\n for (i = 0; i < game.round; i++) {\n game.computerSequence.push(Math.floor(Math.random() * 5));\n }\n for (i = 0; i < game.computerSequence.length; i++) {\n iconFlash(i);\n }\n }, 1000);\n }", "title": "" }, { "docid": "138eb5d5bfc96f39976e1ac7b8118e45", "score": "0.5234691", "text": "function powerOn() {\n cpuTurn = true;\n success = false;\n playerTurn = false;\n $(\"#count\").html('--');\n document.getElementById(\"start\").disabled = false;\n }", "title": "" }, { "docid": "d9ac38bdc3f292f790b76d7b3327a214", "score": "0.52346605", "text": "function playStart(scenario) {\n startSound[scenario].play('');\n}", "title": "" } ]
b572fce77c88974b576bcf63a2dd5c84
Method to check if LT exists in queried LT list Entry is valid if DB has corresponding name
[ { "docid": "58047487fbb345688e9f3b63d1a3ace3", "score": "0.0", "text": "isValidTheme(input) {\n return this.state.loan_themes.indexOf(input) !== -1\n }", "title": "" } ]
[ { "docid": "3ec4ec15bf04b74bfbccc416b0d05b3e", "score": "0.5892645", "text": "async doesEntryExist (entry) {\n try {\n if (!entry || typeof entry !== 'object') {\n throw new Error('entry object is required')\n }\n\n if (!entry.key || typeof entry.key !== 'string') {\n throw new Error('property \"key\" must be a string')\n }\n\n const key = entry.key\n const result = await this.KeyValue.find({ key })\n\n if (result.length > 0) return true\n\n return false\n } catch (err) {\n console.error('Error in doesEntryExist()')\n throw err\n }\n }", "title": "" }, { "docid": "8ec56c8c4d41a159193c74dd73688171", "score": "0.58577365", "text": "exists(name) {\n for (let a of fromEnum(this._n)) {\n if (StringUtilities.c(a.name, name, this._j._e6, 1) == 0) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "ac58afb3d8e8636db8c671282a7d398e", "score": "0.5847529", "text": "exists(name) {\n if (stringIsNullOrEmpty(name)) {\n return false;\n }\n let a = this._d._y;\n for (let b of fromEnum(this._n)) {\n if (StringUtilities.c(b.name, name, a, 1) == 0) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "4536661b73eb78d96b72f19af309d864", "score": "0.57526535", "text": "exists(name) {\n for (let a of fromEnum(this._k)) {\n if (StringUtilities.c(a.name, name, this._a._e6, 1) == 0) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "791708f7be8e2e2b3b61a323e44950a3", "score": "0.57105935", "text": "function entityExists(name) {\n return entities[name] !== undefined;\n }", "title": "" }, { "docid": "b8207858aeceff502f70a61c23616125", "score": "0.5668231", "text": "function exists(name) {\r\n return name in users;\r\n}", "title": "" }, { "docid": "940bdd8ef79627e97819f60ab7155e35", "score": "0.5663737", "text": "function spellExists(splname) {\r\n for(i =0; i < knownSpellList.length; i++){\r\n if(splname == knownSpellList[i].name)\r\n return true;\r\n\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "2043ad57ea825bbaad39b00a21c53450", "score": "0.5644686", "text": "function doesMemberExist(_name) {\r\n let localStorageMemberArray = getLocalStorage(\"member\");\r\n for (var i = 0; i < localStorageMemberArray.length; i++) {\r\n if (localStorageMemberArray[i].name === _name) {\r\n return true;\r\n } else {\r\n return false\r\n }\r\n }\r\n}", "title": "" }, { "docid": "766553d8dd7e6f16c116ff361b2f619f", "score": "0.55891865", "text": "checkIfItemExists(string) {\n let exists = false;\n this.get('model').forEach((item) => {\n let name = item.get('name');\n if (string.toLowerCase().trim() === name.toLowerCase()) { exists = item; }\n });\n\n return exists;\n }", "title": "" }, { "docid": "cec8ff5203251725a84d5c0b66cc8b8a", "score": "0.5573811", "text": "function IsLName(Lname) {\n return Lname.value.length > 0 ? true : false;\n}", "title": "" }, { "docid": "5216c2ada031a4bcb2c664f1e75fe5ca", "score": "0.555745", "text": "async function checkMangaInDB(info) {\n\tvar db = new PouchDB('MangaList');\n\tvar result = await db.find({\n\t\tselector: {nameManga: info.nameManga}\n\t});\n\tif (result.docs.length === 0) {\n\t\treturn false;\n\t};\n\treturn true;\n}", "title": "" }, { "docid": "29b719e2e3513373eb389e197e0dcf6f", "score": "0.55519754", "text": "function isExist(List,dataURI){\n\tvar flag = false;\n\tList.forEach(function(listItem){\n\t\tif(dataURI === listItem.dataURI){\n\t\t\tflag = true;\n\t\t}\n\t});\n\treturn flag;\n}", "title": "" }, { "docid": "c63951d65d5f485a538c581517dea5d0", "score": "0.5537192", "text": "function _checkForTable(d, a) {\n if (a[d] === undefined) {\n _log(1, d + \" does not exist in schema.\");\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "c73523959bad9628d3986bc695e8dd78", "score": "0.5536677", "text": "exists() {\n return super.exists();\n }", "title": "" }, { "docid": "01d9892efe9b5c434efdbd49b6740cdd", "score": "0.5493565", "text": "async exists() {\n const names = this.getCollectionNameList();\n let v = true;\n if (names) {\n for (const name of names) {\n // logger.info(\"isTableExists\", name);\n v = v && (await this.isTableExists(name));\n }\n }\n return v;\n }", "title": "" }, { "docid": "8b99f8f3bd11edd14ee7d392b0d647b4", "score": "0.54902077", "text": "function CheckExistId(db,Id, Price, Latitude, Longitude, Title, Stats, InZone, Comments, Url)\n{\n\t//Setup for IndexedDB query \n\tvar transaction = db.transaction([\"NotSureWhatThisIs\"]);\n\tvar objectStore = transaction.objectStore(\"NotSureWhatThisIs\");\n\tvar request = objectStore.get(Id);\n\t\n\t//Error\n\trequest.onerror = function(event) \n\t{\n\t\tconsole.log('error GetListing: ' + event.target.errorCode);\n\t\twindow.alert('error GetListing: ' + event.target.errorCode);\n\t};\n\t//Success\n\trequest.onsuccess = function(event) \n\t{\n\t\t// Do something with the request.result!\n\t\tif(request.result) \n\t\t{\n\t\t\t//Listing exists don't do anything\n\t\t\tconsole.log(\"Listing already exists don't add to database\");\n\t\t} \n\t\telse \n\t\t{\n\t\t\t//Listing does not exist add it to the database\n\t\t\tconsole.log(\"Listing does not exist add it to the database\");\n\t\t\tAddListing(db, Id, Price, Latitude, Longitude, Title, Stats, InZone, Comments, Url); \n\t\t}\n\t};\n\n}", "title": "" }, { "docid": "01cdf23e8d7284658382a4ac93ef97b3", "score": "0.547404", "text": "has(name) {\n name = `${name}`;\n validateName(name);\n return find(this[MAP], name) !== undefined;\n }", "title": "" }, { "docid": "f14a7979bffe9e095bc52a2da7a20d2d", "score": "0.5465804", "text": "has(name) {\n name = `${name}`;\n validateName(name);\n return find(this[MAP], name) !== void 0;\n }", "title": "" }, { "docid": "917d03e47515bf501b5a3a9418d28c9d", "score": "0.5452218", "text": "folderExists (folderName) {\n\n // iterates on all the elements in the store\n for (let el of this.db.datas) {\n\n // check matches\n if (el.title == folderName) {\n return true\n }\n }\n // no match\n return false\n\n }", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "23bf4e722b859d2ea76a3060d72b9860", "score": "0.54240113", "text": "has(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}", "title": "" }, { "docid": "37c34554701d838390d42a8e9fece2e9", "score": "0.53910726", "text": "hasName(name) {\n return this.m_name2Url.get(name) !== undefined;\n }", "title": "" }, { "docid": "37c34554701d838390d42a8e9fece2e9", "score": "0.53910726", "text": "hasName(name) {\n return this.m_name2Url.get(name) !== undefined;\n }", "title": "" }, { "docid": "87d00e18e959037fd0601ea0cbe86889", "score": "0.53776866", "text": "isNameUnique(contentTierDetails) {\n for (var x = 0; x < this.props.allContentTiers.length; x++) {\n if (this.props.allContentTiers[x].id != contentTierDetails.id) {\n if (this.props.allContentTiers[x].name == contentTierDetails.name.trim()) {\n this.setState({\n showError: true\n });\n\n return true;\n }\n else {\n this.setState({\n showError: false\n });\n }\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "fdd52497a5785506e3de10a358ad33c4", "score": "0.5340975", "text": "function checkExist(name,list){\n for(var i = 0 ; i < list.children.length ; i++)\n if(list.children[i].children[1].innerHTML == name){\n alert(\"Input is existed\");\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "f03773abe148923b500b65107d2014e3", "score": "0.5307708", "text": "function ifExistsInEm(em_id,bl_id,fl_id,rm_id){\n \tif(bl_id==\"\"||fl_id==\"\"||rm_id==\"\"){\n \t\treturn false;\n \t}\n var dataSource = helpDeskGroupMoveController['ds_ab_assign_em_rm_js'];\n \tvar restriction = new Ab.view.Restriction();\n \trestriction.addClause(\"em.em_id\", em_id);\n \trestriction.addClause(\"em.bl_id\", bl_id);\n \trestriction.addClause(\"em.fl_id\", fl_id);\n \trestriction.addClause(\"em.rm_id\", rm_id);\n var dsRecords = dataSource.getRecords(restriction);\n if(dsRecords!=null&&dsRecords.length>0){\n \treturn true;\n }\t\n return false;\n }", "title": "" }, { "docid": "2e3ad432763129592ca780be3ad5a5ed", "score": "0.53027165", "text": "function userExists(name) {\n return allUsers.find(obj => {\n return obj.name === name;\n }) !== undefined;\n }", "title": "" }, { "docid": "00b52489a25d78419ff4727ca3620a3f", "score": "0.52593744", "text": "isExist(data){\n return data != null;\n }", "title": "" }, { "docid": "673e197c37f8fb70cd95c8c0fe10aac2", "score": "0.5259307", "text": "usernameExists(name) {\n console.log(this.list);\n for (let i in this.list) {\n if (this.list[i].nom.localeCompare(name) === 0) {\n return 0;\n }\n }\n return -1;\n }", "title": "" }, { "docid": "661470eec78f71a32e43959b5a69a984", "score": "0.5257544", "text": "function checkHelper(name) {\n var mapKeys = Object.keys(mappedItems);\n var trueName = name;\n if (mapKeys.indexOf(name) !== -1) {\n trueName = mappedItems[name];\n }\n return trueName;\n}", "title": "" }, { "docid": "4c1a9defab50aec5c00f60f67a1babc6", "score": "0.52552676", "text": "has (key) {\n return this.LRUStore.has(key)\n }", "title": "" }, { "docid": "9ebea22c18e4080962895cb7efa88ffb", "score": "0.5254223", "text": "function corpusExists(corpname)\n\t{\n\tvar corps=Session.get(\"corpora\");\n\tvar existing=false; //assume that corpus name is new\n\tfor (var corp in corps)\n\t\t{\n\t\tif (corpname==corps[corp].name)\n\t\t\texisting=true;\n\t\t}\n//\tconsole.log(\"Corpus \"+corpname+(existing?\" exists\":\" does not exist\")+\" in the list\");\n\treturn existing;\n\t}", "title": "" }, { "docid": "b729473b93b63ca93e473fa2665bdbd4", "score": "0.5253902", "text": "function does_alignment_exist(alignmentName) {\n\n\tvar alignmentExists = undefined;\n\t// glue.log(\"INFO\", \"Checking for alignment \", alignmentName);\n\n alignmentResult = glue.tableToObjects(glue.command([\"list\", \"alignment\", \"-w\", \"name = '\"+alignmentName+\"'\"]));\n\t//glue.log(\"INFO\", \"list result was:\", alignmentResult);\n\n\tvar rowObj = alignmentResult[0];\n\tif (rowObj) {\n\t\talignmentExists = rowObj['name'];\n\t\t//glue.log(\"INFO\", \"got exists value:\", alignmentExists);\n\t}\n\t\n\treturn alignmentExists;\n}", "title": "" }, { "docid": "4f9813d9f6d1ccc172d5eeb73d854cd7", "score": "0.52386004", "text": "exists() {\n return !_.isNull(this.val());\n }", "title": "" }, { "docid": "8bf9fdd33b9c55b6b738b9baa94a2cec", "score": "0.5238094", "text": "function is_name_in_tree(tree, dbType, name){\n\n for (var i in tree) {\n var node = tree[i];\n\n if (node['a_attr']['dbType'] === dbType && node['text'].toLowerCase() === name.toLowerCase()) {\n return true\n }\n }\n return false\n}", "title": "" }, { "docid": "d4fc7609ec415e55f8ba4a7e26649351", "score": "0.52122307", "text": "static isNameInUse(name) {\n return new Promise((resolve, reject) => {\n sql.query(\n 'SELECT COUNT(*) AS total FROM pets WHERE name = ?',\n name,\n (err, result) => {\n if (!err) {\n return resolve(result[0].total > 0)\n } else {\n return reject(new Error('Database error!!'))\n }\n }\n )\n })\n }", "title": "" }, { "docid": "ec6652f50d7ee53130966c024d4293a2", "score": "0.5205619", "text": "exists() { }", "title": "" }, { "docid": "1918b414c6495a4282bf36ab00b35803", "score": "0.519614", "text": "testDuplicate(name){\n const {list} = this.state;\n for(let i = 0; i < list.length; ++i){\n if(list[i].name === name)\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "c8ca5b34f2b182f4768a614fe55f633c", "score": "0.5187891", "text": "function doesLanguageIdExistInList(langId){\n\tvar vector = getVectorOfQuestions();\n\tvar length = size(vector);\n\tif(length == 0){\n\t\treturn false;\n\t} else {\n\t\tfor(var i=0;i<length;i++){\n\t\t\tvar obj = elementAt(i,vector);\n\t\t\tif(obj.languageId == langId && !obj.removed) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "7a7fe4e7f68c6ac9c078bfe190561f4c", "score": "0.51826423", "text": "checkUniqueItemName(array, name) {\n for (var i = 0; i < array.length; i++) {\n if (array[i].name === name) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "c489113e83843929d854047841f987a9", "score": "0.5180683", "text": "exists(value) {\n return !!this.entries[value];\n }", "title": "" }, { "docid": "be31f926e0981dddc734057c16105da4", "score": "0.5172912", "text": "function checkIfNameTaken(name){\n\tvar verdict = false;\n\tvar index = 0;\n\tvar check;\n\twhile (index < namesTaken.length && verdict == false){\n\t\tcheck = name.localeCompare(namesTaken[index]);\n\t\tif (check == 0){\n\t\t\tverdict = true;\n\t\t}\n\t\tindex++;\n\t}\t\n\treturn verdict;\n}", "title": "" }, { "docid": "33403ada2af79de3ef44bd373b5d69af", "score": "0.516818", "text": "function isInGeneDBinfoList (element) {\n\tvar dbToCheck = [\n\t\t\"MEDGEN_CODE\",\n\t\t\"DBSNP_DB\",\n\t\t\"GENE\",\n\t\t\"OMIM_CODE\",\n\t\t\"GENALLIANCE_CODE\",\n\t\t\"GENEREV_CODE\",\n\t\t\"ORPHNET_CODE\",\n\t\t\"DBVAR_DB\",\n\t\t\"ORD_CODE\",\n\t\t\"OMIM_DB\",\n\t\t\"GENEREV_DB\",\n\t\t\"UNISWISSPROT_DB\",\n\t\t\"GENE_CODE\",\n\t\t\"UNISWISSPROT_CODE\",\n\t\t\"DBRBC_DB\",\n\t\t\"NCBI_DB\",\n\t\t\"GENE_DB\",\n\t\t\"GHR_CODE\"\n\t];\n\tfor( i = 0; i < dbToCheck.length; i++) {\n\n\t\tif (element == dbToCheck[i]) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n }", "title": "" }, { "docid": "6d6cdb16968dd5a0caee49dab788e331", "score": "0.51670367", "text": "function checkIfBuildingExists(name, all) {\n\t\t\tfor (var id in all) {\n\t\t\t\tid = id.trim().toLowerCase();\n\t\t\t\tname = name.trim().toLowerCase();\n\t\t\t\tif (id == name) { return true; }\n\t\t\t};\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "533d769573cb62115dd95dd4a075d070", "score": "0.51523787", "text": "function validateName(name) {\n return db.none(`\n SELECT *\n FROM teams \n WHERE tname = $1\n `, name);\n}", "title": "" }, { "docid": "d010e29b10a2dead6f97ef95ed990754", "score": "0.5147427", "text": "function checkName(name,list){\n if(name.trim().length > 0){\n if(name.trim().length > 20){\n alert(\"Input is too long, input < 20\");\n return false;\n }\n else\n if(checkExist(name,list))\n return true;\n }\n else{\n alert(\"Input is empty. Please add input.\");\n return false;\n }\n//check exist in list\nfunction checkExist(name,list){\n for(var i = 0 ; i < list.children.length ; i++)\n if(list.children[i].children[1].innerHTML == name){\n alert(\"Input is existed\");\n return false;\n }\n return true;\n }\n}", "title": "" }, { "docid": "f495efd5ad698de68dd32364b2aa4930", "score": "0.5142355", "text": "function _checkUnique(d, a) {\n for (var key in a) {\n if (key == d) {\n _log(1, d + \" already exists in schema\");\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "b1c5d5721e3baf6a97f8edc7b3b156d7", "score": "0.5130486", "text": "function verifyKeyName(name, domain, existing, url) {\n var nameOK = true;\n\n for (fingerprint in domain.keys) {\n var key = domain.keys[fingerprint];\n if (key.name == name && key != existing) {\n displayCloseDialog(\"<p>The name \" + name + \" is already in use for \" + url +\". Please choose another key name.</p>\");\n nameOK = false;\n }\n }\n\n return nameOK;\n }", "title": "" }, { "docid": "db917f404322dc6181273b1dcb274f18", "score": "0.51263326", "text": "function check_entered(name)\n{\n for (var i = 0; i < cur_elements.length; i++)\n {\n if(cur_elements[i].vars.element == name)\n {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "5c42b32be944d2975ce13c56cb814066", "score": "0.51146007", "text": "has(aStr) {\n \t return this._set.has(aStr);\n \t }", "title": "" }, { "docid": "48d3465a07b127738d6882cccf56b166", "score": "0.5077976", "text": "has(aStr){return this._set.has(aStr);}", "title": "" }, { "docid": "cc51517c23f656dde5187d195204246d", "score": "0.50657207", "text": "async function checkInDatabase(_postName, _collection) {\n let flag = false;\n let cursor = _collection.find({});\n\n while (await cursor.hasNext()) {\n let currentEntry = await cursor.next();\n if (_postName == currentEntry.postName) {\n flag = true;\n break;\n }\n }\n return flag;\n}", "title": "" }, { "docid": "00e37beb49770f7f9a773114483760b2", "score": "0.50556743", "text": "function checkUsername(username){\n var b = false;\n for (var i=0;i<userdb.length;i++){\n if(userdb[i].username==username || containsChar(username,' ')){\n //if a usrename is found that is already in the database\n b = true;\n break;\n }\n }\n for (var j=0;j<userdb.length;j++){\n if(codeUserList[j]==username){\n //if a username is found that is already in the pending verification list\n b = true;\n break;\n }\n }\n return b\n //returns boolean true or false depending on whether it exists\n}", "title": "" }, { "docid": "116f8a9b7c3bf130f83b63b2e962744f", "score": "0.5052057", "text": "exists(item, list) {\n return list.indexOf(item) > -1\n }", "title": "" }, { "docid": "4fffe473f2af77a52749fe1b62abb4fc", "score": "0.5044983", "text": "function isInDatabaseByPK(tablename, pkname, pkval) {\n var record;\n if (pkval === undefined || pkval === null) {\n return false;\n }\n // Silly code if no real database\n if (mocktables[tablename] === undefined) {\n return false;\n }\n for (record = 0; record < mocktables[tablename].length; ++record) {\n if (mocktables[tablename][record][pkname] === pkval) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "3bb6e6dddb54abb88c5b9d797f1e847f", "score": "0.5030646", "text": "function _check_if_exist_change(){\n try{\n var is_make_changed = false;\n\n\n if(_is_make_changed){\n is_make_changed = true;\n }else{\n var db = Titanium.Database.open(self.get_db_name());\n var rows = db.execute('SELECT * FROM my_'+_type+' WHERE status_code=1 and company_id=? and id=?',_selected_company_id,_selected_job_id); \n if(rows.isValidRow()){\n if((!is_make_changed)&&(_client_id != rows.fieldByName('client_id'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_sub_number != rows.fieldByName('sub_number'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_unit_number != rows.fieldByName('unit_number'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_street_number != rows.fieldByName('street_number'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_street != rows.fieldByName('street'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_street_type_id != rows.fieldByName('locality_street_type_id'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_street_type != rows.fieldByName('street_type'))){\n is_make_changed = true;\n } \n if((!is_make_changed)&&(_suburb_id != rows.fieldByName('locality_suburb_id'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_suburb != rows.fieldByName('suburb'))){\n is_make_changed = true;\n } \n if((!is_make_changed)&&(_postcode != rows.fieldByName('postcode'))){\n is_make_changed = true;\n } \n if((!is_make_changed)&&(_state_id != rows.fieldByName('locality_state_id'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_order_source_code != rows.fieldByName('order_source_code'))){\n is_make_changed = true;\n } \n if((!is_make_changed)&&(_order_reference != rows.fieldByName('order_reference'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_site_or_sp_name != rows.fieldByName('sp'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_job_status_code_hide_id_value != rows.fieldByName(_type+'_status_code'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_due != rows.fieldByName('due'))){\n is_make_changed = true;\n } \n if((!is_make_changed)&&(_job_title != rows.fieldByName('title'))){\n is_make_changed = true;\n }\n if(_type === 'job'){\n if((!is_make_changed)&&(_job_priority_code_hide_id_value != rows.fieldByName(_type+'_priority_code'))){\n is_make_changed = true;\n }\n } \n }\n db.close();\n }\n \n return is_make_changed;\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _check_if_exist_change');\n return false; \n } \n }", "title": "" }, { "docid": "23475307ba5a0c098df1a3f66a9b5db1", "score": "0.50270164", "text": "checkUrlforUnic(url) {\n this.collection = JSON.parse(localStorage.getItem(\"urlCollection\"));\n if (this.collection) {\n // this.isUrlNotUnic = Boolean(this.collection.find(objCard => objCard.url === this.input.value));\n this.isUrlNotUnic = Boolean(\n this.collection.find(objCard => objCard.url.match(this.inputValue))\n );\n if (this.isUrlNotUnic) {\n alert(\"This url has been already added\");\n return this.isUrlNotUnic;\n }\n } else return (this.isUrlNotUnic = false);\n }", "title": "" }, { "docid": "1c8310db9400877483eb0a59136d13ed", "score": "0.50211954", "text": "function userExist(name){\n\tdb.collection('profiles', function(err, collection) {\n\t\tcollection.findOne({'name': name}, function(err, item) {\n\t\t\tif(item){ return true; }\n\t\t\telse{ return false; }\n\t\t});\n\t});\n}", "title": "" }, { "docid": "de46f104f0d1b492f69e356a7c4ce0e8", "score": "0.5019828", "text": "function getCorrespondingEntry(entry, list){\n\tfor(var i = 0; i < list.length; i++){\n\t\tif(list[i].name === entry.name){\n\t\t\treturn list[i];\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "0ec2affbbc0dd04952c373d7237956df", "score": "0.5018498", "text": "existsLocally (obj) {\n let exists = false;\n const status = this.getStatus(obj);\n if (status && (status.indexOf(EXISTS_LOCALLY) !== -1)) {\n exists = true;\n }\n return exists;\n }", "title": "" }, { "docid": "61e7931c5131d16f71bdd02a7221d4d3", "score": "0.50060856", "text": "function keyExists(value, obj) {\n // Get all the keys from the database object\n let keyList = Object.keys(obj);\n for (let i = 0; i < keyList.length; i++) {\n if (value.toLowerCase() === keyList[i].toLowerCase()) {\n return keyList[i];\n }\n }\n return false;\n }", "title": "" }, { "docid": "2884025c767356a732aa787f8e69c94c", "score": "0.50014126", "text": "function matchingEntry(entry1, entry2) {\n if (entry1.id == null) {\n return entry1.localId == entry2.localId;\n } else {\n return entry1.id == entry2.id;\n }\n }", "title": "" }, { "docid": "17eb1ec683402f3a5635e64812b71967", "score": "0.49766675", "text": "function checkExist(array, target){\n\tfor(var i=0;i<array.length;i++)\n\t{\n\t\tif(array[i].name === target)\n\t\t\treturn true;\n\t}\t\n\treturn false\n}", "title": "" }, { "docid": "907fbc3ed41e0f99ecdc6ace0cfb0f75", "score": "0.49747017", "text": "exists(callback,whr=false) {\n\t\tthis.get(callback,whr, \"exists\");\n\t}", "title": "" }, { "docid": "2afe1aed90fad3c6d5b3baae1078e24a", "score": "0.49726003", "text": "has(aStr) {\n\t return this._set.has(aStr);\n\t }", "title": "" }, { "docid": "d52471731a011b82d189e29831697848", "score": "0.49626997", "text": "function tag_exists(tag) {\n var tag = $.trim(tag.toLowerCase());\n var found = false;\n $(wrapper_sel+' '+tag_sel).each(function() {\n if($.trim($(this).text().toLowerCase()) == tag) {\n found = true;\n return;\n }\n });\n return found;\n }", "title": "" }, { "docid": "388e08785e9c12dfdd38f61fc1abffaf", "score": "0.49623197", "text": "function checkIfProductExists(ans) {\n var query = \"SELECT * FROM products WHERE ?;\";\n\n connection.query(\n query,\n {\n product_name: ans.product\n },\n function(err, res) {\n if (err) throw err;\n\n // prevents duplicate products from being added by checking the length of res. if res.length > 0, then the product exists in the db\n if (res.length > 0) {\n console.log(\"Product already exists!\");\n returnPrompt();\n } else {\n addProductToDb(ans);\n }\n }\n );\n}", "title": "" }, { "docid": "318e4db2f5e6c146e6c3a16548fb9454", "score": "0.49572104", "text": "function enUsCheck(tin) {\n return enUsGetPrefixes().indexOf(tin.substr(0, 2)) !== -1;\n}", "title": "" }, { "docid": "bafbf9145256341c85e9c82e38d5b1d7", "score": "0.49531424", "text": "exists() {\n throw new Error('Not implemented yet')\n }", "title": "" }, { "docid": "b0ee3c7f297d69ce9fbce7957e373dfc", "score": "0.4947326", "text": "check(item_id) {\n let exist = false;\n if (this.tableBasket.length > 0){\n for(let lineArticle of this.tableBasket){\n if (lineArticle._id == item_id){\n exist = true;\n }\n } \n }\n return exist;\n }", "title": "" }, { "docid": "d0c085d2ddcf2b682c7153cfc91e676c", "score": "0.49420092", "text": "has(aStr) {\n return this._set.has(aStr);\n }", "title": "" }, { "docid": "d0c085d2ddcf2b682c7153cfc91e676c", "score": "0.49420092", "text": "has(aStr) {\n return this._set.has(aStr);\n }", "title": "" }, { "docid": "967444321a1e87e96cae4410e254c719", "score": "0.4938801", "text": "function _check_if_exist_change(){\n try{\n var is_make_changed = false;\n if(_is_make_changed){\n is_make_changed = true;\n }else{ \n var db = Titanium.Database.open(self.get_db_name());\n var rows = db.execute('SELECT * FROM my_'+_type+'_site_contact WHERE id=?',_selected_job_site_contact_id);\n if(_site_contact_title_id != rows.fieldByName('salutation_code')){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_site_contact_first_name != rows.fieldByName('first_name'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_site_contact_last_name != rows.fieldByName('last_name'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_site_contact_mobile != rows.fieldByName('phone_mobile'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_site_contact_phone != rows.fieldByName('phone'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_site_contact_phone_work != rows.fieldByName('phone_work'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_site_contact_email != rows.fieldByName('email'))){\n is_make_changed = true;\n }\n if((!is_make_changed)&&(_site_contact_note != rows.fieldByName('note'))){\n is_make_changed = true;\n } \n if((!is_make_changed)&&(_is_primary_contact != rows.fieldByName('is_primary_contact'))){\n is_make_changed = true;\n } \n rows.close();\n db.close(); \n }\n return is_make_changed;\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _check_if_exist_change');\n return false; \n } \n }", "title": "" }, { "docid": "032ed2076632f33461a932d247fe17fb", "score": "0.49294892", "text": "function listDictionaryIsValid(parentName, d, s) {\n var choices = s.get(\"choices\");\n\n var key = choices;\n var n = 1;\n if (s.gettype(\"choices\") == \"array\") {\n n = choices.length;\n }\n\n // Check that d contains a valid choice\n var choiceValid = false;\n\n var t = s.get(\"listType\");\n if (t == \"object\") {\n for (var i = 0; i < n; ++i) {\n if (n > 1) {\n key = choices[i];\n }\n if (d.contains(key)) {\n choiceValid = true;\n break;\n }\n }\n }\n else {\n post(d + \"\\n\");\n }\n if (!choiceValid) {\n error(\"In \" + parentName + \" : invalid choice key \\\"\" + key + \"\\\"\\n\");\n return false;\n }\n\n return unpackKey(parentName, d, key, s);\n}", "title": "" }, { "docid": "6c94b10c58a76ae1f824f0b44682e9c3", "score": "0.4925253", "text": "function existsInWorld( objectName )\n{\n for( let index = 0; index < world.objects.length; index++ )\n {\n if( world.objects[ index ][ \"name\" ] == objectName )\n {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "f23d193ee9fe352c721cd9b72167fa2b", "score": "0.49224624", "text": "function is_name(stmt) {\n return is_tagged_list(stmt, \"name\");\n}", "title": "" }, { "docid": "f23d193ee9fe352c721cd9b72167fa2b", "score": "0.49224624", "text": "function is_name(stmt) {\n return is_tagged_list(stmt, \"name\");\n}", "title": "" }, { "docid": "082a5d22b755318cfa51995a68a1c6e4", "score": "0.49163425", "text": "function checkValidKeyNames(diagram,tree,ext) {\n var bool = false;\n for (var x in diagram.nodeDataArray) {\n if (diagram.nodeDataArray[x].category == \"LinkLabel\") {\n continue;\n }\n if (diagram.nodeDataArray[x].category == \"external\") {\n if (ext.includes(diagram.nodeDataArray[x].key)) {\n continue;\n }\n else {\n bool = true;\n break;\n }\n }\n var result = findObjectById(tree,diagram.nodeDataArray[x].key);\n if (!result) {\n bool = true;\n break;\n }\n }\n if (bool) {\n return true;\n }\n else {\n return false;\n }\n }", "title": "" } ]
3120711111d690c689dc7715469c775d
Updates the message log. Displays the new log.
[ { "docid": "f99bdaf590c3ba30ce88660f8bbbde23", "score": "0.0", "text": "function sendMessage(text) {\n messages.shift();\n messages.push(text);\n var table = document.getElementById(\"messageLog\");\n if (table != null) {\n for (var i = 0; i < table.rows.length; i++) {\n var row = table.rows[i];\n row.cells[0].innerHTML = messages[i];\n }\n }\n}", "title": "" } ]
[ { "docid": "e7d1b6892c8e405f72785ece6394c810", "score": "0.6758852", "text": "function logUpdate(msg) {\r\n d = new Date();\r\n console.log(d.getFullYear() + \"-\" + (d.getMonth() + 1) + \"-\" + d.getDate() + \" \"\r\n + d.getHours() + \":\" + (d.getMinutes() < 10 ? \"0\"\r\n + d.getMinutes() : d.getMinutes()) + \": \" + msg);\r\n}", "title": "" }, { "docid": "f769fcd85aa3ca96ec1ca284f1eb3ab3", "score": "0.65892285", "text": "function updateMessages() {\n var getMessagesCallback = function (messages) {\n // empty message log\n $('.messages').empty();\n\n for (var i = 0; i < messages.length; i++) {\n var message = messages[i];\n $('.messages').append(formatMessage(message));\n }\n };\n\n getMessages(getMessagesCallback);\n}", "title": "" }, { "docid": "fe613ba7579dcc88d263c167a8e21395", "score": "0.6579", "text": "function updateGameLog(m){\n if (m != gameMessages[0]){\n let msgLog = \"\"\n if (m){\n gameMessages.unshift(m)\n }\n let index = 0\n for (let msg of gameMessages){\n let color = index == 0 ? \"highlight\" : \"normal\";\n msgLog += `\n <p class=\"${color}\">${msg}</p><hr>\n `\n index++\n }\n document.getElementById(\"game-log\").innerHTML = msgLog\n }\n}", "title": "" }, { "docid": "b94cec383024e4310adfffe850d870fc", "score": "0.6501747", "text": "function log(message) {\n var now = new Date();\n var time = now.toLocaleTimeString(getLocale());\n\n $('#message_area').append(`<li>[${time}] ${message}</li>`);\n $(\"#message_area\")[0].scrollTop = $(\"#message_area\")[0].scrollHeight;\n}", "title": "" }, { "docid": "4b97f9968a7e138562c9bc1eb5ad91b3", "score": "0.64572257", "text": "function log(message) {\n logger.innerHTML = logger.innerHTML + message + \"<br/>\";\n }", "title": "" }, { "docid": "ad12f0394496e0c833290b15aa123851", "score": "0.63920087", "text": "function outputLog(message) {\n var now = new Date();\n $(output).append('<em>' + now.toLocaleTimeString() + '</em> ' + message + '<br />').scrollTop(output[0].scrollHeight);\n }", "title": "" }, { "docid": "54619a5b80377ff1d315688ecc05c201", "score": "0.6347595", "text": "function refreshLogs()\n{\n\t$(\"#debugger-msgs\").RemoveAndDeleteChildren()\n\tfor(var i=0; i<logTable.length; i++){\n\t\tif(currentFilter === \"all\" || currentFilter === logTable[i].type){\n\t\t\tvar panel = $.CreatePanel(\"Panel\", $(\"#debugger-msgs\"), \"\");\n\t\t\tpanel.AddClass(\"debugger-msg\");\n\t\t\tpanel.AddClass(\"debug-\"+logTable[i].type);\n\t\t\tvar label = $.CreatePanel(\"Label\", panel, \"\");\n\t\t\tlabel.text = logTable[i].msg;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9e1095c0696fa38d8887d9890dd2ea6b", "score": "0.6313424", "text": "function log(message) {\n var log = document.getElementById('log');\n if (!log) return;\n\n log.style.visibility = 'visible';\n log.innerHTML += '<p>' + encodeHtml(message) + '</p>';\n log.scrollTop = log.scrollHeight;\n}", "title": "" }, { "docid": "7a8bb4ce0818f4c4176f6e2e6a1f7ad9", "score": "0.6246764", "text": "async updateLogMessages_() {\n const messages = await sendWithPromise('getLogMessages');\n\n if (messages.length !== this.logMessages_.length) {\n this.logMessages_ = messages;\n this.dispatchEvent_('logMessagesChange');\n }\n // check again in 250 ms\n window.setTimeout(this.updateLogMessages_.bind(this), 250);\n }", "title": "" }, { "docid": "9814543d6b322cde46aed13653933f63", "score": "0.6224399", "text": "function update_chatlogs(log) {\n\n chatlogs.push(log);\n if (chatlogs.length > maxlines) {\n chatlogs.shift();\n }\n\n}", "title": "" }, { "docid": "1b7f7562e32134a19a99eb1032826a24", "score": "0.6222064", "text": "function log(msg) {\n if (msg==\"\") return;\n var date = new Date();\n var logmsg = date.getMonth() + \"/\" + date.getDate() + \"/\" + date.getFullYear() + \" -> \" + msg;\n logString += logmsg + \"<br>\";\n document.getElementById(\"log\").innerHTML = logString;\n }", "title": "" }, { "docid": "3c866597494611c43d8c8cdc581b9243", "score": "0.6167477", "text": "function addToLogger(message) {\n logMessages.push(message);\n //Only show the last 3 messages.\n logger.innerHTML = `${logMessages.slice(logMessages.length - 3, logMessages.length).join('<br/>')}`;\n}", "title": "" }, { "docid": "a9792154b5ae719508b0a119fb98cfd7", "score": "0.6163721", "text": "function refreshlog(){\n loadstart();\n send_message({event: 2801}, namespace='admin');\n}", "title": "" }, { "docid": "d4505176ea1c0f6eca3c64067bc0cbf6", "score": "0.61319536", "text": "update() {\n //update output\n var output = this.buildText();\n\n this.output.full_text = output.text;\n this.output.short_text = output.text;\n this.output.urgent = output.urgent;\n\n //emit updated event to i3Status\n this.emit('updated', this, this.output);\n }", "title": "" }, { "docid": "e4b717549729f77cac2e2d7cef5e7eaa", "score": "0.6125487", "text": "function updateDisplay(message) {\r\n message = message;\r\n var ta = document.getElementById(\"taGame\");\r\n ta.value = \">:\" + \" \" + message + \"\\n\" + ta.value;\r\n }", "title": "" }, { "docid": "b4aa36ccee7afa02e67164343d262721", "score": "0.61145914", "text": "function print_new_messages(messages) {\n var str, len = messages.length;\n for (var i = num_new_messages; i > 0; i--) {\n var m = messages[len - i];\n str += m.line-1 + \": \" + m.text + \"\\n\";\n }\n results.session.setValue(str);\n num_new_messages = 0;\n}", "title": "" }, { "docid": "6dd11d750b431cec8b776a09b9379387", "score": "0.610296", "text": "function updateMessage() {\n\n\tvar el = document.getElementById('message');\n\n\tel.textContent = msg;\n}", "title": "" }, { "docid": "43c5e2824501bec239a9aeb88d7cafc0", "score": "0.6097837", "text": "function log(message){\n message = _.escape(message);\n $log.children(\".loglist\").append(\"<li>\" + message + \"</li>\");\n $log.scrollTop( $log.prop(\"scrollHeight\") );\n }", "title": "" }, { "docid": "f032f48358249bcf084ed9f14dbf9424", "score": "0.6084802", "text": "function updateMessages(displayData) {\n\tmessageBox.innerHTML = displayData;\n}", "title": "" }, { "docid": "abc80f260c39b5f8d84fa35c4500f23b", "score": "0.6065136", "text": "function updateMessages () {\n ctrl.messages = [ getCountMessage(), getCurrentDisplayValue() ];\n }", "title": "" }, { "docid": "d9cdb92faaa457df604af001f1ce0705", "score": "0.6032688", "text": "function updateNewMessage(data) { \n $('#chat_messages').append(data.message + '<br />');\n}", "title": "" }, { "docid": "850d3e65c6a053a69776175eef5a762b", "score": "0.60310227", "text": "function log(msg)\n{\n\t$(\"#logs\").append(msg + \"<br />\");\n\t$(\"#logs\").animate({ scrollTop: $(\"#logs\")[0].scrollHeight}, \"slow\");\t\n}", "title": "" }, { "docid": "6c8c78e4160dc953e0edf097f8e83cd8", "score": "0.6003891", "text": "function updateMessage(){\n\t\t var strDotsMessage = \"Updating Session.\";\n\t\t for(x=0;x<intDotCount;x++)strDotsMessage+=\".\";\n\t\t document.getElementById(\"divAjaxContent\").innerHTML = strDotsMessage;\n\t\t intDotCount++;\n\t\t if(intDotCount>4)intDotCount = 0;\n\t\t}", "title": "" }, { "docid": "210b1d0bc85ee752548793e6fda379a6", "score": "0.598026", "text": "function updateChatPanel(user, message) {\n var now = moment().format();\n insert(\"chat\", \"<p>\" + now + \", \" + user + \": \" + htmlEscape(message) + \"</p>\");\n}", "title": "" }, { "docid": "2f77dfe4495335a4d0654e06fc742d7d", "score": "0.59579444", "text": "function updateMessageView(messages) {\n if (typeof messages === \"undefined\") return \"\";\n let formattedMessages = \"\";\n messages.map(\n (m) =>\n (formattedMessages += `<p><strong>${m.username}</strong>: ${m.message.text} <p>`)\n );\n document.getElementById(\"messageContainer\").innerHTML = formattedMessages;\n updateScroll();\n}", "title": "" }, { "docid": "d960b117255b74fbfddfa736854c85b1", "score": "0.59496236", "text": "function updateLastMessage(data) {\n state.lastMessageTime = Math.floor(data.time / 1000);\n state.lastMessage = data.msg.trim().replace(/\\s\\s+/g, ' ');\n state.lastUser = data.username;\n}", "title": "" }, { "docid": "2ecdf3d83d6b166e27258293d926b8d6", "score": "0.59305876", "text": "function displayOldMsg(data) {\n $chat.append('<span class=\"oldmsg\"><b>' + data.nick + ': </b>' + data.msg + \"</span><br/>\");\n }", "title": "" }, { "docid": "b731c8e54f9e779c5756f190a94d4a86", "score": "0.59074974", "text": "function updateMessage() {\n var el = document.getElementById('message');\n el.textContent = msg;\n}", "title": "" }, { "docid": "da665d154cd8cb1056778f8452682073", "score": "0.58853394", "text": "function update(msg) {\n insert(\"chat\", msg.data);\n}", "title": "" }, { "docid": "88a6eff1d1d85d5f04565ad609cd8aad", "score": "0.5882178", "text": "function updateLogs(student, action) {\n let text = `\\n${action}: ${student.firstName} ${student.lastName}, ${student.id}, ${student.major}`\n logs.value += text\n}", "title": "" }, { "docid": "650cee60ef2cc19d1a22f4406c70ed2a", "score": "0.5871559", "text": "addLog(messageObject) {\n let message = {};\n message.timestamp = Date.now();\n message.message = JSON.stringify(messageObject);\n message.component = Popup.getTranslation(\"generic_unknown\", \".Unknown\");\n message.level = Popup.getTranslation(\"generic_internalError\", \".Internal Error\");\n if (messageObject.hasOwnProperty(\"timestamp\")) message.timestamp = messageObject.timestamp;\n if (messageObject.hasOwnProperty(\"message\")) message.message = messageObject.message;\n if (messageObject.hasOwnProperty(\"component\")) message.component = messageObject.component;\n if (messageObject.hasOwnProperty(\"level\")) message.level = messageObject.level;\n\n // simple duplicate message detection\n if (this.tmpLastLogMessage === message.message) return;\n\n // get info for article from storage\n let log = this.getLog();\n console.debug(\"Biet-O-Matic: addLog(%s) info=%s\", this.articleId, JSON.stringify(message));\n if (log == null) log = [];\n log.push(message);\n window.localStorage.setItem(\"log:\" + this.articleId, JSON.stringify(log));\n // inform local popup about the change\n const row = Popup.table.getRow(\"#\" + this.articleId);\n if (row != null && row.length === 1) {\n // update child info, but drawing will be separate\n row.child(ArticlesTable.renderArticleLog(this));\n Popup.redrawTableCell(this.articleId, \"articleDetailsControl:name\");\n }\n // for duplicate message detection\n this.tmpLastLogMessage = message.message;\n }", "title": "" }, { "docid": "6165d3c9935da5e8622474350e52ded0", "score": "0.58595026", "text": "static informUpdate(data) {\n this.postWindowMessage({\n from: constants.METAL_DEVTOOLS_BACKEND,\n message: {\n data,\n type: constants.UPDATE\n }\n });\n }", "title": "" }, { "docid": "047496a2ad55fee182bd27c9485c5ecb", "score": "0.5857831", "text": "function log_add(LogMessage) {\n\t\n\t$(\"#Log\").html(\"\"); \n\tlog.push(getDateTime() + \" \" + LogMessage);\n\t\n\tif(log.length>log_show_amount) {\n\t\tstart = log.length - log_show_amount;\n\t\t} else {\n\t\tstart = 0;\n\t}\t\n\t\n\t$(\"#Log\").append(\"<div class='VideoHeadline'>Log</div>\");\n\tfor (i=start;i<log.length;i++) {\n\t\t$(\"#Log\").append(\"<div class='VideoSubtitle'>\"+log[i]+\"</div>\");\n\t}\n\t$(\"#Log\").append(\"<div class='VideoBottom'><button class='btn btn-default btn-xs' onclick='log_view()'>View complete log</button></div>\");\n}", "title": "" }, { "docid": "c086053111afbb24cf2a0bc527999d6f", "score": "0.58481115", "text": "function updateGameLog(){\n\t\tvar gameLog = document.getElementById(\"game-log\"); // stores HTML node that tracks the final outcome of all previous games\n\t\tvar finishedGame = document.createElement(\"li\"); // creates new list element\n\t\tvar logText; // will be innerHTML/text for finishedGame\n\t\tif(playerWon === 1){\n\t\t\tlogText = document.createTextNode(\"Player X won\");\n\t\t} else if (playerWon === 2){\n\t\t\tlogText = document.createTextNode(\"Player O won\");\n\t\t} else {\n\t\t\tlogText = document.createTextNode(\"Cat's game (tie)\");\n\t\t}\n\t\tfinishedGame.appendChild(logText); // adds game history text to li element\n\t\tgameLog.appendChild(finishedGame); // adds li record to ol list\n\t}", "title": "" }, { "docid": "033681322f8d3f5a2a31b973de4bad12", "score": "0.5836843", "text": "function statusUpdate(message, error) {\n let displayMessage = \"\";\n if (error) {\n displayMessage += \"<span style=\\\"color: #ff0000;\\\">\" + message + \"</span><br /><br />\";\n } else {\n displayMessage = message + \"<br /><br />\";\n }\n\n document.getElementById(\"feedback\").innerHTML = displayMessage;\n }", "title": "" }, { "docid": "3739a25728d014838c57c50d38cbc2ec", "score": "0.58339846", "text": "function updatePanel(msg) {\n var message = msg.message;\n\n if (message.hasOwnProperty(\"tag\")) {\n updateTag(message.tag);\n };\n if (message.hasOwnProperty(\"attributes\")) {\n updateAttributes(message.attributes);\n };\n if (message.hasOwnProperty(\"ancestry\")) {\n updateAncestry(message.ancestry);\n };\n if (message.hasOwnProperty(\"data\")) {\n updateData(message.data);\n };\n}", "title": "" }, { "docid": "e025fe69bb95829068389eb93647109a", "score": "0.5833114", "text": "function log() {\n if (__DEBUG__) {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n displayBuffer.msgs = displayBuffer.msgs.concat([].concat(args, ['\\n']));\n }\n}", "title": "" }, { "docid": "e025fe69bb95829068389eb93647109a", "score": "0.5833114", "text": "function log() {\n if (__DEBUG__) {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n displayBuffer.msgs = displayBuffer.msgs.concat([].concat(args, ['\\n']));\n }\n}", "title": "" }, { "docid": "2466e805fdc0cb9a401fa0bcf67c2a2c", "score": "0.58304524", "text": "function displayMessage(message){\n\t\tdatabase.child(\"message\").set(message);\n\t}", "title": "" }, { "docid": "84512f7c3c723e777a516e18668679d5", "score": "0.58281225", "text": "function log() {\n if (__DEBUG__) {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n displayBuffer.msgs = displayBuffer.msgs.concat([].concat(args, ['\\n']));\n }\n}", "title": "" }, { "docid": "0618ebd8dc9ebc6cb0d55e303a33e3b3", "score": "0.58094925", "text": "function outputMessage(msg) {\n console.log(\"got new event\" + msg);\n location.reload();\n }", "title": "" }, { "docid": "8eeac304ac27f59c2dd69f235419b229", "score": "0.5802423", "text": "function messageUpdate(msg, color = '#000', bgcolor = '#FFF') {\n $('.lastmsg').html(\"<span>\" + msg + \"</span>\").css({'color':color,'background-color':bgcolor});\n}", "title": "" }, { "docid": "752300ddb89c8dd0d901523ab6061adb", "score": "0.57989687", "text": "function updateView() {\n document.getElementById('container').innerText = JSON.stringify(store.getState().messages);\n}", "title": "" }, { "docid": "df2641ef3410f8314fc9c4fef284c01a", "score": "0.5793115", "text": "function log(level, msg) { \t\t\t\t \n\t\tif (isEnabled) { \n\t\t\t// increment count \n\t\t\tmessageCounter +=1; \n\t\t\t$(com_ub_utilities_loggerjs_ns_instance+'_frame').innerHTML \n\t\t\t= 'LogViewer:' + messageCounter; \n \n\t\t\tvar viewPallate =$(com_ub_utilities_loggerjs_ns_instance + \n\t\t\t '_view'); \n\t\t\t \n\t\t\tif (viewPallate.childNodes.length == 0 ) { \n\t\t\t\tviewPallate.appendChild(append(level,msg)); \n\t\t\t} else { \n\t\t\t\tviewPallate.insertBefore(append(level,msg),viewPallate.childNodes[0]); \n\t\t\t} \n \t\t} \n \t}", "title": "" }, { "docid": "7acf000134785e9be77f34449a8a3755", "score": "0.5784587", "text": "function success_update (resp) {\r\n\t\r\n\tvar response = resp.responseText;\r\n\tvar current_message = response.evalJSON();\r\n\r\n\t// Checks if the message is duplicated\r\n\tfor (var i = 0; i < all_messages.length; i++){\r\n\t\tif (all_messages[i].id === current_message.id){\r\n\t\t\tnotification.info(translator.getLabel('duplicated_message_error'));\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\t\r\n\tclear_message();\r\n\r\n\tposted_msg.set(replace_html_entities( aux_posted_msg ));\r\n\taux_posted_msg = '';\r\n\t\r\n\tcurrent_page = 1;\r\n\t\r\n\tfor (var j = all_messages.length; j != 0 ; j--){\r\n\t\tall_messages[j] = all_messages[j-1];\r\n\t}\r\n\t\r\n\tall_messages[0] = current_message;\r\n\t\r\n\tvar msgs_cont = document.getElementById('message_container'); \r\n\tif (msgs_cont){\r\n\t\tmsgs_cont.innerHTML = '';\r\n\t\tprint_messages(msgs_cont);\t\r\n\t}\r\n}", "title": "" }, { "docid": "7b8095e05b3b5ac7959dcbe2016c8a00", "score": "0.5769297", "text": "static AddNewLineToLog(text)\n {\n GVars.InfoLog().value += text + \"\\n\\n\";\n GVars.InfoLog().scrollTop = GVars.InfoLog().scrollHeight;\n }", "title": "" }, { "docid": "cfabbda7150cd2b53bd7ed8175ae9278", "score": "0.5750273", "text": "function updateHistoryTextArea(playerAction, message) {\n var historyTextArea = document.getElementById(\"taHistory\");\n if (historyTextArea.value === \"\") {\n historyTextArea.value = \"[\" + playerAction + \"]\" + \"\\n\\n\" + message + \"\\n\";\n } else {\n historyTextArea.value = historyTextArea.value + \"\\n\" + \"[\" + playerAction + \"]\" + \"\\n\\n\" + message + \"\\n\";\n }\n historyTextArea.scrollTop = historyTextArea.scrollHeight\n }", "title": "" }, { "docid": "ddc4c61cc08eb883a86dd199aa7fa4c8", "score": "0.5742651", "text": "function updateChatHistory(user, call, message, localmessage) {\r\n var callIdClass = \".\" + callController.getCallId(call),\r\n Digital = new Date(), hours = Digital.getHours(),\r\n minutes = Digital.getMinutes(), seconds = Digital.getSeconds(), dn = \"AM\";\r\n if (hours > 12) {\r\n dn = \"PM\";\r\n hours = hours - 12;\r\n }\r\n if (hours == 0) {\r\n hours = 12;\r\n }\r\n if (minutes <= 9) {\r\n minutes = \"0\" + minutes;\r\n }\r\n if (seconds <= 9) {\r\n seconds = \"0\" + seconds;\r\n }\r\n var text = \"(\" + hours + \":\" + minutes + \":\" + seconds + \" \" + dn + \") \" + user + \":\";\r\n\r\n if (localmessage) {\r\n text += \"<span style='font-weight: bold;'>\" + message + \"</span><br>\";\r\n } else {\r\n text += \"<span>\" + message + \"</span><br>\";\r\n }\r\n $(callIdClass + \" .display-datachannel\").append(text);\r\n $(callIdClass + \" .display-datachannel\").animate({\r\n scrollTop: $(callIdClass + \" .display-datachannel\")[0].scrollHeight}, 1000);\r\n }", "title": "" }, { "docid": "ea70041ece6216956365f28e5c944814", "score": "0.57057995", "text": "update(){\n\t\tthis.updateFramerate();\n\t\tthis.createFooterText();\n\t\tif(this.ShowControls){\n\t\t\tthis.createControlText();\n\t\t}\n\t\tif (this.ShowHelp){\n\t\t\tthis.createHelpText();\n\t\t}\n\t}", "title": "" }, { "docid": "6ab4c8775be7627939d9ea4475bea332", "score": "0.5704258", "text": "function updateMessages () {\n getCurrentDisplayValue().then(function (msg) {\n ctrl.messages = [ getCountMessage(), msg ];\n });\n }", "title": "" }, { "docid": "6ab4c8775be7627939d9ea4475bea332", "score": "0.5704258", "text": "function updateMessages () {\n getCurrentDisplayValue().then(function (msg) {\n ctrl.messages = [ getCountMessage(), msg ];\n });\n }", "title": "" }, { "docid": "6ab4c8775be7627939d9ea4475bea332", "score": "0.5704258", "text": "function updateMessages () {\n getCurrentDisplayValue().then(function (msg) {\n ctrl.messages = [ getCountMessage(), msg ];\n });\n }", "title": "" }, { "docid": "8b5096d746805ecfb1c2ddeaf6bb391d", "score": "0.5695063", "text": "function load() {\r\n $.ajax({\r\n url: '/log',\r\n success: function(data) {\r\n $('#log').text(data.content);\r\n update();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "4103e26dc1b554f39e704bcc8b444b5e", "score": "0.568514", "text": "function refresh() {\n\t// if the entry box isn't empty and this is a new entry, add the new entry to the list and reset the box before refreshing\n\t// whatever the case, we refresh the list checking\n\tif (newEntryForm.entry.value !== '' && newEntryCheck === true) {\n\t\tlog.removeAttribute('class', 'hidden');\n\t\tlogList.push(newEntryForm.entry.value);\n\t}\n\t// clear out all the old stuff in the log\n\tlog.innerHTML = '';\n\n\t// create a new entry for each item in the list of entries and a divider to follow it\n\tfor (var i = 0; i < logList.length; i++) {\n\t\tvar newItm = document.createElement('div');\n\t\tvar txt = document.createElement('span');\n\t\tvar divider = document.createElement('div');\n\t\t// give each entry an id based on its position in the list array so we can find it and do stuff to it later\n\t\ttxt.innerHTML = logList[i];\n\t\tnewItm.setAttribute('id', 'item' + i);\n\t\ttxt.setAttribute('class', 'text')\n\t\ttxt.setAttribute('id', 'itemText' + i);\n\t\tdivider.setAttribute('class', 'divider');\n\t\tnewItm.innerHTML = '<input type = \"checkbox\" id = \"completed' + i + '\"/><input type = \"button\" class = \"button\" id = \"delete' + i + '\" onClick = \"deleteEntry(' + i + ')\" value = \"Delete\"/><input type = \"button\" class = \"button\" id = \"edit' + i + '\" onClick = \"editEntry(' + i + ')\" value = \"Edit\"/>';\n\t\t// stick everything together and add the new entry to the log\n\t\tnewItm.appendChild(txt);\n\t\tlog.appendChild(newItm);\n\t\t// if this is the last entry to be created, we don't need a divider\n\t\tif (logList.length !== 1 && i < logList.length - 1) {\n\t\t\tlog.appendChild(divider);\n\t\t}\n\t};\n\n\tnewEntryForm.entry.value = '';\n\tnewEntryForm.entry.focus();\n}", "title": "" }, { "docid": "582c014bb4259c488f6730b276638eeb", "score": "0.56812197", "text": "function log( msg ) {\n\t$(\"#logdiv\").append( msg + \"<br>\");\n\t$(\"#logdiv\").attr({ scrollTop: $(\"#logdiv\").attr(\"scrollHeight\") });\n}", "title": "" }, { "docid": "0a4cf3b6d803e9a1a9213f0b64ec2be2", "score": "0.56807566", "text": "function updateCoreDisplays(playerAction, message) {\n updateHistoryTextArea(playerAction, message);\n updateStatusTextArea();\n clearTxtCommand();\n setBtnTxtCommand();\n resetTxtCommandPlaceHolder();\n focusOnTxtCommand();\n setBtnState();\n // Display currentLocale and localeVisitCount in debug textarea during development.\n updateDebugTextArea();\n }", "title": "" }, { "docid": "1dca3aa2f561ba62712fe55cbbc12a1a", "score": "0.5679142", "text": "function updates(){\n\tconsole.log(\"Day 4 feeling great!\");\n}", "title": "" }, { "docid": "6d2c9035dca734cfab55e0d5f9a13a5c", "score": "0.5677888", "text": "function restLog(message){\n\tlog_list.push(message);\n\treRenderConsole();\n}", "title": "" }, { "docid": "2e8c319d90ce9ba46140c10207c42765", "score": "0.567298", "text": "function render() {\n const lines = model.getItem('lines');\n\n if (lines) {\n if (lines.length === 0) {\n ui.setContent('log-panel', 'No log entries to show.');\n return;\n }\n\n const panel = getLogPanel();\n panel.innerHTML = '';\n lines.forEach((line) => panel.appendChild(buildLine(line)));\n\n // if we're autoscrolling, scroll to the bottom\n if (fsm.getCurrentState().state.auto || scrollToEndOnNext) {\n panel.scrollTo(0, panel.lastChild.offsetTop);\n scrollToEndOnNext = false;\n }\n } else {\n ui.setContent('log-panel', 'No log entries to show.');\n }\n }", "title": "" }, { "docid": "4d8783eeb07a3e5d84b0890611b4b68a", "score": "0.5659888", "text": "function add2log (text) {\n // if (debug_ajax != true) return ;\n var log = document.getElementById('debug_log') ;\n if (!log) return ;\n log.innerHTML = log.innerHTML + text + '<br>' ;\n} // add2log", "title": "" }, { "docid": "4765078654deef5b7e32395de8373e66", "score": "0.56572676", "text": "function showMessage(message){\n document.getElementById(\"moneyInserted\").innerHTML = message;\n writeOnLCD(message);\n }", "title": "" }, { "docid": "4b3834a6e45a0970b05aa60ef1305dc2", "score": "0.5656892", "text": "function logData(data)\n\t\t{\n\t\n\t\t\tvar logData=document.getElementById(\"loggerBox\").innerHTML+\"<br>\"+data+\"<br>\";\n\t\t\tdocument.getElementById(\"loggerBox\").innerHTML=logData;\n\t\t\tconsole.log((new Date()).getTime(),\"Incoming message\",data);\n\t\t}", "title": "" }, { "docid": "8b9f4e6910cb9a7de9bf6ae57c3c720b", "score": "0.56476814", "text": "function log(msg){\n $(\"#DebugMsgList\").prepend('<li><p>'+ msg +'</p></li>').listview( \"refresh\" );\n console.log(\"MESSAGE: \" + msg);\n}", "title": "" }, { "docid": "0b3980bff5d4e9c51f22441bc9f29869", "score": "0.5643116", "text": "updateInfo(info, shouldLogChange = true) {\n const result = {\n modifiedForStorage: 0,\n modified: [],\n };\n let messages = [];\n const checkList = {\n articleDescription: { i18nKey: \"generic_description\", defaultText: \".Description\" },\n articleCurrency: { i18nKey: \"generic_currency\", defaultText: \".Currency\" },\n articleBidPrice: { i18nKey: \"generic_price\", defaultText: \".Price\" },\n articleBidCount: { i18nKey: \"popup_numberbids\", defaultText: \".Number of Bids\" },\n articleBuyPrice: { i18nKey: \"popup_buynowprice\", defaultText: \".Buy-It-Now Price\" },\n articleShippingCost: { i18nKey: \"popup_shippingcosts\", defaultText: \".Shipping Costs\" },\n articleShippingMethods: { i18nKey: \"popup_shippingmethods\", defaultText: \".Shipping Methods\" },\n articlePaymentMethods: { i18nKey: \"popup_paymentmethods\", defaultText: \".Payment Methods\" },\n articleMinimumBid: { i18nKey: \"popup_minimumbid\", defaultText: \".Minimum Bid\" },\n articleEndTime: { i18nKey: \"popup_auctionendtime\", defaultText: \".Auction End Time\" },\n articleAuctionState: { i18nKey: \"generic_status\", defaultText: \".Status\" },\n articleImage: { i18nKey: \"generic_picture\", defaultText: \".Picture\" },\n articleAutoBid: { i18nKey: \"generic_articleAutoBid\", defaultText: \".Article Auto-Bid\" },\n articleMaxBid: { i18nKey: \"generic_articleMaxBid\", defaultText: \".Article Maximum Bid\" },\n articleGroup: { i18nKey: \"generic_group\", defaultText: \".Article Group\" },\n };\n\n for (const key in checkList) {\n if (info.hasOwnProperty(key) && info[key] !== this[key]) {\n const msg = Popup.getTranslation(checkList[key].i18nKey, checkList[key].defaultText);\n if (key === \"articleAuctionState\") {\n // only add message if StateText is present, else it (should be) HTML\n if (info.hasOwnProperty(\"articleAuctionStateText\")) {\n messages.push(Article.getDiffMessage(msg, this.articleAuctionStateText, info.articleAuctionStateText));\n this.articleAuctionStateText = info.articleAuctionStateText;\n }\n } else {\n messages.push(Article.getDiffMessage(msg, this[key], info[key]));\n }\n this[key] = info[key];\n result.modifiedForStorage++;\n if (\n key !== \"articleMaxBid\" &&\n key !== \"articleAutoBid\" &&\n key !== \"articleGroup\" &&\n key !== \"articleAuctionState\"\n )\n result.modified.push(key);\n }\n }\n\n if (shouldLogChange && result.modifiedForStorage > 0 && messages.length > 0) {\n this.addLog({\n component: Popup.getTranslation(\"generic_items\", \".Items\"),\n level: Popup.getTranslation(\"generic_updated\", \".Updated\"),\n message: messages.join(\"; \"),\n });\n }\n return result;\n }", "title": "" }, { "docid": "c4af8b151682c699fb20df77f0bdbc9f", "score": "0.5641192", "text": "function logMsg(level,msg) {\r\n\t\tif (Config_Logging_Enabled) {\r\n\t\t\t// increase the count in the handle\r\n\t\t\tnNumMsgsLogged +=1;\r\n\t\t\t$(sDOMInstance+'_handle').innerHTML=nNumMsgsLogged;\r\n\t\t\t// Append the log to a display div so it can be seen right away\r\n\t\t\tvar oDisplay =$(sDOMInstance+'_logDisplay');\r\n\t\t\tif (oDisplay.childNodes.length == 0 ) {\r\n\t\t\t\toDisplay.appendChild(createDisplayRow(level,msg));\r\n\t\t\t} else {\r\n\t\t\t\toDisplay.insertBefore(createDisplayRow(level,msg),oDisplay.childNodes[0]);\r\n\t\t\t}\r\n \t} // end of is config enabled\r\n \t}", "title": "" }, { "docid": "14661a8462346128a1127b1da323f5bf", "score": "0.5636853", "text": "function updateChat(msg) {\n insert(\"chat\", msg);\n}", "title": "" }, { "docid": "96174086a23976c1311b0de635436c03", "score": "0.56318617", "text": "function logMessage() {\n\tvar debug\t= true;\n\tif ( debug ) {\n\t\ttrace( \"In logMessage\" );\n\t}\n\n\tvar jsonStr\t= addToJSONStr( jsonStr, \"Message\", $( \"#lm_Message\" ).val());\n\tvar jsonStr\t= addToJSONStr( jsonStr, \"Tabstop\", $( \"#lm_Tabstop\" ).val());\n\n\tif ( $( \"#verbose\" ).is( \":checked\" )) {\n\t\tjsonStr\t= addToJSONStr( jsonStr, \"verbose\", \"true\" );\n\t}\n\tif ( debug ) {\n\t\ttrace( \"jsonStr = [\" + jsonStr + \"]\" );\n\t}\n\n\t$( \"#logMessageResults\" ).html( \"\" );\n\tcallDB( \"logMessage\", jsonStr, function( data ) {\n\t\tif ( debug ) {\n\t\t\ttrace( \"In logMessage anon function, data = [\" + data + \"]\" );\n\t\t}\n\n\t\tvar returnObj\t= createArray( returnObj, data );\n\t\tdumpArray( returnObj, \"logMessageResults\" );\n\n\t});\n\n\tif ( debug ) {\n\t\ttrace( \"Done logMessage\" );\n\t}\n}", "title": "" }, { "docid": "c7b1afd256f932ab89ecb0595454fd5d", "score": "0.5626881", "text": "function logging(text) {\n var textarea = document.getElementById(\"textarea_log\");\n textarea.value += \"\\n----------------\\n\";\n textarea.value += text;\n textarea.scrollTop = textarea.scrollHeight;\n }", "title": "" }, { "docid": "664709d0043aabaf0c14166a6998019e", "score": "0.56256175", "text": "function updateChat(data)\n {\n \tif (data.length > prevCountChat) {\n \t\tprevCountChat = data.length;\n\t \tvar chatbox = $(\"#chatbox\");\n\t \tchatbox.text(\"\");\n\t \tfor (var i = 0; i < data.length; i++)\n\t \t{\n\t \t\tvar time = new Date(parseInt(data[i].Timestamp.substring(6, data[i].Timestamp.length-1)));\n\t \t\tvar hour = time.getHours();\n\t \t\tvar minute = time.getMinutes();\n\t \t\tif (time.getHours() < 10) hour = \"0\" + hour;\n\t \t\tif (time.getMinutes() < 10) minute = \"0\" + minute;\n\t \t\tchatbox.append(\"[\" + hour + \":\" + minute + \"]\" + data[i].User + \" : \" + data[i].Message + \"\\n\");\n\t \t}\n\t \tchatbox.scrollTop(chatbox[0].scrollHeight);\n \t}\n }", "title": "" }, { "docid": "20c16acce67c57e6803bd6ce438a7d81", "score": "0.56251657", "text": "function log(msg) {\n $('#logs').prepend(`<pre>${msg}</pre>`);\n }", "title": "" }, { "docid": "74afdcb37a418174093cf64f97119cad", "score": "0.5624028", "text": "function appendMessage(str){\n var m = 'Last Operation:';\n if(debugPanel){\n $(\"#output\").html(m + \"<br>\" + str);\n }\n\n}", "title": "" }, { "docid": "4e79fa762eed18d047c7a2098abdcc29", "score": "0.5621796", "text": "function showMessage(message, key, logProps) {\n const newMessages = _clone(messages)\n newMessages[key] = message\n setMessages(newMessages)\n setShow(true)\n log('message-modal', { ...logProps, key })\n }", "title": "" }, { "docid": "c9a626495bb1cf3799858400653df5be", "score": "0.5620639", "text": "function updateHud(message = \"\") {\n $hud.html(`Matches: <b>${matches}/${toWin}</b> <span>${message}</span>`);\n}", "title": "" }, { "docid": "86c774357e1ba014631a3aae48864e40", "score": "0.5618671", "text": "setLog() {\n const log = document.getElementById('log');\n document.addEventListener(LoggingUtils.eventType, (e) => {\n // Add some margin so that people don't need to scroll to the very bottom\n // to make sure scrolling works.\n const scrollAtBottom =\n (log.scrollTop >= log.scrollHeight - log.clientHeight - 10);\n log.innerText += (e.message + \"\\n\");\n if (scrollAtBottom) {\n log.scrollTop = log.scrollHeight - log.clientHeight;\n }\n });\n }", "title": "" }, { "docid": "16a59c44ab81673aea1bfeac084a3175", "score": "0.5583945", "text": "function sendUpdate (event, message) {\n if (!connection) {\n return;\n }\n var data = \"\";\n if (event) {\n data += \"event: \" + event + \"\\n\";\n }\n if (message) {\n data += \"data: \" + message + \"\\n\";\n }\n data += \"\\n\"; // final part of message\n connection.write (data);\n}", "title": "" }, { "docid": "f95e6b93658aa94b5894964f450ecf55", "score": "0.5571577", "text": "function updateDeltaInfo(compass, log) {\n $('#mhc').text(compass);\n $('#sowc').text(log);\n}", "title": "" }, { "docid": "5853550d471ea8e7d724a5eddaa81cab", "score": "0.5565886", "text": "function log(msg) {\n var p = document.getElementById('log');\n p.insertAdjacentHTML(\"afterbegin\", msg + \"\\n\");\n}", "title": "" }, { "docid": "bd09c698f02eec395b1720319b420944", "score": "0.5565321", "text": "function updateMessages () { // 19255\n getCurrentDisplayValue().then(function (msg) { // 19256\n ctrl.messages = [ getCountMessage(), msg ]; // 19257\n }); // 19258\n } // 19259", "title": "" }, { "docid": "38f42e8090d3f5b1687739f3b9a9a482", "score": "0.55640596", "text": "function setMessages() {\n\tif (msgReq.readyState === 4 && msgReq.status === 200) {\n\n\t\tvar m_old = parseInt(document.getElementById(\"n-messages\").innerHTML);\n\n\t\tobj = JSON.parse(msgReq.responseText);\n\n\t\tif (obj.newmgs === \"overload\")\n\t\t\tself.location.reload();\n\n\t\telse if (obj.newmsg) {\n\n\t\t\tdocument.getElementById(\"n-messages\").innerHTML = parseInt(document.getElementById(\"n-messages\").innerHTML) + obj.newmsg;\n\n\t\t\tvar msgList = document.getElementById(\"messages\");\n\t\t\tvar canScroll = (msgList.scrollHeight - msgList.scrollTop) <= 320;\n\t\t\tvar scrolled = msgList.scrollTop;\n\n\t\t\tmsgList.innerHTML += obj.content;\n\n\t\t\tmsgList.scrollTop = scrolled;\n\n\t\t\tif (canScroll)\n\t\t\t\tmsgList.scrollTop = msgList.scrollHeight;\n\n\t\t\tvar m_new = parseInt(document.getElementById(\"n-messages\").innerHTML);\n\n\t\t\tif (m_new > m_old) {\n\t\t\t\tplayAudio(\"new-msg\");\n\t\t\t\tif (canScroll === 0)\n\t\t\t\t\tdocument.getElementById(\"skip\").style.display = \"block\";\n\t\t\t\tparent.postMessage(\"NewMsg:\"+(m_new - m_old), \"*\");\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b8efc7b65b91f0028a31bcd7f99a7ee2", "score": "0.5560932", "text": "function onUpdate( data ) {\n var translateToken = data.message;\n var preToken;\n var html= $( \"<p></p>\" );\n var className;\n \n switch ( data.type ) {\n case 'ready':\n preToken = data.user + ' ';\n className = 'status';\n $('#nickname').hide();\n $('#chat').show(); \n break;\n case 'disconnected':\n preToken = data.user + ' ';\n className = 'status';\n break;\n case 'disconnected':\n className = 'status';\n \n break;\n case 'talk':\n className = 'talk';\n translateToken = data.message;\n preToken = data.user + ': ';\n }\n \n html.addClass( className );\n html.append( preToken + translateToken );\n $('#english').append( html );\n \n //translate\n var transHTML = $( \"<p></p>\");\n transHTML.addClass( className );\n \n translate( translateToken, function( gData ){ \n transHTML.append( preToken + gData.data.translations[0].translatedText )\n $('#french').append( transHTML );\n });\n }", "title": "" }, { "docid": "04680c9a61d6d13995b88d6d91c000b8", "score": "0.5559755", "text": "function logEvent(event,display) {\n $('#archiveMessages').append(\"</br>\").append(event);\n if (display) {\n $('#gameMessage').empty().append(event);\n }\n\n }", "title": "" }, { "docid": "c6fe02883d0d79f08f99696515bd8b6d", "score": "0.5559718", "text": "function Set_New_Console_Msg(text) {\n document.getElementById(\"txtAr_Console\").value = document.getElementById(\"txtAr_Console\").value + get_Fromatted_Time().toString() + \": \" + text + \"\\n\";\n document.getElementById(\"txtAr_Console\").scrollTop = document.getElementById(\"txtAr_Console\").scrollHeight;\n }", "title": "" }, { "docid": "ed1f0e426564878bd91a2b77eb9f17e5", "score": "0.5559548", "text": "function Log(message) {\n var div = globals.debugDiv\n div.appendChild(document.createElement(\"br\"));\n div.appendChild(document.createTextNode(new Date() + \":\" + message));\n}", "title": "" }, { "docid": "152b159082c6836257a13d8b3c508131", "score": "0.5554766", "text": "function UpdateLog(){\n\tlog1.ax = ResetLog(log1.ax, log1.speed);\n\tlog1.bx = ResetLog(log1.bx, log1.speed);\n\tlog2.ax = ResetLog(log2.ax, log2.speed);\n\tlog2.bx = ResetLog(log2.bx, log2.speed);\n\tlog3.ax = ResetLog(log3.ax, log3.speed);\n\tlog3.bx = ResetLog(log3.bx, log3.speed);\n}", "title": "" }, { "docid": "ed7908f36322746c2e3a5151ed97e479", "score": "0.55543923", "text": "function showMessage(newMessage) \n\t{\n\n\t_imgManager.ddt._ddt( \"manager.js\",\"332\", \"showMessage(): top with message '\" + newMessage + \"'\" );\n\n\tvar message = document.getElementById('message');\n\tvar messages = document.getElementById('messages');\n\n\tif (message.firstChild)\n\t\tmessage.removeChild(message.firstChild);\n\n\tmessage.appendChild(document.createTextNode(i18n(newMessage)));\n\t\t\n\tmessages.style.display = \"block\";\n\t}", "title": "" }, { "docid": "a5015a0f302ab01b20b1cab99ff61f34", "score": "0.5548824", "text": "function logResults(newResult) {\n results.innerHTML += `<p>${newResult}</p>`;\n }", "title": "" }, { "docid": "b64165491eefe0bfba5edce14df82283", "score": "0.55481106", "text": "function viewLog() {\n //initializing the web page to initial state\n initialDiv();\n initialState();\n var httpurl = basic_URL + \"/log\";\n //constructing an object\n var obj = {};\n //empty the search textbox\n document.getElementById(\"search_textbox\").value = \"\";\n obj.id = user.id;\n //sending request\n var xmlHttp = buildPutRequest(httpurl, obj);\n xmlHttp.onreadystatechange = function () {\n document.getElementById(\"workingArea\").style.width = 0 + \"%\";\n document.getElementById(\"results\").style.width = 100 + '%';\n if ((xmlHttp.status === 200 || xmlHttp.status === 304) && xmlHttp.readyState === 4) {\n var res = JSON.parse(xmlHttp.responseText);\n document.getElementById('results').innerHTML = \"\";\n if (res.length === 0) {\n errorReport(\"No entries as for now\", 'Activity Log');\n } else { //populate the log entries\n for (i = 0; i < res.length; i += 1) {\n var container = document.createElement('div');\n container.className = \"row contain\";\n container.style.margin = 1 + '%';\n container.style.marginLeft = 2 + '%';\n \n //first section containing the activity\n var activity = document.createElement('div');\n activity.className = \"col s2\";\n activity.innerHTML = res[i].activity;\n \n //secong section \n //timestamp\n var date = document.createElement('div');\n date.className = \"col s2\";\n var d = new Date(res[i].time_log);\n date.innerHTML = d.getDate() + \"/\" + (d.getMonth() + 1) + '/' + d.getFullYear() + \" \" + d.getHours() + \":\" + d.getMinutes();\n \n //third section\n //URL\n var url = document.createElement('a');\n url.href = res[i].url;\n var url1 = document.createElement('div');\n url1.className = \"col s8 teal-text\";\n url1.innerHTML = res[i].url;\n url.appendChild(url1);\n\n var divide = document.createElement('div');\n divide.className = \"divider\";\n\n container.appendChild(activity);\n container.appendChild(date);\n container.appendChild(url);\n\n document.getElementById('results').appendChild(container);\n document.getElementById(\"results\").appendChild(divide);\n }\n }\n \n } else {\n document.getElementById('results').innerHTML = \"\";\n errorReport(xmlHttp.responseText, \"Activity log\");\n }\n //changing the URL hash value\n window.location.hash = \"params=log\";\n };\n}", "title": "" }, { "docid": "227fb3e554f1aa3282a69a108f54f097", "score": "0.5544552", "text": "function l(data) {\n var log = document.getElementById('log');\n log.innerHTML = log.innerHTML + data+\"<br />\";\n log.scrollTop = log.scrollHeight;\n}", "title": "" }, { "docid": "dbde8f322dcb2fc724f728ec9a480aa0", "score": "0.55436295", "text": "function _log(msg) {\n// $('#log').val(msg+\"\\n\"+$('#log').val());\n}", "title": "" }, { "docid": "db60d4295a7d3c7762c7764ed775b481", "score": "0.553851", "text": "Info(aMsg) {\r\n this.AddLogMessage(aMsg, ButtplugLogLevel.Info);\r\n }", "title": "" }, { "docid": "4d7f31d9a2995657a577ee74b7c36ad0", "score": "0.5536924", "text": "function update() {\n document.querySelector('#wins').innerHTML = \"Wins: \" + wins;\n document.querySelector('#missed').innerHTML = \"Letters Already Guessed: \" + missedLog.join(\" \");\n document.querySelector('#losses').innerHTML = \"Losses: \" + losses;\n document.querySelector('#guessesleft').innerHTML = \"Number of Guesses Remaining: \" + guessesLeft;\n document.querySelector('#answerblank').innerHTML = \"Answer: \" + answerBlank.join(\" \");\n}", "title": "" }, { "docid": "5a6e5534289f7962d72ca7852f829984", "score": "0.5529142", "text": "function refreshBlock()\n{\n var user = $(\"#sendButton\").val();\n\t$.get(\"./showMessages\",{username: user}, function(data)\n\t{\n\t var scrollAmount = $('#chatlog').scrollTop();\n\t\tvar replacement = $(data).find('#chatlog');\n\t\t$('#chatlog').replaceWith(replacement);\n\t\t$('#chatlog').scrollTop(scrollAmount);\n\t});\n}", "title": "" }, { "docid": "4accda8763dc5572e5a7f6943ebcc2d3", "score": "0.55267066", "text": "log(message) {\n this.logger.info(message);\n }", "title": "" }, { "docid": "0b8d1f299fa7d296e1a597fd237efbad", "score": "0.5513677", "text": "updateRecordWsMessage(id, message) {\n if (id < 0) return;\n try {\n this.getCacheFile(WS_MESSAGE_FILE_PRFIX + id, (err, recordWsMessageFile) => {\n if (err) return;\n fs.appendFile(recordWsMessageFile, wsMessageStingify(message) + ',', () => {});\n });\n } catch (e) {\n console.error(e);\n logUtil.error(e.message + e.stack);\n }\n\n this.emitUpdateLatestWsMessage(id, {\n id: id,\n message: message\n });\n }", "title": "" }, { "docid": "08f0c5696e14c7fb411164ccc481ab1a", "score": "0.5502645", "text": "function addLogMessage(message){\n var newLi = document.createElement('li'),\n text = document.createTextNode(message);\n\n newLi.classList.add('message-log');\n\n newLi.appendChild(text);\n logContainer.appendChild(newLi);\n }", "title": "" }, { "docid": "77ff0c3576b3ba8ecb2ff359a32c0418", "score": "0.55007344", "text": "function updateLogSizeDisplays() {\n that.sizeEditorText = editor.getSize();\n that.sizePlainText = deltaLog_plainText.getSize();\n that.sizeSearchAndReplace = deltaLog_searchReplace.getSize();\n that.sizeADT = deltaLog_ADT.getSize();\n addChartDataPoints();\n }", "title": "" }, { "docid": "56ba226540c45c6b03d7d46596eb8182", "score": "0.54926085", "text": "function updateMessage1() \n{\n var el = document.getElementById('message');\n // el.textContent = msg1;\n document.write(\" <br /> Welcome! \", msg1);\n}", "title": "" }, { "docid": "012de9f8970355be04be00b2ad9e8f55", "score": "0.54913664", "text": "@action\n toggleMessage(log) {\n set(log, 'showMessage', !log.showMessage);\n }", "title": "" }, { "docid": "e27dec1e915e52562d9414c623c502a7", "score": "0.5483037", "text": "function showMessages() {\n\t// Create a paragraph (line) for each message\n\tmessages.forEach((m, index) => {\n\t\tif(index > last_msg_show_id) {\n\t\t\taddMessage(m);\n\t\t\tlast_msg_show_id++;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "77ebb794ecef63cd885d78d60db94afa", "score": "0.54828966", "text": "function msg(text) { $(\"#log\").prepend(text + \"<br/>\"); }", "title": "" }, { "docid": "77ebb794ecef63cd885d78d60db94afa", "score": "0.54828966", "text": "function msg(text) { $(\"#log\").prepend(text + \"<br/>\"); }", "title": "" } ]
451f9bed5059b2fb63dec9658b2d49df
Create a new DefaultXrpClient. The DefaultXrpClient will use gRPC to communicate with the given endpoint.
[ { "docid": "c5717daf5208ae8bf05e29ae6b631e47", "score": "0.7061578", "text": "static defaultXrpClientWithEndpoint(grpcUrl, network, forceWeb = false) {\n return utils_1.default() && !forceWeb\n ? new DefaultXrpClient(new grpc_xrp_network_client_1.default(grpcUrl), network)\n : new DefaultXrpClient(new grpc_xrp_network_client_web_1.default(grpcUrl), network);\n }", "title": "" } ]
[ { "docid": "71d5abf8edbf450aeef66e7d5ff3bedc", "score": "0.64107496", "text": "function new_rpc_default_only(base_address) {\n return new RPC({\n client_factory,\n schema: api_schema,\n router: {\n default: base_address\n },\n api_routes: {}\n });\n}", "title": "" }, { "docid": "867499ef1f700a2408c7ea8ad4b9f969", "score": "0.6212605", "text": "static defaultIlpClientWithEndpoint(grpcURL, forceWeb = false) {\n return utils_1.default() && !forceWeb\n ? new DefaultIlpClient(new grpc_ilp_network_client_1.default(grpcURL))\n : new DefaultIlpClient(new grpc_ilp_network_client_web_1.default(grpcURL));\n }", "title": "" }, { "docid": "2b6b14d3e82302085e48da2e3e086ff7", "score": "0.5787265", "text": "constructor(grpcUrl, network, forceWeb = false) {\n this.network = network;\n const defaultXrpClient = default_xrp_client_1.default.defaultXrpClientWithEndpoint(grpcUrl, network, forceWeb);\n this.decoratedClient = new reliable_submission_xrp_client_1.default(defaultXrpClient, network);\n }", "title": "" }, { "docid": "ff4dfea1978e3b90f955cc490ed40b96", "score": "0.56605846", "text": "static coreXrplClientWithEndpoint(grpcUrl, network, forceWeb = false) {\n return utils_1.default() && !forceWeb\n ? new CoreXrplClient(new grpc_xrp_network_client_1.default(grpcUrl), network)\n : new CoreXrplClient(new grpc_xrp_network_client_web_1.default(grpcUrl), network);\n }", "title": "" }, { "docid": "f423199fbc2bea73bae8ab17eb4366ff", "score": "0.5418871", "text": "function newClientStub() {\n return new dgraph.DgraphClientStub(\n // addr: optional, default: \"http://localhost:8080\"\n \"http://localhost:8080\",\n );\n}", "title": "" }, { "docid": "dfd126c1177f5674e0ad2888952cd3ae", "score": "0.53303707", "text": "function XmlRpcTransport(endpoint) {\n\tthis._http = new HttpConnection(endpoint);\n}", "title": "" }, { "docid": "4e24d0244846b276091a1ebf70cfed91", "score": "0.5094183", "text": "static createForBaseUri(baseUri, defaultOptions = {}) {\n const client = __self.create();\n\n return ScopingHttpClient.forBaseUri(client, baseUri, defaultOptions);\n }", "title": "" }, { "docid": "dd5e1ce1d9ede98c60c0fd7212318acb", "score": "0.49589708", "text": "function createProtoRequest( options, base_uri ) {\n var options = options;\n if (options === undefined) {\n options = {};\n } else if ((typeof options === 'string') && base_uri === undefined) {\n var base_uri = options;\n options = {};\n }\n if (base_uri) {\n var new_host = url.parse(base_uri);\n options.hostname = new_host.hostname;\n options.port = new_host.port;\n if (new_host.protocol === 'http:') {\n if (options.port == null) {\n options.port = '80';\n }\n var scheme = http;\n } else { // new_host.protocol === 'https:'\n if (options.port == null) {\n options.port = '443';\n }\n var scheme = https;\n }\n } else {\n options.hostname = 'api.fmtools.org';\n options.port = 443;\n var scheme = https;\n }\n\n return (function (f) {\n return scheme.request(options, f);\n });\n}", "title": "" }, { "docid": "b516450dc8510156d37565abfb76d602", "score": "0.48635772", "text": "_initRpcClients() {\n const socket = this._endpoint.split('//').pop();\n this.clients = Object.keys(rpcs).reduce((acc, x) => {\n debug('initRpcClient', x);\n acc[x] = new rpcs[x](socket, grpc.credentials.createInsecure());\n return acc;\n }, {});\n }", "title": "" }, { "docid": "64d1e010ced22da6cb32ce8313a0ebd5", "score": "0.4736966", "text": "function newClientStub(url) {\n return new dgraph.DgraphClientStub(url);\n}", "title": "" }, { "docid": "2d43b65d2711d9cb25ee47abdba0a7df", "score": "0.47054", "text": "function createClient(broker, serviceName, requestTTL) {\n return new Client(broker, serviceName, requestTTL)._start();\n}", "title": "" }, { "docid": "de932852cd10f9c68f0b45ca396f3618", "score": "0.46769872", "text": "function getServer() {\n var grpcServer = new grpc.Server();\n grpcServer.addService(emailServiceProto.UserRegistrationEmail.service, {\n newEmail: newEmail\n });\n return grpcServer;\n}", "title": "" }, { "docid": "d874311c0a78d5318e6e0d7d21128458", "score": "0.46314764", "text": "async connect() {\n if (!this.myself) {\n await cryptoWaitReady();\n if (this.config.litentry.privateKey) {\n logger.debug('Use private key');\n this.myself = this.keyring.addFromUri(this.config.litentry.privateKey);\n } else {\n logger.debug(`Use default accounts: ${this.config.litentry.defaultAccount}`);\n this.myself = this.keyring.addFromUri(this.config.litentry.defaultAccount);\n }\n }\n\n this.api = await ApiPromise.create({\n provider: this.wsProvider,\n // NOTE: https://polkadot.js.org/docs/api/FAQ/#the-node-returns-a-could-not-convert-error-on-send\n types: {\n Address: \"MultiAddress\",\n LookupSource: \"MultiAddress\"\n },\n });\n return this.api;\n }", "title": "" }, { "docid": "f7e41a43a81c4ed98dc4f67bc4282236", "score": "0.45616412", "text": "static create(serviceInfo, client, logger) {\r\n if (!(serviceInfo && serviceInfo.name)) {\r\n throw new Error('Missing RPC service name.');\r\n }\r\n const proxy = new RpcProxy(client, serviceInfo.name, logger);\r\n // Generate async methods for requests.\r\n for (const methodName of serviceInfo.methods) {\r\n const methodPropertyName = `${methodName}Async`;\r\n proxy[methodPropertyName] = function () {\r\n // Detect whether optional cancellation token was supplied, and if so strip from args.\r\n let args;\r\n let cancellationToken = arguments[arguments.length - 1];\r\n if (cancellationToken &&\r\n typeof cancellationToken === 'object' &&\r\n typeof cancellationToken.isCancellationRequested === 'boolean') {\r\n args = Array.prototype.slice.call(arguments, 0, arguments.length - 1);\r\n }\r\n else {\r\n args = Array.prototype.slice.call(arguments, 0, arguments.length);\r\n cancellationToken = null;\r\n }\r\n // Detect whether optional progress was supplied, and if so strip from args.\r\n let progress = args[args.length - 1];\r\n if (progress &&\r\n typeof progress === 'object' &&\r\n typeof progress.report === 'function') {\r\n args.splice(args.length - 1, 1);\r\n }\r\n else {\r\n progress = null;\r\n }\r\n const serviceAndMethodName = proxy.serviceName + '.' + methodName;\r\n return proxy.client.sendRequest(this.logger, serviceAndMethodName, progress, cancellationToken, ...args);\r\n };\r\n }\r\n // Generate methods for method-style notifications.\r\n for (const methodName of (serviceInfo.voidMethods || [])) {\r\n proxy[methodName] = function () {\r\n const args = Array.prototype.slice.call(arguments, 0, arguments.length);\r\n const serviceAndMethodName = proxy.serviceName + '.' + methodName;\r\n proxy.client.sendNotification(this.logger, serviceAndMethodName, args).then().catch();\r\n };\r\n }\r\n // Generate events for event-style notifications.\r\n for (const eventName of serviceInfo.events) {\r\n const emitter = new rpc.Emitter();\r\n const eventPropertyName = `on${eventName.substr(0, 1).toUpperCase()}${eventName.substr(1)}`;\r\n proxy[eventPropertyName] = emitter.event;\r\n const serviceAndEventName = proxy.serviceName + '.' + eventName;\r\n proxy.client.ensureConnectionAsync().then((connection) => {\r\n connection.onNotification(serviceAndEventName, (...args) => {\r\n const eventArgs = args[0];\r\n // Event args may contain sensitive data, so only trace when obfuscation is disabled.\r\n const argsString = vso_logging_1.LoggerSettings.disableObfuscation ? JSON.stringify(eventArgs) : '';\r\n proxy.logger.log(vso_logging_1.LogLevel.Debug, `> ${serviceAndEventName}: ${argsString}`);\r\n emitter.fire(eventArgs);\r\n });\r\n }).catch((e) => {\r\n // Failed to get the connection. There will already be errors traced elsewhere\r\n // about the connection failure, so there's no need to trace anything more here.\r\n });\r\n }\r\n return proxy;\r\n }", "title": "" }, { "docid": "bfad46bb878a6d907a7c2fe6f8bc3322", "score": "0.45495594", "text": "constructor(options = {}) {\n _defineProperty(this, \"options\", void 0);\n\n _defineProperty(this, \"key\", void 0);\n\n _defineProperty(this, \"identifier\", void 0);\n\n _defineProperty(this, \"addr\", void 0);\n\n _defineProperty(this, \"eventListeners\", void 0);\n\n _defineProperty(this, \"clients\", void 0);\n\n _defineProperty(this, \"defaultClient\", void 0);\n\n _defineProperty(this, \"msgCache\", void 0);\n\n _defineProperty(this, \"acceptAddrs\", void 0);\n\n _defineProperty(this, \"sessions\", void 0);\n\n _defineProperty(this, \"isReady\", void 0);\n\n _defineProperty(this, \"isFailed\", void 0);\n\n _defineProperty(this, \"isClosed\", void 0);\n\n options = common.util.assignDefined({}, consts.defaultOptions, options);\n let baseIdentifier = options.identifier || '';\n let clients = {};\n\n if (options.originalClient) {\n let clientID = util.addIdentifier('', '');\n clients[clientID] = new _client.default(options);\n\n if (!options.seed) {\n options = common.util.assignDefined({}, options, {\n seed: clients[clientID].key.seed\n });\n }\n }\n\n for (let i = 0; i < options.numSubClients; i++) {\n clients[util.addIdentifier('', i)] = new _client.default(common.util.assignDefined({}, options, {\n identifier: util.addIdentifier(baseIdentifier, i)\n }));\n\n if (i === 0 && !options.seed) {\n options = common.util.assignDefined({}, options, {\n seed: clients[util.addIdentifier('', i)].key.seed\n });\n }\n }\n\n let clientIDs = Object.keys(clients).sort();\n\n if (clientIDs.length === 0) {\n throw new RangeError('should have at least one client');\n }\n\n this.options = options;\n this.clients = clients;\n this.defaultClient = clients[clientIDs[0]];\n this.key = this.defaultClient.key;\n this.identifier = baseIdentifier;\n this.addr = (baseIdentifier ? baseIdentifier + '.' : '') + this.key.publicKey;\n this.eventListeners = {\n connect: [],\n connectFailed: [],\n wsError: [],\n message: [],\n session: []\n };\n this.msgCache = new _memoryCache.Cache();\n this.acceptAddrs = [];\n this.sessions = new Map();\n this.isReady = false;\n this.isFailed = false;\n this.isClosed = false;\n\n for (let clientID of Object.keys(clients)) {\n clients[clientID].onMessage(async ({\n src,\n payload,\n payloadType,\n isEncrypted,\n messageId,\n noReply\n }) => {\n if (this.isClosed) {\n return false;\n }\n\n if (payloadType === common.pb.payloads.PayloadType.SESSION) {\n if (!isEncrypted) {\n return false;\n }\n\n try {\n await this._handleSessionMsg(clientID, src, messageId, payload);\n } catch (e) {\n if (!(e instanceof ncp.errors.SessionClosedError || e instanceof common.errors.AddrNotAllowedError)) {\n throw e;\n }\n }\n\n return false;\n }\n\n let key = common.util.bytesToHex(messageId);\n\n if (this.msgCache.get(key) !== null) {\n return false;\n }\n\n this.msgCache.put(key, clientID, options.msgCacheExpiration);\n src = util.removeIdentifier(src).addr;\n\n if (this.eventListeners.message.length > 0) {\n let responses = await _promise.default.all(this.eventListeners.message.map(async f => {\n try {\n return await f({\n src,\n payload,\n payloadType,\n isEncrypted,\n messageId,\n noReply\n });\n } catch (e) {\n console.log('Message handler error:', e);\n return null;\n }\n }));\n\n if (!noReply) {\n let responded = false;\n\n for (let response of responses) {\n if (response === false) {\n return false;\n } else if (response !== undefined && response !== null) {\n this.send(src, response, {\n encrypt: isEncrypted,\n msgHoldingSeconds: 0,\n replyToId: messageId\n }).catch(e => {\n console.log('Send response error:', e);\n });\n responded = true;\n break;\n }\n }\n\n if (!responded) {\n for (let clientID of Object.keys(clients)) {\n if (clients[clientID].isReady) {\n clients[clientID]._sendACK(util.addIdentifierPrefixAll(src, clientID), messageId, isEncrypted).catch(e => {\n console.log('Send ack error:', e);\n });\n }\n }\n }\n }\n }\n\n return false;\n });\n }\n\n let connectPromises = Object.keys(this.clients).map(clientID => new _promise.default((resolve, reject) => {\n this.clients[clientID].onConnect(resolve);\n }));\n\n _promise.default.any(connectPromises).then(r => {\n this.isReady = true;\n\n if (this.eventListeners.connect.length > 0) {\n this.eventListeners.connect.forEach(async f => {\n try {\n await f(r);\n } catch (e) {\n console.log('Connect handler error:', e);\n }\n });\n }\n });\n\n let connectFailedPromises = Object.keys(this.clients).map(clientID => new _promise.default((resolve, reject) => {\n this.clients[clientID].onConnectFailed(resolve);\n }));\n\n _promise.default.all(connectFailedPromises).then(() => {\n this.isFailed = true;\n\n if (this.eventListeners.connectFailed.length > 0) {\n this.eventListeners.connectFailed.forEach(async f => {\n try {\n await f();\n } catch (e) {\n console.log('Connect failed handler error:', e);\n }\n });\n } else {\n console.log('All clients connect failed');\n }\n });\n\n Object.keys(this.clients).map(clientID => {\n this.clients[clientID].onWsError(event => {\n if (this.eventListeners.wsError.length > 0) {\n this.eventListeners.wsError.forEach(async f => {\n try {\n await f(event);\n } catch (e) {\n console.log('WsError handler error:', e);\n }\n });\n } else {\n console.log(event.message);\n }\n });\n });\n }", "title": "" }, { "docid": "3dbc1fbb2fd46075aacc3ffd38259186", "score": "0.45429778", "text": "client() {\r\n LOG.info('client builder');\r\n return PathProxyFactory('', this._wire);\r\n }", "title": "" }, { "docid": "5930eca0366e743945c9d30bb25dcd36", "score": "0.4537338", "text": "function WSBrokerClient (brokerType, options, pluginsManager, notifyOnListen) {\n this.pluginsManager = pluginsManager;\n this.eventName = brokerType;\n this.notifyOnListen = notifyOnListen;\n\n this._pingTimeout = options.pingTimeout || 50;\n this._pingInterval = options.pingInterval || 1000 * 60;\n this._pingRequestTimeoutId = null;\n this._pingRequestIntervalId = null;\n\n this.client = {\n socket: null,\n connected: null,\n state: 'disconnected',\n retryInterval: options.retryInterval || 1000\n };\n\n this.handlers = {};\n this.onConnectHandlers = [];\n this.onCloseHandlers = [];\n this.onErrorHandlers = [];\n this.server = {};\n\n if (options.host) {\n this.server.address = `ws://${options.host}:${options.port}`;\n this.server.transport = 'tcp';\n }\n else if (options.socket) {\n this.server.address = `ws+unix://${path.resolve(options.socket)}`;\n this.server.transport = 'unix';\n this.server.path = options.socket;\n }\n else {\n throw new InternalError('No endpoint configuration given to connect.');\n }\n\n this.ws = () => new WS(this.server.address, {perMessageDeflate: false});\n\n this.reconnect = true;\n this.retryTimer = null;\n}", "title": "" }, { "docid": "66559e3e9ca0b560bde03d50552e7b0c", "score": "0.45190406", "text": "function Connection(endpoint) {\n _classCallCheck(this, Connection);\n\n _defineProperty(this, \"_rpcReq\", void 0);\n\n _defineProperty(this, \"_rpcWebSock\", void 0);\n\n _defineProperty(this, \"_rpcWebSockConnected\", false);\n\n _defineProperty(this, \"_blockhashInfo\", void 0);\n\n _defineProperty(this, \"_disableBlockhashCaching\", false);\n\n _defineProperty(this, \"_accountChangeSubscriptions\", {});\n\n _defineProperty(this, \"_accountChangeSubscriptionCounter\", 0);\n\n _defineProperty(this, \"_controllerAccountChangeSubscriptions\", {});\n\n _defineProperty(this, \"_controllerAccountChangeSubscriptionCounter\", 0);\n\n var url$1 = url.parse(endpoint);\n this._rpcReq = createRpcReq(url$1.href);\n this._blockhashInfo = {\n recentPackagehash: null,\n seconds: -1,\n transactionSignatures: []\n };\n url$1.protocol = url$1.protocol === 'https:' ? 'wss:' : 'ws:';\n url$1.host = '';\n url$1.port = String(Number(url$1.port) + 1);\n\n if (url$1.port === '1') {\n url$1.port = url$1.protocol === 'wss:' ? '8901' : '8900';\n }\n\n this._rpcWebSock = new rpcWebsockets.Client(url.format(url$1), {\n autoconnect: false,\n max_reconnects: Infinity\n });\n\n this._rpcWebSock.on('open', this._wsOnOpen.bind(this));\n\n this._rpcWebSock.on('error', this._wsOnErr.bind(this));\n\n this._rpcWebSock.on('close', this._wsOnClose.bind(this));\n\n this._rpcWebSock.on('accountNotification', this._wsOnAccountNotice.bind(this));\n\n this._rpcWebSock.on('controllerNotification', this._wsOnProgramAccountNotification.bind(this));\n }", "title": "" }, { "docid": "27c8f53d813fcadc40ab5afa06981b31", "score": "0.45154697", "text": "function main() {\n var server = new grpc.Server();\n server.addService(hello_proto.Greeter.service, {\n ObtenerReportes : ObtenerReportes,\n ObtenerReportesId : ObtenerReportesId,\n IngresarReporte : IngresarReporte,\n ingresarAsistencia : ingresarAsistencia,\n ObtenerEvento : ObtenerEvento,\n ObtenerCarnet : ObtenerCarnet\n });\n server.bindAsync('0.0.0.0:5000', grpc.ServerCredentials.createInsecure(), () => {\n server.start();\n });\n}", "title": "" }, { "docid": "ad264be7b0becd8275a76bfecd361d87", "score": "0.4475305", "text": "static makeClient() {\n const client = new IgniteClient();\n client.setDebug(config.debug);\n return client;\n }", "title": "" }, { "docid": "c09354c142c2a0921a529c18157ada8b", "score": "0.44700217", "text": "function createClient(opt) {\n return new Client(opt);\n}", "title": "" }, { "docid": "99ce197eef1d1937510c23eddfc92af8", "score": "0.44643688", "text": "static createDefault() {\n JuspayEnvironment.init();\n return new RequestOptions();\n }", "title": "" }, { "docid": "c64a2f00044f88231fd0b8db29277087", "score": "0.4451041", "text": "getClient(serviceClient) {\n let creds = credentials.createInsecure()\n let options = {}\n\n // TODO: TLS Certificate\n // if (this.tlsCertificate) {\n // if (this.tlsCertificate.sslTargetHost) {\n // options = {\n // ...options,\n // 'grpc.ssl_target_name_override' : this.tlsCertificate.sslTargetHost,\n // 'grpc.default_authority': this.tlsCertificate.sslTargetHost,\n // }\n // }\n // if(this.tlsCertificate.useServerCertificate === true) {\n // creds = credentials.createSsl()\n // } else {\n // creds = credentials.createSsl(\n // fs.readFileSync(this.tlsCertificate.rootCert.filePath),\n // this.tlsCertificate.privateKey && fs.readFileSync(this.tlsCertificate.privateKey.filePath),\n // this.tlsCertificate.certChain && fs.readFileSync(this.tlsCertificate.certChain.filePath),\n // )\n // }\n // }\n\n return new serviceClient(this.url, creds, options)\n }", "title": "" }, { "docid": "57585488b74456ffd8deca270780e876", "score": "0.44460648", "text": "function FaceClient(credentials, endpoint, options) {\n var _this = _super.call(this, credentials, endpoint, options) || this;\n _this.face = new Face(_this);\n _this.personGroupPerson = new PersonGroupPerson(_this);\n _this.personGroup = new PersonGroupOperations(_this);\n _this.faceList = new FaceListOperations(_this);\n _this.largePersonGroupPerson = new LargePersonGroupPerson(_this);\n _this.largePersonGroup = new LargePersonGroupOperations(_this);\n _this.largeFaceList = new LargeFaceListOperations(_this);\n _this.snapshot = new SnapshotOperations(_this);\n return _this;\n }", "title": "" }, { "docid": "af6dc5626e70de05b56a6ddb5d7ef7a1", "score": "0.44437513", "text": "function main() {\n const server = new grpc.Server();\n server.addService(rpcProto.Fetch.service, { capitalize: capitalize });\n server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());\n server.start();\n}", "title": "" }, { "docid": "eb073bb0eee97773582acf21a6bda6a0", "score": "0.44223106", "text": "function Endpoint(url) {\n var purl = parseUrl(url);\n var protocol = purl.protocol.toLowerCase();\n if (protocol === 'grpc') {\n this.addr = purl.host;\n this.creds = grpc.credentials.createInsecure();\n } else if (protocol === 'grpcs') {\n this.addr = purl.host;\n this.creds = grpc.credentials.createSsl();\n } else {\n throw Error(\"invalid protocol: \"+protocol);\n }\n}", "title": "" }, { "docid": "b0048b25126d5f27f44bf8483de87ba8", "score": "0.4408734", "text": "function createClient(options) {\n const {\n url,\n connectionParams,\n lazy = true,\n onNonLazyError = console.error,\n lazyCloseTimeout = 0,\n keepAlive = 0,\n disablePong,\n connectionAckWaitTimeout = 0,\n retryAttempts = 5,\n retryWait = async function randomisedExponentialBackoff(retries) {\n let retryDelay = 1000; // start with 1s delay\n for (let i = 0; i < retries; i++) {\n retryDelay *= 2;\n }\n await new Promise(resolve => setTimeout(resolve, retryDelay +\n // add random timeout from 300ms to 3s\n Math.floor(Math.random() * (3000 - 300) + 300)));\n },\n isFatalConnectionProblem = errOrCloseEvent =>\n // non `CloseEvent`s are fatal by default\n !isLikeCloseEvent(errOrCloseEvent),\n on,\n webSocketImpl,\n /**\n * Generates a v4 UUID to be used as the ID using `Math`\n * as the random number generator. Supply your own generator\n * in case you need more uniqueness.\n *\n * Reference: https://gist.github.com/jed/982883\n */\n generateID = function generateUUID() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {\n const r = Math.random() * 16 | 0,\n v = c == 'x' ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n },\n jsonMessageReplacer: replacer,\n jsonMessageReviver: reviver\n } = options;\n let ws;\n if (webSocketImpl) {\n if (!isWebSocket(webSocketImpl)) {\n throw new Error('Invalid WebSocket implementation provided');\n }\n ws = webSocketImpl;\n } else if (typeof WebSocket !== 'undefined') {\n ws = WebSocket;\n } else if (typeof __webpack_require__.g !== 'undefined') {\n ws = __webpack_require__.g.WebSocket ||\n // @ts-expect-error: Support more browsers\n __webpack_require__.g.MozWebSocket;\n } else if (typeof window !== 'undefined') {\n ws = window.WebSocket ||\n // @ts-expect-error: Support more browsers\n window.MozWebSocket;\n }\n if (!ws) throw new Error('WebSocket implementation missing');\n const WebSocketImpl = ws;\n // websocket status emitter, subscriptions are handled differently\n const emitter = (() => {\n const message = (() => {\n const listeners = {};\n return {\n on(id, listener) {\n listeners[id] = listener;\n return () => {\n delete listeners[id];\n };\n },\n emit(message) {\n var _a;\n if ('id' in message) (_a = listeners[message.id]) === null || _a === void 0 ? void 0 : _a.call(listeners, message);\n }\n };\n })();\n const listeners = {\n connecting: (on === null || on === void 0 ? void 0 : on.connecting) ? [on.connecting] : [],\n opened: (on === null || on === void 0 ? void 0 : on.opened) ? [on.opened] : [],\n connected: (on === null || on === void 0 ? void 0 : on.connected) ? [on.connected] : [],\n ping: (on === null || on === void 0 ? void 0 : on.ping) ? [on.ping] : [],\n pong: (on === null || on === void 0 ? void 0 : on.pong) ? [on.pong] : [],\n message: (on === null || on === void 0 ? void 0 : on.message) ? [message.emit, on.message] : [message.emit],\n closed: (on === null || on === void 0 ? void 0 : on.closed) ? [on.closed] : [],\n error: (on === null || on === void 0 ? void 0 : on.error) ? [on.error] : []\n };\n return {\n onMessage: message.on,\n on(event, listener) {\n const l = listeners[event];\n l.push(listener);\n return () => {\n l.splice(l.indexOf(listener), 1);\n };\n },\n emit(event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n // we copy the listeners so that unlistens dont \"pull the rug under our feet\"\n for (const listener of [...listeners[event]]) {\n // @ts-expect-error: The args should fit\n listener(...args);\n }\n }\n };\n })();\n // invokes the callback either when an error or closed event is emitted,\n // first one that gets called prevails, other emissions are ignored\n function errorOrClosed(cb) {\n const listening = [\n // errors are fatal and more critical than close events, throw them first\n emitter.on('error', err => {\n listening.forEach(unlisten => unlisten());\n cb(err);\n }),\n // closes can be graceful and not fatal, throw them second (if error didnt throw)\n emitter.on('closed', event => {\n listening.forEach(unlisten => unlisten());\n cb(event);\n })];\n }\n let connecting,\n locks = 0,\n retrying = false,\n retries = 0,\n disposed = false;\n async function connect() {\n const [socket, throwOnClose] = await (connecting !== null && connecting !== void 0 ? connecting : connecting = new Promise((connected, denied) => (async () => {\n if (retrying) {\n await retryWait(retries);\n // subscriptions might complete while waiting for retry\n if (!locks) {\n connecting = undefined;\n return denied({\n code: 1000,\n reason: 'All Subscriptions Gone'\n });\n }\n retries++;\n }\n emitter.emit('connecting');\n const socket = new WebSocketImpl(typeof url === 'function' ? await url() : url, _common.GRAPHQL_TRANSPORT_WS_PROTOCOL);\n let connectionAckTimeout, queuedPing;\n function enqueuePing() {\n if (isFinite(keepAlive) && keepAlive > 0) {\n clearTimeout(queuedPing); // in case where a pong was received before a ping (this is valid behaviour)\n queuedPing = setTimeout(() => {\n if (socket.readyState === WebSocketImpl.OPEN) {\n socket.send((0, _common.stringifyMessage)({\n type: _common.MessageType.Ping\n }));\n emitter.emit('ping', false, undefined);\n }\n }, keepAlive);\n }\n }\n errorOrClosed(errOrEvent => {\n connecting = undefined;\n clearTimeout(connectionAckTimeout);\n clearTimeout(queuedPing);\n denied(errOrEvent);\n });\n socket.onerror = err => emitter.emit('error', err);\n socket.onclose = event => emitter.emit('closed', event);\n socket.onopen = async () => {\n try {\n emitter.emit('opened', socket);\n const payload = typeof connectionParams === 'function' ? await connectionParams() : connectionParams;\n socket.send((0, _common.stringifyMessage)(payload ? {\n type: _common.MessageType.ConnectionInit,\n payload\n } : {\n type: _common.MessageType.ConnectionInit\n // payload is completely absent if not provided\n }, replacer));\n if (isFinite(connectionAckWaitTimeout) && connectionAckWaitTimeout > 0) {\n connectionAckTimeout = setTimeout(() => {\n socket.close(_common.CloseCode.ConnectionAcknowledgementTimeout, 'Connection acknowledgement timeout');\n }, connectionAckWaitTimeout);\n }\n enqueuePing(); // enqueue ping (noop if disabled)\n } catch (err) {\n emitter.emit('error', err);\n socket.close(_common.CloseCode.InternalClientError, (0, _utils.limitCloseReason)(err instanceof Error ? err.message : new Error(err).message, 'Internal client error'));\n }\n };\n let acknowledged = false;\n socket.onmessage = _ref => {\n let {\n data\n } = _ref;\n try {\n const message = (0, _common.parseMessage)(data, reviver);\n emitter.emit('message', message);\n if (message.type === 'ping' || message.type === 'pong') {\n emitter.emit(message.type, true, message.payload); // received\n if (message.type === 'pong') {\n enqueuePing(); // enqueue next ping (noop if disabled)\n } else if (!disablePong) {\n // respond with pong on ping\n socket.send((0, _common.stringifyMessage)(message.payload ? {\n type: _common.MessageType.Pong,\n payload: message.payload\n } : {\n type: _common.MessageType.Pong\n // payload is completely absent if not provided\n }));\n\n emitter.emit('pong', false, message.payload);\n }\n return; // ping and pongs can be received whenever\n }\n\n if (acknowledged) return; // already connected and acknowledged\n if (message.type !== _common.MessageType.ConnectionAck) throw new Error(`First message cannot be of type ${message.type}`);\n clearTimeout(connectionAckTimeout);\n acknowledged = true;\n emitter.emit('connected', socket, message.payload); // connected = socket opened + acknowledged\n retrying = false; // future lazy connects are not retries\n retries = 0; // reset the retries on connect\n connected([socket, new Promise((_, reject) => errorOrClosed(reject))]);\n } catch (err) {\n socket.onmessage = null; // stop reading messages as soon as reading breaks once\n emitter.emit('error', err);\n socket.close(_common.CloseCode.BadResponse, (0, _utils.limitCloseReason)(err instanceof Error ? err.message : new Error(err).message, 'Bad response'));\n }\n };\n })()));\n // if the provided socket is in a closing state, wait for the throw on close\n if (socket.readyState === WebSocketImpl.CLOSING) await throwOnClose;\n let release = () => {\n // releases this connection\n };\n const released = new Promise(resolve => release = resolve);\n return [socket, release, Promise.race([\n // wait for\n released.then(() => {\n if (!locks) {\n // and if no more locks are present, complete the connection\n const complete = () => socket.close(1000, 'Normal Closure');\n if (isFinite(lazyCloseTimeout) && lazyCloseTimeout > 0) {\n // if the keepalive is set, allow for the specified calmdown time and\n // then complete. but only if no lock got created in the meantime and\n // if the socket is still open\n setTimeout(() => {\n if (!locks && socket.readyState === WebSocketImpl.OPEN) complete();\n }, lazyCloseTimeout);\n } else {\n // otherwise complete immediately\n complete();\n }\n }\n }),\n // or\n throwOnClose])];\n }\n /**\n * Checks the `connect` problem and evaluates if the client should retry.\n */\n function shouldRetryConnectOrThrow(errOrCloseEvent) {\n // some close codes are worth reporting immediately\n if (isLikeCloseEvent(errOrCloseEvent) && (isFatalInternalCloseCode(errOrCloseEvent.code) || [_common.CloseCode.InternalServerError, _common.CloseCode.InternalClientError, _common.CloseCode.BadRequest, _common.CloseCode.BadResponse, _common.CloseCode.Unauthorized,\n // CloseCode.Forbidden, might grant access out after retry\n _common.CloseCode.SubprotocolNotAcceptable,\n // CloseCode.ConnectionInitialisationTimeout, might not time out after retry\n // CloseCode.ConnectionAcknowledgementTimeout, might not time out after retry\n _common.CloseCode.SubscriberAlreadyExists, _common.CloseCode.TooManyInitialisationRequests].includes(errOrCloseEvent.code))) throw errOrCloseEvent;\n // client was disposed, no retries should proceed regardless\n if (disposed) return false;\n // normal closure (possibly all subscriptions have completed)\n // if no locks were acquired in the meantime, shouldnt try again\n if (isLikeCloseEvent(errOrCloseEvent) && errOrCloseEvent.code === 1000) return locks > 0;\n // retries are not allowed or we tried to many times, report error\n if (!retryAttempts || retries >= retryAttempts) throw errOrCloseEvent;\n // throw fatal connection problems immediately\n if (isFatalConnectionProblem(errOrCloseEvent)) throw errOrCloseEvent;\n // looks good, start retrying\n return retrying = true;\n }\n // in non-lazy (hot?) mode always hold one connection lock to persist the socket\n if (!lazy) {\n (async () => {\n locks++;\n for (;;) {\n try {\n const [,, throwOnClose] = await connect();\n await throwOnClose; // will always throw because releaser is not used\n } catch (errOrCloseEvent) {\n try {\n if (!shouldRetryConnectOrThrow(errOrCloseEvent)) return;\n } catch (errOrCloseEvent) {\n // report thrown error, no further retries\n return onNonLazyError === null || onNonLazyError === void 0 ? void 0 : onNonLazyError(errOrCloseEvent);\n }\n }\n }\n })();\n }\n return {\n on: emitter.on,\n subscribe(payload, sink) {\n const id = generateID();\n let done = false,\n errored = false,\n releaser = () => {\n // for handling completions before connect\n locks--;\n done = true;\n };\n (async () => {\n locks++;\n for (;;) {\n try {\n const [socket, release, waitForReleaseOrThrowOnClose] = await connect();\n // if done while waiting for connect, release the connection lock right away\n if (done) return release();\n const unlisten = emitter.onMessage(id, message => {\n switch (message.type) {\n case _common.MessageType.Next:\n {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n sink.next(message.payload);\n return;\n }\n case _common.MessageType.Error:\n {\n errored = true, done = true;\n sink.error(message.payload);\n releaser();\n return;\n }\n case _common.MessageType.Complete:\n {\n done = true;\n releaser(); // release completes the sink\n return;\n }\n }\n });\n socket.send((0, _common.stringifyMessage)({\n id,\n type: _common.MessageType.Subscribe,\n payload\n }, replacer));\n releaser = () => {\n if (!done && socket.readyState === WebSocketImpl.OPEN)\n // if not completed already and socket is open, send complete message to server on release\n socket.send((0, _common.stringifyMessage)({\n id,\n type: _common.MessageType.Complete\n }, replacer));\n locks--;\n done = true;\n release();\n };\n // either the releaser will be called, connection completed and\n // the promise resolved or the socket closed and the promise rejected.\n // whatever happens though, we want to stop listening for messages\n await waitForReleaseOrThrowOnClose.finally(unlisten);\n return; // completed, shouldnt try again\n } catch (errOrCloseEvent) {\n if (!shouldRetryConnectOrThrow(errOrCloseEvent)) return;\n }\n }\n })().then(() => {\n // delivering either an error or a complete terminates the sequence\n if (!errored) sink.complete();\n }) // resolves on release or normal closure\n .catch(err => {\n sink.error(err);\n }); // rejects on close events and errors\n return () => {\n // dispose only of active subscriptions\n if (!done) releaser();\n };\n },\n async dispose() {\n disposed = true;\n if (connecting) {\n // if there is a connection, close it\n const [socket] = await connecting;\n socket.close(1000, 'Normal Closure');\n }\n }\n };\n}", "title": "" }, { "docid": "fb3afe9ed7463254b8f9d0a06d988b8c", "score": "0.4399324", "text": "constructor(source) {\n super(source, schema_1.ServiceTypes.Endpoint);\n }", "title": "" }, { "docid": "fb3e7db11da9d1135252e8655a55a1ec", "score": "0.4376855", "text": "_initClient() {\n this._client = new IntegratedAppsClient(\n `${this._confs.host}:${this._confs.port}`,\n this._confs.grpc.creds\n )\n logger.debug({ message: \"started grpc client\", addr: `${this._confs.host}:${this._confs.port}` })\n }", "title": "" }, { "docid": "5d7930930c6ada37119280ae8253df5b", "score": "0.43565184", "text": "function BaseClient() {\n _classCallCheck(this, BaseClient);\n\n // eslint-disable-next-line\n this.eventEmitter = new _events.default();\n }", "title": "" }, { "docid": "0be9d77ada07acf496fe32e13aa3316f", "score": "0.43461666", "text": "function create(initialState, native) {\n const httpLink = new HttpLink({\n uri: 'https://api.graph.cool/simple/v1/cjh2g1fxn6gsw0108o6ud01ms', // Server URL (must be absolute)\n credentials: 'same-origin', // Additional fetch() options like `credentials` or `headers`\n });\n const wsLink =\n (process.browser || native) &&\n new WebSocketLink({\n uri: 'wss://subscriptions.graph.cool/v1/cjh2g1fxn6gsw0108o6ud01ms',\n options: {\n reconnect: true,\n },\n });\n const link =\n !process.browser && !native\n ? httpLink\n : split(\n ({query}) => {\n const {kind, operation} = getMainDefinition(query);\n return (\n kind === 'OperationDefinition' && operation === 'subscription'\n );\n },\n wsLink,\n httpLink,\n );\n return new ApolloClient({\n connectToDevTools: process.browser,\n ssrMode: !process.browser && !native, // Disables forceFetch on the server (so queries are only run once)\n link: ApolloLink.from([\n onError(({graphQLErrors, networkError}) => {\n if (graphQLErrors)\n graphQLErrors.forEach(({message, locations, path}) =>\n // eslint-disable-next-line no-console\n console.log(\n `[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`,\n ),\n );\n // eslint-disable-next-line no-console\n if (networkError) console.log(`[Network error]: ${networkError}`);\n }),\n link,\n ]),\n cache: new InMemoryCache().restore(initialState || {}),\n });\n}", "title": "" }, { "docid": "9bc8517ac6b525acb10a17a1191675d9", "score": "0.43456653", "text": "function PredictionAPIClient(apiKey, endpoint, options) {\n return _super.call(this, apiKey, endpoint, options) || this;\n }", "title": "" }, { "docid": "db0e19fada4172a406814a176f3c2d2b", "score": "0.4323991", "text": "client() {\r\n LOG.info('client builder');\r\n return pathProxyFactory('', this, []);\r\n }", "title": "" }, { "docid": "fa1985c7d012f502d1b01c074c10563c", "score": "0.43192992", "text": "create() {\n return new BaseConnection(this.axiosInstance, `${ConnectionFactoryService.baseURL}/`);\n }", "title": "" }, { "docid": "586dc29e1180b5f290c4d65040859700", "score": "0.43022734", "text": "function createSocket() {\n return socket_io_client_1.default(config_1.API_URL);\n}", "title": "" }, { "docid": "fc1b4b48b295236a3e46608b0ef56386", "score": "0.4287008", "text": "function rpcHttp(host, port) {\n return new RpcClient(new ClientHttp(host, port));\n}", "title": "" }, { "docid": "588c9ebc5a3f9d259a664f360ed75a15", "score": "0.42781332", "text": "function PlexClient() {\n return new Promise((resolve, reject) => {\n const storageItem = browser.storage.local.get([\n 'token',\n 'selected_server_uri',\n 'selected_lib_id'\n ]);\n storageItem.then(res => {\n const { token, selected_server_uri, selected_lib_id } = res;\n\n if (!selected_server_uri) {\n // TODO open settings page\n failToSettings('Selected Server URI NULL');\n }\n if (!selected_lib_id || selected_lib_id === 'none') {\n failToSettings('Selected library ID NULL/none');\n }\n\n const url = new URL(selected_server_uri);\n resolve(\n new PlexAPI({\n hostname: url.hostname,\n port: url.port,\n https: url.protocol === 'https:',\n token: token\n })\n );\n });\n\n const failToSettings = reason => {\n dataStore.settings_view = true;\n return reject(`[Posterizer] Search failed: ${reason}`);\n };\n });\n}", "title": "" }, { "docid": "a6e3318866760401780f31b02adedb1d", "score": "0.42744276", "text": "function main() {\n var server = new grpc.Server();\n server.addService(protoTest.Greeter.service, {EnviaIntRecebeInt: EnviaIntRecebeInt, VoidMetodoSemParametros: VoidMetodoSemParametros,\n EnviaLongRecebeLong: EnviaLongRecebeLong, EnviaLong8RecebeLong:EnviaLong8RecebeLong,\n EnviaStringPotencia10RecebeString:EnviaStringPotencia10RecebeString,\n EnviaArrayIntRecebeInt:EnviaArrayIntRecebeInt,\n EnviaArrayIntRecebeArray:EnviaArrayIntRecebeArray});\n server.bind('192.168.1.34:8000', grpc.ServerCredentials.createInsecure());\n server.start();\n console.log(\"Iniciou\")\n}", "title": "" }, { "docid": "09b34c1b57749ff6e6199d91b392fd5c", "score": "0.4260607", "text": "function JsvServiceClient(baseUri)\n{\n\tthis.baseSyncReplyUri = JsvServiceClient.combine_(baseUri, \"jsv/reply\");\n\tthis.baseAsyncOneWayUri = JsvServiceClient.combine_(baseUri, \"jsv/oneway\");\n}", "title": "" }, { "docid": "60919538d75050eb567c76d801b98a01", "score": "0.425332", "text": "ws(location, advanced, options) {\n\n\t\t// Assembly the options from client options and request options\n\t\toptions = Object.assign({}, this._options, options);\n\n\t\treturn ClientConnection.create(location, advanced, options);\n\t}", "title": "" }, { "docid": "7e627cfd6ea13aa0e6357de1dfbbf43d", "score": "0.42434347", "text": "function Client(options) {\n this.options = _.defaults(options || {}, {\n hostname: \"localhost\",\n query: _.pick(options, \"login\", \"key\"),\n port: 9090,\n });\n\n apis.forEach((apiName) => {\n buildApi(apiName, this);\n });\n}", "title": "" }, { "docid": "3131d040287147f29a0324f9da00af73", "score": "0.4238853", "text": "static get instance() {\n if (this._instance === undefined) {\n let constants = this._constants;\n let config = new extConfig_1.default(constants.extensionConfigSectionName);\n _channel = vscode_1.window.createOutputChannel(constants.serviceInitializingOutputChannelName);\n let logger = new logger_1.Logger(text => _channel.append(text), constants);\n let serverStatusView = new serverStatus_1.ServerStatusView(constants);\n let httpClient = new httpClient_1.default();\n let decompressProvider = new decompressProvider_1.default();\n let downloadProvider = new serviceDownloadProvider_1.default(config, logger, serverStatusView, httpClient, decompressProvider, constants, false);\n let serviceProvider = new server_1.default(downloadProvider, config, serverStatusView, constants.extensionConfigSectionName);\n let statusView = new statusView_1.default();\n this._instance = new SqlToolsServiceClient(serviceProvider, logger, statusView, config);\n }\n return this._instance;\n }", "title": "" }, { "docid": "9959c898deb4fd7ad533d15e915daf58", "score": "0.42275792", "text": "function createPepperProgramWithDefault(defaultValue) {\n const program = new commander.Command();\n program\n .option('-p, --pepper', 'add pepper', defaultValue)\n .option('-P, --no-pepper', 'remove pepper');\n return program;\n}", "title": "" }, { "docid": "f609e39499c317de583503309110d371", "score": "0.4213654", "text": "constructor(options = {}) {\n _defineProperty(this, \"options\", void 0);\n\n _defineProperty(this, \"key\", void 0);\n\n _defineProperty(this, \"identifier\", void 0);\n\n _defineProperty(this, \"addr\", void 0);\n\n _defineProperty(this, \"eventListeners\", void 0);\n\n _defineProperty(this, \"clients\", void 0);\n\n _defineProperty(this, \"defaultClient\", void 0);\n\n _defineProperty(this, \"msgCache\", void 0);\n\n _defineProperty(this, \"acceptAddrs\", void 0);\n\n _defineProperty(this, \"sessions\", void 0);\n\n _defineProperty(this, \"isReady\", void 0);\n\n _defineProperty(this, \"isClosed\", void 0);\n\n options = common.util.assignDefined({}, consts.defaultOptions, options);\n let baseIdentifier = options.identifier || '';\n let clients = {};\n\n if (options.originalClient) {\n let clientID = util.addIdentifier('', '');\n clients[clientID] = new _client.default(options);\n\n if (!options.seed) {\n options = common.util.assignDefined({}, options, {\n seed: clients[clientID].key.seed\n });\n }\n }\n\n for (let i = 0; i < options.numSubClients; i++) {\n clients[util.addIdentifier('', i)] = new _client.default(common.util.assignDefined({}, options, {\n identifier: util.addIdentifier(baseIdentifier, i)\n }));\n\n if (i === 0 && !options.seed) {\n options = common.util.assignDefined({}, options, {\n seed: clients[util.addIdentifier('', i)].key.seed\n });\n }\n }\n\n let clientIDs = Object.keys(clients).sort();\n\n if (clientIDs.length === 0) {\n throw new RangeError('should have at least one client');\n }\n\n this.options = options;\n this.clients = clients;\n this.defaultClient = clients[clientIDs[0]];\n this.key = this.defaultClient.key;\n this.identifier = baseIdentifier;\n this.addr = (baseIdentifier ? baseIdentifier + '.' : '') + this.key.publicKey;\n this.eventListeners = {\n connect: [],\n message: [],\n session: []\n };\n this.msgCache = new _memoryCache.Cache();\n this.acceptAddrs = [];\n this.sessions = new Map();\n this.isReady = false;\n this.isClosed = false;\n\n for (let clientID of Object.keys(clients)) {\n clients[clientID].onMessage(async ({\n src,\n payload,\n payloadType,\n isEncrypted,\n messageId,\n noReply\n }) => {\n if (this.isClosed) {\n return false;\n }\n\n if (payloadType === common.pb.payloads.PayloadType.SESSION) {\n if (!isEncrypted) {\n return false;\n }\n\n try {\n await this._handleSessionMsg(clientID, src, messageId, payload);\n } catch (e) {\n if (!(e instanceof ncp.errors.SessionClosedError || e instanceof common.errors.AddrNotAllowedError)) {\n throw e;\n }\n }\n\n return false;\n }\n\n let key = common.util.bytesToHex(messageId);\n\n if (this.msgCache.get(key) !== null) {\n return false;\n }\n\n this.msgCache.put(key, clientID, options.msgCacheExpiration);\n src = util.removeIdentifier(src).addr;\n\n if (this.eventListeners.message.length > 0) {\n let responses = await _promise.default.all(this.eventListeners.message.map(async f => {\n try {\n return await f({\n src,\n payload,\n payloadType,\n isEncrypted,\n messageId,\n noReply\n });\n } catch (e) {\n console.log('Message handler error:', e);\n return null;\n }\n }));\n\n if (!noReply) {\n let responded = false;\n\n for (let response of responses) {\n if (response === false) {\n return false;\n } else if (response !== undefined && response !== null) {\n this.send(src, response, {\n encrypt: isEncrypted,\n msgHoldingSeconds: 0,\n replyToId: messageId\n }).catch(e => {\n console.log('Send response error:', e);\n });\n responded = true;\n break;\n }\n }\n\n if (!responded) {\n for (let clientID of Object.keys(clients)) {\n if (clients[clientID].isReady) {\n clients[clientID]._sendACK(util.addIdentifierPrefixAll(src, clientID), messageId, isEncrypted).catch(e => {\n console.log('Send ack error:', e);\n });\n }\n }\n }\n }\n }\n\n return false;\n });\n }\n }", "title": "" }, { "docid": "3a98dbb686ec802b7cca477e230e3488", "score": "0.42064378", "text": "function createRawApi(token, options, webhookReplyEnvelope) {\n const client = new ApiClient(token, options, webhookReplyEnvelope);\n const proxyHandler = {\n get(_, m) {\n return client.callApi.bind(client, m);\n },\n ...proxyMethods,\n };\n const raw = new Proxy({}, proxyHandler);\n const installedTransformers = client.installedTransformers;\n const api = {\n raw,\n installedTransformers,\n use: (...t) => {\n client.use(...t);\n return api;\n },\n };\n return api;\n}", "title": "" }, { "docid": "04a369d0009a0d424d437ef0b447eae4", "score": "0.41880313", "text": "function ClientStub(config) {\n try {\n this.ID = -2;\n this.Name = \"\";\n this.eventListeners = {};\n this.ws = config.ws;\n this.server = config.server;\n this.binary = {\n stream: null,\n imgPath: null,\n imgName: null\n };\n\n //configure the internal eventhandlers\n this._setupWebSocketEvents();\n this.setupCommuncationHandling();\n\n //send initial setup request\n this.sendEventOnly(STATES.SETUP_REQ);\n } catch (exception) {\n Logger.err(\"ClientStub creation:\", exception.message);\n }\n}", "title": "" }, { "docid": "ad8566420080c20b8e1f751bdfe28dff", "score": "0.41672266", "text": "function BaseTransport(options) {\n this.options = options;\n /** A simple buffer holding all requests. */\n this._buffer = new utils_1.PromiseBuffer(30);\n this._api = new core_1.API(options.dsn);\n }", "title": "" }, { "docid": "71aeadf4ed45bbb3deb9a290306c06e4", "score": "0.41522565", "text": "static from(signer, xrplNetwork) {\n var _a, _b, _c, _d;\n const account = (_b = (_a = signer.getAccount()) === null || _a === void 0 ? void 0 : _a.getValue()) === null || _b === void 0 ? void 0 : _b.getAddress();\n if (!account) {\n throw new __1.XrpError(__1.XrpErrorType.MalformedProtobuf, 'Signer protobuf is missing `account` field.');\n }\n const accountXAddress = xrp_utils_1.default.encodeXAddress(account, undefined, xrplNetwork == xpring_common_js_1.XrplNetwork.Test || xrplNetwork == xpring_common_js_1.XrplNetwork.Dev);\n if (!accountXAddress) {\n throw new __1.XrpError(__1.XrpErrorType.MalformedProtobuf, 'Cannot construct XAddress from Signer protobuf `account` field.');\n }\n const signingPublicKey = (_c = signer.getSigningPublicKey()) === null || _c === void 0 ? void 0 : _c.getValue_asU8();\n if (!signingPublicKey) {\n throw new __1.XrpError(__1.XrpErrorType.MalformedProtobuf, 'Signer protobuf is missing `SigningPublicKey` field.');\n }\n const transactionSignature = (_d = signer\n .getTransactionSignature()) === null || _d === void 0 ? void 0 : _d.getValue_asU8();\n if (!transactionSignature) {\n throw new __1.XrpError(__1.XrpErrorType.MalformedProtobuf, 'Signer protobuf is missing `TransactionSignature` field.');\n }\n return new XrpSigner(accountXAddress, signingPublicKey, transactionSignature);\n }", "title": "" }, { "docid": "ba579cbbe53fb3e5124b61e3adea254d", "score": "0.41511804", "text": "function main() {\n var server = new grpc.Server();\n server.addService(SumService.service, {sum: sum});\n server.bind(`0.0.0.0:${process.env.LISTEN_PORT || 50052}`, grpc.ServerCredentials.createInsecure());\n server.start();\n}", "title": "" }, { "docid": "b22c9e535393174c313da15db76d2656", "score": "0.41360262", "text": "exchange () {\n return new ExchangeEndpoint(this)\n }", "title": "" }, { "docid": "f3d9fc86d08b3594cee29702490f4419", "score": "0.413574", "text": "function initClient(connectionStringParam, credentialPath) {\r\n var connectionString = ConnectionString.parse(connectionStringParam);\r\n var deviceId = connectionString.DeviceId;\r\n\r\n // fromConnectionString must specify a transport constructor, coming from any transport package.\r\n client = Client.fromConnectionString(connectionStringParam, Protocol);\r\n\r\n // Configure the client to use X509 authentication if required by the connection string.\r\n if (connectionString.x509) {\r\n // Read X.509 certificate and private key.\r\n // These files should be in the current folder and use the following naming convention:\r\n // [device name]-cert.pem and [device name]-key.pem, example: myraspberrypi-cert.pem\r\n var connectionOptions = {\r\n cert: fs\r\n .readFileSync(path.join(credentialPath, deviceId + '-cert.pem'))\r\n .toString(),\r\n key: fs\r\n .readFileSync(path.join(credentialPath, deviceId + '-key.pem'))\r\n .toString()\r\n };\r\n\r\n client.setOptions(connectionOptions);\r\n\r\n console.log('[Device] Using X.509 client certificate authentication');\r\n }\r\n return client;\r\n }", "title": "" }, { "docid": "7d5370e1c9555ece5afcfbf0cd58d2d7", "score": "0.41306207", "text": "function client(srv, nsp, opts) {\n if ('object' == typeof nsp) {\n opts = nsp;\n nsp = null;\n }\n var addr = srv.address();\n if (!addr) addr = srv.listen().address();\n var url = 'ws://' + addr.address + ':' + addr.port + (nsp || '');\n return ioc.connect(url, opts);\n}", "title": "" }, { "docid": "7c0cef754f97a4202bd8afd7864eaab0", "score": "0.41301644", "text": "function main() {\n var server = new grpc.Server();\n server.addService(ep_proto.Teste.service, {Teste1: Teste1, Teste2: Teste2, Teste3: Teste3, Teste4: Teste4, Teste5: Teste5});\n server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());\n server.start();\n console.log('\\033[96m'+'Servidor em execucao. Para interromper utilize Ctrl+C. '+'\\033[39m');\n}", "title": "" }, { "docid": "93fa845231d8fa8cdd8bdba1d3c52e13", "score": "0.41296592", "text": "constructor(networkClient, network) {\n this.networkClient = networkClient;\n this.network = network;\n this.coreXrplClient = new core_xrpl_client_1.default(networkClient, network);\n }", "title": "" }, { "docid": "e9ac42348b8ba8368622d818792096d8", "score": "0.41208354", "text": "function EndpointInterface() {}", "title": "" }, { "docid": "56cc7728561181dd0d38a958100cb0a0", "score": "0.41186097", "text": "function createRestService(props) {\n 'use strict';\n assert(props, 'createRestService requires props');\n assert(props.name, util.format('createRestService props.name :%j', props));\n assert(props.baseURL, util.format('createRestService props.baseURL missing:%j', props));\n assert(props.URLversion, util.format('createRestService props.URLversion missing:%j', props));\n assert(props.port, util.format('createRestService props.port missing:%j', props));\n\n console.log('createRestService invoked with props:%j', props);\n\n let serviceName = props.name;\n\n let loggingMD = { fileName: 'node-utils/restServer.js', ServiceType: props.name, };\n\n // if passed in a logger then use that over the one we have\n //\n let logger;\n if (props.logger) {\n logger = props.logger;\n } else {\n // logger can handle a null logConfig\n logger = loggerFactory.create(props.logConfig);\n }\n\n // set the host and the port\n let host = '0.0.0.0'; // for docker bind to this can overide with props.host\n if (props.host) {\n host = props.host;\n }\n\n let port = props.port;\n\n // confgure the base path, version information\n // if just slash then do set to null as resify adds a slash\n let URLversion = '/' + props.URLversion;\n let baseURL = null;\n if (props.baseURL !== '/') {\n baseURL = props.baseURL;\n } else {\n baseURL = null;\n }\n\n // utility routine to prefix a baseURL and version to the path\n function prefixBaseURLandVersion(path) {\n\n let prefix = URLversion;\n if (baseURL) {\n prefix = baseURL + URLversion;\n }\n\n if (path) {\n return prefix + path;\n } else {\n return prefix; // root\n }\n }\n\n //\n // create the underlying RestServer and install any middleware it needs before\n // installing others - was running into issues with Promises and next being\n // ignored if installed afterwards\n //\n\n //\n // Based on if TLS is needed create server differently\n // look at https://nodejs.org/dist/latest-v7.x/docs/api/https.html#https_https_createserver_options_requestlistener\n // for all the options that should support.\n //\n let restifyServer = null;\n if ((process.env.TLS_ENABLED === '1') || (props.TLSEnabled === '1')) {\n assert(props.certificate, util.format('TLS enabled and no props.certificate passed in:%j', props));\n assert(props.key, util.format('TLS enabled and no props.key passed in:%j', props));\n\n logger.logJSON('info',\n { serviceType: serviceName, action: 'RestServer-TLS-ENABLED',\n certificate: props.certificate, key: props.key }, loggingMD);\n\n // use option to pass config parameters straignt through to node HTTPS so can use all parameters\n let httpsServerOptions = {\n cert: fs.readFileSync(props.certificate),\n key: fs.readFileSync(props.key),\n };\n\n restifyServer = restify.createServer({\n httpsServerOptions: httpsServerOptions,\n });\n\n } else {\n\n logger.logJSON('info',\n { serviceType: serviceName, action: 'RestServer-TLS-DISABLED' }, loggingMD);\n\n restifyServer = restify.createServer();\n }\n\n console.log('createRestService - created server - adding: bodyParser; queryParser');\n\n // add the built in plugins - if do not add this then no body\n restifyServer.use(restify.bodyParser());\n restifyServer.use(restify.queryParser());\n\n // setup state for internal API key\n\n let internalApiKey = null;\n let internalApiKeyName = RestServerConstants.INTERNAL_API_KEY_DEFAULT_NAME;\n if ((props.config) && (props.config.internal_api_key) && (props.config.internal_api_key.enabled)) {\n internalApiKey = props.config.internal_api_key.key;\n if (props.config.internal_api_key.name) {\n internalApiKeyName = props.config.internal_api_key.name;\n }\n\n logger.logJSON('info', { serviceType: serviceName, action: 'RestServer-Internal-API-Key-ENABLED',\n internalApiKey: internalApiKey, internalApiKeyName: internalApiKeyName, }, loggingMD);\n } else {\n\n logger.logJSON('info', { serviceType: serviceName, action: 'RestServer-Internal-API-Key-DISABLED', }, loggingMD);\n }\n\n // check API key if all good continue with next otherwise return forbidden\n function checkInternalApiKey(req) {\n if (internalApiKey) {\n if (req.headers) {\n if (req.headers[internalApiKeyName] === internalApiKey) {\n return HttpStatus.OK;\n } else {\n logger.logJSON('info', { serviceType: serviceName, action: 'RestServer-Internal-API-Key-Check-Result-FORBIDDEN-NAME-OR-KEY-WRONG',\n internalApiKey: internalApiKey, internalApiKeyName: internalApiKeyName,\n headers: req.headers, }, loggingMD);\n\n return HttpStatus.FORBIDDEN;\n }\n } else {\n\n logger.logJSON('info', { serviceType: serviceName, action: 'RestServer-Internal-API-Key-Check-Result-FORBIDDEN-NO-HEADERS',\n internalApiKey: internalApiKey, internalApiKeyName: internalApiKeyName,\n headers: req.headers, }, loggingMD);\n\n return HttpStatus.FORBIDDEN;\n }\n } else {\n return HttpStatus.OK;\n }\n }\n\n //\n // Return logger associated with the service\n function getLogger() {\n return logger;\n }\n\n // start the service\n function start(startedCallback) {\n\n assert(startedCallback, 'start - no callback passed in');\n\n logger.logJSON('info', { serviceType: serviceName, action: 'RestServer-Start-Invoked',\n baseURL: baseURL, URLversion: URLversion, port: port, host: host }, loggingMD);\n\n //\n // if an unexpected errors the shut down process\n //\n restifyServer.on('uncaughtException', function (p1, p2, p3, p4) {\n if (p4 instanceof assert.AssertionError) {\n logger.logJSON('error', { serviceType: serviceName,\n action: 'RestServer-Crashing-assert-AssertionError', errString: p4 }, loggingMD);\n } else {\n logger.logJSON('error', { serviceType: serviceName,\n action: 'RestServer-Crashing-Unknown-Error',\n errorMsg: util.format('p1:%s, p2:%s, p3:%s, p4:%s', serviceName, p1, p2, p3, p4) }, loggingMD);\n }\n\n console.log('%s - console-log-RestServer-Crashing-Unknown-Error: \\np1:%s, \\np2:%s, \\np3:%s, \\np4:%s', serviceName, p1, p2, p3, p4);\n console.log('STACK:%s', p4.stack);\n process.abort();\n });\n\n restifyServer.listen(port, host, function (err) {\n assert(!err, util.format('Error restifyServer.listen;%j', err));\n\n //\n // add status message at '/'\n //\n restifyServer.get('/', function (req, res, next) { // jshint ignore:line\n let statusMsg = {};\n loggingHandler(req, res, next, 'GET-on-path', '/');\n res.statusCode = HttpStatus.OK;\n res.setHeader('content-type', 'application/json');\n statusMsg.statusCode = HttpStatus.OK;\n statusMsg.serviceName = serviceName;\n statusMsg.version = props.serviceVersionNumber;\n res.send(statusMsg);\n });\n\n logger.logJSON('info',\n { serviceType: serviceName, action: 'RestServer-Started',\n address: restifyServer.address(),\n serverName: restifyServer.name, restifyServerUrl: restifyServer.url,\n baseURL: baseURL, URLversion: URLversion, port: port,\n serviceName: serviceName, serviceVersion: props.serviceVersionNumber }, loggingMD);\n\n return startedCallback(null);\n\n });\n }\n\n //\n // stop the service\n //\n function stop(callback) {\n logger.logJSON('info', { serviceType: serviceName, action: 'Service-Stop' }, loggingMD);\n restifyServer.close();\n return callback(null);\n }\n\n // logs a message - can be placed on handler chain for a path\n function loggingHandler(req, res, next, actionMsg, path) {\n logger.logJSON('info', { serviceType: serviceName, action: actionMsg, path: path, headers: req.headers }, loggingMD);\n return next();\n }\n\n //\n // register the handler on the specified path\n //\n function registerGETHandler(path, handler) {\n assert(handler, 'No handler passed to registerGETHandler');\n assert(handler.get, util.format('No get method on handler:%j', handler));\n\n let versionedPath = prefixBaseURLandVersion(path);\n\n logger.logJSON('info', { serviceType: serviceName, action: 'Registered-GET-Handler', path: versionedPath }, loggingMD);\n\n restifyServer.get(\n versionedPath,\n function (req, res, next) {\n loggingHandler(req, res, next, 'GET-on-path', versionedPath);\n },\n\n function (req, res, next) {\n let ok = checkInternalApiKey(req);\n if (ok !== HttpStatus.OK) {\n\n logger.logJSON('info', { serviceType: serviceName,\n action: 'Get-on-path-FORBIDDEN', path: versionedPath,\n headers: req.headers }, loggingMD);\n\n res.statusCode = ok;\n res.setHeader('content-type', 'text/plain');\n res.send('FORBIDDEN');\n return next();\n }\n\n handler.get(req, res, function (err, data) {\n if (err) {\n logger.logJSON('error', { serviceType: serviceName, action: 'GET-Handler-ERROR',\n path: versionedPath, error: err }, loggingMD);\n assert.fail(util.format('Unexpected ERROR: %j - processing GET on: %s', err, versionedPath));\n return next((new restify.BadRequestError(err)));\n } else {\n // if not set then default to json\n if ((!res.getHeader('content-type')) && (!res.getHeader('Content-type'))) {\n res.setHeader('content-type', 'application/json');\n }\n\n if (!res.statusCode) {\n res.statusCode = HttpStatus.OK;\n }\n\n res.send(data);\n return next();\n }\n });\n }\n );\n }\n\n function registerGETJWTHandler(path, handler) {\n assert(handler, 'No handler passed to registerGETJWTHandler');\n assert(handler.get, util.format('No get method on handler:%j', handler));\n\n let versionedPath = prefixBaseURLandVersion(path);\n\n logger.logJSON('info', { serviceType: serviceName, action: 'Registered-GETJWT-Handler', path: versionedPath }, loggingMD);\n\n restifyServer.get(\n versionedPath,\n function (req, res, next) { // jshint ignore:line\n loggingHandler(req, res, next, 'GET-on-path', versionedPath);\n },\n\n function (req, res, next) {\n let ok = checkInternalApiKey(req);\n if (ok !== HttpStatus.OK) {\n\n logger.logJSON('info', { serviceType: serviceName,\n action: 'GetJWT-on-path-FORBIDDEN', path: versionedPath,\n headers: req.headers }, loggingMD);\n\n res.statusCode = ok;\n res.setHeader('content-type', 'text/plain');\n res.send('FORBIDDEN');\n return next();\n }\n\n handler.get(req, res, function (err, data) {\n if (err) {\n logger.logJSON('error', { serviceType: serviceName, action: 'GETJWT-Handler-ERROR',\n path: versionedPath, error: err }, loggingMD);\n assert.fail(util.format('Unexpected ERROR: %j - processing GETJWt on: %s', err, versionedPath));\n return next((new restify.BadRequestError(err)));\n } else {\n // if not set then default to json\n if ((!res.getHeader('content-type')) && (!res.getHeader('Content-type'))) {\n res.setHeader('content-type', 'text/plain');\n }\n\n if (!res.statusCode) {\n res.statusCode = HttpStatus.OK;\n }\n\n res.send(data);\n return next();\n }\n });\n }\n );\n }\n\n //\n // register the handler on the specified path\n //\n function registerPOSTHandler(path, handler) {\n assert(handler, 'No handler passed to registerPOSTHandler');\n assert(handler.post, util.format('No post method on handler:%j', handler));\n\n let versionedPath = prefixBaseURLandVersion(path);\n\n logger.logJSON('info', { serviceType: serviceName, action: 'Registered-POST-Handler', path: versionedPath }, loggingMD);\n\n restifyServer.post(\n versionedPath,\n function (req, res, next) { // jshint ignore:line\n loggingHandler(req, res, next, 'Recieved-POST-on', versionedPath);\n },\n\n function (req, res, next) {\n let ok = checkInternalApiKey(req);\n if (ok !== HttpStatus.OK) {\n\n logger.logJSON('info', { serviceType: serviceName,\n action: 'POST-on-path-FORBIDDEN', path: versionedPath,\n headers: req.headers }, loggingMD);\n\n res.statusCode = ok;\n res.setHeader('content-type', 'text/plain');\n res.send('FORBIDDEN');\n return next();\n }\n\n handler.post(req, res, function (err, data, props) {\n if (err) {\n logger.logJSON('error', { serviceType: serviceName, action: 'POST-Handler-ERROR',\n path: versionedPath, error: err, svcRequest: req }, loggingMD);\n assert(!err, util.format('Unexpected ERROR: %j - processing POST on: %s', err, versionedPath));\n return next((new restify.BadRequestError(err)));\n } else {\n\n if (props) {\n assert.fail(\n 'Code no longer pass props to set the status code or header, set directly if want to overide default:%s', props);\n }\n\n if (!res.statusCode) {\n logger.logJSON('error', { serviceType: serviceName, action: 'POST-Handler-Setting-Status-Code-to-Default-OK',\n path: versionedPath, svcRequestId: req['@id'] }, loggingMD);\n res.statusCode = HttpStatus.OK;\n }\n\n if ((!res.getHeader('content-type')) && (!res.getHeader('Content-type'))) {\n logger.logJSON('info', { serviceType: serviceName, action: 'POST-Handler-Setting-Response-Content-Type-to-application-json-as-not-set',\n path: versionedPath }, loggingMD);\n res.setHeader('content-type', 'application/json');\n }\n\n if (!data) {\n res.send();\n } else {\n res.send(data);\n }\n\n return next();\n }\n });\n }\n );\n }\n\n function registerPOSTJWTHandler(path, handler) {\n assert(handler, 'No handler passed to registerPOSTJWTHandler');\n assert(handler.post, util.format('No post method on handler:%j', handler));\n\n let versionedPath = prefixBaseURLandVersion(path);\n\n logger.logJSON('info', { serviceType: serviceName, action: 'Registered-POST-JWT-Handler', path: versionedPath }, loggingMD);\n\n restifyServer.post(\n versionedPath,\n function (req, res, next) { // jshint ignore:line\n loggingHandler(req, res, next, 'Recieved-POST-on', versionedPath);\n },\n\n function (req, res, next) {\n let ok = checkInternalApiKey(req);\n if (ok !== HttpStatus.OK) {\n\n logger.logJSON('info', { serviceType: serviceName,\n action: 'POSTJWT-on-path-FORBIDDEN', path: versionedPath,\n headers: req.headers }, loggingMD);\n\n res.statusCode = ok;\n res.setHeader('content-type', 'text/plain');\n res.send('FORBIDDEN');\n return next();\n }\n\n handler.post(req, res, function (err, data) {\n if (err) {\n logger.logJSON('error', { serviceType: serviceName, action: 'POST-JWT-Handler-ERROR',\n path: versionedPath, error: err, svcRequest: req }, loggingMD);\n assert(!err, util.format('Unexpected ERROR: %j - processing POSTJWT on: %s', err, versionedPath));\n return next((new restify.BadRequestError(err)));\n } else {\n\n if (!res.statusCode) {\n logger.logJSON('error', { serviceType: serviceName, action: 'POST-JWT-Handler-Setting-Status-Code-to-Default-OK',\n path: versionedPath, svcRequestId: req['@id'] }, loggingMD);\n res.statusCode = HttpStatus.OK;\n }\n\n // if the content-header has not been set then set to default of returning\n // a jwt.\n if ((!res.getHeader('content-type')) && (!res.getHeader('Content-type'))) {\n res.setHeader('content-type', 'text/plain');\n }\n\n if (!data) {\n res.send();\n } else {\n res.send(data);\n }\n\n return next();\n }\n });\n }\n );\n }\n\n let thisService = {\n logger: getLogger,\n registerGETHandler: registerGETHandler,\n registerGETJWTHandler: registerGETJWTHandler,\n registerPOSTHandler: registerPOSTHandler,\n registerPOSTJWTHandler: registerPOSTJWTHandler,\n start: start,\n stop: stop };\n\n return thisService;\n} // create restService", "title": "" }, { "docid": "817cfd29627439c9d3a1ebc928226671", "score": "0.41152927", "text": "function createProxiedInterface(instance, context) {\n const defaultQuery = new TrackingClient(instance, context, 'default');\n const pgClient = {\n query(...args) {\n return instance.query(...args);\n },\n queryWithContext(...args) {\n return instance.queryWithContext(...args);\n },\n connect(...args) {\n return instance.baseClient.connect(...args);\n },\n };\n const methods = ['any', 'one', 'oneOrNone', 'many', 'manyOrNone', 'none', 'result', 'tx', 'task'];\n for (const m of methods) {\n pgClient[m] = function defaultQueryFn(...args) {\n if (context && context.logger && context.logger.warn) {\n context.logger.warn(`pg method '${m}' called without query name. Use client.query(context, name).${m}(...)`, {\n stack: new Error().stack,\n });\n }\n if (!defaultQuery[m]) {\n throw new Error(`Invalid query function: ${m}. Supported: ${Object.getOwnPropertyNames(defaultQuery)}`);\n }\n return defaultQuery[m](...args);\n };\n }\n return pgClient;\n}", "title": "" }, { "docid": "1b4e1bdbf7070a53c22c1e1ca95434dc", "score": "0.41128883", "text": "function BaseTransport(options) {\n this.options = options;\n /** A simple buffer holding all requests. */\n this._buffer = new promisebuffer_PromiseBuffer(30);\n /** Locks transport after receiving 429 response */\n this._disabledUntil = new Date(Date.now());\n this._api = new api_API(options.dsn);\n }", "title": "" }, { "docid": "b04e607b507a6c1cd439830f9017d3c4", "score": "0.41064292", "text": "async function main() {\n let argv = parseArguments(process.argv);\n _ = await generateEndpointConfiguration(argv.proxy_url);\n _ = await generateGrpcWebInterface(\n fs.readdirSync(serviceProtoInterfaceDirectory)\n .map(filename => path.join(serviceProtoInterfaceDirectory, filename))\n .concat([path.join('${googleApisInclude}', 'google', 'rpc',\n 'status.proto')]),\n [serviceProtoInterfaceDirectory],\n path.join(dashboardDirectory, '.grpcWeb'),\n dashboardGenDirectory, 'falken_service_grpc_web_pb.js',\n path.join(dashboardDistDirectory, 'falken_grpc-bundle.js'),\n 'falkenProto');\n if (argv.serve_mode == 'serve') {\n _ = launchGrpcWebProxy(argv.serve_port, argv.proxy_url, argv.endpoint_url,\n argv.cert_file, argv.key_file,\n path.join(dashboardDirectory, '.grpcWebProxy'));\n }\n _ = await build(argv.serve_mode, argv.serve_port);\n _ = await publish(argv.deploy);\n return Promise.resolve();\n}", "title": "" }, { "docid": "7c26adc3aad4dcef883e953ce23bb1d1", "score": "0.40701202", "text": "function BaseClient(backendClass, options) {\n /** Is the client still processing a call? */\n this._processing = false;\n this._backend = new backendClass(options);\n this._options = options;\n if (options.dsn) {\n this._dsn = new dsn_1.Dsn(options.dsn);\n }\n this._integrations = integration_1.setupIntegrations(this._options);\n }", "title": "" }, { "docid": "44f053f6f69fe93704f49d6c2d6ec06b", "score": "0.406008", "text": "endpoint() {}", "title": "" }, { "docid": "921f660005c1e9a2e6b1871324552025", "score": "0.40508527", "text": "function startNew(options) {\n return __awaiter(this, void 0, void 0, function* () {\n let settings = options.serverSettings || __1.ServerConnection.makeSettings();\n let url = coreutils_1.URLExt.join(settings.baseUrl, KERNEL_SERVICE_URL);\n let init = {\n method: 'POST',\n body: JSON.stringify({ name: options.name })\n };\n let response = yield __1.ServerConnection.makeRequest(url, init, settings);\n if (response.status !== 201) {\n throw new __1.ServerConnection.ResponseError(response);\n }\n let data = yield response.json();\n validate.validateModel(data);\n return new DefaultKernel(Object.assign({}, options, { name: data.name, serverSettings: settings }), data.id);\n });\n }", "title": "" }, { "docid": "c65b095ec2584e6dc1083a07b92fc1e6", "score": "0.40480635", "text": "function DnsimpleClientFactory(credentials) {\n this.credentials = credentials;\n}", "title": "" }, { "docid": "8b1cdd3022d2d09aa210354cbb9e2280", "score": "0.40331358", "text": "function createPingPongClient(proteusGateway) {\n\n //Gets a handle to a ReactiveSocket, targeting the group set up in this ProteusGateway config\n const rs = proteusGateway.group(proteusGateway.myGroup());\n\n return {\n // Sends a single 'Ping' message in a Request/Response interaction model\n ping: function pingOnce() {\n const dataBuf = Buffer.from(proteusGateway.myTags()['name']);\n const metadataBuf = encodeMetadata(\n 'io.netifi.proteus.demo.PingPongService',\n 'Ping',\n Buffer.alloc(0),\n Buffer.alloc(0),\n );\n console.log('Pinging...');\n\n // This invokes the corresponding `requestResponse` method on the service, implemented below and returns a\n // \"Single\" of the response\n return rs\n .requestResponse({\n data: dataBuf,\n metadata: metadataBuf,\n })\n .map(payload => {\n console.log('Received payload:' + JSON.stringify(payload));\n if (payload.data == null) {\n throw new Error('data is null');\n }\n return payload.data.toString('utf8');\n });\n },\n\n // Sends a single 'Ping' message in a Fire and Forget interaction model\n pingFnF: function pingFnF() {\n const dataBuf = Buffer.from(proteusGateway.myTags()['name']);\n const metadataBuf = encodeMetadata(\n 'io.netifi.proteus.demo.PingPongService',\n 'Ping',\n Buffer.alloc(0),\n Buffer.alloc(0),\n );\n\n // This invokes the corresponding `fireAndForget` method on the service, implemented below and returns nothing\n // as this interaction model assumes the client is done as soon as the message is sent\n return rs\n .fireAndForget({\n data: dataBuf,\n metadata: metadataBuf,\n });\n },\n\n // Sends a single 'Ping' message and expects a stream of 'Pong' responses\n pingStream: function pingStream(){\n const dataBuf = Buffer.from(proteusGateway.myTags()['name']);\n const metadataBuf = encodeMetadata(\n 'io.netifi.proteus.demo.PingPongService',\n 'Ping',\n Buffer.alloc(0),\n Buffer.alloc(0),\n );\n\n // This invokes the corresponding `requestStream` method on the service, implemented below and returns a\n // stream that represents the 0 or more 'Pong' responses from the server\n return rs\n .requestStream({\n data: dataBuf,\n metadata: metadataBuf,\n })\n .map(payload => {\n console.log('Received stream payload:' + JSON.stringify(payload));\n if (payload.data == null) {\n throw new Error('data is null');\n }\n return payload.data.toString('utf8');\n });\n }\n };\n}", "title": "" }, { "docid": "285bc17677118f5be0d75c42a44fc494", "score": "0.40330204", "text": "async _connect () {\n this._log.info('connecting to rippled')\n await this._api.connect()\n await this._api.connection.request({\n command: 'subscribe',\n accounts: [ this._address ]\n })\n this._log.info('connected to rippled')\n\n await this._store.load('incoming_channel')\n await this._store.load('outgoing_channel')\n await this._store.load('incoming_claim')\n await this._store.load('outgoing_claim')\n\n this._incomingChannel = this._store.get('incoming_channel')\n this._outgoingChannel = this._store.get('outgoing_channel')\n this._incomingClaim = JSON.parse(this._store.get('incoming_claim') || '{\"amount\":\"0\"}')\n this._outgoingClaim = JSON.parse(this._store.get('outgoing_claim') || '{\"amount\":\"0\"}')\n this._log.trace('loaded incoming claim:', this._incomingClaim)\n\n if (this._incomingChannel) {\n await this._watcher.watch(this._incomingChannel)\n await this._reloadIncomingChannelDetails()\n }\n\n if (!this._peerAddress) {\n try {\n this._log.error('No peer xrp address was specified; fetching from peer.')\n const data = await this._sendXrpAddressRequest()\n const peerAddress = data\n .protocolData\n .filter(p => p.protocolName === 'xrp_address')[0]\n .data\n .toString()\n\n this._setPeerAddress(peerAddress)\n } catch (e) {\n this._log.error('No peer address was specified and peer does not support xrp_address protocol.' +\n ' error=' + e.message)\n throw e\n }\n }\n\n if (!this._outgoingChannel) {\n this._log.info('creating new payment channel')\n\n let ev\n try {\n const txTag = util.randomTag()\n ev = await this._txSubmitter.submit('preparePaymentChannelCreate', {\n amount: this.baseToXrp(this._channelAmount),\n destination: this._peerAddress,\n settleDelay: this._settleDelay,\n publicKey: 'ED' + Buffer.from(this._keyPair.publicKey).toString('hex').toUpperCase(),\n sourceTag: txTag\n })\n } catch (err) {\n this._log.error('Error creating payment channel')\n throw err\n }\n\n this._outgoingChannel = util.computeChannelId(\n ev.transaction.Account,\n ev.transaction.Destination,\n ev.transaction.Sequence\n )\n this._store.set('outgoing_channel', this._outgoingChannel)\n\n this._log.info('payment channel successfully created: ', this._outgoingChannel)\n }\n\n await this._reloadOutgoingChannelDetails()\n this._paychanReady = true\n }", "title": "" }, { "docid": "2413d55660f2510b18f54724f23834b6", "score": "0.40307564", "text": "static constructRpc(pipe) {\n var _a;\n assert(pipe);\n let rpc = null;\n if (pipe instanceof stream_1.Duplex) {\n rpc = vscode_jsonrpc_1.createMessageConnection(new vscode_jsonrpc_1.StreamMessageReader(pipe), new vscode_jsonrpc_1.StreamMessageWriter(pipe));\n pipe.on('close', () => {\n var _a;\n (_a = rpc) === null || _a === void 0 ? void 0 : _a.dispose();\n });\n rpc.onDispose(() => pipe.end());\n rpc.onClose(() => pipe.end());\n }\n else {\n rpc = vscode_jsonrpc_1.createMessageConnection(pipe.stream, pipe.stream);\n rpc.onDispose(() => pipe.dispose());\n pipe.completion.then(() => {\n var _a;\n (_a = rpc) === null || _a === void 0 ? void 0 : _a.dispose();\n });\n rpc.onClose(() => pipe.dispose());\n }\n (_a = rpc) === null || _a === void 0 ? void 0 : _a.listen();\n return rpc;\n }", "title": "" }, { "docid": "582d002433b1740ce5a866392eb5a540", "score": "0.40245187", "text": "function createClientForHandler(handler) {\n const server = http_1.default.createServer(handler);\n return supertest(server);\n}", "title": "" }, { "docid": "53a058ea668515c68410a3463f1e0f74", "score": "0.40167004", "text": "function Endpoint() {\n _classCallCheck(this, Endpoint);\n\n var _this = _possibleConstructorReturn(this, (Endpoint.__proto__ || Object.getPrototypeOf(Endpoint)).call(this));\n\n _this._subsciption = null;\n _this._inputStream = null;\n _this._unhandledStream = null;\n _this.unhandled = new _kefir2.default.Pool();\n return _this;\n }", "title": "" }, { "docid": "bedd6b02f378234e3b50ff40df398565", "score": "0.40152583", "text": "async function createPublicIPAddressDefaults() {\n const subscriptionId = process.env[\"NETWORK_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"NETWORK_RESOURCE_GROUP\"] || \"rg1\";\n const publicIpAddressName = \"test-ip\";\n const parameters = { location: \"eastus\" };\n const credential = new DefaultAzureCredential();\n const client = new NetworkManagementClient(credential, subscriptionId);\n const result = await client.publicIPAddresses.beginCreateOrUpdateAndWait(\n resourceGroupName,\n publicIpAddressName,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "1a10f678c78072c14d80e30e831af490", "score": "0.40142065", "text": "function CreateClientVpnEndpointCommand(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 }", "title": "" }, { "docid": "b47e3b4999764caf72233dac8f56c88f", "score": "0.40111554", "text": "function DefaultKernel(options, id) {\n this._id = '';\n this._name = '';\n this._status = 'unknown';\n this._clientId = '';\n this._isDisposed = false;\n this._wsStopped = false;\n this._ws = null;\n this._username = '';\n this._reconnectLimit = 7;\n this._reconnectAttempt = 0;\n this._isReady = false;\n this._targetRegistry = Object.create(null);\n this._info = null;\n this._pendingMessages = [];\n this._statusChanged = new signaling_1.Signal(this);\n this._iopubMessage = new signaling_1.Signal(this);\n this._unhandledMessage = new signaling_1.Signal(this);\n this._displayIdToParentIds = new Map();\n this._msgIdToDisplayIds = new Map();\n this._noOp = function () { };\n this._name = options.name;\n this._id = id;\n this.serverSettings = options.serverSettings || __1.ServerConnection.makeSettings();\n this._clientId = options.clientId || coreutils_1.uuid();\n this._username = options.username || '';\n this._futures = new Map();\n this._commPromises = new Map();\n this._comms = new Map();\n this._createSocket();\n this.terminated = new signaling_1.Signal(this);\n Private.runningKernels.push(this);\n }", "title": "" }, { "docid": "3e672b8f035413dbfe2adc80d992c662", "score": "0.40054747", "text": "function buildClient(){\n if(!client){\n\n const type = getAuthType();\n const appId = getAppId();\n const endpoints = getEndpoints();\n const easEndpoint = getEasUrl();\n const kasEndpoint = getKasUrl();\n const acmEndpoint = getAcmUrl();\n\n const clientConf = {\n email: getUser(),\n easEndpoint: easEndpoint || endpoints.easEndpoint, \n kasEndpoint: kasEndpoint || endpoints.kasEndpoint, \n acmEndpoint: acmEndpoint || endpoints.acmEndpoint\n };\n\n if(appId){\n clientConf.appId = appId;\n }\n \n client = new Virtru.Client(clientConf);\n }\n\n return client;\n}", "title": "" }, { "docid": "7de0ee0da45e6713a4cc368942361545", "score": "0.39845875", "text": "start() {\n this.server.bind(this.serverAddress, grpc.ServerCredentials.createInsecure());\n this.server.start();\n this.started = true;\n }", "title": "" }, { "docid": "b22c9fa37df4c4561c018d81d9164022", "score": "0.39829525", "text": "constructor(options) {BaseClient.prototype.__init.call(this);BaseClient.prototype.__init2.call(this);BaseClient.prototype.__init3.call(this);BaseClient.prototype.__init4.call(this);BaseClient.prototype.__init5.call(this);\n this._options = options;\n\n if (options.dsn) {\n this._dsn = utils.makeDsn(options.dsn);\n } else {\n (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__) && utils.logger.warn('No DSN provided, client will not do anything.');\n }\n\n if (this._dsn) {\n const url = api.getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);\n this._transport = options.transport({\n recordDroppedEvent: this.recordDroppedEvent.bind(this),\n ...options.transportOptions,\n url,\n });\n }\n }", "title": "" }, { "docid": "2077e0904e651253a02810321f31fb10", "score": "0.3982174", "text": "function makeCredentialsProvider(credentials) {\n if (!credentials) {\n return new EmptyCredentialsProvider();\n }\n\n switch (credentials.type) {\n case 'gapi':\n var client = credentials.client; // Make sure this is a Gapi client.\n\n assert(!!(typeof client === 'object' && client !== null && client['auth'] && client['auth']['getAuthHeaderValueForFirstParty']), 'unexpected gapi interface');\n return new FirstPartyCredentialsProvider(client, credentials.sessionIndex || '0');\n\n case 'provider':\n return credentials.client;\n\n default:\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'makeCredentialsProvider failed due to invalid credential type');\n }\n}", "title": "" }, { "docid": "39c3e136e43d7a45508270d08e8d76a0", "score": "0.39698818", "text": "function create() {\n return new MarketApi();\n}", "title": "" }, { "docid": "fdd22967021c1f20ae4dd125c49b74e5", "score": "0.39688036", "text": "function Client (globalRequest) {\n var emptyResponse = JSON.parse(JSON.stringify(response))\n var body = ''\n\n // utility function to create an empty request object\n this.emptyRequest = function () {\n return JSON.parse(JSON.stringify(request))\n }\n\n // utility function to detect empty objects\n function isEmpty (obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n return false\n }\n }\n return true\n }\n\n // add query paramaters to a URL\n function buildPath (basePath, queryParams) {\n basePath = basePath.concat('?')\n var url = basePath.concat(queryString.stringify(queryParams))\n return url\n }\n\n function buildRequest (globalRequest, endpointRequest) {\n var request = JSON.parse(JSON.stringify(globalRequest))\n request.host = endpointRequest.host || globalRequest.host\n request.method = endpointRequest.method\n\n // build URL\n request.path = !isEmpty(endpointRequest.queryParams)\n ? buildPath(endpointRequest.path, endpointRequest.queryParams)\n : endpointRequest.path\n\n // add headers\n if (!isEmpty(endpointRequest.headers)) {\n for (var attrname in endpointRequest.headers) {\n request.headers[attrname] = endpointRequest.headers[attrname]\n }\n }\n\n // add the request body's content length\n if (!isEmpty(endpointRequest.body)) {\n body = JSON.stringify(endpointRequest.body)\n request.headers['Content-Length'] = Buffer.byteLength(body)\n request.headers['Content-Type'] = 'application/json'\n }\n\n return request\n }\n\n // API is the main interface to the API.\n this.API = function (endpointRequest, callback) {\n var request = buildRequest(globalRequest, endpointRequest)\n\n if ( endpointRequest.test == true ) {\n var http_request = http\n request.port = endpointRequest.port\n } else {\n var http_request = https\n }\n\n var httpRequest = http_request.request(request, function (httpResponse) {\n var responseBody = ''\n\n // cature the response from the API\n httpResponse.on('data', function (chunk) {\n responseBody += chunk\n })\n\n // after the call is complete, build the response object\n httpResponse.on('end', function () {\n var response = JSON.parse(JSON.stringify(emptyResponse))\n response.statusCode = httpResponse.statusCode\n response.body = responseBody\n response.headers = httpResponse.headers\n callback(response)\n })\n })\n\n httpRequest.on('error', function (e) {\n var response = JSON.parse(JSON.stringify(emptyResponse))\n response.statusCode = e.statusCode || 500\n response.body = JSON.stringify({\n message: e.message,\n name: e.name,\n stack: e.stack,\n })\n callback(response)\n })\n\n // if thre is a request body, sent it\n if (!isEmpty(endpointRequest.body)) {\n httpRequest.write(body)\n }\n\n httpRequest.end()\n }\n\n return this\n}", "title": "" }, { "docid": "209977716845de9941f96c93e50bf946", "score": "0.39652818", "text": "function defaultClientId() {\n return 'iotjs_mqtt_client_' + Date.now();\n}", "title": "" }, { "docid": "d4b11d5f56f6cacdd935c2eed2d1ed13", "score": "0.39587167", "text": "initialize(config) {\n return client.initialize(config)\n }", "title": "" }, { "docid": "3db2c4a68e030bcbebcfb496c8bfe3e4", "score": "0.39572036", "text": "function makeCredentialsProvider(credentials) {\n if (!credentials) {\n return new EmptyCredentialsProvider();\n }\n switch (credentials.type) {\n case 'gapi':\n var client = credentials.client;\n // Make sure this really is a Gapi client.\n assert(!!(typeof client === 'object' &&\n client !== null &&\n client['auth'] &&\n client['auth']['getAuthHeaderValueForFirstParty']), 'unexpected gapi interface');\n return new FirstPartyCredentialsProvider(client, credentials.sessionIndex || '0');\n case 'provider':\n return credentials.client;\n default:\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'makeCredentialsProvider failed due to invalid credential type');\n }\n}", "title": "" }, { "docid": "3db2c4a68e030bcbebcfb496c8bfe3e4", "score": "0.39572036", "text": "function makeCredentialsProvider(credentials) {\n if (!credentials) {\n return new EmptyCredentialsProvider();\n }\n switch (credentials.type) {\n case 'gapi':\n var client = credentials.client;\n // Make sure this really is a Gapi client.\n assert(!!(typeof client === 'object' &&\n client !== null &&\n client['auth'] &&\n client['auth']['getAuthHeaderValueForFirstParty']), 'unexpected gapi interface');\n return new FirstPartyCredentialsProvider(client, credentials.sessionIndex || '0');\n case 'provider':\n return credentials.client;\n default:\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'makeCredentialsProvider failed due to invalid credential type');\n }\n}", "title": "" }, { "docid": "545a01714e3e939c5a7c2652c476b75e", "score": "0.3952409", "text": "constructor(apiEndpoint, deviceId, consentToken) {\n console.log(\"Creating AlexaAddressClient instance.\");\n this.deviceId = deviceId;\n this.consentToken = consentToken;\n this.endpoint = apiEndpoint.replace(/^https?:\\/\\//i, \"\");\n }", "title": "" }, { "docid": "6142be7fccee3afa9259201b3f32feb6", "score": "0.39504617", "text": "create () {\n return new Promise(resolve => {\n let settled = false;\n\n const client = redis.createClient(redisPool.options.port, redisPool.options.host, {\n no_ready_check: redisPool.options.noReadyCheck\n });\n\n client.on('error', (err) => {\n if (settled) {\n err.name = redisPool.options.name;\n return redisPool.logger.error(err);\n }\n\n settled = true;\n client.end(FLUSH_CONNECTION);\n\n if (err) {\n return resolve(err);\n }\n\n return resolve(client);\n });\n\n client.on('ready', () => {\n client.select(database, err => {\n if (!settled) {\n settled = true;\n\n if (err) {\n return resolve(err);\n }\n\n return resolve(client);\n }\n });\n });\n });\n }", "title": "" }, { "docid": "6da41c4773ef71f344b576ea8a3c9a7d", "score": "0.3950322", "text": "function main() {\n pg.connect().then(function(r) {\n })\n console.log(\"cat grpc starting ...\")\n var server = new grpc.Server();\n server.addService(cat_proto.Cat.service, {createNeImAccount: createNeImAccount});\n server.bind('0.0.0.0:6431', grpc.ServerCredentials.createInsecure());\n server.start();\n}", "title": "" }, { "docid": "79510757d28aa83dbc4089413fdedc7f", "score": "0.39486963", "text": "function StorageClient(logging, host, port, knownTypes, typesNamespace, credentials) {\n var address = [host, port].join(':');\n this._log = logging;\n // in seconds, we use this to get an error when the channel is broken\n // 30 secconds is a lot time, still, under high load I guess this\n // can take some time. 5 seconds was sometimes not enough on my minikube\n // setup.\n // TODO: maybe we can have multiple retries with increasing deadlines\n // and still fail eventually.\n this._deadline = 30;\n this._log.info('StorageClient at:', address);\n this._client = new GrpcStorageClient(\n address\n , credentials || grpc.credentials.createInsecure()\n , {\n 'grpc.max_send_message_length': 80 * 1024 * 1024\n , 'grpc.max_receive_message_length': 80 * 1024 * 1024\n }\n );\n\n this._any = new ProtobufAnyHandler(this._log, knownTypes, typesNamespace);\n}", "title": "" }, { "docid": "58e42470b9c988e2022c55d63c2d7868", "score": "0.39481983", "text": "function makeCredentialsProvider(credentials) {\r\n if (!credentials) {\r\n return new EmptyCredentialsProvider();\r\n }\r\n switch (credentials.type) {\r\n case 'gapi':\r\n var client = credentials.client;\r\n // Make sure this really is a Gapi client.\r\n assert(!!(typeof client === 'object' &&\r\n client !== null &&\r\n client['auth'] &&\r\n client['auth']['getAuthHeaderValueForFirstParty']), 'unexpected gapi interface');\r\n return new FirstPartyCredentialsProvider(client, credentials.sessionIndex || '0');\r\n case 'provider':\r\n return credentials.client;\r\n default:\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'makeCredentialsProvider failed due to invalid credential type');\r\n }\r\n}", "title": "" }, { "docid": "58e42470b9c988e2022c55d63c2d7868", "score": "0.39481983", "text": "function makeCredentialsProvider(credentials) {\r\n if (!credentials) {\r\n return new EmptyCredentialsProvider();\r\n }\r\n switch (credentials.type) {\r\n case 'gapi':\r\n var client = credentials.client;\r\n // Make sure this really is a Gapi client.\r\n assert(!!(typeof client === 'object' &&\r\n client !== null &&\r\n client['auth'] &&\r\n client['auth']['getAuthHeaderValueForFirstParty']), 'unexpected gapi interface');\r\n return new FirstPartyCredentialsProvider(client, credentials.sessionIndex || '0');\r\n case 'provider':\r\n return credentials.client;\r\n default:\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'makeCredentialsProvider failed due to invalid credential type');\r\n }\r\n}", "title": "" }, { "docid": "2619adfbfaa916f9a97b9947f2d1fb11", "score": "0.3947574", "text": "function makeCredentialsProvider(credentials) {\r\n if (!credentials) {\r\n return new EmptyCredentialsProvider();\r\n }\r\n switch (credentials.type) {\r\n case 'gapi':\r\n var client = credentials.client;\r\n // Make sure this is a Gapi client.\r\n assert(!!(typeof client === 'object' &&\r\n client !== null &&\r\n client['auth'] &&\r\n client['auth']['getAuthHeaderValueForFirstParty']), 'unexpected gapi interface');\r\n return new FirstPartyCredentialsProvider(client, credentials.sessionIndex || '0');\r\n case 'provider':\r\n return credentials.client;\r\n default:\r\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'makeCredentialsProvider failed due to invalid credential type');\r\n }\r\n}", "title": "" }, { "docid": "ff9ab4dca2e7cb1bc78edfd0d8780405", "score": "0.39468232", "text": "generateGetApexWireAdapter(namespace,classname,method,isContinuation){const wireAdapter=generateWireAdapter((config,metaConfig)=>{return this._serviceGetApex(namespace,classname,method,isContinuation,config,metaConfig);});return wireAdapter;}", "title": "" }, { "docid": "9aa139f51ccb74daf6e92f7a93ab349d", "score": "0.39458776", "text": "function xdrClient (request) {\n\t return new PromiseObj(function (resolve) {\n\t\n\t var xdr = new XDomainRequest(),\n\t handler = function (_ref) {\n\t var type = _ref.type;\n\t\n\t\n\t var status = 0;\n\t\n\t if (type === 'load') {\n\t status = 200;\n\t } else if (type === 'error') {\n\t status = 500;\n\t }\n\t\n\t resolve(request.respondWith(xdr.responseText, { status: status }));\n\t };\n\t\n\t request.abort = function () {\n\t return xdr.abort();\n\t };\n\t\n\t xdr.open(request.method, request.getUrl());\n\t xdr.timeout = 0;\n\t xdr.onload = handler;\n\t xdr.onerror = handler;\n\t xdr.ontimeout = handler;\n\t xdr.onprogress = function () {};\n\t xdr.send(request.getBody());\n\t });\n\t}", "title": "" }, { "docid": "9aa139f51ccb74daf6e92f7a93ab349d", "score": "0.39458776", "text": "function xdrClient (request) {\n\t return new PromiseObj(function (resolve) {\n\t\n\t var xdr = new XDomainRequest(),\n\t handler = function (_ref) {\n\t var type = _ref.type;\n\t\n\t\n\t var status = 0;\n\t\n\t if (type === 'load') {\n\t status = 200;\n\t } else if (type === 'error') {\n\t status = 500;\n\t }\n\t\n\t resolve(request.respondWith(xdr.responseText, { status: status }));\n\t };\n\t\n\t request.abort = function () {\n\t return xdr.abort();\n\t };\n\t\n\t xdr.open(request.method, request.getUrl());\n\t xdr.timeout = 0;\n\t xdr.onload = handler;\n\t xdr.onerror = handler;\n\t xdr.ontimeout = handler;\n\t xdr.onprogress = function () {};\n\t xdr.send(request.getBody());\n\t });\n\t}", "title": "" }, { "docid": "2d04add871b436eeeb464e3d3a7b1201", "score": "0.39442912", "text": "function startNew(options = {}) {\n if (!terminal_1.TerminalSession.isAvailable()) {\n throw Private.unavailableMsg;\n }\n let serverSettings = options.serverSettings || __1.ServerConnection.makeSettings();\n let url = Private.getServiceUrl(serverSettings.baseUrl);\n let init = { method: 'POST' };\n return __1.ServerConnection.makeRequest(url, init, serverSettings)\n .then(response => {\n if (response.status !== 200) {\n throw new __1.ServerConnection.ResponseError(response);\n }\n return response.json();\n })\n .then((data) => {\n let name = data.name;\n return new DefaultTerminalSession(name, Object.assign({}, options, { serverSettings }));\n });\n }", "title": "" }, { "docid": "0ce5450ab9a8cb4311fd174383c69b8b", "score": "0.39428622", "text": "constructor(context = new context_1.Context(), debug = false) {\n this.context = context;\n const transport = grpc_transport_1.WebsocketTransport(); // Default to websocket always\n this.serviceHost = context.host;\n this.rpcOptions = {\n transport,\n debug,\n };\n // Set default transport to websocket \"globally\"\n grpc_web_1.grpc.setDefaultTransport(transport);\n }", "title": "" }, { "docid": "3dfac94508bd6f16ae255b2a94f15d1f", "score": "0.3941434", "text": "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "title": "" }, { "docid": "3dfac94508bd6f16ae255b2a94f15d1f", "score": "0.3941434", "text": "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "title": "" }, { "docid": "3dfac94508bd6f16ae255b2a94f15d1f", "score": "0.3941434", "text": "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "title": "" }, { "docid": "3dfac94508bd6f16ae255b2a94f15d1f", "score": "0.3941434", "text": "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "title": "" }, { "docid": "3dfac94508bd6f16ae255b2a94f15d1f", "score": "0.3941434", "text": "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "title": "" }, { "docid": "3dfac94508bd6f16ae255b2a94f15d1f", "score": "0.3941434", "text": "function xdrClient (request) {\n return new PromiseObj(function (resolve) {\n\n var xdr = new XDomainRequest(), handler = function (ref) {\n var type = ref.type;\n\n\n var status = 0;\n\n if (type === 'load') {\n status = 200;\n } else if (type === 'error') {\n status = 500;\n }\n\n resolve(request.respondWith(xdr.responseText, {status: status}));\n };\n\n request.abort = function () { return xdr.abort(); };\n\n xdr.open(request.method, request.getUrl());\n\n if (request.timeout) {\n xdr.timeout = request.timeout;\n }\n\n xdr.onload = handler;\n xdr.onabort = handler;\n xdr.onerror = handler;\n xdr.ontimeout = handler;\n xdr.onprogress = function () {};\n xdr.send(request.getBody());\n });\n}", "title": "" }, { "docid": "7e0474e09683df2295f5994ef7b3e32e", "score": "0.3938055", "text": "function createClient({ headers }) {\n\treturn new ApolloClient({\n\t\turi: process.env.NODE_ENV === \"development\" ? endpoint : endpoint,\n\t\trequest: (operation) => {\n\t\t\toperation.setContext({\n\t\t\t\tfetchOptions: {\n\t\t\t\t\tcredentials: \"include\",\n\t\t\t\t},\n\t\t\t\theaders,\n\t\t\t});\n\t\t},\n\t\t//local data\n\t\tclientState: {\n\t\t\tresolvers: {\n\t\t\t\tMutation: {\n\t\t\t\t\ttoggleCart(nothing, variables, { cache }) {\n\t\t\t\t\t\t// 1. read the cartOpen value in cache\n\t\t\t\t\t\tconst { cartOpen } = cache.readQuery({ query: LOCAL_STATE_QUERY });\n\t\t\t\t\t\tconsole.log(\"cartOpen: \", cartOpen);\n\n\t\t\t\t\t\t// 2. write the cart state to be opposite\n\t\t\t\t\t\t// what's happening here is we query out cartOpen and immediately change it's value from true to false...vice versa\n\t\t\t\t\t\tconst data = {\n\t\t\t\t\t\t\tdata: { cartOpen: !cartOpen },\n\t\t\t\t\t\t};\n\t\t\t\t\t\tcache.writeData(data);\n\t\t\t\t\t\tconsole.log(\"data: \", data);\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefaults: {\n\t\t\t\tcartOpen: false,\n\t\t\t},\n\t\t},\n\t});\n}", "title": "" } ]
9e10eb02516db93fd00bb0efe8c10e2c
Overwrites the current set of positions with an array of new ones.
[ { "docid": "0fe0013d77fd369e1749d9727b735232", "score": "0.53634286", "text": "withPositions(positions) {\n this._preferredPositions = positions.slice();\n this._positionStrategy.withPositions(this._preferredPositions);\n return this;\n }", "title": "" } ]
[ { "docid": "f9257e1023bf26aef3d82416005ab0ba", "score": "0.64382863", "text": "overwrite(arr, new_arr) {\n arr.splice(0, arr.length, ...new_arr)\n }", "title": "" }, { "docid": "d98cb21441c71fa99050aee199286cc9", "score": "0.61953676", "text": "function updatePosition() {\r\n let lengths = queen.position.map((item) => item);\r\n queen.whereabouts.push(lengths);\r\n}", "title": "" }, { "docid": "d040bc6afcfa2964949a40dde408ab0c", "score": "0.6188236", "text": "fillPositions() {\n\t\tvar tempArray = []\n\n\t\tfor (var i = 0; i < this.state.babies.length; i++) {\n\t\t\tlet pos = this.setRandomPosition()\n\t\t\ttempArray = tempArray.concat(pos)\n\t\t}\n\n\t if(tempArray != null) {\n\t \tthis.state.babiesPosition = tempArray\n\t }\n\n\t this.sortBabiesByTag()\n\t}", "title": "" }, { "docid": "9d0e199acd9b79f0e5e21967281d36d0", "score": "0.615376", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n } ////////////////////////////////////////////////////////////////////////////////", "title": "" }, { "docid": "29859bfc733f4aeac7afef8f5006cf87", "score": "0.6143933", "text": "function arrayReplaceAt(src, pos, newElements) {\n\t return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n\t}", "title": "" }, { "docid": "cb29416f82c1366fa0ff35f99fc44a6a", "score": "0.6134304", "text": "fullPositionsUpdate(positions) {\n const currentPositions = {};\n\n for (const position of positions) {\n currentPositions[position.symbol] = position;\n }\n\n this.positions = currentPositions;\n }", "title": "" }, { "docid": "15a7dbf9ca36e32aab4632c6e0f30f65", "score": "0.6121363", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n } ////////////////////////////////////////////////////////////////////////////////", "title": "" }, { "docid": "72b3f46104479a8d1356159848d2c407", "score": "0.601657", "text": "function replaceInArray(arr, pos, val) {\n return [].concat(_toConsumableArray(arr.slice(0, pos)), [val], _toConsumableArray(arr.slice(pos + 1)));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "4d24491ea3fbdc0369820a083077c18e", "score": "0.60147643", "text": "function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n}", "title": "" }, { "docid": "705035b0ab22e037e777058cf38d7348", "score": "0.59928876", "text": "fullPositionsUpdate(positions) {\n const currentPositions = {};\n\n positions.forEach(position => {\n currentPositions[position.symbol] = position;\n });\n\n this.positions = currentPositions;\n }", "title": "" }, { "docid": "41963832adde670ff89197b1fbe1689f", "score": "0.5982272", "text": "function resetAllValues(){\n arr = [0,0,0,0];\n position = [0,0,0];\n secondPosition = [0,0,0];\n foodPosition = [0,0,0];\n bodyPosition = [];\n \n push0 = 50;\n push1 = 0;\n push2 = 0;\n push3 = 1;\n snakeLength = 3;\n}", "title": "" }, { "docid": "0c675a4518046303aa7d5a5d2088e0f6", "score": "0.5979613", "text": "changePositions(newPositions) {\n // get map and remove the markers\n let map = this.state.map;\n if (map != null) {\n map.removeObjects(map.getObjects());\n }\n\n // create new markers from the positions\n let markers = [];\n for (const pos of newPositions) {\n const marker = new window.H.map.Marker({lat:pos.latitude, lng:pos.longitude});\n // set data to name, so it can be accessed for more information\n marker.setData('<div>' + pos.name + '</div>');\n markers.push(marker);\n }\n // add markers to the map\n this.createMap(markers);\n }", "title": "" }, { "docid": "a4c882f61e9612170fae51bb7995a837", "score": "0.59506917", "text": "fullPositionsUpdate(positions) {\n let currentPositions = {}\n\n for(const position of positions) {\n currentPositions[position.symbol] = position\n }\n\n this.positions = currentPositions\n }", "title": "" }, { "docid": "9e6073ac9f4951c1c347181544ab2e00", "score": "0.58552736", "text": "update () {\n if (this [coords].length < 3) return;\n this [POS] = new Position ();\n this [coords].forEach ((point) => {\n this [POS].add (point.toCoordinate ());\n });\n this [POS].add (this [coords] [0].toCoordinate ());\n }", "title": "" }, { "docid": "814abd103dfb8dba74c3327f10d93c22", "score": "0.575765", "text": "function updateAllNodePosition() {\n for (const [node, position] of newNodePosition) {\n if (!nodePosition.has(node)) {\n nodePosition.set(node, {\n left: 0,\n top: 0\n });\n }\n const old = nodePosition.get(node);\n if (Math.abs(old.left - position.left) > 1) {\n node.style.left = `${position.left}px`;\n old.left = position.left;\n }\n if (Math.abs(old.top - position.top) > 1) {\n node.style.top = `${position.top}px`;\n old.top = position.top;\n }\n }\n}", "title": "" }, { "docid": "ee4c227455ff6e7307cdac5f26e5d56a", "score": "0.5735026", "text": "storePositions() {\n // todo: add support for clusters and hierarchical.\n const dataArray = [];\n const dataset = this.body.data.nodes.getDataSet();\n\n for (const dsNode of dataset.get()) {\n const id = dsNode.id;\n const bodyNode = this.body.nodes[id];\n const x = Math.round(bodyNode.x);\n const y = Math.round(bodyNode.y);\n\n if (dsNode.x !== x || dsNode.y !== y) {\n dataArray.push({ id, x, y });\n }\n }\n\n dataset.update(dataArray);\n }", "title": "" }, { "docid": "f1975e6b25a5acb0ebe184005401535d", "score": "0.57312304", "text": "function initPositions() {\n positions = [];\n let position1 = {\n x: 0,\n y: 60\n };\n positions.push(position1);\n let position2 = {\n x: 0,\n y: 145\n };\n positions.push(position2);\n let position3 = {\n x: 0,\n y: 230\n };\n positions.push(position3);\n let position4 = {\n x: 102,\n y: 60\n };\n positions.push(position4);\n let position5 = {\n x: 102,\n y: 145\n };\n positions.push(position5);\n let position6 = {\n x: 102,\n y: 230\n };\n positions.push(position6);\n let position7 = {\n x: 204,\n y: 60\n };\n positions.push(position7);\n let position8 = {\n x: 204,\n y: 145\n };\n positions.push(position8);\n let position9 = {\n x: 204,\n y: 230\n };\n positions.push(position9);\n let position10 = {\n x: 306,\n y: 60\n };\n positions.push(position10);\n let position11 = {\n x: 306,\n y: 145\n };\n positions.push(position11);\n let position12 = {\n x: 306,\n y: 230\n };\n positions.push(position12);\n let position13 = {\n x: 408,\n y: 60\n };\n positions.push(position13);\n let position14 = {\n x: 408,\n y: 145\n };\n positions.push(position14);\n let position15 = {\n x: 408,\n y: 230\n };\n positions.push(position15);\n}", "title": "" }, { "docid": "03ee878d504020fdb7f5af8e04acae7b", "score": "0.56748384", "text": "function savePosition(color, x, y, amountOfSavedElements){\n savedPositions[amountOfSavedElements] = new Array(color, x, y);\n}", "title": "" }, { "docid": "76ff0252237e1ece0c283f21f6866f12", "score": "0.5674477", "text": "function addPosition(x,y,positionArray) {\n var position={x,y};\n positionArray.push(position);\n}", "title": "" }, { "docid": "ba7a27fc03561e16ad8343d4ce25c616", "score": "0.5639039", "text": "function finalPosition (arr) {\n // newArr = [y, x]\n let newArr = [0, 0]\n\n for (let value of moves) {\n switch (value) {\n case 'north' :\n newArr[1]++\n break;\n case 'south' :\n newArr[1]--\n break;\n case 'east' :\n newArr[0]++\n break;\n case 'west' :\n newArr[0]--\n break;\n default: \n null;\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "acd6635906c8b74b560ed1c37d6d6202", "score": "0.56258553", "text": "function fillPositions(array) {\n let random = Math.floor(Math.random() * numberOfCards);\n while (array.length < numberOfCards) {\n if (array.indexOf(random) == -1) {\n array.push(random);\n }\n random = Math.floor(Math.random() * numberOfCards);\n }\n return array;\n}", "title": "" }, { "docid": "4a99f8d61a617d8a25732ff37c887a5b", "score": "0.5615355", "text": "function updatePositions(force) {\n\tforce = force === true ? true : false;\n\ttracked.forEach(function (element) {\n\t\telement.updatePosition().update(force);\n\t});\n}", "title": "" }, { "docid": "3dc6ff70283b547d05bf2a90dfa5b97c", "score": "0.56137836", "text": "function updateOutputArray(rowPos, columnPos) {\n for(var i=0; i<INPUT_ARRAY.length; i++) {\n for (var j=0; j<INPUT_ARRAY[i].length; j++) {\n //\"main action\" - make it 0\n if (i == rowPos || j == columnPos) {\n resultArray[i][j] = 0;\n }\n }\n }\n}", "title": "" }, { "docid": "5acfc6941f7e587db3dbbf719de6493e", "score": "0.5611177", "text": "function coordinate_setter(directions_array){\n\tlet [x, y] = [0, 0];\n\tlet arr = [[x, y]];\n\tdirections_array.forEach(direction => {\n\t\t[x, y, arr] = coordinate_checker(direction, arr, arr, x, y);\n\t})\n\treturn arr;\n}", "title": "" }, { "docid": "8f8dbc943adb1f1eb9b2cf2dd527547c", "score": "0.56033266", "text": "function inputPosition(i,position){\n ants[i][0]=position;\n}", "title": "" }, { "docid": "65d8ff506ff32971c133a85e92447243", "score": "0.55869424", "text": "swapPositions(swapPos) {\r\n let zeroPos = this.zeroPosition();\r\n\r\n this.values[zeroPos] = this.values[swapPos];\r\n this.values[swapPos] = 0;\r\n this.numId = this.countId();\r\n this.estimatedDistance = this.countEstimatedDistance();\r\n }", "title": "" }, { "docid": "6686cbfa0cffaf11d8aae3b315ff5347", "score": "0.5577373", "text": "assignLocation(i) {\n const position = [\n {arrayNumber: 0, col: 1, row: 1},\n {arrayNumber: 1, col: 2, row: 1}, \n {arrayNumber: 2, col: 3, row: 1},\n {arrayNumber: 3, col: 1, row: 2},\n {arrayNumber: 4, col: 2, row: 2},\n {arrayNumber: 5, col: 3, row: 2},\n {arrayNumber: 6, col: 1, row: 3},\n {arrayNumber: 7, col: 2, row: 3},\n {arrayNumber: 8, col: 3, row: 3},\n ];\n const historyLocation = this.state.historyLocation.slice();\n this.setState({\n historyLocation: historyLocation.concat([{\n col: position[i].col,\n row: position[i].row\n }])\n })\n }", "title": "" }, { "docid": "8acd277abd807e030c527458d73aa02c", "score": "0.5557977", "text": "setPositions(){\r\n this.ships.forEach(item => { //for each ship\r\n do{\r\n item.positions[0]= new Coordinate(Math.floor((Math.random()*(8 - item.size))), Math.floor((Math.random()*(8 - item.size))));//maximum position of first location of the ship\r\n if (Math.random() > 0.5){ // horizontal\r\n // create next positions\r\n for (let i = 1; i < item.size; i++){\r\n item.positions[i]= new Coordinate(item.positions[i-1].row, item.positions[i-1].col + 1);\r\n } \r\n }\r\n else{ //vertical\r\n // create next positions\r\n for (let i = 1; i < item.size; i++){\r\n item.positions[i]= new Coordinate(item.positions[i-1].row + 1, item.positions[i-1].col);\r\n }\r\n }\r\n }\r\n while(this._collision(item)>0); //if number of collisions is greater than ship's size - create positions again \r\n })\r\n }", "title": "" }, { "docid": "6c0ee2a5e6824a349ce8692e42747dfc", "score": "0.55265653", "text": "function updateSnakePos() {\r\n // Feed snake's positions array with new head's position\r\n snakePos[0][0] = snakex;\r\n snakePos[0][1] = snakey;\r\n \r\n // The rest of the array\r\n for (var i = snakeLength - 1; i > 0; i--) {\r\n snakePos[i][0] = snakePos[i - 1][0];\r\n snakePos[i][1] = snakePos[i - 1][1];\r\n }\r\n}", "title": "" }, { "docid": "c234f74a559635e152d9d9f14a14f438", "score": "0.5487732", "text": "function replaceInNativeArray(array, start, deleteCount, items) {\n arrayContentWillChange(array, start, deleteCount, items.length);\n if (items.length <= CHUNK_SIZE) {\n array.splice.apply(array, [start, deleteCount].concat(items));\n } else {\n array.splice(start, deleteCount);\n for (var i = 0; i < items.length; i += CHUNK_SIZE) {\n var chunk = items.slice(i, i + CHUNK_SIZE);\n array.splice.apply(array, [start + i, 0].concat(chunk));\n }\n }\n arrayContentDidChange(array, start, deleteCount, items.length);\n }", "title": "" }, { "docid": "222f06dad91c257004e504f4ca54a6f0", "score": "0.5480161", "text": "function replaceInNativeArray(array, start, deleteCount, items) {\n arrayContentWillChange(array, start, deleteCount, items.length);\n if (items.length <= CHUNK_SIZE) {\n array.splice(start, deleteCount, ...items);\n } else {\n array.splice(start, deleteCount);\n for (let i = 0; i < items.length; i += CHUNK_SIZE) {\n let chunk = items.slice(i, i + CHUNK_SIZE);\n array.splice(start + i, 0, ...chunk);\n }\n }\n arrayContentDidChange(array, start, deleteCount, items.length);\n }", "title": "" }, { "docid": "a3db46cca7f5f2f0a0bc27bc8ceaab6b", "score": "0.5472762", "text": "function replaceAt(array, idx, newItem) {\n if (array[idx] === newItem) return array;\n const len = array.length;\n const result = Array(len);\n\n for (let i = 0; i < len; i++) {\n result[i] = array[i];\n }\n\n result[idx] = newItem;\n return result;\n} // ===============================================", "title": "" }, { "docid": "6b97a0262bdd40ff94b4819eadc42bba", "score": "0.54726684", "text": "function updatePositionsincident() {\n var positions = line.geometry.attributes.position.array;\n\n var x = -13;\n var y = 0; \n var z = -2.5;\n var index = 0;\n console.log(\"chirag \" + finalx + \" \" + finaly )\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 += ((finalx + 13.04) /MAX_POINTS);\n y += (finaly /MAX_POINTS);\n }\n}", "title": "" }, { "docid": "a6ae2dbd10286741a68698569df33a50", "score": "0.5468698", "text": "function setOffset(arr) {\n var newArr = [];\n for (var i = 0; i < arr.length; i += 7) {\n newArr.push(arr.slice(i, i + 7));\n }\n return newArr;\n }", "title": "" }, { "docid": "ae08314290bb5c1fd20a1b8d04431113", "score": "0.54682606", "text": "async set_coordinates_array(ordered_coordinates){\n this.setState({ markers: ordered_coordinates });\n\n }", "title": "" }, { "docid": "7169a55bef13e95653cf7eca0dfa8bd8", "score": "0.54480994", "text": "allPositions(){\n let positions = [];\n for(let row=0; row< 9; row++){\n for(let col= 0; col<9; col++){\n positions.push([row, col])\n }\n }\n return Util.shuffle(positions);\n }", "title": "" }, { "docid": "13e68478efb8e0f43737e96426b7943e", "score": "0.5444988", "text": "static arr_moveToOf(Array1, Array2, Array3) {\n const a1 = Array1.slice()\n const a2 = Array2.slice()\n const a3 = Array3.slice()\n\n a3.map((e) => {\n if(a1.indexOf(e) > -1) {\n a2.push(e)\n }\n })\n\n this.arr_removeOf(a1, a3)\n\n this.arr_clear(Array1)\n this.arr_clear(Array2)\n Array1.push(...a1)\n Array2.push(...a2)\n }", "title": "" }, { "docid": "e696fa1d487e554c5e24818486e491c5", "score": "0.54320335", "text": "function moveToSortPosition(){\n var i;\n for (i = 0; i < count; i++) {\n combined[i].moveTo(map(i, 0, count-1, bounds.left, bounds.right));\n }\n}", "title": "" }, { "docid": "c0b84f9c72cb16aed1bd7285ec95e609", "score": "0.54304117", "text": "function replaceAt(array, idx, newItem) {\n if (array[idx] === newItem) return array;\n var len = array.length;\n var result = Array(len);\n for (var i = 0; i < len; i++) {\n result[i] = array[i];\n }\n result[idx] = newItem;\n return result;\n}", "title": "" }, { "docid": "ea7e1391a990d7cbc90e77b86f8fdd25", "score": "0.54075694", "text": "function getPositions() {\n return positions;\n }", "title": "" }, { "docid": "73bf332e19d7c3ed554cc95a0af8de5e", "score": "0.54008085", "text": "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 = [-13,-13,-13,-13]; \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}", "title": "" }, { "docid": "a640cb89b7c50d902fdf74e4e35cb1a0", "score": "0.538616", "text": "resetpos() {\n this.x = 202;\n this.y = 387;\n }", "title": "" }, { "docid": "7b4cec4d3710bc8d3570efade4762adc", "score": "0.5379336", "text": "function updateFilePositions() {\n filePositions = filePositions.map((pos) => {\n pos.x = pos.realX * Math.pow(2, zoomLevel - 1);\n pos.y = pos.realY * Math.pow(2, zoomLevel - 1);\n return pos;\n });\n}", "title": "" }, { "docid": "7f7d0ae19b7b8b18e600d2b318cc8d88", "score": "0.5364701", "text": "_updatePositions(polygon, {vertexStart, geometrySize}) {\n const {\n attributes: {positions},\n positionSize\n } = this;\n if (!positions) {\n return;\n }\n const polygonPositions = polygon.positions || polygon;\n\n for (let i = vertexStart, j = 0; j < geometrySize; i++, j++) {\n const x = polygonPositions[j * positionSize];\n const y = polygonPositions[j * positionSize + 1];\n const z = positionSize > 2 ? polygonPositions[j * positionSize + 2] : 0;\n\n positions[i * 3] = x;\n positions[i * 3 + 1] = y;\n positions[i * 3 + 2] = z;\n }\n }", "title": "" }, { "docid": "f38141f33c5d0ac16acfb4ee73aeccba", "score": "0.5355114", "text": "function overflowArray(array, position){\n let overflow = array[0];\n array[0] = array[1];\n array[1] = array[2];\n array[2] = position;\n return overflow;\n}", "title": "" }, { "docid": "8900e5459e0911b5401ee6833b91f71d", "score": "0.5346671", "text": "setNewElementPosition(){\n for(let loopCounter = 0; loopCounter < this.element.length; loopCounter++){\n let offsetHeight = this.gridStyles.top - this.elementHeightRecalculated[loopCounter]\n if(loopCounter > this.columns - 1){\n gsap.to(this.element[loopCounter],{\n y:this.elementHeightRecalculated[loopCounter]\n \n })\n }\n }\n }", "title": "" }, { "docid": "d7cb01aceab1ca6dca6139053d6c32c1", "score": "0.5344615", "text": "assignCoordinates (coord = []) {\n this.coord = coord\n for (const [i, sub] of this.subs.entries()) {\n sub.assignCoordinates(this.coord.concat([i + 1]))\n }\n }", "title": "" }, { "docid": "05a21d649b149ad3dbe337dd43448109", "score": "0.53269297", "text": "function updatePreviousArray() {\n previousImages.push(leftIndex, centerIndex, rightIndex);\n}", "title": "" }, { "docid": "05e36643388dc9fd8ab1248df821901d", "score": "0.53159183", "text": "resetPosition() {\n this.x = 202;\n this.y = 405;\n }", "title": "" }, { "docid": "c9f372d455b394c4bc1a719a38b0c13a", "score": "0.52838385", "text": "function setPos(id, x, y) {\n pos[3 * id] = x;\n pos[3 * id + 1] = y;\n }", "title": "" }, { "docid": "e726b47d985d7cedc68229b1abe18d3d", "score": "0.527889", "text": "function resetPositions() {\n\t\tplayer1position=0;\n\t\tplayer2position=0;\t\n\t}", "title": "" }, { "docid": "dad6e5a28aa55c0407b0b6bbd80a9b12", "score": "0.5273546", "text": "function insertsElement (array, element, position){\n var newArray = [];\n for( var i = 0; i < array.length; i++){\n if (i === position){\n newArray[newArray.length] = element;\n newArray[newArray.length] = array[i];\n\n } else {\n newArray[newArray.length] = array[i];\n }\n }return newArray;\n}", "title": "" }, { "docid": "1b630dfbac8bfc1e23acec9c78d471d5", "score": "0.5272256", "text": "resetPosition () {\n this.x = 202;\n this.y = 404;\n }", "title": "" }, { "docid": "6a61843146621b63b9873b058167bf20", "score": "0.52556056", "text": "function replace(array, newContent) {\n array.splice.apply(array, [0, array.length].concat(newContent));\n }", "title": "" }, { "docid": "aa3ccf6073e502912d9d5065f003e37c", "score": "0.52484727", "text": "_commitPositionUpdates() {\n for (const body of this.bodies) {\n body.x = body.nextX;\n body.y = body.nextY;\n }\n }", "title": "" }, { "docid": "2eadcdf33c9abeefa79d5c5f95bdf704", "score": "0.5246719", "text": "function updateGlobalArraysForUndoing(){\r\n gShownCountsArray.push(gGame.shownCount);\r\n gMarkedCountArray.push(gGame.markedCount);\r\n gLivesArray.push(gLivesNumber);\r\n gSafeClicksArray.push(gSafeClicksCounter);\r\n gHintsCounterArray.push(gHintsCounter);\r\n}", "title": "" }, { "docid": "88c51afd62fd7a391d30f277b9119822", "score": "0.5238455", "text": "undoPos(){\n var old=this.oldPos.pop();\n if(old!=undefined)\n {\n this.position=old;\n }\n }", "title": "" }, { "docid": "e442c09f26bbf74f76406aedb6c3c699", "score": "0.52211356", "text": "function displace( array, contents ) {\n\n // we could use `a.splice.apply( a, [ 0, a.length ].concat( b ) )`\n // but contents could be a `touchlist` and we need to flatten it\n\n array.length = 0;\n\n for ( var i = 0, n = contents.length; i < n; i++ ) {\n array[i] = contents[i];\n }\n\n return array;\n }", "title": "" }, { "docid": "e442c09f26bbf74f76406aedb6c3c699", "score": "0.52211356", "text": "function displace( array, contents ) {\n\n // we could use `a.splice.apply( a, [ 0, a.length ].concat( b ) )`\n // but contents could be a `touchlist` and we need to flatten it\n\n array.length = 0;\n\n for ( var i = 0, n = contents.length; i < n; i++ ) {\n array[i] = contents[i];\n }\n\n return array;\n }", "title": "" }, { "docid": "ec801039ab1e13e0eaf5c49b33749184", "score": "0.5219741", "text": "function resetLocations() {\n objects.forEach((on) => {\n on.x = on.x0;\n on.y = on.y0;\n });\n}", "title": "" }, { "docid": "fd0c72765b94120008ef6e418780efb9", "score": "0.521916", "text": "function setPosition(positions) {\n const position = positions[positions.length - 1] || { id: null };\n setAssignment({\n ...assignment,\n position,\n position_id: position.id,\n hours: position.hours_per_assignment,\n start_date: position.start_date,\n end_date: position.end_date,\n });\n }", "title": "" }, { "docid": "10c60887d4a494d06ef1fa2639055d66", "score": "0.5208358", "text": "function setPos(newX, newY) {\n x = Math.min(columns, Math.max(1, newX));\n y = Math.min(26, Math.max(1, newY));\n }", "title": "" }, { "docid": "6095edb5ee358bd8d25236b5ccbb69c8", "score": "0.5203799", "text": "function createTargetArray(nums, index) {\n let targetArray = [];\n nums.map((value, i) => {\n targetArray.splice(index[i], 0, value)\n\n })\n\n return targetArray\n\n}", "title": "" }, { "docid": "20f54108a01d9d1be9449ab33dfe7421", "score": "0.52018607", "text": "getPositions() { return this.positions; }", "title": "" }, { "docid": "e40d6114f91f9e11ecf171a2d98ccbf7", "score": "0.5188288", "text": "function cloneSpotsArr(arr) {\n\tvar newArr = [];\n\tfor (var i=0; i<arr.length; i++) {\n\t\tnewArr[i] = [];\n\t\tfor (var j=0; j<arr[i].length; j++) {\n\t\t\tnewArr[i][j] = arr[i][j];\n\t\t}\n\t}\n\treturn newArr;\n}", "title": "" }, { "docid": "6b0a6839962c807832f96ff2c7a6040d", "score": "0.51853824", "text": "function cloneArr(points) {\r\n if (points) {\r\n var newPoints = []\r\n\r\n for (var i = 0; i < points.length; i++) {\r\n newPoints.push(points[i].slice())\r\n }\r\n\r\n return newPoints\r\n }\r\n }", "title": "" }, { "docid": "10c17aa6afeb3e2b98c2896f78094d51", "score": "0.5185285", "text": "function fill_arrays(arr, len) {\n for (var i = 0; i < len; i++) {\n arr[i] = INT_MARKER;\n }\n arr[0] = FIRST_ELEM;\n}", "title": "" }, { "docid": "28aec7f77ebe7bcab0db705a87e3526f", "score": "0.5184486", "text": "function adjust(arr,index,itemToAdd){\n arr.splice(index , 0 , ...itemToAdd)\n return arr;\n}", "title": "" }, { "docid": "d1c00717169581e4652060a6f2383432", "score": "0.5180809", "text": "function setPos(newX, newY) {\n x = Math.min(columns, Math.max(1, newX));\n y = Math.min(rows, Math.max(1, newY));\n }", "title": "" }, { "docid": "0b41824e72f6cb5fed789ea0d9f4d37f", "score": "0.5163727", "text": "function resetArrays() {\r\n numArr = [];\r\n signArr = [];\r\n}", "title": "" }, { "docid": "8186556a830985417a833b66e9f93278", "score": "0.5148107", "text": "dragItems(startX, startY, endX, endY) {\n this.tempInventory = [];\n this.tempInventory.push(inventory[startY][startX]);\n this.tempInventory.push(inventory[endY][endX]);\n\n inventory[startY].splice(startX, 1, this.tempInventory[1]);\n inventory[endY].splice(endX, 1, this.tempInventory[0]);\n\n console.log(this.tempInventory, \"temp inv\");\n console.log(inventory, \"inv\");\n \n }", "title": "" }, { "docid": "44ea99d5e2d5782bbbbabb593bc2682a", "score": "0.5148021", "text": "function updateArray(targetArray, gridCoords, materialID) {\n if (gridCoords.x < 0 || \n gridCoords.y < 0 || \n gridCoords.z < 0 ||\n gridCoords.x > width - 1 ||\n gridCoords.y > height - 1 ||\n gridCoords.z > layers - 1) {\n console.log(\"Out of bounds gridCoords\")\n } else {\n targetArray[gridCoords.z][gridCoords.y][gridCoords.x] = materialID;\n localStorage.setItem(\"savedMap3d\", JSON.stringify(targetArray));\n console.log(\"Location \" + gridCoords.x + \" \" + gridCoords.y + \" \" + gridCoords.z + \" successfully updated\")\n }\n}", "title": "" }, { "docid": "795bf8cb141f2c1c4195f3aa6efdc35c", "score": "0.5146684", "text": "static function SetPosition (playgroundParticles : PlaygroundParticles, to : int, runUpdate : boolean) {\n\t\t\n\t\tfor (var i = 0; i<playgroundParticles.particleCache.particles.Length; i++)\n\t\t\tplaygroundParticles.particleCache.particles[i].position = playgroundParticles.states[to].GetPosition(i%playgroundParticles.states[to].positionLength)+GetOverflowOffset(playgroundParticles, i, playgroundParticles.states[to].positionLength);\n\t\tif (runUpdate)\n\t\t\tUpdate(playgroundParticles);\n\t}", "title": "" }, { "docid": "d8bc6ace1777fc4aa7c8a30d0ff83922", "score": "0.51393974", "text": "function setPositions() {\t\t\t\n\t\txPos += direction*4;\n\t\tyPos = (20/57) * xPos + 70;\n\t\t\n\t\n\t\tif (direction == 1) {\n\t\t\tif (xPos >= 640)\n\t\t\t\tresetMapAfterMove();\n\t\t}\n\t\telse {\n\t\t\tif (xPos <= 70) \n\t\t\t\tresetMapAfterMove();\n\t\t}\n\t}", "title": "" }, { "docid": "9091a5ce62bc0580317511f075b2a2c1", "score": "0.51346046", "text": "function removePositions(positionArray) {\n while (positionArray.length!=1) {\n positionArray.pop();\n }\n}", "title": "" }, { "docid": "b87613db120264528856efbd2b596221", "score": "0.51344687", "text": "move (positions) {\n const { me, difficulty} = this.settings;\n const rand = Math.floor(Math.random());\n const opponent = (me === 'o') ? 'x' : 'o';\n let newPositions = [...positions];\n let takeField; // int\n\n const possibleMoves = positions.filter(x=>x !== \"\");\n // if computer starts the game\n if (possibleMoves.length === 9) {\n takeField = (difficulty === 0) ? rand*8 : 4;\n newPositions[takeField] = me;\n } else {\n \n }\n\n setTimeout(()=>{ return newPositions; },this.settings.delay);\n }", "title": "" }, { "docid": "eda8e2a106637642f147aa336e972757", "score": "0.51340973", "text": "function setPiecesStartPosition() {\n piecesArr.forEach(piece => {\n setPieceLocation(`${piece.position.i},${piece.position.j}`, piece.name, piece.icon, piece.type);\n })\n}", "title": "" }, { "docid": "3eef4d228d81c459e5c8aa2e8efc6da9", "score": "0.5132762", "text": "createPosition(nums) {\n let newPos = Math.floor(Math.random() * nums.length);\n while (nums[newPos] != 0) {\n newPos = Math.floor(Math.random() * nums.length);\n }\n return newPos;\n }", "title": "" }, { "docid": "e860fde0376e58f8f14cfc717fee8a9d", "score": "0.51318115", "text": "checkNewIndxsMove(newPosition) {\n this.newIndxs = this.shape.map((index) => index + newPosition);\n if(\n // checking not pushing tetromino over edge of grid\n this.shape.some((index) => {\n return Math.floor((index + this.currentPosition)/10) !== Math.floor((index + newPosition)/10);\n })\n ||\n // checking not pushing tetromino into locked square\n this.newIndxs.some((index) => {\n return mainGridSquares[index].className.includes('locked');\n })\n ){\n // if either check fails, do nothing\n return;\n } \n // checks passed, update tetro position\n else {\n this.updateTetro(newPosition);\n }\n }", "title": "" }, { "docid": "5157f8d58ef1065df770e58c982dfe19", "score": "0.51276875", "text": "clones(position) {\n const odd = this._clones.length / 2, even = odd + this._items.length, map = index => index % 2 === 0 ? even + index / 2 : odd - (index + 1) / 2;\n if (position === undefined) {\n return this._clones.map((v, i) => map(i));\n }\n return this._clones.map((v, i) => v === position ? map(i) : null).filter(item => item);\n }", "title": "" } ]
3e4532285b398f6f56b935fd469c5474
CREATE PRODUCT (TABLE PRODUCT AND PRODUCT INCOME IN DB)
[ { "docid": "512a4efb37573cfedaa5b2b870a740be", "score": "0.0", "text": "function createProduct() {\n $(\"#createProduct\").click(function () {\n var mag;\n if($(\".magazine_name\").val() == null) mag = $(\".hvr_magazine_name_input\").val();\n else mag = $(\".magazine_name\").val();\n var measure;\n if($(\".measure\").val() == null) measure = $(\".hvr_impt_measure\").val();\n else measure = $(\".measure\").val();\n var loc;\n if($(\".location\").val() == null) loc = $(\".hvr_impt_location\").val();\n else loc = $(\".location\").val();\n var waranty;\n if($(\".no_term\").attr(\"checked\")) waranty = '';\n else waranty = $(\".datepicker_term\").val();\n var product = {\n productId: $(\"#product_id\").val(),\n productIncomeId: $(\"#product_income_id\").val(),\n idMagazine: mag,\n idProdName: $(\".hvr_product_like_name_id\").val(),\n nameStandartProdName: $(\".hvr_standart_like_name_id\").val(),\n stdTypeIdName: $(\"#type_standart_by_name\").val(),\n idProdType: $(\".hvr_product_like_type_id\").val(),\n nameStandartProdType: $(\".hvr_standart_like_type_id\").val(),\n stdTypeIdType: $(\"#type_standart_by_type\").val(),\n waranty: waranty,\n produceDate: $(\".datepicker\").val(),\n datePresenter: $(\".datepicker_get\").val(),\n lot: $(\".number_part_id\").val(),\n consumerId: $(\".hvr_consumer_id\").val(),\n countProduct: $(\".count_id\").val(),\n measureId: measure,\n locationId: loc,\n fioPresenter: $(\".fio_presenter\").val(),\n fioLastModify: user,\n dateLastModify: getCurrentDate(),\n fioControler: $(\".fio_controller\").val(),\n arrangements: $(\".arrangements\").val(),\n note: $(\".note\").val(),\n resultControl: result_control,\n files: attachFiles,\n docs: attachDocs\n };\n $.ajax({\n url: '/QP/api/service/create_product',\n type: 'POST',\n data: JSON.stringify(product),\n dataType: 'json',\n contentType: 'application/json; charset=utf-8',\n success: function (newProduct) {\n if (magazine == 0) {\n $(\"#page_number\").html(pageNumber);\n $(\"#fileupload\").val(\"\");\n $(\".list_uloaded_files\").children(\"p\").remove();\n $(\"#doc_number\").val(\"\");\n $(\"#list_uploaded_document\").children(\"p\").remove();\n if(!search) getJoinIncomeProduct(pageNumber); else searchFunction();\n } else {\n $(\"#page_number\").html(pageNumber);\n $(\"#fileupload\").val(\"\");\n $(\".list_uloaded_files\").children(\"p\").remove();\n $(\"#doc_number\").val(\"\");\n $(\"#list_uploaded_document\").children(\"p\").remove();\n if(!search) sortByMagazine(pageNumber, magazine); else searchFunction();\n };\n clear();\n attachDocs = [];\n attachFiles = [];\n result_control = \"999\";\n $(\".datepicker_term\").attr(\"disabled\", false);\n },\n error: function (newProduct) {\n preDeleteListFile();\n $(\"#fileupload\").val(\"\");\n $('.list_uloaded_files').children(\"p\").remove();\n $(\"#doc_number\").val(\"\");\n $(\"#list_uploaded_document\").children(\"p\").remove();\n alert(\"Ошибка дабавления продукции!\");\n }\n });\n });\n}", "title": "" } ]
[ { "docid": "bf78f214b1e10c25d74b6a40b12434f8", "score": "0.6547577", "text": "function createProduct() {\n console.log(\"Inserting a product...\\n\");\n connection.query(\"INSERT INTO products SET ?\",\n {\n item_id: 1,\n productName: 'lizard',\n departmentName: 'reptile',\n price: 6.23,\n inventory: 56\n },\n function (err, res) {\n console.log(res.affectedRows + \" product added!\\n\");\n // Call updateProduct AFTER the INSERT completes\n readBamazon()\n });\n}", "title": "" }, { "docid": "237f6cd485c975436cf428c1e9d3e6ef", "score": "0.6486301", "text": "function Product() {\n function createTable() {\n const sql = `\n CREATE TABLE IF NOT EXISTS porducts(\n id SERIAL PRIMARY KEY,\n name VARCHAR(50),\n price FLOAT(2),\n\n UNIQUE(name)\n )\n `;\n\n dbClient.query(sql).then(result => {\n console.log(\"created products table\");\n });\n }\n\n function findOneProduct(productId, callback) {\n const sql = `\n SELECT * FROM products\n WHERE id = ($1);\n `;\n\n dbClient.query(sql, [productId]).then(result => {\n callback(result.rows[0]);\n });\n }\n\n function createOneProduct(newProduct, callback) {\n const { name, price } = newProduct;\n\n const sql = `\n INSERT INTO products (name, price)\n VALUES ($1, $2)\n RETURNING *;\n `;\n\n dbClient.query(sql, [name, price]).then(result => {\n callback(result.rows[0]);\n });\n }\n\n createTable();\n\n return {\n createOneProduct,\n findOneProduct,\n };\n}", "title": "" }, { "docid": "449021fd70ea6b727b520b8c7254dad2", "score": "0.6409641", "text": "function addNewProductToDB(productName, departmentName,price, stockQuantity){\n return new Promise(async(res,rej)=>{\n try{\n results = await pool.query('INSERT INTO ?? SET ?',\n [\"products\",{\n product:productName,\n dept_id:departmentName,\n price:price,\n qty:stockQuantity\n }])\n res(results);\n }catch(err){\n console.error(err);\n rej(err);\n }\n \n })\n}", "title": "" }, { "docid": "d763eede838e170b6cf34266b179e7fa", "score": "0.6388145", "text": "async function createProductsOrder(orderID, pdtID, pdtQty, priceOrder) {\n await Products_Order.create({\n pdtID: pdtID,\n orderID: orderID,\n pdtQty: pdtQty,\n priceOrder: priceOrder,\n });\n}", "title": "" }, { "docid": "41939404b71fb6cde4234b70cb1dade9", "score": "0.63533014", "text": "function addProduct()\n{\n connection.query(\"INSERT into products SET ? \",{\n product_name:\"Computer Vision\",department_name:\"Technical\",price:154.34,stock_quantity:866\n },\n function(err,res)\n {\n if(err)\n {\n throw err;\n }\n });\n connection.end();\t\n}", "title": "" }, { "docid": "be574f560fc53ae95cf2720d313c555d", "score": "0.6331738", "text": "async function migrate() {\n await query(`\n CREATE TABLE products (\n id SERIAL PRIMARY KEY,\n title character varying NOT NULL,\n image_url character varying,\n price integer NOT NULL\n );\n `);\n await query(`CREATE UNIQUE INDEX products_pkey ON products(id int4_ops);`);\n}", "title": "" }, { "docid": "020f52811ec961a111a694ddfefc7d55", "score": "0.62705994", "text": "insertNewProduct() {\n let sql = `INSERT INTO public.\"Product\"(\n id, \"idStyle\", \"idBrand\", name, price, quantity, description, image, details, status)\n VALUES (default, $1, $2, $3, $4, $5, $6, $7, $8, true)`;\n return queryDB(sql, [this.idStyle, this.idBrand, this.name, this.price, this.quantity, this.description, this.image, this.details]);\n }", "title": "" }, { "docid": "772573f090af25897ac654a1eb324275", "score": "0.626509", "text": "function newItem(name, category, price, quantity){\n\tconnection.query('INSERT INTO products (productName,departmentName,price,stockQuantity) VALUES(\"' + name + '\",\"' + category + '\",' + price + ',' + quantity + ')');\n}", "title": "" }, { "docid": "5da6cfdabb94537962a728a59b74de12", "score": "0.6247946", "text": "function createProduct() {\n const id = generateProductId();\n products[id] = {\n compatible: [],\n versions: [],\n }\n return id;\n}", "title": "" }, { "docid": "803faa194db815a42f3f75076d97bf7e", "score": "0.623296", "text": "function products(){\n\tconnection.query(\n\t\t\"select * from products\",\n\t\tfunction(err,res){\n\t\t\tif(err){\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t\tInsertToTable(res);\n\t\t\tsomethingElse();\n\t\t});\n}", "title": "" }, { "docid": "0f52725d9d3aefb86017186abaab598a", "score": "0.62249464", "text": "function add_product () {\n\t\n\n\tinquirer.prompt(questions.bamzonManager.add).then(function(answer) {\n\t\tvar quer = `INSERT INTO products SET ?;`\n\t\tvar querObj = {\n\t\t\tproduct_name : answer.input_produc_name,\n\t\t\tdepartment_name : answer.input_department_name,\n\t\t\tprice : parseFloat(answer.input_price),\n\t\t\tstock_quantity : parseInt(answer.input_stock_quantity)\n\t\t};\n\t\t\t\n\t\tconn.query(quer, querObj ,function (err, res) {\n\t\t\tif (err) throw err;\n\t\t\tconsole.log('/****************\\nadded to DB!\\n/****************');\n\t\t\tmain();\n\t\t});\n\n\t});\n}", "title": "" }, { "docid": "2d09fb31296c926bec0126a9cca59633", "score": "0.61925393", "text": "function addProduct(name, department, price, quantity) {\n connection.query(\"INSERT INTO products SET ?\", {\n product_name: name,\n department_name: department,\n price: price,\n stock_quantity: quantity\n }, function (err, res) {\n console.log(\"\\nPRODUCT SUCCESSFULLY ADDED!\\n\");\n manager();\n })\n}", "title": "" }, { "docid": "cb47dbbab70393ca7c190ddef62f58ab", "score": "0.61849284", "text": "function _fillUpDB() {\n const products = [];\n products.push(\n new Product({ name: \"Apa\", description: \"Apa minerala\", id: 1 })\n );\n products.push(\n new Product({ name: \"Galuste\", description: \"Cu prune\", id: 2 })\n );\n products.push(\n new Product({ name: \"Branza\", description: \"Mozzarella\", id: 3 })\n );\n\n for (const p of products) {\n p.save();\n }\n}", "title": "" }, { "docid": "471ce40dae050fc24ce1c5c566678c3c", "score": "0.61784697", "text": "static createProduct(req, res) {\n const product = [\n req.body.name,\n req.body.price,\n req.body.quantity,\n ];\n\n pool.query('INSERT INTO products(name, price, quantity) VALUES($1,$2,$3,$4)', product, (err) => {\n if (err) {\n res.status(403).json({\n success: false,\n err,\n message: 'Your request was not succesfull',\n });\n return;\n }\n res.status(200).json({\n success: true,\n product: {\n name: req.body.name,\n category: req.body.category,\n price: req.body.price,\n quantity: req.body.quantity,\n },\n message: 'Product Created Successfully',\n });\n });\n }", "title": "" }, { "docid": "3eead7ebd030dfa9981e82c412dce924", "score": "0.6174758", "text": "function addNewProduct(val) {\n connection.query(\n \"INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES (?, ?, ?, ?)\",\n [val.product_name, val.department_name, val.price, val.quantity],\n function(err, res) {\n if (err) throw err;\n console.log(val.product_name + \" Added to BAMAZON!\\n\");\n // Grab the updated products\n grabProducts();\n }\n );\n }", "title": "" }, { "docid": "d0e6e968b20e70782aadbb5f8906006e", "score": "0.6143779", "text": "function newProduct() {\n inquirer.prompt([\n\n {\n type: \"input\",\n message: \"Product name?\",\n name: \"name\"\n },\n {\n type: \"input\",\n message: \"Product Category?\",\n name: \"dept\"\n },\n {\n type: \"input\",\n message: \"Unit price?\",\n name: \"price\"\n },\n {\n type: \"input\",\n message: \"Quantity?\",\n name: \"quant\"\n }\n ]).then(function (productDetails) {\n connection.query(\"INSERT INTO products SET ?\",\n {\n product_name: productDetails.name,\n department_name: productDetails.dept,\n price: productDetails.price,\n stock_quantity: productDetails.quant\n },\n function (err, res) {\n if (err) {\n return console.log(err);\n }\n console.log(res.affectedRows + \" product added!\");\n continueActions();\n })\n });\n}", "title": "" }, { "docid": "e9a5cc3aa5bcd5feeab05dacd657c696", "score": "0.6125396", "text": "insertProduct(product) {\n return this.products.create(product);\n }", "title": "" }, { "docid": "e0d15a52282f4f61ba26bef67b158bcd", "score": "0.61199516", "text": "function insertProduct(name, department, price, quantity) {\n let query = \"INSERT INTO products \" + \n \"(product_name, department_name, \" +\n \"price, stock_quantity) VALUES( \" + \n \"'\" + name + \"', '\" + \n department + \"', \" + price + \", \" +\n quantity + \");\";\n connection.query(query, (err) => {\n if (err) console.log(err);\n else {\n console.log(\"Added new product '\" + name + \"' to inventory!\");\n connection.end();\n }\n });\n}", "title": "" }, { "docid": "07c34d797dc2e524cc11adcb001a437a", "score": "0.60981405", "text": "function addProduct(products) {\n // prompt user for name, dept, price, quantity (all columns from 'products' table)\n inquirer.prompt([\n {\n type: \"input\",\n name: \"product_name\",\n message: \"Product name:\"\n },\n {\n type: \"input\",\n name: \"department_name\",\n message: \"Department:\"\n },\n {\n type: \"input\",\n name: \"price\",\n message: \"Price:\",\n validate: function (val) {\n return val > 0;\n }\n },\n {\n type: \"input\",\n name: \"quantity\",\n message: \"Stock Quantity:\",\n validate: function (val) {\n return !isNaN(val);\n }\n }\n ])\n // insert into db\n .then(function(val) {\n connection.query(\"INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES (?, ?, ?, ?)\", [val.product_name, val.department_name, val.price, val.quantity], function (err, res) {\n if (err) throw err;\n console.log(\"=======================================================================\");\n console.log(val.product_name + \" has been added to inventory.\");\n console.log(\"=======================================================================\");\n showOptions();\n })\n });\n}", "title": "" }, { "docid": "41a635c3ec578d19983a9e2a79774830", "score": "0.60721815", "text": "function addProd () {\n pmpt(add).then(function (r) {\n var newProduct = `\n INSERT INTO items(product_name, department, price, instock)\n VALUES ('${r.name}','${r.department}',${r.price},${r.num})\n `\n connection.connect(function (e) {\n if (e) throw e\n connection.query(newProduct, function (e, r) {\n if (e) throw e\n console.log(r)\n })\n })\n })\n}", "title": "" }, { "docid": "31b7e5ebea51dd66594dcb1b701a3ecb", "score": "0.6069483", "text": "async createProduct(product) {\n const query = `mutation productAdd($product: ProductInputs!) {\n productAdd(product: $product) {\n id\n }\n }`;\n const data = await graphQLFetch(query, {\n product\n });\n\n if (data) {\n this.loadData();\n }\n }", "title": "" }, { "docid": "3bd1f45706bb2a8b57a6bf41430cadcd", "score": "0.60191315", "text": "function buildTheDatabase() {\n connection.query(\"CREATE DATABASE IF NOT EXISTS bamazon_db\");\n connection.changeUser({database: \"bamazon_db\"});\n connection.query(\"CREATE TABLE IF NOT EXISTS product_list (id int AUTO_INCREMENT PRIMARY KEY, product_name varchar(255), product_desc varchar(255), product_count int)\", (error, results) => {\n if (error) throw error;\n });\n console.log(\"database established!\");\n var product1 = new Product(\"surgical masks\", \"N95 masks to prevent contamination\", 20);\n var product2 = new Product(\"rubber golves\", \"surgical gloves to prevent contamination\", 20);\n var product3 = new Product(\"toilet paper\", \"Charmin Ultra, 4 ply!\", 20);\n var product4 = new Product(\"disinfecting wipes\", \"Lysol brand disinfecting wipes for quick cleanup!\", 20);\n var product5 = new Product(\"hand sanitizer\", \"Germ-X brand alcohol based hand sanitizer\", 20);\n var starterProducts = [product1, product2, product3, product4, product5];\n starterProducts.forEach(x => {\n populateDatabase(x);\n });\n}", "title": "" }, { "docid": "0e07b3447d52441dad80194c32025757", "score": "0.6009904", "text": "function addProduct(item, department, price, quantity) {\n connection.query(\"insert into products set ?\",\n {\n product_name: item,\n department_name: department,\n price: price,\n stock_quantity: quantity\n },\n function(err, res) {\n if (err) throw err;\n }\n );\n\n connection.query(\"SELECT * FROM products WHERE product_name = ?\", [item], function(err,res) {\n if (err) throw err;\n console.log(\"ITEM ADDED\")\n console.table(res)\n })\n\n connection.end();\n }", "title": "" }, { "docid": "6d286e90e8b639f33f33eee5c288dcae", "score": "0.60062295", "text": "function addNew(newProduct, newDpt, newPrice, newStock) {\n connection.query('INSERT INTO Products SET ?', {\n product_name: newProduct,\n department_name: newDpt,\n price: newPrice,\n stock_quantity: newStock\n },\n\n function (error, response) {\n if (error) throw error;\n });\n viewProducts();\n}", "title": "" }, { "docid": "76759f786615cab723321d136266e453", "score": "0.5967479", "text": "async function createProduct(prodName,prodPrice,prodDescription, prodBrand, prodCategory, prodSupplier, prodImages){\n try {\n const product = await newProduct(prodName,prodPrice,prodDescription, prodBrand, prodCategory, prodSupplier, prodImages);\n const result = await product.save();\n return result;\n } catch(err) {\n let message = \"400\";\n return message;\n }\n \n}", "title": "" }, { "docid": "d1cd07237228c733acb0083de2f6f287", "score": "0.5911212", "text": "function createProduct() {\n\n console.log(admin.productData);\n // create the product\n Product.create(admin.productData)\n .then(function(data) {\n // clear the form\n admin.productData = {};\n\n // show a message that the product was successfully created\n // show a link to view that product\n admin.successMessage = 'Product created!';\n admin.newProductId = data.get('_id');\n admin.newProductName = data.get('name');\n });\n }", "title": "" }, { "docid": "c773f53ee7d0c516127d6353184e42be", "score": "0.58882934", "text": "function addNewProduct() {\n connection.query(\"SELECT * FROM departments\", function(err, res) {\n var deptList = [];\n var deptID;\n for (i = 0; i < res.length; i++) {\n deptList.push(res[i].name);\n };\n inquirer.prompt([\n {\n name: 'name',\n type: 'input',\n message: 'Please enter a product name'\n },\n {\n name: 'dept',\n // make this a list based on the departments table\n // store matching department id as var deptID\n type: 'list',\n choices: deptList,\n message: 'Please enter a department name'\n },\n {\n name: 'price',\n type: 'input',\n message: 'Please enter a unit price'\n }\n ]).then(function(response) {\n // take the dept name they chose and find the matching id\n for (i = 0; i < res.length; i++) {\n if (response.dept === res[i].name) {\n deptID = res[i].id;\n };\n };\n connection.query(\"INSERT INTO products SET ?\",\n {\n name: response.name,\n id_departments: deptID,\n price: response.price\n },\n function(err, res) {\n console.log(res.affectedRows + \" Product added!\\n\");\n transactionEnd();\n }\n );\n });\n });\n}", "title": "" }, { "docid": "29140651c7478d335cc59183f576beb0", "score": "0.5867152", "text": "function newProduct() {\n inquirer\n .prompt([\n {\n name: \"id\",\n type: \"input\",\n message: \"What is the product ID?\"\n },\n {\n name: \"product\",\n type: \"input\",\n message: \"What is the Product Name?\"\n },\n {\n name: \"department\",\n type: \"input\",\n message: \"What is the Department?\"\n },\n {\n name: \"price\",\n type: \"input\",\n message: \"What is the Price?\"\n },\n {\n name: \"stock\",\n type: \"input\",\n message: \"How much stock?\"\n },\n ])\n\n .then(function (answer) {\n connection.query(\n \"INSERT INTO products SET ?\",\n {\n item_id: answer.id || 0,\n product_name: answer.product,\n department_name: answer.department,\n price: answer.price || 0,\n stock_quantity: answer.stock || 0\n \n },\n managerOptions()\n \n )\n\n })\n\n}", "title": "" }, { "docid": "f259eb9df3966dee1bfc647a5c6f5861", "score": "0.5857833", "text": "function newProduct () {\n clearTerminal ();\n inquirer.prompt([\n { \n name: \"product_name\", \n type: \"input\",\n message: \"Add the product name\",\n validate: function validate(check){\n return check !== '' || \"Please enter a valid name\";\n }\n },\n { \n name: \"department_name\", \n type: \"input\",\n message: \"Add the department name?\",\n validate: function validate(check){\n return check !== '' || \"Please enter a valid name\";\n }\n },\n { \n name: \"price\", \n type: \"input\",\n message: \"Set the price\",\n validate: function validateNumber(check){\n let reg = /^\\d+$/;\n return reg.test(check) || \"Must input a number\";\n }\n },\n { \n name: \"stock_quantity\", \n type: \"input\",\n message: \"How \" + \"many\".underline + \" would you like to add?\",\n validate: function validateNumber(check){\n let reg = /^\\d+$/;\n return reg.test(check) || \"Must input a number\";\n }\n }\n ]).then(function(answer) {\n\n let productName = answer.product_name; \n let departmentName = answer.department_name;\n let price = parseFloat(answer.price);\n let stockAmount = parseFloat(answer.stock_quantity);\n\n connection.query(`INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES (\"${productName}\", \"${departmentName}\", ${price}, ${stockAmount})`, function(err, res) {\n if (err) throw err;\n start();\n });\n }); \n }", "title": "" }, { "docid": "fb8aae9268fc4c620b325398c21de833", "score": "0.58485913", "text": "function addNewProduct(id, name, dpt, price, qty) {\n connection.query('INSERT INTO products (id, name, department, price, stock) VALUES (\"' + id + '\", \"' + name + '\", \"' + dpt + '\",' + price + ',' + qty + ')');\n console.log(\"Item \" + id + \" (\" + name + \") successfully added!\")\n displayTasks();\n}", "title": "" }, { "docid": "44e1b7b8643dcfdc385a3ebdbd2658d1", "score": "0.5829977", "text": "function newProduct() {\n inquirer\n .prompt([\n {\n name: \"product\",\n type: \"input\",\n message: \"Product?\"\n },\n {\n name: \"department\",\n type: \"input\",\n message: \"Department?\"\n },\n {\n name: \"price\",\n type: \"input\",\n message: \"Price?\"\n },\n {\n name: \"stock\",\n type: \"input\",\n message: \"Starting stock?\"\n },\n ])\n .then(function(answer) {\n console.log(\"\\nAdding Product...\\n\");\n connection.query(\"INSERT INTO products SET ?\",\n {\n product_name: answer.product,\n department_name: answer.department,\n price: answer.price,\n stock_quantity: answer.stock\n },\n function(err, res) {\n console.log(res.affectedRows + \" product(s) added!\\n\");\n displayProducts();\n }\n )\n })\n}", "title": "" }, { "docid": "a72945d3444ab33303825b99509112d3", "score": "0.5815515", "text": "function createProduct(userId, prod) {\n var deferred = q.defer();\n prod.merchantId = userId;\n ProductModel.create(prod).then(function (data) {\n deferred.resolve(data);\n }, function (err) {\n deferred.reject(err);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "bb489de21ed0f144045780c1ec5560cf", "score": "0.5812406", "text": "async seedDB() {\n\t\t\tawait this.adapter.insertMany([\n\t\t\t\t{ name: \"Samsung Galaxy S10 Plus\", quantity: 10, price: 704 },\n\t\t\t\t{ name: \"iPhone 11 Pro\", quantity: 25, price: 999 },\n\t\t\t\t{ name: \"Huawei P30 Pro\", quantity: 15, price: 679 },\n\t\t\t]);\n\t\t}", "title": "" }, { "docid": "f056dfcb76ceaa1f252f04e477ac1dd9", "score": "0.58109546", "text": "function createProduct(newProduct) { \r\n return fetch(dbUrl, {\r\n method: 'POST',\r\n headers: {'Content-Type': 'application/x-www-form-urlencoded', 'Accept': 'application/json'},\r\n body: JSON.stringify(newProduct)\r\n })\r\n .then(response => console.log(response.json()))\r\n .catch(error => console.log(\"Produsul nu a fost adaugat\" + error));\r\n}", "title": "" }, { "docid": "f34adcc2ee3ada5a90200e635c472656", "score": "0.5810116", "text": "function addNew(products) {\n console.log('Adding a new item...\\n');\n var query = 'INSERT INTO products SET ?';\n connection.query(query, {\n product_name: products.product_name,\n department_name: products.department_name,\n price: products.price,\n stock_quantity: products.stock_quantity\n },\n function (err, res) {\n if (err) throw err;\n\n console.log(`The ${products.product_name} in the ${products.department_name} department has been added. You have added ${products.stock_quantity} at $${products.price} each.\\n`);\n\n readAll();\n });\n}", "title": "" }, { "docid": "ea6bbdc60f1a264ee6cccffcca7c5ade", "score": "0.5796248", "text": "function create(req, res) {\n var baseReq = reqBase.reqMessage();\n logger.info(JSON.stringify(reqBase.reqLogMessage(baseReq.transId, req)));\n\n req.checkBody('sku', messages.FIELD_CANT_BE_EMPTY).notEmpty();\n req.checkBody('name', messages.FIELD_CANT_BE_EMPTY).notEmpty();\n req.checkBody('categoryId', messages.FIELD_CANT_BE_EMPTY).notEmpty();\n req.checkBody('createdBy', messages.FIELD_CANT_BE_EMPTY).notEmpty();\n\n req.sanitize('sku').trim();\n req.sanitize('name').trim();\n req.sanitize('description').trim();\n req.sanitize('size').trim();\n req.sanitize('color').trim();\n req.sanitize('categoryId').trim();\n req.sanitize('createdBy').trim();\n\n var errors = req.validationErrors();\n\n if (errors) {\n res.status(messages.HTML_STATUS.BAD_REQUEST).send(resBase.resMessage(messages.ACKNOWLEDGE_TYPE.FAILURE,messages.INSERT_FAILED + util.inspect(errors)));\n return;\n }\n\n models.Product.create({\n sku: req.body.sku,\n name: req.body.name,\n description: req.body.description,\n qty: req.body.qty == '' ? null : req.body.qty,\n price: req.body.price == '' ? null : req.body.price,\n size: req.body.size == '' ? null : req.body.size,\n color: req.body.color == '' ? null : req.body.color,\n CategoryId: req.body.categoryId,\n status: true,\n createdBy: req.body.createdBy\n }).then(function(product) {\n var result = resBase.resMessage(messages.ACKNOWLEDGE_TYPE.SUCCESS,messages.INSERT_SUCCESS,product);\n logger.info(resBase.resLogMessage(baseReq.transId, result));\n res.status(messages.HTML_STATUS.SUCCESS).send(result);\n }).catch (function(e) {\n logger.error(resBase.resLogMessage(baseReq.transId, e));\n res.status(messages.HTML_STATUS.INTERNAL_SERVER_ERROR).send(resBase.resMessage(messages.ACKNOWLEDGE_TYPE.SOMETHING_WENT_WRONG,messages.SOMETHING_WENT_WRONG));\n });\n}", "title": "" }, { "docid": "e80983b43a90edf05b9b51ba84da549a", "score": "0.5789994", "text": "function addProduct(productId, quantity) { }", "title": "" }, { "docid": "e2a2796088e81524b63328effbb6f538", "score": "0.57864785", "text": "addProduct(inquirer) {\n inquirer.prompt([{\n name: 'itemName',\n message: '\\nEnter the product name: \\n'\n },\n {\n name: 'dept',\n message: '\\nEnter the name of the department:\\n'\n },\n {\n name: 'price',\n message: '\\nEnter the price of the item:\\n'\n },\n {\n name: 'stock',\n message: '\\nHow many of these items are in stock?\\n'\n }\n ]).then((data) => {\n connection.query(\n \"INSERT INTO products SET ?\", {\n product_name: data.itemName,\n department_name: data.dept,\n price: data.price,\n stock_quantity: data.stock\n }, (err) => {\n if(err) {throw err;}\n console.log('Your request has been processed!... \\n\\n');\n table.create.prodList.splice(0);\n connection.query('SELECT * FROM products', (err, res) => {\n if(err) {throw err;}\n for(let i in res) {\n let data = res[i];\n table.create.prodList.push([data.item_id, data.product_name, data.department_name, data.price, data.stock_quantity]);\n }\n console.log('\\n\\n' + table.create.prodList.toString() + '\\n\\n');\n console.log('Press any key to continue');\n });\n this.initInq(inquirer);\n })\n });\n }", "title": "" }, { "docid": "ed75fdf1858d000dfa19dc6f19c63ddf", "score": "0.5773042", "text": "function createTable(element, product) {\n const table = `<table id=${product}></table>`;\n $(element).append(table);\n }", "title": "" }, { "docid": "a9927872b0af684fedb397b2c67fd773", "score": "0.5770338", "text": "createTable() {\n const sql = `\n CREATE TABLE IF NOT EXISTS stocks (\n p_id INTEGER PRIMARY KEY AUTOINCREMENT,\n p_name TEXT,\n p_stock INTEGER)`\n return this.dao.run(sql)\n }", "title": "" }, { "docid": "437576bc0fb695ef000b24378559bcdb", "score": "0.5767548", "text": "async createProductVariant(product) {\n let index = 97; // from a - 97\n const indexMax = 106; // to j - 106\n for (index; index <= indexMax; index++) {\n const productVariant = await productVariantModel.create({\n productId: product.id,\n name: product.name + String.fromCharCode(index),\n sku: product.slug + index,\n price: index\n });\n\n this.createVariantAttribute(productVariant);\n }\n }", "title": "" }, { "docid": "b9b210087e3cdf840f5af16534d9c28d", "score": "0.57535267", "text": "newOrder(){\n return Order.create({\n items: products.map((product) => { //for each product in the products array, create a new LineItem per product\n return LineItem.create({\n product: product\n });\n })\n });\n }", "title": "" }, { "docid": "4c6738ceaa2650c7b941b60734c4462a", "score": "0.5750789", "text": "function newProduct(req,res) {\n process.nextTick(() => {\n let newProduct = new Product(req.body);\n newProduct.save((err,product) => {\n if(err) return res.status(400).json({ status: 400, message: \"Missing some required fields.\", error: err});\n res.json({ status: 200, message: 'Product successfully created!', product});\n });\n });\n}", "title": "" }, { "docid": "538ec2a0a66c4bbcbfd3825f2114e7e2", "score": "0.57484305", "text": "static async create(req, res) {\n try {\n const product = await Product.create(req.body);\n\n return res.products_with_additional_prices(product);\n } catch (err) {\n return res.error(err.message);\n }\n }", "title": "" }, { "docid": "8e4260f346ec677169d09c5bacc33f25", "score": "0.5746699", "text": "function create_product_info(curr_prod) {\n //remove table if already constructed\n if ($('#compare_table_div').length) {\n $(\"#compare_table_div\").empty();\n var div = document.getElementById(\"compare_table_div\");\n div.remove();\n }\n var table_div = document.createElement('div');\n var table = document.createElement('table');\n\n table_div.id = 'compare_table_div';\n table.id = 'compare_table';\n\n var prod_row = table.insertRow();\n var prod_cell = prod_row.insertCell();\n var cell_link = document.createElement('a');\n cell_link.innerHTML = curr_prod.prod;\n cell_link.href = curr_prod.url;\n prod_cell.appendChild(cell_link);\n\n var price_row = table.insertRow();\n var price_cell = price_row.insertCell();\n price_cell.innerHTML = curr_prod.price;\n\n var img_row = table.insertRow();\n var img_cell = img_row.insertCell();\n var cell_img = document.createElement('img');\n cell_img.src = curr_prod.img;\n cell_img.width = 300;\n cell_img.height = 300;\n img_cell.appendChild(cell_img);\n\n table_div.appendChild(table);\n document.body.append(table_div);\n\n create_pro_con(curr_prod.pro, curr_prod.con);\n }", "title": "" }, { "docid": "7d65c9c29a45d8d372a429b918693ff7", "score": "0.5711997", "text": "async function createProduct(req, res) {\n try {\n const body = await getPostData(req);\n const { title, description, price } = JSON.parse(body);\n const product = {\n title,\n description,\n price,\n };\n\n const newProduct = await Products.create(product);\n\n res.writeHead(201, { \"Content-Type\": \"application/json\" });\n return res.end(JSON.stringify(newProduct));\n } catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "056d34fc4cb979e89acac1a04ef745df", "score": "0.5698665", "text": "function createProduct(name, price) {\n return {\n name: name,\n price: price,\n }\n}", "title": "" }, { "docid": "fa7419cd8818ec5a59e0563b1ce3f0cd", "score": "0.5687725", "text": "function addProductToDatabase() {\n connection.query('INSERT INTO products SET ?', [currentItem], function(err, data) {\n if (err) {\n console.log(err);\n } else {\n confirmSuccessfulAddition();\n }\n });\n}", "title": "" }, { "docid": "173bf70087126198a66e69bbcfb2ddef", "score": "0.5683869", "text": "function insert(product) { \n if (product.name == 'fail') {\n return Promise.reject('Insert Failed');\n } else {\n return Promise.resolve('Insert Succeeded');\n }\n }", "title": "" }, { "docid": "6aafdb1ab8de909e9175f66ef8329913", "score": "0.56820816", "text": "function addNewProduct() {\n\tinquirer.prompt([\n\t\t{\n type: 'input',\n message: 'Please enter the product name: ',\n name: 'product_name'\n },\n {\n \ttype: 'input',\n message: 'Please enter the department: ',\n name: 'product_department'\n },\n {\n \ttype: 'input',\n message: 'Please enter the price: ',\n name: 'product_price'\n },\n {\n \ttype: 'input',\n message: 'Please enter the quantity: ',\n name: 'product_quantity'\n }\n\t]).then(function(input) {\n\t\tvar query = \"INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES (?, ?, ?, ?)\";\n\t\tconnection.query(query, [input.product_name, input.product_department, input.product_price, input.product_quantity], function(err, res) {\n\t\t\tif(err) throw err;\n\t\t\tconsole.log('\\nProduct Successfully added!\\n');\n\t\t\tperformAnotherAction();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "640b1fe018cf51a4f8447025efb5c413", "score": "0.5668895", "text": "function newProduct() {\n inquirer.prompt([{\n name: \"product\",\n type: \"input\",\n message: \"Type the name of the Product you want to add to Bamazon\"\n }, {\n name: \"department\",\n type: \"input\",\n message: \"Type the Department name of the Product you want to add to Bamazon\"\n }, {\n name: \"price\",\n type: \"input\",\n message: \"Enter the price of the product without currency symbols\"\n }, {\n name: \"quantity\",\n type: \"input\",\n message: \"Enter the amount you want to add to the inventory\"\n }]).then(function(answers) {\n var ProductName = answers.product;\n var DepartmentName = answers.department;\n var Price = answers.price;\n var StockQuantity = answers.quantity;\n connection.query('INSERT INTO Products (ProductName, DepartmentName, Price, StockQuantity) VALUES (?, ?, ?, ?)', [ProductName, DepartmentName, Price, StockQuantity], function(err, data) {\n if (err) {\n throw err;\n } else {\n console.log('\\n\\nProduct: ' + ProductName + ' added successfully!\\n\\n');\n appContinue();\n }\n });\n });\n }", "title": "" }, { "docid": "322d7e85d0c6ca65a5b41628ccec0031", "score": "0.56645375", "text": "function create(req, res, match){\n\tutils.logInfo('create');\n\n\tbeforeCreateUpdate(req, res, function(reqData){\n\t\tproducts.insertOne(reqData, function(err, result){\n\t\t\tutils.logError(err);\n\t\t\tres.end(JSON.stringify({status: 200, message: 'Success, Inserted.', result: {}}));\n\t\t});\n\t});\n}", "title": "" }, { "docid": "b578bc70ae598a8a82982360cbc482e4", "score": "0.56639034", "text": "create(req, res) {\n Product.create(req.body)\n .then(function (newProduct) {\n res.status(200).json(newProduct);\n })\n .catch(function (error){\n res.status(500).json(error);\n });\n }", "title": "" }, { "docid": "84321f6ebb93fd41595ce06bfc22799e", "score": "0.5661232", "text": "function addProduct(){\n\tinquirer.prompt([\n\t\t{\n\t\t\tname: 'name',\n\t\t\tmessage: 'Name of the product',\n\t\t\ttype: 'input',\n\t\t\t\n\t\t},\n\t\t{\n\t\t\tname: 'department',\n\t\t\tmessage: 'What department does it belong to?',\n\t\t\ttype: 'input',\n\t\t},\n\t\t{\n\t\t\tname: 'price',\n\t\t\tmessage: 'What is the price of the product?',\n\t\t\ttype: 'input',\n\t\t\tvalidate: validateFloat\n\t\t},\n\t\t{\n\t\t\tname: 'quantity',\n\t\t\tmessage: 'What is the starting quantity of the product?',\n\t\t\ttype: 'input',\n\t\t\tvalidate: validateNum\n\t\t}\n\t]).then(function(res){\n\t\t// add new product to database\n\t\tnewProduct(res)\n\t})\n}", "title": "" }, { "docid": "4e84625842abdbf80b58c60350e4cd1e", "score": "0.56494814", "text": "function addProductToOrdesProducts(res, order_id, product_id, product_name, amount, price, sum) {\n let database = new Database(config);\n var sql = \"INSERT INTO orders_products (order_id, product_id, product_name, amount, price, sum) VALUES ?\";\n var values = [[order_id, product_id, product_name, amount, price, sum]];\n console.log('CHECK orders_products!!!!!');\n console.log(values);\n database.query(sql, [values]) // executin request\n .then(result => {\n console.log('PROMISE RESULT orders_products!!! ' + result);\n console.log(result);\n res.send(\"New order added!\");\n return database.close();\n }, err => { // handle the error\n return database.close().then(() => { throw err; });\n });\n}", "title": "" }, { "docid": "7d2bafc4b3a3ce10bfbc4ca2f30ae994", "score": "0.56493324", "text": "async registerProduct(ctx, productId ,date, type) {\n\n // IBO is responsible for creating products.\n // So the status of the product is set to \"Process Initiated' and the owner to 'IBO'\n const product = {\n productID: productId,\n serialNo: '',\n date: date,\n status: 'Process Initiated',\n owner: \"IBO\",\n decCertID: \"\",\n type: type\n };\n\n await ctx.stub.putState(product.productID, Buffer.from(JSON.stringify(product)));\n }", "title": "" }, { "docid": "7968597002b73d4fc783e273ad27ea0c", "score": "0.5642702", "text": "function addProduct() {\n console.log(\"ADD NEW PRODUCT\");\n inquirer.prompt([\n {\n name:\"product\",\n message:\"Post a new item \\n Item Name: \",\n },\n {\n name:\"department\",\n message:\"Department\",\n choices:[\"Apparel\", \"Electronics\", \"Toys\", \"Collectibles\",\n \"Apps & Games\", \"Books & Comics\", \"Appliances\"]\n },\n {\n name:\"price\",\n message: \"Set Price: \"\n },\n {\n name:\"quantity\",\n message: \"Set Quantity: \"\n }\n ]).then(function(response){\n connection.query(\n \"INSERT INTO products SET ?\",\n {\n product_name: response.product,\n department_name: response.department,\n price: response.price,\n stock_quantity: response.quantity\n },\n function(err, res){\n if(err) throw err;\n console.log(res.affectedRows + \" items inserted\\n\");\n }\n );\n })\n}", "title": "" }, { "docid": "82749f87df1ac84ec46ffd13af56dbe6", "score": "0.5634901", "text": "async function addOneProductAsync(product) {\n const sql = `INSERT INTO products(productId, productName, produceDate, expireDate, categoryId, productPrice) \n VALUES(DEFAULT, '${product.productName}', '${product.produceDate}', \n '${product.expireDate}', ${product.categoryId}, ${product.productPrice})`;\n const info = await dal.executeAsync(sql);\n product.productId = info.insertId;\n return product;\n}", "title": "" }, { "docid": "3aafc3faa601bf84993936db70d2a214", "score": "0.56345546", "text": "function addproduct() {\n\n\t//Find out valid department choices (because departments need to match up to supervisor department table)\n\tconnection.query ('SELECT department_name FROM departments',\n\t\tfunction(err, res) {\n\n\t\t\t\tif (err) throw err;\n\t\t\t\telse {\n\t\t\t\t\t//String array to serve as department choices for add product prompt\n\t\t\t\t\tvar departments = [];\n\t\t\t\t\t\n\t\t\t\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\t\t\t\tdepartments[i] = res[i].department_name;\n\t\t\t\t\t}\n\t\t\t \n\t\t\t }\n\t\t\t\n\t\t\t\tinquirer.prompt([\n\t\t\t\t{\n\t\t\t\t\tname: 'name',\n\t\t\t\t\tmessage: 'What is the product name?'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'department',\n\t\t\t\t\ttype: 'list',\n\t\t\t\t\tmessage: 'What department does the product belong in?',\n\t\t\t\t\tchoices: departments\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'price',\n\t\t\t\t\tmessage: 'How much does the product cost?'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'quantity',\n\t\t\t\t\tmessage: 'How much of the product do you have in stock?'\n\t\t\t\t}\n\t\t\t\t]).then(function(response) {\n\t\t\n\t\t\t\t\tconnection.query(\n\t\t\t\t\t\t'INSERT INTO products SET ?', \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tproduct_name: response.name,\n\t\t\t\t\t\t\tdepartment_name: response.department,\n\t\t\t\t\t\t\tprice: response.price,\n\t\t\t\t\t\t\tin_stock: response.quantity\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(err, res) {\n\n\t\t\t\t\t\t\tif (err) throw err;\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t console.log(res.affectedRows + \" product inserted!\\n\");\n\t\t\t\t\t\t // Call updateProduct AFTER the INSERT completes\n\t\t\t\t\t\t managerprompt();\n\t\t\t\t\t\t }\n\t\t\t \t});\n\t});\n\n});\n\n\t\n}", "title": "" }, { "docid": "15cd5e0483ff4639884b32d5fee93ab7", "score": "0.5631791", "text": "async seedDB() {\n await this.adapter.insertMany([\n { name: \"Samsung Galaxy S10 Plus\", quantity: 10, price: 704, stars: 3 },\n { name: \"iPhone 11 Pro\", quantity: 25, price: 999, stars: 3 },\n { name: \"Huawei P30 Pro\", quantity: 15, price: 679, stars: 3 },\n { name: \"Samsung Galaxy A50\", quantity: 10, price: 620, stars: 3 },\n ]);\n }", "title": "" }, { "docid": "3a7535ec2ba5c609facf1aaf92f32ab0", "score": "0.56225014", "text": "function maketable() {\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n \n var table = new Table({\n head: ['ID', 'Product', 'Department', 'Price', 'Stock Quantity']\n , colWidths: [5, 20, 20, 10, 10]\n });\n \n for (var i = 0; i<results.length; i++) {\n table.push(\n [results[i].item_id, results[i].product_name, results[i].department_name, \"$\" + results[i].price.toFixed(2), results[i].stock_quantity]\n );\n \n }\n console.log(chalk.blue.bold(\"********************Welcome to Bamazon!************************\"));\n console.log(chalk.rgb(255, 136, 0).bold(table.toString()));\n runprompt();\n })\n}", "title": "" }, { "docid": "3bc42268dbf41684eec8b23d2458aa26", "score": "0.5620913", "text": "function addProduct() {\n inquirer.prompt([\n {\n type: 'input',\n message: 'Item Name: ',\n name: 'product_name'\n },\n {\n type: 'input',\n message: 'Department Name: ',\n name: 'dept_name'\n },\n {\n type: 'input',\n message: 'Price',\n name: 'price'\n },\n {\n type: 'input',\n message: 'Stock Quantity: ',\n name: 'stock_quantity'\n }\n ]).then(function(answer) {\n // Initiate connection\n connection.query(\n // Insert into products table with the object based on answers from inquirer prompt\n 'INSERT INTO products SET ?',\n {\n product_name: answer.product_name,\n dept_name: answer.dept_name,\n price: answer.price,\n stock_quantity: answer.stock_quantity\n }, \n function(err, res) {\n if (err) throw err;\n // Let the user know product has been added\n console.log(res.affectedRows + ' New product added\\n');\n }\n );\n // Go back to manager view\n managerView();\n });\n}", "title": "" }, { "docid": "25edd05e1d057da741f725e5bbe7c4a6", "score": "0.56190014", "text": "function createProduct(product, productType) {\n if (!product._id || !product.name || !product.price || !product.description || !product.imageUrl) {\n return null;\n }\n // if the product have not his personnalisation list\n if ((productType == 'cameras' && !product.lenses) || (productType == 'teddies' && !product.colors) || (productType == 'furniture' && !product.varnish)) {\n return null;\n }\n\n let newProdDiv = createHTMLElement('div', { id: 'product-' + product._id, class: 'container' })\n let subDiv = createHTMLElement('div', { class: 'border border-dark rounded product row' });\n newProdDiv.appendChild(subDiv);\n\n let imgDiv = createHTMLElement('div', { class: 'col' });\n subDiv.appendChild(imgDiv);\n\n let infoDiv = createHTMLElement('div', { class: 'col' });\n subDiv.appendChild(infoDiv);\n\n let img = createHTMLElement('img', { src: product.imageUrl });\n imgDiv.appendChild(img);\n\n let title = createHTMLElement('h3', { innerHTML: product.name + ' - ' + renderPrice(product.price) });\n infoDiv.appendChild(title);\n\n let desc = createHTMLElement('p', { innerHTML: product.description });\n infoDiv.appendChild(desc);\n\n // Add a row with two columns for the select on left and the 'add to bag' button on right\n let selectAndButtonRowDiv = createHTMLElement('div', { class: 'row' });\n infoDiv.appendChild(selectAndButtonRowDiv);\n\n let selectDiv = createHTMLElement('div', { class: 'col' });\n selectAndButtonRowDiv.appendChild(selectDiv);\n\n let buttonDiv = createHTMLElement('div', { class: 'col' });\n selectAndButtonRowDiv.appendChild(buttonDiv);\n\n let select = createHTMLElement('select', { id: 'product-personalisation', class: 'browser-default custom-select' });\n select.addEventListener('change', (event) => {\n document.getElementById('product-add-to-bag').disabled = (event.target.value == null || event.target.value == 'undefined');\n });\n selectDiv.appendChild(select);\n\n let button = createHTMLElement('button', { id: 'product-add-to-bag', class: 'btn btn-outline-dark', disabled: true, innerHTML: 'Add to bag' });\n button.addEventListener('click', (event) => {\n let countOfItem = addProductToBag(productType, product, select.value);\n document.getElementById('bag').children[0].children[1].innerHTML = countOfItem + '<br/>Panier';\n });\n buttonDiv.appendChild(button);\n\n switch (productType) {\n case 'cameras':\n populateSelect(select, product.lenses, 'Choose a lense');\n break;\n case 'teddies':\n populateSelect(select, product.colors, 'Choose a color');\n break;\n case 'furniture':\n populateSelect(select, product.varnish, 'Choose a varnish');\n break;\n }\n\n return newProdDiv;\n}", "title": "" }, { "docid": "daf6ccd6914773149ddacf809b12acee", "score": "0.56140476", "text": "function insertProductInDB(product, seller, uiCallback) {\n if (!product) {\n throw new Error(\n `Product insertion error! Error code: ${codes.NULL_OBJECT}`\n );\n }\n let productData = Product.convertToJSON(product);\n postData(`${API_URL}products/add`, productData)\n .then((response) => {\n uiCallback(codes.INSERTION_SUCCESS);\n })\n .catch((err) => uiCallback(codes.INSERTION_FAILIURE));\n}", "title": "" }, { "docid": "a3e22b2bec17640739c940b45955473d", "score": "0.56107426", "text": "ADD_PRODUCT(state, newProduct){\n return state.product.new_product = newProduct;\n }", "title": "" }, { "docid": "d34ffa6baa7c6161e470c2e6b58ced98", "score": "0.5606613", "text": "async function createProduct(req, res) {\n try {\n const newProduct = await addProduct(req);\n res.status(201).json(newProduct);\n } catch (error) {\n res.status(400).json({ message: error });\n }\n}", "title": "" }, { "docid": "d9106ca4779af8ac663ff7c6385bd4fe", "score": "0.5606591", "text": "function createProductOrderItem(product) {\n var productOrder = datacontext.createObject(model.entityNames.productOrder);\n\n productList.remove(product); // Remove from list\n\n productOrder.product(product);\n productOrder.quantityOrdered(1);\n\n productOrder.order(order()); // link order to product order\n return addToList(productOrder);\n }", "title": "" }, { "docid": "8a025cfbd7e5356adc898546fd5be381", "score": "0.5606299", "text": "function addNewProduct() {\n inquirer.prompt([\n {\n type: 'input',\n message: 'What is the name of the product?',\n name: 'name'\n },\n {\n type: 'input',\n message: 'Which department does the item go in?',\n name: 'department'\n },\n {\n type: 'input',\n message: 'what is the price of the item?',\n name: 'price'\n },\n {\n type: 'input',\n message: 'What is the stock quantity?',\n name: 'stock'\n }\n ])\n .then(answers => {\n connection.query(\n 'INSERT INTO products SET ?',\n {\n product_name: answers.name,\n department_name: answers.department,\n price: answers.price,\n stock_quantity: answers.stock\n },\n (err, res) => {\n if (err) throw err\n askManager()\n }\n )\n })\n}", "title": "" }, { "docid": "c1c20b6bda3591003bee95dc406f0c95", "score": "0.56018406", "text": "function showProducts(){\n connection.query(\"SELECT * FROM products\", function(err, res) {\n // CREATE TABLE TO DISPLAY PRODUCTS\n // var table = new Table({\n // head: [\"Item Id#\", \"Product Name\", \"Department Name\", \"Price\"],\n // style: {\n // head: [\"blue\"],\n // compact: false,\n // colAligns: [\"center\"],\n // }\n // });\n // LOOP THROUGH ALL THE PRODUCTS AND ADD TO THE TABLE\n for (var i = 0; i < res.length; i++) {\n \n // table.push([res[i].item_id, res[i].product_name, res[i].department_name, res[i].price]);\n // console.log(table.toString());\n }\n console.table(res);\n purchase();\n });\n}", "title": "" }, { "docid": "7353b28f89bb28e305c9fb1e26300852", "score": "0.55952543", "text": "function addNewProduct() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n inquirer.prompt([{\n name: \"pname\",\n type: \"input\",\n message: \"What is the product name?\"\n }, {\n name: \"dname\",\n type: \"input\",\n message: \"What is the department for this product?\"\n }, {\n name: \"price\",\n type: \"input\",\n message: \"What is the price for this product?\"\n }, {\n name: \"stock\",\n type: \"input\",\n message: \"What is the stock amount\"\n }]).then(function (ans) {\n // Inserts new product into database\n connection.query(\"INSERT INTO products SET ?\", {\n product_name: ans.pname,\n department_name: ans.dname,\n price: ans.price,\n stock_quantity: ans.stock\n }, function (err) {\n if (err) throw err;\n console.log(\"Product added\");\n showAll();\n connection.end();\n })\n })\n })\n}", "title": "" }, { "docid": "1d1c75f7c17c74fb182b7ff281647465", "score": "0.5593475", "text": "async create(data) {\n\t\tif (data.nombre === '' || typeof data.nombre === 'undefined') return false;\n\t\tif (data.precio === '' || typeof data.precio === 'undefined') return false;\n\t\tif (data.foto === '' || typeof data.foto === 'undefined') return false;\n\n\t\tconst newProducto = new Producto({\n\t\t\tnombre: data.nombre,\n\t\t\tdescripcion: data.descripcion,\n\t\t\tcodigo: data.codigo,\n\t\t\tfoto: data.foto,\n\t\t\tprecio: data.precio,\n\t\t\tstock: data.stock,\n\t\t\tcategoria: data.categoria,\n\t\t\ttimestamp: Date.now(),\n\t\t});\n\t\t\n\t\tawait newProducto.save();\n\t\treturn newProducto;\n\t}", "title": "" }, { "docid": "9124e47927d37ca291d3327041a88f8d", "score": "0.5589501", "text": "function addProduct(product) {\n return new Promise((resolve, reject) => {\n const productToAdd = new Product(product);\n productToAdd.save((err, addedProduct) => {\n if (err) return reject(err);\n resolve(addedProduct);\n });\n });\n}", "title": "" }, { "docid": "60c3974306440b41a4ca374f70fde53a", "score": "0.5580174", "text": "function addProduct() {\n inquirer.prompt([{\n type: 'input',\n message: 'Product Name:',\n name: 'product'\n }, {\n type: 'list',\n message: 'Category:',\n choices: departments,\n name: 'department'\n }, {\n type: 'input',\n message: 'Price ($)',\n name: 'price'\n }]).then(function(user) {\n var newProduct = user.product;\n var newDepartment = user.department;\n var newPrice = parseInt(user.price);\n connection.query('INSERT INTO products SET ?', {\n product: newProduct,\n department: newDepartment,\n price: newPrice,\n stock: 0\n })\n products(managerMenu);\n })\n}", "title": "" }, { "docid": "84992d0dca7a41f0f903ef889bb81a4a", "score": "0.55745065", "text": "function createTabDetallePedido(){\n return `CREATE TABLE IF NOT EXISTS ${dbName}.detalle_pedido (\n id int(11) NOT NULL AUTO_INCREMENT,\n id_pedido int(11) NOT NULL,\n id_plato int(11) NOT NULL,\n cantidad int(11) NOT NULL COMMENT 'num de plato en el pedido',\n precio double(6,2) DEFAULT NULL,\n PRIMARY KEY (id),\n CONSTRAINT detalle_pedido_ibfk_2 FOREIGN KEY (id_plato) REFERENCES platos (id_plato),\n CONSTRAINT detalle_pedido_ibfk_3 FOREIGN KEY (id_pedido) REFERENCES pedidos (id_pedido)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8;`;\n}", "title": "" }, { "docid": "095d9f5be073f2dcd82c6a63fd871eba", "score": "0.5571684", "text": "function addNewProduct() {\n console.log(\"=========== Adding New Product ===========\");\n inquirer.prompt([\n {\n type: \"input\",\n name: \"product_name\",\n message: \"Enter product name\",\n validate: validate.validateString\n },\n {\n type: \"input\",\n name: \"department_name\",\n message: \"Enter department\",\n validate: validate.validateString\n },\n {\n type: \"input\",\n name: \"price\",\n message: \"Enter price\",\n validate: validate.validatePrice\n },\n {\n type: \"input\",\n name: \"stock_quantity\",\n message: \"Enter stock quantity\",\n validate: validate.validateQuantity\n }\n ]).then(input => {\n connection.query(\"INSERT INTO products SET ?\",\n {\n product_name: input.product_name,\n price: input.price,\n department_name: input.department_name,\n stock_quantity: input.stock_quantity\n }, (err, res) => {\n if(err) console.log(err)\n console.log(\"Added \" + input.product_name);\n managerMenu();\n });\n })\n}", "title": "" }, { "docid": "c529a3c62ec1ed033225810ffcd3af5d", "score": "0.5570609", "text": "async function createProduct(\n _,\n args,\n { models: { Product }, middlewares: { authorization } }\n) {\n const { admin } = authorization()\n if (!admin) throw new AuthenticationError('ur not authorized')\n\n const { error } = productCreateValidation(args)\n if (error) throw new UserInputError(error.details[0].message)\n\n const product = await Product.create(args.product)\n return product\n}", "title": "" }, { "docid": "2c4674e3e54d914a802f9b47bcea29e4", "score": "0.5568844", "text": "function addNewProduct(){\n\n // Prompt user for new product details\n prompt.start();\n console.log('\\nComplete the new product details:');\n prompt.get(['ProductName', 'DepartmentName', 'Price', 'Quantity'], function (err, result) {\n\n var productName = result.ProductName;\n var departmentName = result.DepartmentName;\n var price = result.Price;\n var quantity = result.Quantity;\n\n // Update Database\n connection.query('INSERT INTO Products SET ?', {\n ProductName: productName,\n DepartmentName: departmentName,\n Price: price,\n StockQuantity: quantity\n }, function(err, res){\n\n \n if(err){\n console.log('\\nSorry. The SQL database could not be updated.\\n');\n connection.end();\n }\n else{\n console.log('\\nInventory has been successfully updated.')\n connection.end();\n }\n });\n });\n}", "title": "" }, { "docid": "9f637e12e4b9de12a2aff7524d613980", "score": "0.55684376", "text": "function addNewProduct() {\n productArray = []\n inquirer.prompt([\n {\n type: 'input',\n message: 'Enter name of new item: ',\n name: 'item_name',\n },\n {\n type: 'list',\n message: 'Select department item belongs to: ',\n choices: [`Bamazon Gadgets`, `Automotive`, `Men's Apparel`, `Food & Beverages`, `Pets`, `Women's Apparel`],\n name: `department`\n },\n {\n type: 'input',\n message: 'Set item to price(00.00 format): ',\n name: 'price',\n validate: priceCheck\n },\n {\n type: 'input',\n message: 'Enter item starting quantity: ',\n name: 'stock',\n validate: quantityNumberCheck\n }\n ]).then(answer => {\n let newItem = {\n name: answer.item_name,\n department: answer.department,\n price: answer.price,\n stock: answer.stock\n }\n connection.query('INSERT INTO products (product_name, department_name, price, stock_quantity) VALUES(?, ?, ?, ?)', Object.values(newItem), (err, response) => {\n if (err) throw err\n console.log(`${newItem.name} added to inventory.`)\n startPrompt()\n })\n })\n}", "title": "" }, { "docid": "6b79bf76256670bc1805aa6143eca72c", "score": "0.556264", "text": "function showProducts() {\n var productTable = new Table({\n head: [' ID ', ' Product ', ' Department ', ' Price ', ' Stock '],\n });\n\n var query = \"SELECT * FROM products\";\n\n connection.query(query, function (err, result) {\n if (err) throw err;\n result.forEach(function (column) {\n productTable.push([column.item_id, column.product_name, column.department_name, '$' + column.price, column.stock_quantity]);\n });\n console.log(\"\\n\" + \"\\n\" + productTable.toString() + \"\\n\");\n purchaseItem();\n });\n}", "title": "" }, { "docid": "f84cecd75731f4c4ff63c208a785006a", "score": "0.55606014", "text": "function newProduct(name,price,description, brand, category, supplier, images) {\n this.name = name;\n this.price = price;\n this.description = description;\n this.brand = brand;\n this.category = category;\n this.supplier = supplier;\n this.images = images;\n \n return new Promise((resolve, reject) => {\n const product = new Product({\n name: this.name,\n price: this.price,\n description: this.description,\n brand: this.brand,\n category: this.category,\n supplier: this.supplier,\n inages: this.images\n });\n \n //const result = await product.save();\n resolve(product);\n });\n}", "title": "" }, { "docid": "6a192f41ccb1586de3b02753442d9bf9", "score": "0.5550411", "text": "createProduct(parameter) {\n this.logger.info('adding new product to the database');\n return new Promise((resolve, reject) => {\n const product = new ProductModel(parameter);\n product.save((error, savedData) => {\n if (error) {\n console.log(error);\n return reject(error);\n }\n return resolve(savedData);\n });\n });\n }", "title": "" }, { "docid": "2b1be6d7bd5f547a9a5476e1b990afd6", "score": "0.5549433", "text": "function addProduct() {\n\tinquirer.prompt([\n\t\t{\n\t\t\tmessage: \"What is the name of the name of the new product?\",\n\t\t\tname: \"productName\"\n\t\t},\n\t\t{\n\t\t\tmessage: \"To which deparment does the new product belong?\",\n\t\t\tname: \"productDeparment\"\n\t\t},\n\t\t{\n\t\t\tmessage: \"What is the price of the new product?\",\n\t\t\tname: \"productPrice\",\n\t\t\tvalidate: function(input) {\n\t\t\t\tif (isNaN(input) === false) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tmessage: \"How many items of this new product will be in stock?\",\n\t\t\tname: \"stockQuantity\",\n\t\t\tvalidate: function(input) {\n\t\t\t\tif (isNaN(input) === false) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t]).then(function(answers) {\n\t\tconnection.query(\"INSERT INTO products SET ?\", \n\t\t{\n\t\t\tproduct_name: answers.productName,\n\t\t\tdepartment_name: answers.productDeparment,\n\t\t\tprice: answers.productPrice,\n\t\t\tstock_quantity: answers.stockQuantity\n\t\t},\n\t\tfunction(err) {\n\t\t\tif (err) throw err;\n\t\t\tconsole.log(\"\\nNew product successfully added!\\n\\n\" +\n\t\t\t\t\"Name: \" + answers.productName +\n\t\t\t\t\"\\nDeparment: \" + answers.productDeparment +\n\t\t\t\t\"\\nPrice: \" + answers.productPrice +\n\t\t\t\t\"\\nQuantity in Stock: \" + answers.stockQuantity +\n\t\t\t\t\"\\n--------------------------------\\n\");\n\t\t\tstart();\n\t\t})\n\n\t})\n}", "title": "" }, { "docid": "660c0db366f9155749c8492b47b9d62c", "score": "0.55406404", "text": "function setCreate () {\n document.querySelector(`#create`).onclick = function () {\n let cartNewElement = document.createElement(\"tr\")\n cartNewElement.className = \"product\";\n cartNewElement.innerHTML = `<td class=\"name\"><span>${document.querySelector(`.text input`).value}</span></td>\n <td class=\"pu\"><span>$</span>${parseFloat(document.querySelector(`.number input`).value).toFixed(2)}</span></td>\n <td class=\"qty\"><label><input type=\"number\" value=\"0\" min=\"0\"/></label></td>\n <td class=\"subtot\">$<span></span></td>\n <td class=\"rm\"><button class=\"btn btn-delete\">Delete</button></td>`\n $cart.appendChild(cartNewElement);\n setOnChanges ()\n setDelete ()\n } \n}", "title": "" }, { "docid": "4e88be68a413f40015352c9c2f5a63e0", "score": "0.55365175", "text": "function createProduct() {\n console.log('A new product has been created!');\n //On récupère les données saisies\n const productToCreate = document.querySelector('.create-product');\n let name = productToCreate.querySelector('.name');\n let unitPrice = productToCreate.querySelector('.unit-price');\n //On crée un noeud html contenant les infos du nouveau produit\n const tr = document.createElement('tr');\n tr.className = \"product\";\n tr.innerHTML = `\n <td class=\"name\">\n <span>${name.value}</span>\n </td>\n <td class=\"price\">$<span>${unitPrice.value}</span></td>\n <td class=\"quantity\">\n <input type=\"number\" value=\"0\" min=\"0\" placeholder=\"Quantity\" />\n </td>\n <td class=\"subtotal\">$<span>0</span></td>\n <td class=\"action\">\n <button class=\"btn btn-remove\">Remove</button>\n </td>`;\n\n //On ajoute le noeud dans le DOM (à la fin de tbody)\n const cart = document.querySelector('#cart tbody');\n cart.append(tr);\n //Ajout d'un écouteur d'évènement sur le nouveau bouton\n tr.querySelector('.btn-remove').addEventListener(\"click\", removeProduct);\n\n //On vide le formulaire de création de produit\n name.value = \"\";\n unitPrice.value = 0;\n \n}", "title": "" }, { "docid": "a51243791bc14368d227d370ff6d18d0", "score": "0.5533733", "text": "function createGoodsTable(cb){\n\t\tvar sql = \"CREATE TABLE GOODS( \\\n\t\t\t id \t\t\tINTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, \\\n\t\t\t name \t\tVARCHAR(50) NOT NULL, \\\n\t\t\t bcode \t\tINT NOT NULL, \\\n\t\t\t specifi\t\tVARCHAR(10), \\\n\t\t\t unit\t\t\tVARCHAR(10), \\\n\t\t\t price \t\tINT, \\\n\t\t\t other_price \tINT, \\\n\t\t\t cost INT \\\n\t\t\t)\";\n\n\t\t// db.run(sql);\n\t\tisTableExsit(\"GOODS\",function(r){\n\t\t\tif(!r){\n\t\t\t\tconsole.log(\"creating table goods...\");\n\t\t\t\tdb.run(sql,function(){\n\t\t\t\t\tcb && cb();\n\t\t\t\t});\n\t\t\t}else{\n\t\t\t\tcb&&cb();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "906cc7700403ca16bcd24692dd596b7e", "score": "0.55121315", "text": "async dumpProducts() {\n let index = 65; // from A - 65\n const indexMax = 90; // to Z - 90\n for (index; index <= indexMax; index++) {\n const product = await productModel.create({\n name: 'Product ' + String.fromCharCode(index),\n slug: 'product' + String.fromCharCode(index) + index,\n });\n\n await this.createProductVariant(product);\n }\n }", "title": "" }, { "docid": "d692c62b0081a88b75a8fb1165e87946", "score": "0.5510124", "text": "function dbSetup(tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS cm_table (CMID1 text, CMID2 text, CMID3 text, CMID4 text)');\n}", "title": "" }, { "docid": "423eb6b9d0b6dc3bd8af3fb4ae0220c5", "score": "0.55053055", "text": "function addProduct() {\n\n // prompts manager for product information to add to database\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Enter the Product Name:\",\n name: \"product_name\"\n }, {\n type: \"input\",\n message: \"Enter the Product Department:\",\n name: \"department_name\"\n }, {\n type: \"input\",\n message: \"Enter the Product Price:\",\n name: \"price\"\n }, {\n type: \"input\",\n message: \"Enter the Product Quantity:\",\n name: \"stock_quantity\"\n }, {\n \ttype: \"input\",\n message: \"Enter 0 for Product sales:\",\n name: \"product_sales\"\n }\n ]).then(function(managerInput) {\n\n // Inserts new product\n connection.query('INSERT INTO products SET ?', {\n product_name: managerInput.product_name,\n department_name: managerInput.department_name,\n price: parseFloat(managerInput.price).toFixed(2),\n stock_quantity: parseInt(managerInput.stock_quantity),\n product_sales: parseInt(managerInput.product_sales)\n }, function(err, res) {\n if(err) throw err;\n console.log('');\n console.log('Product ' + managerInput.product_name + ' added.');\n console.log('');\n });\n dispSaleItems();\n });\n \n }", "title": "" }, { "docid": "1ebaf72d0d2d42f9e06ac641fdbd2f03", "score": "0.5504021", "text": "function newProductAll() { \n var productarr = [];\n for(var j = 0; j < namearr.length; j++){\n console.log(j);\n let productData = {\n id: j+1,\n name: namearr[j],\n shortname: shortnamearr[j],\n format: formarr[j],\n unit: unitarr[j],\n factory: factoryarr[j],\n price: pricearr[j]\n };\n let name = productData.name || '';\n console.log('new product function called');\n // console.log(restaurantData);\n if (name == '') {\n throw new Error('产品名称为空');\n }\n let id = productData.id || '';\n let shortname = productData.shortname || '';\n let format = productData.format || '';\n let unit = productData.unit || '';\n let factory = productData.factory || '';\n let price = productData.price || '';\n\n let product = new AV.Object('ProductList');\n\n product.set('fullname', name);\n product.set('id', id);\n product.set('shortname',shortname);\n product.set('format',format);\n product.set('unit',unit);\n product.set('factory',factory);\n product.set('price',price);\n // product.save();\n productarr.push(product);\n }\n AV.Object.saveAll(productarr);\n}", "title": "" }, { "docid": "81a8fabbf47f09803e4e9a33f005a504", "score": "0.54953355", "text": "function crearDB(){\t\t\t\t\t\t\n\t\t\t\n\t\t\t// Seleccionamos Base de Datos\n\t\t\tdb = openDatabase('vendty', '1.0', 'vendty', 50 * 1024 * 1024);\n\t\t\t// Si hay un error\n\t\t\tdb.onError = function(tx, e) { alert(\"Ha habido un error en la creacion de la base de datos: \" + e.message); return false; }\t\t\n\n\t\t\t\n\t\t\t// Creamos tablas si no existen\n\t\t\tdb.transaction(function (tx) {\n\t\t\t\t\n\t\t\t //tx.executeSql('CREATE TABLE IF NOT EXISTS ventas (id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, obj TEXT)');\n\t\t\t tx.executeSql('CREATE TABLE IF NOT EXISTS producto( id INTEGER PRIMARY KEY AUTOINCREMENT,categoria_id INT,codigo TEXT,nombre TEXT,codigo_barra TEXT,precio_compra REAL,precio_venta REAL,stock_minimo INT,descripcion TEXT,activo INT,impuesto REAL,fecha DATE,imagen TEXT,material INT,ingredientes INT,combo INT,unidad_id INT,stock_maximo INT,fecha_vencimiento TEXT,ubicacion TEXT,ganancia INT,muestraexist INT,tienda INT) ');\n\t\t\t tx.executeSql('CREATE TABLE IF NOT EXISTS clientes (id_cliente INTEGER PRIMARY KEY AUTOINCREMENT,pais TEXT,provincia TEXT,nombre_comercial TEXT,razon_social TEXT,tipo_identificacion TEXT,nif_cif TEXT,contacto TEXT,pagina_web TEXT,email TEXT,poblacion TEXT,direccion TEXT,cp TEXT,telefono TEXT,movil TEXT,fax TEXT,tipo_empresa TEXT,entidad_bancaria TEXT,numero_cuenta TEXT,observaciones TEXT,grupo_clientes_id INT) ');\t\t\t \n\t\t\t \n\t\t\t});\n\t\t\t\n\t\t}", "title": "" }, { "docid": "03289c8ff1bb1d38efd1a4db22c9bc05", "score": "0.54950833", "text": "function createProductsObjects() {\n let productsList = getFromLocalStorage() || [];\n if(productsList.length > 0){\n for(let i in productsList){\n new Product(productsList[i].name, productsList[i].price, productsList[i].category, productsList[i].quantity);\n }\n }\n}", "title": "" }, { "docid": "44ca295d9f77330a094e687ab5fad371", "score": "0.54946214", "text": "function displayProducts() {\n var table = new Table({\n head: [\"Item Id\", \"Product Name\", \"Price\"]\n });\n var query = connection.query(\"SELECT * FROM products\", function(err, res){\n if (err) throw err;\n res.forEach(function(res) {\n table.push(\n [res.item_id, res.product_name, res.price]\n );\n });\n console.log(table.toString());\n purchaseProduct();\n });\n}", "title": "" }, { "docid": "0d3b5209f831a354420f1f67e534bc2f", "score": "0.5491755", "text": "function createDBVersionTable()\n{\n var db = getDatabase();\n db.transaction(\n function(tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS dbversion' +\n '(dbversionvalue REAL)');\n }\n );\n}", "title": "" }, { "docid": "f68b71499727c5ea592f90c54d5c204d", "score": "0.54911655", "text": "addProduct() {\n event.preventDefault()\n let type = document.querySelector('select[name=\"productType\"]').value\n let value = Number(document.querySelector('input[name=\"value\"]').value / 100)\n let name = document.querySelector('input[name=\"name\"]').value\n let quantity = document.querySelector('input[name=\"quantity\"]').value\n\n let product = new Product(type, value, name, quantity)\n this.addOnTable(product)\n this.cleanForm()\n }", "title": "" }, { "docid": "d7621fd21933b4819a5a799dac5dd548", "score": "0.54763484", "text": "function fillTableProducts(product) {\n //Create the row\n let row = `\n <tr>\n <td>${product.id}</td>\n <td>${product.name}</td>\n <td>\n <button class=\"btn btn-success btn-sm\"\n data-name=\"${product.name}\"\n data-price=\"${product.price}\"\n data-id=\"${product.id}\"\n data-left=\"${product.left}\"\n >\n <i class=\"fas fa-plus\"></i>\n Menambahkan\n </button>\n </td>\n </tr>\n\t\t`;\n\n productsTable.innerHTML += row;\n}", "title": "" }, { "docid": "6804ff826663f760fa059bdd7e5f66e2", "score": "0.5473646", "text": "function newProduct() {\n // prompt for info about the item being put up for auction\n inquirer.prompt([\n {\n name: \"newItem\",\n type: \"input\",\n message: \"What new product would you like to add?\"\n },\n {\n name: \"newDepartment\",\n type: \"input\",\n message: \"What department does this fall under?\"\n },\n {\n name: \"newPrice\",\n type: \"input\",\n message: \"What is the price of this item?\",\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n },\n {\n name: \"newQuantity\",\n type: \"input\",\n message: \"How many would you like to add?\",\n validate: function(value) {\n if (isNaN(value) === false) {\n return true;\n }\n return false;\n }\n }\n ])\n .then(function(answer) {\n // Insert new info into products table\n connection.query(\n \"INSERT INTO bamazon_db.products SET ?\",\n {\n product_name: answer.newItem,\n department_name: answer.newDepartment,\n price: answer.newPrice,\n quantity: answer.newQuantity\n },\n function(err) {\n if (err) throw err;\n console.log(\"\\n\" + answer.newItem + \" were successfully added to the store.\\n\");\n start();\n }\n );\n });\n}", "title": "" }, { "docid": "4c27467a9213645399c7e70e4d67e5b5", "score": "0.5471754", "text": "function addNewProduct() {\n inquirer.prompt([\n {\n name: 'name',\n type: 'input',\n message: 'Enter the product name:'\n },\n {\n name: 'dept',\n type: 'input',\n message: 'Enter the product department:'\n },\n {\n name: 'price',\n type: 'input',\n message: 'Enter the product price:',\n validate: (value) => {\n if (!isNaN(value) && value > 0) {\n return true;\n } else {\n console.log(chalk.red(` => Oops, please enter a number greater than 0`));\n return false;\n }\n }\n },\n {\n name: 'quantity',\n type: 'input',\n message: 'Enter the number of items in stock:',\n validate: (value) => {\n if (!isNaN(value) && value > 0) {\n return true;\n } else {\n console.log(chalk.red(` => Oops, please enter a number greater than 0`));\n return false;\n }\n }\n }\n ]).then((answers) => {\n db.query('INSERT INTO products SET ?', {\n product_name: answers.name,\n department_name: answers.dept,\n price: answers.price,\n stock_quantity: answers.quantity\n })\n initPrompt();\n })\n}", "title": "" }, { "docid": "6f2269450370f6871f4d13895fb79011", "score": "0.54701036", "text": "function add_product() {\n // manager must fill in the name, department, price, and stock of the new item\n inquirer.prompt([{\n type: 'input',\n name: \"inputName\",\n message: \"Enter the name of the new product.\",\n },\n {\n type: \"input\",\n name: \"inputDepartment\",\n message: \"Which department does this product belong in?\",\n },\n {\n type: \"input\",\n name: \"inputPrice\",\n message: \"Set the price of this item.\", \n },\n {\n type: \"input\",\n name: \"inputStock\",\n message: \"How many units would you like in-stock?\",\n }]).then(function(new_product) {\n // connect to database and add data from manager\n connection.query(\"INSERT INTO products SET ?\", {\n product_name: new_product.inputName,\n department_name: new_product.inputDepartment,\n price: new_product.inputPrice,\n stock_quantity: new_product.inputStock\n }, function(err, res) {\n if (err) throw err;\n });\n console.log(\"Product added!\");\n startPrompt();\n });\n}", "title": "" }, { "docid": "0deb32f9fd021087109c91d4c0f92b0b", "score": "0.54682785", "text": "function crearProducto(req, res) {\n let body = req.body;\n let productoEmpresa = new ProductoEmpresa({\n nombreProducto: body.nombreProducto,\n nombreProveedor: body.nombreProveedor,\n stock: body.stock\n });\n\n productoEmpresa.save((err, productoCreado) => {\n if (err) {\n return res.status(500).send({ ok: false, message: 'Hubo un error en la petición.' });\n }\n\n if (!productoCreado) {\n return res.status(500).send({ ok: false, message: 'Error al crear el producto.' });\n }\n\n return res.status(200).send({ ok: true, productoCreado });\n });\n}", "title": "" }, { "docid": "bc2b3222d19f8b1ab8bb8b475ec971ee", "score": "0.5466521", "text": "function addProduct(){\r\n inquirer.\r\n prompt([\r\n {\r\n name: \"itemID\",\r\n type: \"input\",\r\n message: \"What is the itemID?\"\r\n },\r\n {\r\n name: \"productName\",\r\n type: \"input\",\r\n message: \"What is the product name?\"\r\n },\r\n {\r\n name: \"deptName\",\r\n type: \"input\",\r\n message: \"What department does it belong in?\"\r\n },\r\n {\r\n name: \"price\",\r\n type: \"input\",\r\n message: \"What is the cost per item?\"\r\n },\r\n {\r\n name: \"units\",\r\n type: \"input\",\r\n message: \"How many units do you have?\"\r\n },\r\n ]).then(function(answer){\r\n var query = connection.query(\"INSERT INTO products SET ?\", [\r\n {\r\n item_id: answer.itemID, product_name: answer.productName, department_name: answer.deptName, price: answer.price, stock_quantity: answer.units \r\n \r\n }], function(err, res){\r\n console.log(\"Success! You have added the following products: \" + \"\\n\" + answer.itemID + \"\\n\" + answer.productName + \"\\n\" + answer.deptName + \"\\n\" + answer.price + \"\\n\" + answer.units);\r\n });\r\n });\r\n}", "title": "" }, { "docid": "82ab986f77dc768073dbc2f1fc402065", "score": "0.54660594", "text": "function createNewProduct(provider,photo, header, description,large_description,category,stars, price){\r\n //add a new\r\n let newProductKey = databaseRef.ref().child('products').push().key;\r\n\r\n let productData = {\r\n provider:provider,\r\n photo:photo,\r\n title:header,\r\n decription:description,\r\n large_description: large_description,\r\n category:category,\r\n stars:stars,\r\n price:price\r\n }\r\n /*databaseRef.ref('products').push().set({\r\n provider:provider,\r\n photo:photo,\r\n title:header,\r\n decription:description,\r\n large_description: large_description,\r\n category:category,\r\n stars:stars,\r\n price:price\r\n });*/\r\n\r\n let updates = {}\r\n updates['/products/' + newProductKey] = productData;\r\n updates['/comments/' + newProductKey] = {};\r\n\r\n databaseRef.ref().update(updates);\r\n}", "title": "" } ]
e41d5789d7f345099bc64e628f784016
Change URL hash without page jump Author: Lea Verou, 2011
[ { "docid": "82386af1a54a33f0772702ef6902b31f", "score": "0.7144967", "text": "function controlUrl(hash) {\n if (history.pushState) {\n history.pushState(null, null, hash);\n } else {\n location.hash = hash;\n }\n }", "title": "" } ]
[ { "docid": "88a8e8539ae54066e538198ef17f114b", "score": "0.7893682", "text": "function hash() {\n\t\t/*\n\t\tvar location, url, match, hash, queryHash;\n\t\tlocation = window.location;\n\t\turl = location.href;\n\t\tmatch = PATH_MATCH.exec(url);\n\t\thash = match[5] || '';\n\t\treturn hash;\n\t\t*/\n\t}", "title": "" }, { "docid": "317ccf5e4d4e37e35cb155f800be7033", "score": "0.77296853", "text": "function updateHash() {\n window.location.hash = tree.selectedItem.bookmarkId;\n}", "title": "" }, { "docid": "2d675c484efc0c943fae82473ee91026", "score": "0.762018", "text": "function setHash() {\n\twindow.hash_og = window.location.hash;\n\twindow.hash = parseInt(hash_og.match(/#(.*)\\-/).pop());\n\twindow.hash_two = parseInt(hash_og.match(/-(.*)/).pop());\n}", "title": "" }, { "docid": "860fe2fc0ad5dd9585f37d149d45f399", "score": "0.7575851", "text": "updateHash ( slug ) {\n window.location.hash = slug;\n }", "title": "" }, { "docid": "ec2d0ecc3bfe6f386ff8b2cfa6c749e0", "score": "0.75626403", "text": "function setUrlHash (index, hash) {\n /*\n * Known problem:\n * Setting hash leads to reload in webkit:\n * http://www.quirksmode.org/bugreports/archives/2005/05/Safari_13_visual_anomaly_with_windowlocationhref.html\n *\n * so we expect that users are not running an ancient Safari version\n */\n\n userChange = false;\n if (ready) {\n window.location.hash = 'PMAURL-' + index + ':' + hash;\n resetFavicon();\n } else {\n savedHash = 'PMAURL-' + index + ':' + hash;\n }\n }", "title": "" }, { "docid": "a95f321d90ae76b0ff1eaadc9071d7b7", "score": "0.7514542", "text": "function changeHashOnLoad() {\n\twindow.location.href += \"#\";\n\tsetTimeout(\"changeHashAgain()\", \"50\");\n}", "title": "" }, { "docid": "7b252d7ecad49136fccd127af006a105", "score": "0.7494474", "text": "function setHash(h) {\n // Prevent scroll to top when resetting hash.\n const scroll = document.body.scrollTop;\n window.location.hash = h;\n document.body.scrollTop = scroll;\n }", "title": "" }, { "docid": "23e0fb216f37c4de7e6fa3179e298162", "score": "0.7477665", "text": "_setHash(hash) {\n location.hash = encodeURIComponent(hash)\n .replace(/\\(/g, '%28')\n .replace(/\\)/g, '%29');\n }", "title": "" }, { "docid": "0c064b8cff6e110a8e4e21e3c263c219", "score": "0.74682015", "text": "function setHash(h) {\n // Prevent scroll to top when resetting hash.\n const scroll = document.body.scrollTop;\n window.location.hash = h;\n document.body.scrollTop = scroll;\n }", "title": "" }, { "docid": "a26ce34b37af883c2d6aa4b258d3521a", "score": "0.73761374", "text": "function changeURL(textBoxString) {\n // set url hash\n window.location.hash = textBoxString; \n}", "title": "" }, { "docid": "f68d0a24894c08a91c209b22df7d55b7", "score": "0.73515856", "text": "function setHash() {\n if(!window.location.hash) {\n history.pushState(null, null, '#0');\n }\n }", "title": "" }, { "docid": "57f32987f0a249764c3ffad3d8e647a2", "score": "0.7338201", "text": "hash (hash) {\n\t\tlet path = trimEnd(window.location.pathname, '/');\n\t\t\n\t\treturn path + hash;\n\t}", "title": "" }, { "docid": "d207e43bc2f7ee8f23e154096bcf6719", "score": "0.7331421", "text": "updateHash() {\n window.location.hash = window.encodeURIComponent(\n this.searchField.value\n );\n }", "title": "" }, { "docid": "a098759db08897a6835f20eb21858ad1", "score": "0.7329555", "text": "function getHash(url){var index=url.indexOf('#');return index===-1?'':url.substr(index);}", "title": "" }, { "docid": "c94386cc81c73b1b3999fd106628d416", "score": "0.7320437", "text": "function setUrlHash(url){\n\n if(options.recordHistory){\n\n location.hash = url;\n\n }else{\n\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\n\n if(isTouchDevice || isTouch){\n\n window.history.replaceState(undefined, undefined, '#' + url);\n\n }else{\n\n var baseUrl = window.location.href.split('#')[0];\n\n window.location.replace( baseUrl + '#' + url );\n\n }\n\n }\n\n }", "title": "" }, { "docid": "9c43aafe2c9f54a482c16a006b792742", "score": "0.7289499", "text": "function set_hash(value, nr) {\n if(value == undefined) { value = \"\"; }\n if(value == \"undefined\") { value = \"\"; }\n if(nr != undefined) {\n var current = get_hash();\n if(current == undefined) {\n current = \"\";\n }\n var tmp = current.split('|');\n tmp[nr-1] = value;\n value = tmp.join('|');\n }\n // make emtpy values nicer, trim trailing pipes\n value = value.replace(/\\|$/, '');\n\n // replace history otherwise we have to press back twice\n if(value != \"\") { value = '#'+value; }\n if (history.replaceState) {\n history.replaceState({}, \"\", value);\n } else {\n window.location.replace(value);\n }\n if(window.parent) {\n try {\n save_url_in_parents_hash();\n } catch(err) { debug(err); }\n }\n}", "title": "" }, { "docid": "0308bd6f2b27a8c86f4ef6530a9e47ed", "score": "0.72892106", "text": "function setUrlHash(url){\n if(options.recordHistory){\n location.hash = url;\n }else{\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\n if(isTouchDevice || isTouch){\n window.history.replaceState(undefined, undefined, '#' + url);\n }else{\n var baseUrl = window.location.href.split('#')[0];\n window.location.replace( baseUrl + '#' + url );\n }\n }\n }", "title": "" }, { "docid": "0308bd6f2b27a8c86f4ef6530a9e47ed", "score": "0.72892106", "text": "function setUrlHash(url){\n if(options.recordHistory){\n location.hash = url;\n }else{\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\n if(isTouchDevice || isTouch){\n window.history.replaceState(undefined, undefined, '#' + url);\n }else{\n var baseUrl = window.location.href.split('#')[0];\n window.location.replace( baseUrl + '#' + url );\n }\n }\n }", "title": "" }, { "docid": "0308bd6f2b27a8c86f4ef6530a9e47ed", "score": "0.72892106", "text": "function setUrlHash(url){\n if(options.recordHistory){\n location.hash = url;\n }else{\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\n if(isTouchDevice || isTouch){\n window.history.replaceState(undefined, undefined, '#' + url);\n }else{\n var baseUrl = window.location.href.split('#')[0];\n window.location.replace( baseUrl + '#' + url );\n }\n }\n }", "title": "" }, { "docid": "0308bd6f2b27a8c86f4ef6530a9e47ed", "score": "0.72892106", "text": "function setUrlHash(url){\n if(options.recordHistory){\n location.hash = url;\n }else{\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\n if(isTouchDevice || isTouch){\n window.history.replaceState(undefined, undefined, '#' + url);\n }else{\n var baseUrl = window.location.href.split('#')[0];\n window.location.replace( baseUrl + '#' + url );\n }\n }\n }", "title": "" }, { "docid": "0308bd6f2b27a8c86f4ef6530a9e47ed", "score": "0.72892106", "text": "function setUrlHash(url){\n if(options.recordHistory){\n location.hash = url;\n }else{\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\n if(isTouchDevice || isTouch){\n window.history.replaceState(undefined, undefined, '#' + url);\n }else{\n var baseUrl = window.location.href.split('#')[0];\n window.location.replace( baseUrl + '#' + url );\n }\n }\n }", "title": "" }, { "docid": "f803d9f7a55eea97384bc5aefa156c31", "score": "0.72887695", "text": "function hash() {\n return loc.hash.replace(/^#/, '')\n }", "title": "" }, { "docid": "a6d16f8c8cfa86aabe1a3bc96d8f074c", "score": "0.72876984", "text": "function setUrlHash(url){\r\n if(options.recordHistory){\r\n location.hash = url;\r\n }else{\r\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\r\n if(isTouchDevice || isTouch){\r\n window.history.replaceState(undefined, undefined, '#' + url);\r\n }else{\r\n var baseUrl = window.location.href.split('#')[0];\r\n window.location.replace( baseUrl + '#' + url );\r\n }\r\n }\r\n }", "title": "" }, { "docid": "a6d16f8c8cfa86aabe1a3bc96d8f074c", "score": "0.72876984", "text": "function setUrlHash(url){\r\n if(options.recordHistory){\r\n location.hash = url;\r\n }else{\r\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\r\n if(isTouchDevice || isTouch){\r\n window.history.replaceState(undefined, undefined, '#' + url);\r\n }else{\r\n var baseUrl = window.location.href.split('#')[0];\r\n window.location.replace( baseUrl + '#' + url );\r\n }\r\n }\r\n }", "title": "" }, { "docid": "1dc343bdd74449f45da46d9e895b4bee", "score": "0.7257883", "text": "function setURL(website_url) {\n\tdocument.location.hash = website_url;\n}", "title": "" }, { "docid": "b1fff7837d573eebf1409a45e4ddc1e1", "score": "0.72553414", "text": "function setUrlHash(url) {\n\t\t\tif (options.recordHistory) {\n\t\t\t\tlocation.hash = url;\n\t\t\t} else {\n\t\t\t\t//Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\n\t\t\t\tif (isTouchDevice || isTouch) {\n\t\t\t\t\thistory.replaceState(undefined, undefined, '#' + url);\n\t\t\t\t} else {\n\t\t\t\t\tvar baseUrl = window.location.href.split('#')[0];\n\t\t\t\t\twindow.location.replace(baseUrl + '#' + url);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "f3d3fc11405c54b90f5797dd072a0996", "score": "0.7236875", "text": "function hash() {\n var enc = encodeba(\n qa('section[data-sectionid] li[data-nodeid]'),\n function(elem) { return elem.classList.contains('selected'); },\n function(elem) { return Number(elem.dataset.nodeid); }\n );\n if (qa('section[data-sectionid].minimize').length) {\n enc += '|' + encodeba(\n qa('section[data-sectionid]'),\n function(elem) { return elem.classList.contains('minimize'); },\n function(elem) { return Number(elem.dataset.sectionid); }\n );\n }\n\n history.replaceState(undefined, undefined, '#' + encodeURI(enc));\n }", "title": "" }, { "docid": "9a045ad381d98b2b7949b61e76afcf95", "score": "0.72318", "text": "function setHash(newhash, trigger) {\n if (!trigger && (location.hash.replace(/^#/, '') != newhash)) {\n ignoreHashChange = true;\n }\n location.hash = newhash;\n }", "title": "" }, { "docid": "b4e178498e3feaaa882c1136bb85c335", "score": "0.7209181", "text": "function setUrlHash(url){\n if(options.recordHistory){\n location.hash = url;\n }else{\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\n if(isTouchDevice || isTouch){\n history.replaceState(undefined, undefined, '#' + url);\n }else{\n var baseUrl = window.location.href.split('#')[0];\n window.location.replace( baseUrl + '#' + url );\n }\n }\n }", "title": "" }, { "docid": "f00490367c2de7e3d301f6f06d659e73", "score": "0.7208911", "text": "function setUrlHash(url){\r\n if(options.recordHistory){\r\n location.hash = url;\r\n }else{\r\n //Mobile Chrome doesn't work the normal way, so... lets use HTML5 for phones :)\r\n if(isTouchDevice || isTouch){\r\n history.replaceState(undefined, undefined, '#' + url);\r\n }else{\r\n var baseUrl = window.location.href.split('#')[0];\r\n window.location.replace( baseUrl + '#' + url );\r\n }\r\n }\r\n }", "title": "" }, { "docid": "8a826a9ebc3fe348b91093e108639434", "score": "0.71782774", "text": "function urlHash(){\n if(window.location.hash) {\n var hash = window.location.hash.substring(1); //Puts hash in variable, and removes the # character\n if (hash.includes('http')){\n return hash;\n } else{\n return 'http://'+hash;\n }\n // hash found\n } else {\n // No hash found\n return 'https://bionicteaching.com';\n }\n}", "title": "" }, { "docid": "baf6fda608e4c6a7b94a48ee1f2e6d7e", "score": "0.7170832", "text": "function updateHash() {\n var hash = '';\n\n openFrames.forEach(function(f) {\n hash += encodeURIComponent(JSON.stringify(f.state()));\n hash += '&';\n });\n\n window.location.hash = hash;\n }", "title": "" }, { "docid": "466a601f5e8e6320d50791c4e9db3131", "score": "0.7138507", "text": "function set_hash(key, value) {\n var hash = get_hash();\n hash[key] = value\n var hashArray = new Array();\n for (var i in hash) {\n hashArray.push(i + '=' + hash[i])\n }\n window.location.hash = hashArray.join('&');\n }", "title": "" }, { "docid": "9f2fbdea34dbeced8b147e07e9becbaf", "score": "0.7108401", "text": "function hashChanged() {\n var loc = window.location.hash;\n\n toggleLogo(loc); // Check the logo visibility\n toggleGlyphControls(loc); // Check weblab control visibility\n\n var sectionUpdate = String(loc).slice(1);\n\n // Affect pagination on navigation change\n paginationUpdate(sectionUpdate);\n}", "title": "" }, { "docid": "530eb31b3c47e403a0b5fb68f4de6b16", "score": "0.7059794", "text": "function getHash(url) {\n\t var index = url.indexOf('#');\n\t return index === -1 ? '' : url.substr(index);\n\t}", "title": "" }, { "docid": "fa74ca3d16a3be75b8d2ec5fb8b7ed20", "score": "0.7049514", "text": "function buildHash() {\n\tlocation.hash = $.drum.serialize();\n}", "title": "" }, { "docid": "af75200f929ee6dee79505a9b1843d3c", "score": "0.7048588", "text": "function handleHash() {\n if (window.location.hash === \"\") {\n setHash('');\n } else if ((window.innerHeight + window.pageYOffset) >= document.body.offsetHeight) {\n setHash('contact');\n } else {\n setHash(window.location.hash.slice(1));\n }\n }", "title": "" }, { "docid": "506eccca6f21a9a571274724e2fe26eb", "score": "0.7038728", "text": "function removeHash() {\n\thistory.pushState(\"\", document.title, window.location.pathname + window.location.search);\n}", "title": "" }, { "docid": "9ca5be86dcfd4edac1fb0e6ea1fe49b4", "score": "0.7031727", "text": "function getHash( url ) {\r\n var hashPos = url.lastIndexOf( '#' );\r\n return url.substring( hashPos + 1 );\r\n}", "title": "" }, { "docid": "351ed7456291dce2765334deeb516aab", "score": "0.70275134", "text": "function setHashOnAllLinks(tag, hash) {\n links = tag.getElementsByTagName(\"a\");\n for (var i = 0; i < links.length; i++) {\n var a = links[i];\n var href = a.href;\n var hashpos = href.indexOf(\"#\");\n if (hashpos != -1) {\n href = href.substring(0, hashpos);\n }\n a.href = href + \"#\" + hash;\n }\n }", "title": "" }, { "docid": "c31b3f43ae1991f24d528eda16a36cbd", "score": "0.7012045", "text": "function removeHash() {\n\thistory.replaceState(\"\", document.title, window.location.pathname + window.location.search);\n}", "title": "" }, { "docid": "d4339bbc2f0ed705bb5ed63eb09abe18", "score": "0.7011404", "text": "static changeHash() {\n // TODO\n // let hash = RouterElement._getHash();\n // RouterElement.dispatch(_changeHash(hash));\n }", "title": "" }, { "docid": "52346a2f732e587229f7a235009c4f06", "score": "0.70001227", "text": "function URLChange()\n\t\t\t{\n\t\t\t\ti = filterUrlHash(location.hash.substr(1));\n\t\t\t\tif (init) animate(i,falsev,falsev,falsev);\n\t\t\t\telse if (i != t) goToSlide(i, falsev);\n\t\t\t}", "title": "" }, { "docid": "addb1dea6f1ff1a079e2eb7cf8fbf3b8", "score": "0.69912356", "text": "function setHashParam(key, val) {\n\tvar hashString = '#!';\n\tvar params = getHashParams();\n\tparams[key] = val;\n\tfor (key in params) {\n\t\thashString += '/' + key + '/' + params[key];\n\t}\n\thistory.replaceState(null, null, hashString);\n}", "title": "" }, { "docid": "e75346242495af621d224f223d6d1e5c", "score": "0.69710225", "text": "function setHash(hash) {\n window.document.location.hash = hash;\n ids = window.linkelementids;\n for (var i = 0; i < ids.length; i++) {\n setHashOnAllLinks(document.getElementById(ids[i]), hash);\n }\n }", "title": "" }, { "docid": "edec0cb8f8ce0779209b8374f7b5e83b", "score": "0.69678205", "text": "function wpseoSetTabHash() {\n\t\tvar conf = jQuery( \"#wpseo-conf\" );\n\t\tif ( conf.length ) {\n\t\t\tvar currentUrl = conf.attr( \"action\" ).split( \"#\" )[ 0 ];\n\t\t\tconf.attr( \"action\", currentUrl + window.location.hash );\n\t\t}\n\t}", "title": "" }, { "docid": "76a9dba77657e3dddf7362ca5300937f", "score": "0.69405484", "text": "function follow(hash) {\n location.hash = hash;\n }", "title": "" }, { "docid": "6ade2fbbc924c62992682310c1174afe", "score": "0.69282734", "text": "function realUrl() \\{\\par\r\n return /^#!\\\\/.*/.test(window.location.hash) ? \\par\r\n 'http://'+window.location.host+window.location.hash.split('#!')[1] : \\par\r\n window.location.href;\\par\r\n\\}", "title": "" }, { "docid": "4901b178c914a9021f7f64fb20f78856", "score": "0.69158447", "text": "function updateHash (uri, replace, location) {\n var href;\n if (uri === void 0) return;\n location = location || loc;\n if (!replace) {\n location.hash = uri;\n return;\n }\n location.replace(location.href.replace(wholeHash, '') + uri);\n}", "title": "" }, { "docid": "088dce35110635c32cecd1ef6346e327", "score": "0.68460697", "text": "function setHash(hash) {\n re = /\\#/g;\n hash = '#' + hash.replace(re, '$hash$');\n \n // DARQUE: Moving to a local storage + id based system.\n // location.replace(location.origin + location.pathname + hash);\n \n // now that its set, parse it into params\n params = parseHash(hash);\n \n // and update the UI to reflect it\n updateUI();\n}", "title": "" }, { "docid": "9d9d7fc7a3e692e0998fc0a520d0cd8b", "score": "0.6845687", "text": "function get_hash(nr) {\n var hash;\n if(window.location.hash != '#') {\n var values = window.location.hash.split(\"/\");\n if(values[0]) {\n hash = values[0].replace(/^#/, '');\n }\n }\n if(nr != undefined) {\n if(hash == undefined) {\n hash = \"\";\n }\n var tmp = hash.split('|');\n return(tmp[nr-1]);\n }\n return(hash);\n}", "title": "" }, { "docid": "dbd5c53d75027669afb18c15de9871e5", "score": "0.6842074", "text": "function updateLocationHash() {\n var date = getSelectedDate();\n var day = date.getDate();\n var month = date.getMonth() + 1; // JS is stupid and starts months at 0\n var year = date.getFullYear();\n var hash = year + \"-\" + month + \"-\" + day\n window.location.hash = hash;\n}", "title": "" }, { "docid": "e15df18175d27d945d39fe406762e0db", "score": "0.683754", "text": "function checkURL(hash)\n{\n\n\tif(!hash) hash=window.location.hash;\t//if no parameter is provided, use the hash value from the current address\n\tif(hash != lasturl)\t// if the hash value has changed\n\t{\n\t\tlasturl=hash;\t//update the current hash\n\t\tloadPage(hash);\t// and load the new page\n\t}\n}", "title": "" }, { "docid": "942b6bb51dbc85eefd418c6c78f8243f", "score": "0.6823539", "text": "function getHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? '' : url.substr(index);\n}", "title": "" }, { "docid": "dc2adbe0c43f7b75d734960a593310d9", "score": "0.68099594", "text": "function updateHash() {\n\tvar ai = 'ai='+urlencode(window.actualUserInput ? window.actualUserInput : $(\"#awesomeinput\").val());\n\tvar os = '&os='+urlencode($(\"#opensearchinput\").val());\n\tvar sel = '&sel=';\n\tvar ke = '&ke=';\n\tvar options = \"\";\n\tif ($(\"#awesomeinput:focus\").length || window.goingToUrl) {\n\t\tsel += 'ai';\n\t} else if ($(\"#opensearchinput:focus\").length) {\n\t\tsel += 'os';\n\t}\n\tif (getHashVar(\"options\") == 1) {\n\t\toptions = \"&options=1\";\n\t}\n\tif (window.keywordEngine) {\n\t\tke += window.keywordEngine.keyword;\n\t}\n\tvar hash = '#'+ai+os+sel+ke+options;\n\tif (hash != window.location.hash) {\n\t\twindow.location.hash = hash;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "865041b9c2e2457ea4c8e4dbe82d4604", "score": "0.68017817", "text": "function getHash() {\n return window.location.hash.replace(/^#/,'');\n}", "title": "" }, { "docid": "fb2df6185cf68bcf22fca2341daef7e3", "score": "0.6755597", "text": "function fixHashLinks() {\n var links = $(\"a[href^='#']\"); // all links that start with a \"#\" symbol (relative anchor links)\n links.attr(\"href\", function (i, curr) { return location.pathname + curr; }); // put the current path in front of the URL to make it absolute\n}", "title": "" }, { "docid": "7f93d79fa7d27e09022cec6dc76b26c7", "score": "0.67369133", "text": "function changeHash(id) {\n try {\n history.replaceState(null, null, '?id=' + id);\n }\n catch (e) {\n location.hash = '#id_' + id;\n }\n\n }", "title": "" }, { "docid": "4a56e0111a91f7759931ea326d4ef628", "score": "0.6720573", "text": "setHash() {\n window.ignoreHashChange = true;\n let decoded = base32.decode(this.flagsEl.value)\n let retain = base32.decode(localStorage.retainFlags);\n for (let i=0; i < decoded.length; i++) {\n decoded[i] &= ~retain[i];\n }\n let flags = base32.encode(decoded);\n location.hash = ('flags=' + flags + '&seed=' + this.seedEl.value);\n window.ignoreHashChange = false;\n }", "title": "" }, { "docid": "6d96441829d981cc647ec395d8cff157", "score": "0.6698931", "text": "addHandlerInitHash() {\n window.addEventListener(\"load\", function () {\n if (!window.location.href.includes(\"#\")) return;\n const baseUrl = window.location.href.split(\"#\")[0];\n window.location.replace(baseUrl);\n });\n }", "title": "" }, { "docid": "4e18f781f5310273e8cd3a9222d9f85d", "score": "0.66826403", "text": "function onHashChange () {\n\t\tif ( location.hash ) {\n\t\t\tvar hash = location.hash.replace( '#', '' ).replace( ',', ' ' );\n\t\t\tdocument.body.className = hash;\n\t\t\t_gaq && _gaq.push(['_trackEvent', 'Hash', hash]);\n\t\t}\n\t}", "title": "" }, { "docid": "33b5c8f789368f5f05bdbe71616b6b34", "score": "0.6681923", "text": "function cleanHash() {\n if (window.location.hash == '#_=_') {\n // Check if the browser supports history.replaceState.\n if (history.replaceState) {\n // Keep the exact URL up to the hash.\n var cleanHref = window.location.href.split('#')[0];\n // Replace the URL in the address bar without messing with the back button.\n history.replaceState(null, null, cleanHref);\n } else {\n // Well, you're on an old browser, we can get rid of the _=_ but not the #.\n window.location.hash = '';\n }\n }\n}", "title": "" }, { "docid": "785968564690c25ac876b67b2960d745", "score": "0.66817033", "text": "function _checkHash(){\n if (deeplinker._paused) return;\n var oldhref = deeplinker._href;\n var newhref = deeplinker._window.location.href;\n if(oldhref != newhref){\n deeplinker._href = newhref;\n var route = deeplinker.getRoute(newhref);\n if(route){\n deeplinker.route(route);\n }\n else if (deeplinker._defaultCallback){\n deeplinker._defaultCallback();\n }\n }\n}", "title": "" }, { "docid": "61204e094a4f8186f350954a2c935150", "score": "0.66810876", "text": "function onHashChange(evt)\n\t{\n\t\tvar route = location.hash.substr(hashMarker.length);\n\t\tRefluxRouter.navigateTo(route, true);\n\t}", "title": "" }, { "docid": "f1546937a3f81b8640c4dec60c131d50", "score": "0.668019", "text": "function get_hash_parameter() {\n\tlet hasharr = window.location.href.split(\"#\");\n\tlet hash = \"\";\n\t\n\tif (hasharr.length > 1) hash = hasharr[1];\n\tif (!empty(hash)) hash = \"#\" + hash;\n\t\n\treturn hash;\n}", "title": "" }, { "docid": "a4fa148c0a36a2364f8c153f4a0ea502", "score": "0.66559654", "text": "function updateHistory(hash) {\n clearTimeout(updateHistory.timeout);\n updateHistory.timeout = setTimeout(function() {\n if (window.location.hash !== hash) {\n if (location.hash !== '') {\n history.pushState({}, window.title, hash);\n } else {\n\n // On first page load update the URL in place\n history.replaceState({}, window.title, hash);\n }\n }\n }, 1000);\n}", "title": "" }, { "docid": "5898acd66d35f6420c4769670c78f99a", "score": "0.665188", "text": "static setHash(value, silent = false) {\n if (latte._isString(value) && value.length > 0 && value.charAt(0) == '#')\n value = value.substr(1);\n var change = value != Navigation._hash;\n Navigation._hash = value;\n if (!latte._undef(window.location.hash)) {\n Navigation._lock = true;\n window.location.hash = value;\n Navigation._lock = false;\n }\n /// Create path\n var path = value.split('/');\n if (path.length > 0 && !path[0])\n path.shift();\n Navigation.path = path;\n if (change && !(silent === true))\n Navigation.onHashChanged(value);\n return Navigation;\n }", "title": "" }, { "docid": "5a1e090472f30e37396c14917780f63d", "score": "0.66430163", "text": "function addressChange(){\n\tlocation.hash=playlist[loop];\n}", "title": "" }, { "docid": "62259cf450392758fc1da5e376695f2c", "score": "0.66224855", "text": "function realURL() {\r\n if (window.location.hash.match(/\\.php/)) {\r\n return 'http://'+window.location.host+window.location.hash.split('#')[1];\r\n } else if (window.location.href.indexOf('#') != -1) {\r\n return window.location.hash.split('#')[0];\r\n } else {\r\n return window.location.href;\r\n }\r\n}", "title": "" }, { "docid": "0ec095a67d1b3c4fd4a8fca3858a5abd", "score": "0.6609287", "text": "function handleHash() {\n var hash;\n // there is a hash value\n if ('' !== window.location.hash && '#' !== window.location.hash) {\n hash = window.location.hash.slice(1);\n // the hash value is an integer\n if (/[0-9]+/.test(hash)) {\n // the hash value is also a valid array index\n if (hash > 0 && hash <= scroller.count) {\n // cast as a number and decrement so it's zero-indexed\n --hash;\n scroller.scrollTo(hash);\n }\n }\n }\n // no hash value, so go to a random whatever\n else {\n scroller.next();\n }\n }", "title": "" }, { "docid": "1cc6164ab222abe604e5f08b0b24c1d9", "score": "0.66016597", "text": "function unsetHashParam(key) {\n\tvar current = getHashParam(key);\n\tif (typeof current !== 'undefined')\n\t\thistory.replaceState(null, null, window.location.hash.replace('/' + key + '/' + current, ''));\n}", "title": "" }, { "docid": "d22865e40d8bbf89c46f7f71b3c7d1a2", "score": "0.65975213", "text": "function remove_hash(key) {\n var hash = get_hash();\n var hashArray = new Array();\n for (var i in hash) {\n if (i != key) {\n hashArray.push(i + '=' + hash[i]);\n }\n }\n window.location.hash = hashArray.join('&');\n }", "title": "" }, { "docid": "4d564ed38c391f928571573410ed9e2e", "score": "0.65931255", "text": "function home() {\n location.hash = '';\n }", "title": "" }, { "docid": "a99a826480aa08cdd52884d42decbbcb", "score": "0.6575587", "text": "function removeUrlHash() {\n if (history.replaceState) {\n history.replaceState(null, '', ' ');\n }\n }", "title": "" }, { "docid": "3bcd627a5dda5362c5f6dde2e845bb85", "score": "0.65654147", "text": "function displayhashRoute() {\n var url = window.location.hash;\n document.querySelector('.app-url-container').innerHTML = url;\n }", "title": "" }, { "docid": "212090057691bb4ce7fcf9fb503ba819", "score": "0.65569234", "text": "function onHashChange() {\n var h = window.location.hash.split('#')[1];\n\n if(!h) { navigateToIntro(); }\n else if (h === 'poems') { navigateToIndex(); }\n }", "title": "" }, { "docid": "2b2061f248ace700e373c6a83f67ae9e", "score": "0.65546983", "text": "function getPageFn(){\n\tvar urlHash = window.location.hash;\n\tif(urlHash.substr('#/')){\n\t\turlHash = urlHash.replace('#/','');\n\t\turlHash = urlHash.replace('/','_');\n\t}\n\tif(!urlHash){\n\t\treturn 'main'\n\t}\n\treturn urlHash;\n}", "title": "" }, { "docid": "2baa230faf3be8f487510f5928de8471", "score": "0.6553313", "text": "function getHash() {\n return window.location.hash.slice(1);\n }", "title": "" }, { "docid": "afe9bdd5e06989e937cdc920f37f744d", "score": "0.6540107", "text": "_getActiveHash() {\n return location.hash.replace(/^\\/?#\\//, '').replace(/\\?.+$/, '');\n }", "title": "" }, { "docid": "0155b6b86b175f2152d2ff64af354f55", "score": "0.65381324", "text": "function updateHash(e){\n e.preventDefault();\n var search = document.getElementById(\"searchInput\").value;\n if (search.length>1){\n loading();\n var query = searchEncode(search);\n var obj = {s:query};\n var queryString = getQueryString(obj);\n if(history.pushState){\n history.pushState(null, null, '#'+queryString);\n hashChange();\n } else {\n location.hash = '#'+queryString;\n hashChange();\n }\n }\n }", "title": "" }, { "docid": "0827b878c3042c44337c3ce64f4800e7", "score": "0.6519614", "text": "onHashChange( e ) {\n\t\tconsole.log(\"hashchange: \", e.newURL);\n\t\t\n\t\tvar slugs = this.cleanLocation(window.location).slugs;\n\t\t\n\t\tif ( slugs.join() === this.state.slugs.join() ) {\n\t\t\tthis.setState({});\n\t\t}\n\t\telse {\n\t\t\tthis.setState({ 'id': 0, 'slugs': slugs });\n\t\t}\n\t}", "title": "" }, { "docid": "7bdaff95db44a6e0d9ce2f832e79afb8", "score": "0.6515997", "text": "static set hash(value) {\n Navigation.setHash(value, false);\n }", "title": "" }, { "docid": "ccd883c68d6e78f68e4fcd20fc1837e4", "score": "0.65122205", "text": "function realUrl() {\r\n if (window.location.hash.match(/\\.php/)) {\r\n return 'http://'+window.location.host+window.location.hash.split('#')[1];\r\n } else if (window.location.href.indexOf('#') != -1) {\r\n return window.location.hash.split('#')[0];\r\n } else {\r\n return window.location.href;\r\n }\r\n}", "title": "" }, { "docid": "0e5b1ac83df5eab9b0c1c0d5421d94d0", "score": "0.65027136", "text": "function redirectToHome() {\n location.hash = ''\n}", "title": "" }, { "docid": "29b7f981938fbd77066096e0bd19411a", "score": "0.64950126", "text": "function tabHash(headerHeight){\n var hash = window.location.hash;\n hash && jQuery(\".nav-tabs a[href='\" + hash + \"']\").tab(\"show\");\n\n jQuery(window).load(function(e){\n if(window.location.hash){\n jQuery(this).scrollTop(0);\n }\n });\n jQuery(\".nav-tabs a\").click(function(e){\n jQuery(this).tab(\"show\");\n history.pushState(null, null, this.hash);\n });\n jQuery(\"a\").click(function(e){\n if(jQuery(this).prop(\"hash\")){\n\t\t\tvar hrefLink = jQuery(this).prop(\"href\");\n\t\t\tvar matchLink = hrefLink.match(/(.*)#/);\n\t\t\tvar matchLink2 = String(matchLink).match(/[^/]*$/)[0];\n\t\t\t\n\t\t\tvar currentUrl = window.location.href;\n\t\t\tvar matchUrl = currentUrl.match(/(.*)#/);\n\t\t\tvar matchUrl2 = String(matchUrl).match(/[^/]*$/)[0];\n\t\t\t\n\t\t\tif(matchLink2 == matchUrl2){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar linkHash = jQuery(this).prop(\"hash\");\n\t\t\t\tjQuery(\"body\").find(\"a[href=\" + linkHash + \"]\").tab(\"show\");\n\t\t\t\thistory.pushState(null, null, this.hash);\n\t\t\t}\n }\n });\n}", "title": "" }, { "docid": "907171131405484aa7c8c670818cdf2c", "score": "0.64802", "text": "function stripHash (url) {\n return url.slice(0, url.lastIndexOf('#'));\n }", "title": "" }, { "docid": "2560842dfbdd7edb790933f34d83a4a9", "score": "0.6461966", "text": "function goHashUrl() {\n if (window.location.hash) {\n var hash = window.location.hash.substr(1);\n var args = hash.split(';');\n if (args[0]=='config') {\n /* admin config mode */\n $(\"#admin\").trigger('click');\n currentViewMode = 'config';\n if (args[1]) {\n var modes = {'overview':0, 'site':1, 'db':2, 'rooms':3, 'scheduler':4};\n configTabs.tabs('option', 'active', modes[args[1]]);\n if (args[1]=='rooms' && args[2])\n return cfgRoom(args[2]);\n }\n } else {\n /* user live/log mode */\n $(\"#hosts\").html(msg_LoadingLive);\n if (args[0]=='log') {\n showLive = 0;\n currentViewMode = 'log';\n } else {\n currentViewMode = 'live';\n showLive = 1;\n }\n if (args[2]) {\n var e = args[2].split('-');\n var d = new Date(e[0], e[1]-1, e[2], 12, 0, 0, 0);\n setRoom(args[1],d);\n } else \n setRoom(args[1],0);\n }\n }\n}", "title": "" }, { "docid": "651a090050c05923bf83dfd79ad9dd6b", "score": "0.64601165", "text": "function iFrameHashSync(iFrame){\n\n // Propagate changes from inner page to outer page.\n iFrame.contentWindow.addEventListener('hashchange', function () {\n window.location.hash = iFrame.contentWindow.location.hash;\n });\n }", "title": "" }, { "docid": "a2693db8e3682026dab403612a51d2c4", "score": "0.64578515", "text": "function updateHash(location, fragment, replace) {\n if (replace) {\n var href = location.href.replace(/(javascript:|#).*$/, '');\n location.replace(href + '#' + fragment);\n } else {\n // Some browsers require that `hash` contains a leading #.\n location.hash = '#' + fragment;\n }\n }", "title": "" }, { "docid": "c72cf5759c21941681c5efbfe6ae1918", "score": "0.6451809", "text": "function updateHash(location, fragment, replace) {\n if (replace) {\n var href = location.href.replace(/(javascript:|#).*$/, '');\n\n if (history.history.replaceState) {\n history.history.replaceState({}, document.title, href + '#' + fragment); // using history.replaceState instead of location.replace to work around chrom bug\n } else {\n location.replace(href + '#' + fragment);\n }\n } else {\n // Some browsers require that `hash` contains a leading #.\n location.hash = '#' + fragment;\n }\n }", "title": "" }, { "docid": "2d2f3b0b8570613e4859a94f389db6ed", "score": "0.6446965", "text": "function getHash() {\n return window.location.hash.slice(1);\n }", "title": "" }, { "docid": "dba37af2409fcd64a0500fb54c798c1d", "score": "0.64327735", "text": "updateURL(change) {\n let newURL = this.createNewURL();\n\n //if (change) {\n // document.location.href = newURL;\n // } else {\n window.history.pushState('Jerry Frost', 'Jerry Frost', newURL);\n //}\n //document.location.href = newURL;\n }", "title": "" }, { "docid": "e891d61933972eaa77293523bad598aa", "score": "0.6424604", "text": "function processHash() {\n var hash = location.hash || '#';\n router.run(hash.substr(1));\n }", "title": "" }, { "docid": "71e16389201f4ed0d0c8b979cb973de3", "score": "0.6416045", "text": "function getHash(url) {\n if (typeof url == 'string') {\n var hashPos = url.indexOf('#');\n if (hashPos > -1)\n return url.substring(hashPos);\n }\n return '';\n}", "title": "" }, { "docid": "5cd5d525f847e2b7139011cba2bb6fcf", "score": "0.64086825", "text": "function hashUrl(url) {\n var shasum = crypto.createHash('sha1');\n shasum.update(url);\n return shasum.digest('hex');\n}", "title": "" }, { "docid": "a4e8e6fa9ec7bf71a91a298287424403", "score": "0.64037806", "text": "function pageHashChanged(){\n\t\t\t\t\tif(location.hash === '#home-view' || location.hash === '#statistics-view'){\n\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "9e113c053d7fb20169ed60e510048814", "score": "0.64009976", "text": "getURL() {\n var originalPath = this.getHash().substr(1);\n var outPath = originalPath;\n\n if (outPath[0] !== '/') {\n outPath = '/'; // Only add the # if the path isn't empty.\n // We do NOT want `/#` since the ampersand\n // is only included (conventionally) when\n // the location.hash has a value\n\n if (originalPath) {\n outPath += `#${originalPath}`;\n }\n }\n\n return outPath;\n }", "title": "" }, { "docid": "c544a89715565a096ae04c057e4caac6", "score": "0.6375638", "text": "function onHashchange( event ) {\n\t\t\t var\n\t\t\t anchorMapPrevious = copyAnchorMap(),\n\t\t\t anchorMapProposed, stateChanged = false, toggleCty = false;\n\n\t\t\t\t// attempt to parse anchor\n\t\t\t\ttry { anchorMapProposed = $.uriAnchor.makeAnchorMap(); }\n\t\t\t\tcatch ( error ) {\n\t\t\t\t\t$.uriAnchor.setAnchor( anchorMapPrevious, null, true );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tanchorMap = anchorMapProposed;\n\n\t\t\t\tfor ( k in anchorMapProposed ) {\n\t\t\t\t\tif ( ! anchorMapPrevious\n\t\t\t\t\t\t|| anchorMapPrevious[k] !== anchorMapProposed[k]\n\t\t\t\t\t) {\t\n\t\t\t\t\t\tif(k.indexOf('s_')===-1){\n\t\t\t\t\t\t\tstate[k](anchorMapProposed[k]);\n\t\t\t\t\t\t\tstateChanged = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif(stateChanged){\n\t\t\t\t\tstate.updateStateControls();\n\t\t\t\t\tstate.updateDashboard();\n\t\t\t\t}\n\n\t\t\t return false;\n\t\t\t}", "title": "" }, { "docid": "7d2e503acfb3b20767512ce0bb84a120", "score": "0.63683367", "text": "function windowlocationhashListener() {\r\n if (trackHistory) {\r\n \r\n var stateKey = document.getElementById(\"pz2watch:windowlocationhash\");\r\n // console.log(\"browser hash update response detected.\");\r\n // console.log(\"pz2watch:windowlocationhash: [\" + stateKey.value + \"]\");\r\n // console.log(\"window.location.hash: [\" + window.location.hash + \"]\");\r\n if (window.location.hash != stateKey.value) { \r\n if (window.location.hash) {\r\n //console.log(\"updating pz2watch:windowlocationhash with new window.location.hash [\" + window.location.hash + \"]\");\r\n stateKey.value = window.location.hash;\r\n //console.log(\"firing pz2watch:windowlocationhash onChange\");\r\n stateKey.onchange();\r\n } else if (stateKey.value) {\r\n //console.log(\"updating window.location.hash with pz2watch:windowlocationhash [\" + stateKey.value + \"]\");\r\n window.location.hash = stateKey.value;\r\n //console.log(\"firing pz2watch:windowlocationhash onChange\");\r\n stateKey.onchange();\r\n } \r\n } else {\r\n //console.log(\"State hash already has the value of the new browser hash - not updating state hash\");\r\n }\r\n }\r\n}", "title": "" }, { "docid": "060720f664a63dfbf13f5a0ffc0bf445", "score": "0.63652223", "text": "function Hash(pageViewArg){\n\tvar hashData;\n\tvar pageView = pageViewArg;\n\t\n\tthis.hashUpdate = function(){\n\t\t//called on every hash change\n\t\t\n\t\thashData = parseHash();\n\t\tif(!hashData)\n\t\t\treturn; //hash was changed - cancel because hash function will re-fire\n\n\t\tselectCommand();\n\t\t\n\t}\n\t\n\t\n\tvar parseHash = function(){\n\t\t//if the first slash was forgotten, add it\n\t\tif(window.location.hash.indexOf('/') != 1 && window.location.hash.indexOf('#') == 0){\n\t\t\twindow.location.hash = '#/'+hash;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//split data into array (after chopping off again the first slash)\n\t\tvar hashData = window.location.hash.slice(2).split('/');\n\n\t\tif(hashData[1] === undefined){\n\t\t\thashData[0] = 'page';\n\t\t\thashData[1] = '1';\n\t\t}\n\t\treturn hashData;\n\t}\n\n\t\n\tvar selectCommand = function(){\n\t\tvar returnVal;\n\t\t//do stuff with the data\n\t\tswitch(hashData[0]){\n\t\t\tcase 'post':\n\t\t\t\treturnVal = post();\n\t\t\t\tbreak;\n\t\t\tcase 'page':\n\t\t\t\treturnVal = page();\n\t\t\t\tbreak;\n\t\t\tcase 'random':\n\t\t\t\treturnVal = random();\n\t\t\t\tbreak;\n\t\t\tcase 'user':\n\t\t\t\treturnVal = user();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//page type wasn't found\n\t\t\t\t//bring home\n\t\t\t\twindow.location.hash = '#/';\n\t\t\t\treturnVal = false;\n\t\t}\n\t\t\n\t\tif(returnVal === false){}\n\t\t\t//404?\n\t\t\t\n\t\treturn returnVal;\n\t\t\n\t}\n\t\t\n\tvar post = function(){\n\t\tif(hashData[2] !== undefined)\n\t\t\treturn false;\n\t\tif(!validatePositiveNumber(hashData[1]))\n\t\t\treturn false;\n\t\t\n\t\t//safe, go to post page for this ID\n\t\tpageView.updateId(hashData[1]);\n\t}\n\t\n\t\n\tvar page = function(){\n\t\tif(hashData[2] !== undefined)\n\t\t\treturn false;\n\t\tif(!validatePositiveNumber(hashData[1]))\n\t\t\treturn false;\n\t\tif(hashData[1] > pageView.getMaxPage())\n\t\t\treturn false;\n\n\t\t//safe, go to proper page\n\t\tpageView.updatePage(hashData[1]);\n\t\n\t}\n\t\n\t\n\tvar random = function(){\n\t\tif(hashData[2] !== undefined)\n\t\t\treturn false;\n\t\n\t}\n\t\n\t\n\tvar user = function(){\n\t\tif(hashData[2] !== undefined)\n\t\t\treturn false;\n\t\n\t}\n\n\n\tvar validatePositiveNumber = function(string){\n\t\t//test data variable for integerness (including for a \n\t\t//partial non-nnumber that will evaluate to an integer)\n\t\tif(string === undefined){\n\t\t\tvar number = parseInt(hashData[1]);\n\t\t\tstring = hashData[1];\n\t\t}else{\n\t\t\tvar number = parseInt(string);\n\t\t}\n\t\t\n\t\tif((number+'') == string && number > 0){ //if number pareses exactly to an int, not just approximately\n\t\t\treturn number;\n\t\t}else{\n\t\t\twindow.location.hash = '#/';\n\t\t\treturn false;\n\t\t}\n\t\n\t}\n\n\n\t\n}", "title": "" } ]
069acf64c61f19a171c5eaf813463718
Write password to the password input
[ { "docid": "3e4fb6299a4723d4b0a7c0db63e6a0eb", "score": "0.0", "text": "function writePassword(pass) {\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = pass;\n\n}", "title": "" } ]
[ { "docid": "d4751d6b757402fe4a96c6994519229b", "score": "0.88605946", "text": "function writePassword() {}", "title": "" }, { "docid": "064a6294cc5c718406e2fe024e30bfd8", "score": "0.85434437", "text": "function writePassword() {\n var password = getPasswordOptions();\n var passwordText = document.querySelector('#password');\n \n passwordText.value = password;\n }", "title": "" }, { "docid": "0f42aefc7bd1613874e9e1e1887c772d", "score": "0.8511256", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "title": "" }, { "docid": "f0c46a893feb9d31e18e9b068f1a1fdf", "score": "0.8500835", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n generatePassword()\n }", "title": "" }, { "docid": "66a6810dc33ba30d8c5edda142bb3a35", "score": "0.84896296", "text": "function writePassword() {\n var password = buildPassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "97b68bb05cac2a67b48c2ccb7f3a43f7", "score": "0.84846", "text": "function writePassword() {\n \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "title": "" }, { "docid": "98145bc9625ae67ce28d64795ebe1139", "score": "0.84719414", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "title": "" }, { "docid": "4ad743b53c51643a0b2c8d52731818d9", "score": "0.84686357", "text": "function writePassword() {\n var passwordLen = getpasswordLength();\n var options = getPasswordOptionSet();\n\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = makePassword(passwordLen, options);\n\n\n}", "title": "" }, { "docid": "d32465b92d85b0539f202217c73ad7ac", "score": "0.8454292", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "title": "" }, { "docid": "be3a3f35eb5808050d9ed304634fb97e", "score": "0.8443738", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n }", "title": "" }, { "docid": "63718f69884cd409a6ac37c2175d2da5", "score": "0.8431387", "text": "function writePassword() {\n let password = generatePassword(passwordlength).join(\"\");\n let passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "be06b1472681535367522d0d5a9830de", "score": "0.8419759", "text": "function writePassword() {\n getUserInputs();\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "b1b845474f0583e1619524709b7d3db5", "score": "0.8418786", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n // Reset variables\n passwordLength = 0;\n selectedCharacters = \"\";\n includeLowercase = false;\n includeUppercase = false;\n includeNumbers = false;\n includeSpecialChar = false;\n}", "title": "" }, { "docid": "74a136106301902ccf2f99f35c0a61ee", "score": "0.8406216", "text": "function writePassword() {\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "title": "" }, { "docid": "4c90d14c0ccd75ccb8cdd114d95f1c8d", "score": "0.8403772", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "title": "" }, { "docid": "ce5e1da70a621375e86f151d237d94c3", "score": "0.8400314", "text": "function writePassword() {\n var length = getPasswordLength();\n length = parseInt(length);\n ensureCharacterType();\n var password = generatePassword(length);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "title": "" }, { "docid": "cd7aa15a8529d2294ba28e6f143d6fdc", "score": "0.8392802", "text": "function writePassword() {\n var password = generatePassword()\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "title": "" }, { "docid": "cc8ea61afddf17bc97c95a3298a69f7a", "score": "0.83758265", "text": "function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n }", "title": "" }, { "docid": "1f5114821f1b86b81b9df1731966d0a8", "score": "0.8370068", "text": "function writePassword() {\n var passwordReqs = {};\n passwordReqs = passReqs(passwordReqs);\n var password = generatePassword(passwordReqs);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "19f4e42640b31c2ca97db3e2b1935962", "score": "0.83642554", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "title": "" }, { "docid": "d5c57e742be3d4f74a1533de53a4dadf", "score": "0.836013", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n // Only set the new password if one was actually generated. Otherwise, keep the previous password on the screen.\n if (passwordText !== \"\") {\n passwordText.value = password;\n }\n}", "title": "" }, { "docid": "8cf49fb9767060c876bcf02f605eb8f6", "score": "0.8358564", "text": "function writePassword() {\n let newOptions = { ...options };\n setOptions(newOptions);\n var password = generatePassword(newOptions);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "66eb73523c6cc0061bf178bea9e35d64", "score": "0.8357296", "text": "function writePassword() {\n\tvar passwordText = document.querySelector('#password');\n\n\tpasswordText.value = finalPassword;\n}", "title": "" }, { "docid": "079faaeb0871f3210e3cff174e98ecc4", "score": "0.8355442", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n //prompt(password)\n }", "title": "" }, { "docid": "cda01bc2647e33028d532ba80bee9d1a", "score": "0.8354251", "text": "function _3writePassword(password) {\n console.log(\"writing password\")\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n \n}", "title": "" }, { "docid": "ee486b7d1fd2255032d2a8a3a1f65bba", "score": "0.83408403", "text": "function writePassword() {\n const password = generatePassword();\n const passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "ee486b7d1fd2255032d2a8a3a1f65bba", "score": "0.83408403", "text": "function writePassword() {\n const password = generatePassword();\n const passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "730e7eeb98b2367115c080246569b0a4", "score": "0.8301905", "text": "function writePassword() {\n var criteria = passwordCriteria();\n var password = generatePassword(criteria);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "title": "" }, { "docid": "33466f742097cc9b122f4e3120198f4f", "score": "0.8292826", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "title": "" }, { "docid": "33466f742097cc9b122f4e3120198f4f", "score": "0.8292826", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "title": "" }, { "docid": "33466f742097cc9b122f4e3120198f4f", "score": "0.8292826", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "title": "" }, { "docid": "33466f742097cc9b122f4e3120198f4f", "score": "0.8292826", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "title": "" }, { "docid": "0d730d024faa7ab4bbaecf3fd62fe542", "score": "0.828747", "text": "function writePassword() {\n var password = generatePassword();\n // If password is empty string, return without printing\n if (!password) {\n return;\n }\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "1019c895bbf3730bd6a29c771a535609", "score": "0.8274406", "text": "function writePassword() {\n var password = generatePassword();\n if (password !== undefined) {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n }\n}", "title": "" }, { "docid": "4d11dd38c09e8d9a7973dc4a48cee819", "score": "0.8269479", "text": "function writePassword() {\n var password = generatePassword();\n if (password) {\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n }\n}", "title": "" }, { "docid": "d0d6a3d39b09b4491f77bfd05e88f4a7", "score": "0.82615584", "text": "function writePassword () {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\")\n passwordText.value = password;\n}", "title": "" }, { "docid": "95e8b73d3cd4f8e19e7e20b87a4cf59e", "score": "0.8256443", "text": "function writePassword() {\n var password = generatePassword().join(\"\");\n // console.log(password);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "b58bf80c14ec955e45797f0b6c0e1a0b", "score": "0.82556236", "text": "function writePassword() {\n var password = pwCriteria();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "a380df759590d7c3ce53c564001947ae", "score": "0.82519406", "text": "function writePassword(password) {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "ac09622e64b2b89cd7deff2fec14d455", "score": "0.8250689", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "title": "" }, { "docid": "62f87d5d9f68b2196aa1fb2486bbf9f4", "score": "0.82503533", "text": "function writePassword() {\n var userPassword = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = userPassword;\n }", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "cd136e9192bd544267416e8ed0692935", "score": "0.8244716", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "3b1142d1dbfc8c376bd0671a1911338b", "score": "0.82437736", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "title": "" }, { "docid": "3b1142d1dbfc8c376bd0671a1911338b", "score": "0.82437736", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "title": "" }, { "docid": "3b1142d1dbfc8c376bd0671a1911338b", "score": "0.82437736", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "title": "" }, { "docid": "655747208aae9698e841b1d651e1ecdb", "score": "0.8240616", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n return;\n}", "title": "" }, { "docid": "f4c247f82d999ff8a3734b70bfaa84b8", "score": "0.8238806", "text": "function writePassword() {\n var password = createPassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "a5300457501a04a7105cfafad461b157", "score": "0.8238588", "text": "function writePassword() {\r\n\r\n var password = generatePassword(),\r\n passwordText = document.querySelector(\"#password\");\r\n\r\n passwordText.value = password;\r\n \r\n}", "title": "" }, { "docid": "615f9eb7afaef0ae6a44a99ab2b04e3e", "score": "0.8236282", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n if(password) {\n passwordText.value = password;\n }\n}", "title": "" }, { "docid": "e80ad36b07f869fa7f86a6cbe8376096", "score": "0.82324123", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "feeff0f933b8dbc9715b26f089588002", "score": "0.82302624", "text": "function writePassword() {\n var password = generatePassword();\n passwordText.value = password;\n passwordEngine.reset();\n}", "title": "" }, { "docid": "0d6e3525ea0d42486cb235d532ef6c27", "score": "0.82299846", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "7d7940fdd792df0e50a9fa5084ab67e6", "score": "0.8229535", "text": "function writePassword() {\n var password = generatePassword();\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "7d7940fdd792df0e50a9fa5084ab67e6", "score": "0.8229535", "text": "function writePassword() {\n var password = generatePassword();\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "title": "" }, { "docid": "58d29bdc55a09f3afb5c0c60f3ba4143", "score": "0.82283163", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n // clears password variables in case user doesn't click clear button before generating a new password\n passCreate = \"\";\n password = \"\";\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" }, { "docid": "7f06822f1eac406f155e15a912ba7259", "score": "0.82256293", "text": "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "title": "" } ]
dbbe2b70c476ff5b42621da8e33aa1cb
Need to make sure that buffer isn't trying to write out of bounds.
[ { "docid": "137ee363b39f5bef909769cc90d646a5", "score": "0.0", "text": "function checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0)\n throw new RangeError('offset is not uint')\n if (offset + ext > length)\n throw new RangeError('Trying to access beyond buffer length')\n}", "title": "" } ]
[ { "docid": "8237478033654349e087ca2d4d22ed3d", "score": "0.66712785", "text": "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "title": "" }, { "docid": "dbba5f077f32037374b6e41a42c82d51", "score": "0.66182697", "text": "flush() {\n if (this.err !== null)\n throw this.err;\n if (this.usedBufferBytes === 0)\n return;\n let numBytesWritten = 0;\n try {\n numBytesWritten = this.writer.writeSync(this.buf.subarray(0, this.usedBufferBytes));\n }\n catch (e) {\n this.err = e;\n throw e;\n }\n this.checkBytesWritten(numBytesWritten);\n this.usedBufferBytes = 0;\n }", "title": "" }, { "docid": "dbba5f077f32037374b6e41a42c82d51", "score": "0.66182697", "text": "flush() {\n if (this.err !== null)\n throw this.err;\n if (this.usedBufferBytes === 0)\n return;\n let numBytesWritten = 0;\n try {\n numBytesWritten = this.writer.writeSync(this.buf.subarray(0, this.usedBufferBytes));\n }\n catch (e) {\n this.err = e;\n throw e;\n }\n this.checkBytesWritten(numBytesWritten);\n this.usedBufferBytes = 0;\n }", "title": "" }, { "docid": "4913e56479b678a48df6829066b8d9e3", "score": "0.6576181", "text": "function writeBuffer() {\n fs.write(fd, buff, 0, buff.length, 0, function (error) {\n fs.close(fd);\n\n callback(error);\n });\n }", "title": "" }, { "docid": "bba2727e989777ac449bc83433ffd8bc", "score": "0.65046424", "text": "async flush() {\n if (this.err !== null)\n throw this.err;\n if (this.usedBufferBytes === 0)\n return;\n let numBytesWritten = 0;\n try {\n numBytesWritten = await this.writer.write(this.buf.subarray(0, this.usedBufferBytes));\n }\n catch (e) {\n this.err = e;\n throw e;\n }\n this.checkBytesWritten(numBytesWritten);\n this.usedBufferBytes = 0;\n }", "title": "" }, { "docid": "bba2727e989777ac449bc83433ffd8bc", "score": "0.65046424", "text": "async flush() {\n if (this.err !== null)\n throw this.err;\n if (this.usedBufferBytes === 0)\n return;\n let numBytesWritten = 0;\n try {\n numBytesWritten = await this.writer.write(this.buf.subarray(0, this.usedBufferBytes));\n }\n catch (e) {\n this.err = e;\n throw e;\n }\n this.checkBytesWritten(numBytesWritten);\n this.usedBufferBytes = 0;\n }", "title": "" }, { "docid": "6b15bc768eb8d03a5494d0936a1fb06a", "score": "0.64041424", "text": "async write(data) {\n if (this.err !== null)\n throw this.err;\n if (data.length === 0)\n return 0;\n let totalBytesWritten = 0;\n let numBytesWritten = 0;\n while (data.byteLength > this.available()) {\n if (this.buffered() === 0) {\n // Large write, empty buffer.\n // Write directly from data to avoid copy.\n try {\n numBytesWritten = await this.writer.write(data);\n }\n catch (e) {\n this.err = e;\n throw e;\n }\n }\n else {\n numBytesWritten = util_ts_9.copyBytes(data, this.buf, this.usedBufferBytes);\n this.usedBufferBytes += numBytesWritten;\n await this.flush();\n }\n totalBytesWritten += numBytesWritten;\n data = data.subarray(numBytesWritten);\n }\n numBytesWritten = util_ts_9.copyBytes(data, this.buf, this.usedBufferBytes);\n this.usedBufferBytes += numBytesWritten;\n totalBytesWritten += numBytesWritten;\n return totalBytesWritten;\n }", "title": "" }, { "docid": "b38f103214fc68f717812fffebc56cc5", "score": "0.6401063", "text": "writeSync(data) {\n if (this.err !== null)\n throw this.err;\n if (data.length === 0)\n return 0;\n let totalBytesWritten = 0;\n let numBytesWritten = 0;\n while (data.byteLength > this.available()) {\n if (this.buffered() === 0) {\n // Large write, empty buffer.\n // Write directly from data to avoid copy.\n try {\n numBytesWritten = this.writer.writeSync(data);\n }\n catch (e) {\n this.err = e;\n throw e;\n }\n }\n else {\n numBytesWritten = util_ts_9.copyBytes(data, this.buf, this.usedBufferBytes);\n this.usedBufferBytes += numBytesWritten;\n this.flush();\n }\n totalBytesWritten += numBytesWritten;\n data = data.subarray(numBytesWritten);\n }\n numBytesWritten = util_ts_9.copyBytes(data, this.buf, this.usedBufferBytes);\n this.usedBufferBytes += numBytesWritten;\n totalBytesWritten += numBytesWritten;\n return totalBytesWritten;\n }", "title": "" }, { "docid": "9e1965d6f32fa8f5671c0eed9f51d1e8", "score": "0.63830715", "text": "async write(data) {\n if (this.err !== null)\n throw this.err;\n if (data.length === 0)\n return 0;\n let totalBytesWritten = 0;\n let numBytesWritten = 0;\n while (data.byteLength > this.available()) {\n if (this.buffered() === 0) {\n // Large write, empty buffer.\n // Write directly from data to avoid copy.\n try {\n numBytesWritten = await this.writer.write(data);\n }\n catch (e) {\n this.err = e;\n throw e;\n }\n }\n else {\n numBytesWritten = util_ts_1.copyBytes(data, this.buf, this.usedBufferBytes);\n this.usedBufferBytes += numBytesWritten;\n await this.flush();\n }\n totalBytesWritten += numBytesWritten;\n data = data.subarray(numBytesWritten);\n }\n numBytesWritten = util_ts_1.copyBytes(data, this.buf, this.usedBufferBytes);\n this.usedBufferBytes += numBytesWritten;\n totalBytesWritten += numBytesWritten;\n return totalBytesWritten;\n }", "title": "" }, { "docid": "5e4becc692d4afc4a020de3dbbef3f7e", "score": "0.63709193", "text": "writeSync(data) {\n if (this.err !== null)\n throw this.err;\n if (data.length === 0)\n return 0;\n let totalBytesWritten = 0;\n let numBytesWritten = 0;\n while (data.byteLength > this.available()) {\n if (this.buffered() === 0) {\n // Large write, empty buffer.\n // Write directly from data to avoid copy.\n try {\n numBytesWritten = this.writer.writeSync(data);\n }\n catch (e) {\n this.err = e;\n throw e;\n }\n }\n else {\n numBytesWritten = util_ts_1.copyBytes(data, this.buf, this.usedBufferBytes);\n this.usedBufferBytes += numBytesWritten;\n this.flush();\n }\n totalBytesWritten += numBytesWritten;\n data = data.subarray(numBytesWritten);\n }\n numBytesWritten = util_ts_1.copyBytes(data, this.buf, this.usedBufferBytes);\n this.usedBufferBytes += numBytesWritten;\n totalBytesWritten += numBytesWritten;\n return totalBytesWritten;\n }", "title": "" }, { "docid": "59bce48c1aafec712a8c6e605de24b44", "score": "0.60459363", "text": "function write (chunk, encoding) {\n // only buffer things\n if (chunk !== undefined && chunk !== null) {\n // store the encoding\n enc.push(encoding);\n // TODO some kind of magic concat? but then I have\n // accumulation issues, encoding issues and it is nice\n // that what goes to dest is __exactly__ what came to buffer.\n buffer.push(chunk);\n total += chunk.length;\n\n if (total > size) {\n dest.pause();\n self.emit('full');\n return false;\n }\n }\n }", "title": "" }, { "docid": "3c7c94febe14d85e9138a3b6a0598cd2", "score": "0.6008742", "text": "checkAndFlushBuffer() {\n\n if (!this.logStream || !this.buffer.length) {\n return; //will do nothing\n }\n\n if (this.buffer.length >= this.bufferFlushSize) {\n return this.processBuffer(); //will end with a buffer being send to disk\n }\n\n clearTimeout(this._timeout); //buffer limit not reached, reset a timer to process buffer after timeout, if no more logs are sent\n\n const self = this;\n this._timeout = setTimeout(function(){ self.processBuffer(); }, this.bufferTimeout);\n }", "title": "" }, { "docid": "a7db5b9be32059877f6d1fa4ea698962", "score": "0.5984872", "text": "_write(data) {\n if (!isBuffer(data)) {\n data = new Buffer(data + '\\n', 'binary');\n }\n\n this.push(data);\n return (this._offset += data.length);\n }", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "d35e7f5299835a2eca9e31195f8c20c4", "score": "0.5951102", "text": "function checkOffset (offset, ext, length) {\n\t if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n\t if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n\t}", "title": "" }, { "docid": "69aca013ce0780d7103597d7886e2bdf", "score": "0.5937141", "text": "writeBuffer (buf) {\n let opCodeNum\n const len = buf.length\n if (buf.length > 0 && buf.length < OpCode.OP_PUSHDATA1) {\n opCodeNum = buf.length\n } else if (buf.length === 0) {\n opCodeNum = OpCode.OP_0\n } else if (buf.length < Math.pow(2, 8)) {\n opCodeNum = OpCode.OP_PUSHDATA1\n } else if (buf.length < Math.pow(2, 16)) {\n opCodeNum = OpCode.OP_PUSHDATA2\n } else if (buf.length < Math.pow(2, 32)) {\n opCodeNum = OpCode.OP_PUSHDATA4\n } else {\n throw new Error(\"You can't push that much data\")\n }\n this.chunks.push({\n buf: buf,\n len: len,\n opCodeNum: opCodeNum\n })\n return this\n }", "title": "" }, { "docid": "1676f71906dc7ebca7f883ddfbb3554d", "score": "0.59352535", "text": "function checkOffset (offset, ext, length) {\n\t\t\t\t\tif ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint');\n\t\t\t\t\tif (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');\n\t\t\t\t}", "title": "" }, { "docid": "b0f5258a7ebd020ca8c417fed1cb7bbb", "score": "0.5934013", "text": "function writeOrBuffer(stream, state, chunk, encoding, cb) {\n\t chunk = decodeChunk(state, chunk, encoding);\n\t if (util.isBuffer(chunk)) encoding = 'buffer';\n\t var len = state.objectMode ? 1 : chunk.length;\n\n\t state.length += len;\n\n\t var ret = state.length < state.highWaterMark;\n\t // we must ensure that previous needDrain will not be reset to false.\n\t if (!ret) state.needDrain = true;\n\n\t if (state.writing || state.corked) state.buffer.push(new WriteReq(chunk, encoding, cb));else doWrite(stream, state, false, len, chunk, encoding, cb);\n\n\t return ret;\n\t}", "title": "" }, { "docid": "b28cd51e64c0049b8e18555d16f16b33", "score": "0.5929776", "text": "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n\n if (0 === this.writeBuffer.length) {\n this.emit(\"drain\");\n } else {\n this.flush();\n }\n }", "title": "" }, { "docid": "429b707044a2c463dafe64f866f2b941", "score": "0.5929403", "text": "function checkOffset (offset, ext, length) {\r\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\r\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\r\n }", "title": "" }, { "docid": "07f3920ba1199b2ef7ebf8237884f88f", "score": "0.59171635", "text": "function eob() {\n throw new Error('unexpected end of buffer');\n}", "title": "" }, { "docid": "d47a085903347e741c1f99dde8302198", "score": "0.5915978", "text": "function writeLength(buffer, pos, length) {\n var digit = 0\n , origPos = pos\n\n do {\n digit = length % 128 | 0\n length = length / 128 | 0\n if (length > 0) {\n digit = digit | 0x80\n }\n buffer.writeUInt8(digit, pos++, true)\n } while (length > 0)\n\n return pos - origPos\n}", "title": "" }, { "docid": "b19678a68cb662397385f26daf48b312", "score": "0.59104544", "text": "function writeOrBuffer(stream, state, chunk, encoding, cb) {\n\t chunk = decodeChunk(state, chunk, encoding);\n\t if (Buffer.isBuffer(chunk))\n\t encoding = 'buffer';\n\t var len = state.objectMode ? 1 : chunk.length;\n\t\n\t state.length += len;\n\t\n\t var ret = state.length < state.highWaterMark;\n\t // we must ensure that previous needDrain will not be reset to false.\n\t if (!ret)\n\t state.needDrain = true;\n\t\n\t if (state.writing)\n\t state.buffer.push(new WriteReq(chunk, encoding, cb));\n\t else\n\t doWrite(stream, state, len, chunk, encoding, cb);\n\t\n\t return ret;\n\t}", "title": "" }, { "docid": "b19678a68cb662397385f26daf48b312", "score": "0.59104544", "text": "function writeOrBuffer(stream, state, chunk, encoding, cb) {\n\t chunk = decodeChunk(state, chunk, encoding);\n\t if (Buffer.isBuffer(chunk))\n\t encoding = 'buffer';\n\t var len = state.objectMode ? 1 : chunk.length;\n\t\n\t state.length += len;\n\t\n\t var ret = state.length < state.highWaterMark;\n\t // we must ensure that previous needDrain will not be reset to false.\n\t if (!ret)\n\t state.needDrain = true;\n\t\n\t if (state.writing)\n\t state.buffer.push(new WriteReq(chunk, encoding, cb));\n\t else\n\t doWrite(stream, state, len, chunk, encoding, cb);\n\t\n\t return ret;\n\t}", "title": "" }, { "docid": "650821e219cb79fce848432d2bd7724f", "score": "0.590955", "text": "function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}", "title": "" }, { "docid": "650821e219cb79fce848432d2bd7724f", "score": "0.590955", "text": "function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}", "title": "" }, { "docid": "650821e219cb79fce848432d2bd7724f", "score": "0.590955", "text": "function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError('offset is not uint');if(offset+ext>length)throw new RangeError('Trying to access beyond buffer length');}", "title": "" }, { "docid": "b4e31eb5c2e9be9b505eaf83b98d849c", "score": "0.59068036", "text": "function checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n }", "title": "" } ]
11e20e7f41e6d340d150123e683eb283
drm data object containing relevant license url ,scheme name and certificate
[ { "docid": "52dd772886c3782403770438ec92bccb", "score": "0.49613625", "text": "getDrm() {\n\t \treturn this.drm;\n\t }", "title": "" } ]
[ { "docid": "7f1578ea0ed978bbd30cac83fc18095a", "score": "0.55770737", "text": "function renderLicenseLink(data) {\n if (data.license === 'None || Added Your Own Later') {\n return '';\n }\n\n else {\n if (data.license === 'MIT License') {\n return `https://spdx.org/licenses/MIT.html`;\n } else if (data.license === 'GNU Affero General Public License v3.0') {\n return `https://spdx.org/licenses/AGPL-3.0-or-later.html`;\n } else if (data.license === 'Mozilla Public License 2.0') {\n return `https://spdx.org/licenses/MPL-2.0.html`;\n } else if (data.license === 'Apache License 2.0') {\n return `https://spdx.org/licenses/Apache-2.0.html`;\n };\n };\n}", "title": "" }, { "docid": "6def76fb7fd1958ac3fde05081d2b354", "score": "0.54014295", "text": "function renderLicenseLink(data) {\n if (data.license === \"MIT\") {\n return `For additional information about license policy visit: https://choosealicense.com/licenses/mit/#`;\n } else if (data.license === \"GPL\") {\n return `For additional information about license policy visit: https://choosealicense.com/licenses/gpl-3.0/`;\n } else if (data.license === \"Apache\") {\n return `For additional information about license policy visit: https://choosealicense.com/licenses/apache-2.0/`;\n } else {\n return \"\";\n }\n}", "title": "" }, { "docid": "b4804398d17fe771c3c382086102626d", "score": "0.53964543", "text": "function renderLicenseLink(data) {\n if (data === \"MIT\" ) {\n return \"https://opensource.org/licenses/MIT\"\n } else if (data === \"Mozilla\" ) {\n return \"https://www.mozilla.org/en-US/MPL/2.0/\"\n } else if (data === \"IBM\") {\n return \"https://opensource.org/licenses/IPL-1.0\"\n } else {\n return \"\"\n }\n}", "title": "" }, { "docid": "3e4951a02bc6cf3abc2dc6e75e48e297", "score": "0.53450215", "text": "function makeGraph(licenses) {\n return {\n '@context': 'https://raw.githubusercontent.com/ResearchObject/ro-crate/master/docs/0.3-DRAFT/context.json',\n '@graph': [\n {\n '@type': 'Dataset', \n 'license': licenses,\n '@id': './',\n 'name': 'root',\n 'description': 'root'\n },\n {\n \"@type\": \"CreativeWork\",\n \"@id\": \"ro-crate-metadata.jsonld\",\n \"identifier\": \"ro-crate-metadata.jsonld\",\n \"about\": {\n \"@id\": \"./\"\n }\n }\n ]\n };\n}", "title": "" }, { "docid": "25ce14b6986c15b0c7d7e2ea5e744291", "score": "0.5334536", "text": "function renderLicenseLink(data) {\n const noLicenseResp = '';\n\n if (data.license === 'MIT' || data.license ==='Apache 2.0' || data.license === 'GNU GPL v3' || data.license === 'IBM Public License v1.0' || data.license === 'Mozilla Public License 2.0' || data.license === 'Perl') {\n return `[License](${data.license})`\n } else {\n return noLicenseResp; \n }\n}", "title": "" }, { "docid": "956f62690c014a0a9e5304ccdffcf4dc", "score": "0.5300209", "text": "async getLicense() {\n if (this.client.is_superadmin === true) {\n if (typeof this.certificate === 'undefined') {\n const rqst = this.client.newSignedRequest('GET', '/license');\n let cert = await this.client._wrapWithPromise(rqst);\n this.certificate = cert.certificate;\n if (cert.status === \"valid\") {\n this.certificate['valid'] = true;\n }\n else {\n this.certificate['valid'] = false;\n }\n return Promise.resolve(this.certificate);\n }\n }\n else {\n return Promise.resolve(false);\n }\n }", "title": "" }, { "docid": "48a41bf26535002153a957ba567a54b5", "score": "0.52574646", "text": "function getLicenseInfo() {\n return $http.get(LICENSE_ENDPOINT);\n }", "title": "" }, { "docid": "60ff97b6d41262e910940ef5b909ead4", "score": "0.5176559", "text": "function createCertOfAuth2() {\r\n\t\tlogDebug(\"in createCertOfAuth2()\");\r\n\t\tmpscNum = getMPSCNumFromLP();\r\n\t\tlogDebug(\"mpscNum: \"+mpscNum);\r\n\t\tif (mpscNum != null) {\r\n\t\t\tvar existResult = aa.cap.getCapID(mpscNum).getSuccess();\r\n\t\t\tif(!existResult){\r\n\t\t\t \tnewLicId = createParent(appTypeArray[0], appTypeArray[1], \"Certificate of Authority\", \"NA\",null);\r\n\t\t\t\tif (newLicId) {\r\n\t\t\t\t\taa.cap.updateCapAltID(newLicId, mpscNum);\r\n\t\t\t\t\tcopyLicensedProf(capId, newLicId);\r\n\t\t\t\t\tnewLicIdString = newLicId.getCustomID();\r\n\t\t\t\t\t//updateAppStatus(\"Issued\",\"Originally Issued\",newLicId);\r\n\t\t\t\t\tthisLic = new licenseObject(newLicIdString,newLicId);\r\n\t\t\t\t\tthisLic.setStatus(\"Active\");\r\n\t\t\r\n\t\t var certIssueDate = new Date();//getStatusDateinTaskHistory(\"Certification\", \"Issued\");\r\n\t\t var certIssueMonth = certIssueDate.getMonth() + 1;\r\n\t\t var certIssueDay = certIssueDate.getDate();\r\n\t\t var certIssueYear = 1900 + certIssueDate.getYear();\r\n\t\t if (certIssueDate != null && certIssueMonth > 9){\r\n\t\t var certFirstExpYear = certIssueYear + 1;\r\n\t\t thisLic.setExpiration(\"12/31/\"+certFirstExpYear);\r\n\t\t }\r\n\t\t else{\r\n\t\t certFirstExpYear = certIssueYear;\r\n\t\t thisLic.setExpiration(\"12/31/\"+certFirstExpYear);\r\n\t\t }\r\n\t\t logDebug(\"The Certificate of Authority was issued on \" + certIssueDate + \" and will expire on 12/31/\" + certFirstExpYear + \".\");\r\n\t\t\r\n\t\t\t\t\tif (certIssueDate != null){\r\n\t\t\t\t\t\tvar cIDate = certIssueMonth+\"/\"+certIssueDay+\"/\"+certIssueYear;\r\n\t\t\t\t\t\tthisLic.setIssued(cIDate);\r\n\t\t\t\t\t\tlogDebug(\"RefLP License Issued Date updated to: \"+cIDate);\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t\tvar ignore = lookup(\"EMSE:ASI Copy Exceptions\",\"License/*/*/*\"); \r\n\t\t\t\t\tvar ignoreArr = new Array();\r\n\t\t\t\t\tif(ignore != null) ignoreArr = ignore.split(\"|\");\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (asi in AInfo){\r\n\t\t\t\t\t\tlogDebug(asi+\"= \"+AInfo[asi])\r\n//\t\t\t\t\t\teditAppSpecific(asi,AInfo[asi],newCap);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tcopyAppSpecific(newLicId,ignoreArr);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tcopyASITables(capId,newLicId);\r\n\t\t\t\t\tlinkMPSCtoPU(mpscNum, capId);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//get refLp to edit standard fields for ACA display\r\n\t\t\t\t\tvar refLPModel = getRefLicenseProf(mpscNum);\r\n\t\t\t\t\tif(!refLPModel){\r\n\t\t\t\t\t\tlogDebug(\"Ref LP \" + refLPNum + \" not found\");\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\trefLPModel.setAcaPermission(null);//the system interprets null as Y (this will display in ACA)\r\n\t\t\t\t\t\trefLPModel.setInsuranceCo(\"Active\");\r\n\t\t\t\t\t\taa.licenseScript.editRefLicenseProf(refLPModel);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\teditRefLicProfAttribute(mpscNum,\"INTRASTATE AUTHORITY EXPIRATIO\",\"12/31/\"+certFirstExpYear);//sets expiration year on Ref LP\r\n\t\t\t\t\teditRefLicProfAttribute(mpscNum,\"INTRASTATE AUTHORITY STATUS\",\"Active\");\r\n\t\t\t\t\teditRefLicProfAttribute(mpscNum,\"INTRASTATE AUTHORITY STATUS DA\",cIDate);\r\n\t\t\t\t\teditRefLicProfAttribute(mpscNum,\"INTRASTATE AUTH APP DATE\",fileDate);\r\n\t\t\t\t\teditLicProfAttribute(newLicId, mpscNum,\"INTRASTATE AUTHORITY EXPIRATIO\",\"12/31/\"+certFirstExpYear);//sets expiration year on Cert trans LP\r\n\t\t\t\t\teditLicProfAttribute(newLicId, mpscNum,\"INTRASTATE AUTHORITY STATUS\",\"Active\");\r\n\t\t\t\t\teditLicProfAttribute(newLicId, mpscNum,\"INTRASTATE AUTHORITY STATUS DA\",cIDate);\r\n\t\t\t\t\teditLicProfAttribute(newLicId, mpscNum,\"INTRASTATE AUTH APP DATE\",fileDate);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (AInfo[\"Application is Part of a Transfer\"] == \"Y\" || AInfo[\"Application is Part of a Transfer\"] == \"Yes\") {\r\n\t\t\t\t\t\teqListTable = loadASITable(\"EQUIPMENT_LIST\", newLicId);\r\n\t\t\t\t\t\tnewTable = new Array();\r\n\t\t\t\t\t\tfor (var eachRow in eqListTable) {\r\n\t\t\t\t\t\t\tthisRow = eqListTable[eachRow];\r\n\t\t\t\t\t\t\tnewRow = new Array();\r\n\t\t\t\t\t\t\tnewRow[\"Type\"] = new asiTableValObj(\"Type\", thisRow[\"Type\"].fieldValue, \"N\");\r\n\t\t\t\t\t\t\tnewRow[\"Year\"] = new asiTableValObj(\"Year\", thisRow[\"Year\"].fieldValue, \"N\");\r\n\t\t\t\t\t\t\tnewRow[\"Make\"] = new asiTableValObj(\"Make\", thisRow[\"Make\"].fieldValue, \"N\");\r\n\t\t\t\t\t\t\tnewRow[\"Serial#/VIN\"] = new asiTableValObj(\"Serial#/VIN\", thisRow[\"Serial#/VIN\"].fieldValue, \"N\");\r\n\t\t\t\t\t\t\tnewRow[\"GVWR\"] = new asiTableValObj(\"GVWR\", thisRow[\"GVWR\"].fieldValue, \"N\");\r\n\t\t\t\t\t\t\tnewRow[\"Unit/Fleet #\"] = new asiTableValObj(\"Unit/Fleet #\", thisRow[\"Unit/Fleet #\"].fieldValue, \"N\");\r\n\t\t\t\t\t\t\tnewRow[\"License Plate State\"] = new asiTableValObj(\"License Plate State\", thisRow[\"License Plate State\"].fieldValue, \"N\");\r\n\t\t\t\t\t\t\tnewRow[\"Leased Vehicle Owner\"] = new asiTableValObj(\"Leased Vehicle Owner\", thisRow[\"Leased Vehicle Owner\"].fieldValue, \"N\");\r\n\t\t\t\t\t\t\tnewRow[\"Vehicle Action\"] = new asiTableValObj(\"Vehicle Action\", \"\"/*thisRow[\"Vehicle Action\"].fieldValue*/, \"N\");\r\n\t\t\t\t\t\t\tnewRow[\"Status\"] = new asiTableValObj(\"Status\", thisRow[\"Status\"].fieldValue, \"N\");\r\n\t\t\t\t\t\t\tnewRow[\"MPSC Decal #\"] = new asiTableValObj(\"MPSC Decal #\", thisRow[\"MPSC Decal #\"].fieldValue, \"Y\");\r\n\t\t\t\t\t\t\tvar equipUse = thisRow[\"Equipment Use\"].fieldValue;//gets equipment use to set plate fee instead of copying Plate Fee data\r\n\t\t\t\t\t\t\tnewRow[\"Equipment Use\"] = new asiTableValObj(\"Equipment Use\", equipUse, \"N\");\r\n\t\t\t\t\t\t\tif (equipUse == \"Household Goods\") pFee = \"50.00\";\r\n\t\t\t\t\t\t\telse pFee = \"100.00\";\r\n\t\t\t\t\t\t\tnewRow[\"Plate Fee\"] = new asiTableValObj(\"Plate Fee\", pFee, \"N\");\r\n\t\t\t\t\t\t\tnewTable.push(newRow);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\taddASITable(\"EQUIPMENT LIST\", newTable);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//Update existing Authority\r\n\t\t\t\tlogDebug(\"A Certificate of Authority has already been issued for this CVED number, updating the existing Authority.\");\r\n\t\t\t\t//get existing Authority capId\r\n\t\t\t\tvar authCapId = aa.cap.getCapID(mpscNum).getOutput();\r\n\t\t\t\t\r\n\t\t\t\t//link app to existing Certificate of Authority\r\n\t\t\t\taddParent(mpscNum);\r\n\t\t\t\t\r\n\t\t\t\t//link the RefLP to the public user on the new App\r\n\t\t\t\tlinkMPSCtoPU(mpscNum, capId);//getting the pu from new app and linking to the updated refLp\r\n\t\t\t\t\r\n\t\t\t\t//remove existing ASIT, Addresses, Contacts and LPs from Auth\r\n\t\t\t\tremoveASITable(\"EQUIPMENT LIST\",authCapId);\r\n\t\t\t\tremoveASITable(\"CONTINUOUS CONTRACT\",authCapId);\r\n\t\t\t\tremoveCapAddresses(authCapId);\r\n\t\t\t\tremoveCapContacts(authCapId);\r\n\t\t\t\tremoveCapLPs(authCapId);\r\n\t\t\t\t\r\n\t\t\t\t//copy updated ASI, ASIT, Address, Contacts from App to Authority\r\n\t\t\t\tvar ignore = lookup(\"EMSE:ASI Copy Exceptions\",\"License/*/*/*\"); \r\n\t\t\t\tvar ignoreArr = new Array();\r\n\t\t\t\tif(ignore != null) ignoreArr = ignore.split(\"|\"); \r\n//\t\t\t\tcopyAppSpecific(authCapId,ignoreArr);\r\n\t\t\t\tcopyASITables(capId, authCapId);\r\n\t\t\t\tcopyAddresses(capId, authCapId);\r\n\t\t\t\tcopyContacts(capId, authCapId);\r\n\t\t\t\t\r\n\t\t\t\t//Updates for issuance Record Status\r\n\t\t\t\tupdateAppStatus(\"Active\",\"\",authCapId);\r\n\t\t\t\t//Updates for issuance Expiration Status and date\r\n\t\t\t\tthisLic = new licenseObject(mpscNum,authCapId);\r\n\t\t\t\tthisLic.setStatus(\"Active\");\r\n\r\n\t var certIssueDate = new Date();//getStatusDateinTaskHistory(\"Certification\", \"Issued\");\r\n\t var certIssueMonth = certIssueDate.getMonth() + 1;\r\n\t var certIssueDay = certIssueDate.getDate();\r\n\t var certIssueYear = 1900 + certIssueDate.getYear();\r\n\t if (certIssueDate != null && certIssueMonth > 9){\r\n\t var certFirstExpYear = certIssueYear + 1;\r\n\t thisLic.setExpiration(\"12/31/\"+certFirstExpYear);\r\n\t }\r\n\t else{\r\n\t certFirstExpYear = certIssueYear;\r\n\t thisLic.setExpiration(\"12/31/\"+certFirstExpYear);\r\n\t }\r\n\t logDebug(\"The Certificate of Authority was issued on \" + certIssueDate + \" and will expire on 12/31/\" + certFirstExpYear + \".\");\r\n\r\n\t\t\t\tif (certIssueDate != null){\r\n\t\t\t\t\tvar cIDate = certIssueMonth+\"/\"+certIssueDay+\"/\"+certIssueYear;\r\n\t\t\t\t\tthisLic.setIssued(cIDate);\r\n\t\t\t\t\tlogDebug(\"RefLP License Issued Date updated to: \"+cIDate);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Update existing reference LP with current info from app\r\n\t\t\t\tupdateRefLpFromTransLp();\r\n\t\t\t\t\r\n\t\t\t\t//edit Ref LP for issuance and copy to existing Authority\r\n\t\t\t\teditRefLicProfAttribute(mpscNum,\"INTRASTATE AUTHORITY EXPIRATIO\",\"12/31/\"+certFirstExpYear);//sets expiration year on Ref LP\r\n\t\t\t\teditRefLicProfAttribute(mpscNum,\"INTRASTATE AUTHORITY STATUS\",\"Active\");\r\n\t\t\t\teditRefLicProfAttribute(mpscNum,\"INTRASTATE AUTHORITY STATUS DA\",cIDate);\r\n\t\t\t\teditRefLicProfAttribute(mpscNum,\"INTRASTATE AUTH APP DATE\",fileDate);\r\n\t\t\t\t\r\n\t\t\t\tvar refLPModel = getRefLicenseProf(mpscNum);\r\n\t\t\t\tif(!refLPModel){\r\n\t\t\t\t\tlogDebug(\"Ref LP \" + refLPNum + \" not found\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\trefLPModel.setAcaPermission(null);//the system interprets null as Y (this will display in ACA)\r\n\t\t\t\t\trefLPModel.setInsuranceCo(\"Active\");\r\n\t\t\t\t\tmodifyRefLPAndSubTran(authCapId, refLPModel);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//update results\r\n\t\t\t\tlogDebug(\"The existing Authority: \"+mpscNum+\" was updated and has been reissued\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tlogDebug(\"No CVED# found on Application\");\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "8f43b9c92d7c56b25a9e90a404362bdd", "score": "0.5172168", "text": "function renderLicenseLink(data) {\n let licenseLink = data.license[0];\n let yourLink = '';\n if(licenseLink === 'MIT') {\n yourLink = `<a href = \"https://opensource.org/licenses/MIT\">License Link</a>`\n } else if (licenseLink === 'GPLv3') {\n yourLink = `<a href = \"http://perso.crans.org/besson/LICENSE.html\">License Link</a>`\n } else if (licenseLink === 'IBM') {\n yourLink = `<a href = \"https://opensource.org/licenses/IPL-1.0\">License Link</a>`\n } else if(licenseLink === 'Apache') {\n yourLink = `<a href = \"https://opensource.org/licenses/Apache-2.0\">License Link</a>`\n } else {\n yourLink = '';\n }\n return yourLink;\n}", "title": "" }, { "docid": "c91e528a49234ef3665a86bfe409f709", "score": "0.5127996", "text": "function getLicenseLink(res) {\n for (i = 0; i < licenses.length; i++) {\n if (res.license === licenses[i].name) {\n licensesSection = `${licenses[i].name}: ${licenses[i].link}`\n }\n }\n return licensesSection;\n}", "title": "" }, { "docid": "f03e5534a30890932885398e75cc891c", "score": "0.51239014", "text": "function getLicenseInfo()\n{\n // Only retrieve license usage information for the first few seconds after login\n // this ensures the usage information is not continually queried.\n // This could be improved by having a central usage service on the web-tier that\n // is reponsible for retrieving the usage in a more sensible schedule.\n if (context.properties[\"editionInfo\"].edition != \"UNKNOWN\" &&\n user.properties[\"alfUserLoaded\"] > new Date().getTime() - 5000)\n {\n // retrieve license usage information\n var result = remote.call(\"/api/admin/usage\");\n if (result.status.code == status.STATUS_OK)\n {\n usage = eval('(' + result + ')');\n // if warnings or errors are present, display them to the admin or user\n // admin sees messages if WARN_ADMIN, WARN_ALL, LOCKED_DOWN\n // users see messages if WARN_ALL, LOCKED_DOWN\n if ( (user.isAdmin && (usage.warnings.length != 0 || usage.errors.length != 0)) ||\n (usage.level >= 2 && (usage.warnings.length != 0 || usage.errors.length != 0)) )\n {\n model.usage = usage;\n }\n }\n }\n}", "title": "" }, { "docid": "356605a2827a772823d2544f0c56d703", "score": "0.50923264", "text": "function renderLicenseSection(data) {\n if(data.license){\n return \"\\n\\n# 📝 License\\n\\nThis project is [\"+data.license+\"](\"+renderLicenseLink(data.license,data.username,data.reponame)+\") licensed.\";\n }else{\n return \"\";\n }\n}", "title": "" }, { "docid": "9a8126b775c965bf89fcccf700df3180", "score": "0.5063145", "text": "function renderLicenseLink(license) {\n\n\n}", "title": "" }, { "docid": "77e3a000a8ca1bb7f0a656c6dcb627e8", "score": "0.50604665", "text": "function renderLicenseLink(license) {\n switch (license) {\n case \"Apache 2.0 License\":\n return \"https://opensource.org/licenses/Apache-2.0\";\n break;\n case \"Boost Software License 1.0\":\n return \"https://www.boost.org/LICENSE_1_0.txt\";\n break;\n case \"BSD 3-Clause License\":\n return \"https://opensource.org/licenses/BSD-3-Clause\";\n break;\n case \"BSD 2-Clause License\":\n return \"https://opensource.org/licenses/BSD-2-Clause\";\n break;\n case \"Eclipse Public License 1.0\":\n return \"https://opensource.org/licenses/EPL-1.0\";\n break;\n case \"GNU GPL v3\":\n return \"https://www.gnu.org/licenses/gpl-3.0\";\n break;\n case \"GNU GPL v2\":\n return \"https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html\";\n break;\n case \"GNU AGPL v3\":\n return \"https://www.gnu.org/licenses/agpl-3.0\";\n break;\n case \"GNU LGPL v3\":\n return \"https://www.gnu.org/licenses/lgpl-3.0\";\n break;\n case \"GNU FDL v1.3\":\n return \"https://www.gnu.org/licenses/fdl-1.3\";\n break;\n case \"IBM Public License Version 1.0\":\n return \"https://opensource.org/licenses/IPL-1.0\";\n break;\n case \"ISC License (ISC)\":\n return \"https://opensource.org/licenses/ISC\";\n break;\n case \"The MIT License\":\n return \"https://opensource.org/licenses/MIT\";\n break;\n case \"Mozilla Public License 2.0\":\n return \"https://opensource.org/licenses/MPL-2.0\";\n break;\n case \"Attribution License (BY)\":\n return \"https://opendatacommons.org/licenses/by/\";\n break;\n case \"Open Database License (ODbL)\":\n return \"https://opendatacommons.org/licenses/odbl/\";\n break;\n case \"Public Domain Dedication and License (PDDL)\":\n return \"https://opendatacommons.org/licenses/pddl/\";\n break;\n case \"The Perl License\":\n return \"https://opensource.org/licenses/Artistic-2.0\";\n break;\n case \"The Artistic License 2.0\":\n return \"https://opensource.org/licenses/Artistic-2.0\";\n break;\n case \"SIL Open Font License 1.1\":\n return \"https://opensource.org/licenses/OFL-1.1\";\n break;\n case \"No License\":\n return \"\";\n break;\n default:\n return \"\";\n break;\n }\n}", "title": "" }, { "docid": "352c20faa50dfb2fff62b3adfa1d690f", "score": "0.50494665", "text": "function renderLicenseLink(license) {\n \n}", "title": "" }, { "docid": "3be11cffdc3742d90ea42c46b7e96c9a", "score": "0.5020838", "text": "function renderLicenseSection(data) {\n\n let licenseLink = renderLicenseLink(data);\n \n if (data === \"MIT\" ) {\n return `This project uses [the MIT License](${licenseLink})`\n } else if (data === \"Mozilla\" ) {\n return `This project uses [Mozilla Public License 2.0](${licenseLink})`\n } else if (data === \"IBM\") {\n return `This project uses [IBM Punlic License Version 1.0](${licenseLink})`\n } else {\n return \"No License data available\"\n }\n}", "title": "" }, { "docid": "24d34ea4c41ed0095d4a3bf4f8d90ad5", "score": "0.5012465", "text": "function renderLicenseLink(license) {\n if (data.license === \"\") {\n return data.license;\n }\n}", "title": "" }, { "docid": "6397244a4c3aa3f13ceffc3092703f1b", "score": "0.49915376", "text": "function renderLicenseSection(data) {\n if (data.license === \"N/A\") {\n return \"\";\n } else {\n return (\n `\\n## License\n${data.license}` +\n \"\\n\" +\n renderLicenseLink(data) +\n \"\\n\"\n );\n }\n}", "title": "" }, { "docid": "3600f06ea4e1cac0011899e66e7e763a", "score": "0.49333602", "text": "function renderLicenseLink(license) { }", "title": "" }, { "docid": "3600f06ea4e1cac0011899e66e7e763a", "score": "0.49333602", "text": "function renderLicenseLink(license) { }", "title": "" }, { "docid": "3600f06ea4e1cac0011899e66e7e763a", "score": "0.49333602", "text": "function renderLicenseLink(license) { }", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "4f0b3a2edf7388b65820cd7e5df3ceaa", "score": "0.4932741", "text": "function renderLicenseLink(license) {}", "title": "" }, { "docid": "dc7467377c2fce9f1558ec927b72bd4e", "score": "0.49270192", "text": "static createCanonJWT(serviceCtx, props) {\n assert(serviceCtx, 'serviceCtx param is missing');\n\n const hostname = serviceCtx.config.getHostname();\n\n let pnDataModelId = TestReferenceSourcePNDataModel.model.ID;\n if ((props) && (props.pnDataModelId)) {\n pnDataModelId = props.pnDataModelId;\n }\n\n let privacyPipeId = 'ppId-1';\n if ((props) && (props.privacyPipeId)) {\n privacyPipeId = props.privacyPipeId;\n }\n\n let postBackURL = 'http://fake';\n if ((props) && (props.postBackURL)) {\n postBackURL = props.postBackURL;\n }\n\n // this subject data is tied to content encrypt key metadata\n // https://md.pn.id.webshield.io/encrypt_key_md/io/webshield/test/dc#content-key-1\n //\n // Note the suject type is the base subject - needs to be this to work with the canon privacy step instance\n let subjects = [\n {\n '@id': 'https://id.webshield.io/io/webshield/test/subject#111',\n '@type': [\n 'https://subject.pn.schema.webshield.io/type#Subject',\n 'http://pn.schema.webshield.io/type#PrivacyGraph',\n ],\n 'https://schema.org/givenName': {\n '@type': 'https://md.pn.id.webshield.io/paction_instance/io/webshield/test/dc#dc-paction1483568111',\n '@value': 'BwY/p37oY1nhoFfO..y1oXJpIG52/tMiQJ9gM8lQ9YEQ==',\n },\n 'https://schema.org/familyName': {\n '@type': 'https://md.pn.id.webshield.io/paction_instance/io/webshield/test/dc#dc-paction1483568111',\n '@value': 'E/jJ1i3xyFElWMeM..lphpi5id1rXwkbXOj5zvYapUD2sw1K4=',\n },\n 'https://schema.org/taxID': {\n '@type': 'https://md.pn.id.webshield.io/paction_instance/io/webshield/test/dc#invalid-so-will-not-decrypt',\n '@value': 'E/jJ1i3xyFElWMeM..lphpi5id1rXwkbXOj5zvYapUD2sw1K4=',\n },\n 'http://pn.schema.webshield.io/prop#sourceID': {\n '@type': 'https://md.pn.id.webshield.io/paction_instance/io/webshield/test/dc#dc-paction1483568111',\n '@value': 'sqOU8UjpmO/HCzS4..suxTN7CGGMXG82AD7pM0vxGZmQ==',\n },\n 'https://schema.org/address': {\n '@id': 'https://id.webshield.io/io/webshield/test/address#adr_1',\n '@type': 'https://schema.org/PostalAddress',\n 'https://schema.org/postalCode': {\n '@type': 'https://md.pn.id.webshield.io/paction_instance/io/webshield/test/dc#dc-paction1483568111',\n '@value': '66DRmDUnumKXJlxE..u2pceQfCCexJFXzruOhmuWPyPa0Q',\n },\n },\n },\n {\n '@id': 'https://id.webshield.io/io/webshield/test/subject#222',\n '@type': [\n 'https://subject.pn.schema.webshield.io/type#Subject',\n 'http://pn.schema.webshield.io/type#PrivacyGraph',\n ],\n 'https://schema.org/givenName': {\n '@type': 'https://md.pn.id.webshield.io/paction_instance/io/webshield/test/dc#dc-paction1483568111',\n '@value': 'kMqyinSWZ5hOMqL9..KTNxgYEFhprKvuScZG7aGRgrxr5p',\n },\n 'https://schema.org/familyName': {\n '@type': 'https://md.pn.id.webshield.io/paction_instance/io/webshield/test/dc#dc-paction1483568111',\n '@value': 'W3mfgDnGOtbva6WT..DPJK4Md0EzV/cQnvn72DdoITYiRZ',\n },\n 'https://schema.org/taxID': {\n '@type': 'https://md.pn.id.webshield.io/paction_instance/io/webshield/test/dc#invalid-so-will-not-decrypt',\n '@value': 'E/jJ1i3xyFElWMeM..lphpi5id1rXwkbXOj5zvYapUD2sw1K4=',\n },\n 'http://pn.schema.webshield.io/prop#sourceID': {\n '@type': 'https://md.pn.id.webshield.io/paction_instance/io/webshield/test/dc#dc-paction1483568111',\n '@value': 'BVaHuCa/tS4CZTyR..cAwRnxvEM9IOAZewoZERHOoWUQ==',\n },\n 'https://schema.org/address': {\n '@id': 'https://id.webshield.io/io/webshield/test/address#adr_2',\n '@type': 'https://schema.org/PostalAddress',\n 'https://schema.org/postalCode': {\n '@type': 'https://md.pn.id.webshield.io/paction_instance/io/webshield/test/dc#dc-paction1483568111',\n '@value': 'JPmAsz6ibgbNE9mk..posJpbMs4vdScEyJ7JUfBvWYgzH7',\n },\n },\n },\n ];\n\n //\n // Create a syndicated entity in the format of the target reference source data model\n // FOR NOW JUST HARD CODE as FOLLOWS\n // - just use name and given name\n let syndEnts = [];\n\n let subject = subjects[0];\n let se = new SyndicatedEntity('test-se-1', {\n hostname: hostname,\n pnDataModelId: pnDataModelId,\n jobId: canonConstants.ALICE_SYNDICATION_JOB_ID,\n });\n\n se.addProperty('https://schema.org/givenName', // target schema the test referecne source\n subject['@id'], 'https://schema.org/givenName', 'jwt1-rspquery-canon');\n se.addProperty('https://schema.org/familyName', subject['@id'],\n 'https://schema.org/familyName', 'jwt1-rsquery-canon');\n\n syndEnts.push(se);\n\n subject = subjects[1];\n se = new SyndicatedEntity('test-se-2', {\n hostname: hostname,\n pnDataModelId: pnDataModelId,\n jobId: canonConstants.BOB_SYNDICATION_JOB_ID,\n });\n\n se.addProperty('https://schema.org/givenName', // target schema the test referecne source\n subject['@id'], 'https://schema.org/givenName', 'jwt2-rspquery-canon');\n se.addProperty('https://schema.org/familyName', subject['@id'],\n 'https://schema.org/familyName', 'jwt2-rsquery-canon');\n\n syndEnts.push(se);\n\n /* OLD CODE let syndEnts = [\n PNSyndicatedEntity.createJSON('test-se-1',\n { hostname: hostname,\n jobId: canonConstants.ALICE_SYNDICATION_JOB_ID,\n pnDataModelId: pnDataModelId,\n subjectIds: subjects[0]['@id'],\n }),\n PNSyndicatedEntity.createJSON('test-se-2',\n { hostname: hostname,\n jobId: canonConstants.BOB_SYNDICATION_JOB_ID,\n pnDataModelId: pnDataModelId,\n subjectIds: subjects[1]['@id'],\n }),\n ];*/\n\n let createProps = {\n postBackURL: postBackURL,\n pnDataModelId: pnDataModelId,\n privacyPipeId: privacyPipeId,\n subjects: subjects,\n syndicatedEntities: syndEnts,\n };\n\n return RSQuery.createJWT(serviceCtx, createProps);\n\n }", "title": "" }, { "docid": "72fd7327e5f0e2a76766f1b97482c001", "score": "0.49239573", "text": "function renderLicenseSection(data) {\n switch(data.license) {\n case \"MIT\": \n return fs.writeFileSync(path.join(process.cwd(), \"LICENSE\"), generateMIT(data));\n case \"APACHE 2.0\":\n return fs.writeFileSync(path.join(process.cwd(), \"LICENSE\"), generateApache(data));\n case \"GPL 3.0\": \n return fs.writeFileSync(path.join(process.cwd(), \"LICENSE\"), generateGPL(data));\n case \"BSD 3\": \n return fs.writeFileSync(path.join(process.cwd(), \"LICENSE\"), generateBSD(data));\n case \"None\": \n return fs.writeFileSync(path.join(process.cwd(), \"LICENSE\"), \"\");\n }\n}", "title": "" }, { "docid": "0f9f0bcbcc52a76a402db2acd8603029", "score": "0.4885018", "text": "function extractData(item) {\n\treturn item.product.code + \"\\0\" + item.product.version + \"\\0\" + item.policy.code + \"\\0\" + item.policy.version;\n}", "title": "" }, { "docid": "661a042fc41847a2e5b9b0e3233f871f", "score": "0.4876385", "text": "function renderLicenseLink(license) {\n let licenseLink = {};\n switch(license){\n case 'MIT': licenseLink.ioLink = 'https://img.shields.io/badge/License-MIT-yellow.svg';\n licenseLink.endLink = 'MIT';\n break;\n case 'GPL v3': licenseLink.ioLink = 'https://img.shields.io/badge/License-GPLv3-blue.svg';\n licenseLink.endLink = 'https://www.gnu.org/licenses/gpl-3.0';\n break;\n case 'BSD 3-Clause': licenseLink.ioLink = 'https://img.shields.io/badge/License-BSD%203--Clause-blue.svg';\n licenseLink.endLink = 'https://opensource.org/licenses/BSD-3-Clause';\n break;\n default: break;\n }\n return licenseLink;\n\n}", "title": "" }, { "docid": "322fa1e1e974a2f05def02ef32c3f1f8", "score": "0.487287", "text": "async getCalibrationPDF(pk, hasChainOfTruth) {\n const token = window.sessionStorage.getItem('token');\n\n let result = {\n success: true,\n url: [],\n }\n let url;\n if(hasChainOfTruth) {\n url = `${API_URL}/api/export_calibration_event_pdf_chain/${pk}`;\n } else {\n url = `${API_URL}/api/export_calibration_event_pdf/${pk}`;\n }\n \n return fetch(url, {\n method: 'GET',\n headers: {\n Authorization: `JWT ${token}`\n }\n })\n .then(res => {\n if (res.ok) {\n return res.blob().then(blob => {\n result.type = blob.type;\n return URL.createObjectURL(blob)\n })\n .then(url => {\n result.url = url;\n return result;\n })\n } else {\n return res.json().then(async (json) => {\n return await checkBadResponse(json, result);\n });\n }\n })\n }", "title": "" }, { "docid": "23eb499577fdedada44011df40a24a94", "score": "0.48696098", "text": "printDataCar() {\n console.log(this.driver);\n //llamar el account\n console.log(this.driver.name);\n console.log(this.driver.document);\n console.log(this.license)\n }", "title": "" }, { "docid": "79529d94073fd0a1dd2a05a4d7722bd6", "score": "0.48584858", "text": "function renderLicenseSection(data) {\nif (data.license == 'Apache 2.0') {\n return `License\n\n Apache 2.0' License \n\nCopyright [2021] [${data.name}]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n \nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.`\n} \n else if (data.license == 'GNU GPLv3') {\n return `License\n \n GNU GPLv3 License \n\n Copyright [2021] [${data.name}]\n \n \n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see [https://www.gnu.org/licenses/](https://www.gnu.org/licenses/)`\n }\n else if (data.license == 'MIT') {\n return `License\n\n MIT License\n\n Copyright [2021] [${data.name}] \n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE. [https://spdx.org/licenses/MIT.html](https://spdx.org/licenses/MIT.html) `\n }\n else if (data.license == 'ISC') {\n return `License\n\n ISC License\n\n Copyright [2021] [${data.name}] \n \n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted, provided that the above\n copyright notice and this permission notice appear in all copies.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n [https://spdx.org/licenses/ISC.html](https://spdx.org/licenses/ISC.html) `\n }\n else if (data.License === 0) {\n return `License `;\n }\n}", "title": "" }, { "docid": "f2577ef71fc7eed64a169d3ecab67b5e", "score": "0.48402366", "text": "function getConvenienceStrDrpDwnData() {\n gasStoreService.getConvenienceStoreOptionData().then(function success(response) {\n $scope.graphFlterOtnData = parseGasNConvenienceStDrpDwnData(response.data, false);\n var graphAPIParam = getGraphAPIParam($scope.graphFlterOtnData);\n getGraphDataPointsData(graphAPIParam);\n }, function error(error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "e6ef4758245d119e918a44ac649fed23", "score": "0.48171714", "text": "function fn(){this.subjectPublicKeyRSA=null,this.subjectPublicKeyRSA_hN=null,this.subjectPublicKeyRSA_hE=null,this.hex=null,this.getSerialNumberHex=function(){return Aa.getDecendantHexVByNthList(this.hex,0,[0,1])},this.getSignatureAlgorithmField=function(){var e=Aa.getDecendantHexVByNthList(this.hex,0,[0,2,0]),t=r.asn1.ASN1Util.oidHexToInt(e),a=r.asn1.x509.OID.oid2name(t);return a},this.getIssuerHex=function(){return Aa.getDecendantHexTLVByNthList(this.hex,0,[0,3])},this.getIssuerString=function(){return fn.hex2dn(Aa.getDecendantHexTLVByNthList(this.hex,0,[0,3]))},this.getSubjectHex=function(){return Aa.getDecendantHexTLVByNthList(this.hex,0,[0,5])},this.getSubjectString=function(){return fn.hex2dn(Aa.getDecendantHexTLVByNthList(this.hex,0,[0,5]))},this.getNotBefore=function(){var e=Aa.getDecendantHexVByNthList(this.hex,0,[0,4,0]);return e=e.replace(/(..)/g,\"%$1\"),e=decodeURIComponent(e),e},this.getNotAfter=function(){var e=Aa.getDecendantHexVByNthList(this.hex,0,[0,4,1]);return e=e.replace(/(..)/g,\"%$1\"),e=decodeURIComponent(e),e},this.readCertPEM=function(e){var t=Aa.pemToHex(e),a=fn.getPublicKeyHexArrayFromCertHex(t),n=new Nt;n.setPublic(a[0],a[1]),this.subjectPublicKeyRSA=n,this.subjectPublicKeyRSA_hN=a[0],this.subjectPublicKeyRSA_hE=a[1],this.hex=t},this.readCertPEMWithoutRSAInit=function(e){var t=Aa.pemToHex(e),a=fn.getPublicKeyHexArrayFromCertHex(t);\"function\"===typeof this.subjectPublicKeyRSA.setPublic&&this.subjectPublicKeyRSA.setPublic(a[0],a[1]),this.subjectPublicKeyRSA_hN=a[0],this.subjectPublicKeyRSA_hE=a[1],this.hex=t},this.getInfo=function(){var e=\"Basic Fields\\n\";e+=\" serial number: \"+this.getSerialNumberHex()+\"\\n\",e+=\" signature algorithm: \"+this.getSignatureAlgorithmField()+\"\\n\",e+=\" issuer: \"+this.getIssuerString()+\"\\n\",e+=\" notBefore: \"+this.getNotBefore()+\"\\n\",e+=\" notAfter: \"+this.getNotAfter()+\"\\n\",e+=\" subject: \"+this.getSubjectString()+\"\\n\",e+=\" subject public key info: \\n\";var t=fn.getSubjectPublicKeyInfoPosFromCertHex(this.hex),a=Aa.getHexOfTLV_AtObj(this.hex,t),n=qa.getKey(a,null,\"pkcs8pub\");n instanceof Nt&&(e+=\" key algorithm: RSA\\n\",e+=\" n=\"+n.n.toString(16).substr(0,16)+\"...\\n\",e+=\" e=\"+n.e.toString(16)+\"\\n\"),e+=\"X509v3 Extensions:\\n\";for(var i=fn.getV3ExtInfoListOfCertHex(this.hex),l=0;l<i.length;l++){var s=i[l],o=r.asn1.x509.OID.oid2name(s.oid);\"\"===o&&(o=s.oid);var u=\"\";if(!0===s.critical&&(u=\"CRITICAL\"),e+=\" \"+o+\" \"+u+\":\\n\",\"basicConstraints\"===o){var d=fn.getExtBasicConstraints(this.hex);void 0===d.cA?e+=\" {}\\n\":(e+=\" cA=true\",void 0!==d.pathLen&&(e+=\", pathLen=\"+d.pathLen),e+=\"\\n\")}else if(\"keyUsage\"===o)e+=\" \"+fn.getExtKeyUsageString(this.hex)+\"\\n\";else if(\"subjectKeyIdentifier\"===o)e+=\" \"+fn.getExtSubjectKeyIdentifier(this.hex)+\"\\n\";else if(\"authorityKeyIdentifier\"===o){var c=fn.getExtAuthorityKeyIdentifier(this.hex);void 0!==c.kid&&(e+=\" kid=\"+c.kid+\"\\n\")}else if(\"extKeyUsage\"===o){var h=fn.getExtExtKeyUsageName(this.hex);e+=\" \"+h.join(\", \")+\"\\n\"}else if(\"subjectAltName\"===o){var f=fn.getExtSubjectAltName(this.hex);e+=\" \"+f.join(\", \")+\"\\n\"}else if(\"cRLDistributionPoints\"===o){var v=fn.getExtCRLDistributionPointsURI(this.hex);e+=\" \"+v+\"\\n\"}else if(\"authorityInfoAccess\"===o){var m=fn.getExtAIAInfo(this.hex);void 0!==m.ocsp&&(e+=\" ocsp: \"+m.ocsp.join(\",\")+\"\\n\"),void 0!==m.caissuer&&(e+=\" caissuer: \"+m.caissuer.join(\",\")+\"\\n\")}}return e+=\"signature algorithm: \"+fn.getSignatureAlgorithmName(this.hex)+\"\\n\",e+=\"signature: \"+fn.getSignatureValueHex(this.hex).substr(0,16)+\"...\\n\",e}}", "title": "" }, { "docid": "bebd4ad9b61ecc5d7ec8540ea5043bd1", "score": "0.4810207", "text": "async function isssueCredential() {\n let walletHandle = await indy.openWallet({\"id\": issuerState.wallet.id}, {\"key\": issuerState.wallet.key})\n\n // Cred values populated\n let credValues = {\n \"name\": {\"raw\": \"will\", \"encoded\": \"1234123\"},\n \"dob\": {\"raw\": \"today\", \"encoded\": \"12312312\"}\n }\n // let handle = await indy.openBlobStorageReader(\"item\", {})\n // console.log(\"BLOB HANDLE\", handle)\n\n credObj = await indy.issuerCreateCredential(walletHandle, credOffer, credReq[0], credValues, null, walletHandle)\n console.log(\"CRED\", credObj)\n let buf = Buffer.from(JSON.stringify(credObj))\n console.log(\"CRED SIZE\", buf.length)\n await indy.closeWallet(walletHandle)\n\n\n}", "title": "" }, { "docid": "a4e86bac91219c3f2e393d38cc73d86c", "score": "0.48085397", "text": "function get_credit_card_info() {\n AccountModel.getccinfo().then(function (response) {\n self.Getccinfo1 = angular.copy(response.data); \n }, function (error) { \n });\n\n }", "title": "" }, { "docid": "3147c9567ca6c37948f3b10a31c29d26", "score": "0.4804848", "text": "async fundCredits(data) {\n var body = data;\n var path = `/v2/auth/r/funding/credits/${body.symbol}`;\n var method = \"post\";\n var header = this.authenticatedHeader(path, body);\n try {\n return await this._instanceAuthenticated({\n method: method,\n data: body,\n url: path,\n headers: header\n });\n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "7285adb6171ba0b80398ddf12a640f81", "score": "0.4803495", "text": "function renderLicenseBadge(license, licenseChoices) {\n if (license == licenseChoices[0]){\n var badge = \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMSEhUSExIWFhUVFRcWFxUYFhcXFRgXFRcXGBUYFRcZHSggGBolGxgXITEhJSktLi4uFyAzODMtNygtLisBCgoKDg0OGxAQGi0mICYtLS0tLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAOEA4QMBEQACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAAAwQFBgcBAgj/xABEEAACAQMBBQUEBwYGAQMFAAABAgMABBEhBQYSMUETUWFxgQciMpEUI0JScqGxYoKSwdHwJDNDosLhU7LS8RUWF2Nz/8QAGwEBAAIDAQEAAAAAAAAAAAAAAAMEAgUGAQf/xAA5EQACAgECBAQEBQIFBAMAAAAAAQIDBBEhBRIxQRMiUWEGMnGBFJGhsdEjQhVSweHwFjM08SRTcv/aAAwDAQACEQMRAD8A3GgCgCgCgCgCgCgCgCgOUA1vdowwjillRB3swH6142SV0WWPyxbK9e+0TZ8fKYue5EY/7sAfnWLnE2NfBMya15NPuiFuPazAPggkbxJVf51j4qL0Phu9rzSQxk9rjfZtAfOXH6LXniky+GZd5/oeU9rjdbQekpP/ABr3xkev4Zf/ANn6D6D2tQn47eQeTKf6UVqIZfDdq+Wa/Ul7L2kWD6NI0Z/bRsfNQRWXiRKU+BZkekdfuixbP2xbzjMU0b/hYH8qy1TNdZjW1PScWh9mvSEBQHaAKAKAKAKAKAKAKAKAKAKAKAKAKAKAKA8SShQSxAA1JJwB5mmp7GLk9F1Kdt/2j2sGREe3fuRhwer8vlmo5WJG5xOB5F+8lyr3M+217Q7yfRX7Fe6PQ/x8/lioXadHi8DxqVrJcz9/4KvLK8hJZi7dSxLH1JqNzT7m1hCEFpBafYcbNsO1ljjZuESOqcWM44jjOOteKSb0MMi/w6pTS10Wuhcb7c/Z1tJ2dxfvxgAlFQA4PLT3qklGEOrNDXxXMvjrVWtPqJvulaXKObC4ZpY14jDIMM4H3c4I89Ry5V4lGS8jMo8VyaJpZUfK+67ELu8lohcXkUjAgBeDIKkE8WRnOeQx4VHGyP8AcX8x5M4xeNJFmst1NmXaSSQzTxrEMuWGgGM/aGugqaKhJa6mqt4jn40oxtSevQirjdWx4S0e1ojgEhWVQTpy+Ma+lY+TT5i5DieXzKM6H9v/AEVFOIYIyD4ZBFeKSN21Ga8y/MsOx9+b23OkxkX7shL/ACY6j51IrGjWZPBsa5a8uj9i/wC7/tPglPDcL2DfezxRn1wOH1qVWJ9TncvgF1W9T5l+peba6SRQ8bq6nkykMD5EVIaKcJQfLJaMVzQxO0AUAUAUAUAUAUAUAUAUAUAUAUBWd6t8reyBVjxy40iXGdeRY/ZFYSnymyweF3Zb8u0fUyHePey5vGPG5WPpEuiDz+8fOoJT1OzwuF0Yy8q1fqRNraPIyooyzMFUd5JwKi5tS5ZbCuDm3sX+4+i7KxCkC3F1wgySv8Ck8lHPHfgdMZNZTsjX23ObgsjiL8WU+WHZLqFvt21vCIr20jj4tFniJBRifdJOhA8dR36VhG+Fj5ZLQWYeTiLxaLG9Oz7kJtvYz2VwEY5CskiOPtIGBB8xjBH9agt1rnv9jYY2XHMpbXXTRomfaVB/jgQCeOCM4AJOjSDp6Vnlt8+iKXBbNMVp/wCZ/wCgpuBs2VLn6Q6NHFFG5Z3BQagaDPPln0rLHUk3Jox4vk12U+FF6ybWyKze4eSRxyaR2HkzEj8jVOc05M21HNGuMX6IsmwBwbKv3GhZwmfNYx/yq1TLSmTNTmrn4hVH21/cqRgqqpm95n1E2gqRT0PVLuN5LapVYSKxobvARUisXckU9R9sXb1xZtxQyFddUOqN5r/ZqaM2irlYFGTHSS39e5re6e/8F3iOT6qY6BSfdb8Dd/gasRmpHG5/BrcbzLeP/OpchWZpztAFAFAFAFAFAFAFAFAFAcY0HXYzPfj2icJaCzYFuTzcwO8R958eVRTs0Om4XwNz0sv6dl/JQ9g7AuL6Q8AJGcyTOfdXvLMdWbwGtQLWW6Ogyc6jDjp37JFlh3Z2WW7AbQft88PFwjsS/LhB4MHXpx5rxqt7a7mrfEs+MfEdS5f1/f8A0PW7+x2tdqQwzAZVyVb7LAo3Cy/p4GooJxtUZDLy1k4Epw+/sMN5IWF5ccXPtWPoQOH8sVXyHpZIt8Pa/Cwcemgw7LIxVXm21LTlsWve3MlhYyN/mFSpPUrwE/qqmruVLWmDZo+HJQy7oroTe9O8NxCtu0JQLJFkkpxHI4eRzpz7qlycmVcIuJRwcGq+U1Zrqn2GdhtA7Rgezmfhm+ON+SvjXhZRocdR1Go5VhVf+Jg4N7k1+MsC6N9a1j39ioXFqyMyOuGU4Ydx/vX1rWy1g9Gb6u2NkeeO6ZYVTg2Qw5GW4H5Mv8kq3q44u/dmqbc+JL2j/JWDHVTnRudTwY6zUz3USaOs1My1EXiqVTM1IazW9TRsJIzGbx4qeMtSbVNaPoX/AHJ9obRFYLti0egWU5LJ+M/aXx5jxqxCzszmeJ8DjLWyhb91/BrcMyuoZWDKRkEHII8DU6ORlFxfLJaMVoeBQBQBQBQBQBQBQHGNAt3oZL7Q9+e14rW2YhASJJAfj6FVx9nvPWoZz7I67g/B+XS65fRGdxxZ0zVWU0up072Rp0kxvdmBbX6poNJraPTjXGvDjUg/F44INZylz1eT8jkVD8Lna3eZS6SfYp1nZNKRHEpZm+EKNdeROPhA7+la9KUnpHqb626FcXKb2LhvzORLbKHHbQRjjcdH90rn5E47jU2bbyzj6o0nCq1KFjkvLJ7IcXcEO08So6w3QAV43OjgciD6nB9DSbhk6NPR+hHXO3h75JJyh2a7DePc11964liijB95uLJI6heWpqBYbi+ackkTT4rGe1MW5DbeTaSzuqxjhhiXgjHyy2OnIY8vGq2ZlRskox6Im4fjOmLlN+Z9RO/2k08cMRQAQjAIJJOmNRjSorcuVsIwS6GdONGiyVnN8whBZTAhkjkypBDKjZBHIg4qOPip6xi/yJZ20yTjKS0fuL31vcytxyxys3LJiI06DRaztd9j1lF/kRUTx6o8sJLT6nm6upTCluy4RG4h7pDZ15/Oll8/CVbi9j2uqpWu2Mlq/cjilRKxFw8FKzUxqJslSRsRluJslTRmZaiDx1KpGSY1lhqeMyWMmugxlhxVmM9SeM9S2bh76NZt2UpLQMeWf8sk8x+z3irFc9OppOLcJjkx8Sv5v3NrgnV1DoQysMhgcgg8iKsHESjKEuWS0YpQxO0AUAUAUAUAUBmXtQ3wKZsoG94j61x0B+wDzzjn4GorJ6bHTcD4Xzvx7Ft2X+pT90N3Un47i4JS1h1dtRx4+wp5+ZHfga1Ao828uhuOI58qdKad5vp7Fhi3lsW+rfZyLb5wG07QD7xH56HPnUfj19NNjXS4flpeIrW5+nY9XMLbKvVeIloXXiAznjiJwyEnmVyCD4jxqKxvHs5l8rFbXEcZxmvOv3Jnb10trEsljGqJdEs041YFteEA/DnJ8tdM1lk2eHXz1d+5SxKnkWuGTLVw2S+hTMEkkkkk5JJySe8nqa0k7G92dFoktEtEhRY84/L/AKqHneu3Uxk4reRZNm7o3E2Gf3F6cZJb0XpV+rAyLt5PRe5qb+KU0v8AppN+xaLDc63T4gZD+0SB8hWzr4XTFebc1N3Fr57J6Im4LCJPgjVfICrsaK49IooSusl80mOAKk0IgxTQHiSFW0Kg+YzWLhF9UZKcl0ZF3m7VtJnMQBPVcqfyqrZgUT6xLdfEMivpIre0txWGTC4P7LaH0YVrbuENb1v8za0cb7WR/IqV7YvE3DIhU+PXy761s4zqek1obqq+u2OsJajNkrJTfqTJoSdKmjIyTEHSp4yJExrLFU8ZkkZNbojp4sairUJFiL1Lz7NN7zA4tZm+qc4jY/6bHoT90n5E1arnpszneN8LVkfHrXmXVepsK1OcaeqAKAKAKA4aArW/e8Ysrcsp+tf3Yxz1xqxHcP1xWE5cqNlwvBeXdy/2rqYOcsxJJJJJJOpJJyST4mqk3tr3PoKioR5Y9P2NKtWj2nZpaoRBPbgMsI0ikwMZGdcZ9VJ69fdVdDlXU5WcbOH5Lul5oy790Qeyt3pppzblTGy/5pb/AE17+456d/pVJUzlPlfRdTY38Qrrp8RS116e5Jb1X8c0iJD/AJUCdmh+8RjiOe7QAeR8KjzLk2kuiK/DceVUHZZ1luKbF2wI4JbeVDJE4yqjQq/XB6DrnoRUNWZGFbrn07HmVhynbG6t6NdfoJ7F2LLcNwoNBzc/CP6nwqrRjWZEtIdPUkysyvHjrJ6v0NF2Lu7DbAEDif75xn07q6HGwq6Om79Tl8rPtyHvsvQmBV0pHaAKAKAKA5XgE551RSzEADmTWFlka4803ojKEHN6RW4ysttQytwq+vcQRnyzzqrRxDHvlywluT24ltS1kthzeWaTLwSKGU9D/Luq1ZVCxaSWpFXbOqXNF6MoW8W6DRZkhy6akr9pR/MVoMrh0q/PDdeh0eFxWNj5Ldn6lTdaoRmbtPXoIOlWIzMkxu6VYjIzTGc8dWYSJoMjpY8Hwq3F6onT5kbH7MN6PpEX0eRsywgYJ5unIHPUjkfQ1arlqjiON8P/AA9niQXlf6MvVSGiO0AUAUB4lcKCScAAknoAOZoepNvRHz7vnt5ry5eTP1anhjHQKOvmTrVWctT6JwvDWNQo93uyX3dh2bNCsM3Hbzj/AFyfcYnvPIDoA1RJ1taPZlHMlnU2OyvzR9O4ttDde5tCsqntEUhlnhzpjkxUZKjx1HPOlQW1WV+aJ5VxDHyk6prR+jLPsrbn06FrWSQRTuuBKMBZQOQ/kVzrris4X+LB1yekv3NTk4f4OxXRXNBPp6FVvdnSQOY5F4WH8JHQqeorTZEJVPlkbynIhfHnh0/Yl92t32uWyciNT7zY5/srXuJiSyJb9CnxDPWOuVbs0uzs0iQIihVHQfqe8101VUao8sUclbbK2TlN6sc1KYBQBQBQBQBQCNzcKil2OAOZqK22NUXOT2RnCuVjUY9SibY2o07dyg+6v8z41xWbnTyZb9PQ6TExY0x9yNJIOQcEciOYqnCTi9UXdFJaM0XY90ZYUc8yNfMc67zDudtKk+5yWTV4Vrih4RVnQgKdvZusGBmhGG5sgHPvKjvrT52Av+5X+RvOHcScX4dj27MoDpWljLQ6VMbutWoyM9RrKv8Af9B1qzB6vREiaXcZ3lsw+JGXPLiRlz5cQGatQ5l2Ja7Yy0Saf0YnsfaT2s6TIcFDqPvL9pT4EVbhIZePHIqcJLqfROy79J4kmQ5V1DD+Y9DpVpbnze6qVVjhLqh3XpEFAFAUv2p7b7C0MQPv3GUH4MfWH5HHrUdj0RuuB4juyOd9I7/fsYtAuTVObO7k9iThSqk5PUqye+xP7A25Nakdm2Y9OKJtUI6gZ+E+I/OsIZM63129DW5eBVeumkvUlt57CLEV3AOGO414eXC4GcjHLkeXUV5nQSUbY9ynw+6zWWNbu4/sJ7Pt5r6ZVZyxAALH7KDy/smqUFZl2pNkl0qcKpuK017e5qFjZpEgjQYVR/ZPjXT1VqqKjFdDkrbZWycpPdjipCM7XoCgCgCgCgOE0b0Bnm8m3+2l4UP1S6fiP3vLurk+J5bvlyx+VfqdRw/B8Kvnl8z/AEGwXADHmeXl31p+Tljq+5Pzcz09Ooi9RolRcti3PY2auVLAEnC8OcE4zqRXbcKi1jROZ4g148h423EBYMrhleNCuATmQAggg4KjXJ/ZPhWyKJKV4Cg78bBCZuIx7pPvjuJ+15GtDxHD5H4kPudHwnO5v6Nn2KU61rq5djoOpcfZtsyNjJOwDMpCLnXh0BJHif5Vu+GwTi2zn+OZE041rZFy23sqK5heKVQVI0zzBHIg8wQetbKcFJGjxsidNilBnzrdR4J8CRnvwcZqlF76H0umfNFS9jT/AGPbb4ke0bmmZE/CT7w/iOfWrdctTk/iLE5ZK9d9maZUpzIUBygML9pu1u3vWUH3YPqx5j4z89PSq1r3O94Hi+DjKXeW/wDAvu9e7PeBbe7hKEE4uUJzljnLEaqPDBGlQqUGtGQ5tObC130S1X+UfX+5ksa9pAwuYuYZCOPHio0b0+VV7caWmsNyKji9cny3Lll+hHWmz5XYIkTlycY4SNfEnkPGqKrnKXKolyzJphHnlLYse83DFFb2QPE0I4nPTiYHA/3E/KsuITUK40rsavh6lZZPIeyey+hcN0dkfR4QSPrH95vDuX0rZ8PxvBr17vqaTiOV49vsuhOitgUDtAFAFAFAFAcNAU7frbvAPo6H3mHvnuU9PM/pWo4nkuMfDj17m74Tg+I/Fl0XQp2z4wxJb4EGWPh0A8SdK0NdWr1fRG+vm4rlj1fQ7NdFyST5DoB0A8BUFj5nqZV1KEdDyiliANSTgV5GLb5UZSajHmZq1vYAQLCw0CgHpyx/Ou3oh4dcV6HDXT8Scpep6l2bGx4iuTrrrkcXBnB6Z4F+VTEY8FAJTxB1KsMhgQR4HnWMoqUWn3PYycGpLsZHt7Zpt5mjPIHKnvU8jXJ30um1xf2+h2uFkq+pT/M5sDbj2chZQGVsB0Omccip6GreJk+E9uh5nYMcqOj6roS23t/2kjMcEZjLDBdiCQDz4QDz8TyrYzzlJaRKOLwSMLNbZa6Gc3MelRVt66s6eD0QtuttQ2t1FN0DYb8LaN/X0q5W/NqRcRxvxGPKP5H0UDVs+bPY7Xp4NdqXYhhklbkiMx9BmvG9FqS01uycY+rPnewtpLu4VF1kmk5noWOWY+A1Jqk/M9EfSLZwxcfmfSKJrbuzobecwwymTgADkjGJABxBW6j9Dp5VshRjsinhZNt9fPbHTXp9Ca3R2TevmW2cxKDjiZiqORzwuCGHTP8A3WNNdslzQehr+I5OJF8li1f6r7krtjbG0YD2crKvENHRRqOvC3Q+lR5N+RUtJFfExcK7zQ1enZsb7o7P7e5BbJCe+xOuSDpknnk/pVHBrd965t0tybiV3gUOK77I1HFdUcidoAoAoAoAoDmaAi949rrawNKefJB3seXpUN9nhwbLWHjO+1QXTv8AQx+W5aRi7ElmJJPUk1z005y1fU7aFca69I9ESN+3ZKIAdR70n4z9n90Y9c1jdDljyIrUrxG7X9voM1eqUq9i0WrcXZxklMp+GPl4seXy5/KtjwvF57PEfRGm4vkqFfhrqzRq6U5cKAKA5QFV3/2bxwiUD3ozr+FufyODWp4rTzQ8RdUbjg+RyW+G+j/czeQVpa32OqT2Gsgq3BkiGU61ZgyWPUip11q9DoWluj6A3H2j9IsoZM5PDwN5p7p/SrkHqj5xxKhU5U4k9WZryqe1C77PZ0o6yFIx+8w4v9oNRz+U2/Ba+fMjr21f6Gdey1f8VIQMutvIY/xacqrw669zpuOt+DHXpzLUj9h2T3MywA/Wux4+9NcyMw6Ea8+uKpKDnNInyMiNFPP2S29/Qtm9+08OtnASsNuAhAJHE47yOYAx6k91eZt2nkjskanhmKpRd9q1lLda+gveys2zYDISW7YhCdTwjiHPrpUGTJvETl1MKYqOfNQ223+pYvZ9Z8MLSnnI2AfBdP1zVnhFXLU5epr+NXc1yj6FsrbmmCgCgCgCgCgPLGg012RiW+e9H0q6Kqfqo8oni2feb1x8gKoZKc+nY7nhfDvw9HM/mfX6HnYmEDXLD3YsBAftSt8A8casfKqcIKKcn/xmeW+aSoh36/TuNO2JJJOSTknvJ5k1VlFtlmMVHbsOtn27zSLGgyzHA/qe4VjGlzloiG6yNMHKXRGx7G2ctvCsS9Bqe9jzPzroaKlVBRRw+Te77HN9x/UxAFAFAFAIXsAkjdDyZSvzGKjtgpwcX3RnVNwmpLszGLqIqzKeakg+lcjpyya9Du65KUE/UZyCrUGToZzCrUGSRIq6WrtbLUGav7GLzitpYj9iXiHk6j+YPzq7U9jjviOtK+Ml3RodSHO6Gde2ifFvCn3pST5Kp/rUVr2Oj+G4a3yfojMtjXbwyrLG3C6NlTzHiCOoI0I8aqTk4vY6vKphdU659GXtt/5mQhYIklYYaVc58wMc/Mn1rCeW0tO5z3+CVqe8m16ELsi0EsqRs4QMdXY+pOTzY+PU1roxVk+VvRM2OTY6am4rXTsTm8W0UkMcMP8AkwDhU/eOgLeWnPrk1Hn3xlpXDoihw/GlBO2z5pbmh7uQcFtEv7APz1/nW+woclEV7HM5s+e+T9yTq0VgoAoAoAoAoCl+0/b/ANHtTEjYlm90d4XI4z8tPWsJvRaG54LhePfzP5YmJxoSQqjJJAAHMk6AVW6ndzkoxbfRE9tq8EXBarqIB77fembWQ+Q0QfhrCyvVaGtw6nY5XS/u6ey7fn1I0bRP3fzqH8P6l7wkW/cDaE01zHDGixoDxyso99lTXDOehbAwMaE1ZprUXsaLjFFddLsm229kuxslXDjDtAFAFAFAcNAZPvfDw3co6Eg/NQT+ea5TMjy5EjsuGS5saJASV7A2SGcwq1AlRGXYq7UWay9exefE86fejVv4T/3Vyo534lh/ThL3NcqwcdoZZ7bJNbZe8SH5cA/nUFvRHV/DK3sf0M7tBVO06iwlIaozK0h3GKqzI37DuEaj0qnPsiKWyNotFwiDuUfpXZVryL6HBWvzv6i1SGAUAUAUAUB5d8DJ5DU0PUm3oj563x24by6eX7A9yMfsKTj56n1qvN6s+icMxFjUKHfq/qc3dTsxLdkZ7ADs88jO+RH58OregpH1PM1uxxx4/wB3X/8AK6/mQzEnJJJJ1JPMnqSaw7mwiko6LseoYmdgqqWYnAUAkk9wAp1eh5KcYx5pPobb7Nd2/okBdiDLLjixg8IXOEyOoOc+PlViEVE4TjGe8m3RfKuhccVmaY7Q9CgCgCgCgMz3/XF0T3otc1xNaZGp1fBnrRp7lUkqGBuUNJqtQJERl3VyrqWay1ex9v8AHsO+B/yZP61eq6mj+I//AB4/X+TaqsHFmVe2xPetT4Sj5lP6VDadT8Mvez7Ge2hqjYdTYSkNUrCpIdx1VmYMdwnUeY/WqkuqIprZm02pyin9kfpXY1fIvocFYvO/qK1IYBQBQBQBQFM9qW2jb2ZRTh5z2Y7wuMuflp614zb8GxldkJvotzDxUTid1zJLcnd4/qUhtAdY17SXH/mkAJB7+FcL868kttChha2zle+70X0X8kFmsNDZlr3H2FcXL4VzFCW+sce6xwMlUPxE8uWgzWcFqabi2XTTHfeXZfyblZ26xosaDCoAoA6AaCpzhZyc5OT7i1DEKAKAKAKAKAzT2gt/isdyL/Oub4m/6/2Oq4Mv6H3KnLUEDcoaTVagSojLurlfUs1lq9j4/wAeT/8Aof8A9UdXqepo/iP/AMdfX/Rm1VOcUZx7aYfqYH7pGX+Jf+qitR0nw3PS6cfVGW2hqlYdfPoSkJqlNFWQ8jNVZkbHSVTsRGzYNgT8dvE3eg/LSusxJ89UWcNlw5LpL3JCrJXCgCgCgOGgMK9qO1+3vmQH3IQIx+Lm5+en7te6Ha8Fo8LH5n1kRG7Ea9t20gzHbqZW8SNI19XKivNC5mzfh+HHrLZf6/oRlzOZHZ21Z2LHzY5P5msGi5XFQiorstBOsOUl1NY9j1gWWS6cliD2MedcAAM3D3DJHLurOCOR+IbUpRqj9WaZWZzYUAUAUAUAUBw0BlO+c3Fdy9wIA9FGfzrlc2XNkSZ2PC48uNEr0hryBs0M5jVuBJEjLs1cqLVZd/YxBm5mf7sQH8Tf9VdqOe+JZ6VQj6s1+pzjin+1S049nuwGsbI/pxBT+TE+lYWLY3HArOXMj76/sYnbHWqU+h3kiVgNUplWQ8jNVZojY6jNU7FsRs0vcK747fs+sbEejHI/U1vuE2KVPL6HJ8Yq5Mjm7Ms9bU1IUAUAUA02teCGGSVjpGjOf3QT/KvV1JKYOdiiu7PmeeYuzO2rMSx8ycmpGj6FVFQgorsTtyewsUix9ZdMJW7xChxED5sGb0rHTYp1/wBXK510jt9+5AVjobLUWtLV5XWNFLO5CqB1JrHQxstVcHOXRH0bu9spbW3jgXHuKMnvb7R9TXp88yb3fa7H3JKhAFAFAFAFAFAJXEoRWY8lBJ8gM1jOXLFy9DKEXKSiu5lVhYG9uJMtwDDSM+M8Oumf76GuYoq/EWSeui3OwuvWJRHRavZaFflI6HI78YyOhx0r2KNlF7asZzGrUFuSrqRd2auVLbUtQ9jUvYta4hnl+9IEH7ign/1flV2lbHIfElut0YeiNHqY5wY7csRPbywn7cbL8xp+dYvdE2Nb4VsZrsz5wwVYg8wSD5g4NU5LY+mxkpx5l3JK3aqU0V5IexGqs0QsdxmqliMGiz7j7Q7K4Ck+7IOH1+yf5etT8Nu8O/TszUcXo8SnVdYmm11ByYUAUAUBTvavemPZ7gc5GVPQnJ/IVnWtWbLhUFLJWvYxXY2z2uJ44F5uwGe4faPoMn0qZrQ62+/wqnP0HO820hcXDumkYwkY7o00THpr61joY4dbqqUX1e7IuvGi3roa17Kt0zGPpky4ZhiJT0U83I7z08Kjexy/GeI+I/Bh07ml1ic+doAoAoAoAoAoCt79bQ7O34Afel93937X9PWtbxO7kq5V3NpwmjxL+btHcqNu/wBHsHl5PdN2Sd/AueI/k35VRx14OM33l0NvYvxGaoPpBasi92NnCe5RWH1aAySd3Cg0Hq3D6ZrLDqUprXoi5xG91UeXq9kQO1rlXkkkRQiM7FFHIJn3cDvIwfMmpdnJyXQvYkZQrjGe70Wp73m2IttDbMzN28yF3TThUfZx1zyHoaucvKkYYObPItsil5Y7J+5rfs82f2FhCp5sDIf3zxfoRVuC0Rx3Fr1dlSku2xZKyNdzHaAwL2hbKNvfS6e7ITKv75y3+7NVrFufQuDZKuxo69VsRNq9U7Il6xaMkYmqnNFdjuNqrTRGxzG+NQcEcjVOeqZHKOuxrO7m1BcQq+ffHuuP2h/XnXVYeQrq/fucVm4zx7XHt2JUVcKh2gG192nZsYuHjAyob4SR0OOWeWa9XUyjpruZT7S94Y7q2txHkHtJO0jPxI8YA4WH7x161bor5Wzb8PplXY2/sVjYQNvbXF3yJH0aH8cusjDxVAfmaTXm0NtbNXWQq9N39iM2ZsW4uCFhhd89QML6scAfOsXoupdsyaql5pJF+2Hurb2TI10yz3THEVqmGHH+15feOANTUbbZpMriFtycato+prEWcDIGca45elQnPPqe6AKAKAKAKAKA8MwAJPIamvG9Fqwlr0Mq3k2g11cHgBYZ4I1HM+I8Tzrl8m2WTd5enY7HBoji0c03o+rFrbeZAgt7q1V0j93QYdemqt18iKu15Oi8O2PQhnw6Up+Njz0b3JDZ1vZvFcR2NxwSzqFxLniRRzVQcHUFtcnn4VdpVWj8PuVL55MbIPKjrGPp3K3Z7lXX0qKOWLEXGGaRWDJwJ7xHeM4A1HWsa8ecXv0Nndxeh0ScHu+i+pH7bP8A9R2qUTVWkWNfCOMAMR3cmPrU6809ixjf/C4fzS66a/dm5xoFAAGgGB5CrRwsnqz3QxOYoelC9rmwzLbrcL8UGc6c0bHF8sA/Oo7Ftqb/AIBl+Fd4T6S/cyG3fBqnNarU7Wa1JOF6pzRWktB5G1VpRImhwjVVmiPQnd2tsm2lDc0bRx4d/mKzxMh0Wez6mvz8RZENF1XQ1OCYOoZSCpGQRyINdTCcZpNdDj5QlBuMluhTNZmJ5Lgc8a0C36GJ+1XZQhvONVwJ148AfaBw3z0PrV/HlrHR9jd4NusNH2IzelexS3susKdpL/8A2n98gjvVCo8iKzgubWRNjybm7PX9kMbC7uXxEty6J+1OY4lHjlgAKylCKXQmnyfM46/bc1b2cbtwxBrgP20radvg8GPtCEnVh0L9cVStm3safLyJS8umi9C84qAoHaAKAKAKA4aAM0BTd+NvcINvGfePxkHkPu+Z/StNxLLSTqg9+5vOFYLk/Fktl0KJBdvG6yI3CynIP98xWpocoPWJ0dlUbYuEujLLDLBtT6t1EN2FyJFGVkC946gZGhOnQ1uocmSvMtJeppZq7hz5ovmrfZlP29sma1fgmTGvuuNUb8Dd/hzFRuqVcvMbrEy6cmPlf27iNpvddwAok7MhUrwyEuBkY90nUfOrVcpLuZz4VjWtNx0ftsWn2O7EPE92w0wY48jmSRxsD6Y+dWao6I0/xDlaJY6+rNWqY5UKAKARvLdZEaNxlXUqw7wwwaMzrm65KceqPnfePZLWlzJAwPunKn7yHVT/AH3VUnHfQ+j4GVHJoU+/f6iVtLVSyJNOI/jeqsoldpdWWC23cu2TjW3bh5jOASPBSa8eJbJaqJrp8RxlLlcxkQVJVgQQcEEagjvFa+2vTqWoyUo6roy07pbydgeykOYydD9w9f3auYOd4L8Ofymn4jw7xv6lfX9zRYpAwDKQQdQRyNdHGSa1XQ5eUXF6PqRm3XynZ/R2nLfYGAo8WckcOO8a1LDr1M61310M2m3YuWvrdZ/8vLSiLtmmZY4sFhkjPvHA/wDirisiotr6GxjfFVvl+gw/+zb2+d7kdliV2Jy+Cpzgoy40K8seFe+NGC0M1lQqjyPsWPYPsrVGD3Uokxr2aZCnzbmR8qhsyddkQW8QbWkNjR4IlRQqgBVAAA0AA5AVV1bNc3q9WKUAUAUAUAUBw0BXN6d5FgUxocynT8GnM+PhWszc6NUeWPzG04fw+V8uaXy/uUPZdkbqUoZVVmBILHV26Ad/XNafGoV825PRnRZN/wCFrTjHVL07DDatjLbvwSoVbXHUNjqh6/r4VNKidb0kibHyKr488X9fYmWY7NteLld3IwB1hi118+XqfCthCPgw1fVmv0/H5Gmv9OH6sjdk73AJ9Gvl+kW7YGW1kTuOebAaHPxDxqWq16cs1qixkcKfN4uM+WS/Jlf2ps6J7zsLN2lR2VUJ11bpnqB3+B7qkUVrpHobKjJsrxfEyFo11N32BspbW3jgTkg1PeSSWPqSatpaHA5V8r7ZWS7kjXpXCgCgOGgKb7St2fpcHaRjM0OSoHNl+0vn1HlWFkdUbjg2f+Gt0l8r/wCamJxPg1TlHU716NaroWTdFka8txJ8JlXny4hkpn97H5VFCKU1qaviSnHGnyen6G81tNj58Zh7RAgvBw44jEpfz4mCk+OM/IVo+IxXPqjrOCuTx2n012/QryNWpnH1Ns010J/d7eSS2PCfej+53eKnpVjFzZ0PR/KazN4bC/zR2kaJs3akU68UbZ7xyYeYro6Miu5axZy1+NZS+WaInYI7a7ubrmqkW8fdiPJlI83OP3auz8sFH7ix8sVEnILNUZ3XTtCGYdOIALnzIAz5VFrsRNtoc14eBQBQBQBQHM0B4kkCgkkADmToKxbUVqz2KcnoluUzePfIAGO3PeDJ0H4O/wA602VxP+yrr6m9weEuTUrfy/kh4NiIEFxezGJX1VBrK/nzOvPAGagqwopeJe/5Lk82Tl4ONHVrv2IzbgsuFTavKW4veV+IYAGeIZAOc45GvbI46/7TepbxPxcpON6Wg92LvgBwRXqCWNWVkkI4njKnILD7WDjUa+dXMfJeiVnQq5XC3o54z0b11XqNN9tjzM7XqP8ASIZdQ6alFA91SBzUa6j176ktqblzLdEvC8yuCWPNcrXr3KFNJmvYROkSSRqfsn3ZKL9MkHvOMRDuQ829enh51brjocfx/iHiS8CD2XX/AJ7GkipWc2doAoAoDhoAxQGQe07dAxM13Cv1bnMigfAx5vp9k9e4+dQWQ7o6/gfE+aKose/b+ChwS46+XeCOoPQ1WkvQ6SyCkmmXWy3+vVjCdojYGA7Jl/UggE+lYvImtjRW8ExXZro17ETJdNIxd2LOxyzHmTVCzWT1ZerqhXFRitke0eq8ojQWV6glAx0Fo79ocyIxVlGQVOD4D1NSYlc3fFRfcrZUa3W+daoumzdvLYrHbOnHwopkcHXtX96QkHxPfW7y+JxqvcGtUu5z8OGzyIeJF/RexZrHb9vL8Mq5+6x4W+RqarNps6SKNuFfU/NFkkGq0mmVGtDua9AZoAzQDa62hFHq8ir5sB+VRTvrh8zRLCmyfyxZXdpb7xJpEpkPf8K/1rW3cVrj8i1NnRwe2e83oimbV25NcH33PD0QaJ8uvrWouyLruvT9De42FVTrypa+vcR2JGJLmBG1DSLkd4GuD4aVJiVJ3RT9TPNly48pLroKb43jPeTcROEYIo6BQqnTzJz8qt5TbtaZhwupRxotd92QDvUcYmyS1OR2ksiSSIhZIhmRtMKAM65OeXdVmFTerMZX1QmoSe76BsHemayfMZ4kPxxMfcbxH3W8R65q1U5RW35GOXw2vKj59pLuuv8AuSW5O7TbQuWnkULAHLOFXhRmOvZoOQHLPh51YhBvdlPiecsKlU1vWWn3RtkaAAADAAAAHQDlVg4ltt6s9YoYnaHoUAUAUAUAlNErqVYAqwwQeRB5g0PYycWpR6oxTf3ctrNjNEMwMfEmPuDfs9xqvOGh3HCeLRyY+HZ837lTimxVaUNTdOOuw/imqvKBDKA6SSq7iRNCyyVE4GLQ72bEJbiGI/BxGWTu7OEcZz5twr61sOGVqEpXPsjT8WsahGpdZCl1dGR2c82Yn5nNai1OUm/Vmwqr8OCh6I8B6gdfoZ6Dq32nKnwSOvkxrNWWw+WTIbMaufzRRIwbyXh0SV20zgKrHA6/DyqeOVlvpIqTwMNfNFfmcO9d3/5z/Cn/ALa8eblLrP8AYy/wzFfSP6s9xXN9cfCZXHeNF+egrKP4u5bNswlXhY782iFhuhdsMtwA9FaT3j+RFSf4bc92/wA2R/4pixflT/Ir95E8bmORSrLzB568iO8eNVpUOuWjRs6rY3R54vYt11NbG2tIZ04RLH7swwOzcAYLeBz/AFrdONUqoRktNTQRV8ciyyt68r6eqKttC1lsbhC2MqwkjYfBIFIOnpoR0z61UlTKial7m5qtrzKZJd1o16NkzvPsz6Wgv7QcYcDtYx8alRjOPvDABHrVy6pW/wBSH3KGBlfhZPGv206MoxLFuAKxflwcLcXlw4zUEa2b9yjy8ze3qWq8Q7O2ZJHLpcX3+n1ROHBz5An1bFXlHkhp6mlg/wAfnKUPlh39yvbnbqyX8mnuxJ8b/wDFe9v0rKuDbNrxLicMSG28n0N12bYRwRrFEvCijAH/AH1NWkjgLrp3Tc5vdjoUIztAFAFAFAFAFAFAJXEKupRgGVgQQeRB5g0MoSlCSlHqjId9/Z88Baa1UvFzaMavH34+8v5ioJ190dhwvjcbEq79pdn6lDilxUDimdE1zD2Geq0qyKUfYdJLUMoETiPNm3IVZ3z77hYFHUIDxyn1bhX9091WpyVeNyLq9zS+BO3N8SXyx2X1OCStZyG2a3PYkrFwPND0JKxcDxrUuG7d0tlAlxIPeupURc8xCDq3lrxeorZ4yjRWpS/uZoM6Ly7nXDpBPX6kDvFaGC5lj6cXEvir+8Plkj92qWVTyWtLubPAt8aiMvs/sTWxbpzsu5EblWik4gVOG4fcZv8AlVrHcliy5exrsyuCz4OS2a/XcqT3BJ4yzcQ1DFjxA94PSqS1b67m7VMUuXRaehZ98JjJaWM7/wCa44W7yvAWz81U+tbHIXPVBvqafha5Mi2uL8p52pYy3FnYCGNpG4WBxjAGObE6Aada9nVKdUOXcUX10ZVzseiHdqIYoBZbQuY24iqxImWaA6jWQaKASACQMa8xysQglDw7H/sV7HOdrvxINadX6/YrW04bvZMxZJCFf4ZRgxygagOvLiHd8tKiUJUy0XQ2tE8fiUFGxeZdV3R2T2nXxGAIAfvCNuL83x+VT+LLoZf9PY2vWX01O7ubrXO1JTc3DsIyQTI3xOPuxDoPHGNetZwg29WYZfEaMCvwqF5v2Nh2bs+O3jWKJAqKNAPz8zU6Rxt107p883qx3XpGFAFAFAFAFAFAFAFAcoAIoCjb3+zuK5zLBiKU6kY+rc+IHwnxFRyrTN7w/jdmP5LN4/qjJdq7KntX7OaMoeh+y3ip5EVBKGh2GPl1ZEOaD1/cQS4xUMoE7gOY7ionW31IeRIcLNUTgYOIoJawcDHlHux7Q3M8cA/1GwT3Ko4nPyBHmRWVdLnNIrZd3gVSs9C3b27Burib6qJeyjQRRjtFGgHvHHTJxp4CrORROyWkeiNLw/Mx6a27G+aT1ewjvtZy/RrW5lThkUCGYZBxz4GyNMZH++vcqtuCk+vQz4VdDx7KovZ7oT9nEyvLPbt8MsOcfhJDY9GFY4a3cX3M+NQcYQuXVMay3+y4SVW2mnZCVPaNhSVOCGDHGMjurJKmD2RlGniF6UnNRT9CG2/vBJdSB3AVVHCka/Ci6aZ0ydBriorJOZssPBhjQ5Vu31ZO7Sv5E2LblJGTMvAxVipK5bTI1xpVnRqlaGrpphPic1JJmfvPzx/eaj8Pc6dQ22Ja22teXEK2KcUqZ91ODjYDOg4jnCg8j076nXM1y9jX2YuLj2vIl5X+S/Ive6Xs0VCJbzDt0iGqD8Z+15cvOpo16dTQcQ4/Kfkx9vfv/saOiAAAAAAYAAwAOmBUpzjbb3PWKHh2gCgCgCgCgCgCgCgCgCgCgOUA12js6KdDHLGrqehH6Hp6V5pqS1XWVS5oPRmf7weyxG960fgP/jckr6NqR+dRyr1OhxPiKUdr1r7oz7bG7l1an62FgB9se8n8Q5etQyg0dHj8Rx8j5ZfYjFmNYciLmiYotzWDrRi4Fw3T2jFa21xeF1NxjsoY8++AcAtjuyfklZ1xUYuWv0NHxGm3IvhRp5erfYq4vm59o+ep4mGT1Oh76i5Hrqbb8PWl8q29kXPcq8F1b3VjJJqy9pEzsTgjA5k50bhPrU1a5oyizRcToePfXkQjt0ehB7nbVEF9C8h4FBZZM8gGVgcnwbFR1LlkpGx4lju7FkoLV7NfmMN4bhPpU5hYNG0rOrDlhzxHn4k17KEXJtFjBhZ4EOfZpJP7EY0xr1QSLiST2JqwF9dwpaxK7xI2QoUBc5OSXx4nrUiTa5TXWvExrHfJpS/52LdsD2VsSGu5ABoezjJz5M2NPT51KqvU02X8RdqF92aLsfYkFqnBBEEHU6lj5sck1Kkkc5kZdt8uayWpIYr0rgKHh2h6FAFAFAFAFAFAFAFAFAFAFAFAFAFAeSKDXQgtqbn2VxkyQLk/aX3G+a1i4Jl6jiWVSvLMrV97J7dtYppU8DwuP0B/OsXUjaV/Ed6WkopkNceyacfBcRt5qV/rWHhF2HxLX/dBjJvZbfdGg/jYf8KeEyb/AKjxv8rPP/4svjzMH8bH/hR06h/EeM/7X+g8tvZPcH45418gzf0p4RHP4kqXywbJiz9ksI/zbiRvBAq/mQayVKKVnxJc15IJFj2buNYw6rAGPe5Ln86zUEjWXcWyrVpKWn0LEiADAAA7hyrI17k2e6HgUAUAUAUAUAUAUAUAUAUAUAUAUAUAUAUAUAUByvTwKHgV4ZIK9PEFDIK8PDhr1HqO0PO5yvBI9UPAoehQBQBQBQBQBQBQBQBQH//Z\";\n } else if (license == licenseChoices[1]){\n var badge = \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxMSEhQSEhMVFRUWGBoYGBgYGRoaHRgbHhgYHRkgHR8bHyghGh8lHRYaITEhJykrMC4uFx81ODMsNygtLisBCgoKDg0OFxAQGSslICUtLS0uKy4tLS0tKy8tLS0tLS0tLS0tLS0tLSsrLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIALwAyAMBEQACEQEDEQH/xAAcAAACAgMBAQAAAAAAAAAAAAAABgcIAwQFAgH/xABNEAACAQMBBQQFBgkICQUAAAABAgMABBEFBgcSITETQVFhInGBkbEIMjVCobIUI1JicnOzwdEVMzR0g5LC8BckJTZEVILD4RZjk6Px/8QAGwEBAAIDAQEAAAAAAAAAAAAAAAEFAwQGAgf/xAAxEQEAAgECBQEHAgYDAAAAAAAAAQIDBBEFEiExQVEGEyIyYXGBkbEUQqHB0fAjM2L/2gAMAwEAAhEDEQA/AJxoCgKAoCgKAoCg5uva7b2URluZVjQeJ5sfBR1J8hQQ5tRv3Y5Swg4f/dm5n2IPiT7KCO9Q2r1S8Ys9xcNnuRii/wB1MLXi2Sle8tjFpM2X5KTP4acb6hEQ6vcqw55V3B+w14jPin+aGa3DNXWN5x2/Q4aLvn1K3IFwEuFHUOvA+PJlxz8yDWWJiezTtS1Z2tGx5sd/Vmw/G286N+bwuPfkH7Kl5al3v/hB/FWcrD891X4cVBv7P787SaRY54Xt+I4D5DqP0jyIHniglaNwwDKQQRkEcwR3YoPVAUBQFAUBQFAUBQFAUBQFAUBQR7vG3oQacDDFia5/Iz6MfXm5Hf8Am9aCvWu67dajP2k7tI5Por9VQe5R0AqLWisbyyYsV8topSN5l1tJ2cVMNL6Tfk9w/jVVn1szvFOzseHcApjiL5+s+nhv32rRQYU9cfNUdP4Vr4tNky9VlquKabRfBPf0hq2WutK2EhYjvOeQ+ysuTRRjje14aml41fU35ceGdvXfo3dUgLphVUseWW+qPGsOC8Vt1mfx5b3EMFs2LlrSu8+Z8fUuvpVvFzlm4vzVxVjXUZr/ACV2+suYvw3Q6brnzbz6VYP5SjHKG3X1tljXv3F565L/AKdGvPEMFPh0+CPvPWWpe6h2gAMaKR3qMe+suPFydpmfu0tTrff12mlYn6Rsn35PmuyT2csEjFuwcBCe5GGcewg1maKVqAoCgKAoCgKAoCgKAoCgKD4TjmaCEt6G9/hLWumvzHJ7gfaI/P8AO93jQQdJIWJZiSScknmSe/10Hc2dvIohkhmkY4AUcwPbWlqsd8nadodDwfVYNP1mJtee0Qa3kbgJC+ljkp8e7NVNa1i8RM9HYXyZZwzaldrehQ13S2jCyM3EXJ4j3A9w+NXGnz1vvWI22cTxTh2TBNcl53m3c16XEEiQD8kVU6i2+SXY8NxVpp6REeHO1JY5X7KRpI2+rhvRb1Z5Z8uVbWKb0rz12mP6qvWRh1OX3Oa1qT469J/s5OraEIQrBiyk4bOOVbWDVzl3jbZT8Q4NXSTW0WmYmXQu40jdIRJ+DxMjM0gXiJIViB1BJYgL1+t4UwR7ze1+sp4le2lrGPBHLWY7x5/JdTTJSiy8JEbuY1c9C4AJGfHDCtyekbqCtZvO0dzZu427k0iZ1eLjhkI7RMYcEdCpPwPI+VKzExvBelqW5bd1ldn9oLa+iE1tKsi9+OqnwYHmp8jUvLqUBQFAUBQFAUBQFAUBQeJ5lRS7kKqjJJ5ADzoIO3ibU3+qMbTTIJzb5w0iqy9t6icYj+PqoEXV93c9lF219LDAPqxhuOR/JVHf6zioCYakNGx1oPSlI59B5eNVnEMkxtWHWezmlrMzlmPsZ6qnYMdxGrKQ4BXvz/nlXvHNon4WDPTHek+922+rh6pqsfB2aGQkcgUyMe3vFWGDT5Obntt+XO6/iWnjH7rDN94817ODYEPKqzlypOOZPI93Wt/LvWkzj2c7pZjLnrGom0xPrMm28njjAjlU8B5cR5j294PnVTSl7zzVnq7PUZ9PhpGLNWeSe094Yr2EtGvZhZkAxwk5yO4g+Ne8eTa88/SfVr6jT82KJwRGSvp/iXLXTRJhMXEQzkKfSUHxHPl662p1Nqx3rP5VFeFYsttuTJSftvDqDRFZOCU8ZHR8YYD99ac6u0W3p0+i6jglL4uXNbmnxPmHM/kq6tX7S1ldSPrIxRsew863sWux26W6KDV+z+oxdcfxR9O5v2d30X1tiO7jFwo5cTDgkx6xyb3e2tyJie0qLJjvjna0TH3SvsxvQ069wol7GT8iXCn2HoffUvB0U55jmKD7QFAUBQFAUBQFB5dARggEHqDzFAhbyN5UGmIYYuGS6xyj+rHnvfHTlzC9T5CgrXrWrzXcrTXEhkkbqT3eQHcPKgw2No0rBVH+cH+Brza8VjeWbDgtlttWDhsuuIMd4Yg/ZVNrut3c8Ary4Jie8S65rTrG87Lu1orEzLR06bteNz83iKqO7A/j+6tnNWMURWFZoc06rmtbt4bojHgPdWtNpWUY6x4h5eFT1UH2Cpi8x2lFsOO3esS170K2ImGQ4P2Cs+GbRvePDR1sY8nLgtHcrrdPZTMmeJPDxB6HyNWc46amkW8uTrqcvC9TOPfevoabDUI5hlD6x3iqnLgtinq7DR8Qw6qm9J6+nlt1hbz5Q2Y57dXGGUEede6ZLVneJYc2nx5Y2yViS5rmgxojSIeDHceYPkPA1Z6XV3vPLMOU4rwXBhxzlx22+h63F7bXH4SmnysZInVuDiOTGVUtgHvBx086snKJ/oCgKAoCgKAoCg5O00lz2DLZoGnccKsxAWLP12zzOOoABJPdjNBEdzu+sdMja+1qdrqRjkRqSO0c+sh5D5kgY6igjHazaJ71uJIUgtkOI4o1ComemeEDiY+JoPWxkg43U9cZHs5fvqv4hE8kTDpfZu1ffWrPoaIoVXiIGOI5Prqqve19t3Y4sFMUzNPIuR6Dc8eiefhyr1h+eGPW/wDRZwNkr0YaI9clh5+Pwrf12KZ2tDnvZ/V1ibYrT18GSqp1e4okvbR3LRSRSDoM+3xq00dIvjmsuU43nvp89MseC1qV320jPjGe7wHdVjixxjryw5fWamdRlnJPlignZGDISCPCvVqxaNrRuw4c18VotSdpNWl7SK2Fl9Fvyu4+vwqrz6CY60dhw/2hpfamo6T6+HfVgRkdKrprMTtLpq5K2jes7vtQ9bl/ay2dghB9EHB9Z6GrLQ3rXffu5f2h0+XJFZr28tjdiht9atUY8+Ph9fEpA+NWdLxevNDktRgtgyTjt4Wqr2wCgKAoCgKAoCgx3LlUZlXiYKSFzjiIHIZ7s9KCNNR2EFzIdR1ucFY1LdghxFCo58PF1bpzIxk0ENbc7XC7bsbaJbezjPoRIOHjPQO+PnNjx6UC9pV4YZA/sPq76xZsfvKzDd0GqnTZovCQY5AwDA5B5g1z168tpiX0rFkjLSLR5YdRUmJwvUqce6smn2jJEy1uIxadPaKdypp2kuyiWF8Op5qeWDVvl1Fa/DeOkuO0fDMuWPe4LfFHeJNVvcnhXtRwO3LHiR4VU3xdZmnWHYYNVaK1rn+GzZrA392hrWn9vHw9GHMHzrZ02f3V/oq+K6D+Lw8sd47EtbTgkCTAqOhP7x41d+8i1eanVwX8NOLNGPPGz1qGlvFz+ch6MOYNeceat/v6Peq0GTB1718TDGLodj2fZpxF+LtOfFjGOEc8cPf0rM0XUSV4TK1vMJIYioy3Li4unCp59QencM1hyYKZPmhv6TiWo03yW6enhtJtSynEkWD5Eg+41p24dHiy8xe1Foj/AJMf6S2k2kgcYcMM+IyPsrD/AAGWvWsw3q+0OkyRtkrMMuxcTXWtWxhzylV8juVBlj7hVlgpNKRWXKcRz0z6i16dpWqrM0RQFAUBQFAUBQFBHm8rRr3U3Wwt/wATbAB553Bwxz6KKOr4xxHHLOOYxigSNr9FsNn7ZViHbahKD2cr4zEOhdV6L3gd+e/lQQy5OTnrQNGyN+TmI88c18vEVWa/DG3PDrfZ3XWmZw27Gaqp13dpGy4JDJHgcXz17m8/IitmM8Wpy3Vs6KcWX3uDpv3j1fdUs+1jKg4PVT4EdKjBl93f6J4jpP4jFO3SY6x93HsNouE9nOCCDji/iP31uZtFFvjxqTRcdnDPudTHbpv/AJh3obpHGVdSPEEfb4VX2xXrO0w6TFq8GSvNS8TH3at1qNt0d4z5fO+GazY8GfvWJaeo1/D9tst6z/X9t3Nk2hgQcMaFh4Ywv28/srYjRZbTvayrvx7RYqzTFSZj8RH+/hiiitLkcvxTnuzjn5dxrJM6jB/6hr0x8N18b/Jf03/2GObZVx8yQHyIx8M1NeIV/mjZjzezOSI3x3ifv0/y0ri5uIO2V+RmUKzHByoIOAe7oB6q3aZaZI3rKh1Ojzae22WuzXgv04i0kKMOzKBR6ADcOFc8PMkH0vMjnWRrJv8Ak7bO8EMt+49KU9nHy6Ip9I+1sD/oPjQTHQFAUBQFAUBQFAUHiYkKSoycHA8T3UEP7V6AbJDfS5u9WuW4YVA4kiOOZjTHMIvee8jlQQxtBoU1qQLllEz+k0fFxOueeXx80nwJzQdfY+1ARpO8nHuqq4hkn5XZezmliKTlnuYarHVPtQPlSOHtFpsTAyO/A2OvXix05eNWOkz5N+WI3c3xrh+ltWc17cs/v+Caat3ET0noZdj9hbzUWAgjxH3yvkIvt7/UM0Ql6y3C2YQdrcTs+OZXhUZ9RBP20HO1ncGMZtbvn+TKvL+8v8KBTu93GtWn83GZV7uzYOP7p5j3Vhvgx3+aG7p+JarB0x3n9/3bOzW6fUL6TjvOK3jB59p88/oJ3es4Fe60rWNqwwZ9Rlz25slpmUyaNu3023hEP4LHLjmXlVXdj4kkcunQYHlXthNMECooRFVVUYCqAAB4ADkKDJQFAUBQFAUBQFAUBQcbazU0tLaW7aJpOyQ/MA4gDyOD9Ud5PlnuoKmbQ6glzcPLFD2Qc54eJnJJ6kluZJqN9kxEzO0NrTdLmwOOQwp15tgn2d1aebPj3+GvNP2X+i4fqtt75Pd1++0/oarSIKoAJPmTkmqjLaZt1jZ2elw1x44rWZn6yz1ibTG8qghScE9POslaTMbxDBkz0pblmev7l+/0xpC807EIuSqDwHwqyxZ612pTv6uX1nDsuab59Rbasdo+jd3SbKJqN/iVcwRAyOPHnhVJ8z8Ksoclbbedlo7W2SNFSNQiKMKqjAA8gKlDLQFAUBQFAUBQFAUBQFAUBQFAUBQfGUEYPMGggHeruwe2dr3T1YxEkyRICWiJySy4+p5fV9XSJiJ7vVb2pO9Z2I2zUsBPpfzvi5z/AHartZXLEfD2+jqeCZdHM/H8/rb+xmFVLsImBmo2Tu1b+1WZDGTz6jxB7jWxhyWxzv4aGt02PU45p5/qU7u+njV4JMkEYBPXqOYPeMCremPDkmMlXFajVazBW2nyTO3++U6/J50zs9PeYjBmlOD4qoAH2lvdW0p0p0BQFAUBQFAUBQFAUBQFAUBQFAUBQFAUEX7wd0MF5ma04befqRjCSHOckD5p8xQ7Im1XStT0w8NzAzJ3OPSX2OOntrVy6SmTr2XOi43qdP8ADM80ekscG08LfO4lPqzWhbh+SPl6uiwe0eltHx71n9WHVb6NwJIZQJF6c8ZHeKyafDevwXr0lrcR1mDNEZtPliLx+C/f3r3DrxYzyUDuqxx4q442q5jWa3LqrRbJ3W62N0k2ljbW5xmONQ2OnEebY8fSJrI1HZoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCg8ugIwQCPA86BS1XdlpdwSz2qKxJJMZKZJ7/RIoFS63DWTElLi4QeGUYD3rmgwJuCts87uf2BB+6gljTbTsYo4uJm7NFTibGW4QBk45ZOKDZoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgKAoCgV95W0L2GnzXEQHaDhVM8wGZgMn1DJ9goK/aPvT1KKdJZLl5U4hxxtghlzzA5cuXhQWeN1xQdqnfHxrnzXIzQVi1TevqspP+s9mOfKNVX+JoLK7LztJZWsjkszwRMxPeTGpJ95oIM3i7zdShvrm2ilWNI3KrwoOLHdknOaCSty+rzXWmiW4kaSTtZAWbrgYI+NA+UBQFAUGOedUBZ2VVHUsQAPaaDzLdIq8bOqp14iQB7zyoMNnqsExxFNFIR3I6sfsNBtswAyTgDvNBoRa5as3AtxCzZxwiRCc+GAc0HQoCgxXFyka8Ujqi+LEAe80GlBtBaOeFLqBm8FlQn3A0HSBoPhNBj/CU/LX3igPwlPy194oD8IT8tfeKDT2g0aK8t5LacExyDBwcEYIIIPcQQD7KCJdH3P2VtdI9zfpIisCkR4YyzZ9EMS5z6gBnyoJnmHosPI/CgpJN84+s/GguLsV9H2X9Wh/ZrQVm3tD/AGtefrP3CoE0fJ9+iv7eT4JUiS6DVvNRhh/nZY4/03VfiaDDaa5aynEVxDIfBJEY/YaDoUFS96N3MdRuopZpJEjmfs1diwRScgAHkMAgeyg0pbzUNRWKH8dOkKhERQxVQOhwOXFjlnrUDnMlxZTAkSW8yHI6oy/5+2gZNoNutR1RY7cliAoDJED+NP5Thevq6UCxqWlzW7BJ4niYjIDggkeIoJ73A7UzXUM9tcSNIYeExsxy3AcggnqQCBjP5VSJB2v2gSwtJbqQZCD0VzjjY8lX2n7M0FV9pdqLzU5szOz5b8XEueFM9Aqjv7s9TQGsbE39rEJp7aRIz9bGeH9LHzfbQOu6jehLbSx2l25e3chVdzkwk8hzP1PI9KCdtqoGlsrlI142eJwoHPiJU4AoKtf6PNU/5Gf+5QaGsbL3looe5tpIVY8ILjGT4CoGpo0LPcQqilmMi4AGSfSHdUi029Fiuj3ZBKkRDpyPzl8KCsWyf9Ntf10f3hQXJm+afUfhQUjm+cfWfjQXF2K+j7L+rQ/s1oKz72/pe7/T/wAIoJn+T79Ff28nwSg0d9+1uoWIjS2xHFIP54c24h1XnyXlzz19VBB0On3t85kEc9w56vhnJ9bGg1dQ02e1cLNHJC/UcQKnl3j/AMVCFhNxO1s17byw3DmSS3K4dupRgeHJ7yCp5+GKlKGt7H0ve/rP8C0E6biowNJiIABLyZ8/SPWgjH5RaAanEfG1Qn/5Zh8AKBs+TdAv4PdPwjj7RRxY544emfCg5/ylkGbFu8iUe7s8fE0Gj8m0/wCt3X6kffFB0/lJagwFpbgnhPHIR4kYAz6ufvoFDcLZiTVkZgD2UUkgz44Cj79BY/V7RZYJYnAIeNlIPmpqBS+dOFmXwJHuNSLf7AXZl02ykbmTBGCfEhQpPvFB2by6SJGlkYIiAszHoAOpoKn7x9sX1O7aXmIU9GFPyV8T+c3U+wd1BJe4bYVk/wBpTrgsCIFPger+3oPaaB93tfRF7+rH31oKw7J/021/XR/eFBcmb5p9R+FBSOb5x9Z+NBcXYr6Psv6tD+zWgrNvb+l7z9P/AAigmj5Pv0V/byfBKBu2yt7J7f8A2jwCBWVvTOBxDOPMnryoFKTfDo9uBHF2jKvIdlFhfZxFaCMN7+3Vrqn4P+DrKDFxZ7RVHI46YY+FAwfJpH429P5kXxkoEPex9L3v6wfcWgnXcX9EQ/pyfeNBGXyjvpKH+qp+2noG35N39Euf1q/doOd8pf8A4H+2/wC1Qc75Nv8AS7r9SPvrQbnylLY9pZyd3C6e0EH99AvfJ9mC6qQfrwSKPXlG+CmoFjr2ULG7HoqsT7ATQUrumy7kdCxP20Fud29uY9LslPXsEb+8OL/FUiJt+m3vau2mwH0EP45vymHMKPId/n6qBP3WbFtqV2AwxbxENM3iM8kHm32DJ8qC1ccYUBVAAAAAAwAB0AHcKBT3tfRF7+rH31oKw7J/021/XR/eFQLkzfNPqPwqRSOb5x9Z+NBcXYr6Psv6vD+zWgrNvb+l7v8AT/wigmj5Pv0V/byfBKCMN+W0r3N+9uCwitvQC9xfHpNj249lBg3YbtzqqySvN2UUbBDheJmOMnGSAoAI58+vSoGTe3sJb6V+D9g8rmXi4u0KnpjpwqMdfOgaPkz/ADr/ANUHxmqRH+9j6Xvf1g+4tBOu4z6Ih/Sk+8aCMvlHfSUP9VT9tPQNvybv6JdfrV+7Qc75S/8AwP8Abf8AaoOd8m3+l3X6kffWglbebsr/AClYvCoHaqeOIn8od2e4EcvdQVisLq50y8WQKYp4H5qw9YYHxUjI8waB42m30XN3bPbrAkJkHC7qxJx3geGagL27jYeXU7hV4WW3UgyydAB+Sp72OMeXWpFgt5mtvp2mSSW4AZQsSeCA4UEeodKCqEshZizEkk5JPUk9SahCRdj9676dbLbQ2cRAJZmLNxOx6k49g8gAKlJi0/fndzSxxJZwlnZVHpP1JxQSRvXz/I95nr2Yz6+NaCseyf8ATbX9dH94VAuWRUimG0elva3M1vIMNG7KfPnyI8iMH20E/bmdvxeIli0fA8EKgNnIcLheQ7uWDQRhvx0p4dUlkYehMFdG8eQDe0EEe7xqB3Nym8AWxj054siaf0ZAccJcKMEeGVHvNSOFvt0F7bUpZSCY7j8YrY5ZPJlz4gj7aDHu23kPpSyx9iJY5GD44uEqwGDjxyMe4VA09v8AbafV5FZogiQqeFVy2ASMlj7BQdfcZtG9rf8AYiNpEuQEYKMlSpJVvUMtnyOe6pE6anu+064leaa1R5HOWYluZ9/lQdnRtIhtIhDboI4wSQozyycnrQc7XtjbG9kEtzbrI4UIGOfmgkgcj4sffQbWz+zttZKyWsQiVzxMBnmcY76DHtDsvaX3B+FQrL2eeHOeXFjPQ/mj3UHjZ/ZGzsmZ7WBYmYcLEZ5jOccz40HcoOHtFslZ3wH4VAkhXo3MMPUy4OKDgRbodIU5/BifXLKR7i1A46bp8VvGsUMaxxr0VRgCgxa3o0F3EYbiMSRkglTnqDkdKBd/0X6T/wAmnvb+NAf6L9J/5NPe38aDZ0zd9ptvKk0NqiSIcqwJ5H2mg72qadHcRPDMoeNxhlPQjIPxFAu227bS43WRLRAykMpy3Ig5HfQNlAubS7DWF+we5gDuBjjBZGwOgJUgnHnQYNm93un2EvbW0JWTBXiLu3I9eTHFB1toNnra+j7K6iWRQcjPUHxBHMeygW7DdPpUMiypA3GjBlJlkOCOnItz9tAza9oVvexdjcxLImc4PcfEEcwefdQJUm5TSichJVHgJGx9uTQMeg7C2FmkkcFuoEq8MnES5de8EsSceVBj2V2CstPlkmtoyHk5ZYluBeXornmBkZ//ACgRda3makNRuLGztIpjExCjDFioAyThvOgkLYjUby4t+0voBBLxkcABHojoeZPWgXt5G8f+T5I7W3i7e6l4Sq/VUMSFzjmWJHJf/GQ4FxvN1LT5ol1ayRIpejRE5A7/AKzAkd65BoJct5ldVdTlWAYHxBGRQR/rO3k8OtQ6ascZik4Msc8Q4s5xzx3eFBl2724msb+xtY442S5ZQxbORmUIcYOOhoH+giG63uSQ6s1lNHELdZezMg4uIA4wTzx1PPlQdz/11N/Lo0vs4+xK54+fF/MGTxx18ulA/XD8Ksw7gT7hQQlpm9bV7gSvBYxSpEfT4A+QOf53gKCRN3m3UOqxMyKY5Y8CSInPDnoQe9Tg8/KgZr+6WKN5XOFRSx9QGaCI9gt7NzeX8VtcRRJFNx9myhgSRxcPMsQfmlenWglPaC5litppLePtJlRmjTBPEwHIYHM5NBDN7va1iGZLeWwjSZ8cEbLIGbJwMDi55PKgk/YHVL65geS/txbuH4UTDAlQoPEeInqSR/00C9tbvAntdWt9PSONo5RGSzcXEONmBxg47qCSKCKte3oXEl8dP0m3S4kUlWdyeHiX52MEeiPyiaDNsrvJuDffydqlutvM3JGUkKT3DmTyPcQaCTmNBEex+9yS41E2dykUaM7ojrxZ4gxCg5JHPHvoO7shtzPd6reWMkcax2/HwsueI8MiqM5OOhoI2GmXFztHeR2tybWTikPaAZ5BRkdR1oJ42espobeOK4mM8qjDSkY4jk88UEJ7X4i2rgebkjPbspPTHAqg+x1PuoOv8pKZfwe0TI4jKzY78BME+8igkzYuFksLRH5MIYwfXwigija9wu1doWIUYh5nkPrj40Gbe/IDrekqCCyvFkA8xmdSM+HKgmugrhqegG+1PWYVAMgUyR/pIVOPaMig191mpPca7aPJkuI2jJPU8Fsyc/7tBZG9/m3/AEW+BoIZ+TxIFW/diAqspJPIADiJJPqoOf8AJ4jJvr2RR+LEeCe7LSZT7Fagdd/Gr9hpjRg4ad1jA8R85vsFBC+payIodMeCKWOazHpO64Vm4+0GPEcRaoFpdKvlnhinTmsqK49TAH99SIV3nf7xaf8ApQftKCdKCCN5f+8tl+jB+0egnegr7uHYRapdxSnhlMboAepZZQXHr9En2GoGXesvb6/ZxQ+lIDCCF5kEPxc/DC8/ZQT23T2VIqnaaG9wupTQ57W1l7ZcdcCRg2PV19lA47ir83GrXc7fOkhZj6zJHmgk/TNhreHUpdRV5jNJxZUsvAOILnACZ+2gbqBZ2z2ItNSVfwhWDp8ySMhXUeGSCCO/BBoE3ZLdfZPJ2873E5ifCrLICvLpkBQT6s4oJXAx0oEneRsLaX6dvN2iyxIQrxsASASQDkEEZJ7u80C1uw3eWgZb1zLJLG/oh2BUHHI4CgkjzNBLlAq6NsXBBfz36PKZZshlYrwDOOgCg93iaDR0vdxZ2+pG/iMqycTtwZTswXUg4HBkD0z30DrMmVYHvBH2UEXLuP0/Oe3vPS5kdpHg/wD1edA/bNbO29hCILaPgTOTzJZj3lieZP8AkUHH2t2Ft9RnhluJJh2GOFEZQh9LJ4gUJOcAciOVB0trdnIb61a1m4gjFOaYDKQwwVJBHl0PImgybKaGljbJaxPI6RlgpkILYLE4yoAxknuoORtBsJb3V9DfSPMJYeAqFZAh4WyMgoT7iKBvoE3Xtg7a61CK+keYSxBAoVkCHhLEZBQnqfGgcqCPtvt3lncF738bDOBkvCwXiI6Fsg88d4waD3u92AtLQreKZZJ3X58rBuHPXGAB7Tk0D6RQKOyWwltYyXEkbSv+EZEiyFCuCxyAFUcuffmgw7G7vLXTbmSe3aYs6spV2QqAWB5AID3eJoP/2Q==\";\n }else if (license == licenseChoices[2]){\n var badge = \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxIQDxUPEA0QEA8PDw4QDhEQDw8PEhAQFRIYFxUSFRUYHSggGB0lHBUVIj0hJSkrOjIwFx8zRDMuNywtLisBCgoKDg0OGhAQGi0mICUtLS8rLi0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tLS0rLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAI4BYgMBEQACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABQcDBAYBAgj/xAA+EAACAQMBBQYCCAMHBQAAAAAAAQIDBBEFBhIhMUEHE1FhcYEikRQjMkKCkqGxUnLwM0NTorLC0VRzg+Hx/8QAGgEBAAIDAQAAAAAAAAAAAAAAAAMEAQIFBv/EACkRAQACAgEEAgICAwADAAAAAAABAgMRBAUSITETQVFhIjJCcZEGI4H/2gAMAwEAAhEDEQA/ALxAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8yBir3MKazOpGC8ZyjFfqY2xuEdU2osYvEtRs4vwd1QX+4x3Q1nJWPtsW2tW1X+zu6FT+StTn+zMxMSzFqz9t5SMtnoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABym1e3drYZpuTrXC/uaTWYvpvy5Q9OfkaWvFUd8ta+HC3u0erXvGMlY0JclDMJNfzP436rdRQzc6lPtNg4XJ5HmPEIKvs+m96tcVa0+sm+PzllnMv1S29Vh2MP/AI7SY3ktMtK402lHlF+8mK83LZZnofFiPth0vSVc3VK2isd9VjBtcXGPOUuPgk37F7BmveYhR5fSMFMc3iZh299s5eabUjCz1pb0/wCzoVpOlvc+CUt6m22njO7ku2vFLRXflwJx2r6lIWHaLXtqioaraToz/wASEXhrx3VlSXnBv0JYvP2zXLMeLrC07UqVxBVKVSM4SWVKLTTJInfpYiYmNw3DLIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPGwKx2324qVKr0/TZZqZca1xH7uOEo05dMdZ9OnHiV82eKV3KL+WW/x4/aO0DZynQXez+tr8W6kuO7J891P9+ZxMvKtk9O7xum0xebebN67mUMku5iqhLyZBHmV2PEIK8mXMcIby6Tsj0/vb+ddr4bai8f9yo91f5VP5nZ4VPO3D6tk1SK/lj7Rb/vr+UU8xpfAvw8H/mU/mU+Vk7slp/8AjzVp8vmx1acqP0e4jC6t+lOunLc4c4T+1B+afAgrzsmP9wjm3jUtGlXr6ZVdxZubtm81KM5b2F4Npf5seuevQ4vUKZJ16lFFppPj0tjZXaile0lODw+UovnGXVM60TtdpeLRt0KZls9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK+7UtqZUIKwtpP6Tcx+OUXiVKlJ44PpKXFZ6JN+BDlyRSu5RW7rWjHT3LmNndLjQhhJOcsb8vHyXkjzWfkWzW/T1XC4NeLj/f3Lo5cIms+ITR5siruZWvK7ihCXkzGOFi0oK8mX8cILStHszt1a6VO7kvirSq1vWMFuQXvut/iO1h/9eGbS8p1LL3Zp/St69R1K05t5bk+Pj5+/P3OJefDk7SdnAo5JRymranlYaymsNPqvAiraYncNEFc056XcxuaOfo9VpTin9l/w/u17o9J0/l/JGp9s1v22XBs5rEbmkpKSeUjsRO12J35TIZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANfULyNClOtUeKdKnOpN+EYrL/YwxM6jaldLjK5dbVK6+tubh0qCf3IpJza8Uo93TT/AJjkdSvrF/td6Jh+TkTkn6dDZQOLjh6bNZs3UsIkuhx+0LdzKt3QxaQl5MmxV2zktFY3MoK7ll4Uo5bwstJJ+fgjpYsVvw5uXn4I3/KFs7S6nQo6RCha16VWMYUaKdKpGfCEU8vD6tQ/MXuZbtxRSHks2WMkzaJ9q2s4HFyyglO2cCheUUpm1gaMM+pWUa1CVGfKaxnrF9JLzTJMWecN4tBMOe7PtXnbV3bVHhwm44zy48V8/wB0ez4+SL1iYTYL+NSuqhUUoprqidZZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOE7YtR7rTu7T43NWFPhz3I5nL/Sl7keSdVQZ51Vpy2buI07a2pUN6FC1hvTcowh3025VW3zWZPomcvm8TLmvER6iHb6ZycXGwzv3KUttkppZr3ipr+GjCKx61Kmc/lRvi6VEe53/AKZy9Vmf6x/1srSrCP27uUn4yvZx/SEki9XpsfVJUrdQvP8Ak1NX0zTo0J13czUKcXKUoXTrPySjNyTbbSS8WiPL07Hr+VdNq9Uy4/Pcpi/vXWm91SUHJ7kG1vbueDm1wz6fIjwcOlPSvn5uflzu06hvabszXrLKhhPyZc+OFeMNW3c7G3FNb0YtPHTPHyI74YtDS2DXmrX0qs3J05x3akOafDODh83jzT+UekfdPqXS2kDi28yxKZtYGBnryIsktZcFtB9VfRqx4d4k3/MuD/2np+j5ZtiiJ+mcc6suTZC+723i89EdxfT4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFY9rL7y906g+MJ1nvJ8nvVqUePtvfMjt5tEK2edTDJcbZXFeTVLdo08vd3Vmbjng3J8vZI9Ji6ZjpWLX8yinPaZ1DJCUmt6cnKT6ybk/mx2VidVg3M+2jdSLNIR2lx21lf7FPo25S9uX7nL6xk/rjhrWNzpIbAbPfSJ78lwzk5MRp0qxqFz2OmwpRSUVw8kZbNipbRksOKAqTtV0eNrWo3lNYU5unUS6tLej81vr2RV5OOLUmJVc9YiYl9WkTxto1OkUJi2XA1ZYrmfBkFvM6aOF2sqxbhiScozeUmm0n/wDD0PSK2rvbOtalYnZhct0t1vlwPRwvx6WEZZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVP2yZjd2U1w4VcPwaqU3n9RjnWan+1Ple4aWlUuR7HNZWpCfqcI4KMeZTSiruRaxwimXG7S/bhLp8UX/XzOL1mkxetmaTq0LN7MILuV4nMdOFgAAKz7aa3eQtbOHxVq1xvwj1fwunH5yqfoyLL+FbkedQk1sVXj9i7oyS5b9Cafu1Pj8jkZOj1tabRZt8MM1PZW55O8oQXXdtpzfzlUS/QxHR6R/azPww+amy9rHjdXtat4w7yNKH5aSUv1Hw8Hj+bWjaanGmfUOQ7Sbi1+i0rezoxpqF2nNRp7jb7qW68/e+11LuDPiy13jhDyqTTUSk+ymXB+rL8eksLRMsgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK57abNytKVdLjQr4b8Izjj/AFRh8zS061MflX5FdxtGaJicYzXKUYyXusnqPl78cWVaw37qQxw2lDXky3SEcua1dKSafqvJmvL4scjFNfv6EtsDtXG0n3VeW7BvCnzj7+HqeQvW2K3ZeNLWLLrxK6bK8hVgpwnGUZJOLi000+qa5iJ2tR5RG0+19rYRfe1VKtjMKEGpVJeGV91ebwYtbSO+Stfar7Cda/vHqNz8P/TwXKMV9nHksvj1bbPPdU5+o7KT5TcPjze3yXdvaV6n+LU/PP8A5OBHLzR/lLq/HT8NupJtcW36tv8Acgy8nLb3af8AreuOv4Rl9PCIMcTafLe3hXO1lZPuY/elGtdS/wDLJRhH8lCD/Ge74GLsxVh57lW780QsDsstsUs4OqkWOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFbT6Wruzq27/vaclF/wzXGEvaSTMTG4aXruNKq2GunuTt6i3atvKScXz3c4a9pZXyOj0/N3V+OfpRj8Jm6mdikMWQt9MuUaOa1GoWKQ2hCxeW/PCXhnOc/ovmcLr9qRWtdeZba2tfsw1GbjGks93BYj6Hn6xpfrGoaHapp8aGo0bxwTpXCjGrlZW/Twm3+Fx/IVOZS00nt9obarkrM+kjaQPC5Jnfl6Gmu3wmrWBE2ZqsivefLeHO7QXG7Sk95Ryt3efJb3DL9OfsXuBi78kQhz37azKurqu7m6c0mlOUY04/w0YJRpx9oxj8me9w11Dz+Pd7zZeexNj3VvHhh4LCw6UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxoCo+0PSZ2N5HU6Efq6jUbmK5bz4NvyksejSfU1recV4vCpmpqe6GW1VW6pKtb2dxVpTzicXaPinhprvsprwayegxc7FrzKOMU2jcIbV4Tp8KtOpSbeF3tOdLL8E5JKT9Gzo4c+O/8AWYazjtX25XUZ4yX6/liGlSp9Or4e7/8AXA8V1DP8/JtMeo9JcNd2Xb2b6V3dFSa4tIqrrf7StG+ladUSWalH6+n470E8pesXJe5reNwizV7quN2Pu++toPOZQ+rn6x5P3WGeI6nh+PNP7dTg5e/FH6dZQjwObMrkMdxLgV/cpPUK4241VSkreDzuveqvon0j6/8AKPWdG4UxHyWhxOfyO+3x1ZdgdDdWspyjwWPZHp6xqENa9saXla0VCKiuiMtmYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABp6pYQr0pUpxUozi1JNZTT6BiY2qanWudn7mW7GVawqz+ODeMPkmm/szXBZ5SSSfRqKd1lW/lin9LR0rVba/od5SnCtSmsTi0nh9YTg+T8mSVt9wsRaLQ4HtI2NtaNtO8pPuHTcEqUVvU5uUlFRgvuc+S4YT4dTpY+q5seOa28oMtIiNq+2bsnWuIxxyab9X/SOXTfuW+Cuq7foPRbVU6UY46I3TN2pHKwGJU1pFv8AQdWr2L4U6jc6Hp9uCX4XJfgPPdawd2Pvj6Z4N/jyzWft3K5Hk7efEO3v7cRtbtbGGaNtJTqcVOonmNP0fJy/RHZ6Z0i1p+TLGo/Dncvnf4Y/LjtE0ydxUSSbWctvOW/FnsMdIrChjp2+Z9ry2N0JW9JSa+N/oiRK6UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARusaVC4g4TimmmnlIxMbYmNqo1PZi606v8ASbGrOm10T4OP8LT4SXlLJHNJj+qCcUxO6onazbC4v6NK3uKMacqNR1Kjg5JVWo4i9x8sJy6vOehrMzPiUdrWvMVmE72YaTvS7xrzJohbjx4XBCOFgyy+gKw7XLGVKpb6lSXxUakadT0zvQb8s70fxorcnFGSk1n7QZN1tF6/TiNe2rubpOnh0KT4d3De3pLwlLm15cEc/i9JxYp7tbn9pL582bx6hh0PZqrcSXwtR4f0zr1rEQxTHWq4tltl4W0U3Fb2DZI6lID0AB4wPQAAAAAAAAAAAAAAAAAAAAAAAAAAAAPAPQAHgAD0ABguLaM1iSTA5jVdiaNZ5SSDGoSug6JG1juxDKZAAa95QVSDi+qMMa25BbCU3VdRrm8mWXTafpVOikoxQEggDAAMgMAegAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/2Q==\";\n }else{\n var badge =\"\";\n }\n \n return \"![badge](\" + badge + \")\";\n}", "title": "" }, { "docid": "7fb749f49ca8ac13bca5750eecb90863", "score": "0.47901228", "text": "async function requestCredential() {\n\n let proverWalletHandle = await indy.openWallet({\"id\": proverState.wallet.id}, {\"key\": proverState.wallet.key})\n let proverDidObj = await indy.createAndStoreMyDid(proverWalletHandle, {})\n // didObj = [\n // 'CUTc1s32tcn7FyfT1rdGW',\n // '7FhTjTDtWxu2vTUsZCjJqvRQxPx6or7GepP7NK321tp'\n // ]\n console.log(\"PROVER DID\", proverDidObj)\n\n\n\n console.log(\"MS ID\", proverState.masterSecretId)\n\n // NOTE: Cred Def must be retrieved from ledger\n credReq = await indy.proverCreateCredentialReq(proverWalletHandle, proverDidObj[0], credOffer, issuerState.credDefObj[1], proverState.masterSecretId)\n console.log(\"CRED_REQ\", credReq)\n let buf = Buffer.from(JSON.stringify(credReq))\n console.log(\"CRED REQ SIZE\", buf.length)\n await indy.closeWallet(proverWalletHandle)\n}", "title": "" }, { "docid": "2547b42de8e3da6da9e2bc91dbf43164", "score": "0.47777838", "text": "getModelName() {\n return \"DeviceLinkNonce\";\n }", "title": "" }, { "docid": "c13e176c9208cd86d990ecc06bed3aef", "score": "0.47671235", "text": "function source(data) {\n return {\n type: [data['jenis_pelapor'] === 'KORPORASI' ? 'thirdParty' : 'selfDeclaration'],\n retrievedAt: new Date().toISOString(),\n url: 'https://bo.ahu.go.id/service/getReportBo',\n assertedBy: [{\n name: data['jenis_pelapor'] === 'KORPORASI' ? data['nama_pelapor'] : data['nama_pic']\n }]\n }\n}", "title": "" }, { "docid": "4cf350184f55c479c63756e1765fdf22", "score": "0.47627246", "text": "function renderLicenseSection(data) {\n let licenseSection = data.license[0];\n let yourSection = ''\n if(licenseSection === 'MIT') {\n yourSection = `<a href = \"https://gist.github.com/ckib16/8732561535ed766cd6b8\">MIT Guide</a>`\n\n } else if(licenseSection === 'GPLv3') {\n yourSection = `<a href = \"https://github.com/TheFox/GPLv3.mdl\">GPLv3 Guide</a>`\n\n } else if(licenseSection === 'IBM') {\n yourSection = `<a href = \"https://www.ibm.com/docs/en/spectrum-archive-ee/1.3.0.0?topic=reference-licensing-readme\" </a>`\n\n }else if(licenseSection === 'Apache') {\n yourSection = `<a href = \"https://github.com/Medium/opensource/blob/master/apache-license-2.0.md\">Apache Guide</a>`\n\n } else {\n yourSection = 'N/A'\n }\n return yourSection;\n}", "title": "" }, { "docid": "716d709c2e186f14df148333675cdd6a", "score": "0.47609943", "text": "constructor(certs) {\n this.idmg = null;\n\n // Cle pour cert\n this.cle = certs.key;\n this.password = certs.password; // Mot de passe pour la cle, optionnel\n\n // Contenu format texte PEM\n this.chainePEM = certs.cert;\n this.hotePEM = certs.hote || certs.cert; // Chaine XS pour connexion middleware\n this.hoteCA = certs.hoteMillegrille || certs.millegrille;\n this.ca = certs.millegrille;\n\n this.caIntermediaires = [];\n\n // Objets node-forge\n this.certPEM = null;\n this.cleForge = null; // Objet cle charge en memoire (forge)\n this.cert = null; // Objet certificat charge en memoire (forge)\n this.caStore = null; // CA store pour valider les chaines de certificats\n\n this.cacheCertsParFingerprint = {};\n\n }", "title": "" }, { "docid": "b80055b5173c5bbfa65bd8e61154fba3", "score": "0.47106066", "text": "async function createIDMParty(data, callback) {\n\tlet docName = 'DL';\n\tswitch (data.investorDocs.title) {\n\t\tcase 'Passport':\n\t\t\tdocName = 'PP';\n\t\t\tbreak;\n\t\tcase 'ID card':\n\t\t\tdocName = 'ID';\n\t\t\tbreak;\n\t\tcase 'Driver license':\n\t\t\tdocName = 'DL';\n\t\t\tbreak;\n\t\tcase 'RP':\n\t\t\tdocName = 'Residence permit';\n\t\t\tbreak;\n\t\tcase 'Utility bill':\n\t\t\tdocName = 'UB';\n\t\t\tbreak;\n\t}\n\n\tconst parsedUrl = new URL(data.investorDocs.file);\n\tconst docPath = parsedUrl.pathname.replace(`/${keys.bucketName}/`, '');\n\tlet expiresTime = new Date();\n\texpiresTime.setMinutes(expiresTime.getMinutes() + 5);\n\tconst docFile = docsBucket.file(docPath);\n\tvar config = {\n\t\taction: 'read',\n\t\texpires: expiresTime\n\t};\n\ttry {\n\t\tconst publicUrl = await docFile.getSignedUrl(config);\n\t\tconst response = await axios(publicUrl[0], {\n\t\t\tresponseType: 'arraybuffer'\n\t\t});\n\t\tlet scanData = new Buffer(response.data, 'binary').toString('base64');\n\t\tscanData = `data:${response.headers[\n\t\t\t'content-type'\n\t\t].toLowerCase()};base64,${scanData}`;\n\t\n\t\tlet options = {\n\t\t\turl: keys.idmApiBaseUrl + 'consumer',\n\t\t\tmethod: 'POST',\n\t\t\tauth: {\n\t\t\t\tusername: keys.idmUsername,\n\t\t\t\tpassword: keys.idmPassword\n\t\t\t},\n\t\t\tbody: {\n\t\t\t\tdob: moment(data.investor.dob).format('YYYY-MM-DD'),\n\t\n\t\t\t\tman: data.investor.email,\n\t\t\t\ttea: data.investor.email,\n\t\t\t\tbfn: data.investor.firstName,\n\t\t\t\tbln: data.investor.lastName,\n\t\t\t\tprofile: 'KYCAML',\n\t\t\t\tbsn: data.investor.address1,\n\t\t\t\tbco: data.investor.country,\n\t\t\t\tbz: data.investor.zip,\n\t\t\t\tbc: data.investor.city,\n\t\t\t\tbs: data.investor.state,\n\t\t\t\tphn: data.investor.phone,\n\t\t\t\tdocCountry: data.investorDocs.country,\n\t\t\t\tdocType: docName,\n\t\t\t\tscanData: scanData\n\t\t\t},\n\t\t\tjson: true\n\t\t};\n\t\tif (data.investor.idmAccountId) {\n\t\t\toptions.body.tid = data.investor.idmAccountId;\n\t\t}\n\t\tif (data.investor.country === 'US') {\n\t\t\toptions.body.assn = data.investor.taxId;\n\t\t}\n\t\n\t\trequest(options, (err, resp, body) => {\n\t\t\tif (err && resp.statusCode !== 200) {\n\t\t\t\tconsole.log('Error:', err);\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tif (body != null && resp.statusCode === 200) {\n\t\t\t\tInvestor.find(\n\t\t\t\t\t{\n\t\t\t\t\t\t_id: data.investor._id\n\t\t\t\t\t},\n\t\t\t\t\tfunction(err, investor) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tthrow err;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinvestor[0].idmAccountId = body.mtid;\n\t\t\t\t\t\t\tinvestor[0].verification.idmAml_status = 'Pending';\n\t\t\t\t\t\t\tinvestor[0].verification.idmKyc_status = 'Pending';\n\t\t\t\t\t\t\tinvestor[0].save(err => {\n\t\t\t\t\t\t\t\tif (err) console.log('Error:', err);\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tcallback(null, true); // To separate idm and nc call\n\t\t\t\t\t\t\t\t\tif (data.investor.investAs === 'Individual') {\n\t\t\t\t\t\t\t\t\t\tif (!data.investor.partyId || data.investor.partyId === '') {\n\t\t\t\t\t\t\t\t\t\t\t// To separate idm and nc call\n\t\t\t\t\t\t\t\t\t\t\tdata.action = 'createNCParty';\n\t\t\t\t\t\t\t\t\t\t\tbackground.queueNCPartyAndEntity(data);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tdata.action = 'updateNCParty';\n\t\t\t\t\t\t\t\t\t\t\tbackground.queueNCPartyAndEntity(data);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} else console.log('Error:', body);\n\t\t});\n\t} catch(err) {\n\t\tRaven.captureException(err);\n\t}\n\t\n}", "title": "" }, { "docid": "ac73161b40eca2ee8d514af09813bf81", "score": "0.4694391", "text": "function parse_RC4Header(blob) {\n var o = {};\n var vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n if (vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n o.Salt = blob.read_shift(16);\n o.EncryptedVerifier = blob.read_shift(16);\n o.EncryptedVerifierHash = blob.read_shift(16);\n return o;\n }", "title": "" }, { "docid": "5e172f19b3467202eb8d22f4c67cadb1", "score": "0.46939754", "text": "function renderLicenseBadge(data) {\n let badgeURL = data.license\n let url = ''\n switch (badgeURL) {\n case 'MIT' : url = `[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)`\n break;\n case 'GNU AGPLv3' : url = `[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)`\n break;\n case 'GNU GPLv3' : url = `[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)`\n break;\n case 'GNU LGPLv3' : url = `[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)`\n break;\n case 'Unlicense' : url = `[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)`\n break;\n }\n return url\n}", "title": "" }, { "docid": "5bb81ec3396609098a8bd3619967e958", "score": "0.4688489", "text": "function renderLicenseLink(license) {\nif (license === 'MIT')\nreturn `(https://opensource.org/licenses/MIT)`;\n\nelse if (license === 'IBM')\nreturn '(https://opensource.org/licenses/IPL-1.0)'\n\nelse if ( license === 'Mozilla')\nreturn '(https://opensource.org/licenses/MIT)'\n\nelse\nreturn '(https://opensource.org/licenses/Apache-2.0)'\n}", "title": "" }, { "docid": "a7209a5f93a0ef2083721cb9770d90fd", "score": "0.4687794", "text": "function renderLicenseLink(license) {\n if (license !== \"None\") {\n return {\n 'https://opensource.org/licenses/'\n :\n\n// If there is no license, return an empty string\nfunction renderLicenseSection(license) {\n\n}\n//Generate Markdown Function\nfunction: generateMarkdown:(data) {\n return `\n # ${data.title}\n ${license[data.license] || \"\"}\n\n ## Description\n ${data.description}\n\n ## Start\n *[Install](#install)\n\n`;\n}\n }}", "title": "" }, { "docid": "718b22c222b4ac4b01d184bbbe9ed4f6", "score": "0.46785465", "text": "function renderLicenseLink(license) {\n // put the corresponding link w/out parenthesis\n return {\n \"MIT\" : \"https://opensource.org/licenses/MIT\",\n \"GNU v3\" : \"https://www.gnu.org/licenses/gpl-3.0\",\n \"Apache 2.0\" : \"https://opensource.org/licenses/Apache-2.0\",\n \"Mozilla Public License 2.0\" : \"https://opensource.org/licenses/MPL-2.0\"\n }[license]\n}", "title": "" }, { "docid": "6f78f4c587d665f013ffe13a4093ac77", "score": "0.46767533", "text": "function retrieveReleaseInfo() {\n var release = new Object();\n release.discs = [];\n\n var bandcampAlbumData = unsafeWindow.TralbumData;\n var bandcampEmbedData = unsafeWindow.EmbedData;\n\n // Release artist credit\n release.artist_credit = [ { artist_name: bandcampAlbumData.artist } ];\n\n // Grab release title\n release.title = bandcampAlbumData.current.title;\n\n // Grab release event information\n var releasedate = bandcampAlbumData.current.release_date;\n\n if(bandcampEmbedData.album_title) {\n release.parent_album = bandcampEmbedData.album_title;\n }\n\n if (typeof releasedate != \"undefined\" && releasedate != \"\") {\n release.year = $.format.date(releasedate, \"yyyy\");\n release.month = $.format.date(releasedate, \"MM\");\n release.day = $.format.date(releasedate, \"dd\");\n }\n\n release.labels = new Array();\n release.format = \"Digital Media\";\n release.country = \"XW\"; // Worldwide\n // FIXME: implement a mapping between bandcamp release types and MB ones\n release.type = bandcampAlbumData.current.type;\n release.status = 'official';\n\n // map Bandcamp single tracks to singles\n if(release.type == \"track\")\n { release.type = \"single\"; }\n\n // Tracks\n var disc = new Object();\n disc.tracks = new Array();\n disc.format = release.format;\n release.discs.push(disc);\n $.each(bandcampAlbumData.trackinfo, function(index, bctrack) {\n var track = {\n 'title': bctrack.title,\n 'duration': Math.round(bctrack.duration*1000),\n 'artist_credit': []\n }\n disc.tracks.push(track);\n });\n\n // URLs\n // link_type mapping:\n // - 74: purchase for download\n // - 75: download for free\n // - 85: stream {video} for free\n // - 301: license\n release.urls = new Array();\n // Download for free vs. for purchase\n if (bandcampAlbumData.current.download_pref !== null) {\n if (bandcampAlbumData.current.minimum_price_nonzero === null ||\n bandcampAlbumData.current.minimum_price == 0.0) {\n release.urls.push( { 'url': window.location.href, 'link_type': 75 } );\n }\n if (bandcampAlbumData.current.minimum_price_nonzero !== null) {\n release.urls.push( { 'url': window.location.href, 'link_type': 74 } );\n }\n }\n // Check if the release is streamable\n if (bandcampAlbumData.hasAudio) {\n release.urls.push( { 'url': window.location.href, 'link_type': 85 } );\n }\n // Check if release is Creative Commons licensed\n if ($(\"div#license a.cc-icons\").length > 0) {\n release.urls.push( {\n 'url': $(\"div#license a.cc-icons\").attr(\"href\"), 'link_type': 301\n } );\n }\n\n mylog(release);\n return release;\n\n}", "title": "" }, { "docid": "75fad4f2f739846c2fe829c3e3b2f78d", "score": "0.4670755", "text": "function generateLicense(data) {\n var licenseBadge = \"\";\n if (data.license === \"Apache license\") {\n licenseBadge =\n \"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\";\n return licenseBadge;\n } else if (data.license === \"Boost Software\") {\n licenseBadge =\n \"[![License](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)\";\n return licenseBadge;\n } else if (data.license === \"BSD\") {\n licenseBadge =\n \"[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\";\n return licenseBadge;\n } else if (data.license === \"Creative Commons\") {\n licenseBadge =\n \"[![License: CC0-1.0](https://licensebuttons.net/l/zero/1.0/80x15.png)](http://creativecommons.org/publicdomain/zero/1.0/)\";\n return licenseBadge;\n } else if (data.license === \"Eclipse\") {\n licenseBadge =\n \"[![License](https://img.shields.io/badge/License-EPL%201.0-red.svg)](https://opensource.org/licenses/EPL-1.0)\";\n return licenseBadge;\n } else if (data.license === \"GNU\") {\n licenseBadge =\n \"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\";\n return licenseBadge;\n } else if (data.license === \"ISC\") {\n licenseBadge =\n \"[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)\";\n return licenseBadge;\n } else if (data.license === \"MIT\") {\n licenseBadge =\n \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n return licenseBadge;\n } else if (data.license === \"Mozilla\") {\n licenseBadge =\n \"[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)\";\n return licenseBadge;\n } else if (data.license === \"Open\") {\n licenseBadge =\n \"[![License: Open Data Commons Attribution](https://img.shields.io/badge/License-ODC_BY-brightgreen.svg)](https://opendatacommons.org/licenses/by/)\";\n return licenseBadge;\n } else if (data.license === \"SIL\") {\n licenseBadge =\n \"[![License: Open Font-1.1](https://img.shields.io/badge/License-OFL%201.1-lightgreen.svg)](https://opensource.org/licenses/OFL-1.1)\";\n return licenseBadge;\n } else if (data.license === \"The Unlicense\") {\n licenseBadge =\n \"[![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue.svg)](http://unlicense.org/)\";\n return licenseBadge;\n } else if (data.license === \"MIT\") {\n licenseBadge =\n \"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\";\n return licenseBadge;\n } else {\n licenseBadge = \"\";\n return licenseBadge;\n }\n}", "title": "" }, { "docid": "b58451891caac932e5a2ef2072431bce", "score": "0.46555722", "text": "identify(cardData) {\r\n return this.authService\r\n .Identify(new core.Credential(core.Credential.ContactlessCard, cardData))\r\n .then(ticket => ticket.jwt);\r\n }", "title": "" }, { "docid": "b619349aa21eee74ae4d6aaa8ea1148d", "score": "0.4651465", "text": "function renderLicenseLink(license) {\n return\n}", "title": "" }, { "docid": "6045e5d0bed1ffa358b280ea5e2937d5", "score": "0.46500474", "text": "function X509(){this.subjectPublicKeyRSA=null;this.subjectPublicKeyRSA_hN=null;this.subjectPublicKeyRSA_hE=null;this.hex=null;this.getSerialNumberHex=function(){return ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,1])};this.getSignatureAlgorithmField=function(){var b=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,2,0]);var a=KJUR.asn1.ASN1Util.oidHexToInt(b);var c=KJUR.asn1.x509.OID.oid2name(a);return c};this.getIssuerHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3])};this.getIssuerString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3]))};this.getSubjectHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5])};this.getSubjectString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5]))};this.getNotBefore=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,0]);a=a.replace(/(..)/g,\"%$1\");a=decodeURIComponent(a);return a};this.getNotAfter=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,1]);a=a.replace(/(..)/g,\"%$1\");a=decodeURIComponent(a);return a};this.readCertPEM=function(c){var e=X509.pemToHex(c);var b=X509.getPublicKeyHexArrayFromCertHex(e);var d=new RSAKey();d.setPublic(b[0],b[1]);this.subjectPublicKeyRSA=d;this.subjectPublicKeyRSA_hN=b[0];this.subjectPublicKeyRSA_hE=b[1];this.hex=e};this.readCertPEMWithoutRSAInit=function(c){var d=X509.pemToHex(c);var b=X509.getPublicKeyHexArrayFromCertHex(d);this.subjectPublicKeyRSA.setPublic(b[0],b[1]);this.subjectPublicKeyRSA_hN=b[0];this.subjectPublicKeyRSA_hE=b[1];this.hex=d};this.getInfo=function(){var p=\"Basic Fields\\n\";p+=\" serial number: \"+this.getSerialNumberHex()+\"\\n\";p+=\" signature algorithm: \"+this.getSignatureAlgorithmField()+\"\\n\";p+=\" issuer: \"+this.getIssuerString()+\"\\n\";p+=\" notBefore: \"+this.getNotBefore()+\"\\n\";p+=\" notAfter: \"+this.getNotAfter()+\"\\n\";p+=\" subject: \"+this.getSubjectString()+\"\\n\";p+=\" subject public key info: \\n\";var j=X509.getSubjectPublicKeyInfoPosFromCertHex(this.hex);var d=ASN1HEX.getHexOfTLV_AtObj(this.hex,j);var n=KEYUTIL.getKey(d,null,\"pkcs8pub\");if(n instanceof RSAKey){p+=\" key algorithm: RSA\\n\";p+=\" n=\"+n.n.toString(16).substr(0,16)+\"...\\n\";p+=\" e=\"+n.e.toString(16)+\"\\n\"}p+=\"X509v3 Extensions:\\n\";var m=X509.getV3ExtInfoListOfCertHex(this.hex);for(var e=0;e<m.length;e++){var b=m[e];var o=KJUR.asn1.x509.OID.oid2name(b.oid);if(o===\"\"){o=b.oid}var k=\"\";if(b.critical===true){k=\"CRITICAL\"}p+=\" \"+o+\" \"+k+\":\\n\";if(o===\"basicConstraints\"){var g=X509.getExtBasicConstraints(this.hex);if(g.cA===undefined){p+=\" {}\\n\"}else{p+=\" cA=true\";if(g.pathLen!==undefined){p+=\", pathLen=\"+g.pathLen}p+=\"\\n\"}}else{if(o===\"keyUsage\"){p+=\" \"+X509.getExtKeyUsageString(this.hex)+\"\\n\"}else{if(o===\"subjectKeyIdentifier\"){p+=\" \"+X509.getExtSubjectKeyIdentifier(this.hex)+\"\\n\"}else{if(o===\"authorityKeyIdentifier\"){var a=X509.getExtAuthorityKeyIdentifier(this.hex);if(a.kid!==undefined){p+=\" kid=\"+a.kid+\"\\n\"}}else{if(o===\"extKeyUsage\"){var h=X509.getExtExtKeyUsageName(this.hex);p+=\" \"+h.join(\", \")+\"\\n\"}else{if(o===\"subjectAltName\"){var f=X509.getExtSubjectAltName(this.hex);p+=\" \"+f.join(\", \")+\"\\n\"}else{if(o===\"cRLDistributionPoints\"){var l=X509.getExtCRLDistributionPointsURI(this.hex);p+=\" \"+l+\"\\n\"}else{if(o===\"authorityInfoAccess\"){var c=X509.getExtAIAInfo(this.hex);if(c.ocsp!==undefined){p+=\" ocsp: \"+c.ocsp.join(\",\")+\"\\n\"}if(c.caissuer!==undefined){p+=\" caissuer: \"+c.caissuer.join(\",\")+\"\\n\"}}}}}}}}}}p+=\"signature algorithm: \"+X509.getSignatureAlgorithmName(this.hex)+\"\\n\";p+=\"signature: \"+X509.getSignatureValueHex(this.hex).substr(0,16)+\"...\\n\";return p}}", "title": "" }, { "docid": "6045e5d0bed1ffa358b280ea5e2937d5", "score": "0.46500474", "text": "function X509(){this.subjectPublicKeyRSA=null;this.subjectPublicKeyRSA_hN=null;this.subjectPublicKeyRSA_hE=null;this.hex=null;this.getSerialNumberHex=function(){return ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,1])};this.getSignatureAlgorithmField=function(){var b=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,2,0]);var a=KJUR.asn1.ASN1Util.oidHexToInt(b);var c=KJUR.asn1.x509.OID.oid2name(a);return c};this.getIssuerHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3])};this.getIssuerString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3]))};this.getSubjectHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5])};this.getSubjectString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5]))};this.getNotBefore=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,0]);a=a.replace(/(..)/g,\"%$1\");a=decodeURIComponent(a);return a};this.getNotAfter=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,1]);a=a.replace(/(..)/g,\"%$1\");a=decodeURIComponent(a);return a};this.readCertPEM=function(c){var e=X509.pemToHex(c);var b=X509.getPublicKeyHexArrayFromCertHex(e);var d=new RSAKey();d.setPublic(b[0],b[1]);this.subjectPublicKeyRSA=d;this.subjectPublicKeyRSA_hN=b[0];this.subjectPublicKeyRSA_hE=b[1];this.hex=e};this.readCertPEMWithoutRSAInit=function(c){var d=X509.pemToHex(c);var b=X509.getPublicKeyHexArrayFromCertHex(d);this.subjectPublicKeyRSA.setPublic(b[0],b[1]);this.subjectPublicKeyRSA_hN=b[0];this.subjectPublicKeyRSA_hE=b[1];this.hex=d};this.getInfo=function(){var p=\"Basic Fields\\n\";p+=\" serial number: \"+this.getSerialNumberHex()+\"\\n\";p+=\" signature algorithm: \"+this.getSignatureAlgorithmField()+\"\\n\";p+=\" issuer: \"+this.getIssuerString()+\"\\n\";p+=\" notBefore: \"+this.getNotBefore()+\"\\n\";p+=\" notAfter: \"+this.getNotAfter()+\"\\n\";p+=\" subject: \"+this.getSubjectString()+\"\\n\";p+=\" subject public key info: \\n\";var j=X509.getSubjectPublicKeyInfoPosFromCertHex(this.hex);var d=ASN1HEX.getHexOfTLV_AtObj(this.hex,j);var n=KEYUTIL.getKey(d,null,\"pkcs8pub\");if(n instanceof RSAKey){p+=\" key algorithm: RSA\\n\";p+=\" n=\"+n.n.toString(16).substr(0,16)+\"...\\n\";p+=\" e=\"+n.e.toString(16)+\"\\n\"}p+=\"X509v3 Extensions:\\n\";var m=X509.getV3ExtInfoListOfCertHex(this.hex);for(var e=0;e<m.length;e++){var b=m[e];var o=KJUR.asn1.x509.OID.oid2name(b.oid);if(o===\"\"){o=b.oid}var k=\"\";if(b.critical===true){k=\"CRITICAL\"}p+=\" \"+o+\" \"+k+\":\\n\";if(o===\"basicConstraints\"){var g=X509.getExtBasicConstraints(this.hex);if(g.cA===undefined){p+=\" {}\\n\"}else{p+=\" cA=true\";if(g.pathLen!==undefined){p+=\", pathLen=\"+g.pathLen}p+=\"\\n\"}}else{if(o===\"keyUsage\"){p+=\" \"+X509.getExtKeyUsageString(this.hex)+\"\\n\"}else{if(o===\"subjectKeyIdentifier\"){p+=\" \"+X509.getExtSubjectKeyIdentifier(this.hex)+\"\\n\"}else{if(o===\"authorityKeyIdentifier\"){var a=X509.getExtAuthorityKeyIdentifier(this.hex);if(a.kid!==undefined){p+=\" kid=\"+a.kid+\"\\n\"}}else{if(o===\"extKeyUsage\"){var h=X509.getExtExtKeyUsageName(this.hex);p+=\" \"+h.join(\", \")+\"\\n\"}else{if(o===\"subjectAltName\"){var f=X509.getExtSubjectAltName(this.hex);p+=\" \"+f.join(\", \")+\"\\n\"}else{if(o===\"cRLDistributionPoints\"){var l=X509.getExtCRLDistributionPointsURI(this.hex);p+=\" \"+l+\"\\n\"}else{if(o===\"authorityInfoAccess\"){var c=X509.getExtAIAInfo(this.hex);if(c.ocsp!==undefined){p+=\" ocsp: \"+c.ocsp.join(\",\")+\"\\n\"}if(c.caissuer!==undefined){p+=\" caissuer: \"+c.caissuer.join(\",\")+\"\\n\"}}}}}}}}}}p+=\"signature algorithm: \"+X509.getSignatureAlgorithmName(this.hex)+\"\\n\";p+=\"signature: \"+X509.getSignatureValueHex(this.hex).substr(0,16)+\"...\\n\";return p}}", "title": "" }, { "docid": "521c8b75e8ace84e82b3a6d77966c4d4", "score": "0.46483338", "text": "function renderLicenseSection(data) {\n if (data.license === 'None || Added Your Own Later') {\n return '';\n }\n\n else {\n return `## License\n \n This project is licensed under the Open Source ${data.license}.\n A full overview of what this license covers can be found at ${renderLicenseLink(data)}.\n `;\n }\n}", "title": "" }, { "docid": "e0534460a2d13858c093d7297ea8526a", "score": "0.46393698", "text": "getDidDoc () {\n console.debug(\"getDidDoc: \")\n return Promise.resolve(this.wallets.map((w) => {\n const did = SOV_DID_PREFIX + w.did\n const pubKey = w.verifyKey\n const credentials = []\n\n\n const didDoc = {\n didDoc: {\n did,\n pubKey,\n credentials,\n },\n }\n return didDoc\n }))\n }", "title": "" }, { "docid": "0e946de74c56df6d800d7b35b157bf6c", "score": "0.46334332", "text": "async getDetailsFromChain() {\n let oreHttpEndpoint, oreChainId;\n //get ORE blockchain URL from verifier discovery endpoint\n var errMsg = `ORE Blockchain: Problem retrieving ORE address from verifier discovery endpoint. Config expects a verifier running here: ${this.config.verifier}.`;\n try {\n const oreNetworkData = await fetch(`${this.config.verifier}/discovery`);\n const { oreNetworkUri } = await oreNetworkData.json();\n oreHttpEndpoint = oreNetworkUri;\n if (!oreHttpEndpoint) {\n throw new Error(errMsg);\n }\n } catch (error) {\n throw new Error(`${errMsg}: ${error}`);\n }\n\n //get chainId from ORE blockchain\n errMsg = `ORE Blockchain: Problem retrieving info from the ORE blockchain. Config file expects an ORE node running here: ${oreHttpEndpoint}.`;\n try {\n const oreInfoEndpoint = `${oreHttpEndpoint}/v1/chain/get_info`;\n const oreNetworkInfo = await fetch(oreInfoEndpoint);\n const { chain_id } = await oreNetworkInfo.json();\n oreChainId = chain_id;\n if (!oreChainId) {\n throw new Error(errMsg);\n }\n } catch (error) {\n throw new Error(`${errMsg}: ${error}`);\n }\n\n //return data\n return { oreHttpEndpoint, oreChainId };\n\n }", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.46327695", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.46327695", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.46327695", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.46327695", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.46327695", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.46327695", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.46327695", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "be618e4b7d3174a96000fbf9bafcef75", "score": "0.46327695", "text": "function parse_RC4Header(blob) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "efb4ae5666f7b5a3d3cc1f7388158605", "score": "0.4631254", "text": "function pi(){this.subjectPublicKeyRSA=null,this.subjectPublicKeyRSA_hN=null,this.subjectPublicKeyRSA_hE=null,this.hex=null,this.getSerialNumberHex=function(){return jn.getDecendantHexVByNthList(this.hex,0,[0,1])},this.getSignatureAlgorithmField=function(){var t=jn.getDecendantHexVByNthList(this.hex,0,[0,2,0]),e=a.asn1.ASN1Util.oidHexToInt(t),n=a.asn1.x509.OID.oid2name(e);return n},this.getIssuerHex=function(){return jn.getDecendantHexTLVByNthList(this.hex,0,[0,3])},this.getIssuerString=function(){return pi.hex2dn(jn.getDecendantHexTLVByNthList(this.hex,0,[0,3]))},this.getSubjectHex=function(){return jn.getDecendantHexTLVByNthList(this.hex,0,[0,5])},this.getSubjectString=function(){return pi.hex2dn(jn.getDecendantHexTLVByNthList(this.hex,0,[0,5]))},this.getNotBefore=function(){var t=jn.getDecendantHexVByNthList(this.hex,0,[0,4,0]);return t=t.replace(/(..)/g,\"%$1\"),t=decodeURIComponent(t),t},this.getNotAfter=function(){var t=jn.getDecendantHexVByNthList(this.hex,0,[0,4,1]);return t=t.replace(/(..)/g,\"%$1\"),t=decodeURIComponent(t),t},this.readCertPEM=function(t){var e=jn.pemToHex(t),n=pi.getPublicKeyHexArrayFromCertHex(e),i=new Ue;i.setPublic(n[0],n[1]),this.subjectPublicKeyRSA=i,this.subjectPublicKeyRSA_hN=n[0],this.subjectPublicKeyRSA_hE=n[1],this.hex=e},this.readCertPEMWithoutRSAInit=function(t){var e=jn.pemToHex(t),n=pi.getPublicKeyHexArrayFromCertHex(e);\"function\"===typeof this.subjectPublicKeyRSA.setPublic&&this.subjectPublicKeyRSA.setPublic(n[0],n[1]),this.subjectPublicKeyRSA_hN=n[0],this.subjectPublicKeyRSA_hE=n[1],this.hex=e},this.getInfo=function(){var t=\"Basic Fields\\n\";t+=\" serial number: \"+this.getSerialNumberHex()+\"\\n\",t+=\" signature algorithm: \"+this.getSignatureAlgorithmField()+\"\\n\",t+=\" issuer: \"+this.getIssuerString()+\"\\n\",t+=\" notBefore: \"+this.getNotBefore()+\"\\n\",t+=\" notAfter: \"+this.getNotAfter()+\"\\n\",t+=\" subject: \"+this.getSubjectString()+\"\\n\",t+=\" subject public key info: \\n\";var e=pi.getSubjectPublicKeyInfoPosFromCertHex(this.hex),n=jn.getHexOfTLV_AtObj(this.hex,e),i=Jn.getKey(n,null,\"pkcs8pub\");i instanceof Ue&&(t+=\" key algorithm: RSA\\n\",t+=\" n=\"+i.n.toString(16).substr(0,16)+\"...\\n\",t+=\" e=\"+i.e.toString(16)+\"\\n\"),t+=\"X509v3 Extensions:\\n\";for(var r=pi.getV3ExtInfoListOfCertHex(this.hex),s=0;s<r.length;s++){var o=r[s],h=a.asn1.x509.OID.oid2name(o.oid);\"\"===h&&(h=o.oid);var u=\"\";if(!0===o.critical&&(u=\"CRITICAL\"),t+=\" \"+h+\" \"+u+\":\\n\",\"basicConstraints\"===h){var c=pi.getExtBasicConstraints(this.hex);void 0===c.cA?t+=\" {}\\n\":(t+=\" cA=true\",void 0!==c.pathLen&&(t+=\", pathLen=\"+c.pathLen),t+=\"\\n\")}else if(\"keyUsage\"===h)t+=\" \"+pi.getExtKeyUsageString(this.hex)+\"\\n\";else if(\"subjectKeyIdentifier\"===h)t+=\" \"+pi.getExtSubjectKeyIdentifier(this.hex)+\"\\n\";else if(\"authorityKeyIdentifier\"===h){var l=pi.getExtAuthorityKeyIdentifier(this.hex);void 0!==l.kid&&(t+=\" kid=\"+l.kid+\"\\n\")}else if(\"extKeyUsage\"===h){var f=pi.getExtExtKeyUsageName(this.hex);t+=\" \"+f.join(\", \")+\"\\n\"}else if(\"subjectAltName\"===h){var d=pi.getExtSubjectAltName(this.hex);t+=\" \"+d.join(\", \")+\"\\n\"}else if(\"cRLDistributionPoints\"===h){var g=pi.getExtCRLDistributionPointsURI(this.hex);t+=\" \"+g+\"\\n\"}else if(\"authorityInfoAccess\"===h){var p=pi.getExtAIAInfo(this.hex);void 0!==p.ocsp&&(t+=\" ocsp: \"+p.ocsp.join(\",\")+\"\\n\"),void 0!==p.caissuer&&(t+=\" caissuer: \"+p.caissuer.join(\",\")+\"\\n\")}}return t+=\"signature algorithm: \"+pi.getSignatureAlgorithmName(this.hex)+\"\\n\",t+=\"signature: \"+pi.getSignatureValueHex(this.hex).substr(0,16)+\"...\\n\",t}}", "title": "" }, { "docid": "5ecce066b307460b62b24ef8a301aab8", "score": "0.46268326", "text": "function RegisterCert() {\n let personName = document.getElementById('person-name').value;\n let degreeName = document.getElementById('degree-name').value;\n let degreeId = document.getElementById('degree-id').value;\n let degreeDate = document.getElementById('degree-date').value;\n //uint256 id, string name, string certDate, string certName\n block.setCertificate(degreeId, personName, degreeDate, degreeName, function(error, result){\n if(!error)\n Materialize.toast('Certificate Successfully added', 4000)\n console.log(result);\n }\n );\n }", "title": "" }, { "docid": "69908ae35df858513a4d109ebf8c4331", "score": "0.46203235", "text": "function renderLicenseLink(apache, boost, bsd, eclipse, gnu, ibm, isc, perl) {\n return apache ? '[Apache 2.0](https://opensource.org/licenses/Apache-2.0)' :\n boost ? '[Boost 1.0](https://img.shields.io/badge/License-Boost%201.0-lightblue.svg)](https://www.boost.org/LICENSE_1_0.txt)' :\n bsd ? '[BSD 3-Clause](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)' :\n eclipse ? '[Eclipse 1.0](https://img.shields.io/badge/License-EPL%201.0-red.svg)](https://opensource.org/licenses/EPL-1.0)' :\n gnu ? '[GNU GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)' :\n ibm ? '[IBM 1.0](https://img.shields.io/badge/License-IPL%201.0-blue.svg)](https://opensource.org/licenses/IPL-1.0)' :\n isc ? '[ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)' :\n perl ? '[Perl](https://img.shields.io/badge/License-Perl-0298c3.svg)](https://opensource.org/licenses/Artistic-2.0)' :\n '';\n}", "title": "" }, { "docid": "b198860ad8591843d948e5b50feeac36", "score": "0.46077302", "text": "function X509() { this.subjectPublicKeyRSA = null; this.subjectPublicKeyRSA_hN = null; this.subjectPublicKeyRSA_hE = null; this.hex = null; this.getSerialNumberHex = function () { return ASN1HEX.getDecendantHexVByNthList(this.hex, 0, [0, 1]) }; this.getSignatureAlgorithmField = function () { var b = ASN1HEX.getDecendantHexVByNthList(this.hex, 0, [0, 2, 0]); var a = KJUR.asn1.ASN1Util.oidHexToInt(b); var c = KJUR.asn1.x509.OID.oid2name(a); return c }; this.getIssuerHex = function () { return ASN1HEX.getDecendantHexTLVByNthList(this.hex, 0, [0, 3]) }; this.getIssuerString = function () { return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex, 0, [0, 3])) }; this.getSubjectHex = function () { return ASN1HEX.getDecendantHexTLVByNthList(this.hex, 0, [0, 5]) }; this.getSubjectString = function () { return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex, 0, [0, 5])) }; this.getNotBefore = function () { var a = ASN1HEX.getDecendantHexVByNthList(this.hex, 0, [0, 4, 0]); a = a.replace(/(..)/g, \"%$1\"); a = decodeURIComponent(a); return a }; this.getNotAfter = function () { var a = ASN1HEX.getDecendantHexVByNthList(this.hex, 0, [0, 4, 1]); a = a.replace(/(..)/g, \"%$1\"); a = decodeURIComponent(a); return a }; this.readCertPEM = function (c) { var e = X509.pemToHex(c); var b = X509.getPublicKeyHexArrayFromCertHex(e); var d = new RSAKey(); d.setPublic(b[0], b[1]); this.subjectPublicKeyRSA = d; this.subjectPublicKeyRSA_hN = b[0]; this.subjectPublicKeyRSA_hE = b[1]; this.hex = e }; this.readCertPEMWithoutRSAInit = function (c) { var d = X509.pemToHex(c); var b = X509.getPublicKeyHexArrayFromCertHex(d); this.subjectPublicKeyRSA.setPublic(b[0], b[1]); this.subjectPublicKeyRSA_hN = b[0]; this.subjectPublicKeyRSA_hE = b[1]; this.hex = d }; this.getInfo = function () { var p = \"Basic Fields\\n\"; p += \" serial number: \" + this.getSerialNumberHex() + \"\\n\"; p += \" signature algorithm: \" + this.getSignatureAlgorithmField() + \"\\n\"; p += \" issuer: \" + this.getIssuerString() + \"\\n\"; p += \" notBefore: \" + this.getNotBefore() + \"\\n\"; p += \" notAfter: \" + this.getNotAfter() + \"\\n\"; p += \" subject: \" + this.getSubjectString() + \"\\n\"; p += \" subject public key info: \\n\"; var j = X509.getSubjectPublicKeyInfoPosFromCertHex(this.hex); var d = ASN1HEX.getHexOfTLV_AtObj(this.hex, j); var n = KEYUTIL.getKey(d, null, \"pkcs8pub\"); if (n instanceof RSAKey) { p += \" key algorithm: RSA\\n\"; p += \" n=\" + n.n.toString(16).substr(0, 16) + \"...\\n\"; p += \" e=\" + n.e.toString(16) + \"\\n\" } p += \"X509v3 Extensions:\\n\"; var m = X509.getV3ExtInfoListOfCertHex(this.hex); for (var e = 0; e < m.length; e++) { var b = m[e]; var o = KJUR.asn1.x509.OID.oid2name(b.oid); if (o === \"\") { o = b.oid } var k = \"\"; if (b.critical === true) { k = \"CRITICAL\" } p += \" \" + o + \" \" + k + \":\\n\"; if (o === \"basicConstraints\") { var g = X509.getExtBasicConstraints(this.hex); if (g.cA === undefined) { p += \" {}\\n\" } else { p += \" cA=true\"; if (g.pathLen !== undefined) { p += \", pathLen=\" + g.pathLen } p += \"\\n\" } } else { if (o === \"keyUsage\") { p += \" \" + X509.getExtKeyUsageString(this.hex) + \"\\n\" } else { if (o === \"subjectKeyIdentifier\") { p += \" \" + X509.getExtSubjectKeyIdentifier(this.hex) + \"\\n\" } else { if (o === \"authorityKeyIdentifier\") { var a = X509.getExtAuthorityKeyIdentifier(this.hex); if (a.kid !== undefined) { p += \" kid=\" + a.kid + \"\\n\" } } else { if (o === \"extKeyUsage\") { var h = X509.getExtExtKeyUsageName(this.hex); p += \" \" + h.join(\", \") + \"\\n\" } else { if (o === \"subjectAltName\") { var f = X509.getExtSubjectAltName(this.hex); p += \" \" + f.join(\", \") + \"\\n\" } else { if (o === \"cRLDistributionPoints\") { var l = X509.getExtCRLDistributionPointsURI(this.hex); p += \" \" + l + \"\\n\" } else { if (o === \"authorityInfoAccess\") { var c = X509.getExtAIAInfo(this.hex); if (c.ocsp !== undefined) { p += \" ocsp: \" + c.ocsp.join(\",\") + \"\\n\" } if (c.caissuer !== undefined) { p += \" caissuer: \" + c.caissuer.join(\",\") + \"\\n\" } } } } } } } } } } p += \"signature algorithm: \" + X509.getSignatureAlgorithmName(this.hex) + \"\\n\"; p += \"signature: \" + X509.getSignatureValueHex(this.hex).substr(0, 16) + \"...\\n\"; return p } }", "title": "" }, { "docid": "6ca3225b04a3bc7af3fc64bb0eb27a5c", "score": "0.4607217", "text": "function buildCertificateObject(commonName, organization, organizationUnit, countryCode, keyPair) {\n var cert = new org.pkijs.simpl.CERT();\n\n setSerialNumber(cert, Date.now());\n setSubject(cert, countryCode, organization, organizationUnit, commonName);\n setIssuer(cert, countryCode, organization, organizationUnit, commonName);\n setValidityPeriod(cert, new Date(), 30); // Good from today for 30 days\n setEmptyExtensions(cert);\n setCABit(cert, false);\n\n //digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign \n setKeyUsage(cert, true, true, false, false, false, true, true); \n setSignatureAlgorithm(cert, \"1.2.840.113549.1.1.11\"); // RSA with SHA-256\n\n return setPublicKey(cert, keyPair.publicKey).\n then(function() {return signCert(cert, \"1.2.840.113549.1.1.11\", keyPair.privateKey)}).\n then(function() {return cert});\n\n\n // Helper functions\n\n function setSerialNumber(cert, serialNumber) {\n cert.serialNumber = new org.pkijs.asn1.INTEGER({value: serialNumber});;\n }\n\n function setSubject(cert, countryCode, organization, organizationUnit, commonName) {\n setEntity(cert.subject, countryCode, organization, organizationUnit, commonName);\n }\n\n function setIssuer(cert, countryCode, organization, organizationUnit, commonName) {\n setEntity(cert.issuer, countryCode, organization, organizationUnit, commonName);\n }\n\n function setEntity(entity, countryCode, organization, organizationUnit, commonName) {\n if (countryCode) {\n entity.types_and_values.push(new org.pkijs.simpl.ATTR_TYPE_AND_VALUE({\n type: \"2.5.4.6\", //countryCode\n value: new org.pkijs.asn1.PRINTABLESTRING({value: countryCode})\n }));\n }\n\n if (organization) {\n entity.types_and_values.push(new org.pkijs.simpl.ATTR_TYPE_AND_VALUE({\n type: \"2.5.4.10\", //Organization\n value: new org.pkijs.asn1.PRINTABLESTRING({value: organization})\n }));\n }\n\n if (organizationUnit) {\n entity.types_and_values.push(new org.pkijs.simpl.ATTR_TYPE_AND_VALUE({\n type: \"2.5.4.11\", //Organization Unit\n value: new org.pkijs.asn1.PRINTABLESTRING({value: organizationUnit})\n }));\n }\n\n if (commonName) {\n entity.types_and_values.push(new org.pkijs.simpl.ATTR_TYPE_AND_VALUE({\n type: \"2.5.4.3\", //commonName\n value: new org.pkijs.asn1.PRINTABLESTRING({value: commonName})\n }));\n }\n }\n\n function setValidityPeriod(cert, startDate, durationInDays) {\n // Normalize to midnight\n var start = new Date(startDate);\n start.setHours(0);\n start.setMinutes(0);\n start.setSeconds(0);\n var end = new Date(start.getTime() + durationInDays * 24 * 60 * 60 * 1000);\n\n cert.notBefore.value = start;\n cert.notAfter.value = end;\n }\n\n function setEmptyExtensions(cert) {\n cert.extensions = new Array();\n }\n\n function setCABit(cert, isCA) {\n var basicConstraints = new org.pkijs.simpl.x509.BasicConstraints({\n cA: isCA,\n pathLenConstraint: 3\n });\n\n cert.extensions.push(new org.pkijs.simpl.EXTENSION({\n extnID: \"2.5.29.19\",\n critical: false,\n extnValue: basicConstraints.toSchema().toBER(false),\n parsedValue: basicConstraints\n }));\n }\n\n function setKeyUsage(cert, digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign) {\n var keyUsageBits = new ArrayBuffer(1);\n var keyUsageBytes = new Uint8Array(keyUsageBits);\n\n keyUsageBytes[0] = 0;\n if (digitalSignature) {keyUsageBytes[0] |= 0x80;}\n if (nonRepudiation) {keyUsageBytes[0] |= 0x40;}\n if (keyEncipherment) {keyUsageBytes[0] |= 0x20;}\n if (dataEncipherment) {keyUsageBytes[0] |= 0x10;}\n if (keyAgreement) {keyUsageBytes[0] |= 0x08;}\n if (keyCertSign) {keyUsageBytes[0] |= 0x04;}\n if (cRLSign) {keyUsageBytes[0] |= 0x02;}\n\n var keyUsage = new org.pkijs.asn1.BITSTRING({value_hex: keyUsageBits});\n cert.extensions.push(new org.pkijs.simpl.EXTENSION({\n extnID: \"2.5.29.15\",\n critical: false,\n extnValue: keyUsage.toBER(false),\n parsedValue: keyUsage\n }));\n }\n\n function setSignatureAlgorithm(cert, oid) {\n cert.signatureAlgorithm.algorithm_id = oid; // In tbsCert\n }\n\n function setPublicKey(cert, publicKey) {\n return cert.subjectPublicKeyInfo.importKey(publicKey);\n }\n\n function signCert(cert, oid, privateKey) {\n cert.signature.algorithm_id = oid; // In actual signature\n return cert.sign(privateKey);\n }\n}", "title": "" }, { "docid": "9b2d6aed1223fbb95a0be816d882b032", "score": "0.4596389", "text": "function renderLicenseLink(license) {\n\n// //['MIT', 'GNU AGPLv3', 'GNU GPLv3', 'GNU LGPLv3','Mozilla Public 2.0','Apache 2.0','Boost Software 1.0','The Unlicense','None]\n if (license ==='MIT'){\n return 'https://choosealicense.com/licenses/mit/'\n }\n else if (license === 'GNU AGPLv3'){\n return 'https://choosealicense.com/licenses/agpl-3.0/'\n }\n else if (license === 'GNU GPLv3') {\n return 'https://choosealicense.com/licenses/gpl-3.0/'\n }\n else if (license === 'GNU LGPLv3') {\n return 'https://choosealicense.com/licenses/lgpl-3.0/'\n }\n else if (license === 'Mozilla Public 2.0') {\n return 'https://choosealicense.com/licenses/mpl-2.0/'\n }\n else if (license === 'Apache 2.0') {\n return 'https://choosealicense.com/licenses/apache-2.0/'\n }\n else if (license === 'Boost Software 1.0') {\n return 'https://choosealicense.com/licenses/bsl-1.0/'\n }\n else if (license === 'The Unlicense') {\n return 'https://choosealicense.com/licenses/unlicense/'\n }\n else {\n return ''\n }\n }", "title": "" }, { "docid": "49685fc57b02079103cc3f2011150dae", "score": "0.45947742", "text": "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "02605dc6c71d9d137d5214dfc3144e03", "score": "0.45944896", "text": "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "02605dc6c71d9d137d5214dfc3144e03", "score": "0.45944896", "text": "function parse_RC4Header(blob, length) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_Version(blob, 4); length -= 4;\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}", "title": "" }, { "docid": "ae2788b7af6a07928e809efb8e4f4795", "score": "0.45804137", "text": "function renderLicenseLink(license) {\n let x;\n switch (license.toString()) {\n case 'None':\n x = \"\";\n break;\n case 'CC0 1.0 Universal':\n x = `Full license information can be found here: [License: CC0-1.0](http://creativecommons.org/publicdomain/zero/1.0/)`;\n break;\n case 'LGPL':\n x = `Full license information can be found here: [License: LGPL v3]](https://www.gnu.org/licenses/lgpl-3.0)`;\n break;\n case 'MIT':\n x = `Full license information can be found here: [License: MIT](https://opensource.org/licenses/MIT)`\n break;\n case 'Apache License, Version 2.0':\n x = `Full license information can be found here: [License](https://opensource.org/licenses/Apache-2.0)`\n break;\n case 'Boost':\n x = `Full license information can be found here: [License](https://www.boost.org/LICENSE_1_0.txt)`;\n break;\n }\n return x;\n}", "title": "" }, { "docid": "961fd6ba2e51cb1e2be0cde2b38be1ef", "score": "0.4578962", "text": "extractDomoticzUrlData (request) {\n\t let domoticzUrlData = {domain:null,proto:\"HTTP\"};\n\t const result = request.split(\"//\").map((value)=>value.split(\":\")[0]);\n\t debugLogger('%j',result)\n\t if(result.length > 1)\n\t {\n\t domoticzUrlData.proto = result[0];\n\t domoticzUrlData.domain = result[1];\n\t }else{\n\t domoticzUrlData.domain = result[0];\n\t }\n \t return domoticzUrlData;\n\t}", "title": "" }, { "docid": "b3926481437580a12387fc561d2c0f35", "score": "0.4577665", "text": "function compileFundData() {\n var rawURLData = window.location.href.split('?')[1];\n if (rawURLData === undefined) { return null };\n var fundData = rawURLData.split('|');\n \n var convertedFundData = fundData.map(function(item, i) {\n var ticketItems = item.split(',');\n var ticketObj = { identifier: ticketItems[0], identifierType: ticketItems[1], weight: ticketItems[2] };\n return ticketObj;\n })\n \n return convertedFundData;\n }", "title": "" }, { "docid": "9833f4e00651cfa3f50200a2fa2e3020", "score": "0.4576389", "text": "prepare(sid) {\n var file_name;\n if (this.student.middle_name != null) {\n file_name = this.student.student_id + '_' + this.student.school + '_' + this.student.first_name + '_' + this.student.middle_name + '_' + this.student.last_name + '_' + sid + '.pdf';\n }\n else {\n file_name = this.student.student_id + '_' + this.student.school + '_' + this.student.first_name + '__' + this.student.last_name + '_' + sid + '.pdf';\n }\n console.log(file_name);\n var downloadUrl = (this.cdn + file_name.replace(/\\s/g, \"_\"));\n if (downloadUrl.includes(\"'\")) {\n downloadUrl = downloadUrl.replace(/'/g, \"''\");\n }\n console.log(downloadUrl);\n this.download(file_name, downloadUrl);\n }", "title": "" }, { "docid": "004293fe626bb97344ecf8fd3838dd47", "score": "0.45715168", "text": "function renderLicenseLink(license) {\n switch (license) { \n case 'MIT':\n return \"(https://opensource.org/licenses/MIT)\";\n case 'MPL':\n return \"(https://opensource.org/licenses/MPL-2.0)\";\n default:\n return \"\";\n } \n}", "title": "" }, { "docid": "fcb30dcf0dc63889d4719b822118766d", "score": "0.45710534", "text": "function X509(){this.subjectPublicKeyRSA=null;this.subjectPublicKeyRSA_hN=null;this.subjectPublicKeyRSA_hE=null;this.hex=null;this.getSerialNumberHex=function(){return ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,1])};this.getIssuerHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3])};this.getIssuerString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,3]))};this.getSubjectHex=function(){return ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5])};this.getSubjectString=function(){return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex,0,[0,5]))};this.getNotBefore=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,0]);a=a.replace(/(..)/g,\"%$1\");a=decodeURIComponent(a);return a};this.getNotAfter=function(){var a=ASN1HEX.getDecendantHexVByNthList(this.hex,0,[0,4,1]);a=a.replace(/(..)/g,\"%$1\");a=decodeURIComponent(a);return a};this.readCertPEM=function(c){var e=X509.pemToHex(c);var b=X509.getPublicKeyHexArrayFromCertHex(e);var d=new RSAKey();d.setPublic(b[0],b[1]);this.subjectPublicKeyRSA=d;this.subjectPublicKeyRSA_hN=b[0];this.subjectPublicKeyRSA_hE=b[1];this.hex=e};this.readCertPEMWithoutRSAInit=function(c){var d=X509.pemToHex(c);var b=X509.getPublicKeyHexArrayFromCertHex(d);this.subjectPublicKeyRSA.setPublic(b[0],b[1]);this.subjectPublicKeyRSA_hN=b[0];this.subjectPublicKeyRSA_hE=b[1];this.hex=d}}", "title": "" }, { "docid": "6130a2eb4349e909654803b9e09a6792", "score": "0.4570366", "text": "function getLicense(state) {\n return state.entities.general.license;\n}", "title": "" }, { "docid": "81a81b3392a47a9ea35bfe07e5e4f59d", "score": "0.4569724", "text": "function renderLicenseSection(license) {\n\n\n}", "title": "" }, { "docid": "81a81b3392a47a9ea35bfe07e5e4f59d", "score": "0.4569724", "text": "function renderLicenseSection(license) {\n\n\n}", "title": "" }, { "docid": "ad9953aa76c69a60cbfec4a58cae0281", "score": "0.45664695", "text": "function setWidevineDataResponse(response) {\n const wrappedArray = new Uint8Array(response.data);\n\n // Convert it to a string.\n const wrappedString = String.fromCharCode.apply(null, wrappedArray);\n\n // Parse the JSON string into an object.\n let wrapped;\n try {\n wrapped = JSON.parse(wrappedString);\n } catch (err) {\n throw new Error(`Error while parsing JSON: ${err}`);\n }\n\n // This is a base64-encoded version of the raw license.\n const rawLicenseBase64 = wrapped.license;\n\n // Decode it to a string.\n const rawLicenseString = atob(rawLicenseBase64);\n\n // Convert that string into a Uint8Array and replace the response data to\n // feed it to the Widevine CDM.\n response.data = new Uint8Array(rawLicenseString.length);\n for (let i = 0; i < rawLicenseString.length; i += 1) {\n response.data[i] = rawLicenseString.charCodeAt(i);\n }\n}", "title": "" }, { "docid": "74036588a2b44820d760ef819db79a44", "score": "0.4564558", "text": "function renderLicenseLink(license) {\n this.license = license;\n let licenseType = this.license;\n let LicLink = '';\n if(licenseType === 'MIT license') {\n LicLink = 'https://opensource.org/licenses/MIT'\n } else if (licenseType === '') {\n LicLink = '';\n \n }\n return LicLink;\n}", "title": "" }, { "docid": "0242e8e7eeca64cf216f2e6ce7ab3ecf", "score": "0.45636833", "text": "function X509() { this.subjectPublicKeyRSA = null; this.subjectPublicKeyRSA_hN = null; this.subjectPublicKeyRSA_hE = null; this.hex = null; this.getSerialNumberHex = function () { return ASN1HEX.getDecendantHexVByNthList(this.hex, 0, [0, 1]) }; this.getIssuerHex = function () { return ASN1HEX.getDecendantHexTLVByNthList(this.hex, 0, [0, 3]) }; this.getIssuerString = function () { return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex, 0, [0, 3])) }; this.getSubjectHex = function () { return ASN1HEX.getDecendantHexTLVByNthList(this.hex, 0, [0, 5]) }; this.getSubjectString = function () { return X509.hex2dn(ASN1HEX.getDecendantHexTLVByNthList(this.hex, 0, [0, 5])) }; this.getNotBefore = function () { var a = ASN1HEX.getDecendantHexVByNthList(this.hex, 0, [0, 4, 0]); a = a.replace(/(..)/g, \"%$1\"); a = decodeURIComponent(a); return a }; this.getNotAfter = function () { var a = ASN1HEX.getDecendantHexVByNthList(this.hex, 0, [0, 4, 1]); a = a.replace(/(..)/g, \"%$1\"); a = decodeURIComponent(a); return a }; this.readCertPEM = function (c) { var e = X509.pemToHex(c); var b = X509.getPublicKeyHexArrayFromCertHex(e); var d = new RSAKey(); d.setPublic(b[0], b[1]); this.subjectPublicKeyRSA = d; this.subjectPublicKeyRSA_hN = b[0]; this.subjectPublicKeyRSA_hE = b[1]; this.hex = e }; this.readCertPEMWithoutRSAInit = function (c) { var d = X509.pemToHex(c); var b = X509.getPublicKeyHexArrayFromCertHex(d); this.subjectPublicKeyRSA.setPublic(b[0], b[1]); this.subjectPublicKeyRSA_hN = b[0]; this.subjectPublicKeyRSA_hE = b[1]; this.hex = d } }", "title": "" }, { "docid": "2f29413a6c9040973b3056161542e242", "score": "0.4561332", "text": "@api\n toData(){\n\n return this.signaturePad.toData()\n }", "title": "" }, { "docid": "0d05a238abf93f35469796604eaa51c0", "score": "0.45530048", "text": "function renderLicenseLink(license) {\n if (license.trim() === \"\") return \"\";\n switch (license) {\n case \"A2\":\n return `(https://opensource.org/licenses/Apache-2.0)`;\n case \"C4\":\n return `(https://creativecommons.org/licenses/by/4.0/)`;\n case \"G3\":\n return `(https://www.gnu.org/licenses/gpl-3.0)`;\n case \"M\":\n return `(https://opensource.org/licenses/MIT)`;\n case \"M2\":\n return `(https://opensource.org/licenses/MPL-2.0)`;\n }\n}", "title": "" }, { "docid": "bfa2700033c5dd09f8e942e6e8849614", "score": "0.4550993", "text": "function registerLicense(licenseCode) {\n const array = new Uint8Array(licenseCode.length);\n for (let i = 0; i < array.length; i++) {\n array[i] = licenseCode.charCodeAt(i);\n }\n\n const request = {\n method: 'POST',\n url: LICENSE_ENDPOINT,\n headers: {\n 'Content-Type': 'application/octet-stream'\n },\n data: array,\n transformRequest: []\n };\n return $http(request);\n }", "title": "" }, { "docid": "33246dff9a5156049bf59664e0868309", "score": "0.4549792", "text": "function renderLicenseLink(license) {\n switch(license){\n case 'Apache': return 'https://opensource.org/licenses/Apache-2.0';\n case 'GNU': return 'https://opensource.org/licenses/gpl-license';\n case 'MIT': return 'https://opensource.org/licenses/MIT';\n case 'Boost Software': return 'https://www.boost.org/users/license.html';\n case 'Creative Commons': return'https://creativecommons.org/about/cclicenses/';\n case 'Eclipse': return 'https://www.eclipse.org/org/documents/edl-v10.php';\n case 'Mozilla': return 'https://opensource.org/licenses/MPL-2.0';\n case 'The Unlicense': return 'https://opensource.org/licenses/Unlicense';\n case 'None': return'';\n }\n}", "title": "" }, { "docid": "40565b3be59abc36dbc374c36cdb1389", "score": "0.45399457", "text": "function renderLicenseSection(license) {\n\n}", "title": "" }, { "docid": "3d7ab7bfda9298d162d0a6d9e5c9cd8c", "score": "0.45342243", "text": "GetCACertificate(int, string, int) {\n\n }", "title": "" } ]
977a4f43a80693a976ce80a7dc4ec431
Principle 1 code example for Window/Global Object Binding
[ { "docid": "914d17845b7223d4ee3ada218a904674", "score": "0.0", "text": "function sayName(name) {\n console.log(this);// this will output the window/console object\n return name;\n }", "title": "" } ]
[ { "docid": "eff8d584e79a66e71e3e6a6c0e223253", "score": "0.67468435", "text": "function globalBinding() {\n console.log(`An example of Global Binding :-`);\n console.log(this);\n}", "title": "" }, { "docid": "a3f6de809a54d4837d720f63b53dd0d0", "score": "0.60996336", "text": "function windowsBind(){\n console.log(this)\n }", "title": "" }, { "docid": "62724ee7588b57160632976bbd65e0d4", "score": "0.59765095", "text": "function globalBinding(gblBind) {\n console.log(this);\n return gblBind; //?\n}", "title": "" }, { "docid": "33951687f620687a7751cb4b4b18db60", "score": "0.58497435", "text": "function Window(){this.initialize.apply(this,arguments);}", "title": "" }, { "docid": "0083a3c214ba785a8b680905468a43ba", "score": "0.58263004", "text": "function extendWindow(global) {\n global.window = global;\n \n global.frameElement = null;\n global.frames = [];\n global.length = 0;\n \n \n global.window.location = \"JENERIC\";\n global.window.parent = global.window;\n global.window.top = global.window;\n global.window.window = global.window;\n global.window.self = global.window;\n \n for(ob in __Window.prototype) {\n global[ob] = __Window.prototype[ob];\n }\n global.window.___link = window;\n \n}", "title": "" }, { "docid": "1249826858d3b78b4871d48bba7e07c5", "score": "0.578465", "text": "function bindGlobal() {\n updateEl = $el;\n activeButtons = newButtons;\n updateCB = options.onUpdate;\n }", "title": "" }, { "docid": "b474ac59165932dd9062d5c62d2e62ae", "score": "0.5639717", "text": "attachToWindow(win) {\n this.attachToGlobal(win);\n }", "title": "" }, { "docid": "12241fcc9d823744e4da38cf7655d625", "score": "0.563739", "text": "function applyBinding() {\n\tdataBind(document.body, viewModel);\n}", "title": "" }, { "docid": "c6a61a8baa1080eb99e0f8263677686f", "score": "0.5629925", "text": "function __Window() { \n // this.document to be set by inuit!!!!\n this.frameElement = null;\n this.frames = [];\n this.length = 0;\n this.___link = window;\n \n}", "title": "" }, { "docid": "4ecde2f17268039d67ae7f972501174b", "score": "0.561809", "text": "init() {\n this.binds();\n }", "title": "" }, { "docid": "3f9d395d630951fbee28f9a0a39e1218", "score": "0.55681074", "text": "function UserInterfaceBinder() {\n this.debugWindow = null;\n this.FormBindings = new Array();\n this.ListBindings = new Array();\n this.Directives = new Array();\n}", "title": "" }, { "docid": "da2accb364f0047fde2927a0319aed00", "score": "0.55524415", "text": "bind() {\n this.emit = this.emit.bind(this);\n this.auto = this.auto.bind(this);\n this.onWindowFocus = this.onWindowFocus.bind(this);\n this.onWindowBlur = this.onWindowBlur.bind(this);\n this.onVisibilityChange = this.onVisibilityChange.bind(this);\n }", "title": "" }, { "docid": "41a2cf94a7c8eff84bcd79bd47b8a0b5", "score": "0.55407804", "text": "function onCanHaveBindings(this_, o) {\n flushCurrent(this_);\n this_._current = o;\n}", "title": "" }, { "docid": "e99c7f8be06bddbc055025aa8a3c5cb3", "score": "0.55305606", "text": "function addObjectToWindow(nameInWindow, obj, callback) {\n window[nameInWindow] = obj;\n try {\n callback();\n } finally {\n delete window[nameInWindow];\n }\n}", "title": "" }, { "docid": "8655c6f154a9cd9928798e0b0078f532", "score": "0.55019474", "text": "bind() {\n this.bindings.forEach(binding => {\n binding.bind();\n });\n }", "title": "" }, { "docid": "8522ab9654bf43163a8ae9311c263018", "score": "0.54948086", "text": "bindCorrectContext() {\n this.onChannelsChange = this.onChannelsChange.bind(this);\n this.onAllChannelsChange = this.onAllChannelsChange.bind(this);\n this.onShowLinkerButton = this.onShowLinkerButton.bind(this);\n this.hoverAction = this.hoverAction.bind(this);\n this.showLinkerWindow = this.showLinkerWindow.bind(this);\n }", "title": "" }, { "docid": "5f34beb3ab178332b6c153a5e3ab14ec", "score": "0.54940546", "text": "bindings()\n {\n\n }", "title": "" }, { "docid": "14c5d6b9c17732ce6d9e0c575d572fe6", "score": "0.54800373", "text": "function NewBinding() {\n console.log(this.name); // outputs undefined\n}", "title": "" }, { "docid": "8804325c175b44607c57fc3148d5b7e7", "score": "0.5464871", "text": "static greeting(){\n console.log('Hey there!');\n console.log(this);//here, this is not point to Windows object, it point to Person6.\n //it don't have access to object\n //where is this method located? in prototype? no\n //we just need to rememeber it.\n }", "title": "" }, { "docid": "0b62dbce808fdc552b79d778ce4cfed7", "score": "0.5451827", "text": "function Window_SPW() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "dc2acd65861a94f5bd7fe8972dd79823", "score": "0.544904", "text": "static init () {\n new Tabs().binds();\n }", "title": "" }, { "docid": "649924958c7fed947c6b0d645c507894", "score": "0.5439906", "text": "function is_object_bound(obj) {\n\t return is_bound(obj) && obj[Symbol[\"for\"]('__context__')] === Object;\n\t } // ----------------------------------------------------------------------", "title": "" }, { "docid": "b29127b9cd7c22e5022b14ab46e7904d", "score": "0.54338235", "text": "static initialize(){\n elementBinding();\n }", "title": "" }, { "docid": "f390f840d2173c4cfc512e2cfb5ac16e", "score": "0.5432482", "text": "function LiveObject() {\n\n }", "title": "" }, { "docid": "2908b32765ba0d231a3640c4857f4b1f", "score": "0.54319555", "text": "_bindToCallbacks() {\r\n\t\tthis._switchArea = this._switchArea.bind(this);\r\n\t\tthis._setWindow = this._setWindow.bind(this);\t\r\n\t\tthis._completeArea = this._completeArea.bind(this);\t\t\t\r\n\t}", "title": "" }, { "docid": "43f71d4dfcbee978af001d23edf057bc", "score": "0.5423465", "text": "function Person(obj){\n this.name = obj.name;\n this.age = obj.age;\n this.speak = function(){\n console.log(`This new binding`, this);\n return `Hello, my name is ${this.name}, and I am ${this.age} years old`;\n }\n}", "title": "" }, { "docid": "7089b874b237835777a44e617333df65", "score": "0.54087955", "text": "function NewBinding(name, book, char) {\n\tthis.book = book;\n\tthis.char = char;\n\tthis.name = name;\n\tthis.intro = function() {\n\t\tconsole.log(`Hi! My name is ${this.name}, and my favorite book is ${this.book}. My favorite character in the story is ${this.char}.`)\n\t}\n}", "title": "" }, { "docid": "91cfb1d3d51f8f1e095ccc2cd69f2e57", "score": "0.5391764", "text": "function _bind()\n {\n // Listen for scroll and touch move events\n angular.element($window).bind('scroll', _update);\n angular.element($window).bind('touchmove', _update);\n angular.element($window).bind('resize', _update);\n }", "title": "" }, { "docid": "0f5158f8e1a6f81e13414b68286bc8a5", "score": "0.5389128", "text": "function pageLoaded(args) {\n var page = args.object;\n page.bindingContext = vm;\n}", "title": "" }, { "docid": "802ab4271a1f40727fa1787d4dd209b3", "score": "0.5369074", "text": "function TameWindow() {\n // These descriptors were chosen to resemble actual ES5-supporting browser\n // behavior.\n // The document property is defined below.\n Object.defineProperty(this, \"location\", {\n value: tameLocation,\n configurable: false,\n enumerable: true,\n writable: false // Writable in browsers, but has a side-effect\n // which we don't implement.\n });\n Object.defineProperty(this, \"navigator\", {\n value: tameNavigator,\n configurable: false,\n enumerable: true,\n writable: false\n });\n definePropertiesAwesomely(this, viewProperties);\n taming.permitUntaming(this);\n }", "title": "" }, { "docid": "9570d59e7c1b1358ad1e30f1414a8283", "score": "0.53587794", "text": "function Window_Command() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "df0331058d53bc95f77c06f4e37fa0f8", "score": "0.5352508", "text": "function setupBinding(root, factory) {\n\t if (true) {\n\t // AMD. Register as an anonymous module.\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1),__webpack_require__(32)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom) {\n\t return factory(root, React, ReactDom);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t } else if (typeof exports === 'object') {\n\t // Node. Note that this does not work with strict\n\t // CommonJS, but only CommonJS-like environments\n\t // that support module.exports\n\t module.exports = factory(root, require('react'), require('react-dom'));\n\t } else {\n\t // Browser globals (root is window)\n\t root.onClickOutside = factory(root, React, ReactDOM);\n\t }\n\t }", "title": "" }, { "docid": "adbc6a446646f664ae5bdc3f4163a8a1", "score": "0.53522813", "text": "function Window_Blast() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "d7931c02abc15314afb1737dcd775b99", "score": "0.53492963", "text": "function Window_Base() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "94266c325e5bd39adc8ef2a165466fd6", "score": "0.5348601", "text": "function setupBinding(root, factory) {\n\t if (true) {\n\t // AMD. Register as an anonymous module.\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(2),__webpack_require__(32)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom) {\n\t return factory(root, React, ReactDom);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t } else if (typeof exports === 'object') {\n\t // Node. Note that this does not work with strict\n\t // CommonJS, but only CommonJS-like environments\n\t // that support module.exports\n\t module.exports = factory(root, require('react'), require('react-dom'));\n\t } else {\n\t // Browser globals (root is window)\n\t root.onClickOutside = factory(root, React, ReactDOM);\n\t }\n\t }", "title": "" }, { "docid": "523e2264d514d5b0dcf3bccd523b9260", "score": "0.5343925", "text": "function setupBinding(root, factory) {\n\t if (true) {\n\t // AMD. Register as an anonymous module.\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! react */ 17),__webpack_require__(/*! react-dom */ 18)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom) {\n\t return factory(root, React, ReactDom);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t } else if (typeof exports === 'object') {\n\t // Node. Note that this does not work with strict\n\t // CommonJS, but only CommonJS-like environments\n\t // that support module.exports\n\t module.exports = factory(root, require('react'), require('react-dom'));\n\t } else {\n\t // Browser globals (root is window)\n\t root.onClickOutside = factory(root, React, ReactDOM);\n\t }\n\t }", "title": "" }, { "docid": "d4d157b8079daabb35817246c4778cd2", "score": "0.534219", "text": "function Ui(){return Ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ui.apply(this,arguments)}", "title": "" }, { "docid": "b4774389de7a1b16e886663e9c03568e", "score": "0.5335367", "text": "function setupBinding(root, factory) {\n\t if (true) {\n\t // AMD. Register as an anonymous module.\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(2),__webpack_require__(34)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom) {\n\t return factory(root, React, ReactDom);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t } else if (typeof exports === 'object') {\n\t // Node. Note that this does not work with strict\n\t // CommonJS, but only CommonJS-like environments\n\t // that support module.exports\n\t module.exports = factory(root, require('react'), require('react-dom'));\n\t } else {\n\t // Browser globals (root is window)\n\t root.onClickOutside = factory(root, React, ReactDOM);\n\t }\n\t }", "title": "" }, { "docid": "5c6d650f19cd43b655b08cc5846494f0", "score": "0.5330039", "text": "function globalWindow() {\n console.log(this)\n}", "title": "" }, { "docid": "ed9196290536e9bdf8596db08c373530", "score": "0.53253084", "text": "function Window() {\n this.initialize(...arguments);\n}", "title": "" }, { "docid": "8ab02b4999ae70e2313292a1479986ed", "score": "0.5321703", "text": "function raamObject() {\n /*\n het window object is het globale object aan de client side.\n alle onderstaande methods zijn uit te voeren door er window. voor te zetten\n De dom is een onderdeel van het window object.\n */\n\n // Windows methods/objects/properties\n\n // console.log\n // console.log(123);\n\n // alert\n // alert('hoi');\n\n // prompt\n // neemt een input vanuit alert box\n // const input = prompt();\n // alert(input);\n\n // confirm\n // if (confirm(\"weet je het zeker?\")) {\n // console.log(\"yes\");\n // } else {\n // console.log(\"no\");\n // }\n\n // verschillende properties van het window object\n let val;\n\n // outer height and width\n val = window.outerHeight;\n val = window.outerWidth;\n\n // inner height and width\n val = window.innerHeight;\n val = window.innerWidth;\n\n // Scroll points\n // waar je bent met scrollen\n val = window.scrollY;\n val = window.scrollX;\n\n // Location object\n val = window.location;\n // inhoud van location object benaderen\n val = window.location.hostname;\n val = window.location.port;\n val = window.location.href;\n // alles achter de ampersande& in de url\n val = window.location.search;\n\n // Location object redirect\n // window.location.href = 'https://google.com';\n\n // Reload blijft pagina infinite reloaden\n // window.location.reload();\n\n // History Object, gaat terug naar de vorige pagina. parameter toevoegen zoals -1 gaan we 1 site terug\n // val = window.history.go();\n\n // De lengte van de history\n val = window.history.length;\n\n // Navigator object\n // dit heeft te maken met de browser zelf niet met de paginas\n // Haalt verschillende browser informatie op\n\n val = window.navigator;\n val = window.navigator.appName;\n val = window.navigator.appVersion;\n val = window.navigator.userAgent;\n val = window.navigator.platform;\n val = window.navigator.vendor;\n val = window.navigator.language;\n\n console.log(val);\n}", "title": "" }, { "docid": "1f75f4d02f1e8d126096823d2e5513c1", "score": "0.5313425", "text": "bindUI() {\n this.on('mousedown', this.onMouseDown);\n this.on('click', this.onClick);\n\n this.onWindowEvent('resize', this.onWindowResize);\n this.onWindowEvent('mousemove', this.onWindowMouseMove);\n this.onWindowEvent('mouseup', this.onWindowMouseUp);\n }", "title": "" }, { "docid": "d7f2979a6c4d1cd0184020deb3225593", "score": "0.5311952", "text": "_bind() {}", "title": "" }, { "docid": "fb1d68447f299b3f11b75dd4c2bf6ce6", "score": "0.52977484", "text": "function setupBinding(root, factory) {\n\t if (true) {\n\t // AMD. Register as an anonymous module.\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1),__webpack_require__(37),__webpack_require__(1109)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom, createReactClass) {\n\t if (!createReactClass) createReactClass = React.createClass;\n\t return factory(root, React, ReactDom, createReactClass);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t } else if (typeof exports === 'object') {\n\t // Node. Note that this does not work with strict\n\t // CommonJS, but only CommonJS-like environments\n\t // that support module.exports\n\t module.exports = factory(root, require('react'), require('react-dom'), require('create-react-class'));\n\t } else {\n\t // Browser globals (root is window)\n\t var createReactClass = React.createClass ? React.createClass : window.createReactClass;\n\t root.onClickOutside = factory(root, React, ReactDOM, createReactClass);\n\t }\n\t }", "title": "" }, { "docid": "92432a7ca37a387422ab05f36c04bf6f", "score": "0.52960026", "text": "function Person(obj) {\n this.name = obj.name;\n thids.age = obj.age;\n this.speak = function() {\n console.log(`This is new binding`,this);\n return `Hello my name is ${this.name} and i am ${this.age} years old`;\n }\n }", "title": "" }, { "docid": "6054d89468dc162138a72e0b70f5c693", "score": "0.5293777", "text": "function initBindings(){ngDevMode&&assertEqual(viewData[BINDING_INDEX],-1,'Binding index should not yet be set '+viewData[BINDING_INDEX]);if(tView.bindingStartIndex===-1){tView.bindingStartIndex=viewData.length;}viewData[BINDING_INDEX]=tView.bindingStartIndex;}", "title": "" }, { "docid": "f24acd7b8068b7ed922f78d4f0f31f21", "score": "0.52788156", "text": "bind(func, context) {\n var win = window;\n var ArrayProto = Array.prototype,\n FuncProto = Function.prototype,\n ObjProto = Object.prototype,\n slice = ArrayProto.slice,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty,\n windowConsole = win.console,\n navigator = win.navigator,\n document = win.document,\n windowOpera = win.opera,\n screen = win.screen,\n userAgent = navigator.userAgent;\n\n var nativeBind = FuncProto.bind,\n nativeForEach = ArrayProto.forEach,\n nativeIndexOf = ArrayProto.indexOf,\n nativeIsArray = Array.isArray,\n breaker = {};\n var args, bound;\n if (nativeBind && func.bind === nativeBind) {\n return nativeBind.apply(func, slice.call(arguments, 1));\n }\n // if (!_.isFunction(func)) {\n // throw new TypeError();\n // }\n args = slice.call(arguments, 2);\n bound = function () {\n if (!(this instanceof bound)) {\n return func.apply(context, args.concat(slice.call(arguments)));\n }\n var ctor = {};\n ctor.prototype = func.prototype;\n var self = {};\n ctor.prototype = null;\n var result = func.apply(self, args.concat(slice.call(arguments)));\n if (Object(result) === result) {\n return result;\n }\n return self;\n };\n return bound;\n\n }", "title": "" }, { "docid": "cf6b44f01a43c8149774b4b63a971103", "score": "0.5275064", "text": "function bind() {\n common.naclModule.postMessage({cmd: 'bind', name: configName, id: configId});\n}", "title": "" }, { "docid": "03b709ececd95d9a21a980b14f6e4d34", "score": "0.5268722", "text": "function applicationCommonBindings() {\r\n return [\r\n di_1.bind(compiler_1.Compiler)\r\n .toClass(compiler_2.Compiler_),\r\n application_tokens_1.APP_ID_RANDOM_BINDING,\r\n view_pool_1.AppViewPool,\r\n di_1.bind(view_pool_1.APP_VIEW_POOL_CAPACITY).toValue(10000),\r\n di_1.bind(view_manager_1.AppViewManager).toClass(view_manager_2.AppViewManager_),\r\n view_manager_utils_1.AppViewManagerUtils,\r\n view_listener_1.AppViewListener,\r\n proto_view_factory_1.ProtoViewFactory,\r\n view_resolver_1.ViewResolver,\r\n pipes_1.DEFAULT_PIPES,\r\n di_1.bind(change_detection_1.IterableDiffers).toValue(change_detection_1.defaultIterableDiffers),\r\n di_1.bind(change_detection_1.KeyValueDiffers).toValue(change_detection_1.defaultKeyValueDiffers),\r\n directive_resolver_1.DirectiveResolver,\r\n pipe_resolver_1.PipeResolver,\r\n di_1.bind(dynamic_component_loader_1.DynamicComponentLoader).toClass(dynamic_component_loader_2.DynamicComponentLoader_),\r\n di_1.bind(life_cycle_1.LifeCycle).toFactory(function (exceptionHandler) { return new life_cycle_1.LifeCycle_(null, lang_1.assertionsEnabled()); }, [exceptions_1.ExceptionHandler]),\r\n ];\r\n}", "title": "" }, { "docid": "acb8df9da14612c09666fd115b545f75", "score": "0.52538", "text": "function navigatingTo(args) {\n var page = args.object;\n page.bindingContext = new main_view_model_1.HelloWorldModel();\n}", "title": "" }, { "docid": "74b36e6dda8290446d55011092685936", "score": "0.5253431", "text": "function GlobalScopeCtrl() {\n \"use strict\";\n internal(this)._localStorageNode = flownodeFactory.createLocalStorageNode();\n internal(this)._name = scopeFactory.createDomainScope([\n internal(this)._localStorageNode,\n internal(this)._localStorageNode,\n [internal(this)._localStorageNode]\n ]);\n\n initialization(internal(this)._localStorageNode, internal(this)._name);\n\n /* start-test-block */\n this._testonly_ = internal(this);\n this._testonly_._initialization = initialization;\n /* end-test-block */\n}", "title": "" }, { "docid": "871ebde2d23706b419db60be82b43d3b", "score": "0.52439433", "text": "get binding() {\n\t\treturn this.__binding;\n\t}", "title": "" }, { "docid": "871ebde2d23706b419db60be82b43d3b", "score": "0.52439433", "text": "get binding() {\n\t\treturn this.__binding;\n\t}", "title": "" }, { "docid": "0c126f9b4f545ce3205d481fb7b72517", "score": "0.5240759", "text": "function Window_NotepadBase() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "b42c8f285fdf983978506e6493732b3b", "score": "0.52380484", "text": "function bindElement(element,object){setPropertyOnElement(element,DATA_BINDING_ID,object);}", "title": "" }, { "docid": "31368059356aac9591e6a95223023096", "score": "0.5210347", "text": "function onLoad() {\n g_browserBridge = new BrowserBridge();\n g_mainView = new MainView();\n}", "title": "" }, { "docid": "87f3bab1a26fb761061246ac7808a0cc", "score": "0.5208141", "text": "function bindings_complete()\n{\n init_js();\n}", "title": "" }, { "docid": "743c67ca865acd1a4988ebb346c3e885", "score": "0.5205207", "text": "static GetWindow() {}", "title": "" }, { "docid": "b2c123681bb98a284d7c25a1c1a43276", "score": "0.5201526", "text": "function initBinding()\n {\n // watch binding for value changes to apply\n var handle = value.watch(function (v) { m_element[prop] = v; });\n m_watchHandles.push(handle);\n m_element[prop] = value.val;\n }", "title": "" }, { "docid": "18dab5a6d26beb29c41aac3ce279fd4c", "score": "0.5197866", "text": "function Window_Item() { this.initialize.apply(this, arguments); }", "title": "" }, { "docid": "6c1d8afcae97fb459e03ed95f611a5f4", "score": "0.5188959", "text": "function boundButtonClick() {\r\n var i;\r\n var num=0;\r\n var box = getElement(\"term-window\");\r\n\r\n do {\r\n var str = BoundVariableName(num);\r\n var match = false;\r\n\r\n for (i=0; i < box.children.length; i++) {\r\n var child = box.children[i];\r\n if (child.type == \"termBox\") {\r\n if (child.term.subtype == \"bound variable\") {\r\n if (child.term.argList[0].subtype == str) {\r\n match = true;\r\n }\r\n }\r\n }\r\n }\r\n num++;\r\n } while (match);\r\n\r\n addContext(termContext(new BoundVariable(str)));\r\n}", "title": "" }, { "docid": "a5c6e79e89aec3d5f5fe15b5ddb47d64", "score": "0.51832956", "text": "function myBind(func, obj) {\n return function() {\n return func.apply(obj, arguments); \n };\n}", "title": "" }, { "docid": "267f6c3c6322f3719b9da9103afd442c", "score": "0.5155269", "text": "function bind() {\n quux(foo.bar) // foo.bar is not executed directly, and it still logs 'global'\n quux(foo.bar.bind(foo)) // foo.bar is not executed directly, but we're binding whatever scope we would like to use \n quux(foo.bar.bind(fizz)) // foo.bar is not executed directly, but we're binding it to fizz\n quux(function () {\n console.log(this)\n }.bind(foo)) // this also binds the anonymous function to foo\n}", "title": "" }, { "docid": "3aa1a94746b0eab57a1c2b2c2eece782", "score": "0.5153167", "text": "function CGProcessLoadHelperDelegateViewer() {\n this.base = CGProcess;\n this.base(2);\n}", "title": "" }, { "docid": "8c3fe2d2bc28008db1b809ead0dce5ca", "score": "0.51525676", "text": "_bind() {\n this.bindings.PL_atom_chars = this.module.cwrap(\n 'PL_atom_chars', 'number', ['number']);\n this.bindings.PL_functor_arity = this.module.cwrap(\n 'PL_functor_arity', 'number', ['number']);\n this.bindings.PL_functor_name = this.module.cwrap(\n 'PL_functor_name', 'number', ['number']);\n this.bindings.PL_get_functor = this.module.cwrap(\n 'PL_get_functor', 'number', ['number', 'number']);\n this.bindings.PL_get_chars = this.module.cwrap(\n 'PL_get_chars', 'number', ['number', 'number', 'number']);\n this.bindings.PL_get_arg = this.module.cwrap(\n 'PL_get_arg', 'number', ['number', 'number', 'number']);\n this.bindings.PL_get_integer = this.module.cwrap(\n 'PL_get_integer', 'number', ['number', 'number']);\n this.bindings.PL_put_chars = this.module.cwrap(\n 'PL_put_chars', 'number', ['number', 'number', 'number', 'number']);\n this.bindings.PL_unify = this.module.cwrap(\n 'PL_unify', 'number', ['number', 'number']);\n this.bindings.PL_is_string = this.module.cwrap(\n 'PL_is_string', 'number', ['number']);\n this.bindings.PL_initialise = this.module.cwrap(\n 'PL_initialise', 'number', ['number', 'number']);\n this.bindings.PL_new_atom = this.module.cwrap(\n 'PL_new_atom', 'number', ['string']);\n this.bindings.PL_new_functor = this.module.cwrap(\n 'PL_new_functor', 'number', ['number', 'number']);\n this.bindings.PL_new_term_ref = this.module.cwrap(\n 'PL_new_term_ref', 'number', []);\n this.bindings.PL_put_functor = this.module.cwrap(\n 'PL_put_functor', 'number', ['number', 'number']);\n this.bindings.PL_chars_to_term = this.module.cwrap(\n 'PL_chars_to_term', 'number', ['string', 'number']);\n this.bindings.PL_call = this.module.cwrap(\n 'PL_call', 'number', ['number', 'number']);\n this.bindings.PL_unify_arg = this.module.cwrap(\n 'PL_unify_arg', 'number', ['number', 'number', 'number']);\n }", "title": "" }, { "docid": "9ed48a0a041fc31e36d58e3ea4400a6b", "score": "0.514663", "text": "rebind() {\r\n this.tabSwitchHandler = this.tabSwitchHandler.bind(this);\r\n this.windowSwitchHandler = this.windowSwitchHandler.bind(this);\r\n this.tabRemovalHandler = this.tabRemovalHandler.bind(this);\r\n this.tabsCreatedHandler = this.tabsCreatedHandler.bind(this);\r\n this.commandHandler = this.commandHandler.bind(this);\r\n this.targetHandler = this.targetHandler.bind(this);\r\n this.requestHandler = this.requestHandler.bind(this);\r\n // this.contentWindowIdListener = this.contentWindowIdListener.bind(this);\r\n }", "title": "" }, { "docid": "4b1373600755be999397c9871260682e", "score": "0.5144345", "text": "function Main(){\n var $routeObj = null; //LfRoute Object\n var $dataObj = null; //LfBind Object\n var $repeatObj = null; //LfRepeat Object\n var $dependency = null; //DependenctInjection object\n\n this.$isUserRoutesDefined = false;\n this.$scope = {}; //main object to hold all user defined data\n this.$routeParam = [];\n this.$rootElement = null;\n var that = this;\n\n this.$checkUserDefinedRoute = function(){ \n if(typeof RouteProvider === 'function') //RouteProvider is function that should be used by user to define Routes\n that.$isUserRoutesDefined = true;\n }\n\n this.$initializeDataBind = function(){\n $dataObj.$registerWatcher(); //register all lf-models and lf-binds.\n $dataObj.$observeObject(); //observe $scope object, so any change on this object trigger an event.\n $dataObj.$addListener(); //add 'keyup' event to all lf-models.\n $dataObj.$initializeFirstView(); //set value to lf-model initially, if $scope object has any.\n } \n\n this.$initializeRepeat = function(){\n $repeatObj.$initRepeat(); //get lf-repeat present on current view\n $repeatObj.$doRepeat(); //perform lf-repeat\n $repeatObj.$doDetail(); //perform lf-detail\n }\n\n\n this.$bootstrap = function(){\n that.$rootElement = document.querySelector('[lf-app]'); \n if(that.$rootElement === null){ \n return;\n }\n\n //instatiation of objects\n $dependency = new DependencyInjection(); //line no: 74\n $dataObj = new LfBind(); //line no: 119\n $repeatObj = new LfRepeat(); //line no: 307\n \n that.$checkUserDefinedRoute(); //verify whether user has defined routes or not\n if(that.$isUserRoutesDefined){\n $routeObj = new LfRoute(); \n $dependency.$registerDependency('$route' , $routeObj); //set LfRoute's object as dependency for $route as parameter \n $dependency.$processMethods(RouteProvider); //process and invoke RouteProvider function\n $routeObj.$doRoute(); //get current URL and render the proper view\n }\n\n setTimeout($dependency.$invokeUserControllers,5); //invoke only those controllers that are used in current view\n setTimeout(that.$initializeRepeat,10); //since $invokeUserControllers is asynchronous [Bad Practice using setTimeOut eventhough]\n setTimeout(that.$initializeDataBind,10);\n window.addEventListener('hashchange' , that.$updateSerivces , false); //update the view if url is changed\n }\n\n this.$updateSerivces = function(){ \n if($routeObj){ //update only if user has defined routes\n $routeObj.$doRoute();\n that.$scope = {}; //flush $scope when view is changed\n setTimeout($dependency.$invokeUserControllers,5); \n setTimeout(that.$initializeRepeat,10);\n setTimeout(that.$initializeDataBind,10);\n }\n }\n} //end of Main Class", "title": "" }, { "docid": "541aa954dfa9b2eaa7f1a17fcbdb8c11", "score": "0.51427156", "text": "function Window_Exp() {\r\n this.initialize.apply(this, arguments);\r\n}", "title": "" }, { "docid": "4c0f53975cae1999b051d8ddb918c68a", "score": "0.5139224", "text": "autoExport () {\n let self = this;\n Object.getOwnPropertyNames(Object.getPrototypeOf(self)).forEach(function (name) {\n if (/^_[^_]+/.test(name)) {\n self[name.replace(/^_/, '')] = self[name].bind(self);\n }\n });\n }", "title": "" }, { "docid": "3a08d9817a711b0e77e45047614a0ac3", "score": "0.51348674", "text": "function setupBinding(root, factory) {\n if (true) {\n // AMD. Register as an anonymous module.\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(2),__webpack_require__(48),__webpack_require__(370)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom, createReactClass) {\n if (!createReactClass) createReactClass = React.createClass;\n return factory(root, React, ReactDom, createReactClass);\n }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else if (typeof exports === 'object') {\n // Node. Note that this does not work with strict\n // CommonJS, but only CommonJS-like environments\n // that support module.exports\n module.exports = factory(root, require('react'), require('react-dom'), require('create-react-class'));\n } else {\n // Browser globals (root is window)\n var createReactClass = React.createClass ? React.createClass : window.createReactClass;\n root.onClickOutside = factory(root, React, ReactDOM, createReactClass);\n }\n }", "title": "" }, { "docid": "179794ed6b984850d67fa92ddc79227f", "score": "0.5134729", "text": "_bindEvent() {\n let me = this;\n\n window.addEventListener('message', function (event) {\n let loc = me._win.location;\n let domain = loc.protocol + '//' + loc.host;\n if (event.origin === domain\n && event.source && event.data\n && event.data.type === 'bind' + me._id\n && event.source === me._win\n ) {\n MIP.$set(event.data.m);\n }\n });\n }", "title": "" }, { "docid": "0a5159875602122d7de1431e4669a3a1", "score": "0.5134348", "text": "function setupBinding(root, factory) {\n if (true) {\n // AMD. Register as an anonymous module.\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(0),__webpack_require__(44),__webpack_require__(114)], __WEBPACK_AMD_DEFINE_RESULT__ = function(React, ReactDom, createReactClass) {\n if (!createReactClass) createReactClass = React.createClass;\n return factory(root, React, ReactDom, createReactClass);\n }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else if (typeof exports === 'object') {\n // Node. Note that this does not work with strict\n // CommonJS, but only CommonJS-like environments\n // that support module.exports\n module.exports = factory(root, require('react'), require('react-dom'), require('create-react-class'));\n } else {\n // Browser globals (root is window)\n var createReactClass = React.createClass ? React.createClass : window.createReactClass;\n root.onClickOutside = factory(root, React, ReactDOM, createReactClass);\n }\n }", "title": "" }, { "docid": "b382bcb8460c688a6cb889041fa5e02d", "score": "0.51250994", "text": "function set_global(name, value){\n window[name] = value;\n \n if (typeof unsafeWindow !== 'undefined'){\n unsafeWindow[name] = value;\n }\n }", "title": "" }, { "docid": "678f54ed8ce674e48b8a8a54b9719bfb", "score": "0.51149446", "text": "function _main() {\n window.tools = window.tools || {};\n window.tools.logWarn = _logWarn;\n window.tools.logError = _logError;\n }", "title": "" }, { "docid": "c8df21ebe70637772d89bafb03816a04", "score": "0.51142436", "text": "function InitObjectProperty_L1(){\n}", "title": "" }, { "docid": "aefce60993c188435234f4a06c64acf8", "score": "0.5111136", "text": "connectedCallback() {\n setTimeout(() => {\n super.connectedCallback();\n }, 0);\n\n this._initBinder();\n }", "title": "" }, { "docid": "1320551ba6993d863676c02f3ae439fc", "score": "0.5109392", "text": "function initGlobalComponents() {\n\n\t}", "title": "" }, { "docid": "7f892df7cebf4964f2b5988c12912d4a", "score": "0.5104214", "text": "function InitObjectProperty_Framework_L0(){\n// ggbApplet.setVisible(\"textSettingA0\", true);\n// ggbApplet.setVisible(\"g\", true);\n}", "title": "" }, { "docid": "e08fec250649472630dd3fcb360492df", "score": "0.510383", "text": "static isWindow(object){return![undefined,null].includes(object)&&typeof object==='object'&&'window'in object&&object===object.window}", "title": "" }, { "docid": "8c216f9eaa94162683b5756c4fc3dc74", "score": "0.50985205", "text": "function init() {\n\tko.applyBindings(new viewModel());\n}", "title": "" }, { "docid": "b8d6aec08b007356a407e36fbdeffa6b", "score": "0.50973696", "text": "function LfBind(){\n var $watchModels = []; //models to watch for\n var $watchBinds = []; //binds to watch for\n var that = this;\n\n this.$registerWatcher = function(){ \n $watchModels = $main.$rootElement.querySelectorAll('[lf-model]'); \n $watchBinds = $main.$rootElement.querySelectorAll('[lf-bind]');\n }\n\n this.$observeObject = function(){\n //observe changes in $scope object, if any change is detected it updates respective models and bind\n Object.observe($main.$scope, function(changes){\n changes.forEach(function(change) {\n that.$updateView(change.name);\n });\n });\n }\n\n this.$addListener = function(){ \n var index = null;\n var key = null;\n var value = null;\n for(var i = 0, len = $watchModels.length; i < len; i++){\n $watchModels[i].count = i;\n $watchModels[i].addEventListener('keyup' , function(evt)\n { \n index = evt.target.count;\n key = $watchModels[index].getAttribute('lf-model');\n value = $watchModels[index].value;\n $main.$scope[key] = value;\n });\n }\n }\n \n //updates the model and binds with data if initially present in scope object\n this.$initializeFirstView = function(){ \n var $elementName = null;\n for(var i = 0, len = $watchModels.length; i < len; i++){\n $elementName = $watchModels[i].getAttribute('lf-model'); \n if($main.$scope.hasOwnProperty($elementName)){\n $watchModels[i].value = $main.$scope[$elementName];\n $watchModels[i].innerHTML = $main.$scope[$elementName];\n }\n }\n for(var i = 0, len = $watchBinds.length; i < len; i++){\n $elementName = $watchBinds[i].getAttribute('lf-bind'); \n if($main.$scope.hasOwnProperty($elementName)){\n $watchBinds[i].value = $main.$scope[$elementName];\n $watchBinds[i].innerHTML = $main.$scope[$elementName];\n }\n }\n } \n\n //search and update all bind and models of changed variable\n this.$updateView = function($changedElementName){\n for(var j = 0, len = $watchModels.length; j < len; j++){\n if($changedElementName === $watchModels[j].getAttribute('lf-model')){\n $watchModels[j].value = $main.$scope[$changedElementName];\n $watchModels[j].innerHTML = $main.$scope[$changedElementName];\n }\n } \n for(var j = 0, len = $watchBinds.length; j < len; j++){\n if($changedElementName === $watchBinds[j].getAttribute('lf-bind')){\n $watchBinds[j].value = $main.$scope[$changedElementName];\n $watchBinds[j].innerHTML = $main.$scope[$changedElementName];\n }\n } \n }\n} //end of LfBind", "title": "" }, { "docid": "0bcbc69f4f47d55fa87b42b52d80d7b1", "score": "0.50942504", "text": "'constructor'() {\n this._bound_events = {};\n }", "title": "" }, { "docid": "4a0e2f94455c83e8331f257e3f6bb49c", "score": "0.509094", "text": "function IsGlobal(obj) {\n\treturn !IsStrongDefined(obj) || obj === window;\n}", "title": "" }, { "docid": "262f06e26b9cdb8d320ccde9f9c824d7", "score": "0.5087051", "text": "constructor() {\r\n this.onmsg = this.onmsg.bind(this);\r\n this.addBind = this.addBind.bind(this);\r\n this.listBinds = this.listBinds.bind(this);\r\n this.removeBind = this.removeBind.bind(this);\r\n this.checkLoop = this.checkLoop.bind(this);\r\n this.onStartup = this.onStartup.bind(this);\r\n this.onShutdown = this.onShutdown.bind(this);\r\n this.binds = new Object(); // initalize a holder of the commands\r\n }", "title": "" }, { "docid": "4e8d7476a60e5d8531e9ff772d3c31d5", "score": "0.50841576", "text": "function Window_EquipStatus() {\n this.initialize(...arguments);\n}", "title": "" }, { "docid": "e83d9947bb4db550144c0b815a97b5cd", "score": "0.50833666", "text": "function IlAuthentication_app(){\n\n//var pessoa = new Pessoa(\"Usuário\",\"Fulano\");\n//\tconsole.log(pessoa);\n\nvar myObj = { \"name\":\"John\", \"age\":31, \"city\":\"New York\" };\nvar app = new AppViewModel(myObj);\n\nconsole.log(app);\n\n}", "title": "" }, { "docid": "f3c9d764c7690edce6fec5f281273644", "score": "0.5077165", "text": "handleSub() {\n console.log(\"Hi I need to be bound\");\n }", "title": "" }, { "docid": "56009f3b656aa86dbd349f35b464be2e", "score": "0.50737506", "text": "function __model_binding(infos){\n \n if (infos == null) return;\n \n this.deep = infos.deep || true; //binde les proprietes de l'objet??\n \n __prop_binding.call(this, infos);\n this.presenter = infos.presenter;\t//le code html pour l'affichage des donn�es de l'objet\n this.merge = infos.merge;\t\t//@deprecated compliqué a expliquer pour une utilisation tres reduite (voir exemple SVG)\n this.empty = infos.empty;\n\n this._empty = false;\n \n this._child_binding = []; //les bindings générées par ce model\n this._generated_keys = [];//les clés de ce binding!\n this._ftw2_type = null;//le type de données actuellement affichée\n \n \n \n //les data-types, met les en cache, de toute facon, il faudra les recuperer...\n //MAIS: recupere tous les types en place du type necessaire uniquement\n //a voir....\n \n \n //probleme, chq model_binding correspond a un MODEL[id ou id_type]\n \n //a passer dans AppInit!!!! ====> TODO\n /*model = document.getElementById(this.presenter);\n if (model){\n \n this._root_model = model;\n this._cache_types = {};\n \n //recupere les datas types si existent\n var children = model.children;\n if (children == null){\n children = [];\n var childs = model.childNodes;\n var end = childs.length;\n for (i= 0; i< end; i++){\n if (childs[i].nodeType != 8 && (childs[i].nodeType != 3 || /\\S/.test(childs[i].nodeValue))){\n children.push( childs[i] );\n break;\n }\n }\n }\n var count = children.length;\n while (count--){\n var elem = children[count];\n var type=\"defaut\";\n \n if (elem.hasAttribute(\"data-type\")){\n type = elem.getAttribute(\"data-type\");\n } \n //enregistre\n this._cache_types[type] = elem;\n }\n if (this.fallback) this._cache_types['fallback'] = document.getElementById(this.fallback);\n if (this.empty) this._cache_types['empty'] = document.getElementById(this.empty);\n }*/\n \n \n}", "title": "" }, { "docid": "c4dc3e04115bedde2be06219e9a5274f", "score": "0.507191", "text": "run () {\n\t\tthis.app = new APP()\n\t}", "title": "" }, { "docid": "5bc301d30cde5ee3398ab29f948b3ba0", "score": "0.5060885", "text": "function nlobjContext() {\n}", "title": "" }, { "docid": "617f72d523a93c671b24a410cd208890", "score": "0.5058287", "text": "static initialize(obj, environment) { \n obj['environment'] = environment;\n }", "title": "" }, { "docid": "bc5a60832f988c8ed3dcd3359b307879", "score": "0.50564265", "text": "function ObjectProxy() {}", "title": "" }, { "docid": "9bca534874c97d56a89d46e363dffdb8", "score": "0.50523055", "text": "function Window_EventItem() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "d4a92d3a7bf1fc64593ebebfb6648641", "score": "0.50490093", "text": "function genBindDoc(useBody) {\n return function(evtName, callback, customTarget) {\n var target = customTarget ? customTarget : (useBody ? document.body : document);\n\n target.addEventListener(evtName, callback, false);\n };\n} // bindDoc", "title": "" }, { "docid": "da29a9d6a48e9a05a612d2cb6bb8903a", "score": "0.50460213", "text": "activate() {\n this.bindings = new Map();\n this.idleCallbacks = new Set();\n let depsCallbackID;\n const installMinimapLinterDeps = () => {\n this.idleCallbacks.delete(depsCallbackID);\n if (!atom.inSpecMode()) {\n require('atom-package-deps').install('minimap-linter');\n }\n };\n depsCallbackID = window.requestIdleCallback(installMinimapLinterDeps);\n this.idleCallbacks.add(depsCallbackID);\n\n this.subscriptions = new CompositeDisposable();\n this.messageCache = new Set();\n }", "title": "" }, { "docid": "13507cb2e77bb90616e431e7f3a9e897", "score": "0.5043767", "text": "function Window_Gold() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "5ee4deb5003faf428bed3a9edb5068ed", "score": "0.50359905", "text": "function bindWindow() {\n // We'll always bind resize since mobile is cool about it\n WINDOW_BINDINGS.push(WindowController.on('resize', onWindowResize, this));\n\n // If we're not mobile or IE, bind the scroll event\n if (!isMobile && !$('html').hasClass('ie')) {\n $scrollList = $('[data-kiu*=\"scroll-in-view\"]').not('[data-kiu-scroll]');\n WINDOW_BINDINGS.push(WindowController.on('scroll', onWindowScroll, this));\n } else {\n // Else just show what we need to and get on with our lives\n var $v, winTop = $window.scrollTop() + $window.height(), hasIe = $('html').hasClass('ie');\n\n // scroll-in-view items\n $('[data-kiu*=\"scroll-in-view\"]').each(function (i, v) {\n $v = $(v);\n if ($v.offset().top <= winTop && !hasIe) {\n Walt.animate({\n 'el': $v.attr('data-kiu', null).css('visibility', 'visible').attr('data-kiu-scroll', 'in-view'),\n 'animation': 'fadeIn' + ($v.attr('data-scroll-direction') || 'Up'),\n 'delay': ((i + 1) * 0.1) + 's',\n 'duration': '0.5s'\n });\n } else {\n $v.attr('data-kiu', null).css('visibility', 'visible').attr('data-kiu-scroll', 'in-view');\n }\n });\n\n // preloaded items\n $('[data-kiu-wait]').each(function (i, v) {\n $v = $(v);\n $v.attr('data-kiu-scroll', 'in-view').attr('data-kiu-wait', null).attr('style', $v.attr('data-style')).css('visibility', 'visible');\n });\n\n // image switch stuff\n var dataMobile, dataTablet, dataDesktop;\n $switchList.each(function (i, v) {\n $v = $(v);\n dataMobile = $v.attr('data-mobile-image') || false;\n dataTablet = $v.attr('data-tablet-image') || false;\n dataDesktop = $v.attr('data-desktop-image') || false;\n $v.css('background-image', 'url(\"' + (dataMobile ? dataMobile : (dataTablet ? dataTablet : dataDesktop)) + '\")'); //.attr('data-kiu-mode', 'mobile');\n });\n\n // proportions\n keepProportions($window.width());\n }\n }", "title": "" }, { "docid": "bbb4ab484037eaf653c606f0d3812226", "score": "0.50357294", "text": "function Window_Status() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "bbb4ab484037eaf653c606f0d3812226", "score": "0.50357294", "text": "function Window_Status() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "638ce9d7745e9efade7b96021122ad53", "score": "0.5022372", "text": "_injectGlobal(Konva) {\n exports.glob.Konva = Konva;\n }", "title": "" }, { "docid": "a71b6b5b18371a8d32db43f8bd1589a4", "score": "0.5022341", "text": "constructor() {\n this[_window] = null;\n }", "title": "" } ]
21144e3b3cba2f16c6a017f273341fb2
Helper to check if a field meets a certain length var field: var len: length return: Boolean
[ { "docid": "273aca5a216b5ed3a7be85dcda4a1b8d", "score": "0.9126623", "text": "function meetsLength( field, len ) {\r\n\treturn field.length >= len;\r\n}", "title": "" } ]
[ { "docid": "586e0cf1783f12d6bc9b67aa5a263813", "score": "0.7868164", "text": "function check_length(field, min_length, max_length)\n{\n if (field == null || field.value.length < min_length || field.value.length > max_length) {\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "5d6b1bae270566cac42ad67b67349a39", "score": "0.78376865", "text": "function checkLength(value, len) {\n if (value.trim().length >= len) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "3895b29b076de786db516af13dc06970", "score": "0.78213197", "text": "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "3895b29b076de786db516af13dc06970", "score": "0.78213197", "text": "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "3895b29b076de786db516af13dc06970", "score": "0.78213197", "text": "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "3895b29b076de786db516af13dc06970", "score": "0.78213197", "text": "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "3895b29b076de786db516af13dc06970", "score": "0.78213197", "text": "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "13f7dabca999883576d21ee786f66b0f", "score": "0.7814073", "text": "function checkLength(value, len) { \n if (value.trim().length > len) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "13f7dabca999883576d21ee786f66b0f", "score": "0.7814073", "text": "function checkLength(value, len) { \n if (value.trim().length > len) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "0e3360bb51b214ed004b04c82ff2261b", "score": "0.7812119", "text": "function isValidLength(strField,nLength)\n\t{\n\t\tvar bRetVal;\n\t\tbRetVal=true;\n\t\tstrText = new String(strField);\n\t\tif (strText.length<nLength)\n\t\t{\n\t\t\t bRetVal=false;\n\t\t}\n\t\treturn bRetVal;\n\t}", "title": "" }, { "docid": "f7f790f1fa7a19794a588243360edddd", "score": "0.7709874", "text": "function checkLen(len,fldId,message) \n{\n\tvar objValue = document.getElementById(fldId).value;\n\tvar length = objValue.length\n\tif(length < len)\n\t\tretunMessage(message,fldId);\n\telse\n\t\treturn true;\n}", "title": "" }, { "docid": "fb37cb4789695e8a47d52288a639b80a", "score": "0.7629029", "text": "static CheckStringLength(strField, minlength, maxLength) {\r\n const lengthDf = strField.length;\r\n let bResult = false;\r\n if (lengthDf >= minlength && lengthDf <= maxLength) {\r\n bResult = true;\r\n }\r\n return bResult;\r\n }", "title": "" }, { "docid": "dd14c0e337b477d55fc391f9d029e758", "score": "0.75997525", "text": "function exactLength(field, length) {\r\n if (field.value.length === length) {\r\n setValid(field);\r\n return true;\r\n } else {\r\n setInvalid(\r\n field,\r\n `${field.name} must be exactly ${length} characters long`\r\n );\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "47e3b7cd9c5ffe9ab2ceb9524b657ae0", "score": "0.72872686", "text": "function hasLength (data, length) {\n\t return assigned(data) && data.length === length;\n\t }", "title": "" }, { "docid": "0fe85d24ae87b2cd283b9e5946def3c2", "score": "0.72370386", "text": "function meetLength(field, minLength, maxLength) {\r\n if (field.value.length >= minLength && field.value.length < maxLength) {\r\n setValid(field);\r\n return true;\r\n } else if (field.value.length < minLength) {\r\n setInvalid(\r\n field,\r\n `${field.name} debe tener al menos ${minLength} caracteres`\r\n );\r\n return false;\r\n } else {\r\n setInvalid(\r\n field,\r\n `${field.name} debe tener menos de ${maxLength} caracteres`\r\n );\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "01fd4cc3ed53867bfe05f08e1e98b4b5", "score": "0.7217958", "text": "static reqtl(val,vlength){\n return val.length === vlength;\n }", "title": "" }, { "docid": "1125f49a2ba44af1259d198487029ab7", "score": "0.7203824", "text": "function checkLength (input) {\n if (input.length >= 8){\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "c5ce05df9e89f216b6fa77e4d58d0366", "score": "0.7123912", "text": "validateEntryString(field) {\n return field.length >= 3 ? true : false\n }", "title": "" }, { "docid": "46ad294f9b00d6779d8733debd71d5ca", "score": "0.69558215", "text": "function checkLength(field, valueGiven){\n\n\tif(valueGiven.length===0){\n\t\terrorMessage=errorMessage+\"The field \"+field+ \" is blank. \";\n\t\treturn false;\n\t}\n\telse{\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "205f3ba1f7a75f5ed3bcd6b06d3c5233", "score": "0.69329315", "text": "function isLength(num, length) {\n return num.toString().length === numDigits\n}", "title": "" }, { "docid": "ce4a752d5365e0789c5ca7b010dd224b", "score": "0.69172525", "text": "function checkLength(input, minLen) {\n console.log(input);\n if (input.value.trim().length >= minLen) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "4b7f3c4b98536d8e1ae513deed337cbe", "score": "0.6907008", "text": "function _checkLength(formElement, length, event)\n{\n elementLength = formElement.value.length;\n if (elementLength > length)\n {\n // Input is longer than max, truncate and return false.\n // This takes care of the case where the user has pasted in text\n // that's too long. Return true here because the onChange event can\n // continue (now that we've truncated the value). This allows chained\n // handlers to work.\n formElement.value = formElement.value.substr(0, length);\n return true;\n }\n\n // If less than max length (i.e. within acceptable range), return true\n if (elementLength < length)\n return true;\n\n // If we've made it to here, we know that elementLength == length\n\n if (_agent.isIE)\n {\n // in many forms there is a hidden field named \"event\"\n // Sometimes IE gets confused and sends us that instead of\n // the true event, so...\n if (event[\"type\"] == \"hidden\")\n event = window.event;\n }\n\n // If this is a change event, the field has already been updated to a string\n // of the maximum allowable length. This is fine. Continue processing.\n if (event.type == 'change')\n return true;\n\n // If we've made it to here, we know that this is a keyPress event\n\n // If the input is something less than a space (e.g. tab, CR, etc.)\n // return true.\n // If key was CTRL-v, which will be used to paste some new text,\n // pass it along.\n if (event)\n {\n if ((event.which < 32)\n || ((event.which == 118) && (event[\"ctrlKey\"])))\n return true;\n }\n\n // Default return FALSE. If we're here, this is an onKeyPress event, it's a\n // printable character, and elementLength already equals the maximum allowed.\n // We need to return false here to cancel the event otherwise this last\n // character will end up in the input field in position MAX+1.\n return false;\n}", "title": "" }, { "docid": "48f6015daf05240d8222b9f1a6fc1f92", "score": "0.69007945", "text": "function required(val) { return val && val.length; }", "title": "" }, { "docid": "1bbdd752d559a010698cdc2e2c8de441", "score": "0.68881357", "text": "function isLongerThanThreeCharacters(val){\n return val.length > 3;\n}", "title": "" }, { "docid": "91c8dd2de2ad1e8f394820b09b796f06", "score": "0.67684335", "text": "function isLongerThanThreeCharacters(val) {\n return val.length > 3;\n}", "title": "" }, { "docid": "951481d9404cae6b2ea51c4ddf05d3c4", "score": "0.6751992", "text": "function checkLengthOne(elmName,length,msg,allowNull){\n\t\t\t\tvar elm = document.getElementById(elmName);\n\t\t\t var value = elm.value;\n\t\t\t var oldLength=value.length;\n\t\t\t var byteLength=oldLength\n\t\t\t for (var i=0;i<oldLength;i++)\n\t\t\t {\n\t\t\t if (value.charCodeAt(i)<0||value.charCodeAt(i)>255) byteLength++\n\t\t\t }\n\t\t\t if(allowNull){\n\t\t\t \tif(byteLength>length){\n\t\t\t\t \talert(msg);\n\t\t\t\t\t\tshowError(elm);\n\t\t\t\t return false;\n\t\t\t\t }\n\t\t\t }else{\n\t\t\t\t if(byteLength<=0||byteLength>length){\n\t\t\t\t \talert(msg);\n\t\t\t\t\t\tshowError(elm);\n\t\t\t\t return false;\n\t\t\t\t }\n\t\t\t }\n\t\t\t return true;\n\t\t\t}", "title": "" }, { "docid": "0e688e56d64eac8d7070728ac205d1e3", "score": "0.67439944", "text": "function length( id, up_length, lo_length, message, display )\r\n{\r\n\telementId = document.getElementById( id );\r\n\telementVal = elementId.value;\r\n\tif( elementVal.length <= up_length && elementVal.length >= lo_length )\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tdisplayMessage( message, id, display );\r\n\t\treturn false;\r\n\t}\r\n\r\n}", "title": "" }, { "docid": "70186d7dccfd9548a896b5c218fe8e01", "score": "0.6740263", "text": "function validateLength(field, length) {\n\t/*\n\t * Haal het element op waarin het resultaat van de evaluatie komt te staan. Dit gaat ervan uit dat \n\t * het ID van dat element gelijk is aan het ID van het formulierveld (input, textarea, etc.) waarachter\n\t * de tekst 'ValResult' is gezet. \n\t * \n\t * Een input met ID #test gebruikt dus een element met ID #testValResult om het resultaat weer te geven.\n\t */\n\tvar fieldID = field.attr('id');\n\tvar fieldInfo = $(\"#\" + fieldID + 'ValResult');\n\t\n\t// Alle opmaak weghalen\n\tfield.removeAttr('class');\n\tfieldInfo.removeAttr('class');\n\t\n\t// Check of lengte kleiner is dan opgegeven lengte\n\tvar tooSmall = field.val().length < length;\n\tif(tooSmall) {\n\t\tfield.addClass(\"error\");\n\t\tfieldInfo.text(\"Geen/te korte invoer (minimaal \" + length + \" tekens)\");\n\t\tfieldInfo.addClass(\"error\");\n\t\treturn false;\n } else {\n\t\tfield.addClass(\"success\");\n\t\tfieldInfo.text(\"Correct\");\n\t\tfieldInfo.addClass(\"success\");\n\t\treturn true;\n }\n}", "title": "" }, { "docid": "bd77b2d9425d106cf02e1e3ed03ebcde", "score": "0.673732", "text": "static rlteql(val,vlength){\n return val.length <= vlength;\n }", "title": "" }, { "docid": "666892a9200c3419a0d92210f900e6eb", "score": "0.67298394", "text": "checkFieldLength(field,min,max){\n if(field.value.length < min){\n this.showError(field,`${this.changeFirstLetter(field.id)} must be at least ${min} characters`);\n }else if(field.value.length > max){\n this.showError(field,`${this.changeFirstLetter(field.id)} must be less than ${max} characters`);\n }else{\n this.showSuccess(field);\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "af9b173885c7f7c5d71cb5be391bc2e5", "score": "0.6723994", "text": "static minLength(str, length) {\n let isInvalid = false;\n\n if (str.length < length) {\n isInvalid = true;\n }\n\n return isInvalid;\n }", "title": "" }, { "docid": "de0835f410e4ac599fa1a00eb4bd9ea2", "score": "0.67223626", "text": "static reql(val,vlength){\n return val.length == vlength;\n }", "title": "" }, { "docid": "3a19220d38b24d9be5edb2976b68ebbe", "score": "0.670624", "text": "function validateLengths(object) {\n\t_.forEach(object, function(field) {\n\t\tif(field.value.toString().length > field.width) {\n\t\t\tthrow new nACHError( {\n\t\t\t\t\t \tname: 'Invalid Length',\n\t\t\t\t\t \tmessage: field.name+'\\'s length is '+field.value.length+', but it should be no greater than '+field.width+'.'\n\t\t\t\t\t\t});\n\t\t}\n\t});\n\n\treturn true;\n}", "title": "" }, { "docid": "f2b6ab87e35326455bc08de40ecdb825", "score": "0.6704324", "text": "function checkLengthMore(elmName,length,msg,allowNull){\n\t\t\t\tvar elms = document.getElementsByName(elmName);\n\t\t\t\tvar elm;\n\t\t\t\tvar elmValue;\n\t\t\t\tvar oldLength;\n\t\t\t\tvar byteLength;\n\t\t\t\tif(elms!=null&&elms.length>0){\n\t\t\t\t\tfor(var i=0;i<elms.length;i++){\n\t\t\t\t\t\telmValue=\"\";\n\t\t\t\t\t\toldLength=0;\n\t\t\t\t\t\tbyteLength=0;\n\t\t\t\t\t\telm = elms[i];\n\t\t\t\t\t\tif(elm.disabled!=true){\n\t\t\t\t\t\t\telmValue = elm.value;\n\t\t\t\t\t\t\toldLength = elmValue.length;\n\t\t\t\t\t\t\tbyteLength=oldLength\n\t\t\t\t\t\t for (var j=0;j<oldLength;j++)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t if (elmValue.charCodeAt(j)<0||elmValue.charCodeAt(j)>255) byteLength++\n\t\t\t\t\t\t }\n\t\t\t\t\t\t if(allowNull){\n\t\t\t\t\t\t \tif(byteLength>length){\n\t\t\t\t\t\t\t \talert(msg);\n\t\t\t\t\t\t\t\t\tshowError(elm);\n\t\t\t\t\t\t\t return false;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t if(byteLength<=0||byteLength>length){\n\t\t\t\t\t\t\t \talert(msg);\n\t\t\t\t\t\t\t\t\tshowError(elm);\n\t\t\t\t\t\t\t return false;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "title": "" }, { "docid": "69fa72654a61f2223e107ab61d01f384", "score": "0.66991866", "text": "static rgteql(val,vlength){\n return val.length >= vlength;\n }", "title": "" }, { "docid": "c30b3594cce3862646a64887e9b0a5b3", "score": "0.66934574", "text": "function checkNameEntryLength(name) {\n check = false;\n if(name.length > 3) {\n check = true;\n }\n return check;\n}", "title": "" }, { "docid": "9d28a67eaf019d7e30d328e19b116186", "score": "0.66767895", "text": "function IsLength(pstrValue, intLength){\n\treturn pstrValue.length == intLength;\n}", "title": "" }, { "docid": "ea7aaa752e719f7d45b88bb37d13133e", "score": "0.6675187", "text": "function validator(v){\n\treturn v.length > 10;\n}", "title": "" }, { "docid": "e3d2878601296c25c283d66422ebd537", "score": "0.66709393", "text": "function validate_string_length(string_name, how_long){\n if(string_name.length == how_long){\n return(true);\n }\n else{\n return(false);\n }\n }", "title": "" }, { "docid": "a0c7cd436a4b53ee674f2647afd18169", "score": "0.66649127", "text": "function checkLength(o) {\n if (o.val().length == 0) {\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "abbdf6a812c59c67e5a3424caf9ef945", "score": "0.6639618", "text": "function isMaxLength(fieldName, maxLength = 255) {\n if (fieldName.length > maxLength) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "bf893d7d9edfdf34ac232e874dcaa10c", "score": "0.6627051", "text": "function validTextLength(value) {\n\treturn value.length < 300;\n}", "title": "" }, { "docid": "d7e91edec5d68e82d7090c5980724172", "score": "0.6616756", "text": "function isMinLength(fieldName, minLength = 0) {\n if (fieldName.length < minLength) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "73cafb4be33a509a68d59167887e320d", "score": "0.6614019", "text": "function inputLengthAllowed(){\n\t// dont allow digit length to be greater than 8\n\tif(currentValueString.length<=8){return true}\n\telse return false;\t\n}", "title": "" }, { "docid": "ae2e07dc63e9285195e8ce06bd9770f8", "score": "0.6599624", "text": "function stringsWithLength(thing) {\n if (typeof thing === 'string') {\n return !!thing.length\n } else {\n return true\n }\n}", "title": "" }, { "docid": "3544dcf1b98c76db6a0a4089d92ebd92", "score": "0.65977454", "text": "function checkLengthof(element,text,min,max,elmError) \n{\n\tif (checkBlank(element,text,elmError)) \n\t{ //check for blank\n\t\tvar tips = 0;\n\t\tvar length = element.val().length;\n\t\t\n\t\tif ((min != 0 && max != 0) && ( length > max || length < min ) )\n\t\t\t//tips = \"* Length of \" + text + \" must be between \"+min+\" to \"+max+\".\";\n\t\t\ttips = \"* Password must be greater than 6 character\";\n\t\telse if((min !=0 && max == 0) && (length < min))\n\t\t\t//tips = \"* Length of \" + text + \" must be minimum \"+min+\" letters.\";\n\t\t\ttips = \"* Password must be greater than 6 character\";\n\t\telse if((min == 0 && max != 0) && (length > max))\n\t\t\t//tips = \"* Length of \" + text + \" must be maximum \"+max+\" letters.\"\n\t\t\ttips = \"* Password must be greater than 6 character\";\n\t\t\n\t\tif (tips != 0) {\n\t\t\telement.addClass('ui-state-error');\n\t\t\tupdateTips(tips,elmError,element);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($(field_focus).attr('id') == $(element).attr('id'))\n\t\t\t\tfield_focus = '';\n\t\t\treturn true;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3544dcf1b98c76db6a0a4089d92ebd92", "score": "0.65977454", "text": "function checkLengthof(element,text,min,max,elmError) \n{\n\tif (checkBlank(element,text,elmError)) \n\t{ //check for blank\n\t\tvar tips = 0;\n\t\tvar length = element.val().length;\n\t\t\n\t\tif ((min != 0 && max != 0) && ( length > max || length < min ) )\n\t\t\t//tips = \"* Length of \" + text + \" must be between \"+min+\" to \"+max+\".\";\n\t\t\ttips = \"* Password must be greater than 6 character\";\n\t\telse if((min !=0 && max == 0) && (length < min))\n\t\t\t//tips = \"* Length of \" + text + \" must be minimum \"+min+\" letters.\";\n\t\t\ttips = \"* Password must be greater than 6 character\";\n\t\telse if((min == 0 && max != 0) && (length > max))\n\t\t\t//tips = \"* Length of \" + text + \" must be maximum \"+max+\" letters.\"\n\t\t\ttips = \"* Password must be greater than 6 character\";\n\t\t\n\t\tif (tips != 0) {\n\t\t\telement.addClass('ui-state-error');\n\t\t\tupdateTips(tips,elmError,element);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($(field_focus).attr('id') == $(element).attr('id'))\n\t\t\t\tfield_focus = '';\n\t\t\treturn true;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6cd7c87e135a1097a589a4e6209aa040", "score": "0.65693873", "text": "function isCorrectLength(str) {\n return isLongEnough( str ) && isShortEnough( str )\n}", "title": "" }, { "docid": "524cac90ce489728a0658a5cd07a2c95", "score": "0.65341914", "text": "function lengthChecker() {\n var valid = false;\n var length = document.getElementById('passwordLengthInput').value;\n if (length >= 8 && length <= 128) {\n valid = true;\n }\n return valid;\n}", "title": "" }, { "docid": "60dac38670684630e0af6d33c0a116d3", "score": "0.6528828", "text": "function check_length(inputname,inputlength,msg)\n{\n var inputobj;\n\n if(inputname.indexOf(\"|\")==-1)\n {\n inputobj=eval(CONST_STRDOC+inputname);\n\n if((inputobj.value.length!=0) && (inputobj.value.length!=inputlength))\n {\n alert(msg + LENGTH_EQUAL_MSG + inputlength + COMMA_MSG + ENTER_MSG + MODIFY_MSG);\n return false;\n }\n\n return true;\n }\n \n var split_inputname=inputname.split(\".\");\n var split_inputs=split_inputname[1].split(\"|\");\n var split_inputlength=inputlength.split(\"|\");\n var split_msg=msg.split(\"|\");\n var errmsg=\"\";\n \n for (var i=0;i<split_inputs.length;i++)\n {\n inputobj=eval(CONST_STRDOC+split_inputname[0]+\".\"+split_inputs[i]);\n \n if((inputobj.value.length!=0) && (inputobj.value.length!=split_inputlength[i]))\n\t\t\terrmsg=errmsg+split_msg[i] + LENGTH_EQUAL_MSG + split_inputlength[i] + COMMA_MSG + ENTER_MSG;\n }\n \n if(errmsg.length!=0)\n {\n alert(errmsg + MODIFY_MSG);\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "689fc552571d3f299d36c18000a2791c", "score": "0.6526937", "text": "function checkName(name) {\n return (name.length > 0) && (name.length<=40);\n}", "title": "" }, { "docid": "851d31c00878b72da12a27e1182000a9", "score": "0.65233535", "text": "function charLength(input){\n if(input.length >= 8){\n return true;\n }\n}", "title": "" }, { "docid": "10092c328bd889e28f18fd52d4cf3b48", "score": "0.6508932", "text": "hasLength(length) {\r\n assertNumbers(length);\r\n return eq(length, this.length());\r\n }", "title": "" }, { "docid": "10092c328bd889e28f18fd52d4cf3b48", "score": "0.6508932", "text": "hasLength(length) {\r\n assertNumbers(length);\r\n return eq(length, this.length());\r\n }", "title": "" }, { "docid": "eb8467728aa1b16afb7b3e7298a03771", "score": "0.6507324", "text": "function checkInputLengthMessage(value) {\n // trim the value\n var trimmedValue = value.trim();\n // if the value's length is equal or greater than 10 characters, return true\n if (trimmedValue.length >= 10) {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "cb8ba3f9b74dc8bcbe02b34ea039f196", "score": "0.65065944", "text": "function lengthPass(pass) {\n if(pass >= 6) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "689629d2e4c5b0f4c6b1c6aaf08f9d66", "score": "0.64742076", "text": "function checkLength(input,minL,maxL) {\n if( input.value.length < minL){\n showError(input,`${getFieldId(input)} should be atleast ${minL} characters`);\n\n }else if (input.value.length > maxL){\n showError(input,`${getFieldId(input)} should be less than ${maxL} characters`);\n }else {\n showSuccess(input);\n }\n\n}", "title": "" }, { "docid": "347fd369924f3a570ffe8f17091e4afa", "score": "0.6473176", "text": "function check_content_length(elem_id, max_len)\n{\n var elem = document.getElementById(elem_id);\n if(elem.value.length > max_len) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "6314b3752a34e47aad0622dd1729b392", "score": "0.6453535", "text": "function CheckLength(objField,intLength,strMaxMin,strAlertval)\n{\n\tvar str=objField.value\n\tif(strMaxMin=='Minimum')\n\t{\n\t\tif (str.length<intLength)\n\t\t{\n\t\t\talert(\"Minimum \" + intLength + \" \" + strAlertval);\n\t\t\tobjField.focus();\n\t\t\treturn true;\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (str.length>intLength)\n\t\t{\n\t\t\talert(\"Maximum \" + intLength + \" \" + strAlertval);\n\t\t\tobjField.focus();\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n }", "title": "" }, { "docid": "b55d5a99ec34d619b82117a5c78e1039", "score": "0.6441537", "text": "function letters_length(our_str) {\r\n var len = our_str.length;\r\n if (len >= 6) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "385cee26d602090492008353754e109c", "score": "0.6439628", "text": "function myAlphabetLengthIf(max) {\n if (myAlphabet.length<4)\n console.log(true);\n else {\n console.log(false);\n }\n}", "title": "" }, { "docid": "33b3c656a36f8c595ffe0828fb4e879b", "score": "0.64306206", "text": "function stringEight(input){\n return typeof input == 'string' && input.length === 8;\n}", "title": "" }, { "docid": "5952a78c73a1af3124d8497d447801f2", "score": "0.64068764", "text": "function isEmpty(strField)\n\t{\n\t\tvar bRetVal=true;\n\t\tif('' != strField)\n\t\t{\n\t\t\tbRetVal = (strField.length + 1 == strField.split(' ').length);\n\t\t}\n\t\treturn bRetVal;\t\n\t}", "title": "" }, { "docid": "bda158af9b355f722d2a08e657d6cb7b", "score": "0.63973784", "text": "function checkNumOfChar(str) {\r\n if(str.length <= maxNumofChar){\r\n return true\r\n }else return false\r\n}", "title": "" }, { "docid": "d6990584e1ec0f393ae85ddd39cc848f", "score": "0.6364954", "text": "function passwordLongEnough(password){\n\tif(password.length===10){\n\treturn true;\n\t}\n\telse{\n\treturn false;\n\t}\n}", "title": "" }, { "docid": "2ca43333ee6f5a083e5d9e0038290277", "score": "0.6363062", "text": "function checkMaxLength(inputField, maxSize){\n\tif(inputField && inputField.length > maxSize) {\n\t\treturn 'fail';\n\t} else {\n\t\treturn 'pass';\n\t}\n}", "title": "" }, { "docid": "1ba4a89ec12aa4bca03cd73fed4bb0d7", "score": "0.6360905", "text": "function checkPassLength(pass) {\n if (pass.length >= 8 && pass.length <= 16) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "e71d7e672369a0b7adb352f5e7a1861c", "score": "0.6359752", "text": "function checkLength(o, n, min, max) {\n\n var result = false;\n\n if (o.length > max || o.length < min)\n //***Show error.\n scoreError(\"Length of \" + n + \" must be between \" + min + \" and \" + max + \".\");\n else\n result = true;\n\n return result;\n}", "title": "" }, { "docid": "547f20c4365051a0d97c3b2f0bce12a4", "score": "0.6344748", "text": "function CheckLength(thefield,maxlength,message) {\n\tif (thefield.value.length > maxlength) {\n\t\talert(message);\n\t\tthefield.focus();\n\t\treturn false;\n\t\t}\n\treturn true;\n}", "title": "" }, { "docid": "3cf51e93dacb5df7ff0c43961b630029", "score": "0.633423", "text": "function nombreDelProducto(){\n if(inputNombreDelProducto.value.length <5){ \n return true\n }else{\n return false\n } \n }", "title": "" }, { "docid": "97fabc7cf15d5850efb7664ecf464fee", "score": "0.6309813", "text": "function ValidateStringLength(str, bound) {\n return (str.length <= bound);\n}", "title": "" }, { "docid": "45770c1c8402ee35e009699406847359", "score": "0.6287485", "text": "function fieldIsOK(fieldId)\n{\n fn = $(fieldId).val();\n res = false;\n switch (fieldId) // Select the validation rule\n {\n case '#fname': // Names must be at least 2 chars long\n case '#lname': // Names must be at least 2 chars long\n case '#gitname':\n res = (fn.length >= 2);\n break;\n }\n return res;\n}", "title": "" }, { "docid": "505b51db5b58b769c604d3e44380cb67", "score": "0.6276043", "text": "function checkLength(input,min,max){\n if(input.value.length < min){\n showerror(input, `${getFieldId(input)} must be atleat ${min} characters.` );\n } else if( input.value.length > max){\n showerror(input, `${getFieldId(input)} must be less than ${max} characters.` );\n } else {\n showsuccess(input);\n }\n\n}", "title": "" }, { "docid": "bd0bc04ada953f78e62715de140acfc2", "score": "0.62729454", "text": "function length8(passw) {\n return (passw.length >= 8);\n}", "title": "" }, { "docid": "bd0bc04ada953f78e62715de140acfc2", "score": "0.62729454", "text": "function length8(passw) {\n return (passw.length >= 8);\n}", "title": "" }, { "docid": "1339990d01878cadc3d1c056252745f1", "score": "0.6272164", "text": "function isProperLength(elemId, length) {\n\tif(document.getElementById(elemId).value.length>length) {\n\t\treturn \"<div>The length of \" + elemId + \" is over the limit. Please enter less then \"+length+\" characters.</div>\";\n\t}\n\treturn \"\";\n}", "title": "" }, { "docid": "ce93aade4ee304a639960b007196423f", "score": "0.62708986", "text": "function page_vali_input_length(input_text_id, max_len) {\n if (p_is_ele_null(input_text_id)) {\n return true;\n }\n if (get_str_len($(\"#\" + input_text_id).val()) > max_len) {\n page_input_err_show(input_text_id, p_g_c_msg()['outof_max_lenth']\n + max_len);\n return false;\n }\n page_input_show(input_text_id);\n return true;\n}", "title": "" }, { "docid": "3fe2119016e7e9378798e3ec709d5d64", "score": "0.6264879", "text": "validPublicKey(){\n if(this.public.length>=8 && this.length<=25){ //Will conditionally check to see if the string is between 8 and 25 characters long inclusively.\n return true;\n }\n else{\n return false;\n }\n }", "title": "" }, { "docid": "993243953a6b7f2a32a208c8071b9bd1", "score": "0.625896", "text": "static rgtl(val,vlength){\n return val.length > vlength;\n }", "title": "" }, { "docid": "c4a9a60a8bc5b57a5fc248670d8fdeab", "score": "0.6257377", "text": "function checkPasswordLength(pwd) {\n check = false;\n if(pwd.length >= 8) {\n check = true;\n }\n return check;\n}", "title": "" }, { "docid": "9c9767aa50f46a93412e7f92fddb4db8", "score": "0.625702", "text": "function Validate_20(value) {\n if (value.length > 16) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "694819356ba15da42b22d223f3f587a2", "score": "0.62562805", "text": "function imposeMaxLength(Object, MaxLen) {\n return (Object.value.length <= MaxLen);\n}", "title": "" }, { "docid": "80ca3df20d8d7d3d32df71cdaf1b2c0e", "score": "0.62475926", "text": "function isLen16(elem) {\r\n var str = elem.value;\r\n var re = /\\b.{16}\\b/;\r\n if (!str.match(re)) {\r\n alert(\"Entry does not contain the required 16 characters.\");\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "be2fe209254a2694ee17de4d33bd00be", "score": "0.6242649", "text": "function checkPasswordLength(/*String*/ password, /*int*/ min, /*int*/ max){\n return password.length >= min && password.length <= max;\n}", "title": "" }, { "docid": "f71de789d85e0bee049a490d9939dd75", "score": "0.62317365", "text": "function checkLength(textValue, minLength, maxLength) {\n var length = textValue.length;\n if (maxLength === undefined) {\n maxLength = minLength;\n }\n return (length >= minLength && length <= maxLength);\n }", "title": "" }, { "docid": "a5c0b0186e00b9c7194c7e5e87838586", "score": "0.62271553", "text": "function b(input){\r\n return input.length==len;\r\n \r\n }", "title": "" }, { "docid": "e3dd37f151736eff97e0f2493f8ae55a", "score": "0.6222712", "text": "static rneql(val,vlength){\n return val.length != vlength;\n }", "title": "" }, { "docid": "15ed4dc122df2f7ffe6fdffd245fc1c2", "score": "0.6216589", "text": "function pwLength(str) {\n return str.length >= minLengthPW;\n }", "title": "" }, { "docid": "ef6010389b6bdf9dc2aa76cb7cbdd928", "score": "0.6212207", "text": "function checkLength( o, n, min, max ) {\n if ( o.val().length > max || o.val().length < min ) {\n o.addClass( \"ui-state-error\" );\n updateTips( \"Length of \" + n + \" must be between \" +\n min + \" and \" + max + \".\" );\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "8d06064f7a10aebbe98997f99a8e8875", "score": "0.6197719", "text": "function isLengthMinMax(inputElm, minLength, maxLength, errMsg, errElm) {\n var inputValue = inputElm.value.trim();\n var isValid = (inputValue.length >= minLength) && (inputValue.length <= maxLength);\n postValidate(isValid, errMsg, errElm, inputElm);\n return isValid;\n}", "title": "" }, { "docid": "9a7e40898f54ed63b04d0ebdaf1ee978", "score": "0.6179075", "text": "requiredFieldsFilled() {\n const { firstName, lastName, DOB, email, password } = this.state;\n // console.log(`fields filled is ${firstName.length > 0 && lastName.length > 0 && DOB.length > 0 && email.length > 0 && password.length > 0}, lengths are ${firstName.length} ${lastName.length} ${DOB.length} ${email.length } ${password.length}`);\n return firstName.length > 0 && lastName.length > 0 && DOB.length === undefined && email.length > 0 && password.length > 0;\n }", "title": "" }, { "docid": "a90f2958015ea8244af298f61789b071", "score": "0.6174754", "text": "function validator(v) {\n return v.length > 0;\n}", "title": "" }, { "docid": "61fed4eb11cae7e33d36552962fb9489", "score": "0.6167735", "text": "function checkInputLength(value) {\n // Trim the value\n var trimmedValue = value.trim();\n // If the value's length is greater than 0 characters, return true\n if (trimmedValue.length > 0) {\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "50f915fe1f682d9871e14eb81b193e2b", "score": "0.6164652", "text": "function stringLength(stringToTest, options) {\n if ('string' !== typeof stringToTest) {\n return false;\n }\n options = options || {};\n //console.log(options);\n options.minLength = options.minLength || 0;\n var isMinLength = options.minLength !== undefined ? stringToTest.length >= options.minLength : true;\n var isMaxLength = options.maxLength !== undefined ? stringToTest.length <= options.maxLength : true;\n return isMinLength && isMaxLength;\n}", "title": "" }, { "docid": "c1ec4001abdb4e001aa960090af79336", "score": "0.61501443", "text": "function checkLength(input,min,max){\n if(input.value.length<min){\n showError(input,`${getFieldName(input)} must be atleast ${min} characters`)\n }else if(input.value.length>max){\n showError(input,`${getFieldName(input)} must be less than ${max} characters`)\n }else{\n showSuccess(input)\n }\n}", "title": "" }, { "docid": "e4e1ee2ff0e2f6fce453b07bfb648e95", "score": "0.6137976", "text": "static rltl(val,vlength){\n return val.length < vlength;\n }", "title": "" }, { "docid": "7d1640df7618872c85c338db9b53fb0e", "score": "0.6134105", "text": "function validateMaxLength(value, maxLength) {\r\n return (value.length <= maxLength);\r\n }", "title": "" }, { "docid": "79ac2a2fd9669ac842941fa127a556e6", "score": "0.6121362", "text": "function check_checkLenth_nm(field_nm, obj, arg_limtiByte){\r\n\tvar lang = getLang('MN_LANG');\r\n\tvar inputDate=obj.value;\r\n\tvar totalLength=check_getLength(inputDate);\r\n\t\r\n\tif(eval(totalLength) > eval(arg_limtiByte)){\r\n\t\tif(lang == \"ko\"){\r\n\t\t\t var msg=\"{0}일 경우, {0}자리입니다.\";\r\n\t\t}else if(lang == \"en\"){ \t \r\n\t\t\t var msg=\"{0} is {0}digits needed.\";\r\n\t\t}else{\r\n\t\t\t var msg=\"{0} тохиолдолд {0} оронтой байна.\";\r\n\t\t }\r\n\t\tmsg=msg.replace(\"{0}\",field_nm);\r\n\t\tmsg=msg.replace(\"{0}\",arg_limtiByte);\r\n\t\t\r\n\t\talert(msg);\r\n\t\tobj.focus();\r\n\t\tobj.select();\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "12bfcf5d49f6604f005bf9912586c653", "score": "0.6111118", "text": "function checkMaxLength(element,text,max,elmError)\n{\n\tif(element.val().length > max )\n\t{\n\t\telement.addClass('ui-state-error');\n\t\tupdateTips(\"* Length of \" +text+\" must be maximum \"+max+\" letters\",elmError,element);\n\t\treturn false;\n\t}\n\telse \n\t\treturn true;\n}", "title": "" }, { "docid": "12bfcf5d49f6604f005bf9912586c653", "score": "0.6111118", "text": "function checkMaxLength(element,text,max,elmError)\n{\n\tif(element.val().length > max )\n\t{\n\t\telement.addClass('ui-state-error');\n\t\tupdateTips(\"* Length of \" +text+\" must be maximum \"+max+\" letters\",elmError,element);\n\t\treturn false;\n\t}\n\telse \n\t\treturn true;\n}", "title": "" } ]
5f2629fb39d146b24d37e20c77677943
Returns a decimal value given a fractional value
[ { "docid": "b54f05a8255c0f5341d6a7c5780e0b7c", "score": "0.7785755", "text": "function fracToDec(fractionalValue) {\n return parseFloat('.' + fractionalValue);\n }", "title": "" } ]
[ { "docid": "f1744c2d9a77b1d5fa9d459d1a51faf8", "score": "0.7871575", "text": "function fracToDec(fractionalValue) {\n return parseFloat('.' + fractionalValue);\n}", "title": "" }, { "docid": "772ff84c242f22319e9d5a61a31bec0f", "score": "0.7079873", "text": "function calculatefrac(value, base = 2) {\n var [integer, fraction = ''] = value.toString().split('.');\n\n return parseInt(integer, base) + (integer[0] !== '-' || -1) * fraction.split('').reduceRight((r, a) => (r + parseInt(a, base)) / base, 0);\n}", "title": "" }, { "docid": "82e36e00b4e5dd91db2de341a6c01389", "score": "0.6921824", "text": "function frac(x)\n{\n return Math.abs(x - trunc(x));\n}", "title": "" }, { "docid": "306c3ba0727142c24c9f5693fae13ab4", "score": "0.65298605", "text": "function returnFloat1(value) {\n\tvalue = Math.round(parseFloat(value) * 10) / 10;\n\tif (value.toString().indexOf(\".\") < 0) {\n\t\tvalue = value.toString() + \".0\";\n\t}\n\treturn value;\n}", "title": "" }, { "docid": "712733876e5c9b3e9c73e78e80ea2886", "score": "0.63883173", "text": "function getFloat(value){\n\t\treturn value.match(/[-]?[0-9]*\\.?[0-9]+/)[0];\n\t}", "title": "" }, { "docid": "7c2c358cdf95869d13e225478340298a", "score": "0.6338485", "text": "function number1(value) {\n return value.toFixed()\n }", "title": "" }, { "docid": "c9eb66756fe508b3fa9994aaba5dc8ee", "score": "0.63023525", "text": "function toDecimal(f) {\n if (f != 0) {\n return Number.parseFloat(f).toFixed(2);\n }\n return f;\n}", "title": "" }, { "docid": "5532ccd48872736eb1fae179231139a3", "score": "0.6176311", "text": "function frac(n) { return Math.abs(n)%1; }", "title": "" }, { "docid": "80cc13af7f0f28808f7cc65213962aff", "score": "0.61406225", "text": "function ToDecimal(val,n){\n //var binToDic = [2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072];\n var number = val.toString(); //to string\n var inDex = number.indexOf(\".\"); //search for .\n var fraction = number.slice(inDex+1); //slice out after . string\n var leng = fraction.length; //find length\n if(leng == 0) return \"\";\n number = parseInt(fraction); //extract int value\n var numberA = fraction.split(\"\"); //spilt into string array\n val = 0;\n for(let i=0;i<leng;i++){\n if(numberA[i] != \"0\"){\n let temp = numberA[i];\n let devide = parseInt(temp,n);\n let devided = Math.pow(n,i+1);\n val += (devide/devided);\n }\n }\n number = val.toString();\n val = number.slice(1);\n return val;\n}", "title": "" }, { "docid": "869610109cd6d58cd0ecef53b3753d1a", "score": "0.6133719", "text": "function _exactFraction(n) {\n if (isFinite(n)) {\n var f = math.fraction(n);\n if (f.valueOf() === n) {\n return f;\n }\n }\n return n;\n }", "title": "" }, { "docid": "69f573e209c599b2c3c56ffcc51c255d", "score": "0.6094058", "text": "function impartire1(a,b){\n\n return (a/b).toFixed(2);\n\n}", "title": "" }, { "docid": "0d22a633a23f8f2952549768ee9e899d", "score": "0.6090058", "text": "function decimal2fraction(dec) {\n const nume = dec * 100;\n const denom = 100;\n const myGCD = gcd(nume, denom);\n let out = (nume / myGCD).toString() + \"/\" + (denom / myGCD).toString();\n if (nume > denom) {\n out = fractionToMixedFraction(nume, denom);\n }\n\n return out;\n}", "title": "" }, { "docid": "2659311f0d2cd458fcedbd68eb0dfc04", "score": "0.606175", "text": "function fractionate(val, minVal, maxVal) {\n return (val - minVal)/(maxVal - minVal);\n}", "title": "" }, { "docid": "4b03b0cb75418b763c0091fccaee804b", "score": "0.6055352", "text": "function getFraction(n) {\n const s = String(n);\n let number;\n if (s.indexOf('.') === -1) {\n number = 0;\n } else {\n number = Number(s.slice(s.indexOf('.')));\n }\n return number;\n}", "title": "" }, { "docid": "38b94ee7ae47e24235d2d325e149948e", "score": "0.6017917", "text": "function decimalFormat(value) {\n return parseFloat(Math.round(value * 100) / 100).toFixed(2);\n}", "title": "" }, { "docid": "41577618712aab06f183284ed37c8f78", "score": "0.6014469", "text": "function float(num) {\n return num * 0.1 * 10;\n}", "title": "" }, { "docid": "cc3e1c072c799ca51dbccfd7c4d0ed98", "score": "0.59869635", "text": "function toFixed(value, fractionOrSignificantDigits) {\r\n if (fractionOrSignificantDigits === void 0) { fractionOrSignificantDigits = 2; }\r\n var power = Math.floor(Math.log(Math.abs(value)) / Math.LN10);\r\n if (power >= 0 || !isFinite(power)) {\r\n return value.toFixed(fractionOrSignificantDigits); // fraction digits\r\n }\r\n return value.toFixed(Math.abs(power) - 1 + fractionOrSignificantDigits); // significant digits\r\n}", "title": "" }, { "docid": "0e0938636c9a265d57fdc51b10c2ad8f", "score": "0.5974985", "text": "quotient() {\n return Math.floor(this.numerator / this.denominator);\n }", "title": "" }, { "docid": "23eaf10c87bc2a9152d346ccbfe1c4cf", "score": "0.59747726", "text": "function toFixed(value, fractionOrSignificantDigits) {\n if (fractionOrSignificantDigits === void 0) { fractionOrSignificantDigits = 2; }\n var power = Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n if (power >= 0 || !isFinite(power)) {\n return value.toFixed(fractionOrSignificantDigits); // fraction digits\n }\n return value.toFixed(Math.abs(power) - 1 + fractionOrSignificantDigits); // significant digits\n}", "title": "" }, { "docid": "23eaf10c87bc2a9152d346ccbfe1c4cf", "score": "0.59747726", "text": "function toFixed(value, fractionOrSignificantDigits) {\n if (fractionOrSignificantDigits === void 0) { fractionOrSignificantDigits = 2; }\n var power = Math.floor(Math.log(Math.abs(value)) / Math.LN10);\n if (power >= 0 || !isFinite(power)) {\n return value.toFixed(fractionOrSignificantDigits); // fraction digits\n }\n return value.toFixed(Math.abs(power) - 1 + fractionOrSignificantDigits); // significant digits\n}", "title": "" }, { "docid": "b90b553c462b160974b1f0dabdff43be", "score": "0.597264", "text": "function preserveDecimal(n) {\n return parseFloat(n);\n}", "title": "" }, { "docid": "fa36c65c5da14cc0ff3246b1d57cdf20", "score": "0.5951312", "text": "function fraction(numb){\n var number = numb.toString();\n var getpredec = number.split('.');\n var getdecimal = parseFloat( '0.' + getpredec[1] );\n var frac = getdecimal;\n var returnvalue = frac * 8;\n var concat = returnvalue.toString() + '/8';\n return concat;\n }", "title": "" }, { "docid": "6297989ace5aa38a3d5a6a4ebcc4127c", "score": "0.5938785", "text": "function changeTwoDecimal_f(x){\r\n\tvar f_x = parseFloat(x);\r\n\tif (isNaN(f_x)){\r\n\t\treturn null;\r\n\t}\r\n\tvar f_x = Math.round(x*100)/100;\r\n\tvar s_x = f_x.toString(); \r\n\tvar pos_decimal = s_x.indexOf('.'); \r\n\tif (pos_decimal < 0){\r\n\t\tpos_decimal = s_x.length; \r\n\t\ts_x += '.'; \r\n\t}\r\n\twhile (s_x.length <= pos_decimal + 2) { \r\n\t\ts_x += '0'; \r\n\t}\r\n\treturn s_x; \r\n}", "title": "" }, { "docid": "4ba551fbf229e56bba47ca67e964dc8d", "score": "0.59326845", "text": "function convertirEnDecimal(d){\n d=parseFloat(d);\n return d;\n\n}", "title": "" }, { "docid": "428f553672028855e8e230a32ca5ffa6", "score": "0.5918686", "text": "function preserveDecimal (a) {\n return parseFloat (a)\n}", "title": "" }, { "docid": "760b5188691e14072512d67dcf245f1b", "score": "0.59155685", "text": "function toDecimal(s) {\n return parseFloat('0.'+s);\n }", "title": "" }, { "docid": "377b6ad971ebc863f8a518f41662afed", "score": "0.59082747", "text": "function formatDecimal(value, decimals, keepZero) {\n var mul = new String(\"1\");\n var zero = new String(\"0\");\n for (var i = decimals; i > 0; i--) {\n mul += zero;\n }\n value = Math.round(value * mul);\n value = value / mul;\n var strVal = new String(value);\n if (!keepZero) {\n return strVal;\n }\n\n var nowDecimals = 0;\n var dot = strVal.indexOf(\".\");\n if (dot == -1) {\n strVal += \".\";\n } else {\n nowDecimals = strVal.length - dot - 1;\n }\n for (var i = nowDecimals; i < decimals; i++) {\n strVal = strVal + zero;\n }\n\n return strVal;\n }", "title": "" }, { "docid": "1b146a14c5ab5bbb75198bd3e9b6f387", "score": "0.5894311", "text": "function roundToOneDecimal(number){\n return (Math.round(number*10))/10;\n}", "title": "" }, { "docid": "e9df46c06e8e36f0203d42db7a5ff1e5", "score": "0.5892192", "text": "function getPercent(ex1, note1)\n{\n return ((ex1/(note1*2))*100).toFixed(2); //Rounds to 2 decimal places\n}", "title": "" }, { "docid": "da5052d915c809e0fb94d746f8552457", "score": "0.5885281", "text": "function toFixedDecimals(value, decimals) {\n\t\treturn Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);\n\t}", "title": "" }, { "docid": "6b595baf4e2d4f805e85d5eed1871965", "score": "0.5883667", "text": "function floorFigure(figure, decimals){\r\n if (!decimals) decimals = 4;\r\n var d = Math.pow(10,decimals);\r\n return (parseInt(figure*d)/d).toFixed(decimals);\r\n}", "title": "" }, { "docid": "4320d2243a9698c861b234a7c1faa6f1", "score": "0.585822", "text": "function roundToDecimal(value, decimals) {\n\t var tenTo = Math.pow(10, decimals);\n\t return Math.round(value * tenTo) / tenTo;\n\t}", "title": "" }, { "docid": "134e570059b3bd12d5f50799247e999f", "score": "0.5854519", "text": "static getPercentDecimalValue(superRate) {\n const rate = superRate.slice(0, -1);\n return rate / 100;\n }", "title": "" }, { "docid": "9547b1d7a3056427381cfe79d778c528", "score": "0.5852861", "text": "function getDecimalPlaces(value) {\n var match = ('' + value).match(/(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/);\n\n if (!match) { return 0; }\n\n return Math.max(\n 0,\n // Number of digits right of decimal point.\n (match[1] ? match[1].length : 0) -\n // Adjust for scientific notation.\n (match[2] ? +match[2] : 0)\n );\n }", "title": "" }, { "docid": "b60c34f00471e04d9d0eeefdda810ada", "score": "0.5850444", "text": "function floorFigure(figure, decimals) {\n //if (!decimals) decimals = 2;\n var d = Math.pow(10, decimals);\n return (parseInt(figure * d) / d).toFixed(decimals);\n}", "title": "" }, { "docid": "b2cdb2ffa5300ddee0d7e3c28a4aa0df", "score": "0.58284545", "text": "function InMaCo(){\n var inc = 0;\n var inc2 = 0;\n var inc3 = 0;\n inc = talla/100\n inc2 = Math.pow(inc, 2);\n var inc3 = pesoactual/inc2;\n $scope.IMC = inc3.toFixed(1);\n console.log(parseFloat(inc3).toFixed(1));\n\n\n }", "title": "" }, { "docid": "071b6dc2d433d8275f356ac28bcc759c", "score": "0.5823839", "text": "function calc (x,y) { return (parseInt(x,10) / parseInt(y,10) * 100).toFixed(); }", "title": "" }, { "docid": "4d23f61c2ca3891c040883b6ff18c45d", "score": "0.58201504", "text": "function decimalToPercent(decimal) {\n return Math.round(decimal * 1000) / 10;\n}", "title": "" }, { "docid": "bcfe3393b0a3d6221bef29c7510582e3", "score": "0.58023936", "text": "function floorFigure(figure, decimals){\n if (!decimals) decimals = 2;\n var d = Math.pow(10,decimals);\n return (parseInt(figure*d)/d).toFixed(decimals);\n}", "title": "" }, { "docid": "e42b793bbfc3241d1152d053bd9aa731", "score": "0.57977086", "text": "function poundsToDollars(money) {\n let pound = 1.31;\n let finale = (money * pound).toFixed(3);\n console.log(finale);\n}", "title": "" }, { "docid": "e8175c8dc43fa1e195e91d3050b590be", "score": "0.5795124", "text": "function conversor(cantidad, precio){\n var z = Number.parseFloat(cantidad).toFixed(2);\n var y = Number.parseFloat(precio).toFixed(2);\n var x = z / y;\n return Number.parseFloat(x).toFixed(2);;\n}", "title": "" }, { "docid": "ec3340e8e0982f3d92f6bd473624001f", "score": "0.5791893", "text": "function round(value, decimals) {\n return Number(Math.round(value+'e'+decimals)+'e-'+decimals);\n}", "title": "" }, { "docid": "785a9dde36907354813bbe4aaf2e005e", "score": "0.5781719", "text": "function galEquation() {\n\tvar gallon = 0.2641720524;\n\tvar l = document.getElementById(\"kInput\").value;\n var totalG = l * gallon;\n var g = totalG.toFixed(3); //Result shows only one decimal\n document.getElementById(\"mInput\").value = g;\n}", "title": "" }, { "docid": "aac1edb46670c18045c832f0f2c877a4", "score": "0.5755293", "text": "function round(value, decimals) {\n return Number(Math.round(value+'e'+decimals+'e-'+decimals));\n}", "title": "" }, { "docid": "eaae58dec65a6286267b0eda59996e8a", "score": "0.57457453", "text": "homeMadeRound(value, decimals) {\n return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals);\n }", "title": "" }, { "docid": "9a4581dc337e05e79e7fac27f5a013f0", "score": "0.5744941", "text": "function getdTValue(decimals) {\n var deltaT = elements[5] + 0.0;\n\n return deltaT.toFixed(decimals);\n}", "title": "" }, { "docid": "2e1e6a3b3b8dc07ff3f2e127551c3667", "score": "0.57417136", "text": "function handleDecimals( name, value )\n{ \n var result;\n\n if( endsWith(name,\"ExposureSec\") )\n {\n result = value.toFixed( 3 );\n }\n else\n {\n result = round(value).toString();\n }\n \n return result;\n}", "title": "" }, { "docid": "0a2d4f70ef869d45692f63945b30eb3e", "score": "0.5733689", "text": "function fraction_part(dividendo, divisor)\n{\n resDiv = dividendo / divisor;\n f_part = Math.floor(resDiv);\n return f_part;\n} // Fin de función fraction_part", "title": "" }, { "docid": "49bf194b8883be021be1f43de7d24c11", "score": "0.57318395", "text": "function fEquation() {\n\tvar f = document.getElementById(\"mInput\").value;\n var totalC = (f - 32) * 5/9;\n var c = Math.floor(totalC); //Result shows only one decimal\n document.getElementById(\"kInput\").value = c;\n}", "title": "" }, { "docid": "7caffef511a76cc38bb4970330d334db", "score": "0.57316107", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i,\n coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)];\n }", "title": "" }, { "docid": "b157efd779c527020aaf657f5c11842c", "score": "0.5725359", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}", "title": "" }, { "docid": "b157efd779c527020aaf657f5c11842c", "score": "0.5725359", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}", "title": "" }, { "docid": "b157efd779c527020aaf657f5c11842c", "score": "0.5725359", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}", "title": "" }, { "docid": "b157efd779c527020aaf657f5c11842c", "score": "0.5725359", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}", "title": "" }, { "docid": "7ceb0281c90c11aa056a44ee6698b38f", "score": "0.5721173", "text": "function RoundNumber(value){\n if(decimalFactor==-1) return value;\n return Math.round(decimalFactor*value)/decimalFactor;\n }", "title": "" }, { "docid": "e121972d96e8fbe721e95605b99a1ceb", "score": "0.57161987", "text": "function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null;\n // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)];\n}", "title": "" }, { "docid": "a5fc77a499798d6f6ad1658f976d3ac2", "score": "0.57153046", "text": "function bfgRound(val, dp) {\n if (dp<=0) {\n return Math.round(val);\n } else {\n var z = \"\"+val;\n var ix = z.indexOf(\".\");\n return z.substring(0, Math.min(ix+dp+1, z.length));\n }\n}", "title": "" }, { "docid": "5afd2d66a8a64e84c765b75ee0691c60", "score": "0.57106096", "text": "function formatToOneDecimalPlace(value) {\n return Math.round((value + Number.EPSILON) * 10) / 10;\n }", "title": "" }, { "docid": "370007c60454b763271df9e9f8031ec0", "score": "0.5700063", "text": "function calPer(val, val2) {\n return (100 - (((val - val2) / val) * 100)).toFixed(2);\n}", "title": "" }, { "docid": "47ec677e376a8aada7dd97cdd37e18ac", "score": "0.5699543", "text": "function round(value, decimals) {\n return Number(Math.round(value+'e'+decimals)+'e-'+decimals);\n}", "title": "" }, { "docid": "47ec677e376a8aada7dd97cdd37e18ac", "score": "0.5699543", "text": "function round(value, decimals) {\n return Number(Math.round(value+'e'+decimals)+'e-'+decimals);\n}", "title": "" }, { "docid": "220bb64b2925ba7dac01cc295478c7ad", "score": "0.5698876", "text": "function convertToFloat(dollar){\n return parseFloat(dollar);\n\n}", "title": "" }, { "docid": "90fe1b6a9e24c412e1069af6c0d7a227", "score": "0.56930476", "text": "fraction() {\n return this.numerator % this.denominator;\n }", "title": "" }, { "docid": "548519eaec2a948e0c623ad9d54d8765", "score": "0.5685244", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n }", "title": "" }, { "docid": "548519eaec2a948e0c623ad9d54d8765", "score": "0.5685244", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n }", "title": "" }, { "docid": "548519eaec2a948e0c623ad9d54d8765", "score": "0.5685244", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n }", "title": "" }, { "docid": "548519eaec2a948e0c623ad9d54d8765", "score": "0.5685244", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n }", "title": "" }, { "docid": "548519eaec2a948e0c623ad9d54d8765", "score": "0.5685244", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n }", "title": "" }, { "docid": "548519eaec2a948e0c623ad9d54d8765", "score": "0.5685244", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n }", "title": "" }, { "docid": "094da2730899056b960f9ea72abc417f", "score": "0.56849074", "text": "function formatDecimal (x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i,\n coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)];\n }", "title": "" }, { "docid": "c507058cb739f66a89b94dd762628c97", "score": "0.5683015", "text": "function formatDecimal(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n }", "title": "" }, { "docid": "2753b29f9e2510d5e8e58c5f99d2732d", "score": "0.568068", "text": "function fract(x)\r\n{\r\n return x - Math.floor(x);\r\n}", "title": "" }, { "docid": "248494e82332e5fbbc1c4a51db38c768", "score": "0.56795037", "text": "function roundToOneDecimal(n)\n{\n\tvar num = n / METERS_IN_MILE;\n\treturn num.toFixed(1);\n}", "title": "" }, { "docid": "0e4373616d0b72f38c6882834c0027cc", "score": "0.56779337", "text": "function porcentajeGasolina() {\r\n var result= gasolina * 100 / gasolinaTotal;\r\n return result.toFixed(0);\r\n}", "title": "" }, { "docid": "5923c0e7bf401c154e05ff13698dccda", "score": "0.5671358", "text": "function calc(x, y) { return (parseInt(x, 10) / parseInt(y, 10) * 100).toFixed(); }", "title": "" }, { "docid": "b30e145800cfc47e574b8768a0e79354", "score": "0.5670498", "text": "function countDecimalPlaces(value) {\n if (!isFinite(value)) return 0;\n var e = 1;\n var p = 0;\n\n while (Math.round(value * e) / e !== value) {\n e *= 10;\n p++;\n }\n\n return p;\n}", "title": "" }, { "docid": "e12b2d510e627042857cf442bfc15554", "score": "0.5669835", "text": "function insertDecimal(num) {\n return (num / 10).toFixed(1);\n }", "title": "" }, { "docid": "8449a589bfc90d9b0a4ac7f8a4c4d4b2", "score": "0.5667697", "text": "function floatToDecimal(float) {\n\treturn Math.round(float*100)+'%';\n}", "title": "" }, { "docid": "ac9cc17a53a8d56ee42b3113b5ac7750", "score": "0.5659908", "text": "function round(value, decimals) {\n return Number(Math.round(value+'e'+decimals)+'e-'+decimals);\n }", "title": "" }, { "docid": "e5dd692561f8008fb039b70bdf8c900c", "score": "0.5657058", "text": "function formatFloat(theFloat,decimalPoint){\n\tvar multiplier;\n\tvar totLength;\n\tvar decimalPos;\n\tvar reminder;\n\t\n\tmultiplier = Math.pow(10,decimalPoint);\n\ttheFloat = theFloat * multiplier;\n\n\t//round the number so that when formatFloat(14.44999,2); the result will be 14.5 instead of 14.44\n\ttheFloat = Math.round(theFloat);\n\t//theFloat = parseInt(theFloat);\t//this causes 14.44 to be return\n\t\n\ttheFloat = theFloat / multiplier;\n\t\n\t//this will cause the result 14.4 to 14.40\n\ttheFloat = theFloat + \"\";\n\ttotLength = theFloat.length;\n\tdecimalPos = theFloat.indexOf(\".\");\n \n\ttotLength = totLength - 1;\n reminder = totLength - decimalPos;\t\n \n if( reminder == 1){\n\t\ttheFloat = theFloat + \"0\";\n\t}\n\t\t\n\treturn theFloat;\n}", "title": "" }, { "docid": "fcee66d9daed59cf9d76c0b7e7f14e53", "score": "0.5653882", "text": "function multiplier(x){var parts=x.toString().split('.');if(parts.length<2){return 1;}return Math.pow(10,parts[1].length);}", "title": "" }, { "docid": "fcee66d9daed59cf9d76c0b7e7f14e53", "score": "0.5653882", "text": "function multiplier(x){var parts=x.toString().split('.');if(parts.length<2){return 1;}return Math.pow(10,parts[1].length);}", "title": "" }, { "docid": "dec0aab473e5762b286752475f0063ff", "score": "0.56482816", "text": "function cEquation() {\n\tvar i = document.getElementById(\"kInput\").value;\n var totalF = i * 9/5 + 32; \n var f = Math.floor(totalF); //Result shows only one decimal\n document.getElementById(\"mInput\").value = f;\n}", "title": "" }, { "docid": "eb81e2146171f93d5c3690521b3043aa", "score": "0.5630318", "text": "function getVal(subVal, val) {\n return subVal * val / 100;\n\t\t\t }", "title": "" }, { "docid": "f329d40218a2b6f67883bd2368ca99ae", "score": "0.5629892", "text": "function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n\n var i,\n coefficient = x.slice(0, i); // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n\n return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)];\n}", "title": "" }, { "docid": "f329d40218a2b6f67883bd2368ca99ae", "score": "0.5629892", "text": "function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n\n var i,\n coefficient = x.slice(0, i); // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n\n return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)];\n}", "title": "" }, { "docid": "bb3d4e64cc007555acef2504b811d94e", "score": "0.5620465", "text": "get percent() {\n let value = parseFloat(this.value);\n let minValue = parseFloat(this.minValue);\n let maxValue = parseFloat(this.maxValue);\n return Math.min(Math.max((value - minValue) / (maxValue - minValue), 0), 1) * 100;\n }", "title": "" }, { "docid": "fb9272eed21ce169d4ccc6c601ba2baa", "score": "0.5618729", "text": "function modp(x){ return TRG.modp(x,1.5) }", "title": "" }, { "docid": "0b4d583bf8baf40c7dbd1a42b969c76a", "score": "0.5610358", "text": "function decimalNumber(number, precision) {\r\n\t // Convert the first parameter to a number.\r\n\t number = num(number);\r\n\t // If the precision is not specified, round to the nearest tenth.\r\n\t if(!precision) {\r\n\t\t return Math.round(number);\r\n\t }\r\n\t if(number == 0) {\r\n\t\t var decimals = \"\";\r\n\t\t for(var i=0; i<precision; i++) decimals += \"0\";\r\n\t\t return \"0.\" + decimals;\r\n\t }\r\n\t var exponent = Math.pow(10,precision);\r\n\t var roundedNumber = Math.round((number*exponent)).toString();\r\n\t return parseFloat(roundedNumber.slice(0,-1*precision) + \".\" + roundedNumber.slice(-1*precision));\r\n }", "title": "" }, { "docid": "f75157535dca0b4d246e0fb133687d2a", "score": "0.5603847", "text": "function pdiff(first,second) {\n\tvar firstN = parseFloat(first,10);\n\tvar secondN = parseFloat(second,10);\n\tvar answer = (((firstN / secondN) - 1) * 100).toFixed(2);\n\treturn parseFloat(answer,10);\n}", "title": "" }, { "docid": "0c80b4b89fd5429e986dd72a257695cd", "score": "0.56032884", "text": "_digitCorrector(value) {\n return this._round2Decimal(value * .0001);\n }", "title": "" }, { "docid": "e69656af003c1fc607fb2de94293428f", "score": "0.5594707", "text": "function formatDecimal(x, p) {\n\t if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n\t var i, coefficient = x.slice(0, i);\n\n\t // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n\t // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n\t return [\n\t coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n\t +x.slice(i + 1)\n\t ];\n\t }", "title": "" }, { "docid": "e69656af003c1fc607fb2de94293428f", "score": "0.5594707", "text": "function formatDecimal(x, p) {\n\t if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n\t var i, coefficient = x.slice(0, i);\n\n\t // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n\t // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n\t return [\n\t coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n\t +x.slice(i + 1)\n\t ];\n\t }", "title": "" }, { "docid": "e69656af003c1fc607fb2de94293428f", "score": "0.5594707", "text": "function formatDecimal(x, p) {\n\t if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n\t var i, coefficient = x.slice(0, i);\n\n\t // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n\t // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n\t return [\n\t coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n\t +x.slice(i + 1)\n\t ];\n\t }", "title": "" }, { "docid": "e69656af003c1fc607fb2de94293428f", "score": "0.5594707", "text": "function formatDecimal(x, p) {\n\t if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n\t var i, coefficient = x.slice(0, i);\n\n\t // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n\t // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n\t return [\n\t coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n\t +x.slice(i + 1)\n\t ];\n\t }", "title": "" }, { "docid": "e69656af003c1fc607fb2de94293428f", "score": "0.5594707", "text": "function formatDecimal(x, p) {\n\t if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n\t var i, coefficient = x.slice(0, i);\n\n\t // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n\t // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n\t return [\n\t coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n\t +x.slice(i + 1)\n\t ];\n\t }", "title": "" }, { "docid": "e69656af003c1fc607fb2de94293428f", "score": "0.5594707", "text": "function formatDecimal(x, p) {\n\t if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n\t var i, coefficient = x.slice(0, i);\n\n\t // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n\t // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n\t return [\n\t coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n\t +x.slice(i + 1)\n\t ];\n\t }", "title": "" }, { "docid": "4997c289dce677a8fbbb607c6308cff2", "score": "0.5586604", "text": "function formatDecimal(x, p) {\n\t if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n\t var i, coefficient = x.slice(0, i);\n\t\n\t // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n\t // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n\t return [\n\t coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n\t +x.slice(i + 1)\n\t ];\n\t }", "title": "" }, { "docid": "522f46c36e96ac3df69dea6e7a31c40d", "score": "0.558652", "text": "function format_float(f, p)\r\n{\r\n var i = to_int(f);\r\n var d = to_int((f - i) * Math.pow(10, p));\r\n \r\n return pad_left(i, 2, \"0\") + \".\" + pad_right(d, p, \"0\");\r\n}", "title": "" }, { "docid": "e106c314fc010b0253c85ddb383491d3", "score": "0.5577795", "text": "function decimalRound(number) {\n var formatInteger = d3.format(\",\");\n var formatDecimal = d3.format(\",.2f\");\n\n var number1 = 10101;\n var number2 = 12334.2;\n return !(number % 1) ? formatInteger(number) : formatDecimal(number)\n}", "title": "" } ]
316cbdc0c41ae0e32d63947e3f6cf617
jQuery extend now ignores nulls!
[ { "docid": "1fbd4570d8eda8d306286dd537077e74", "score": "0.0", "text": "function datepicker_extendRemove( target, props ) {\n\t$.extend( target, props );\n\tfor ( var name in props ) {\n\t\tif ( props[ name ] == null ) {\n\t\t\ttarget[ name ] = props[ name ];\n\t\t}\n\t}\n\treturn target;\n}", "title": "" } ]
[ { "docid": "b833c2c0ba99b9a1e23aa9fbb41b8bd0", "score": "0.76913226", "text": "function extend(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=false;if(typeof g===\"boolean\"){j=g;g=arguments[1]||{};h=2}if(typeof g!==\"object\"&&!jQuery.isFunction(g)){g={}}if(i===h){g=this;--h}for(;h<i;h++){if((a=arguments[h])!=null){for(b in a){c=g[b];d=a[b];if(g===d){continue}if(j&&d&&(jQuery.isPlainObject(d)||(e=jQuery.isArray(d)))){if(e){e=false;f=c&&jQuery.isArray(c)?c:[]}else{f=c&&jQuery.isPlainObject(c)?c:{}}g[b]=jQuery.inject(j,f,d)}else if(d!==undefined){g[b]=d}}}}return g}", "title": "" }, { "docid": "b27bb99dd0622a7b60da959f2b6e87d7", "score": "0.68003935", "text": "extend (){\n\n\t\t\tvar options, name, src, copy, copyIsArray, clone,\n\t\t\t\ttarget = arguments[ 0 ] || {},\n\t\t\t\ti = 1,\n\t\t\t\tlength = arguments.length,\n\t\t\t\tdeep = false;\n\n\t\t\t// Handle a deep copy situation\n\t\t\tif ( typeof target === \"boolean\" ) {\n\t\t\t\tdeep = target;\n\t\t\t\t// Skip the boolean and the target\n\t\t\t\ttarget = arguments[ i ] || {};\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t// Handle case when target is a string or something (possible in deep copy)\n\t\t\tif ( typeof target !== \"object\" && this.isFunction ( target ) ) {\n\t\t\t\ttarget = {};\n\t\t\t}\n\t\t\t// Extend jQuery itself if only one argument is passed\n\t\t\tif ( i === length ) {\n\t\t\t\ttarget = this;\n\t\t\t\ti--;\n\t\t\t}\n\t\t\tfor ( ; i < length; i++ ) {\n\n\t\t\t\t// Only deal with non-null/undefined values\n\t\t\t\tif ( ( options = arguments[ i ] ) !== null ) {\n\n\t\t\t\t\t// Extend the base object\n\t\t\t\t\tfor ( name in options ) {\n\t\t\t\t\t\tsrc = target[ name ];\n\t\t\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t\t\t// Prevent never-ending loop\n\t\t\t\t\t\tif ( target === copy ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\t\tvar bool = this.typeOf( copy ); \n\t\t\t\t\t\tif ( deep && copy && ( bool === \"object\" ||\n\t\t\t\t\t\t\t( copyIsArray = (bool === \"array\") ) ) ) {\n\n\t\t\t\t\t\t\tif ( copyIsArray ) {\n\t\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\t\tclone = src && bool === \"array\" ? src : [];\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tclone = src && bool === \"object\" ? src : {};\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\t\ttarget[ name ] = this.extend( deep, clone, copy );\n\n\t\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Return the modified object\n\t\t\treturn target;\n\t\t}", "title": "" }, { "docid": "349db7aa315f110ebebf6ec19680ee22", "score": "0.65827507", "text": "function extend() {\n var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {},\n i = 1,\n length = arguments.length,\n deep = false,\n toString = Object.prototype.toString,\n hasOwn = Object.prototype.hasOwnProperty,\n push = Array.prototype.push,\n slice = Array.prototype.slice,\n trim = String.prototype.trim,\n indexOf = Array.prototype.indexOf,\n class2type = {\n \"[object Boolean]\": \"boolean\",\n \"[object Number]\": \"number\",\n \"[object String]\": \"string\",\n \"[object Function]\": \"function\",\n \"[object Array]\": \"array\",\n \"[object Date]\": \"date\",\n \"[object RegExp]\": \"regexp\",\n \"[object Object]\": \"object\"\n },\n jQuery = {\n isFunction: function(obj) {\n return jQuery.type(obj) === \"function\"\n },\n isArray: Array.isArray ||\n function(obj) {\n return jQuery.type(obj) === \"array\"\n },\n isWindow: function(obj) {\n return obj != null && obj == obj.window\n },\n isNumeric: function(obj) {\n return !isNaN(parseFloat(obj)) && isFinite(obj)\n },\n type: function(obj) {\n return obj == null ? String(obj) : class2type[toString.call(obj)] || \"object\"\n },\n isPlainObject: function(obj) {\n if (!obj || jQuery.type(obj) !== \"object\" || obj.nodeType) {\n return false\n }\n try {\n if (obj.constructor && !hasOwn.call(obj, \"constructor\") && !hasOwn.call(obj.constructor.prototype, \"isPrototypeOf\")) {\n return false\n }\n } catch (e) {\n return false\n }\n var key;\n for (key in obj) {}\n return key === undefined || hasOwn.call(obj, key)\n }\n };\n if (typeof target === \"boolean\") {\n deep = target;\n target = arguments[1] || {};\n i = 2;\n }\n if (typeof target !== \"object\" && !jQuery.isFunction(target)) {\n target = {}\n }\n if (length === i) {\n target = this;\n --i;\n }\n for (i; i < length; i++) {\n if ((options = arguments[i]) != null) {\n for (name in options) {\n src = target[name];\n copy = options[name];\n if (target === copy) {\n continue\n }\n if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && jQuery.isArray(src) ? src : []\n } else {\n clone = src && jQuery.isPlainObject(src) ? src : {};\n }\n // WARNING: RECURSION\n target[name] = extend(deep, clone, copy);\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n return target;\n}", "title": "" }, { "docid": "ead69f00d6e0f6b757a9d673361a3501", "score": "0.63857865", "text": "extend(target, source) {\n if (Array.isArray(target)) {\n if (Array.isArray(source)) {\n target.splice(0, target.length) // empty array but keep the reference\n source.forEach(s => { target.push(this.clone(s)) })\n } else {\n throw new Error('Arrays can be extended with arrays only')\n }\n } else if (target instanceof Node || target instanceof Event) {\n throw new Error('HTML elmenents and events cannot be extended')\n } else if (target && typeof target == 'object' && source != null) {\n if (typeof source != 'object') {\n throw new Error('Object can be extended with other objects only.')\n }\n Object.keys(source).forEach(key => {\n if (target[key] != null && typeof target[key] == 'object'\n && source[key] != null && typeof source[key] == 'object') {\n let src = this.clone(source[key])\n // do not extend HTML elements and events, but overwrite them\n if (target[key] instanceof Node || target[key] instanceof Event) {\n target[key] = src\n } else {\n // if an array needs to be extended with an object, then convert it to empty object\n if (Array.isArray(target[key]) && this.isPlainObject(src)) {\n target[key] = {}\n }\n this.extend(target[key], src)\n }\n } else {\n target[key] = this.clone(source[key])\n }\n })\n } else if (source != null) {\n throw new Error('Object is not extendable, only {} or [] can be extended.')\n }\n // other arguments\n if (arguments.length > 2) {\n for (let i = 2; i < arguments.length; i++) {\n this.extend(target, arguments[i])\n }\n }\n return target\n }", "title": "" }, { "docid": "6ee0e8a4e31061065c064e8a1fde5c1c", "score": "0.62100494", "text": "function extend(){ var a=arguments,i=1,c=a.length,o=a[0],x;for(;i<c;i++){if(typeof(a[i])!='object')continue;for(x in a[i])if(a[i].hasOwnProperty(x))o[x]=a[i][x]};return o }", "title": "" }, { "docid": "31e3eb4dbb04e72bfb689c9b85f02a93", "score": "0.6063353", "text": "function ajaxExtend(target,src){++cov_2pqev52nch.f[471];var deep,key,flatOptions=(++cov_2pqev52nch.s[2900],(++cov_2pqev52nch.b[1355][0],jQuery.ajaxSettings.flatOptions)||(++cov_2pqev52nch.b[1355][1],{}));++cov_2pqev52nch.s[2901];for(key in src){++cov_2pqev52nch.s[2902];if(src[key]!==undefined){++cov_2pqev52nch.b[1356][0];++cov_2pqev52nch.s[2903];(flatOptions[key]?(++cov_2pqev52nch.b[1357][0],target):(++cov_2pqev52nch.b[1357][1],(++cov_2pqev52nch.b[1358][0],deep)||(++cov_2pqev52nch.b[1358][1],deep={})))[key]=src[key];}else{++cov_2pqev52nch.b[1356][1];}}++cov_2pqev52nch.s[2904];if(deep){++cov_2pqev52nch.b[1359][0];++cov_2pqev52nch.s[2905];jQuery.extend(true,target,deep);}else{++cov_2pqev52nch.b[1359][1];}++cov_2pqev52nch.s[2906];return target;}", "title": "" }, { "docid": "9e0deb2a62d3e2156680f87c0e140580", "score": "0.6009505", "text": "function extend() {\n\t // copy reference to target object\n\t var target = arguments[0] || {},\n\t i = 1,\n\t length = arguments.length,\n\t deep = false,\n\t options,\n\t name,\n\t src,\n\t copy;\n\n\t // Handle a deep copy situation\n\t if (typeof target === \"boolean\") {\n\t deep = target;\n\t target = arguments[1] || {};\n\t // skip the boolean and the target\n\t i = 2;\n\t }\n\n\t // Handle case when target is a string or something (possible in deep copy)\n\t if (typeof target !== \"object\" && !typeof target === 'function')\n\t target = {};\n\n\t var isPlainObject = function(obj) {\n\t // Must be an Object.\n\t // Because of IE, we also have to check the presence of the constructor\n\t // property.\n\t // Make sure that DOM nodes and window objects don't pass through, as well\n\t if (!obj || toString.call(obj) !== \"[object Object]\" || obj.nodeType\n\t || obj.setInterval)\n\t return false;\n\t \n\t var has_own_constructor = hasOwnProperty.call(obj, \"constructor\");\n\t var has_is_prop_of_method = hasOwnProperty.call(obj.constructor.prototype,\n\t \"isPrototypeOf\");\n\t // Not own constructor property must be Object\n\t if (obj.constructor && !has_own_constructor && !has_is_prop_of_method)\n\t return false;\n\t \n\t // Own properties are enumerated firstly, so to speed up,\n\t // if last one is own, then all properties are own.\n\n\t var last_key;\n\t for (key in obj)\n\t last_key = key;\n\t \n\t return typeof last_key === \"undefined\" || hasOwnProperty.call(obj, last_key);\n\t };\n\n\n\t for (; i < length; i++) {\n\t // Only deal with non-null/undefined values\n\t if ((options = arguments[i]) !== null) {\n\t // Extend the base object\n\t for (name in options) {\n\t src = target[name];\n\t copy = options[name];\n\n\t // Prevent never-ending loop\n\t if (target === copy)\n\t continue;\n\n\t // Recurse if we're merging object literal values or arrays\n\t if (deep && copy && (isPlainObject(copy) || Array.isArray(copy))) {\n\t var clone = src && (isPlainObject(src) || Array.isArray(src)\n\t ? src : (Array.isArray(copy) ? [] : {}));\n\n\t // Never move original objects, clone them\n\t target[name] = extend(deep, clone, copy);\n\n\t // Don't bring in undefined values\n\t } else if (typeof copy !== \"undefined\")\n\t target[name] = copy;\n\t }\n\t }\n\t }\n\n\t // Return the modified object\n\t return target;\n\t}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5962941", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5962941", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5962941", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5962941", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5962941", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "23f0c86d328059017db687ebf3b6f5c8", "score": "0.5962941", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "9c8e767694194ff04964d2c420742ac2", "score": "0.59416074", "text": "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions || {};for(key in src) {if(src[key] !== undefined){(flatOptions[key]?target:deep || (deep = {}))[key] = src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "e6d1c60a94945cbbfea6dddc560af5a1", "score": "0.5929224", "text": "function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key];}}if(deep){jQuery.extend(true,target,deep);}return target;}", "title": "" }, { "docid": "5a6dc2ae85a91407b0c0b067c0355e76", "score": "0.5919393", "text": "function extend(o, e){\n each(e, function(v, n){\n if (is(o[n], 'object') && is(v, 'object')){\n o[n] = extend(o[n], v);\n } else if (v !== null) {\n o[n] = v;\n }\n });\n return o;\n}", "title": "" }, { "docid": "229e15446c9cc13e6211987b8a67795f", "score": "0.58849984", "text": "function ajaxExtend(target,src){var key,deep,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(flatOptions[key]?target:deep||(deep={}))[key]=src[key]}}if(deep){jQuery.extend(true,target,deep)}return target}", "title": "" }, { "docid": "7a09955bb81fcb1935dbe5d8f420a09d", "score": "0.58698547", "text": "function extend(){return(function m(a){var b={},src,p,c=function(v){return(v!==undefined&&v!==null&&v.constructor==Object)};while(a.length>0){src=a.shift();if(c(src)){for(p in src){if(src.hasOwnProperty(p)){if(c(src[p])){b[p]=m([(b[p]||{}),src[p]])}else{b[p]=src[p]}}}}}return b})(Array.prototype.slice.call(arguments,0))}", "title": "" }, { "docid": "013202509c260e40e3ff3a1ad157655f", "score": "0.5856992", "text": "function _extend(){\n\t\tvar ret = arguments[0]\n\t\tfor(var i = 1; i < arguments.length; i++){\n\t\t\tvar arg = arguments[i];\n\t\t\tfor(var j in arg) ret[j] = arg[j]\n\t\t}\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "013202509c260e40e3ff3a1ad157655f", "score": "0.5856992", "text": "function _extend(){\n\t\tvar ret = arguments[0]\n\t\tfor(var i = 1; i < arguments.length; i++){\n\t\t\tvar arg = arguments[i];\n\t\t\tfor(var j in arg) ret[j] = arg[j]\n\t\t}\n\t\treturn ret;\n\t}", "title": "" }, { "docid": "e21a6a233ec24443dea12e7f8052a965", "score": "0.583919", "text": "function extend(){\n for(var i=1; i<arguments.length; i++)\n for(var key in arguments[i])\n if(arguments[i].hasOwnProperty(key))\n arguments[0][key] = arguments[i][key];\n return arguments[0];\n }", "title": "" }, { "docid": "e9bbcb7384a983f20403c328334772d8", "score": "0.5834088", "text": "function extend(from, to)\n\t{\n\t\tif (from == null || typeof from != \"object\") return from;\n\t\tif (from.constructor != Object && from.constructor != Array) return from;\n\t\tif (from.constructor == Date || from.constructor == RegExp || from.constructor == Function ||\n\t\t\tfrom.constructor == String || from.constructor == Number || from.constructor == Boolean)\n\t\t\treturn new from.constructor(from);\n\n\t\tto = to || new from.constructor();\n\n\t\tfor (var name in from)\n\t\t{\n\t\t\tto[name] = typeof to[name] == \"undefined\" ? extend(from[name], null) : to[name];\n\t\t}\n\n\t\treturn to;\n\t}", "title": "" }, { "docid": "808b14fd8bd9df3b1bd2cef5455ca93c", "score": "0.58305687", "text": "function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}", "title": "" }, { "docid": "808b14fd8bd9df3b1bd2cef5455ca93c", "score": "0.58305687", "text": "function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}", "title": "" }, { "docid": "808b14fd8bd9df3b1bd2cef5455ca93c", "score": "0.58305687", "text": "function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}", "title": "" }, { "docid": "808b14fd8bd9df3b1bd2cef5455ca93c", "score": "0.58305687", "text": "function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}", "title": "" }, { "docid": "94c080d69d4413f7652deb775def4b3c", "score": "0.58059233", "text": "function extend(){\n\tif(typeof arguments[1] == \"object\") {\n\t\tfor(var i = 1 ; i < arguments.length ; i++) {\n\t\t\tfor(var key in arguments[i])\n\t\t {\n\t\t\t\tif(arguments[i].hasOwnProperty(key)) {\n\t\t\t\t\tif(arguments[i] != undefined && arguments[0] != undefined ){\n\t\t\t\t\t\targuments[0][key] = extend(arguments[0][key] , arguments[i][key]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\targuments[0] = arguments[0] = arguments[i];\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\targuments[0] = arguments[1];\n\t}\n\treturn arguments[0];\n}", "title": "" }, { "docid": "5e3bb673573dffe579c1ae4c928767dc", "score": "0.5785637", "text": "function extend(from, to)\n{\n if (from == null || typeof from != \"object\") return from;\n if (from.constructor != Object && from.constructor != Array) return from;\n if (from.constructor == Date || from.constructor == RegExp || from.constructor == Function ||\n from.constructor == String || from.constructor == Number || from.constructor == Boolean)\n return new from.constructor(from);\n\n to = to || new from.constructor();\n\n for (var name in from)\n {\n to[name] = typeof to[name] == \"undefined\" ? extend(from[name], null) : to[name];\n }\n\n return to;\n}", "title": "" }, { "docid": "571481f0f87b1f42e681591560c8e504", "score": "0.5727031", "text": "function __extends(e,t){function __(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}", "title": "" }, { "docid": "f55548155c5c144c4f2ab0660800a239", "score": "0.5714977", "text": "function extend() {\n var src, copy, name, options, clone;\n var target = arguments[0] || {};\n var i = 1;\n var length = arguments.length;\n\n for ( ; i < length; i++ ) {\n // Only deal with non-null/undefined values\n if ( (options = arguments[ i ]) != null ) {\n // Extend the base object\n for ( name in options ) {\n src = target[ name ];\n copy = options[ name ];\n\n // Prevent never-ending loop\n if ( target === copy ) {\n continue;\n }\n\n // Recurse if we're merging plain objects or arrays\n if ( copy && typeof copy === \"object\" ) {\n clone = src && typeof src === \"object\" ? src : {};\n\n // Never move original objects, clone them\n target[ name ] = extend( clone, copy );\n\n // Don't bring in undefined values\n } else if ( copy !== undefined ) {\n target[ name ] = copy;\n }\n }\n }\n }\n\n // Return the modified object\n return target;\n }", "title": "" }, { "docid": "98110aaa217a01174fb8183389d7a4fd", "score": "0.57104135", "text": "function extend(){\n for(var i=1; i<arguments.length; i++)\n for(var key in arguments[i])\n if(arguments[i].hasOwnProperty(key))\n arguments[0][key] = arguments[i][key];\n return arguments[0];\n}", "title": "" }, { "docid": "598f5c9f77e44a8958008eca23582e24", "score": "0.5709871", "text": "function extend(){\n for (var i=1; i<arguments.length; i++) {\n for (var key in arguments[i]) {\n if (arguments[i].hasOwnProperty(key)) arguments[0][key] = arguments[i][key];\n }\n }\n return arguments[0];\n }", "title": "" }, { "docid": "68d525bc049da243d632c9c9016aa6a1", "score": "0.5707272", "text": "function extend(target, source) {\n\t\ttarget = target || {}; //return an empty object if extending null (or false?)\n//\t\tif (!source) {\t\t// not required since ECMA5\n//\t\t\treturn target;\n//\t\t}\n\n\t\ttddjs.each(source, function(prop, val) {\n\t\t\ttarget[prop] = val;\n\t\t});\n\t\treturn target;\n\t}", "title": "" }, { "docid": "af0fa336f5011218ffc42a6f23079228", "score": "0.5706658", "text": "function ajaxExtend(target, src) {\n var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for (key in src) void 0 !== src[key] && ((flatOptions[key] ? target : deep || (deep = {}))[key] = src[key]);\n return deep && jQuery.extend(!0, target, deep), target;\n }", "title": "" }, { "docid": "8214ceb2151035cb08343347c9865951", "score": "0.5686497", "text": "function ajaxExtend(target, src) {\n var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for (key in src) void 0 !== src[key] && ((flatOptions[key] ? target : deep || (deep = {}))[key] = src[key]);\n return deep && jQuery.extend(!0, target, deep), target;\n }", "title": "" }, { "docid": "b1ab9e541e9ee177fdbedd7c928a9976", "score": "0.56853086", "text": "function copy(object) {\n if (typeof(object) === 'undefined' || object === null) {\n return null;\n }\n if (typeof(object) === 'string' || typeof(object) === 'number' || typeof(object) === 'boolean') {\n return object;\n }\n if (object.constructor == Array) {\n return jQuery.extend(true, [], object);\n }\n return jQuery.extend(true, {}, object);\n}", "title": "" }, { "docid": "4a8303068bacc653d27e2062dc37b23f", "score": "0.5684636", "text": "function extend(a,b){for(var p in b)a[p]=b[p];return a}", "title": "" }, { "docid": "27a343de2eea0468dd4a60c51b335acd", "score": "0.56634724", "text": "function extend() {\n for(var i=1; i<arguments.length; i++)\n for(var key in arguments[i])\n if(arguments[i].hasOwnProperty(key))\n arguments[0][key] = arguments[i][key];\n return arguments[0];\n}", "title": "" }, { "docid": "e4c19d357010c29200e0638867376424", "score": "0.5657199", "text": "function extend(r,i){for(var o in i)r[o]=i[o];return r}", "title": "" }, { "docid": "c36b2fe79a01f1f9f5669a31285aa96d", "score": "0.5651526", "text": "function simpleExtend( from, to ) {\n\t\tfor ( var k in from) {\n\t\t\tif (to[k] == undefined) {\n\t\t\t\tto[k] = from[k];\n\t\t\t}\n\t\t}\n\t\treturn to;\n\t}", "title": "" }, { "docid": "bf1c2b172b5196f67df440d450b49fee", "score": "0.5630438", "text": "function extendJavascriptObjects()\r\n{\r\n // ---------- String extensions ----------\r\n\r\n /** Format text content as it will appear on a page (before wrapping, etc).\r\n */\r\n String.prototype.normalizeWhitespace = function()\r\n {\r\n var text = this.replace(/\\s+/g, \" \"); // reduce internal whitespace\r\n text = text.replace(/ ([,;:\\.!])/g, \"$1\"); // snug-up punctuation\r\n return text.trimWhitespace();\r\n }\r\n\r\n /** Format text content as it will appear on a page (before wrapping, etc).\r\n */\r\n String.prototype.trimWhitespace = function()\r\n {\r\n return this.replace(/^\\s*/, \"\").replace(/\\s*$/, \"\");\r\n }\r\n\r\n String.prototype.stripQuoteMarks = function()\r\n {\r\n var text = this.replace(/\"/g, \"\");\r\n return text;\r\n }\r\n\r\n // ---------- Date extensions ----------\r\n\r\n SECOND = 1000;\r\n MINUTE = SECOND * 60;\r\n HOUR = MINUTE * 60;\r\n DAY = HOUR * 24;\r\n WEEK = DAY * 7;\r\n\r\n // Example, on the hour: floor(Date.HOUR)\r\n Date.prototype.floor = function(unit) {\r\n var floorMilli = Math.floor(this.getTime() / unit) * unit;\r\n return new Date(floorMilli);\r\n }\r\n\r\n Date.prototype.add = function(millis) {\r\n return new Date(this.getTime() + millis);\r\n }\r\n}", "title": "" }, { "docid": "48f4806d5d311ddc0723d193972f072b", "score": "0.5618442", "text": "function ajaxExtend( target, src ) {\r\n\tvar deep, key,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "48f4806d5d311ddc0723d193972f072b", "score": "0.5618442", "text": "function ajaxExtend( target, src ) {\r\n\tvar deep, key,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "48f4806d5d311ddc0723d193972f072b", "score": "0.5618442", "text": "function ajaxExtend( target, src ) {\r\n\tvar deep, key,\r\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n\tfor ( key in src ) {\r\n\t\tif ( src[ key ] !== undefined ) {\r\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\r\n\t\t}\r\n\t}\r\n\tif ( deep ) {\r\n\t\tjQuery.extend( true, target, deep );\r\n\t}\r\n\r\n\treturn target;\r\n}", "title": "" }, { "docid": "f6446a21a963714b2e463ed297ff76c7", "score": "0.5611407", "text": "function extend() {\n var objects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n objects[_i] = arguments[_i];\n }\n /** The final result we will return */\n var result = {};\n for (var _a = 0, objects_1 = objects; _a < objects_1.length; _a++) {\n var object = objects_1[_a];\n if (object == null || object === false) {\n continue;\n }\n for (var key in object) {\n /** Falsy values except a explicit 0 is ignored */\n var val = object[key];\n if (!val && val !== 0) {\n continue;\n }\n /** if nested media or pseudo selector */\n if (key === '$nest' && val) {\n result[key] = result['$nest'] ? extend(result['$nest'], val) : val;\n }\n else if ((key.indexOf('&') !== -1 || key.indexOf('@media') === 0)) {\n result[key] = result[key] ? extend(result[key], val) : val;\n }\n else {\n result[key] = val;\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "50b42a4b8209f50a628f93849eb9c6b8", "score": "0.559722", "text": "function ajaxExtend(target, src) {\n\t\t\tvar key,\n\t\t\t deep,\n\t\t\t flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\t\tfor (key in src) {\n\t\t\t\tif (src[key] !== undefined) {\n\t\t\t\t\t(flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (deep) {\n\t\t\t\tjQuery.extend(true, target, deep);\n\t\t\t}\n\t\n\t\t\treturn target;\n\t\t}", "title": "" }, { "docid": "d33026f423d60071e891d2af6ff7e9e8", "score": "0.559155", "text": "function extend() {\r\n var objects = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n objects[_i] = arguments[_i];\r\n }\r\n /** The final result we will return */\r\n var result = {};\r\n for (var _a = 0, objects_1 = objects; _a < objects_1.length; _a++) {\r\n var object = objects_1[_a];\r\n if (object == null || object === false) {\r\n continue;\r\n }\r\n for (var key in object) {\r\n /** Falsy values except a explicit 0 is ignored */\r\n var val = object[key];\r\n if (!val && val !== 0) {\r\n continue;\r\n }\r\n /** if nested media or pseudo selector */\r\n if (key === '$nest' && val) {\r\n result[key] = result['$nest'] ? extend(result['$nest'], val) : val;\r\n }\r\n else if ((key.indexOf('&') !== -1 || key.indexOf('@media') === 0)) {\r\n result[key] = result[key] ? extend(result[key], val) : val;\r\n }\r\n else {\r\n result[key] = val;\r\n }\r\n }\r\n }\r\n return result;\r\n}", "title": "" }, { "docid": "7981c1179daab69e210ad62c8ad0e57a", "score": "0.55887324", "text": "function ajaxExtend( target, src ) {\n\t\tvar deep, key,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "7981c1179daab69e210ad62c8ad0e57a", "score": "0.55887324", "text": "function ajaxExtend( target, src ) {\n\t\tvar deep, key,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "6e3658422a82bf5050a1b307a3179714", "score": "0.55827737", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "6e3658422a82bf5050a1b307a3179714", "score": "0.55827737", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "c5119e74003a047835cc9710114ae491", "score": "0.55797446", "text": "function ajaxExtend( target, src ) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for ( key in src ) {\n if ( src[ key ] !== undefined ) {\n ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n }\n }\n if ( deep ) {\n jQuery.extend( true, target, deep );\n }\n\n return target;\n }", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.55769956", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.55769956", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.55769956", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.55769956", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.55769956", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.55769956", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.55769956", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "0503ff3e248cf2333da2e2bea990061b", "score": "0.55769956", "text": "function ajaxExtend( target, src ) {\n\t\tvar key, deep,\n\t\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\t\n\t\tfor ( key in src ) {\n\t\t\tif ( src[ key ] !== undefined ) {\n\t\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t\t}\n\t\t}\n\t\tif ( deep ) {\n\t\t\tjQuery.extend( true, target, deep );\n\t\t}\n\t\n\t\treturn target;\n\t}", "title": "" }, { "docid": "2c573dd26a0edcd9cfbf78711e18b579", "score": "0.55707306", "text": "function ajaxExtend(target, src) {\n var key, deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : (deep || (deep = {})))[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n\n return target;\n }", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" }, { "docid": "350994d1b0d01e4506160f10da1a525b", "score": "0.5564788", "text": "function ajaxExtend( target, src ) {\n\tvar deep, key,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}", "title": "" } ]
73f623994431a95830c795a29ed2fddd
these helpers produces better vm code in JS engines due to their explicitness and function inlining
[ { "docid": "642587c0dffe8f20c966f94f9796cfbb", "score": "0.0", "text": "function isUndef (v) {\n return v === undefined || v === null\n}", "title": "" } ]
[ { "docid": "87f207c75371d1283b19f0542bc36625", "score": "0.62799925", "text": "function __f_0() {\n \"use asm\";\n\n function __f_1() {\n ;\n }\n\n return {\n __f_1: __f_1\n };\n}", "title": "" }, { "docid": "dba98fc9e35cf9958b7f74196e0fc825", "score": "0.6023361", "text": "function o0(stdlib,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n function o104(o49, o50, o73) {\n try {\no95(o49, o50, o73, this);\n}catch(e){}\n\n try {\no676++;\n}catch(e){}\n\n try {\nif (o97 === o49) {\n try {\nreturn true;\n}catch(e){}\n }\n}catch(e){}\n\n try {\nreturn false;\n}catch(e){}\n };\n //views\n var o14 = o0.o1(\"ES6ArrayUseConstructor_helper.js\",\"samethread\");\n\n function o4(){\n var o5 = 0.5\n var o6 = o2(1.5);\n try {\no3[1] = o6;\n}catch(e){}\n try {\nreturn +(o3[1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "557e3067eea38020afcf090dfa3ca027", "score": "0.6003248", "text": "function v2() {\n const v8 = Symbol || 9007199254740991;\n function v9(v10,v11,v12) {\n }\n const v16 = String();\n const v100 = String();//add\n const v106 = String();// add\n const v116 = String();// add\n const v17 = Int32Array();\n const v18 = Map();\n const v19 = [];\n const v20 = v18.values();\n function v21(v22,v23,v24,v25,v26) {\n }\n function v28(v29,v30,v31) {\n function v32(v33,v34,v35,v36) {\n }\n let v39 = 0;\n do {\n const v40 = v32();\n function v99() {\n }\n } while (v39 < 8);\n }\n const v41 = Promise();\n}", "title": "" }, { "docid": "c5c9474695f7dc8a04c8ecb0277ed475", "score": "0.59724176", "text": "function o0(stdlib,e,o1) {\n try {\n\"use asm\";\n}catch(e){}\n function add(o2,o3) {\n try {\no2 = +o11;\n}catch(o6.o8(o13.includes(new Boolean(true)), \"includes(new Boolean(true)): includes return false for search miss\")){}\n try {\nString.prototype = +e;\n}catch(e){}\n try {\nreturn +(o2+print('getOwnPropertyDescriptor on proxy : ' + o3.toString()));\n}catch(o7.o9){}\n }\n \n function o4(o2,o3){\n try {\no421 = +o2;\n}catch(e){}\n try { {\n try {\no282.unshift(o292);\n}catch(e){}\n} } catch(e) {}\n var o5 = 0.0;\n var o6 = 1;\n try {\no5 = +o7[o6&3](o2,o3);\n}catch(e){}\n try {\nreturn +o5;\n}catch(e){}\n }\n \n var o22 = 0;\n \n \n try {\nreturn { \n o4 : o4\n };\n}catch(e){}\n}", "title": "" }, { "docid": "352563c0f86c2e88154818c8b1a83d91", "score": "0.59471196", "text": "function Module() {\n \"use asm\";\n function f() {\n var $0 = 0, $25 = 0, $i$014$i = 0, $sum$013$i = 0, $v_0$01$i = 0, $v_1$02$i = 0, $v_10$011$i = 0, $v_11$012$i = 0, $v_2$03$i = 0, $v_3$04$i = 0, $v_4$05$i = 0, $v_5$06$i = 0, $v_6$07$i = 0, $v_7$08$i = 0, $v_8$09$i = 0, $v_9$010$i = 0;\n $i$014$i = 0;\n $sum$013$i = 0;\n $v_0$01$i = 8;\n $v_1$02$i = 9;\n $v_10$011$i = 18;\n $v_11$012$i = 19;\n $v_2$03$i = 10;\n $v_3$04$i = 11;\n $v_4$05$i = 12;\n $v_5$06$i = 13;\n $v_6$07$i = 14;\n $v_7$08$i = 15;\n $v_8$09$i = 16;\n $v_9$010$i = 17;\n do {\n $v_0$01$i = $v_3$04$i + $v_9$010$i + $v_0$01$i | 0;\n $v_1$02$i = $v_4$05$i + $v_10$011$i + $v_1$02$i | 0;\n $v_2$03$i = $v_5$06$i + $v_11$012$i + $v_2$03$i | 0;\n $v_3$04$i = $v_3$04$i + $v_6$07$i + $v_0$01$i | 0;\n $v_4$05$i = $v_4$05$i + $v_7$08$i + $v_1$02$i | 0;\n $v_5$06$i = $v_5$06$i + $v_8$09$i + $v_2$03$i | 0;\n $v_6$07$i = $v_6$07$i + $v_9$010$i + $v_3$04$i | 0;\n $v_7$08$i = $v_7$08$i + $v_10$011$i + $v_4$05$i | 0;\n $v_8$09$i = $v_8$09$i + $v_11$012$i + $v_5$06$i | 0;\n $v_9$010$i = $v_0$01$i + $v_9$010$i + $v_6$07$i | 0;\n $v_10$011$i = $v_1$02$i + $v_10$011$i + $v_7$08$i | 0;\n $v_11$012$i = $v_2$03$i + $v_11$012$i + $v_8$09$i | 0;\n $25 = $v_0$01$i + $v_1$02$i | 0;\n $sum$013$i = $v_2$03$i + $sum$013$i + $v_5$06$i + $v_4$05$i + $v_8$09$i + $v_3$04$i + $25 + $v_7$08$i + $v_11$012$i + $v_6$07$i + $v_10$011$i + $v_9$010$i | 0;\n $i$014$i = $i$014$i + 1 | 0;\n } while (($i$014$i | 0) <= 0);\n return $sum$013$i - ($v_5$06$i + $v_2$03$i + $v_4$05$i + $v_8$09$i + $25 + $v_3$04$i + $v_7$08$i + $v_11$012$i + $v_6$07$i + $v_10$011$i + $v_9$010$i);\n }\n return { f: f };\n}", "title": "" }, { "docid": "592658f0e115784177ca999db25e39e2", "score": "0.5921731", "text": "vmExecute(nexeccalls) {\n // This labelled while loop is used to simulate the effect of C's\n // goto. The end of the while loop is never reached. The beginning\n // of the while loop is branched to using a \"continue reentry;\"\n // statement (when a Lua function is called or returns).\n reentry: while (true) {\n // assert stack[ci.function()].r instanceof LuaFunction;\n var _function = this._stack[this.__ci().func].r;\n var proto = _function.proto;\n var code = proto.code; //int[]\n var k = proto.constant; //Slot[] \n var pc = this._savedpc;\n //20170402:added\n if (Lua.D) {\n //usage:luac -p -l cf.lua\n for (var i_test = 0; i_test < code.length; i_test++) {\n var name1 = Lua.getOpcodeName(Lua.OPCODE(code[i_test]));\n console.log(\">>>OPCODE(code(\" + (i_test + 1) + \")) == \" + name1);\n }\n }\n while (true) // main loop of interpreter\n {\n // Where the PUC-Rio code used the Protect macro, this has been\n // replaced with \"savedpc = pc\" and a \"// Protect\" comment.\n // Where the PUC-Rio code used the dojump macro, this has been\n // replaced with the equivalent increment of the pc and a\n // \"//dojump\" comment.\n var i = code[pc++]; // VM instruction.\n // :todo: line hook\n if ((this._hookmask & Lua.MASKCOUNT) != 0 && --this._hookcount == 0) {\n this.traceexec(pc);\n if (this.status == Lua.YIELD) // did hook yield?\n {\n this._savedpc = pc - 1;\n return;\n }\n // base = this.base\n }\n var a = Lua.ARGA(i); // its A field.\n var rb;\n var rc;\n //20170402:added\n if (Lua.D) {\n var name2 = Lua.getOpcodeName(Lua.OPCODE(i));\n console.log(\">>>pc == \" + pc + \", name == \" + name2);\n }\n switch (Lua.OPCODE(i)) {\n case Lua.OP_MOVE:\n this._stack[this._base + a].r = this._stack[this._base + Lua.ARGB(i)].r;\n this._stack[this._base + a].d = this._stack[this._base + Lua.ARGB(i)].d;\n continue;\n case Lua.OP_LOADK:\n this._stack[this._base + a].r = k[Lua.ARGBx(i)].r;\n this._stack[this._base + a].d = k[Lua.ARGBx(i)].d;\n if (Lua.D) {\n console.log(\"OP_LOADK:stack[\" + (this._base + a) +\n \"]=k[\" + Lua.ARGBx(i) + \"]=\" + k[Lua.ARGBx(i)].d);\n }\n continue;\n case Lua.OP_LOADBOOL:\n this._stack[this._base + a].r = Lua.valueOfBoolean(Lua.ARGB(i) != 0);\n if (Lua.ARGC(i) != 0) {\n ++pc;\n }\n continue;\n case Lua.OP_LOADNIL:\n {\n var b = this._base + Lua.ARGB(i);\n do {\n this._stack[b--].r = Lua.NIL;\n } while (b >= this._base + a);\n continue;\n }\n case Lua.OP_GETUPVAL:\n {\n var b2 = Lua.ARGB(i);\n // :todo: optimise path\n this.setObjectAt(_function.upVal(b2).value, this._base + a);\n continue;\n }\n case Lua.OP_GETGLOBAL:\n rb = k[Lua.ARGBx(i)];\n // assert rb instance of String;\n this._savedpc = pc; // Protect\n this.vmGettable(_function.env, rb, this._stack[this._base + a]);\n continue;\n case Lua.OP_GETTABLE:\n {\n this._savedpc = pc; // Protect\n var h = this._stack[this._base + Lua.ARGB(i)].asObject();\n if (Lua.D) {\n console.log(\"OP_GETTABLE index = \" + (this._base + Lua.ARGB(i)) +\n \", size = \" + this._stack.length +\n \", h = \" + h);\n }\n this.vmGettable(h, this.RK(k, Lua.ARGC(i)), this._stack[this._base + a]);\n continue;\n }\n case Lua.OP_SETUPVAL:\n {\n var uv = _function.upVal(Lua.ARGB(i));\n uv.value = this.objectAt(this._base + a);\n continue;\n }\n case Lua.OP_SETGLOBAL:\n this._savedpc = pc; // Protect\n // :todo: consider inlining objectAt\n this.vmSettable(_function.env, k[Lua.ARGBx(i)], this.objectAt(this._base + a));\n continue;\n case Lua.OP_SETTABLE:\n {\n this._savedpc = pc; // Protect\n var t = this._stack[this._base + a].asObject();\n this.vmSettable(t, this.RK(k, Lua.ARGB(i)), this.RK(k, Lua.ARGC(i)).asObject());\n continue;\n }\n case Lua.OP_NEWTABLE:\n {\n var b3 = Lua.ARGB(i);\n var c = Lua.ARGC(i);\n this._stack[this._base + a].r = new LuaTable_1.LuaTable();\n this._stack[this._base + a].r.init(Lua.oFb2int(b3), Lua.oFb2int(c));\n continue;\n }\n case Lua.OP_SELF:\n {\n var b4 = Lua.ARGB(i);\n rb = this._stack[this._base + b4];\n this._stack[this._base + a + 1].r = rb.r;\n this._stack[this._base + a + 1].d = rb.d;\n this._savedpc = pc; // Protect\n this.vmGettable(rb.asObject(), this.RK(k, Lua.ARGC(i)), this._stack[this._base + a]);\n continue;\n }\n case Lua.OP_ADD:\n rb = this.RK(k, Lua.ARGB(i));\n rc = this.RK(k, Lua.ARGC(i));\n if (rb.r == Lua.NUMBER && rc.r == Lua.NUMBER) {\n var sum = rb.d + rc.d;\n this._stack[this._base + a].d = sum;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (Lua.toNumberPair(rb, rc, Lua.NUMOP)) {\n var sum2 = Lua.NUMOP[0] + Lua.NUMOP[1];\n this._stack[this._base + a].d = sum2;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (!this.call_binTM(rb, rc, this._stack[this._base + a], \"__add\")) {\n this.gAritherror(rb, rc);\n }\n continue;\n case Lua.OP_SUB:\n rb = this.RK(k, Lua.ARGB(i));\n rc = this.RK(k, Lua.ARGC(i));\n if (rb.r == Lua.NUMBER && rc.r == Lua.NUMBER) {\n var difference = rb.d - rc.d;\n this._stack[this._base + a].d = difference;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (Lua.toNumberPair(rb, rc, Lua.NUMOP)) {\n var difference2 = Lua.NUMOP[0] - Lua.NUMOP[1];\n this._stack[this._base + a].d = difference2;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (!this.call_binTM(rb, rc, this._stack[this._base + a], \"__sub\")) {\n this.gAritherror(rb, rc);\n }\n continue;\n case Lua.OP_MUL:\n rb = this.RK(k, Lua.ARGB(i));\n rc = this.RK(k, Lua.ARGC(i));\n if (rb.r == Lua.NUMBER && rc.r == Lua.NUMBER) {\n var product = rb.d * rc.d;\n this._stack[this._base + a].d = product;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (Lua.toNumberPair(rb, rc, Lua.NUMOP)) {\n var product2 = Lua.NUMOP[0] * Lua.NUMOP[1];\n this._stack[this._base + a].d = product2;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (!this.call_binTM(rb, rc, this._stack[this._base + a], \"__mul\")) {\n this.gAritherror(rb, rc);\n }\n continue;\n case Lua.OP_DIV:\n rb = this.RK(k, Lua.ARGB(i));\n rc = this.RK(k, Lua.ARGC(i));\n if (rb.r == Lua.NUMBER && rc.r == Lua.NUMBER) {\n var quotient = rb.d / rc.d;\n this._stack[this._base + a].d = quotient;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (Lua.toNumberPair(rb, rc, Lua.NUMOP)) {\n var quotient2 = Lua.NUMOP[0] / Lua.NUMOP[1];\n this._stack[this._base + a].d = quotient2;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (!this.call_binTM(rb, rc, this._stack[this._base + a], \"__div\")) {\n this.gAritherror(rb, rc);\n }\n continue;\n case Lua.OP_MOD:\n rb = this.RK(k, Lua.ARGB(i));\n rc = this.RK(k, Lua.ARGC(i));\n if (rb.r == Lua.NUMBER && rc.r == Lua.NUMBER) {\n var modulus = Lua.__modulus(rb.d, rc.d);\n this._stack[this._base + a].d = modulus;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (Lua.toNumberPair(rb, rc, Lua.NUMOP)) {\n var modulus2 = Lua.__modulus(Lua.NUMOP[0], Lua.NUMOP[1]);\n this._stack[this._base + a].d = modulus2;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (!this.call_binTM(rb, rc, this._stack[this._base + a], \"__mod\")) {\n this.gAritherror(rb, rc);\n }\n continue;\n case Lua.OP_POW:\n rb = this.RK(k, Lua.ARGB(i));\n rc = this.RK(k, Lua.ARGC(i));\n if (rb.r == Lua.NUMBER && rc.r == Lua.NUMBER) {\n var result = Lua.iNumpow(rb.d, rc.d);\n this._stack[this._base + a].d = result;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (Lua.toNumberPair(rb, rc, Lua.NUMOP)) {\n var result2 = Lua.iNumpow(Lua.NUMOP[0], Lua.NUMOP[1]);\n this._stack[this._base + a].d = result2;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (!this.call_binTM(rb, rc, this._stack[this._base + a], \"__pow\")) {\n this.gAritherror(rb, rc);\n }\n continue;\n case Lua.OP_UNM:\n rb = this._stack[this._base + Lua.ARGB(i)];\n if (rb.r == Lua.NUMBER) {\n this._stack[this._base + a].d = -rb.d;\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (Lua.tonumber(rb, Lua.NUMOP)) {\n this._stack[this._base + a].d = -Lua.NUMOP[0];\n this._stack[this._base + a].r = Lua.NUMBER;\n }\n else if (!this.call_binTM(rb, rb, this._stack[this._base + a], \"__unm\")) {\n this.gAritherror(rb, rb);\n }\n continue;\n case Lua.OP_NOT:\n {\n // All numbers are treated as true, so no need to examine\n // the .d field.\n var ra = this._stack[this._base + Lua.ARGB(i)].r;\n this._stack[this._base + a].r = Lua.valueOfBoolean(this.isFalse(ra));\n continue;\n }\n case Lua.OP_LEN:\n rb = this._stack[this._base + Lua.ARGB(i)];\n if (rb.r instanceof LuaTable_1.LuaTable) {\n var t2 = rb.r;\n this._stack[this._base + a].d = t2.getn();\n this._stack[this._base + a].r = Lua.NUMBER;\n continue;\n }\n else if (rb.r instanceof String || typeof (rb.r) == 'string') {\n var s = rb.r;\n this._stack[this._base + a].d = s.length;\n this._stack[this._base + a].r = Lua.NUMBER;\n continue;\n }\n this._savedpc = pc; // Protect\n if (!this.call_binTM(rb, rb, this._stack[this._base + a], \"__len\")) {\n this.gTypeerror(rb, \"get length of\");\n }\n continue;\n case Lua.OP_CONCAT:\n {\n var b_CONCAT = Lua.ARGB(i);\n var c_CONCAT = Lua.ARGC(i);\n this._savedpc = pc; // Protect\n // :todo: The compiler assumes that all\n // stack locations _above_ b end up with junk in them. In\n // which case we can improve the speed of vmConcat (by not\n // converting each stack slot, but simply using\n // StringBuffer.append on whatever is there).\n this.vmConcat(c_CONCAT - b_CONCAT + 1, c_CONCAT);\n this._stack[this._base + a].r = this._stack[this._base + b_CONCAT].r;\n this._stack[this._base + a].d = this._stack[this._base + b_CONCAT].d;\n continue;\n }\n case Lua.OP_JMP:\n // dojump\n pc += Lua.ARGsBx(i);\n continue;\n case Lua.OP_EQ:\n rb = this.RK(k, Lua.ARGB(i));\n rc = this.RK(k, Lua.ARGC(i));\n if (this.vmEqual(rb, rc) == (a != 0)) {\n // dojump\n pc += Lua.ARGsBx(code[pc]);\n }\n ++pc;\n continue;\n case Lua.OP_LT:\n rb = this.RK(k, Lua.ARGB(i));\n rc = this.RK(k, Lua.ARGC(i));\n this._savedpc = pc; // Protect\n if (this.vmLessthan(rb, rc) == (a != 0)) {\n // dojump\n pc += Lua.ARGsBx(code[pc]);\n }\n ++pc;\n continue;\n case Lua.OP_LE:\n rb = this.RK(k, Lua.ARGB(i));\n rc = this.RK(k, Lua.ARGC(i));\n this._savedpc = pc; // Protect\n if (this.vmLessequal(rb, rc) == (a != 0)) {\n // dojump\n pc += Lua.ARGsBx(code[pc]);\n }\n ++pc;\n continue;\n case Lua.OP_TEST:\n if (this.isFalse(this._stack[this._base + a].r) != (Lua.ARGC(i) != 0)) {\n // dojump\n pc += Lua.ARGsBx(code[pc]);\n }\n ++pc;\n continue;\n case Lua.OP_TESTSET:\n rb = this._stack[this._base + Lua.ARGB(i)];\n if (this.isFalse(rb.r) != (Lua.ARGC(i) != 0)) {\n this._stack[this._base + a].r = rb.r;\n this._stack[this._base + a].d = rb.d;\n // dojump\n pc += Lua.ARGsBx(code[pc]);\n }\n ++pc;\n continue;\n case Lua.OP_CALL:\n {\n var b_CALL = Lua.ARGB(i);\n var nresults = Lua.ARGC(i) - 1;\n if (b_CALL != 0) //FIXME:bug: b->b_CALL\n {\n this.stacksetsize(this._base + a + b_CALL);\n }\n this._savedpc = pc;\n switch (this.vmPrecall(this._base + a, nresults)) {\n case Lua.PCRLUA:\n nexeccalls++;\n continue reentry;\n case Lua.PCRJ:\n // Was Java function called by precall, adjust result\n if (nresults >= 0) {\n this.stacksetsize(this.__ci().top);\n }\n continue;\n default:\n return; // yield\n }\n }\n case Lua.OP_TAILCALL:\n {\n var b_TAILCALL = Lua.ARGB(i);\n if (b_TAILCALL != 0) {\n this.stacksetsize(this._base + a + b_TAILCALL);\n }\n this._savedpc = pc;\n // assert ARGC(i) - 1 == MULTRET\n switch (this.vmPrecall(this._base + a, Lua.MULTRET)) {\n case Lua.PCRLUA:\n {\n // tail call: put new frame in place of previous one.\n var ci = this._civ.elementAt(this._civ.size - 2);\n var func = ci.func;\n var fci = this.__ci(); // Fresh CallInfo\n var pfunc = fci.func;\n this.fClose(ci.base);\n this._base = func + (fci.base - pfunc);\n var aux; // loop index is used after loop ends\n for (aux = 0; pfunc + aux < this._stackSize; ++aux) {\n // move frame down\n this._stack[func + aux].r = this._stack[pfunc + aux].r;\n this._stack[func + aux].d = this._stack[pfunc + aux].d;\n }\n this.stacksetsize(func + aux); // correct top\n // assert stackSize == base + ((LuaFunction)stack[func]).proto().maxstacksize();\n ci.tailcall(this._base, this._stackSize);\n this.dec_ci(); // remove new frame.\n continue reentry;\n }\n case Lua.PCRJ: // It was a Java function\n {\n continue;\n }\n default:\n {\n return; // yield\n }\n }\n }\n case Lua.OP_RETURN:\n {\n this.fClose(this._base);\n var b_RETURN = Lua.ARGB(i);\n if (b_RETURN != 0) {\n var top = a + b_RETURN - 1;\n this.stacksetsize(this._base + top);\n }\n this._savedpc = pc;\n // 'adjust' replaces aliased 'b' in PUC-Rio code.\n var adjust = this.vmPoscall(this._base + a);\n if (--nexeccalls == 0) {\n return;\n }\n if (adjust) {\n this.stacksetsize(this.__ci().top);\n }\n continue reentry;\n }\n case Lua.OP_FORLOOP:\n {\n var step = this._stack[this._base + a + 2].d;\n var idx = this._stack[this._base + a].d + step;\n var limit = this._stack[this._base + a + 1].d;\n if ((0 < step && idx <= limit) ||\n (step <= 0 && limit <= idx)) {\n // dojump\n pc += Lua.ARGsBx(i);\n this._stack[this._base + a].d = idx; // internal index\n this._stack[this._base + a].r = Lua.NUMBER;\n this._stack[this._base + a + 3].d = idx; // external index\n this._stack[this._base + a + 3].r = Lua.NUMBER;\n }\n continue;\n }\n case Lua.OP_FORPREP:\n {\n var init = this._base + a;\n var plimit = this._base + a + 1;\n var pstep = this._base + a + 2;\n this._savedpc = pc; // next steps may throw errors\n if (!this.tonumber(init)) {\n this.gRunerror(\"'for' initial value must be a number\");\n }\n else if (!this.tonumber(plimit)) {\n this.gRunerror(\"'for' limit must be a number\");\n }\n else if (!this.tonumber(pstep)) {\n this.gRunerror(\"'for' step must be a number\");\n }\n var step_FORPREP = this._stack[pstep].d;\n var idx_FORPREP = this._stack[init].d - step_FORPREP;\n this._stack[init].d = idx_FORPREP;\n this._stack[init].r = Lua.NUMBER;\n // dojump\n pc += Lua.ARGsBx(i);\n continue;\n }\n case Lua.OP_TFORLOOP:\n {\n var cb = this._base + a + 3; // call base\n this._stack[cb + 2].r = this._stack[this._base + a + 2].r;\n this._stack[cb + 2].d = this._stack[this._base + a + 2].d;\n this._stack[cb + 1].r = this._stack[this._base + a + 1].r;\n this._stack[cb + 1].d = this._stack[this._base + a + 1].d;\n this._stack[cb].r = this._stack[this._base + a].r;\n this._stack[cb].d = this._stack[this._base + a].d;\n this.stacksetsize(cb + 3);\n this._savedpc = pc; // Protect\n this.vmCall(cb, Lua.ARGC(i));\n this.stacksetsize(this.__ci().top);\n if (Lua.NIL != this._stack[cb].r) // continue loop\n {\n this._stack[cb - 1].r = this._stack[cb].r;\n this._stack[cb - 1].d = this._stack[cb].d;\n // dojump\n pc += Lua.ARGsBx(code[pc]);\n }\n ++pc;\n continue;\n }\n case Lua.OP_SETLIST:\n {\n var n = Lua.ARGB(i);\n var c_SETLIST = Lua.ARGC(i);\n var setstack = false;\n if (0 == n) {\n n = (this._stackSize - (this._base + a)) - 1;\n setstack = true;\n }\n if (0 == c_SETLIST) {\n c_SETLIST = code[pc++];\n }\n var t3 = this._stack[this._base + a].r;\n var last = ((c_SETLIST - 1) * Lua.LFIELDS_PER_FLUSH) + n;\n // :todo: consider expanding space in table\n for (; n > 0; n--) {\n var val = this.objectAt(this._base + a + n);\n t3.putnum(last--, val);\n }\n if (setstack) {\n this.stacksetsize(this.__ci().top);\n }\n continue;\n }\n case Lua.OP_CLOSE:\n this.fClose(this._base + a);\n continue;\n case Lua.OP_CLOSURE:\n {\n var p = _function.proto.proto[Lua.ARGBx(i)];\n var nup = p.nups;\n var up = new Array(nup); //UpVal[] \n for (var j = 0; j < nup; j++, pc++) {\n var _in = code[pc];\n if (Lua.OPCODE(_in) == Lua.OP_GETUPVAL) {\n up[j] = _function.upVal(Lua.ARGB(_in));\n }\n else {\n // assert OPCODE(in) == OP_MOVE;\n up[j] = this.fFindupval(this._base + Lua.ARGB(_in));\n }\n }\n var nf = new LuaFunction_1.LuaFunction(p, up, _function.env);\n //up = null;\n this._stack[this._base + a].r = nf;\n continue;\n }\n case Lua.OP_VARARG:\n {\n var b_VARARG = Lua.ARGB(i) - 1;\n var n_VARARG = (this._base - this.__ci().func) -\n _function.proto.numparams - 1;\n if (b_VARARG == Lua.MULTRET) {\n // :todo: Protect\n // :todo: check stack\n b_VARARG = n_VARARG;\n this.stacksetsize(this._base + a + n_VARARG);\n }\n for (var j_VARARG = 0; j_VARARG < b_VARARG; ++j_VARARG) {\n if (j_VARARG < n_VARARG) {\n var src = this._stack[this._base - n_VARARG + j_VARARG];\n this._stack[this._base + a + j_VARARG].r = src.r;\n this._stack[this._base + a + j_VARARG].d = src.d;\n }\n else {\n this._stack[this._base + a + j_VARARG].r = Lua.NIL;\n }\n }\n continue;\n }\n } /* switch */\n } /* while */\n } /* reentry: while */\n }", "title": "" }, { "docid": "9d578081b530ef9e785d99b15eb212fa", "score": "0.5902723", "text": "async function v26(v27,v28) {\n const v29 = (v30,v31,v32) => {\n };\n const v34 = 3;\n // v34 = .integer\n let v35 = 0;\n const v36 = v35 + 1;\n // v36 = .primitive\n v35 = v36;\n for (const v37 in v28) {\n const v39 = [3474686002];\n // v39 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"toString\", \"indexOf\", \"unshift\", \"shift\", \"concat\", \"sort\", \"reduceRight\", \"flatMap\", \"forEach\", \"entries\", \"every\", \"values\", \"push\", \"find\", \"fill\", \"toLocaleString\", \"join\", \"filter\", \"pop\", \"reverse\", \"some\", \"reduce\", \"splice\", \"includes\", \"lastIndexOf\", \"findIndex\", \"flat\", \"map\", \"slice\", \"keys\", \"copyWithin\"])\n const v40 = 129;\n // v40 = .integer\n }\n const v41 = 1337;\n // v41 = .integer\n const v43 = 3;\n // v43 = .integer\n let v44 = 0;\n const v45 = v44 + 1;\n // v45 = .primitive\n v44 = v45;\n const v48 = BigInt(2361875206);\n // v48 = .bigint\n const v49 = -2 % 1337;\n // v49 = .integer | .float | .bigint\n const v50 = arguments;\n // v50 = .object()\n const v51 = v48 * v48;\n // v51 = .integer | .float | .bigint\n async function v52(v53,v54) {\n const v55 = {get:v52};\n // v55 = .object(ofGroup: Object, withProperties: [\"__proto__\"], withMethods: [\"get\"])\n }\n function v56(v57,v58) {\n return v44;\n }\n const v59 = 0;\n // v59 = .integer\n let v61 = 0;\n const v62 = v61 + 1;\n // v62 = .primitive\n const v63 = 100;\n // v63 = .integer\n const v64 = 1;\n // v64 = .integer\n const v65 = gc;\n // v65 = .function([] => .undefined)\n const v66 = 0;\n // v66 = .integer\n const v67 = 100;\n // v67 = .integer\n const v68 = 1;\n // v68 = .integer\n v28.length = 0;\n const v69 = Object;\n // v69 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"freeze\", \"getOwnPropertyDescriptors\", \"isFrozen\", \"isExtensible\", \"keys\", \"entries\", \"is\", \"getOwnPropertyDescriptor\", \"getOwnPropertySymbols\", \"assign\", \"create\", \"fromEntries\", \"isSealed\", \"setPrototypeOf\", \"getOwnPropertyNames\", \"defineProperty\", \"values\", \"getPrototypeOf\", \"defineProperties\", \"preventExtensions\", \"seal\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v70 = 0;\n // v70 = .integer\n const v71 = 100;\n // v71 = .integer\n const v72 = 1;\n // v72 = .integer\n}", "title": "" }, { "docid": "e2c8b243ebaabc0f8bf4ba72b17a03a3", "score": "0.58405626", "text": "function evalFunctionInVm(func, emit) {\n return function (arg1, arg2, arg3) {\n var code = '(function() {\"use strict\";' +\n 'var createBuiltInError = ' + createBuiltInErrorInVm.toString() + ';' +\n 'var sum = ' + sum.toString() + ';' +\n 'var log = function () {};' +\n 'var isArray = Array.isArray;' +\n 'var toJSON = JSON.parse;' +\n 'var __emitteds__ = [];' +\n 'var emit = function (key, value) {__emitteds__.push([key, value]);};' +\n 'var __result__ = (' +\n func.replace(/;\\s*$/, '') + ')' + '(' +\n JSON.stringify(arg1) + ',' +\n JSON.stringify(arg2) + ',' +\n JSON.stringify(arg3) + ');' +\n 'return {result: __result__, emitteds: __emitteds__};' +\n '})()';\n\n var output = vm.runInNewContext(code);\n\n output.emitteds.forEach(function (emitted) {\n emit(emitted[0], emitted[1]);\n });\n if (isBuiltInError(output.result)) {\n output.result = convertToTrueError(output.result);\n }\n return output.result;\n };\n}", "title": "" }, { "docid": "f254c5ed74d69ec5db4cf83e4629bcb3", "score": "0.5827783", "text": "function main() {\n function f0() {\n try {\n var v0 = 0;\n } catch (v3) { }\n try {\n var v1 = new Array(23);\n } catch (v4) { }\n try {\n for (; v0 < v1.length; v0++) {\n v1[v0] = new Uint32Array(262142);\n v1[v0] = new Uint32Array(262139);\n v1[v0] = new Uint32Array(262139);\n }\n } catch (v5) { }\n v0 = -13;\n try {\n var v2 = [];\n } catch (v6) { }\n try {\n var v1 = new Array(23);\n } catch (v7) { }\n try {\n v2.xxx = \"xxx\";\n } catch (e) { }\n try {\n for (var v0 = 0; v0 < 1024; v0++) {\n v2[v0] = new Array(v0);\n v2[v0] = new Array(v0);\n v2[v0] = new Array(v0);\n v2[v0].xxx = \"xxx \" + v0;\n v2[v0].xxx = \"xxx \" + v0;\n v2[v0].xxx = \"xxx \" + v0;\n }\n } catch (v8) { }\n try {\n gc();\n a(900000)[b(b(900000), 900000)] = 900000;\n } catch (v9) { }\n }\n gc();\n f0();\n}", "title": "" }, { "docid": "5478ab514b06756b77766f007f0cd0e9", "score": "0.58186096", "text": "function Module() {\n \"use asm\";\n\n function w0(a) {\n a = a | 0;\n if (a) while (1);\n return 42;\n }\n\n function w1(a) {\n a = a | 0;\n while (1) return 42;\n return 106;\n }\n\n function d0(a) {\n a = a | 0;\n if (a) do ; while(1);\n return 42;\n }\n\n function d1(a) {\n a = a | 0;\n do return 42; while(1);\n return 107;\n }\n\n function f0(a) {\n a = a | 0;\n if (a) for (;;) ;\n return 42;\n }\n\n function f1(a) {\n a = a | 0;\n for(;;) return 42;\n return 108;\n }\n\n return { w0: w0, w1: w1, d0: d0, d1: d1, f0: f0, f1: f1 };\n}", "title": "" }, { "docid": "3fcfe9c76c81a71262c933f77c57f50a", "score": "0.5817598", "text": "function asm() {\n \"use asm\";\n function f(a) {\n a = a | 0;\n while (1) return 1;\n return 0;\n }\n return { f: f};\n}", "title": "" }, { "docid": "07358ff56b831ed8e410fb438ce77a10", "score": "0.5808641", "text": "function convert_routine_to_js(zmach, rname, locals, code, pauseable, is_cont) {\n var local_variables = new Set;\n function variable(v) {\n switch (v[0]) {\n case \"local\":\n return \"arg_\" + v[1];\n case \"global\":\n return \"e.getGlobal(\" + v[1] + \")\";\n case \"var\":\n local_variables.add(v[1]);\n return v[1];\n default:\n throw new Error(v[0]);\n }\n }\n function setVariable(v, val) {\n switch (v[0]) {\n case \"local\":\n return \"arg_\" + v[1] + \" = \" + val;\n case \"global\":\n return \"e.setGlobal(\" + v[1] + \", \" + val + \")\";\n case \"var\":\n local_variables.add(v[1]);\n return v[1] + \" = \" + val;\n default:\n throw new Error(v[0]);\n }\n }\n function convert_seq(codes, cb) {\n for (var i = 0; i < codes.length; i++) {\n convert_statement(codes[i], cb);\n }\n }\n function convert_statement(code, cb) {\n switch(code[0]) {\n case \"block\":\n if (code[1] !== null) {\n cb.indent(code[1] + \": {\");\n }\n convert_seq(code[2], cb);\n if (code[1] !== null) {\n cb.dedent(\"}\");\n }\n break;\n case \"switch\":\n if (code[1]) {\n cb.add(code[1] + \":\");\n }\n cb.add(\"switch (\" + convert_expr(code[2]) + \") {\");\n code[3].forEach(function (entry) {\n entry[0].forEach(function (addr) {\n cb.add(\"case \" + addr + \":\");\n });\n cb.indent();\n convert_seq(entry[1], cb);\n cb.add(\"break;\");\n cb.dedent();\n });\n cb.add(\"}\");\n break;\n case \"loop\":\n if (code[1]) {\n cb.add(code[1] + \":\");\n }\n cb.indent(\"while (true) {\");\n convert_seq(code[2], cb);\n cb.dedent(\"}\");\n break;\n case \"if\":\n function check_only_if(cons) {\n if (cons.length === 1 && cons[0][0] === \"if\") return cons[0];\n else if (cons.length === 2 && cons[0][0] === \"comment\" && cons[1][0] === \"if\") return cons[1];\n else return null;\n }\n cb.indent(\"if (\" + convert_expr(code[1]) + \") {\");\n convert_seq(code[2], cb);\n var alt = check_only_if(code[3]);\n while (alt) {\n code = alt;\n cb.dedent();\n cb.indent(\"} else if (\" + convert_expr(code[1]) + \") {\");\n convert_seq(code[2], cb);\n alt = check_only_if(code[3]);\n }\n if (code[3].length === 0) {\n cb.dedent(\"}\");\n } else {\n cb.dedent();\n cb.indent(\"} else {\");\n convert_seq(code[3], cb);\n cb.dedent(\"}\");\n }\n break;\n case \"break\":\n if (code[1] !== null) {\n cb.add(\"break \" + code[1] + \";\");\n } else {\n cb.add(\"break;\");\n }\n break;\n case \"continue\":\n if (code[1] !== null) {\n cb.add(\"continue \" + code[1] + \";\");\n } else {\n cb.add(\"continue;\");\n }\n break;\n case \"return\":\n cb.add(\"return \" + convert_expr(code[1]) + \";\");\n break;\n case \"quit\":\n cb.add(\"e.abort();\");\n break;\n case \"cont\":\n var routine = zmach.routines.get(code[3][1]);\n if (code[3][0] === \"call\" && routine && !routine.pauseable) {\n // TODO move this to separate optimization pass\n if (code[2] === null) {\n cb.add(convert_expr(code[3]) + \";\");\n } else {\n cb.add(setVariable(code[2], convert_expr(code[3])) + \";\");\n }\n break;\n }\n local_variables.add(\"__cont__\");\n if (code[2] === null) {\n cb.add(\"__cont__ = \" + code[1] + \"<<9|0<<8|0;\");\n cb.add(convert_expr(code[3]) + \";\");\n } else {\n var varnum;\n if (code[2][0] === \"local\") varnum = code[2][1] + 1;\n else if (code[2][0] === \"global\") varnum = code[2][1] + 16;\n else throw new Error;\n\n cb.add(\"__cont__ = \" + code[1] + \"<<9|0<<8|\"+varnum+\";\");\n cb.add(setVariable(code[2], convert_expr(code[3])) + \";\");\n }\n break;\n case \"contstack\":\n local_variables.add(\"__cont__\");\n cb.add(\"__cont__ = \" + code[1] + \"<<9|1<<8|0;\");\n if (code[2] === null) {\n local_variables.add(\"__stack__\");\n cb.add(\"__stack__.push(\" + convert_expr(code[3]) + \");\");\n } else {\n cb.add(setVariable(code[2], convert_expr(code[3])) + \";\");\n }\n break;\n case \"push\":\n local_variables.add(\"__stack__\");\n cb.add(\"__stack__.push(\" + convert_expr(code[1]) + \");\");\n break;\n case \"pop\":\n local_variables.add(\"__stack__\");\n cb.add(setVariable(code[1], \"__stack__.pop()\") + \";\");\n break;\n case \"set\":\n cb.add(setVariable(code[1], convert_expr(code[2])) + \";\");\n break;\n case \"get_var\":\n local_variables.add(\"__stack__\");\n var tmp = gensym();\n cb.add(setVariable([\"var\", tmp], convert_expr(code[2])) + \";\");\n cb.add(\"switch (\"+tmp+\") {\");\n cb.indent(\"case 0:\"); {\n cb.add(setVariable(code[1], \"__stack__[__stack__.length-1]\") + \";\");\n cb.add(\"break;\");\n cb.dedent(); }\n for (var i = 0; i < locals; i++) {\n cb.indent(\"case \"+(i+1)+\":\"); {\n cb.add(setVariable(code[1], variable([\"local\", i])) + \";\");\n cb.add(\"break;\");\n cb.dedent(); }\n }\n if (i < 15) {\n for (; i < 15; i++) {\n cb.add(\"case \"+(i+1)+\":\");\n }\n cb.indent();\n cb.add(\"throw new Error('invalid get_var',\"+tmp+\");\");\n cb.dedent();\n }\n cb.indent(\"default:\"); {\n cb.add(setVariable(code[1], \"e.getGlobal(\"+tmp+\" - 16)\")+\";\");\n cb.dedent(); }\n cb.add(\"}\");\n break;\n case \"ignore\":\n cb.add(convert_expr(code[1]) + \";\");\n break;\n case \"comment\":\n// cb.add(\"// $\" + hexWord(code[1]));\n break;\n case \"restart\":\n cb.add(\"throw new Error('Game wants to restart');\");\n break;\n default:\n throw new Error(code[0]);\n }\n }\n function convert_expr(_code) {\n var litprec = 20;\n var stack = [];\n var vstack = [];\n stack.push({code:_code, i:0});\n while (stack.length > 0) {\n var state = stack.pop();\n if (optable.has(state.code[0])) {\n if (1 + state.i < state.code.length) {\n stack.push({code:state.code, i:state.i+1});\n stack.push({code:state.code[state.i+1], i:0});\n } else {\n var op = optable.get(state.code[0]);\n var args = vstack.splice(-state.code.length+1,state.code.length-1);\n vstack.push(op.f.apply(null, [op].concat(args)));\n }\n continue;\n }\n switch (state.code[0]) {\n case \"lit\":\n vstack.push({js:\"\"+state.code[1], prec:litprec});\n break;\n case \"string\":\n vstack.push({js:\"/* \" + JSON.stringify(state.code[2]) + \" */ \" + state.code[1],\n prec:litprec});\n break;\n case \"global\":\n case \"local\":\n case \"var\":\n vstack.push({js:variable(state.code), prec:litprec});\n break;\n case \"peek\":\n local_variables.add(\"__stack__\");\n vstack.push({js:\"__stack__[__stack__.length-1]\", prec:litprec});\n break;\n case \"call\":\n var numargs = state.code.length-2;\n if (state.i<numargs) {\n stack.push({code:state.code, i:state.i+1});\n stack.push({code:state.code[state.i+2], i:0});\n break;\n } else {\n var args = vstack.splice(-numargs,numargs);\n vstack.push({js:\"e.r$\"+hexWord(state.code[1])+\"(\"+op_join_comma(args)+\")\",\n prec:17});\n break;\n }\n case \"indcall\":\n var numargs = state.code.length-1;\n if (state.i<numargs) {\n stack.push({code:state.code, i:state.i+1});\n stack.push({code:state.code[state.i+1], i:0});\n break;\n } else {\n var args = vstack.splice(-numargs,numargs);\n vstack.push({js:\"e.pindcall(\"+op_join_comma(args)+\")\",\n prec:17});\n break;\n }\n case \"extern\":\n var numargs = state.code.length-2;\n if (state.i<numargs) {\n stack.push({code:state.code, i:state.i+1});\n stack.push({code:state.code[state.i+2], i:0});\n break;\n } else {\n var args = vstack.splice(-numargs,numargs);\n vstack.push({js:\"e.\"+state.code[1]+\"(\"+op_join_comma(args)+\")\",\n prec:17});\n break;\n }\n case \"resumeframe\":\n vstack.push({js:\"__frame__.child === null ? (() => {/*debugger;*/ return __contval__;})() : e.resume(__frame__.child, __contval__)\",\n prec:4});\n break;\n default:\n debugger;\n throw new Error(state.code[0]);\n }\n }\n if (vstack.length !== 1) throw new Error;\n return vstack[0].js;\n }\n\n var arglist = [];\n for (var i = 0; i < locals; i++) {\n arglist.push(\"arg_\" + i);\n }\n\n var cb = new CodeBuilder();\n // deferring function header and local variable definitions\n cb.indent();\n if (pauseable) {\n cb.indent(\"try {\");\n }\n convert_statement(code, cb);\n if (pauseable) {\n/* if (!local_variables.has(\"__cont__\")) {\n throw new Error;\n }*/\n cb.dedent();\n cb.indent(\"} catch (x) {\");\n cb.indent(\"if (x instanceof PauseException) {\");\n var localsarg = '['+arglist.join(',')+']';\n var stackarg = local_variables.has(\"__stack__\")?\"Array.from(__stack__)\":\"[]\";\n local_variables.add(\"__numargs__\");\n var makeframe = \"new CallFrame(__numargs__, \"+localsarg+\", \"+stackarg+\", __cont__, x.frame)\";\n cb.add(\"throw new PauseException(x.action, x.args, \"+makeframe+\");\");\n cb.dedent();\n cb.indent(\"} else {\");\n cb.add(\"console.error(__cont__);\");\n cb.add(\"throw x;\");\n cb.dedent(\"}\");\n cb.dedent(\"}\");\n }\n cb.add(\"throw new Error('fell off end of routine');\");\n cb.dedent(\"}\");\n\n var vardefs = \"\";\n if (local_variables.size > 0) {\n var varstrings = Array.from(local_variables);\n varstrings.sort();\n vardefs += \" var \" + varstrings.join(\", \") + \";\\n\";\n }\n if (local_variables.has(\"__numargs__\")) {\n if (is_cont) {\n vardefs += \" __numargs__ = __frame__.numargs;\\n\";\n } else {\n vardefs += \" __numargs__ = arguments.length;\\n\";\n }\n }\n if (local_variables.has(\"__stack__\")) {\n if (is_cont) {\n vardefs += \" __stack__ = __frame__.stack.slice();\\n\";\n } else {\n vardefs += \" __stack__ = [];\\n\";\n }\n }\n\n if (is_cont) {\n for (var i = 0; i < arglist.length; i++) {\n vardefs += \" var \"+arglist[i]+\" = __frame__.locals[\"+i+\"];\\n\";\n }\n } else {\n if (locals > 0) {\n vardefs += \" \" + arglist.slice(0,8).map(function (v) { return v+\" |= 0;\"; }).join(\" \") + \"\\n\";\n if (locals > 8) {\n vardefs += \" \" + arglist.slice(8).map(function (v) { return v+\" |= 0;\"; }).join(\" \") + \"\\n\";\n }\n }\n }\n //vardefs = \"console.log('trace \"+rname+\"');\\n\"+vardefs;\n\n var arglist2 = arglist;\n if (is_cont) {\n arglist2 = [\"__frame__\", \"__contval__\"];\n }\n\n return (\"function \" + rname + \"(\" + arglist2.join(\", \") + \") {\\n\"\n +\" \\\"use strict\\\";\\n\"\n + vardefs + cb.toString());\n}", "title": "" }, { "docid": "74583eab4704cf1360bb37356c8da004", "score": "0.57692873", "text": "function warmupInlineFunctions() {\n let returnValue = 0;\n for (let i = 0; i < 1e4; ++i) {\n returnValue += inlinedCompareToNull(\"foo\");\n returnValue += inlinedCompareToNull(null);\n returnValue += inlinedCompareToNull(Math);\n returnValue += inlinedCompareToNull(5);\n returnValue += inlinedCompareToNull(5.5);\n\n returnValue += inlinedComparedToUndefined(\"foo\");\n returnValue += inlinedComparedToUndefined(null);\n returnValue += inlinedComparedToUndefined(Math);\n returnValue += inlinedComparedToUndefined(5);\n returnValue += inlinedComparedToUndefined(5.5);\n }\n return returnValue;\n}", "title": "" }, { "docid": "36b9e144d3302e5bfb906e031c7a9a56", "score": "0.57320076", "text": "function v23(v24,v25) {\n const v28 = 10;\n // v28 = .integer\n let v29 = 0;\n const v30 = v29 + 1;\n // v30 = .primitive\n v29 = v30;\n function v31(v32,v33) {\n const v38 = [13.37,13.37,Int16Array,13.37];\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 v40 = [1337,1337,1337,1337,1337];\n // v40 = .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 v41 = [v40,isNaN,v38,v40,1337,isNaN,\"5BurUlYPg9\"];\n // v41 = .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 v42(v43) {\n function v44(v45,v46) {\n function v47(v48,v49) {\n for (let v53 = -1024; v53 < 100; v53 = v53 + 1) {\n v40.__proto__ = v43;\n const v54 = 0;\n // v54 = .integer\n const v55 = 1337;\n // v55 = .integer\n function v56(v57,v58) {\n const v59 = v56.__proto__;\n // v59 = .unknown\n }\n const v60 = 0;\n // v60 = .integer\n const v61 = 100;\n // v61 = .integer\n const v62 = 1;\n // v62 = .integer\n }\n for (const v63 of v43) {\n v5.valueOf = v48;\n let v64 = \"128\";\n v64 = v4;\n }\n }\n const v66 = new Promise(v47);\n // v66 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n }\n const v68 = new Promise(v44);\n // v68 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n }\n let v71 = 13.37;\n function v72(v73,v74) {\n function v75(v76,v77) {\n const v79 = [v73,108978604,108978604,108978604];\n // v79 = .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 v80 = v41.findIndex(v42,v79);\n // v80 = .integer\n }\n const v81 = v75(v75,v71);\n // v81 = .unknown\n }\n const v82 = v72(v72,Function);\n // v82 = .unknown\n }\n const v84 = new Promise(v31);\n // v84 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n}", "title": "" }, { "docid": "5d0185e7f42abfb148ca7fecef19df54", "score": "0.56962496", "text": "function Module() {\n \"use asm\";\n\n function if0() {\n var x = 0;\n x = 0 ? 11 : 12;\n return ((x | 0) == 11) | 0;\n }\n\n function if1() {\n var x = 0;\n x = 1 ? 13 : 14;\n return ((x | 0) == 13) | 0;\n }\n\n function if2() {\n var x = 0;\n x = 0 ? 15 : 16;\n return ((x | 0) != 15) | 0;\n }\n\n function if3() {\n var x = 0;\n x = 1 ? 17 : 18;\n return ((x | 0) != 17) | 0;\n }\n\n function if4() {\n var x = 0;\n var y = 0;\n x = 0 ? 19 : 20;\n y = ((x | 0) == 19) ? 21 : 22;\n return y | 0;\n }\n\n function if5() {\n var x = 0;\n var y = 0;\n x = 1 ? 23 : 24;\n y = ((x | 0) == 23) ? 25 : 26;\n return y | 0;\n }\n\n function if6() {\n var x = 0;\n var y = 0;\n var z = 0;\n x = 0 ? 27 : 28;\n y = ((x | 0) == 27) ? 29 : 30;\n z = ((y | 0) == 29) ? 31 : 32;\n return z | 0;\n }\n\n function if7() {\n var x = 0;\n var y = 0;\n var z = 0;\n var w = 0;\n x = 1 ? 33 : 34;\n y = ((x | 0) == 33) ? 35 : 36;\n z = ((y | 0) == 35) ? 37 : 38;\n w = ((z | 0) == 37) ? 39 : 40;\n return w | 0;\n }\n\n function if8() {\n var w = 0;\n var x = 0;\n var y = 0;\n var z = 0;\n if (0) {\n x = 0 ? 43 : 44;\n y = ((x | 0) == 43) ? 45 : 46;\n z = ((y | 0) == 45) ? 47 : 48;\n w = ((z | 0) == 47) ? 49 : 50;\n } else {\n x = 1 ? 53 : 54;\n y = ((x | 0) == 53) ? 55 : 56;\n z = ((y | 0) == 55) ? 57 : 58;\n w = ((z | 0) == 57) ? 59 : 60;\n }\n return w | 0;\n }\n\n return {if0: if0, if1: if1, if2: if2, if3: if3, if4: if4, if5: if5, if6: if6, if7: if7, if8: if8 };\n}", "title": "" }, { "docid": "a786c20a834aaf5b9204d975f6757b66", "score": "0.56683517", "text": "function v37(v38,v39) {\n function v41(v42,v43) {\n const v46 = Symbol.match;\n // v46 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n const v47 = (100).toLocaleString();\n // v47 = .unknown\n let v48 = v17;\n v48 = v46;\n const v49 = v47.split(v48);\n // v49 = .unknown\n const v50 = 0;\n // v50 = .integer\n const v51 = 5;\n // v51 = .integer\n const v52 = 1;\n // v52 = .integer\n const v53 = 0;\n // v53 = .integer\n const v54 = 8;\n // v54 = .integer\n const v55 = 1;\n // v55 = .integer\n }\n const v57 = new Promise(v41);\n // v57 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n const v58 = 0;\n // v58 = .integer\n const v59 = 8;\n // v59 = .integer\n const v60 = 1;\n // v60 = .integer\n const v62 = \"unicode\".padStart(-65536,v37);\n // v62 = .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 v63 = Function(v62);\n // v63 = .unknown\n const v64 = 785494185n;\n // v64 = .bigint\n with (v62) {\n const v65 = EPSILON;\n // v65 = .unknown\n }\n function v69(v70,v71) {\n for (let v74 = -2.2250738585072014e-308; v74 < 100; v74 = v74 + 1) {\n const v75 = 1 ^ v74;\n // v75 = .integer | .bigint\n const v76 = 1 % v75;\n // v76 = .integer | .float | .bigint\n const v77 = 0;\n // v77 = .integer\n const v78 = 16;\n // v78 = .integer\n const v79 = 1;\n // v79 = .integer\n const v80 = 0;\n // v80 = .integer\n const v81 = 100;\n // v81 = .integer\n const v82 = 1;\n // v82 = .integer\n for (let v87 = 0; v87 < 100; v87 = v87 + 1) {\n const v88 = \"toStringTag\";\n // v88 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n }\n const v89 = [63455.09052841901,63455.09052841901,63455.09052841901,\"0jb3mmw5pG\"];\n // v89 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n }\n return v17;\n }\n const v90 = v69(undefined,undefined);\n // v90 = .unknown\n return 1337;\n }", "title": "" }, { "docid": "0981d0a59df4d90e52c1361a662d18ff", "score": "0.5627004", "text": "function $() {\n var id_0 = $.SIMD.id_1;\n var id_1 = id_2.check;\n var id_3 = id_4;\n var id_5 = id_6.id_7;\n var id_7 = id_8.id_9;\n var id_9 = id_10;\n var id_11 = id_12;\n var id_13 = id_14;\n var id_15 = id_16;\n var id_17 = id_18;\n var id_19 = id_20;\n var id_21 = id_22;\n var id_23 = id_24;\n var id_25 = id_26;\n var id_27 = id_28;\n var id_29 = id_30.and;\n var id_31 = id_32.or;\n var id_33 = id_34.xor;\n var id_35 = id_36.not;\n var id_37 = id_38;\n var id_39 = id_40;\n var id_41 = id_42.id_43;\n var id_43 = id_44.id_45;\n var id_45 = id_46.store\n var id_47 = id_48.id_49;\n var id_49 = id_50.id_51;\n var id_56 = id_57.splat;\n var id_58 = id_59;\n var id_60 = id_61.id_62;\n var id_62 = id_63.abs;\n var id_64 = id_65.neg;\n var id_66 = id_67.add;\n var id_68 = id_69.sub;\n var id_70 = id_71.mul;\n var id_72 = id_73.div;\n var id_74 = id_75.min;\n var id_76 = id_77.max;\n var id_78 = id_79.sqrt;\n var id_80 = id_81.id_82;\n var id_82 = id_83.shuffle;\n var id_84 = id_85.lessThan;\n var id_86 = id_87.lessThanOrEqual;\n var id_88 = id_89.equal;\n var id_90 = id_91.notEqual;\n var id_92 = id_93.greaterThan;\n var id_94 = id_95.greaterThanOrEqual;\n var id_96 = id_97.select;\n var id_98 = id_99.load;\n var id_100 = id_101.id_102;\n var id_102 = id_103.id_104;\n var $ = id_105.id_106;\n var id_106 = id_107;\n var id_108 = id_109.id_110;\n var id_110 = id_111;\n var id_112 = id_113;\n var fround = stdlib.Math.fround;\n var id_114 = id_115(imports.asmModule);\n var id_116 = id_117;\n var id_118 = id_119(5033.2, 3401.0, 665.34, 32234.1);\n var id_120 = id_121(1065353216, 1073741824, 1077936128, 1082130432);\n var gval = 1234;\n var id_126 = $.id_127;\n var id_127 = $.$;\n\n function id_165() {\n value = id_166;\n id_167(id_168)\n }\n\n function id_169() {\n return id_170(id_171)\n }\n\n function id_172() {\n $ = id_173;\n id_174(id_175)\n }\n\n function id_176() {\n return id_177(id_178)\n }\n\n function id_179() {\n $ = id_180;\n id_181(id_182)\n }\n\n function id_183() {\n return id_184(id_185)\n }\n\n function id_186() {\n $ = id_187;\n id_188(id_189)\n }\n\n function id_190() {}\n\n function id_193() {\n $ = id_194;\n id_195(id_196)\n }\n\n function $() {}\n\n function id_200() {\n id_201(id_202, id_203);\n return id_204(id_205)\n }\n\n function id_206() {\n var $ = id_208;\n while ($) {\n id_209 = id_210;\n for (;;) {\n switch ($) {\n case $:\n id_211(id_212, id_213);\n case $:\n id_214(id_215, id_216);\n case $:\n id_217(id_218, id_219);\n case $:\n id_220(id_221, id_222)\n }\n id_223 = id_224(id_225, id_226)\n }\n\n }\n\n return id_227(id_228)\n }\n\n function id_229() {\n var $ = id_231;\n for (;;) {\n id_232 = id_233;\n for (;;) {\n switch ($) {\n case $:\n id_234(id_235, id_236);\n case $:\n id_237(id_238, id_239);\n case $:\n id_240(id_241, id_242);\n case $:\n id_243(id_244, id_245)\n }\n id_246 = id_247(id_248, id_249)\n }\n\n }\n\n return id_250(id_251)\n }\n\n function id_252() {\n var $ = id_254;\n do {\n id_255 = id_256;\n for (;;) {\n switch ($) {\n case $:\n id_257(id_258, id_259);\n case $:\n id_260(id_261, id_262);\n case $:\n id_263(id_264, id_265);\n case $:\n id_266(id_267, id_268)\n }\n id_269 = id_270(id_271, id_272)\n }\n\n }\n while ($) return id_273(id_274)\n }\n\n function id_275() {\n var $ = id_277;\n while ($) {\n id_278 = id_279;\n for (;;) {\n id_280(id_281, id_282);\n id_283 = id_284(id_285, id_286)\n }\n\n }\n\n return id_287(id_288)\n }\n\n function id_289() {\n var $ = id_291;\n while ($) {\n id_292 = id_293;\n for (;;) {\n id_294(id_295, id_296);\n id_297 = id_298(id_299, id_300)\n }\n\n }\n\n return id_301(id_302)\n }\n\n function id_303() {\n var $ = id_305;\n while ((loopIndex) < (loopCOUNT)) {\n id_306 = id_307;\n for (;;) {\n id_308(id_309, id_310);\n id_311 = id_312(id_313, id_314)\n }\n\n }\n\n return id_315(id_316)\n }\n\n function id_317() {\n var $ = id_319;\n while ($) {\n id_320 = id_321;\n for (;;) {\n id_322(id_323, id_324);\n id_325 = id_326(id_327, id_328)\n }\n\n }\n\n return id_329(id_330)\n }\n\n function id_331() {\n var $ = id_333;\n while ($) {\n id_334 = id_335;\n for (;;) {\n id_336(id_337, id_338);\n id_339 = id_340(id_341, id_342)\n }\n\n }\n\n return id_343(id_344)\n }\n\n function id_345() {\n var $ = id_347;\n while ($) {\n id_348 = id_349;\n for (;;) {\n id_350(id_351, id_352);\n id_353 = id_354(id_355, id_356)\n }\n\n }\n\n return id_357(id_358)\n }\n\n function id_359() {\n var $ = id_360;\n while ($) {\n for (;;) {\n switch (functionPicker) {\n case $:\n v = id_361(id_362);\n case $:\n $ = id_363(id_364);\n case $:\n $ = id_365(id_366);\n case $:\n $ = id_367(id_368, idx)\n }\n }\n\n }\n\n }\n\n function id_369() {\n var $ = id_370;\n for (;;) {\n for (;;) {\n switch ($) {\n case $:\n $ = id_371(id_372);\n case $:\n $ = id_373(id_374);\n case $:\n $ = id_375(id_376);\n case $:\n $ = id_377(id_378)\n }\n }\n\n }\n\n }\n\n function id_379() {\n var $ = id_380;\n do {\n for (;;) {\n switch ($) {\n case $:\n $ = id_381(id_382);\n case $:\n $ = id_383(id_384);\n case $:\n $ = id_385(id_386);\n case $:\n $ = id_387(id_388)\n }\n }\n\n }\n while ($)\n }\n\n function id_389() {\n var $ = id_390;\n while ($) {\n for (;;) {\n $ = id_391(id_392)\n }\n\n }\n\n }\n\n function id_393() {\n var $ = id_394;\n end = (((length)))\n }\n\n function id_397() {\n var $ = id_398;\n while ($) {\n for (;;) {\n $ = id_399(id_400)\n }\n\n }\n\n }\n\n function id_401() {\n var $ = id_402;\n while ($) {\n for (;;) {\n $ = id_403(id_404)\n }\n\n }\n\n }\n\n function id_405() {\n while ($) {\n for (;;) {\n $ = id_407(id_408)\n }\n\n }\n\n }\n\n function id_409() {\n var $ = id_410;\n while ($) {\n for (;;) {\n $ = id_411(id_412)\n }\n\n }\n\n }\n return {\n changeHeap: ch,\n id_413: id_414,\n id_415: id_416,\n id_417: id_418,\n id_419: id_420,\n id_421: id_422,\n id_423: id_424,\n id_425: id_426,\n id_427: id_428,\n id_429: id_430,\n id_431: id_432,\n id_433: id_434,\n id_435: id_436,\n id_437: id_438,\n id_439: id_440,\n id_441: id_442,\n id_443: id_444,\n id_445: id_446,\n id_447: id_448,\n id_449: id_450,\n id_451: id_452,\n id_453: id_454,\n id_455: id_456,\n id_457: id_458,\n id_459: id_460,\n id_461: id_462,\n id_463: id_464,\n id_465: id_466,\n id_467: id_468,\n id_469: id_470,\n id_471: id_472,\n id_473: id_474,\n id_475: id_476,\n id_477: $\n }\n}", "title": "" }, { "docid": "190a6133afb57e8e769be2e44b16ffc0", "score": "0.55799645", "text": "function compile(raw) {\n if (FAKE_X86_FP80) {\n raw = raw.replace(/x86_fp80/g, 'double');\n }\n if (raw.search('\\r\\n') >= 0) {\n raw = raw.replace(/\\r\\n/g, '\\n'); // fix windows line endings\n }\n var lines = raw.split('\\n');\n raw = null;\n\n // Pre-process the LLVM assembly\n\n Debugging.handleMetadata(lines);\n\n function runPhase(currPhase) {\n //printErr('// JS compiler in action, phase ' + currPhase + typeof lines + (lines === null));\n phase = currPhase;\n if (phase != 'pre' && phase != 'glue') {\n if (singlePhase) PassManager.load(read(forwardedDataFile));\n\n if (phase == 'funcs') {\n PreProcessor.eliminateUnneededIntrinsics(lines);\n }\n }\n\n // Do it\n\n var intertyped = intertyper(lines);\n if (singlePhase) lines = null;\n var analyzed = analyzer(intertyped);\n intertyped = null;\n JSify(analyzed);\n\n //dumpInterProf();\n //printErr(phase + ' paths (fast, slow): ' + [fastPaths, slowPaths]);\n B.print(phase);\n\n phase = null;\n\n if (DEBUG_MEMORY) {\n print('zzz. last gc: ' + gc());\n MemoryDebugger.dump();\n print('zzz. hanging now!');\n while(1){};\n }\n }\n\n // Normal operation is for each execution of compiler.js to run a single phase. The calling script sends us exactly the information we need, and it is easy to parallelize operation that way. However, it is also possible to run in an unoptimal multiphase mode, where a single invocation goes from ll to js directly. This is not recommended and will likely do a lot of duplicate processing.\n singlePhase = !!phase;\n\n if (singlePhase) {\n runPhase(phase);\n } else {\n runPhase('pre');\n runPhase('funcs');\n runPhase('post');\n }\n}", "title": "" }, { "docid": "1c5b7495d325a5d1d2b3e3abc3f8e424", "score": "0.5574521", "text": "constructor(VM){\n\t\tthis.VM = VM;\n\t\tthis.if = (args,scope) => {\n\t\t\tif (args.length != 3) throw new SyntaxError(\"Wrong number of args to if.\");\n\t\t\tif (this.VM.evaluate(args[0], scope) === true) return this.VM.evaluate(args[1], scope);\n\t\t\telse return this.VM.evaluate(args[2], scope);\n\t\t};\n\t\t\n\t\tthis.while = (args,scope) => {\n\t\t\tif (args.length != 2) throw new SyntaxError(\"Wrong number of args to while.\");\n\t\t\twhile( this.VM.evaluate(args[0],scope) === true)\n\t\t\t\t\tthis.VM.evaluate(args[1],scope);\n\t\t\treturn true;\n\t\t};\n\t\t\n\t\tthis.do = (args, scope) => { \n\t\t\tlet value = false;\n\t\t\tfor (let arg of args) {\n\t\t\t value = this.VM.evaluate(arg, scope);\n\t\t\t}\n\t\t\treturn value;\n\t\t};\n\t\t\n\t\tthis[\":=\"] = this.def = this.define = (args, scope) => {\n\t\t\tif(args.length != 2) throw new SyntaxError(\"Wrong number of args to define.\");\n\t\t\tlet value = this.VM.evaluate(args[1], scope);\n\t\t\tscope[args[0].name] = value;\n\t\t\treturn {\"word\": args[0].name , \"value\" : value };\n\t\t};\n\t\t\n\t\tthis[\"->\"] = this.fun = (args, scope) => {\n\t\t\tif (!args.length) throw new SyntaxError(\"Functions need a body\");\n\t\t\tlet body = args[args.length - 1];\n\t\t\tlet params = args.slice(0, args.length - 1).map(expr => {\n\t\t\t if (expr.type != \"word\") throw new SyntaxError(\"Parameter names must be words\");\n\t\t\t return expr.name;\n\t\t\t});\n\t\t \n\t\t\treturn (...args) => {\n\t\t\t if (args.length != params.length) throw new TypeError(\"Wrong number of arguments\");\n\t\t\t let localScope = Object.create(scope); //Importante crear un objeto con herencia del primero, para crear un scope con acceso a los scope \"padres\"\n\t\t\t for (let i = 0; i < args.length; i++) localScope[params[i]] = args[i];\n\t\t\t return this.VM.evaluate(body, localScope);\n\t\t\t};\n\t\t};\n\t\t\n\t\tthis[\"=\"] = this.set = (args, scope) => {\n\t\t\tif(args.length != 2) \n\t\t\t\tthrow new SyntaxError(\"Incorrect use of Set. Set needs two arguments \");\n\t\t\telse if( args[0].type != \"word\" ) \n\t\t\t\tthrow new SyntaxError(\"Incorrect use of Set. Set needs a word as first argument \");\n\t\t\tlet value = this.VM.evaluate(args[1], scope);\n\n\t\t\tif(args[0].name in scope){\n\t\t\t\tlet scopeIt = scope;\n\t\t\t\tdo{\n\t\t\t\t\tscopeIt[args[0].name] = value;\n\t\t\t\t\t//No llegamos al scope global, pero hemos llegado al punto donde la variable se definió, más atrás no nos importa tocar (y sería incorrecto):\n\t\t\t\t\tif(args[0].name in Object.getOwnPropertyNames(scopeIt)) break; \n\t\t\t\t}while(scopeIt = Object.getPrototypeOf(scopeIt));\n\t\t\t\treturn {\"word\" : args[0].name , \"value\" :scope[args[0].name]};\n\t\t\t}\n\t\t\telse \n\t\t\t\tthrow new ReferenceError(`Undefined variable: ${args[0].name}`)\n\t\t};\n\t}", "title": "" }, { "docid": "87c32e15631a7cf82178eccdfbb27b7a", "score": "0.5538738", "text": "function Module(stdlib, foreign, heap) {\n \"use asm\"\n var x = +stdlib.x;\n}", "title": "" }, { "docid": "4cd3b9a9626bc9cb63c3ff50d2d839be", "score": "0.5518343", "text": "function AsmModule(stdlib, foreign, buffer) {\n \"use asm\";\n\n var m1 = stdlib.Math.fround;\n var func1 = foreign.fun1; //views\n\n var HEAP8 = new stdlib.Float32Array(buffer);\n\n function f1() {\n var x = m1(1.5);\n x = m1(HEAP8[1]);\n return m1(x);\n }\n\n return f1;\n}", "title": "" }, { "docid": "5c453a8d4eed1ba4f1574a83bcbb7e50", "score": "0.548268", "text": "function o0(stdlib,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n var o8 = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength')\n \n function o4(o2,o3){\n try {\no2 = +o2;\n}catch(e){}\n try {\no3 = +o3;\n}catch(e){}\n var o5 = 0.0;\n var o6 = 1;\n try {\no5 = +o7[o6&3](o2,o3);\n}catch(e){}\n try {\nreturn +o5;\n}catch(e){}\n }\n \n var o7 = [add,add,add,add];\n \n \n try {\nreturn { \n o4 : o4\n };\n}catch(e){}\n}", "title": "" }, { "docid": "e065c42969dd102e2e7d4047ed3696dc", "score": "0.5440579", "text": "function applyPrimitiveProcedure() {\n\n}", "title": "" }, { "docid": "6b22e6695227e242e5381f9cdb56a608", "score": "0.5432074", "text": "vmPrecall(func, r) {\n var faso; // Function AS Object\n faso = this._stack[func].r;\n if (!Lua.isFunction(faso)) {\n faso = this.tryfuncTM(func);\n }\n this.__ci().savedpc = this._savedpc;\n if (faso instanceof LuaFunction_1.LuaFunction) {\n var f = faso;\n var p = f.proto;\n // :todo: ensure enough stack\n if (!p.isVararg) {\n this._base = func + 1;\n if (this._stackSize > this._base + p.numparams) {\n // trim stack to the argument list\n this.stacksetsize(this._base + p.numparams);\n }\n }\n else {\n var nargs = (this._stackSize - func) - 1;\n this._base = this.adjust_varargs(p, nargs);\n }\n var top = this._base + p.maxstacksize;\n this.inc_ci(func, this._base, top, r);\n this._savedpc = 0;\n // expand stack to the function's max stack size.\n this.stacksetsize(top);\n // :todo: implement call hook.\n return Lua.PCRLUA;\n }\n else if (faso instanceof LuaJavaCallback_1.LuaJavaCallback) {\n var fj = faso;\n // :todo: checkstack (not sure it's necessary)\n this._base = func + 1;\n this.inc_ci(func, this._base, this._stackSize + Lua.MINSTACK, r);\n // :todo: call hook\n var n = 99;\n try {\n n = fj.luaFunction(this);\n }\n catch (e1) {\n if (e1 instanceof LuaError_1.LuaError) {\n console.log(e1.stack);\n throw e1;\n }\n else if (e1 instanceof RuntimeException_1.RuntimeException) {\n console.log(e1.stack);\n this.yield(0);\n throw e1;\n }\n }\n if (n < 0) // yielding?\n {\n return Lua.PCRYIELD;\n }\n else {\n this.vmPoscall(this._stackSize - n);\n return Lua.PCRJ;\n }\n }\n throw new IllegalArgumentException_1.IllegalArgumentException();\n }", "title": "" }, { "docid": "84bf641a923d547a6dc65eb72eb8a5cc", "score": "0.54301274", "text": "function test0() {\r\n var obj1 = {};\r\n var func0 = function (argMath0 = {\r\n prop7: {\r\n prop0: ary.pop() >> (typeof protoObj1.prop1 == 'undefined'),\r\n prop1: typeof protoObj1.prop1 == 'undefined',\r\n prop2: 314342286 >= 314342286 || obj0.prop0 == obj1.prop0,\r\n prop3: obj0.length,\r\n prop4: 138434197,\r\n prop5: leaf.call(protoObj0),\r\n prop6: (obj0.prop0 %= typeof ((2147483647 ^= leaf.call(obj0) ? protoObj0.length >> h : uic8[186 & 255]) ? typeof g == 'boolean' : (i32[132 & 255] * (typeof g == 'boolean') + {\r\n prop2: 32061261727923600 instanceof (typeof Error == 'function' ? Error : Object),\r\n prop1: ary[(-47093207 >= 0 ? -47093207 : 0) & 15],\r\n prop0: new Object() instanceof (typeof EvalError == 'function' ? EvalError : Object)\r\n } ? -1200911084.9 : leaf.call(obj1)) * (new leaf().prop1 - (ui32[-887632913.9 * (-152266440 + arrObj0.prop0) * (obj0.length - 314342286) + func0.caller & 255] - -710991759))) == 'undefined') ? ary.pop() : typeof protoObj0.prop1 != 'number' | 4294967297,\r\n prop7: leaf.call(litObj1)\r\n },\r\n prop6: (obj0.prop0 %= typeof ((2147483647 ^= leaf.call(obj0) ? protoObj0.length >> h : uic8[186 & 255]) ? typeof g == 'boolean' : (i32[132 & 255] * (typeof g == 'boolean') + {\r\n prop2: 32061261727923600 instanceof (typeof Error == 'function' ? Error : Object),\r\n prop1: ary[(-47093207 >= 0 ? -47093207 : 0) & 15],\r\n prop0: new Object() instanceof (typeof EvalError == 'function' ? EvalError : Object)\r\n } ? -1200911084.9 : leaf.call(obj1)) * (new leaf().prop1 - (ui32[-887632913.9 * (-152266440 + arrObj0.prop0) * (obj0.length - 314342286) + func0.caller & 255] - -710991759))) == 'undefined') ? ary.pop() : typeof protoObj0.prop1 != 'number' | 4294967297,\r\n prop5: g !== protoObj0.length || this.prop1 === arrObj0.prop1,\r\n prop4: (2147483647 ^= leaf.call(obj0) ? protoObj0.length >> h : uic8[186 & 255]) ? typeof g == 'boolean' : (i32[132 & 255] * (typeof g == 'boolean') + {\r\n prop2: 32061261727923600 instanceof (typeof Error == 'function' ? Error : Object),\r\n prop1: ary[(-47093207 >= 0 ? -47093207 : 0) & 15],\r\n prop0: new Object() instanceof (typeof EvalError == 'function' ? EvalError : Object)\r\n } ? -1200911084.9 : leaf.call(obj1)) * (new leaf().prop1 - (ui32[-887632913.9 * (-152266440 + arrObj0.prop0) * (obj0.length - 314342286) + func0.caller & 255] - -710991759)),\r\n prop3: obj1.prop1 = ary.push(i8[func0.caller & 255], func0.caller, -(typeof obj0.prop1 == 'object'), Math.acos(func0.caller), leaf.call(arrObj0) === leaf.call(obj0), 2147483647, ary.reverse() * (leaf.call(obj0) ? protoObj0.length >> h : uic8[186 & 255]) + -2147483648 || new Object() instanceof (typeof EvalError == 'function' ? EvalError : Object)),\r\n prop2: new RangeError() instanceof (typeof RegExp == 'function' ? RegExp : Object),\r\n prop1: new RangeError() instanceof (typeof RegExp == 'function' ? RegExp : Object),\r\n prop0: arrObj0.prop1 > protoObj0.prop0 && obj0.length < obj1.prop1}) \r\n {\r\n };\r\n var id27 = 2147483647;\r\n for (var i =0;i<1000;i++) {\r\n if (obj1 >= 238436589.1) {\r\n makeArrayLength(ary(id27));\r\n while (+uic8[b != h & 255] - (id27 = obj1)) {\r\n }\r\n }\r\n obj1.prop0;\r\n }\r\n}", "title": "" }, { "docid": "a7e31e00b65252339ad37b40099db687", "score": "0.5422165", "text": "function asm() {\n \"use asm\";\n function f() {}\n return {};\n}", "title": "" }, { "docid": "24f0310a2d813d94f278436318c52f27", "score": "0.5418251", "text": "function v27(v28) {\n const v31 = [13.37,13.37,13.37,13.37,13.37];\n // v31 = .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 v33 = [1337,1337];\n // v33 = .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 v34 = [v31,transferArrayBuffer,v33,transferArrayBuffer,transferArrayBuffer,v31,13.37,v23];\n // v34 = .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 v37(v38,v39) {\n function v41(v42,v43) {\n const v46 = Symbol.match;\n // v46 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n const v47 = (100).toLocaleString();\n // v47 = .unknown\n let v48 = v17;\n v48 = v46;\n const v49 = v47.split(v48);\n // v49 = .unknown\n const v50 = 0;\n // v50 = .integer\n const v51 = 5;\n // v51 = .integer\n const v52 = 1;\n // v52 = .integer\n const v53 = 0;\n // v53 = .integer\n const v54 = 8;\n // v54 = .integer\n const v55 = 1;\n // v55 = .integer\n }\n const v57 = new Promise(v41);\n // v57 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n const v58 = 0;\n // v58 = .integer\n const v59 = 8;\n // v59 = .integer\n const v60 = 1;\n // v60 = .integer\n const v62 = \"unicode\".padStart(-65536,v37);\n // v62 = .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 v63 = Function(v62);\n // v63 = .unknown\n const v64 = 785494185n;\n // v64 = .bigint\n with (v62) {\n const v65 = EPSILON;\n // v65 = .unknown\n }\n function v69(v70,v71) {\n for (let v74 = -2.2250738585072014e-308; v74 < 100; v74 = v74 + 1) {\n const v75 = 1 ^ v74;\n // v75 = .integer | .bigint\n const v76 = 1 % v75;\n // v76 = .integer | .float | .bigint\n const v77 = 0;\n // v77 = .integer\n const v78 = 16;\n // v78 = .integer\n const v79 = 1;\n // v79 = .integer\n const v80 = 0;\n // v80 = .integer\n const v81 = 100;\n // v81 = .integer\n const v82 = 1;\n // v82 = .integer\n for (let v87 = 0; v87 < 100; v87 = v87 + 1) {\n const v88 = \"toStringTag\";\n // v88 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n }\n const v89 = [63455.09052841901,63455.09052841901,63455.09052841901,\"0jb3mmw5pG\"];\n // v89 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n }\n return v17;\n }\n const v90 = v69(undefined,undefined);\n // v90 = .unknown\n return 1337;\n }\n const v92 = new Promise(v37);\n // v92 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n }", "title": "" }, { "docid": "e353d1083a44da74985d15b2c63c8fc5", "score": "0.53912145", "text": "function vl(t){return t}", "title": "" }, { "docid": "1c0f0e721abcf753dcce9fec5809ccd9", "score": "0.53778535", "text": "function apply_primitive_function(fun,args) {\n return apply_in_underlying_javascript(\n primitive_implementation(fun),\n args); \n}", "title": "" }, { "docid": "6f981da88162230bb03dd8867c03628e", "score": "0.53599966", "text": "function Module(stdlib, foreign, heap, offset) {\n \"use asm\";\n var MEM8 = new stdlib.Int8Array(heap, offset);\n var MEM16 = new stdlib.Int16Array(heap, offset);\n var MEM32 = new stdlib.Int32Array(heap, offset);\n var MEMU8 = new stdlib.Uint8Array(heap, offset);\n var MEMU16 = new stdlib.Uint16Array(heap, offset);\n var MEMU32 = new stdlib.Uint32Array(heap, offset);\n var compareExchange = stdlib.Atomics.compareExchange;\n var fround = stdlib.Math.fround;\n\n function compareExchangei8(i, o, n) {\n i = i | 0;\n o = o | 0;\n n = n | 0;\n return compareExchange(MEM8, i, o, n)|0;\n }\n\n function compareExchangei16(i, o, n) {\n i = i | 0;\n o = o | 0;\n n = n | 0;\n return compareExchange(MEM16, i, o, n)|0;\n }\n\n function compareExchangei32(i, o, n) {\n i = i | 0;\n o = o | 0;\n n = n | 0;\n return compareExchange(MEM32, i, o, n)|0;\n }\n\n function compareExchangeu8(i, o, n) {\n i = i | 0;\n o = o >>> 0;\n n = n >>> 0;\n return compareExchange(MEMU8, i, o, n)>>>0;\n }\n\n function compareExchangeu16(i, o, n) {\n i = i | 0;\n o = o >>> 0;\n n = n >>> 0;\n return compareExchange(MEMU16, i, o, n)>>>0;\n }\n\n function compareExchangeu32(i, o, n) {\n i = i | 0;\n o = o >>> 0;\n n = n >>> 0;\n return compareExchange(MEMU32, i, o, n)>>>0;\n }\n\n return {\n compareExchangei8: compareExchangei8,\n compareExchangei16: compareExchangei16,\n compareExchangei32: compareExchangei32,\n compareExchangeu8: compareExchangeu8,\n compareExchangeu16: compareExchangeu16,\n compareExchangeu32: compareExchangeu32,\n };\n}", "title": "" }, { "docid": "c7a1f16f8d97edf1c0db0d0f3c7018a1", "score": "0.5344745", "text": "function Module(stdlib, imports, buffer) {\n \"use asm\";\n function f() {\n return (281474976710655 * 1048575) | 0;\n }\n return { f:f };\n}", "title": "" }, { "docid": "c4bfd91b1eda20129c48a6e4a3c92245", "score": "0.5339859", "text": "W(){let t=Rn(),e=Rn(),n=Rn();return this.M.forEach((s,i)=>{switch(i){case 0/* Added */:t=t.add(s);break;case 2/* Modified */:e=e.add(s);break;case 1/* Removed */:n=n.add(s);break;default:F();}}),new Vn(this.L,this.B,t,e,n);}", "title": "" }, { "docid": "b378c816581b5dff51e2e0e0a2f1ab39", "score": "0.5294143", "text": "[Symbol.toPrimitive]() {\n return () => _util2.default.inspect(render(chain, syntax));\n }", "title": "" }, { "docid": "c29993a6421adca4bbb4f838e1a3eb9e", "score": "0.5285232", "text": "function v8(v9,v10) {\n const v14 = 13.37 ** 13.37;\n // v14 = .integer | .float | .bigint\n const v15 = 2;\n // v15 = .integer\n const v19 = [13.37,13.37,13.37];\n // v19 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v21 = [1337,1337];\n // v21 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v22 = [ArrayBuffer];\n // v22 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v23 = {b:ArrayBuffer,e:ArrayBuffer};\n // v23 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"b\"])\n const v24 = {a:ArrayBuffer,b:v19,c:ArrayBuffer,d:-3131930798,length:v23};\n // v24 = .object(ofGroup: Object, withProperties: [\"length\", \"d\", \"c\", \"b\", \"a\", \"__proto__\"])\n const v26 = \"9\";\n // v26 = .string + .object(ofGroup: String, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"substring\", \"padEnd\", \"indexOf\", \"lastIndexOf\", \"endsWith\", \"matchAll\", \"startsWith\", \"search\", \"concat\", \"codePointAt\", \"slice\", \"includes\", \"match\", \"repeat\", \"split\", \"charCodeAt\", \"trim\", \"charAt\", \"padStart\", \"replace\"])\n const v31 = [13.37,13.37,13.37];\n // v31 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v32 = {b:ArrayBuffer,e:ArrayBuffer};\n // v32 = .object(ofGroup: Object, withProperties: [\"b\", \"__proto__\", \"e\"])\n const v33 = {a:ArrayBuffer,b:v31,c:ArrayBuffer,d:-3131930798,length:v32};\n // v33 = .object(ofGroup: Object, withProperties: [\"d\", \"__proto__\", \"length\", \"b\", \"a\", \"c\"])\n const v37 = [13.37,13.37,13.37];\n // v37 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v39 = [\"9\",ArrayBuffer];\n // v39 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v40 = {b:v39,e:ArrayBuffer};\n // v40 = .object(ofGroup: Object, withProperties: [\"b\", \"__proto__\", \"e\"])\n const v41 = {a:ArrayBuffer,b:v37,c:ArrayBuffer,d:1337,length:v40};\n // v41 = .object(ofGroup: Object, withProperties: [\"length\", \"d\", \"b\", \"a\", \"__proto__\", \"c\"])\n v41.d = 13.37;\n const v43 = [13.37,13.37,13.37];\n // v43 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v44 = 1337;\n // v44 = .integer\n const v45 = [ArrayBuffer];\n // v45 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v46 = -3131930798;\n // v46 = .integer\n const v47 = \"9\";\n // v47 = .string + .object(ofGroup: String, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"substring\", \"padEnd\", \"indexOf\", \"lastIndexOf\", \"endsWith\", \"matchAll\", \"startsWith\", \"search\", \"concat\", \"codePointAt\", \"slice\", \"includes\", \"match\", \"repeat\", \"split\", \"charCodeAt\", \"trim\", \"charAt\", \"padStart\", \"replace\"])\n const v49 = -2.220446049250313e-16;\n // v49 = .float\n const v50 = [ArrayBuffer];\n // v50 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n let v53 = 0;\n while (v53 < 9) {\n const v54 = v53 + 1;\n // v54 = .primitive\n const v55 = -3131930798;\n // v55 = .integer\n const v56 = Object;\n // v56 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"defineProperty\", \"entries\", \"getOwnPropertyDescriptors\", \"keys\", \"freeze\", \"isExtensible\", \"values\", \"create\", \"assign\", \"isSealed\", \"isFrozen\", \"getPrototypeOf\", \"defineProperties\", \"getOwnPropertyNames\", \"seal\", \"fromEntries\", \"is\", \"getOwnPropertySymbols\", \"preventExtensions\", \"setPrototypeOf\", \"getOwnPropertyDescriptor\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n v53 = v54;\n const v58 = \"9\";\n // v58 = .string + .object(ofGroup: String, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"substring\", \"padEnd\", \"indexOf\", \"lastIndexOf\", \"endsWith\", \"matchAll\", \"startsWith\", \"search\", \"concat\", \"codePointAt\", \"slice\", \"includes\", \"match\", \"repeat\", \"split\", \"charCodeAt\", \"trim\", \"charAt\", \"padStart\", \"replace\"])\n const v61 = [13.37,13.37,13.37];\n // v61 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v63 = [1337,1337];\n // v63 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v64 = [ArrayBuffer];\n // v64 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v65 = {b:ArrayBuffer,e:ArrayBuffer};\n // v65 = .object(ofGroup: Object, withProperties: [\"e\", \"b\", \"__proto__\"])\n const v66 = {a:ArrayBuffer,b:v61,c:ArrayBuffer,d:-3131930798,length:v65};\n // v66 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"length\", \"c\", \"a\", \"d\", \"b\"])\n let v67 = v66;\n const v68 = 0;\n // v68 = .integer\n const v69 = ArrayBuffer;\n // v69 = .object(ofGroup: ArrayBufferConstructor, withProperties: [\"prototype\"], withMethods: [\"isView\"]) + .constructor([.integer] => .object(ofGroup: ArrayBuffer, withProperties: [\"__proto__\", \"byteLength\"], withMethods: [\"slice\"]))\n const v70 = 0;\n // v70 = .integer\n const v74 = [-820170.9924548339,-820170.9924548339,-820170.9924548339];\n // v74 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v76 = [1337,ArrayBuffer];\n // v76 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v77 = [ArrayBuffer];\n // v77 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v78 = {b:ArrayBuffer,e:ArrayBuffer};\n // v78 = .object(ofGroup: Object, withProperties: [\"b\", \"__proto__\", \"e\"])\n const v79 = {a:ArrayBuffer,b:v74,c:ArrayBuffer,d:-3131930798,length:v78};\n // v79 = .object(ofGroup: Object, withProperties: [\"length\", \"c\", \"__proto__\", \"d\", \"b\", \"a\"])\n const v84 = [13.37,13.37,13.37];\n // v84 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v86 = [-3131930798,4294967296];\n // v86 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v87 = [ArrayBuffer];\n // v87 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n function v88(v89,v90) {\n const v91 = \"9\";\n // v91 = .string + .object(ofGroup: String, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"substring\", \"padEnd\", \"indexOf\", \"lastIndexOf\", \"endsWith\", \"matchAll\", \"startsWith\", \"search\", \"concat\", \"codePointAt\", \"slice\", \"includes\", \"match\", \"repeat\", \"split\", \"charCodeAt\", \"trim\", \"charAt\", \"padStart\", \"replace\"])\n }\n const v92 = {a:ArrayBuffer,b:v84,c:ArrayBuffer,d:\"9\",length:\"9\"};\n // v92 = .object(ofGroup: Object, withProperties: [\"b\", \"__proto__\", \"length\", \"c\", \"a\", \"d\"])\n let v93 = -820170.9924548339;\n const v98 = [13.37,13.37,13.37];\n // v98 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v99 = [ArrayBuffer];\n // v99 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v100 = {b:ArrayBuffer,e:ArrayBuffer};\n // v100 = .object(ofGroup: Object, withProperties: [\"e\", \"__proto__\", \"b\"])\n const v101 = {a:ArrayBuffer,b:v98,c:ArrayBuffer,d:-3131930798,length:v100};\n // v101 = .object(ofGroup: Object, withProperties: [\"length\", \"__proto__\", \"d\", \"b\", \"a\", \"c\"])\n const v105 = Object();\n // v105 = .object()\n const v108 = [13.37,13.37,13.37];\n // v108 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v109 = Object;\n // v109 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"defineProperty\", \"entries\", \"getOwnPropertyDescriptors\", \"keys\", \"freeze\", \"isExtensible\", \"values\", \"create\", \"assign\", \"isSealed\", \"isFrozen\", \"getPrototypeOf\", \"defineProperties\", \"getOwnPropertyNames\", \"seal\", \"fromEntries\", \"is\", \"getOwnPropertySymbols\", \"preventExtensions\", \"setPrototypeOf\", \"getOwnPropertyDescriptor\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v110 = Object;\n // v110 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"defineProperty\", \"entries\", \"getOwnPropertyDescriptors\", \"keys\", \"freeze\", \"isExtensible\", \"values\", \"create\", \"assign\", \"isSealed\", \"isFrozen\", \"getPrototypeOf\", \"defineProperties\", \"getOwnPropertyNames\", \"seal\", \"fromEntries\", \"is\", \"getOwnPropertySymbols\", \"preventExtensions\", \"setPrototypeOf\", \"getOwnPropertyDescriptor\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v111 = Object;\n // v111 = .object(ofGroup: ObjectConstructor, withProperties: [\"prototype\"], withMethods: [\"defineProperty\", \"entries\", \"getOwnPropertyDescriptors\", \"keys\", \"freeze\", \"isExtensible\", \"values\", \"create\", \"assign\", \"isSealed\", \"isFrozen\", \"getPrototypeOf\", \"defineProperties\", \"getOwnPropertyNames\", \"seal\", \"fromEntries\", \"is\", \"getOwnPropertySymbols\", \"preventExtensions\", \"setPrototypeOf\", \"getOwnPropertyDescriptor\"]) + .function([.anything...] => .object()) + .constructor([.anything...] => .object())\n const v112 = [ArrayBuffer];\n // v112 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v113 = {b:ArrayBuffer,e:ArrayBuffer};\n // v113 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"e\", \"b\"])\n const v114 = {a:ArrayBuffer,b:v108,c:ArrayBuffer,d:-3131930798,length:v113};\n // v114 = .object(ofGroup: Object, withProperties: [\"length\", \"b\", \"__proto__\", \"a\", \"d\", \"c\"])\n let v115 = v114;\n const v118 = [13.37,ArrayBuffer,13.37];\n // v118 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v119 = {b:Uint32Array,e:Uint32Array};\n // v119 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"e\", \"b\"])\n const v120 = {a:Uint32Array,b:v118,c:Uint32Array,d:-3131930798,length:v119};\n // v120 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\", \"d\", \"length\", \"c\", \"a\"])\n const v121 = v99[13.37];\n // v121 = .unknown\n v115 = v93;\n const v125 = [13.37,13.37,13.37];\n // v125 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v126 = {set:Object};\n // v126 = .object(ofGroup: Object, withProperties: [\"__proto__\"], withMethods: [\"set\"])\n const v127 = {b:NaN,e:NaN};\n // v127 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"e\", \"b\"])\n const v128 = Object[ArrayBuffer];\n // v128 = .unknown\n }\n with (\"9\") {\n e = v24;\n }\n const v129 = {b:ArrayBuffer,e:ArrayBuffer};\n // v129 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"e\", \"b\"])\n const v130 = {a:ArrayBuffer,b:v43,c:ArrayBuffer,d:-3131930798,length:v129};\n // v130 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"c\", \"b\", \"d\", \"length\", \"a\"])\n }", "title": "" }, { "docid": "6aecda74aaf8ff97c1604a91a3d4710f", "score": "0.5274831", "text": "function v6(v7,v8) {\n function v10(v11,v12) {\n let v15 = v5;\n const v17 = [1337];\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 = 4;\n // v18 = .integer\n const v23 = [13.37,13.37,Int16Array,13.37];\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 v25 = [1337,1337,1337,1337,1337];\n // v25 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v26 = [v25,isNaN,v23,v25,1337,isNaN,\"5BurUlYPg9\"];\n // v26 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n function v27(v28) {\n const v31 = [13.37,13.37,13.37,13.37,13.37];\n // v31 = .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 v33 = [1337,1337];\n // v33 = .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 v34 = [v31,transferArrayBuffer,v33,transferArrayBuffer,transferArrayBuffer,v31,13.37,v23];\n // v34 = .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 v37(v38,v39) {\n function v41(v42,v43) {\n const v46 = Symbol.match;\n // v46 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n const v47 = (100).toLocaleString();\n // v47 = .unknown\n let v48 = v17;\n v48 = v46;\n const v49 = v47.split(v48);\n // v49 = .unknown\n const v50 = 0;\n // v50 = .integer\n const v51 = 5;\n // v51 = .integer\n const v52 = 1;\n // v52 = .integer\n const v53 = 0;\n // v53 = .integer\n const v54 = 8;\n // v54 = .integer\n const v55 = 1;\n // v55 = .integer\n }\n const v57 = new Promise(v41);\n // v57 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n const v58 = 0;\n // v58 = .integer\n const v59 = 8;\n // v59 = .integer\n const v60 = 1;\n // v60 = .integer\n const v62 = \"unicode\".padStart(-65536,v37);\n // v62 = .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 v63 = Function(v62);\n // v63 = .unknown\n const v64 = 785494185n;\n // v64 = .bigint\n with (v62) {\n const v65 = EPSILON;\n // v65 = .unknown\n }\n function v69(v70,v71) {\n for (let v74 = -2.2250738585072014e-308; v74 < 100; v74 = v74 + 1) {\n const v75 = 1 ^ v74;\n // v75 = .integer | .bigint\n const v76 = 1 % v75;\n // v76 = .integer | .float | .bigint\n const v77 = 0;\n // v77 = .integer\n const v78 = 16;\n // v78 = .integer\n const v79 = 1;\n // v79 = .integer\n const v80 = 0;\n // v80 = .integer\n const v81 = 100;\n // v81 = .integer\n const v82 = 1;\n // v82 = .integer\n for (let v87 = 0; v87 < 100; v87 = v87 + 1) {\n const v88 = \"toStringTag\";\n // v88 = .string + .object(ofGroup: String, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"padEnd\", \"split\", \"charAt\", \"match\", \"lastIndexOf\", \"charCodeAt\", \"trim\", \"startsWith\", \"includes\", \"repeat\", \"search\", \"slice\", \"endsWith\", \"matchAll\", \"indexOf\", \"concat\", \"replace\", \"padStart\", \"substring\", \"codePointAt\"])\n }\n const v89 = [63455.09052841901,63455.09052841901,63455.09052841901,\"0jb3mmw5pG\"];\n // v89 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n }\n return v17;\n }\n const v90 = v69(undefined,undefined);\n // v90 = .unknown\n return 1337;\n }\n const v92 = new Promise(v37);\n // v92 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n }\n function v93(v94,v95) {\n function v96(v97,v98) {\n }\n }\n const v102 = \"a\" + v15;\n // v102 = .primitive\n const v103 = [v102,1337,1337,v10];\n // v103 = .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 v104 = [\"source\",1337,-2642800796,v103,\"a\"];\n // v104 = .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 v106(v107,v108) {\n const v112 = 8;\n // v112 = .integer\n let v113 = 0;\n const v114 = 0;\n // v114 = .integer\n const v115 = 100;\n // v115 = .integer\n const v116 = 1;\n // v116 = .integer\n const v117 = \"-128\".padStart(1337,v104);\n // v117 = .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 v119 = 10;\n // v119 = .integer\n let v120 = 0;\n const v121 = v120 + 1;\n // v121 = .primitive\n v120 = v121;\n const v122 = Function(v117);\n // v122 = .unknown\n }\n const v124 = new Promise(v106);\n // v124 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n }\n const v125 = v10(\"undefined\",v10);\n // v125 = .unknown\n}", "title": "" }, { "docid": "0269194dd1c3cdbbb8e29df86c990494", "score": "0.52700084", "text": "function Module(global, env, buffer) {\n \"use asm\";\n var HEAPF64 = new global.Float64Array(buffer);\n var HEAPF32 = new global.Float32Array(buffer);\n var Math_fround = global.Math.fround;\n function main_d_f() {\n HEAPF64[0] = Math_fround(+HEAPF64[0]);\n }\n function main_d_fq() {\n HEAPF64[1] = HEAPF32[4096];\n }\n function main_f_dq() {\n HEAPF32[4] = HEAPF64[4096];\n }\n return {main_d_f: main_d_f, main_d_fq: main_d_fq, main_f_dq: main_f_dq};\n}", "title": "" }, { "docid": "f153f3bad00788f2cf12b8db2c5f0a2d", "score": "0.5257629", "text": "function sV(a,b,c,d,e,f,g,k,l,n){if(ea[ud]){this.sta=n?n:$va;t:{n=this.sta;var p=ea[Fc][Kc]||ea[Fc].hash;if(null==n)n=p;else{if(p)for(var p=p[we](1)[zc](We),t=0;t<p[J];t++)if(p[t][we](0,p[t][zd](Df))==n){n=p[t][we](p[t][zd](Df)+1);break t}n=M}}this.pta=n;this.ca={};this.en={};this.attributes=[];a&&this[v](vD,a);b&&this[v](kH,b);c&&this[v](pi,c);d&&this[v](gh,d);e&&this[v](MC,new tV(e[qc]()[zc](mf)));t:if(a=new tV([0,0,0]),Rx.plugins&&Rx.mimeTypes[J])(b=Rx.plugins[PAa])&&b.description&&(a=new tV(b.description[Ab](/([a-zA-Z]|\\s)+/,\nM)[Ab](/(\\s+r|\\s+b[0-9]+)/,mf)[zc](mf)));else if(Rx[Cc]&&0<=Rx[Cc][zd](mAa))for(b=1,c=3;b;)try{c++,b=new ActiveXObject(NAa+c),a=new tV([c,0,0])}catch(u){b=null}else{b=null;try{b=new ActiveXObject(LAa)}catch(x){try{b=new ActiveXObject(MAa),a=new tV([6,0,21]),b.Wya=UK}catch(A){if(6==a.UE)break t}try{b=new ActiveXObject(OAa)}catch(C){}}null!=b&&(a=new tV(b.GetVariable(fFa)[zc](Ke)[1][zc](jf)))}this.DU=a;!ba.opera&&ea.all&&7<this.DU.UE&&(KKa=!0);f&&(this.ca.bgcolor=f);this.ca.quality=g?g:uH;this[v](Nma,\n!1);this[v](BI,!1);this[v](rma,k?k:ba[Fc]);this[v](bF,M);l&&this[v](bF,l)}}", "title": "" }, { "docid": "73f2570c8caefa83faf434bdd877db63", "score": "0.5255669", "text": "function baz() {\n \"use asm\";\n}", "title": "" }, { "docid": "e93f13fe087ecfd2d59726f251fe3dcb", "score": "0.5251237", "text": "function readSingleFile (fileName) {\n var d = fs.readFileSync(__dirname + '/' + fileName + '.vm');\n var dArr = d.toString().split(/\\n/);\n // Clear unwanted parts\n var clearedDArr = [];\n dArr.forEach((item) => {\n item = item.replace(/^\\/\\/.*/g, '')\n .replace(/\\r/g, '')\n .replace(/\\/\\/.*/g, '')\n .trim();\n if (item !== '') {\n clearedDArr.push(item);\n };\n });\n // Translate\n var translatedDArr = [];\n var order = {\n eq: 0,\n gt: 0,\n lt: 0\n };\n var newHck;\n clearedDArr.forEach((item) => {\n var translated;\n if (item.indexOf('push') !== 0 \n && item.indexOf('pop') !== 0 \n && item.indexOf('label') !== 0\n && item.indexOf('goto') !== 0\n && item.indexOf('if') !== 0\n && item.indexOf('call') !== 0\n && item.indexOf('function') !== 0\n && item.indexOf('return') !== 0) {\n translated = asmMap[item];\n if (order.hasOwnProperty(item)) {\n translated = insertOrder(translated, order[item]);\n order[item]++;\n };\n } else if (item.indexOf('label') === 0 \n || item.indexOf('goto') === 0\n || item.indexOf('if') === 0) {\n var label = clearLabel(item);\n if (item.indexOf('label') === 0) {\n translated = asmMap.label(label);\n } else {\n if (item.indexOf('if') === 0) {\n translated = asmMap.ifGoTo(label);\n } else {\n translated = asmMap.goto(label); \n } \n };\n } else if (item.indexOf('call') === 0\n || item.indexOf('function') === 0\n || item.indexOf('return') === 0) {\n var f = fInfo(item);\n if (item.indexOf('function') === 0) {\n translated = asmMap.createF(f.name, f.num);\n } else if (item.indexOf('call') === 0) {\n translated = asmMap.call(f.name, f.num, returnOrder);\n returnOrder++; \n } else {\n translated = asmMap.returnF();\n };\n } else {\n var l = msL(item);\n var file = fileName.replace(/^.*\\//, '').trim();\n if (item.indexOf('push') > -1) {\n translated = asmMap\n .push(l.seg, l.shift, file.toLowerCase());\n } else {\n translated = asmMap\n .pop(l.seg, l.shift, file.toLowerCase());\n }; \n };\n translatedDArr.push('// ' + fileName + ': ' + item + '\\n' \n + translated);\n newHack = translatedDArr.join('\\n');\n });\n return newHack;\n}", "title": "" }, { "docid": "6efba43167bde5ef91bd97a58fe5a742", "score": "0.524608", "text": "function Module(stdlib, foreign, heap) {\n \"use asm\";\n var a = stdlib.Math.PI;\n function f() { return a }\n return { f:f };\n}", "title": "" }, { "docid": "04c74957dbfa725a16df69e1d64f0866", "score": "0.52412724", "text": "function sc_func(x, y) {\r\n\r\n // JIT spray - this example is a nop sled ending in int3\r\n // Point is to prove that we are generating code of the form\r\n // 01: xor eax, 0x01eb9090\r\n // 06: xor eax, 0x01eb9090\r\n // 0b: xor eax, 0x01eb9090\r\n // ... etc ...\r\n var mynum = x ^\r\n 0x23840952 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0x01eb9090 ^\r\n 0xcccccccc ^\r\n 0x23840952 ^ \r\n 0x23840952;\r\n\r\n return mynum + y;\r\n}", "title": "" }, { "docid": "728e40307ead90dfa49c4a1166e87f15", "score": "0.52341264", "text": "async function v3(v4,v5) {\n while (v1 < 7) {\n }\n const v8 = (-2)();\n // v8 = .unknown\n const v10 = Object();\n // v10 = .object()\n for (const v11 in v10) {\n }\n for (const v12 in v8) {\n }\n let v13 = v4;\n while (v13 > 3476555219) {\n }\n const v15 = 2;\n // v15 = .integer\n let v16 = 0;\n}", "title": "" }, { "docid": "68b3e8e9afd21cdf5df92d4b80e22529", "score": "0.5216517", "text": "function t(a,b){\"string\"===typeof a&&(a=da(a,\"code\"));var d=a.constructor;this.za=function(){return new d({options:{}})};var c=this.za(),e;for(e in a)c[e]=\"body\"===e?a[e].slice():a[e];this.ra=c;this.U=[];this.qb=b;this.sa=!1;this.ca=[];this.Ya=0;this.rb=Object.create(null);a=/^step([A-Z]\\w*)$/;var h,k;for(k in this)\"function\"===typeof this[k]&&(h=k.match(a))&&(this.rb[h[1]]=this[k].bind(this));this.N=ea(this,this.ra,null);this.Na=this.N.object;this.ra=da(this.ca.join(\"\\n\"),\"polyfills\");this.ca=void 0;\nfa(this.ra);h=new u(this.ra,this.N);h.done=!1;this.j=[h];this.Eb();this.value=void 0;this.ra=c;h=new u(this.ra,this.N);h.done=!1;this.j.length=0;this.j[0]=h}", "title": "" }, { "docid": "fd66b6b1408eb15a257deff377f096f6", "score": "0.5213508", "text": "function v12(v13,v14,v15) {\n const v16 = [v6,v13,v9,v14];\n // v16 = .object(ofGroup: Array, withProperties: [\"constructor\", \"__proto__\", \"length\"], withMethods: [\"reduce\", \"map\", \"forEach\", \"find\", \"keys\", \"indexOf\", \"copyWithin\", \"flatMap\", \"join\", \"reverse\", \"reduceRight\", \"unshift\", \"entries\", \"slice\", \"pop\", \"filter\", \"some\", \"lastIndexOf\", \"fill\", \"toLocaleString\", \"concat\", \"every\", \"values\", \"flat\", \"findIndex\", \"shift\", \"push\", \"sort\", \"splice\", \"includes\", \"toString\"])\n const v17 = 0;\n // v17 = .integer\n let v20 = 0;\n do {\n const v21 = v20 + 1;\n // v21 = .primitive\n let v24 = 0;\n while (v24 < v13) {\n const v25 = v24 + 1;\n // v25 = .primitive\n v24 = v25;\n }\n for (let v27 = 0; v27 < 100; v27 = v27 + 1) {\n const v29 = Float32Array.species;\n // v29 = .unknown\n v11[v29] = v20;\n }\n v20 = v21;\n function v30(v31,v32,v33,v34) {\n let v35 = v34;\n v35 = v20;\n }\n } while (v20 < 10);\n}", "title": "" }, { "docid": "04ce6e858ed428d53c4180a8db40be4b", "score": "0.5203508", "text": "function p(a,b){for(var c=0,d=a.length;c<d;c++)ra.set(a[c],\"globalEval\",!b||ra.get(b[c],\"globalEval\"))}", "title": "" }, { "docid": "da4d5bcfed717406afd9c096ce542530", "score": "0.5202823", "text": "function convertJsFunctionToWasm(func, sig) {\n\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n var typeSection = [\n 0x01, // id: section,\n 0x00, // length: 0 (placeholder)\n 0x01, // count: 1\n 0x60, // form: func\n ];\n var sigRet = sig.slice(0, 1);\n var sigParam = sig.slice(1);\n var typeCodes = {\n 'i': 0x7f, // i32\n 'j': 0x7e, // i64\n 'f': 0x7d, // f32\n 'd': 0x7c, // f64\n };\n\n // Parameters, length + signatures\n typeSection.push(sigParam.length);\n for (var i = 0; i < sigParam.length; ++i) {\n typeSection.push(typeCodes[sigParam[i]]);\n }\n\n // Return values, length + signatures\n // With no multi-return in MVP, either 0 (void) or 1 (anything else)\n if (sigRet == 'v') {\n typeSection.push(0x00);\n } else {\n typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);\n }\n\n // Write the overall length of the type section back into the section header\n // (excepting the 2 bytes for the section id and length)\n typeSection[1] = typeSection.length - 2;\n\n // Rest of the module is static\n var bytes = new Uint8Array([\n 0x00, 0x61, 0x73, 0x6d, // magic (\"\\0asm\")\n 0x01, 0x00, 0x00, 0x00, // version: 1\n ].concat(typeSection, [\n 0x02, 0x07, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,\n 0x07, 0x05, // export section\n // (export \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x66, 0x00, 0x00,\n ]));\n\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n e: {\n f: func\n }\n });\n var wrappedFunc = instance.exports.f;\n return wrappedFunc;\n}", "title": "" }, { "docid": "99667408be8d9cafaeda9d684a30707d", "score": "0.51942074", "text": "function m_add_literals(stdlib, ffi, heap) {\n \"use asm\";\n\n function f() {\n\treturn (37 + 42)|0;\n }\n return { f:f };\n}", "title": "" }, { "docid": "d292c2e0f6560ff3eb2fd89cef2a3e5b", "score": "0.51864517", "text": "function Module(stdlib, foreign, heap) {\n \"use asm\"\n var pi = stdlib.Math.PI;\n function f() {\n return +pi;\n }\n return { f:f };\n}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.51789093", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.51789093", "text": "function dummy() {}", "title": "" }, { "docid": "bbdf983ed00cc7884a76355069c07d66", "score": "0.51789093", "text": "function dummy() {}", "title": "" }, { "docid": "f2f646e24eb8122b077f1cc16dbfbb60", "score": "0.5176185", "text": "extractAndCompile (code) {\n let blocks = code.split('\\n\\n');\n\n const methods = Object.keys(Shader.api);\n\n const rest = [];\n const ours = [];\n\n blocks.forEach(block => {\n for (const m of methods) {\n if (block.includes(m + '(')) {\n ours.push(block);\n return\n }\n }\n rest.push(block);\n });\n\n code = ours.join('\\n\\n').trim();\n if (!code.length) {\n return { shaderFunc: null, rest: rest.join('\\n\\n') }\n }\n\n // compile\nconsole.log(code);\n let func = new Function(\n ...methods,\n code\n ).bind(this, ...Object.values(Shader.api));\n\n return { shaderFunc: func, rest: rest.join('\\n\\n') }\n }", "title": "" }, { "docid": "2724798bb95efd07b0c972d5bcfb7836", "score": "0.5156014", "text": "function f(a, b) {\n %DeoptimizeNow();\n return a + b;\n}", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.51490915", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.51490915", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.51490915", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.51490915", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "dc4c7063b94443293d04a082c048c018", "score": "0.51490915", "text": "function optimize(ast) {\n }", "title": "" }, { "docid": "892b43bdeb1d6701f46583be7e88bed8", "score": "0.5126127", "text": "function convertJsFunctionToWasm(func, sig) {\n // The module is static, with the exception of the type section, which is\n // generated based on the signature passed in.\n var typeSection = [\n 0x01, // id: section,\n 0x00, // length: 0 (placeholder)\n 0x01, // count: 1\n 0x60, // form: func\n ];\n var sigRet = sig.slice(0, 1);\n var sigParam = sig.slice(1);\n var typeCodes = {\n 'i': 0x7f, // i32\n 'j': 0x7e, // i64\n 'f': 0x7d, // f32\n 'd': 0x7c, // f64\n };\n\n // Parameters, length + signatures\n typeSection.push(sigParam.length);\n for (var i = 0; i < sigParam.length; ++i) {\n typeSection.push(typeCodes[sigParam[i]]);\n }\n\n // Return values, length + signatures\n // With no multi-return in MVP, either 0 (void) or 1 (anything else)\n if (sigRet == 'v') {\n typeSection.push(0x00);\n } else {\n typeSection = typeSection.concat([0x01, typeCodes[sigRet]]);\n }\n\n // Write the overall length of the type section back into the section header\n // (excepting the 2 bytes for the section id and length)\n typeSection[1] = typeSection.length - 2;\n\n // Rest of the module is static\n var bytes = new Uint8Array([\n 0x00, 0x61, 0x73, 0x6d, // magic (\"\\0asm\")\n 0x01, 0x00, 0x00, 0x00, // version: 1\n ].concat(typeSection, [\n 0x02, 0x07, // import section\n // (import \"e\" \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x65, 0x01, 0x66, 0x00, 0x00,\n 0x07, 0x05, // export section\n // (export \"f\" (func 0 (type 0)))\n 0x01, 0x01, 0x66, 0x00, 0x00,\n ]));\n\n // We can compile this wasm module synchronously because it is very small.\n // This accepts an import (at \"e.f\"), that it reroutes to an export (at \"f\")\n var module = new WebAssembly.Module(bytes);\n var instance = new WebAssembly.Instance(module, {\n e: {\n f: func\n }\n });\n var wrappedFunc = instance.exports.f;\n return wrappedFunc;\n}", "title": "" }, { "docid": "11e21d2b35ea373e4c9dcef4f3d9a3a4", "score": "0.5123751", "text": "function InvokeStaticBlock(block) {\n return [op(0\n /* PushFrame */\n ), op('PushCompilable', block), op('JitCompileBlock'), op(2\n /* InvokeVirtual */\n ), op(1\n /* PopFrame */\n )];\n}", "title": "" }, { "docid": "2660b995ccc234b6e86b91e8108a7451", "score": "0.5117561", "text": "function Compiler (vm, options) {\n\n var compiler = this,\n key, i\n\n // default state\n compiler.init = true\n compiler.destroyed = false\n\n // process and extend options\n options = compiler.options = options || {}\n utils.processOptions(options)\n\n // copy compiler options\n extend(compiler, options.compilerOptions)\n // repeat indicates this is a v-repeat instance\n compiler.repeat = compiler.repeat || false\n // expCache will be shared between v-repeat instances\n compiler.expCache = compiler.expCache || {}\n\n // initialize element\n var el = compiler.el = compiler.setupElement(options)\n utils.log('\\nnew VM instance: ' + el.tagName + '\\n')\n\n // set other compiler properties\n compiler.vm = el.vue_vm = vm\n compiler.bindings = utils.hash()\n compiler.dirs = []\n compiler.deferred = []\n compiler.computed = []\n compiler.children = []\n compiler.emitter = new Emitter(vm)\n\n // VM ---------------------------------------------------------------------\n\n // set VM properties\n vm.$ = {}\n vm.$el = el\n vm.$options = options\n vm.$compiler = compiler\n vm.$event = null\n\n // set parent & root\n var parentVM = options.parent\n if (parentVM) {\n compiler.parent = parentVM.$compiler\n parentVM.$compiler.children.push(compiler)\n vm.$parent = parentVM\n // inherit lazy option\n if (!('lazy' in options)) {\n options.lazy = compiler.parent.options.lazy\n }\n }\n vm.$root = getRoot(compiler).vm\n\n // DATA -------------------------------------------------------------------\n\n // setup observer\n // this is necesarry for all hooks and data observation events\n compiler.setupObserver()\n\n // create bindings for computed properties\n if (options.methods) {\n for (key in options.methods) {\n compiler.createBinding(key)\n }\n }\n\n // create bindings for methods\n if (options.computed) {\n for (key in options.computed) {\n compiler.createBinding(key)\n }\n }\n\n // initialize data\n var data = compiler.data = options.data || {},\n defaultData = options.defaultData\n if (defaultData) {\n for (key in defaultData) {\n if (!hasOwn.call(data, key)) {\n data[key] = defaultData[key]\n }\n }\n }\n\n // copy paramAttributes\n var params = options.paramAttributes\n if (params) {\n i = params.length\n while (i--) {\n data[params[i]] = utils.checkNumber(\n compiler.eval(\n el.getAttribute(params[i])\n )\n )\n }\n }\n\n // copy data properties to vm\n // so user can access them in the created hook\n extend(vm, data)\n vm.$data = data\n\n // beforeCompile hook\n compiler.execHook('created')\n\n // the user might have swapped the data ...\n data = compiler.data = vm.$data\n\n // user might also set some properties on the vm\n // in which case we should copy back to $data\n var vmProp\n for (key in vm) {\n vmProp = vm[key]\n if (\n key.charAt(0) !== '$' &&\n data[key] !== vmProp &&\n typeof vmProp !== 'function'\n ) {\n data[key] = vmProp\n }\n }\n\n // now we can observe the data.\n // this will convert data properties to getter/setters\n // and emit the first batch of set events, which will\n // in turn create the corresponding bindings.\n compiler.observeData(data)\n\n // COMPILE ----------------------------------------------------------------\n\n // before compiling, resolve content insertion points\n if (options.template) {\n this.resolveContent()\n }\n\n // now parse the DOM and bind directives.\n // During this stage, we will also create bindings for\n // encountered keypaths that don't have a binding yet.\n compiler.compile(el, true)\n\n // Any directive that creates child VMs are deferred\n // so that when they are compiled, all bindings on the\n // parent VM have been created.\n i = compiler.deferred.length\n while (i--) {\n compiler.bindDirective(compiler.deferred[i])\n }\n compiler.deferred = null\n\n // extract dependencies for computed properties.\n // this will evaluated all collected computed bindings\n // and collect get events that are emitted.\n if (this.computed.length) {\n DepsParser.parse(this.computed)\n }\n\n // done!\n compiler.init = false\n\n // post compile / ready hook\n compiler.execHook('ready')\n}", "title": "" }, { "docid": "a7453d53207c7123dee87f74391bee22", "score": "0.5109764", "text": "function optimizedCode() {\n const res = [];\n const comb = [];\n\n codeRecur(res, comb, 12, 1);\n return res;\n}", "title": "" }, { "docid": "e7b9754e712a0d093d755f885d3b1671", "score": "0.51096654", "text": "function foo() { return 1; }", "title": "" }, { "docid": "b3e53dc1f07735e212f6fad5e9c3cd93", "score": "0.5100633", "text": "function o0() {\n try {\n'use strict';\n}catch(e){}\n try {\ntry {\n var o1 = Object.defineProperty(o4, Symbol.hasInstance, {\n value: function(o34) { try {\nreturn true;\n}catch(e){} }\n });\n var o2 = new Array(1);\n try {\nfunction() {\n var o32 = {};\n try {\no32[Symbol.iterator] = 'some string';\n}catch(e){}\n try {\no4.o11('some string', o32[Symbol.iterator], \"o[Symbol.iterator] === 'some string'\");\n}catch(e){}\n try {\no4.o7(o32[Symbol.iterator.toString()] === undefined, \"o[Symbol.iterator] uses the property id stored in Symbol.iterator (not the value created by Symbol.iterator.toString())\");\n}catch(e){}\n\n // use functions to wrap property access to ensure we hit JIT code\n function o33(o3, o31) {\n try {\nreturn o3[o31];\n}catch(e){}\n }\n function o34(o3, o31, o35) {\n try {\no3[o31] = o35;\n}catch(e){}\n }\n\n try {\no32 = {};\n}catch(e){}\n var o36 = Symbol();\n try {\nfor (var o37 = 0; o37 < 5; o37++) {\n try {\no34(o32, o36, o37);\n}catch(e){}\n try {\no4.o11(o37, o33(o32, o36), \"Property keyed by symbol is able to be set and get\");\n}catch(e){}\n }\n}catch(e){}\n\n var o31 = Symbol('sym');\n try {\no32 = {};\n}catch(e){}\n try {\no32[o31] = 'test';\n}catch(e){}\n\n try {\no4.o11('test', o32[o31], \"Symbol converted to property key works\");\n}catch(e){}\n try {\no4.o11(undefined, o32['sym'], \"Symbol description is not added as a property to the object\");\n}catch(e){}\n\n var o38 = Symbol('uniquevalue');\n var o39 = Symbol('uniquevalue');\n try {\no32 = {};\n}catch(e){}\n try {\no32[o38] = 's1';\n}catch(e){}\n try {\no32[o39] = 's2';\n}catch(e){}\n\n try {\no4.o11('s1', o32[o38], \"Simple test of symbol producing a property on an object\");\n}catch(e){}\n try {\no4.o11('s2', o32[o39], \"Simple test of symbol producing a property on an object\");\n}catch(e){}\n try {\no4.o7(o32[o38] != o32[o39], \"Different symbols with the same description create different properties on an object\");\n}catch(e){}\n\n try {\ndelete o32[o38];\n}catch(e){}\n\n try {\no4.o11(undefined, o32[o38], \"deleting properties from objects also works\");\n}catch(e){}\n try {\no4.o11('s2', o32[o39], \"deleting a property doesn't affect other properties\");\n}catch(e){}\n\n // Needs ES6 object literal improvements\n try {\no32 = { [o31] : 'string' };\n}catch(e){}\n try {\no4.o11('string', o32[o31], \"Object literal declared with symbol property works\");\n}catch(e){}\n };\n}catch(e){}\n var o3 = 0;\n try {\ntry { {\nModule['noExitRuntime'] = true;\n} } catch(e) {}try { {} } catch(e) {}\n}catch(e){}\n //Snippet 3: fewer arguments than formal parameters\n try {\no9lengthe = (function (o4, o5, o6, o7, o8) {\n try {\no9 *= o1.o10;\n}catch(e){}\n var o11 = o4 + o5 + o6 + o7 + o8;\n try {\nreturn o11 + o2[(1)];\n}catch(e){}\n })(1, 1, 1);\n}catch(e){}\n }\n catch(o9) {\n try {\no12.o13(o9);\n}catch(e){}\n }\n}catch(e){}\n}", "title": "" }, { "docid": "4f9265c922989e1fefb1fdafc90522de", "score": "0.5099832", "text": "function exec (inst) {\n // gR: get register, sR: set register.\n function gR (i) { return M.state.regs[inst[i]]; }\n function sR (i, val) { M.state.regs[inst[i]] = val; }\n\n var advance = true;\n var docall = false;\n function setpc (i) {\n M.state.pc = inst[i];\n advance = false;\n }\n function jumpto (name) {\n var lbl = M.state.labels[name];\n //console.log(\"jumping to \" + name + \": \" + lbl);\n if (lbl === null || lbl === undefined) {\n throw new Error(\"Undefined label: \" + name);\n }\n M.state.pc = lbl;\n advance = false;\n }\n switch (inst[0]) {\n case \"mov\": sR(1, gR(2)); break;\n case \"add\": sR(1, gR(2) + gR(3)); break;\n case \"sub\": sR(1, gR(2) - gR(3)); break;\n case \"mul\": sR(1, gR(2) * gR(3)); break;\n case \"div\": sR(1, gR(2) / gR(3)); break;\n case \"mod\": sR(1, gR(2) % gR(3)); break;\n case \"inc\": sR(1, gR(1) + 1); break;\n case \"dec\": sR(1, gR(1) - 1); break;\n\n case \"setarg\": M.args[inst[2]]=gR(1); break;\n case \"getarg\": sR(1,M.args[inst[2]]); break;\n\n case \"eq\": sR(1, gR(2) == gR(3)); break;\n case \"lt\": sR(1, gR(2) < gR(3)); break;\n case \"lteq\": sR(1, gR(2) <= gR(3)); break;\n case \"gtz\": sR(1, gR(2) > 0); break;\n\n //case \"loadi\": sR(1, inst[2]); break;\n case \"call\": docall = true; break;\n\n case \"jump\": jumpto(inst[1]); break;\n case \"jumpif\": if (gR(2)) { jumpto(inst[1]) }; break;\n case \"jumpifn\": if (!gR(2)) { jumpto(inst[1]) }; break;\n\n //case \"loadstr\": sR(1, inst[2]); break;\n case \"print\": console.log(gR(1)); break;\n case \"module\": sR(1, M.modules[inst[2]][inst[3]]); break;\n case \"label\": break;\n case \"end\": M.endFunc(); advance=false; break;\n case \"loadval\": sR(1, inst[2]); break; // Por ahora este en vez de loadi...\n default: throw new Error(\"Unrecognized instruction: \" + inst[0]);\n }\n if (advance) {\n M.state.pc++;\n }\n if (docall) {\n mcall(gR(1), inst[2])\n }\n}", "title": "" }, { "docid": "f6007918824c2b02f91216648eb9fda7", "score": "0.50960016", "text": "function Compiler (vm, options) {\n\n var compiler = this\n // indicate that we are intiating this instance\n // so we should not run any transitions\n compiler.init = true\n\n // process and extend options\n options = compiler.options = options || makeHash()\n utils.processOptions(options)\n\n // copy data, methods & compiler options\n var data = compiler.data = options.data || {}\n extend(vm, data, true)\n extend(vm, options.methods, true)\n extend(compiler, options.compilerOptions)\n\n // initialize element\n var el = compiler.setupElement(options)\n log('\\nnew VM instance:', el.tagName, '\\n')\n\n // set compiler properties\n compiler.vm = vm\n compiler.bindings = makeHash()\n compiler.dirs = []\n compiler.exps = []\n compiler.computed = []\n compiler.childCompilers = []\n compiler.emitter = new Emitter()\n\n // set inenumerable VM properties\n def(vm, '$', makeHash())\n def(vm, '$el', el)\n def(vm, '$compiler', compiler)\n def(vm, '$root', getRoot(compiler).vm)\n\n // set parent VM\n // and register child id on parent\n var parent = compiler.parentCompiler,\n childId = utils.attr(el, 'component-id')\n if (parent) {\n parent.childCompilers.push(compiler)\n def(vm, '$parent', parent.vm)\n if (childId) {\n compiler.childId = childId\n parent.vm.$[childId] = vm\n }\n }\n\n // setup observer\n compiler.setupObserver()\n\n // create bindings for computed properties\n var computed = options.computed\n if (computed) {\n for (var key in computed) {\n compiler.createBinding(key)\n }\n }\n\n // beforeCompile hook\n compiler.execHook('beforeCompile', 'created')\n\n // the user might have set some props on the vm \n // so copy it back to the data...\n extend(data, vm)\n\n // observe the data\n Observer.observe(data, '', compiler.observer)\n \n // for repeated items, create an index binding\n // which should be inenumerable but configurable\n if (compiler.repeat) {\n //data.$index = compiler.repeatIndex\n def(data, '$index', compiler.repeatIndex, false, true)\n compiler.createBinding('$index')\n }\n\n // allow the $data object to be swapped\n Object.defineProperty(vm, '$data', {\n enumerable: false,\n get: function () {\n return compiler.data\n },\n set: function (newData) {\n var oldData = compiler.data\n Observer.unobserve(oldData, '', compiler.observer)\n compiler.data = newData\n Observer.copyPaths(newData, oldData)\n Observer.observe(newData, '', compiler.observer)\n }\n })\n\n // now parse the DOM, during which we will create necessary bindings\n // and bind the parsed directives\n compiler.compile(el, true)\n\n // extract dependencies for computed properties\n if (compiler.computed.length) {\n DepsParser.parse(compiler.computed)\n }\n\n // done!\n compiler.init = false\n\n // post compile / ready hook\n compiler.execHook('afterCompile', 'ready')\n}", "title": "" }, { "docid": "82eade520a137a160c7de6ffd4ef87de", "score": "0.50923836", "text": "function v7(v8) {\n const v13 = [13.37,1337,1337];\n // v13 = .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 v14 = [1337,v13,v13,v13,1337,1337,-9007199254740991,\"bigint\",-9007199254740991];\n // v14 = .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 v15 = {c:v13,constructor:13.37,d:\"bigint\",e:1337,length:v14,toString:v13,valueOf:1337};\n // v15 = .object(ofGroup: Object, withProperties: [\"valueOf\", \"c\", \"length\", \"__proto__\", \"d\", \"constructor\", \"toString\", \"e\"])\n function v16(v17,v18,v19,v20,v21) {\n }\n const v23 = [1337,1337,1337,1337,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 function v25(v26,v27) {\n const v29 = {get:v26,set:v25};\n // v29 = .object(ofGroup: Object, withProperties: [\"__proto__\"], withMethods: [\"get\", \"set\"])\n const v31 = Object.defineProperty(v15,\"__proto__\",v29);\n // v31 = .undefined\n const v33 = [13.37,13.37];\n // v33 = .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 v34(v35,v36) {\n const v37 = v36 + 1;\n // v37 = .primitive\n return v33;\n }\n const v38 = v34(v34,v34);\n // v38 = .unknown\n let v41 = 13.37;\n function v42(v43,v44) {\n const v47 = [v38,108978604,108978604,108978604];\n // v47 = .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 v48 = v47;\n const v49 = (10).toLocaleString();\n // v49 = .unknown\n const v50 = v48.join(v49);\n // v50 = .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 v51 = eval(v50);\n // v51 = .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 return 1337;\n }\n const v52 = v42(v42,v41);\n // v52 = .unknown\n v23[8] = v27;\n const v56 = [13.37,13.37,13.37,13.37];\n // v56 = .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 v58 = [Int16Array,1392904795,v56,13.37,1337];\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 function v59(v60,v61) {\n let v66 = 100;\n const v69 = new Int8Array(127);\n // v69 = .object(ofGroup: Int8Array, withProperties: [\"byteLength\", \"constructor\", \"length\", \"__proto__\", \"buffer\", \"byteOffset\"], withMethods: [\"reduce\", \"copyWithin\", \"findIndex\", \"entries\", \"lastIndexOf\", \"map\", \"set\", \"includes\", \"indexOf\", \"sort\", \"some\", \"reverse\", \"keys\", \"reduceRight\", \"values\", \"filter\", \"forEach\", \"slice\", \"subarray\", \"join\", \"fill\", \"find\", \"every\"])\n const v70 = v69.indexOf(v66);\n // v70 = .integer\n const v73 = \"sO0KQ7OSCy\".indexOf(0,-65535);\n // v73 = .integer\n let v74 = v73;\n const v76 = typeof v16;\n // v76 = .string\n const v78 = v76 === \"number\";\n // v78 = .boolean\n function v79(v80,v81) {\n const v82 = 0;\n // v82 = .integer\n const v83 = 4;\n // v83 = .integer\n const v84 = 1;\n // v84 = .integer\n function v85(v86,v87) {\n return v56;\n }\n const v89 = {constructor:-4294967295};\n // v89 = .object(ofGroup: Object, withProperties: [\"constructor\", \"__proto__\"])\n let v90 = -4294967295;\n const v91 = -2285213110;\n // v91 = .integer\n const v92 = Uint8Array;\n // v92 = .constructor([.integer | .object()] => .object(ofGroup: Uint8Array, withProperties: [\"byteLength\", \"byteOffset\", \"constructor\", \"length\", \"buffer\", \"__proto__\"], withMethods: [\"includes\", \"join\", \"slice\", \"copyWithin\", \"filter\", \"lastIndexOf\", \"entries\", \"every\", \"fill\", \"reverse\", \"keys\", \"map\", \"subarray\", \"indexOf\", \"reduceRight\", \"forEach\", \"some\", \"find\", \"set\", \"findIndex\", \"sort\", \"reduce\", \"values\"]))\n const v93 = v81 instanceof v85;\n // v93 = .boolean\n for (let v97 = 13.37; v97 < 512; v97 = v97 + 1) {\n }\n function v98(v99,v100) {\n return v81;\n }\n return v81;\n }\n function v101(v102,v103) {\n const v105 = -506317353;\n // v105 = .integer\n const v107 = Uint32Array(0);\n // v107 = .unknown\n const v108 = Uint32Array(0);\n // v108 = .unknown\n const v111 = Int16Array;\n // v111 = .constructor([.integer | .object()] => .object(ofGroup: Int16Array, withProperties: [\"buffer\", \"byteLength\", \"constructor\", \"byteOffset\", \"length\", \"__proto__\"], withMethods: [\"some\", \"includes\", \"every\", \"set\", \"reduce\", \"reduceRight\", \"forEach\", \"join\", \"lastIndexOf\", \"values\", \"filter\", \"fill\", \"indexOf\", \"map\", \"find\", \"slice\", \"subarray\", \"copyWithin\", \"reverse\", \"sort\", \"entries\", \"keys\", \"findIndex\"]))\n const v113 = [13.37,13.37];\n // v113 = .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 v114 = [v101,126905259,noFTL,126905259,126905259];\n // v114 = .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 v115 = v5.map(isNaN);\n // v115 = .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 v117 = 0;\n const v118 = v117 + 1;\n // v118 = .primitive\n v117 = v118;\n const v119 = {__proto__:noFTL,b:v114,constructor:noFTL,length:v113};\n // v119 = .object(ofGroup: Object, withProperties: [\"length\", \"b\", \"__proto__\"], withMethods: [\"constructor\", \"__proto__\"])\n for (let v121 = v108; v121 < 100; v121 = v121 + \"2147483648\") {\n }\n }\n let v122 = 0;\n do {\n } while (v122 < 5);\n }\n const v125 = \"function\".padStart(1337,v25);\n // v125 = .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 v126 = Function(v125);\n // v126 = .unknown\n }\n const v128 = new Promise(v25);\n // v128 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n}", "title": "" }, { "docid": "f4826ba75e50c3beaaab2ccb4b1f58e1", "score": "0.5090417", "text": "function index(o9,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n var o35 = o479.o524 = [];\n //views\n var o3 =filter.call;\n\n var o733 = 0\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "e7b25bd71da894d26e16b4ef4c28e8cc", "score": "0.5086897", "text": "function __f_9() {}", "title": "" }, { "docid": "f5988dafadebfd54a87ae7bf791a528b", "score": "0.5081918", "text": "function generate_the_ast(receivedCode,filename){\n var ast = esprima.parse(receivedCode);\n estraverse.replace(ast,{\n enter: function (node) {\n if (node.type == 'ExpressionStatement' && node.expression.type == 'CallExpression' &&\n node.expression.callee.property.name == \"forEach\")\n\n {\n var arrayName = node.expression.callee.object.name;\n var body = node.expression.arguments[0].body.body;\n\n var functionArgument = node.expression.arguments[0].params[0].name;\n\n body.splice(0,0,assignBodyVariable(\"var \"+functionArgument+\"=arr[i];\"));\n\n return refactorForeach(arrayName, body, functionArgument);\n\n }\n else if (node.type == 'VariableDeclaration' && node.declarations[0].type == 'VariableDeclarator' && node.declarations[0].init.type == 'CallExpression' &&\n node.declarations[0].init.callee.property.name == \"map\")\n {\n\n var arrayName = node.declarations[0].init.callee.object.name;\n var body = node.declarations[0].init.arguments[0].body.body;\n\n\n var functionArgument = node.declarations[0].init.arguments[0].params[1].name;\n var mappedArray = node.declarations[0].id.name;\n\n body.splice(0,0,assignBodyVariable(\"var \"+functionArgument+\"=arr[i];\"));\n return refactorMap(arrayName, body, functionArgument,mappedArray);\n\n }\n else if (node.type == 'VariableDeclaration' && node.declarations[0].type == 'VariableDeclarator' && node.declarations[0].init.type == 'CallExpression' &&\n node.declarations[0].init.callee.property.name == \"reduce\")\n {\n var arrayName = node.declarations[0].init.callee.object.name;\n var body = node.declarations[0].init.arguments[0].body.body;\n var accumulatingVariable= node.declarations[0].id.name;\n\n var functionArgument1 = node.declarations[0].init.arguments[0].params[1].name;\n\n body.splice(0,0,assignBodyVariable(\"var \"+functionArgument1+\"=arr[i];\"));\n\n\n return refactorReduce(arrayName, body, functionArgument1,accumulatingVariable);\n\n }\n else if (node.type == 'VariableDeclaration' && node.declarations[0].type == 'VariableDeclarator' && node.declarations[0].init.type == 'CallExpression' &&\n node.declarations[0].init.callee.property.name == \"filter\")\n {\n\n var arrayName = node.declarations[0].init.callee.object.name;\n var body = node.declarations[0].init.arguments[0].body.body;\n\n var filteredOutput= node.declarations[0].id.name;\n var functionArgument = node.declarations[0].init.arguments[0].params[0].name;\n body.splice(0,0,assignBodyVariable(\"var \"+functionArgument+\"=array[i];\"));\n\n return refactorFilter(arrayName, body, functionArgument,filteredOutput);\n\n }\n\n },\n leave: function (node, parent) {\n\n }\n });\n\n var out = escodegen.generate(ast);\n //writes refactored code to the output file\n fs.writeFileSync('../../out/'+filename, out);\n\n\n}", "title": "" }, { "docid": "0b7468c9609da042809a01768625de1a", "score": "0.50704056", "text": "function test0() {\n var loopInvariant = 11;\n var obj0 = {};\n var arrObj0 = {};\n var func1 = function (argMath0) {\n for (var _strvar4 in i32) {\n loopInvariant;\n i32[_strvar4] = argMath0;\n }\n };\n var i32 = new Int32Array(256);\n arrObj0 = new Proxy(arrObj0, Object());\n func1(arrObj0);\n}", "title": "" }, { "docid": "f18f043e480376529a7134289a985c9a", "score": "0.50685394", "text": "function getRuntime() {\n let dynamicTop = TOTAL_STACK;\n const table = new WebAssembly.Table({\n initial: TABLE_SIZE,\n maximum: TABLE_SIZE,\n element: \"anyfunc\",\n });\n const memory = new WebAssembly.Memory({\n initial: TOTAL_MEMORY / PAGE_SIZE,\n maximum: TOTAL_MEMORY / PAGE_SIZE,\n });\n const HEAPU8 = new Uint8Array(memory.buffer);\n return {\n table: table,\n memory: memory,\n sbrk: (increment) => {\n const oldDynamicTop = dynamicTop;\n dynamicTop += increment;\n return oldDynamicTop;\n },\n emscripten_memcpy_big: (dest, src, num) => {\n HEAPU8.set(HEAPU8.subarray(src, src+num), dest);\n },\n // Empty stubs for dav1d.\n pthread_cond_wait: (cond, mutex) => 0,\n pthread_cond_signal: (cond) => 0,\n pthread_cond_destroy: (cond) => 0,\n pthread_cond_init: (cond, attr) => 0,\n pthread_cond_broadcast: (cond) => 0,\n pthread_join: (thread, res) => 0,\n pthread_create: (thread, attr, func, arg) => 0,\n // Emscripten debug.\n // abort: () => {},\n // __lock: () => {},\n // __unlock: () => {},\n // djs_log: (msg) => console.log(msg),\n };\n}", "title": "" }, { "docid": "9e377775ceec6be1704fd7d59d7239d7", "score": "0.5058342", "text": "function foo() {\n function bar() {\n print(\"bar\");\n /* Some text to pad out the function so that it won't be eagerly compiled\n * for being too short. Lorem ipsum dolor sit amet, consectetur adipiscing\n * elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n */\n }\n function unused() {\n print(\"unused\");\n /* Some text to pad out the function so that it won't be eagerly compiled\n * for being too short. Lorem ipsum dolor sit amet, consectetur adipiscing\n * elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n */\n }\n\n // This function is so small that it's not worth postponing compilation.\n function tiny() {\n print(\"tiny\");\n }\n\n print(\"foo\");\n bar();\n bar();\n tiny();\n}", "title": "" }, { "docid": "d5a6735b973c18e7e711d05845d70abf", "score": "0.50564116", "text": "function Compiler (vm, options) {\n\n var compiler = this,\n key, i\n\n // default state\n compiler.init = true\n compiler.destroyed = false\n\n // process and extend options\n options = compiler.options = options || {}\n utils.processOptions(options)\n\n // copy compiler options\n extend(compiler, options.compilerOptions)\n // repeat indicates this is a v-repeat instance\n compiler.repeat = compiler.repeat || false\n // expCache will be shared between v-repeat instances\n compiler.expCache = compiler.expCache || {}\n\n // initialize element\n var el = compiler.el = compiler.setupElement(options)\n utils.log('\\nnew VM instance: ' + el.tagName + '\\n')\n\n // set other compiler properties\n compiler.vm = el.vue_vm = vm\n compiler.bindings = utils.hash()\n compiler.dirs = []\n compiler.deferred = []\n compiler.computed = []\n compiler.children = []\n compiler.emitter = new Emitter(vm)\n\n // create bindings for computed properties\n if (options.methods) {\n for (key in options.methods) {\n compiler.createBinding(key)\n }\n }\n\n // create bindings for methods\n if (options.computed) {\n for (key in options.computed) {\n compiler.createBinding(key)\n }\n }\n\n // VM ---------------------------------------------------------------------\n\n // set VM properties\n vm.$ = {}\n vm.$el = el\n vm.$options = options\n vm.$compiler = compiler\n vm.$event = null\n\n // set parent & root\n var parentVM = options.parent\n if (parentVM) {\n compiler.parent = parentVM.$compiler\n parentVM.$compiler.children.push(compiler)\n vm.$parent = parentVM\n }\n vm.$root = getRoot(compiler).vm\n\n // DATA -------------------------------------------------------------------\n\n // setup observer\n // this is necesarry for all hooks and data observation events\n compiler.setupObserver()\n\n // initialize data\n var data = compiler.data = options.data || {},\n defaultData = options.defaultData\n if (defaultData) {\n for (key in defaultData) {\n if (!hasOwn.call(data, key)) {\n data[key] = defaultData[key]\n }\n }\n }\n\n // copy paramAttributes\n var params = options.paramAttributes\n if (params) {\n i = params.length\n while (i--) {\n data[params[i]] = utils.checkNumber(\n compiler.eval(\n el.getAttribute(params[i])\n )\n )\n }\n }\n\n // copy data properties to vm\n // so user can access them in the created hook\n extend(vm, data)\n vm.$data = data\n\n // beforeCompile hook\n compiler.execHook('created')\n\n // the user might have swapped the data ...\n data = compiler.data = vm.$data\n\n // user might also set some properties on the vm\n // in which case we should copy back to $data\n var vmProp\n for (key in vm) {\n vmProp = vm[key]\n if (\n key.charAt(0) !== '$' &&\n data[key] !== vmProp &&\n typeof vmProp !== 'function'\n ) {\n data[key] = vmProp\n }\n }\n\n // now we can observe the data.\n // this will convert data properties to getter/setters\n // and emit the first batch of set events, which will\n // in turn create the corresponding bindings.\n compiler.observeData(data)\n\n // COMPILE ----------------------------------------------------------------\n\n // before compiling, resolve content insertion points\n if (options.template) {\n this.resolveContent()\n }\n\n // now parse the DOM and bind directives.\n // During this stage, we will also create bindings for\n // encountered keypaths that don't have a binding yet.\n compiler.compile(el, true)\n\n // Any directive that creates child VMs are deferred\n // so that when they are compiled, all bindings on the\n // parent VM have been created.\n i = compiler.deferred.length\n while (i--) {\n compiler.bindDirective(compiler.deferred[i])\n }\n compiler.deferred = null\n\n // extract dependencies for computed properties.\n // this will evaluated all collected computed bindings\n // and collect get events that are emitted.\n if (this.computed.length) {\n DepsParser.parse(this.computed)\n }\n\n // done!\n compiler.init = false\n\n // post compile / ready hook\n compiler.execHook('ready')\n}", "title": "" }, { "docid": "74ca3ff47722ba0dbeb10f0404c8d9ec", "score": "0.50542957", "text": "function Module(stdlib, imports, buffer) {\n \"use asm\";\n\n function f(a, b, c) {\n a = a | 0;\n b = b | 0;\n c = c | 0;\n var x = 0;\n x = funTable[a & 1](funTable[b & 1](c) | 0) | 0;\n return x | 0;\n }\n\n function g(a) {\n a = a | 0;\n return a + 23 | 0;\n }\n\n function h(a) {\n a = a | 0;\n return a + 42 | 0;\n }\n\n var funTable = [g, h];\n return f;\n}", "title": "" }, { "docid": "69bd595e2a0e49d4380dc91029c88bfd", "score": "0.504863", "text": "function HelperFunctions (){}", "title": "" }, { "docid": "0e43217d0b639d4f038335b64bddc916", "score": "0.5048496", "text": "function YY(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "title": "" }, { "docid": "8c5810c96efc937f4c2590912a333206", "score": "0.5046324", "text": "compile () {}", "title": "" }, { "docid": "2ad5d812267534bfb123fe41c4cfb671", "score": "0.5044979", "text": "function test2() {\n const v8 = require('v8');\n console.log(v8.getHeapSpaceStatistics());\n}", "title": "" }, { "docid": "3d7fc27517852529a39cabcffbf0936d", "score": "0.50378907", "text": "async function v9(v10,v11) {\n for (let v15 = 0; v15 < 100; v15 = v15 + 1) {\n let v18 = -2;\n while (v18 < 10) {\n const v19 = v18 + 1;\n // v19 = .primitive\n v18 = v19;\n }\n }\n const v22 = -979549123 && -979549123;\n // v22 = .boolean\n let v23 = v10;\n const v24 = v22 >>> v23;\n // v24 = .integer | .bigint\n for (let v26 = 0; v26 < v24; v26 = v26 + 13.37) {\n const v29 = (0)(21353);\n // v29 = .unknown\n }\n}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5035622", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5035622", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5035622", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5035622", "text": "function TMP() {}", "title": "" }, { "docid": "b0e1e1a46915a2b97c9a4d1781ab50ef", "score": "0.50242853", "text": "function quux11 (foo) {\n\n}", "title": "" }, { "docid": "bedeb245d952a92ea3dafd699a1aea5c", "score": "0.5021957", "text": "function optimize(ast) {}", "title": "" }, { "docid": "b4ce3ca612d5afe82846651a01126eb8", "score": "0.5021883", "text": "function v30(v31,v32) {\n let v35 = 0;\n while (v35 < 9) {\n const v36 = v35 + 1;\n // v36 = .primitive\n v35 = v36;\n let v39 = 0;\n do {\n const v40 = v39 + 1;\n // v40 = .primitive\n v39 = v40;\n } while (v39 < 8);\n }\n const v42 = [13.37,13.37,13.37];\n // v42 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n const v44 = [13.37,13.37,13.37];\n // v44 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"pop\", \"forEach\", \"find\", \"shift\", \"every\", \"join\", \"flatMap\", \"copyWithin\", \"splice\", \"keys\", \"unshift\", \"reverse\", \"fill\", \"reduce\", \"values\", \"lastIndexOf\", \"flat\", \"concat\", \"findIndex\", \"push\", \"entries\", \"sort\", \"slice\", \"toString\", \"includes\", \"filter\", \"reduceRight\", \"some\", \"toLocaleString\", \"map\", \"indexOf\"])\n function v45(v46,v47) {\n }\n const v48 = v42.forEach(v45,v44);\n // v48 = .undefined\n }", "title": "" }, { "docid": "35ce400431970716e00bb6a029df84bd", "score": "0.50153196", "text": "function processBlock(block,proc,dtypes){var code=block.body;var pre=[];var post=[];for(var i=0;i < block.args.length;++i) {var carg=block.args[i];if(carg.count <= 0){continue;}var re=new RegExp(carg.name,\"g\");var ptrStr=\"\";var arrNum=proc.arrayArgs.indexOf(i);switch(proc.argTypes[i]){case \"offset\":var offArgIndex=proc.offsetArgIndex.indexOf(i);var offArg=proc.offsetArgs[offArgIndex];arrNum = offArg.array;ptrStr = \"+q\" + offArgIndex; // Adds offset to the \"pointer\" in the array\ncase \"array\":ptrStr = \"p\" + arrNum + ptrStr;var localStr=\"l\" + i;var arrStr=\"a\" + arrNum;if(proc.arrayBlockIndices[arrNum] === 0){ // Argument to body is just a single value from this array\nif(carg.count === 1){ // Argument/array used only once(?)\nif(dtypes[arrNum] === \"generic\"){if(carg.lvalue){pre.push([\"var \",localStr,\"=\",arrStr,\".get(\",ptrStr,\")\"].join(\"\")); // Is this necessary if the argument is ONLY used as an lvalue? (keep in mind that we can have a += something, so we would actually need to check carg.rvalue)\ncode = code.replace(re,localStr);post.push([arrStr,\".set(\",ptrStr,\",\",localStr,\")\"].join(\"\"));}else {code = code.replace(re,[arrStr,\".get(\",ptrStr,\")\"].join(\"\"));}}else {code = code.replace(re,[arrStr,\"[\",ptrStr,\"]\"].join(\"\"));}}else if(dtypes[arrNum] === \"generic\"){pre.push([\"var \",localStr,\"=\",arrStr,\".get(\",ptrStr,\")\"].join(\"\")); // TODO: Could we optimize by checking for carg.rvalue?\ncode = code.replace(re,localStr);if(carg.lvalue){post.push([arrStr,\".set(\",ptrStr,\",\",localStr,\")\"].join(\"\"));}}else {pre.push([\"var \",localStr,\"=\",arrStr,\"[\",ptrStr,\"]\"].join(\"\")); // TODO: Could we optimize by checking for carg.rvalue?\ncode = code.replace(re,localStr);if(carg.lvalue){post.push([arrStr,\"[\",ptrStr,\"]=\",localStr].join(\"\"));}}}else { // Argument to body is a \"block\"\nvar reStrArr=[carg.name],ptrStrArr=[ptrStr];for(var j=0;j < Math.abs(proc.arrayBlockIndices[arrNum]);j++) {reStrArr.push(\"\\\\s*\\\\[([^\\\\]]+)\\\\]\");ptrStrArr.push(\"$\" + (j + 1) + \"*t\" + arrNum + \"b\" + j); // Matched index times stride\n}re = new RegExp(reStrArr.join(\"\"),\"g\");ptrStr = ptrStrArr.join(\"+\");if(dtypes[arrNum] === \"generic\"){ /*if(carg.lvalue) {\r\n pre.push([\"var \", localStr, \"=\", arrStr, \".get(\", ptrStr, \")\"].join(\"\")) // Is this necessary if the argument is ONLY used as an lvalue? (keep in mind that we can have a += something, so we would actually need to check carg.rvalue)\r\n code = code.replace(re, localStr)\r\n post.push([arrStr, \".set(\", ptrStr, \",\", localStr,\")\"].join(\"\"))\r\n } else {\r\n code = code.replace(re, [arrStr, \".get(\", ptrStr, \")\"].join(\"\"))\r\n }*/throw new Error(\"cwise: Generic arrays not supported in combination with blocks!\");}else { // This does not produce any local variables, even if variables are used multiple times. It would be possible to do so, but it would complicate things quite a bit.\ncode = code.replace(re,[arrStr,\"[\",ptrStr,\"]\"].join(\"\"));}}break;case \"scalar\":code = code.replace(re,\"Y\" + proc.scalarArgs.indexOf(i));break;case \"index\":code = code.replace(re,\"index\");break;case \"shape\":code = code.replace(re,\"shape\");break;}}return [pre.join(\"\\n\"),code,post.join(\"\\n\")].join(\"\\n\").trim();}", "title": "" }, { "docid": "cf1a660d6073824f4703f6d5225e920d", "score": "0.5013427", "text": "function vv(a,b){this.e=[];this.o=a;this.p=b||null;this.b=this.a=!1;this.c=void 0;this.n=this.q=this.g=!1;this.f=0;this.d=null;this.i=0}", "title": "" }, { "docid": "6b2f23fe60b7fa4c6f0710262f7b2428", "score": "0.49989668", "text": "function Module() {\n 'use asm';\n function f() {}\n function g() {\n var x = 0.0;\n table[x & 3]();\n }\n var table = [f, f, f, f];\n return { g: g };\n}", "title": "" }, { "docid": "5961c990cdb221655eba65bdb68bc882", "score": "0.49985403", "text": "function vig() {\n \n}", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.49980667", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.49980667", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.49980667", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "cb23e640a6dc4cf354ca3eef6d8234b5", "score": "0.49980667", "text": "function ExpandoInstructions() { }", "title": "" }, { "docid": "c344f3044be8491c5171dda20e226e9d", "score": "0.49901593", "text": "function dummy(){\n\n}", "title": "" }, { "docid": "e5b9d3cf2bfa1621f252f3e034f9b2c1", "score": "0.49774438", "text": "function v25(v26,v27) {\n const v29 = {get:v26,set:v25};\n // v29 = .object(ofGroup: Object, withProperties: [\"__proto__\"], withMethods: [\"get\", \"set\"])\n const v31 = Object.defineProperty(v15,\"__proto__\",v29);\n // v31 = .undefined\n const v33 = [13.37,13.37];\n // v33 = .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 v34(v35,v36) {\n const v37 = v36 + 1;\n // v37 = .primitive\n return v33;\n }\n const v38 = v34(v34,v34);\n // v38 = .unknown\n let v41 = 13.37;\n function v42(v43,v44) {\n const v47 = [v38,108978604,108978604,108978604];\n // v47 = .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 v48 = v47;\n const v49 = (10).toLocaleString();\n // v49 = .unknown\n const v50 = v48.join(v49);\n // v50 = .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 v51 = eval(v50);\n // v51 = .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 return 1337;\n }\n const v52 = v42(v42,v41);\n // v52 = .unknown\n v23[8] = v27;\n const v56 = [13.37,13.37,13.37,13.37];\n // v56 = .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 v58 = [Int16Array,1392904795,v56,13.37,1337];\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 function v59(v60,v61) {\n let v66 = 100;\n const v69 = new Int8Array(127);\n // v69 = .object(ofGroup: Int8Array, withProperties: [\"byteLength\", \"constructor\", \"length\", \"__proto__\", \"buffer\", \"byteOffset\"], withMethods: [\"reduce\", \"copyWithin\", \"findIndex\", \"entries\", \"lastIndexOf\", \"map\", \"set\", \"includes\", \"indexOf\", \"sort\", \"some\", \"reverse\", \"keys\", \"reduceRight\", \"values\", \"filter\", \"forEach\", \"slice\", \"subarray\", \"join\", \"fill\", \"find\", \"every\"])\n const v70 = v69.indexOf(v66);\n // v70 = .integer\n const v73 = \"sO0KQ7OSCy\".indexOf(0,-65535);\n // v73 = .integer\n let v74 = v73;\n const v76 = typeof v16;\n // v76 = .string\n const v78 = v76 === \"number\";\n // v78 = .boolean\n function v79(v80,v81) {\n const v82 = 0;\n // v82 = .integer\n const v83 = 4;\n // v83 = .integer\n const v84 = 1;\n // v84 = .integer\n function v85(v86,v87) {\n return v56;\n }\n const v89 = {constructor:-4294967295};\n // v89 = .object(ofGroup: Object, withProperties: [\"constructor\", \"__proto__\"])\n let v90 = -4294967295;\n const v91 = -2285213110;\n // v91 = .integer\n const v92 = Uint8Array;\n // v92 = .constructor([.integer | .object()] => .object(ofGroup: Uint8Array, withProperties: [\"byteLength\", \"byteOffset\", \"constructor\", \"length\", \"buffer\", \"__proto__\"], withMethods: [\"includes\", \"join\", \"slice\", \"copyWithin\", \"filter\", \"lastIndexOf\", \"entries\", \"every\", \"fill\", \"reverse\", \"keys\", \"map\", \"subarray\", \"indexOf\", \"reduceRight\", \"forEach\", \"some\", \"find\", \"set\", \"findIndex\", \"sort\", \"reduce\", \"values\"]))\n const v93 = v81 instanceof v85;\n // v93 = .boolean\n for (let v97 = 13.37; v97 < 512; v97 = v97 + 1) {\n }\n function v98(v99,v100) {\n return v81;\n }\n return v81;\n }\n function v101(v102,v103) {\n const v105 = -506317353;\n // v105 = .integer\n const v107 = Uint32Array(0);\n // v107 = .unknown\n const v108 = Uint32Array(0);\n // v108 = .unknown\n const v111 = Int16Array;\n // v111 = .constructor([.integer | .object()] => .object(ofGroup: Int16Array, withProperties: [\"buffer\", \"byteLength\", \"constructor\", \"byteOffset\", \"length\", \"__proto__\"], withMethods: [\"some\", \"includes\", \"every\", \"set\", \"reduce\", \"reduceRight\", \"forEach\", \"join\", \"lastIndexOf\", \"values\", \"filter\", \"fill\", \"indexOf\", \"map\", \"find\", \"slice\", \"subarray\", \"copyWithin\", \"reverse\", \"sort\", \"entries\", \"keys\", \"findIndex\"]))\n const v113 = [13.37,13.37];\n // v113 = .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 v114 = [v101,126905259,noFTL,126905259,126905259];\n // v114 = .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 v115 = v5.map(isNaN);\n // v115 = .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 v117 = 0;\n const v118 = v117 + 1;\n // v118 = .primitive\n v117 = v118;\n const v119 = {__proto__:noFTL,b:v114,constructor:noFTL,length:v113};\n // v119 = .object(ofGroup: Object, withProperties: [\"length\", \"b\", \"__proto__\"], withMethods: [\"constructor\", \"__proto__\"])\n for (let v121 = v108; v121 < 100; v121 = v121 + \"2147483648\") {\n }\n }\n let v122 = 0;\n do {\n } while (v122 < 5);\n }\n const v125 = \"function\".padStart(1337,v25);\n // v125 = .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 v126 = Function(v125);\n // v126 = .unknown\n }", "title": "" }, { "docid": "3455413af3b9793c45f726dbe32d6b8a", "score": "0.49725595", "text": "function v106(v107,v108) {\n const v112 = 8;\n // v112 = .integer\n let v113 = 0;\n const v114 = 0;\n // v114 = .integer\n const v115 = 100;\n // v115 = .integer\n const v116 = 1;\n // v116 = .integer\n const v117 = \"-128\".padStart(1337,v104);\n // v117 = .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 v119 = 10;\n // v119 = .integer\n let v120 = 0;\n const v121 = v120 + 1;\n // v121 = .primitive\n v120 = v121;\n const v122 = Function(v117);\n // v122 = .unknown\n }", "title": "" }, { "docid": "32e6a37c6c7ba2f8d3f4dd02888d7c47", "score": "0.49605742", "text": "function o0(o1)\n{\n var o11 = o14.o15('pass');\n try {\nfor (var o29 = () => {\n try {\no5.o24(o16 === new.target, \"Function called as new expression has new.target set to the function in the function body\");\n}catch(e){}\n\n try {\nreturn new.target;\n}catch(e){}\n }; o259[o1091 >> [10744, 5.5, 6.6]]; o582 & 0xFFFF)\n {\n try {\ntry { o332 = 1 + o333 - o334; } catch(e) {}try { return o165.slice(0, o174); } catch(e) {}\n}catch(e){}\n }\n}catch(o41){}\n}", "title": "" }, { "docid": "01f5720756cd7ca6d9267e8fab5ee5b7", "score": "0.49590185", "text": "function m_eq_literals(stdlib, ffi, heap) {\n \"use asm\";\n\n function f() {\n\treturn (37 == 42)|0;\n }\n function g() {\n\treturn (37 == 37)|0;\n }\n return { f:f, g:g };\n}", "title": "" }, { "docid": "73b5fee244e97603d3aff59f5edfc3e4", "score": "0.4956354", "text": "function foo(){return 32;}", "title": "" } ]
b28f680577a052e14a72dfc1b3b704f8
draw map and piechart with the loaded data
[ { "docid": "e9949e78aefa4fe5fc9984228b88d10b", "score": "0.0", "text": "function ready(error, hpiData, suicideData){\n if (error){\n throw error;\n };\n\n // save hpi data in dict structure\n var hpiDict = {};\n hpiData.forEach(function(d) {\n d.hpi = +d.hpi;\n hpiDict[d.country] = d.hpi\n })\n\n var suicideDict = {}\n suicideData.forEach(function(d) {\n d.male = +d.male;\n d.female = +d.female;\n suicideDict[d.country] =[\n {gender:\"female\", suicides:d.female},\n {gender:\"male\", suicides:d.male}\n ];\n })\n console.log(suicideDict['Netherlands'])\n\n function makePiechart(countryName){\n var pieSvg = d3.select(\"#pieChart\")\n\n var colorPie = d3.scale.category10();\n\n var arc = d3.svg.arc()\n .outerRadius(radius-100)\n .innerRadius(0);\n\n var pie = d3.layout.pie()\n .sort(null)\n .value(function(d) { return d.suicides});\n\n var g = svg.selectAll(\".fan\")\n .data(pie(suicideDict[countryName]))\n .enter()\n .append(\"g\")\n .attr(\"class\", \"fan\")\n\n g.append(\"path\")\n .attr(\"d\", arc)\n .attr(\"fill\", function(d,i){ return colorPie(i); })\n\n g.append(\"text\")\n .attr(\"transform\", function(d) { return \"translate(\" + arc.centroid(d) + \")\"; })\n\t\t\t .style(\"text-anchor\", \"middle\")\n\t\t\t .text(function(d,i) { return d.data.gender; });\n }\n\n function updatePieChart(newCountryName){\n\n svg.selectAll(\".fan\").remove()\n\n var colorPie = d3.scale.category10();\n\n var pie = d3.layout.pie()\n .sort(null)\n .value(function(d) { return d.suicides});\n\n var arc = d3.svg.arc()\n .outerRadius(radius-100)\n .innerRadius(0);\n\n var g = svg.selectAll(\".fan\")\n .data(pie(suicideDict[newCountryName]))\n .enter()\n .append(\"g\")\n .attr(\"class\", \"fan\")\n\n g.append(\"path\")\n .attr(\"d\", arc)\n .attr(\"fill\", function(d,i){ return colorPie(i); })\n\n g.append(\"text\")\n .attr(\"transform\", function(d) { return \"translate(\" + arc.centroid(d) + \")\"; })\n .style(\"text-anchor\", \"middle\")\n .text(function(d,i) { return d.data.gender; });\n }\n\n // datamap\n var basic = new Datamap({\n element: document.getElementById(\"container\"),\n\n // get country name by click and update piechart\n done: function(datamap) {\n datamap.svg.selectAll('.datamaps-subunit').on('click', function(geography) {\n if (suicideDict[geography.properties.name] != undefined) {\n updatePieChart(geography.properties.name);\n };\n });\n },\n\n projection: 'mercator',\n scope: 'world',\n\n // zoom in on europe\n setProjection: function(element) {\n var projection = d3.geo.mercator()\n .center([8, 54])\n .rotate([4.4, 0])\n .scale(540)\n .translate([element.offsetWidth / 2, element.offsetHeight / 2]);\n var path = d3.geo.path()\n .projection(projection);\n return {path: path, projection: projection};\n },\n // initialize colors for countries\n fills: {\n defaultFill: \"#c5f49f\",\n norway: color(hpiDict['Norway']),\n spain: color(hpiDict['Spain']),\n netherlands: color(hpiDict['Netherlands']),\n switzerland: color(hpiDict['Switzerland']),\n denmark: color(hpiDict['Denmark']),\n unitedKingdom: color(hpiDict['United Kingdom']),\n finland: color(hpiDict['Finland']),\n iceland: color(hpiDict['Iceland']),\n austria: color(hpiDict['Austria']),\n france: color(hpiDict['France']),\n ireland: color(hpiDict['Ireland']),\n germany: color(hpiDict['Germany']),\n malta: color(hpiDict['Malta']),\n italy: color(hpiDict['Italy']),\n sweden: color(hpiDict['Sweden']),\n portugal: color(hpiDict['Portugal']),\n belgium: color(hpiDict['Belgium']),\n greece: color(hpiDict['Greece']),\n luxembourg: color(hpiDict['Luxembourg']),\n },\n\n // implement country colors\n data: {\n NOR: { fillKey: \"norway\"},\n ESP: { fillKey: \"spain\"},\n NLD: { fillKey: \"netherlands\" },\n CHE: { fillKey: \"switzerland\" },\n DNK: { fillKey: \"denmark\" },\n GBR: { fillKey: \"unitedKingdom\" },\n FIN: { fillKey: \"finland\" },\n ISL: { fillKey: \"iceland\" },\n AUT: { fillKey: \"austria\" },\n FRA: { fillKey: \"france\" },\n IRL: { fillKey: \"ireland\" },\n DEU: { fillKey: \"germany\" },\n MLT: { fillKey: \"malta\" },\n ITA: { fillKey: \"italy\" },\n SWE: { fillKey: \"sweden\" },\n PRT: { fillKey: \"portugal\" },\n BEL: { fillKey: \"belgium\" },\n GRC: { fillKey: \"greece\" },\n LUX: { fillKey: \"luxembourg\" }\n },\n\n geographyConfig: {\n highlightBorderColor: '#bada55',\n popupTemplate: function(geography, data) {\n var secondLine = ''\n if (hpiDict[geography.properties.name] != undefined) {\n secondLine = '<b> HPI: ' + hpiDict[geography.properties.name] + '</br>'\n }\n return '<div class=\"hoverinfo\"><b>' + geography.properties.name + '</br>' + secondLine + '</div> '\n },\n popupOnHover: true,\n highlightBorderColor: '#000000',\n highlightBorderWidth: 2,\n highlightFillColor: '#000000'\n },\n\n });\n\n\n\n // var updatePieChart(){\n //\n // }\n\n var pie = makePiechart(countryName)\n }", "title": "" } ]
[ { "docid": "9e3e5577219f84082200d6a908f67bc4", "score": "0.73049307", "text": "function drawChart() {\n \n\n var data = google.visualization.arrayToDataTable(arr1);\n var view = new google.visualization.DataView(data);\n // Optional; add a title and set the width and height of the chart\n\n var options = {'title': total_count, 'width':550, 'height':400, \n\t\t\tlegend: { position: 'top', maxLines: 3 },\n\t\t\ttheme: 'material',\n\t\t\ttooltip: { isHtml: true},\n\t\t\tbackgroundColor: { fill:'transparent' },\n\t\t\tanimation: {\n duration: 1500,\n startup: true\n }};\n // Display the chart inside the <div> element with id=\"piechart\"\n \n var chart = new google.visualization.ColumnChart(document.getElementById('map1'));\n chart.draw(view, options);\n}", "title": "" }, { "docid": "8a6f5f1503996da50ef47e11c691b930", "score": "0.7220448", "text": "function loadMap() {\n\tvar mapOptions = {\n\t\tcenter: new google.maps.LatLng(1.3667,103.83),\n\t\tzoom: 12,\n\t\tmapTypeId: google.maps.MapTypeId.TERRAIN,\n\t\tdraggable:false,\n\t\tpanControl: false,\n\t\tzoomControl: false,\n\t\tscaleControl: true,\n\t\tscrollwheel: false\n\t};\n\n\n\tvar map = new google.maps.Map(document.getElementById('map-canvas'),\n\t\tmapOptions);\n\n\tmap.set('styles', [\n\t\t{\n\t\t\tfeatureType: \"all\",\n\t\t\telementType: \"labels\",\n\t\t\tstylers: [\n\t\t\t\t{ visibility: \"off\" }\n\t\t\t]\n\t\t}\n\t]);\n\n\tfor (sub in results) {\n\t\tif (suburbs[sub]) {\n\t\t\tvar pieData = [{\n\t\t\t\tvalue: results[sub].Positive,\n\t\t\t\tcolor: \"#B2DC57\",\n\t\t\t\thighlight: \"#C4F160\",\n\t\t\t\tlabel: \"Positive\"\n\t\t\t}, {\n\t\t\t\tvalue: results[sub].Neutral,\n\t\t\t\tcolor: \"#70BBF5\",\n\t\t\t\thighlight: \"#8EDBFB\",\n\t\t\t\tlabel: \"Neutral\"\n\t\t\t}, {\n\t\t\t\tvalue: results[sub].Negative,\n\t\t\t\tcolor: \"#D33F26\",\n\t\t\t\thighlight: \"#F34A2D\",\n\t\t\t\tlabel: \"Negative\"\n\t\t\t}];\n\n\t\t\tvar barChartData = {\n\t\t\t\tlabels : [\"Positive\",\"Neutral\",\"Negative\"],\n\t\t\t\tdatasets : [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: sub,\n\t\t\t\t\t\tfillColor : getMajor(results[sub]),\n\t\t\t\t\t\tstrokeColor : \"black\",\n\t\t\t\t\t\thighlightFill: \"rgba(220,220,220,0.75)\",\n\t\t\t\t\t\thighlightStroke: \"rgba(220,220,220,1)\",\n\t\t\t\t\t\tdata : [results[sub].Positive, results[sub].Neutral, results[sub].Negative]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"Singapore\",\n\t\t\t\t\t\tfillColor : \"#0066CC\",\n\t\t\t\t\t\tstrokeColor : \"black\",\n\t\t\t\t\t\thighlightFill : \"rgba(151,187,205,0.75)\",\n\t\t\t\t\t\thighlightStroke : \"rgba(151,187,205,1)\",\n\t\t\t\t\t\tdata : [singapore.Positive, singapore.Neutral, singapore.Negative]\n\t\t\t\t\t}\n\t\t\t\t]\n\n\t\t\t};\n\n\t\t\tvar frequencyArea = {\n\t\t\t\tlabels : [\"Total Frequency\"],\n\t\t\t\tdatasets : [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: sub,\n\t\t\t\t\t\tfillColor : getMajor(results[sub]),\n\t\t\t\t\t\tstrokeColor : \"black\",\n\t\t\t\t\t\thighlightFill: \"rgba(220,220,220,0.75)\",\n\t\t\t\t\t\thighlightStroke: \"rgba(220,220,220,1)\",\n\t\t\t\t\t\tdata : [results[sub].Total]\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: \"Singapore\",\n\t\t\t\t\t\tfillColor : \"#0066CC\",\n\t\t\t\t\t\tstrokeColor : \"black\",\n\t\t\t\t\t\thighlightFill : \"rgba(151,187,205,0.75)\",\n\t\t\t\t\t\thighlightStroke : \"rgba(151,187,205,1)\",\n\t\t\t\t\t\tdata : [singapore.Total]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t};\n\n\t\t\tvar p = new google.maps.Polygon({\n\t\t\t\tpaths: suburbs[sub],\n\t\t\t\tstrokeColor: 'black',\n\t\t\t\tstrokeOpacity: 1,\n\t\t\t\tstrokeWeight: 2,\n\t\t\t\tfillColor: getMajor(results[sub]),\n\t\t\t\tfillOpacity: 0.6,\n\t\t\t\tindexID: sub,\n\t\t\t\tpieData: pieData,\n\t\t\t\tbarData: barChartData,\n\t\t\t\ttotalData: frequencyArea\n\t\t\t});\n\n\t\t\tp.setMap(map);\n\n\t\t\tvar mapLabel = new MapLabel({\n\t\t\t\ttext: p.indexID,\n\t\t\t\tposition: p.my_getBounds().getCenter(),\n\t\t\t\tmap: map,\n\t\t\t\tfontSize: 10,\n\t\t\t\talign: 'center'\n\t\t\t});\n\t\t\tp.label = mapLabel;\n\t\t\tp.color = p.fillColor\n\n\t\t\tmapLabel.set('position', p.my_getBounds().getCenter());\n\n\t\t\tgoogle.maps.event.addListener(p, 'click', function (event) {\n\t\t\t\t//alert the index of the polygon\n\t\t\t\tmap.setZoom(5);\n\t\t\t\tmap.fitBounds(this.my_getBounds());\n\t\t\t\tthis.label.set('fontSize', 20);\n\n\t\t\t\t// Create pie chart\n\t\t\t\tvar ctx = document.getElementById(\"chart-area\").getContext(\"2d\");\n\t\t\t\tvar myPie = new Chart(ctx).Pie(this.pieData, {\n\t\t\t\t\tresponsive: true\n\t\t\t\t});\n\n\t\t\t\t$('#region').html('in ' + this.indexID);\n\n\t\t\t\t$('#js-legend').html(myPie.generateLegend());\n\n\t\t\t\t// Create elements bar chart\n\t\t\t\tvar ctx2 = document.getElementById(\"bar-area\").getContext(\"2d\");\n\t\t\t\tvar myBar = new Chart(ctx2).Bar(this.barData, {\n\t\t\t\t\ttooltipTemplate: \"<%if (label){%><%=label%>: <%}%><%= value %>kb\",\n\t\t\t\t\tresponsive: true\n\t\t\t\t});\n\n\t\t\t\t// Create total bar chart\n\t\t\t\tvar ctx3 = document.getElementById(\"frequency-area\").getContext(\"2d\");\n\t\t\t\tvar myBar = new Chart(ctx3).Bar(this.totalData, {\n\t\t\t\t\ttooltipTemplate: \"<%if (label){%><%=label%>: <%}%><%= value %>kb\",\n\t\t\t\t\tresponsive: true\n\t\t\t\t});\n\n\t\t\t\t$('#bar-legend').html(myBar.generateLegend());\n\t\t\t\t//alert(myBar.generateLabels())\n\n\t\t\t});\n\n\t\t\tgoogle.maps.event.addListener(p, 'mouseover', function (event) {\n\t\t\t\tthis.setOptions({fillColor: \"#00FF00\"});\n\t\t\t});\n\n\t\t\tgoogle.maps.event.addListener(p, 'mouseout', function (event) {\n\t\t\t\tthis.setOptions({fillColor: this.color});\n\t\t\t});\n\t\t}\n\t}\n\n\tvar zoom_out = GMapButton.create(map, {\n\t\thtml: \"Zoom Out\",\n\t\tonclick: function () {\n\t\t\tdrawSGChart();\n\t\t\tmap.setCenter(new google.maps.LatLng(1.3667,103.83));\n\t\t\tmap.setZoom(12);\n\n\t\t\tvar barCanvas = document.getElementById(\"bar-area\");\n\t\t\tvar ctx = barCanvas.getContext(\"2d\");\n\t\t\tctx.clearRect(0, 0, barCanvas.width, barCanvas.height);\n\t\t\tvar totalCanvas = document.getElementById(\"frequency-area\");\n\t\t\tvar ctx2 = totalCanvas.getContext(\"2d\");\n\t\t\tctx2.clearRect(0, 0, totalCanvas.width, totalCanvas.height);\n\t\t\t$(\"#bar-legend\").html(\"\");\n\t\t}\n\n\n\t});\n\n\n\tmap.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(\n\t\tdocument.getElementById('map-legend'));\n\n\t$(\"#loading\").fadeOut();\n\t$(\"#container\").fadeIn(\"slow\");\n\tdrawSGChart();\n}", "title": "" }, { "docid": "9a379ada66397e2128415e4f778acee8", "score": "0.685797", "text": "function drawPieChart(dataFromJSONP){\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Project Name');\n data.addColumn('number', 'Comments');\n data.addRows([\n [dataFromJSONP.projects[0].name, dataFromJSONP.projects[0].stats.comments],\n [dataFromJSONP.projects[1].name, dataFromJSONP.projects[1].stats.comments],\n [dataFromJSONP.projects[2].name, dataFromJSONP.projects[2].stats.comments],\n \n ]);\n\n var options = {\n slices: [\n {color: '#1B2D47'},\n {color: '#1E3E75'},\n {color: '#2F4C93'},\n ],\n chartArea:{\n height:400,\n width: 700\n },\n \n };\n\n var chart = new google.visualization.PieChart(document.getElementById('chart2Location'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "721e3f47e7b0b6b762554eb124a89045", "score": "0.6798327", "text": "function drawPie() {\n var data = google.visualization.arrayToDataTable(pieData);\n\n var chart = new google.visualization.PieChart(document.getElementById('pie_div'));\n chart.draw(data, pieOptions);\n }", "title": "" }, { "docid": "721e3f47e7b0b6b762554eb124a89045", "score": "0.6798327", "text": "function drawPie() {\n var data = google.visualization.arrayToDataTable(pieData);\n\n var chart = new google.visualization.PieChart(document.getElementById('pie_div'));\n chart.draw(data, pieOptions);\n }", "title": "" }, { "docid": "b6a4b79b5e95305ed765c80aa4fe9628", "score": "0.6737542", "text": "function draw_map(data) {\n var data_to_use;\n if(draw_map.arguments.length == 1) {\n data_to_use = data;\n }\n else {\n data_to_use = loaded_data;\n }\n\n $(\"#svg_map\").datamap({\n scope: 'world',\n geography_config: {\n borderWidth: 0.3,\n borderColor: 'black',\n popupTemplate: _.template([\n '<div class=\"hoverinfo\">',\n '<strong><%= geography.properties.name %></strong></br></br>',\n '<% if (data.total) { %>',\n 'Population: <%= data.total %></br></br>',\n '<i>The distribution of age groups is shown on the right.</i></br>',\n '<% } else { %>',\n 'Population: unknown <% } %>',\n '<% draw_bar_chart(geography.properties.name, geography.id, data.total) %>',\n '</div>'\n ].join('')),\n popupOnHover: popup_on_hover,\n highlightOnHover: highlight_on_hover,\n highlightFillColor: highlight_fill_color,\n highlightBorderColor: highlight_border_color,\n highlightBorderWidth: 2\n },\n fills: data_to_use['fills'],\n data: data_to_use['data'][selected_year]\n });\n}", "title": "" }, { "docid": "db725c236ffc44ea9af050c95ac1434a", "score": "0.67206573", "text": "function drawGeochart() {\n chart.draw(currentData[current], options);\n }", "title": "" }, { "docid": "9bcceccc0530404a25634b95f73362bc", "score": "0.6679942", "text": "function populateMap() {\n // add the data rows to the data object (now that it's fulled)\n data.addRows(dataRows);\n // define the chart options (UI)\n var options = {\n region: 'AU',\n displayMode: 'markers',\n enableRegionInteractivity: 'false',\n resolution: 'provinces',\n colorAxis: {colors: ['red']},\n sizeAxis : {\n minSize: 1,\n maxSize: 1\n },\n tooltip: { isHtml: true },\n keepAspectRatio: true\n };\n // define the chart from the JS lib\n var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));\n // draw the data onto the chart\n setTimeout(function() {\n chart.draw(data, options);\n }, 1200)\n }", "title": "" }, { "docid": "87ad03d4a2c54c976a0980f57613789f", "score": "0.66660625", "text": "function drawMaps() {\n d3.json(\"california.json\", function(err, data) {\n makeMap(\"#map\", \"historical-map\", data);\n makeMap(\"#stat-wrapper\", \"stat-map\", data);\n drawReservoirs();\n });\n}", "title": "" }, { "docid": "32b2efd972845f35c51f5e41f7f4021e", "score": "0.665626", "text": "function drawPieChart (data) {\n var wrapper = new google.visualization.ChartWrapper({\n chartType: 'PieChart',\n dataTable: data,\n options: {'title': 'Codon Usage \\(triplets\\)',chartArea : {'width':'80%', 'height':'80%'}, width:700, height:600},\n containerId: 'pie_div'\n });\n wrapper.draw();\n }", "title": "" }, { "docid": "05703558403cd182e6f6ce78236cda49", "score": "0.6623645", "text": "function drawData() {\n\t\tfor(var src = 0; src < dataMappings.length; src++) {\n\t\t\tif(dataMappings[src].active) {\n\t\t\t\tif(dataMappings[src].vizType == 0 || dataMappings[src].vizType == 1 || dataMappings[src].vizType == 5) { // points or lines\n\t\t\t\t\tdrawCartesianPlot(src);\n\t\t\t\t}\n\t\t\t\telse if(dataMappings[src].vizType == 2) {\n\t\t\t\t\tdrawHeatmap(src);\n\t\t\t\t}\n\t\t\t\telse if(dataMappings[src].vizType == 3 || dataMappings[src].vizType == 4) {\n\t\t\t\t\tdraw3D(src);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7b4c5ab8838226db56bdc2c387c20384", "score": "0.66137767", "text": "function update_map() {\n\t\t\n\t\t// Size of maps depends on number of maps\n\t\tvar no_rows = cur_map.length <= 3 ? 1 : 2\n var no_cols = Math.ceil(cur_map.length / no_rows)\n vis_height = (screen.height - nav_height - 150) / no_rows\n vis_width = (screen.width - 25) / no_cols\n\t\t\n\t\t// Create functions to draw circles\n\t\tvar fun_x = d3.scale.linear().domain([0, 1]).range([50, vis_width - 50])\n\t\tvar fun_y = d3.scale.linear().domain([0, 1]).range([20, vis_height - 20])\n\t\tvar fun_r = d3.scale.sqrt().domain([0, 1]).range([0, 10]) \n\t\t\n\t\t// Loop over all maps we need to display\t\t\n\t\tfor(map_ind = 0; map_ind < cur_map.length; map_ind++) {\n \n // Push functions for zooming/panning\n zoom_level.push(1)\n fun_xx.push(d3.scale.linear().domain([0, 1]).range([0, 1]))\n fun_yy.push(d3.scale.linear().domain([0, 1]).range([0, 1]))\n \n\t\t\t// Add SVG element for current map\n vis.push(d3.select(\"#chart\")\n .append(\"svg:svg\")\n .attr(\"x\", nav_height + Math.floor(map_ind / no_cols) * vis_height)\n .attr(\"y\", 1 + (map_ind % no_cols) * vis_width)\n .attr(\"width\", vis_width - 5)\n .attr(\"height\", vis_height)\n .attr(\"opacity\", 0)\n .attr(\"map_ind\", map_ind)\n .call(d3.behavior.zoom().on(\"zoom\", redraw)))\n \n\t\t\t// Select data for current map\n\t\t\tnodes.push([])\n\t\t\tmaps.values.forEach(function(d) {\n\t\t\t\tif(d.map_no == cur_map[map_ind]) { \n\t\t\t\t\tnodes[map_ind].push({x: fun_x(d.x), y: fun_y(d.y), prop: fun_r(d.prop), fixed: true})\t// nodes\n\t\t\t\t}\n\t\t\t})\n\t\t\tvar no_words = nodes[map_ind].length\n\t\t\tmaps.values.forEach(function(d) {\n\t\t\t\tif(d.map_no == cur_map[map_ind]) { \n\t\t\t\t\tnodes[map_ind].push({x: fun_x(d.x), y: fun_y(d.y), word: d.word, fixed: false})\t\t\t// words\n\t\t\t\t}\n\t\t\t})\n\t\t\t\t\n\t\t\t// Construct links between nodes\n\t\t\tlinks.push([])\n\t\t\tfor(i = 0; i < no_words; i++) {\n\t\t\t\tlinks[map_ind].push({source: i, target: no_words + i, value: 1, type: 1})\t\t\t\t\t// link between word and node\n\t\t\t}\n\t\t\tfor(i = no_words; i < nodes[map_ind].length; i++) {\n\t\t\t\tfor(j = i + 1; j < nodes[map_ind].length; j++) {\n\t\t\t\t\tif(Math.sqrt((nodes[map_ind][i].x - nodes[map_ind][j].x) * (nodes[map_ind][i].x - nodes[map_ind][j].x) + \n\t\t\t\t\t\t\t\t (nodes[map_ind][i].y - nodes[map_ind][j].y) * (nodes[map_ind][i].y - nodes[map_ind][j].y)) < 50) {\n\t\t\t\t\t\tlinks[map_ind].push({source: i, target: j, value: 1, type: 2})\t\t\t\t\t\t// link between neighboring words\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t\n\t\t\t// Create force-directed layout\n\t\t\tforce.push(d3.layout.force()\n\t\t\t.charge(-30 / zoom_level[map_ind])\n .gravity(.1 / zoom_level[map_ind])\n\t\t\t.linkDistance(function(d) { return d.type == 1 ? 5 / zoom_level[map_ind] : 70 / zoom_level[map_ind] } )\n\t\t\t.nodes(nodes[map_ind])\n\t\t\t.links(links[map_ind])\n\t\t\t.size([vis_width, vis_height]))\n\t\t\t\n\t\t\t// Draw bounding box around SVG element\n\t\t\tvis[map_ind].selectAll(\"rect\")\n\t\t\t.data(d3.range(1, no_maps + 1))\n\t\t\t.enter().append(\"svg:rect\")\n\t\t\t.attr(\"x\", 1)\n\t\t\t.attr(\"y\", 1)\n\t\t\t.attr(\"width\", vis_width - 7)\n\t\t\t.attr(\"height\", vis_height - 2)\n\t\t\t.attr(\"stroke-width\", 1.5)\n\t\t\t.attr(\"stroke\", \"#ddd\")\n\t\t\t.attr(\"fill\", \"#fff\")\n\t\t\t\t\n\t\t\t// Draw all circles\n\t\t\tnode1.push([])\n\t\t\tnode1[map_ind] = vis[map_ind].selectAll(\"circle.node\")\n\t\t\t.data(nodes[map_ind].slice(0, no_words))\n\t\t\t.enter().append(\"svg:circle\")\n\t\t\t.attr(\"cx\", function(d) { return d.x })\n\t\t\t.attr(\"cy\", function(d) { return d.y })\n\t\t\t.attr(\"stroke-width\", 1)\n\t\t\t.attr(\"fill\", \"#00F\")\n\t\t\t.attr(\"stroke\", \"#00F\")\n\t\t\t.attr(\"fill-opacity\", .2)\n\t\t\t.attr(\"stroke-opacity\", .25)\n\t\t\t.attr(\"opacity\", 1)\n\t\t\t.attr(\"class\", \"node1\")\n\t\t\t.attr(\"r\", function(d) { return d.prop })\n\t\t\t\t\n\t\t\t// Draw all words\n\t\t\tnode2.push(vis[map_ind].selectAll(\"text.node\")\n\t\t\t.data(nodes[map_ind].slice(no_words))\n\t\t\t.enter().append(\"svg:text\")\n\t\t\t.attr(\"x\", function(d) { return d.x + 10 })\n\t\t\t.attr(\"y\", function(d) { return d.y })\n\t\t\t.attr(\"cx\", function(d) { return d.x + 10 })\n\t\t\t.attr(\"cy\", function(d) { return d.y })\n\t\t\t.attr(\"text-anchor\", \"middle\")\n\t\t\t.attr(\"fill\", \"#333\")\n\t\t\t.attr(\"opacity\", 1)\n\t\t\t.attr(\"class\", \"node2\")\n\t\t\t.text(function(d) { return d.word })\n\t\t\t.on(\"click\", function(d) { search_box[0][0].value = d.word; update_selectors(); update_all_maps_button(); redraw() }))\n //.call(force[map_ind].drag)\n \n\t\t\t// Draw links\n\t\t\tlink.push(vis[map_ind].selectAll(\"line.link\")\n\t\t\t.data(links[map_ind])\n\t\t\t.enter().insert(\"svg:line\")\n\t\t\t.attr(\"class\", \"link\")\n\t\t\t.attr(\"stroke\", \"#9ecae1\")\n\t\t\t.style(\"stroke-width\", function(d) { return d.type == 1 ? 1 : 0 })\n\t\t\t.attr(\"x1\", function(d) { return d.source.x })\n\t\t\t.attr(\"y1\", function(d) { return d.source.y })\n\t\t\t.attr(\"x2\", function(d) { return d.target.x })\n\t\t\t.attr(\"y2\", function(d) { return d.target.y })\n\t\t\t.attr(\"opacity\", 1))\n\t\t\t\n\t\t\t// Appearance transition\n\t\t\tvis[map_ind].transition().attr(\"opacity\", 1).delay(trans_len).duration(trans_len)\n\t\t\t\n\t\t\t// Start force-directed layout\n force[map_ind].start()\n\t\t}\t\t\n\t\t\n\t\t// Function called when force-directed layout is updated\n\t\tforce[0].on(\"tick\", redraw)\n\t}", "title": "" }, { "docid": "882850565c555fdb48acb4a60a949bf4", "score": "0.6572954", "text": "function mapGrafica(e) {\n var dataGraph = [];\n var elArray = new Array();\n var dataCfg;\n var totalAE = 0; \n var totalANE = 0;\n console.log(\"layer loaded\");\n\n Ymax = maps.getBounds().getNorth();\n Ymin = maps.getBounds().getSouth();\n Xmax = maps.getBounds().getEast();\n Xmin = maps.getBounds().getWest();\n\n var sql = new cartodb.SQL({\n user:\"develop\"\n }); \n\n sql.execute(\"SELECT cartodb_id, alerta_alto_bajo_i, asociacion, cadena, detalleopc, detenidos FROM alertas_alto_bajo_impacto_union WHERE ST_Contains(ST_MakeEnvelope(\"+Xmin+\",\"+Ymin+\",\"+Xmax+\",\"+Ymax+\",4326),the_geom) ORDER BY cartodb_id\")\n\n .done(function(data){\n\n for (idx in data.rows){\n \n if (data.rows[idx].alerta_alto_bajo_i == 1) {\n \ttotalAE = parseInt(totalAE) + parseInt(1);\n } else {\n \ttotalANE = parseInt(totalANE) + 1;\n }\n\n }\n\n dataCfg = \n [\n {\n \tname:\"Alertas Efectivas\",\n y:totalAE,\n },{\n \t\n name:\"Alertas No Efectivas\",\n y:totalANE,\n }\n ];\n\n console.log(dataCfg);\n \n graficapiehighcharts(totalAE,totalANE);\n /*\n\t // Forma Grafica \n\t var chart = {\n\t plotBackgroundColor: null,\n\t plotBorderWidth: null,\n\t plotShadow: false\n\t };\n\n\t var title= {\n\t text: 'Alertas Efectivas y No Efectivas'\n\t };\n\t var tooltip= {\n\t pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'\n\t };\n\t var plotOptions= {\n\t pie: {\n\t allowPointSelect: true,\n\t cursor: 'pointer',\n\t \n\t dataLabels: {\n\t enabled: true,\n\t format: '<b>{point.name}</b>: {point.percentage:.1f} %',\n\t style: {\n\t color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'\n\t }\n\t }\n\t }\n\t };\n\t var series = [{\n\t type: 'pie',\n\t name: 'Alertas SSP',\n\t data:[\n\t {\n\t \tname: 'Alertas Efectivas',\n\t \ty:totalAE,\n\t // sliced: false,\n\t // selected: false,\n\t },{\n\t name: 'Alertas No Efectivas',\n\t \ty:totalANE,\n\t // sliced: true,\n\t // selected: true\n\t }\n\t ]\n\t }];\n\t\t\t // // Radialize the colors\n\t\t\t // Highcharts.getOptions().colors = Highcharts.map(\n\t\t\t // Highcharts.getOptions().colors, function (color) {\n\t\t\t // return {\n\t\t\t // radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },\n\t\t\t // stops: [\n\t\t\t // [0, color],\n\t\t\t // [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken\n\t\t\t // ]\n\t\t\t // };\n\t\t\t // }\n\t\t\t // );\n\t\t\t // se crea el json \n\t var json = {}; \n\t json.chart = chart; \n\t json.title = title; \n\t json.tooltip = tooltip; \n\t json.series = series;\n\t json.plotOptions = plotOptions;\n\t $('#graficaCircular').highcharts(json); \n\t */\n });//Fin .done(function(data){\n}//Fin Function", "title": "" }, { "docid": "8c9603f0883fa3c18740c1c2ccc37572", "score": "0.65464056", "text": "function draw(data) {\n\t\tdrawTable.init(data);\n\t\tdrawBarChart.init(data);\n\t\tdrawLineChart.init(data);\n\t\tdrawMaps.topograph();\n\t\tdrawMaps.google();\n\t\ttimeLine.init(data);\n\t}", "title": "" }, { "docid": "77cdc0dc4116d97a5b840f50a84d151b", "score": "0.64436835", "text": "function mapIt(){\n\t$(document).ready(function(){ \n\t\t$(\"#regions_div\").show();\n \t\t$(\"#commTable\").hide();\n\t\tvar ctycnt=topCtyTable[\"12\"].length;\n\t\t\n\t\tvar mapTots =[[],[]]; \n\t\tfor(i=1;i<60;i++){\n\t\t\tmapTots[i-1][0]=topCtyTable[\"12\"][i][2];\n\t\t\tmapTots[i-1][1]=Number(topCtyTable[\"12\"][i][3]);\n\t\t}\n\t\tconsole.log(mapTots);\n\t\t\n\t\tgoogle.charts.load('current', {'packages':['geochart']});\n \t\tgoogle.charts.setOnLoadCallback(drawRegionsMap);\n \t\tfunction drawRegionsMap() {\n \t\tvar data = google.visualization.arrayToDataTable(mapTots);\n \tvar options = {};\n\t\tvar chart = new google.visualization.GeoChart(document.getElementById('regions_div'));\n \tchart.draw(data, options);\n \t\t}\t\n\t});\n}", "title": "" }, { "docid": "30845478e1e4aa1c65330878f7063826", "score": "0.64409274", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n\n // Set chart options\n var options = {'title':'테스트용 차트',\n 'width':500,\n 'height':400};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "e9652d4f2532a7c890f1e5eebe140021", "score": "0.63685715", "text": "function plotData(map) {\n // mapping functions\n let xMap = map.x;\n let yMap = map.y;\n\n // append data to SVG and plot as points\n svgScatterPlot.selectAll('.dot')\n .data(data)\n .enter()\n .append('circle')\n .attr('cx', xMap)\n .attr('cy', yMap)\n .attr('r', 3)\n .attr('fill', \"#4286f4\");\n }", "title": "" }, { "docid": "8d151c9f462164fad8412818d17dd858", "score": "0.63531905", "text": "function drawMap() {\n//data=d3.csv(\"https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/7_OneCatOneNum.csv\");\nitems=[\"Temperature\",\"Hunger\",\"Uniformity\",\"Wrap\",\"Synergy\"]\nconsole.log(adobada)\ndata=[]\n i=0;\n console.log(adobada[i]['Location'])\n // console.log(adobada[i]['Temp'])\n for(var i=0;i<adobada.length;i++)\n {\n data=[]\n\n if(i==0)\n {\n data.push([\"Temperature\",adobada[i]['Temp'],\"#f0ff0a\",adobada[i]['overall'],adobada[i]['Google'],40,120,\"#ff0a0a\",adobada[i]['Cost'],adobada[i]['Location']])\n data.push([\"Hunger\",adobada[i]['Hunger'],\"#19ff0a\",adobada[i]['overall'],adobada[i]['Google'],40,120,\"#ff0a0a\",adobada[i]['Cost'],adobada[i]['Location']])\n data.push([\"Uniformity\",adobada[i]['Uniformity'],\"#0a11ff\",adobada[i]['overall'],adobada[i]['Google'],40,120,\"#ff0a0a\",adobada[i]['Cost'],adobada[i]['Location']])\n data.push([\"Wrap\",adobada[i]['Wrap'],\"#ff1ae3\",adobada[i]['overall'],adobada[i]['Google'],40,120,\"#ff0a0a\",adobada[i]['Cost'],adobada[i]['Location']])\n data.push([\"Synergy\",adobada[i]['Synergy'],\"#FFA500\",adobada[i]['overall'],adobada[i]['Google'],40,120,\"#ff0a0a\",adobada[i]['Cost'],adobada[i]['Location']])\n \n }\n else{\n data.push([\"Temperature\",adobada[i]['Temp'],\"#f0ff0a\",adobada[i]['overall'],adobada[i]['Google'],60+i*180,120,\"#ff0a0a\",adobada[i]['Cost'],adobada[i]['Location']])\n data.push([\"Hunger\",adobada[i]['Hunger'],\"#19ff0a\",adobada[i]['overall'],adobada[i]['Google'],60+i*180,120,\"#ff0a0a\",adobada[i]['Cost'],adobada[i]['Location']])\n data.push([\"Uniformity\",adobada[i]['Uniformity'],\"#0a11ff\",adobada[i]['overall'],adobada[i]['Google'],60+i*180,120,\"#ff0a0a\",adobada[i]['Cost'],adobada[i]['Location']])\n data.push([\"Wrap\",adobada[i]['Wrap'],\"#ff1ae3\",adobada[i]['overall'],adobada[i]['Google'],60+i*180,120,\"#ff0a0a\",adobada[i]['Cost'],adobada[i]['Location']])\n data.push([\"Synergy\",adobada[i]['Synergy'],\"#FFA500\",adobada[i]['overall'],adobada[i]['Google'],60+i*180,120,\"#ff0a0a\",adobada[i]['Cost'],adobada[i]['Location']])\n }//console.log(data)\ndrawRadialChart(data);\n}\n\nfor(var i=0;i<al_pastor.length;i++)\n {\n data=[]\n if(i==0)\n {\n data.push([\"Temperature\",al_pastor[i]['Temp'],\"#f0ff0a\",al_pastor[i]['overall'],al_pastor[i]['Google'],40,370,'#00FFFF',al_pastor[i]['Cost'],al_pastor[i]['Location']])\n data.push([\"Hunger\",al_pastor[i]['Hunger'],\"#19ff0a\",al_pastor[i]['overall'],al_pastor[i]['Google'],40,370,'#00FFFF',al_pastor[i]['Cost'],al_pastor[i]['Location']])\n data.push([\"Uniformity\",al_pastor[i]['Uniformity'],\"#0a11ff\",al_pastor[i]['overall'],al_pastor[i]['Google'],40,370,'#00FFFF',al_pastor[i]['Cost'],al_pastor[i]['Location']])\n data.push([\"Wrap\",al_pastor[i]['Wrap'],\"#ff1ae3\",al_pastor[i]['overall'],al_pastor[i]['Google'],40,370,'#00FFFF',al_pastor[i]['Cost'],al_pastor[i]['Location']])\n data.push([\"Synergy\",al_pastor[i]['Synergy'],\"#FFA500\",al_pastor[i]['overall'],al_pastor[i]['Google'],40,370,'#00FFFF',al_pastor[i]['Cost'],al_pastor[i]['Location']])\n \n }\nelse{\n data.push([\"Temperature\",al_pastor[i]['Temp'],\"#f0ff0a\",al_pastor[i]['overall'],al_pastor[i]['Google'],60+i*180,370,'#00FFFF',al_pastor[i]['Cost'],al_pastor[i]['Location']])\n data.push([\"Hunger\",al_pastor[i]['Hunger'],\"#19ff0a\",al_pastor[i]['overall'],al_pastor[i]['Google'],60+i*180,370,'#00FFFF',al_pastor[i]['Cost'],al_pastor[i]['Location']])\n data.push([\"Uniformity\",al_pastor[i]['Uniformity'],\"#0a11ff\",al_pastor[i]['overall'],al_pastor[i]['Google'],60+i*180,370,'#00FFFF',al_pastor[i]['Cost'],al_pastor[i]['Location']])\n data.push([\"Wrap\",al_pastor[i]['Wrap'],\"#ff1ae3\",al_pastor[i]['overall'],al_pastor[i]['Google'],60+i*180,370,'#00FFFF',al_pastor[i]['Cost'],al_pastor[i]['Location']])\n data.push([\"Synergy\",al_pastor[i]['Synergy'],\"#FFA500\",al_pastor[i]['overall'],al_pastor[i]['Google'],60+i*180,370,'#00FFFF',al_pastor[i]['Cost'],al_pastor[i]['Location']])\n //console.log(data)\n}\ndrawRadialChart(data);\n}\n\nfor(var i=0;i<california.length;i++)\n {\n data=[]\n // if(i>49)\n // {\n // var x=60+(i-50)*180;\n // var y=1520; \n // }\n if(i>39)\n {\n var x=60+(i-40)*180;\n var y=1420; \n }\n else if(i>29)\n {\n var x=60+(i-30)*180;\n var y=1220;\n }\n\n else if(i>19)\n {\n if(i==20)\n {\n var x=40+(i-20)*180;\n var y=1020;\n }\n else{\n var x=40+(i-20)*180;\n var y=1020;\n }\n }\n else if(i>9)\n {\n if(i==10)\n {\n var x=40+(i-10)*180;\n var y=820;\n }\n else{\n var x=60+(i-10)*180;\n var y=820;\n }\n }\n else{\n var x=60+i*180;\n var y=620;\n }\n if(i==0){\n data.push([\"Temperature\",california[i]['Temp'],\"#f0ff0a\",california[i]['overall'],california[i]['Google'],40,620,'#bf3117',california[i]['Cost'],california[i]['Location']])\n data.push([\"Hunger\",california[i]['Hunger'],\"#19ff0a\",california[i]['overall'],california[i]['Google'],40,620,'#bf3117',california[i]['Cost'],california[i]['Location']])\n data.push([\"Uniformity\",california[i]['Uniformity'],\"#0a11ff\",california[i]['overall'],california[i]['Google'],40,620,'#bf3117',california[i]['Cost'],california[i]['Location']])\n data.push([\"Wrap\",california[i]['Wrap'],\"#ff1ae3\",california[i]['overall'],california[i]['Google'],40,620,'#bf3117',california[i]['Cost'],california[i]['Location']])\n data.push([\"Synergy\",california[i]['Synergy'],\"#FFA500\",california[i]['overall'],california[i]['Google'],40,620,'#bf3117',california[i]['Cost'],california[i]['Location']])\n \n }\n else{\n data.push([\"Temperature\",california[i]['Temp'],\"#f0ff0a\",california[i]['overall'],california[i]['Google'],x,y,'#bf3117',california[i]['Cost'],california[i]['Location']])\n data.push([\"Hunger\",california[i]['Hunger'],\"#19ff0a\",california[i]['overall'],california[i]['Google'],x,y,'#bf3117',california[i]['Cost'],california[i]['Location']])\n data.push([\"Uniformity\",california[i]['Uniformity'],\"#0a11ff\",california[i]['overall'],california[i]['Google'],x,y,'#bf3117',california[i]['Cost'],california[i]['Location']])\n data.push([\"Wrap\",california[i]['Wrap'],\"#ff1ae3\",california[i]['overall'],california[i]['Google'],x,y,'#bf3117',california[i]['Cost'],california[i]['Location']])\n data.push([\"Synergy\",california[i]['Synergy'],\"#FFA500\",california[i]['overall'],california[i]['Google'],x,y,'#bf3117',california[i]['Cost'],california[i]['Location']])\n }\n //console.log(data)\ndrawRadialChart(data);\n}\n\nfor(var i=0;i<surf_and_turf.length;i++)\n {\n data=[]\n if(i==0)\n {\n data.push([\"Temperature\",surf_and_turf[i]['Temp'],\"#f0ff0a\",surf_and_turf[i]['overall'],surf_and_turf[i]['Google'],40,1670,'#9400d3',surf_and_turf[i]['Cost'],surf_and_turf[i]['Location']])\n data.push([\"Hunger\",surf_and_turf[i]['Hunger'],\"#19ff0a\",surf_and_turf[i]['overall'],surf_and_turf[i]['Google'],40,1670,'#9400d3',surf_and_turf[i]['Cost'],surf_and_turf[i]['Location']])\n data.push([\"Uniformity\",surf_and_turf[i]['Uniformity'],\"#0a11ff\",surf_and_turf[i]['overall'],surf_and_turf[i]['Google'],40,1670,'#9400d3',surf_and_turf[i]['Cost'],surf_and_turf[i]['Location']])\n data.push([\"Wrap\",surf_and_turf[i]['Wrap'],\"#ff1ae3\",surf_and_turf[i]['overall'],surf_and_turf[i]['Google'],40,1670,'#9400d3',surf_and_turf[i]['Cost'],surf_and_turf[i]['Location']])\n data.push([\"Synergy\",surf_and_turf[i]['Synergy'],\"#FFA500\",surf_and_turf[i]['overall'],surf_and_turf[i]['Google'],40,1670,'#9400d3',surf_and_turf[i]['Cost'],surf_and_turf[i]['Location']])\n \n }\n\n else{\n data.push([\"Temperature\",surf_and_turf[i]['Temp'],\"#f0ff0a\",surf_and_turf[i]['overall'],surf_and_turf[i]['Google'],60+i*180,1670,'#9400d3',surf_and_turf[i]['Cost'],surf_and_turf[i]['Location']])\n data.push([\"Hunger\",surf_and_turf[i]['Hunger'],\"#19ff0a\",surf_and_turf[i]['overall'],surf_and_turf[i]['Google'],60+i*180,1670,'#9400d3',surf_and_turf[i]['Cost'],surf_and_turf[i]['Location']])\n data.push([\"Uniformity\",surf_and_turf[i]['Uniformity'],\"#0a11ff\",surf_and_turf[i]['overall'],surf_and_turf[i]['Google'],60+i*180,1670,'#9400d3',surf_and_turf[i]['Cost'],surf_and_turf[i]['Location']])\n data.push([\"Wrap\",surf_and_turf[i]['Wrap'],\"#ff1ae3\",surf_and_turf[i]['overall'],surf_and_turf[i]['Google'],60+i*180,1670,'#9400d3',surf_and_turf[i]['Cost'],surf_and_turf[i]['Location']])\n data.push([\"Synergy\",surf_and_turf[i]['Synergy'],\"#FFA500\",surf_and_turf[i]['overall'],surf_and_turf[i]['Google'],60+i*180,1670,'#9400d3',surf_and_turf[i]['Cost'],surf_and_turf[i]['Location']])\n }//console.log(data)\ndrawRadialChart(data);\n}\n\nfor(var i=0;i<carnitas.length;i++)\n {\n data=[]\n if(i>9)\n {\n if(i==10)\n {\n var x=40+(i-10)*180;\n var y=2120;\n }\n else{\n var x=60+(i-10)*180;\n var y=2120;\n }\n }\n else\n {\n var x=60+i*180;\n var y=1920;\n }\n if(i==0)\n {\n data.push([\"Temperature\",carnitas[i]['Temp'],\"#f0ff0a\",carnitas[i]['overall'],carnitas[i]['Google'],40,1920,'#006400',carnitas[i]['Cost'],carnitas[i]['Location']])\n data.push([\"Hunger\",carnitas[i]['Hunger'],\"#19ff0a\",carnitas[i]['overall'],carnitas[i]['Google'],40,1920,'#006400',carnitas[i]['Cost'],carnitas[i]['Location']])\n data.push([\"Uniformity\",carnitas[i]['Uniformity'],\"#0a11ff\",carnitas[i]['overall'],carnitas[i]['Google'],40,1920,'#006400',carnitas[i]['Cost'],carnitas[i]['Location']])\n data.push([\"Wrap\",carnitas[i]['Wrap'],\"#ff1ae3\",carnitas[i]['overall'],carnitas[i]['Google'],40,1920,'#006400',carnitas[i]['Cost'],carnitas[i]['Location']])\n data.push([\"Synergy\",carnitas[i]['Synergy'],\"#FFA500\",carnitas[i]['overall'],carnitas[i]['Google'],40,1920,'#006400',carnitas[i]['Cost'],carnitas[i]['Location']])\n }\n else\n {\n data.push([\"Temperature\",carnitas[i]['Temp'],\"#f0ff0a\",carnitas[i]['overall'],carnitas[i]['Google'],x,y,'#006400',carnitas[i]['Cost'],carnitas[i]['Location']])\n data.push([\"Hunger\",carnitas[i]['Hunger'],\"#19ff0a\",carnitas[i]['overall'],carnitas[i]['Google'],x,y,'#006400',carnitas[i]['Cost'],carnitas[i]['Location']])\n data.push([\"Uniformity\",carnitas[i]['Uniformity'],\"#0a11ff\",carnitas[i]['overall'],carnitas[i]['Google'],x,y,'#006400',carnitas[i]['Cost'],carnitas[i]['Location']])\n data.push([\"Wrap\",carnitas[i]['Wrap'],\"#ff1ae3\",carnitas[i]['overall'],carnitas[i]['Google'],x,y,'#006400',carnitas[i]['Cost'],carnitas[i]['Location']])\n data.push([\"Synergy\",carnitas[i]['Synergy'],\"#FFA500\",carnitas[i]['overall'],carnitas[i]['Google'],x,y,'#006400',carnitas[i]['Cost'],carnitas[i]['Location']])\n }//console.log(data)\ndrawRadialChart(data);\n}\n\n\nfor(var i=0;i<carne_asada.length;i++)\n {\n data=[]\n if(i>19)\n {\n if(i==20)\n {\n var x=40+(i-20)*180;\n var y=2750;\n }\n else{\n var x=60+(i-20)*180;\n var y=2750;\n }\n }\n else if(i>9)\n {\n if(i==10)\n {\n var x=40 +(i-10);\n var y=2550;\n }\n else{\n var x=60+(i-10)*180;\n var y=2550;\n }\n }\n else{\n var x=60+i*180;\n var y=2350;\n }\n if(i==0)\n {\n data.push([\"Temperature\",carne_asada[i]['Temp'],\"#f0ff0a\",carne_asada[i]['overall'],carne_asada[i]['Google'],40,2350,'#74282d',carne_asada[i]['Cost'],carne_asada[i]['Location']])\n data.push([\"Hunger\",carne_asada[i]['Hunger'],\"#19ff0a\",carne_asada[i]['overall'],carne_asada[i]['Google'],40,2350,'#74282d',carne_asada[i]['Cost'],carne_asada[i]['Location']])\n data.push([\"Uniformity\",carne_asada[i]['Uniformity'],\"#0a11ff\",carne_asada[i]['overall'],carne_asada[i]['Google'],40,2350,'#74282d',carne_asada[i]['Cost'],carne_asada[i]['Location']])\n data.push([\"Wrap\",carne_asada[i]['Wrap'],\"#ff1ae3\",carne_asada[i]['overall'],carne_asada[i]['Google'],40,2350,'#74282d',carne_asada[i]['Cost'],carne_asada[i]['Location']])\n data.push([\"Synergy\",carne_asada[i]['Synergy'],\"#FFA500\",carne_asada[i]['overall'],carne_asada[i]['Google'],40,2350,'#74282d',carne_asada[i]['Cost'],carne_asada[i]['Location']])\n \n }\n else{\n data.push([\"Temperature\",carne_asada[i]['Temp'],\"#f0ff0a\",carne_asada[i]['overall'],carne_asada[i]['Google'],x,y,'#74282d',carne_asada[i]['Cost'],carne_asada[i]['Location']])\n data.push([\"Hunger\",carne_asada[i]['Hunger'],\"#19ff0a\",carne_asada[i]['overall'],carne_asada[i]['Google'],x,y,'#74282d',carne_asada[i]['Cost'],carne_asada[i]['Location']])\n data.push([\"Uniformity\",carne_asada[i]['Uniformity'],\"#0a11ff\",carne_asada[i]['overall'],carne_asada[i]['Google'],x,y,'#74282d',carne_asada[i]['Cost'],carne_asada[i]['Location']])\n data.push([\"Wrap\",carne_asada[i]['Wrap'],\"#ff1ae3\",carne_asada[i]['overall'],carne_asada[i]['Google'],x,y,'#74282d',carne_asada[i]['Cost'],carne_asada[i]['Location']])\n data.push([\"Synergy\",carne_asada[i]['Synergy'],\"#FFA500\",carne_asada[i]['overall'],carne_asada[i]['Google'],x,y,'#74282d',carne_asada[i]['Cost'],carne_asada[i]['Location']])\n }//console.log(data)\ndrawRadialChart(data);\n}\n\n\n\n//console.log(california.length)\n\n\n}", "title": "" }, { "docid": "0ef9dd69c7b80f9495e1fba62027852e", "score": "0.63266766", "text": "function chartOne() {\n\n $.ajax({\n url: \"js/data.json\",\n dataType: \"json\",\n type: \"GET\",\n success:function(dataSeason){\n\n var dataOne = new google.visualization.DataTable();\n dataOne.addColumn('string','season');\n dataOne.addColumn('number','percentage');\n for (var i = 0; i < dataSeason.length; i++) {\n dataOne.addRow([\n dataSeason[i].season,\n dataSeason[i].percentage\n ]);\n } \n\n var optionsOne = {\n colors: ['#83CFC7', '#3C6361', '#DAE05C', '#A3A126'],\n backgroundColor: {\n fill: 'transparent'\n },\n fontName: 'helvetica',\n fontSize: '26',\n legend: {\n textStyle:{\n color: '#FDFFDB'\n }\n }\n\n };\n\n var chartOne = new google.visualization.PieChart(document.getElementById('topLeft'));\n\n chartOne.draw(dataOne, optionsOne);\n\n},\nerror:function(error){\n console.log(\"ERROR\");\n console.log(error);\n}\n\n });//ajax\n}", "title": "" }, { "docid": "423fb44730d1c0535c5c6816aea5366a", "score": "0.63243145", "text": "function initCharts() {\n google.charts.load('current', {'packages': ['corechart']});\n google.charts.setOnLoadCallback(initMap);\n}", "title": "" }, { "docid": "4d49e3414ebdb934d784e8319684e924", "score": "0.6308402", "text": "function drawChart() {\n\n // Create the data table.\n data = new google.visualization.DataTable();\n\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Pop-Rock', 20],\n ['Hip-Hop & Reggae', 20],\n ['Jazz & Blues', 20],\n ['Musique du monde', 20],\n ['Hard Rock & Métal', 20],\n ['Musique électronique', 20],\n ['chanson', 20],\n ['autres', 20]\n\n\n ]);\n\n // Set chart options\n options = {'title':'Repartition des genres dans la playlist',\n 'width':600,\n 'height':400,\n is3D: true,\n legend: {\n position: 'labeled',\n },\n backgroundColor: 'transparent'\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "287f9759ed986e2b4f515ca79826b0d5", "score": "0.6307377", "text": "function mapLoad(data) {\r\n\r\n\t// getting the min and max value\r\n\tvar onlyUsage = data.map(function(obj) { return obj.happinessScore; });\r\n\tvar minValue = Math.min.apply(null, onlyUsage),\r\n\t\t\tmaxValue = Math.max.apply(null, onlyUsage);\r\n\t\r\n\t// dataset containing info for filling the countries \r\n\tdataset = {};\t\r\n\r\n\t// create color palette function\r\n\tvar paletteScale = d3.scale.linear()\r\n\t .domain([minValue,maxValue])\r\n\t .range([\"#62808d\",\"#FFF550\"]); // light grey - yellow\r\n\t // fill dataset in appropriate format\r\n\tdata.forEach(function(item){ //\r\n\t // item example value [\"USA\", \"#FFFFFF\"]\r\n\t var iso = item.countryCode,\r\n\t value = item.happinessScore;\r\n\t dataset[iso] = { numberOfThings: value, fillColor: paletteScale(value) };\r\n\t}); \r\n\r\n\trendermap();\r\n\trenderScatterplot(data)\r\n\r\n\tvar svg = d3.select(\".datamap\"); \r\n\t// adds title and gradient scale\r\n\tvar margin = {top: 60, right: -30, bottom: 30, left: -30},\r\n\twidth = 800 - margin.left - margin.right,\r\n height = 600 - margin.top - margin.bottom;\r\n\r\n // sets Title for the Map\r\n\tsvg.append(\"text\")\r\n\t\t.attr(\"x\", (width * 0.5))\r\n\t\t.attr(\"y\", (height * 0.2))\r\n\t\t.attr(\"text-anchor\", \"middle\")\r\n\t\t.style(\"font-size\", \"25px\")\r\n\t\t.style(\"text-decoration\", \"underline\")\r\n\t\t.text(\"Happiness per country in: \" + year);\r\n\r\n\tvar defs = svg.append(\"defs\");\r\n\r\n\t//Append a linear Gradient element to the SVG\r\n\tvar linearGradient = defs.append(\"linearGradient\")\r\n\t\t.attr(\"id\", \"linear-gradient\");\r\n\r\n\tlinearGradient\r\n\t\t.attr(\"y1\", \"0%\")\r\n\t\t.attr(\"y2\",\"0%\")\r\n\t\t.attr(\"x1\", \"0%\")\r\n\t\t.attr(\"x2\", \"100%\");\r\n\r\n\tlinearGradient.append(\"stop\")\r\n\t\t.attr(\"offset\", \"0%\")\r\n\t\t.attr(\"stop-color\", \"#62808d\") // brown\r\n\r\n\tlinearGradient.append(\"stop\")\r\n\t\t.attr(\"offset\", \"100%\")\r\n\t\t.attr(\"stop-color\", \"#FFF550\") // yellow\r\n\r\n\tsvg.append(\"text\")\r\n\t\t.attr(\"x\", width * 0.15)\r\n\t\t.attr(\"y\", height * 1.23)\r\n\t\t.text(\"0\")\r\n\r\n\t// title and numbers to the gradient bar\r\n\tsvg.append(\"text\")\r\n\t\t.attr(\"x\", width * 0.33)\r\n\t\t.attr(\"y\", height * 1.23)\r\n\t\t.text(\"Cantril ladder (happiness Index)\")\r\n\r\n\tsvg.append(\"text\")\r\n\t\t.attr(\"x\", width * 0.73)\r\n\t\t.attr(\"y\", height * 1.23)\r\n\t\t.text(\"10\")\r\n\r\n\tsvg.append(\"rect\")\r\n\t\t.attr(\"x\", width * 0.15)\r\n\t\t.attr(\"y\", height * 1.25)\r\n\t\t.attr(\"class\", \"gradient-rect\")\r\n\t\t.attr(\"width\", width * 0.6)\r\n\t\t.attr(\"height\", height * 0.05)\r\n\t\t.style(\"fill\", \"url(#linear-gradient)\");\r\n}", "title": "" }, { "docid": "b23dde350db55fdb14524679906dcc0b", "score": "0.6277034", "text": "function get_data_and_draw_map() {\n d3.json(\"data/data.json\", function(error, json) {\n if(error) {\n console.log(error);\n };\n // 'loaded_data' is a global!\n loaded_data = json;\n draw_map();\n });\n}", "title": "" }, { "docid": "34dfd2abf261a5deadd177c8ff9361c5", "score": "0.6271794", "text": "function mapGraficacolum2(e) {\n var dataGraph = [];\n var elArray = new Array();\n var dataCfg;\n var totalAE = 0; \n var totalANE = 0;\n // console.log(\"layer loaded\");\n\n Ymax = maps.getBounds().getNorth();\n Ymin = maps.getBounds().getSouth();\n Xmax = maps.getBounds().getEast();\n Xmin = maps.getBounds().getWest();\n\n var sql = new cartodb.SQL({\n user:\"develop\"\n }); \n\n sql.execute(\"SELECT cartodb_id, alerta_alto_bajo_i, asociacion, cadena, detalleopc, detenidos FROM alertas_alto_bajo_impacto_union WHERE ST_Contains(ST_MakeEnvelope(\"+Xmin+\",\"+Ymin+\",\"+Xmax+\",\"+Ymax+\",4326),the_geom) ORDER BY cartodb_id\")\n\n .done(function(data){\n\n for (idx in data.rows){\n \n if (data.rows[idx].alerta_alto_bajo_i == 1) {\n \ttotalAE = parseInt(totalAE) + parseInt(1);\n } else {\n \ttotalANE = parseInt(totalANE) + 1;\n }\n\n }\n\n dataCfg = \n [\n {\n \tname:\"Alertas Efectivas\",\n y:totalAE,\n },{\n \t\n name:\"Alertas No Efectivas\",\n y:totalANE,\n }\n ];\n\n // console.log(dataCfg);\n \n graficacolum2highcharts(\"\",\"\"); //Graphics3 code\n\n });//Fin .done(function(data){\n}//Fin Function", "title": "" }, { "docid": "083aaf10f1c6840c7114248c850bef7e", "score": "0.6266149", "text": "drawChart() {\n const results = this.fetchData();\n const db = this.props.session;\n\n if (!results || Object.keys(results.divisions).length < 1) return;\n\n const state = db.Division\n .filter(d => d.level === 'state')\n .first();\n\n if (!state || !state.topojson) return;\n\n chart.create(\n '#turnout-chart',\n results,\n state.topojson,\n `https://www.politico.com/interactives/elections/cdn/historical-results/2016-11-08/president/${window.appConfig.stateSlug}/data.json`,\n {\n range: ['#2b6abd', '#fd5639'],\n circlePadding: 4,\n minimumToShow: 6,\n rangeMax: 20,\n mapWidth: 100,\n mapHeight: 100,\n circleRadius: document.body.clientWidth < 450 ? 4 : 6,\n },\n );\n }", "title": "" }, { "docid": "8ae360e3b12e4c316a9846ffe960cf7b", "score": "0.62660116", "text": "function plotData(map) {\r\n\r\n // mapping functions\r\n let xMap = map.x;\r\n let yMap = map.y;\r\n\r\n // scaling functions\r\n let xScale = map.xScale\r\n let yScale = map.yScale\r\n\r\n svgContainer.selectAll('.dot')\r\n .data(data)\r\n .enter()\r\n .append('circle')\r\n .attr('cx', xMap)\r\n .attr('cy', yMap)\r\n .attr('r', 4)\r\n .attr('fill', \"#4286f4\")\r\n .style(\"opacity\", 0.6) // Make it possible to see all the dots\r\n .style(\"stroke\", \"#244ED9\") // Give each dot an outline\r\n\r\n .on(\"mouseover\", (d) => {\r\n div.transition()\r\n .duration(200)\r\n .style(\"opacity\", .9)\r\n .style(\"left\", (d3.event.pageX) + \"px\")\r\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\r\n })\r\n .on(\"mouseout\", (d) => {\r\n div.transition()\r\n .duration(500)\r\n .style(\"opacity\", 0);\r\n });\r\n\r\n }", "title": "" }, { "docid": "e443d4dd29dab3ba74984e45c86568e6", "score": "0.6260504", "text": "drawMap(world,allData) {\n\n //(note that projection is a class member\n // updateMap() will need it to add the winner/runner_up markers.)\n\n // ******* TODO: PART IV *******\n\n // Draw the background (country outlines; hint: use #map)\n // Make sure and add gridlines to the map\n\n // Hint: assign an id to each country path to make it easier to select afterwards\n // we suggest you use the variable in the data element's .id field to set the id\n\n // Make sure and give your paths the appropriate class (see the .css selectors at\n // the top of the provided html file)\n\n\n\n let path = d3.geoPath()\n .projection(this.projection);\n\n d3.select(\"#map\").selectAll(\"path\")\n .data(topojson.feature(world,world.objects.countries).features)\n .enter()\n .append(\"path\")\n .attr(\"d\", path)\n .classed(\"countries\",true)\n .attr(\"id\",function (d) {\n return d.id;\n });\n\n let graticule = d3.geoGraticule();\n d3.select(\"#map\")\n .append(\"path\")\n .datum(graticule)\n .attr('class', \"grat\")\n .attr('d', path)\n .attr('fill', 'none');\n\n d3.selectAll(\".countries\")\n .on(\"click\", function (d) {\n d3.selectAll(\".newpanel\").remove();\n let newpanel = d3.select(\"#bar-chart\")\n .append(\"div\")\n .classed(\"newpanel\",true);\n newpanel\n .append(\"div\")\n .classed(\"xcountry\",true)\n .append(\"H2\")\n .text(d['id'])\n newpanel\n .append(\"div\")\n .classed(\"xyears\",true)\n .append(\"H3\")\n .text(\"Participated in the years: \")\n for(let worldcup of allData){\n if(worldcup['teams_iso'].indexOf(d['id']) > -1) {\n d3.select(\".xyears\")\n .append(\"div\").text(worldcup['year'])\n }\n }\n\n\n })\n }", "title": "" }, { "docid": "e969fb760d654d364f5c43852fda4bb5", "score": "0.62566644", "text": "function drawChart(){\n // get the data from text area within web page\n data = document.getElementById('json-data').value;\n // edit the percent array using custom function\n percentArray = createPercentArray();\n // create a color array with custom function\n colorArray = createRandomColorArray();\n // convert json data into array off object\n populateArray(data);\n // draw all pie pieces of the chart\n drawPie();\n}", "title": "" }, { "docid": "d1dcbab0c7fdd6018a709b648e92a035", "score": "0.62288445", "text": "function whenDataLoaded() {\n legend.addTo(map);\n updateColorScheme();\n geojson.setStyle(style);\n changeWordCloud();\n\n}", "title": "" }, { "docid": "fc46ddacebdaac208aaf9d1d55b37d61", "score": "0.6221051", "text": "function mapGraficacolum(e) {\n var dataGraph = [];\n var elArray = new Array();\n var dataCfg;\n var totalAE = 0; \n var totalANE = 0;\n // console.log(\"layer loaded\");\n\n Ymax = maps.getBounds().getNorth();\n Ymin = maps.getBounds().getSouth();\n Xmax = maps.getBounds().getEast();\n Xmin = maps.getBounds().getWest();\n\n var sql = new cartodb.SQL({\n user:\"develop\"\n }); \n\n sql.execute(\"SELECT cartodb_id, alerta_alto_bajo_i, asociacion, cadena, detalleopc, detenidos FROM alertas_alto_bajo_impacto_union WHERE ST_Contains(ST_MakeEnvelope(\"+Xmin+\",\"+Ymin+\",\"+Xmax+\",\"+Ymax+\",4326),the_geom) ORDER BY cartodb_id\")\n\n .done(function(data){\n\n for (idx in data.rows){\n \n if (data.rows[idx].alerta_alto_bajo_i == 1) {\n \ttotalAE = parseInt(totalAE) + parseInt(1);\n } else {\n \ttotalANE = parseInt(totalANE) + 1;\n }\n\n }\n\n dataCfg = \n [\n {\n \tname:\"Alertas Efectivas\",\n y:totalAE,\n },{\n \t\n name:\"Alertas No Efectivas\",\n y:totalANE,\n }\n ];\n\n // console.log(dataCfg);\n \n graficacolumhighcharts(\"\",\"\"); //Graphics3 code\n\n });//Fin .done(function(data){\n}//Fin Function", "title": "" }, { "docid": "2ba3abb54e652fa23b43ae6407f887ef", "score": "0.6220781", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n $.getJSON('data.json', function(jsonData) { \n data.addColumn('string', 'name');\n data.addColumn('number', 'followers');\n jsonData.children.forEach(function(child){\n data.addRows([[child.name, child.size]]);\n });\n\n // Set chart options\n var options = {'title':'Am I followed?','legend':'left','is3D':true,'width':1600,'height':1200};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n });\n }", "title": "" }, { "docid": "7fe1d1572398e13d7b86a8a05efd2b84", "score": "0.62095207", "text": "function loadDataPieChart(dependency) {\n \n $.getJSON( urlChartJson , function(data) {\n \n var plots;\n var strJSon = \"[{}]\"; \n plots = jsonPath(data, \"$.[?(@.id=='\"+dependency+\"')].plots[*]\");\n strJSon = JSON.stringify(plots);\n var data = JSON.parse(strJSon);\n\n var numTotales = 0; //Sum of all obras for titulo\n for(var dd in data){\n numTotales += parseInt(data[dd].y);\n }\n \n var chartShowInLegend = false; //Deprecable\n \n var widthWindow = jQuery(window).width()\n \n\n //Crea un div con los legends\n var legendCh = '<div id=\"containerLegends\">';\n for(var i in data){\n if(data[i].y == 0 || data[i].y == null ){\n ;\n }else{\n var shape = '<svg xmlns=\"http://www.w3.org/2000/svg\"> <circle fill=\"'+ data[i].color +'\" /> </svg>'\n var spanY = '<span>'+ data[i].y +'</span> '\n var spanName = '<span>'+ data[i].name +'</span> ';\n var valuePercent = parseInt(data[i].y)*100/numTotales ;\n var spanPercent = '<span>'+ Math.round(valuePercent*10)/10 +'%</span> ';\n legendCh += '<p class=\"legendRebanada\"> '+ shape + spanY + spanName + spanPercent + '</p>';\n }\n }\n legendCh += '</div>';\n\n\n\n \n if(widthWindow < 600){\n var chartDataLabel = false; \n document.getElementById('genl-legend-pie-chart').innerHTML = legendCh;\n }else{\n var chartDataLabel = true;\n document.getElementById('genl-legend-pie-chart').innerHTML = '';\n }\n \n \n \n for (var y in data ){\n if(data[y].y == 0){\n data[y].y = null\n }\n }\n \t \n var options = {\n \t chart: {\n \t \t type: 'pie',\n options3d: {\n enabled: true,\n alpha: 45,\n beta: 0\n },\n /*events: {\n render: function () {\n var enableDataLabel = setLegendsChart(data);\n console.log(this);\n this.series[0].plotOptions.dataLabels.enabled = enableDataLabel\n }\n } */ \n \t \t},\n \t \ttitle: {\n \t text: 'TOTAL DE OBRAS ' + numTotales\n \t \t},\n \t \ttooltip: {\n \t pointFormat: '<b>{point.percentage:.1f} %</b>'\n \t \t},\n \t \tplotOptions: {\n \t \t pie: {\n \t \t\t allowPointSelect: true,\n \t \t\t cursor: 'pointer',\n depth: 35,\n showInLegend: false,\n \t point: {\n \t events: {\n \t click: function () {\n var dependency= $('#dependency option:selected').val();\n var url = \"./tablaCelular2.html\" + \"#\" + dependency + \",\" + this.x;\n window.open( url ,\"_self\"); \n \t //loadModalTable(this.x, this.name, this.y);\n \t },\n legendItemClick: function(){\n this.slice(null);\n return false;\n }\n \t }\n \t },\t\t\t\t\t\t\t\t\t \n \t \t\t dataLabels: {\n \t \t\t enabled: chartDataLabel,\n \t \t\t color: '#000000',\n \t \t\t connectorColor: '#000000',\n \t \t\t format: '<b>{point.name}</b>: {point.y:.0f}'\n \t }\n \t \t }\n \t },\n /*legend: {\n useHTML: true,\n labelFormatter: function () {\n console.log(this);\n bb=this\n var a = this.percentage\n var styleText = ' style=\"font-family: \\'Poppins\\', sans-serif; font-weight: 400; margin: 2px 2px;\" '\n var nameO = '<span '+ styleText +'>' + this.name + '</span> </tspan>'\n var yValue = this.y === null ? 0 : this.y;\n var pYO = '<span '+ styleText +'>' + yValue + '</span> </tspan>'\n var percentO = '<span '+ styleText +'>' + this.percentage.toFixed(2) + '%</span> '\n\n if( yValue === 0 ){\n this.options.color = \"#777\"\n this.legendGroup.element.style.display = \"none\"\n return null;\n }\n \n var re = this.y === null ? null : pYO + nameO + percentO ;\n return re;\n }\n },*/\n credits: {\n enabled: false\n },\t\t\n \t \tseries: [{\n \t \t data: []\n \t \t}]\n \t };\n\n \t chart = Highcharts.chart('genl-pie-chart', options);\n \t chart.series[0].setData(data);\n \t \n \n }).done(function() {\n ;\n })\n .fail(function(jqxhr, textStatus, error) {\n console.log( jqxhr);\n console.log( textStatus);\n console.log( error);\n })\n .always(function() {\n ;\n });\n}", "title": "" }, { "docid": "28df05c659effe1502e4ccaa067b1a7f", "score": "0.6195056", "text": "function drawChart() {\r\n var data = google.visualization.arrayToDataTable([\r\n ['Kategoria', 'Kwota [zł]'],\r\n ['Jedzenie', 134],\r\n ['Mieszkanie', 580],\r\n ['Transport', 0],\r\n ['Telekomunikacja', 0],\r\n ['Opieka zdrowotna', 0],\r\n ['Ubranie', 0],\r\n ['Higiena', 18],\r\n ['Dzieci', 0],\r\n ['Rozrywka', 0],\r\n ['Wycieczka', 0],\r\n ['Szkolenia', 0],\r\n ['Książki', 0],\r\n ['Oszczędności', 0],\r\n ['Na emeryturę', 0],\r\n ['Spłata długów', 0],\r\n ['Darowizna', 0],\r\n ['Inne', 0],\r\n]);\r\n\r\n // Optional; add a title and set the width and height of the chart\r\n var options = {\r\n title:'Wydatki:',\r\n backgroundColor:'transparent',\r\n legend:'none',\r\n pieSliceText:'label',\r\n 'width':'100%',\r\n 'height':700,\r\n 'chartArea':{'width':'80%','height':'80%'}\r\n\r\n };\r\n\r\n // Display the chart inside the <div> element with id=\"piechart\"\r\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\r\n chart.draw(data, options);\r\n}", "title": "" }, { "docid": "5d5f6cf2affa01369863218e72a1a08c", "score": "0.61912054", "text": "function getData(map){\n //load the data\n $.ajax(\"data/women-in-congress2.geojson\", {\n dataType: \"json\",\n success: function(response){\n\t\t\t\n\t\t\tvar attributes = processData(response);\n\t\t\t\n //call function to create proportional symbols\n\t\t\tcreatePropSymbols(response, map, attributes);\n\t\t\tcreateSequenceControls(map, attributes);\n\t\t\tcreateLegend(map, attributes);\n }\n });\n}", "title": "" }, { "docid": "a46ad0bdc14c953e578a3a60e63fb5c3", "score": "0.61861455", "text": "function load(journeyNumber, panelNumber) {\n\n // global var - var for marker bounds (used for setting the zoom and centre)\n markerBounds = new google.maps.LatLngBounds();\n // global var - new array holding polyline\n routeArray = [];\n // global var - create array for area chart\n areaChartInputData = [['Point', 'Speed (mph)', 'Battery (%)']];\n\n // setup map options\n var mapOptions={\n center: new google.maps.LatLng(54.5954, -5.876),\n zoom: 13,\n //mapTypeId: 'roadmap'\n };\n\n // checks if the map has been previously loaded (ie has HTML)\n // this is a proxy for all dynamic elements within the panel\n var mapPresent = document.getElementById(\"mapcanvas\"+panelNumber).innerHTML;\n\n // if there is no map, create one plus the charts\n if (!mapPresent) {\n // global var - create new area chart\n areaChart = new google.visualization.AreaChart(document.getElementById(\"journey-area-chart\"+panelNumber));\n // global var - create new map with map options - gets map element id by using \"mapcanvas\"+panelNumber\n map = new google.maps.Map(document.getElementById(\"mapcanvas\"+panelNumber), mapOptions);\n // global var - creates varible for info window\n infoWindow = new google.maps.InfoWindow;\n // append journey number to get request\n var urlGet = \"php/journeyDataLoadAjax.php?journey=\"+journeyNumber;\n // get data from MySQL and calls download URL function\n downloadUrl(urlGet, function(data) {\n var xml = data.responseXML;\n // if there are no results (might be a database error then fail gracefully)\n if (xml===null){\n alert(DATABASE_ERROR_MESSAGE);\n }\n // gets markers from xml\n var markers = xml.documentElement.getElementsByTagName(\"marker\");\n // load the area chart\n loadAreaChart(markers);\n // load the map\n loadMap(markers);\n } // end download URL function\n );//end download url\n }// end if\n }", "title": "" }, { "docid": "7e40daec9b88ea07eb86c7a752bbc3f2", "score": "0.6179854", "text": "function draw2(cfg, data) {\n\n\t\tvar prearr = [], tr = [], metLocs = {}, doAdd = false, tv = 0;\n\t\tprearr.push(cfg.header);\n\t\tfor (var v in data) {\n\t\t\tif (data.hasOwnProperty(v)) {\n\t\t\t\ttr = [];\n\t\t\t\tdoAdd = false;\n\t\t\t\tfor (var x = 0, cx = cfg.body.length; x < cx; x++) {\n\t\t\t\t\tvar rcv = data[v][cfg.body[x]];\n\t\t\t\t\tif (x === 0) {\n\t\t\t\t\t\tif (metLocs.hasOwnProperty(rcv)) {\n\t\t\t\t\t\t\tdoAdd = metLocs[rcv];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmetLocs[rcv] = (prearr.length);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trcv = (locationNames[cfg.dlevel][rcv]);\n\t\t\t\t\t}\n\t\t\t\t\tif (doAdd === false) {\n\t\t\t\t\t\ttr.push(rcv);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (x > 0) {\n\t\t\t\t\t\t\ttv = Number(prearr[doAdd][x]) + Number(rcv);\n\t\t\t\t\t\t\tprearr[doAdd][x] = Number(tv);\n\t\t\t\t\t\t\tprearr[doAdd][x] = Number(prearr[doAdd][x].toFixed(2));\n\t\t\t\t\t\t\tvar c = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif (doAdd === false) {\n\t\t\t\t\tprearr.push(tr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar data2 = google.visualization.arrayToDataTable(prearr);\n\n\n\t\tvar options = {\n\t\t\tregion: 'GE',\n\t\t\tdisplayMode: 'markers',\n\t\t\tcolorAxis: {colors: ['green', 'red']}\n\t\t\t/*tooltip: {textStyle: {color: '#FF0000'}, showColorCode: true},\n\t\t\t legend: {\n\t\t\t textStyle: {color: 'blue', fontSize: 16},\n\t\t\t numberFormat: \".##\"\n\t\t\t }*/\n\t\t};\n\n\n\t\tvar cd = document.getElementById(\"chart_div\");\n\t\t//cd.innerHTML = \"\";\n\t\tif (!xChart) {\n\t\t\txChart = new google.visualization.GeoChart(cd);\n\t\t} else {\n\t\t\txChart.clearChart();\n\t\t}\n\t\tgoogle.visualization.events.addListener(xChart, \"error\", careChart);\n\t\txChart.draw(data2, options);\n\n\t}", "title": "" }, { "docid": "0964e2de74433904dfe031752b728c98", "score": "0.6178073", "text": "function mapGraficalinea(e) {\n var dataGraph = [];\n var elArray = new Array();\n var dataCfg;\n var totalAE = 0; \n var totalANE = 0;\n // console.log(\"layer loaded\");\n\n Ymax = maps.getBounds().getNorth();\n Ymin = maps.getBounds().getSouth();\n Xmax = maps.getBounds().getEast();\n Xmin = maps.getBounds().getWest();\n\n var sql = new cartodb.SQL({\n user:\"develop\"\n }); \n\n sql.execute(\"SELECT cartodb_id, alerta_alto_bajo_i, asociacion, cadena, detalleopc, detenidos FROM alertas_alto_bajo_impacto_union WHERE ST_Contains(ST_MakeEnvelope(\"+Xmin+\",\"+Ymin+\",\"+Xmax+\",\"+Ymax+\",4326),the_geom) ORDER BY cartodb_id\")\n\n .done(function(data){\n\n for (idx in data.rows){\n \n if (data.rows[idx].alerta_alto_bajo_i == 1) {\n \ttotalAE = parseInt(totalAE) + parseInt(1);\n } else {\n \ttotalANE = parseInt(totalANE) + 1;\n }\n\n }\n\n dataCfg = \n [\n {\n \tname:\"Alertas Efectivas\",\n y:totalAE,\n },{\n \t\n name:\"Alertas No Efectivas\",\n y:totalANE,\n }\n ];\n\n // console.log(dataCfg);\n \n graficalinehighcharts(\"\",\"\"); //Graphics3 code\n\n });//Fin .done(function(data){\n}//Fin Function", "title": "" }, { "docid": "29da49f7ac619f90b2763fade84ecbc0", "score": "0.61754227", "text": "function drawMap(date) {\n drawInitialMap();\n var states_ordered_closure = [];\n var states_recommended_closure = [];\n\n data[date].forEach((row) => {\n if (row.status == \"ordered\") {\n states_ordered_closure.push(row.stateAbbr);\n } else if (row.status == \"recommended\") {\n states_recommended_closure.push(row.stateAbbr);\n }\n });\n\n // color the map\n console.log(\"begin cloring\");\n states_ordered_closure.forEach((id) => {\n map.select(\"path#\" + id)\n .style(\"fill\", color_ordered);\n });\n\n states_recommended_closure.forEach((id) => {\n map.select(\"path#\" + id)\n .style(\"fill\", color_recommended);\n });\n }", "title": "" }, { "docid": "ff2eafd39424b572411a896e8912349d", "score": "0.6162592", "text": "function drawChart() {\n let chart_data = new google.visualization.DataTable();\n chart_data.addColumn('string', 'Τύπος Δραστηριότητας');\n chart_data.addColumn('number', '#Εγγραφών');\n chart_data.addRow(['IN_VEHICLE', activity_data['IN_VEHICLE']]);\n chart_data.addRow(['ON_BICYCLE', activity_data['ON_BICYCLE']]);\n chart_data.addRow(['ON_FOOT', activity_data['ON_FOOT']]);\n chart_data.addRow(['RUNNING', activity_data['RUNNING']]);\n chart_data.addRow(['STILL', activity_data['STILL']]);\n chart_data.addRow(['TILTING', activity_data['TILTING']]);\n chart_data.addRow(['UNKNOWN', activity_data['UNKNOWN']]);\n\n // Optional; add a title and set the width and height of the chart\n var options = { 'width': '100%', 'height': '100%', 'pieHole': 0.4 };\n\n // Display the chart inside the <div> element\n var chart = new google.visualization.PieChart(document.getElementById('activity-chart'));\n chart.draw(chart_data, options);\n }", "title": "" }, { "docid": "efb0649d257a41621565f9ac3738f6ce", "score": "0.6144528", "text": "function getData() {\n d3.json(\"./data/piedata.json\", function(d) {return d}).then(drawPie)\n}", "title": "" }, { "docid": "ea55d9fe8d27c4d72a6c42004bca304b", "score": "0.6134045", "text": "function fill_content(csv_data) {\n // draw static US states map\n var svg_charts = d3.select('#viz_charts')\n .append('svg')\n .attr('width', chart_crect.width)\n .attr('height', chart_crect.height);\n var svg_legend = d3.select('#viz_legend')\n .append('svg')\n .attr('width', '100%')\n .attr('height', '100%');\n\n\t// different perspective data\n\tvar all_objs;\n\tvar ticks = 5;\n\tswitch (select_value) {\n\t\tcase 'zhvi_summary':\n\t\tall_objs = get_zhvi_summary(csv_data);\n\t\tbreak;\n\t\tcase 'zhvi':\n\t\tall_objs = get_zhvi(csv_data);\n\t\tbreak;\n\t}\n\n\tif (!all_objs) { return; } //do nothing for now\n\n\tvar type = Perspectives.filter(function(d) { return d['id'] === select_value; })[0].type;\n\n\tif (type === 'line') {\n\t\t// one format for all charts\n\t\tvar pattern = Perspectives.filter(function(d) { \n\t\t\treturn d['id'] === select_value; })[0].format;\n\t\t// draw line charts\n\t\tchart_objs = new Array();\n\t\tvar sub_height = chart_crect.height/all_objs.length;\n\t\tvar map_display_obj;\n\t\tfor (var i = 0; i < all_objs.length; i++) {\n\t\t\tvar obj = all_objs[i];\n\t\t\tif (i === 0) {\n\t\t\t\t// map is overlayed with first chart data\n\t\t\t\tmap_display_obj = obj;\n\t\t\t\tadd_legend(svg_legend, obj.colors, obj.extent, pattern, ticks);\n\t\t\t\tupdate_viz_period(obj.latest_period_date, true);\n\t\t\t}\n\t\t\tvar main_area_nested = obj.nested.filter(function(d) { \n\t\t\t\treturn Main_Areas.indexOf(d['key']) >= 0; });\n\t\t\tchart_objs.push(init_series_line_chart(main_area_nested, obj.nested, \n\t\t\t\tobj.extent, ticks, svg_charts, chart_crect.width, sub_height, \n\t\t\t\tmargin, obj['title'], pattern, i*sub_height, obj.mid_color)\n\t\t\t);\n\t\t}\n\t} else if (type === 'bar') {\n\t\t// draw bar charts\n\t\tchart_objs = new Array();\n\t\t// 2 charts per row, ideal for 2x2\n\t\tvar sub_width = chart_crect.width/2;\n\t\tvar sub_height = chart_crect.height/(all_objs.length/2);\n\t\tvar map_display_obj;\n\n\t\tfor (var i = 0; i < all_objs.length; i++) {\n\t\t\tvar obj = all_objs[i];\n\t\t\t// diff format for each chart\n\t\t\tvar pattern = obj.format;\n\t\t\tif (i === 0) {\n\t\t\t\t// map is overlayed with first chart data\n\t\t\t\tmap_display_obj = obj;\n\t\t\t\tadd_legend(svg_legend, obj.colors, obj.extent, pattern, ticks);\n\t\t\t\tvar d = new Date(2015, 11, 1); // fixed as data source is not dynamically updated\n\t\t\t\tupdate_viz_period(d, false);\n\t\t\t}\n\n\t\t\tvar main_area_data = obj.data.filter(function(d) { \n\t\t\t\treturn Main_Areas.indexOf(d['region']) >= 0; });\n\t\t\tchart_objs.push(init_bar_chart(main_area_data, obj.data, obj.extent, ticks, \n\t\t\t\tsvg_charts, sub_width, sub_height, obj['title'], pattern, \n\t\t\t\tMath.floor(i/2)*sub_height, (i%2)*sub_width, obj.mid_color)\n\t\t\t);\n\t\t}\n\t}\n\n\t// add data to map\n map_geojson.features.forEach(function(element) {\n \t// first reset\n \telement.properties['datum'] = undefined;\n \telement.properties['color'] = undefined;\t\n\n \tvar zip = element.properties['zip']; \t\n \tvar zip_item;\n \tif (type === 'line') {\n \t\tzip_item = map_display_obj.nested.filter(function(d) {\n\t \t\treturn d['key'] === zip;\n\t \t});\n \t} else if (type === 'bar') {\n \t\tzip_item = map_display_obj.data.filter(function(d) {\n\t \t\treturn d['region'] === zip;\n\t \t});\n \t}\n \tif (!zip_item || zip_item.length == 0) { return; } // zip not found\n\n\t\tvar val;\n\t\tif (type === 'line') {\n\t\t\tval = zip_item[0]['values']['latest_datum'];\n\t\t} else if (type === 'bar') {\n\t\t\tval = zip_item[0]['datum'];\n\t\t}\n\t\tif(val) {\n\t \telement.properties['datum'] = val;\n\t \telement.properties['color'] = map_display_obj.colors.color_func(val);\n\t } \n });\n\n\tgoogle_map.data.addGeoJson(map_geojson);\n}", "title": "" }, { "docid": "adac0b588b0787ecfb535d18309e89e6", "score": "0.61312133", "text": "function km_makes_a_pie_chart() {\n\n\t// Calls google's DataTable recipe\n\tvar km_gorgeous_data = new google.visualization.DataTable();\n\t//specifies what the column value type and headings will be\n\tkm_gorgeous_data.addColumn('string', 'Time Allocation');\n\t//column number 2\n\tkm_gorgeous_data.addColumn('number', 'Hours');\n\t//adds rows into the DataTable, matching the syntax I defined above in the addColumn function\n\t//references the data that I've loaded into variables in the data.js file\n\tkm_gorgeous_data.addRows(km_gorgeous_data_info);\n\n\t// Customization area to define what we want the chart to look like.\n\t// See https://developers.google.com/chart/interactive/docs/basic_customizing_chart#specify-options\n\tvar km_gorgeous_chart_options = {\n\t\t//The string for the title that will appear at the top\n\t\t'title' : 'How I Spend My Day',\n\t\t//how wide my chart will be, in pixels\n\t\t'width' : 500,\n\t\t//how high my chart will be, in pixels\n\t\t'height' : 400,\n\t\t//what colors my char will use to draw the pie chart (chosen from Pantone colors, obvs)\n\t\t'colors' : ['#EABEDB', '#E56DB1', '#DA1884', '#A50050', '#910048'],\n\t\t//the font I want to use in the body of the chart\n\t\t'fontName' : 'Tahoma',\n\t\t//whether I want my legend to appear as a static bit (default), or when you mouse over the slices\n\t\t'legend.position' : 'labeled',\n\t\t//an object that defines the styling for my title\n\t\t'titleTextStyle' : {\n\t\t\tfontName : 'Helvetica',\n\t\t\tbold : true,\n\t\t\tfontSize : 18\n\t\t}\n\t};\n\n\t// This variable stores the results of the PieChart function, called from Google's charting package\n\t// PieChart takes a document function (a native javascript function, refers to an html document)\n\t// getElement lets you retrieve a tagged thing in an html file. ById means it looks for a tag.\n\t// All of that means that getElementById is retrieving something tagged 'chart_div'\n\tvar day_pie = new google.visualization.PieChart(document.getElementById('day_pie_container'));\n\tday_pie.draw(km_gorgeous_data, km_gorgeous_chart_options);\n}", "title": "" }, { "docid": "28b973ff3c6bb352d1ff2ff33600ce3b", "score": "0.61222893", "text": "function loadpie() {\n var points;\n var tpoints = 0;\n var name;\n var color;\n for (var i = 0; i < rms.length; i++) {\n tpoints = tpoints + Number(sessionStorage.getItem('points'+rms[i]));\n }\n if (tpoints == 0) {\n addData(pie, 'No points earned yet', 1, 'Grey');\n } else {\n for (var i = 0; i < rms.length; i++) {\n points = Number(sessionStorage.getItem('points'+rms[i]));\n name = sessionStorage.getItem('name'+rms[i]);\n color = colorList[i % colorList.length];\n addData(pie, name, points, color);\n }\n }\n}", "title": "" }, { "docid": "0c81f026721b02760d73f8214703cb63", "score": "0.61057913", "text": "function drawDisplacementChart(){\n var graph = [];\n downloadUrl(\"Map.php\", function (data){\n var xml = data.responseXML;\n var markers = xml.documentElement.getElementsByTagName(\"marker\");\n var dataTable = new google.visualization.DataTable();\n var options = {title:'Displacement (m)', \n curveType:'function', \n legend:{position:'bottom'},\n is3d:true \n };\n \n var startPoint = new google.maps.LatLng(markers[0].getAttribute(\"lat\"),markers[0].getAttribute(\"lng\"));\n for(var i = 0; i<markers.length; i++){\n var time = i+':00';\n var current = new google.maps.LatLng(markers[i].getAttribute(\"lat\"),markers[i].getAttribute(\"lng\"));\n var displacement = google.maps.geometry.spherical.computeDistanceBetween(startPoint,current);\n graph[i] = [time, displacement];\n }\n \n var chart = new google.visualization.LineChart(document.getElementById('chart_div2'));\n dataTable.addColumn('string', 'time');\n dataTable.addColumn('number', 'Displacement');\n \n \n var array = [];\n for(var i = 0; i<graph.length; i++){\n setTimeout(function(y){\n array.push(graph[y]);\n dataTable.addRows(array); \n chart.draw(dataTable, options); \n array = [];\n }, i*TIME, i);\n }\n \n \n });\n }", "title": "" }, { "docid": "3717cb60dbe6e9529911589d8e3539d4", "score": "0.6101917", "text": "function initialize_charts (){\n\n\t// create initial title\n\td3.select(\"#title\")\n\t.append(\"h1\")\n\t.attr(\"class\", \"title\")\n\t.text(\"Analyse van huizen\")\n\n\t// functions to create initial map\n \tdraw_barchart()\n \tdraw_scatter()\n \tdraw_table()\n \tcreate_legend()\n\tcreate_buttons()\n\n // not show charts\n d3.selectAll(\"#firstrow, #secondrow\")\n .style(\"display\", \"none\")\n\n\n}", "title": "" }, { "docid": "543ef2626c8e7653584471b02867331b", "score": "0.6092174", "text": "function drawmap(countries_keyed) {\n // first clear any existing layers\n circles.clearLayers();\n points.clearLayers();\n\n // add div icons to the map for each distinct country where count > 1\n // count is the number of studies in that country in the raw data \n var countries = Object.keys(countries_keyed);\n // sort countries by count, to ensure smaller ones are stacked on top of larger ones\n countries.sort(function(a,b) {\n return countries_keyed[b].count - countries_keyed[a].count\n });\n // go over countries, and make circles. \n // Before we start figure out what style to use\n countries.forEach(function(name){\n // skip countries that don't have matching name, counts, lat/lngs, etc.\n if (countries_keyed[name] === undefined) return;\n if (countries_keyed[name].count === undefined || countries_keyed[name].count == 0) return;\n if (countries_keyed[name].latitude === undefined || countries_keyed[name].longitude === undefined) return;\n if (countries_keyed[name].latitude === \"\" || countries_keyed[name].longitude === \"\") return;\n if (countries_keyed[name].count > 0) {\n var country = countries_keyed[name];\n // can't fit bound to L.cicles for some reason, so we make null marker icons instead\n var nullicon = L.divIcon({ className: 'null-icon'});\n var point = L.marker([country.latitude, country.longitude], {icon: nullicon, interactive: false});\n point.addTo(points);\n // get an area from scale function, calc the radius, and then add the circles \n var area = circleScale(country.count);\n var radius = Math.sqrt(area/Math.PI);\n var circle = L.circle([country.latitude, country.longitude], {radius: radius}).setStyle(defaultStyle).addTo(circles);\n // add interactivity\n circle.data = country;\n var plural = country.count > 1 ? \"s\" : \"\";\n circle.bindPopup(country.name + \": \" + country.count + \" data point\" + plural);\n circle.on('click',function(e) { \n map.closePopup();\n clearCircles();\n clearSquares();\n clickCircle(e.target.data, this); \n });\n circle.on('mouseover', function (e) {\n // first clear any selections selected by other means, and other open stuff\n clearCircles();\n clearSquares();\n closeVariableInfoTip();\n this.openPopup();\n this.setStyle(selectedStyle);\n selectSquares({key: \"fips\", value: e.target.data.fips});\n });\n circle.on('mouseout', function (e) {\n // close map popups (but not on mobile)\n if (! isMobile() ) map.closePopup();\n // clear style, clear squares, close tooltip\n this.setStyle(defaultStyle);\n clearSquares();\n closeSquareTooltip();\n });\n }\n\n // on mobile only, pan the map to the selected place(s)\n if (isMobile() ) { map.panTo(points.getBounds().getCenter());} \n\n });\n}", "title": "" }, { "docid": "6f2773c858b927cdc30d1c9ac3e7d37c", "score": "0.609164", "text": "function initialiseCharts(idMap, idLanguageChart) {\n divIDMap = idMap;\n divIDLanguageChart = idLanguageChart;\n\n setLayout();\n\n d3.json(\"data/countries.geo.json\", function (error, geojson) { // open file with world data\n countriesGeoJSON = {};\n // Read geojson countries\n for (var r = 0; r < geojson.features.length; r++) { // for each country in geojson\n var countryData = geojson.features[r];\n var countryName = countryData.properties.name;\n var countryCode = findCountryCode(countryName);\n countriesGeoJSON[countryCode] = countryData;\n }\n\n });\n\n createActorsMap(divIDMap);\n setBiographyWidgetActor(null);\n createActorPieChart(\"#\" + divIDLanguageChart, null);\n}", "title": "" }, { "docid": "be9ce63bd6f14ff76c2e500ba5c8730d", "score": "0.608875", "text": "function drawMap(data) {\n\n //processes the data brought into script by AJAX request and creates and styles L.circleMarkers in the map div\n var dataLayer = L.geoJson(data, options).addTo(map);\n\n //gets the extent of dataLayer and applies as the bounds of the map\n //map.fitBounds(dataLayer.getBounds());\n map.fitBounds([\n [24.880280, -126.984404], //Southwest\n [48.731455, -63.749716] //Northeast\n]);\n //backs the map's zoom out 0.8 level from the extent that was set with the fitBounds method above\n //map.zoomOut(0.8);\n map.zoomControl.setPosition('topright');\n //creates a var named currentYear to set initial value of year identifier div upon webpage load\n\n\n //JQuery method to update html of the year div\n $('#year').html(\"Year:\" + \" \" + currentYear);\n\n //eventListeneer added on dataLayer that shows the info window on mouseover\n dataLayer.on('mouseover', function () {\n $(\".info\").show();\n });\n\n //eventListeneer added on dataLayer that hides the info window on mouseout\n dataLayer.on('mouseout', function () {\n $(\".info\").hide();\n });\n\n //calls resizeCircles function\n resizeCircles(dataLayer, currentYear);\n\n //call to sequenceUI that adds a listener to the slider UI that updates currentYear \n sequenceUI(dataLayer);\n\n //creates initial content for the info window\n layerInfo(dataLayer, currentYear);\n\n //calls banUI function, which binds an event listener for changes in the ban selector and fires function\n banUI(dataLayer, currentYear);\n\n }", "title": "" }, { "docid": "ba388d5bcb59a500f0d503dcc321bfdc", "score": "0.60842186", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n\n // Set chart options\n var options = {'title':'How Much Pizza I Ate Last Night',\n 'width':400,\n 'height':300};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "6993938ba800cc09ac680b5b9c587e6a", "score": "0.606723", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Recoverd', usData.recovered],\n ['Death', usData.deaths],\n ['Cases', usData.Cases],\n ['TodayCases', usData.todayCases],\n ['TodayDeaths', usData.todayDeaths]\n ]);\n\n // Set chart options\n var options = {'title':'United-Sates',\n 'width':400,\n 'height':300};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "928608122ce364ce0ba3310ce400df48", "score": "0.6065424", "text": "function initChart() {\n mapViz = new Datamap({\n scope: 'usa',\n element: document.getElementById('map_viz'),\n fills: { defaultFill: '#FFF' },\n geographyConfig: {\n highlightBorderColor: '#bada55',\n popupTemplate: function(geo, data) {\n $scope.$apply(function() {\n $scope.selectedState = breakdownData.state[geo.id]\n $scope.selectedState.name = geo.properties.name;\n });\n },\n highlightBorderWidth: 2,\n highlightFillColor: function(geo) {\n return geo['fillColor'] || '#FFF';\n },\n },\n data: generateMapData()\n });\n mapViz.labels();\n }", "title": "" }, { "docid": "48e315bdcd97bcb66eb9f55409e8b24f", "score": "0.6062108", "text": "function drawMap(processedMap, processedTable) {\r\n\tvar options = {colorAxis: {colors: ['#c0c0c0', '#000000']}, width: 500},\r\n chart = new google.visualization.GeoChart(document.getElementById('mapChartDiv')),\r\n table = new google.visualization.Table(document.getElementById('dataTable'));\r\n\t\r\n\tchart.draw(processedMap, options);\r\n\ttable.draw(processedTable, null);\r\n}", "title": "" }, { "docid": "247fa6ba33b6d6ec98c4ca0cda609146", "score": "0.6060551", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Mushrooms', 3],\n ['Onions', 1],\n ['Olives', 1],\n ['Zucchini', 1],\n ['Pepperoni', 2]\n ]);\n\n // Set chart options\n var options = {\n 'title': 'How Much Pizza I Ate Last Night',\n 'width': 400,\n 'height': 300\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "title": "" }, { "docid": "7c26abec0dac64519ab18463dd4b6717", "score": "0.6054859", "text": "function DrawPieChart(Charts, ctx, Data, DataSum, StartPoint, RunCount, DataCount) {\n if (RunCount > 0) {\n const ValuePoint = Data.Ydata[DataCount - RunCount] / DataSum * 360 * Math.PI / 180;\n const EndPoint = StartPoint + ValuePoint;\n\n //開始繪圖路徑\n ctx.beginPath();\n\n // 移動到圓心\n ctx.moveTo(Charts.width / 2, Charts.height / 2);\n\n //繪製扇形\n ctx.arc(Charts.width / 2, Charts.height / 2, 200, StartPoint, EndPoint);\n ctx.fillStyle = Data.StyleColor[DataCount - RunCount];\n ctx.fill();\n\n //關閉繪圖路徑\n ctx.closePath();\n\n //開始繪圖路徑\n ctx.beginPath();\n\n // 移動到圓心\n ctx.moveTo(Charts.width / 2, Charts.height / 2);\n\n // 取得物件角度中間值並列出每個物件的名字、數量\n let TextPoint = StartPoint + ValuePoint * 0.5;\n let TextX = Charts.width / 2 + (200 + 50) * Math.cos(TextPoint);\n let TextY = Charts.height / 2 + (200 + 20) * Math.sin(TextPoint);\n let DataText = Data.Xdata[DataCount - RunCount] + ' ,' + Math.round((Data.Ydata[DataCount - RunCount] / DataSum) * 1000) / 100 + '% ,' + Data.Ydata[DataCount - RunCount];\n\n // 為了讓文字在圓外就必需設定在圖 左(右) 邊時文字要靠 右(左)\n if ((TextPoint > 90 * Math.PI / 180) && (TextPoint < 270 * Math.PI / 180)) {\n ctx.textAlign = 'end';\n }\n\n //顯示資料\n ctx.font = '15px Arial';\n ctx.fillStyle = '#000';\n ctx.fillText(DataText, TextX, TextY);\n\n //關閉繪圖路徑\n ctx.closePath();\n\n //繪製圖表清單\n TagList(Charts, ctx, Data, DataCount, RunCount);\n\n RunCount--;\n DrawPieChart(Charts, ctx, Data, DataSum, EndPoint, RunCount, DataCount);\n } else {\n return;\n }\n}", "title": "" }, { "docid": "6fa26053b0bf67d1106c8ac89a007a9f", "score": "0.6052329", "text": "function drawCharts(){\n genericDraw( areaData, 'Area', 'Number of Employees', 'Jobs by area (with at least one employee)', 'areaDiv' );\n genericDraw( yearData, 'Age', 'Number of Employees', 'Active employees by age', 'ageDiv' );\n genericDraw( genderData, 'Gender', 'Number of Employees', 'Employees by gender', 'genderDiv' );\n}", "title": "" }, { "docid": "0d20fd522cbc13be3d2c662a182ad06e", "score": "0.6046464", "text": "function loadData() {\n\n // reset old data\n label = [];\n backgroundColor = [];\n ratedData = [];\n unratedData = [];\n\n //set data based on the pointCounters\n vm.quizPointStatistic.pointCounters.forEach(function (pointCounter) {\n label.push(pointCounter.points);\n ratedData.push(pointCounter.ratedCounter);\n unratedData.push(pointCounter.unRatedCounter);\n backgroundColor.push(\n {\n backgroundColor: \"#428bca\",\n borderColor: \"#428bca\",\n pointBackgroundColor: \"#428bca\",\n pointBorderColor: \"#428bca\"\n });\n });\n // order the bars ascending on points\n order();\n\n vm.labels = label;\n vm.colors = backgroundColor;\n\n // load data into the chart\n loadDataInDiagram();\n }", "title": "" }, { "docid": "d2e2cbcbbf3acdbe4fbc80a5e9e9ab45", "score": "0.6044315", "text": "function drawChart() {\n\t\n\tvar jsonData = $.ajax({\n\t\turl: \"/editorial/workspace/get_workload_chart/38\",\n\t\tdataType: \"json\",\n\t\tasync: true,\n\t\tsuccess: function(response) {\n\t\t\tdebug(response);\n\t\t\tvar data = new google.visualization.DataTable(response);\n\t\t\t\n\t\t\tvar options = {\n\t\t\t\ttitle: 'Workload Activities',\n\t\t\t\tis3D: true,\n\t\t\t};\n\n\t\t\t// Instantiate and draw our chart, passing in some options.\n\t\t\tvar chart = new google.visualization.PieChart(document.getElementById('task-workload-chart'));\n\t\t\tchart.draw(data, options);\n\t\t\t\n\t\t\t\n\t\t}\n\t});\t\n}", "title": "" }, { "docid": "c64661cea535b723420e90aa92ad2c5b", "score": "0.6041364", "text": "function drawData() {\n\t var calcdata = gd.calcdata,\n\t i;\n\t\n\t // in case of traces that were heatmaps or contour maps\n\t // previously, remove them and their colorbars explicitly\n\t for(i = 0; i < calcdata.length; i++) {\n\t var trace = calcdata[i][0].trace,\n\t isVisible = (trace.visible === true),\n\t uid = trace.uid;\n\t\n\t if(!isVisible || !Plots.traceIs(trace, '2dMap')) {\n\t fullLayout._paper.selectAll(\n\t '.hm' + uid +\n\t ',.contour' + uid +\n\t ',#clip' + uid\n\t ).remove();\n\t }\n\t\n\t if(!isVisible || !trace._module.colorbar) {\n\t fullLayout._infolayer.selectAll('.cb' + uid).remove();\n\t }\n\t }\n\t\n\t // loop over the base plot modules present on graph\n\t var basePlotModules = fullLayout._basePlotModules;\n\t for(i = 0; i < basePlotModules.length; i++) {\n\t basePlotModules[i].plot(gd);\n\t }\n\t\n\t // styling separate from drawing\n\t Plots.style(gd);\n\t\n\t // show annotations and shapes\n\t Shapes.drawAll(gd);\n\t Plotly.Annotations.drawAll(gd);\n\t\n\t // source links\n\t Plots.addLinks(gd);\n\t\n\t // Mark the first render as complete\n\t gd._replotting = false;\n\t\n\t return Plots.previousPromises(gd);\n\t }", "title": "" }, { "docid": "9872e1fb8ac8619faa12eb6241ae1b73", "score": "0.6037383", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['От',18 ],\n ['До', 100]\n ]);\n\n var data2 = new google.visualization.DataTable();\n data2.addColumn('string', 'Topping');\n data2.addColumn('number', 'Slices');\n data2.addRows([\n ['От',18 ],\n ['До', 30]\n ]);\n\n\n // Set chart options\n var options = {\n 'width':30,\n 'height':30,\n 'legend': 'none',\n 'pieSliceText': 'none', \n 'chartArea':{left:0,top:0,right:0,bottom:0,width:'100%',height:'100%'},\n 'pieSliceBorderColor': 'transparent',\n 'backgroundColor':'transparent',\n 'slices': {\n overflow:'visible',\n 0: { color: '#E91E63' },\n 1: { color: 'blue' },\n },\n tooltip: { trigger: 'none' },\n\n \n };\n\n var data3 = new google.visualization.DataTable();\n data3.addColumn('string', 'Topping');\n data3.addColumn('number', 'Slices');\n data3.addRows([\n ['От',18 ],\n ['До', 10]\n ]);\n\n\n // Set chart options\n var options = {\n 'width':30,\n 'height':30,\n 'legend': 'none',\n 'pieSliceText': 'none', \n 'chartArea':{left:0,top:0,right:0,bottom:0,width:'100%',height:'100%'},\n 'pieSliceBorderColor': 'transparent',\n 'backgroundColor':'transparent',\n 'slices': {\n 0: { color: '#E91E63' },\n 1: { color: 'blue' },\n },\n tooltip: { trigger: 'none' },\n\n \n };\n var data4 = new google.visualization.DataTable();\n data4.addColumn('string', 'Topping');\n data4.addColumn('number', 'Slices');\n data4.addRows([\n ['От',18 ],\n ['До', 5]\n ]);\n\n\n // Set chart options\n var options = {\n 'width':30,\n 'height':30,\n 'legend': 'none',\n 'pieSliceText': 'none', \n 'chartArea':{left:0,top:0,right:0,bottom:0,width:'100%',height:'100%'},\n 'pieSliceBorderColor': 'transparent',\n 'backgroundColor':'transparent',\n 'slices': {\n overflow:'visible',\n 0: { color: '#E91E63' },\n 1: { color: 'blue' },\n },\n tooltip: { trigger: 'none' },\n\n \n };\n\n\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n var chart2 = new google.visualization.PieChart(document.getElementById('chart2'));\n var chart3 = new google.visualization.PieChart(document.getElementById('chart3'));\n var chart4 = new google.visualization.PieChart(document.getElementById('chart4'));\n chart.draw(data, options);\n chart2.draw(data2, options);\n chart3.draw(data3, options);\n chart4.draw(data4, options);\n }", "title": "" }, { "docid": "8b410dfd70cd582bbc8a9fc2e67f811d", "score": "0.60359085", "text": "function drawChart2() {\r\n\r\n // R prepared summary data for Restaurants with scores of 27 or higher are being shown.\r\n var data = google.visualization.arrayToDataTable([\r\n ['Lat', 'Long', 'Name'],\r\n [40.834518,-73.940807, 'ORTIZ RESTAURANT'],\r\n\t [40.761184,-73.957797, 'XING WONG BBQ'],\r\n\t [40.760539,-73.958355, 'HUNAN BISTRO'],\r\n\t [40.760539,-73.958355, 'CARVAL PIZZERIA'],\r\n\t [40.704043,-74.013188, 'OPEN MARKET'],\r\n\t [40.731165,-73.99192, 'OH TAISHO'],\r\n\t [40.776603,-73.946627, 'RIDGEWAY DINER'],\r\n\t [40.734671,-73.994585, 'VSPOT ORGANIC'],\r\n\t [40.742178,-73.983232, 'PIPPALI'],\r\n\t [40.755404,-73.979483,'THAI GRILL SUSHI BAR'],\r\n\t [40.776603,-73.946627, 'CHEF YU / AZUKI'],\r\n\t [40.721083,-74.005845, 'CHA CHAS BACKYARD GARDEN BAR CAFE'],\r\n\t [40.760539,-73.958355, 'MEGASUN RESTAURANT']\r\n ]);\r\n\r\n\r\n var options = {\r\n title : 'Chart 5\\nYearly Coffee Shops Scores',\r\n vAxis: {title: 'Score'},\r\n hAxis: {title: 'Year'},\r\n seriesType: 'bars',\r\n series: {5: {type: 'line'}},\r\n colors: ['#AED6F1', '#85C1E9', '#5DADE2', '#2980B9', '#1F618D', '#E74C3C']\r\n };\r\n\r\n var map = new google.visualization.Map(document.getElementById('map_div2'));\r\n map.draw(data,{showTip: true});\r\n }", "title": "" }, { "docid": "03dae2ed808f5c3ea73b21035cea2986", "score": "0.60282815", "text": "function getCharts(){ \n getMap();\n loadEventFrame();\n for(var i=1;i<maincell;i++){\n getChildMap(i);\n }\n}", "title": "" }, { "docid": "bf1da14e9fa7d59c58176a99cd1c23d6", "score": "0.6017039", "text": "function drawUSAMap(id){\n // d3.select(\"#mapSvg\").remove();\n // d3.select(\"#textSvg\").remove();\n // d3.select(\".d3-tooltip\").remove();\n // $(\"#world_map\").hide();\n // $(\"#world_charts\").hide();\n // $(\"#worldTitle\").hide();\n // $(\"#usa_map\").show();\n // $(\"#pr_charts\").show();\n // $(\"#usa_map\").empty();\n // $(\"#title\").empty();\n // $(\"#percentage_chart\").empty();\n // $(\"#ranking_chart\").empty();\n // var usaMap = new usaMapVis(\"usamapvis\",id,dataOfUSA,regionDataOfUSA);\n}", "title": "" }, { "docid": "ee358e17b829c2e687db10b82445e691", "score": "0.6016804", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Confirmed');\n data.addColumn('number', 'Pending');\n data.addRows(plotdata);\n\n // Set chart options\n var options = {\n 'title': 'Reservations status',\n 'width': '100%',\n 'height': 500\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_statuses'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "e9ed869bff1cfaebe45f2e42cfe86173", "score": "0.60155416", "text": "function drawMap() {\n\n var dataArray = [];\n dataArray[0] = ['Lat', 'Long', 'Name']\n\n $.getJSON('/api/user_last', function (data) {\n $.each(data, function (index, element) {\n var i = index + 1;\n if (!dataArray[i]) dataArray[i] = new Array(3);\n\n dataArray[i] = [element.latitude, element.longitude, element.user];\n\n });\n\n var mapData = google.visualization.arrayToDataTable(dataArray);\n\n var options = {\n\n };\n map = new google.visualization.GeoChart(document.getElementById('global_map'));\n\n map.draw(mapData, options);\n\n setInterval(function() { updateMap() }, 10000)\n });\n}", "title": "" }, { "docid": "2f262e2ecf9f4135ffffe5e10521216a", "score": "0.6011527", "text": "function drawMap(error, data) {\r\n const mapData = data[0]; //Geo JSon\r\n const mapInfo = data[1]; //CSV\r\n\r\n //Add Canopy Percentage to map geo json data\r\n mapData.features.map(el => {\r\n const name = el.properties.name;\r\n const info = mapInfo.find(item => {\r\n return item.Neighborhood === name;\r\n });\r\n if (info) {\r\n el.properties.canopyPercent = info['Canopy%'];\r\n }\r\n return el;\r\n });\r\n\r\n //Create projection\r\n const projection = d3\r\n .geoMercator()\r\n .center([-122.433701, 37.767683])\r\n .scale(1750)\r\n .translate([width / 1.5, height / 1.74]);\r\n\r\n //create geo path\r\n const path = d3.geoPath().projection(projection);\r\n\r\n //Assign all paths for later use\r\n paths = map\r\n .selectAll('path')\r\n .data(mapData.features)\r\n .enter()\r\n .append('path')\r\n .attr('d', path)\r\n .attr('stroke', 'white')\r\n .attr('stroke-width', 0.02)\r\n .attr('fill', d => {\r\n return colorPicker(d.properties.canopyPercent);\r\n })\r\n .on('mousemove', d => {\r\n showTooltip(d);\r\n });\r\n\r\n //Attach event handler for keydown\r\n d3.select('body').on('keydown', () => {\r\n const event = d3.event;\r\n //Press 'c' for animation\r\n if (event.keyCode === 67) {\r\n animation();\r\n }\r\n });\r\n\r\n drawLegend();\r\n}", "title": "" }, { "docid": "34cb2622cceceb4dff705543f6848369", "score": "0.5999242", "text": "function drawPieChart() {\n\tconsole.log(\"Run\");\n\n\t// Create the data table.\n\tvar data = new google.visualization.DataTable();\n\tdata.addColumn('string', 'Topping');\n\tdata.addColumn('number', 'Slices');\n\tdata.addRows([\n\t\t['Mushrooms', 3],\n\t\t['Onions', 1],\n\t\t['Olives', 1],\n\t\t['Zucchini', 1],\n\t\t['Pepperoni', 2]\n\t]);\n\n\t// Set chart options\n\tvar options = {'title':'How Much Pizza I Ate Last Night','width':400,'height':300};\n\n\t \n\t// Instantiate and draw our chart, passing in some options.\n\tvar pie_chart = new google.visualization.PieChart(document.getElementById('pie_chart_div'));\n\tpie_chart.draw(data, options);\n}", "title": "" }, { "docid": "51db3a5be42981b06d9d9e1f3873a1b6", "score": "0.59988326", "text": "function drawMap(map)\n{\n\t$('.center-pane').empty()\n\tmap.pop()\n\n\n\tfor(i=0;i<map.length;i++){\n\t\tfor (w in wadi){\n\t\t\tif(wadi[w]['ID']==Number(map[i]['wadi_ID']))\n\t\t\t\tbreak\n\t\t}\n\t\tfor (s in souq){\n\t\t\tif(souq[s]['ID']==Number(map[i]['souq_ID']))\n\t\t\t\tbreak\n\t\t}\n\t\tdraw(w,s,100)\n\t}\n\t\t\n\t\n}", "title": "" }, { "docid": "f06bcf29e27afa314f8b214183f50bf2", "score": "0.59915155", "text": "function displayMap(data){\n\t\n\t//delete the documents/projects button\n\td3.select('#types').style(\"opacity\", 1).transition().duration(500).style('opacity', 0e-6).remove();\n\t\n\t\n\t var divmap = d3.select(\"#opere_display\").append('div').style('width', function(){\n\t \treturn d3.select('#params').style('width');\n\t }).style('height', function(){\n\t \treturn '100%';//window.innerHeight-d3.select('#opere_display')[0][0].offsetTop-10;\n\t })\n\t \n var map = new google.maps.Map(divmap.node(), {\n zoom: 5,\n center: new google.maps.LatLng(48.856626, 2.351139),\n //paris\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n\n //gérer tous les controles : \n panControl: false,\n mapTypeControl: false,\n overviewMapControl: false,\n streetViewControl: false,\n zoomControl: false,\n keyboardShortcuts: true,\n scrollwheel: true,\n\n //gérer le style :\n styles: [{\n featureType: \"all\",\n elementType: \"geometry\",\n stylers: [{\n saturation: -100\n }, {\n lightness: 50\n }, {\n visibility: \"simplified\"\n }]\n }, {\n featureType: \"all\",\n elementType: \"labels\",\n stylers: [{\n saturation: -100\n }]\n }, {\n featureType: \"road\",\n elementType: \"labels\",\n stylers: [{\n visibility: \"on\"\n }]\n }, {\n featureType: \"water\",\n elementType: \"geometry\",\n stylers: [{\n hue: \"#FFFFFF\"\n }, {\n saturation: 100\n }, {\n lightness: 100\n }]\n }, {\n featureType: \"administrative.country\",\n elementType: \"all\",\n stylers: [{\n saturation: 0\n }, {\n lightness: 0\n }, {\n visibility: \"on\"\n }]\n }]\n }); //fin de la map \t\n\t\n\t\n\tvar overlay = new google.maps.OverlayView();\n\t\n\tvar data = dynamicArray.list;\n\t\n // Add the container when the overlay is added to the map.\n overlay.onAdd = function() {\n var layer = d3.select(this.getPanes().overlayLayer).append(\"div\")\n .attr(\"class\", \"stations\");\n\n // Draw each marker as a separate SVG element.\n // We could use a single SVG, but what size would it have?\n overlay.draw = function() {\n var projection = this.getProjection(),\n padding = 10;\n\n var marker = layer.selectAll(\"svg\")\n .data(data)\n .each(transform) // update existing markers\n .enter().append(\"svg:svg\")\n .each(transform)\n .attr(\"class\", \"marker\");\n\n // Add a circle.\n marker.append(\"svg:circle\")\n .attr(\"r\", 4.5)\n .attr(\"cx\", padding)\n .attr(\"cy\", padding)\n .style('cursor', 'pointer')\n .on('mouseover',function(){\n \td3.select(this).transition().duration(200).attr(\"r\", 9);\n\n \t})\n .on('mouseout',function(){d3.select(this).transition().duration(200).attr(\"r\", 4.5)})\n .on('click', function(d){window.location.href = 'project/'+d.sigla})\n ;\n \n marker.on('mouseover', function(d){\n \t\n \t\t\t\t//d3.select(this).append('text').text('coucou').attr(\"x\", 0).attr('y', 0)\n \t\t\t\t//console.log(d3.select(this))\n\t\t\t \tvar top = window.event.clientY ;//d3.select(this)[0][0].offsetTop;\n\t\t\t \tvar left = window.event.clientX;//d3.select(this)[0][0].offsetLeft;\n\t\t\t \tvar data = d;\n\t\t\t \tvar tooltip = d3.select('#opere_display').append('div').attr('id', 'maptooltip')\n\t\t\t \t\n\t\t\t \ttooltip.style('left', function(){\n\t\t\t \t\treturn left;\n\t\t\t \t})\n\t\t\t \ttooltip.style('top', function(){\n\t\t\t \t\t//console.log(d3.select(this));\n\t\t\t \t\treturn top +20;//+ d3.select('#opere_display')[0][0].offsetTop;\n\t\t\t \t})\t\t\t \t\t\n\t\t\t \t\t\n\t\t\t \tvar text = tooltip.append(\"h3\").text(function(d){return data.denominazione;})\n\t\t\t \t\n\t\t\t \ttooltip.append('p').attr('class', 'temp').style('padding-left', \"10px\").style('border-left', '1px solid black')\n\t\t\t\t\t\t\t\t\t.html(function(){\n\t\t\t\t\t\t\t\t\t\tvar texte = ''\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\ttexte += 'Tipo : ' + data['tipo'] + '<br><br>';\n\t\t\t\t\t\t\t\t\t\ttexte += 'Indirizzo : ' + data['address'] + '<br><br>';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\ttexte += 'Date : '\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tfor(i in data['data']){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar interval = ''\n\t\t\t\t\t\t\t\t\t\t\tif(i!= 0) interval += ', '\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar d1 = data['data'][i]['begining'];\n\t\t\t\t\t\t\t\t\t\t\tvar d2 = data['data'][i]['end'];\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(d1<d2){\n\t\t\t\t\t\t\t\t\t\t\tinterval += d1 + '-' + d2;\n\t\t\t\t\t\t\t\t\t\t\t} else interval += d2 + '-' + d1;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\ttexte += interval;\n\t\t\t\t\t\t\t\t\t\t\treturn texte;\n\t\t\t\t\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 \t\n\t\t\t \t})\n\n .on('mouseout', function(d){\n \td3.selectAll('#maptooltip').remove();\n });\n \n /*\n var mask = marker.append ('svg:defs').append('svg:clipPath').attr('class', 'decoupe')\n \n mask.append('circle').attr('cx', 30).attr('cy', 30).attr('r', 10);\n \n var img = marker.append('image').attr('xlink:href', function(d){\n\t\t\t\t\t\t\treturn static_prefix+ d.adressthumb;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.attr(\"x\", -25)\n\t\t\t\t\t\t.attr('y', -25)\n\t\t\t\t\t\t.attr('width', 50)\n\t\t\t\t\t\t.attr('height', 50)\n\t\t\t\t\t\t.attr(\"clip-path\", \"url(.decoupe)\")*/\n \n /*var img = marker.append('image').attr('xlink:href', function(d){\n\t\t\t\t\t\t\treturn static_prefix+ d.adressthumb;\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.attr(\"x\", -25)\n\t\t\t\t\t\t.attr('y', -25)\n\t\t\t\t\t\t.attr('width', 50)\n\t\t\t\t\t\t.attr('height', 50)*/\n\n // Add a label.\n /*marker.append(\"svg:text\")\n .attr(\"x\", padding + 7)\n .attr(\"y\", padding)\n .attr(\"dy\", \".31em\")\n .text(function(d) { return d.address; });*/\n\n function transform(d) {\n d = new google.maps.LatLng(d['x'], d['y']);\n d = projection.fromLatLngToDivPixel(d);\n return d3.select(this)\n .style(\"left\", (d.x - padding) + \"px\")\n .style(\"top\", (d.y - padding) + \"px\");\n }\n };\n };\n\n // Bind our overlay to the map…\n overlay.setMap(map);\n \n\t\n}", "title": "" }, { "docid": "4bfd3e19a937a05b1cc4571d09d64591", "score": "0.59822416", "text": "function showData() {\n //count the rows in our table\n background(85);\n strokeWeight(0.1);\n stroke(255);\n\n//scale circles \n for (var d = 0; d <= 1; d = d + 0.1) {\n ellipse(windowWidth / 2, windowHeight / 2, windowHeight * d, windowHeight * d);\n }\n\n stroke(85);\n\n var count = table.getRowCount();\n var rowHeight = 20;\n var j = 2 * PI / count;\n for (var r = 0; r < count; r++) {\n\n // loop through all the columns\n // var country = table.getString(r, 2);\n var valf = table.getString(r, 3);\n var valm = table.getString(r, 4);\n // display the text on the canvas\n\n valf = parseFloat(valf);\n valm = parseFloat(valm);\n\n\n\n var femaleRadius = map(valf, rangeLow, rangeHigh, 0, windowHeight);\n var maleRadius = map(valm, rangeLow, rangeHigh, 0, windowHeight);\n // var top = map(1, rangeLow, rangeHigh, 0, windowHeight);\n \n fill(85, 85, 85, 100);\n strokeWeight(3);\n arc(windowWidth / 2, windowHeight / 2, windowHeight + 20, windowHeight + 20, r * j, r * j + j, PIE);\n noFill();\n // noStroke();\n strokeWeight(0.1);\n\n\n //male bars\n fill(159, 33, 49);\n arc(windowWidth / 2, windowHeight / 2, maleRadius, maleRadius, r * j, r * j + j, PIE);\n noFill();\n\n \n //female bars\n fill(200);\n arc(windowWidth / 2, windowHeight / 2, femaleRadius, femaleRadius, r * j, r * j + j, PIE);\n noFill();\n // noStroke();\n // strokeWeight(0.1);\n\n //inner circle \n fill(85);\n ellipse(windowWidth / 2, windowHeight / 2, windowHeight * 0.15, windowHeight * 0.15);\n noFill();\n fill(255);\n // text(\"hi\", windowWidth / 2 - 9, windowHeight / 2);\n \n // text(country, windowWidth, windowHeight);\n }\n\n \n}", "title": "" }, { "docid": "739164d790cbd7b47e9de891964a6f71", "score": "0.59814614", "text": "function drawSysDashboard(events) {\n\t\n\t\n//Create a dashboard and data table \neventsdashboard = new google.visualization.Dashboard(document.getElementById('dashboard')); \neventsdata = new google.visualization.DataTable();\t\norgdata = new google.visualization.DataTable();\t\n\n \n//build a datatable for the piechart\nvar eventpiedata = new google.visualization.DataTable();\n\t\teventpiedata.addColumn('string', 'Event Type');\n\t\teventpiedata.addColumn('number', 'Number');\n\t\teventpiedata.addRows([\n ['Conflict', conflict],\n ['Earthquake', earthquake],\n ['Epidemic', epidemic],\n ['Flood', flood],\n ['Hurricane', hurricane],\n ['Tornado', tornado],\n ['Tsunami', tsunami],\n ['Other', other]\n ]);\n\t\n\n// create the data table and add column headings before loop\n\neventsdata.addColumn('string','Name');\neventsdata.addColumn('string', 'Type of Event');\neventsdata.addColumn('date', 'Created');\neventsdata.addColumn('number', 'Assessments');\neventsdata.addColumn('number', 'Service Areas');\n\n\n\n//count length of events array and put into rows\neventsdata.addRows(events.length);\n\n\n//set the values in a loop\n$.each(events, function(key, event) {\n\t//change json date to date object\n\tdate = new Date(event.created);\n\t\n\teventsdata.setCell(key, 0, event.name);\n\teventsdata.setCell(key, 1, event.eventtype);\n\teventsdata.setValue(key, 2, date);\n\teventsdata.setValue(key, 3, event.assessmentareas.length);\n\teventsdata.setValue(key, 4, event.serviceareas.length);\n\n\t\n}); \n\n\n\n\n// Define a category picker control for the Gender column\nvar categoryPicker = new google.visualization.ControlWrapper({\n 'controlType': 'CategoryFilter',\n 'containerId': 'CatSelect',\n 'options': {\n 'filterColumnLabel': 'Event Type', //this needs to be changed if you use the other data table\n 'ui': {\n 'labelStacking': 'horizonal',\n 'allowTyping': false,\n 'allowMultiple': true\n }\n }\n});\n\n//define a chart controler to handle dates\n var control = new google.visualization.ControlWrapper({\n 'controlType': 'ChartRangeFilter',\n 'containerId': 'control',\n 'options': {\n // Filter by the date axis.\n 'filterColumnIndex': 3,\n 'ui': {\n 'chartType': 'LineChart',\n 'chartOptions': {\n 'chartArea': {'width': '90%'},\n 'hAxis': {'baselineColor': 'none'}\n },\n // Display a single series that shows the average of the stock open and close values.\n // Thus, this view has two columns: the date (axis) and the stock average (line series).\n 'chartView': {\n 'columns': [\n 0, {\n 'calc': 1,\n 'type': 'number'\n }]\n },\n // 1 day in milliseconds = 24 * 60 * 60 * 1000 = 86,400,000\n 'minRangeSize': 86400000\n }\n },\n // Initial range: 2012-02-09 to 2012-03-20.\n 'state': {'range': {'start': new Date(2000, 1, 9), 'end': new Date(2012, 2, 20)}}\n });\n\n\n//Define a pie chart\n\n \n //var piechart = new google.visualization.PieChart(document.getElementById('piechart_div'));\n var piechart = new google.visualization.ChartWrapper({\n \t 'chartType': 'PieChart',\n \t 'containerId': 'piechart_div',\n \t 'options': {\n \t 'width': 450,\n \t 'height': 250,\n \t \t'colors':['green','red','yellow','lightblue', 'blue','green','blue', 'grey'],\n \t 'title' :\"Events by Type\"\n \t }\n \t});\n\n// Define a bar chart\nvar barChart = new google.visualization.ChartWrapper({\n\t 'chartType': 'ColumnChart',\n\t 'containerId': 'barChart',\n\t 'options': {\n\t 'width': 450,\n\t 'height': 300,\n\t 'title' :\"Response Events\",\n\t 'vAxis': {title: 'Total Number', titleTextStyle: {color: 'red'}},\n\t 'hAxis': {title: 'Event', titleTextStyle: {color: 'blue', fontName: 'arial', fontSize: 12}},\n\t 'chartArea': {width:\"40%\",height:\"50%\"}\n\t },\n\t 'view': {'columns': [0, 3, 4]}\n\t});\n\n// Define a table\nvar eventtable = new google.visualization.ChartWrapper({\n 'chartType': 'Table',\n 'containerId': 'eventDataTable',\n 'options': {\n 'width': '400px'\n\n },\n 'view': {'columns': [0, 1, 2]}\n\n});\n\n\n\n //bind and draw\n //dashboard.bind(categoryPicker, [barChart, eventtable]);\n eventsdashboard.bind(categoryPicker, [piechart]);\n eventsdashboard.draw(eventpiedata);\n \n\n // When the slector is selected, togle the markers.\n google.visualization.events.addListener(categoryPicker, 'statechange', function() {\n\n\t //clear the timeline\n\teventsTlSource.clear();\n\ttempEvents =[];\n\ttimeLineEventsArray =[];\n\n \n\t//hide the markers\n\t$.each(saveMarkers, function(index, marker) { \n\n\t\tmarker.setVisible(false);\n\t\t\n\t}); \n \n\n //selection array\n selections = categoryPicker.getState().selectedValues;\n \n\t//if selction is empty, show all markers\n\tif (selections == \"\")\t{\n\n\t\t//rebuild the timeline with all events\n\t\t\t //clear the timeline\n tempEvents =events;\n\t\t//buildEventsTimeline(events);\n\t\t\n\t\t//show the markers\n\t\t$.each(saveMarkers, function(index, marker) { \n\n\t\t\tmarker.setVisible(true);\n\t\t\t\n\t\t}); \n\t} \n \n\n\t//iterate over the selctions\n\t$.each(selections, function(index, selection) { \n\t \t//iterate over the markers\n\t\t\t$.each(saveMarkers, function(index, marker) { \n\t\t\t\t// based on the alert, appears that I can access orgObject for each marker = alert(marker.myorgs);\n\t\t\t\tif (marker.myCategory == selection){\n\t\t\t\t\tmarker.setVisible(true);\n\t\t\t\t}\n\t\t\t});\n\t \t\n\t \t//iterate over the tempEventsArray and only build selected \n\t \t\n\t \t$.each(events, function(index, event) { \n\t \t\t\n\t\t\t\tif (event.eventtype == selection){\n\t\t\t\t\t\n\t\t\t\t\ttempEvents.push(event);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\n\t});\t \n\n\tbuildEventsTimeline(tempEvents); \n \n \n }); \n \n \n \n}", "title": "" }, { "docid": "6a461edceece317e5be3e64356fb0ea5", "score": "0.5977879", "text": "function makeGraphs(error, crimeData, mapJson) {\n var ndx = crossfilter(crimeData); // Run all data through crossfilter\n\n crimeType(ndx); // Type of crime pie chart\n crimeOutcome(ndx); // Outcome of crimes row chart\n totalCrime(ndx); // The total crimes selected, all by default\n crimeMap(ndx, mapJson); // Map of Hertfordshire\n crimeMonth(ndx); // Month selector\n monthTotal(ndx); // Total crimes per month in bar chart\n\n dc.renderAll(); // Render all the charts\n\n // Stop spinner and hidde overlay\n spinner.stop();\n document.getElementById('loader').style.visibility = 'hidden';\n}", "title": "" }, { "docid": "1282737ce6fd15e83413243690217ea1", "score": "0.59778255", "text": "function drawMap(featureCollection,data, gmap) { \r\n\r\n\t// Proyección\r\n const center = d3.geoCentroid(featureCollection); \r\n const projection = d3.geoMercator()\r\n .fitSize([width-marginleftmap, height-marginleftmap], featureCollection)\r\n .center(center)\r\n .translate([width/2, height/2 + yposinimap]);\r\n\r\n // Uso de la proyección\r\n const pathProjection = d3.geoPath().projection(projection);\r\n\r\n // Pintar las coordenadas del json\r\n const features = featureCollection.features;\r\n\r\n // Cálculamos el máximo avgprice del json\r\n const maxavgprice = d3.max(features, function(d) { return d.properties.avgprice; });\r\n\r\n // Pintar el mapa\r\n const neighbourhoodsPath = gmap.selectAll('.neighbourhoods')\r\n \t.data(features)\r\n \t.enter()\r\n \t.append('path')\r\n .attr('stroke', 'black')\r\n .attr('stroke-width', 0.5);\r\n\r\n neighbourhoodsPath.attr('d', pathProjection);\r\n\r\n neighbourhoodsPath.on('click', clickNeighbourhood)\r\n \t.on('mouseover', mouseoverNeighbourhood)\r\n \t.on('mouseleave', mouseleaveNeighbourhood);\r\n\r\n function mouseoverNeighbourhood(d, i){\r\n d3.select(this)\r\n .transition()\r\n .duration(200)\r\n .attr('fill', 'red');\r\n }\r\n\r\n\r\n function mouseleaveNeighbourhood(d, i){\r\n d3.select(this)\r\n .transition()\r\n .duration(200)\r\n .attr('fill', (d) => color(d.properties.avgprice));\r\n }\r\n\r\n function clickNeighbourhood(d, i) {\r\n // Pintar la leyenda sobre el mapa\r\n drawLeyend(d.properties.name, d.properties.avgprice);\r\n\r\n // Filtrar los datos del csv según el barrio seleccionado\r\n const neighbourselect = d.properties.name;\r\n const datagraph = data.filter(\r\n datos => datos.neighbourhood == neighbourselect\r\n );\r\n\r\n // Pintar el bar chart con los datos del barrio seleccionado\r\n drawGraph(d.properties.name, groupGraph,datagraph);\r\n \r\n }\r\n\r\n // Nº de divisiones de las leyendas\r\n const numberOfLegends = 7;\r\n \r\n // Treshold Scale Legend\r\n const color = d3.scaleThreshold()\r\n .domain([40, 80, 120, 160, 200, 240, maxavgprice])\r\n .range(d3.schemeYlGnBu[numberOfLegends]);\r\n\r\n neighbourhoodsPath.attr('fill', (d) => color(d.properties.avgprice))\r\n \r\n // Leyenda con el precio (rectángulo)\r\n const legend = gmap.append('g')\r\n\t .attr('class', 'legend')\r\n\t .attr('title', 'AVG Price');\r\n\r\n\r\n // Escala lineal con 6 rectangulos en base al max del precio medio por barrio\r\n const scaleLegend = d3.legendColor()\r\n .scale(color);\r\n\r\n const legendGroup = legend\r\n .append('g')\r\n .attr('transform', `translate (${widthlegend}, ${heightlegend}) `)\r\n .call(scaleLegend);\r\n\r\n legend.attr('transform', `translate(${marginleftmap},0)`);\r\n gmap.attr('transform', `translate(${-marginleftmap},0)`);\r\n}", "title": "" }, { "docid": "4706a71509f8fdd4c994e0bcb33d273f", "score": "0.5974173", "text": "function drawData(withFill, withClick, mousePos) {\n\tvar font = c.font;\n\t \n\t//draw data \n\tc.lineWidth = 1.0;\n\tvar stop = true;\t\n\t\n\tvar pieData = [];\n\tvar cx;\n\tvar cy;\n\tif (showLabels) {\n\t\tcx = realWidth-2*getMaxLabelWidth()-2*line-20;\n\t\tcy = realHeight-titleSpace-getLabelHeight()-2*line-20;\n\t} else {\n\t\tcx = realWidth-2*line-20;\n\t\tcy = realHeight-titleSpace-2*line-20;\n\t}\n\tvar center = [realWidth / 2, (realHeight+titleSpace) / 2];\t\n\tvar radius = Math.min(cx, cy) / 2;\n\tif (radius < 0) {\n\t\tradius = 20;\n\t}\n\tvar total = 0;\n\tvar lastPosition = 0;\n\t// total up all the data for chart\n\tfor (var i in data) { total += data[i]; }\n\t\n\tif (radius-delta < H) {\n H = radius-delta;\n } else {\n stop = false;\n } \n\t\n\t// populate arrays for each slice\n\tfor(var i in data) {\n\t\tpieData[i] = [];\n\t\tpieData[i]['value'] = data[i];\n\t\tvar percent = data[i]*100/total;\t\t\n\t\tpieData[i]['percent'] = Math.round(percent*100)/100;\n\t\tpieData[i]['startAngle'] = 2 * Math.PI * lastPosition;\n\t\tpieData[i]['endAngle'] = 2 * Math.PI * (lastPosition + (data[i]/total));\n\t\tpieData[i]['labelAngle'] = pieData[i]['startAngle'] + Math.abs(pieData[i]['endAngle']-pieData[i]['startAngle'])/2;\n\t\tpieData[i]['middle'] = [center[0]+H*Math.cos(pieData[i]['labelAngle']), center[1]+H*Math.sin(pieData[i]['labelAngle'])];\n\t\tpieData[i]['labelpos'] = [pieData[i]['middle'][0] + line*Math.cos(pieData[i]['labelAngle']) ,pieData[i]['middle'][1] + line*Math.sin(pieData[i]['labelAngle'])];\t\n\t\tlastPosition += data[i]/total;\n\t}\t\n\tdelta = adjustYLabels(pieData, center, H+line);\t\n\t\t\n\tvar cursorStyle = 'default';\n\tfor(var i=0; i<data.length; i++) { \n\t\t\n\t\t// create slices paths\n\t\tdefineSliceSelection(pieData, i, center, H);\n\t \n\t\tif (withFill) {\n\t\t\tvar gradient = c.createLinearGradient( 0, 0, realWidth, realHeight );\n\t\t\tgradient.addColorStop( 0, \"#ddd\" );\n\t\t\tgradient.addColorStop( 1, seriesColor[i] );\n\t\t\t\n\t\t\t// draw slices\t\t\t\n\t\t\tc.fillStyle = gradient;\n\t\t\tc.fill();\t\t\t\n\t\t\tc.lineWidth = 1;\n\t\t\tc.strokeStyle = \"#fff\";\n\t\t\tc.stroke();\t \t\t\t\n\t\t\n\t\t\t// draw Labels\t\n\t\t\tif (typeof labels !== \"undefined\") {\n\t\t\t\tdrawLabels(i, pieData);\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tvar fromCenterX = mousePos.x - center[0];\n\t\t\tvar fromCenterY = mousePos.y - center[1];\n\t\t\tvar fromCenter = Math.sqrt(Math.pow(Math.abs(fromCenterX), 2) + Math.pow(Math.abs(fromCenterY), 2 ));\n\t\t\t\n\t\t\t// highlight selection\n\t\t\tif ((fromCenter <= radius-delta) && (i == highlighterIndex)) {\n\t\t\t\thighlight(seriesColor[i], 0.5);\t\t\n\t\t\t} else {\n\t\t\t\tunhighlight(i);\n\t\t\t}\t\t\t\n\t \t\t \t\t \t\t \t\n\t\t\tif (fromCenter <= radius-delta) {\n\t\t\t\tvar angle = Math.atan2(fromCenterY, fromCenterX);\n\t\t\t\tif (angle < 0) angle = 2 * Math.PI + angle; // normalize\n\n\t\t\t\tvar found;\n\t\t\t\tfor (var slice in pieData) {\t\t\t\t\t\n\t\t\t\t\tif (angle >= pieData[slice]['startAngle'] && angle <= pieData[slice]['endAngle']) {\t\t\t\t \t\t\n\t\t\t \t\thighlighterIndex = slice;\t \t\t\t \t\t\n\t\t\t\t\t\tvar tValue = pieData[slice]['value'];\n\t\t\t\t\t\tvar tTotal = total;\n\t\t\t \t\tif (obj.tooltipPattern !== undefined) {\n\t\t\t \t\t\ttValue = formatNumber(tValue, obj.tooltipPattern.decimals, obj.tooltipPattern.decimalSeparator, obj.tooltipPattern.thousandSeparator);\n\t\t\t \t\t\ttTotal = formatNumber(tTotal, obj.tooltipPattern.decimals, obj.tooltipPattern.decimalSeparator, obj.tooltipPattern.thousandSeparator);\n\t\t\t \t\t}\t \t\n\t\t\t \t\t\n\t\t\t \t\tvar returnValue;\n\t\t\t \t\tif (labels === undefined) {\n\t\t\t \t\t\treturnValue = \"\";\n\t\t\t \t\t} else {\n\t\t\t \t\t\treturnValue = labels[slice]; // tValue\n\t\t\t \t\t}\n\t\t\t \t\tif (withClick) {\n\t\t\t \t\t\tif (found === undefined) {\n\t\t\t \t\t\t\tfound = returnValue;\n\t\t\t \t\t\t}\n\t\t\t \t\t} else {\n\t\t\t\t\t \tvar mes = String(message).replace('#val', tValue);\n\t\t\t\t\t \tmes = mes.replace('#x', returnValue);\n\t\t\t\t\t \tmes = mes.replace('#total', tTotal);\n\t\t\t\t\t \tmes = mes.replace('#percent', pieData[slice]['percent']);\n\t\t\t\t\t \tif (obj.onClick !== undefined) {\n\t\t\t\t\t \t\tcursorStyle = 'pointer';\n\t\t\t\t\t \t\tcanvas.style.cursor = cursorStyle;\n\t\t\t\t\t \t}\n\t\t\t\t\t \tif (found === undefined) {\n\t\t\t\t \t\tfound = mes;\n\t\t\t\t \t}\t\t\t\t\t \n\t\t\t \t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (cursorStyle != 'pointer') {\n\t\t\t\t\t\t\tcanvas.style.cursor = 'default';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \t \t\t\t\t\t \n\t }\n\t \n\t} \n\t\n\tif (found !== undefined) {\t\t \n\t\treturn found;\n\t}\t\n\t\t\n\tif (withFill) {\n\t\treturn stop;\n\t} else {\n\t\t// empty tooltip message\n\t\treturn \"\";\n\t}\n}", "title": "" }, { "docid": "8d1349a9915580fc6906d5af705d6ca1", "score": "0.59685063", "text": "async function drawMap() {\n let countyData = await d3.json('data/us_counties.json');\n let stateData = await d3.json('data/us_states.json');\n let dividedCounties = {};\n let codes = {};\n for (let state of stateData.features){\n codes[+state.properties.STATE] = state.properties.NAME.toLowerCase();\n dividedCounties[state.properties.NAME.toLowerCase()] = {\n features: [], \n state_features: state, \n type:'FeatureCollection'}\n }\n for (let county of countyData.features){\n let name = codes[+county.properties.STATE];\n dividedCounties[name].features.push(county);\n }\n countyMap.drawMap(dividedCounties);\n }", "title": "" }, { "docid": "e97eeb49b3103e7fcec54e9d3a4820dd", "score": "0.5962583", "text": "function makeChart(error, data, namedata, aidata) {\n if (error) throw error;\n var bcb = 0;\n aidata.forEach(function (d) {\n if (map1[d.Country] != null) {\n map1[d.Country] = map1[d.Country] + 1;\n bcb = bcb + 1;\n } else {\n map1[d.Country] = 1;\n bcb = bcb + 1;\n }\n\n if (map3[d.Make] != null) {\n map3[d.Make] = map3[d.Make] + 1;\n } else {\n map3[d.Make] = 1;\n }\n\n if (map5[d.Make] != null) {\n map5[d.Make] = +map5[d.Make] + Number(d.Total_Fatal_Injuries);\n } else {\n map5[d.Make] = +d.Total_Fatal_Injuries;\n }\n var date = d.Event_Date;\n date = date.substring(date.lastIndexOf(\"/\") + 1);\n if (map7[date] != null) {\n map7[date] = +map7[date] + 1;\n } else {\n map7[date] = +1;\n }\n });\n //by country array\n var map2 = [];\n aaa = 0;\n\n for (var key in map1) {\n var c = map1[key];\n namedata.forEach(function (d) {\n if (d.name == key) {\n map2[aaa] = {Country: key, Count: +c, ID: d.id};\n\n aaa++;\n }\n })\n }\n\n\n var countries = topojson.feature(data, data.objects.countries).features;\n\n\n map2.sort((a, b) => (a.Count > b.Count) ? -1 : ((b.Count > a.Count) ? 1 : 0));\n g.selectAll(\".country\")\n .data(countries)\n .enter().append(\"path\")\n .attr(\"class\", \"country\")\n .attr(\"d\", path)\n .on('click', function (d) {\n d3.select(this).classed(\"selected\", true)\n })\n .on(\"mouseover\", function (d) {\n d3.select(this).classed(\"selected\", true)\n\n })\n .on(\"mouseout\", function (d) {\n d3.select(this).classed(\"selected\", false)\n svg2.selectAll('.bar')\n .classed(\"selected2\", false)\n })\n g.append('path')\n .datum(countries)\n .attr('d', path);\n\n //create the zoom effect\n\n var zoom = d3.behavior.zoom()\n .on(\"zoom\", function () {\n g.attr(\"transform\", \"translate(\" +\n d3.event.translate.join(\",\") + \")scale(\" + d3.event.scale + \")\");\n g.selectAll(\"path\")\n .attr(\"d\", path.projection(projection));\n });\n svg.call(zoom);\n\n\n // number of incidents by make array\n var map4 = [];\n aaa = 0;\n for (var key in map3) {\n var c = map3[key];\n map4[aaa] = {Make: key, Count: +c};\n aaa++;\n }\n map4 = map4.map(function(d, i){ d.value = +d.Count; return d; });\n var nodes1 = bubble.nodes({children:map4}).filter(function(d) { return !d.children; });\n\n\n //setup the chart\n var bubbles = svg3.append(\"g\")\n .attr(\"transform\", \"translate(0,0)\")\n .selectAll(\".bubble\")\n .data(nodes1)\n .enter();\n\n //create the bubbles\n bubbles.append(\"circle\")\n .attr(\"r\", function(d){ return d.r; })\n .attr(\"cx\", function(d){ return d.x; })\n .attr(\"cy\", function(d){ return d.y; })\n .style(\"fill\", function(d) { return color(d.value); });\n\n //format the text for each bubble\n bubbles.append(\"text\")\n .attr(\"x\", function(d){ return d.x; })\n .attr(\"y\", function(d){ return d.y + 5; })\n .attr(\"text-anchor\", \"middle\")\n .text(function(d, i){ return d.Make; })\n .style({\n \"fill\":\"white\",\n \"font-family\":\"Helvetica Neue, Helvetica, Arial, san-serif\",\n \"font-size\": \"14px\"\n });\n\n\n // number fo fatal injuries by make array\n var map6 = [];\n aaa = 0;\n for (var key in map5) {\n var c = map5[key];\n map6[aaa] = {Make: key, Injury: +c};\n aaa++;\n }\n map6 = map6.map(function(d, i){ d.value = +d.Injury; return d; });\n var nodes2 = bubble.nodes({children:map6}).filter(function(d) { return !d.children; });\n\n //setup the chart\n var bubbles2 = svg4.append(\"g\")\n .attr(\"transform\", \"translate(0,0)\")\n .selectAll(\".bubble\")\n .data(nodes2)\n .enter();\n\n //create the bubbles\n bubbles2.append(\"circle\")\n .attr(\"r\", function(d){ return d.r; })\n .attr(\"cx\", function(d){ return d.x; })\n .attr(\"cy\", function(d){ return d.y; })\n .style(\"fill\", function(d) { return color2(d.value); });\n\n //format the text for each bubble\n bubbles2.append(\"text\")\n .attr(\"x\", function(d){ return d.x; })\n .attr(\"y\", function(d){ return d.y + 5; })\n .attr(\"text-anchor\", \"middle\")\n .text(function(d, i){ return d.Make; })\n .style({\n \"fill\":\"white\",\n \"font-family\":\"Helvetica Neue, Helvetica, Arial, san-serif\",\n \"font-size\": \"13px\"\n });\n\n var max = d3.max(map2, function(d, i) { return d.Count; });\n var maxmax = 1;\n\n var y = d3.scale.linear().domain([0,max]).range([height, 10]);\n\n var yy = d3.scale.linear().domain([0,maxmax]).range([height, 10]);\n\n var x = d3.scale.ordinal()\n .domain(map2.map(function(d, i) { return d.Country; }))\n .rangeRoundBands([0, width], 0.1);\n\n var xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\");\n\n var yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\");\n\n var formatPercent = d3.format(\".0%\");\n var yyAxis = d3.svg.axis()\n .scale(yy)\n .orient(\"right\")\n .tickFormat(formatPercent);\n\n svg2.append(\"g\")\n .attr(\"class\", \"xaxis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n .selectAll(\"text\")\n .style(\"font-size\", \"12px\")\n .style(\"text-anchor\", \"end\")\n .attr(\"dx\", \"-.9em\")\n .attr(\"dy\", \"-.5em\")\n .attr(\"transform\", function(d) {\n return \"rotate(-80)\"\n });\n\n svg2.append(\"g\")\n .attr(\"class\", \"yaxis\")\n .style(\"font-size\", \"12px\")\n .call(yAxis);\n\n svg2.append(\"g\")\n .attr(\"class\", \"yyaxis\")\n .attr(\"transform\", \"translate(\" + width + \" ,0)\")\n .style(\"font-size\", \"12px\")\n .call(yyAxis);\n\n // Bars\n bar = svg2.selectAll(\".bar\")\n .data(map2)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function(d, i) { return x(d.Country); })\n .attr(\"width\", x.rangeBand())\n .attr(\"y\", function(d, i) { return y(d.Count); })\n .attr(\"height\", function(d, i) { return height - y(d.Count); })\n .on('mouseover', function(d) {\n d3.select(this).classed(\"selected\", true)\n d3.select('#numIn').text(d.Count);\n d3.select('#perIn').text(Number(+d.Count/bcb * 100).toFixed(2) + \"%\");\n d3.select('#tooltip2')\n .style('left', (d3.event.pageX + 20) + 'px')\n .style('top', (d3.event.pageY - 80) + 'px')\n .style('display', 'block')\n .style('opacity', 0.8)\n })\n .on('mouseout', function(d) {\n d3.select(this).classed(\"selected\", false)\n d3.select('#tooltip2')\n .style('display', 'none');\n });\n\n\n\n // number of incidents by make array\n var map8 = [];\n aaa = 0;\n for (var key in map7) {\n var c = map7[key];\n if (+key > 90) key = Number(key) + 1900;\n else if (+key > 80) key = Number(key) + 1800;\n else key = Number(key) + 2000;\n map8[aaa] = {Year: +key, Count: +c};\n aaa++;\n }\n map8.sort((a,b) => (a.Year > b.Year) ? 1 : ((b.Year > a.Year) ? -1 : 0));\n\n var max2 = d3.max(map8, function(d, i) { return d.Count; }) + 10;\n\n var y2 = d3.scale.linear().domain([0,max2]).range([height, 0]);\n\n var x2 = d3.scale.ordinal()\n .domain(map8.map(function(d, i) { return d.Year; }))\n .rangeRoundBands([0, width], 0.1);\n\n var xAxis2 = d3.svg.axis()\n .scale(x2)\n .orient(\"bottom\");\n\n var yAxis2 = d3.svg.axis()\n .scale(y2)\n .orient(\"left\");\n\n svg5.append(\"g\")\n .attr(\"class\", \"xaxis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis2)\n .selectAll(\"text\")\n .style(\"font-size\", \"12px\")\n .style(\"text-anchor\", \"end\")\n .attr(\"dx\", \"-.9em\")\n .attr(\"dy\", \"-.5em\")\n .attr(\"transform\", function(d) {\n return \"rotate(-80)\"\n });\n\n svg5.append(\"g\")\n .attr(\"class\", \"yaxis\")\n .style(\"font-size\", \"12px\")\n .call(yAxis2);\n\n\n // Bars\n var bar2 = svg5.selectAll(\".bar\")\n .data(map8)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function(d, i) { return x2(d.Year); })\n .attr(\"width\", x2.rangeBand())\n .attr(\"y\", function(d, i) { return y2(d.Count); })\n .attr(\"height\", function(d, i) { return height - y2(d.Count); });\n\n svg5.selectAll(\".text\")\n .data(map8)\n .enter()\n .append(\"text\")\n .style(\"font-size\", \"12px\")\n .style('fill', 'white')\n .attr(\"class\",\"label\")\n .attr(\"x\", (function(d,i) { return x2(d.Year) + 29; } ))\n .attr(\"y\", function(d,i) { return y2(d.Count) + 4; })\n .attr(\"dy\", \".75em\")\n .text(function(d) { return d.Count; });\n\n\n dataset=aidata.map(function(d) { return [+d.Longitude,+d.Latitude];});\n //var locations = [data.Latitude, data.Longitude];\n //var hue = 0; //create the circles\n\n // Classic D3... Select non-existent elements, bind the data, append the elements, and apply attributes\n g.selectAll('circle')\n .data(aidata)\n .enter()\n .append('circle') //show the circles\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\", 2)\n .style('fill', \"black\")\n //Next, we need to write two pieces of code, one that listens for when the value of the tooltip changes, and one that updates the SVG elements.\n //We are going to use some D3 code to listen for an input change on the tooltip elements\n\n //Add Event Listeners | mouseover\n .on('mouseover', function(d) {\n d3.select('#number').text(d.Accident_Number);\n d3.select('#date').text(d.Event_Date);\n d3.select('#location').text(d.Location);\n d3.select('#country').text(d.Country);\n d3.select('#injury').text(d.Injury_Severity);\n d3.select('#carrier').text(d.Air_Carrier);\n d3.select('#totalFatal').text(d.Total_Fatal_Injuries);\n d3.select('#totalSerious').text(d.Total_Serious_Injuries);\n d3.select('#weather').text(d.Weather_Condition);\n d3.select('#tooltip')\n .style('left', (d3.event.pageX + 20) + 'px')\n .style('top', (d3.event.pageY - 80) + 'px')\n .style('display', 'block')\n .style('opacity', 0.8)\n d3.select(this).style('fill', 'red');\n })\n .on('mouseout', function(d) {\n d3.select(this).style('fill', d.color);\n d3.select('#tooltip')\n .style('display', 'none');\n d3.select(this).style('fill', 'black');\n });\n }", "title": "" }, { "docid": "1125d1820ad9c27ef925b114b9e95a90", "score": "0.594401", "text": "function drawCharts() {\n fetch('/words', {method: 'GET'}).then(response => response.json()).then((wordsArray) => {\n const chartsDOM = document.querySelector('.charts-divs');\n var index = 0;\n wordsArray.forEach(album => {\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Words');\n data.addColumn('number', 'Number of appearances');\n data.addRows(Object.entries(album.words).map(\n ([_, wordObj]) => [wordObj.word, wordObj.frequency]));\n\n var options = {'title': album.musician + ' - \\\"' + album.albumTitle + '\\\"',\n 'width': 400,\n 'height': 300};\n\n const divElement = document.createElement('div');\n divElement.id = 'chart-' + index;\n chartsDOM.appendChild(divElement);\n var chart = new google.visualization.PieChart(divElement);\n chart.draw(data, options);\n\n index++;\n })\n })\n}", "title": "" }, { "docid": "df0940748f8a9ed9f337a809f202f34c", "score": "0.59403574", "text": "function loading(error, us, data) {\r\n if (error && error.target.status === 404) {\r\n console.log(\"File not found\")\r\n }\r\n if(data.length === 0){\r\n console.log(\"File empty\")\r\n }\r\n var combineIdEarnings = {};\r\n var combineIdName = {};\r\n var combineIdRate = {};\r\n var listname = {};\r\n var combineNumbers = {};\r\n\r\ndata.forEach(function(d) {\r\n combineIdEarnings[d.id] = +d.earnings;\r\n combineIdName[d.id] = d.name;\r\n combineIdRate[d.id] = +d.rate;\r\n listname[d.id] = d.name;\r\n combineNumbers[d.id] = +d.num;\r\n});\r\n\r\n// append colours to US counties map\r\nsvg.append(\"g\")\r\n .attr(\"class\", \"county\")\r\n .selectAll(\"path\")\r\n .data(topojson.feature(us, us.objects.counties).features)\r\n .enter().append(\"path\")\r\n .attr(\"d\", path)\r\n .style ( \"fill\" , function (d) {\r\n return colour (combineIdEarnings[d.id]);\r\n })\r\n .style(\"opacity\", 1)\r\n\r\n// add interactivity on mouseover\r\n .on(\"mouseover\", function(d) {\r\n d3.select(this).transition().duration(100).style(\"opacity\", 0.7);\r\n div.transition().duration(100)\r\n .style(\"opacity\", 1);\r\n\r\n// show tooltip on mouseover\r\n div.text(combineIdName[d.id] + \" : $\" + combineIdEarnings[d.id])\r\n .style(\"left\", (d3.event.pageX) + \"px\")\r\n .style(\"top\", (d3.event.pageY -30) + \"px\");\r\n })\r\n\r\n// on mouseout reset opacity\r\n .on(\"mouseout\", function() {\r\n d3.select(this)\r\n .transition().duration(100)\r\n .style(\"opacity\", 1);\r\n div.transition().duration(100)\r\n .style(\"opacity\", 0);\r\n })\r\n\r\n .on(\"click\", function (d) {\r\n id = combineNumbers[d.id]\r\n drawbar(data, id);\r\n })\r\n// add a title to the map\r\nsvg.append(\"svg:text\")\r\n .attr(\"class\", \"title\")\r\n .attr(\"x\", 400)\r\n .attr(\"y\", 20)\r\n .text(\"Total earnings(TH$) per U.S. county in 2001\");\r\n\r\n// add a legend element\r\nvar legend = svg.selectAll(\"g.legend\")\r\n .data(colour_domain)\r\n .enter().append(\"g\")\r\n .attr(\"class\", \"legend\");\r\n\r\nvar legend_height = 20;\r\n\r\n// create legend rects\r\nlegend.append(\"rect\")\r\n .attr(\"x\", 20)\r\n .attr(\"y\", function(d, i){ return height - (i*legend_height) - 2*legend_height - 10;})\r\n .attr(\"width\", 20)\r\n .attr(\"height\", legend_height)\r\n .style(\"fill\", function(d, i) { return colour(d); })\r\n .style(\"opacity\", 0.8);\r\n\r\n// add label descriptions\r\nlegend.append(\"text\")\r\n .attr(\"x\", 50)\r\n .attr(\"y\", function(d, i){ return height - (i*legend_height) - legend_height - 15;})\r\n .text(function(d, i){ return labels_legend[i];\r\n});\r\n}", "title": "" }, { "docid": "2d79859a511a4bc82e1992910521d135", "score": "0.5935112", "text": "function loadPieData()\r\n {\r\n d3.csv(\"https://raw.githubusercontent.com/apogaku/VAProject/e7e75ac959cc7b62a87db038b0ba75defc491d37/pqid_combined%20prodoffers.csv\",function(data)\r\n {\r\n \r\n myEntireData=data;\r\n \r\n d3.select(\"#svg_pie\")\r\n .attr(\"width\", svgWidth_pie + margin_pie.left + margin_pie.right)\r\n .attr(\"height\", svgHeight_pie + margin_pie.top + margin_pie.bottom)\r\n .append(\"g\")\r\n .attr(\"id\", \"svg_pie_g_id\")\r\n .attr(\"transform\", \"translate(\" + margin_pie.left + \",\" + margin_pie.top + \")\"); \r\n d3.select(\"#svg_pie2\")\r\n .attr(\"width\", svgWidth_pie2 + margin_pie2.left + margin_pie2.right)\r\n .attr(\"height\", svgHeight_pie2 + margin_pie2.top + margin_pie2.bottom)\r\n .append(\"g\")\r\n .attr(\"id\", \"svg_pie2_g_id\")\r\n .attr(\"transform\", \"translate(\" + margin_pie2.left + \",\" + margin_pie2.top + \")\"); \r\n generateDataPie();\r\n createPieChart();\r\n generateDataPie2();\r\n createPie2Chart();\r\n \r\n } );\r\n\t\t\t }", "title": "" }, { "docid": "511ef3ecb8cda5a151ee9f7a5233d70f", "score": "0.5933746", "text": "function setup(map){\n\t//$(\".feature-btn\").tooltip({ placement: 'right', title: 'Charts'});\t\n\t//map.addControl(new ChartControl());\n\trefresh();\n\tvar layers = JSON.parse(localStorage.getItem('sk-load-charts'));\n\tif(!layers)return;\n\tlayers = jQuery.grep(layers, function(value) {\n\t\taddChartLayer(map, value.key, value.type, value.scale);\n\t\t});\n}", "title": "" }, { "docid": "b752b5811415c51f10857a6439df2d62", "score": "0.59300864", "text": "function drawOrderStatusChart() {\n\n\n \n \n // Create the data table for Sarah's pizza.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n var i;\n for(i = 0; i < count; i++)\n {\n data.addRows([[orderStatus[i], orderOrders[i]]]);\n }\n // data.addRows([\n // ['Mushrooms', 1],\n // ['Onions', 1],\n // ['Olives', 2],\n // ['Zucchini', 2],\n // ['Pepperoni', 1]\n // ]);\n\n // Set options for Sarah's pie chart.\n var options = {title:'Order Status Information',\n width:300,\n height:200};\n\n // Instantiate and draw the chart for Sarah's pizza.\n var chart = new google.visualization.PieChart(document.getElementById('OrderStatus_chart_div'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "c34bc9810309f67990d974ad803316f5", "score": "0.5927843", "text": "function drawChart() {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn(\"string\", \"Topping\");\n data.addColumn(\"number\", \"Slices\");\n data.addRows([\n [\"Mushrooms\", 3],\n [\"Onions\", 1],\n [\"Olives\", 1],\n [\"Zucchini\", 1],\n [\"Pepperoni\", 2]\n ]);\n\n // Set chart options\n var options = {\n title: \"How Much Pizza I Ate Last Night\",\n width: 400,\n height: 300\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(\n document.getElementById(\"chart_div\")\n );\n chart.draw(data, options);\n }", "title": "" }, { "docid": "60d2d8e9c6914efed608ef1574c7e5cd", "score": "0.59225357", "text": "function drawChart() {\n let chart_data = new google.visualization.DataTable();\n chart_data.addColumn('string', 'Έτος');\n chart_data.addColumn('number', '#Εγγραφών');\n chart_data.addRows([\n ['2015', year_data['2015']],\n ['2016', year_data['2016']],\n ['2017', year_data['2017']],\n ['2018', year_data['2018']],\n ['2019', year_data['2019']],\n ['2020', year_data['2020']]\n ]);\n\n // Optional; add a title and set the width and height of the chart\n var options = { 'width': '100%', 'height': '100%', 'pieHole': 0.4, 'sliceVisibilityThreshold': 0 };\n\n // Display the chart inside the <div> element\n var chart = new google.visualization.PieChart(document.getElementById('year-chart'));\n chart.draw(chart_data, options);\n }", "title": "" }, { "docid": "f5cb68adf9589d7656e4e8f4464fc733", "score": "0.592226", "text": "function plotData(map, originalData) {\n\n // mapping functions\n let xMap = map.x;\n let yMap = map.y;\n\n // make tooltip\n let div = d3.select(\"body\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n\n\n\n // append data to SVG and plot as points\n svgContainer.selectAll('.dot')\n .data(data)\n .enter()\n .append('circle')\n .attr('cx', xMap)\n .attr('cy', yMap)\n .attr('r', 4)\n .attr('fill', \"#4286f4\")\n .attr('class', 'dot')\n // add tooltip functionality to points\n .on(\"mouseover\", (d) => {\n div.transition()\n .duration(200)\n .style(\"opacity\", .9);\n div.html(\"\" + \"<br/>\")\n .style(\"left\", (d3.event.pageX) + \"px\")\t\t\n .style(\"top\", (d3.event.pageY - 140) + \"px\")\n // add SVG to tooltip\n let tipSVG = d3.select(\".tooltip\")\n .append(\"svg\")\n .attr(\"width\", 300)\n .attr(\"height\", 300)\n\n let current = d.accommodates;\n\n makePie(tipSVG, originalData, current);\n })\n .on(\"mouseout\", (d) => {\n div.transition()\n .duration(500)\n .style(\"opacity\", 0);\n }); \n\n }", "title": "" }, { "docid": "6baad1fe1256bc715aa6cc9978f611ef", "score": "0.59205085", "text": "function drawGraphsAndMap(sid) {\n $('#introp').slideUp();\n\n // we need alldata_loaded (for graphs) and station_aggregate_loaded (for map)\n if(alldata_loaded && station_aggregate_loaded) {\n drawGraph(graph1, sid);\n $('#timeline').removeClass('hidden');\n $('#allday').removeClass('hidden');\n $('.outgoingsubtitle').removeClass('hidden');\n $('.explain').fadeOut(250, function() {\n $(this).remove();\n });\n $('#info').removeClass('hidden');\n // info ??? tooltip\n $('#info').hover(function(){\n // Hover over code\n var title = $(this).attr('title');\n $(this).data('tipText', title).removeAttr('title');\n $('<p class=\"tooltip\"></p>')\n .text(title)\n .appendTo('body')\n .fadeIn('slow');\n }, function() {\n // Hover out code\n $(this).attr('title', $(this).data('tipText'));\n $('.tooltip').remove();\n }).mousemove(function(e) {\n var mousex = e.pageX + 20; //Get X coordinates\n var mousey = e.pageY + 10; //Get Y coordinates\n $('.tooltip')\n .css({ top: mousey, left: mousex })\n });\n\n drawSingleGraph(graph2, sid);\n limitMap(sid);\n } else {\n // show loading image\n $('#loadingimage').removeClass('hidden');\n clicked_but_not_loaded = 1;\n }\n}", "title": "" }, { "docid": "c3b26b83e2c5c94861b80c77efc04da1", "score": "0.59045094", "text": "function drawCharts() {\n var colors = ['#008000','#4169E1','#708090','#FF8C00','#B22222','#6A5ACD','#00FF7F','#1E90FF'];\n\n /*\n var width = Math.max(document.documentElement[\"clientWidth\"], document.body[\"scrollWidth\"],\n document.documentElement[\"scrollWidth\"], document.body[\"offsetWidth\"],\n document.documentElement[\"offsetWidth\"]);\n */\n\n for (var x in vm.surveyResults()) {\n // it would be better to check the length of surveyResults outside of loop\n // but if the data is empty the length still returns as 1.\n var haveData = false;\n\n // Create our data table.\n chartData = new google.visualization.DataTable();\n chartData.addColumn('string', 'Answer');\n chartData.addColumn('number', 'Count');\n\n for (var a in vm.surveyResults()[x].answers()) {\n haveData = true;\n\n chartData.addRow([vm.surveyResults()[x].answers()[a].answerText(),\n Number(vm.surveyResults()[x].answers()[a].answerCount())]);\n }\n\n // Set chart options\n var options = {\n 'title': vm.surveyResults()[x].questionText(),\n //'width': width,\n //'height': 300,\n is3D: true,\n colors: colors\n };\n\n if (haveData) {\n // Instantiate and draw our chart, passing in some options.\n //chart = new google.visualization.PieChart(document.getElementById('chart75'));\n chart = new google.visualization.PieChart(document.getElementById(vm.surveyResults()[x].chartId()));\n chart.draw(chartData, options);\n }\n }\n}", "title": "" }, { "docid": "a443789f1b07b6611f7a20eb4cd57668", "score": "0.588669", "text": "render() {\n const { classes } = this.props;\n var self = this;\n var i = 0;\n console.log('map', data)\n var clusterdatadict = this.state.data1['clusterdata'];\n var totalclusters = this.state.data1['totalclusters'];\n var activeclusters = this.state.data1['activeclusters'];\n var maintenanceclusters = this.state.data1['maintenanceclusters'];\n var nodedataDict = this.state.data1['nodedata'];\n var totalnodes = this.state.data1['totalnodes'];\n var activenodes = this.state.data1['activenodes'];\n var maintenancenodes = this.state.data1['maintenancenodes'];\n var sensordataDict = this.state.data1['sensordata'];\n var totalsensors = this.state.data1['totalsensors'];\n var activesensors = this.state.data1['activesensors'];\n var maintenancesensors = this.state.data1['maintenancesensors'];\n\n var humiditysensors = this.state.data1['humiditysensors'];\n var pollutionsensors = this.state.data1['pollutionsensors'];\n var lightsensors = this.state.data1['lightsensors'];\n var temperaturesensors = this.state.data1['temperaturesensors'];\n\n var piechart1 = new Chartist.Pie('.ct-chart1', {labels: [`Inactive=${totalclusters - activeclusters - maintenanceclusters}`, `Active = ${activeclusters}`, `Maintenance = ${maintenanceclusters}`],\n series: [totalclusters - activeclusters - maintenanceclusters, activeclusters, maintenanceclusters]\n}, {\n labelOffset: 35,\n labelDirection: 'explode'\n});\n\nvar piechart2 = new Chartist.Pie('.ct-chart2', {labels: [`Temperature = ${temperaturesensors}`, `Humidity = ${humiditysensors}`, `Pollution = ${pollutionsensors}`, `Light = ${lightsensors}`],\n series: [temperaturesensors,humiditysensors, pollutionsensors, lightsensors]\n},{\n labelOffset: 35,\n labelDirection: 'explode'\n});\nvar piechart3 = new Chartist.Pie('.ct-chart3', {labels: [`Inactive = ${totalnodes - activenodes - maintenancenodes}`, `Active = ${activenodes}`, `Maintenance = ${maintenancenodes}`],\n series: [totalnodes - activenodes - maintenancenodes, activenodes, maintenancenodes]\n}, {\n labelOffset: 30,\n labelDirection: 'explode'\n});\n\nvar piechart4 = new Chartist.Pie('.ct-chart4', {labels: [`Inactive=${totalsensors - activesensors - maintenancesensors}`, `Active = ${activesensors}`, `Maintenance = ${maintenancesensors}`],\n series: [totalsensors - activesensors - maintenancesensors, activesensors, maintenancesensors]\n}, {\n labelOffset: 20,\n labelDirection: 'explode'\n});\n\n console.log('- Cluster data:', clusterdatadict)\n console.log('node data:', nodedataDict)\n console.log(typeof nodedataDict)\n console.log('Total clusters:', totalclusters)\n console.log('Total nodes:', totalnodes)\n console.log('Active clusters:', activeclusters)\n console.log('Active nodes:', activenodes)\n console.log(typeof totalclusters,typeof totalnodes,typeof activeclusters,typeof activenodes)\n\n// SENSOR DATA only\nconst sensorData = data.map((function(item){\n return(\n <tr key={item.id_sensor_master_pk} onClick={self.handleClick} className=\"odd ProjectTable-row project-details\">\n {/*changed coloumn names as per mongo db column names*/}\n <td className='ProjectTable-cell '>{item.id_sensor_master_pk}</td>\n <td className=' '>{item.sensor_model}</td>\n <td>{(new Date(item.sensor_add_date)).toLocaleDateString()}</td>\n <td className='ProjectTable-cell'>{item.sensor_location}</td>\n <td className='ProjectTable-cell'>{item.status}</td>\n </tr>\n )\n}))\n//SENSOR DATA fetched\n return (\n <div>\n <GridContainer>\n <GridItem xs={12} sm={6} md={3}>\n <Card>\n <CardHeader color=\"warning\" stats icon>\n <CardIcon color=\"warning\">\n <Icon>wb_cloudy</Icon>\n </CardIcon>\n <p className={classes.cardCategory}><b>Clusters</b><br/> My Smart City</p>\n <h3 className={classes.cardTitle}>\n Total: {totalclusters}</h3>\n <h3 className={classes.cardTitle}>\n Active: {activeclusters}</h3>\n <h3 className={classes.cardCategory}>California, USA</h3>\n </CardHeader>\n </Card>\n </GridItem>\n <GridItem xs={12} sm={6} md={3}>\n <Card chart>\n <CardHeader color=\"warning\">\n <ChartistGraph\n className=\"ct-chart4\"\n data={emailsSubscriptionChart.data}\n type=\"Bar\"\n options={emailsSubscriptionChart.options}\n responsiveOptions={emailsSubscriptionChart.responsiveOptions}\n listener={emailsSubscriptionChart.animation}\n />\n </CardHeader>\n <CardBody>\n <h4 className={classes.cardTitle}>All Available Sensors</h4>\n \n </CardBody>\n <CardFooter chart>\n <div className={classes.stats}>\n <AccessTime /> Just updated\n </div>\n </CardFooter>\n </Card>\n </GridItem>\n\n <GridItem xs={12} sm={6} md={3}>\n <Card>\n <CardHeader color=\"info\" stats icon>\n <CardIcon color=\"info\">\n <Icon>wb_incandescent</Icon>\n </CardIcon>\n <p className={classes.cardTitle}>Sensors</p>\n <h3 className={classes.cardCategory}>Total : {totalsensors}</h3>\n <h3 className={classes.cardCategory}>Active : {activesensors}</h3>\n <h3 className={classes.cardCategory}>Pollution : {pollutionsensors}</h3>\n <h3 className={classes.cardCategory}>Temperature : {temperaturesensors}</h3>\n <h3 className={classes.cardCategory}>Humidity : {humiditysensors}</h3>\n <h3 className={classes.cardCategory}>Luminosity : {lightsensors}</h3>\n </CardHeader>\n <CardFooter stats>\n <div className={classes.stats}>\n <LocalOffer />\n Tracked from AWS IoT\n </div>\n </CardFooter>\n </Card>\n </GridItem> \n\n <GridItem xs={12} sm={6} md={3}>\n <Card>\n <CardHeader color=\"primary\" stats icon>\n <CardIcon color=\"primary\">\n <Accessibility />\n </CardIcon>\n <p className={classes.cardCategory}><b>Nodes</b><br/> My Smart City</p>\n <h3 className={classes.cardTitle}>Total: {totalnodes}</h3>\n <h3 className={classes.cardTitle}>Active: {activenodes}</h3>\n <h3 className={classes.cardCategory}>California, USA</h3>\n </CardHeader>\n <CardFooter stats>\n <div className={classes.stats}>\n <Update />\n Just Updated\n </div>\n </CardFooter>\n </Card>\n </GridItem>\n </GridContainer>\n \n <GridContainer>\n <GridItem xs={12} sm={12} md={4}>\n <Card chart>\n <CardHeader color=\"success\">\n <ChartistGraph style={{}}\n className=\"ct-chart1\"\n data={dailySalesChart.data}\n type=\"Line\"\n options={dailySalesChart.options}\n listener={dailySalesChart.animation}\n /> \n {/*} {piechart}*/}\n </CardHeader> \n <CardBody>\n <h4 className={classes.cardTitle}>Cluster Status</h4>\n </CardBody> \n <CardFooter stats>\n <div className={classes.stats}>\n <Update />\n Just Updated\n </div>\n </CardFooter>\n </Card> \n </GridItem>\n \n <GridItem xs={12} sm={12} md={4}>\n <Card chart>\n <CardHeader color=\"success\">\n <ChartistGraph\n className=\"ct-chart2\"\n data={emailsSubscriptionChart.data}\n type=\"Bar\"\n options={emailsSubscriptionChart.options}\n responsiveOptions={emailsSubscriptionChart.responsiveOptions}\n listener={emailsSubscriptionChart.animation}\n />\n </CardHeader>\n <CardBody>\n <h4 className={classes.cardTitle}>All Available Sensors</h4>\n \n </CardBody>\n <CardFooter chart>\n <div className={classes.stats}>\n <AccessTime /> Just updated\n </div>\n </CardFooter>\n </Card>\n </GridItem>\n\n <GridItem xs={12} sm={12} md={4}>\n <Card chart>\n <CardHeader color=\"success\">\n <ChartistGraph\n className=\"ct-chart3\"\n data={completedTasksChart.data}\n type=\"Line\"\n options={completedTasksChart.options}\n listener={completedTasksChart.animation}\n />\n </CardHeader>\n <CardBody>\n <h4 className={classes.cardTitle}>Node Status</h4>\n <p className={classes.cardCategory}>\n Just updated\n </p>\n </CardBody>\n <CardFooter chart>\n <div className={classes.stats}>\n <AccessTime/> updated every 30 minutes\n </div>\n </CardFooter>\n </Card>\n </GridItem>\n </GridContainer>\n {\n //This is where the new sensor/node/cluster tables/feed comes in\n }\n\n <GridContainer>\n <GridItem xs={12} sm={12} md={12}>\n <Card>\n <CardHeader color=\"primary\">\n <h4 className={classes.cardTitleWhite}>Sensor Statistics</h4>\n <p className={classes.cardCategoryWhite}>\n Below are the live sensor statistics from cloud database\n </p>\n </CardHeader>\n <table className='ProjectTable' tableHeaderColor=\"primary\">\n <thead className='ProjectTable-head'>\n <tr>\n <th className='ProjectTable-header'>Sensor ID</th>\n <th className='ProjectTable-header'>Sensor Type</th>\n <th className='ProjectTable-header'>Active Since</th>\n <th className='ProjectTable-header'>Location</th>\n <th className='ProjectTable-header'>Status</th>\n </tr>\n </thead>\n <tbody>\n {/*{nameslist} */}\n {sensorData} \n </tbody>\n </table> \n </Card>\n </GridItem>\n </GridContainer>\n \n </div>\n );\n }", "title": "" }, { "docid": "e6b8db817037d48a7b9e2f1e80d2cf6d", "score": "0.5883566", "text": "function loadedNews(data) {\n\t// TODO: automatically set center of the map and zoom according to the clusters\t\n\t// initialize Google maps\n\tvar latlng = new google.maps.LatLng(45.0, 13);\n\tvar myOptions = {\n\t\tzoom: 4,\n\t\tcenter: latlng,\n\t\tmapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, position: google.maps.ControlPosition.RIGHT_BOTTOM},\n\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t};\t\n\tmap = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions); \n\t \t\n\tconsole.log(data);\n\tnodes = JSON.parse(data);\n\tfor (i = 0; i < nodes.length; i++) {\n\t\tconsole.log(nodes[i].Name);\n\t\tconsole.log(nodes[i].Position[0]);\n\t\t// create marker\t\n\t\tvar markerLatLng = new google.maps.LatLng(nodes[i].Position[0], nodes[i].Position[1]);\t\n\t\tvar the_marker = new google.maps.Marker({\n\t\t\tposition: markerLatLng,\n\t\t\ttitle: nodes[i].Name,\n\t\t\tmap: map,\n\t\t\tclickable: true\n\t\t}); \n\t\tthe_marker.setMap(map);\n\t}\t\n}", "title": "" }, { "docid": "e22ed2658d9ae37e491b1d0adcb6e65d", "score": "0.58824015", "text": "function drawPieChart(div_id, datas)\n{\n\t$('#'+div_id).highcharts({\n\t\tchart: {\n\t\t\tbackgroundColor: 'rgba(255, 255, 255, 0.01)',\n\t\t\tplotShadow: false,\n\t\t\trenderto: 'container',\n\t\t\tmargin: '40'\n\t\t},\n\t\texporting: {\n\t\t\tenabled: false\n\t\t},\n\t\tcredits: {\n\t\t\tenabled: false\n\t\t},\n\t\ttitle: {\n\t\t\ttext: null\n\t\t},\n\t\ttooltip: {\n\t\t\tpointFormat: '{series.name} : <b>{point.percentage:.1f}%</b>'\n\t\t},\n\t\tplotOptions: {\n\t\t\tpie: {\n\t\t\t\tdataLabels: {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tformat: '<b>{point.name}</b> : {point.y:.0f}',\n\t\t\t\t\tstyle: {\n\t\t\t\t\t\tcolor: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tconnectorColor: 'silver'\n\t\t},\n\t\tseries: [{\n\t\t\ttype: 'pie',\n\t\t\tname: 'Value',\n\t\t\tdata: [\n\t\t\t\t{\n\t\t\t\t\tname: 'WARNING',\n\t\t\t\t\ty: datas.warning,\n\t\t\t\t\tcolor: {\n\t\t\t\t\t\tradialGradient: { cx: 0.5, cy: 0.5, r: 0.8 },\n\t\t\t\t\t\tstops: [\n\t\t\t\t\t\t\t[0, graph_color.warning],\n\t\t\t\t\t\t\t[1, Highcharts.Color(graph_color.warning).brighten(-0.3).get('rgb')] // darken\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\tname: 'CRITICAL',\n\t\t\t\t\ty: datas.critical,\n\t\t\t\t\tcolor: {\n\t\t\t\t\t\tradialGradient: { cx: 0.5, cy: 0.5, r: 0.8 },\n\t\t\t\t\t\tstops: [\n\t\t\t\t\t\t\t[0, graph_color.critical],\n\t\t\t\t\t\t\t[1, Highcharts.Color(graph_color.critical).brighten(-0.3).get('rgb')] // darken\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\tname: 'UNKNOWN',\n\t\t\t\t\ty: datas.unknown,\n\t\t\t\t\tcolor: {\n\t\t\t\t\t\tradialGradient: { cx: 0.5, cy: 0.5, r: 0.8 },\n\t\t\t\t\t\tstops: [\n\t\t\t\t\t\t\t[0, graph_color.unknown],\n\t\t\t\t\t\t\t[1, Highcharts.Color(graph_color.unknown).brighten(-0.3).get('rgb')] // darken\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}", "title": "" }, { "docid": "31c3c9e486b9581100af0b620f7c3534", "score": "0.58797926", "text": "function plotData(map) {\n let xMap = map.x;\n let yMap = map.y;\n\n let div = d3.select(\"body\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n // append data to SVG and plot as points\n svgContainer.selectAll('.dot')\n .data(data)\n .enter()\n .append('rect')\n .attr('x', datapoint => xMap(datapoint) - 3)\n .attr('y', yMap)\n .attr('width', 10)\n .attr('height', (datapoint) => 700 - yMap(datapoint))\n .attr('fill', \"#ddb1b1\")\n .attr('stroke', 'black')\n .on(\"mouseover\", (d) => {\n div.transition()\n .duration(200)\n .style(\"opacity\", .9);\n div.html(d.location + \"<br/>\" + numberWithCommas(d[\"pop_mlns\"] * 1000000))\n .style(\"left\", (d3.event.pageX) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n })\n .on(\"mouseout\", (d) => {\n div.transition()\n .duration(500)\n .style(\"opacity\", 0);\n });;\n }", "title": "" }, { "docid": "56fd59c3b2b6e03e14c46b3aa36b5e70", "score": "0.5879674", "text": "function drawMapPoints() {\n sortedNarrativeIds.forEach(function(narrativeId, idx) {\n drawNarrativePoints(narrativeId.toString(), idx);\n })\n }", "title": "" }, { "docid": "bb651fac73e53e44dc533421f08b8ce3", "score": "0.5878831", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Passed');\n data.addColumn('number', 'Failed');\n data.addRows([\n ['Passed', passed],\n ['Failed', failed],\n ]);\n\n // Set chart options\n var options = {'title':'Test Report',\n 'width':400,\n 'height':300};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "2183a6012a2f97327552a7f605295250", "score": "0.58732027", "text": "function ready(allData) {\n var us = allData[0];\n var spending = allData[1];\n var statesWithId = allData[2];\n // if (error) alert('there was an error');\n window.loaded = {\n us, spending, statesWithId\n };\n drawHeatMap(us, spending, statesWithId);\n drawBarChart();\n}", "title": "" }, { "docid": "9f85d01b439a06650163edd6a218146d", "score": "0.585995", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Money', 'Quantity'],\n ['Income', incomes],\n ['Expense', expenses]\n ]);\n\n // Optional; add a title and set the width and height of the chart\n var options = {\n 'backgroundColor': 'transparent',\n 'title': 'Status',\n 'width': 550,\n 'height': 400,\n 'is3D': true\n };\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n chart.draw(data, options);\n}", "title": "" }, { "docid": "aed0738f12999f7af1066a667803251b", "score": "0.5845595", "text": "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Task', 'Hours per Day'],\n ['Delivered', 676],\n ['Pending', 200],\n ['Failed', 876],\n]);\n \n var data1 = google.visualization.arrayToDataTable([\n\t ['Task', 'transport'],\n\t ['Delivered', 676],\n\t ['Pending', 400],\n\t ['Failed', 576],\n\t]);\n\n // Optional; add a title and set the width and height of the chart\n //var options = {'title':'Chart 2', 'width':550, 'height':400};\n \n var options = {\n title: 'My Daily Activities','width':400, 'height':300,\n slices: {0: {color: '#A9A9A9'}, 1:{color: '#00FF08'}, 2:{color: '#1D7A46'}}\n };\n \n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n chart.draw(data, options);\n var chart1 = new google.visualization.PieChart(document.getElementById('piechart1'));\n chart1.draw(data1, options);\n var chart2 = new google.visualization.PieChart(document.getElementById('piechart2'));\n chart2.draw(data, options);\n}", "title": "" }, { "docid": "e383da85de1cc2955b83315f9d23c36b", "score": "0.5845228", "text": "function getData(mymap){\r\n //load the data\r\n $.ajax(\"data/map.geojson\", {\r\n dataType: \"json\",\r\n success: function(response){\r\n \r\n //create attributes array\r\n var attributes = processData(response);\r\n \r\n //call functions to create proportional symbols and sequence controls\r\n \r\n //define scaleFactor\r\n var scaleFactor = calcScaleFactor(response);\r\n createPropSymbols(response, mymap, attributes);\r\n createSequenceControls(mymap, attributes);\r\n \r\n //createLegend(mymap, attributes);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "c38dfbf559083f821f031ff625ef5b72", "score": "0.58428353", "text": "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'People who save for a pension');\n data.addColumn('number', 'Age Range');\n data.addRows([\n ['20–29', 1],\n ['30–39', 2],\n ['40–49', 3],\n ['50–59', 5],\n ]);\n\n // Set chart options\n var options = {'title':'Pension Savers Grouped By Age',\n 'width':400,\n 'height':300,\n 'animation':{\n duration: 1000,\n easing: 'out',\n startup: 'true'\n }\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "title": "" }, { "docid": "ba92780ada259afb5d4a90a37d2b3128", "score": "0.58415234", "text": "function loadMap() {\n\tremoveMarkers();\n\tremoveCircles();\n removeGrids();\n\taccidents.max_pt_value = 0;\n\td3.csv(data_path+accDataFile(accidents.curr_mapname, accidents.curr_elevation), \n\t function(err, data) { \n var i;\n if (err) { \n console.log('*** Error: '+err+'; while loading masters'); \n } else {\n captureAccidentData(data);\n addGrid();\n addMarkers();\n sliderLoad();\n reset_display();\n }});\n} // loadAccidentData", "title": "" }, { "docid": "3bc58b23bb3d3c5d1e9dc48e82dda1ff", "score": "0.5836007", "text": "function drawChart() {\n\n\t// Create the data table.\n\tvar data = new google.visualization.DataTable();\n\tdata.addColumn('string', 'Topping');\n\tdata.addColumn('number', 'Slices');\n\tdata.addRows([\n\t\t['Mushrooms', 3],\n\t\t['Onions', 1],\n\t\t['Olives', 1],\n\t\t['Zucchini', 1],\n\t\t['Pepperoni', 2]\n\t\t]);\n\n\t// Set chart options\n\tvar options = {'title':'How Much Pizza I Ate Last Night',\n\t'width':550,\n\t'height':450};\n\n\t// Instantiate and draw our chart, passing in some options.\n\tvar chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n\tchart.draw(data, options);\n}", "title": "" }, { "docid": "64a55340f810fd2e5ac6d6a2e91f5318", "score": "0.5835825", "text": "function drawChart() {\n\tchart.draw(\n\t\tgoogle.visualization.arrayToDataTable(data),\n\t\toptions\n\t);\n}", "title": "" }, { "docid": "dadb914dbe9a658b51764418c866327a", "score": "0.5833658", "text": "function drawMarkersMap() {\n // define the data\n var data = new google.visualization.DataTable();\n // add the columns to the data (what we want to appear on hover)\n data.addColumn('number', 'LATITUDE');\n data.addColumn('number', 'LONGITUDE');\n data.addColumn('string', 'LANGUAGENAME');\n data.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': true}})\n var dataRows = [];\n // loop through the sheet data object and do this for each language\n sheetData.forEach(function(language, i) {\n // define a data row\n // html row\n var htmlData = '<div><p><b>Language ID: </b>' + language.Language_id + '</p><p><b>Variety: </b>' + language.Variety + '</p><p><b>Subgroup: </b>' + language.Subgroup + '</p><p><b>Family: </b>' + language.Family + '</p></div>';\n var dataRow = [language.Latitude, language.Longitude, language.Language_name, htmlData];\n dataRows.push(dataRow);\n // add the row to the data object\n if (i == sheetData.length - 1)\n populateMap(); // call the function once we've looped through the whole thing\n })\n // abstract this to a seperate function so we can choose when to call it\n //instead of using Promises and polyfills\n function populateMap() {\n // add the data rows to the data object (now that it's fulled)\n data.addRows(dataRows);\n // define the chart options (UI)\n var options = {\n region: 'AU',\n displayMode: 'markers',\n enableRegionInteractivity: 'false',\n resolution: 'provinces',\n colorAxis: {colors: ['red']},\n sizeAxis : {\n minSize: 1,\n maxSize: 1\n },\n tooltip: { isHtml: true },\n keepAspectRatio: true\n };\n // define the chart from the JS lib\n var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));\n // draw the data onto the chart\n setTimeout(function() {\n chart.draw(data, options);\n }, 1200)\n }\n }", "title": "" }, { "docid": "75f5c8767ef47831215b1c90c5db65d8", "score": "0.5832612", "text": "function MapChartFactory() {}", "title": "" } ]
e0eaca2d6e99fe9dbcac2f0ac2dd54f5
endregion region rubric min/max scores
[ { "docid": "b5746c7b8027fce873c7b436a05a9eb3", "score": "0.70566034", "text": "function setRubricMinScoreAgainstMax(max) {\r\n var min = viewModel.assessment.rubricMinScore;\r\n if (min > max) {\r\n viewModel.set('assessment.rubricMinScore', max);\r\n }\r\n }", "title": "" } ]
[ { "docid": "86689e8598ec718bdac077b059fcd3a3", "score": "0.6797977", "text": "function iScore (min, max, value) {\n value = Math.min(max, value);\n value = Math.max(min, value);\n return round(1 + 9 * (max - value) / (max - min));\n}", "title": "" }, { "docid": "28087f3ae9fd4e18a5202589567b834c", "score": "0.65059173", "text": "getAggregateScore(scores) {\n // this adds a weighted score to each score object\n var scoresMultiplied = scores.map((item) => {\n item.weightedScore = item.score * item.weight\n return item\n })\n\n // get the sum of all weighted scores\n var sumOfWeightedScores = 0\n scores.map((item) => {\n sumOfWeightedScores = sumOfWeightedScores + item.weightedScore\n })\n\n // get the sum of all weights\n var sumOfWeights = 0\n scores.map((item) => {\n sumOfWeights = sumOfWeights + item.weight\n })\n\n // just return 50 if all the sliders are switched off\n if (sumOfWeights === 0) return 50\n else return Math.round(sumOfWeightedScores/sumOfWeights)\n }", "title": "" }, { "docid": "2ff4fc2c4e5c0ae8edc229dd3d3dcaae", "score": "0.64123166", "text": "function calculate_minmax(data) {\n\n bound = [];\n bound.max = Math.max.apply(Math, data);\n bound.min = Math.min.apply(Math, data);\n return bound;\n\n}", "title": "" }, { "docid": "e680fb3dc5d09a19a17b26c2c047a093", "score": "0.6362395", "text": "limits() {\n var keys = Object.keys(this.data);\n var min = parseInt(this.data[keys[0]]); // ignoring case of empty list for conciseness\n var max = parseInt(this.data[keys[0]]);\n var i;\n for (i = 1; i < keys.length; i++) {\n var value = parseInt(this.data[keys[i]]);\n if (value < min) min = value;\n if (value > max) max = value;\n }\n this.yMin =min - Math.round(min/4);\n if(this.yMin <= 0)\n this.yMin=0;\n this.yMax = max + Math.round(max/4);\n\n }", "title": "" }, { "docid": "3a16f89a3a206b8fbbaab878c1a0a53d", "score": "0.6350452", "text": "function _calcMaxMin() {\n\t var i,j,k;\n\t\t\n\t\t_vMaxValuesAttr = d3.range (_vIndexMapAttr.length);\n\t\t_vMinValuesAttr = d3.range (_vIndexMapAttr.length);\n\t\t\n\t\tfor (i=0; i< _vMaxValuesAttr.length; i++) {\n\t\t\t_vMaxValuesAttr[i] = Number.MIN_VALUE;\n\t\t\t_vMinValuesAttr[i] = Number.MAX_VALUE;\n\t\t}\n\n\t\tfor (i=0; i< _data.matrix.length; i++)\t\n\t\t\tfor ( j=0; j< _data.matrix[i].length; j++)\n\t\t\t\tif (_data.matrix[i][j].exist) {\n\t\t\t\t\tfor (k=0; k< _vIndexMapAttr.length; k++) {\n\t\t\t\t\t\tif (_data.matrix[i][j].values[_vIndexMapAttr[k]] > _vMaxValuesAttr[k])\n\t\t\t\t\t\t\t_vMaxValuesAttr[k] = _data.matrix[i][j].values[_vIndexMapAttr[k]];\n\t\t\t\t\t\tif (_data.matrix[i][j].values[_vIndexMapAttr[k]] < _vMinValuesAttr[k])\n\t\t\t\t\t\t\t_vMinValuesAttr[k] = _data.matrix[i][j].values[_vIndexMapAttr[k]];\t\t\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t_maxValueAttr = d3.max(_vMaxValuesAttr);\n\t\t_minValueAttr = d3.min(_vMinValuesAttr);\n\t}", "title": "" }, { "docid": "639e62351fabd00e7a5f4d9c78756e0f", "score": "0.62516904", "text": "function getFinalScore() {\n var sum = 0;\n var allRanges = $('.range');\n \n for (var i = 0; i < allRanges.length; i++) { \n sum = parseInt(sum) + parseInt($(allRanges[i]).val());\n\n $(allRanges[i]).siblings('.side-score').html($(allRanges[i]).val());\n\n\n }\n\n sum = sum / allRanges.length;\n sum = Math.round(sum * 100) / 100;\n sum = sum.toString() + \" / 7\";\n $(\".yourScore\").html(sum);\n }", "title": "" }, { "docid": "7dfdd7a0381d77163054e73adbc26aff", "score": "0.62438357", "text": "function getScore() { // Calculating rounded scores based off of dimension\n if (size < 50) { // Checking less than 50\n var lessThan = Math.round(10 - 0.1 * size);\n score = score + lessThan; // Updating score\n } else { // Checking more than 50\n var moreThan = Math.round(10 - 0.09 * size);\n score = score + moreThan; // Updating score\n }\n }", "title": "" }, { "docid": "bd359caf9ed4ab77bf7c25e04111d57d", "score": "0.62211907", "text": "function updateMinMax() {\n min = parseInt(minValueField.value);\n max = parseInt(maxValueField.value);\n}", "title": "" }, { "docid": "494fb14596144abd7544705e463d043d", "score": "0.61751175", "text": "function maxOrMin (dataArray) {\n var maxX = dataArray[0].x; \n var minX = dataArray[0].x;\n\n for (var i = 0; i < dataArray.length ; i++) {\n if (dataArray[i].x >= maxX) {\n maxX = Math.round(dataArray[i].x);\n }\n if (dataArray[i].x <= minX) {\n minX = Math.round(dataArray[i].x);\n }\n }\n var maxAndMin = {\"max\": maxX, \"min\": minX};\n return maxAndMin; \n }", "title": "" }, { "docid": "4e694030d7a00c4dc44cc2d38291638b", "score": "0.6169783", "text": "function izScore (max, value) {\n return iScore(0, max, value);\n}", "title": "" }, { "docid": "a5dfaf6f496b7f3e3a0bad5142a74df8", "score": "0.61484265", "text": "function computeScore([low, mid]) {\n console.log(low, mid)\n}", "title": "" }, { "docid": "7d5589cb04d003712f83e48a4d4c1672", "score": "0.6104067", "text": "function maxScore(questions) {\n // map the maxScore of each question and reduce\n return _.reduce(_.map(questions, function(question) { return question.maxPoints;}), function(memo, num) { return memo + num })\n}", "title": "" }, { "docid": "773a30d63fdc5998a82c617e3d2601b4", "score": "0.6097295", "text": "function PrintMaxMinAverageArrayVals(arr){\n}", "title": "" }, { "docid": "7115faa62c2032d92d622c9e173bd5c9", "score": "0.60918415", "text": "function minGrade () {\n\tfor (var i = 0;i<scores.length; i++) {\n\n\t\tif(minNum < scores[i]) {\n\t\t\tminNum;\n\t\t} else {\n\t\t\tminNum = scores[i];\n\t\t}\n\t}\n\treturn minNum;\n}", "title": "" }, { "docid": "f213ad0d1638de5ed117e22e6ea85804", "score": "0.6025391", "text": "setGlobalMinMax(min, max) {\n\n API.LMSSetValue(\"cmi.core.score.min\", String(min));\n API.LMSSetValue(\"cmi.core.score.max\", String(max));\n }", "title": "" }, { "docid": "2f093cc4894d2d38cbb6a1d3392744bb", "score": "0.600282", "text": "function maxGrade () {\n\n\tfor (var i = 0; i <scores.length; i++) \n\t{\n\n\t\tif (maxNum < scores[i]) {\n\t\t\tmaxNum = scores[i];\n\t\t} else {\n\t\t\tmaxNum ;\n\t\t}\n }\n return maxNum;\n }", "title": "" }, { "docid": "1c9bdbc6ec2972b72837c1b5e4c0102c", "score": "0.6000899", "text": "function minMaxAvrg(array) {\n let avrgNum = 0;\n let max = array[0];\n let min = array[0];\n for(let i=0;i<array.length;i++) {\n if(array[i] > max) {\n max = array[i]\n } else if(array[i] < min) {\n min = array[i]\n }\n avrgNum += array[i] / array.length;\n }\n return `Minimum number is ${min}, Maximum number is ${max} and average number is ${avrgNum}`\n}", "title": "" }, { "docid": "388866f1e178af8b304022aabaaf3c2e", "score": "0.59829915", "text": "function breakingRecords(scores) {\n let arr = scores\n let highest = scores[0];\n let lowest = scores[0]\n let high = 0, low = 0;\n arr = [...new Set(arr)];\n\n\n for (let i = 1; i < arr.length; i++){\n if (arr[i] > highest) {\n high++;\n highest = arr[i];\n }\n else if (arr[i] < lowest) {\n low++;\n lowest = arr[i];\n }\n }\n return([high, low]);\n\n\n}", "title": "" }, { "docid": "87052a649e0c3add38fa615c9120c411", "score": "0.5977829", "text": "function printMaxMinAverage(arr) {\n if (arr.length === 0) {\n return;\n }\n var min = arr[0];\n var max = arr[0];\n var sum = 0;\n for (var idx = 0; idx < arr.length; idx++) {\n if (arr[idx] < min) {\n min = arr[idx];\n }\n if (arr[idx] > max) {\n max = arr[idx];\n }\n sum += arr[idx];\n }\n return {\n min,\n max,\n avg: sum / arr.length\n };\n}", "title": "" }, { "docid": "48cc955c065943525f84ab3cc9e8fff1", "score": "0.5970391", "text": "function maximumScore(tileHand) {\n\treturn tileHand.reduce((p,c) => p + c.score, 0);\n}", "title": "" }, { "docid": "866a4cbff6065603c3e816203f03965d", "score": "0.5958905", "text": "function CNCXPagMinMax()\n{\n}", "title": "" }, { "docid": "919f95b497ea2f9761231fc41ddc09a1", "score": "0.59566253", "text": "function bestAverageGrade(scores) {\n\n // TODO: implement this function\n return 0;\n}", "title": "" }, { "docid": "440ab3b93d6f085b5db9c6c25a9bd455", "score": "0.5953144", "text": "get value(){ \r\n return { \r\n min : this._value[ 0 ], \r\n max : this._value[ 1 ]\r\n };\r\n }", "title": "" }, { "docid": "793107b91893ef0fdf76b6ac59ac1944", "score": "0.5951051", "text": "function rcvmax(b, a, bnds, aoi){\n var diff = b.select(bnds).subtract(a.select(bnds));\n var maxab = b.select(bnds).max(a.select(bnds)).pow(2);\n var stat = diff.divide(maxab);\n var diff_sd = diff.reduceRegion({\n reducer: ee.Reducer.stdDev(),\n geometry: aoi,\n scale: 30,\n maxPixels: 1e13,\n tileScale: 6\n }).toImage(bnds).divide(maxab);\n var diff_mn = diff.reduceRegion({\n reducer: ee.Reducer.mean(),\n geometry: aoi,\n scale: 30,\n maxPixels: 1e13,\n tileScale: 6\n }).toImage(bnds).divide(maxab);\n\n return(\n //stat.reduce(ee.Reducer.sum()).rename(['rcvmax'])\n stat.subtract(diff_mn).divide(diff_sd).reduce(ee.Reducer.sum()).rename(['rcvmax'])\n );\n}", "title": "" }, { "docid": "5dc07342e7288304ae2eb9da8ea77aec", "score": "0.59469587", "text": "function calcScores() {\n\t// Use a negative value for first score for safety's sake\n\tvar lowscore = -1;\n\tvar lowid = '';\n\tvar scores, sumscore;\n\tfor (var i = 0; i < boardsize; ++i) {\n\t\t// Observe the cards in the rows\n\t\tscores = getScoringArray();\n\t\t$('li.square[id^=square_'+i+']').each(function(){\n\t\t\tif (this.innerHTML != '') {\n\t\t\t\tscores[parseInt(this.innerHTML)]++;\n\t\t\t}\n\t\t});\n\t\t// Calculate the score\n\t\tsumscore = calcScore(scores);\n\t\t$('li#score_row_'+i).text(sumscore);\n\t\t// Check it for lowest value\n\t\tif (sumscore < lowscore || lowscore < 0) {\n\t\t\t// Store the score\n\t\t\tlowscore = sumscore;\n\t\t\t// Remember where we are\n\t\t\tlowid = 'row_'+i;\n\t\t} // if (sumscore < lowscore || lowscore < 0)\n\n\t\t// Observe the cards in the columns\n\t\tscores = getScoringArray();\n\t\t$('li.square[id$=_'+i+']').each(function(){\n\t\t\tif (this.innerHTML != '') {\n\t\t\t\tscores[parseInt(this.innerHTML)]++;\n\t\t\t}\n\t\t});\n\t\t// Calculate the score\n\t\tsumscore = calcScore(scores);\n\t\t$('li#score_col_'+i).text(sumscore);\n\t\t// Check it for lowest value\n\t\tif (sumscore < lowscore || lowscore < 0) {\n\t\t\t// Store the score\n\t\t\tlowscore = sumscore;\n\t\t\t// Remember where we are\n\t\t\tlowid = 'col_'+i;\n\t\t} // if (sumscore < lowscore || lowscore < 0)\n\n\t\t// Set the score, identify the low notch\n\t\t$('li#score_current').text(lowscore);\n\t\t$('li.score').removeClass('lowest');\n\t\t$('li#score_'+lowid).addClass('lowest');\n\t} // for (var i = 0; i < boardsize; ++i)\n} // function calcScores()", "title": "" }, { "docid": "8b946fb20f3d41096e48ec0e4ab7dd2b", "score": "0.5944185", "text": "function getScore() {\n\treturn parseFloat((Math.abs(error) / ramp * 100).toPrecision(4));\n}", "title": "" }, { "docid": "24e6c68f5c04fcdbf3e1278831315320", "score": "0.5911941", "text": "function min_max_bigtraders() {\n min = Number.MAX_SAFE_INTEGER;\n max = 0;\n\n big_traders.forEach(function(ISO) {\n stories_data[current_story]\n .filter(x => x.PartnerISO == ISO)\n .map(x => parseInt(x.Value))\n .forEach(function(value) {\n if (value > max) {\n max = value;\n }\n if (value < min) {\n min = value;\n }\n })\n })\n return [min, max];\n}", "title": "" }, { "docid": "21b3d0cc6b3d5036fc67fe7b0c27196d", "score": "0.58916265", "text": "function PrintMaxMinAvg(myArr) {\n var max = min = sum = myArr[0];\n var avg;\n for (var i = 1; i < myArr.length; i++) {\n if (max < myArr[i]) {\n max = myArr[i];\n }\n\n if (min > myArr[i]) {\n min = myArr[i];\n }\n sum += myArr[i];\n avg = sum / myArr.length;\n }\n console.log(\"Max:\", max, \" Min:\", min, \" Average:\", avg);\n}", "title": "" }, { "docid": "288924de4a84ab996bd53d5dee7fb29a", "score": "0.58863", "text": "function getMaximumScore(tiles) {\n return tiles.reduce((score, tile) => score += tile.score, 0);\n}", "title": "" }, { "docid": "8ee1d110f625c3113e7e405b644f34f2", "score": "0.58723897", "text": "function calculate_range_score(score, benchmark_type){\n var return_val;\n\n // check `sq1` and `wva1` types\n if(benchmark_type == 'sq1'){\n if(score <= 25){\n return_val = 'Left Side';\n }else if(score >= 25 && score <= 75 ){\n return_val = 'Mid Range';\n }else if(score > 75){\n return_val = 'Right Side';\n }else{ // default\n return_val = 'Mid Range';\n }\n }else if(benchmark_type == 'wva1'){\n if(score <= 25){\n return_val = 'Low Range';\n }else if(score >= 25 && score <= 75 ){\n return_val = 'Average Range';\n }else if(score > 75){\n return_val = 'High Range';\n }else{ // default\n return_val = 'High Range';\n }\n }else if(benchmark_type == 'wc1'){ // WPP benchmark type\n switch(true){\n case (score <= 20):\n return_val = 'Left Side';\n break;\n case (score > 20 && score <= 40):\n return_val = 'Mid Left';\n break;\n case (score > 40 && score <= 60):\n return_val = 'Mid Range';\n break;\n case (score > 60 && score <= 80):\n return_val = 'Mid Right';\n break;\n case (score > 80):\n return_val = 'Right Side';\n break;\n default:\n return_val = 'Mid Range';\n break;\n }\n }\n\n return return_val;\n }", "title": "" }, { "docid": "c1ae028769c985e17018877605af1467", "score": "0.58680576", "text": "minmaxWithinIndices(ratings, lo, hi) {\n if (ratings.length < 1) {\n return [];\n }\n\n var minRating = ratings[lo][\"ratings\"];\n var maxRating = ratings[lo][\"ratings\"];\n for (var i = lo + 1; i <= hi; ++i) {\n var cur = ratings[i][\"ratings\"];\n if (cur < minRating) {\n minRating = cur;\n }\n if (cur > maxRating) {\n maxRating = cur;\n }\n }\n return [minRating, maxRating];\n }", "title": "" }, { "docid": "f8853f2ce0ecba33ab134e962218a0d0", "score": "0.58672947", "text": "calculateRange() {\n if (!this.grid || !this.grid[0]) {\n return\n }\n let rows = this.grid.length\n let cols = this.grid[0].length\n // const vectors = [];\n let min\n let max\n // @from: https://stackoverflow.com/questions/13544476/how-to-find-max-and-min-in-array-using-minimum-comparisons\n for (let j = 0; j < rows; j++) {\n for (let i = 0; i < cols; i++) {\n let vec = this.grid[j][i]\n if (vec !== null) {\n let val = vec.m || vec.magnitude()\n // vectors.push();\n if (min === undefined) {\n min = val\n } else if (max === undefined) {\n max = val\n // update min max\n // 1. Pick 2 elements(a, b), compare them. (say a > b)\n min = Math.min(min, max)\n max = Math.max(min, max)\n } else {\n // 2. Update min by comparing (min, b)\n // 3. Update max by comparing (max, a)\n min = Math.min(val, min)\n max = Math.max(val, max)\n }\n }\n }\n }\n return [min, max]\n }", "title": "" }, { "docid": "116c76eb27a2783326458ad740cb528a", "score": "0.5840432", "text": "function getMinMax() {\n var minPt = pts[0];\n var maxPt = pts[0];\n for (var i=1; i<pts.length; i++) {\n minPt = minPt.$min( pts[i] );\n }\n for (i=1; i<pts.length; i++) {\n maxPt = maxPt.$max( pts[i] );\n }\n nextRect.set( minPt).to( maxPt );\n}", "title": "" }, { "docid": "a69cfa29f2277bf04c76e08dc396dee7", "score": "0.5840039", "text": "function compScore([low,mid]) {\n console.log(low,mid);\n}", "title": "" }, { "docid": "4f67d5f9a020bd4453c0410b0ed52f17", "score": "0.5815691", "text": "static getMinMax(boundary, norm) {\n let probeA = boundary.topRight.dot(norm);\n let probeB = boundary.bottomRight.dot(norm);\n let probeC = boundary.bottomLeft.dot(norm);\n let probeD = boundary.topLeft.dot(norm);\n\n return {\n max: Math.max(probeA, probeB, probeC, probeD),\n min: Math.min(probeA, probeB, probeC, probeD)\n }\n }", "title": "" }, { "docid": "86a217d7e18972079210c1ab36d13241", "score": "0.5814824", "text": "function adjustMines() {\n maxMines = (lines*collumns) - 1;\n \n document.getElementById(\"mineSlider\").setAttribute(\"max\", maxMines);\n document.getElementById(\"valueMax\").innerHTML = maxMines;\n \n if (mines > maxMines) {\n document.getElementById(\"valueM\").innerHTML = maxMines;\n mines = parseInt(maxMines);\n }\n}", "title": "" }, { "docid": "370789493cee7b908a3c037cc5a00d5b", "score": "0.58115643", "text": "function maxMinAvg(arr) {\n var max = arr[0];\n var min = arr[0];\n var sum = arr[0];\n var result = [];\n for (var i=1; i < arr.length; i++) {\n sum += arr[i];\n if (arr[i] > max) {\n max = arr[i];\n } else if (arr[i] < min){\n min = arr[i];\n }\n }\n result.push(max);\n result.push(min);\n result.push(sum / arr.length);\n return result;\n}", "title": "" }, { "docid": "9ddeebb567ddd52f572f1f82d4fd616e", "score": "0.5806506", "text": "function increaseMinMax() {\n min -= 10;\n max += 10;\n }", "title": "" }, { "docid": "8f60b144616832937aacd5b976b1dbbf", "score": "0.5786038", "text": "function getMinMax(arr) {\n let min = arr[0][\"price\"], max = arr[0][\"price\"];\n \n // For all values in resolution\n for (let i = 1, len=arr.length; i < len; i++) {\n // Check if current value is min or max\n let v = arr[i][\"price\"];\n min = (v < min) ? v : min;\n max = (v > max) ? v : max;\n }\n\n // Set the min for little more less than what is really is.\n min = Math.floor(min - max * 0.01)\n \n // But more than 0, set the max automaticlly.\n return [Math.max(0, min), \"auto\"];\n }", "title": "" }, { "docid": "d4c1a871bd52ffaf86dfb910b6a3c54d", "score": "0.57846725", "text": "calculateScoreOld() {\n let cardValues = this.cards.map(({ value }) => value).sort((a, b) => b - a);\n return cardValues.reduce((acc, val) => {\n return val === 1 && acc + val < 8 ? acc + val + 10 : acc + val;\n }, 0);\n }", "title": "" }, { "docid": "795c0053240f624a0409beb4e25a6622", "score": "0.57723963", "text": "function getMinMaxAvg(data) {\n // Note: sign of data is ignored, so -5 is treated the same as 5.\n let max = Number.MIN_SAFE_INTEGER;\n let min = Number.MAX_SAFE_INTEGER;\n let total = 0.0;\n for (var i = 0; i < data.length; i++) {\n let d = Math.abs(data[i]);\n max = Math.max(max, d);\n min = Math.min(min, d);\n total += d;\n }\n\n return {\n min: min,\n max: max,\n avg: total / data.length\n }\n}", "title": "" }, { "docid": "5db718956f4e3826c21d8d2e5dcf78c8", "score": "0.5769422", "text": "testMinMax(wert1, wert2){\r\n let index;\r\n //console.log(wert1, wert2);\r\n // Testen, ob es eine Nummer ist\r\n if(!isNaN(Number(wert1)) && !isNaN(Number(wert2)) ){\r\n wert1 = Number(wert1);\r\n wert2 = Number(wert2);\r\n if(wert1 < this.min[0] ) this.min[0] = wert1;\r\n if(wert2 < this.min[1] ) this.min[1] = wert2;\r\n if(wert1 > this.max[0] ) this.max[0] = wert1;\r\n if(wert2 > this.max[1] ) this.max[1] = wert2;\r\n }\r\n // testen, ob es ein Array ist\r\n else if(Array.isArray(wert1) && Array.isArray(wert2)){\r\n // testen, ob die Elemente der Arrays nummern sind\r\n if(wert1.length <= wert2.length){\r\n for(index in wert1){\r\n if(!isNaN(Number(wert1[index]))\r\n && !isNaN(Number(wert2[index])) ){\r\n wert1[index] = Number(wert1[index]);\r\n wert2[index] = Number(wert2[index]);\r\n if(wert1[index] < this.min[0] ) this.min[0] = wert1[index];\r\n if(wert2[index] < this.min[1] ) this.min[1] = wert2[index];\r\n if(wert1[index] > this.max[0] ) this.max[0] = wert1[index];\r\n if(wert2[index] > this.max[1] ) this.max[1] = wert2[index];\r\n }\r\n }\r\n } else {\r\n for(index in wert1){\r\n if(!isNaN(Number(wert1[index]))\r\n && !isNaN(Number(wert2[index])) ){\r\n wert1[index] = Number(wert1[index]);\r\n wert2[index] = Number(wert2[index]);\r\n if(wert1[index] < this.min[0] ) this.min[0] = wert1[index];\r\n if(wert2[index] < this.min[1] ) this.min[1] = wert2[index];\r\n if(wert1[index] > this.max[0] ) this.max[0] = wert1[index];\r\n if(wert2[index] > this.max[1] ) this.max[1] = wert2[index];\r\n }\r\n }\r\n }\r\n }\r\n else{\r\n console.log(\"In testMinMax gibt es Probleme: x: \", wert1, \" | y:\", wert2);\r\n }\r\n }", "title": "" }, { "docid": "50716947878aa3bdd9a3c85b75c742bb", "score": "0.57491034", "text": "function payscaleAnalyzer(payList) {\n var highest = payList[0];\n var lowest = payList[0];\n\n for(var i = 0; i < payList.length; i++) {\n if(payList[i] > highest) {\n highest = payList[i]\n }\n else if(payList[i] < lowest){\n lowest = payList[i]\n }\n }\n\n return highest - lowest;\n}", "title": "" }, { "docid": "83d2b857c2a4bd969617a24dc3624074", "score": "0.5743743", "text": "function determineMaxPoints(questions) {\n _.each(questions, function(question, index) {\n question.maxPoints = _.max(_.map(question.valueAdded, function(category) { return category.val }));\n })\n}", "title": "" }, { "docid": "5250e68773af85b77c05118f3164a611", "score": "0.5738864", "text": "function getMaxScore()\r\n{\r\n\tmaxScore = 0;\r\n\tfor(var i = 0; i < worms.length; i++)\r\n\t{\r\n\t\tif(players[i] && worms[i].score > maxScore)\r\n\t\t{\r\n\t\t\tmaxScore = worms[i].score;\r\n\t\t\twinningWorm = i;\r\n\t\t}\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "e7d1d87d4477222c0b8e8f95882dcae7", "score": "0.57314056", "text": "function getScores(returnObject, sheet, r, generalStart, generalEnd, specificStart, specificEnd, grade, comment) {\n \n // general points\n returnObject.generalPoints = 0;\n returnObject.possibleGeneralPoints = 0;\n for (var col = generalStart; col <= generalEnd; col++) {\n returnObject.generalPoints += isNumber(sheet.getRange(r,col).getValue()) ? sheet.getRange(r,col).getValue() : 0;\n returnObject.possibleGeneralPoints += 5;\n // sheet.getRange(r,col).setBackground(\"#9999ff\"); // testing\n }\n\n // specific points\n returnObject.specificPoints = 0;\n returnObject.possibleSpecificPoints = 0;\n for (var col = specificStart; col <= specificEnd; col++) {\n returnObject.specificPoints += isNumber(sheet.getRange(r,col).getValue()) ? sheet.getRange(r,col).getValue() : 0;\n returnObject.possibleSpecificPoints += 5;\n // sheet.getRange(r,col).setBackground(\"#99ff99\"); // testing\n }\n\n // grade\n returnObject.grade = sheet.getRange(r,grade).getValue();\n // sheet.getRange(r,grade).setBackground(\"#ff9999\"); // testing\n\n // comment\n returnObject.comment = sheet.getRange(r,comment).getValue();\n // sheet.getRange(r,comment).setBackground(\"#ff33ff\"); // testing\n\n return returnObject;\n}", "title": "" }, { "docid": "87487c0557283c45e796664c9b76420c", "score": "0.5730444", "text": "function getHumanReadableScore(score) {\r\n if (score > 0) { \r\n return Math.round(score/antiscale);\r\n }\r\n return 10000;\r\n}", "title": "" }, { "docid": "8bc79a41b3d63acb15004dce1a81dc69", "score": "0.57255507", "text": "function maxscore(v){\r\n if(v>temp){\r\n document.getElementById('score').innerHTML=v;\r\n temp=v;\r\n }\r\n }", "title": "" }, { "docid": "30c2236e9b8748d7e4c43f022d738793", "score": "0.57247454", "text": "function maxMinAvg(array) {\n var min = 99;\n var max = 0;\n var sum =0;\n var count = array.length;\n var newArr =[];\n for (let i = 0; i < array.length; i++) {\n sum += array[i];\n if (array[i] < min) {\n min = array[i];\n } else if (array[i] > max) {\n max = array[i];\n }\n \n }\n newArr.push(max);\n newArr.push(min);\n newArr.push(sum/count);\n\n return newArr;\n\n}", "title": "" }, { "docid": "b6806fd971185047d815b01a206147ce", "score": "0.5721945", "text": "function changeMaxAndMin(minRange, maxRange) {\n var minStorage = document.querySelector('#post-min-range');\n var maxStorage = document.querySelector('#post-max-range');\n if (minRange > 10) {\n minRange = minRange - 10;\n minStorage.innerText = minRange;\n maxRange = maxRange + 10;\n maxStorage.innerText = maxRange;\n } else {\n minStorage.innerText = minRange;\n maxRange = maxRange + 10;\n maxStorage.innerText = maxRange;\n }\n}", "title": "" }, { "docid": "d379677638da3c6ef60d39e8cc649564", "score": "0.57153785", "text": "function highAndLowBestPractice(numbers){\n // ...\n numbers = numbers.split(' ').map(Number);\n var max = Math.max.apply(0, numbers);\n var min = Math.min.apply(0, numbers);\n return max + ' ' + min;\n}", "title": "" }, { "docid": "bec9e58a0077aa53821ea7f1dee57604", "score": "0.5710847", "text": "function minMaxAvg(arr){\n var avg=0;\n var min=arr[0];\n var max=arr[0];\n for(var i=0;i<arr.length;i++){\n avg+=arr[i];\n if (arr[i]>max){\n max=arr[i];\n }\n else if(min>arr[i]){\n min=arr[i]\n }\n }\n return [min,max,avg/arr.length];\n}", "title": "" }, { "docid": "2cbef5be4313588e9e0f1b2d159c7efe", "score": "0.57071745", "text": "function minmax(newBoard,player) {\n var availSpots = emptySpots(newBoard);\n if(checkWinner(newBoard,huPLayer)) return {score:-10};\n else if (checkWinner(newBoard,aiPlayer)) return{score:+10};\n else if (availSpots.length === 0 ) return {score:0};\n //an arrar to collect all the objects\n var moves = [];\n //loop through avail spots\n for(var i in availSpots){\n var move ={};\n move.index = newBoard[availSpots[i]];\n //set the emptty spot to the current player\n newBoard[availSpots[i]] = player;\n //collect the score resulted from calling minmax on the opponent of the player\n if(player == aiPlayer){\n var result = minmax(newBoard, huPLayer);\n move.score = result.score;\n }\n else{\n var result = minmax(newBoard, aiPlayer);\n move.score = result.score;\n }\n\n //reset the spot to empty\n newBoard[availSpots[i]] = move.index\n //push the objest to the array\n moves.push(move);\n }\n //if it is the computers's turn loop over the moves and chose the move with highest score\n var bestMove;\n if(player === aiPlayer){\n var bestScore = -10000;\n for(var i = 0; i < moves.length; i++){\n\n if(moves[i].score > bestScore){\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n }\n else{\n // else loop over the moves and choose the move with the lowest score\n var bestScore = 10000;\n for(var i = 0; i < moves.length; i++){\n if(moves[i].score < bestScore){\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n }\n // return the chosen move (object) from the moves array\n return moves[bestMove];\n }", "title": "" }, { "docid": "d3071c40bbcd374bacc28a4ae97ece1b", "score": "0.57053214", "text": "function maxMinAvg(arr){\n var max = arr[0];\n var minim = arr[0];\n var avg = 0;\n for(var i = 0; i < arr.length; i++){\n avg += arr[i];\n if(max < arr[i]){\n max = arr[i];\n }\n else{\n minim = arr[i];\n }\n }\n var combined = [max,minim,avg];\n return combined;\n}", "title": "" }, { "docid": "020f4b667c7356a32df746c193ff56ff", "score": "0.5695577", "text": "drawMinMaxes(ctx, ymin, ymax)\n{\n var barData = new Array();\n\n var minValue = 1000000000.0;\n var maxValue = -1000000000.0;\n var minIndex = -1;\n var maxIndex = -1;\n var minLine = -1;\n var maxLine = -1;\n\n for ( var jndx=0; jndx<this.plotData.length; jndx++ )\n {\n barData = this.plotData[jndx];\n\n for ( var indx=0; indx<barData.length; indx++ )\n {\n if ( barData[indx] > maxValue )\n {\n maxValue = barData[indx];\n maxIndex = indx;\n maxLine = jndx;\n }\n if ( barData[indx] < minValue )\n {\n minValue = barData[indx];\n minIndex = indx;\n minLine = jndx;\n }\n }\n }\n\n if ( this.labelMax == true && maxIndex != -1 )\n {\n barData = this.plotData[maxLine];\n\n if ( this.DEBUG == true )\n alert(\"Max Line: \" + maxLine + \", Index: \" + maxIndex +\n \", Value: \" + barData[maxIndex]);\n\n var x = this.xScale*maxIndex + this.xOrg + this.xScale/2.0;\n var y = this.yOrg - (barData[maxIndex]-ymin)*this.yScale - this.xLabelsFontSize;\n\n var max_val = barData[maxIndex];\n ctx.lineWidth = 1;\n ctx.strokeStyle = this.BLACK;\n ctx.drawTextCenter(this.xLabelsFont, this.xLabelsFontSize, x, y, max_val + \"\");\n }\n\n if ( this.labelMin == true && minIndex != -1 )\n {\n barData = this.plotData[minLine];\n\n if ( this.DEBUG == true )\n alert(\"Min Line: \" + minLine + \", Index: \" + minIndex +\n \", Value: \" + barData[minIndex]);\n\n var x = this.xScale*minIndex + this.xOrg + this.xScale/2.0;\n var y = this.yOrg - (barData[minIndex]-ymin)*this.yScale - this.xLabelsFontSize;\n\n var min_val = barData[minIndex];\n ctx.lineWidth = 1;\n ctx.strokeStyle = this.BLACK;\n ctx.drawTextCenter(this.xLabelsFont, this.xLabelsFontSize, x, y, min_val + \"\");\n }\n}", "title": "" }, { "docid": "5666c78dcc1eb84dbf6e43461290149d", "score": "0.5694775", "text": "function updateScore() {\r\n if (min.innerHTML == '01') {\r\n yourScore = 7;\r\n } else if (sec.innerHTML <= '30') {\r\n yourScore = 15;\r\n } else if (sec.innerHTML <= '45') {\r\n yourScore = 12;\r\n } else if (sec.innerHTML <= '59') {\r\n yourScore = 8;\r\n } else {\r\n yourScore = 5;\r\n }\r\n}", "title": "" }, { "docid": "5e6aadb20c178220c40d8d2c41d759a1", "score": "0.5694594", "text": "function arrMaxMin(arr) {\n\tlet min = +Infinity, max = -Infinity;\n\tlet statmin=0, statmax=0;\n\tfor(let i=0; i < arr.length; i++) {\n\t\tif(arr[i] < min) {\n\t\t\tmin = arr[i];\n\t\t\tstatmin++;\n\t\t}\n\t\tif(arr[i] > max) {\n\t\t\tmax = arr[i];\n\t\t\tstatmax++;\n\t\t}\n\t}\n\tconsole.log(max, min);\n}", "title": "" }, { "docid": "7bb254bd296a1599383a2a2bfe2518aa", "score": "0.569409", "text": "function score(data) {\r\n return data[0]*0.1 + data[2]*0.01 + data[3]*0.11 + data[1]*0.1 + data[4]*0.2 + data[5]*0.1 + data[6]*0.2 + data[7]*0.01 + data[8]*0.01;\r\n}", "title": "" }, { "docid": "7597797f9b1a4cff7edcc92422b655c0", "score": "0.56842136", "text": "function minmax(value, min, max) {\n //debugger;\n if (parseInt(value) < 1 || isNaN(value)) { return 1; }\n else if (parseInt(value) > 100) { return 100; }\n else { return value; }\n}", "title": "" }, { "docid": "3098dd8181680f9a32af0711b56b8e9f", "score": "0.5682902", "text": "function printMaxMinAverage(inputArray) {\n\tlet max = inputArray[0],\n\t\tmin = inputArray[0],\n\t\tsum = 0;\n\tinputArray.forEach((element) => {\n\t\tif (element > max) max = element;\n\t\tif (element < min) min = element;\n\t\tsum += element;\n\t});\n\tconsole.log(\"Max:\", max);\n\tconsole.log(\"Min:\", min);\n\tconsole.log(\"Average:\", sum / (inputArray.length - 1));\n}", "title": "" }, { "docid": "b34947ad8c30187506e06b7dbfb9881d", "score": "0.5681928", "text": "function printMaxMinAverage(arr) {\n if (arr.length === 0) {\n return;\n }\n var min = arr[0];\n var max = arr[0];\n var sum = arr[0];\n for (var idx = 1; idx <= arr.length; idx++) {\n if (arr[idx] < min) {\n min = arr[idx];\n }\n if (arr[idx] > max) {\n max = arr[idx];\n }\n sum += arr[idx];\n }\n return min;\n return max;\n return avg;\n}", "title": "" }, { "docid": "effe93048a2db49c1e1137aada04b1f5", "score": "0.5676718", "text": "function yMinMax() {\n // min will grab the smallest datum from the selected column.\n yMin = d3.min(theData, function(d) {\n return parseFloat(d[curY]) * 0.90;\n });\n\n // .max will grab the largest datum from the selected column.\n yMax = d3.max(theData, function(d) {\n return parseFloat(d[curY]) * 1.10;\n });\n }", "title": "" }, { "docid": "ef25e3b7060e6b481ce37495f6fa0ec6", "score": "0.5662311", "text": "function rangeFunc() {\n let rangeNum = Math.max(num1, num2, num3) - Math.min(num1, num2, num3);\n console.log(\"RANGE: \" + rangeNum);\n results[4].textContent = \"Range: \" + rangeNum;\n}", "title": "" }, { "docid": "c8b1bf22bc7b5b8bb1d615d8ac1cea90", "score": "0.5646237", "text": "function range(){\nmin =Math.floor( Math.min.apply(null, resultHotel.map((item)=> {\n return item.price;\n}))),\nmax = Math.round( Math.max.apply(null,resultHotel.map((item)=> {\n return item.price;\n})));\n// console.log(min , max)\n}", "title": "" }, { "docid": "14968bdcf95a8989796ed3e361222950", "score": "0.5642217", "text": "function result_max() {\n result_a = flotr_data[0].data.filter(isBigEnough(area.x1)).filter(isSmallEnough(area.x2)).reduce(\n function(max, arr) {\n return max >= arr[1] ? max : arr[1];\n }, -Infinity);\n\n if (typeof flotr_data[1] !== \"undefined\") {\n if ( typeof flotr_data[1].yaxis === \"undefined\") {\n result_b = flotr_data[1].data.filter(isBigEnough(area.x1)).filter(isSmallEnough(area.x2)).reduce(function(max, arr) {\n return max >= arr[1] ? max : arr[1];\n }, -Infinity);\n if (result_b > result_a ){\n return result_b;\n }\n }\n }\n return result_a;\n }", "title": "" }, { "docid": "e20d59a4f81cf82a63d28b528fb87c1a", "score": "0.56341916", "text": "function printing(arr) {\n var sum = arr[0];\n var min = arr[0];\n var max = arr[0];\n for (var i = 1; i < arr.length; ++i) {\n if (arr[i] < min) {\n min = arr[i];\n }\n if (arr[i] > max) {\n max = arr[i];\n }\n sum += arr[i];\n }\n console.log(max);\n console.log(min);\n console.log(sum / arr.length);\n}", "title": "" }, { "docid": "4d7bec182d95a18005e8394d9ba2d57a", "score": "0.5633832", "text": "function maxMinAvg(arr){\n let totalSum = 0;\n let max = arr[0];\n let min = arr[0];\n for (let i=1; i<arr.length;i++){\n if (min > arr[i]) {\n min = arr[i];\n }\n }\n for (let i=1; i<arr.length;i++){\n if (max < arr[i]) {\n max = arr[i];\n }\n }\n for (let i=0; i<arr.length;i++){\n totalSum += i; \n }\n average = totalSum / arr.length;\n console.log(\"max: \" + max);\n console.log(\"min: \" + min);\n console.log(\"average: \" + average);\n}", "title": "" }, { "docid": "d10136144942814330968145f2ff1926", "score": "0.5629317", "text": "function Resume_Maximise_ScoreCounter(miniScore)\n{\n\t//create a score counter\n\tvar score = new ScoreManager_ScoreCounter();\n\t//fill it up\n\tscore.Requests_Hints = miniScore[0];\n\tscore.Requests_Cameras = miniScore[1];\n\tscore.Actions_Correct = miniScore[2];\n\tscore.Actions_BadData = miniScore[3];\n\tscore.Triggers_Hints = miniScore[4];\n\tscore.Triggers_Camera = miniScore[5];\n\tscore.Triggers_Penalty = miniScore[6];\n\tscore.Triggers_Error = miniScore[7];\n\tscore.Triggers_Info = miniScore[8];\n\tscore.Triggers_MouseOver = miniScore[9];\n\tscore.Count_Errors = miniScore[10];\n\tscore.bProcessed = miniScore[11] == 1;\n\tscore.AutoPlayCamera = miniScore[12] == 1;\n\t//return it\n\treturn score;\n}", "title": "" }, { "docid": "56c701dbcb7954b73c44d6164abfaee7", "score": "0.56180036", "text": "function maxAndMinNextValue(minSoFar,total,level)\n{\nvar quotient = Math.floor(total/level)\nvar dividend = total%level\n//th\n//because the level is greater than one we can spread the total over the remaining slots\n//the -1 is because we are putting one in every slot accept the one we are concerned with\n//making the others one tells us this max\nvar maxCandidateByWhatsLeve = total-((level*1)-1)\n//This value cannot be larger than the smallest so far\nvar max = (minSoFar<maxCandidateByWhatsLeve)?minSoFar:maxCandidateByWhatsLeve;\nvar min = quotient+((dividend>0)?1:0);\nreturn [min,max];\n}", "title": "" }, { "docid": "e2f61868883f089fc5f18ba3762640b7", "score": "0.5617635", "text": "function breakingRecords(scores) {\r\n let min = scores[0];\r\n let max = scores[0];\r\n // count the number of changes for each\r\n var changeArr = [0,0];\r\n\r\n // starting at index [1] allows me to keep track only of changes, not initial score\r\n for (let i = 1; i < scores.length; i++) {\r\n if (scores[i] > max) {\r\n max = scores[i];\r\n // max score changed. record it\r\n changeArr[0]++;\r\n } else if (scores[i] < min) {\r\n min = scores[i];\r\n // min score changed. record it\r\n changeArr[1]++;\r\n }\r\n }\r\n return changeArr;\r\n }", "title": "" }, { "docid": "95ddc106a6f7daee19f3d84fe01cd7f7", "score": "0.5614549", "text": "function r_in_r(min, max) {\n return chance.integer({min: min, max: max});\n}", "title": "" }, { "docid": "6f6cb3c26d098c6c72bcef3cb6d51861", "score": "0.56108516", "text": "function calculate_score() {\n var answer = get_answer();\n var guess = get_guess();\n var diff = compare_arrays(answer, guess)\n return Math.floor(((((255 * 3) - diff) / (255 * 3)) * 100))\n}", "title": "" }, { "docid": "3a97da7a02249053f4c53db4b6394e11", "score": "0.5605512", "text": "function miniMaxSum(arr) {\n let newArr = [...arr].sort()\n let sum = 0;\n for (let i = 0; i < newArr.length; i++) {\n sum += newArr[i]\n }\n let minValue = sum - newArr[newArr.length - 1]\n let maxValue = sum - newArr[0]\n console.log(minValue, maxValue)\n }", "title": "" }, { "docid": "8bd1e7668ed218554b8fa9cd6417f24e", "score": "0.55986285", "text": "getScore() {\n return this.val;\n }", "title": "" }, { "docid": "4fd395cddca7def930b619074e706b7b", "score": "0.5598463", "text": "function breakingRecords(scores) {\n\n let lowestScore = 0;\n let highestScore = 0;\n let highestCount = 0;\n let lowestCount = 0;\n\n for(let i = 0; i<scores.length; i++){\n if(i === 0) {\n if (highestScore === 0) {\n highestScore = scores[i];\n lowestScore = scores[i];\n }\n }\n\n if(highestScore < scores[i]){\n highestCount ++;\n highestScore = scores[i];\n }\n\n if(lowestScore > scores[i]){\n lowestCount ++;\n lowestScore = scores[i];\n }\n }\n\n let results = [highestCount, lowestCount];\n console.log(highestCount + \" \" + lowestCount);\n\n return results;\n}", "title": "" }, { "docid": "d5f28f898264fd65dc44b9be2bc60a7c", "score": "0.55965513", "text": "function minMaxAvg (arr){\n var max = arr[0];\n var min = arr[0];\n var sum = arr[0];\n for (var i=1;i<arr.length;i++){\n sum= sum + arr[i];\n\n //find maximum\n if(arr[i]>max){\n max=arr[i];\n }\n //find minimum\n else if (arr[i]<min){\n min=arr[i];\n }\n \n\n }\n console.log(\"Max: \"+ max+ \" Min: \" + min + \" Avg: \" + sum/arr.length);\n\n}", "title": "" }, { "docid": "981531c25de9f1234b08cb44e4c128d0", "score": "0.55887073", "text": "function yMinMax() {\n yMin = d3.min(censusData, function(d) {\n return parseFloat(d[currentY]) * 0.90;\n });\n\n yMax = d3.max(censusData, function(d) {\n return parseFloat(d[currentY]) * 1.10;\n });\n }", "title": "" }, { "docid": "81a1a6f051451047af92ba83da706332", "score": "0.55871636", "text": "function getMaxMin(data){\n var min_max = {x: {}, y: {}};\n\n for(var i = 0; i < data.length; i++){\n var set = data[i].data;\n\n if(i === 0){\n min_max.x.min = set[0].x;\n min_max.x.max = set[0].x;\n min_max.y.min = set[0].y;\n min_max.y.max = set[0].y;\n }\n\n for(var k = 0; k < set.length; k++){\n //min x\n if(set[k].x < min_max.x.min){\n min_max.x.min = set[k].x;\n }\n //max x\n if(set[k].x > min_max.x.max){\n min_max.x.max = set[k].x;\n }\n //min y\n if(set[k].y < min_max.y.min){\n min_max.y.min = set[k].y;\n }\n //max y\n if(set[k].y > min_max.y.max){\n min_max.y.max = set[k].y;\n }\n }\n }\n\n return min_max;\n }", "title": "" }, { "docid": "06c40c12ac6cdea361673b51215e329a", "score": "0.5584389", "text": "function getScore() {\n\t\tif (this.value == 'N') { //None\n\t\t\treturn 0.85;\n\t\t} else { //Required\n\t\t\treturn 0.62;\n\t\t}\n\t}", "title": "" }, { "docid": "a5e24f97df8d17497058fd5971d1c412", "score": "0.5576918", "text": "function findMinAndMax(value) {\n 'use strict';\n\n return 'Min -> ' + Math.min.apply(null, value) +\n '\\r\\nMax -> ' + Math.max.apply(null, value) + '\\r\\n';\n}", "title": "" }, { "docid": "3287bb487e62707490dc9c173f4e259a", "score": "0.5571591", "text": "score(inputs, output) {\n var d = Math.abs(inputs[0] - inputs[1]);\n d = Math.abs(d - output) + 0.1;\n return 1 / d;\n }", "title": "" }, { "docid": "c5034afa16abe8cfd69886970bcd7b18", "score": "0.5568558", "text": "function setScaling(hsclasses, theClass, theScore, i) {\n var colour;\n var plusminus;\n var change;\n\tvar score_weighting\n\tvar j;\n\tvar scaled;\n\n\tif (theClass.substring(0, 3) == \"VV-\") {\n\t\t// VET-Other\n\t\t//No Score required, gets 10% of top 4 classes\n\t\t\n\t\tvar newScore = -1;\n\t\t\n\t\t// Write out the changes\n document.getElementById(\"scaling\" + i).innerHTML = \"<span class='grey'> N/a </span>\";\n document.getElementById(\"class\" + i + \"result\").value = newScore;\n return newScore;\n\t\t\n } else if(theClass.substring(0, 3) == \"HE-\") {\n\t\t// Higher Education class\n\t\t// Score just gets transferred as a 10% class. No scaling.\n\t\tif(theScore < 0 || theScore > 5) {\n\t\t\t// The score is invalid\n\t\t\tsendAlert(\"Higher Education scores are only between 0 and 5\");\n\t\t}\n\t\t\n\t\t// Write out the changes\n document.getElementById(\"scaling\" + i).innerHTML = \"<span class='grey'> N/a </span>\";\n document.getElementById(\"class\" + i + \"result\").value = parseInt(theScore*100)/100;\n return theScore;\n\t\n\t} else if (theScore < 0 || theScore > 50) {\n\t\t// If score is invalid, notify user\n sendAlert(\"Raw scores are only between 0 and 50\");\n\t\n\t} else if (theClass === \"\") {\n\t\tlog(\"Error: Class sent to setScaling() was null\");\n\t\treturn 0;\n\t} else {\n\t\n\t\t// Look up the nearest scales in hsclasses to get the scaled score\n\t\tvar upper = 0;\n\t\tvar lower = 0;\n\t\tvar scaled_lower = 0;\n\t\tvar scaled_upper = 0;\n\t\t\n\t\t// Find the upper and lower min_agg's\n\t\tfor (j = 20; j <= 50; j += 5) {\n\t\t\tif (theScore < j && upper == 0) {\n\t\t\t\tupper = j;\n\t\t\t\tscaled_upper = hsclasses['raw_' + j][theClass];\n\t\t\t}\n\t\t\t\t\n\t\t\tif (theScore >= j) {\n\t\t\t\tlower = j;\n\t\t\t\tscaled_lower = hsclasses['raw_' + j][theClass];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (lower == theScore)\n\t\t{\n\t\t\tscaled = scaled_lower;\n\t\t} else if (lower == 0) {\n\t\t\t// Score is < 20\n\t\t\t// Assume that 0 is scaled to 0 and use that as the lower value\n\t\t\tscore_weighting = (theScore - lower) / (upper - lower);\n\t\t\tscaled = score_weighting * scaled_upper + (1 - score_weighting) * scaled_lower;\n\t\t} else if (upper == 0) {\n\t\t\t// Score of 50\n\t\t\t// Should already have been sorted.\n\t\t\tsendAlert(\"Logic error 634\");\n\t\t} else {\n\t\t\t// Score is 20 or above, but less than or equal to 50\n\t\t\t\n\t\t\t// Gives percentage of weighing\n\t\t\tscore_weighting = (theScore - lower) / (upper - lower);\n\t\t\t\n\t\t\t// Takes the weightings and applies to to the scaled score linearly\n\t\t\tscaled = score_weighting * scaled_upper + (1 - score_weighting) * scaled_lower;\n\t\t}\n \n // Set appropriate colour and value\n if (scaled == theScore) {\n colour = \"grey\";\n plusminus = \"+\";\n change = 0;\n } else if (scaled < theScore) {\n colour = \"red\";\n plusminus = \"\";\n change = scaled - theScore;\n } else {\n colour = \"green\";\n plusminus = \"+\";\n change = scaled - theScore;\n }\n \n // Check score is not negative\n if (+theScore + +change < 0) {\n change = - theScore;\n }\n \n // Write out the changes\n document.getElementById(\"scaling\" + i).innerHTML = \"<span class='\" + colour + \"'>\" + plusminus + Math.round(change) + \"</span>\";\n document.getElementById(\"class\" + i + \"result\").value = parseInt(100 * (+theScore + +change)) / 100;\n return parseInt(100 * (+theScore + +change)) / 100;\n }\n \n return 0;\n\n}", "title": "" }, { "docid": "6da5ff425d20d69dc5caff127afb1d81", "score": "0.5557123", "text": "function breakingRecords(scores) {\n let most = scores[0];\n let least = scores[0];\n \n let dMost = 0;\n let dLeast = 0;\n \n for (const score of scores) {\n if (most < score) {\n most = score;\n dMost++;\n }\n else if (score < least) {\n least = score;\n dLeast++;\n }\n }\n return [dMost, dLeast];\n }", "title": "" }, { "docid": "c52930dec11f289b986f332a296f3b9b", "score": "0.5557089", "text": "function getScore() {\n\treturn parseInt(currentScore);\n}", "title": "" }, { "docid": "80052f3fccc3e2b76857914f2c83326f", "score": "0.5553126", "text": "checkRectangleSide(min, max, value) {\n //Does the whole magic\n if (value < min) {\n return min;\n } else if (value > max) {\n return max;\n } else {\n return value;\n }\n }", "title": "" }, { "docid": "2b5677475e18a9073b8b4331a3ce8320", "score": "0.5552887", "text": "function minMax(arr){\n var max = arr[0];\n var min = arr[0];\n var sum = 0;\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > max){\n max = arr[i];\n }\n else if(arr[i] < min){\n min = arr[i];\n }\n sum += arr[i];\n }\n console.log(\"max: \" + max);\n console.log(\"min: \" + min);\n console.log(\"avg: \" + (sum/arr.length));\n}", "title": "" }, { "docid": "f16691658eb5a986485936873d62cbdc", "score": "0.55451334", "text": "function mathOperations(arr){\n let max = arr[0],min=arr[0]\n\n for(let i = 0;i<arr.length;i++){\n if(arr[i]>max){\n max = arr[i]\n }\n if(arr[i]<min){\n min = arr[i]\n }\n }\n\n console.log(\"MAX = \" + max)\n\n console.log(\"Min = \" + min)\n\n console.log(\"Range = \" + (max-min))\n}", "title": "" }, { "docid": "2167e04f912063d5b85a31f9af304bfa", "score": "0.55363846", "text": "function calculateScore() {\n\tscore = winCount * 100 + loseCount * -50 + (coveredTileCount * 2) + (100 - time) + (50 - moves) * 2 + (bonus * 15);\n}", "title": "" }, { "docid": "37f6306554f9a5b2bfd24385df51f9a2", "score": "0.55359375", "text": "function roundMinMax(factor) {\n factor = parseFloat(factor);\n var minNum = parseFloat(min.value);\n var maxNum = parseFloat(max.value);\n\n var minMod = min.value % factor;\n var maxMod = max.value % factor;\n var minVal = minMod < factor / 2 ? minNum - minMod : minNum + (factor - minMod);\n var maxVal = maxMod < factor / 2 ? maxNum - maxMod : maxNum + (factor - maxMod);\n\n min.value = minVal.toFixed(2);\n max.value = maxVal.toFixed(2);\n min.step = factor;\n max.step = factor;\n adjustLabel(max_input, max);\n adjustLabel(min_input, min);\n }", "title": "" }, { "docid": "e067541c4e796f8bab4a961c1958f523", "score": "0.55355686", "text": "function getMinMaxs(points) {\n var xs = points.map(function (point) {\n return point[0];\n });\n var ys = points.map(function (point) {\n return point[1];\n });\n return {\n minX: Math.min.apply(Math, xs),\n minY: Math.min.apply(Math, ys),\n maxX: Math.max.apply(Math, xs),\n maxY: Math.max.apply(Math, ys)\n };\n }", "title": "" }, { "docid": "a602bdc71318b3649086437ed193d7f2", "score": "0.55354357", "text": "scoreToDisplay() {\n let score = '';\n\n if (this.P1point === this.P2point && this.P1point < 3) {\n if (this.P1point === 0)\n score = 'Love';\n if (this.P1point === 1)\n score = 'Fifteen';\n if (this.P1point === 2)\n score = 'Thirty';\n score += '-All';\n }\n if (this.P1point === this.P2point && this.P1point > 2)\n score = 'Deuce';\n\n if (this.P1point > 0 && this.P2point === 0) {\n if (this.P1point === 1)\n this.P1res = 'Fifteen';\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n if (this.P1point === 3)\n this.P1res = 'Forty';\n\n this.P2res = 'Love';\n score = this.P1res + '-' + this.P2res;\n }\n if (this.P2point > 0 && this.P1point === 0) {\n if (this.P2point === 1)\n this.P2res = 'Fifteen';\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n if (this.P2point === 3)\n this.P2res = 'Forty';\n\n this.P1res = 'Love';\n score = this.P1res + '-' + this.P2res;\n }\n\n if (this.P1point > this.P2point && this.P1point < 4) {\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n if (this.P1point === 3)\n this.P1res = 'Forty';\n if (this.P2point === 1)\n this.P2res = 'Fifteen';\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n score = this.P1res + '-' + this.P2res;\n }\n if (this.P2point > this.P1point && this.P2point < 4) {\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n if (this.P2point === 3)\n this.P2res = 'Forty';\n if (this.P1point === 1)\n this.P1res = 'Fifteen';\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n score = this.P1res + '-' + this.P2res;\n }\n\n if (this.P1point > this.P2point && this.P2point >= 3) {\n score = 'Advantage ' + this.player1Name;\n }\n\n if (this.P2point > this.P1point && this.P1point >= 3) {\n score = 'Advantage ' + this.player2Name;\n }\n\n if (this.P1point >= 4 && this.P2point >= 0 && (this.P1point - this.P2point) >= 2) {\n score = 'Win for ' + this.player1Name;\n }\n if (this.P2point >= 4 && this.P1point >= 0 && (this.P2point - this.P1point) >= 2) {\n score = 'Win for ' + this.player2Name;\n }\n return score;\n }", "title": "" }, { "docid": "d7dd0a025c843d1ee713f8b6dfa613d1", "score": "0.55340207", "text": "function highAndLow(test){\r\n let tempArray = test.split(\" \");\r\n let max = Math.max.apply(null,tempArray);\r\n let min = Math.min.apply(null,tempArray);\r\n return max + \" \"+ min}", "title": "" }, { "docid": "b79d1d681b4ce65a344e339e8c185234", "score": "0.55332416", "text": "function getRangeAccuracy() {\n\tvar visible = parseInt($(\"#baseRange\").val());\n\tvar potRange = $(\"#potRange option:selected\").text();\n\n\tif (potRange.indexOf(\"No Potion\")) {\n\t\tvisible = calculateVisible(visible, potRange);\n\t}\n\n\tvar p1 = $(\"#p1 option:selected\").text();\n\tvar pAcc = 1;\n\tif (p1.indexOf(\"No Prayer\")) {\n\t\tpAcc = parseFloat(p1.substr(p1.search(/([\\d]\\.?[\\d]*)/)));\n\t}\n\t\n\tvar style = 0;\n\tif($(\"#radioAccurate\").is(':checked')) { style = 3; }\n else if($(\"#radioRapid\").is(':checked')) { style = 0; }\n\telse if($(\"#radioLongrange\").is(':checked')) { style = 0; }\n\telse { alert(\"No style\"); }\n\t\n\tvar v = $(\"#checkVoid\").is(':checked') ? 1.1 : 1;\n\tvar gear = $(\"#checkSalve\").is(':checked') ? 1.2 : $(\"#checkSlay\").is(':checked') ? 1.15 : 1;\n\tvar bonus = $(\"#total\").find(\".ra\").val() || \"0\";\n\t\n\tvar load = {visible, pAcc, style, v, bonus, gear};\n\treturn calculateRoll(load);\n}", "title": "" }, { "docid": "fce30a1e1db5f767df1ff46768262f1e", "score": "0.5532789", "text": "function randomScore(){\n\tmin = 0;\n\tmax = 0;\n\tmin = 19;\n\tmax = 120;\n\trandomNum = Math.round(Math.random() * (max - min + 1)) + min;\n\t$(\".randomNum\").html(\"Desired Score: \" + randomNum);\n\t}", "title": "" }, { "docid": "985d7a05b2e958eb21f62336e0768488", "score": "0.5529801", "text": "function findMinAndMax(array) {\n var minValue = array[0];\n var maxValue = array[0];\n var = i;\n\n for (i = 1; i < array.length; i++) {\n currentElement = array[i];\n\n if (currentElement < minValue) {\n minValue = currentElement;\n\n }\n\n if (currentElement > maxValue) {\n maxValue = currentValue;\n\n }\n\n //i=1:minValue = 3, maxValue = 7\n } //i=2:minValue = 2, maxValue = 7\n //i=3:minValue = 1, maxValue = 7\n //i=4:minValue = 1 maxValue = 8\n //i=5:minValue = 1 maxValue = 8\n\n}", "title": "" }, { "docid": "55a6be8bedb1570ba57e0e08c037fd0e", "score": "0.55292183", "text": "function maxMinAvg (arr){\n var max = arr[0]\n var min = arr[0]\n var sum = 0\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > max){\n max = arr[i] \n }\n if(arr[i] < min){\n min = arr[i]\n }\n sum += arr[i]\n }\n average = sum / arr.length\n console.log(max, min, average)\n}", "title": "" }, { "docid": "ab87d6ef037e69641d523d421dea9321", "score": "0.55246955", "text": "function getMaxMin(Layer, energy, moisture, content, potential, year){\n max = 0\n min = 99999999\n// As thermochemical facilities do not have a tag but are listed as dry we need to do the step below\nif (energy == '_dry'){\n moisture = '_dry'\n energy = ''\n }\n\n Layer.forEach(function(feature){\n type = feature.getProperty(\"Type\");\n if (type == 'crop'){\n if (moisture == ''){\n res_val = getTotalBiomass(feature, energy, '_dry', content, potential, year);\n cull_val = getTotalBiomass(feature, energy, '_wet', content, potential, year);\n biomass_val = res_val + cull_val\n }\n else {\n biomass_val = getTotalBiomass(feature, energy, moisture, content, potential, year);\n }\n }\n else {\n biomass_val = getTotalBiomass(feature, energy, moisture, content, potential, year);\n }\n if (biomass_val>max){\n max=biomass_val\n }\n if (biomass_val<min){\n min=biomass_val\n }\n })\n return ([max, min])\n }", "title": "" }, { "docid": "97504abd6d7569dc2669e89ccdb5c834", "score": "0.552284", "text": "function findMinAndMax(value){\n value.sort(function (a, b) { return a - b });\n console.log(\"Min -> %d\\nMax -> %d\", value[0], value[value.length-1]);\n}", "title": "" }, { "docid": "d9a1dd8c42891d11f544ff86d4084b51", "score": "0.55205816", "text": "getScores() {\n return getScores(this);\n }", "title": "" }, { "docid": "2c3b1d76dcc5597d6ae967ada5a90889", "score": "0.55157655", "text": "function maxMinAvg(arr){\n var max = arr[0];\n var min = arr[0];\n var avg = 0;\n var output = [];\n for(var i = 0; i < arr.length; i++){\n if(arr[i] > max){\n max = arr[i];\n }\n if(arr[i] < min){\n min = arr[i];\n }\n avg += arr[i];\n }\n output.push(max);\n output.push(min);\n output.push(avg/arr.length);\n return output;\n}", "title": "" } ]
2780660ad538474e67f5682099386724
Check if extension is active.
[ { "docid": "6ab2a8e9fdb1a499272d07b29767d149", "score": "0.75097257", "text": "function extensionIsActivated(cb) {\n\tconsole.log(\"Is extension active?\");\n\n\tchrome.storage.sync.get('userId', function(items) {\n\t\tif (items.userId == null) return cb(null, false);\n\t\tconsole.log(\"Check for userId\", items.userId);\n\t\t\n\t\tvar UserRecord = Parse.Object.extend(\"UserRecord\");\n\t\tvar query = new Parse.Query(UserRecord);\n\t\tquery.equalTo(\"userId\", items.userId);\n\t\tquery.find({\n\t\t\tsuccess: function(results) {\n\t\t\t\tconsole.log(\"Found\", results.length, \"matching records\");\n\t\t\t\tif (results.length > 0) {\n\t\t\t\t\tcb(null, true);\n\t\t\t\t} else {\n\t\t\t\t\tcb(null, false);\n\t\t\t\t}\n\t\t\t}\n\t\t,\n\t\t\terror: function(err) {\n\t\t\t\tconsole.log(\"Error querying records\");\n\t\t\t\tcb(err);\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" } ]
[ { "docid": "f87726c5d7e4a3a1a0b08288434bbc51", "score": "0.6960333", "text": "function isChromeExtensionAvailable(callback) {\n if (!callback) return;\n\n if (chromeMediaSource == 'desktop') return callback(true);\n\n // ask extension if it is available\n window.postMessage('are-you-there', '*');\n\n setTimeout(function() {\n if (chromeMediaSource == 'screen') {\n callback(false);\n } else callback(true);\n }, 2000);\n}", "title": "" }, { "docid": "177136bf5cf7cc59a41d3277bac25004", "score": "0.68920714", "text": "function isActive() {\n if (root.getApplication(this.name) == null)\n return false;\n else\n return true;\n}", "title": "" }, { "docid": "7c39a5e595ac758e9f47c7f287a10ec9", "score": "0.6866114", "text": "function isChromeExtensionAvailable(callback) {\n if (!callback) return;\n\n if (isFirefox) return isFirefoxExtensionAvailable(callback);\n\n if (window.IsAndroidChrome) {\n chromeMediaSource = 'screen';\n callback(true);\n return;\n }\n\n if (chromeMediaSource == 'desktop') {\n callback(true);\n return;\n }\n\n // ask extension if it is available\n window.postMessage('are-you-there', '*');\n\n setTimeout(function() {\n if (chromeMediaSource == 'screen') {\n callback(false);\n } else callback(true);\n }, 2000);\n }", "title": "" }, { "docid": "e03feb61ce839e3e6f943ef94a5efc6c", "score": "0.6659808", "text": "function isChromeExtension() {\n\n return window.chrome && window.chrome.extension;\n }", "title": "" }, { "docid": "8b9a99d06dab1f4a3e5e5ccb6b4d140f", "score": "0.65764135", "text": "isBrowserActive(app) { return 0; }", "title": "" }, { "docid": "c181feffa9b081398156171c59ff2554", "score": "0.6471205", "text": "async isActive() {\n return this._hasState('active');\n }", "title": "" }, { "docid": "3c161b1843858b56ad4135c1f6f6ca20", "score": "0.64530444", "text": "function isMediaElementActive(){\n\t\t\t\t\n\t\treturn(typeof mejs != \"undefined\");\n\t}", "title": "" }, { "docid": "c1f35004e8af20a534cdb153e3537cbd", "score": "0.6444304", "text": "hasActiveContext() {\n return !!this._activeContext.name\n }", "title": "" }, { "docid": "2cce8673a5deb237942a31fdf47c45b9", "score": "0.64341486", "text": "function isYTActive(){\n\t\t\n\t\tif(typeof YT != \"undefined\" && typeof YT.Player != \"undefined\")\n\t\t\treturn(true);\n\t\t\n\t\treturn(false);\n\t}", "title": "" }, { "docid": "14da9b57dcb57c3beab977832a605bec", "score": "0.6355133", "text": "function checkIfActiveLayerAvailable() {\n\treturn true;\n}", "title": "" }, { "docid": "ecee439745cdc69f775ac293fbbf2bef", "score": "0.63482606", "text": "hasExtension(ext) {\n return this.extension == ext;\n }", "title": "" }, { "docid": "36d1f6fa4f7f48e2e04c24a5a8d3198f", "score": "0.6305381", "text": "function isWorkActive() {\n logi(\"Checking if work is active\")\n return workers.ani.isWorking() || workers.nyaa.isWorking()\n}", "title": "" }, { "docid": "acc420bb6f8ba3932ffb1c1363e76f4a", "score": "0.6137722", "text": "function isActive(){\n\n return !!active;\n }", "title": "" }, { "docid": "8926846c1b74b3aedb30d0b5e186785d", "score": "0.6086869", "text": "function checkExtenstionExist() {\n chrome.runtime.sendMessage(extId, { action: 'doYouExist' }, function (response) {\n if( !response )\n $('#ext-dwn').removeClass('hide')\n })\n}", "title": "" }, { "docid": "ff4b02315fa992f2039e7646744caac9", "score": "0.6063037", "text": "function isAvailable() {\n return Boolean(exports.chromeStorage);\n }", "title": "" }, { "docid": "85cee9d363c24151d2437536b40c3bee", "score": "0.6026372", "text": "function checkTab(){\n getActiveTabURL().then(url=>{\n var newIsActive = url.indexOf(\"unbabel.com\") != -1; \n if(newIsActive != isActive)\n update();\n isActive = newIsActive;\n });\n}", "title": "" }, { "docid": "d6fa7e9e50834ccada4e756ac3f021c1", "score": "0.59922016", "text": "function activateExtension() {\n\n // Call the helper function to make necessary changes\n extensionStateChange(\"#deactivateExtension\", \"#activateExtension\");\n\n // Change the toolbar item image to denote extension is on\n /* istanbul ignore if */\n if (typeof safari !== \"undefined\" && safari.extension !== undefined) {\n safari.extension.toolbarItems[0].image = safari.extension.baseURI + 'img/extension_on.png';\n }\n}", "title": "" }, { "docid": "f8bbaa4fc79c3a1a8366f43d1654d0cc", "score": "0.59762573", "text": "function isSCActive(){\n\t\t\n\t\treturn(typeof SC != \"undefined\");\t\n\t}", "title": "" }, { "docid": "7e0736d597b95732ef80c09410478d62", "score": "0.5892178", "text": "isActive () {\n return this.status === State.statuses.embedLib.ACTIVE\n }", "title": "" }, { "docid": "19444af2314dc7ac5406bd9e49b3dacb", "score": "0.58721817", "text": "function checkOnLaunched() {\n doc.getElementById('status').innerHTML = chrome.app.runtime.onLaunched ? \"onLaunched exists\" : \"onLaunched not found\";\n}", "title": "" }, { "docid": "878580b03eeb8de2081cd9fa95bafcf8", "score": "0.5815984", "text": "function CNExtendIsEnabled() {\r\n\t\treturn CNExtend_util.PrefObserver.getBoolPreference(CNExtend_enum.IS_ENABLED_PREF);\r\n\t}", "title": "" }, { "docid": "97c440a0005886c5b3ad76a39f358b59", "score": "0.57373744", "text": "function tabIsActive(element) {\n return element.className.indexOf('nav-tabs--active') > -1;\n }", "title": "" }, { "docid": "2ee362df370fc85adcdbc31bd00fd542", "score": "0.57293177", "text": "function checkIfActive(classes) {\n return classes.includes('Plx--active');\n}", "title": "" }, { "docid": "59b8d36bb07cb739a91e27728abcb860", "score": "0.57171935", "text": "function isEnabled() {\n return tracker.currentWidget !== null &&\n tracker.currentWidget === app.shell.currentWidget;\n }", "title": "" }, { "docid": "3052f82b38b6a6d413cfd8e1f4e61ec1", "score": "0.5709361", "text": "static isActive() {\n // eslint-disable-next-line no-underscore-dangle\n return mixpanel && mixpanel.__loaded && mixpanel.get_distinct_id();\n }", "title": "" }, { "docid": "35584fd2200495c821e6d518f2fc705d", "score": "0.56965077", "text": "function isEnabled() {\n return (tracker.currentWidget !== null &&\n tracker.currentWidget === app.shell.currentWidget);\n }", "title": "" }, { "docid": "35584fd2200495c821e6d518f2fc705d", "score": "0.56965077", "text": "function isEnabled() {\n return (tracker.currentWidget !== null &&\n tracker.currentWidget === app.shell.currentWidget);\n }", "title": "" }, { "docid": "35584fd2200495c821e6d518f2fc705d", "score": "0.56965077", "text": "function isEnabled() {\n return (tracker.currentWidget !== null &&\n tracker.currentWidget === app.shell.currentWidget);\n }", "title": "" }, { "docid": "35584fd2200495c821e6d518f2fc705d", "score": "0.56965077", "text": "function isEnabled() {\n return (tracker.currentWidget !== null &&\n tracker.currentWidget === app.shell.currentWidget);\n }", "title": "" }, { "docid": "35584fd2200495c821e6d518f2fc705d", "score": "0.56965077", "text": "function isEnabled() {\n return (tracker.currentWidget !== null &&\n tracker.currentWidget === app.shell.currentWidget);\n }", "title": "" }, { "docid": "5a9aab7fac4d0d8b6b1fa590cd1173ef", "score": "0.5689921", "text": "function checkOnSuspend() {\n doc.getElementById('status').innerHTML = chrome.runtime.onSuspend ? \"onSuspend exists\" : \"onSuspend not found\";\n}", "title": "" }, { "docid": "13eb46ebab4fca6131912ae0c298c78a", "score": "0.56448156", "text": "function setToggleState() {\n chrome.storage.sync.get('isExtensionActive', storage => {\n extensionToggle.checked = !storage.isExtensionActive;\n chrome.storage.sync.set({\n isExtensionActive: !storage.isExtensionActive,\n });\n });\n}", "title": "" }, { "docid": "a5cf26348192938aa04a551162584d80", "score": "0.56333804", "text": "function isAvailable() {\n\t\treturn (url!=null);\n\t}", "title": "" }, { "docid": "4a94e6a025800872dcd4bf948660281f", "score": "0.5625293", "text": "function checkExt(ext) {\n\tfor (var i = 0; i < extensions.length; i++) {\n\t\tif (ext == extensions[i])\n\t\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "ca2f6b21a775589172690ced380ba42d", "score": "0.55910593", "text": "isAvailable() {\n \n }", "title": "" }, { "docid": "ac7aa7158f2d27cdb1e385dea58cf454", "score": "0.557152", "text": "async isSwitchActive() {\n const active = await browser.isAndroid ? 'ON' : '1';\n let text = await this.switch.getText()\n let status = text.includes(active);\n return status\n }", "title": "" }, { "docid": "941de9939111370d0ee00fa08c8d4a81", "score": "0.5564021", "text": "function updateExtensionState(isEnabled) {\n\tif(isEnabled) {\n\t\t//connect to the \"Get_Song_Title_To_File\" app.\n\t\tport = browser.runtime.connectNative(\"Get_Song_Title_To_File\");\n\t\t//Listen for messages from the app.\n\t\tport.onMessage.addListener(getResponceFromApp);\n\t\t//Listen for messages from content script\n\t\tbrowser.runtime.onMessage.addListener(getSong);\n\t\tbrowser.browserAction.setIcon({\n\t\t\tpath : \"icons/iconColor.ico\"\n\t\t});\n\t\tconsole.log(\"Extension is enabled\");\n\t} else {\n\t\tif (port) {\n\t\t\tport.onMessage.removeListener(getResponceFromApp);\n\t\t\tport.disconnect();\n\t\t}\n\t\tbrowser.runtime.onMessage.removeListener(getSong);\n\t\tbrowser.browserAction.setIcon({\n\t\t\tpath : \"icons/iconGray.ico\"\n\t\t});\n\t\tconsole.log(\"Extension is disabled\");\n\t}\n}", "title": "" }, { "docid": "96e40686f63a00f4127171b15ef4e4b3", "score": "0.55600387", "text": "function detectActiveX(classId) {\n\ttry {\n\t\treturn !!(window.ActiveXObject && new ActiveXObject(classId));\n\t}\n\tcatch (e) {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "dc0e35bbffcbb51b7866e1d30878d67b", "score": "0.5555321", "text": "async isActive() {\n if (isCordova()) {\n return new Promise(function (resolve, reject) {\n cordova.exec((res) => {\n resolve(res);\n }, () => {\n reject();\n }, \"alanVoice\", \"isActive\", []);\n });\n }\n else {\n return this.alanBtnInst.isActive();\n }\n }", "title": "" }, { "docid": "dcad0eb6930360865db3bf82744d21f7", "score": "0.55433035", "text": "isActive() {\n return this.customBehavior('is active');\n }", "title": "" }, { "docid": "46ff2d78821b5fc52ca9bcc031edcaed", "score": "0.5514466", "text": "function IsSupportExt(ext){\n var supportExtList = [\".mp3\",\".flac\",\".wav\",\".ogg\",\".aac\",\".webm\"];\n ext = \".\" + ext;\n for (var i = 0; i < supportExtList.length; i++){\n var thisExt = supportExtList[i];\n if (ext == thisExt){\n return true\n }\n }\n return false\n}", "title": "" }, { "docid": "9a5159da68081f849f238f1b27973efd", "score": "0.5505413", "text": "function check_extn(url){\n url=strip_http(url);\n var s=url.split(\"/\");\n url = \"*://\"+s[0]+\"/*\";\n if (url==\"*://chrome-extension:/*\"){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "0b8ebe5ecab6015e5967d84d4e29cbaa", "score": "0.55042815", "text": "function checkActive() {\n var here;\n if (active === undefined) {\n return false;\n }\n \n function playerHere(player) {\n return _.any(here, function (uuid) {\n return player === uuid;\n });\n }\n \n // make sure a challenger hasn't left\n if (active.player1 !== '' && active.player2 !== '') {\n here = main.uuids();\n \n if (!playerHere(active.player1) || !playerHere(active.player2)) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "368c9ab30ab1b77f7fae703d8ec87f05", "score": "0.5499346", "text": "get hasActiveCallTask() {\n if (!this.workerTasks) return false;\n\n return [...this.workerTasks.values()]\n .some(task => {\n return TaskHelper.isCallTask(task)\n && (TaskHelper.isPending(task) || TaskHelper.isLiveCall(task))\n });\n }", "title": "" }, { "docid": "ff981a5e3220a1d7242bbf602e5b6a49", "score": "0.54938567", "text": "static isActive(module, depInQuestion) {\r\n\t\tvar desc = depInQuestion.describeHarmonyExport();\r\n\t\tif(!desc.exportedName) return true;\r\n\t\tvar before = true;\r\n\t\tfor(var i = 0; i < module.dependencies.length; i++) {\r\n\t\t\tvar dep = module.dependencies[i];\r\n\t\t\tif(dep === depInQuestion) {\r\n\t\t\t\tbefore = false;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif(!dep.describeHarmonyExport) continue;\r\n\t\t\tvar d = dep.describeHarmonyExport();\r\n\t\t\tif(!d || !d.exportedName) continue;\r\n\t\t\tif(d.exportedName === desc.exportedName) {\r\n\t\t\t\tif(d.precedence < desc.precedence) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tif(d.precedence === desc.precedence && !before) {\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\treturn true;\r\n\t}", "title": "" }, { "docid": "a969212474c0b60f99241351ea20b8f9", "score": "0.5492527", "text": "isEnabled()\n\t{\n\t\treturn MotionTracker.CONFIG.enabled && game.settings.get(settings.REGISTER_CODE, 'enabled');\n\t}", "title": "" }, { "docid": "d6f9a16a09aa205998cbf25306cf9605", "score": "0.54801655", "text": "isActive() {\n for (let g of this.guesses) {\n if (g.status === \"active\") {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "0f48ede034d5ef9af83ea6f427da8ae7", "score": "0.5475067", "text": "function checkActive() {\n for (var i = $this.breakPoints.length - 1; i >= 0; i--) {\n $this.breakPoints[i].check()\n }\n }", "title": "" }, { "docid": "696918ae618fcfea780f939fc89e5b64", "score": "0.54706335", "text": "function appHasWeeklyNotesPluginLoaded() {\n const { app } = window;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (app.plugins.getPlugin(\"calendar\")) {\n return true;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const periodicNotes = app.plugins.getPlugin(\"periodic-notes\");\n return periodicNotes && periodicNotes.settings?.weekly?.enabled;\n}", "title": "" }, { "docid": "a02fb982e1dd59de15625031687147fa", "score": "0.5454741", "text": "function tabActivated(activeInfo) {\n chrome.tabs.get(activeInfo.tabId, function(tab) {\n checkPTOStatus(tab.url);\n });\n}", "title": "" }, { "docid": "f241e0607ffde51a85c895b62d360b07", "score": "0.5448751", "text": "static isAvailable() {\n if ((0, _util.isNodeSdk)()) {\n return false;\n } else if (BrowserPollConnection.forceAllow_) {\n return true;\n } else {\n // NOTE: In React-Native there's normally no 'document', but if you debug a React-Native app in\n // the Chrome debugger, 'document' is defined, but document.createElement is null (2015/06/08).\n return !BrowserPollConnection.forceDisallow_ && typeof document !== 'undefined' && document.createElement != null && !isChromeExtensionContentScript() && !isWindowsStoreApp();\n }\n }", "title": "" }, { "docid": "9a4ab63c77e3050106eee0e74d62eada", "score": "0.54486716", "text": "function isWistiaActive(){\n\t\t\n\t\treturn(typeof Wistia != \"undefined\");\t\n\t}", "title": "" }, { "docid": "903460ca05789072d28b7d38c6bc0146", "score": "0.5440175", "text": "function checkCurrentPlayPauseStatus(callback) {\n\twithGpmTab(function (tab) {\n\t\tchrome.tabs.executeScript(tab.id, {code: 'checkCurrentPlayPauseStatus();'}, function (result) {\n\t\t\tcallback(result);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "074a3cb6fbcf3381af775019ad1ad908", "score": "0.5438794", "text": "function cnc_check_if_loaded() {\r\n try {\r\n if (typeof qx != 'undefined') {\r\n a = qx.core.Init.getApplication(); // application\r\n if (a) {\r\n cncteam_create();\r\n window.CNCTeam.main.getInstance().initialize();\r\n } else {\r\n window.setTimeout(cnc_check_if_loaded, 1000);\r\n }\r\n } else {\r\n window.setTimeout(cnc_check_if_loaded, 1000);\r\n }\r\n } catch (e) {\r\n if (typeof console != 'undefined') console.log(e);\r\n else if (window.opera) opera.postError(e);\r\n else GM_log(e);\r\n }\r\n }", "title": "" }, { "docid": "fb3c3b064cc26257f6fc0d7aa7e7c3d0", "score": "0.54377186", "text": "function isFroogaloopActive(){\n\t\t\n\t\treturn(typeof Froogaloop != \"undefined\");\n\t}", "title": "" }, { "docid": "3a1cb9ae83fe5ccf42b65cb1129629fe", "score": "0.5432145", "text": "function checkActiveElement() {\r\n\treturn document.activeElement.nodeName == 'INPUT' || document.activeElement.nodeName == 'TEXTAREA' ? true : false;\r\n}", "title": "" }, { "docid": "d756e14ee31cfe8eeafaa0534b021190", "score": "0.54230374", "text": "function isAuthorisedExtension(sExtensionToCheck, aExtensionList){\r\n\t for (i=0;i<aExtensionList.length;i++){\r\n\t if (aExtensionList[i]==sExtensionToCheck) return true;\r\n\t }\r\n\t return false;\r\n}", "title": "" }, { "docid": "16d43319cd44c756d4bd9b667aa92868", "score": "0.53957224", "text": "function cnc_check_if_loaded() {\r\n try {\r\n if (typeof qx != 'undefined') {\r\n a = qx.core.Init.getApplication(); // application\r\n if (a) {\r\n cncopt_create();\r\n } else {\r\n window.setTimeout(cnc_check_if_loaded, 1000);\r\n }\r\n } else {\r\n window.setTimeout(cnc_check_if_loaded, 1000);\r\n }\r\n } catch (e) {\r\n if (typeof console != 'undefined') console.log(e);\r\n else if (window.opera) opera.postError(e);\r\n else GM_log(e);\r\n }\r\n }", "title": "" }, { "docid": "16d43319cd44c756d4bd9b667aa92868", "score": "0.53957224", "text": "function cnc_check_if_loaded() {\r\n try {\r\n if (typeof qx != 'undefined') {\r\n a = qx.core.Init.getApplication(); // application\r\n if (a) {\r\n cncopt_create();\r\n } else {\r\n window.setTimeout(cnc_check_if_loaded, 1000);\r\n }\r\n } else {\r\n window.setTimeout(cnc_check_if_loaded, 1000);\r\n }\r\n } catch (e) {\r\n if (typeof console != 'undefined') console.log(e);\r\n else if (window.opera) opera.postError(e);\r\n else GM_log(e);\r\n }\r\n }", "title": "" }, { "docid": "16d43319cd44c756d4bd9b667aa92868", "score": "0.53957224", "text": "function cnc_check_if_loaded() {\r\n try {\r\n if (typeof qx != 'undefined') {\r\n a = qx.core.Init.getApplication(); // application\r\n if (a) {\r\n cncopt_create();\r\n } else {\r\n window.setTimeout(cnc_check_if_loaded, 1000);\r\n }\r\n } else {\r\n window.setTimeout(cnc_check_if_loaded, 1000);\r\n }\r\n } catch (e) {\r\n if (typeof console != 'undefined') console.log(e);\r\n else if (window.opera) opera.postError(e);\r\n else GM_log(e);\r\n }\r\n }", "title": "" }, { "docid": "a4725a66132295a7dc9fbd9872e7c83f", "score": "0.5395669", "text": "function activate(context) {\n // This line of code will only be executed once when your extension is activated. \n let spotifyStatus = new SpotifyStatus_1.SpotifyStatus();\n let controller = new SpotifyStatusController_1.SpotifyStatusController(spotifyStatus, context.globalState);\n // Add to a list of disposables which are disposed when this extension is deactivated.\n context.subscriptions.push(controller);\n context.subscriptions.push(spotifyStatus);\n context.subscriptions.push(Commands_1.createCommands(spotifyStatus, controller));\n}", "title": "" }, { "docid": "3d1718a7cbf23307ea0d712fb05baf9c", "score": "0.5392616", "text": "function _detectAudioWorklet() {\n // OfflineAudioContext doesn't render the audio to the device hardware, generates it ASAP and outputs to AudioBuffer\n let context = new OfflineAudioContext(1, 1, 44100);\n return Boolean(context.audioWorklet && typeof context.audioWorklet.addModule === 'function');\n}", "title": "" }, { "docid": "000ba0b801eb1a47beb442cf76b17958", "score": "0.5378877", "text": "static canUseNativeForeground() { return true; }", "title": "" }, { "docid": "1aa9b1d3477667a0da5f911bd6794f38", "score": "0.5376076", "text": "function testExtensionApi() {\n try {\n return new Promise(resolve => {\n chrome.tabs.getAllInWindow(null, function() {\n resolve(!chrome.runtime.lastError);\n });\n });\n } catch (e) {\n return false;\n }\n}", "title": "" }, { "docid": "330876fabdef8995ebce63ec8cd52539", "score": "0.53515464", "text": "hasExtension(fileName) {\n return (new RegExp('(' + appConstants.profilePicture.extensions.join('|').replace(/\\./ig, '\\\\.') + ')$')).test(fileName) ||\n (new RegExp('(' + appConstants.profilePicture.extensions.join('|').replace(/\\./ig, '\\\\.') + ')$')).test(fileName.toLowerCase());\n }", "title": "" }, { "docid": "ec75bc023a70f028ec17d62bf69f2f50", "score": "0.5349612", "text": "isOpen() { return this._windowRef != null; }", "title": "" }, { "docid": "ec75bc023a70f028ec17d62bf69f2f50", "score": "0.5349612", "text": "isOpen() { return this._windowRef != null; }", "title": "" }, { "docid": "241e38687c273a0243b7431ef2a59d01", "score": "0.5341904", "text": "function getActiveDomain(){var sentry=getMainCarrier().__SENTRY__;return sentry&&sentry.extensions&&sentry.extensions.domain&&sentry.extensions.domain.active;}", "title": "" }, { "docid": "79651c55de5dafc3c0999a65db7fe602", "score": "0.5329289", "text": "function checkStatus() {\n if (group === 'free_fitness_minsk') {\n return 'active';\n } else {\n return checkText(text) ? 'active' : 'noactive';\n }\n }", "title": "" }, { "docid": "e569ae4ea589c1b9d0d46ba41260452d", "score": "0.532194", "text": "get isFeedbackStreamActive() {\n\t\treturn this._feedbackStreamDocument.get(rh.KEY_FEEDBACK_STREAM_IS_ACTIVE);\n\t}", "title": "" }, { "docid": "9ecab4e13e39b6d1a3ee465901fbd1dc", "score": "0.5320625", "text": "function IsWindowAppearing() { return bind.IsWindowAppearing(); }", "title": "" }, { "docid": "828f9a8165b71d62a47f7f091703e62e", "score": "0.53023803", "text": "isActive() {\n\t\tconst { deleted, collecting } = this;\n\t\treturn !deleted && collecting && collecting.isInProgress();\n\t}", "title": "" }, { "docid": "2b7db3dfca41c2fc6ea6e6ad9a41402c", "score": "0.5302302", "text": "function attendanceActive(){\n if(attendance_active&&((!attendance_timer)||(attendance_timer&&init_time.getHours<attendance_end))){\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "eff0ec038b7e4522be34e3466ef76e46", "score": "0.52995336", "text": "function et_fb_check() {\n \treturn $(\"#et-fb-app\").length > 0;\n\t}", "title": "" }, { "docid": "1d6104faf3c986ce222eb95d0fbe38f9", "score": "0.5296662", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "1d6104faf3c986ce222eb95d0fbe38f9", "score": "0.5296662", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "1d6104faf3c986ce222eb95d0fbe38f9", "score": "0.5296662", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "c96c69da09afc095e229b48d654fae11", "score": "0.5295469", "text": "hasRunning() {\n return new Promise(resolve => {\n this.checkDotEnv().then(res => {\n if (!res) resolve(false)\n this.containersLoading = true\n window.backend.Compose.HasRunning()\n .then(res => {\n resolve(res)\n })\n .catch(error => {\n this.setError(error)\n this.containersLoading = false\n resolve(false)\n })\n })\n });\n }", "title": "" }, { "docid": "86b4437590aa9d7bb5ae26f855d88563", "score": "0.5294419", "text": "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "title": "" }, { "docid": "c674daf1e484c8d8889a0bbcc49135f7", "score": "0.5294013", "text": "function canApplyUpdates() {\n return module.hot.status() === \"idle\";\n }", "title": "" }, { "docid": "bb7ff8af45a5f2d99fdcc5c876181990", "score": "0.5291518", "text": "get hasTabNavigation() {\n return this.popupElement.isExisting(selectors.tab.container);\n }", "title": "" }, { "docid": "f2efc4802b8edeb579bb47c1336cba4c", "score": "0.5265102", "text": "function currentThemeCheck(){\n\t\t\t\tif($(iframeID).contents().find(\"#usu-template-front\").length>0){\n\t\t\t\t\tvar currentTheme = $(iframeID).contents().find(\"#usu-template-front\").attr(\"class\");\n\t\t\t\t\t$(\"#\"+currentTheme).addClass(\"active-fp-theme\");\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\tthemeSupportCheck(currentTheme);\n\t\t\t\t\t}, 1000);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "1a1c5a12d8df8e22130a7f49920f0b6f", "score": "0.5247297", "text": "function checkActive() {\n var activeClassImgs = document.querySelectorAll('.active');\n if (activeClassImgs.length > 0) {\n document.querySelector('.active').classList.remove('active');\n }\n }", "title": "" }, { "docid": "caf77630c48401f7d2c1ace8828f1979", "score": "0.52461404", "text": "function registerAudioContext(ac) {\n\tif (!window.abcjsAudioContext) {\n\t\tif (!ac) {\n\t\t\tac = window.AudioContext ||\n\t\t\t\twindow.webkitAudioContext ||\n\t\t\t\tnavigator.mozAudioContext ||\n\t\t\t\tnavigator.msAudioContext;\n\t\t\tac = new ac();\n\t\t}\n\t\twindow.abcjsAudioContext = ac;\n\t}\n\treturn window.abcjsAudioContext.state !== \"suspended\";\n}", "title": "" }, { "docid": "3aa9ff8bda04548ea37c0eef87fecde6", "score": "0.52318317", "text": "function validate_extension(pkg){\n try {\n // for now, just try to load the key... could check whether file exists?\n pkg['jupyter']['lab']['main']\n return true;\n } catch(err) {\n return false;\n }\n}", "title": "" }, { "docid": "f52da31de63795b569ef114783f4b6ad", "score": "0.5227781", "text": "isRunning() {\n return this.status === constants_1.STATUS_RUNNING;\n }", "title": "" }, { "docid": "d6df61814ff25edf640e0b3236f6ddf7", "score": "0.5212236", "text": "function isCurrent() {\n\t\t\t\t\t\t// retrieve the last activity of the account\n\t\t\t\t\t\tvar lastActivity = localStorage.get(LS_LASTACTIVITY) || '';\n\n\t\t\t\t\t\tif (lastActivity === '') {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (dateDiffInMinutes(new Date(lastActivity), new Date()) < authDefaults.sessionMinutes);\n\t\t\t\t\t}", "title": "" }, { "docid": "c6de88ae86cfe20614d4277e820239bc", "score": "0.52119815", "text": "async function isSupported() {\n if ((0, _util.isBrowserExtension)()) {\n return false;\n }\n\n if (!(0, _util.areCookiesEnabled)()) {\n return false;\n }\n\n if (!(0, _util.isIndexedDBAvailable)()) {\n return false;\n }\n\n try {\n const isDBOpenable = await (0, _util.validateIndexedDBOpenable)();\n return isDBOpenable;\n } catch (error) {\n return false;\n }\n}", "title": "" }, { "docid": "90e44f6e45ff140daba1277eb567b736", "score": "0.5211848", "text": "static get isRunning() {}", "title": "" }, { "docid": "2038491382e84e31e0a2200e4ae22efe", "score": "0.52108043", "text": "function isDevMode() {\n return !('update_url' in chrome.runtime.getManifest());\n }", "title": "" }, { "docid": "c559e84def9022cafcbd310f1a0dbf81", "score": "0.51959926", "text": "get onActive() {}", "title": "" }, { "docid": "09926bd5f8f010ed826501dabc8d5a80", "score": "0.51938146", "text": "function cnc_check_if_loaded() {\r\n\t\ttry {\r\n\t\t\tif (typeof qx != 'undefined') {\r\n\t\t\t\ta = qx.core.Init.getApplication(); // application\r\n\t\t\t\tif (a) {\r\n\t\t\t\t\tsisosnop_create();\r\n\t\t\t\t} else {\r\n\t\t\t\t\twindow.setTimeout(cnc_check_if_loaded, 1000);\r\n }\r\n\t\t\t} else {\r\n\t\t\t\twindow.setTimeout(cnc_check_if_loaded, 1000);\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tif (typeof console != 'undefined') console.log(e);\r\n\t\t\telse if (window.opera) opera.postError(e);\r\n\t\t\telse GM_log(e);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "fe0dce644405f2ed6eb007377ba146f2", "score": "0.51852906", "text": "function activate() {\n \n return true;\n }", "title": "" }, { "docid": "8bcb3dd8f6019e2a43d20d693e6efcc5", "score": "0.51768535", "text": "function check_access_addon(addon_name, output_div, control_element, addon_data) {\n var addon_active = false;\n\n if (addon_data.enabled) {\n addon_active = true;\n };\n if (!addon_data.enabled) {\n $(output_div).style.display = 'block';\n $(output_div).set('html', addon_data.notice)\n // Allow use the addon on trial.\n if (!addon_data.trial) {\n setTimeout(function(){$(control_element).checked = false;}, 50);\n }\n }\n return addon_active;\n}", "title": "" }, { "docid": "9a0f23c4ed0890b0bd470d9dd231c47e", "score": "0.5167663", "text": "static hasActiveAccessibilitySettings(settings) {\n const activeSettings = this.parseShortcomingSettings(settings);\n return activeSettings && activeSettings.length;\n }", "title": "" }, { "docid": "b506f4c144c27b7d4b3fa4baa757cc43", "score": "0.51675063", "text": "checkSupport() {\n if (!(\"Notification\" in window)) {\n console.log(\"This browser does not support desktop notification\");\n }\n }", "title": "" }, { "docid": "2c51ebed8f938043feb7249e41401759", "score": "0.5163187", "text": "static supportsType(url) {\n const extensions = url.split(\".\");\n const extension = extensions[extensions.length - 1];\n const response = document.createElement(\"audio\").canPlayType(\"audio/\" + extension);\n return response !== \"\";\n }", "title": "" }, { "docid": "1c414d7ed31aad64b32511305053b26c", "score": "0.5159443", "text": "function update() {\n\t if (typeof window === \"undefined\") {\n\t return false;\n\t }\n\t var isPassiveEventsSupported = false;\n\t var opts = Object.defineProperty({}, \"passive\", {\n\t get: function () {\n\t isPassiveEventsSupported = true;\n\t },\n\t });\n\t window.addEventListener(\"testSupportsPassive\", noop, opts);\n\t window.removeEventListener(\"testSupportsPassive\", noop, opts);\n\t isSupported = isPassiveEventsSupported;\n\t return isPassiveEventsSupported;\n\t}", "title": "" }, { "docid": "2863ab360a4610f2b0e96ecc8df7b8f3", "score": "0.5155157", "text": "function listenOnActiveTab() {\r\n\tchrome.tabs.query({active:true,currentWindow:true},function(tabs) {\r\n\t\t//get active tab id, null if none\r\n\t\tvar tabId=(tabs[0]?tabs[0].id:null);\r\n\t\t\r\n\t\t//if new active tab is same as currently active tab, then nothing to do\r\n\t\tif(activeTabId==tabId) return;\r\n\t\t\r\n\t\t//send message to previously active tab (if any) to stop observing DOM changes\r\n\t\tif(activeTabId) {\r\n\t\t\tchrome.tabs.sendMessage(activeTabId,{observeDownloads:\"stop\"});\r\n\t\t}\r\n\t\t\t\r\n\t\t//update the new active tab\r\n\t\tactiveTabId=tabId;\r\n\r\n\t\t//send message to new tab to query current download links and to start observing DOM changes\r\n\t\tif(activeTabId) {\r\n\t\t\tchrome.tabs.sendMessage(activeTabId,{observeDownloads:\"start\"});\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "49c23a914378d3a35e089d38cd833e53", "score": "0.51425046", "text": "get isLoaded() {\n return this._audioext.isLoaded;\n }", "title": "" } ]
35249bf7cd7eb7ff3d95308c647372ac
take a series of points and create two bezier spline curves through them from there, connect the specific points between the t points on each curve as sandlines.
[ { "docid": "f512d6ce225d234e89977a8c0939bdd2", "score": "0.0", "text": "constructor(options) {\n // build a new flow field container.\n\n const opts = options || {};\n opts.name = 'curves';\n opts.border = 0.0;\n super(opts);\n }", "title": "" } ]
[ { "docid": "e6de1dc7ff3f4bb49241126b0f8ebae9", "score": "0.66365737", "text": "function drawTBezierCurve(i, points) {\n \n var n = 0;\n var x = 0;\n var y = 0;\n\n cBezierCurves[i].segments(Array(0));\n cBezierCurves[i].moveTo(points[0][1], points[0][2]);\n \n n = points.length - 1;\n \n\n for(t = 1/tEvaluations; t < 1; t += 1/tEvaluations, x = 0, y = 0) {\n for(p = 1; p < points.length; p++){\n for(c = 0; c < points.length - p; c++){\n points[c][1] = (1 - t) * points[c][1] + t * points[c + 1][1];\n points[c][2] = (1 - t) * points[c][2] + t * points[c + 1][2];\n }\n }\n x = points[0][1];\n y = points[0][2];\n\n cBezierCurves[i].lineTo(x, y);\n }\n cBezierCurves[i].moveTo(points[n][1], points[n][2]);\n}", "title": "" }, { "docid": "fb6e1dbf565bf5aa5bc46ff83189be49", "score": "0.65841615", "text": "function bspline()\n{\n\t/*Loop through each spline*/\n\tfor(var i = 0; i < splinePositions.length; i += 1)\n\t{\n\t\t/*loop through each control point in that spline*/\n\t\tfor(var j = 0; j < splinePositions[i].length; j += 1)\n\t\t{\n\t\t\t/*between each control point, loop the proper number of times based on the transition time of the current spline*/\n\t\t\tfor(var t = 0; t < 1 ; t += 1/(splineTransitionTimes[i] * 5))\n\t\t\t{\n\t\t\t\t/*a modulous function that accounts for negative values. used to set the proper points for the spline subsections*/\n\t\t\t\tfunction mod(n, m)\n\t\t\t\t{\n\t\t\t\t\treturn ((m % n) + n) % n;\n\t\t\t\t};\n\t\t\t\t/*set the spline subsection control points to account for*/\n\t\t\t\tvar P0 = splinePositions[i][mod(splinePositions[i].length, j - 1)];\n\t\t\t\tvar P1 = splinePositions[i][j];\n\t\t\t\tvar P2 = splinePositions[i][mod(splinePositions[i].length, j + 1)];\n\t\t\t\tvar P3 = splinePositions[i][mod(splinePositions[i].length, j + 2)];\n\t\t\t\t/*set the time related variables that are used frequently*/\n\t\t\t\tvar t2 = t * t;\n\t\t\t\tvar t3 = t2 * t;\n\n\t\t\t\t/*calculate the x value of the new position for the object*/\n\t\t\t\tvar x = (\n\t\t\t\t\t((1/6 * Math.pow((1 - t),3)) * P0.x) +\n\t\t\t\t\t(((1/2 * t3) - t2 + (2/3)) * P1.x) +\n\t\t\t\t\t(((-1/2 * t3) + (1/2 * t2) + (1/2 * t) + 1/6) * P2.x) +\n\t\t\t\t\t((1/6 * t3) * P3.x)\n\t\t\t\t);\n\t\t\t\t/*calculate the y value of the new position for the object*/\n\t\t\t\tvar y = (\n\t\t\t\t\t((1/6 * Math.pow((1 - t),3)) * P0.y) +\n\t\t\t\t\t(((1/2 * t3) - t2 + (2/3)) * P1.y) +\n\t\t\t\t\t(((-1/2 * t3) + (1/2 * t2) + (1/2 * t) + 1/6) * P2.y) +\n\t\t\t\t\t((1/6 * t3) * P3.y)\n\t\t\t\t);\n\t\t\t\t/*calculate the z value of the new position for the object*/\n\t\t\t\tvar z = (\n\t\t\t\t\t((1/6 * Math.pow((1 - t),3)) * P0.z) +\n\t\t\t\t\t(((1/2 * t3) - t2 + (2/3)) * P1.z) +\n\t\t\t\t\t(((-1/2 * t3) + (1/2 * t2) +\n\t\t\t\t\t(1/2 * t) + 1/6) * P2.z) +\n\t\t\t\t\t((1/6 * t3) * P3.z)\n\t\t\t\t);\n\t\t\t\t/*create a new vector3 to hold the position for the object to interpolate to*/\n\t\t\t\tvar newPos = new THREE.Vector3();\n\t\t\t\tnewPos.setX(x);\n\t\t\t\tnewPos.setY(y);\n\t\t\t\tnewPos.setZ(z);\n\t\t\t\t/*add the position to the global array holding all bspline interpolation points*/\n\t\t\t\tbsplinePoints.push(newPos)\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7fd187ad658fd55c781c2808b24619f9", "score": "0.6557295", "text": "function splineToTentacle(spline){\n //start tentacle\n var t = [spline[0]];\n var prev = 0;\n for (var i = 0; i < spline.length - 1; i++){\n var rth = rT(spline[i], spline[i+1]);\n var next = rth[1];\n rth[1] -= prev;\n if (rth[1] > Math.PI){\n rth[1] -= Math.PI * 2; \n }\n if (rth[1] < - Math.PI){\n rth[1] += Math.PI * 2;\n }\n prev = next;\n t.push(rth);\n }\n \n return t;\n}", "title": "" }, { "docid": "452697e84d77859a39bc95758c025406", "score": "0.65306693", "text": "function createCurveSurface2(pointFinal, points) {\r\n var nubs = [];\r\n \r\n var j = 0;\r\n for(var i=0; i<points.length; i++) {\r\n nubs[j] = createNubs(points[i]);\r\n DRAW(nubs[j]);\r\n j++;\r\n }\r\n nubs.push(pointFinal);\r\n return createBezierS1(nubs);\r\n }", "title": "" }, { "docid": "794ecf16cf3a8e429f568b1989bc5b0d", "score": "0.65113115", "text": "function createCurveSurface(pointStart, pointFinal, points) {\r\n var nubs = [];\r\n nubs.push(pointStart);\r\n var j = 1;\r\n for(var i=0; i<points.length; i++) {\r\n nubs[j] = createNubs(points[i]);\r\n DRAW(nubs[j]);\r\n j++;\r\n }\r\n nubs.push(pointFinal);\r\n\r\n return createBezierS1(nubs);\r\n }", "title": "" }, { "docid": "794ecf16cf3a8e429f568b1989bc5b0d", "score": "0.65113115", "text": "function createCurveSurface(pointStart, pointFinal, points) {\r\n var nubs = [];\r\n nubs.push(pointStart);\r\n var j = 1;\r\n for(var i=0; i<points.length; i++) {\r\n nubs[j] = createNubs(points[i]);\r\n DRAW(nubs[j]);\r\n j++;\r\n }\r\n nubs.push(pointFinal);\r\n\r\n return createBezierS1(nubs);\r\n }", "title": "" }, { "docid": "429b5e004dc4e11f75acc5f518475887", "score": "0.64569205", "text": "function bSpline(gl, p) {\n\n for (var t = 0; t < 1; t += 0.1) {\n\tvar ax = (-p[0].x + 3*p[1].x - 3*p[2].x + p[3].x) / 6;\n\tvar ay = (-p[0].y + 3*p[1].y - 3*p[2].y + p[3].y) / 6;\n\tvar bx = (p[0].x - 2*p[1].x + p[2].x) / 2;\n\tvar by = (p[0].y - 2*p[1].y + p[2].y) / 2;\n\tvar cx = (-p[0].x +p[2].x) / 2;\n\tvar cy = (-p[0].y +p[2].y) / 2;\n\tvar dx = (p[0].x + 4*p[1].x + p[2].x) / 6;\n\tvar dy = (p[0].y + 4*p[1].y + p[2].y) / 6;\n\n\tax*Math.pow(t, 3) + bx*Math.pow(t, 2) + cx*t + dx;\n\tay*Math.pow(t, 3) + by*Math.pow(t, 2) + cy*t + dy;\n\tax*Math.pow(t+0.1, 3) + bx*Math.pow(t+0.1, 2) + cx*(t+0.1) + dx;\n\tay*Math.pow(t+0.1, 3) + by*Math.pow(t+0.1, 2) + cy*(t+0.1) + dy;\n }\n\n // desenhar os pontos\n}", "title": "" }, { "docid": "ff838ba9ee92ad3e95d54077ef2725cb", "score": "0.64434564", "text": "function SplineInterpolator(points) {\n var n = points.length;\n this.xa = [];\n this.ya = [];\n this.u = [];\n this.y2 = [];\n\n points.sort(function(a, b) {\n return a[0] - b[0];\n });\n for (var i = 0; i < n; i++) {\n this.xa.push(points[i][0]);\n this.ya.push(points[i][1]);\n }\n\n this.u[0] = 0;\n this.y2[0] = 0;\n\n for (var i = 1; i < n - 1; ++i) {\n // This is the decomposition loop of the tridiagonal algorithm. \n // y2 and u are used for temporary storage of the decomposed factors.\n var wx = this.xa[i + 1] - this.xa[i - 1];\n var sig = (this.xa[i] - this.xa[i - 1]) / wx;\n var p = sig * this.y2[i - 1] + 2.0;\n\n this.y2[i] = (sig - 1.0) / p;\n\n var ddydx = \n (this.ya[i + 1] - this.ya[i]) / (this.xa[i + 1] - this.xa[i]) - \n (this.ya[i] - this.ya[i - 1]) / (this.xa[i] - this.xa[i - 1]);\n\n this.u[i] = (6.0 * ddydx / wx - sig * this.u[i - 1]) / p;\n }\n\n this.y2[n - 1] = 0;\n\n // This is the backsubstitution loop of the tridiagonal algorithm\n for (var i = n - 2; i >= 0; --i) {\n this.y2[i] = this.y2[i] * this.y2[i + 1] + this.u[i];\n }\n}", "title": "" }, { "docid": "e9d80b574463ea8bb703ecf7725dea4b", "score": "0.64055884", "text": "function funBSpline(pts) {\n // Let us declare all vars here to shorten the code.\n var i;\n var g,Tt,dTt,v,T,N;\n var t,ifirst,npts = this.n = pts.length/4;\n var nsteps = (npts-3)*300; // internal points (actually +1 because we go to t=1.0)\n var b = []; // the internal storage\n var B = [0,0,1,0]; // \"arbitrary binormal at beginning\"\n //this.n=npts;\n\n for (i=0;i<nsteps+1;i++){\n t = i/nsteps; // scale t to [0,1] within curve\n if (i<nsteps) {\n ifirst = t*(npts-3) | 0; // 1st point is... (funny \"|0\" makes a floor())\n t = t*(npts-3) - ifirst; // reset t to [0,1] within segm.\n } else {\n ifirst = npts-4;\n t = 1;\n }\n\n g = pts.slice(ifirst*4,ifirst*4+16); // pick cps to G.\n Tt = [1, t, t*t, t*t*t];\n dTt = [0, 1, 2*t, 3*t*t];\n v = matmul4(matmul4(g, bspB),Tt);\n T = nmld(matmul4(matmul4(g, bspB),dTt));\n N = nmld(cross(B,T));\n B = nmld(cross(T,N));\n b.push([].concat(N, // \"normal\"/orientation\n B, // binormal\n T, // tangent\n v)); // pos.\n }\n\n // as of now, we don't care to interpolate:\n this.c = function(t){\n return b[0 | t*(nsteps)];\n }\n }", "title": "" }, { "docid": "da74c068d4686b9ff4e9726b9a9276de", "score": "0.6369231", "text": "function Spline( points ) {\n\n\t \tthis.points = points;\n\n\t \tvar c = [], v3 = { x: 0, y: 0, z: 0 },\n\t \tpoint, intPoint, weight, w2, w3,\n\t \tpa, pb, pc, pd;\n\n\t \tthis.initFromArray = function ( a ) {\n\n\t \t\tthis.points = [];\n\n\t \t\tfor ( var i = 0; i < a.length; i ++ ) {\n\n\t \t\t\tthis.points[ i ] = { x: a[ i ][ 0 ], y: a[ i ][ 1 ], z: a[ i ][ 2 ] };\n\n\t \t\t}\n\n\t \t};\n\n\t \tthis.getPoint = function ( k ) {\n\n\t \t\tpoint = ( this.points.length - 1 ) * k;\n\t \t\tintPoint = Math.floor( point );\n\t \t\tweight = point - intPoint;\n\n\t \t\tc[ 0 ] = intPoint === 0 ? intPoint : intPoint - 1;\n\t \t\tc[ 1 ] = intPoint;\n\t \t\tc[ 2 ] = intPoint > this.points.length - 2 ? this.points.length - 1 : intPoint + 1;\n\t \t\tc[ 3 ] = intPoint > this.points.length - 3 ? this.points.length - 1 : intPoint + 2;\n\n\t \t\tpa = this.points[ c[ 0 ] ];\n\t \t\tpb = this.points[ c[ 1 ] ];\n\t \t\tpc = this.points[ c[ 2 ] ];\n\t \t\tpd = this.points[ c[ 3 ] ];\n\n\t \t\tw2 = weight * weight;\n\t \t\tw3 = weight * w2;\n\n\t \t\tv3.x = interpolate( pa.x, pb.x, pc.x, pd.x, weight, w2, w3 );\n\t \t\tv3.y = interpolate( pa.y, pb.y, pc.y, pd.y, weight, w2, w3 );\n\t \t\tv3.z = interpolate( pa.z, pb.z, pc.z, pd.z, weight, w2, w3 );\n\n\t \t\treturn v3;\n\n\t \t};\n\n\t \tthis.getControlPointsArray = function () {\n\n\t \t\tvar i, p, l = this.points.length,\n\t \t\t\tcoords = [];\n\n\t \t\tfor ( i = 0; i < l; i ++ ) {\n\n\t \t\t\tp = this.points[ i ];\n\t \t\t\tcoords[ i ] = [ p.x, p.y, p.z ];\n\n\t \t\t}\n\n\t \t\treturn coords;\n\n\t \t};\n\n\t \t// approximate length by summing linear segments\n\n\t \tthis.getLength = function ( nSubDivisions ) {\n\n\t \t\tvar i, index, nSamples, position,\n\t \t\t\tpoint = 0, intPoint = 0, oldIntPoint = 0,\n\t \t\t\toldPosition = new Vector3(),\n\t \t\t\ttmpVec = new Vector3(),\n\t \t\t\tchunkLengths = [],\n\t \t\t\ttotalLength = 0;\n\n\t \t\t// first point has 0 length\n\n\t \t\tchunkLengths[ 0 ] = 0;\n\n\t \t\tif ( ! nSubDivisions ) nSubDivisions = 100;\n\n\t \t\tnSamples = this.points.length * nSubDivisions;\n\n\t \t\toldPosition.copy( this.points[ 0 ] );\n\n\t \t\tfor ( i = 1; i < nSamples; i ++ ) {\n\n\t \t\t\tindex = i / nSamples;\n\n\t \t\t\tposition = this.getPoint( index );\n\t \t\t\ttmpVec.copy( position );\n\n\t \t\t\ttotalLength += tmpVec.distanceTo( oldPosition );\n\n\t \t\t\toldPosition.copy( position );\n\n\t \t\t\tpoint = ( this.points.length - 1 ) * index;\n\t \t\t\tintPoint = Math.floor( point );\n\n\t \t\t\tif ( intPoint !== oldIntPoint ) {\n\n\t \t\t\t\tchunkLengths[ intPoint ] = totalLength;\n\t \t\t\t\toldIntPoint = intPoint;\n\n\t \t\t\t}\n\n\t \t\t}\n\n\t \t\t// last point ends with total length\n\n\t \t\tchunkLengths[ chunkLengths.length ] = totalLength;\n\n\t \t\treturn { chunks: chunkLengths, total: totalLength };\n\n\t \t};\n\n\t \tthis.reparametrizeByArcLength = function ( samplingCoef ) {\n\n\t \t\tvar i, j,\n\t \t\t\tindex, indexCurrent, indexNext,\n\t \t\t\trealDistance,\n\t \t\t\tsampling, position,\n\t \t\t\tnewpoints = [],\n\t \t\t\ttmpVec = new Vector3(),\n\t \t\t\tsl = this.getLength();\n\n\t \t\tnewpoints.push( tmpVec.copy( this.points[ 0 ] ).clone() );\n\n\t \t\tfor ( i = 1; i < this.points.length; i ++ ) {\n\n\t \t\t\t//tmpVec.copy( this.points[ i - 1 ] );\n\t \t\t\t//linearDistance = tmpVec.distanceTo( this.points[ i ] );\n\n\t \t\t\trealDistance = sl.chunks[ i ] - sl.chunks[ i - 1 ];\n\n\t \t\t\tsampling = Math.ceil( samplingCoef * realDistance / sl.total );\n\n\t \t\t\tindexCurrent = ( i - 1 ) / ( this.points.length - 1 );\n\t \t\t\tindexNext = i / ( this.points.length - 1 );\n\n\t \t\t\tfor ( j = 1; j < sampling - 1; j ++ ) {\n\n\t \t\t\t\tindex = indexCurrent + j * ( 1 / sampling ) * ( indexNext - indexCurrent );\n\n\t \t\t\t\tposition = this.getPoint( index );\n\t \t\t\t\tnewpoints.push( tmpVec.copy( position ).clone() );\n\n\t \t\t\t}\n\n\t \t\t\tnewpoints.push( tmpVec.copy( this.points[ i ] ).clone() );\n\n\t \t\t}\n\n\t \t\tthis.points = newpoints;\n\n\t \t};\n\n\t \t// Catmull-Rom\n\n\t \tfunction interpolate( p0, p1, p2, p3, t, t2, t3 ) {\n\n\t \t\tvar v0 = ( p2 - p0 ) * 0.5,\n\t \t\t\tv1 = ( p3 - p1 ) * 0.5;\n\n\t \t\treturn ( 2 * ( p1 - p2 ) + v0 + v1 ) * t3 + ( - 3 * ( p1 - p2 ) - 2 * v0 - v1 ) * t2 + v0 * t + p1;\n\n\t \t}\n\n\t }", "title": "" }, { "docid": "cfb7769f1ab8c5d31d7caa7e2e3ca515", "score": "0.6345528", "text": "function drawTCurve(){\n generateCBezierCurve();\n var count = 0;\n var controlPoints = [];\n var aux = paths[1].segments();\n\n console.log(paths[0].segments());\n console.log(paths[1].segments());\n for (q = 0; q < 1.001; q += 1/sb) {\n \n var tpoints = [];\n \n for (i = 0; i < countPoints/2; i++){\n \n controlPoints[0] = paths[0].segments()[i];\n controlPoints[1] = paths[1].segments()[i];\n\n for(var pt = 1; pt < controlPoints.length; pt++) {\n \n for(var ct = 0; ct < controlPoints.length - pt; ct++) {\n //calculating the new points\n controlPoints[ct][1] = (1 - q) * controlPoints[ct][1] + q * controlPoints[ct + 1][1];\n controlPoints[ct][2] = (1 - q) * controlPoints[ct][2] + q * controlPoints[ct + 1][2];\n \n }\n }\n\n tpoints.push(controlPoints[0]);\n }\n drawTBezierCurve(count, tpoints);\n count++;\n }\n}", "title": "" }, { "docid": "568a7c0260c7904f6a1667e9526373fe", "score": "0.6191631", "text": "function getCubicSpline(points, limited) {\n\t if (points.length < 2) {\n\t return points.slice(0);\n\t }\n\t if (points.length === 2) {\n\t return [points[0], {\n\t x: interpolate(points[0].x, points[1].x, 1 / 3),\n\t y: interpolate(points[0].y, points[1].y, 1 / 3)\n\t }, {\n\t x: interpolate(points[0].x, points[1].x, 2 / 3),\n\t y: interpolate(points[0].y, points[1].y, 2 / 3)\n\t }, points[1]];\n\t }\n\n\t var curve = new Array((points.length - 1) * 3 + 1);\n\t var c0, p1, c3, c1x, c1y, c2x, c2y, qx, qy, qt, tan, dx1, dx2, kl;\n\t for (var i = 0; i < points.length; i++) {\n\t curve[i * 3] = points[i];\n\t if (i > 0) {\n\t curve[i * 3 - 2] = (0, _bezier.getBezierPoint)(1 / 3, points[i - 1], points[i]);\n\t curve[i * 3 - 1] = (0, _bezier.getBezierPoint)(2 / 3, points[i - 1], points[i]);\n\t }\n\t }\n\t var result = curve.slice(0);\n\t for (var j = 0, last; j < 3; j++) {\n\t for (i = 6; i < result.length; i += 3) {\n\t c0 = result[i - 5];\n\t p1 = result[i - 3];\n\t c3 = result[i - 1];\n\t if ((p1.x - c0.x) * (c3.x - p1.x) * 1e12 < 1) {\n\t c1x = interpolate(c0.x, p1.x, 0.5);\n\t c2x = interpolate(p1.x, c3.x, 0.5);\n\t c1y = interpolate(c0.y, p1.y, 0.5);\n\t c2y = interpolate(p1.y, c3.y, 0.5);\n\t } else {\n\t qt = (p1.x - c0.x) / (c3.x - c0.x);\n\t qx = (p1.x - c0.x * (1 - qt) * (1 - qt) - c3.x * qt * qt) / (2 * (1 - qt) * qt);\n\t qy = (p1.y - c0.y * (1 - qt) * (1 - qt) - c3.y * qt * qt) / (2 * (1 - qt) * qt);\n\t c1x = interpolate(c0.x, qx, qt);\n\t c2x = interpolate(qx, c3.x, qt);\n\t c1y = interpolate(c0.y, qy, qt);\n\t c2y = interpolate(qy, c3.y, qt);\n\n\t if (limited) {\n\t dx1 = p1.x - c1x;\n\t dx2 = c2x - p1.x;\n\t tan = (c2y - p1.y) / dx2;\n\t if ((p1.y - c0.y) * (c3.y - p1.y) <= 0) {\n\t tan = 0;\n\t } else {\n\t if (p1.y > c0.y === c2y > c3.y) {\n\t kl = (c3.y - p1.y) / (c2y - p1.y);\n\t dx2 = interpolate(dx2 * kl, dx2, 1 / (1 + Math.abs(kl)));\n\t tan = (c3.y - p1.y) / dx2;\n\t }\n\t if (p1.y > c0.y === c1y < c0.y) {\n\t kl = (p1.y - c0.y) / (p1.y - c1y);\n\t dx1 = interpolate(dx1 * kl, dx1, 1 / (1 + Math.abs(kl)));\n\t tan = (p1.y - c0.y) / dx1;\n\t }\n\t }\n\t c1x = p1.x - dx1;\n\t c2x = p1.x + dx2;\n\t c1y = p1.y - tan * dx1;\n\t c2y = p1.y + tan * dx2;\n\t }\n\t }\n\t curve[i - 4] = { x: c1x, y: c1y };\n\t curve[i - 2] = { x: c2x, y: c2y };\n\t }\n\t curve[1] = {\n\t x: interpolate(curve[0].x, curve[3].x, 1 / 3),\n\t y: interpolate(curve[0].y, interpolate(curve[3].y, curve[2].y, 3 / 2), 2 / 3)\n\t };\n\t last = curve.length - 1;\n\t curve[last - 1] = {\n\t x: interpolate(curve[last].x, curve[last - 3].x, 1 / 3),\n\t y: interpolate(curve[last].y, interpolate(curve[last - 3].y, curve[last - 2].y, 3 / 2), 2 / 3)\n\t };\n\t result = curve.slice(0);\n\t }\n\n\t return result;\n\t}", "title": "" }, { "docid": "2d2bbd286a39fbebb2c82dfda7991f07", "score": "0.6191037", "text": "function funBSplineTransformed(pts,tfm) {\n // Let us declare all vars here to shorten the code.\n var i;\n var g,Tt,dTt,v,T,N;\n var t,ifirst,npts = this.n = pts.length/4;\n var nsteps = (npts-3)*300; // internal points (actually +1 because we go to t=1.0)\n var b = []; // the internal storage\n var B = [0,0,1,0]; // \"arbitrary binormal at beginning\"\n //this.n=npts;\n pts = matmul4(tfm,pts); // transform!\n\n\n for (i=0;i<nsteps+1;i++){\n t = i/nsteps; // scale t to [0,1] within curve\n if (i<nsteps) {\n ifirst = t*(npts-3) | 0; // 1st point is... (funny \"|0\" makes a floor())\n t = t*(npts-3) - ifirst; // reset t to [0,1] within segm.\n } else {\n ifirst = npts-4;\n t = 1;\n }\n\n g = pts.slice(ifirst*4,ifirst*4+16); // pick cps to G.\n Tt = [1, t, t*t, t*t*t];\n dTt = [0, 1, 2*t, 3*t*t];\n v = matmul4(matmul4(g, bspB),Tt);\n T = nmld(matmul4(matmul4(g, bspB),dTt));\n N = nmld(cross(B,T));\n B = nmld(cross(T,N));\n b.push([].concat(N, // \"normal\"/orientation\n B, // binormal\n T, // tangent\n v)); // pos.\n }\n\n // as of now, we don't care to interpolate:\n this.c = function(t){\n return b[0 | t*(nsteps)];\n }\n }", "title": "" }, { "docid": "b9cba9d3ae3135ef514e490f6d024766", "score": "0.6149084", "text": "function BezierEasing(points){this._p=points;this._mSampleValues=float32ArraySupported?new Float32Array(kSplineTableSize):new Array(kSplineTableSize);this._precomputed=false;this.get=this.get.bind(this);}", "title": "" }, { "docid": "111beb4dd9eaac816eea610a761f536d", "score": "0.6134512", "text": "getSegments() {\n const { knots, points, degree } = this;\n const result = [];\n const v = ts3dutils.Vector.pack(points, new Float64Array(points.length * 4));\n const vectorFromV = (i) => new ts3dutils.Vector(v.slice(i * 4, (i + 1) * 4));\n let k = degree + 1; // k = knot index we are duplicating\n while (k < knots.length - degree - 1) {\n const t = knots[k];\n const prevKnot = knots[k - 1];\n let s = 1; // s = multiplicity of the knot\n while (knots[k + 1] == t) {\n k++;\n s++;\n }\n const newNURBSPoints = new Array(degree + 1);\n // the first s + 1 points are identical to the current curve\n for (let i = 0; i < s + 1; i++) {\n newNURBSPoints[i] = vectorFromV(k - degree - s + i);\n }\n // we need to have multiplicity degree, so insert (degree - s) times\n for (let level = 1; level <= degree - s; level++) {\n for (let i = k - degree; i <= k - s - level; i++) {\n const alpha = (t - prevKnot) / (knots[i + degree + 1] - prevKnot);\n for (let dim = 0; dim < 4; dim++) {\n v[i * 4 + dim] = (1 - alpha) * v[i * 4 + dim] + alpha * v[(i + 1) * 4 + dim];\n }\n }\n newNURBSPoints[s + level] = vectorFromV(k - degree);\n }\n const newNURBSKnots = ts3dutils.arrayFromFunction((degree + 1) * 2, i => (i < degree + 1 ? knots[k - s] : t));\n result.push(new NURBS$$1(newNURBSPoints, degree, newNURBSKnots));\n k++;\n }\n // last curve\n const newNURBSPoints = ts3dutils.arrayFromFunction(degree + 1, i => vectorFromV(points.length - degree - 1 + i));\n const newNURBSKnots = ts3dutils.arrayFromFunction((degree + 1) * 2, i => (i < degree + 1 ? knots[k - 1] : knots[k]));\n result.push(new NURBS$$1(newNURBSPoints, degree, newNURBSKnots));\n return result;\n }", "title": "" }, { "docid": "33f545b574462e3782488629be7d0871", "score": "0.61253476", "text": "function drawBeziers(p, mousePositions) {\n // Draw some vectors\n\n // Get every 7th point in the array\n let everyOther = mousePositions.filter((element, index) => {\n return (mousePositions.length - index) % 7 === 0;\n })\n\n // Take the last N positions\n let count = 2\n let pts = everyOther.slice(everyOther.length - count)\n\n // Now we have 5 points, sampled every 7th point, starting at the end\n // So we can draw \"backward\" from the end\n\n if (pts.length > 0) {\n //p.stroke(0)\n p.fill(Math.random()*255, .25)\n\n p.beginShape()\n p.vertex(...pts[0])\n\n // Draw each segment of a bezier curve \n // (start at index=1!)\n for (var i = 1; i < pts.length; i++) {\n // For this segment, we draw between 2 pts\n let pt0 = pts[i - 1]\n let pt1 = pts[i]\n let d = vector.getSub(pt1, pt0)\n let mag = vector.magnitude(d)\n let n = [-d[1], d[0]]\n\n let cp0 = pt0.slice(0)\n let cp1 = pt1.slice(0)\n cp0[1] -= mag\n cp1[1] -= mag\n\n // vector.addTo(cp1, n)\n \n\n\n p.bezierVertex(...cp0, ...cp1, ...pt1)\n }\n\n p.endShape()\n }\n}", "title": "" }, { "docid": "30c7949897fd81404b1ee02f15779e24", "score": "0.60949886", "text": "function getCubicInterpolator(pointsFrom, pointsTo) {\n\n\t for (var i = 2; i < pointsFrom.length - 1; i += 3) {\n\t pointsFrom[i - 1].isCubicControl = true;\n\t pointsFrom[i].isCubicControl = true;\n\t }\n\t for (i = 2; i < pointsTo.length - 1; i += 3) {\n\t pointsTo[i - 1].isCubicControl = true;\n\t pointsTo[i].isCubicControl = true;\n\t }\n\n\t // Replace interpolated points sequence with straight segment\n\t // TODO: Continue unfinished transition of ending points.\n\t pointsFrom = pointsFrom.filter(function (d) {\n\t return !d.isInterpolated;\n\t });\n\t var d, p;\n\t for (i = pointsFrom.length - 2; i >= 0; i--) {\n\t p = pointsFrom[i + 1];\n\t d = pointsFrom[i];\n\t if (!d.isCubicControl && !p.isCubicControl) {\n\t pointsFrom.splice(i + 1, 0, (0, _bezier.getBezierPoint)(1 / 3, p, d), (0, _bezier.getBezierPoint)(2 / 3, p, d));\n\t pointsFrom[i + 1].isCubicControl = true;\n\t pointsFrom[i + 2].isCubicControl = true;\n\t }\n\t }\n\n\t // NOTE: Suppose data is already sorted by X.\n\t // var anchorsFrom = pointsFrom.filter(d => !d.isCubicControl);\n\t // var anchorsTo = pointsTo.filter(d => !d.isCubicControl);\n\t var anchorsFrom = pointsFrom.filter(function (d, i) {\n\t return i % 3 === 0;\n\t });\n\t var anchorsTo = pointsTo.filter(function (d, i) {\n\t return i % 3 === 0;\n\t });\n\t var idsFrom = anchorsFrom.map(function (d) {\n\t return d.id;\n\t });\n\t var idsTo = anchorsTo.map(function (d) {\n\t return d.id;\n\t });\n\t var indicesFrom = idsFrom.reduce(function (memo, id) {\n\t return memo[id] = pointsFrom.findIndex(function (d) {\n\t return d.id === id;\n\t }), memo;\n\t }, {});\n\t var indicesTo = idsTo.reduce(function (memo, id) {\n\t return memo[id] = pointsTo.findIndex(function (d) {\n\t return d.id === id;\n\t }), memo;\n\t }, {});\n\t var remainingIds = idsFrom.filter(function (id) {\n\t return idsTo.indexOf(id) >= 0;\n\t });\n\n\t //\n\t // Determine start and end scales difference to apply\n\t // to initial target position of newly added points\n\t // (or end position of deleted points)\n\n\t var stableFrom = anchorsFrom.filter(function (d) {\n\t return !d.positionIsBeingChanged;\n\t });\n\t var stableTo = anchorsTo.filter(function (d) {\n\t return !d.positionIsBeingChanged;\n\t });\n\t var toEndScale = getScaleDiffFn(stableFrom, stableTo);\n\t var toStartScale = getScaleDiffFn(stableTo, stableFrom);\n\n\t var interpolators = [];\n\t remainingIds.forEach(function (id, i) {\n\n\t var indexFrom = indicesFrom[id];\n\t var indexTo = indicesTo[id];\n\n\t if (i === 0 && (indexFrom > 0 || indexTo > 0)) {\n\t interpolators.push(getEndingInterpolator({\n\t polylineFrom: pointsFrom.slice(0, indexFrom + 1),\n\t polylineTo: pointsTo.slice(0, indexTo + 1),\n\t toOppositeScale: indexTo === 0 ? toEndScale : toStartScale,\n\t isCubic: true\n\t }));\n\t }\n\n\t if (i > 0) {\n\t var prevIndexFrom = indicesFrom[remainingIds[i - 1]];\n\t var prevIndexTo = indicesTo[remainingIds[i - 1]];\n\t if (indexFrom - prevIndexFrom > 3 || indexTo - prevIndexTo > 3) {\n\t interpolators.push(getInnerInterpolator({\n\t polylineFrom: pointsFrom.slice(prevIndexFrom, indexFrom + 1),\n\t polylineTo: pointsTo.slice(prevIndexTo, indexTo + 1),\n\t isCubic: true\n\t }));\n\t } else {\n\t interpolators.push(getControlsBetweenRemainingInterpolator({\n\t polylineFrom: pointsFrom.slice(prevIndexFrom, indexFrom + 1),\n\t polylineTo: pointsTo.slice(prevIndexTo, indexTo + 1)\n\t }));\n\t }\n\t }\n\n\t interpolators.push(getRemainingPointInterpolator({\n\t pointFrom: pointsFrom[indexFrom],\n\t pointTo: pointsTo[indexTo]\n\t }));\n\n\t if (i === remainingIds.length - 1 && (pointsFrom.length - indexFrom - 1 > 0 || pointsTo.length - indexTo - 1 > 0)) {\n\t interpolators.push(getEndingInterpolator({\n\t polylineFrom: pointsFrom.slice(indexFrom),\n\t polylineTo: pointsTo.slice(indexTo),\n\t toOppositeScale: pointsTo.length - indexTo === 1 ? toEndScale : toStartScale,\n\t isCubic: true\n\t }));\n\t }\n\t });\n\n\t if (interpolators.length === 0 && (pointsTo.length > 0 && remainingIds.length === 0 || pointsFrom.length > 0 && remainingIds.length === 0)) {\n\t interpolators.push(getNonRemainingPathInterpolator({\n\t polylineFrom: pointsFrom.slice(0),\n\t polylineTo: pointsTo.slice(0),\n\t isCubic: true\n\t }));\n\t }\n\n\t return function (t) {\n\t var intermediate = [];\n\t interpolators.forEach(function (ipl) {\n\t var points = ipl(t);\n\t push(intermediate, points);\n\t });\n\t return intermediate;\n\t };\n\t}", "title": "" }, { "docid": "2db8bd55d48b1d55b2739058b7e3ad9b", "score": "0.6033024", "text": "CubicBezierToLines(control_points, smoothing)\n\t{\n\t\t//console.log(control_points);\n\t\tvar points = control_points.map(function(vec){\n return new THREE.Vector2(vec[0], vec[1]);\n });\n\t\tvar interpolatedPoints = [];\n\t\tvar curve = new THREE.SplineCurve(points);\n interpolatedPoints = curve.getPoints( Math.round( control_points.length * smoothing ) );\n\n\t\tvar points = interpolatedPoints.map(function(vec){\n return vec.C;\n });\n\t\treturn interpolatedPoints;\n\t}", "title": "" }, { "docid": "0210c0dcfb8a511614baf2275c6c4422", "score": "0.6027996", "text": "function generateSpline(p1, cp1f, cp2f, p2, maxSegmentLength) {\n\tconst points = [];\n\tconst numSegments = 20; // findDistance(p1, p2) / 6; // This is an approximation; ideally we'd use maxSegmentLength instead\n\tconst dx = p2.x - p1.x;\n\tconst dy = p2.y - p1.y;\n\n\tconst cp1 = {x: p1.x + dx * cp1f.x, y: p1.y + dy * cp1f.y};\n\tconst cp2 = {x: p1.x + dx * cp2f.x, y: p1.y + dy * cp2f.y};\n\n\tfor (let i = 1; i < numSegments; i++) {\n\t\tconst f = i / numSegments;\n\t\tpoints.push(getPointOnBezier(p1, cp1, cp2, p2, f));\n\t}\n\n\treturn points;\n}", "title": "" }, { "docid": "468a29e2803fd112c269b6a72ab333d0", "score": "0.60174197", "text": "function Spline(points){this.points=points;var c=[],v3={x:0,y:0,z:0},point,intPoint,weight,w2,w3,pa,pb,pc,pd;this.initFromArray=function(a){this.points=[];for(var i=0;i<a.length;i++){this.points[i]={x:a[i][0],y:a[i][1],z:a[i][2]};}};this.getPoint=function(k){point=(this.points.length-1)*k;intPoint=Math.floor(point);weight=point-intPoint;c[0]=intPoint===0?intPoint:intPoint-1;c[1]=intPoint;c[2]=intPoint>this.points.length-2?this.points.length-1:intPoint+1;c[3]=intPoint>this.points.length-3?this.points.length-1:intPoint+2;pa=this.points[c[0]];pb=this.points[c[1]];pc=this.points[c[2]];pd=this.points[c[3]];w2=weight*weight;w3=weight*w2;v3.x=interpolate(pa.x,pb.x,pc.x,pd.x,weight,w2,w3);v3.y=interpolate(pa.y,pb.y,pc.y,pd.y,weight,w2,w3);v3.z=interpolate(pa.z,pb.z,pc.z,pd.z,weight,w2,w3);return v3;};this.getControlPointsArray=function(){var i,p,l=this.points.length,coords=[];for(i=0;i<l;i++){p=this.points[i];coords[i]=[p.x,p.y,p.z];}return coords;};// approximate length by summing linear segments\n\tthis.getLength=function(nSubDivisions){var i,index,nSamples,position,point=0,intPoint=0,oldIntPoint=0,oldPosition=new Vector3(),tmpVec=new Vector3(),chunkLengths=[],totalLength=0;// first point has 0 length\n\tchunkLengths[0]=0;if(!nSubDivisions)nSubDivisions=100;nSamples=this.points.length*nSubDivisions;oldPosition.copy(this.points[0]);for(i=1;i<nSamples;i++){index=i/nSamples;position=this.getPoint(index);tmpVec.copy(position);totalLength+=tmpVec.distanceTo(oldPosition);oldPosition.copy(position);point=(this.points.length-1)*index;intPoint=Math.floor(point);if(intPoint!==oldIntPoint){chunkLengths[intPoint]=totalLength;oldIntPoint=intPoint;}}// last point ends with total length\n\tchunkLengths[chunkLengths.length]=totalLength;return{chunks:chunkLengths,total:totalLength};};this.reparametrizeByArcLength=function(samplingCoef){var i,j,index,indexCurrent,indexNext,realDistance,sampling,position,newpoints=[],tmpVec=new Vector3(),sl=this.getLength();newpoints.push(tmpVec.copy(this.points[0]).clone());for(i=1;i<this.points.length;i++){//tmpVec.copy( this.points[ i - 1 ] );\n\t//linearDistance = tmpVec.distanceTo( this.points[ i ] );\n\trealDistance=sl.chunks[i]-sl.chunks[i-1];sampling=Math.ceil(samplingCoef*realDistance/sl.total);indexCurrent=(i-1)/(this.points.length-1);indexNext=i/(this.points.length-1);for(j=1;j<sampling-1;j++){index=indexCurrent+j*(1/sampling)*(indexNext-indexCurrent);position=this.getPoint(index);newpoints.push(tmpVec.copy(position).clone());}newpoints.push(tmpVec.copy(this.points[i]).clone());}this.points=newpoints;};// Catmull-Rom\n\tfunction interpolate(p0,p1,p2,p3,t,t2,t3){var v0=(p2-p0)*0.5,v1=(p3-p1)*0.5;return(2*(p1-p2)+v0+v1)*t3+(-3*(p1-p2)-2*v0-v1)*t2+v0*t+p1;}}", "title": "" }, { "docid": "19823c044761d8acbd65cdd141fa12e8", "score": "0.60005456", "text": "function curveThroughPoints(points) {\n\t\n\t var controlPoints = getCurveControlPoints(points);\n\t var path = ['M', points[0].x, points[0].y];\n\t\n\t for (var i = 0; i < controlPoints[0].length; i += 1) {\n\t path.push('C', controlPoints[0][i].x, controlPoints[0][i].y, controlPoints[1][i].x, controlPoints[1][i].y, points[i + 1].x, points[i + 1].y);\n\t }\n\t return path;\n\t} // import * as utils from '../common/utils';", "title": "" }, { "docid": "1a0bb20d02bdfa116072d5caa4fc946a", "score": "0.59947455", "text": "function BSpline(degree, ctrlPoints, closed) {\n Curve.call(this, ctrlPoints, closed);\n this.degree = degree;\n\n if (this.closed) {\n this.ctrlPoints.push(ctrlPoints[0]);\n this.ctrlPoints.push(ctrlPoints[1]);\n }\n\n this.knots = [];\n for (var i = 0; i <= this.degree + this.ctrlPoints.length; i++) {\n if (i < this.degree + 1)\n this.knots.push(0);\n else if (i < this.ctrlPoints.length - 1)\n this.knots.push(i/(this.ctrlPoints.length + this.degree));\n else\n this.knots.push(1);\n }\n\n if (this.closed) {\n for (var i = 0; i < 2 * this.degree + 4; i++)\n this.knots.push(this.knots[i]);\n }\n}", "title": "" }, { "docid": "dd8f179404c6d0d4617fbc58ba4b9e62", "score": "0.5990842", "text": "static CreateHermiteSpline(p1, t1, p2, t2, nbPoints) {\n const hermite = new Array();\n const step = 1.0 / nbPoints;\n for (let i = 0; i <= nbPoints; i++) {\n hermite.push(_1.Vector3.Hermite(p1, t1, p2, t2, i * step));\n }\n return new Curve3(hermite);\n }", "title": "" }, { "docid": "1b73f9ccc43ac3f0949eda4fba9e2b54", "score": "0.5983652", "text": "function generateBezier(mX1,mY1,mX2,mY2){var NEWTON_ITERATIONS=4,NEWTON_MIN_SLOPE=0.001,SUBDIVISION_PRECISION=0.0000001,SUBDIVISION_MAX_ITERATIONS=10,kSplineTableSize=11,kSampleStepSize=1.0 / (kSplineTableSize - 1.0),float32ArraySupported=(\"Float32Array\" in window); /* Must contain four arguments. */if(arguments.length !== 4){return false;} /* Arguments must be numbers. */for(var i=0;i < 4;++i) {if(typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])){return false;}} /* X values must be in the [0, 1] range. */mX1 = Math.min(mX1,1);mX2 = Math.min(mX2,1);mX1 = Math.max(mX1,0);mX2 = Math.max(mX2,0);var mSampleValues=float32ArraySupported?new Float32Array(kSplineTableSize):new Array(kSplineTableSize);function A(aA1,aA2){return 1.0 - 3.0 * aA2 + 3.0 * aA1;}function B(aA1,aA2){return 3.0 * aA2 - 6.0 * aA1;}function C(aA1){return 3.0 * aA1;}function calcBezier(aT,aA1,aA2){return ((A(aA1,aA2) * aT + B(aA1,aA2)) * aT + C(aA1)) * aT;}function getSlope(aT,aA1,aA2){return 3.0 * A(aA1,aA2) * aT * aT + 2.0 * B(aA1,aA2) * aT + C(aA1);}function newtonRaphsonIterate(aX,aGuessT){for(var i=0;i < NEWTON_ITERATIONS;++i) {var currentSlope=getSlope(aGuessT,mX1,mX2);if(currentSlope === 0.0)return aGuessT;var currentX=calcBezier(aGuessT,mX1,mX2) - aX;aGuessT -= currentX / currentSlope;}return aGuessT;}function calcSampleValues(){for(var i=0;i < kSplineTableSize;++i) {mSampleValues[i] = calcBezier(i * kSampleStepSize,mX1,mX2);}}function binarySubdivide(aX,aA,aB){var currentX,currentT,i=0;do {currentT = aA + (aB - aA) / 2.0;currentX = calcBezier(currentT,mX1,mX2) - aX;if(currentX > 0.0){aB = currentT;}else {aA = currentT;}}while(Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);return currentT;}function getTForX(aX){var intervalStart=0.0,currentSample=1,lastSample=kSplineTableSize - 1;for(;currentSample != lastSample && mSampleValues[currentSample] <= aX;++currentSample) {intervalStart += kSampleStepSize;}--currentSample;var dist=(aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),guessForT=intervalStart + dist * kSampleStepSize,initialSlope=getSlope(guessForT,mX1,mX2);if(initialSlope >= NEWTON_MIN_SLOPE){return newtonRaphsonIterate(aX,guessForT);}else if(initialSlope == 0.0){return guessForT;}else {return binarySubdivide(aX,intervalStart,intervalStart + kSampleStepSize);}}var _precomputed=false;function precompute(){_precomputed = true;if(mX1 != mY1 || mX2 != mY2)calcSampleValues();}var f=function f(aX){if(!_precomputed)precompute();if(mX1 === mY1 && mX2 === mY2)return aX;if(aX === 0)return 0;if(aX === 1)return 1;return calcBezier(getTForX(aX),mY1,mY2);};f.getControlPoints = function(){return [{x:mX1,y:mY1},{x:mX2,y:mY2}];};var str=\"generateBezier(\" + [mX1,mY1,mX2,mY2] + \")\";f.toString = function(){return str;};return f;}", "title": "" }, { "docid": "3dd33bc1570b711a0744396ff6f5047b", "score": "0.5971999", "text": "function BezierEasing (points) {\r\n this._p = points;\r\n this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\r\n this._precomputed = false;\r\n\r\n this.get = this.get.bind(this);\r\n }", "title": "" }, { "docid": "5f3f4e24219697e0c3939a82f71d6cc6", "score": "0.59653217", "text": "function GetCurve(points) {\n var tension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5;\n var closedPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var frames = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 16;\n var numOfSegments = Math.round(frames * .3295);\n var isPairs = Array.isArray(points[0]);\n var res = [];\n var pts = points.slice(0);\n var pts2 = pts.slice(0);\n var x;\n var y;\n var t1x;\n var t2x;\n var t1y;\n var t2y;\n var c1;\n var c2;\n var c3;\n var c4;\n var st;\n var t;\n var i;\n\n if (isPairs) {\n pts = pts.concat.apply([], pts);\n } else {\n pts = pts.concat.apply([], pts.map(function (p) {\n return [p, p];\n }));\n }\n\n pts2 = pts.slice(0);\n\n if (closedPath) {\n pts.unshift(pts2[pts2.length - 1]);\n pts.unshift(pts2[pts2.length - 2]);\n pts.unshift(pts2[pts2.length - 1]);\n pts.unshift(pts2[pts2.length - 2]);\n pts.push(pts2[0]);\n pts.push(pts2[1]);\n } else {\n pts.unshift(pts2[1]);\n pts.unshift(pts2[0]);\n pts.push(pts[pts2.length - 2]);\n pts.push(pts[pts2.length - 1]);\n }\n\n for (i = 2; i < pts.length - 4; i += 2) {\n for (t = 0; t <= numOfSegments; t++) {\n // calc tension vectors\n t1x = (pts[i + 2] - pts[i - 2]) * tension;\n t2x = (pts[i + 4] - pts[i]) * tension;\n t1y = (pts[i + 3] - pts[i - 1]) * tension;\n t2y = (pts[i + 5] - pts[i + 1]) * tension; // calc step\n\n st = t / numOfSegments; // calc cardinals\n\n c1 = 2 * Math.pow(st, 3) - 3 * Math.pow(st, 2) + 1;\n c2 = -(2 * Math.pow(st, 3)) + 3 * Math.pow(st, 2);\n c3 = Math.pow(st, 3) - 2 * Math.pow(st, 2) + st;\n c4 = Math.pow(st, 3) - Math.pow(st, 2); // calc x and y cords with common control vectors\n\n x = c1 * pts[i] + c2 * pts[i + 2] + c3 * t1x + c4 * t2x;\n y = c1 * pts[i + 1] + c2 * pts[i + 3] + c3 * t1y + c4 * t2y;\n res.push([x, y]);\n }\n }\n\n return isPairs ? res : res.map(function (p) {\n return p[0];\n });\n}", "title": "" }, { "docid": "ed73f77c45832a10b1802045aa04eaa7", "score": "0.59261763", "text": "function generateBezier(mX1,mY1,mX2,mY2){var NEWTON_ITERATIONS=4,NEWTON_MIN_SLOPE=0.001,SUBDIVISION_PRECISION=0.0000001,SUBDIVISION_MAX_ITERATIONS=10,kSplineTableSize=11,kSampleStepSize=1.0/(kSplineTableSize-1.0),float32ArraySupported=\"Float32Array\" in window; /* Must contain four arguments. */if(arguments.length!==4){return false;} /* Arguments must be numbers. */for(var i=0;i<4;++i){if(typeof arguments[i]!==\"number\"||isNaN(arguments[i])||!isFinite(arguments[i])){return false;}} /* X values must be in the [0, 1] range. */mX1=Math.min(mX1,1);mX2=Math.min(mX2,1);mX1=Math.max(mX1,0);mX2=Math.max(mX2,0);var mSampleValues=float32ArraySupported?new Float32Array(kSplineTableSize):new Array(kSplineTableSize);function A(aA1,aA2){return 1.0-3.0*aA2+3.0*aA1;}function B(aA1,aA2){return 3.0*aA2-6.0*aA1;}function C(aA1){return 3.0*aA1;}function calcBezier(aT,aA1,aA2){return ((A(aA1,aA2)*aT+B(aA1,aA2))*aT+C(aA1))*aT;}function getSlope(aT,aA1,aA2){return 3.0*A(aA1,aA2)*aT*aT+2.0*B(aA1,aA2)*aT+C(aA1);}function newtonRaphsonIterate(aX,aGuessT){for(var i=0;i<NEWTON_ITERATIONS;++i){var currentSlope=getSlope(aGuessT,mX1,mX2);if(currentSlope===0.0)return aGuessT;var currentX=calcBezier(aGuessT,mX1,mX2)-aX;aGuessT-=currentX/currentSlope;}return aGuessT;}function calcSampleValues(){for(var i=0;i<kSplineTableSize;++i){mSampleValues[i]=calcBezier(i*kSampleStepSize,mX1,mX2);}}function binarySubdivide(aX,aA,aB){var currentX,currentT,i=0;do {currentT=aA+(aB-aA)/2.0;currentX=calcBezier(currentT,mX1,mX2)-aX;if(currentX>0.0){aB=currentT;}else {aA=currentT;}}while(Math.abs(currentX)>SUBDIVISION_PRECISION&&++i<SUBDIVISION_MAX_ITERATIONS);return currentT;}function getTForX(aX){var intervalStart=0.0,currentSample=1,lastSample=kSplineTableSize-1;for(;currentSample!=lastSample&&mSampleValues[currentSample]<=aX;++currentSample){intervalStart+=kSampleStepSize;}--currentSample;var dist=(aX-mSampleValues[currentSample])/(mSampleValues[currentSample+1]-mSampleValues[currentSample]),guessForT=intervalStart+dist*kSampleStepSize,initialSlope=getSlope(guessForT,mX1,mX2);if(initialSlope>=NEWTON_MIN_SLOPE){return newtonRaphsonIterate(aX,guessForT);}else if(initialSlope==0.0){return guessForT;}else {return binarySubdivide(aX,intervalStart,intervalStart+kSampleStepSize);}}var _precomputed=false;function precompute(){_precomputed=true;if(mX1!=mY1||mX2!=mY2)calcSampleValues();}var f=function f(aX){if(!_precomputed)precompute();if(mX1===mY1&&mX2===mY2)return aX;if(aX===0)return 0;if(aX===1)return 1;return calcBezier(getTForX(aX),mY1,mY2);};f.getControlPoints=function(){return [{x:mX1,y:mY1},{x:mX2,y:mY2}];};var str=\"generateBezier(\"+[mX1,mY1,mX2,mY2]+\")\";f.toString=function(){return str;};return f;}", "title": "" }, { "docid": "b41bd03fbc124c72aa02e60a6104157c", "score": "0.5924403", "text": "function generateBezier(mX1,mY1,mX2,mY2){var NEWTON_ITERATIONS=4,NEWTON_MIN_SLOPE=0.001,SUBDIVISION_PRECISION=0.0000001,SUBDIVISION_MAX_ITERATIONS=10,kSplineTableSize=11,kSampleStepSize=1.0/(kSplineTableSize-1.0),float32ArraySupported=\"Float32Array\"in window;/* Must contain four arguments. */if(arguments.length!==4){return false;}/* Arguments must be numbers. */for(var i=0;i<4;++i){if(typeof arguments[i]!==\"number\"||isNaN(arguments[i])||!isFinite(arguments[i])){return false;}}/* X values must be in the [0, 1] range. */mX1=Math.min(mX1,1);mX2=Math.min(mX2,1);mX1=Math.max(mX1,0);mX2=Math.max(mX2,0);var mSampleValues=float32ArraySupported?new Float32Array(kSplineTableSize):new Array(kSplineTableSize);function A(aA1,aA2){return 1.0-3.0*aA2+3.0*aA1;}function B(aA1,aA2){return 3.0*aA2-6.0*aA1;}function C(aA1){return 3.0*aA1;}function calcBezier(aT,aA1,aA2){return((A(aA1,aA2)*aT+B(aA1,aA2))*aT+C(aA1))*aT;}function getSlope(aT,aA1,aA2){return 3.0*A(aA1,aA2)*aT*aT+2.0*B(aA1,aA2)*aT+C(aA1);}function newtonRaphsonIterate(aX,aGuessT){for(var i=0;i<NEWTON_ITERATIONS;++i){var currentSlope=getSlope(aGuessT,mX1,mX2);if(currentSlope===0.0)return aGuessT;var currentX=calcBezier(aGuessT,mX1,mX2)-aX;aGuessT-=currentX/currentSlope;}return aGuessT;}function calcSampleValues(){for(var i=0;i<kSplineTableSize;++i){mSampleValues[i]=calcBezier(i*kSampleStepSize,mX1,mX2);}}function binarySubdivide(aX,aA,aB){var currentX,currentT,i=0;do{currentT=aA+(aB-aA)/2.0;currentX=calcBezier(currentT,mX1,mX2)-aX;if(currentX>0.0){aB=currentT;}else{aA=currentT;}}while(Math.abs(currentX)>SUBDIVISION_PRECISION&&++i<SUBDIVISION_MAX_ITERATIONS);return currentT;}function getTForX(aX){var intervalStart=0.0,currentSample=1,lastSample=kSplineTableSize-1;for(;currentSample!=lastSample&&mSampleValues[currentSample]<=aX;++currentSample){intervalStart+=kSampleStepSize;}--currentSample;var dist=(aX-mSampleValues[currentSample])/(mSampleValues[currentSample+1]-mSampleValues[currentSample]),guessForT=intervalStart+dist*kSampleStepSize,initialSlope=getSlope(guessForT,mX1,mX2);if(initialSlope>=NEWTON_MIN_SLOPE){return newtonRaphsonIterate(aX,guessForT);}else if(initialSlope==0.0){return guessForT;}else{return binarySubdivide(aX,intervalStart,intervalStart+kSampleStepSize);}}var _precomputed=false;function precompute(){_precomputed=true;if(mX1!=mY1||mX2!=mY2)calcSampleValues();}var f=function f(aX){if(!_precomputed)precompute();if(mX1===mY1&&mX2===mY2)return aX;if(aX===0)return 0;if(aX===1)return 1;return calcBezier(getTForX(aX),mY1,mY2);};f.getControlPoints=function(){return[{x:mX1,y:mY1},{x:mX2,y:mY2}];};var str=\"generateBezier(\"+[mX1,mY1,mX2,mY2]+\")\";f.toString=function(){return str;};return f;}", "title": "" }, { "docid": "8c4b1114fc6df6bd6ef380b772e43403", "score": "0.5913967", "text": "function generateBezier(mX1,mY1,mX2,mY2){var NEWTON_ITERATIONS=4,NEWTON_MIN_SLOPE=.001,SUBDIVISION_PRECISION=1e-7,SUBDIVISION_MAX_ITERATIONS=10,kSplineTableSize=11,kSampleStepSize=1/(kSplineTableSize-1),float32ArraySupported=\"Float32Array\"in window;/* Must contain four arguments. */\nif(arguments.length!==4){return false}/* Arguments must be numbers. */\nfor(var i=0;i<4;++i){if(typeof arguments[i]!==\"number\"||isNaN(arguments[i])||!isFinite(arguments[i])){return false}}/* X values must be in the [0, 1] range. */\nmX1=Math.min(mX1,1);mX2=Math.min(mX2,1);mX1=Math.max(mX1,0);mX2=Math.max(mX2,0);var mSampleValues=float32ArraySupported?new Float32Array(kSplineTableSize):new Array(kSplineTableSize);function A(aA1,aA2){return 1-3*aA2+3*aA1}function B(aA1,aA2){return 3*aA2-6*aA1}function C(aA1){return 3*aA1}function calcBezier(aT,aA1,aA2){return((A(aA1,aA2)*aT+B(aA1,aA2))*aT+C(aA1))*aT}function getSlope(aT,aA1,aA2){return 3*A(aA1,aA2)*aT*aT+2*B(aA1,aA2)*aT+C(aA1)}function newtonRaphsonIterate(aX,aGuessT){for(var i=0;i<NEWTON_ITERATIONS;++i){var currentSlope=getSlope(aGuessT,mX1,mX2);if(currentSlope===0){return aGuessT}var currentX=calcBezier(aGuessT,mX1,mX2)-aX;aGuessT-=currentX/currentSlope}return aGuessT}function calcSampleValues(){for(var i=0;i<kSplineTableSize;++i){mSampleValues[i]=calcBezier(i*kSampleStepSize,mX1,mX2)}}function binarySubdivide(aX,aA,aB){var currentX,currentT,i=0;do{currentT=aA+(aB-aA)/2;currentX=calcBezier(currentT,mX1,mX2)-aX;if(currentX>0){aB=currentT}else{aA=currentT}}while(Math.abs(currentX)>SUBDIVISION_PRECISION&&++i<SUBDIVISION_MAX_ITERATIONS);return currentT}function getTForX(aX){var intervalStart=0,currentSample=1,lastSample=kSplineTableSize-1;for(;currentSample!==lastSample&&mSampleValues[currentSample]<=aX;++currentSample){intervalStart+=kSampleStepSize}--currentSample;var dist=(aX-mSampleValues[currentSample])/(mSampleValues[currentSample+1]-mSampleValues[currentSample]),guessForT=intervalStart+dist*kSampleStepSize,initialSlope=getSlope(guessForT,mX1,mX2);if(initialSlope>=NEWTON_MIN_SLOPE){return newtonRaphsonIterate(aX,guessForT)}else if(initialSlope===0){return guessForT}else{return binarySubdivide(aX,intervalStart,intervalStart+kSampleStepSize)}}var _precomputed=false;function precompute(){_precomputed=true;if(mX1!==mY1||mX2!==mY2){calcSampleValues()}}var f=function(aX){if(!_precomputed){precompute()}if(mX1===mY1&&mX2===mY2){return aX}if(aX===0){return 0}if(aX===1){return 1}return calcBezier(getTForX(aX),mY1,mY2)};f.getControlPoints=function(){return[{x:mX1,y:mY1},{x:mX2,y:mY2}]};var str=\"generateBezier(\"+[mX1,mY1,mX2,mY2]+\")\";f.toString=function(){return str};return f}", "title": "" }, { "docid": "9b8faee15abb65d25d3231e5783c296e", "score": "0.5896155", "text": "function getCurveControlPoints(knots) {\n\n var firstControlPoints = [];\n var secondControlPoints = [];\n var n = knots.length - 1;\n var i;\n\n // Special case: Bezier curve should be a straight line.\n if (n == 1) {\n // 3P1 = 2P0 + P3\n firstControlPoints[0] = new Point(\n (2 * knots[0].x + knots[1].x) / 3,\n (2 * knots[0].y + knots[1].y) / 3\n );\n\n // P2 = 2P1 – P0\n secondControlPoints[0] = new Point(\n 2 * firstControlPoints[0].x - knots[0].x,\n 2 * firstControlPoints[0].y - knots[0].y\n );\n\n return [firstControlPoints, secondControlPoints];\n }\n\n // Calculate first Bezier control points.\n // Right hand side vector.\n var rhs = [];\n\n // Set right hand side X values.\n for (i = 1; i < n - 1; i++) {\n rhs[i] = 4 * knots[i].x + 2 * knots[i + 1].x;\n }\n\n rhs[0] = knots[0].x + 2 * knots[1].x;\n rhs[n - 1] = (8 * knots[n - 1].x + knots[n].x) / 2.0;\n\n // Get first control points X-values.\n var x = getFirstControlPoints(rhs);\n\n // Set right hand side Y values.\n for (i = 1; i < n - 1; ++i) {\n rhs[i] = 4 * knots[i].y + 2 * knots[i + 1].y;\n }\n\n rhs[0] = knots[0].y + 2 * knots[1].y;\n rhs[n - 1] = (8 * knots[n - 1].y + knots[n].y) / 2.0;\n\n // Get first control points Y-values.\n var y = getFirstControlPoints(rhs);\n\n // Fill output arrays.\n for (i = 0; i < n; i++) {\n // First control point.\n firstControlPoints.push(new Point(x[i], y[i]));\n\n // Second control point.\n if (i < n - 1) {\n secondControlPoints.push(new Point(\n 2 * knots [i + 1].x - x[i + 1],\n 2 * knots[i + 1].y - y[i + 1]\n ));\n\n } else {\n secondControlPoints.push(new Point(\n (knots[n].x + x[n - 1]) / 2,\n (knots[n].y + y[n - 1]) / 2\n ));\n }\n }\n\n return [firstControlPoints, secondControlPoints];\n }", "title": "" }, { "docid": "ccc709a566c2eb74863f261e5942951d", "score": "0.58959323", "text": "function funBezierCurve(pts) {\n // Let us declare all vars here to shorten the code.\n var i;\n var g,Tt,dTt,v,T,N;\n var t,ifirst,npts = pts.length/4;\n this.n = pts.length*4; // Fidelity hint for surface eval\n var nsteps = ((npts-1)/3)*10; // internal points (actually +1 because we go to t=1.0)\n var b = []; // the internal storage\n var B = [0,0,1,0]; // \"arbitrary binormal at beginning\"\n //this.n=npts;\n\n for (i=0;i<nsteps+1;i++){\n t = i/nsteps; // scale t to [0,1] within curve\n if (i<nsteps) {\n ifirst = (t*((npts-1)/3) | 0)*3; // 1st point is... (funny \"|0\" makes a floor())\n t = t*((npts-1)/3) - (ifirst/3); // reset t to [0,1] within segm.\n } else {\n ifirst = npts-4;\n t = 1;\n }\n\n g = pts.slice(ifirst*4,ifirst*4+16); // pick cps to G.\n Tt = [1, t, t*t, t*t*t];\n dTt = [0, 1, 2*t, 3*t*t];\n //v = matmul4(matmul4(g, bezB),Tt);\n v = homogenized(matmul4(matmul4(g, bezB),Tt));\n T = nmld(matmul4(matmul4(g, bezB),dTt));\n N = nmld(cross(B,T));\n B = nmld(cross(T,N));\n b.push([].concat(N, // \"normal\"/orientation\n B, // binormal\n T, // tangent\n v)); // pos.\n //console.log(\"ja tuota \" + npts + \" \" + ifirst + \" \" + t);\n }\n\n // as of now, we don't care to interpolate:\n this.c = function(t){\n return b[0 | t*(nsteps)];\n }\n }", "title": "" }, { "docid": "3c54cb1c3d159d7656a0b63b6c38ed4a", "score": "0.58436805", "text": "function drawBezierCurve() {\n \"use strict\";\n\n var x;\n var y;\n var t;\n var i;\n var j;\n\n //assign new variables to equal the original\n var oldX;\n var oldY;\n\n //get resolution\n t = 1 / nSteps;\n\n var tIncrement = t;\n\n for (j = 0; j < totalPoints; j += 3) {\n oldX = points[j][0];\n oldY = points[j][1];\n\n t = 1 / nSteps;\n\n for (i = 0; i < nSteps; i += 1) {\n\n //input variables into quadratic equation\n x = Math.pow((1 - t), 2) * points[j][0] + 2 * (1 - t) * t * points[j + 1][0] + Math.pow(t, 2) * points[j + 2][0];\n y = Math.pow((1 - t), 2) * points[j][1] + 2 * (1 - t) * t * points[j + 1][1] + Math.pow(t, 2) * points[j + 2][1];\n\n drawLine(oldX, oldY, x, y, \"black\", lineWidth);\n drawLine(oldX, oldY, x, y, \"white\", 5);\n\n //increment resolution so the the equation is updated to draw the next line\n t += tIncrement;\n\n //update original variables with new ones so it moves to the end of the previously drawn line\n oldX = x;\n oldY = y;\n }\n }\n\n drawLine(shapeCoords[0][0], shapeCoords[0][1], shapeCoords[1][0], shapeCoords[1][1], \"red\", 10.0);\n drawLine(shapeCoords[1][0], shapeCoords[1][1], shapeCoords[2][0], shapeCoords[2][1], \"red\", 10.0);\n drawLine(shapeCoords[2][0], shapeCoords[2][1], shapeCoords[3][0], shapeCoords[3][1], \"red\", 10.0);\n drawLine(shapeCoords[3][0], shapeCoords[3][1], shapeCoords[4][0], shapeCoords[4][1], \"red\", 10.0);\n drawLine(shapeCoords[5][0], shapeCoords[5][1], shapeCoords[6][0], shapeCoords[6][1], \"blue\", 10.0); //upper left tyre\n drawLine(shapeCoords[6][0], shapeCoords[6][1], shapeCoords[7][0], shapeCoords[7][1], \"blue\", 10.0);\n drawLine(shapeCoords[7][0], shapeCoords[7][1], shapeCoords[8][0], shapeCoords[8][1], \"blue\", 10.0);\n drawLine(shapeCoords[9][0], shapeCoords[9][1], shapeCoords[10][0], shapeCoords[10][1], \"blue\", 10.0); //upper right tyre\n drawLine(shapeCoords[10][0], shapeCoords[10][1], shapeCoords[11][0], shapeCoords[11][1], \"blue\", 10.0);\n drawLine(shapeCoords[11][0], shapeCoords[11][1], shapeCoords[12][0], shapeCoords[12][1], \"blue\", 10.0);\n drawLine(shapeCoords[13][0], shapeCoords[13][1], shapeCoords[14][0], shapeCoords[14][1], \"blue\", 10.0); //lower left tyre\n drawLine(shapeCoords[14][0], shapeCoords[14][1], shapeCoords[15][0], shapeCoords[15][1], \"blue\", 10.0);\n drawLine(shapeCoords[15][0], shapeCoords[15][1], shapeCoords[16][0], shapeCoords[16][1], \"blue\", 10.0);\n drawLine(shapeCoords[17][0], shapeCoords[17][1], shapeCoords[18][0], shapeCoords[18][1], \"blue\", 10.0); //lower right tyre\n drawLine(shapeCoords[18][0], shapeCoords[18][1], shapeCoords[19][0], shapeCoords[19][1], \"blue\", 10.0);\n drawLine(shapeCoords[19][0], shapeCoords[19][1], shapeCoords[20][0], shapeCoords[20][1], \"blue\", 10.0);\n drawLine(shapeCoords[21][0], shapeCoords[21][1], shapeCoords[22][0], shapeCoords[22][1], \"red\", 10.0); //car roof\n drawLine(shapeCoords[22][0], shapeCoords[22][1], shapeCoords[23][0], shapeCoords[23][1], \"red\", 10.0);\n drawLine(shapeCoords[23][0], shapeCoords[23][1], shapeCoords[24][0], shapeCoords[24][1], \"red\", 10.0);\n drawLine(shapeCoords[24][0], shapeCoords[24][1], shapeCoords[25][0], shapeCoords[25][1], \"red\", 10.0);\n\n drawLine(shapeCoords2[0][0], shapeCoords2[0][1], shapeCoords2[1][0], shapeCoords2[1][1], \"red\", 10.0);\n drawLine(shapeCoords2[1][0], shapeCoords2[1][1], shapeCoords2[2][0], shapeCoords2[2][1], \"red\", 10.0);\n drawLine(shapeCoords2[2][0], shapeCoords2[2][1], shapeCoords2[3][0], shapeCoords2[3][1], \"red\", 10.0);\n drawLine(shapeCoords2[3][0], shapeCoords2[3][1], shapeCoords2[4][0], shapeCoords2[4][1], \"red\", 10.0);\n drawLine(shapeCoords2[5][0], shapeCoords2[5][1], shapeCoords2[6][0], shapeCoords2[6][1], \"blue\", 10.0); //upper left tyre\n drawLine(shapeCoords2[6][0], shapeCoords2[6][1], shapeCoords2[7][0], shapeCoords2[7][1], \"blue\", 10.0);\n drawLine(shapeCoords2[7][0], shapeCoords2[7][1], shapeCoords2[8][0], shapeCoords2[8][1], \"blue\", 10.0);\n drawLine(shapeCoords2[9][0], shapeCoords2[9][1], shapeCoords2[10][0], shapeCoords2[10][1], \"blue\", 10.0); //upper right tyre\n drawLine(shapeCoords2[10][0], shapeCoords2[10][1], shapeCoords2[11][0], shapeCoords2[11][1], \"blue\", 10.0);\n drawLine(shapeCoords2[11][0], shapeCoords2[11][1], shapeCoords2[12][0], shapeCoords2[12][1], \"blue\", 10.0);\n drawLine(shapeCoords2[13][0], shapeCoords2[13][1], shapeCoords2[14][0], shapeCoords2[14][1], \"blue\", 10.0); //lower left tyre\n drawLine(shapeCoords2[14][0], shapeCoords2[14][1], shapeCoords2[15][0], shapeCoords2[15][1], \"blue\", 10.0);\n drawLine(shapeCoords2[15][0], shapeCoords2[15][1], shapeCoords2[16][0], shapeCoords2[16][1], \"blue\", 10.0);\n drawLine(shapeCoords2[17][0], shapeCoords2[17][1], shapeCoords2[18][0], shapeCoords2[18][1], \"blue\", 10.0); //lower right tyre\n drawLine(shapeCoords2[18][0], shapeCoords2[18][1], shapeCoords2[19][0], shapeCoords2[19][1], \"blue\", 10.0);\n drawLine(shapeCoords2[19][0], shapeCoords2[19][1], shapeCoords2[20][0], shapeCoords2[20][1], \"blue\", 10.0);\n drawLine(shapeCoords2[21][0], shapeCoords2[21][1], shapeCoords2[22][0], shapeCoords2[22][1], \"red\", 10.0); //car roof\n drawLine(shapeCoords2[22][0], shapeCoords2[22][1], shapeCoords2[23][0], shapeCoords2[23][1], \"red\", 10.0);\n drawLine(shapeCoords2[23][0], shapeCoords2[23][1], shapeCoords2[24][0], shapeCoords2[24][1], \"red\", 10.0);\n drawLine(shapeCoords2[24][0], shapeCoords2[24][1], shapeCoords2[25][0], shapeCoords2[25][1], \"red\", 10.0);\n}", "title": "" }, { "docid": "2fff6a05f3ba3c7da2fcfe7ccf97ca70", "score": "0.58288914", "text": "function createBezierS2 (curves, color) {\r\n var b1 = BEZIER(S2)(curves);\r\n var b1Map = MAP(b1)(domain3);\r\n return DRAW(COLOR(color)(b1Map));\r\n}", "title": "" }, { "docid": "2fff6a05f3ba3c7da2fcfe7ccf97ca70", "score": "0.58288914", "text": "function createBezierS2 (curves, color) {\r\n var b1 = BEZIER(S2)(curves);\r\n var b1Map = MAP(b1)(domain3);\r\n return DRAW(COLOR(color)(b1Map));\r\n}", "title": "" }, { "docid": "5942ac514608f113ace045753dbe7f18", "score": "0.5810432", "text": "function createBezierS1(curves) {\r\n var b1 = BEZIER(S1)(curves);\r\n //var b1Map = MAP(b1)(domain2);\r\n //DRAW(b1Map)\r\n return b1;\r\n}", "title": "" }, { "docid": "5942ac514608f113ace045753dbe7f18", "score": "0.5810432", "text": "function createBezierS1(curves) {\r\n var b1 = BEZIER(S1)(curves);\r\n //var b1Map = MAP(b1)(domain2);\r\n //DRAW(b1Map)\r\n return b1;\r\n}", "title": "" }, { "docid": "8ab60b144cc13f4c38b27c9bd9424a46", "score": "0.58042973", "text": "function animateSpline() {\n console.log('spline1: ' + line.position.x, line.position.y, line.position.z)\n\n line.position.x += Math.random() * 10\n line.position.y += Math.random() * 10\n line.position.z += Math.random() * 10\n\n console.log('spline2: ' + line.position.x, line.position.y, line.position.z)\n\n}", "title": "" }, { "docid": "b6106c774bf6cab7064344a75e0d32bd", "score": "0.57890135", "text": "function drawBezierCurve(a, b) {\n // List of points on the line, starting at the center of a\n const points = [a.center.x, a.center.y];\n // Number of segments in which to draw the curve\n const NUM_SEGMENTS = 100;\n // The four points defining a cubic Bezier curve\n const p1 = a.center;\n const p2 = a.pOut;\n const p3 = b.pIn;\n const p4 = b.center;\n \n for (let i = 1; i < 100; i++) {\n // The [0,1] value describing where on the curve we are\n t = i / NUM_SEGMENTS;\n // The formulas defining a cubic bezier curve\n x = (1.0-t)*(1.0-t)*(1.0-t)*p1.x + 3*t*(1.0-t)*(1.0-t)*p2.x + 3*t*t*(1.0-t)*p3.x + t*t*t*p4.x;\n y = (1.0-t)*(1.0-t)*(1.0-t)*p1.y + 3*t*(1.0-t)*(1.0-t)*p2.y + 3*t*t*(1.0-t)*p3.y + t*t*t*p4.y;\n points.push(x, y);\n }\n // Add the center of b as the end point\n points.push(p4.x, p4.y);\n const iPoints = points.map(x => parseInt(x));\n // Pick a color alternating red, green, blue\n let color = [0.2, 0.2, 0.2, 1.0];\n color[bezierPoints.indexOf(a) % 3] = 1.0\n drawLine(iPoints, color);\n}", "title": "" }, { "docid": "ab2b5a1180607ea92d34ffc4fb9a1c3b", "score": "0.5780711", "text": "function smoothPlotter(e) {\n var ctx = e.drawingContext,\n points = e.points;\n ctx.beginPath();\n ctx.moveTo(points[0].canvasx, points[0].canvasy);\n\n // right control point for previous point\n var lastRightX = points[0].canvasx,\n lastRightY = points[0].canvasy;\n for (var i = 1; i < points.length; i++) {\n var p0 = points[i - 1],\n p1 = points[i],\n p2 = points[i + 1];\n p0 = p0 && isOK(p0.canvasy) ? p0 : null;\n p1 = p1 && isOK(p1.canvasy) ? p1 : null;\n p2 = p2 && isOK(p2.canvasy) ? p2 : null;\n if (p0 && p1) {\n var controls = getControlPoints({\n x: p0.canvasx,\n y: p0.canvasy\n }, {\n x: p1.canvasx,\n y: p1.canvasy\n }, p2 && {\n x: p2.canvasx,\n y: p2.canvasy\n }, smoothPlotter.smoothing);\n // Uncomment to show the control points:\n // ctx.lineTo(lastRightX, lastRightY);\n // ctx.lineTo(controls[0], controls[1]);\n // ctx.lineTo(p1.canvasx, p1.canvasy);\n lastRightX = lastRightX !== null ? lastRightX : p0.canvasx;\n lastRightY = lastRightY !== null ? lastRightY : p0.canvasy;\n ctx.bezierCurveTo(lastRightX, lastRightY, controls[0], controls[1], p1.canvasx, p1.canvasy);\n lastRightX = controls[2];\n lastRightY = controls[3];\n } else if (p1) {\n // We're starting again after a missing point.\n ctx.moveTo(p1.canvasx, p1.canvasy);\n lastRightX = p1.canvasx;\n lastRightY = p1.canvasy;\n } else {\n lastRightX = lastRightY = null;\n }\n }\n ctx.stroke();\n }", "title": "" }, { "docid": "eb9948f74c7c4e80f6e9ba116057ee97", "score": "0.5779946", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n\t\t var NEWTON_ITERATIONS = 4,\n\t\t NEWTON_MIN_SLOPE = 0.001,\n\t\t SUBDIVISION_PRECISION = 0.0000001,\n\t\t SUBDIVISION_MAX_ITERATIONS = 10,\n\t\t kSplineTableSize = 11,\n\t\t kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n\t\t float32ArraySupported = \"Float32Array\" in window;\n\t\t\n\t\t /* Must contain four arguments. */\n\t\t if (arguments.length !== 4) {\n\t\t return false;\n\t\t }\n\t\t\n\t\t /* Arguments must be numbers. */\n\t\t for (var i = 0; i < 4; ++i) {\n\t\t if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n\t\t return false;\n\t\t }\n\t\t }\n\t\t\n\t\t /* X values must be in the [0, 1] range. */\n\t\t mX1 = Math.min(mX1, 1);\n\t\t mX2 = Math.min(mX2, 1);\n\t\t mX1 = Math.max(mX1, 0);\n\t\t mX2 = Math.max(mX2, 0);\n\t\t\n\t\t var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\t\t\n\t\t function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n\t\t function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n\t\t function C (aA1) { return 3.0 * aA1; }\n\t\t\n\t\t function calcBezier (aT, aA1, aA2) {\n\t\t return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n\t\t }\n\t\t\n\t\t function getSlope (aT, aA1, aA2) {\n\t\t return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n\t\t }\n\t\t\n\t\t function newtonRaphsonIterate (aX, aGuessT) {\n\t\t for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t\t var currentSlope = getSlope(aGuessT, mX1, mX2);\n\t\t\n\t\t if (currentSlope === 0.0) return aGuessT;\n\t\t\n\t\t var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t\t aGuessT -= currentX / currentSlope;\n\t\t }\n\t\t\n\t\t return aGuessT;\n\t\t }\n\t\t\n\t\t function calcSampleValues () {\n\t\t for (var i = 0; i < kSplineTableSize; ++i) {\n\t\t mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t\t }\n\t\t }\n\t\t\n\t\t function binarySubdivide (aX, aA, aB) {\n\t\t var currentX, currentT, i = 0;\n\t\t\n\t\t do {\n\t\t currentT = aA + (aB - aA) / 2.0;\n\t\t currentX = calcBezier(currentT, mX1, mX2) - aX;\n\t\t if (currentX > 0.0) {\n\t\t aB = currentT;\n\t\t } else {\n\t\t aA = currentT;\n\t\t }\n\t\t } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\t\t\n\t\t return currentT;\n\t\t }\n\t\t\n\t\t function getTForX (aX) {\n\t\t var intervalStart = 0.0,\n\t\t currentSample = 1,\n\t\t lastSample = kSplineTableSize - 1;\n\t\t\n\t\t for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t\t intervalStart += kSampleStepSize;\n\t\t }\n\t\t\n\t\t --currentSample;\n\t\t\n\t\t var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n\t\t guessForT = intervalStart + dist * kSampleStepSize,\n\t\t initialSlope = getSlope(guessForT, mX1, mX2);\n\t\t\n\t\t if (initialSlope >= NEWTON_MIN_SLOPE) {\n\t\t return newtonRaphsonIterate(aX, guessForT);\n\t\t } else if (initialSlope == 0.0) {\n\t\t return guessForT;\n\t\t } else {\n\t\t return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t\t }\n\t\t }\n\t\t\n\t\t var _precomputed = false;\n\t\t\n\t\t function precompute() {\n\t\t _precomputed = true;\n\t\t if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n\t\t }\n\t\t\n\t\t var f = function (aX) {\n\t\t if (!_precomputed) precompute();\n\t\t if (mX1 === mY1 && mX2 === mY2) return aX;\n\t\t if (aX === 0) return 0;\n\t\t if (aX === 1) return 1;\n\t\t\n\t\t return calcBezier(getTForX(aX), mY1, mY2);\n\t\t };\n\t\t\n\t\t f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\t\t\n\t\t var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\t\t f.toString = function () { return str; };\n\t\t\n\t\t return f;\n\t\t }", "title": "" }, { "docid": "24a7bfe85802882fd421455f2206a8c5", "score": "0.5774736", "text": "function computeBSplinePoint(t, p0, p1, p2, p3) {\n // polynomial cubic b-spline equation\n var point = (Math.pow(1-t, 3) * p0/6) +\n\t\t((4-6*Math.pow(t,2)+3*Math.pow(t,3)) * p1/6) +\n\t\t((1+3*t+3*Math.pow(t,2)-3*Math.pow(t,3))* p2/6) +\n\t\t(Math.pow(t, 3) * p3/6);\n return point;\n}", "title": "" }, { "docid": "12db7fc4510098f844d42b865b9b368a", "score": "0.5773127", "text": "function getCurve(points) {\n\t return getCubicSpline(points, false);\n\t}", "title": "" }, { "docid": "21af2db1984339a4bb90e651bd71d304", "score": "0.5761458", "text": "function d3_svg_lineBasisClosed(points) {\r\n var path,\r\n i = -1,\r\n n = points.length,\r\n m = n + 4,\r\n pi,\r\n px = [],\r\n py = [];\r\n while (++i < 4) {\r\n pi = points[i % n];\r\n px.push(pi[0]);\r\n py.push(pi[1]);\r\n }\r\n path = [\r\n d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), \",\",\r\n d3_svg_lineDot4(d3_svg_lineBasisBezier3, py)\r\n ];\r\n --i; while (++i < m) {\r\n pi = points[i % n];\r\n px.shift(); px.push(pi[0]);\r\n py.shift(); py.push(pi[1]);\r\n d3_svg_lineBasisBezier(path, px, py);\r\n }\r\n return path.join(\"\");\r\n}", "title": "" }, { "docid": "89114e6f8481fa54a054048fe09445a6", "score": "0.5756935", "text": "function createHermiteSplines(datapoints, curvedLinesOptions, yPos) {\n var points = datapoints.points;\n var ps = datapoints.pointsize; // preparation get length (x_{k+1} - x_k) and slope s=(p_{k+1} - p_k) / (x_{k+1} - x_k) of the segments\n\n var segmentLengths = [];\n var segmentSlopes = [];\n\n for (var i = 0; i < points.length - ps; i += ps) {\n var curX = i;\n var curY = i + yPos;\n var dx = points[curX + ps] - points[curX];\n var dy = points[curY + ps] - points[curY];\n segmentLengths.push(dx);\n segmentSlopes.push(dy / dx);\n } //get the values for the desired gradients m_k for all points k\n //depending on the used method the formula is different\n\n\n var gradients = [segmentSlopes[0]];\n\n if (curvedLinesOptions.monotonicFit) {\n // Fritsch Carlson\n for (var i = 1; i < segmentLengths.length; i++) {\n var slope = segmentSlopes[i];\n var prev_slope = segmentSlopes[i - 1];\n\n if (slope * prev_slope <= 0) {\n // sign(prev_slope) != sign(slpe)\n gradients.push(0);\n } else {\n var length = segmentLengths[i];\n var prev_length = segmentLengths[i - 1];\n var common = length + prev_length; //m = 3 (prev_length + length) / ((2 length + prev_length) / prev_slope + (length + 2 prev_length) / slope)\n\n gradients.push(3 * common / ((common + length) / prev_slope + (common + prev_length) / slope));\n }\n }\n } else {\n // Cardinal spline with t € [0,1]\n // Catmull-Rom for t = 0\n for (var i = ps; i < points.length - ps; i += ps) {\n var curX = i;\n var curY = i + yPos;\n gradients.push(Number(curvedLinesOptions.tension) * (points[curY + ps] - points[curY - ps]) / (points[curX + ps] - points[curX - ps]));\n }\n }\n\n gradients.push(segmentSlopes[segmentSlopes.length - 1]); //get the two major coefficients (c'_{oef1} and c'_{oef2}) for each segment spline\n\n var coefs1 = [];\n var coefs2 = [];\n\n for (i = 0; i < segmentLengths.length; i++) {\n var m_k = gradients[i];\n var m_k_plus = gradients[i + 1];\n var slope = segmentSlopes[i];\n var invLength = 1 / segmentLengths[i];\n var common = m_k + m_k_plus - slope - slope;\n coefs1.push(common * invLength * invLength);\n coefs2.push((slope - common - m_k) * invLength);\n } //create functions with from the coefficients and capture the parameters\n\n\n var ret = [];\n\n for (var i = 0; i < segmentLengths.length; i++) {\n var spline = function spline(x_k, coef1, coef2, coef3, coef4) {\n // spline for a segment\n return function (x) {\n var diff = x - x_k;\n var diffSq = diff * diff;\n return coef1 * diff * diffSq + coef2 * diffSq + coef3 * diff + coef4;\n };\n };\n\n ret.push(spline(points[i * ps], coefs1[i], coefs2[i], gradients[i], points[i * ps + yPos]));\n }\n\n return ret;\n }", "title": "" }, { "docid": "07d22df7e5bc67d2471f0ef004a47f1e", "score": "0.57566166", "text": "function fitCubic(pts, first, last, tHat1, tHat2, error) {\n var nPts = last - first + 1;\n var iterationError = error * error;\n var maxInterations = 4;\n\n // Use heuristic if region only has two points in it\n if (nPts === 2) {\n var dist = twoPtDist(pts[last], pts[first]) / 3;\n return [new BezierCurve(\n pts[first],\n pts[first].add(tHat1.scale(dist)),\n pts[last].add(tHat2.scale(dist)),\n pts[last]\n )];\n }\n\n\n // Parameterize points, and attempt to fit curve\n var u = chordLengthParameterize(pts, first, last);\n var curve = generateBezier(pts, first, last, u, tHat1, tHat2);\n\n // Find max deviation of points to fitted curve\n var splitPoint = {i: 0};\n var maxError = computeMaxError(pts, first, last, curve, u, splitPoint);\n if (maxError < error) {\n return [curve];\n }\n\n if (maxError < iterationError) {\n for (var i = 0; i < maxInterations; i++) {\n var uPrime = reparameterize(pts, first, last, u, curve);\n curve = generateBezier(pts, first, last, uPrime, tHat1, tHat2);\n maxError = computeMaxError(pts, first, last, curve, uPrime, splitPoint);\n\n if (maxError < error) {\n return [curve];\n }\n u = uPrime;\n }\n }\n\n var tHatCenter = computeCenterTangent(pts, splitPoint.i);\n var left = fitCubic(pts, first, splitPoint.i, tHat1, tHatCenter, error);\n var right = fitCubic(pts, splitPoint.i, last, tHatCenter.negate(), tHat2, error);\n return left.concat(right);\n }", "title": "" }, { "docid": "23e51a6902e3a6b6b8147a80a1a97b29", "score": "0.5746852", "text": "function getPointsOnBezierCurves(points, tolerance) {\n const newPoints = [];\n const numSegments = (points.length - 1) / 3;\n for (let i = 0; i < numSegments; ++i) {\n const offset = i * 3;\n getPointsOnBezierCurveWithSplitting(points, offset, tolerance, newPoints);\n }\n return newPoints;\n}", "title": "" }, { "docid": "4ae59ead5b523705cf446b9884e91598", "score": "0.5742203", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n\t var NEWTON_ITERATIONS = 4,\n\t NEWTON_MIN_SLOPE = 0.001,\n\t SUBDIVISION_PRECISION = 0.0000001,\n\t SUBDIVISION_MAX_ITERATIONS = 10,\n\t kSplineTableSize = 11,\n\t kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n\t float32ArraySupported = \"Float32Array\" in window;\n\t\n\t /* Must contain four arguments. */\n\t if (arguments.length !== 4) {\n\t return false;\n\t }\n\t\n\t /* Arguments must be numbers. */\n\t for (var i = 0; i < 4; ++i) {\n\t if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t /* X values must be in the [0, 1] range. */\n\t mX1 = Math.min(mX1, 1);\n\t mX2 = Math.min(mX2, 1);\n\t mX1 = Math.max(mX1, 0);\n\t mX2 = Math.max(mX2, 0);\n\t\n\t var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\t\n\t function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n\t function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n\t function C (aA1) { return 3.0 * aA1; }\n\t\n\t function calcBezier (aT, aA1, aA2) {\n\t return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n\t }\n\t\n\t function getSlope (aT, aA1, aA2) {\n\t return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n\t }\n\t\n\t function newtonRaphsonIterate (aX, aGuessT) {\n\t for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t var currentSlope = getSlope(aGuessT, mX1, mX2);\n\t\n\t if (currentSlope === 0.0) return aGuessT;\n\t\n\t var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t aGuessT -= currentX / currentSlope;\n\t }\n\t\n\t return aGuessT;\n\t }\n\t\n\t function calcSampleValues () {\n\t for (var i = 0; i < kSplineTableSize; ++i) {\n\t mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t }\n\t }\n\t\n\t function binarySubdivide (aX, aA, aB) {\n\t var currentX, currentT, i = 0;\n\t\n\t do {\n\t currentT = aA + (aB - aA) / 2.0;\n\t currentX = calcBezier(currentT, mX1, mX2) - aX;\n\t if (currentX > 0.0) {\n\t aB = currentT;\n\t } else {\n\t aA = currentT;\n\t }\n\t } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\t\n\t return currentT;\n\t }\n\t\n\t function getTForX (aX) {\n\t var intervalStart = 0.0,\n\t currentSample = 1,\n\t lastSample = kSplineTableSize - 1;\n\t\n\t for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t intervalStart += kSampleStepSize;\n\t }\n\t\n\t --currentSample;\n\t\n\t var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n\t guessForT = intervalStart + dist * kSampleStepSize,\n\t initialSlope = getSlope(guessForT, mX1, mX2);\n\t\n\t if (initialSlope >= NEWTON_MIN_SLOPE) {\n\t return newtonRaphsonIterate(aX, guessForT);\n\t } else if (initialSlope == 0.0) {\n\t return guessForT;\n\t } else {\n\t return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t }\n\t }\n\t\n\t var _precomputed = false;\n\t\n\t function precompute() {\n\t _precomputed = true;\n\t if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n\t }\n\t\n\t var f = function (aX) {\n\t if (!_precomputed) precompute();\n\t if (mX1 === mY1 && mX2 === mY2) return aX;\n\t if (aX === 0) return 0;\n\t if (aX === 1) return 1;\n\t\n\t return calcBezier(getTForX(aX), mY1, mY2);\n\t };\n\t\n\t f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\t\n\t var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\t f.toString = function () { return str; };\n\t\n\t return f;\n\t }", "title": "" }, { "docid": "4ae59ead5b523705cf446b9884e91598", "score": "0.5742203", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n\t var NEWTON_ITERATIONS = 4,\n\t NEWTON_MIN_SLOPE = 0.001,\n\t SUBDIVISION_PRECISION = 0.0000001,\n\t SUBDIVISION_MAX_ITERATIONS = 10,\n\t kSplineTableSize = 11,\n\t kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n\t float32ArraySupported = \"Float32Array\" in window;\n\t\n\t /* Must contain four arguments. */\n\t if (arguments.length !== 4) {\n\t return false;\n\t }\n\t\n\t /* Arguments must be numbers. */\n\t for (var i = 0; i < 4; ++i) {\n\t if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n\t return false;\n\t }\n\t }\n\t\n\t /* X values must be in the [0, 1] range. */\n\t mX1 = Math.min(mX1, 1);\n\t mX2 = Math.min(mX2, 1);\n\t mX1 = Math.max(mX1, 0);\n\t mX2 = Math.max(mX2, 0);\n\t\n\t var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\t\n\t function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n\t function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n\t function C (aA1) { return 3.0 * aA1; }\n\t\n\t function calcBezier (aT, aA1, aA2) {\n\t return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n\t }\n\t\n\t function getSlope (aT, aA1, aA2) {\n\t return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n\t }\n\t\n\t function newtonRaphsonIterate (aX, aGuessT) {\n\t for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t var currentSlope = getSlope(aGuessT, mX1, mX2);\n\t\n\t if (currentSlope === 0.0) return aGuessT;\n\t\n\t var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t aGuessT -= currentX / currentSlope;\n\t }\n\t\n\t return aGuessT;\n\t }\n\t\n\t function calcSampleValues () {\n\t for (var i = 0; i < kSplineTableSize; ++i) {\n\t mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t }\n\t }\n\t\n\t function binarySubdivide (aX, aA, aB) {\n\t var currentX, currentT, i = 0;\n\t\n\t do {\n\t currentT = aA + (aB - aA) / 2.0;\n\t currentX = calcBezier(currentT, mX1, mX2) - aX;\n\t if (currentX > 0.0) {\n\t aB = currentT;\n\t } else {\n\t aA = currentT;\n\t }\n\t } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\t\n\t return currentT;\n\t }\n\t\n\t function getTForX (aX) {\n\t var intervalStart = 0.0,\n\t currentSample = 1,\n\t lastSample = kSplineTableSize - 1;\n\t\n\t for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t intervalStart += kSampleStepSize;\n\t }\n\t\n\t --currentSample;\n\t\n\t var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n\t guessForT = intervalStart + dist * kSampleStepSize,\n\t initialSlope = getSlope(guessForT, mX1, mX2);\n\t\n\t if (initialSlope >= NEWTON_MIN_SLOPE) {\n\t return newtonRaphsonIterate(aX, guessForT);\n\t } else if (initialSlope == 0.0) {\n\t return guessForT;\n\t } else {\n\t return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t }\n\t }\n\t\n\t var _precomputed = false;\n\t\n\t function precompute() {\n\t _precomputed = true;\n\t if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n\t }\n\t\n\t var f = function (aX) {\n\t if (!_precomputed) precompute();\n\t if (mX1 === mY1 && mX2 === mY2) return aX;\n\t if (aX === 0) return 0;\n\t if (aX === 1) return 1;\n\t\n\t return calcBezier(getTForX(aX), mY1, mY2);\n\t };\n\t\n\t f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\t\n\t var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\t f.toString = function () { return str; };\n\t\n\t return f;\n\t }", "title": "" }, { "docid": "5b108b6e0d61ef17cb8917959f8a432e", "score": "0.5734233", "text": "function getPath(points) {\n var p = new Path();\n if (!points) {\n return p;\n }\n\n var contours = getContours(points);\n\n for (var contourIndex = 0; contourIndex < contours.length; ++contourIndex) {\n var contour = contours[contourIndex];\n\n var prev = null;\n var curr = contour[contour.length - 1];\n var next = contour[0];\n\n if (curr.onCurve) {\n p.moveTo(curr.x, curr.y);\n } else {\n if (next.onCurve) {\n p.moveTo(next.x, next.y);\n } else {\n // If both first and last points are off-curve, start at their middle.\n var start = {x: (curr.x + next.x) * 0.5, y: (curr.y + next.y) * 0.5};\n p.moveTo(start.x, start.y);\n }\n }\n\n for (var i = 0; i < contour.length; ++i) {\n prev = curr;\n curr = next;\n next = contour[(i + 1) % contour.length];\n\n if (curr.onCurve) {\n // This is a straight line.\n p.lineTo(curr.x, curr.y);\n } else {\n var prev2 = prev;\n var next2 = next;\n\n if (!prev.onCurve) {\n prev2 = { x: (curr.x + prev.x) * 0.5, y: (curr.y + prev.y) * 0.5 };\n p.lineTo(prev2.x, prev2.y);\n }\n\n if (!next.onCurve) {\n next2 = { x: (curr.x + next.x) * 0.5, y: (curr.y + next.y) * 0.5 };\n }\n\n p.lineTo(prev2.x, prev2.y);\n p.quadraticCurveTo(curr.x, curr.y, next2.x, next2.y);\n }\n }\n\n p.closePath();\n }\n return p;\n}", "title": "" }, { "docid": "90601bb8ca1cd0790581dbf179bd13ee", "score": "0.5729294", "text": "function generateBezier(mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = \"Float32Array\" in window;\n\n /* Must contain four arguments. */\n if (arguments.length !== 4) {\n return false;\n }\n\n /* Arguments must be numbers. */\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n\n /* X values must be in the [0, 1] range. */\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n }\n function B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n }\n function C(aA1) {\n return 3.0 * aA1;\n }\n\n function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n }\n\n function getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate(aX, aGuessT) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues() {\n for (var i = 0; i < kSplineTableSize; ++i) {\n mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide(aX, aA, aB) {\n var currentX,\n currentT,\n i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX(aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n if (mX1 !== mY1 || mX2 !== mY2) {\n calcSampleValues();\n }\n }\n\n var f = function f(aX) {\n if (!_precomputed) {\n precompute();\n }\n if (mX1 === mY1 && mX2 === mY2) {\n return aX;\n }\n if (aX === 0) {\n return 0;\n }\n if (aX === 1) {\n return 1;\n }\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function () {\n return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }];\n };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n f.toString = function () {\n return str;\n };\n\n return f;\n }", "title": "" }, { "docid": "f3d2845c18da71e02498595c3c858fac", "score": "0.5726014", "text": "function generateBezier(mX1, mY1, mX2, mY2) {\n\t\t\t\tvar NEWTON_ITERATIONS = 4,\n\t\t\t\t\t\tNEWTON_MIN_SLOPE = 0.001,\n\t\t\t\t\t\tSUBDIVISION_PRECISION = 0.0000001,\n\t\t\t\t\t\tSUBDIVISION_MAX_ITERATIONS = 10,\n\t\t\t\t\t\tkSplineTableSize = 11,\n\t\t\t\t\t\tkSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n\t\t\t\t\t\tfloat32ArraySupported = \"Float32Array\" in window;\n\t\n\t\t\t\t/* Must contain four arguments. */\n\t\t\t\tif (arguments.length !== 4) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\n\t\t\t\t/* Arguments must be numbers. */\n\t\t\t\tfor (var i = 0; i < 4; ++i) {\n\t\t\t\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\t/* X values must be in the [0, 1] range. */\n\t\t\t\tmX1 = Math.min(mX1, 1);\n\t\t\t\tmX2 = Math.min(mX2, 1);\n\t\t\t\tmX1 = Math.max(mX1, 0);\n\t\t\t\tmX2 = Math.max(mX2, 0);\n\t\n\t\t\t\tvar mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\t\n\t\t\t\tfunction A(aA1, aA2) {\n\t\t\t\t\treturn 1.0 - 3.0 * aA2 + 3.0 * aA1;\n\t\t\t\t}\n\t\t\t\tfunction B(aA1, aA2) {\n\t\t\t\t\treturn 3.0 * aA2 - 6.0 * aA1;\n\t\t\t\t}\n\t\t\t\tfunction C(aA1) {\n\t\t\t\t\treturn 3.0 * aA1;\n\t\t\t\t}\n\t\n\t\t\t\tfunction calcBezier(aT, aA1, aA2) {\n\t\t\t\t\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n\t\t\t\t}\n\t\n\t\t\t\tfunction getSlope(aT, aA1, aA2) {\n\t\t\t\t\treturn 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n\t\t\t\t}\n\t\n\t\t\t\tfunction newtonRaphsonIterate(aX, aGuessT) {\n\t\t\t\t\tfor (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t\t\t\t\t\tvar currentSlope = getSlope(aGuessT, mX1, mX2);\n\t\n\t\t\t\t\t\tif (currentSlope === 0.0) {\n\t\t\t\t\t\t\treturn aGuessT;\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tvar currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t\t\t\t\t\taGuessT -= currentX / currentSlope;\n\t\t\t\t\t}\n\t\n\t\t\t\t\treturn aGuessT;\n\t\t\t\t}\n\t\n\t\t\t\tfunction calcSampleValues() {\n\t\t\t\t\tfor (var i = 0; i < kSplineTableSize; ++i) {\n\t\t\t\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tfunction binarySubdivide(aX, aA, aB) {\n\t\t\t\t\tvar currentX, currentT, i = 0;\n\t\n\t\t\t\t\tdo {\n\t\t\t\t\t\tcurrentT = aA + (aB - aA) / 2.0;\n\t\t\t\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\n\t\t\t\t\t\tif (currentX > 0.0) {\n\t\t\t\t\t\t\taB = currentT;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\taA = currentT;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\t\n\t\t\t\t\treturn currentT;\n\t\t\t\t}\n\t\n\t\t\t\tfunction getTForX(aX) {\n\t\t\t\t\tvar intervalStart = 0.0,\n\t\t\t\t\t\t\tcurrentSample = 1,\n\t\t\t\t\t\t\tlastSample = kSplineTableSize - 1;\n\t\n\t\t\t\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t\t\t\t\t\tintervalStart += kSampleStepSize;\n\t\t\t\t\t}\n\t\n\t\t\t\t\t--currentSample;\n\t\n\t\t\t\t\tvar dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n\t\t\t\t\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\n\t\t\t\t\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\n\t\n\t\t\t\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\n\t\t\t\t\t\treturn newtonRaphsonIterate(aX, guessForT);\n\t\t\t\t\t} else if (initialSlope === 0.0) {\n\t\t\t\t\t\treturn guessForT;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tvar _precomputed = false;\n\t\n\t\t\t\tfunction precompute() {\n\t\t\t\t\t_precomputed = true;\n\t\t\t\t\tif (mX1 !== mY1 || mX2 !== mY2) {\n\t\t\t\t\t\tcalcSampleValues();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\tvar f = function(aX) {\n\t\t\t\t\tif (!_precomputed) {\n\t\t\t\t\t\tprecompute();\n\t\t\t\t\t}\n\t\t\t\t\tif (mX1 === mY1 && mX2 === mY2) {\n\t\t\t\t\t\treturn aX;\n\t\t\t\t\t}\n\t\t\t\t\tif (aX === 0) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (aX === 1) {\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\n\t\t\t\t\treturn calcBezier(getTForX(aX), mY1, mY2);\n\t\t\t\t};\n\t\n\t\t\t\tf.getControlPoints = function() {\n\t\t\t\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\n\t\t\t\t};\n\t\n\t\t\t\tvar str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\t\t\t\tf.toString = function() {\n\t\t\t\t\treturn str;\n\t\t\t\t};\n\t\n\t\t\t\treturn f;\n\t\t\t}", "title": "" }, { "docid": "2d7cccaf00d71111a6a6c0856bd58750", "score": "0.57252777", "text": "function d3_svg_lineBasisOpen(points) {\r\n if (points.length < 4) return d3_svg_lineLinear(points);\r\n var path = [],\r\n i = -1,\r\n n = points.length,\r\n pi,\r\n px = [0],\r\n py = [0];\r\n while (++i < 3) {\r\n pi = points[i];\r\n px.push(pi[0]);\r\n py.push(pi[1]);\r\n }\r\n path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px)\r\n + \",\" + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py));\r\n --i; while (++i < n) {\r\n pi = points[i];\r\n px.shift(); px.push(pi[0]);\r\n py.shift(); py.push(pi[1]);\r\n d3_svg_lineBasisBezier(path, px, py);\r\n }\r\n return path.join(\"\");\r\n}", "title": "" }, { "docid": "26c750a4ddb89299307e9e753632dcfe", "score": "0.5697609", "text": "function getPath(points) {\n var p = new Path();\n if (!points) {\n return p;\n }\n\n var contours = getContours(points);\n\n for (var contourIndex = 0; contourIndex < contours.length; ++contourIndex) {\n var contour = contours[contourIndex];\n\n var prev = null;\n var curr = contour[contour.length - 1];\n var next = contour[0];\n\n if (curr.onCurve) {\n p.moveTo(curr.x, curr.y);\n } else {\n if (next.onCurve) {\n p.moveTo(next.x, next.y);\n } else {\n // If both first and last points are off-curve, start at their middle.\n var start = {x: (curr.x + next.x) * 0.5, y: (curr.y + next.y) * 0.5};\n p.moveTo(start.x, start.y);\n }\n }\n\n for (var i = 0; i < contour.length; ++i) {\n prev = curr;\n curr = next;\n next = contour[(i + 1) % contour.length];\n\n if (curr.onCurve) {\n // This is a straight line.\n p.lineTo(curr.x, curr.y);\n } else {\n var prev2 = prev;\n var next2 = next;\n\n if (!prev.onCurve) {\n prev2 = { x: (curr.x + prev.x) * 0.5, y: (curr.y + prev.y) * 0.5 };\n }\n\n if (!next.onCurve) {\n next2 = { x: (curr.x + next.x) * 0.5, y: (curr.y + next.y) * 0.5 };\n }\n\n p.quadraticCurveTo(curr.x, curr.y, next2.x, next2.y);\n }\n }\n\n p.closePath();\n }\n return p;\n}", "title": "" }, { "docid": "fc0a1efb642c079112f94379025e4714", "score": "0.5690198", "text": "function createSSpline() {\n var helix = new THREE.Curve(); //initializes helix curve\n helix.getPoint = function(t) { //make helix curve by setting x, y and z in vector to match helix shape\n var s = (t - 0.5)*8*Math.PI; //the radians\n return new THREE.Vector3(\n 300*Math.cos(s),\n 25*s,\n 50*Math.sin(s)\n );\n }\n\n helix_points = helix.getPoints(sceneParams.numHelixPoints).reverse(); //gets a center number of helix points\n // addDoors(helix_points); //calls addDoors to get doors added in the scene\n\n addSphere();\n var helixGeom = new THREE.TubeGeometry(helix,\n sceneParams.helixTubularSegments,\n sceneParams.helixTubeRadius,\n sceneParams.helixRadiusSegments); //creates helix tubegeom\n var helixMesh = new THREE.Mesh(helixGeom, splineMaterial); //creates mesh of helix\n\n scene.add(helixMesh);\n}", "title": "" }, { "docid": "a75f94d9467807761e30d929ed99fdfe", "score": "0.5658317", "text": "function computeBezierCurve(controlPoints,t){\n var n=controlPoints.length-1;\n var value_x=0;\n var value_y=0;\n for(var i=0;i<=n;i++){\n coeff=(fact(n)/(fact(i)*fact(n-i)));\n value_x+=coeff*Math.pow((1-t),n-i)*Math.pow(t,i)*controlPoints[i][\"x\"];\n value_y+=coeff*Math.pow((1-t),n-i)*Math.pow(t,i)*controlPoints[i][\"y\"];\n }\n return [value_x,value_y];\n}", "title": "" }, { "docid": "05dae00ea451e0d73ac158fe45ab7b19", "score": "0.565235", "text": "static CreateQuadraticBezier(v0, v1, v2, nbPoints) {\n nbPoints = nbPoints > 2 ? nbPoints : 3;\n const bez = new Array();\n const equation = (t, val0, val1, val2) => {\n const res = (1.0 - t) * (1.0 - t) * val0 + 2.0 * t * (1.0 - t) * val1 + t * t * val2;\n return res;\n };\n for (let i = 0; i <= nbPoints; i++) {\n bez.push(new _1.Vector3(equation(i / nbPoints, v0.x, v1.x, v2.x), equation(i / nbPoints, v0.y, v1.y, v2.y), equation(i / nbPoints, v0.z, v1.z, v2.z)));\n }\n return new Curve3(bez);\n }", "title": "" }, { "docid": "549c7b5fbad3dd2f3b09bf9c6aa07b89", "score": "0.5645228", "text": "function drawBezierCurve(context, p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y, lines) {\n const bezierMatrix = [[-1, 3, -3, 1], [3, -6, 3, 0], [-3, 3, 0, 0], [1, 0, 0, 0]];\n const pointVectorX = [p1x, p2x, p3x, p4x];\n const pointVectorY = [p1y, p2y, p3y, p4y];\n\n const cx = multiplyMatrixByVector(bezierMatrix, pointVectorX);\n const cy = multiplyMatrixByVector(bezierMatrix, pointVectorY);\n\n step = 1/lines;\n for(let t = 0; Math.floor((t+step)*100)/100 <= 1; t+=step) {\n let startX = calculateCurvePoint(cx, 1-t);\n let startY = calculateCurvePoint(cy, 1-t);\n let endX = calculateCurvePoint(cx, 1-(t+step));\n let endY = calculateCurvePoint(cy, 1-(t+step));\n\n drawLine(context, startX, startY, endX, endY);\n }\n}", "title": "" }, { "docid": "1894f70e43e9de344ecb7dfe06981d97", "score": "0.5638299", "text": "setCurve (frameIndex, cx1, cy1, cx2, cy2) {\n let tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\n let dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\n let ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\n let dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\n\n let i = frameIndex * CurveTimeline.BEZIER_SIZE;\n let curves = this.curves;\n curves[i++] = CurveTimeline.BEZIER;\n\n let x = dfx, y = dfy;\n for (let n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\n curves[i] = x;\n curves[i + 1] = y;\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n x += dfx;\n y += dfy;\n }\n }", "title": "" }, { "docid": "92efa4efd578e6ad1b528b71becec45f", "score": "0.5628063", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n\t var NEWTON_ITERATIONS = 4,\n\t NEWTON_MIN_SLOPE = 0.001,\n\t SUBDIVISION_PRECISION = 0.0000001,\n\t SUBDIVISION_MAX_ITERATIONS = 10,\n\t kSplineTableSize = 11,\n\t kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n\t float32ArraySupported = \"Float32Array\" in window;\n\n\t /* Must contain four arguments. */\n\t if (arguments.length !== 4) {\n\t return false;\n\t }\n\n\t /* Arguments must be numbers. */\n\t for (var i = 0; i < 4; ++i) {\n\t if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n\t return false;\n\t }\n\t }\n\n\t /* X values must be in the [0, 1] range. */\n\t mX1 = Math.min(mX1, 1);\n\t mX2 = Math.min(mX2, 1);\n\t mX1 = Math.max(mX1, 0);\n\t mX2 = Math.max(mX2, 0);\n\n\t var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n\t function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n\t function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n\t function C (aA1) { return 3.0 * aA1; }\n\n\t function calcBezier (aT, aA1, aA2) {\n\t return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n\t }\n\n\t function getSlope (aT, aA1, aA2) {\n\t return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n\t }\n\n\t function newtonRaphsonIterate (aX, aGuessT) {\n\t for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n\t if (currentSlope === 0.0) return aGuessT;\n\n\t var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t aGuessT -= currentX / currentSlope;\n\t }\n\n\t return aGuessT;\n\t }\n\n\t function calcSampleValues () {\n\t for (var i = 0; i < kSplineTableSize; ++i) {\n\t mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t }\n\t }\n\n\t function binarySubdivide (aX, aA, aB) {\n\t var currentX, currentT, i = 0;\n\n\t do {\n\t currentT = aA + (aB - aA) / 2.0;\n\t currentX = calcBezier(currentT, mX1, mX2) - aX;\n\t if (currentX > 0.0) {\n\t aB = currentT;\n\t } else {\n\t aA = currentT;\n\t }\n\t } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n\t return currentT;\n\t }\n\n\t function getTForX (aX) {\n\t var intervalStart = 0.0,\n\t currentSample = 1,\n\t lastSample = kSplineTableSize - 1;\n\n\t for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t intervalStart += kSampleStepSize;\n\t }\n\n\t --currentSample;\n\n\t var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n\t guessForT = intervalStart + dist * kSampleStepSize,\n\t initialSlope = getSlope(guessForT, mX1, mX2);\n\n\t if (initialSlope >= NEWTON_MIN_SLOPE) {\n\t return newtonRaphsonIterate(aX, guessForT);\n\t } else if (initialSlope == 0.0) {\n\t return guessForT;\n\t } else {\n\t return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t }\n\t }\n\n\t var _precomputed = false;\n\n\t function precompute() {\n\t _precomputed = true;\n\t if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n\t }\n\n\t var f = function (aX) {\n\t if (!_precomputed) precompute();\n\t if (mX1 === mY1 && mX2 === mY2) return aX;\n\t if (aX === 0) return 0;\n\t if (aX === 1) return 1;\n\n\t return calcBezier(getTForX(aX), mY1, mY2);\n\t };\n\n\t f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\n\t var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\t f.toString = function () { return str; };\n\n\t return f;\n\t }", "title": "" }, { "docid": "b0fb1b3bb9a5a855a1ba1116fabfeac1", "score": "0.56259096", "text": "function interpolatePathPoints(pointsFrom, pointsTo) {\n\t var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'polyline';\n\n\n\t var interpolate;\n\n\t return function (t) {\n\t if (t === 0) {\n\t return pointsFrom;\n\t }\n\t if (t === 1) {\n\t return pointsTo;\n\t }\n\n\t if (!interpolate) {\n\t interpolate = (type === 'cubic' ? getCubicInterpolator : getLinearInterpolator)(pointsFrom, pointsTo);\n\t }\n\n\t return interpolate(t);\n\t };\n\t}", "title": "" }, { "docid": "898e22f63807e7261a245d1560ff7242", "score": "0.5622294", "text": "slinkyVertices(t){\n const x = -this.step * 3/4;\n const r = this.step/2;\n const r_i = r/2;\n\n let arc = [];\n let box = [];\n\n let angle_0 = 0;\n let angle = 0;\n\n let y = 0;\n let box_height = 0;\n\n // Split into phases\n const curve_start = 0;\n const fall_start = 0.25;\n const uncurve_start = 0.5;\n const squish_start = 0.75;\n\n if(t <= fall_start){\n t = utime(t, curve_start, fall_start);\n\n angle_0 = Math.PI;\n angle = lerp(0, -Math.PI, t);\n }\n else if(t <= uncurve_start){\n t = utime(t, fall_start, uncurve_start);\n\n angle_0 = Math.PI;\n angle = -Math.PI;\n\n box_height = lerp(0, this.step, t);\n }\n else if(t <= squish_start){\n t = utime(t, uncurve_start, squish_start);\n\n angle_0 = 0;\n angle = lerp(Math.PI, 0, t);\n\n box_height = this.step;\n }\n else{\n t = utime(t, squish_start, 1);\n\n y = lerp(0, -this.step, t);\n box_height = lerp(this.step, 0, t);\n }\n\n const sections = 5*Math.abs(angle);\n arc = this.arcVertices(x + r + r_i, y, r_i, r+r_i, angle, angle_0, sections);\n box = this.boxVertices(x + 2*r_i + r, y, r, box_height);\n\n return arc.concat(box);\n }", "title": "" }, { "docid": "a35b64e793663adf33c3052b3c7e314f", "score": "0.5611025", "text": "function drawBezierCurve(i) {\n var n, x, y;\n if(paths[i].segments().length < 2) return;\n var points = paths[i].segments();\n\n bezierCurves[i].segments(Array(0));\n\n bezierCurves[i].moveTo(points[0][1], points[0][2]);\n n = points.length - 1;\n x = 0, y = 0;\n\n for(t = 1/evaluations; t < 1; t += 1/evaluations, x = 0, y = 0) {\n for(p = 1; p < points.length; p++){\n for(c = 0; c < points.length - p; c++){\n points[c][1] = (1 - t) * points[c][1] + t * points[c + 1][1];\n points[c][2] = (1 - t) * points[c][2] + t * points[c + 1][2];\n }\n }\n x = points[0][1];\n y = points[0][2];\n\n bezierCurves[i].lineTo(x, y);\n }\n\n bezierCurves[i].lineTo(points[n][1], points[n][2]);\n}", "title": "" }, { "docid": "96fd2453b6a47295c92a854961489a46", "score": "0.56102943", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = \"Float32Array\" in window;\n\n /* Must contain four arguments. */\n if (arguments.length !== 4) {\n return false;\n }\n\n /* Arguments must be numbers. */\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n\n /* X values must be in the [0, 1] range. */\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n function C (aA1) { return 3.0 * aA1; }\n\n function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }\n\n function getSlope (aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate (aX, aGuessT) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) return aGuessT;\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues () {\n for (var i = 0; i < kSplineTableSize; ++i) {\n mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide (aX, aA, aB) {\n var currentX, currentT, i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope == 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n }\n\n var f = function (aX) {\n if (!_precomputed) precompute();\n if (mX1 === mY1 && mX2 === mY2) return aX;\n if (aX === 0) return 0;\n if (aX === 1) return 1;\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n f.toString = function () { return str; };\n\n return f;\n }", "title": "" }, { "docid": "96fd2453b6a47295c92a854961489a46", "score": "0.56102943", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = \"Float32Array\" in window;\n\n /* Must contain four arguments. */\n if (arguments.length !== 4) {\n return false;\n }\n\n /* Arguments must be numbers. */\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n\n /* X values must be in the [0, 1] range. */\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n function C (aA1) { return 3.0 * aA1; }\n\n function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }\n\n function getSlope (aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate (aX, aGuessT) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) return aGuessT;\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues () {\n for (var i = 0; i < kSplineTableSize; ++i) {\n mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide (aX, aA, aB) {\n var currentX, currentT, i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope == 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n }\n\n var f = function (aX) {\n if (!_precomputed) precompute();\n if (mX1 === mY1 && mX2 === mY2) return aX;\n if (aX === 0) return 0;\n if (aX === 1) return 1;\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n f.toString = function () { return str; };\n\n return f;\n }", "title": "" }, { "docid": "96fd2453b6a47295c92a854961489a46", "score": "0.56102943", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = \"Float32Array\" in window;\n\n /* Must contain four arguments. */\n if (arguments.length !== 4) {\n return false;\n }\n\n /* Arguments must be numbers. */\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n\n /* X values must be in the [0, 1] range. */\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n function C (aA1) { return 3.0 * aA1; }\n\n function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }\n\n function getSlope (aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate (aX, aGuessT) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) return aGuessT;\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues () {\n for (var i = 0; i < kSplineTableSize; ++i) {\n mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide (aX, aA, aB) {\n var currentX, currentT, i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope == 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n }\n\n var f = function (aX) {\n if (!_precomputed) precompute();\n if (mX1 === mY1 && mX2 === mY2) return aX;\n if (aX === 0) return 0;\n if (aX === 1) return 1;\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n f.toString = function () { return str; };\n\n return f;\n }", "title": "" }, { "docid": "96fd2453b6a47295c92a854961489a46", "score": "0.56102943", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = \"Float32Array\" in window;\n\n /* Must contain four arguments. */\n if (arguments.length !== 4) {\n return false;\n }\n\n /* Arguments must be numbers. */\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n\n /* X values must be in the [0, 1] range. */\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n function C (aA1) { return 3.0 * aA1; }\n\n function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }\n\n function getSlope (aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate (aX, aGuessT) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) return aGuessT;\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues () {\n for (var i = 0; i < kSplineTableSize; ++i) {\n mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide (aX, aA, aB) {\n var currentX, currentT, i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope == 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n }\n\n var f = function (aX) {\n if (!_precomputed) precompute();\n if (mX1 === mY1 && mX2 === mY2) return aX;\n if (aX === 0) return 0;\n if (aX === 1) return 1;\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n f.toString = function () { return str; };\n\n return f;\n }", "title": "" }, { "docid": "96fd2453b6a47295c92a854961489a46", "score": "0.56102943", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = \"Float32Array\" in window;\n\n /* Must contain four arguments. */\n if (arguments.length !== 4) {\n return false;\n }\n\n /* Arguments must be numbers. */\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n\n /* X values must be in the [0, 1] range. */\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n function C (aA1) { return 3.0 * aA1; }\n\n function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }\n\n function getSlope (aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate (aX, aGuessT) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) return aGuessT;\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues () {\n for (var i = 0; i < kSplineTableSize; ++i) {\n mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide (aX, aA, aB) {\n var currentX, currentT, i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope == 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n }\n\n var f = function (aX) {\n if (!_precomputed) precompute();\n if (mX1 === mY1 && mX2 === mY2) return aX;\n if (aX === 0) return 0;\n if (aX === 1) return 1;\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n f.toString = function () { return str; };\n\n return f;\n }", "title": "" }, { "docid": "96fd2453b6a47295c92a854961489a46", "score": "0.56102943", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = \"Float32Array\" in window;\n\n /* Must contain four arguments. */\n if (arguments.length !== 4) {\n return false;\n }\n\n /* Arguments must be numbers. */\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n\n /* X values must be in the [0, 1] range. */\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n function C (aA1) { return 3.0 * aA1; }\n\n function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }\n\n function getSlope (aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate (aX, aGuessT) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) return aGuessT;\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues () {\n for (var i = 0; i < kSplineTableSize; ++i) {\n mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide (aX, aA, aB) {\n var currentX, currentT, i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope == 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n }\n\n var f = function (aX) {\n if (!_precomputed) precompute();\n if (mX1 === mY1 && mX2 === mY2) return aX;\n if (aX === 0) return 0;\n if (aX === 1) return 1;\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n f.toString = function () { return str; };\n\n return f;\n }", "title": "" }, { "docid": "96fd2453b6a47295c92a854961489a46", "score": "0.56102943", "text": "function generateBezier (mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = \"Float32Array\" in window;\n\n /* Must contain four arguments. */\n if (arguments.length !== 4) {\n return false;\n }\n\n /* Arguments must be numbers. */\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n\n /* X values must be in the [0, 1] range. */\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }\n function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }\n function C (aA1) { return 3.0 * aA1; }\n\n function calcBezier (aT, aA1, aA2) {\n return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;\n }\n\n function getSlope (aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate (aX, aGuessT) {\n for (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) return aGuessT;\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues () {\n for (var i = 0; i < kSplineTableSize; ++i) {\n mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide (aX, aA, aB) {\n var currentX, currentT, i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX (aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample != lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample+1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope == 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n if (mX1 != mY1 || mX2 != mY2) calcSampleValues();\n }\n\n var f = function (aX) {\n if (!_precomputed) precompute();\n if (mX1 === mY1 && mX2 === mY2) return aX;\n if (aX === 0) return 0;\n if (aX === 1) return 1;\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function() { return [{ x: mX1, y: mY1 }, { x: mX2, y: mY2 }]; };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n f.toString = function () { return str; };\n\n return f;\n }", "title": "" }, { "docid": "501f917132f164a5d547ad109b13740e", "score": "0.56088626", "text": "createShapeFromPoints (points, height = 0.5) {\n var shape = []\n for (let i = 0; i < points.length; i+=2) {\n shape.push(new BABYLON.Vector2(points[i], points[i + 1]))\n }\n\n return new BABYLON.PolygonMeshBuilder(\"drill\", shape, this.scene).build(false, height)\n }", "title": "" }, { "docid": "1a980721d956946089d4f5eaa07fc014", "score": "0.56005794", "text": "function createSecondTweenPoints(lineOptions){\n var returnArray = [];\n returnArray.push(lineOptions.firstPoint.x, lineOptions.firstPoint.y, lineOptions.secondPoint.x, lineOptions.secondPoint.y, lineOptions.thirdPoint.x, lineOptions.thirdPoint.y);\n return returnArray;\n}", "title": "" }, { "docid": "441afe424e47118214850e000ff19bb7", "score": "0.5598326", "text": "function drawBezierCurves()\n{\n var count = 0;\n for (var t = 0.0; t <= 1.00; t += .01)\n {\n var xTop = Math.pow((1 - t), 3)*controlPoints[0][0] + 3*Math.pow((1 - t), 2)*t*controlPoints[1][0] + 3*(1 - t)*Math.pow(t, 2)*controlPoints[2][0] + Math.pow(t, 3)*controlPoints[3][0];\n var yTop = Math.pow((1 - t), 3)*controlPoints[0][1] + 3*Math.pow((1 - t), 2)*t*controlPoints[1][1] + 3*(1 - t)*Math.pow(t, 2)*controlPoints[2][1] + Math.pow(t, 3)*controlPoints[3][1];\n var xBottom = Math.pow((1 - t), 3)*controlPoints[3][0] + 3*Math.pow((1 - t), 2)*t*controlPoints[4][0] + 3*(1 - t)*Math.pow(t, 2)*controlPoints[5][0] + Math.pow(t, 3)*controlPoints[6][0];\n var yBottom = Math.pow((1 - t), 3)*controlPoints[3][1] + 3*Math.pow((1 - t), 2)*t*controlPoints[4][1] + 3*(1 - t)*Math.pow(t, 2)*controlPoints[5][1] + Math.pow(t, 3)*controlPoints[6][1];\n if (!bcInitialized)\n {\n bezierCurveTop.push(vec4(xTop, yTop));\n bezierCurveBottom.push(vec4(xBottom, yBottom)); \n }\n else\n {\n var topPoint = vec4(xTop, yTop);\n var bottomPoint = vec4(xBottom, yBottom);\n bezierCurveTop[count] = topPoint;\n bezierCurveBottom[count] = bottomPoint;\n gl.bufferSubData(gl.ARRAY_BUFFER, 16 * (btLocation + count), flatten(topPoint));\n gl.bufferSubData(gl.ARRAY_BUFFER, 16 * (bbLocation + count), flatten(bottomPoint));\n count++;\n }\n }\n}", "title": "" }, { "docid": "c74aefd4d51a1e49f57dba90d0a55fab", "score": "0.5597746", "text": "function createHermiteSplines(datapoints, curvedLinesOptions, yPos) {\r\n\t\t\tvar points = datapoints.points;\r\n\t\t\tvar ps = datapoints.pointsize;\r\n\t\t\t\r\n\t\t\t// preparation get length (x_{k+1} - x_k) and slope s=(p_{k+1} - p_k) / (x_{k+1} - x_k) of the segments\r\n\t\t\tvar segmentLengths = [];\r\n\t\t\tvar segmentSlopes = [];\r\n\r\n\t\t\tfor (var i = 0; i < points.length - ps; i += ps) {\r\n\t\t\t\tvar curX = i;\r\n\t\t\t\tvar curY = i + yPos;\t\t\t\r\n\t\t\t\tvar dx = points[curX + ps] - points[curX];\r\n\t\t\t\tvar dy = points[curY + ps] - points[curY];\r\n\t\t\t\t\t\t\t\r\n\t\t\t\tsegmentLengths.push(dx);\r\n\t\t\t\tsegmentSlopes.push(dy / dx);\r\n\t\t\t}\r\n\r\n\t\t\t//get the values for the desired gradients m_k for all points k\r\n\t\t\t//depending on the used method the formula is different\r\n\t\t\tvar gradients = [segmentSlopes[0]];\t\r\n\t\t\tif (curvedLinesOptions.monotonicFit) {\r\n\t\t\t\t// Fritsch Carlson\r\n\t\t\t\tfor (var i = 1; i < segmentLengths.length; i++) {\r\n\t\t\t\t\tvar slope = segmentSlopes[i];\r\n\t\t\t\t\tvar prev_slope = segmentSlopes[i - 1];\r\n\t\t\t\t\tif (slope * prev_slope <= 0) { // sign(prev_slope) != sign(slpe)\r\n\t\t\t\t\t\tgradients.push(0);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar length = segmentLengths[i];\r\n\t\t\t\t\t\tvar prev_length = segmentLengths[i - 1];\r\n\t\t\t\t\t\tvar common = length + prev_length;\r\n\t\t\t\t\t\t//m = 3 (prev_length + length) / ((2 length + prev_length) / prev_slope + (length + 2 prev_length) / slope)\r\n\t\t\t\t\t\tgradients.push(3 * common / ((common + length) / prev_slope + (common + prev_length) / slope));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// Cardinal spline with t € [0,1]\r\n\t\t\t\t// Catmull-Rom for t = 0\r\n\t\t\t\tfor (var i = ps; i < points.length - ps; i += ps) {\r\n\t\t\t\t\tvar curX = i;\r\n\t\t\t\t\tvar curY = i + yPos;\t\r\n\t\t\t\t\tgradients.push(Number(curvedLinesOptions.tension) * (points[curY + ps] - points[curY - ps]) / (points[curX + ps] - points[curX - ps]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tgradients.push(segmentSlopes[segmentSlopes.length - 1]);\r\n\r\n\t\t\t//get the two major coefficients (c'_{oef1} and c'_{oef2}) for each segment spline\r\n\t\t\tvar coefs1 = [];\r\n\t\t\tvar coefs2 = [];\r\n\t\t\tfor (i = 0; i < segmentLengths.length; i++) {\r\n\t\t\t\tvar m_k = gradients[i];\r\n\t\t\t\tvar m_k_plus = gradients[i + 1];\r\n\t\t\t\tvar slope = segmentSlopes[i];\r\n\t\t\t\tvar invLength = 1 / segmentLengths[i];\r\n\t\t\t\tvar common = m_k + m_k_plus - slope - slope;\r\n\t\t\t\t\r\n\t\t\t\tcoefs1.push(common * invLength * invLength);\r\n\t\t\t\tcoefs2.push((slope - common - m_k) * invLength);\r\n\t\t\t}\r\n\r\n\t\t\t//create functions with from the coefficients and capture the parameters\r\n\t\t\tvar ret = [];\r\n\t\t\tfor (var i = 0; i < segmentLengths.length; i ++) {\r\n\t\t\t\tvar spline = function (x_k, coef1, coef2, coef3, coef4) {\r\n\t\t\t\t\t// spline for a segment\r\n\t\t\t\t\treturn function (x) {\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar diff = x - x_k;\r\n\t\t\t\t\t\tvar diffSq = diff * diff;\r\n\t\t\t\t\t\treturn coef1 * diff * diffSq + coef2 * diffSq + coef3 * diff + coef4;\r\n\t\t\t\t\t};\r\n\t\t\t\t};\t\t\t\r\n\t\t\r\n\t\t\t\tret.push(spline(points[i * ps], coefs1[i], coefs2[i], gradients[i], points[i * ps + yPos]));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn ret;\r\n\t\t}", "title": "" }, { "docid": "0e4bfe1269b6896c2a76273980f5ec62", "score": "0.5594661", "text": "function generateBezier(mX1, mY1, mX2, mY2) {\r\n\t\t\tvar NEWTON_ITERATIONS = 4,\r\n\t\t\t\t\tNEWTON_MIN_SLOPE = 0.001,\r\n\t\t\t\t\tSUBDIVISION_PRECISION = 0.0000001,\r\n\t\t\t\t\tSUBDIVISION_MAX_ITERATIONS = 10,\r\n\t\t\t\t\tkSplineTableSize = 11,\r\n\t\t\t\t\tkSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\r\n\t\t\t\t\tfloat32ArraySupported = \"Float32Array\" in window;\r\n\r\n\t\t\t/* Must contain four arguments. */\r\n\t\t\tif (arguments.length !== 4) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t/* Arguments must be numbers. */\r\n\t\t\tfor (var i = 0; i < 4; ++i) {\r\n\t\t\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/* X values must be in the [0, 1] range. */\r\n\t\t\tmX1 = Math.min(mX1, 1);\r\n\t\t\tmX2 = Math.min(mX2, 1);\r\n\t\t\tmX1 = Math.max(mX1, 0);\r\n\t\t\tmX2 = Math.max(mX2, 0);\r\n\r\n\t\t\tvar mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\r\n\r\n\t\t\tfunction A(aA1, aA2) {\r\n\t\t\t\treturn 1.0 - 3.0 * aA2 + 3.0 * aA1;\r\n\t\t\t}\r\n\t\t\tfunction B(aA1, aA2) {\r\n\t\t\t\treturn 3.0 * aA2 - 6.0 * aA1;\r\n\t\t\t}\r\n\t\t\tfunction C(aA1) {\r\n\t\t\t\treturn 3.0 * aA1;\r\n\t\t\t}\r\n\r\n\t\t\tfunction calcBezier(aT, aA1, aA2) {\r\n\t\t\t\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\r\n\t\t\t}\r\n\r\n\t\t\tfunction getSlope(aT, aA1, aA2) {\r\n\t\t\t\treturn 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\r\n\t\t\t}\r\n\r\n\t\t\tfunction newtonRaphsonIterate(aX, aGuessT) {\r\n\t\t\t\tfor (var i = 0; i < NEWTON_ITERATIONS; ++i) {\r\n\t\t\t\t\tvar currentSlope = getSlope(aGuessT, mX1, mX2);\r\n\r\n\t\t\t\t\tif (currentSlope === 0.0) {\r\n\t\t\t\t\t\treturn aGuessT;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar currentX = calcBezier(aGuessT, mX1, mX2) - aX;\r\n\t\t\t\t\taGuessT -= currentX / currentSlope;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn aGuessT;\r\n\t\t\t}\r\n\r\n\t\t\tfunction calcSampleValues() {\r\n\t\t\t\tfor (var i = 0; i < kSplineTableSize; ++i) {\r\n\t\t\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction binarySubdivide(aX, aA, aB) {\r\n\t\t\t\tvar currentX, currentT, i = 0;\r\n\r\n\t\t\t\tdo {\r\n\t\t\t\t\tcurrentT = aA + (aB - aA) / 2.0;\r\n\t\t\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\r\n\t\t\t\t\tif (currentX > 0.0) {\r\n\t\t\t\t\t\taB = currentT;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\taA = currentT;\r\n\t\t\t\t\t}\r\n\t\t\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\r\n\r\n\t\t\t\treturn currentT;\r\n\t\t\t}\r\n\r\n\t\t\tfunction getTForX(aX) {\r\n\t\t\t\tvar intervalStart = 0.0,\r\n\t\t\t\t\t\tcurrentSample = 1,\r\n\t\t\t\t\t\tlastSample = kSplineTableSize - 1;\r\n\r\n\t\t\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\r\n\t\t\t\t\tintervalStart += kSampleStepSize;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t--currentSample;\r\n\r\n\t\t\t\tvar dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\r\n\t\t\t\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\r\n\t\t\t\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\r\n\r\n\t\t\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\r\n\t\t\t\t\treturn newtonRaphsonIterate(aX, guessForT);\r\n\t\t\t\t} else if (initialSlope === 0.0) {\r\n\t\t\t\t\treturn guessForT;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar _precomputed = false;\r\n\r\n\t\t\tfunction precompute() {\r\n\t\t\t\t_precomputed = true;\r\n\t\t\t\tif (mX1 !== mY1 || mX2 !== mY2) {\r\n\t\t\t\t\tcalcSampleValues();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar f = function(aX) {\r\n\t\t\t\tif (!_precomputed) {\r\n\t\t\t\t\tprecompute();\r\n\t\t\t\t}\r\n\t\t\t\tif (mX1 === mY1 && mX2 === mY2) {\r\n\t\t\t\t\treturn aX;\r\n\t\t\t\t}\r\n\t\t\t\tif (aX === 0) {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t\tif (aX === 1) {\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn calcBezier(getTForX(aX), mY1, mY2);\r\n\t\t\t};\r\n\r\n\t\t\tf.getControlPoints = function() {\r\n\t\t\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\r\n\t\t\t};\r\n\r\n\t\t\tvar str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\r\n\t\t\tf.toString = function() {\r\n\t\t\t\treturn str;\r\n\t\t\t};\r\n\r\n\t\t\treturn f;\r\n\t\t}", "title": "" }, { "docid": "624e1ab6e6350e2d0f4c7ca978f41d5f", "score": "0.5585653", "text": "function createStarburst(radius, numPoints, radiusTransformFunc, centerPoint){\n\tcenterPoint = centerPoint ? centerPoint : JSX.vector.centerPoint().point;\n\tvar arcRadLength = 2 / numPoints;\n\tradiusTransformFunc = radiusTransformFunc ? radiusTransformFunc : function(radius, i){return radius;};\n\tfor (var i = 0; i < numPoints; i++) {\n\t\tvar tRadius = radiusTransformFunc(radius, i);\n\t\tvar radDegreesFromOrigin = arcRadLength * i * Math.PI;\n\t\tdrawLine([centerPoint, JSX.math.parametricCirclePoint(centerPoint, tRadius, radDegreesFromOrigin).point]);\n\t}\n}", "title": "" }, { "docid": "b70b10c7d9ad5704fc3e0571bbc7d3b8", "score": "0.5583214", "text": "function calculateCurve(TURN_POINTS, CURVE_POINTS) {\n len = TURN_POINTS.length;\n ly = TURN_POINTS[len - 2];\n ry = TURN_POINTS[len - 1];\n for (var i = 1; i < XDIS + 1; ++i) {\n CURVE_POINTS.push({'x':WIDTH + i, \n 'y':sin_func(ly, ry, i)});\n }\n}", "title": "" }, { "docid": "7ff93005f1a58f2eb0d5a5805d5df609", "score": "0.55778396", "text": "function generateCubicBezier(mX1,mY1,mX2,mY2){var NEWTON_ITERATIONS=4,NEWTON_MIN_SLOPE=0.001,SUBDIVISION_PRECISION=0.0000001,SUBDIVISION_MAX_ITERATIONS=10,kSplineTableSize=11,kSampleStepSize=1.0/(kSplineTableSize-1.0),float32ArraySupported=typeof Float32Array!=='undefined';/* Must contain four arguments. */if(arguments.length!==4){return false;}/* Arguments must be numbers. */for(var i=0;i<4;++i){if(typeof arguments[i]!==\"number\"||isNaN(arguments[i])||!isFinite(arguments[i])){return false;}}/* X values must be in the [0, 1] range. */mX1=Math.min(mX1,1);mX2=Math.min(mX2,1);mX1=Math.max(mX1,0);mX2=Math.max(mX2,0);var mSampleValues=float32ArraySupported?new Float32Array(kSplineTableSize):new Array(kSplineTableSize);function A(aA1,aA2){return 1.0-3.0*aA2+3.0*aA1;}function B(aA1,aA2){return 3.0*aA2-6.0*aA1;}function C(aA1){return 3.0*aA1;}function calcBezier(aT,aA1,aA2){return((A(aA1,aA2)*aT+B(aA1,aA2))*aT+C(aA1))*aT;}function getSlope(aT,aA1,aA2){return 3.0*A(aA1,aA2)*aT*aT+2.0*B(aA1,aA2)*aT+C(aA1);}function newtonRaphsonIterate(aX,aGuessT){for(var _i=0;_i<NEWTON_ITERATIONS;++_i){var currentSlope=getSlope(aGuessT,mX1,mX2);if(currentSlope===0.0){return aGuessT;}var currentX=calcBezier(aGuessT,mX1,mX2)-aX;aGuessT-=currentX/currentSlope;}return aGuessT;}function calcSampleValues(){for(var _i2=0;_i2<kSplineTableSize;++_i2){mSampleValues[_i2]=calcBezier(_i2*kSampleStepSize,mX1,mX2);}}function binarySubdivide(aX,aA,aB){var currentX,currentT,i=0;do{currentT=aA+(aB-aA)/2.0;currentX=calcBezier(currentT,mX1,mX2)-aX;if(currentX>0.0){aB=currentT;}else{aA=currentT;}}while(Math.abs(currentX)>SUBDIVISION_PRECISION&&++i<SUBDIVISION_MAX_ITERATIONS);return currentT;}function getTForX(aX){var intervalStart=0.0,currentSample=1,lastSample=kSplineTableSize-1;for(;currentSample!==lastSample&&mSampleValues[currentSample]<=aX;++currentSample){intervalStart+=kSampleStepSize;}--currentSample;var dist=(aX-mSampleValues[currentSample])/(mSampleValues[currentSample+1]-mSampleValues[currentSample]),guessForT=intervalStart+dist*kSampleStepSize,initialSlope=getSlope(guessForT,mX1,mX2);if(initialSlope>=NEWTON_MIN_SLOPE){return newtonRaphsonIterate(aX,guessForT);}else if(initialSlope===0.0){return guessForT;}else{return binarySubdivide(aX,intervalStart,intervalStart+kSampleStepSize);}}var _precomputed=false;function precompute(){_precomputed=true;if(mX1!==mY1||mX2!==mY2){calcSampleValues();}}var f=function f(aX){if(!_precomputed){precompute();}if(mX1===mY1&&mX2===mY2){return aX;}if(aX===0){return 0;}if(aX===1){return 1;}return calcBezier(getTForX(aX),mY1,mY2);};f.getControlPoints=function(){return[{x:mX1,y:mY1},{x:mX2,y:mY2}];};var str=\"generateBezier(\"+[mX1,mY1,mX2,mY2]+\")\";f.toString=function(){return str;};return f;}", "title": "" }, { "docid": "e532ae12bb74a0ed40b684a4fe5b6618", "score": "0.55754393", "text": "function strokes(strokes, config) {\n var outlines = [];\n var newPoint = [];\n config = config || {};\n\n var points = function(point) {\n newPoint = point;\n };\n\n var addStroke = function(lng, lat, options) {\n options = options || {};\n options.color = 'black';\n options.angle = 1.5;\n var outline = { options: options };\n if (config.latitudeFirst) {\n outline.lat = lng;\n outline.lng = lat;\n } else {\n outline.lng = lng;\n outline.lat = lat;\n }\n outlines.push(outline);\n };\n\n var drawStrokes = function(planet, context) {\n for (var i = 0; i < outlines.length; i++) {\n var outline = outlines[i];\n drawStroke(planet, context, outline, newPoint);\n }\n };\n\n var drawStroke = function(planet, context, outline, point) {\n\n var circle = d3.geo.circle()\n .origin([outline.lng, outline.lat])\n .angle(outline.options.angle)();\n\n context.beginPath();\n planet.path.context(context)(circle);\n context.strokeStyle = d3.rgb(outline.options.color);\n //something is going wrong here, not sure what\n //same as lines 322-324 of planetaryjs.js\n context.stroke();\n\n\n var bounds = planet.path.bounds(circle);\n if(bounds[0][0] < point[0] && bounds[1][0] > point[0] && bounds[0][1] < point[1] && bounds[1][1] > point[1]){\n //console.log('true');\n //this is theoreticlly where context.stroke() will go once it works\n };\n\n };\n\n return function (planet) {\n planet.plugins.strokes = {\n add: addStroke,\n point: points\n };\n\n planet.onDraw(function() {\n planet.withSavedContext(function(context) {\n drawStrokes(planet, context);\n });\n });\n };\n }", "title": "" }, { "docid": "bbc8e7e5dcb1a1cad81faddf7102f391", "score": "0.55743957", "text": "function graph(x1, y1)\n{\n point = interpolate(control_pts);\n bezier_ctx.beginPath();\n bezier_ctx.moveTo(x1, y1);\n bezier_ctx.lineTo(point.x, point.y);\n bezier_ctx.stroke();\n t += BEZIER_TIME_STEP;\n if(t < 1)\n {\n window.requestAnimationFrame(e => {\n graph(point.x, point.y);\n });\n }\n}", "title": "" }, { "docid": "5181848c073f5f8f396fa48a7f0fc23a", "score": "0.5573058", "text": "function getBrushCurve(points) {\n\t if (points.length === 0) {\n\t return '';\n\t }\n\t if (points.length === 1) {\n\t return getCirclePath(points[0]);\n\t }\n\t var segments = [];\n\t for (var i = 3; i < points.length; i += 3) {\n\t segments.push(getCurveSegmentPath(points[i - 3], points[i - 2], points[i - 1], points[i]));\n\t }\n\t return segments.join(' ');\n\t}", "title": "" }, { "docid": "71dcad1e21eca29f67030197c40dc21a", "score": "0.556394", "text": "function generateCubicBezier(mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = typeof Float32Array !== 'undefined';\n /* Must contain four arguments. */\n\n if (arguments.length !== 4) {\n return false;\n }\n /* Arguments must be numbers. */\n\n\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n /* X values must be in the [0, 1] range. */\n\n\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n }\n\n function B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n }\n\n function C(aA1) {\n return 3.0 * aA1;\n }\n\n function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n }\n\n function getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate(aX, aGuessT) {\n for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues() {\n for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) {\n mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide(aX, aA, aB) {\n var currentX,\n currentT,\n i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX(aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n\n if (mX1 !== mY1 || mX2 !== mY2) {\n calcSampleValues();\n }\n }\n\n var f = function f(aX) {\n if (!_precomputed) {\n precompute();\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return aX;\n }\n\n if (aX === 0) {\n return 0;\n }\n\n if (aX === 1) {\n return 1;\n }\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function () {\n return [{\n x: mX1,\n y: mY1\n }, {\n x: mX2,\n y: mY2\n }];\n };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\n f.toString = function () {\n return str;\n };\n\n return f;\n}", "title": "" }, { "docid": "71dcad1e21eca29f67030197c40dc21a", "score": "0.556394", "text": "function generateCubicBezier(mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = typeof Float32Array !== 'undefined';\n /* Must contain four arguments. */\n\n if (arguments.length !== 4) {\n return false;\n }\n /* Arguments must be numbers. */\n\n\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n /* X values must be in the [0, 1] range. */\n\n\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n }\n\n function B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n }\n\n function C(aA1) {\n return 3.0 * aA1;\n }\n\n function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n }\n\n function getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate(aX, aGuessT) {\n for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues() {\n for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) {\n mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide(aX, aA, aB) {\n var currentX,\n currentT,\n i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX(aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n\n if (mX1 !== mY1 || mX2 !== mY2) {\n calcSampleValues();\n }\n }\n\n var f = function f(aX) {\n if (!_precomputed) {\n precompute();\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return aX;\n }\n\n if (aX === 0) {\n return 0;\n }\n\n if (aX === 1) {\n return 1;\n }\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function () {\n return [{\n x: mX1,\n y: mY1\n }, {\n x: mX2,\n y: mY2\n }];\n };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\n f.toString = function () {\n return str;\n };\n\n return f;\n}", "title": "" }, { "docid": "2fc2dcb25eb4e4e6f3526b2070d4ab87", "score": "0.5555048", "text": "function drawCurve(ctx, ptsa, tension, isClosed, numOfSegments, showPoints) {\n\n \tctx.beginPath();\n \tdrawLines(ctx, getCurvePoints(ptsa, tension, isClosed, numOfSegments));\n \n \tif (showPoints) {\n \tctx.beginPath();\n \tfor(var i = 0; i < ptsa.length-1; i++) ctx.rect(ptsa[i].x - 2, ptsa[i].y - 2, 4, 4);\n \t}//if\n\n ctx.stroke();\n \t//ctx.closePath();\n}//function drawCurve", "title": "" }, { "docid": "14c744ea1d3c58566ec4d91d89f98a34", "score": "0.55545163", "text": "function processDatapoints(plot, series, datapoints) {\n var nrPoints = datapoints.points.length / datapoints.pointsize;\n var EPSILON = 0.5; //pretty large epsilon but save\n\n if (series.curvedLines.apply == true && series.originSeries === undefined && nrPoints > (1 + EPSILON)) {\n if (series.lines.fill) {\n\n var pointsTop = calculateCurvePoints(datapoints, series.curvedLines, 1)\n ,pointsBottom = calculateCurvePoints(datapoints, series.curvedLines, 2); //flot makes sure for us that we've got a second y point if fill is true !\n\n //Merge top and bottom curve\n datapoints.pointsize = 3;\n datapoints.points = [];\n var j = 0;\n var k = 0;\n var i = 0;\n var ps = 2;\n while (i < pointsTop.length || j < pointsBottom.length) {\n if (pointsTop[i] == pointsBottom[j]) {\n datapoints.points[k] = pointsTop[i];\n datapoints.points[k + 1] = pointsTop[i + 1];\n datapoints.points[k + 2] = pointsBottom[j + 1];\n j += ps;\n i += ps;\n\n } else if (pointsTop[i] < pointsBottom[j]) {\n datapoints.points[k] = pointsTop[i];\n datapoints.points[k + 1] = pointsTop[i + 1];\n datapoints.points[k + 2] = k > 0 ? datapoints.points[k-1] : null;\n i += ps;\n } else {\n datapoints.points[k] = pointsBottom[j];\n datapoints.points[k + 1] = k > 1 ? datapoints.points[k-2] : null;\n datapoints.points[k + 2] = pointsBottom[j + 1];\n j += ps;\n }\n k += 3;\n }\n } else if (series.lines.lineWidth > 0) {\n datapoints.points = calculateCurvePoints(datapoints, series.curvedLines, 1);\n datapoints.pointsize = 2;\n }\n }\n }", "title": "" }, { "docid": "9a85d4e951dffb2c85c5f602715aa6ca", "score": "0.55450135", "text": "function initPath()\r\n{\r\n var numPoints = 100;\r\n\r\n var height = 5;\r\n\r\n spline = new THREE.SplineCurve3(\r\n [\r\n new THREE.Vector3( -100 , height, -0.54 ),\r\n new THREE.Vector3( -78.5, height, -0.54 ),\r\n new THREE.Vector3( -69.32, height, -13.5 ),\r\n new THREE.Vector3( -55.2, height, -25 ),\r\n new THREE.Vector3( -40, height, -32.8 ),\r\n new THREE.Vector3( -23.1, height, -39 ),\r\n new THREE.Vector3( 0, height, -42.5 ),\r\n new THREE.Vector3( 22.76, height, -41.3 ),\r\n new THREE.Vector3( 45.1, height, -33.4 ),\r\n new THREE.Vector3( 58.45, height, -25.06 ),\r\n new THREE.Vector3( 71, height, -9.6 ),\r\n new THREE.Vector3( 74.11, height, 3.54 ),\r\n new THREE.Vector3( 68.36, height, 21.06 ),\r\n new THREE.Vector3( 57.74, height, 31.8 ),\r\n new THREE.Vector3( 43.43, height, 38.6 ),\r\n new THREE.Vector3( 21.51, height, 42.18 ),\r\n new THREE.Vector3( -3.13, height, 38.36 ),\r\n new THREE.Vector3( -24.1, 0 , 17.4 )\r\n ] );\r\n\r\n var material = new THREE.LineBasicMaterial( {\r\n color: 0x222222,\r\n } );\r\n\r\n var geometry = new THREE.Geometry();\r\n var splinePoints = spline.getPoints( numPoints );\r\n\r\n for ( var i = 0; i < splinePoints.length; i++ )\r\n {\r\n geometry.vertices.push( splinePoints[i] );\r\n }\r\n\r\n var line = new THREE.Line( geometry, material );\r\n //mg1_scene.add( line );\r\n \r\n}", "title": "" }, { "docid": "6159fde4d694107634a39c568eafd9c6", "score": "0.55246294", "text": "addCurveInterpolationPoints(numberOfPoints, color=''){\n let curveData = this.getCurveTone(color);\n let existingCurveData = this.getCurveTone(color);\n let originalLength = existingCurveData.length;\n\n let pointsToAdd = numberOfPoints;\n while(pointsToAdd){\n existingCurveData.push(existingCurveData[~~(Math.random() * originalLength)].slice());\n pointsToAdd --;\n }\n this.setCurveTone(existingCurveData, color);\n }", "title": "" }, { "docid": "230d93ddb29f86978c0ca782e7ae432a", "score": "0.55237514", "text": "function createHermiteSplines(datapoints, curvedLinesOptions, yPos) {\n\t\t\tvar points = datapoints.points;\n\t\t\tvar ps = datapoints.pointsize;\n\t\t\t\n\t\t\t// preparation get length (x_{k+1} - x_k) and slope s=(p_{k+1} - p_k) / (x_{k+1} - x_k) of the segments\n\t\t\tvar segmentLengths = [];\n\t\t\tvar segmentSlopes = [];\n\n\t\t\tfor (var i = 0; i < points.length - ps; i += ps) {\n\t\t\t\tvar curX = i;\n\t\t\t\tvar curY = i + yPos;\t\t\t\n\t\t\t\tvar dx = points[curX + ps] - points[curX];\n\t\t\t\tvar dy = points[curY + ps] - points[curY];\n\t\t\t\t\t\t\t\n\t\t\t\tsegmentLengths.push(dx);\n\t\t\t\tsegmentSlopes.push(dy / dx);\n\t\t\t}\n\n\t\t\t//get the values for the desired gradients m_k for all points k\n\t\t\t//depending on the used method the formula is different\n\t\t\tvar gradients = [segmentSlopes[0]];\t\n\t\t\tif (curvedLinesOptions.monotonicFit) {\n\t\t\t\t// Fritsch Carlson\n\t\t\t\tfor (var i = 1; i < segmentLengths.length; i++) {\n\t\t\t\t\tvar slope = segmentSlopes[i];\n\t\t\t\t\tvar prev_slope = segmentSlopes[i - 1];\n\t\t\t\t\tif (slope * prev_slope <= 0) { // sign(prev_slope) != sign(slpe)\n\t\t\t\t\t\tgradients.push(0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar length = segmentLengths[i];\n\t\t\t\t\t\tvar prev_length = segmentLengths[i - 1];\n\t\t\t\t\t\tvar common = length + prev_length;\n\t\t\t\t\t\t//m = 3 (prev_length + length) / ((2 length + prev_length) / prev_slope + (length + 2 prev_length) / slope)\n\t\t\t\t\t\tgradients.push(3 * common / ((common + length) / prev_slope + (common + prev_length) / slope));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Cardinal spline with t € [0,1]\n\t\t\t\t// Catmull-Rom for t = 0\n\t\t\t\tfor (var i = ps; i < points.length - ps; i += ps) {\n\t\t\t\t\tvar curX = i;\n\t\t\t\t\tvar curY = i + yPos;\t\n\t\t\t\t\tgradients.push(Number(curvedLinesOptions.tension) * (points[curY + ps] - points[curY - ps]) / (points[curX + ps] - points[curX - ps]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tgradients.push(segmentSlopes[segmentSlopes.length - 1]);\n\n\t\t\t//get the two major coefficients (c'_{oef1} and c'_{oef2}) for each segment spline\n\t\t\tvar coefs1 = [];\n\t\t\tvar coefs2 = [];\n\t\t\tfor (i = 0; i < segmentLengths.length; i++) {\n\t\t\t\tvar m_k = gradients[i];\n\t\t\t\tvar m_k_plus = gradients[i + 1];\n\t\t\t\tvar slope = segmentSlopes[i];\n\t\t\t\tvar invLength = 1 / segmentLengths[i];\n\t\t\t\tvar common = m_k + m_k_plus - slope - slope;\n\t\t\t\t\n\t\t\t\tcoefs1.push(common * invLength * invLength);\n\t\t\t\tcoefs2.push((slope - common - m_k) * invLength);\n\t\t\t}\n\n\t\t\t//create functions with from the coefficients and capture the parameters\n\t\t\tvar ret = [];\n\t\t\tfor (var i = 0; i < segmentLengths.length; i ++) {\n\t\t\t\tvar spline = function (x_k, coef1, coef2, coef3, coef4) {\n\t\t\t\t\t// spline for a segment\n\t\t\t\t\treturn function (x) {\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar diff = x - x_k;\n\t\t\t\t\t\tvar diffSq = diff * diff;\n\t\t\t\t\t\treturn coef1 * diff * diffSq + coef2 * diffSq + coef3 * diff + coef4;\n\t\t\t\t\t};\n\t\t\t\t};\t\t\t\n\t\t\n\t\t\t\tret.push(spline(points[i * ps], coefs1[i], coefs2[i], gradients[i], points[i * ps + yPos]));\n\t\t\t}\n\t\t\t\n\t\t\treturn ret;\n\t\t}", "title": "" }, { "docid": "230d93ddb29f86978c0ca782e7ae432a", "score": "0.55237514", "text": "function createHermiteSplines(datapoints, curvedLinesOptions, yPos) {\n\t\t\tvar points = datapoints.points;\n\t\t\tvar ps = datapoints.pointsize;\n\t\t\t\n\t\t\t// preparation get length (x_{k+1} - x_k) and slope s=(p_{k+1} - p_k) / (x_{k+1} - x_k) of the segments\n\t\t\tvar segmentLengths = [];\n\t\t\tvar segmentSlopes = [];\n\n\t\t\tfor (var i = 0; i < points.length - ps; i += ps) {\n\t\t\t\tvar curX = i;\n\t\t\t\tvar curY = i + yPos;\t\t\t\n\t\t\t\tvar dx = points[curX + ps] - points[curX];\n\t\t\t\tvar dy = points[curY + ps] - points[curY];\n\t\t\t\t\t\t\t\n\t\t\t\tsegmentLengths.push(dx);\n\t\t\t\tsegmentSlopes.push(dy / dx);\n\t\t\t}\n\n\t\t\t//get the values for the desired gradients m_k for all points k\n\t\t\t//depending on the used method the formula is different\n\t\t\tvar gradients = [segmentSlopes[0]];\t\n\t\t\tif (curvedLinesOptions.monotonicFit) {\n\t\t\t\t// Fritsch Carlson\n\t\t\t\tfor (var i = 1; i < segmentLengths.length; i++) {\n\t\t\t\t\tvar slope = segmentSlopes[i];\n\t\t\t\t\tvar prev_slope = segmentSlopes[i - 1];\n\t\t\t\t\tif (slope * prev_slope <= 0) { // sign(prev_slope) != sign(slpe)\n\t\t\t\t\t\tgradients.push(0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar length = segmentLengths[i];\n\t\t\t\t\t\tvar prev_length = segmentLengths[i - 1];\n\t\t\t\t\t\tvar common = length + prev_length;\n\t\t\t\t\t\t//m = 3 (prev_length + length) / ((2 length + prev_length) / prev_slope + (length + 2 prev_length) / slope)\n\t\t\t\t\t\tgradients.push(3 * common / ((common + length) / prev_slope + (common + prev_length) / slope));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Cardinal spline with t € [0,1]\n\t\t\t\t// Catmull-Rom for t = 0\n\t\t\t\tfor (var i = ps; i < points.length - ps; i += ps) {\n\t\t\t\t\tvar curX = i;\n\t\t\t\t\tvar curY = i + yPos;\t\n\t\t\t\t\tgradients.push(Number(curvedLinesOptions.tension) * (points[curY + ps] - points[curY - ps]) / (points[curX + ps] - points[curX - ps]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tgradients.push(segmentSlopes[segmentSlopes.length - 1]);\n\n\t\t\t//get the two major coefficients (c'_{oef1} and c'_{oef2}) for each segment spline\n\t\t\tvar coefs1 = [];\n\t\t\tvar coefs2 = [];\n\t\t\tfor (i = 0; i < segmentLengths.length; i++) {\n\t\t\t\tvar m_k = gradients[i];\n\t\t\t\tvar m_k_plus = gradients[i + 1];\n\t\t\t\tvar slope = segmentSlopes[i];\n\t\t\t\tvar invLength = 1 / segmentLengths[i];\n\t\t\t\tvar common = m_k + m_k_plus - slope - slope;\n\t\t\t\t\n\t\t\t\tcoefs1.push(common * invLength * invLength);\n\t\t\t\tcoefs2.push((slope - common - m_k) * invLength);\n\t\t\t}\n\n\t\t\t//create functions with from the coefficients and capture the parameters\n\t\t\tvar ret = [];\n\t\t\tfor (var i = 0; i < segmentLengths.length; i ++) {\n\t\t\t\tvar spline = function (x_k, coef1, coef2, coef3, coef4) {\n\t\t\t\t\t// spline for a segment\n\t\t\t\t\treturn function (x) {\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar diff = x - x_k;\n\t\t\t\t\t\tvar diffSq = diff * diff;\n\t\t\t\t\t\treturn coef1 * diff * diffSq + coef2 * diffSq + coef3 * diff + coef4;\n\t\t\t\t\t};\n\t\t\t\t};\t\t\t\n\t\t\n\t\t\t\tret.push(spline(points[i * ps], coefs1[i], coefs2[i], gradients[i], points[i * ps + yPos]));\n\t\t\t}\n\t\t\t\n\t\t\treturn ret;\n\t\t}", "title": "" }, { "docid": "6f8db32c9152a598321c4d8ceab94f00", "score": "0.5520331", "text": "function brushPaint(ppts){\n\t//console.log(\"BRUSH PAINT: PINTAR \" + ppts.length + \" PONTOS\");\n\n\tfor(var i = 0; i < ppts.length; i++){\n\n\t\tif(ppts[i].type == 'eraser'){\n\t\t\t//console.log(\"ERASER COLOR: \" + ppts[i].color);\n\t\t\ttmp_ctx.strokeStyle = '#ffffff';\n\t\t\ttmp_ctx.fillStyle = '#ffffff';\t\n\t\t}\n\t\telse{\n\t\t\ttmp_ctx.strokeStyle = ppts[i].color;\n\t\t\ttmp_ctx.fillStyle = ppts[i].color;\t\n\t\t}\n\t\ttmp_ctx.lineWidth = ppts[i].line_width;\n\t\ttmp_ctx.lineJoin = 'round';\n\t\ttmp_ctx.lineCap = 'round';\n\t\t//console.log(ppts[i].line_id);\n\n\t\tif(i > 0){\n\t\t\tif(ppts[i].line_id != ppts[i-1].line_id){\n\t\t\t\t//console.log(\"MUDAR LINHA!\");\n\t\t\t\t//e se for so um ponto?\n\t\t\t\t//verificar se ha \n\t\t\t\tif(ppts.length > i+2){\n\t\t\t\t\t//console.log(\"A\");\n\t\t\t\t\t//verificar se 2 posiçoes a frente é o mesmo id\n\t\t\t\t\tif(ppts[i+2].line_id == ppts[i].line_id){\n\t\t\t\t\t\t//console.log(\"B\");\n\t\t\t\t\t\ttmp_ctx.clearRect(0, 0, tmp_canvas.width, tmp_canvas.height);\n\n\t\t\t\t\t\ttmp_ctx.beginPath();\n\t\t\t\t\t\ttmp_ctx.moveTo(ppts[i].pos_x, ppts[i].pos_y);\n\n\t\t\t\t\t\tfor (var j = i; j < ppts.length - 2; j++) {\n\t\t\t\t\t\t\tvar c = (parseFloat(ppts[j].pos_x) + parseFloat(ppts[j + 1].pos_x)) / 2;\n\t\t\t\t\t\t\tvar d = (parseFloat(ppts[j].pos_y) + parseFloat(ppts[j + 1].pos_y)) / 2;\n\n\t\t\t\t\t\t\ttmp_ctx.quadraticCurveTo(ppts[j].pos_x, ppts[j].pos_y, c, d);\n\t\t\t\t\t\t\tif(ppts[j].line_id != ppts[j+2].line_id)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// For the last 2 points\n\t\t\t\t\t\ttmp_ctx.quadraticCurveTo(ppts[j].pos_x, ppts[j].pos_y, ppts[j + 1].pos_x, ppts[j + 1].pos_y);\n\t\t\t\t\t\ttmp_ctx.stroke();\n\t\t\t\t\t\tctx.drawImage(tmp_canvas, 0, 0);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttmp_ctx.beginPath();\n\t\t\t\t\t\ttmp_ctx.arc(ppts[i].pos_x, ppts[i].pos_y, tmp_ctx.lineWidth / 2, 0, Math.PI * 2, !0);\n\t\t\t\t\t\ttmp_ctx.fill();\n\t\t\t\t\t\ttmp_ctx.closePath();\n\t\t\t\t\t\tctx.drawImage(tmp_canvas, 0, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttmp_ctx.beginPath();\n\t\t\t\t\ttmp_ctx.arc(ppts[i].pos_x, ppts[i].pos_y, tmp_ctx.lineWidth / 2, 0, Math.PI * 2, !0);\n\t\t\t\t\ttmp_ctx.fill();\n\t\t\t\t\ttmp_ctx.closePath();\n\t\t\t\t\tctx.drawImage(tmp_canvas, 0, 0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(ppts.length > 3){\n\t\t\t\tif(ppts[2].line_id == ppts[0].line_id){\n\t\t\t\t\t\t//tmp_ctx.clearRect(0, 0, tmp_canvas.width, tmp_canvas.height);\n\n\t\t\t\t\t\ttmp_ctx.beginPath();\n\t\t\t\t\t\ttmp_ctx.moveTo(ppts[0].pos_x, ppts[0].pos_y);\n\n\t\t\t\t\t\tfor (var j = 0; j < ppts.length - 2; j++) {\n\t\t\t\t\t\t\t//console.log(ppts[j].pos_x + \" / \" + ppts[j + 1].pos_x);\n\t\t\t\t\t\t\t//console.log(ppts[j].pos_y + \" / \" + ppts[j + 1].pos_y);\n\n\t\t\t\t\t\t\tvar c = (parseFloat(ppts[j].pos_x) + parseFloat(ppts[j + 1].pos_x)) / 2;\n\t\t\t\t\t\t\tvar d = (parseFloat(ppts[j].pos_y) + parseFloat(ppts[j + 1].pos_y)) / 2;\n\n\t\t\t\t\t\t\t//console.log(\"X: \" + ppts[j].pos_x + \" / Y: \" + ppts[j].pos_y);\n\t\t\t\t\t\t\t//console.log(\"C: \" + c + \" / D: \" + d);\n\t\t\t\t\t\t\ttmp_ctx.quadraticCurveTo(ppts[j].pos_x, ppts[j].pos_y, c, d);\n\t\t\t\t\t\t\tif(ppts[j].line_id != ppts[j+2].line_id)\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// For the last 2 points\n\t\t\t\t\t\ttmp_ctx.quadraticCurveTo(ppts[j].pos_x, ppts[j].pos_y, ppts[j + 1].pos_x, ppts[j + 1].pos_y);\n\t\t\t\t\t\ttmp_ctx.stroke();\n\t\t\t\t\t\tctx.drawImage(tmp_canvas, 0, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//console.log(\"X\");\n\t\t\ttmp_ctx.beginPath();\n\t\t\ttmp_ctx.arc(ppts[i].pos_x, ppts[i].pos_y, tmp_ctx.lineWidth / 2, 0, Math.PI * 2, !0);\n\t\t\ttmp_ctx.fill();\n\t\t\ttmp_ctx.closePath();\n\t\t\tctx.drawImage(tmp_canvas, 0, 0);\n\t\t}\n\t}\n\tctx.drawImage(tmp_canvas, 0, 0);\n}", "title": "" }, { "docid": "01597bc3b9b62d122e239a24e0ea1659", "score": "0.5515603", "text": "function generateBezier(mX1, mY1, mX2, mY2) {\n\t\t\tvar NEWTON_ITERATIONS = 4,\n\t\t\t\t\tNEWTON_MIN_SLOPE = 0.001,\n\t\t\t\t\tSUBDIVISION_PRECISION = 0.0000001,\n\t\t\t\t\tSUBDIVISION_MAX_ITERATIONS = 10,\n\t\t\t\t\tkSplineTableSize = 11,\n\t\t\t\t\tkSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n\t\t\t\t\tfloat32ArraySupported = \"Float32Array\" in window;\n\n\t\t\t/* Must contain four arguments. */\n\t\t\tif (arguments.length !== 4) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/* Arguments must be numbers. */\n\t\t\tfor (var i = 0; i < 4; ++i) {\n\t\t\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* X values must be in the [0, 1] range. */\n\t\t\tmX1 = Math.min(mX1, 1);\n\t\t\tmX2 = Math.min(mX2, 1);\n\t\t\tmX1 = Math.max(mX1, 0);\n\t\t\tmX2 = Math.max(mX2, 0);\n\n\t\t\tvar mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n\t\t\tfunction A(aA1, aA2) {\n\t\t\t\treturn 1.0 - 3.0 * aA2 + 3.0 * aA1;\n\t\t\t}\n\t\t\tfunction B(aA1, aA2) {\n\t\t\t\treturn 3.0 * aA2 - 6.0 * aA1;\n\t\t\t}\n\t\t\tfunction C(aA1) {\n\t\t\t\treturn 3.0 * aA1;\n\t\t\t}\n\n\t\t\tfunction calcBezier(aT, aA1, aA2) {\n\t\t\t\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n\t\t\t}\n\n\t\t\tfunction getSlope(aT, aA1, aA2) {\n\t\t\t\treturn 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n\t\t\t}\n\n\t\t\tfunction newtonRaphsonIterate(aX, aGuessT) {\n\t\t\t\tfor (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t\t\t\t\tvar currentSlope = getSlope(aGuessT, mX1, mX2);\n\n\t\t\t\t\tif (currentSlope === 0.0) {\n\t\t\t\t\t\treturn aGuessT;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t\t\t\t\taGuessT -= currentX / currentSlope;\n\t\t\t\t}\n\n\t\t\t\treturn aGuessT;\n\t\t\t}\n\n\t\t\tfunction calcSampleValues() {\n\t\t\t\tfor (var i = 0; i < kSplineTableSize; ++i) {\n\t\t\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction binarySubdivide(aX, aA, aB) {\n\t\t\t\tvar currentX, currentT, i = 0;\n\n\t\t\t\tdo {\n\t\t\t\t\tcurrentT = aA + (aB - aA) / 2.0;\n\t\t\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\n\t\t\t\t\tif (currentX > 0.0) {\n\t\t\t\t\t\taB = currentT;\n\t\t\t\t\t} else {\n\t\t\t\t\t\taA = currentT;\n\t\t\t\t\t}\n\t\t\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n\t\t\t\treturn currentT;\n\t\t\t}\n\n\t\t\tfunction getTForX(aX) {\n\t\t\t\tvar intervalStart = 0.0,\n\t\t\t\t\t\tcurrentSample = 1,\n\t\t\t\t\t\tlastSample = kSplineTableSize - 1;\n\n\t\t\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t\t\t\t\tintervalStart += kSampleStepSize;\n\t\t\t\t}\n\n\t\t\t\t--currentSample;\n\n\t\t\t\tvar dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n\t\t\t\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\n\t\t\t\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\n\n\t\t\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\n\t\t\t\t\treturn newtonRaphsonIterate(aX, guessForT);\n\t\t\t\t} else if (initialSlope === 0.0) {\n\t\t\t\t\treturn guessForT;\n\t\t\t\t} else {\n\t\t\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _precomputed = false;\n\n\t\t\tfunction precompute() {\n\t\t\t\t_precomputed = true;\n\t\t\t\tif (mX1 !== mY1 || mX2 !== mY2) {\n\t\t\t\t\tcalcSampleValues();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar f = function(aX) {\n\t\t\t\tif (!_precomputed) {\n\t\t\t\t\tprecompute();\n\t\t\t\t}\n\t\t\t\tif (mX1 === mY1 && mX2 === mY2) {\n\t\t\t\t\treturn aX;\n\t\t\t\t}\n\t\t\t\tif (aX === 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (aX === 1) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\treturn calcBezier(getTForX(aX), mY1, mY2);\n\t\t\t};\n\n\t\t\tf.getControlPoints = function() {\n\t\t\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\n\t\t\t};\n\n\t\t\tvar str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\t\t\tf.toString = function() {\n\t\t\t\treturn str;\n\t\t\t};\n\n\t\t\treturn f;\n\t\t}", "title": "" }, { "docid": "01597bc3b9b62d122e239a24e0ea1659", "score": "0.5515603", "text": "function generateBezier(mX1, mY1, mX2, mY2) {\n\t\t\tvar NEWTON_ITERATIONS = 4,\n\t\t\t\t\tNEWTON_MIN_SLOPE = 0.001,\n\t\t\t\t\tSUBDIVISION_PRECISION = 0.0000001,\n\t\t\t\t\tSUBDIVISION_MAX_ITERATIONS = 10,\n\t\t\t\t\tkSplineTableSize = 11,\n\t\t\t\t\tkSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n\t\t\t\t\tfloat32ArraySupported = \"Float32Array\" in window;\n\n\t\t\t/* Must contain four arguments. */\n\t\t\tif (arguments.length !== 4) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/* Arguments must be numbers. */\n\t\t\tfor (var i = 0; i < 4; ++i) {\n\t\t\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* X values must be in the [0, 1] range. */\n\t\t\tmX1 = Math.min(mX1, 1);\n\t\t\tmX2 = Math.min(mX2, 1);\n\t\t\tmX1 = Math.max(mX1, 0);\n\t\t\tmX2 = Math.max(mX2, 0);\n\n\t\t\tvar mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n\t\t\tfunction A(aA1, aA2) {\n\t\t\t\treturn 1.0 - 3.0 * aA2 + 3.0 * aA1;\n\t\t\t}\n\t\t\tfunction B(aA1, aA2) {\n\t\t\t\treturn 3.0 * aA2 - 6.0 * aA1;\n\t\t\t}\n\t\t\tfunction C(aA1) {\n\t\t\t\treturn 3.0 * aA1;\n\t\t\t}\n\n\t\t\tfunction calcBezier(aT, aA1, aA2) {\n\t\t\t\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n\t\t\t}\n\n\t\t\tfunction getSlope(aT, aA1, aA2) {\n\t\t\t\treturn 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n\t\t\t}\n\n\t\t\tfunction newtonRaphsonIterate(aX, aGuessT) {\n\t\t\t\tfor (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t\t\t\t\tvar currentSlope = getSlope(aGuessT, mX1, mX2);\n\n\t\t\t\t\tif (currentSlope === 0.0) {\n\t\t\t\t\t\treturn aGuessT;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t\t\t\t\taGuessT -= currentX / currentSlope;\n\t\t\t\t}\n\n\t\t\t\treturn aGuessT;\n\t\t\t}\n\n\t\t\tfunction calcSampleValues() {\n\t\t\t\tfor (var i = 0; i < kSplineTableSize; ++i) {\n\t\t\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction binarySubdivide(aX, aA, aB) {\n\t\t\t\tvar currentX, currentT, i = 0;\n\n\t\t\t\tdo {\n\t\t\t\t\tcurrentT = aA + (aB - aA) / 2.0;\n\t\t\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\n\t\t\t\t\tif (currentX > 0.0) {\n\t\t\t\t\t\taB = currentT;\n\t\t\t\t\t} else {\n\t\t\t\t\t\taA = currentT;\n\t\t\t\t\t}\n\t\t\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n\t\t\t\treturn currentT;\n\t\t\t}\n\n\t\t\tfunction getTForX(aX) {\n\t\t\t\tvar intervalStart = 0.0,\n\t\t\t\t\t\tcurrentSample = 1,\n\t\t\t\t\t\tlastSample = kSplineTableSize - 1;\n\n\t\t\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t\t\t\t\tintervalStart += kSampleStepSize;\n\t\t\t\t}\n\n\t\t\t\t--currentSample;\n\n\t\t\t\tvar dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n\t\t\t\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\n\t\t\t\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\n\n\t\t\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\n\t\t\t\t\treturn newtonRaphsonIterate(aX, guessForT);\n\t\t\t\t} else if (initialSlope === 0.0) {\n\t\t\t\t\treturn guessForT;\n\t\t\t\t} else {\n\t\t\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _precomputed = false;\n\n\t\t\tfunction precompute() {\n\t\t\t\t_precomputed = true;\n\t\t\t\tif (mX1 !== mY1 || mX2 !== mY2) {\n\t\t\t\t\tcalcSampleValues();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar f = function(aX) {\n\t\t\t\tif (!_precomputed) {\n\t\t\t\t\tprecompute();\n\t\t\t\t}\n\t\t\t\tif (mX1 === mY1 && mX2 === mY2) {\n\t\t\t\t\treturn aX;\n\t\t\t\t}\n\t\t\t\tif (aX === 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (aX === 1) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\treturn calcBezier(getTForX(aX), mY1, mY2);\n\t\t\t};\n\n\t\t\tf.getControlPoints = function() {\n\t\t\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\n\t\t\t};\n\n\t\t\tvar str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\t\t\tf.toString = function() {\n\t\t\t\treturn str;\n\t\t\t};\n\n\t\t\treturn f;\n\t\t}", "title": "" }, { "docid": "01597bc3b9b62d122e239a24e0ea1659", "score": "0.5515603", "text": "function generateBezier(mX1, mY1, mX2, mY2) {\n\t\t\tvar NEWTON_ITERATIONS = 4,\n\t\t\t\t\tNEWTON_MIN_SLOPE = 0.001,\n\t\t\t\t\tSUBDIVISION_PRECISION = 0.0000001,\n\t\t\t\t\tSUBDIVISION_MAX_ITERATIONS = 10,\n\t\t\t\t\tkSplineTableSize = 11,\n\t\t\t\t\tkSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n\t\t\t\t\tfloat32ArraySupported = \"Float32Array\" in window;\n\n\t\t\t/* Must contain four arguments. */\n\t\t\tif (arguments.length !== 4) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/* Arguments must be numbers. */\n\t\t\tfor (var i = 0; i < 4; ++i) {\n\t\t\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* X values must be in the [0, 1] range. */\n\t\t\tmX1 = Math.min(mX1, 1);\n\t\t\tmX2 = Math.min(mX2, 1);\n\t\t\tmX1 = Math.max(mX1, 0);\n\t\t\tmX2 = Math.max(mX2, 0);\n\n\t\t\tvar mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n\t\t\tfunction A(aA1, aA2) {\n\t\t\t\treturn 1.0 - 3.0 * aA2 + 3.0 * aA1;\n\t\t\t}\n\t\t\tfunction B(aA1, aA2) {\n\t\t\t\treturn 3.0 * aA2 - 6.0 * aA1;\n\t\t\t}\n\t\t\tfunction C(aA1) {\n\t\t\t\treturn 3.0 * aA1;\n\t\t\t}\n\n\t\t\tfunction calcBezier(aT, aA1, aA2) {\n\t\t\t\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n\t\t\t}\n\n\t\t\tfunction getSlope(aT, aA1, aA2) {\n\t\t\t\treturn 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n\t\t\t}\n\n\t\t\tfunction newtonRaphsonIterate(aX, aGuessT) {\n\t\t\t\tfor (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t\t\t\t\tvar currentSlope = getSlope(aGuessT, mX1, mX2);\n\n\t\t\t\t\tif (currentSlope === 0.0) {\n\t\t\t\t\t\treturn aGuessT;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t\t\t\t\taGuessT -= currentX / currentSlope;\n\t\t\t\t}\n\n\t\t\t\treturn aGuessT;\n\t\t\t}\n\n\t\t\tfunction calcSampleValues() {\n\t\t\t\tfor (var i = 0; i < kSplineTableSize; ++i) {\n\t\t\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction binarySubdivide(aX, aA, aB) {\n\t\t\t\tvar currentX, currentT, i = 0;\n\n\t\t\t\tdo {\n\t\t\t\t\tcurrentT = aA + (aB - aA) / 2.0;\n\t\t\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\n\t\t\t\t\tif (currentX > 0.0) {\n\t\t\t\t\t\taB = currentT;\n\t\t\t\t\t} else {\n\t\t\t\t\t\taA = currentT;\n\t\t\t\t\t}\n\t\t\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n\t\t\t\treturn currentT;\n\t\t\t}\n\n\t\t\tfunction getTForX(aX) {\n\t\t\t\tvar intervalStart = 0.0,\n\t\t\t\t\t\tcurrentSample = 1,\n\t\t\t\t\t\tlastSample = kSplineTableSize - 1;\n\n\t\t\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t\t\t\t\tintervalStart += kSampleStepSize;\n\t\t\t\t}\n\n\t\t\t\t--currentSample;\n\n\t\t\t\tvar dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n\t\t\t\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\n\t\t\t\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\n\n\t\t\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\n\t\t\t\t\treturn newtonRaphsonIterate(aX, guessForT);\n\t\t\t\t} else if (initialSlope === 0.0) {\n\t\t\t\t\treturn guessForT;\n\t\t\t\t} else {\n\t\t\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _precomputed = false;\n\n\t\t\tfunction precompute() {\n\t\t\t\t_precomputed = true;\n\t\t\t\tif (mX1 !== mY1 || mX2 !== mY2) {\n\t\t\t\t\tcalcSampleValues();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar f = function(aX) {\n\t\t\t\tif (!_precomputed) {\n\t\t\t\t\tprecompute();\n\t\t\t\t}\n\t\t\t\tif (mX1 === mY1 && mX2 === mY2) {\n\t\t\t\t\treturn aX;\n\t\t\t\t}\n\t\t\t\tif (aX === 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (aX === 1) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\treturn calcBezier(getTForX(aX), mY1, mY2);\n\t\t\t};\n\n\t\t\tf.getControlPoints = function() {\n\t\t\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\n\t\t\t};\n\n\t\t\tvar str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\t\t\tf.toString = function() {\n\t\t\t\treturn str;\n\t\t\t};\n\n\t\t\treturn f;\n\t\t}", "title": "" }, { "docid": "01597bc3b9b62d122e239a24e0ea1659", "score": "0.5515603", "text": "function generateBezier(mX1, mY1, mX2, mY2) {\n\t\t\tvar NEWTON_ITERATIONS = 4,\n\t\t\t\t\tNEWTON_MIN_SLOPE = 0.001,\n\t\t\t\t\tSUBDIVISION_PRECISION = 0.0000001,\n\t\t\t\t\tSUBDIVISION_MAX_ITERATIONS = 10,\n\t\t\t\t\tkSplineTableSize = 11,\n\t\t\t\t\tkSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n\t\t\t\t\tfloat32ArraySupported = \"Float32Array\" in window;\n\n\t\t\t/* Must contain four arguments. */\n\t\t\tif (arguments.length !== 4) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/* Arguments must be numbers. */\n\t\t\tfor (var i = 0; i < 4; ++i) {\n\t\t\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* X values must be in the [0, 1] range. */\n\t\t\tmX1 = Math.min(mX1, 1);\n\t\t\tmX2 = Math.min(mX2, 1);\n\t\t\tmX1 = Math.max(mX1, 0);\n\t\t\tmX2 = Math.max(mX2, 0);\n\n\t\t\tvar mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n\t\t\tfunction A(aA1, aA2) {\n\t\t\t\treturn 1.0 - 3.0 * aA2 + 3.0 * aA1;\n\t\t\t}\n\t\t\tfunction B(aA1, aA2) {\n\t\t\t\treturn 3.0 * aA2 - 6.0 * aA1;\n\t\t\t}\n\t\t\tfunction C(aA1) {\n\t\t\t\treturn 3.0 * aA1;\n\t\t\t}\n\n\t\t\tfunction calcBezier(aT, aA1, aA2) {\n\t\t\t\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n\t\t\t}\n\n\t\t\tfunction getSlope(aT, aA1, aA2) {\n\t\t\t\treturn 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n\t\t\t}\n\n\t\t\tfunction newtonRaphsonIterate(aX, aGuessT) {\n\t\t\t\tfor (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t\t\t\t\tvar currentSlope = getSlope(aGuessT, mX1, mX2);\n\n\t\t\t\t\tif (currentSlope === 0.0) {\n\t\t\t\t\t\treturn aGuessT;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t\t\t\t\taGuessT -= currentX / currentSlope;\n\t\t\t\t}\n\n\t\t\t\treturn aGuessT;\n\t\t\t}\n\n\t\t\tfunction calcSampleValues() {\n\t\t\t\tfor (var i = 0; i < kSplineTableSize; ++i) {\n\t\t\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction binarySubdivide(aX, aA, aB) {\n\t\t\t\tvar currentX, currentT, i = 0;\n\n\t\t\t\tdo {\n\t\t\t\t\tcurrentT = aA + (aB - aA) / 2.0;\n\t\t\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\n\t\t\t\t\tif (currentX > 0.0) {\n\t\t\t\t\t\taB = currentT;\n\t\t\t\t\t} else {\n\t\t\t\t\t\taA = currentT;\n\t\t\t\t\t}\n\t\t\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n\t\t\t\treturn currentT;\n\t\t\t}\n\n\t\t\tfunction getTForX(aX) {\n\t\t\t\tvar intervalStart = 0.0,\n\t\t\t\t\t\tcurrentSample = 1,\n\t\t\t\t\t\tlastSample = kSplineTableSize - 1;\n\n\t\t\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t\t\t\t\tintervalStart += kSampleStepSize;\n\t\t\t\t}\n\n\t\t\t\t--currentSample;\n\n\t\t\t\tvar dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n\t\t\t\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\n\t\t\t\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\n\n\t\t\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\n\t\t\t\t\treturn newtonRaphsonIterate(aX, guessForT);\n\t\t\t\t} else if (initialSlope === 0.0) {\n\t\t\t\t\treturn guessForT;\n\t\t\t\t} else {\n\t\t\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _precomputed = false;\n\n\t\t\tfunction precompute() {\n\t\t\t\t_precomputed = true;\n\t\t\t\tif (mX1 !== mY1 || mX2 !== mY2) {\n\t\t\t\t\tcalcSampleValues();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar f = function(aX) {\n\t\t\t\tif (!_precomputed) {\n\t\t\t\t\tprecompute();\n\t\t\t\t}\n\t\t\t\tif (mX1 === mY1 && mX2 === mY2) {\n\t\t\t\t\treturn aX;\n\t\t\t\t}\n\t\t\t\tif (aX === 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (aX === 1) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\treturn calcBezier(getTForX(aX), mY1, mY2);\n\t\t\t};\n\n\t\t\tf.getControlPoints = function() {\n\t\t\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\n\t\t\t};\n\n\t\t\tvar str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\t\t\tf.toString = function() {\n\t\t\t\treturn str;\n\t\t\t};\n\n\t\t\treturn f;\n\t\t}", "title": "" }, { "docid": "01597bc3b9b62d122e239a24e0ea1659", "score": "0.5515603", "text": "function generateBezier(mX1, mY1, mX2, mY2) {\n\t\t\tvar NEWTON_ITERATIONS = 4,\n\t\t\t\t\tNEWTON_MIN_SLOPE = 0.001,\n\t\t\t\t\tSUBDIVISION_PRECISION = 0.0000001,\n\t\t\t\t\tSUBDIVISION_MAX_ITERATIONS = 10,\n\t\t\t\t\tkSplineTableSize = 11,\n\t\t\t\t\tkSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n\t\t\t\t\tfloat32ArraySupported = \"Float32Array\" in window;\n\n\t\t\t/* Must contain four arguments. */\n\t\t\tif (arguments.length !== 4) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/* Arguments must be numbers. */\n\t\t\tfor (var i = 0; i < 4; ++i) {\n\t\t\t\tif (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/* X values must be in the [0, 1] range. */\n\t\t\tmX1 = Math.min(mX1, 1);\n\t\t\tmX2 = Math.min(mX2, 1);\n\t\t\tmX1 = Math.max(mX1, 0);\n\t\t\tmX2 = Math.max(mX2, 0);\n\n\t\t\tvar mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n\t\t\tfunction A(aA1, aA2) {\n\t\t\t\treturn 1.0 - 3.0 * aA2 + 3.0 * aA1;\n\t\t\t}\n\t\t\tfunction B(aA1, aA2) {\n\t\t\t\treturn 3.0 * aA2 - 6.0 * aA1;\n\t\t\t}\n\t\t\tfunction C(aA1) {\n\t\t\t\treturn 3.0 * aA1;\n\t\t\t}\n\n\t\t\tfunction calcBezier(aT, aA1, aA2) {\n\t\t\t\treturn ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n\t\t\t}\n\n\t\t\tfunction getSlope(aT, aA1, aA2) {\n\t\t\t\treturn 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n\t\t\t}\n\n\t\t\tfunction newtonRaphsonIterate(aX, aGuessT) {\n\t\t\t\tfor (var i = 0; i < NEWTON_ITERATIONS; ++i) {\n\t\t\t\t\tvar currentSlope = getSlope(aGuessT, mX1, mX2);\n\n\t\t\t\t\tif (currentSlope === 0.0) {\n\t\t\t\t\t\treturn aGuessT;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n\t\t\t\t\taGuessT -= currentX / currentSlope;\n\t\t\t\t}\n\n\t\t\t\treturn aGuessT;\n\t\t\t}\n\n\t\t\tfunction calcSampleValues() {\n\t\t\t\tfor (var i = 0; i < kSplineTableSize; ++i) {\n\t\t\t\t\tmSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction binarySubdivide(aX, aA, aB) {\n\t\t\t\tvar currentX, currentT, i = 0;\n\n\t\t\t\tdo {\n\t\t\t\t\tcurrentT = aA + (aB - aA) / 2.0;\n\t\t\t\t\tcurrentX = calcBezier(currentT, mX1, mX2) - aX;\n\t\t\t\t\tif (currentX > 0.0) {\n\t\t\t\t\t\taB = currentT;\n\t\t\t\t\t} else {\n\t\t\t\t\t\taA = currentT;\n\t\t\t\t\t}\n\t\t\t\t} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n\t\t\t\treturn currentT;\n\t\t\t}\n\n\t\t\tfunction getTForX(aX) {\n\t\t\t\tvar intervalStart = 0.0,\n\t\t\t\t\t\tcurrentSample = 1,\n\t\t\t\t\t\tlastSample = kSplineTableSize - 1;\n\n\t\t\t\tfor (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n\t\t\t\t\tintervalStart += kSampleStepSize;\n\t\t\t\t}\n\n\t\t\t\t--currentSample;\n\n\t\t\t\tvar dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n\t\t\t\t\t\tguessForT = intervalStart + dist * kSampleStepSize,\n\t\t\t\t\t\tinitialSlope = getSlope(guessForT, mX1, mX2);\n\n\t\t\t\tif (initialSlope >= NEWTON_MIN_SLOPE) {\n\t\t\t\t\treturn newtonRaphsonIterate(aX, guessForT);\n\t\t\t\t} else if (initialSlope === 0.0) {\n\t\t\t\t\treturn guessForT;\n\t\t\t\t} else {\n\t\t\t\t\treturn binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _precomputed = false;\n\n\t\t\tfunction precompute() {\n\t\t\t\t_precomputed = true;\n\t\t\t\tif (mX1 !== mY1 || mX2 !== mY2) {\n\t\t\t\t\tcalcSampleValues();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar f = function(aX) {\n\t\t\t\tif (!_precomputed) {\n\t\t\t\t\tprecompute();\n\t\t\t\t}\n\t\t\t\tif (mX1 === mY1 && mX2 === mY2) {\n\t\t\t\t\treturn aX;\n\t\t\t\t}\n\t\t\t\tif (aX === 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (aX === 1) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\n\t\t\t\treturn calcBezier(getTForX(aX), mY1, mY2);\n\t\t\t};\n\n\t\t\tf.getControlPoints = function() {\n\t\t\t\treturn [{x: mX1, y: mY1}, {x: mX2, y: mY2}];\n\t\t\t};\n\n\t\t\tvar str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\t\t\tf.toString = function() {\n\t\t\t\treturn str;\n\t\t\t};\n\n\t\t\treturn f;\n\t\t}", "title": "" }, { "docid": "2427387e045667af27565f54c91d9e1b", "score": "0.55074245", "text": "function slerp()\n{\n\t/*Loop through each spline*/\n\tfor(var i = 0; i < splineRotations.length; i += 1)\n\t{\n\t\t/*loop through each control point in that spline*/\n\t\tfor(var j = 0; j < splineRotations[i].length; j += 1)\n\t\t{\n\t\t\t/*between each control point, loop the proper number of times based on the transition time of the current spline*/\n\t\t\tfor(var t = 0; t < 1 ; t += 1/(splineTransitionTimes[i] * 5))\n\t\t\t{\n\t\t\t\t/*a modulous function that accounts for negative values. used to set the proper points for the spline subsections*/\n\t\t\t\tfunction mod(n, m)\n\t\t\t\t{\n\t\t\t\t\treturn ((m % n) + n) % n;\n\t\t\t\t};\n\t\t\t\t/*a vec4 used for the spherical linear interpolation*/\n\t\t\t\tvar newQuat = new THREE.Vector4();\n\t\t\t\t/*the euler rotations of interest for this piece of the slerp*/\n\t\t\t\tvar rot0 = splineRotations[i][j];\n\t\t\t\tvar rot1 = splineRotations[i][mod(splineRotations[i].length, j + 1)];\n\t\t\t\t/*convert the eulers to quaternions*/\n\t\t\t\trot0 = eulerToQuaternion(rot0);\n\t\t\t\trot1 = eulerToQuaternion(rot1);\n\t\t\t\t/*calculate the angle between the quaternions of interest*/\n\t\t\t\tvar cosineHalfTheta = (rot0.w * rot1.w) + (rot0.x * rot1.x) + (rot0.y * rot1.y) + (rot0.z * rot1.z);\n\t\t\t\t/*theta = 0: can return rot0*/\n\t\t\t\tif(Math.abs(cosineHalfTheta) >= 1.0)\n\t\t\t\t{\n\t\t\t\t\tnewQuat.w = rot0.w;\n\t\t\t\t\tnewQuat.x = rot0.x;\n\t\t\t\t\tnewQuat.y = rot0.y;\n\t\t\t\t\tnewQuat.z = rot0.z;\n\t\t\t\t\tslerpRotations.push(quaternionToEuler(newQuat));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t/*values used in comparisons*/\n\t\t\t\tvar halfTheta = Math.acos(cosineHalfTheta);\n\t\t\t\tvar sinHalfTheta = Math.sqrt(1.0 - (cosineHalfTheta * cosineHalfTheta));\n\t\t\t\t/*if the angle is equal to 180 degrees then the result is not defined, rotate aroudn any axis normal to rot0 or rot1*/\n\t\t\t\tif(Math.abs(sinHalfTheta) < 0.001)\n\t\t\t\t{\n\t\t\t\t\tnewQuat.w = (rot0.w * 0.5) + (rot1.w * 0.5);\n\t\t\t\t\tnewQuat.x = (rot0.x * 0.5) + (rot1.x * 0.5);\n\t\t\t\t\tnewQuat.y = (rot0.y * 0.5) + (rot1.y * 0.5);\n\t\t\t\t\tnewQuat.z = (rot0.z * 0.5) + (rot1.z * 0.5);\n\t\t\t\t\tslerpRotations.push(quaternionToEuler(newQuat));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t/*prepare for conversion to euler angles*/\n\t\t\t\tvar ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta;\n\t\t\t\tvar ratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n\t\t\t\tnewQuat.w = (rot0.w * ratioA) + (rot1.w * ratioB);\n\t\t\t\tnewQuat.x = (rot0.x * ratioA) + (rot1.x * ratioB);\n\t\t\t\tnewQuat.y = (rot0.y * ratioA) + (rot1.y * ratioB);\n\t\t\t\tnewQuat.z = (rot0.z * ratioA) + (rot1.z * ratioB);\n\t\t\t\tslerpRotations.push(quaternionToEuler(newQuat));\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "16df5f9a08e1824db1d3aaee13b9ff1a", "score": "0.5501064", "text": "function quad(points) {\r\n return d3.range(points.length - 1).map(function(i) {\r\n var a = [points[i - 1], points[i], points[i + 1], points[i + 2]];\r\n a.t0 = points[i].t;\r\n a.t1 = points[i + 1].t;\r\n a.t = (a.t0 + a.t1) / 2;\r\n return a;\r\n });\r\n }", "title": "" }, { "docid": "f762de30c916b2d4f9163ae46dd00643", "score": "0.5499397", "text": "function processDatapoints(plot, series, datapoints) {\n\t\t\t\tvar nrPoints = datapoints.points.length / datapoints.pointsize;\n\t\t\t\tvar EPSILON = 0.5; //pretty large epsilon but save\n\n\t\t\t\tif (series.curvedLines.apply == true && series.originSeries === undefined && nrPoints > (1 + EPSILON)) {\n\t\t\t\t\tif (series.lines.fill) {\n\n\t\t\t\t\t\tvar pointsTop = calculateCurvePoints(datapoints, series.curvedLines, 1)\n\t\t\t\t\t\t,pointsBottom = calculateCurvePoints(datapoints, series.curvedLines, 2); //flot makes sure for us that we've got a second y point if fill is true !\n\n\t\t\t\t\t\t//Merge top and bottom curve\n\t\t\t\t\t\tdatapoints.pointsize = 3;\n\t\t\t\t\t\tdatapoints.points = [];\n\t\t\t\t\t\tvar j = 0;\n\t\t\t\t\t\tvar k = 0;\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\tvar ps = 2;\n\t\t\t\t\t\twhile (i < pointsTop.length || j < pointsBottom.length) {\n\t\t\t\t\t\t\tif (pointsTop[i] == pointsBottom[j]) {\n\t\t\t\t\t\t\t\tdatapoints.points[k] = pointsTop[i];\n\t\t\t\t\t\t\t\tdatapoints.points[k + 1] = pointsTop[i + 1];\n\t\t\t\t\t\t\t\tdatapoints.points[k + 2] = pointsBottom[j + 1];\n\t\t\t\t\t\t\t\tj += ps;\n\t\t\t\t\t\t\t\ti += ps;\n\n\t\t\t\t\t\t\t} else if (pointsTop[i] < pointsBottom[j]) {\n\t\t\t\t\t\t\t\tdatapoints.points[k] = pointsTop[i];\n\t\t\t\t\t\t\t\tdatapoints.points[k + 1] = pointsTop[i + 1];\n\t\t\t\t\t\t\t\tdatapoints.points[k + 2] = k > 0 ? datapoints.points[k-1] : null;\n\t\t\t\t\t\t\t\ti += ps;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdatapoints.points[k] = pointsBottom[j];\n\t\t\t\t\t\t\t\tdatapoints.points[k + 1] = k > 1 ? datapoints.points[k-2] : null;\n\t\t\t\t\t\t\t\tdatapoints.points[k + 2] = pointsBottom[j + 1];\n\t\t\t\t\t\t\t\tj += ps;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tk += 3;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (series.lines.lineWidth > 0) {\n\t\t\t\t\t\tdatapoints.points = calculateCurvePoints(datapoints, series.curvedLines, 1);\n\t\t\t\t\t\tdatapoints.pointsize = 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "f762de30c916b2d4f9163ae46dd00643", "score": "0.5499397", "text": "function processDatapoints(plot, series, datapoints) {\n\t\t\t\tvar nrPoints = datapoints.points.length / datapoints.pointsize;\n\t\t\t\tvar EPSILON = 0.5; //pretty large epsilon but save\n\n\t\t\t\tif (series.curvedLines.apply == true && series.originSeries === undefined && nrPoints > (1 + EPSILON)) {\n\t\t\t\t\tif (series.lines.fill) {\n\n\t\t\t\t\t\tvar pointsTop = calculateCurvePoints(datapoints, series.curvedLines, 1)\n\t\t\t\t\t\t,pointsBottom = calculateCurvePoints(datapoints, series.curvedLines, 2); //flot makes sure for us that we've got a second y point if fill is true !\n\n\t\t\t\t\t\t//Merge top and bottom curve\n\t\t\t\t\t\tdatapoints.pointsize = 3;\n\t\t\t\t\t\tdatapoints.points = [];\n\t\t\t\t\t\tvar j = 0;\n\t\t\t\t\t\tvar k = 0;\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\tvar ps = 2;\n\t\t\t\t\t\twhile (i < pointsTop.length || j < pointsBottom.length) {\n\t\t\t\t\t\t\tif (pointsTop[i] == pointsBottom[j]) {\n\t\t\t\t\t\t\t\tdatapoints.points[k] = pointsTop[i];\n\t\t\t\t\t\t\t\tdatapoints.points[k + 1] = pointsTop[i + 1];\n\t\t\t\t\t\t\t\tdatapoints.points[k + 2] = pointsBottom[j + 1];\n\t\t\t\t\t\t\t\tj += ps;\n\t\t\t\t\t\t\t\ti += ps;\n\n\t\t\t\t\t\t\t} else if (pointsTop[i] < pointsBottom[j]) {\n\t\t\t\t\t\t\t\tdatapoints.points[k] = pointsTop[i];\n\t\t\t\t\t\t\t\tdatapoints.points[k + 1] = pointsTop[i + 1];\n\t\t\t\t\t\t\t\tdatapoints.points[k + 2] = k > 0 ? datapoints.points[k-1] : null;\n\t\t\t\t\t\t\t\ti += ps;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdatapoints.points[k] = pointsBottom[j];\n\t\t\t\t\t\t\t\tdatapoints.points[k + 1] = k > 1 ? datapoints.points[k-2] : null;\n\t\t\t\t\t\t\t\tdatapoints.points[k + 2] = pointsBottom[j + 1];\n\t\t\t\t\t\t\t\tj += ps;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tk += 3;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (series.lines.lineWidth > 0) {\n\t\t\t\t\t\tdatapoints.points = calculateCurvePoints(datapoints, series.curvedLines, 1);\n\t\t\t\t\t\tdatapoints.pointsize = 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "424bd60a2d3e9a3567d6b1c04377b858", "score": "0.5496262", "text": "function generateCubicBezier(mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = typeof Float32Array !== 'undefined';\n\n /* Must contain four arguments. */\n if (arguments.length !== 4) {\n return false;\n }\n\n /* Arguments must be numbers. */\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n\n /* X values must be in the [0, 1] range. */\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n }\n\n function B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n }\n\n function C(aA1) {\n return 3.0 * aA1;\n }\n\n function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n }\n\n function getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate(aX, aGuessT) {\n for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues() {\n for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) {\n mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide(aX, aA, aB) {\n var currentX = void 0,\n currentT = void 0,\n i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX(aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n if (mX1 !== mY1 || mX2 !== mY2) {\n calcSampleValues();\n }\n }\n\n var f = function f(aX) {\n if (!_precomputed) {\n precompute();\n }\n if (mX1 === mY1 && mX2 === mY2) {\n return aX;\n }\n if (aX === 0) {\n return 0;\n }\n if (aX === 1) {\n return 1;\n }\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function () {\n return [{\n x: mX1,\n y: mY1\n }, {\n x: mX2,\n y: mY2\n }];\n };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n f.toString = function () {\n return str;\n };\n\n return f;\n}", "title": "" }, { "docid": "424bd60a2d3e9a3567d6b1c04377b858", "score": "0.5496262", "text": "function generateCubicBezier(mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = typeof Float32Array !== 'undefined';\n\n /* Must contain four arguments. */\n if (arguments.length !== 4) {\n return false;\n }\n\n /* Arguments must be numbers. */\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n\n /* X values must be in the [0, 1] range. */\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n }\n\n function B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n }\n\n function C(aA1) {\n return 3.0 * aA1;\n }\n\n function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n }\n\n function getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate(aX, aGuessT) {\n for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues() {\n for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) {\n mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide(aX, aA, aB) {\n var currentX = void 0,\n currentT = void 0,\n i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX(aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n if (mX1 !== mY1 || mX2 !== mY2) {\n calcSampleValues();\n }\n }\n\n var f = function f(aX) {\n if (!_precomputed) {\n precompute();\n }\n if (mX1 === mY1 && mX2 === mY2) {\n return aX;\n }\n if (aX === 0) {\n return 0;\n }\n if (aX === 1) {\n return 1;\n }\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function () {\n return [{\n x: mX1,\n y: mY1\n }, {\n x: mX2,\n y: mY2\n }];\n };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n f.toString = function () {\n return str;\n };\n\n return f;\n}", "title": "" }, { "docid": "9970a3eb9ab0e0333f85e352fc8bf53a", "score": "0.5496165", "text": "function d3_svg_lineBasis(points) {\r\n if (points.length < 3) return d3_svg_lineLinear(points);\r\n var i = 1,\r\n n = points.length,\r\n pi = points[0],\r\n x0 = pi[0],\r\n y0 = pi[1],\r\n px = [x0, x0, x0, (pi = points[1])[0]],\r\n py = [y0, y0, y0, pi[1]],\r\n path = [x0, \",\", y0];\r\n d3_svg_lineBasisBezier(path, px, py);\r\n while (++i < n) {\r\n pi = points[i];\r\n px.shift(); px.push(pi[0]);\r\n py.shift(); py.push(pi[1]);\r\n d3_svg_lineBasisBezier(path, px, py);\r\n }\r\n i = -1;\r\n while (++i < 2) {\r\n px.shift(); px.push(pi[0]);\r\n py.shift(); py.push(pi[1]);\r\n d3_svg_lineBasisBezier(path, px, py);\r\n }\r\n return path.join(\"\");\r\n}", "title": "" } ]
e5c26ef8aa5d634d7c13d092378c53ca
Sends the command to the server
[ { "docid": "f4e38a82e32888e10d784740ae64ab63", "score": "0.0", "text": "addCommand(action, params) {\n return this.processCommand(action, params);\n }", "title": "" } ]
[ { "docid": "d9106f4190188e0ff5c7bab32fb74260", "score": "0.8228925", "text": "sendCommand(command){\n\n\t\t//TODO send command to server.\n\t}", "title": "" }, { "docid": "ec1a735e41885cc23b7b647126b300c1", "score": "0.7517958", "text": "function sendCommand(cmd) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tconnection.send(cmd);\r\n\t\t\t\t\tcontrolCommand=0;\r\n\t\t\t\t}", "title": "" }, { "docid": "3f885c29ff0253e2f453048f5a385e19", "score": "0.7403148", "text": "function send() {\n var commandBits = \"\";\n for (var name in command) {\n commandBits = commandBits + (command[name] ? \"1\" : \"0\");\n }\n $.get(window.location.protocol+'//'+window.location.host + ':' + CONTROL_PORT + \"?set\" + commandBits);\n}", "title": "" }, { "docid": "5c4ca5986f755b85eae5652e77a4aada", "score": "0.72555006", "text": "function sendCommand(command) {\r\n fetch(\"/terminalCommand\", { // Send POST to Cowboy web server with terminal command\r\n method: \"POST\", \r\n headers: {\r\n \"Content-Type\": \"text/plain\",\r\n },\r\n body: String(command)\r\n })\r\n .then(function(response) {\r\n if(response.ok) {\r\n return response.text()\r\n .then(function(text) {\r\n var x = '[[;green;]'.concat($.terminal.escape_brackets(text)).concat(']');\r\n term.echo(x); // Print Cowboy web server response in terminal\r\n return;\r\n }); \r\n }\r\n throw new Error('Not OK.');\r\n })\r\n}", "title": "" }, { "docid": "b2d5dd0d4d327f1001466414a058e6e9", "score": "0.7239837", "text": "send(command, args) {\n\t\tif (this._connected) {\n\n\t\t\tlet packet = {\n\t\t\t\taddress: command\n\t\t\t}\n\n\t\t\tif (args !== undefined) {\n\t\t\t\tpacket.args = args\n\t\t\t}\n\n\t\t\t// console.log(\"Sending OSC packet\", packet)\n\t\t\tthis._connection.send(packet)\n\t\t} else {\n\t\t\tthrow \"Client is not connected!\"\n\t\t}\n\t}", "title": "" }, { "docid": "85fe9a3d433de4dd9164f639ac1d8a03", "score": "0.71422744", "text": "sendCommand(command) {\n this.sendCommand2(command, []);\n }", "title": "" }, { "docid": "d192fbdfe770474b3f1bbf1b1b8bb44d", "score": "0.7043808", "text": "send(command, args){\n //console.log('Sending command \\'' + command + '\\'');\n if(this.stdout) this.stdout.write(this.encapsulate({command: command, args: args}));\n }", "title": "" }, { "docid": "2c28cbfc0d26e0f2cdbab84ae3cc05ae", "score": "0.7026711", "text": "send( cmd ) {\n let url = `${this.endpoint}${cmd}`;\n console.log( `VMIX: ${url}` );\n this.onupdate( 'sending command' );\n return got( url )\n .then(\n ( res ) => {\n console.log( `VMIX RESPONSE:\\n${res.requestUrl}\\n${res.body}` );\n this.lastmessage = 'command successful';\n this.onupdate( this.lastmessage );\n },\n ( err ) => {\n // console.log(err);\n this.lastmessage = 'command failed';\n this.onupdate( this.lastmessage );\n }\n )\n .catch( ( err ) => {\n console.log( 'vmix request error' );\n this.lastmessage = 'error sending command';\n this.onupdate( this.lastmessage );\n } );\n }", "title": "" }, { "docid": "148b314523f639388892c064e02d6de4", "score": "0.69980174", "text": "function sendCommand(device_id, command) {\n\tnew Ajax.Request(\"/controls/sendCommand\", { \n\t\tmethod: \"get\", \n\t\tparameters: { \n\t\t\t\"device_id\": device_id,\n\t\t\t\"command\": command,\n\t\t}\n\t});\t\n}", "title": "" }, { "docid": "ebb0563285e6d721000513791a53e348", "score": "0.6963014", "text": "sendCommand(id, command) {\n\t\treturn this.send(id, \"execute_request\", this.getCodeContent(command));\n\t}", "title": "" }, { "docid": "0a3861a8bb782598245c5199a3c5e923", "score": "0.68682015", "text": "async function sendCommand(cmd) {\r\n\t// Display the command in the log\r\n\tlog(' -> ' + cmd );\r\n\ttry{\r\n\t\tlet encoder = new TextEncoder('utf-8');\r\n\t\t// Send command via GATT Write request \r\n\t\tawait inboundChar.writeValue(encoder.encode(cmd));\r\n\t} \r\n\tcatch(error) {\r\n\t\tlog('Failed: ' + error);\r\n\t}\r\n}", "title": "" }, { "docid": "b6953b4072b2bf38cfafbd84fc0162bc", "score": "0.6846361", "text": "function sendWriteRequest(){\n\tif(typeof(socket) != 'undefined' && writeBuffer.length > 0){\n\t\tsocket.emit('command', writeBuffer.shift());\n\t}\n}", "title": "" }, { "docid": "d7e0e3ffa87494c9a7e47b182b2bd45d", "score": "0.67882234", "text": "sendCommand(command) {\n if (!this.responded) {\n setTimeout((function () {\n this.sendCommand(command);\n }).bind(this), 10);\n return;\n }\n\n this.responded = false;\n\n // make sure it ends in a newline\n if (command[command.length - 1] != \"\\n\") {\n command += \"\\n\";\n }\n\n process.stdout.write(command);\n this.child.stdin.write(command);\n }", "title": "" }, { "docid": "aa737dcd4594675d7e60ec7cc299a3d9", "score": "0.67546463", "text": "function cSend(cmd) {\n\t mpd.send(cmd,function() {\n\t\t console.log('cSend called.');\n\t });\n }", "title": "" }, { "docid": "df35187636116a3f907e1ed7c73f1c6a", "score": "0.6724822", "text": "sendCommand() {\n this.btnText = 'Sending';\n this.btnDisable = true;\n\n this.http.client.post('/asset/rawcommand', {\n imeis: this.imeis,\n interfaceMap: this.interfaceMap,\n command: this.rawCommand\n }).then((res) => {\n this.btnText = 'Send Command';\n this.btnDisable = false;\n if (res && res.message) {\n Materialize.toast(res.message, 3000);\n }\n });\n }", "title": "" }, { "docid": "6e4d57a14cfac97a0e0733a368bb2d89", "score": "0.67131084", "text": "async function sendCommand(req, res) {\n // [START iot_send_command]\n const iotClient = new iot.v1.DeviceManagerClient({\n // optional auth parameters.\n });\n\n const data = req.body.payload;\n const formattedName = iotClient.devicePath(\n projectId,\n cloudRegion,\n registryId,\n deviceId\n );\n\n const binaryData = Buffer.from(data).toString(\"base64\");\n const request = {\n name: formattedName,\n binaryData: binaryData,\n };\n\n try {\n const responses = await iotClient.sendCommandToDevice(request);\n return res.send(\"Sent command\");\n } catch (err) {\n return res.send(\"Could not send command\");\n }\n // [END iot_send_command]\n}", "title": "" }, { "docid": "4e4be1017b1a8a164b234f7e915cab64", "score": "0.6692094", "text": "function send(command,payload, ajajOpt){\n FShell.fossil.sendCommand(command,payload,ajajOpt);\n}", "title": "" }, { "docid": "52ddcb8fcd4f085aaf2f50f7fd4796ae", "score": "0.6683592", "text": "send(message) {\n\t\t// console.log(message);\n\t\tthis.output.sendMessage(message);\n\t}", "title": "" }, { "docid": "114edea60c5bf2b3ce914042bf88332c", "score": "0.6644682", "text": "async _send(command) {\n if (this.dry) return command;\n if (!this.connected) throw Error('No device connected.');\n await this.serial.write(command);\n const response = await this.reader.next();\n return response.value.value;\n }", "title": "" }, { "docid": "ccda32f7558c2c70c8cdb16c68465e79", "score": "0.6606979", "text": "sendHeartbeatCommand() {\n\t\tthis.socket.write(\"N\\n\");\n\t}", "title": "" }, { "docid": "cdba4432e3871eeb57ccc70fc008fb70", "score": "0.6597027", "text": "function sendCommand(command) {\n\tvar ajax = $.ajax(command)\n\t\t\t\n\tajax.done(function(response) {})\n\tajax.fail(function() {connectionErrorAlert(command);})\n}", "title": "" }, { "docid": "437bf8a43122ee431b363316ec1d90a7", "score": "0.6586444", "text": "_send(command, data, error) {\n log.debug(`outgoing socket event: ${topic}`, { component });\n try {\n this._socket.send(JSON.stringify({ command, data, error }));\n }\n catch (e) {\n log.error(`error ${e}`, { component });\n }\n }", "title": "" }, { "docid": "2b9dffa5702da2f54f01760acf9e2385", "score": "0.6563605", "text": "function sendCommand(type, data, callback) {\n\t$.post('/command/' + type, data, function(result) {\n\t\tif (callback) { callback(null, result) }\n\t})\n}", "title": "" }, { "docid": "1fd7339609ee3b5732d840558140d6d0", "score": "0.65460306", "text": "irSend(command) {\n if (this.cmdInFlight) {\n log('IR command already in flight. Skipping.');\n return;\n }\n this.cmdInFlight = true;\n const args = ['--count=5', 'SEND_ONCE', 'denon-ir1', command];\n log('ir-send:', irCommand, args.join(' '));\n const child = spawn(irCommand, args, {stdio: 'inherit'});\n const killTimeout = setTimeout(() => {\n child.kill(); // Just in case\n }, 2000);\n child.on('exit', code => {\n this.cmdInFlight = false;\n clearTimeout(killTimeout);\n if (code !== 0) {\n log(`ERROR: IR send failed code=${code}`);\n }\n });\n }", "title": "" }, { "docid": "5e69828d491e8a197ac77a99759113ae", "score": "0.64890975", "text": "function runCommand(command) {\n if (!command) {\n var command = document.getElementById('command').value;\n } else {\n command = JSON.stringify(command)\n }\n if (!command) {\n alert(\"no command entered\")\n return false;\n }\n console.log(command)\n try {\n command = JSON.parse(command);\n }\n catch(err) {\n console.log(err.message);\n alert(\"json error, check command string\");\n return false;\n }\n var socketlistening = document.getElementById('socketlistening').value;\n if (socketlistening == 0) {\n alert(\"diskover socket server not listening\")\n return false;\n }\n command = JSON.stringify(command);\n console.log(\"sending command to socket server\")\n console.log(command)\n xhr.open(\"GET\", \"sockethandler.php?command=\"+command, true);\n xhr.timeout = 0;\n xhr.send();\n}", "title": "" }, { "docid": "7c07c7663baf301d1757ebd08887d5e9", "score": "0.6477072", "text": "function sendCommand(command, args, callback) {\n ikpdbs.sendCommand(command, args, function(err, reply) {\n /*****\n * Process the messages IKPdb could send\n * Note that error messages ar only displayed if IKPdb returned\n * an error.\n */\n if (reply) {\n // Display info and warning messages\n reply.info_messages.forEach(function (iMessage) {\n console.log(iMessage);\n });\n reply.warning_messages.forEach(function (wMessage) {\n bubble.popup(wMessage, false);\n });\n }\n\n if (err) {\n // Display errors\n var errMessage;\n if (reply) {\n errMessage = reply.error_messages.join(\" \");\n showError(errMessage, 10000);\n }\n return callback && callback(err);\n }\n \n if (reply.result.executionStatus)\n setState(reply.result.executionStatus);\n \n callback && callback(err, reply);\n });\n }", "title": "" }, { "docid": "fdf075e334853b91e50dc4ac7e4201b2", "score": "0.6465964", "text": "function sendCommand(cmd_string){\n var command = cmd_string\n if(cmd_string === 'ARM'){\n if(uavs[current_uav].armed){\n command = 'DISARM';\n }\n }\n uavs[current_uav].socket.send(command);\n}", "title": "" }, { "docid": "9a7148c65a809d323f85225218370109", "score": "0.6461787", "text": "sendCommand(deviceId,commandName,status=\"press\"){\t\t\n\t\tif (this.devices[deviceId]) deviceId=this.devices[deviceId];\n\t\tthis.msg=\"{ \\\"hubId\\\": \\\"\"+this.hubId+\"\\\", \\\"timeout\\\": 30, \\\"hbus\\\": { \\\"cmd\\\":\\\"vnd.logitech.harmony/vnd.logitech.harmony.engine?holdAction\\\",\\\"id\\\": \\\"0\\\",\\\"params\\\": {\\\"status\\\":\\\"\"+status+\"\\\",\\\"timestamp\\\":\\\"0\\\",\\\"verb\\\": \\\"render\\\",\\\"action\\\": \\\"{\\\\\\\"command\\\\\\\": \\\\\\\"\"+commandName+\"\\\\\\\",\\\\\\\"type\\\\\\\": \\\\\\\"IRCommand\\\\\\\",\\\\\\\"deviceId\\\\\\\": \\\\\\\"\"+deviceId+\"\\\\\\\"}\\\"}}}\";\n\t\tthis.send(this.msg);\n\t}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.64502615", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.64502615", "text": "send() {}", "title": "" }, { "docid": "b69f212a7fbd0c6de179dcdc5f9858d9", "score": "0.6446014", "text": "send( message ) {\n\t\tconsole.log( message );\n\t\ttry {\n\t\t\tthis.oscPort.send( message );\n\t\t} catch ( e ) {\n\t\t\tconsole.log( e );\n\t\t}\n\t}", "title": "" }, { "docid": "c2f4179f88c2de6915eed7f4639a9233", "score": "0.6442144", "text": "async function sendCommand(command) {\n try {\n const response = await fetch(EXPRESS_URL + \"/game\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ command: command }),\n });\n return await response.json(); // Return json from response\n } catch (e) {\n console.log(`Error fetching ${e.message}`);\n }\n}", "title": "" }, { "docid": "a7730388b8545f40a1148ddb34bf424e", "score": "0.6377386", "text": "function rconSend( rcon, status, command ) {\n\tvar packet = rconInt( 0 ) + rconInt( status ) + command + '\\0\\0';\n\trcon.write( rconInt( packet.length ) + packet );\n}", "title": "" }, { "docid": "0445a8f4985adc61d34a2e443095d288", "score": "0.6299366", "text": "function handleCommand(command, id) {\n let conn = connections.find(c => c.id == id)\n if (conn) {\n let data = { command }\n if (conn.websocket)\n conn.websocket.send(JSON.stringify(data))\n else\n console.log('Commands over HTTP not implemented!')\n }\n}", "title": "" }, { "docid": "50526a95ece3ba04bdecf735c3577eb9", "score": "0.6282461", "text": "StartCommand() {\n\t\tconst options = {\n\t\t\trejectUnauthorized: false,\n\t\t\trequestCert: true\n\t\t};\n\t\tvar self = this\n\t\tconst socket = net.connect(3010, this.ipaddress, options, function () {\n\t\t\t//this.command = net.connect({ host: this.ipaddress, port: 3001 }, () => {\n\t\t\tif (self.username != \"\" && self.password != \"\") {\n\t\t\t\tsocket.write(sprintf(\"Login %s %s\\n\", self.username, self.password));\n\t\t\t}\n\t\t\tsocket.write(sprintf(\"STATUS ALL\\n\"));\n\t\t\tsocket.write(sprintf(\"ELENABLE 1 AUTOMATION ON\\nELENABLE 1 EVENT ON\\nELENABLE 1 STATUS ON\\nELENABLE 1 STATUSEX ON\\nELENABLE 1 SYSTEM ON\\nELLOG AUTOMATION ON\\nELLOG EVENT ON\\nELLOG STATUS ON\\nELLOG STATUSEX ON\\nELLOG SYSTEM ON\\n\"));\n\t\t});\n\n\t\tsocket.on('data', (data) => {\n\t\t\t/* Data received */\n\t\t\tvar lines = data.toString().split('\\n');\n\t\t\tfor (var i = 0; i < lines.length; i++) {\n\t\t\t\tvar dataItem = lines[i].split(\" \");\n\t\t\t\t// console.log(dataItem);\n\t\t\t\tif (lines[i].startsWith(\"S:BLIND\") || lines[i].startsWith(\"R:GETBLIND\") || (lines[i].startsWith(\"R:INVOKE\") && dataItem[3].includes(\"Blind\"))) {\n\t\t\t\t\t/* Live update about load level (even if it's a RGB load') */\n\t\t\t\t\tself.emit(\"blindStatusChange\", parseInt(dataItem[1]), parseInt(dataItem[2]));\n\t\t\t\t}\n\t\t\t\tif (lines[i].startsWith(\"S:LOAD \") || lines[i].startsWith(\"R:GETLOAD \")) {\n\t\t\t\t\t/* Live update about load level (even if it's a RGB load') */\n\t\t\t\t\tself.emit(\"loadStatusChange\", parseInt(dataItem[1]), parseInt(dataItem[2]));\n\t\t\t\t}\n\t\t\t\tif (dataItem[0] == \"S:TEMP\") {\n\t\t\t\t\t//console.log(\"now lets set the temp!\" + parseInt(dataItem[2]));\n\t\t\t\t\tself.emit(sprintf(\"thermostatDidChange\"), parseInt(dataItem[2]));\n\t\t\t\t\t// self.emit(sprintf(\"thermostatIndoorTemperatureChange\"), parseInt(dataItem[2]));\n\t\t\t\t}\n\t\t\t\telse if (dataItem[0] == \"R:INVOKE\" && dataItem[3].includes(\"Thermostat.GetIndoorTemperature\")) {\n\t\t\t\t\t//console.log(\"lets get the indoor temp!\")\n\t\t\t\t\tself.emit(sprintf(\"thermostatIndoorTemperatureChange\"), parseInt(dataItem[1]), parseFloat(dataItem[2]));\n\t\t\t\t}\n\t\t\t\telse if (dataItem[0] == \"S:THERMOP\" || dataItem[0] == \"R:GETTHERMOP\" || dataItem[0] == 'R:THERMTEMP') {\n\t\t\t\t\tvar modeVal = 0;\n\t\t\t\t\tif (dataItem[2].includes(\"OFF\"))\n\t\t\t\t\t\tmodeVal = 0;\n\t\t\t\t\telse if (dataItem[2].includes(\"HEAT\"))\n\t\t\t\t\t\tmodeVal = 1;\n\t\t\t\t\telse if (dataItem[2].includes(\"COOL\"))\n\t\t\t\t\t\tmodeVal = 2;\n\t\t\t\t\telse\n\t\t\t\t\t\tmodeVal = 3;\n\t\t\t\t\t// console.log(parseInt(modeVal));\n\t\t\t\t\tif (dataItem[0] == \"S:THERMOP\" || dataItem[0] == \"R:GETTHERMOP\")\n\t\t\t\t\t\tself.emit(sprintf(\"thermostatIndoorModeChange\"), parseInt(dataItem[1]), parseInt(modeVal), -1);\n\t\t\t\t\telse\n\t\t\t\t\t\tself.emit(sprintf(\"thermostatIndoorModeChange\"), parseInt(dataItem[1]), parseInt(modeVal), parseFloat(dataItem[3]));\n\t\t\t\t}\n\n\t\t\t\t/* Non-state feedback */\n\t\t\t\tif (lines[i].startsWith(\"R:INVOKE\") && lines[i].indexOf(\"Object.IsInterfaceSupported\")) {\n\t\t\t\t\tself.emit(sprintf(\"isInterfaceSupportedAnswer-%d-%d\", parseInt(dataItem[1]), parseInt(dataItem[4])), parseInt(dataItem[2]));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tthis.command = socket\n\t}", "title": "" }, { "docid": "dfa9889df4bb476b1207ddce3af71d6f", "score": "0.621639", "text": "function sendOMMmessage(commandObj) {\n ws.send(JSON.stringify(commandObj));\n }", "title": "" }, { "docid": "d1d66f6a2122ee5074e4d9adf089a50c", "score": "0.62032413", "text": "function sendCommand(command, data, doneSending, responseRecieved) {\n\tif (typeof data === 'undefined' || typeof data === 'function') {\n\t\tresponseRecieved = doneSending;\n\t\tdoneSending = data;\n\t\tdata = new Buffer(0);\n\t}\n\n\tvar sendBuff = new Buffer(data.length + 3);\n\n\t// Wired binary command with header in response\n\tsendBuff[0] = 0xF9;\n\tsendBuff[1] = command;\n\n\tdata.copy(sendBuff, 2);\n\n\tsendBuff[sendBuff.length - 1] = sendBuff[1];\n\n\tfor (var i = 0; i < data.length; i++)\t{\n\t\tsendBuff[sendBuff.length - 1] += data[i];\n\t}\n\n\tif (responseRecieved) {\n\t\tresponseFormat = getCommandResponseFormat(command);\n\t}\n\n\tvar timeoutHandler;\n\n\tfunction commandResponse(data) {\n\t\tresponseFormat = undefined;\n\t\tclearTimeout(timeoutHandler);\n\t\tresponseRecieved(data);\n\t}\n\n\tif (responseFormat) {\n\t\tserialPort.once('response', commandResponse);\n\t}\n\n\tserialPort.write(sendBuff, function(err, result){\n\t\tif (responseFormat) {\n\t\t\ttimeoutHandler = setTimeout(function() {\n\t\t\t\tserialPort.removeListener('response', commandResponse);\n\t\t\t\ttimeouts++;\n\t\t\t}, 1000);\n\t\t}\n\t\tif (typeof doneSending === 'function')\n\t\t\tdoneSending(err, result);\n\t});\n}", "title": "" }, { "docid": "36c56acece1354c4e755f88947e517c5", "score": "0.6197701", "text": "function send(options){}", "title": "" }, { "docid": "fb4b5be50ffb3a71d85e7a53cae59f61", "score": "0.61892694", "text": "function sendCommand(input){\n const wsc = new WebSocket(pythonWebsocketAddr);\n wsc.on(\"open\", function(){\n wsc.send(JSON.stringify(input));\n wsc.on(\"message\", function(inmsg){\n wsc.close(1000);\n updateCells();\n });\n });\n}", "title": "" }, { "docid": "5ebe2cd2ffb3d1506cb56b4ec399f0e0", "score": "0.6185403", "text": "sendMessage (message) {\r\n this._socket.send(message);\r\n }", "title": "" }, { "docid": "38efdd95ff02efc5966b514b739c4277", "score": "0.61768794", "text": "send() {\n this.game.socket.send(Packets.Chat, [this.input.val()]);\n this.toggle();\n }", "title": "" }, { "docid": "28ac7b207aa07946ca6f16ad9d8bf194", "score": "0.6155138", "text": "function sendMove()\n{\n\tsocket.send(moveFrom +\"|\"+ moveTo);\n}", "title": "" }, { "docid": "3e84319395c4158c7bee9da83b5e5ab0", "score": "0.61466414", "text": "send() {\n\n // construct data as proper html-form x-www-urlencoded, the esp finds this easiest to work with.\n const params = new URLSearchParams();\n params.append('mix', this.mix);\n params.append('effect', this.effect);\n params.append('colorone', this.colorone);\n params.append('colortwo', this.colortwo);\n params.append('rate',this.rate);\n\n //send data\n axios\n .post('/command', params)\n .then(response => {\n this.message = response.data.content;\n this.hasError = false;\n })\n .catch(error => {\n this.message = `${error}`;\n this.hasError = true;\n });\n }", "title": "" }, { "docid": "6673cedffa5c000d611be227ef95ec98", "score": "0.6145673", "text": "function sendCommand(topic, json) {\n\n //Publish the command\n device.publish(topic, json);\n\n}", "title": "" }, { "docid": "0d1522ae5d009380e60883863747710c", "score": "0.61398256", "text": "function sendCmd(cmd, params, callback){\n if (!cmd) return;\n let ingoredCmds = [\"clientinfo\"];\n \n tsBot.send(cmd, params, function(error, response, rawResponse){\n if (error){\n log(\"Error running command \" + cmd + \". Message: \" + error.msg);\n return;\n }\n \n if (typeof callback === \"function\"){\n if (ingoredCmds.indexOf(cmd) === -1) log(\"Issuing command \" + cmd + \" with params: \" + JSON.stringify(params).replace(/\\n/, \"\"));\n callback(response);\n } else if (typeof params === \"function\"){\n if (ingoredCmds.indexOf(cmd) === -1) log(\"Issuing command \" + cmd);\n params(response);\n }\n });\n}", "title": "" }, { "docid": "0ffeb90f47159bad56861bab7679ce34", "score": "0.6122835", "text": "function sendData() {\n const state = getState();\n let command;\n manualControl.status(state); // We always send the updated state\n if (controlMode.isRobotic && robot) {\n try {\n command = robot.ai(state);\n } catch (ex) {\n console.error('ERROR: Running AI: ', ex);\n }\n if (command && command.action === 'move') {\n actionMove(command);\n }\n }\n logger.info(`STATUS:${JSON.stringify(state)}`);\n}", "title": "" }, { "docid": "58316dcb602896475b115f0534a811b6", "score": "0.6085876", "text": "async sendCommandWithSession(command, body, method) {\n //TODO: Support post body\n log.info(`Sending command ${command} to WebDriverAgent with body ${JSON.stringify(body)} via method ${method}`);\n try {\n let commandurl = url.format(this.url) + 'session/' + this.jwproxy.sessionId + '/' + command;\n await request({\n url: commandurl,\n body: body ? body : {},\n method: method,\n json: true,\n resolveWithFullResponse: true\n })\n .then(function (response) {\n // Command succeeded...\n log.info(`Successfully processed command with response: ${response}`);\n })\n .catch(function (err) {\n // Command failed...\n log.warn(`Error while processing command: ${err}`);\n });\n } catch (err) {\n log.warn(`Error while processing command: ${err}`);\n throw err;\n }\n }", "title": "" }, { "docid": "8f88e8dea390319d8353dc7ea3263e03", "score": "0.6073464", "text": "send(data){\n this.device.write(new Buffer(data + \"\\n\", 'utf-8'), (err) => { if(err) console.log(err); });\n }", "title": "" }, { "docid": "309ee275081ab8ede67a55a6cc680324", "score": "0.6052651", "text": "send(data) {\n\t\t\techo({\n\t\t\t\turl: self.endpoint,\n\t\t\t\tdata\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "26ab3e3a2036e14e31baf7c7ddf5b0de", "score": "0.6040397", "text": "sendingControlCommand(event) {\n const command = event.target.name;\n if (command == 'takingOff') {\n this.setState({\n operating: true\n });\n }\n \n if (this.state.operating == true) {\n // if command is landing, immediately set operating state to be false\n // so that no further action can be take\n if (command == 'landing') {\n this.setState({\n operating: false\n });\n }\n var clientServerOptions = {\n uri: 'http://' + window.location.hostname + ':3000/api' + command,\n body: JSON.stringify({'command': command}),\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n }\n };\n request(clientServerOptions, function (error, response) {\n console.log(error,response.body);\n });\n } else {\n console.log('drone not operating');\n }\n }", "title": "" }, { "docid": "d42547a92adb9c68badbbd0b18c6fbac", "score": "0.6002518", "text": "function sendMsg(msg) {\n socket.send(msg.value);\n }", "title": "" }, { "docid": "72a1349fc23d87953303e8e0efb0a741", "score": "0.6001424", "text": "send(raw) {\n\t\tif (!this.socket) return\n\t\tthis.socket.emit(\"message\", raw)\n\t}", "title": "" }, { "docid": "f625f65c0f4cfea5c805cab32fd8381a", "score": "0.5999714", "text": "function sendCommandToPlugwise(id, onoff) {\n console.log('479 sendcmmand with deviseid ' + id + ' and command ' + onoff);\n \n var command = '';\n if (onoff == true) {\n command = 'on';\n }\n else if (onoff == false) {\n command = \"off\";\n }\n console.log('commandpath = /api/actions.html?option=switch' + command + '&id=' + id)\n \n \n \n \n var path= '/api/actions.html?option=switch' + command + '&id=' + id\n \n //Homey.app.\n //self.reqserver = function (ip, port, path, method, username, password) { \n Homey.app.reqserver(Homey.app.serverip, Homey.app.serverport, path, Homey.app.servermethod, Homey.app.serverusername, Homey.app.serverpassword);\n \n\n\n\n\n\n\n}", "title": "" }, { "docid": "35dc891905c763e9bc5a750e8d10213e", "score": "0.59927267", "text": "send() {\n throw new Error(\"send() not implemented\");\n }", "title": "" }, { "docid": "0bd05e04bfc5a5867ba3d9724147da4d", "score": "0.5981126", "text": "send (...args) {\n return process.send.apply(process, args)\n }", "title": "" }, { "docid": "62b6cc0695d5b773fbbe028d0c272259", "score": "0.5967009", "text": "sendMsg() {\n const currentText = this.input.current.value;\n if (!currentText) {\n // If no message is written\n return;\n }\n this.input.current.value = '';\n\n if (currentText.startsWith('/')) {\n this.socket.emit('chat command', currentText);\n // No message sent due to being a command\n return;\n }\n\n const msg = {\n user: this.state.user,\n text: currentText,\n };\n this.socket.emit('chat message', msg);\n }", "title": "" }, { "docid": "cff1e47f0b0c80eb76d1c77e102aece2", "score": "0.59628063", "text": "function sendToDiscord() {\n fetch(host+\":6969\", {\n method: \"POST\",\n mode: \"cors\",\n headers: { 'Content-Type': \"application/json\" },\n body: JSON.stringify(data)\n }).then(response => {\n if(response.code === \"Yeah\") console.log(\"successfully updated discord status\")\n })\n }", "title": "" }, { "docid": "8228cb610621a5caaa6780c01806a1bc", "score": "0.5939754", "text": "async sendCommand(deviceSubtype,deviceId,directive,directiveValue,inverted){\n\t\tlet conConfig = await this.getConnectionConfig();\n\t\tconConfig.path += \"?\" + SET_COMMAND + \"&\";\n\t\t//const params = overrideParams && typeof overrideParams === \"function\" ? overrideParams(requestMethod) : DEVICE_HANDLER_COMMANDS_PARAMS[requestMethod];\n\t\tconConfig.path += generate_command(deviceSubtype,deviceId,directive,directiveValue,inverted);\n\n\t\tdebugLogger('%j',conConfig.path);\n\t\ttry {\n\t\t\tPROD_MODE ? await promiseHttpRequest(conConfig) : null ;\n\t\t\tprodLogger(\"REQUEST SENT\");\n\t\t\tsendStatsd(\"calls.command.\"+deviceSubtype+\":1|c\");\n\n\t\t\treturn conConfig.path;\n\t\t}catch(e){\n\t\t\tthrow e;\n\t\t}\n\n\t}", "title": "" }, { "docid": "158001beda32685eedf76a85b4e4482a", "score": "0.5938896", "text": "function sendCommand(command, channel, params, uuid, callback) {\n setResponse(\"\");\n if(params.length != 0 && params != \"{}\") {\n try {\n params = JSON.parse(params);\n } catch(e) {\n setResponse(\"Unable to parse params into valid JSON object: \" + params);\n return;\n }\n var command_ = {};\n command_[command] = params;\n command = command_;\n }\n\n // register the callback\n interest.push([uuid, callback]);\n\n var msgObj = {channel: channel, message: {uuid: uuid, cmd: command}};\n socket.send(JSON.stringify(msgObj));\n\n // remove the registered callback after the timeout expires\n setTimeout(function(){\n deregister(uuid);\n }, resTimeoutMs);\n}", "title": "" }, { "docid": "06a5f1a344e109e6ed8ba84af7888fcd", "score": "0.5938807", "text": "function Command(dir) {\n\tif (gameState == GAMESTATE_COMMENCING && turn == index) {\n\t\tvar data = \"\";\n\t\tdata += String.fromCharCode(COMMAND_SEND_DIRECTION);\n\t\tdata += String.fromCharCode(dir);\n\t\tSend (data);\n\t}\n}", "title": "" }, { "docid": "06a5f1a344e109e6ed8ba84af7888fcd", "score": "0.5938807", "text": "function Command(dir) {\n\tif (gameState == GAMESTATE_COMMENCING && turn == index) {\n\t\tvar data = \"\";\n\t\tdata += String.fromCharCode(COMMAND_SEND_DIRECTION);\n\t\tdata += String.fromCharCode(dir);\n\t\tSend (data);\n\t}\n}", "title": "" }, { "docid": "b6032a7b971c50a60f6aaed28ea1e7a0", "score": "0.5928456", "text": "async execute(msg, args) {\n\t\tawait msg.channel.send('output of command');\n\t}", "title": "" }, { "docid": "2c7605424b6253e9273899d8b5bf56b9", "score": "0.5922213", "text": "async sendOpcodeMessage({ op, d = {}, s = null, t = null } = {}) {\n if (!this.#connected_)\n return false;\n\n return await this.#socket_.write({ op, d, s, t });\n }", "title": "" }, { "docid": "0849b919d5e8cfa5d7e139cd6f9aaf3c", "score": "0.5920187", "text": "function runCMD() {\n const params = new URL(location.href).searchParams;\n const selectedAgent = params.get('agent');\n\n data = \"c=\" + encodeURIComponent(document.getElementById(\"inputcmd\").value);\n h.post(\"./agents/\" + selectedAgent + \"/command\",data,\"application/x-www-form-urlencoded\");\n document.getElementById(\"inputcmd\").value = \"\";\n document.getElementById(\"inputcmd\").focus();\n window.location.reload();\n}", "title": "" }, { "docid": "2726dcc4f863c9c358254c7d5880b28b", "score": "0.59192693", "text": "function sendResponse(result, tts) {\n\n message.type = \"response\";\n message.dst = \"master\";\n message.src = piname;\n message.request = result;\n message.content = tts;\n\n\n console.log(message);\n pinode.send(\"commands\", message);\n\n}", "title": "" }, { "docid": "87567b50ed536328711118d70dbb824a", "score": "0.59117573", "text": "function sendData(data){\n\tconsole.log('called send function');\n\tio.sockets.emit('write', data);;\n}", "title": "" }, { "docid": "104213f8bead43b62e83a874fc267d81", "score": "0.5902134", "text": "function updateServer(message) {\n\tif(connection) {\n\t\tconsole.log(\"sending:\" + message);\n\t\tconnection.send(message);\n\t}\n}", "title": "" }, { "docid": "736386bb89c2364df3248dea2c4525cb", "score": "0.5892464", "text": "function sendAT(req, res, cmd) {\n var msg = \"AT*\" + cmd + \"=\" + (seq++);\n\n for (var i = 3; i < arguments.length; i++)\n msg += \",\" + arguments[i];\n\n msg += \"\\r\";\n\n var buf = new Buffer(msg, \"ascii\");\n\n if (buf.length > 1024) {\n res.status(400).send(\"*** ERROR *** Command exceeds 1024 chars.\");\n }\n else {\n console.log(\"Exec :\", msg);\n\n if (config.THIS_IS_FOR_REAL) {\n udpSock.send(buf, 0, buf.length, consts.AT_PORT, consts.AR_ADDR, function() {\n res.status(200).send(\"OK\\n\");\n });\n }\n else {\n res.status(200).send(msg + \"\\n\");\n }\n }\n}", "title": "" }, { "docid": "1b400120b4c1037aa5ab52d38f9b9651", "score": "0.5888856", "text": "buttonHandler(commands) {\n if (commands.length > 0) {\n this.socket.emit(\"movement command\", commands);\n }\n }", "title": "" }, { "docid": "dfc9459dce91a1c528bb5ed3f5698b19", "score": "0.58695644", "text": "execute()\n {\n var postData = JSON.stringify(this.data);\n var options =\n {\n hostname: 'discordapp.com',\n path: this.url,\n method: 'POST',\n headers: \n {\n 'Content-Type': 'application/json',\n 'Content-Length': Buffer.byteLength(postData)\n }\n };\n\n var req = https.request(options, (res) =>\n {\n console.log(`STATUS: ${res.statusCode}`);\n console.log(`HEADERS:\n ${JSON.stringify(res.headers)}`);\n res.setEncoding('utf8');\n res.on('data', (chunk) => \n {\n console.log(`BODY: ${chunk}`);\n });\n res.on('end', () =>\n {\n console.log('No more data in response...');\n });\n });\n req.on('error', (e) =>\n {\n console.log(`Problem with request: ${e.message}`);\n });\n req.write(postData);\n req.end();\n }", "title": "" }, { "docid": "d7fee1609dc1d68d57b07b4cb41b5814", "score": "0.586032", "text": "function send (data) {\n window.electron.ipc.send('send', data)\n}", "title": "" }, { "docid": "2c9f56ba4cc958ec05cedd563fc4beeb", "score": "0.58586717", "text": "send (command, payload, assert) {\n assert = assert != null ? assert : true\n if (assert) this._assertPeers()\n for (let peer of this.peers) {\n peer.send(command, payload)\n }\n }", "title": "" }, { "docid": "e1c859e685cdc98d57173432981c1108", "score": "0.58533674", "text": "send(msg) {\n if (!this.connected()) {\n this.listener.remote_error(\"No connection to collaboration server\")\n }\n this.socket.send(msg);\n }", "title": "" }, { "docid": "f5a8e48760246e3e195d9da949daedda", "score": "0.5847187", "text": "function sendCommands(device_id, commands){\n var device = devices[device_id];\n\n io.of('/deviceSocket').to(device.socket_id)\n .emit('command', commands);\n}", "title": "" }, { "docid": "379ad4b685244e151d573db33e72a9b0", "score": "0.58283114", "text": "function response (err, res, body) {\n var parsed = parse(body);\n if (parsed) {\n command.send(parsed.text);\n }\n }", "title": "" }, { "docid": "4e9aad2a65d69d953dc0d4e70007397f", "score": "0.5817126", "text": "function sendWIxPCommand(command) {\n\talert(\"Enter sendWIxPCommand \\n\");\n\ttry {\n\t\tvar WIXPJSONStringForm = JSON.stringify(command);\n\t\tPrintLogsWIXPToTV(command);\n\t\tJAPITWIXPPlugin.WebIxpSend(WIXPJSONStringForm);\n\t\talert(\"Exit sendWIxPCommand \\n\");\n\t}\n\tcatch (e) {\n\t\talert(\"Exit sendWIxPCommand: \" + e + \" \\n\");\n\t}\n}", "title": "" }, { "docid": "24ff903306d9c851edcc2704dbe85a74", "score": "0.5814112", "text": "function Send(data) {\n\tif (socketStatus == SOCKET_STATUS_ONLINE) {\n\t\tsocket.sendText(data);\n\t}\n}", "title": "" }, { "docid": "24ff903306d9c851edcc2704dbe85a74", "score": "0.5814112", "text": "function Send(data) {\n\tif (socketStatus == SOCKET_STATUS_ONLINE) {\n\t\tsocket.sendText(data);\n\t}\n}", "title": "" }, { "docid": "2d950f4513534df1f8d9a32f509891ae", "score": "0.5811158", "text": "function runCommand(msg) {\r\n\t\tif (msg.length <= 1) return true;\r\n\r\n\t\tlet cmd = msg.split(\" \")[0].split(\".\")[1];\r\n\t\tlet msgList = msg.split(\" \");\r\n\r\n\t\tswitch (cmd.toLowerCase()) {\r\n\t\t\tcase \"send\":\r\n\t\t\tcase \"recv\":\r\n\t\t\t\tif (msgList.length < 2) {\r\n\t\t\t\t\tprint(\"ÿc1Missing arguments\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tlet args = [];\r\n\t\t\t\tmsgList.shift();\r\n\r\n\t\t\t\tfor (let b = 0; b < msgList.length; b++) {\r\n\t\t\t\t\targs[b*2] = 1;\r\n\t\t\t\t\targs[b*2+1] = parseInt(msgList[b]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\targs[1] = parseInt(\"0x\" + msgList[0], 16);\r\n\r\n\t\t\t\tif (cmd.toLowerCase() == \"send\") {\r\n\t\t\t\t\teval(\"sendPacket(\" + args.join(\", \") + \")\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\teval(\"getPacket(\" + args.join(\", \") + \")\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"watch\":\r\n\t\t\t\tif (msgList.length < 3) {\r\n\t\t\t\t\tprint(\"ÿc1Missing arguments\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch (msgList[1].toLowerCase()) {\r\n\t\t\t\t\tcase \"sent\":\r\n\t\t\t\t\t\tif (msgList[2] == \"list\") {\r\n\t\t\t\t\t\t\tprint(\"Watching sent packets : ÿc8\" + watchSent.join(\", \"));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\twatchSent.push(msgList[2]);\r\n\t\t\t\t\t\tprint(\"Added ÿc80x\" + msgList[2] + \"ÿc0 (sent) to watch list\");\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"recv\":\r\n\t\t\t\t\t\tif (msgList[2] == \"list\") {\r\n\t\t\t\t\t\t\tprint(\"Watching received packets : ÿc8\" + watchRecv.join(\", \"));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\twatchRecv.push(msgList[2]);\r\n\t\t\t\t\t\tprint(\"Added ÿc80x\" + msgList[2] + \"ÿc0 (recv) to watch list\");\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tprint(\"ÿc1Invalid argument : \" + msgList[1]);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"!watch\":\r\n\t\t\t\tif (msgList.length < 3) {\r\n\t\t\t\t\tprint(\"ÿc1Missing arguments\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch (msgList[1].toLowerCase()) {\r\n\t\t\t\t\tcase \"sent\":\r\n\t\t\t\t\t\tif (watchSent.indexOf(msgList[2]) > -1) watchSent.splice(watchSent.indexOf(msgList[2]), 1);\r\n\t\t\t\t\t\tprint(\"Removed packet ÿc80x\" + msgList[2] + \"ÿc0 (sent) from watch list\");\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"recv\":\r\n\t\t\t\t\t\tif (watchRecv.indexOf(msgList[2]) > -1) watchRecv.splice(watchRecv.indexOf(msgList[2]), 1);\r\n\t\t\t\t\t\tprint(\"Removed packet ÿc80x\" + msgList[2] + \"ÿc0 (recv) from watch list\");\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tprint(\"ÿc1Invalid argument : \" + msgList[1]);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"block\":\r\n\t\t\t\tif (msgList.length < 3) {\r\n\t\t\t\t\tprint(\"ÿc1Missing arguments\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch (msgList[1].toLowerCase()) {\r\n\t\t\t\t\tcase \"sent\":\r\n\t\t\t\t\t\tif (msgList[2] == \"list\") {\r\n\t\t\t\t\t\t\tprint(\"Blocking sent packets : ÿc8\" + blockSent.join(\", \"));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tblockSent.push(msgList[2]);\r\n\t\t\t\t\t\tprint(\"Added ÿc80x\" + msgList[2] + \"ÿc0 (sent) to block list\");\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"recv\":\r\n\t\t\t\t\t\tif (msgList[2] == \"list\") {\r\n\t\t\t\t\t\t\tprint(\"Blocking received packets : ÿc8\" + blockRecv.join(\", \"));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tblockRecv.push(msgList[2]);\r\n\t\t\t\t\t\tprint(\"Added ÿc80x\" + msgList[2] + \"ÿc0 (recv) to block list\");\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tprint(\"ÿc1Invalid argument : \" + msgList[1]);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"!block\":\r\n\t\t\t\tif (msgList.length < 3) {\r\n\t\t\t\t\tprint(\"ÿc1Missing arguments\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch (msgList[1].toLowerCase()) {\r\n\t\t\t\t\tcase \"sent\":\r\n\t\t\t\t\t\tif (blockSent.indexOf(msgList[2]) > -1) blockSent.splice(blockSent.indexOf(msgList[2]), 1);\r\n\t\t\t\t\t\tprint(\"Removed packet ÿc80x\" + msgList[2] + \"ÿc0 (sent) from block list\");\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"recv\":\r\n\t\t\t\t\t\tif (blockRecv.indexOf(msgList[2]) > -1) blockRecv.splice(blockRecv.indexOf(msgList[2]), 1);\r\n\t\t\t\t\t\tprint(\"Removed packet ÿc80x\" + msgList[2] + \"ÿc0 (recv) from block list\");\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tprint(\"ÿc1Invalid argument : \" + msgList[1]);\r\n\t\t\t\t\t\tbreak;\t\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"reload\":\r\n\t\t\t\treload();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"chat\":\r\n\t\t\t\tif (msgList.length < 2) {\r\n\t\t\t\t\tprint(\"ÿc1Missing arguments\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch (msgList[1].toLowerCase()) {\r\n\t\t\t\t\tcase \"game\":\r\n\t\t\t\t\tcase \"0\":\r\n\t\t\t\t\t\tprint(\"Chat mode set to : ÿc8in-game\");\r\n\t\t\t\t\t\tchat = 0;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase \"irc\":\r\n\t\t\t\t\tcase \"1\":\r\n\t\t\t\t\t\tprint(\"Chat mode set to : ÿc8irc\");\r\n\t\t\t\t\t\tchat = 1;\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tprint(\"ÿc1Invalid chat mode : \" + msgList[1]);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"msg\":\r\n\t\t\t\tif (msgList.length < 3) {\r\n\t\t\t\t\tprint(\"ÿc1Missing arguments\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tD2Bot.postToIRC(\"IRC\", msgList[1], msg.split(\".msg \" + msgList[1] + \" \")[1]);\r\n\t\t\t\tprint(\"ÿc2to \" + msgList[1] + \"ÿc0: \" + msg.split(\".msg \" + msgList[1] + \" \")[1]);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"channel\":\r\n\t\t\t\tif (msgList.length < 2) {\r\n\t\t\t\t\tprint(\"ÿc1Missing arguments\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (msgList[1][0] !== \"#\") {\r\n\t\t\t\t\tprint(\"ÿc1Invalid channel : \" + msgList[1]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tchannel = msgList[1];\r\n\t\t\t\tprint(\"Set channel to : ÿc8\" + msgList[1]);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"commands\":\r\n\t\t\tcase \"help\":\r\n\t\t\t\tprint(\"Help -------------------------------------------------------------\");\r\n\r\n\t\t\t\tprint(\".watch sent id ÿc5Adds a sent packet to watch list\");\r\n\t\t\t\tprint(\".watch recv id ÿc5Adds a received packet to watch list\");\r\n\r\n\t\t\t\tprint(\".!watch sent id ÿc5Removes a sent packet from watch list\");\r\n\t\t\t\tprint(\".!watch recv id ÿc5Removes a received packet from watch list\");\r\n\r\n\t\t\t\tprint(\".watch sent list ÿc5Lists all packets from sent watch list\");\r\n\t\t\t\tprint(\".watch recv list ÿc5Lists all packets from received watch list\");\r\n\r\n\t\t\t\tprint(\".block sent id ÿc5Adds a sent packet to block list\");\r\n\t\t\t\tprint(\".block recv id ÿc5Adds a received packet to block list\");\r\n\r\n\t\t\t\tprint(\".!block sent id ÿc5Removes a sent packet from block list\");\r\n\t\t\t\tprint(\".!block recv id ÿc5Removes a received packet from block list\");\r\n\r\n\t\t\t\tprint(\".block sent list ÿc5Lists all packets from sent block list\");\r\n\t\t\t\tprint(\".block recv list ÿc5Lists all packets from received block list\");\r\n\r\n\t\t\t\tprint(\".send id bytes ÿc5Sends a packet, example .send 13 2 0 0 0 17 0 0 0\");\r\n\t\t\t\tprint(\".recv id bytes ÿc5Receive a packet, example .recv 77 16\");\r\n\r\n\t\t\t\tprint(\".chat mode ÿc5Sets chat mode. 0 = game, 1 = irc\");\r\n\t\t\t\tprint(\".channel #name ÿc5Sets irc channel name. Default = #d2bs\");\r\n\t\t\t\tprint(\".msg nick msg ÿc5Whisper a specific user on irc\");\r\n\t\t\t\tprint(\".reload ÿc5Reloads in-game script\");\r\n\r\n\t\t\t\t//print(\"--------------------------------------------------------------------\")\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tprint(\"ÿc1Invalid command : \" + cmd);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "ac84ca501ee05ea7d4aab68115441c2b", "score": "0.58074564", "text": "_sendMessage(msg, socket) {\n let respString = this.messageParser.toString(msg);\n debug('Sentinel send response of\\n' + respString + '\\nto ' + socket.remoteAddress + ':' + socket.remotePort);\n socket.write(respString);\n }", "title": "" }, { "docid": "bddc804af28c88b226135c728b68e12d", "score": "0.5802111", "text": "function sendMessage(msg) {\n socket.send(msg);\n}", "title": "" }, { "docid": "1b4d601909bb2c0ffde43e2fee3b10b5", "score": "0.5797493", "text": "function commandfunc(command){\n\t\t// Splits up parameters \n\t\tvar commandParameters = command.split(/[\\s,]+/);\n\t\t// Logs to \n\t\tsys.puts(client.name+\" used the command: /\"+command);\n\t\tswitch (commandParameters[0]) {\n\t\t\t// Improvement; need to create OOP style list for commands\n\t\t\t\n\t\t\tcase 'help':\n\t\t\t\t// Nothing yet, you can easily add the commands by using \n\t\t\t\t// socket.write(\"/commandname - description\");\n\t\t\t\t// Improvement; Create a class with all the commands, their functions and descriptions\n\t\t\tbreak;\n\n\t\t\tcase 'users':\n\t\t\t\t// Lists all users\n\t\t\t\tclients.forEach(function(c) {\n\t\t\t\t\tsocket.write(\"- \" + c.name + \"\\n\");\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\tbreak;\n\n\t\t\tcase 'quit': \n\t\t\tcase 'optout':\n\t\t\t\t// Ends socket (logs the user out)\n\t\t\t\tsocket.end();\n\t\t\tbreak;\n\n\t\t\tcase 'pm':\n\t\t\t\t//Unfinished(?)\n\t\t\t\tvar reciever = commandParameters[1];\n\t\t\t\t// Workaround until I find the right regex expression\n\t\t\t\tvar msg = command.split(/\\s(.+)?/)[1].split(/\\s(.+)?/)[1];\n\t\t\t\t//clients.forEach(function(c) {\n\t\t\t\t//\tif()\n\t\t\t\t//});\n\t\t\tbreak;\n\n\t\t\tcase 'username':\n\t\t\t\t// Changes the users username (supports whitespaces i.e \"Foo bar\")\n\t\t\t\tclient.name = command.split(/\\s(.+)?/)[1];\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// If it's not a valid command\n\t\t\t\tsocket.write(\"You so silly, that not a command.\\n\");\n\t\t}\n\t}", "title": "" }, { "docid": "532a5945a32185553a85a1115b2b048a", "score": "0.5796589", "text": "function sendMessageToServer(message) {\n socket.emit('request', message);\n}", "title": "" }, { "docid": "dbe5a6ad67e5c850f04c5e892f3a3749", "score": "0.5784679", "text": "function send_ping( )\r\n{\r\n\tmy_uart.write\r\n\t(\r\n\t\t\"P\\0\",\r\n\t\tfunction(err, res)\r\n\t\t{\r\n\t\t\tif (err)\r\n\t\t\t{\r\n\t\t\t\tconsole.log(\"err \", err);\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n}", "title": "" }, { "docid": "b5ae0e17b33d9c66bf63fd8112728950", "score": "0.5781355", "text": "function sendAT(command: string, wait: number = 100) {\n serial.writeString(command + \"\\u000D\\u000A\")\n basic.pause(wait)\n}", "title": "" }, { "docid": "5183c3302b8adcd69c9dbfc8d858eaac", "score": "0.57811034", "text": "function sendCommand(command, callback, confirmed) {\n // callback = function(err) in case of confirmed = false\n // callback = function(err, battery_voltage) in case of confirmed = true\n confirmed = (typeof confirmed === 'undefined') ? true : confirmed;\n\n if (confirmed) {\n wire.write(command, function(err) {\n if (err) {\n console.log('Send command failed');\n callback(err, null);\n } else {\n wire.read(STATUS_PACKET_SIZE, function(err, buffer) {\n console.log('Read status from Trex: ' + buffer)\n if (err) {\n console.log('Status read after command send failed');\n callback(err, null);\n } else {\n // Get the battery voltage\n volt = ((buffer[3]*256)+buffer[2])/100.0;\n\n // Here we should check the status\n if (buffer[1] == 0x00) { // No errors\n callback(null, volt);\n } else {\n callback('Status indicates error: ' + buffer[1], volt);\n }\n }\n });\n }\n });\n } else {\n wire.write(command, callback);\n }\n }", "title": "" }, { "docid": "8f2dc04aa9a92e9338359728dbe9bd83", "score": "0.5778505", "text": "function sendData(data){\n //myPort.write(data, onError); need to have a look at the error\n myPort.write(data);\n }", "title": "" }, { "docid": "ef5b58b3607df32f9bee037347987f9a", "score": "0.5774219", "text": "function sendMessage() {\n io.emit('message', { msg: new Date().toJSON() });\n}", "title": "" }, { "docid": "260d9d6c86d73ebf9cbe9012b0e32825", "score": "0.5766247", "text": "sendSocks5CommandRequest() {\n const buff = new smart_buffer_1.SmartBuffer();\n buff.writeUInt8(0x05);\n buff.writeUInt8(constants_1.SocksCommand[this.options.command]);\n buff.writeUInt8(0x00);\n // ipv4, ipv6, domain?\n if (net.isIPv4(this.options.destination.host)) {\n buff.writeUInt8(constants_1.Socks5HostType.IPv4);\n buff.writeBuffer(ip.toBuffer(this.options.destination.host));\n }\n else if (net.isIPv6(this.options.destination.host)) {\n buff.writeUInt8(constants_1.Socks5HostType.IPv6);\n buff.writeBuffer(ip.toBuffer(this.options.destination.host));\n }\n else {\n buff.writeUInt8(constants_1.Socks5HostType.Hostname);\n buff.writeUInt8(this.options.destination.host.length);\n buff.writeString(this.options.destination.host);\n }\n buff.writeUInt16BE(this.options.destination.port);\n this.nextRequiredPacketBufferSize =\n constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader;\n this.socket.write(buff.toBuffer());\n this.setState(constants_1.SocksClientState.SentFinalHandshake);\n }", "title": "" }, { "docid": "260d9d6c86d73ebf9cbe9012b0e32825", "score": "0.5766247", "text": "sendSocks5CommandRequest() {\n const buff = new smart_buffer_1.SmartBuffer();\n buff.writeUInt8(0x05);\n buff.writeUInt8(constants_1.SocksCommand[this.options.command]);\n buff.writeUInt8(0x00);\n // ipv4, ipv6, domain?\n if (net.isIPv4(this.options.destination.host)) {\n buff.writeUInt8(constants_1.Socks5HostType.IPv4);\n buff.writeBuffer(ip.toBuffer(this.options.destination.host));\n }\n else if (net.isIPv6(this.options.destination.host)) {\n buff.writeUInt8(constants_1.Socks5HostType.IPv6);\n buff.writeBuffer(ip.toBuffer(this.options.destination.host));\n }\n else {\n buff.writeUInt8(constants_1.Socks5HostType.Hostname);\n buff.writeUInt8(this.options.destination.host.length);\n buff.writeString(this.options.destination.host);\n }\n buff.writeUInt16BE(this.options.destination.port);\n this.nextRequiredPacketBufferSize =\n constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader;\n this.socket.write(buff.toBuffer());\n this.setState(constants_1.SocksClientState.SentFinalHandshake);\n }", "title": "" }, { "docid": "0cd2f6d183ea3cb8d4fd8e6175914fe4", "score": "0.576384", "text": "function sendTECommandToHost(strCommand) {\n\n\tif(objTerminalEmulation==null) {\n\t\tobjTerminalEmulation = new ActiveXObject(\"Dat32Com.TerminalEmulation\");\t\t\t \t\t\t\t\t\n\t}\n\n\ttry {\n\t\tobjTerminalEmulation.Open();\n\t\tstrCommand='<FORMAT>'+strCommand+'</FORMAT>';\n\t\tobjTerminalEmulation.MakeEntry(strCommand);\n\n\t\t//In case success is not returned then gather the return in array\n\t\tif(!objTerminalEmulation.ResponseLine(0).match(/^\\s\\*<CARRIAGE_RETURN/)) {\n\t\t\tgatherErrors(objTerminalEmulation);\n\t\t}\n\n\t\treturn objTerminalEmulation.ResponseXML;\n\t} catch(e) {\n\t\treturn e.message;\n\t} finally {\n\t\tif(objTerminalEmulation!=null) objTerminalEmulation.Close(); //close after usage\n\t}\t\n}", "title": "" }, { "docid": "83459bdb6ae365900a9e303bec4bd00a", "score": "0.5756388", "text": "function sendMove() {\r\n \ttry {\r\n\t \tconnection.send(JSON.stringify({\r\n\t \t\t\"action\" : \"move\"\r\n\t \t\t, \"gameID\" : gameID\r\n\t \t\t, \"originTile\" : tileSelected\r\n\t \t\t, \"destinationTile\" : destinationTile}))\r\n \t} catch (e) {\r\n \t\tlog(\"We errored on move\")\r\n \t\treturn;\r\n \t}\r\n }", "title": "" }, { "docid": "77afb7906e78da8c40e513cb478b1e94", "score": "0.57555896", "text": "function sendMessage() {\n // Create a new message object\n var message = {\n text: vm.messageText\n };\n\n // Emit a 'writingMessage' message event\n Socket.emit('writingMessage', message);\n\n // Clear the message text\n vm.messageText = '';\n }", "title": "" }, { "docid": "06a09e457f7cfefd869fe0cd3727fe4f", "score": "0.57282877", "text": "_sendMessage(msg, socket) {\n let respString = this.messageParser.toString(msg);\n debug('Send response of\\n' + respString + '\\nto ' + socket.remoteAddress + ':' + socket.remotePort);\n socket.write(respString);\n }", "title": "" }, { "docid": "ab8467cce3f1deb3caecbfb7cea32ca6", "score": "0.572508", "text": "function sendReq(command, data)\n\t{\n\t\t$.ajax({\n \t\t\turl:'/api',\n \t\t\ttype:'GET',\n \t\t\tdata:{'command':command, 'data':data},\n \t\t\tsuccess: function(res){\n\n\t\t\t$('#programInput').val(res);\n\t\t}\n\t\t});\n\n\t}", "title": "" }, { "docid": "b97371d400e55ae348b6b7d4d7739ffb", "score": "0.5713506", "text": "send(action, payload) {\n this.connection.send(\n JSON.stringify({\n action,\n payload\n })\n );\n }", "title": "" }, { "docid": "57ee3bb3054330cedf352648ed5271b2", "score": "0.5712687", "text": "function send(text) {\r\n\twebSocket.send(text);\r\n}", "title": "" }, { "docid": "6a243c0bd88f42f13f0bb86558085782", "score": "0.57123893", "text": "function socketSend(str) {\n socket.send(str);\n}", "title": "" }, { "docid": "29deb36345c75ceb200f48c431a2db86", "score": "0.5707413", "text": "static _send(code, text, opts = silentOpts) {\n const coop = SERVER._coop();\n const chan = this.getByCode(coop, code);\n return chan.send(text, opts);\n }", "title": "" }, { "docid": "4f29952445150bab6d3de904c93d42fc", "score": "0.5702524", "text": "function handleSendCommandResponse(id, data) {\n var response = {result: data, id: id};\n if (chrome.extension.lastError) {\n response.error = chrome.extension.lastError;\n }\n if (debug) {\n var msg = id + \n \" atopwi response to sendCommand \" + messageObject.method;\n var obj = {messageObject: messageObject, data: data, response: response};\n console.log(msg, obj);\n }\n this.inspectorWindow.InspectorBackend.dispatch(response); \n }", "title": "" }, { "docid": "59ccc9ab63423f47f6784d8f7cdfb054", "score": "0.56980085", "text": "command(data) {\n if (!this.connection) throw new Error('connection is not attached');\n this.connection.switchCommandService({ ...data, key: this.config.key });\n }", "title": "" } ]
6b51e5dc217b49c21060c44da07baffe
start the runner animation
[ { "docid": "530c8be3756a17db79ece0022889caa1", "score": "0.65055346", "text": "function moveRunner() {\n //console.log('runner is, well, running!');\n\n let animate = document.getElementById('running');\n animate.style.display = 'block'; \n\n // show each image for the amount of time in imgArr\n timerId = window.setTimeout(runRunner, imgArr[nextImg][1]); // set the timeout from imgArr\n nextImg++; // move to the next image\n}", "title": "" } ]
[ { "docid": "d9f4f1e0d665aff102c31a87d988bd33", "score": "0.72079355", "text": "start() {\n\t\tthis.run = true;\n\t\tthis.startDrawCycle();\n\t}", "title": "" }, { "docid": "f3d0400fa4337c26f9b604d4a1f2cc51", "score": "0.7039141", "text": "start() {\n this.createBlocks();\n this.animate();\n }", "title": "" }, { "docid": "d33e262ad571ad282cea256e39303760", "score": "0.70180535", "text": "startAnimation() {\n this._animationCallback();\n }", "title": "" }, { "docid": "f1d9a58fb17fdf201c49bc30b6392fa1", "score": "0.6975501", "text": "function start() {\n isanim = true;\n anim();\n}", "title": "" }, { "docid": "6ede3905381d54e275c5d6b8dd0bec2b", "score": "0.67600864", "text": "start() {\n this.started = true;\n this.draw();\n }", "title": "" }, { "docid": "e2e18796c161adac3479aec8c4360119", "score": "0.6757391", "text": "function startAnimation() {\n if (setupFailed) {\n return handleSetupFailed();\n }\n\n document.getElementById('startButton').onclick = stopAnimation;\n document.getElementById('startButton').value = 'Stop';\n magLevel = 1;\n iterations = 0;\n timeBefore = Date.now();\n initStatus();\n\n // Send these through shared memory to illustrate the principle.\n // The worker could compute the slice from the iteration number.\n\n var sliceHeight = Math.ceil(height / NumSlices);\n for (var i = 0; i < NumSlices; i++) {\n slices[i * Slice_INTS + Slice_ybase] = i * sliceHeight;\n slices[i * Slice_INTS + Slice_ylimit] = Math.min(height, (i + 1) * sliceHeight);\n }\n\n startFrame();\n}", "title": "" }, { "docid": "44eb7f2c98703bdce382ad77974b99ba", "score": "0.67407703", "text": "start(animate) {\n this.isStarted = true;\n animate(this.ctx);\n }", "title": "" }, { "docid": "de366c21713c69098fa8d8a107cecf39", "score": "0.65658194", "text": "start() {\n if (!this.frameId) {\n this.frameId = requestAnimationFrame(this.animate)\n }\n }", "title": "" }, { "docid": "ada934e55955849a6a9131dbbace8f31", "score": "0.65316045", "text": "schedule(runner,delay,when){if(null==runner){return this._runners.map(makeSchedule)}// The start time for the next animation can either be given explicitly,\n// derived from the current timeline time or it can be relative to the\n// last start time to chain animations direclty\nvar absoluteStartTime=0,endTime=this.getEndTime();delay=delay||0;// Work out when to start the animation\nif(null==when||\"last\"===when||\"after\"===when){// Take the last time and increment\nabsoluteStartTime=endTime}else if(\"absolute\"===when||\"start\"===when){absoluteStartTime=delay;delay=0}else if(\"now\"===when){absoluteStartTime=this._time}else if(\"relative\"===when){const runnerInfo=this._runners[runner.id];if(runnerInfo){absoluteStartTime=runnerInfo.start+delay;delay=0}}else{throw new Error(\"Invalid value for the \\\"when\\\" parameter\")}// Manage runner\nrunner.unschedule();runner.timeline(this);const persist=runner.persist(),runnerInfo={persist:null===persist?this._persist:persist,start:absoluteStartTime+delay,runner};this._lastRunnerId=runner.id;this._runners.push(runnerInfo);this._runners.sort((a,b)=>a.start-b.start);this._runnerIds=this._runners.map(info=>info.runner.id);this.updateTime()._continue();return this}", "title": "" }, { "docid": "361df98c380180df4d72b073f7b941d0", "score": "0.65206546", "text": "function startAnimation() {\n stopAnimation();\n animation = animate(slider.values[0]);\n }", "title": "" }, { "docid": "361df98c380180df4d72b073f7b941d0", "score": "0.65206546", "text": "function startAnimation() {\n stopAnimation();\n animation = animate(slider.values[0]);\n }", "title": "" }, { "docid": "be6086aa8efa9f4dd81a844a23c9655a", "score": "0.65127385", "text": "function animate() {\n renderer.setAnimationLoop(render);\n}", "title": "" }, { "docid": "cb34b5c2612c3e1d12001ace80a51959", "score": "0.65102065", "text": "function anim (){\n loop ();\n requestAnimFrame(anim);\n }", "title": "" }, { "docid": "af5373e9ad0b73ba40c3d992754e8706", "score": "0.65070945", "text": "function startGame () {\n\t\t$('.target').each(function (i, el) {\n\t\t\t\n\t\t\tanimateDiv($(this));\n\t\t});\n\t}", "title": "" }, { "docid": "2989141eef5327482fe2d84b9b129e2b", "score": "0.6503881", "text": "function start() {\r\n if (isRunning) return;\r\n animationCallback = getRequestAnimationFrame(frameRenderCore);\r\n isRunning = true;\r\n }", "title": "" }, { "docid": "86e334d7b7adaba44280d337c4620c44", "score": "0.6439672", "text": "function animate() {\n\tif (runAnim) {\n\t\trequestAnimationFrame(animate);\n\t}\n\trender();\n}", "title": "" }, { "docid": "d33cd11a5da65f06770cc5a9c5e8f6cf", "score": "0.64269763", "text": "function main() {\n\t\t\ttry {\n if (moDecArmed) {\n render(which);\n }\n\t\t\t} catch(e) {\n\t\t\t\tconsole.log(e);\n\t\t\t\treturn;\n\t\t\t}\n\n // asks browser to call this function on \n // new animation frame. \n raf(main.bind(this));\n\t\t}", "title": "" }, { "docid": "11fa41593dea9e3ba2a8fc14732d3717", "score": "0.64196473", "text": "function Animation() {\n\t'use strict';\n\tthis.runners = [];\n\tthis.timer = null;\n\tthis.animationSecs = 0;\n\tthis.deltaSecs = 5;\n\t// value in milliseconds\n\tthis.timerInterval = 100;\n\t// if not real time then mass start\n\tthis.realTime = false;\n\tthis.earliestStartSecs = 0;\n\tthis.latestFinishSecs = 0;\n\tthis.tailLength = 0;\n\tthis.useFullTails = false;\n\t// control to start from if this option selected\n\tthis.massStartControl = 0;\n\t// run each leg as a mass start if true\n\tthis.massStartByControl = false;\n\tthis.displayNames = true;\n\tthis.displayInitials = false;\n}", "title": "" }, { "docid": "93068e90f2c24ee56a1e2f35aa9bd0a6", "score": "0.6415819", "text": "function animate() {\n renderer.animate( render );\n }", "title": "" }, { "docid": "966b6eeb6873927ad66ca37080f535fe", "score": "0.6393461", "text": "function initRunAnimate(id) {\n matchId = id;\n sortPlayerStats(id);\n //drawBarchart(); \n clearBarchart(); \n end1 = PI; end2 = 0;\n end1Stop = TWO_PI; end2Stop = PI;\n enableDraw = true;\n drawFlag = false;\n //if (id==1)\n // {clear();return;}\n clear();\n //image(empireImg, 0, 0, empireImg.width = 1200, empireImg.height/2.7);\n //drawVisualizationAnimate();\n loop();\n}", "title": "" }, { "docid": "395a09276e8ad02004b90dbfaa22b433", "score": "0.6393198", "text": "function start() {\n running = true;\n frame();\n }", "title": "" }, { "docid": "e71e747a302f3dc414fc6fbeaa20b352", "score": "0.6389528", "text": "start() {\n\n\t\t// start animation loop\n\t\tthis.gameEngine.renderer.setAnimationLoop(() => {\n\t\t\tthis.gameEngine.updateGameObjects()\n\t\t\tthis.gameEngine.render()\n\t\t})\n\t}", "title": "" }, { "docid": "34fb1752fde4d017d3520bb0290b5ad0", "score": "0.63535047", "text": "function startTestIsClicked(){\n startColor = '#FF5533';\n TESTSTART = true;\n testball_status = \"move\";\n setTimeout(() => {\n startColor = '#16C79A';\n }, 100);\n COLLISION = false;\n dt = 1.0/frmRate;\n }", "title": "" }, { "docid": "bdaa6de37bb9a6022bcd5f35a89a5f8e", "score": "0.6341031", "text": "start(){\n this.boot();\n this.animate();\n }", "title": "" }, { "docid": "31a688d8f71b2e04c62c974d29e24a9a", "score": "0.6334304", "text": "function beginAnimation() {\n\tdocument.getElementById('main').appendChild(renderer.view);\n\trequestAnimFrame(animate);\n}", "title": "" }, { "docid": "5c660179cd80921a419755a32a604ba0", "score": "0.6325758", "text": "function animloop() {\n init = requestAnimFrame(animloop);\n draw();\n }", "title": "" }, { "docid": "750b2056640cb2dceb8a83fa38a14608", "score": "0.63217497", "text": "function startAnimation() {\n\tlet mc = app2.stage.children[0];\n\tconsole.log(mc);\n\tmc.gotoAndPlay(\"start_anime\");\n}", "title": "" }, { "docid": "d63793493def93c236ca61df9cd3c533", "score": "0.63174623", "text": "SampleAnimation() {}", "title": "" }, { "docid": "9d6e8f1fc301e2eabe30361075e7529f", "score": "0.6315847", "text": "function startAnimation() {\n\t\t\tif (animationCycle) { return; }\n\n\t\t\t// Restart sound\n\t\t\tif (sound) { \n\t\t\t\tsound.play();\n\t\t\t}\n\n\t\t\tvar startedAt = getMillis();\n\t\t\tanimationCycle = $interval(function() {\n\t\t\t\t// Check that we haven't been cancelled\n\t\t\t\tif (!animationCycle) { return; }\n\n\t\t \tvar diff = getMillis() - startedAt,\n\t\t \t\t\tx = diff/animationDuration,\n\t\t\t\t\t\ty = (Math.cos(Math.PI*(2*x+1))+1)/2;\n\n\t \t\tvar cam = tweenCamera($scope.scene.camA, $scope.scene.camB, y);\n\t \t\thuman.send('camera.set', cam);\n\t \t}, 30);\n\t\t}", "title": "" }, { "docid": "d5d9a8a63c057f653787792db1839a87", "score": "0.630992", "text": "function startAnimation() {\n document.getElementById(\"startButton\").onclick = stopAnimation;\n document.getElementById(\"startButton\").value = \"Stop\";\n magnification = 1;\n iterations = 0;\n timeBefore = Date.now();\n initStatus();\n startFrame();\n}", "title": "" }, { "docid": "dba03bad80e52e1f37249373e42c7bbe", "score": "0.63026094", "text": "animateStoneCard() {\n this.animationFinished = false;\n this.animation.startAnimation();\n }", "title": "" }, { "docid": "99dcd9e74f32075d4b98abe5552b47cd", "score": "0.6278519", "text": "start() {\n\t\tthis.update();\n\t\tthis.scoreboard.draw();\n\t\tthis.playground.draw();\n\t\tthis.timer = setTimeout(this.nextScreen.bind(this), 5000);\n\t}", "title": "" }, { "docid": "c46bfae16e92ecd448c82086a1821825", "score": "0.62663025", "text": "function startAnimation() {\n if (animating) return;\n animating = true;\n previousTime = 0;\n animate(previousTime);\n}", "title": "" }, { "docid": "60e4cacc144c1731ef270b4388fa4b01", "score": "0.6256891", "text": "function firstLoop() {\n anim.playSegments([0,18], true);\n}", "title": "" }, { "docid": "2f9b9e151b33027f937bf8bf5e585246", "score": "0.6252961", "text": "animationStart() {\n this.drawing.drawGridLines('black', this.CA.rows, this.CA.cols);\n this.drawing.drawGrid('full', this.CA.rows, this.CA.cols, this.CA.grid);\n this.animationLoop();\n }", "title": "" }, { "docid": "81b888993de801b675888a9409cb83ed", "score": "0.624419", "text": "function start () { \n\t\tif ( is_running ) return;\n\t\tlogger.info( \"game started.\" );\n\t\treset();\n\t\tis_running = true;\n\t\tis_paused = false;\n\t\ttimer.start(); \n\t\tcanvas.parentNode.className = 'running';\n\t}", "title": "" }, { "docid": "9fd91a6bbb6287054122d06a5c8f830a", "score": "0.62437195", "text": "start() {\n if (this.callbackId !== null) {\n console.warn(\"Start called while running.\");\n return;\n }\n let callback = () => {\n this.paintAll();\n this.callbackId = window.requestAnimationFrame(callback);\n };\n callback();\n }", "title": "" }, { "docid": "77fac0c56a43fe24742b32dfdbb13c40", "score": "0.6233386", "text": "function main() {\n if(!running) {\n return;\n }\n\n var now = Date.now();\n var dt = (now - then) / 1000.0;\n\n//\tupdate(dt);\n render();\n\n then = now;\n requestAnimFrame(main);\n }", "title": "" }, { "docid": "27ab3bd8e977b9a20fc5f76dc0347625", "score": "0.62209105", "text": "start() {\n this.loop();\n }", "title": "" }, { "docid": "1206971588423eb5436feb9bb14850b4", "score": "0.6218965", "text": "function start(){\n\tconsole.log(\"Start!\");\n init();\n window.requestAnimationFrame(animate);\n}", "title": "" }, { "docid": "9e72a1cbfe94a1f74a6c1946d38057f9", "score": "0.6214375", "text": "StartScreenBob() {\n this.body.allowGravity = false;\n this.tween = this.scene.tweens.add({\n targets: this,\n y: this.y + 20,\n duration: 1500,\n ease: 'Sine.inOut',\n yoyo: true,\n repeat: -1\n });\n\n this.waiting = true;\n }", "title": "" }, { "docid": "4175eee042838945bd8bd54e59e1774d", "score": "0.6184546", "text": "startDrawCycle() {\n\t\tif (this.run === false) return;\n\t\tthis.drawFrame(1);\n\n\t\traf(this.startDrawCycle.bind(this));\n\t}", "title": "" }, { "docid": "4b13c88237f601178d1db71dba8de0d5", "score": "0.6173022", "text": "function begynd() { //begynder animationen\n\n $(\"#start\").on(\"click\", moveIn); //knap til start, defineret i html\n $(\"#fall\").on(\"click\", fall);\n\n}", "title": "" }, { "docid": "3555ce19980690233fd978ba5aeede6a", "score": "0.6172304", "text": "function animate() {\n\trenderer.animate( render );\n}", "title": "" }, { "docid": "dc4056e1e04925aeebbd4e655e074406", "score": "0.61704326", "text": "start () {\n util.waitOn(() => this.modelReady, () => this.anim.start())\n return this\n }", "title": "" }, { "docid": "ae3770b16e9610c8b9bb43f222d438c3", "score": "0.61654484", "text": "function startPlay() {\n\t\tif(running || list.length < 1) return;\n\t\trunning = true;\n\t\t\n\t\tgenerateResult();\n\t\t\n\t\tfor(var i = 0; i < reels.length; i++) {\n\t\t\tvar r = reels[i];\n\t\t\tvar extra = Math.floor(Math.random() * 3);\n\t\t\tvar target = r.position + 10 + i * 5 + extra;\n\t\t\tvar time = 2500 + i * 600 + extra * 600;\n\t\t\n\t\t\t// Update reel target\n\t\t\tr.target = target;\n\t\t\ttweenTo(r, 'position', time, backout(0.5), i === reels.length-1 ? reelsComplete : null)\n\t\t}\n\t}", "title": "" }, { "docid": "1cdf283f0d8e6f25e921b4bca317baa2", "score": "0.61641127", "text": "function reactionStart () {\n switchButton2(); // Zustand des Schaltknopfs ändern\n if (bu2.state == 1) startAnimation(); // Entweder Animation starten bzw. fortsetzen ...\n else stopAnimation(); // ... oder stoppen\n if (bu2.state == 2) savePoint(); // Falls Pause, Koordinaten speichern\n paint(); // Zeichnung aktualisieren\n }", "title": "" }, { "docid": "5581db4ea9b20e620a573b7a1b929428", "score": "0.6156488", "text": "constructor(timeSource=defaultSource){super();this._timeSource=timeSource;// Store the timing variables\nthis._startTime=0;this._speed=1;// Determines how long a runner is hold in memory. Can be a dt or true/false\nthis._persist=0;// Keep track of the running animations and their starting parameters\nthis._nextFrame=null;this._paused=!0;this._runners=[];this._runnerIds=[];this._lastRunnerId=-1;this._time=0;this._lastSourceTime=0;this._lastStepTime=0;// Make sure that step is always called in class context\nthis._step=this._stepFn.bind(this,!1);this._stepImmediate=this._stepFn.bind(this,!0)}", "title": "" }, { "docid": "9a41d82795d7fc192127be715d9c8baa", "score": "0.61555177", "text": "run() {\r\n\t\t// Only start running once.\r\n\t\tif (this.running) return;\r\n\t\tthis.running = true;\r\n\t\t\r\n\t\tlet stepper = this;\r\n\t\tconst recurse = function() {\r\n\t\t\tif (!stepper.running) return;\r\n\t\t\tstepper.stepAll();\r\n\t\t\tstepper.drawAll();\r\n\t\t\twindow.requestAnimationFrame(recurse);\r\n\t\t}\r\n\t\twindow.requestAnimationFrame(recurse);\r\n\t}", "title": "" }, { "docid": "4b3951aa17695cfa01881c49df48383b", "score": "0.6151112", "text": "function startAnimation() {\n timerId = setInterval(drawFrame, 16);\n}", "title": "" }, { "docid": "3c59aba29b7d260c76f8863aa70fdb57", "score": "0.6150323", "text": "function main() {\n if(!running) {\n return;\n }\n\n var now = Date.now();\n var dt = (now - then) / 1000.0;\n\n update(dt);\n render();\n\n then = now;\n requestAnimFrame(main);\n }", "title": "" }, { "docid": "2c7e77aa5a66328cc72e99ae08f66281", "score": "0.612391", "text": "function animate() {\n oneStep();\n if( ! stopRequested ) {\n animationId = requestAnimationFrame(animate);\n }\n}", "title": "" }, { "docid": "d1ac45f42da56687f04d110840df7519", "score": "0.6122073", "text": "function run(){\n\n\t\t\tif( !running ){\n\n\t\t\t\trunning = true;\n\t\t\t\tsounds.ambient.play();\n\t\t\n\t\t\t\tfunction animate( timeSinceLoad ){\n\n\n\t\t\t\t\t\n\n\t\t\t\t\tt = timeSinceLoad - startTime;\n\t\t\t\t\tdelta = t - time;\n\t\t\t\t\tdelta = delta > FPmS ? FPmS : delta\n\t\t\t\t\ttime = t;\n\n\t\t\t\t\tTWEEN.update( time );\n\t\t\t\t\t\n\t\t\t\t\tcontrolsActive = lights.update( camera );\n\t\t\t\t\tcontrols.setPauseState( controlsActive );\n\t\t\t\t\tif( !controlsActive ) controls.update( camera );\n\t\t\t\t\t// if( gui && lastClicked ) controls.autoRotate = !controlsActive;\n\n\t\t\t\t\tpicking();\n\t\t\t\t\t\n\t\t\t\t\ttransition.update( delta / 1000 * api.speed );\n\n\t\t\t\t\tif( arrived && lastClicked ){\n\t\t\t\t\t\ttoScreenXY( lastClicked.position , camera, $('#main') );\n\t\t\t\t\t\tyPOss = Number( screenPos.top - 200 );\n\t\t\t\t\t\tyPOss -= Math.max( 0, yPOss + infoOverlay.height() - window.innerHeight + 10 );\n\t\t\t\t\t\tyPOss = Math.max( 0, yPOss );\n\t\t\t\t\t\tinfoOverlay.css(\"transform\", 'translate( '+ Number( screenPos.left + 250 - infoOverlay.xOffset ) + 'px, '+ yPOss +'px )');\n\t\t\t\t\t}\n\n\t\t\t\t\trequestAnimationFrame( animate );\n\t\t\t\t\trender( delta, time );\n\t\t\t\t\t\t\n\n\n\t\t\t\t}\n\n\t\t\t\ttime = 0;\n\t \t\t\tdelta = 0;\n\t \t\t\tt = 0;\n\n\t \t\t\tstartTime = timer.now() - ( performance && performance.timing ? performance.timing.navigationStart : pageLoad );\n\n\t\t\t\trequestAnimationFrame( animate );\n\t\t\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2383f7deb146fd22b0749150c8a98021", "score": "0.6120583", "text": "function startAnimation() {\n\tintervalRef = setInterval('animateSprite()',200);\n\t}", "title": "" }, { "docid": "1dffe3535fd9d9bae7214cb33a866694", "score": "0.61167544", "text": "function startRelu() {\n \t\tcounter = 0;\n \t\tif (interval) clearInterval(interval);\n\n \t\t$$invalidate(12, interval = setInterval(\n \t\t\t() => {\n \t\t\t\tif (isPaused) return;\n \t\t\t\tconst flat_animated = counter % (output.length * output.length);\n \t\t\t\t$$invalidate(6, outputHighlights = array1d$1(output.length * output.length, i => false));\n \t\t\t\t$$invalidate(5, inputHighlights = array1d$1(image.length * image.length, i => undefined));\n \t\t\t\tconst animatedH = Math.floor(flat_animated / output.length);\n \t\t\t\tconst animatedW = flat_animated % output.length;\n \t\t\t\t$$invalidate(6, outputHighlights[animatedH * output.length + animatedW] = true, outputHighlights);\n \t\t\t\t$$invalidate(5, inputHighlights[animatedH * output.length + animatedW] = true, inputHighlights);\n \t\t\t\tconst inputMatrixSlice = getMatrixSliceFromInputHighlights(image, inputHighlights, 1);\n \t\t\t\t$$invalidate(3, gridInputMatrixSlice = gridData(inputMatrixSlice));\n \t\t\t\tconst outputMatrixSlice = getMatrixSliceFromOutputHighlights(output, outputHighlights);\n \t\t\t\t$$invalidate(4, gridOutputMatrixSlice = gridData(outputMatrixSlice));\n \t\t\t\tcounter++;\n \t\t\t},\n \t\t\t250\n \t\t));\n \t}", "title": "" }, { "docid": "530803f4a1080604896328938ea6ea8b", "score": "0.61100006", "text": "function startAnimation(){\r\n\r\n\tif(animateBall){\r\n\t\r\n\t\tupAndDown();\r\n\t\tballAnimationInterval = setInterval(function(){upAndDown();}, ballAnimationTime*2.6);\r\n\t\t\r\n\t}\r\n\t\r\n\tif(animateBubble){\r\n\t\r\n\t\tbubble();\r\n\t\tsetInterval(function(){bubble();}, bubbleAnimationTime*2.2);\r\n\t\t\r\n\t}\r\n\t\r\n\tif(animateNose){\r\n\t\r\n\t\tnose();\r\n\t\tsetInterval(function(){nose();}, (Math.floor(Math.random() * 10) + 6) * 1000);\r\n\t\t\r\n\t}\r\n\r\n\t$(\"#universal-preloader\").remove();\r\n\r\n}", "title": "" }, { "docid": "cf4eae3489874e6d0a84137ad1886ab2", "score": "0.6108333", "text": "function startAnimation () {\n on = true; // Animation angeschaltet\n timer = setInterval(paint,40); // Timer mit Intervall 0,040 s aktivieren\n t0 = new Date(); // Neuer Anfangszeitpunkt \n }", "title": "" }, { "docid": "cf4eae3489874e6d0a84137ad1886ab2", "score": "0.6108333", "text": "function startAnimation () {\n on = true; // Animation angeschaltet\n timer = setInterval(paint,40); // Timer mit Intervall 0,040 s aktivieren\n t0 = new Date(); // Neuer Anfangszeitpunkt \n }", "title": "" }, { "docid": "8e779c535a9a39fd61f2c13ec691d07a", "score": "0.609972", "text": "_animationStart() {\n this.isAnimating = true;\n }", "title": "" }, { "docid": "668cb93cd8c89f744cb6f3556f2c2e6c", "score": "0.6090861", "text": "function start() {\n startScreen.style.animationName = \"blow-up\";\n startScreen.style.animationDuration = \"0.75s\";\n startScreen.style.animationDelay = \"0.5s\";\n startScreen.style.animationFillMode = \"both\";\n}", "title": "" }, { "docid": "22470d5939755fbcaea8324fca6b5d06", "score": "0.60836506", "text": "function startAnimation() {\n const frameFunction = (time) => {\n draw(time);\n window.requestAnimationFrame(frameFunction);\n };\n window.requestAnimationFrame(frameFunction);\n}", "title": "" }, { "docid": "98f5f17aaab41d7c4527de5c9b606cb3", "score": "0.60806924", "text": "start() {\n this._scan();\n this._renderLoop();\n }", "title": "" }, { "docid": "5d8f3ebee8b3bfd7cad5e8e0d212ddae", "score": "0.60705805", "text": "function start() {\n\t\tcorruption = requestAnimationFrame(render);\n\t}", "title": "" }, { "docid": "2d906db79a5f94b52322a6f9a2e611e9", "score": "0.6064465", "text": "start () {\n // Draw the starting point for the view with no elements\n }", "title": "" }, { "docid": "2d906db79a5f94b52322a6f9a2e611e9", "score": "0.6064465", "text": "start () {\n // Draw the starting point for the view with no elements\n }", "title": "" }, { "docid": "6b442db0c5606218979ed19a4c1d4f4d", "score": "0.6058104", "text": "function animloop() {\n render();\n\trequestAnimFrame(animloop);\n}", "title": "" }, { "docid": "6b442db0c5606218979ed19a4c1d4f4d", "score": "0.6058104", "text": "function animloop() {\n render();\n\trequestAnimFrame(animloop);\n}", "title": "" }, { "docid": "75bd4d37d7d4e25e9b1041e877d63e17", "score": "0.60560703", "text": "function startTrain(t) {\n\tconsole.log(\"Choo Choo!\");\n\tt.stop().animate({\n \t'left': '-1354px'\n },{\n \tduration: 5000,\n \teasing: 'linear',\n \tcomplete: function(){\n \tinfiniteTrain(t);\n \t}\n \t}\n\t);\n}", "title": "" }, { "docid": "9a457ac445e486ddc01b23df691f3a4f", "score": "0.6054687", "text": "start () {\n const timelineVm = this;\n let currentTick = 0;\n\n this._interval = setInterval(eachTick, timelineVm.tick);\n\n /**\n * Method gets called on each tick of the interval\n */\n function eachTick () {\n const indexesOfSequenceItems = timelineVm._timelineMapping[currentTick];\n\n if (typeof indexesOfSequenceItems !== 'undefined' &&\n Array.isArray(indexesOfSequenceItems)) {\n indexesOfSequenceItems.forEach(callAnimationOfSequenceItem);\n }\n\n currentTick += timelineVm.tick;\n\n if (currentTick > timelineVm._endTimeOfSequence) {\n clearInterval(timelineVm._interval);\n timelineVm._timelineMapping = {};\n timelineVm.items = {};\n }\n }\n\n /**\n * Call the onTick of the animation related to the sequenceItem given\n * @param {Number} sequenceItemIndex\n */\n function callAnimationOfSequenceItem (sequenceItemIndex) {\n const sequenceItem = timelineVm.items[sequenceItemIndex];\n const from = sequenceItem[0];\n const to = sequenceItem[1];\n const animation = sequenceItem[2];\n\n if (animation instanceof Animation) {\n const percentage = (currentTick - from) / (to - from);\n animation.onTick(percentage);\n\n if (currentTick > to - timelineVm.tick) {\n animation.onComplete();\n }\n }\n }\n }", "title": "" }, { "docid": "a8517571aa3a530b62c689880b6f8fdd", "score": "0.6053379", "text": "async start() {\n const m = this\n\n // start the game\n m.#store.set((s) => s.started = true)\n\n // wait for the animation fo finish\n // show the first honeypot\n await delay(5.0)\n m.spawnHoneypot()\n }", "title": "" }, { "docid": "1188c288d4f8526730c8fd2d165884c5", "score": "0.6052746", "text": "play() {\n\n if (this.firstAnimation !== null) {\n this.firstAnimation.start();\n }\n\n this.firstAnimation = null;\n this.previousAnimation = null;\n }", "title": "" }, { "docid": "fd648f30b65ebffc2b3648257b6e2803", "score": "0.60505044", "text": "function startSequences()\n{\n\t\t\n\ttigerBlink = new animationSequence(\"tiger\",3);\n\ttigerBlink.hold(1,72);\n\t//tigerBlink.hold(2,10);//hold the first image for 30 frames//still a fantasy\n\t\n\t//console.log(\"after a 30 frame and 10 frame hold, total frameCount is now \"+tigerBlink.frameCount);\n\t//thisSequence = new animationSequence(divIdName, totalImages, \"imageSuffix-holdTime\",\"nextImageSuffix-holdTime\");\n\t//var tigerBlink = new animationSequence(tiger,3,\"1-30\",\"3-2\");//still a fantasy\n\t\n\t//tigerBlink.holdRandom(1,30,100);//Hold image one for a random frame count between 30 and 100//still a fantasy\n\t//tigerBlink.frameRate = 12;//still a fantasy\n}", "title": "" }, { "docid": "32b0fb64d8f6d8cce90eb316965498bd", "score": "0.6050101", "text": "start() {\n this.r.start();\n }", "title": "" }, { "docid": "a96512f101d541c5f4f07dbb8073bcee", "score": "0.6043604", "text": "startAnimation() {\n if (!this.rafActive && this.watchArray.length > 0) {\n this.rafActive = true;\n this.rafId = requestAnimationFrame(this.updateAnimation.bind(this));\n }\n }", "title": "" }, { "docid": "d069846dfeb1c274acf05d411917f146", "score": "0.6042824", "text": "function runLoaderAnimation() {\n console.log(\"loader started\");\n animation_container.classList.add(\"loader-container\");\n animation.classList.add(\"loader\");\n} // Stop the Loader animation", "title": "" }, { "docid": "02651ce64cb6b31f0c33728224f129e8", "score": "0.6042361", "text": "function start_race()\n{\n\t//Disable the start button\n\tdisable_button('start_button');\n\t//Position cars on the start line\n\t//$('audio_player').writeAttribute('src', '../audio/f1loin_SF.ogg');\n\tvar cars = $$('div.car');\n\tfor (var i=0 ; i<cars.length ; i++)\n\t{\n\t\tnew Effect.Move(cars[i], { x: 0, y: linesPositions[0][ 'position'] });\n\t}\n\t//Stop the sond played\n\t/*setTimeout\t(\tfunction() \n\t\t\t\t\t{\n\t\t\t\t\t\t$('audio_player').writeAttribute('src', '')\n\t\t\t\t\t},\n\t\t\t\t\t1000\n\t\t\t\t);\n\t*/\n\t\n\t//Launch the countdown after 2 seconds\n\tsetTimeout(\"launch_countdown(false)\", 2000);\n\t\n\t//Launch the race when the countdown is finished\n\tsetTimeout(\"moveTo(linesPositions[1]['position'], linesPositions[1]['name'], linesPositions[1]['position']+heightIntermediaryStep)\", 5000);\n\tsetTimeout(\"followCars(3)\", 5000);\n}", "title": "" }, { "docid": "ec8a9a29dd41e9194cd7b3b5b4fc88c7", "score": "0.6036889", "text": "start () {\n loop(this)\n }", "title": "" }, { "docid": "63fe8b1bfef818c2ad848afeee16d3b0", "score": "0.60211", "text": "function animloop() {\n init = requestAnimFrame(animloop);\n draw();\n}", "title": "" }, { "docid": "155ee7e27a7f1010c17d9159375fb2f2", "score": "0.6013658", "text": "function gameStart() {\n\t\t$colors.off('click'); //condition that takes care of the user not clicking buttons when the game is running\n\t\t$message.text('Watch the sequence.');\n\t\t$round.text('Current round: ' + round);\n\t\tlightSequence(); //light the sequence just generated\n\n\t}", "title": "" }, { "docid": "ea61c483f8eb8a08250c64d93fe5c034", "score": "0.60086167", "text": "startRunning() {\n var that = this;\n setTimeout(function () { \n that.running = true; \n }, Math.floor(Math.random() * (config.maxEnemyDelay - config.minEnemyDelay + 1)) + config.minEnemyDelay);\n }", "title": "" }, { "docid": "49dc0e8974356fa0e0c68ea96c46fccc", "score": "0.60036546", "text": "async startAnimationLoop() {\n if (document.readyState === 'loading')\n await new Promise(resolve => setTimeout(resolve))\n\n if (this.animationLoopStarted) return\n\n this.animationLoopStarted = true\n\n let timestamp = null\n\n while (this.animationLoopStarted) {\n timestamp = await this.animationFrame()\n\n this.runRenderTasks(timestamp)\n\n // wait for the next microtask before continuing so that SkateJS\n // updated methods (or any other microtask handlers) have a\n // chance to handle changes before the next renderNodes call.\n //\n // TODO add test to make sure behavior size change doesn't\n // happen after render\n await Promise.resolve()\n\n this.renderNodes(timestamp)\n\n // If no tasks are left, stop the animation loop.\n if (!this.allRenderTasks.length)\n this.animationLoopStarted = false\n }\n }", "title": "" }, { "docid": "1e786ddba601aef3561c5f9741f5b6da", "score": "0.59943473", "text": "function play(){\n raf = window.requestAnimationFrame(draw);\n running = true;\n bg_start= true;\n}", "title": "" }, { "docid": "87eb99780c9d7fe228c50056b475f781", "score": "0.5994245", "text": "frame() {\n this.display();\n this.animate();\n }", "title": "" }, { "docid": "40ecb1198f1d42a9924f61f05a666c97", "score": "0.5992348", "text": "function startAnimating(fps) {\r\n fpsInterval = 1000 / fps;\r\n then = Date.now();\r\n animate();\r\n}", "title": "" }, { "docid": "9fe0eb916b7d262edf34548417dd9305", "score": "0.5987267", "text": "function animloop() {\n requestAnimationFrame(animloop);\n theAnimator.drawScreen(context);\n }", "title": "" }, { "docid": "1a23a9f10c927aeeced048225f01ba92", "score": "0.5984305", "text": "function startAnimation() {\n //getting every frame animation\n requestAnimationFrame(startAnimation);\n //clearing frames to see animation movement\n body.clearRect(0, 0, innerWidth, innerHeight);\n //animation for every created circles\n for (var i = 0; i < circleBalls.length; i++) {\n circleBalls[i].data();\n }\n }", "title": "" }, { "docid": "3172ef2882908ad5b7fa55fbacb17b5b", "score": "0.59828734", "text": "function start() {\n if (mapLoaded && deckLoaded) {\n animate(deck);\n }\n }", "title": "" }, { "docid": "1e27d5c3e1559222715ddf9f3a4fbc83", "score": "0.59790695", "text": "function startGame() {\r\n renderBlanks()\r\n startTimer()\r\n \r\n // Prevents start button from being clicked when round is in progress\r\n\r\n\r\n\r\n }", "title": "" }, { "docid": "dd5acdbb2938a33233cf1e1a12f4cb48", "score": "0.59747434", "text": "function start(){\n\n active = true;\n step();\n return this;\n }", "title": "" }, { "docid": "de8305dfa138b68ee8e491c8d9b32452", "score": "0.5973163", "text": "function _start() {\n if (!$animate) {\n $animate = $injector.get('$animate');\n }\n\n var $parent = $document.find($parentSelector).eq(0);\n $timeout.cancel(completeTimeout);\n\n // do not continually broadcast the started event:\n if (started) {\n return;\n }\n\n $rootScope.$broadcast('cfpLoadingBar:started');\n started = true;\n\n if (includeBar) {\n $animate.enter(loadingBarContainer, $parent);\n }\n\n if (includeSpinner) {\n $animate.enter(spinner, $parent);\n }\n\n _set(startSize);\n }", "title": "" }, { "docid": "c40ab4c3759202e61a6c21f7008f0240", "score": "0.5970422", "text": "function run() {\r\n\r\n $(slides[iNext]).animate({\r\n opacity: 0,\r\n height: 0,\r\n top: hw,\r\n }, {\r\n duration: dur,\r\n specialEasing: {\r\n height: eas\r\n }\r\n });\r\n\r\n $(slides[iCur]).animate({\r\n opacity: 0,\r\n height: 0,\r\n top: hw,\r\n }, {\r\n duration: dur,\r\n specialEasing: {\r\n height: eas\r\n },\r\n complete: function() {\r\n\r\n $(slides[iCur]).animate({\r\n opacity: 0,\r\n height: h,\r\n top:0,\r\n }, {\r\n duration: dur,\r\n specialEasing: {\r\n height: eas\r\n }\r\n });\r\n\r\n $(slides[iNext]).animate({\r\n opacity: 1,\r\n height: h,\r\n top:0,\r\n }, {\r\n duration: dur,\r\n specialEasing: {\r\n height: eas\r\n }\r\n });\r\n\r\n iCur++;\r\n iNext++;\r\n if (iCur >= amount) {\r\n iCur = 0;\r\n }\r\n if (iNext >= amount) {\r\n iNext = 0;\r\n }\r\n }\r\n });\r\n\r\n // loop\r\n setTimeout(run, interval);\r\n }", "title": "" }, { "docid": "65f2e576365ed87fad1ecf269b381093", "score": "0.5959186", "text": "create() {\r\n this.add.text(20, 20, 'Loading game...'); \r\n console.log(\"cargando Scene 1\"); \r\n \r\n //Sprite animations, require spritesheets\r\n this.anims.create({\r\n key: \"ship1_fly\",\r\n frames: this.anims.generateFrameNumbers(\"ship1\"),\r\n frameRate: 20, //fps\r\n repeat: -1 //infinite loop\r\n });\r\n this.anims.create({\r\n key: \"ship2_fly\",\r\n frames: this.anims.generateFrameNumbers(\"ship2\"),\r\n frameRate: 20,\r\n repeat: -1 \r\n });\r\n this.anims.create({\r\n key: \"ship3_fly\",\r\n frames: this.anims.generateFrameNumbers(\"ship3\"),\r\n frameRate: 20,\r\n repeat: -1 \r\n });\r\n \r\n this.anims.create({\r\n key: \"explode\",\r\n frames: this.anims.generateFrameNumbers(\"explosion\"),\r\n frameRate: 20,\r\n repeat: 0, //only one loop\r\n hideOnComplete: true //disappears when finished\r\n });\r\n\r\n this.anims.create({\r\n key: \"red\",\r\n frames: this.anims.generateFrameNumbers(\"powerUp\", {start: 0, end: 1}),\r\n frameRate: 20, \r\n repeat: -1 \r\n });\r\n this.anims.create({\r\n key: \"gray\",\r\n frames: this.anims.generateFrameNumbers(\"powerUp\", {start: 2, end: 3}),\r\n frameRate: 20,\r\n repeat: -1\r\n });\r\n \r\n this.anims.create({\r\n key: \"player_fly\",\r\n frames: this.anims.generateFrameNumbers(\"player\"),\r\n frameRate: 20,\r\n repeat: -1\r\n });\r\n\r\n this.anims.create({\r\n key: \"beam_shoot\",\r\n frames: this.anims.generateFrameNumbers(\"beam\"),\r\n frameRate: 20,\r\n repeat: -1\r\n });\r\n\r\n this.scene.start(\"MenuScene\"); //start another scene\r\n }", "title": "" }, { "docid": "fae2130844dab4e6c0ac68003a67d1bd", "score": "0.5955947", "text": "function init() {\n animate()\n}", "title": "" }, { "docid": "b4fc0eabc35734580fd4bd7896bb20d9", "score": "0.59528303", "text": "function startAnimating(fps) {\n fpsInterval = 1000 / fps;\n then = Date.now();\n startTime = then;\n animate();\n }", "title": "" }, { "docid": "3b51b40d8fc5c01176c6ab8b4800a1b1", "score": "0.59435546", "text": "function startAnimating() {\n isAnimating = true;\n requestAnimationFrame(update);\n }", "title": "" }, { "docid": "d9131fc01282cc9ae25e621728df3c0f", "score": "0.594297", "text": "function start(){\n isStopped = false;\n render();\n }", "title": "" }, { "docid": "37b360c9601448e9c0cdf395614d208f", "score": "0.59428394", "text": "function startIt (){\n\n $(\".scrollpart\").show();\n $(\".timerbutton\").hide();\n $(\".directions\").hide();\n run();\n \n }", "title": "" }, { "docid": "5a1e9e18b723079d3a5c635a8114cc4a", "score": "0.5930161", "text": "start() {\n this._render();\n this._timer = setInterval(()=>this._render(), 1100);\n }", "title": "" }, { "docid": "e6d8259ed97f7cea8517b3dabe71636e", "score": "0.5919886", "text": "function playRunnerAndGoHome() {\n var duration = 5000;\n var maxWidth = 100;\n var step = maxWidth/duration;\n var start = Date.now();\n\n var timer = setInterval(function() {\n var timePassed = Date.now() - start;\n\n if (timePassed > (duration+1)) {\n clearInterval(timer);\n window.location.href = window.location.protocol + '//' + window.location.hostname;\n return\n }\n\n draw( timePassed );\n }, 0);\n\n function draw( timePassed ) {\n var increaseWidth = (Math.round( timePassed * step * 100) / 100) + '%';\n $('.error-page__progress-bar__runner').css('width', increaseWidth);\n };\n }", "title": "" }, { "docid": "209bfdaf2d5f9f7fd72f34f03a9ff8b5", "score": "0.5915667", "text": "function startAnimation(){\n\tif(updateIntervalHandler) clearInterval(updateIntervalHandler);\n\tupdateIntervalHandler =\tsetInterval(updateScene, 1000/60);\n}", "title": "" } ]
10af8fd253e5b72224a3eb362f15be43
Checks if 'gender' has a valid value and if so, removes its higlight.
[ { "docid": "e45163a5e852cd16083ee85f6602070f", "score": "0.5162802", "text": "function checkGenderRadioButtons() {\n \n // If any of the 'gender' radio buttons are checked, gets true\n var genderRadioButtonChecked = (document.getElementById('gender_male').checked ||\n document.getElementById('gender_female').checked ||\n document.getElementById('gender_unknown').checked);\n\n // Gets the 'gender' radio button input element\n var genderInput = document.getElementById('gender_radio_buttons');\n \n // If there is a checked radio button, stops highlighting the input element \n if (genderRadioButtonChecked) {\n resetHighlight(1);\n }\n}", "title": "" } ]
[ { "docid": "4d5d642153551c7cf2a2044b9fcdc539", "score": "0.61731136", "text": "function isFemale(person){\n return !person.gender;\n}", "title": "" }, { "docid": "8868709acdd1bbbe2774589a4528ac85", "score": "0.6121489", "text": "function filterFemale(person) {\r\n if (person.gender === \"female\") {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "f99f26eaf4ca665dcb4b097b57cc2b19", "score": "0.6113567", "text": "function passengerFemaleFilter (record) {\n if (record.age !== ''&& record.sex == 'female') {\n return record;\n }\n }", "title": "" }, { "docid": "5f9007c8963ef997b834c1653083e74f", "score": "0.60236794", "text": "function passengerMaleFilter (record) {\n if (record.age !== ''&& record.sex == 'male') {\n return record;\n }\n }", "title": "" }, { "docid": "2f1441438e97a9056a9b716dd45f08f9", "score": "0.60105205", "text": "function sanitizeSexPreference(sexPreference) {\n let sanitizedSexPreference = defaultSexPreference;\n try {\n if (typeof(sexPreference) !== 'string') {\n throw Error('Invalid sex preference object')\n }\n if (!['anyone', 'women', 'men'].includes(sexPreference)) {\n throw Error('Invalid sex preference');\n }\n sanitizedSexPreference = sexPreference;\n } catch (error) {\n // Assume defautl sex preference value and continue\n console.log(error);\n }\n return sanitizedSexPreference;\n}", "title": "" }, { "docid": "269bf9609004c6872a348e580b2c0e8e", "score": "0.5908161", "text": "function validateGendar(){\n var gender = document.getElementById('gender')\n var nameErrorMessage = document.getElementById(\"gender_error\") \n if(gender.value == \"\" || gender.value == undefined){\n \n nameErrorMessage.classList.remove('is-invisible')\n }\n else{\n nameErrorMessage.classList.add('is-invisible')\n }\n}", "title": "" }, { "docid": "011ad9a7cfc8ae58225e9e792ced20a8", "score": "0.5882084", "text": "function genderBrushConverter(gender) {\n if (gender === \"M\") return bluegrad;\n if (gender === \"F\") return pinkgrad;\n return \"orange\";\n }", "title": "" }, { "docid": "3ac74fe840ee8c569fc3f333b8e9c732", "score": "0.58357346", "text": "function profileTest(genderProfile) {\n if (genderProfile.value == \"male\") {\n gender = genderProfile.value;\n } else if (genderProfile.value == \"female\") {\n gender = genderProfile.value;\n }\n}", "title": "" }, { "docid": "d81909107549edace6a7e761a1a6c45a", "score": "0.5791284", "text": "function Gender() {\n if(this.value) {\n }\n }", "title": "" }, { "docid": "b3b2ca36bb36adf80e8216b553a36742", "score": "0.5729811", "text": "getAdministrativeGenderCode(code) {\n switch (code) {\n case 0: return \"unknown\"; // Not Known (not recorded)\n case 1: return \"male\";\n case 2: return \"female\";\n case 9: return \"other\"; // Indeterminate (unable to be classified as either male or female)\n }\n throw new Error(\"Unhandled gender value \\\"\" + code + \"\\\".\");\n }", "title": "" }, { "docid": "014e5eaf5bb17f8cae063b6d9e48aea3", "score": "0.572056", "text": "set gender(value) { //\r\n this._gender = value; //\r\n }", "title": "" }, { "docid": "fa36b3cee3adc85be503138c93d0f252", "score": "0.5663775", "text": "presumedMale() {\n return this.filter(m => {\n return m.has('(#MaleName|mr|mister|sr|jr|king|pope|prince|sir)')//todo configure these in .world\n })\n }", "title": "" }, { "docid": "416ac5a0ba786918920a4dcc03d344d4", "score": "0.5623628", "text": "function genderBrushConverter(gender) {\r\n\t\tif(gender === \"男\") return \"#0099CC\";\r\n\t\tif(gender === \"女\") return \"#FF6666\";\r\n\t\treturn \"#FFA100\";\r\n\t}", "title": "" }, { "docid": "6292a3b5dc3ddde04d3e761c38e85d96", "score": "0.55175763", "text": "function filterOutFemales(members) {\n\tvar femaleStudents = members.filter(function(student){\n \treturn student.gender !== 'female';\n });\n return femaleStudents;\n}", "title": "" }, { "docid": "065f9b43fdf37b5e89b042630ef23424", "score": "0.5511303", "text": "function hideSexes() {\n svg.selectAll('.sex').remove();\n }", "title": "" }, { "docid": "948d7d474fe730f25c0a025a37b31727", "score": "0.550018", "text": "function check_edit_gender() {\r\n\tvar gender = $('input[name=\"edit_gender\"]:checked');\r\n\tvar flag = true;\r\n\r\n\tif (!gender.length) {\r\n\t\tprintError(\"#message_edit_gender\", \"error_gender\", \"#edit_male\",\r\n\t\t\t\tthis.check_first_blank_field);\r\n\t\tflag = false;\r\n\t} else {\r\n\t\thideError(\"#message_edit_gender\", \"#edit_male\");\r\n\t}\r\n\r\n\treturn flag;\r\n}", "title": "" }, { "docid": "55114cf19589d541d4b8653fb19387c9", "score": "0.54823524", "text": "function handleGenderRefinerChange() {\n\n var provinceId = $('#FloorPlan-ProvinceList').val();\n var province = provinceId === 'All' ? provinceId : provinces[provinceId];\n var gender = $('#FloorPlan-GenderList').val();\n\n setFilteredOpacity(province, gender);\n\n clearMPCard();\n clearSearchBox();\n\n return;\n}", "title": "" }, { "docid": "8d6d17d8793b74aad1c1d712e56ec2ae", "score": "0.5418052", "text": "renderGenderData (gen) {\n let gender;\n if(gen === 'f'){\n gender = 'This name is only used for naming women'\n }\n else if(gen === 'm'){\n gender = 'This name is only used for naming men'\n }\n else{ /*Gender can also be mf or fm*/\n gender = 'This name is used for both men and women'\n }\n return gender\n }", "title": "" }, { "docid": "031727a4c2f86fa554a2a5122de1f301", "score": "0.5415581", "text": "get gender () {\n\t\treturn this._gender;\n\t}", "title": "" }, { "docid": "461c8ebd8056c386d479fe6b95094adf", "score": "0.5410362", "text": "get gender() {\n\t\treturn this.__gender;\n\t}", "title": "" }, { "docid": "9a4548ac1793f3bf69077ff3f0521400", "score": "0.5408798", "text": "function getAverageAgeByGender(data, gender) {\n\tconst sexAge = data.filter(p => p.fields.sex == (gender)).filter(p => p.fields.age != undefined).map(p => p.fields.age)\n\tconst average = sexAge.reduce((sum, p) => sum + p, 0) / sexAge.length\n\treturn average\n}", "title": "" }, { "docid": "1121974c2889b50f67009a1db54a5562", "score": "0.540083", "text": "function filterGender(){\n\t\tvm.filterData();\n\t}", "title": "" }, { "docid": "126a85097314a40e67663be1fabcc1bd", "score": "0.53718466", "text": "function filterMaleSurvived (record) {\n if (record.sex =='male' && record.survived == 1)\n return record;\n }", "title": "" }, { "docid": "2a458499ba66b28d25f2b2dfd507bc02", "score": "0.5338682", "text": "function update_cancer_by_sex(node) {\n $('#cancer .row').show();\n if(node.sex === 'M') {\n delete node.ovarian_cancer_diagnosis_age;\n $(\"[id^='id_ovarian_cancer_diagnosis_age']\").closest('.row').hide();\n } else if(node.sex === 'F') {\n delete node.prostate_cancer_diagnosis_age;\n $(\"[id^='id_prostate_cancer_diagnosis_age']\").closest('.row').hide();\n }\n }", "title": "" }, { "docid": "095760f4d14c86b0711da1b3384fd566", "score": "0.53258914", "text": "function filterFemaleSurvived (record) {\n if (record.sex =='female' && record.survived == 1)\n return record;\n }", "title": "" }, { "docid": "aa46b22db760c437f3d1ddf7e54b2100", "score": "0.5312861", "text": "function getGender() {\n let tmp_gender\n if (Settings.settingForKey('my_gender') == undefined) {\n tmp_gender = \"both\"\n } else {\n tmp_gender = Settings.settingForKey('my_gender')\n }\n Settings.setSettingForKey('my_gender', tmp_gender)\n return tmp_gender\n}", "title": "" }, { "docid": "f0959a84ade63bb0e5e5b38c4ee24dab", "score": "0.53007746", "text": "function checkRadioValid(male, female, unknown) {\n if (!male.checked && !female.checked && !unknown.checked) {\n showInMessageBox(\"Please select the gender\");\n radioField.style.color = 'red';\n return false;\n }\n if (male.checked) {\n genderSelected = \"male\";\n } else if (female.checked) {\n genderSelected = \"female\";\n } else {\n genderSelected = \"unknown\";\n }\n radioField.style.color = 'black';\n return true;\n}", "title": "" }, { "docid": "f950a94aa175bca22e4943f43cb62a00", "score": "0.52819276", "text": "function genderFilter() {\n //bring in the gender keyword from the local storage\n genderFilterKeyword = JSON.parse(localStorage.getItem(\"storeGenderFilterSetting\"))\n //in order to filter gender, check if the gender section of the announcement contains the gender keyword\n for (var i = 0; i < createGenderEditable.length; i++) {\n\n //if the genderkeyword is found in the announcement, delete it across all arrays. This deletion occurs in the editable array which gets reset every time the filter changes -> this allows the filter to be changed around without deleting the original announcement entirely.\n if (createGenderEditable[i] == (genderFilterKeyword)) {\n createNameEditable.splice(i, 1);\n createRoomEditable.splice(i, 1);\n createClubEditable.splice(i, 1);\n createGradeEditable.splice(i, 1);\n createGenderEditable.splice(i, 1);\n createAnnouncementEditable.splice(i, 1);\n genderFilter();\n }\n }\n }", "title": "" }, { "docid": "1f2c7301f5d865f52976293f9c14a44f", "score": "0.5277576", "text": "static getGender(user) {\n return user.gender;\n }", "title": "" }, { "docid": "7f7f250536f08d1e6efdd231a61ee388", "score": "0.51753366", "text": "function Gender()\n{\n\tvar male = document.forms[\"myform\"][\"male\"].checked;\n var female = document.forms[\"myform\"][\"female\"].checked;\n if(male == false && female == false)\n {\n document.getElementById(\"gendertext\").innerHTML =\"Please Select Gender\";\n return false;\n }\n else\n {\n\t document.getElementById(\"gendertext\").style.visibility = \"hidden\";\n return true;\n }\n\n}", "title": "" }, { "docid": "35ff39235f0e5d307012c24dac25bb4c", "score": "0.5142125", "text": "static setGender(value) {\n return this.update({\n $set: {\n gender: value\n }\n });\n }", "title": "" }, { "docid": "32d460f8ef14fd63ef9a57306cf0eccb", "score": "0.5087992", "text": "function checkGenderAndRole() {\n console.debug(\"Checking for genders that don't match their spousal role...\");\n console.log(\"US21: Correct Gender for Role\");\n let errorCnt = 0;\n\n // Check each family:\n for (const familyID in entityDict.FAM) {\n const family = entityDict.FAM[familyID];\n // Check to make sure HUSB is of gender 'M', and WIFE is of gender 'F':\n for (const [tag, gender] of [[\"HUSB\", \"M\"], [[\"WIFE\", \"F\"]]]) {\n if (!family[tag]) continue;\n const entity = entityDict.INDI[family[tag]];\n if (entity && entity.SEX !== gender) {\n console.log(\"Line \" + family[tag + \"_LINE\"] + \": \" + familyID + \" \" + tag + \" is not of gender '\" + gender + \"'!\");\n ++errorCnt;\n }\n }\n }\n\n return errorCnt;\n}", "title": "" }, { "docid": "616af5bd08d2fd464ba319fbb2a88087", "score": "0.5060268", "text": "function getUserGender() {\n let isChecked = document.getElementById(\"genderm\").checked;\n // determines users gender as 'm' or 'f' depending on bool values for check of genderm radio button\n if (isChecked === true) {\n userGender = 'm';\n } else {\n userGender = 'f';\n };\n return userGender;\n }", "title": "" }, { "docid": "c3e91ef9caa954b59528d46d7f814229", "score": "0.5025196", "text": "scoreGender(sex, lgbt){\n\t\tlet res = 0;\n\t\tif(sex == 'No Preference') res = 0;\n\t\telse if(sex == this.sex) res += 5;\n\t\tif(lgbt == 'Yes' && lgbt == this.sex) res += 5;\n\t\treturn res;\n\t}", "title": "" }, { "docid": "8ee25e55b5d4c0eb4293965f28c23f74", "score": "0.49842227", "text": "sex(member) {\n var sex = $('#sex').val();\n if ( sex == \"\") {\n vm.errorMessage(\"#sex\",\"Sex was not valid\");\n //$('#error12').show();\n return false;\n }\n \n else {\n vm.removeError(\"#sex\")\n //$('#error12').hide();\n return true;\n }\n }", "title": "" }, { "docid": "93c19ec901053dc60c7c7e17cb1b8b1b", "score": "0.49804613", "text": "function generateStringForGender(gender){ /* ARG = student.obj.gender */\n switch(gender){ // index -> student_obj.gender\n case 1: /* Male */\n return \"male\";\n break;\n case 2: /* Female */\n return \"female\";\n break;\n }\n\n}", "title": "" }, { "docid": "b694dd49dfd9ad41983667ef76dedca1", "score": "0.49698496", "text": "function getGender() {\n if (validateAverage()) {\n data = $('#genderForm').serialize();\n ajaxRequest('/gender', data);\n }\n}", "title": "" }, { "docid": "4d3664151640c5b668c4feebadd14b41", "score": "0.49589956", "text": "function get_filtered_gender_wage_gap_data(country=\"\") {\n if (country === \"\") {\n var filtered_gender_wage_gap_data = $wage_gap_by_gender_data.filter(function(entry){ return entry.Occupation === \"All occupations\" });\n }\n else {\n var filtered_gender_wage_gap_data = $wage_gap_by_gender_data.filter(function(entry){ return entry.Country == country });\n }\n\n return filtered_gender_wage_gap_data;\n }", "title": "" }, { "docid": "c8ffd9535357d4d0cbaff2f5b2706132", "score": "0.49571204", "text": "function setFilteredOpacity(province, gender) {\n\n var selector = void 0;\n console.log(province);\n console.log(gender);\n if (province === 'All' && gender === 'Both') {\n d3.selectAll('rect').attr('opacity', 1);\n return;\n }\n\n if (province === 'All' && gender !== 'Both') {\n selector = '[gender=\"' + gender + '\"]';\n } else if (province !== 'All' && gender === 'Both') {\n selector = '[province=\"' + province + '\"]';\n } else {\n selector = '[province=\"' + province + '\"][gender=\"' + gender + '\"]';\n }\n\n d3.selectAll('rect').attr('opacity', 0.3);\n d3.selectAll(selector).attr('opacity', 1);\n\n return;\n}", "title": "" }, { "docid": "7f5fdfcd7b2f5be36c9e4a179f4dc55c", "score": "0.4919294", "text": "function createFilter (gender) {\n // Create a transform stream according to gender.\n return Transform({\n // Indicate this stream will read data as object.\n writableObjectMode: true,\n transform (object, encoding, callback) {\n if (object.gender && object.gender === gender) {\n return callback(null, JSON.stringify(object) + '\\n')\n }\n callback()\n }\n })\n}", "title": "" }, { "docid": "b2821f844e1c5df4c44216af28a2e5a2", "score": "0.48257458", "text": "function genderProfiles(gender, profiles){\n var group = profiles.filter((profile) => profile.gender == gender)\n return group;\n}", "title": "" }, { "docid": "b4ef772d028e679c0f209ce274586631", "score": "0.4801668", "text": "function getPassengersByGender(data, gender) {\n\tconst sex = data.filter(p => p.fields.sex == (gender))\n\treturn sex.length\n}", "title": "" }, { "docid": "f48d89d107ea2866799e7f7b92b62fd4", "score": "0.47646278", "text": "function validate() {\n var genders = document.getElementsByName(\"gender\");\n\n if (document.myForm.century.value == \"\" || document.myForm.century.value >= 22 || document.myForm.century.value < 19) {\n alert(\"Please provide a valid century\");\n document.myForm.year.focus();\n return false;\n } else if (document.myForm.year.value == \"\") {\n alert(\"Please provide a valid year\");\n document.myForm.year.focus();\n return false;\n } else if (document.myForm.month.value <= 0 || document.myForm.month.value > 12) {\n alert(\"Please provide valid month of birth\");\n document.myForm.month.focus();\n return false;\n } else if (document.myForm.date.value <= 0 || document.myForm.date.value > 31) {\n alert(\"Please provide a valid date of birth\");\n document.myForm.day.focus();\n return false;\n } else if (genders[0].checked == false && genders[1].checked == false) {\n alert(\"You must select male or female\");\n return false;\n } else {\n return true;\n }\n\n}", "title": "" }, { "docid": "c89c98766c10fa27784d56e0776ff312", "score": "0.47637182", "text": "function getAllGender() {\n\tdisplaySpinner ();\n\tfetch(\"http://api.nobelprize.org/v1/laureate.json?\")\n\t.then(function (response) {\n\t\treturn response.json();\n\t})\n\t.then(function (allData) {\n\t\tstopSpinner();\n\t\tdisplayGenderRatio(allData);\n\t})\n\t.catch(function (error) {\n\t\t\tstandardErrorMessage (error);\n\t\t})\n}", "title": "" }, { "docid": "ceb8adb9b84a1797c53f3702d4c9d5df", "score": "0.47470182", "text": "function isFemale(list) {\n\tfor (var i = 0; i < list.length; ++i) {\n\t\tif(list[i].Gender == 'female') {\n\t\t\tprint(\"female \" + list[i].Name);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6fa6105d03aecc1d54a39c1a894449ac", "score": "0.4743621", "text": "function examGend(gender) {\n return function (d) {\n if (d.gender === gender) {\n return +d.sat_exam;\n } else {\n return 0;\n } \n };\n }", "title": "" }, { "docid": "4901302891d4f842a3add6e59396a328", "score": "0.47428027", "text": "function removeInvalidStyling() {\n if (!inputValue.validity.valueMissing) {\n inputValue.nextElementSibling.style.opacity = null;\n inputValue.style.boxShadow = null;\n }\n }", "title": "" }, { "docid": "a79c6b9adc583abdce7cbb5c223a547b", "score": "0.47306702", "text": "function person(gender,genderPreference){\n this.gender = gender;\n this.gender_pref = genderPreference;\n}", "title": "" }, { "docid": "249e7122a218160a810abda7537e7ee4", "score": "0.47057962", "text": "onValueGender(value: string) {\r\n this.setState({\r\n selectedGender: value\r\n });\r\n }", "title": "" }, { "docid": "cb1cc30a00696e53ceebe06fa4b10ca5", "score": "0.4700332", "text": "function normalize(value, format){\n \n var spec;\n switch (format){\n case Color.HEX: spec = { key: \"rgb\", converter: parsehex }; break;\n case Color.RGB: spec = { key: \"rgb\", converter: parsergb }; break;\n case Color.HSL: spec = { key: \"hsl\", converter: parsehsl }; break;\n default: throw new TypeError(\"Invalid color format: \" + format);\n }\n \n var parsed = spec.converter(value);\n if (parsed[spec.key].toString() != nominal[spec.key].toString()){\n nominal = parsed;\n }\n \n return nominal;\n }", "title": "" }, { "docid": "d0831dd0b735919f0f04fe0a937352e1", "score": "0.46966216", "text": "function highlightGender() {\n var field = \"gendersclean\";\n var legendDelay = 500;\n var legendBlock = legends.get(field);\n var legendBar = legendBars.get(field)['bar'];\n var legendBack = legendBars.get(field)['back'];\n hideLegend();\n hideAxis();\n hideBars();\n hideSankey();\n\n dotTitles.text(function (d) {\n return d['gendersclean'] + \" (click to view details)\";\n });\n\n countTitle.transition()\n .duration(300)\n .attr('opacity', 0);\n countingTag.transition()\n .duration(300)\n .attr('opacity', 0);\n numberTag.transition()\n .duration(300)\n .attr('opacity', 0);\n\n g.selectAll('.bar')\n .transition()\n .duration(600)\n .attr('width', 0);\n\n g.selectAll('.bar-text')\n .transition()\n .duration(0)\n .attr('opacity', 0);\n\n // Sort by gender\n sortBy(dots, field);\n\n dots.transition()\n .duration(800)\n .attr('opacity', function (d) { return d[field] === \"Unknown\" ? 0.3 :\n 1.0; })\n .attr('fill', function (d) { return colorPalette[d[field]]; })\n .attr('stroke', function (d) { return colorPalette[d[field]]; })\n .attr('stroke-width', 0);\n\n // use named transition to ensure\n // move happens even if other\n // transitions are interrupted.\n if (!fieldsToSort.get(field).sorted) {\n dots.transition('sort-fills')\n .duration(1000)\n .delay(1200)\n .attr('cx', function (d) { return d.x + dotRadius;})\n .attr('cy', function (d) { return d.y + dotRadius;});\n\n legendDelay = 2000;\n\n fieldsToSort.each(function (d, i) {\n d.sorted = i === field;\n });\n }\n\n // show legend\n legendBlock.transition()\n .duration(1000)\n .delay(legendDelay)\n .attr('opacity', 1.0);\n legendBar.transition()\n .duration(1000)\n .delay(legendDelay)\n .attr('opacity', 1.0);\n legendBack.transition()\n .duration(1000)\n .delay(legendDelay)\n .attr('opacity', 1.0);\n countTag.transition()\n .duration(1000)\n .delay(legendDelay)\n .attr('opacity', 1.0);\n\n }", "title": "" }, { "docid": "58fa925bba0062cb3874a50a7240c0c2", "score": "0.469523", "text": "function custGender(people){\n var genders = {};\n _.each(people, function(person, i, people){\n if (genders.hasOwnProperty(person[\"gender\"]) === false){\n genders[person[\"gender\"]] = 0;\n }\n });\n _.reduce(people, function(total, nextInLine, i){\n if (genders.hasOwnProperty(people[i][\"gender\"])){\n return genders[people[i][\"gender\"]] += 1;\n } else { return total;\n }}\n , 0);\n \n return genders;\n \n}", "title": "" }, { "docid": "740f8c4a68a9deac1b4e412b521e30c6", "score": "0.46867958", "text": "function isMale(list) {\n\tfor (var i = 0; i < list.length; ++i) {\n\t\tif(list[i].Gender == 'male') {\n\t\t\t print(\"male \" + list[i].Name);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "72fcfaec5224b15eec1381ac4573d685", "score": "0.46699739", "text": "function CheckAnyGender(){\r\n if( document.forms[ 0 ].GenderAny.checked ){\r\n document.getElementById( \"GenderRow\" ).className = \"HideRow\";\r\n document.forms[ 0 ].GenderMale.disabled = true;\r\n document.forms[ 0 ].GenderFemale.disabled = true;\r\n }\r\n else {\r\n document.getElementById( \"GenderRow\" ).className = \"ShowDemoRow\";\r\n document.forms[ 0 ].GenderMale.disabled = false;\r\n document.forms[ 0 ].GenderFemale.disabled = false;\r\n }\r\n}", "title": "" }, { "docid": "ec3faa4029b8f7ee7fdf35d98bed6da2", "score": "0.46376485", "text": "function displayGenderRatio(allData) {\n\tlet allLiteratureArray = [];\n\tlet sum = 0;\n\tfor(lit of allData.laureates) {\n\t\tif (lit.prizes[0].category == \"literature\") {\n\t\t\tallLiteratureArray.push(lit);\n\t\t\tsum++\n\t\t}\n\t}\n\tlet fem = 0;\n\tfor (person of allLiteratureArray) {\n\t\tif (person.gender == \"female\") {\n\t\t\tfem++\n\t\t}\n\t}\n\tmoreInfo.innerHTML = `<p>Out of<br><span class=\"bigger\">${sum}</span> laureates there are<br><span class=\"bigger\">${fem}</span> women and<br><span class=\"bigger\">${sum - fem}</span> men.</p>`;\n}", "title": "" }, { "docid": "823bb0e8564f84e381f76dfcd1e06771", "score": "0.46106413", "text": "function addGenders(d) {\n if (d[\"values\"]) {\n d[\"values\"].forEach(function(d1) {\n addGenders(d1);\n });\n }\n else {\n d[\"characters\"].forEach(function(char) {\n if (char[\"gender\"] === \"F\") {\n genders[0][\"value\"]++;\n }\n else if (char[\"gender\"] === \"M\") {\n genders[1][\"value\"]++;\n }\n else if (char[\"gender\"] === null) {\n genders[3][\"value\"]++;\n }\n else {\n genders[2][\"value\"]++;\n }\n });\n }\n }", "title": "" }, { "docid": "84022def3196f1dbb6a1302be42b792f", "score": "0.4609898", "text": "function calcByGender(e) {\n feetInchToCm();\n lbsToKg();\n selectHeight();\n selectWeight();\n goalSpecific();\n age = ageInput.value;\n if (gender[0].checked) {\n calcBMR = (9.99 * weightKilos) + (6.25 * heightCM) - (4.92 * age) - 161;\n } else if (gender[1].checked) {\n console.log(age);\n calcBMR = (9.99 * weightKilos) + (6.25 * heightCM) - (4.92 * age) + 5;\n }\n}", "title": "" }, { "docid": "2655ca227c6d2dcf19973647e7a9c6e8", "score": "0.4602472", "text": "function userBMR() {\n \n if (allValues.userGenderInput.female.value == 1) {\n //calculation of BMR if female radio button selected \n return ((10 * allValues.userWeightInput.value) + (6.25 * allValues.userHeightInput.value) - (5 * allValues.userAgeInput.value) - 161);\n\n } else {\n //calculation of BMR if male radio button selected\n return ((10 * allValues.userWeightInput.value) + (6.25 * allValues.userHeightInput.value) - (5 * allValues.userAgeInput.value) + 5);\n }\n}", "title": "" }, { "docid": "ab4045ff2d0308977d7b074d7c393abc", "score": "0.4588452", "text": "get gender() { return $('//div[@class=\"tvlrDtls-section\"]/div[@class=\"trvl-formfield-row\"]/div[3]/div/div/label[1]')}", "title": "" }, { "docid": "dd7adf29cef98bcddedc959cbe6ec2b0", "score": "0.4574873", "text": "function focusGender(e)\n{\n const genderFocus = e.target.parentNode;\n const genderSelect = document.querySelectorAll('.gender-btn');\n\n let mainGender = undefined;\n let altGender = undefined;\n\n if(genderFocus.id == genderSelect[0].id)\n {\n mainGender = genderSelect[0];\n altGender = genderSelect[1];\n gender = 'male';\n }\n else\n {\n mainGender = genderSelect[1];\n altGender = genderSelect[0];\n gender = 'female';\n }\n \n // extra check if the other button is focused\n // if it is, then unfocus it \n if(altGender.classList.contains('focused'))\n {\n altGender.classList.remove('focused');\n }\n\n mainGender.classList.add('focused'); \n}", "title": "" }, { "docid": "620f8102d8d990444bf5db6bd485b1cb", "score": "0.45715478", "text": "function onlyOne(checkbox) {\r\n var checkboxes = document.getElementsByName('Gender');\r\n checkboxes.forEach((item) => {\r\n if (item !== checkbox) item.checked = false;\r\n });\r\n}", "title": "" }, { "docid": "92dddc39c2db9ea178f200bc0690d661", "score": "0.45595416", "text": "function filterType(person) {\n return person.bloodType === inputValue;\n }", "title": "" }, { "docid": "b45cb55440ba64b9ff828b43ac1a27af", "score": "0.45565358", "text": "function validateForm() {\r\n // Retrieving the values of form elements \r\n var fname = document.sign-up-launch-promo.fname.value;\r\n var lname = document.sign-up-launch-promo.lname.value;\r\n var account = document.sign-up-launch-promo.account.value;\r\n var bank = document.sign-up-launch-promo.bank.value;\r\n var email = document.sign-up-launch-promo.email.value;\r\n var phone = document.sign-up-launch-promo.phone.value;\r\n var birthday = document.sign-up-launch-promo.birthday.value;\r\n var amount = document.sign-up-launch-promo.amount.value;\r\n var country = document.sign-up-launch-promo.country.value;\r\n var gender = document.sign-up-launch-promo.gender.value;\r\n var = [];\r\n var checkboxes = document.getElementsByName(\"gender[]\");\r\n for(var i=0; i < checkboxes.length; i++) {\r\n if(checkboxes[i].checked) {\r\n // Populate hobbies array with selected values\r\n gender.push(checkboxes[i].value);\r\n }\r\n }\r\n\r\n\t// Defining error variables with a default value\r\n var fname_error = lname_error = email_error = phone_error = bank_error = account_error = birthday_error = gender_error = true;\r\n \r\n // Validate name\r\n if(fname == \"\") {\r\n printError(\"fname_error\", \"Please enter your first name\");\r\n } else {\r\n var regex = /^[a-zA-Z\\s]+$/; \r\n if(regex.test(fname) === false) {\r\n printError(\"fname_error\", \"Please enter a valid first name name\");\r\n } else {\r\n printError(\"fname_error\", \"\");\r\n fname_error = false;\r\n }\r\n }\r\n \r\n if(lname == \"\") {\r\n printError(\"lname_error\", \"Please enter your last name\");\r\n } else {\r\n var regex = /^[a-zA-Z\\s]+$/; \r\n if(regex.test(lname) === false) {\r\n printError(\"lname_error\", \"Please enter a valid last name\");\r\n } else {\r\n printError(\"lname_error\", \"\");\r\n lname_error = false;\r\n }\r\n }\r\n\r\n // Validate email address\r\n if(email == \"\") {\r\n printError(\"email_error\", \"Please enter your email address\");\r\n } else {\r\n // Regular expression for basic email validation\r\n var regex = /^\\S+@\\S+\\.\\S+$/;\r\n if(regex.test(email) === false) {\r\n printError(\"email_error\", \"Please enter a valid email address\");\r\n } else{\r\n printError(\"email_error\", \"\");\r\n email_error = false;\r\n }\r\n }\r\n \r\n // Validate mobile number\r\n if(phone == \"\") {\r\n printError(\"phone_error\", \"Please enter your phone number\");\r\n } else {\r\n var regex = /^(\\d[\\s-]?)?[\\(\\[\\s-]{0,2}?\\d{3}[\\)\\]\\s-]{0,2}?\\d{3}[\\s-]?\\d{4}$/i;\r\n if(regex.test(mobile) === false) {\r\n printError(\"mobileErr\", \"Please enter a valid phone number\");\r\n } else{\r\n printError(\"phone_error\", \"\");\r\n phone_error = false;\r\n }\r\n }\r\n \r\n if(account == \"\") {\r\n printError(\"account_error\", \"Please enter your mobile number\");\r\n } else {\r\n var regex = /^[1-9]\\d{14}$/;\r\n if(regex.test(account) === false) {\r\n printError(\"account\", \"Please enter a valid 10 to 16 digits account number\");\r\n } else{\r\n printError(\"account\", \"\");\r\n account_error = false;\r\n }\r\n }\r\n\r\n if(bank == \"\") {\r\n printError(\"bank_error\", \"Please enter your banking institution\");\r\n } else {\r\n var regex = /^[a-zA-Z\\s]+$/; \r\n if(regex.test(bank) === false) {\r\n printError(\"bank_error\", \"Please enter only aphabets\");\r\n } else {\r\n printError(\"bank_error\", \"\");\r\n bank_error = false;\r\n }\r\n }\r\n\r\n if(birthday == \"\") {\r\n printError(\"birthday_error\", \"Please enter or select your birthday\");\r\n }\r\n \r\n // Validate gender\r\n if(gender == \"\") {\r\n printError(\"gender_error\", \"Please select your gender\");\r\n } else {\r\n printError(\"gender_error\", \"\");\r\n gender_error = false;\r\n }\r\n \r\n\r\n\r\n // Prevent the form from being submitted if there are any errors\r\n if((nameErr || emailErr || mobileErr || countryErr || genderErr) == true) {\r\n return false;\r\n } else {\r\n // Creating a string from input data for preview\r\n var dataPreview = \"You've entered the following details: \\n\" +\r\n \"Full Name: \" + name + \"\\n\" +\r\n \"Email Address: \" + email + \"\\n\" +\r\n \"Mobile Number: \" + mobile + \"\\n\" +\r\n \"Country: \" + country + \"\\n\" +\r\n \"Gender: \" + gender + \"\\n\";\r\n if(hobbies.length) {\r\n dataPreview += \"Hobbies: \" + hobbies.join(\", \");\r\n }\r\n // Display input data in a dialog box before submitting the form\r\n alert(dataPreview);\r\n }\r\n}", "title": "" }, { "docid": "c66b9a4fdb99e4765d50597ea6f3e7a0", "score": "0.4552676", "text": "function filter(key, value){\n if(key=='GI'){\n if(/^[a-zA-Z]*$/.test(value))\n return value.toUpperCase();\n else\n return false;\n }else{\n if(isNaN(value))\n return false;\n }\n return value;\n }", "title": "" }, { "docid": "6ea6e1ff726c8f81e1a658e11d075f6c", "score": "0.4549372", "text": "function gender_validation(obj,objto,objstar,objright,objwrong,obj_stat,obj_percent,obj_status)\r\n{\nif(progress_bar13 === 0)\r\n\t{\r\n\t\tprogress_bar13=1;\r\n\t\tvar val=obj_stat.value;\r\n\t\tval=val+9; obj_percent.innerHTML=val+\"%\";\r\n\t\tobj_stat.value=val;\r\n\t}\t\n\tprogress_bar13=1;\n\t objstar.style.color = \"blue\";\nobjwrong.style.visibility='hidden';\nobjright.style.visibility='visible';\nif(obj_stat.value === 100)\r\n\t{obj_status.style.display='block';}\r\nobjto.focus();\nreturn;\r\n\r\n}", "title": "" }, { "docid": "532967f2c09cd3d04c9ada90548d2146", "score": "0.45295417", "text": "function getSurvivorsByGender(data, gender) {\n\tconst survivedSex = data.filter(p => p.fields.sex == (gender)).filter(p => p.fields.survived === 'Yes')\n\treturn survivedSex.length\n}", "title": "" }, { "docid": "d806200468f2cb672e4ecb27f7a5e278", "score": "0.45271158", "text": "handleBaseFormReset (e) {\n this.setData({\n 'baseInfo.userGender': 2,\n })\n }", "title": "" }, { "docid": "2ca1a7586eafc4ca1cc3725317a7d637", "score": "0.45234826", "text": "function getCasualtiesByGender(data, gender) {\n\tconst deadSex = data.filter(p => p.fields.sex == (gender)).filter(p => p.fields.survived === 'No')\n\treturn deadSex.length\n}", "title": "" }, { "docid": "5891ca6f2e2be1eaf28ddc4a58f11b04", "score": "0.45051914", "text": "function findGenderRatio(d) {\n // create structure to save gender ratio in\n let genders = [{\"label\": \"female\", \"value\": 0},\n {\"label\": \"male\", \"value\": 0},\n {\"label\": \"other\", \"value\": 0},\n {\"label\": \"unknown\", \"value\": 0}];\n\n addGenders(d);\n\n /**\n * Adds up all character genders of all episodes included in given series,\n * season or episode (d).\n */\n function addGenders(d) {\n if (d[\"values\"]) {\n d[\"values\"].forEach(function(d1) {\n addGenders(d1);\n });\n }\n else {\n d[\"characters\"].forEach(function(char) {\n if (char[\"gender\"] === \"F\") {\n genders[0][\"value\"]++;\n }\n else if (char[\"gender\"] === \"M\") {\n genders[1][\"value\"]++;\n }\n else if (char[\"gender\"] === null) {\n genders[3][\"value\"]++;\n }\n else {\n genders[2][\"value\"]++;\n }\n });\n }\n }\n\n return genders;\n}", "title": "" }, { "docid": "d6c4a762765c7d15665d54c7c1b65db9", "score": "0.44938615", "text": "function searchGender(){\r\n genders = [...new Set(peopleJson.map(x=>x.gender))]\r\n console.log(genders)\r\n return genders\r\n}", "title": "" }, { "docid": "b71f0d3050c002d0655ea7e1f2899706", "score": "0.44879684", "text": "function sortByGenderAndAge() {\n const sortedPeople = people\n .sort((a, b) => {\n if (a.gender > b.gender) {\n return 1;\n } \n if (a.gender < b.gender) {\n return -1\n }\n return 0;\n }\n )\n .filter(person => person.age > 30)\n .filter(pers => pers.age < 40);\n document.getElementById(\"people\").innerHTML = sortedPeople;\n console.log(sortedPeople); \n}", "title": "" }, { "docid": "287554d4b70d746297dbf362860da2af", "score": "0.4476709", "text": "handleBlur() {\r\n this.showCriteria = false;\r\n this.isOptional ? this.isValid = true : this.isValid = this.isRequiredProvided(this.value);\r\n }", "title": "" }, { "docid": "d57effbbdcd112b65418fa670281cbce", "score": "0.44756684", "text": "function retirement(currentYear, yearOfBirth, gender) {\n let yearsToRetire = 0;\n if (gender = \"male\" && currentYear - yearOfBirth < 65) {\n yearsToRetire = 65 - (currentYear - yearOfBirth);\n } else {\n yearsToRetire = \"Already retired\";\n }\n if (gender = \"female\" && currentYear - yearOfBirth < 60) {\n yearsToRetire = 60 - (currentYear - yearOfBirth);;\n } else {\n yearsToRetire = \"Already retired\";\n }\n return yearsToRetire;\n}", "title": "" }, { "docid": "08fd723378370078fea651d139c4b7c6", "score": "0.4455923", "text": "function genderOfPerson(){\n var gend= document.getElementsByName(\"gender\");\n \n if(gend[0].checked == true){\n var personGender = \"male\";\n }\n else if(gend[1].checked == true){\n var personGender = \"female\";\n }\n else{\n return false;\n }\n switch(personGender){\n case \"male\":\n if (valueOfDay == 1){\n alert(\"Hello \"+ind+\",you were born on \" +namesOfDays [0] + \" and Your akan name is \" +namesOfMale[0]+\"!\");\n }\n else if(valueOfDay == 2){\n alert(\"Hello \"+ind+\",you were born on \"+namesOfDays [1] + \" and Your akan name is \" +namesOfMale[1]+\"!\");\n }\n else if(valueOfDay== 3){\n alert(\"Hello \"+ind+\",you were born on \" +namesOfDays [2]+ \" and Your akan name is \" +namesOfMale[2]+\"!\");\n }\n else if(valueOfDay == 4){\n alert(\"Hello \"+ind+\",you were born on \"+namesOfDays [3] + \" and Your akan name is \" +namesOfMale[3]+\"!\");\n }\n else if(valueOfDay == 5){\n alert(\"Hello \"+ind+\",you were born on \"+namesOfDays [4] + \" and Your akan name is \" +namesOfMale[4]+\"!\");\n }\n else if(valueOfDay == 6){\n alert(\"Hello \"+ind+\",you were born on \"+namesOfDays [5] + \" and Your akan name is \" +namesOfMale[5]+\"!\");\n }\n else if(valueOfDay == -0){\n alert(\"Hello \"+ind+\",you were born on \"+namesOfDays [6] + \" and Your akan name is \" +namesOfMale[6]+\"!\");\n }\n break;\n case \"female\":\n if (valueOfDay == 1){\n alert(\"Hello \"+ind+\",you were born on \"+namesOfDays [0] + \" and Your akan name is \" +namesOfFemales[0]+\"!\");\n }\n else if(valueOfDay == 2){\n alert(\"Hello \"+ind+\",you were born on \" +namesOfDays [1] + \" and Your akan name is \" +namesOfFemales[1]+\"!\");\n }\n else if(valueOfDay == 3){\n alert(\"Hello \"+ind+\",you were born on \" +namesOfDays [2] + \" and Your akan name is \" +namesOfFemales[2]+\"!\");\n }\n else if(valueOfDay == 4){\n alert(\"Hello \"+ind+\",you were born on \" +namesOfDays [3] + \" and Your akan name is \" +namesOfFemales[3]+\"!\");\n }\n else if(valueOfDay == 5){\n alert(\"Hello \"+ind+\",you were born on \" +namesOfDays [4] + \" and Your akan name is \" +namesOfFemales[4]+\"!\");\n }\n else if(valueOfDay == 6){\n alert(\"Hello \"+ind+\",you were born on \" +namesOfDays [5] + \" and Your akan name is \" + namesOfFemales[5]+\"!\");\n }else if(valueOfDay == -0){\n alert(\"Hello \"+ind+\",you were born on \" +namesOfDays [6] + \" and Your akan name is \" +namesOfFemales[6]+\"!\");\n }\n break\n default:\n \n }\n }", "title": "" }, { "docid": "18ccc13217c04b3d3ed467d4df7f58e0", "score": "0.44425765", "text": "function validateSex() {\n if (men.checked === false && women.checked === false && other.checked === false) {\n sexError.innerHTML = 'Debe seleccionar un sexo'\n console.log('Debe seleccionar un sexo')\n completeSex = false\n } else {\n sexError.innerHTML = ''\n completeSex = true\n }\n}", "title": "" }, { "docid": "e7bf79a5dcfa9921a0d89bc49a8d0143", "score": "0.44420245", "text": "function validateAge(){\n var age = document.getElementById('age')\n var tooYoungMessage = document.getElementById('age-error-young')\n var middleErrorMessage = document.getElementById('age-error-middle')\n var oldErrorMessage =document.getElementById('age-error-old')\n if(age.value < 18){ \n tooYoungMessage.classList.remove('is-invisible')\n }\n else if(age.value > 38 && age.value < 42){\n middleErrorMessage.classList.remove('is-invisible')\n }\n else if(age.value > 64){\n oldErrorMessage.classList.remove('is-invisible')\n }\n}", "title": "" }, { "docid": "b31b0f8a40d8f98863cc3873c8f9eb32", "score": "0.44352004", "text": "function validationUM(r) {\n let um = /[^1-9]/;\n r.value = r.value.replace(um, \"\");\n}", "title": "" }, { "docid": "150bca027741b06b86f84ccb2dda349d", "score": "0.44321623", "text": "function groupByGender(data) {\r\n var males = [];\r\n var females = []\r\n const dataSet = new Array();\r\n\r\n //get each line in the csv file and iterate through all\r\n let line = data.split(\"\\n\")\r\n\r\n for(let i = 0; i < line.length; i++) {\r\n let gender = data.split(\"\\n\")[i].split(\",\")[1].trim().toUpperCase()\r\n if(!/[^fmFM]/.test(gender) ) {\r\n\r\n //Store gender to their respective set\r\n if(gender == 'M') {\r\n \r\n //Add all male gender in a group\r\n males.push(data.split(\"\\n\")[i].split(\",\")[0].trim().toUpperCase())\r\n\r\n //Sort duplicate names in male data set\r\n let sortDuplicate = new Set(males)\r\n males = [...sortDuplicate]\r\n dataSet[0] = males\r\n }else if(gender == 'F') {\r\n\r\n //Add all female gender in a group\r\n females.push(data.split(\"\\n\")[i].split(\",\")[0].trim().toUpperCase())\r\n \r\n //Sort duplicate names in female data set\r\n let sortDuplicate = new Set(females);\r\n females = [...sortDuplicate];\r\n dataSet[1] = females\r\n }\r\n }\r\n }\r\n return dataSet\r\n}", "title": "" }, { "docid": "72673fbd60809d297c6e74ec0426cdf4", "score": "0.44127995", "text": "function filterByGender(pListaContactos, pGender) {\n\n let listaContactosGender = pListaContactos.filter((contacto) => contacto.gender == pGender)\n\n return listaContactosGender;\n}", "title": "" }, { "docid": "8c51eb75375613e7181cac6834a37869", "score": "0.44113523", "text": "function isMale(arr){\n return arr.sex === 'M';\n}", "title": "" }, { "docid": "5e43b265216191168b613ec1112c0eb0", "score": "0.44021308", "text": "function retirement(yearOfBirth, currentYear, gender) {\n\n var yearsLeft;\n var years = currentYear - yearOfBirth;\n if (gender == 'male') {\n if (years < 65) {\n yearsLeft = 65 - years;\n return yearsLeft;\n } else {\n return 'You are already retired'\n\n }\n }\n if (gender == 'female') {\n if (years < 60) {\n yearsLeft = 60 - years;\n return yearsLeft;\n } else {\n return 'You are already retired'\n\n }\n }\n\n}", "title": "" }, { "docid": "865587a6d66c7b24bc57fd7b02ae0350", "score": "0.43982106", "text": "function isFemale(arr){\n return arr.sex === 'F';\n}", "title": "" }, { "docid": "c4693760078a90cf010275fd97b4414d", "score": "0.4394193", "text": "function calculateBMR(gender){\n var bmr = 0;\n if(Number($(\".age:visible\").val()) < 15 || Number($(\".age:visible\").val()) > 80){\n $(\".display:visible\").text(\"Please enter a valid age\");\n $(\".display:visible\").addClass(\"errorMessage\");\n }\n else{\n if (gender === \"male\"){\n bmr = 66 + (13.7 * $(\".weight:visible\").val()) + (5 * $(\".height\").val()) - (6.8 * $(\".age\").val());\n }\n else if (gender === \"female\"){\n bmr = 655 + (9.6 * $(\".weight:visible\").val()) + (1.8 * $(\".height\").val()) - (4.7 * $(\".age\").val());\n }\n $(\"#sedentary\").text(Math.round(bmr * 1.2).toLocaleString(\"en-US\"));\n $(\"#exercise1to3\").text(Math.round(bmr * 1.375).toLocaleString(\"en-US\"));\n $(\"#exercise4to5\").text(Math.round(bmr * 1.55).toLocaleString(\"en-US\"));\n $(\"#exercise3to4\").text(Math.round(bmr * 1.725).toLocaleString(\"en-US\"));\n $(\"#exercise6to7\").text(Math.round(bmr * 1.9).toLocaleString(\"en-US\"));\n $(\"#veryIntenseExercise\").text(Math.round(bmr * 2.0).toLocaleString(\"en-US\"));\n //Display the calculated BMR in the result section\n $(\".valueDisplay\").text(Math.round(bmr).toLocaleString(\"en-US\"));\n $(\".valueDisplay\").addClass(\"calculatedColor\");\n } \n}", "title": "" }, { "docid": "5b2f3ade5477d26980f9b0a6eed25ea1", "score": "0.43908402", "text": "function validationCantitate(r) {\n let cantitate = /[^1-9]/;\n r.value = r.value.replace(cantitate, \"\");\n}", "title": "" }, { "docid": "cc2cfbc43af2a1908bd5432951cc2c4d", "score": "0.43899018", "text": "function genderSearch(people){ \n let userChoice = promptFor(\"Is the person male or female?\", validateGender);\n let foundPeople = people.filter(function(el){\n if(el.gender === userChoice) { \n return true;\n }});\n if(foundPeople === undefined|| foundPeople.length === 0){\n noResults();\n return app(people);\n }\n return foundPeople;\n}", "title": "" }, { "docid": "a0d39e14eb0d3dcaa15c42f319705da7", "score": "0.43845963", "text": "function getNumGender(arr, gender) {\n return lodown.filter(arr, function(person, index, persons){\n return person.gender === gender;\n }).length;\n}", "title": "" }, { "docid": "d9660da092bb6b24527865456b566e35", "score": "0.4375886", "text": "function maxpulseNormal() {\n let age = document.getElementById(\"age_input\").value;\n let gender = document.querySelector(\"input[name=maxpulse_gender]:checked\").value;\n maxpulse = 206.9 - (0.67 * age);\n\n //if the age is empty, ask for the user to fill inn.\n if (age == \"\") {\n document.getElementById(\"maxpulse_output\").innerHTML = \"Please fill in your age\";\n }\n else {\n if (gender === \"male\") {\n document.getElementById(\"maxpulse_output\").innerHTML = \"Your max pulse is: \" + parseFloat(maxpulse).toFixed(2);\n }\n else if (gender === \"female\") {\n document.getElementById(\"maxpulse_output\").innerHTML = \"Your max pulse is: \" + parseFloat(maxpulse + 2.45).toFixed(2);\n }\n }\n}", "title": "" }, { "docid": "43991e7d7514c26f95efb179c296c05e", "score": "0.4364183", "text": "function BMRmale(weight, height, age) {\n var BMR = 66.47 + (13.75 * weight) + (5.003 * height) - (6.755 * age);\n return BMR\n}", "title": "" }, { "docid": "e853993b01930bd20ebd6a6fb25ab74b", "score": "0.43527958", "text": "setSex () {\n return this.getChoice();\n }", "title": "" }, { "docid": "36b87e7373e3d251c24d1da472173680", "score": "0.4351857", "text": "function toggleGenderIntegrationText() {\r\n if ($(\".genderIntegrationOption:checked\").val() == 0) {\r\n $(\".genderIntegrationsDescription\").hide(\"slow\");\r\n $(\"#activity\\\\.genderIntegrationsDescription\").text(\"\");\r\n } else {\r\n $(\".genderIntegrationsDescription\").show(\"slow\");\r\n }\r\n}", "title": "" }, { "docid": "0b69bd8b34706f3f7baed9ec9e93bcda", "score": "0.43502846", "text": "handleFilter(gender) {\n if (gender === \"All\") {\n this.setState({ employees: this.state.originalState })\n } else {\n this.setState({ employees: this.state.originalState.filter(e => e.gender === gender) })\n }\n }", "title": "" }, { "docid": "0b69bd8b34706f3f7baed9ec9e93bcda", "score": "0.43502846", "text": "handleFilter(gender) {\n if (gender === \"All\") {\n this.setState({ employees: this.state.originalState })\n } else {\n this.setState({ employees: this.state.originalState.filter(e => e.gender === gender) })\n }\n }", "title": "" }, { "docid": "a6fc2715df15e01429e841199c542d39", "score": "0.43489286", "text": "function validation(event) {\r\n var radio_check = document.getElementsByName('gender'); // Fetching radio button by name.\r\n var input_field = document.getElementsByClassName('text_field'); // Fetching all inputs with same class name text_field and an html tag textarea.\r\n var text_area = document.getElementsByTagName('textarea');\r\n// Validating radio button.\r\nif (radio_check[0].checked == false && radio_check[1].checked == false) {\r\n var y = 0;\r\n} else {\r\n var y = 1;\r\n}\r\n// For loop to count blank inputs.\r\nfor (var i = input_field.length; i > count; i--) {\r\n if (input_field[i - 1].value == '' || text_area.value == '') {\r\n count = count + 1;\r\n } \r\n else {\r\n count = 0;\r\n }\r\n}\r\nif (count != 0 || y == 0) {\r\n alert(\"*All Fields are mandatory*\"); // Notifying validation\r\n event.preventDefault();\r\n} \r\nelse {\r\n return true;\r\n}\r\n}", "title": "" }, { "docid": "79e9331945248be81c6bb44018a57c8b", "score": "0.43398857", "text": "function hideShowMaternity(selectval) {\n $.post('/home/leave/gender', { userid: selectval }, function (data) {\n if (data[0].gender == 'Male') {\n $('#li_maternity').hide();\n } else {\n $('#li_maternity').show();\n }\n });\n}", "title": "" }, { "docid": "d7e6b286c9c712d4bb82c3a02fea519b", "score": "0.4334912", "text": "function validateAge(){\n if(!event.target.readOnly && event.target.value.trim() == \"\" || event.target.value == undefined){\n spanAgeError = getById('spanAgeError');\n spanAgeError.style.display = 'block';\n spanAgeError.innerText = 'Please enter age';\n }else{\n getById('spanAgeError').style.display = 'none';\n }\n}", "title": "" }, { "docid": "78d3edcc4c9daeab6dd305e20c0b30e1", "score": "0.4331478", "text": "function name(firstName,lastName, gender){\n var output;\n if(gender === 'male'){\n output = 'mr.'+firstName+ ' '+lastName;\n }\n else if(gender === 'female'){\n output= 'ms'+ ' '+firstName+ ' '+lastName;\n }\n return output;\n}", "title": "" }, { "docid": "dcae92f414d9fb29d23f9d277aac0d4a", "score": "0.43283188", "text": "get genderMr() {\n return $('#id_gender1');\n }", "title": "" }, { "docid": "f43df05449038039e6c28dc419dbb9a7", "score": "0.4319891", "text": "function passengerFilter (record) {\n if (record.age !== '') {\n return record;\n }\n }", "title": "" }, { "docid": "c7e37faa600f5d5351490ed63f6f05f4", "score": "0.43101928", "text": "function askGender() {\n readlineThing.question(\"Choose your gender: \", function(answer) {\n gender(answer); \n startingPoint();\n })\n}", "title": "" }, { "docid": "0c721db4dbc6ef33e7fba8988be87c44", "score": "0.43078235", "text": "function femaleCoders(array){\r\n if (Array.isArray(array)){\r\n return array.filter(eachObj => {\r\n if (typeof(eachObj) === \"object\"){\r\n return (eachObj.Gender === 'f' && eachObj.Coder === true);\r\n } \r\n }); \r\n }else{\r\n return 'Array Object expected';\r\n }\r\n}", "title": "" } ]
27582ebff46f701102171afdece611df
cambia el valor de la dimension en la que estas
[ { "docid": "cf80bdae9bd65d46e419c34e8bd6c373", "score": "0.62879515", "text": "changeDimValue(){\n this.dimValue *= -1;\n }", "title": "" } ]
[ { "docid": "cc55be64a503db4d3817bfad278903b7", "score": "0.8072132", "text": "getDimValue(){//1 lado izquierdo\n return this.dimValue;\n }", "title": "" }, { "docid": "52a760fc1375ffe79ad49d2e119d4df4", "score": "0.7444379", "text": "getDimen(){\n return parseInt(this._dimen);\n }", "title": "" }, { "docid": "b2e1c83048ce7d4ff4b9f6d84d4a2f38", "score": "0.7308988", "text": "get dimensions() {\r\n let temp = {x: this.xDim, y: this.yDim}\r\n return temp\r\n }", "title": "" }, { "docid": "358117b2609ec87ee8de20e71bf592aa", "score": "0.7028064", "text": "getDim() {\n return {\n width: this.width,\n height: this.height\n };\n }", "title": "" }, { "docid": "126afb6c228824500dfe4fabdc2c3e53", "score": "0.6368824", "text": "dimensions() {\r\n return {\r\n rows: this.elements.length,\r\n cols: this.elements[0].length\r\n };\r\n }", "title": "" }, { "docid": "4ba77736ad15848221ae077073d2ee15", "score": "0.60532737", "text": "function _setDimensionValues() {\n\n this.wrapperBox = Utils.getBoxElement(this.wrapper[0]);\n\t\n\n if(this.horizontal) {\n\n _setNewValuesHorizontal.call(this,\n Utils.getPercentage(Utils.getBoxElement(this.layoutLeft[0]).width, this.wrapperBox.width)\n );\n\n } else {\n\n _setNewValuesVertical.call(this,\n Utils.getPercentage(Utils.getBoxElement(this.layoutTop[0]).height, this.wrapperBox.height)\n );\n\n }\n\n }", "title": "" }, { "docid": "7cae07d0902936b64d045126b0a7d803", "score": "0.5991055", "text": "get axisLength() {}", "title": "" }, { "docid": "72a8e46664f7879d42f81ebf8e4c739f", "score": "0.5983827", "text": "function dimensionCalc() {\n if (width > height) {\n vMax = width / 100;\n circleRad = height * 0.45;\n } else {\n vMax = height / 100;\n circleRad = width * 0.45;\n }\n}", "title": "" }, { "docid": "a3d83a4d8309d317f4f761f27d54d97c", "score": "0.5944943", "text": "get length() {\r\n return this._shape[0];\r\n }", "title": "" }, { "docid": "a4e432f799e10ab0bd58cb750d09c83c", "score": "0.5932366", "text": "function isConstrainedValue(value){return value!==undefined&&value!==null&&value!=='none';}// Private helper to get a constraint dimension", "title": "" }, { "docid": "7d8026dd8be70b519dfbd35beed18383", "score": "0.5932036", "text": "is1d() {\n return this.dimension == \"1d\";\n }", "title": "" }, { "docid": "2e0632add3ef60b94d05632324e30de1", "score": "0.5928298", "text": "get flexibleDimensions() { return this._flexibleDimensions; }", "title": "" }, { "docid": "2e0632add3ef60b94d05632324e30de1", "score": "0.5928298", "text": "get flexibleDimensions() { return this._flexibleDimensions; }", "title": "" }, { "docid": "2e0632add3ef60b94d05632324e30de1", "score": "0.5928298", "text": "get flexibleDimensions() { return this._flexibleDimensions; }", "title": "" }, { "docid": "2e0632add3ef60b94d05632324e30de1", "score": "0.5928298", "text": "get flexibleDimensions() { return this._flexibleDimensions; }", "title": "" }, { "docid": "2e0632add3ef60b94d05632324e30de1", "score": "0.5928298", "text": "get flexibleDimensions() { return this._flexibleDimensions; }", "title": "" }, { "docid": "2e0632add3ef60b94d05632324e30de1", "score": "0.5928298", "text": "get flexibleDimensions() { return this._flexibleDimensions; }", "title": "" }, { "docid": "805088e687d7478d62fce32cccd7a331", "score": "0.59125304", "text": "get_dim_vector(){\n var grid = this.params['param_grid']\n var grid_keys = []\n for(var key in grid){\n grid_keys.push(key)\n }\n grid_keys.sort()\n\n var dimensions = []\n\n for(var key of grid_keys){\n dimensions.push(grid[key])\n }\n\n return [dimensions, grid_keys]\n }", "title": "" }, { "docid": "1ebdad0bc668c249f8cbdcaf6332b327", "score": "0.58881223", "text": "function getMatrixSize(){\n\n\t\tconsole.log(\"Boton pulsado, ejecutando funcion getSize\");\n\n\t\tresetSquares();\n\n\t\t$x = parseInt($inputX.value);\n\t\t$y = parseInt($inputY.value);\n\t\tconsole.log(\"Ancho: \"+ $x);\n\t\tconsole.log(\"Alto: \"+ $y);\n\n\t\tfillTable();\n\t}", "title": "" }, { "docid": "a392771c34edf7b4bfc865669a8f9fc0", "score": "0.58635396", "text": "getWidth() {\n return data.width * data.zoom;\n }", "title": "" }, { "docid": "c9f8b0b475c0c59b595a1673eab78819", "score": "0.58597696", "text": "get width () {\r\n \r\n return graph.staticCanvas.width;\r\n \r\n }", "title": "" }, { "docid": "8ded3b1e5db82874b842147106d08787", "score": "0.5856232", "text": "get width() {\n return this.pixelSize[0]\n }", "title": "" }, { "docid": "8f2c053e6c9cffcb4438b46b8866c7de", "score": "0.5855588", "text": "getSize() {\n return {r: this.rows, c: this.cols};\n }", "title": "" }, { "docid": "07580d5cc6973d96563a8511422b1312", "score": "0.5837028", "text": "function getDim(el){\n\tfor (var lx=0,ly=0;el!=null;\n\t\tlx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);\n\treturn {x:lx,y:ly}\n}", "title": "" }, { "docid": "84c4979128f49bb2876f70db370601c8", "score": "0.5812069", "text": "function decreaseDimension(){\n newDimension -= 1;\n if(newDimension<7){ /*Limits the min size to 7, the algorithm i made can take smaller values but there really isnt much point in doing a 3x3 grid.*/\n newDimension = 7;\n }\n dimensionElement = document.getElementById(\"dimension-value\"); /*Gets the container for the dimension value and updates it with the user's decrease*/\n dimensionElement.innerHTML = newDimension;\n bombCheck(); /*Runs an algorithm to check if there are more bombs than max grid size to avoid problems*/\n }", "title": "" }, { "docid": "7d7d62c923d5b187bb6acfc0b6139f47", "score": "0.5797824", "text": "function getDimension(ob) {\n var dimensions = [];\n dimensions.imgHeight = ob.find(\"img\").innerHeight();\n dimensions.imgWidth = ob.find(\"img\").innerWidth();\n dimensions.spanHeight = ob.find(\"span\").innerHeight();\n return dimensions;\n }", "title": "" }, { "docid": "1c08b9e92a49960c6cb00496e2f3f607", "score": "0.5778084", "text": "get pixelSize() {\n let [w, h] = this.baseSize\n return [w * this.scale.x, h * this.scale.y]\n }", "title": "" }, { "docid": "89e4466c7e4e503a49b0e48067b0abbe", "score": "0.57638687", "text": "get width() {\r\n \t\treturn this.scale.x * (this.gltf.max[0] - this.gltf.min[0]);\r\n \t}", "title": "" }, { "docid": "b98fa9c624f160969cd1af66963e60fa", "score": "0.5752407", "text": "getDimensions(dimensionType, dimensionValue){\n if(dimensionType == \"height\"){\n this.setState({\n height: dimensionValue\n });\n }else if(dimensionType == \"width\"){\n this.setState({\n width: dimensionValue\n });\n }\n }", "title": "" }, { "docid": "0d24bd4a9e42db10683569f78fea30d7", "score": "0.5741004", "text": "function getWidth() { return parseInt(vis.style(\"width\")); }", "title": "" }, { "docid": "8f76ad0a6cd4b7e646356ac68eaebba7", "score": "0.5718566", "text": "getDimensions(hour){return [0,0];}", "title": "" }, { "docid": "55658e1a04abedf70355f31a3dae7bc3", "score": "0.57011217", "text": "function increaseDimension(){\n newDimension += 1;\n if(newDimension>15){ /*Limits the max size to 15, the algorithm i made can take higher values however it gets to a point where screen size limits it too much*/\n newDimension = 15;\n }\n dimensionElement = document.getElementById(\"dimension-value\"); /*Gets the container for the dimension value and updates it with the user increment*/\n dimensionElement.innerHTML = newDimension;\n bombCheck(); /*Runs an algorithm to check if there are more bombs than max grid size to avoid problems*/\n }", "title": "" }, { "docid": "30163eb7db7d0e1ad77c864261fe96ee", "score": "0.56842303", "text": "get mathXYZ() {\n return [this.E, this.N, this.height];\n }", "title": "" }, { "docid": "45b65e9232992943e4f85c4abace34a4", "score": "0.56811154", "text": "get width() { return this.range.x * this.size.x }", "title": "" }, { "docid": "60071282c03fbdb0229eb5132071394b", "score": "0.56606627", "text": "shape() {\n return this.size;\n }", "title": "" }, { "docid": "f387180b522876ddfb5ce471ca51257a", "score": "0.56534135", "text": "function dimensions() {\r\n let rows = 0;\r\n let cols = 0;\r\n return {\r\n setDimensions(r, c) {\r\n rows = r;\r\n cols = c;\r\n },\r\n getDimensions() {\r\n return { rows: rows, cols: cols };\r\n }\r\n }\r\n}", "title": "" }, { "docid": "b186067e1ae7d4b8d9c2493ad1677fe5", "score": "0.56496024", "text": "get width() {\n return this.i.gf;\n }", "title": "" }, { "docid": "81c543b05e7ee30ef33d45385283cbd1", "score": "0.5644973", "text": "function variablesValues() {\n width = Math.floor( window.innerWidth );\n height = Math.floor( width * aspectRatio );\n}", "title": "" }, { "docid": "ccac43fe40832117149fff72fef0192f", "score": "0.5642215", "text": "static dimension(version) {\n return 17 + 4 * version;\n }", "title": "" }, { "docid": "de992de658a4d0e7c1b52b4b9bd8228d", "score": "0.5616648", "text": "function getDimensions() {\n dimensions.width = window.innerWidth\n dimensions.height = window.innerHeight\n }", "title": "" }, { "docid": "a7648a18a6fec447f77be7e95b100ed0", "score": "0.5596626", "text": "is2d() {\n return this.dimension == \"2d\";\n }", "title": "" }, { "docid": "579d6dceb8d386aafd3cd98af2e4f34d", "score": "0.5585196", "text": "function dimensions() {\n\t\tif (canvas.width >= canvas.height) {\n\t\t\tplayArea = new Array(Math.round(canvas.width/2.0\n\t\t\t\t - canvas.height/2.0) + padding,\n\t\t\t\tpadding,\n\t\t\t\tcanvas.height - 2*padding,\n\t\t\t\tcanvas.height - 2*padding);\n\t\t} else {\n\t\t\tplayArea = new Array(padding,\n\t\t\t\tMath.round(canvas.height/2.0\n\t\t\t\t - canvas.width/2.0) + padding,\n\t\t\t\t - canvas.width + padding,\n\t\t\t\tcanvas.width - 2*padding,\n\t\t\t\tcanvas.width - 2*padding);\n\t\t}\n\n\t\tblockMargin = Math.round(playArea[2] / fieldSize * blockMarginRatio);\n\t\tblockSize = Math.round((playArea[2] - blockMargin) / fieldSize) - blockMargin;\n\t}", "title": "" }, { "docid": "833028176b2eda8959d3c1b8878a3f0a", "score": "0.5584782", "text": "function normalizeDimension(v) {\n if (isFinite(v)) {\n return v + 'px';\n } else {\n return v;\n }\n }", "title": "" }, { "docid": "3a3eb94871cd22fe7e44a2ad5e1b11ee", "score": "0.55845124", "text": "getDimensions() {\n // caller has explicitly called setDimensions\n if (this.shouldUseDefaultDimensions === false) {\n return this.dimensions;\n }\n // if there are no default dimensions, return the custom dimensions\n if (Object.keys(this.defaultDimensions).length === 0) {\n return this.dimensions;\n }\n // if default dimensions have been provided, but no custom dimensions, use the defaults\n if (this.dimensions.length === 0) {\n return [this.defaultDimensions];\n }\n // otherwise, merge the dimensions\n // we do this on the read path because default dimensions\n // may get updated asynchronously by environment detection\n return this.dimensions.map(custom => {\n return Object.assign(Object.assign({}, this.defaultDimensions), custom);\n });\n }", "title": "" }, { "docid": "241f36c929040411e4b2512ec3854ebe", "score": "0.557869", "text": "get size() {\n return this._matrix.length;\n }", "title": "" }, { "docid": "86d586dd99944e54de16923f39d7622f", "score": "0.5563762", "text": "getWidth() { return this.width; }", "title": "" }, { "docid": "86d586dd99944e54de16923f39d7622f", "score": "0.5563762", "text": "getWidth() { return this.width; }", "title": "" }, { "docid": "b604899e2ef7b8acf4a67f23577bf357", "score": "0.5553013", "text": "function getCellDimension(dim, xory){\n\tvar evalString = \"Math.round(graph.\" + dim + \n\t\t\t\t\t\"/CELLS_\" + xory + \");\";\n\treturn eval(evalString);\n}", "title": "" }, { "docid": "35ad1090bb06137a797c1abed344c66a", "score": "0.5547828", "text": "get xCount() {\n\t\t// if x axis, total x will length of nested arr\n\t\tif (this.axis === 'x') {\n\t\t\treturn this.grid[0].length;\n\t\t} else {\n\t\t\treturn this.grid.length;\n\t\t}\n\t}", "title": "" }, { "docid": "e2959cf5c48cb1c0ffc6cec202383641", "score": "0.55472744", "text": "getArea() {\n return this.length * this.length;\n }", "title": "" }, { "docid": "db48c22511e32396b7931f64aa0d4781", "score": "0.55389345", "text": "get width()\n {\n return this.x;\n }", "title": "" }, { "docid": "2c45a914f965dd6d4843f211696e6fb3", "score": "0.5536652", "text": "get density() {\n return this.i.h;\n }", "title": "" }, { "docid": "848322c9fc835221d249e50963a8cb52", "score": "0.55331326", "text": "function getAbsoluteValue(valueType,$element){\n if(valueType=='row')\n return $element.height();\n else if(valueType=='column')\n return $element.width();\n }", "title": "" }, { "docid": "65337bef5633b483060c8d38704c53d2", "score": "0.55320764", "text": "function size(d) {\n\t\t\t\t\t return d.size;\n\t\t\t\t\t }", "title": "" }, { "docid": "a38fe3b9e675ad4ed45b91789131b7fe", "score": "0.55205405", "text": "get center() { return this.size.divide(2); }", "title": "" }, { "docid": "d55711b195eb1fbdbd9545f1e8990e63", "score": "0.550016", "text": "getChildrenSideSum( dimension ) {\n return this.children.reduce((accu, child)=> {\n if ( !child.isBoxComponent ) return accu\n const margin = (child.margin * 2) || 0;\n const CHILD_SIZE = (dimension === \"width\") ?\n (child.getWidth() + margin) :\n (child.getHeight() + margin);\n return accu + CHILD_SIZE;\n }, 0 );\n }", "title": "" }, { "docid": "ce60e0c68b9182474b537578a5b7291e", "score": "0.5496946", "text": "function i(t){return{width:t.width(),height:t.height()}}", "title": "" }, { "docid": "4588b6c42f8a7fd0da71468f358c1f0c", "score": "0.549379", "text": "function project(d) {\r\n\t\t\t\treturn dimensions.map(function(p,i) {\r\n\t\t\t\t\t// check if data element has property and contains a value\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t!(p.key in d) ||\r\n\t\t\t\t\t\t\td[p.key] === null\r\n\t\t\t\t\t) return null;\r\n\r\n\t\t\t\t\treturn [xscale(i),p.scale(d[p.key])];\r\n\t\t\t\t});\r\n\t\t\t}", "title": "" }, { "docid": "c27db1ec2e17607e027833c52e14cc49", "score": "0.54894346", "text": "function setDimensions(){\n console.log('Called setDimensions');\n spacing = width*0.1;\n diameter = spacing*2/3; \n}", "title": "" }, { "docid": "1d4704ff1c7d4f2fe5476ca6d8b41a77", "score": "0.54799896", "text": "get actualDensity() {\n return this.i.g;\n }", "title": "" }, { "docid": "0eed1eab1dbdcdb92332f23c13384119", "score": "0.5476492", "text": "get maxX() {\n return this.x + this.width;\n }", "title": "" }, { "docid": "43ee3439be268bf349a6fdf51561dddb", "score": "0.54761624", "text": "function relativeDimensions (value) {\n return this[size + \"Size\"](value);\n}", "title": "" }, { "docid": "7c20ecb4ae51e0db296b764db462c20a", "score": "0.547596", "text": "function getWidth(){\n return width;\n }", "title": "" }, { "docid": "562975d037b956b684194291c1a74228", "score": "0.5475065", "text": "function validateDimension() {\n\t\tvar match = this.getValue().match( regexGetSizeOrEmpty ),\n\t\t\tisValid = !!( match && parseInt( match[ 1 ], 10 ) !== 0 );\n\n\t\tif ( !isValid )\n\t\t\talert( commonLang[ 'invalidLength' ].replace( '%1', commonLang[ this.id ] ).replace( '%2', 'px' ) ); // jshint ignore:line\n\n\t\treturn isValid;\n\t}", "title": "" }, { "docid": "aeef8d011c3a747e5ec2a92e2f9bc7f7", "score": "0.5472257", "text": "getMaxX(){\r\n return this.x+this.width\r\n }", "title": "" }, { "docid": "56846f223b9c817404b4441896c077d2", "score": "0.5471249", "text": "get zoomX () {\r\n \r\n return graph.width / graph.rangeX;\r\n \r\n }", "title": "" }, { "docid": "9b384f6813d4106dcbcccdae13b21938", "score": "0.5470047", "text": "getWidth(){\n return this.__width;\n }", "title": "" }, { "docid": "af50476dc196096d22d94435b6a6d2ec", "score": "0.5467492", "text": "getSize(){\n return Math.sqrt(this.gameState.board.length);\n }", "title": "" }, { "docid": "52845ea365b6061c8ebddd9d694634c2", "score": "0.5461313", "text": "get density() {}", "title": "" }, { "docid": "a1cde8412da67f6b5abc688ab424f3c7", "score": "0.5454477", "text": "getModuleWidth() { return this.module_base_face_dimensions_axes[0]; }", "title": "" }, { "docid": "f97684e4f0862775fb79ae5bea3f0baf", "score": "0.5452406", "text": "width() { return this.w; }", "title": "" }, { "docid": "3d9458b9c9f87d411f68ea5415dd8362", "score": "0.54511845", "text": "get baseSize() {\n return this.info.getDimensions(this.info.baseLevel)\n }", "title": "" }, { "docid": "65582130443d194e60c10acf729f2fd8", "score": "0.5450974", "text": "function dimensioni(event){\n\t\t\tvar mod_larghezza = event.pageX - boxLeft();\n\t\t\tvar mod_altezza = event.pageY - boxTop();\n\n\t\t\tbox.style['width'] = mod_larghezza+ \"px\";\n\t\t\tbox.style['height'] = mod_altezza+ \"px\";\n\t}", "title": "" }, { "docid": "7709378f7fabba3d121184d1115c90e4", "score": "0.54409075", "text": "function updateDimFields(evt) {\n var element = evt.srcElement;\n var elementId = element.id;\n var size = element.value;\n var targetElement = null;\n \n evt.preventDefault();\n\n switch (elementId) {\n case 'colorwidth':\n targetElement = document.getElementById('colorheight');\n targetElement.value = (1080 * size) / 1920;\n break;\n\n case 'colorheight': \n targetElement = document.getElementById('colorwidth');\n targetElement.value = (1920 * size) / 1080;\n break;\n\n case 'depthwidth':\n targetElement = document.getElementById('depthheight');\n targetElement.value = (424 * size) / 512;\n break;\n\n case 'depthheight':\n targetElement = document.getElementById('depthwidth');\n targetElement.value = (512 * size) / 424;\n break;\n }\n}", "title": "" }, { "docid": "293abe9a4c53118326f009be9b3cade5", "score": "0.54370856", "text": "setChartDimension(){\n // SVG element\n this.svg\n .attr(\"viewBox\", `0 0 ${this.cfg.width+this.cfg.margin.left+this.cfg.margin.right} ${this.cfg.height+this.cfg.margin.top+this.cfg.margin.bottom}`)\n .attr(\"width\", this.cfg.width + this.cfg.margin.left + this.cfg.margin.right)\n .attr(\"height\", this.cfg.height + this.cfg.margin.top + this.cfg.margin.bottom);\n\n // Center group\n this.gcenter\n .attr('transform', `translate(${this.cfg.width/2}, ${this.cfg.height/2})`);\n }", "title": "" }, { "docid": "c9176cddded52ded1eba5529b0bfd3cf", "score": "0.5436678", "text": "get area() {\n if (this.count !== 4) return \n return this.side[0] * this.side[0]\n }", "title": "" }, { "docid": "d62f1efb653d00a1dde0d676355115f0", "score": "0.5436162", "text": "getWidth(){return this._width;}", "title": "" }, { "docid": "2d06d756c8423d21726001d9bc590e28", "score": "0.54293656", "text": "static get indirectScale() {}", "title": "" }, { "docid": "622db2a61af2ce98303e239cde9563ff", "score": "0.5426934", "text": "width(dimension) {\n dimension = dimension || Width.Default;\n switch (dimension) {\n case Width.Inner:\n case Width.Outer:\n return this._width;\n default:\n return this._width - this.settings.stagePadding * 2 + this.settings.margin;\n }\n }", "title": "" }, { "docid": "159260322431d0d4b3cf00631a49f1d6", "score": "0.54244256", "text": "function setRoofDimensions(){\r\n let inputVal_1 = document.getElementById(\"ridge_length\").value;\r\n roof_ridge_dimension = inputVal_1;\r\n\r\n let inputVal_2 = document.getElementById(\"roof_width\").value;\r\n roof_side_dimension = inputVal_2;\r\n}", "title": "" }, { "docid": "598767d9fc2ecd9043b3ad9dfcff8cf4", "score": "0.54229826", "text": "get resourceValue () {\n let lumber = 0\n let wood = 0\n\n for (let i = 0; i < this.h; i++) {\n for (let j = 0; j < this.w; j++) {\n lumber += Number(this.matrix[i][j] === '#')\n wood += Number(this.matrix[i][j] === '|')\n }\n }\n\n return lumber * wood\n }", "title": "" }, { "docid": "5001f1b855c0d3852d7faca338e30cb5", "score": "0.5420934", "text": "get width() {\n return this.root.width.baseVal.value;\n }", "title": "" }, { "docid": "71c49a64befd5a4268b831c571e5f727", "score": "0.54186904", "text": "function getdim(mat) {\n var d = dim(mat);\n return validator(d)(mat) ? d : false;\n}", "title": "" }, { "docid": "80280698465f41d231c67ffb194b80c8", "score": "0.54175794", "text": "get canvasDimensions() {\n return {\n width: this._svgCanvas.offsetWidth,\n height: this._svgCanvas.offsetHeight\n };\n }", "title": "" }, { "docid": "a295697f58f1e8cb1151c94bef9d5982", "score": "0.54142654", "text": "function Dimensions(props) {\n const has_dims = props.l || props.w || props.h; // values can be null!\n let dims = [\n parseFloat(props.l || 0),\n parseFloat(props.w || 0),\n parseFloat(props.h || 0)\n ];\n const is_small = has_dims && dims.filter(d => d > 0 && d < 1).length > 0;\n dims = is_small\n ? dims\n .map(d => parseFloat((d * 100).toFixed(2)))\n .map(d => (Number.isInteger(d) ? parseInt(d) : d))\n : dims;\n const unit = is_small ? \"cm\" : \"m\";\n return has_dims ? (\n <DataUnitTemplate\n label=\"Dimensions (L × l × h)\"\n value={\n dims.map(d => d.toString().replace(\".\", \",\")).join(\" × \") + \" \" + unit\n }\n />\n ) : null;\n}", "title": "" }, { "docid": "790fa6f824a5db5d2ec60610baeb2ebc", "score": "0.54101795", "text": "get area() {\n return this.width * this.height;\n }", "title": "" }, { "docid": "ec9d3d250294171b6c5037e82bd13aeb", "score": "0.54051375", "text": "getArea() {\n return this.width * this.height;\n }", "title": "" }, { "docid": "e02a902abee7e8a61cc9f1949bceef19", "score": "0.540334", "text": "function gridSize(){\n\t// change the game grid size\n\tv = document.getElementById('gridsize').value.split('x');\n\tW = parseInt(v[0]);\n\tH = parseInt(v[1]);\n\taPlantilla = new Array(W*H);\n\tcurrentTile = 0; // Indicamos que el tile seleccionado es el 0\n\twritePlantilla()\n\tinitPlantilla();\t// Inicializamos el array con la plantilla\n\ttileSelector();\t\t// Cambiamos el color del borde de todos los tiles seleccionables\n\tselectTile(document.t0); // Seleccionamos graficamente el tile 0\n\tsetCasilla(document.c0); // inicializamos la cadena del puzzle\n\tdocument.getElementById(\"final\").value = valoresPlantilla()\n}", "title": "" }, { "docid": "c9ccbb9b8f19b62503c11e61146adc33", "score": "0.5402616", "text": "function ajustaTamanhoPalcoJogo(){\n altura = window.innerHeight\n largura = window.innerWidth\n //console.log(altura, largura)\n }", "title": "" }, { "docid": "998bb47d7ae38b3a320b0daace9e7c86", "score": "0.54018956", "text": "function dimension(value) {\n var dimension = {\n filter: filter,\n filterExact: filterExact,\n filterRange: filterRange,\n filterFunction: filterFunction,\n filterAll: filterAll,\n top: top,\n bottom: bottom,\n group: group,\n groupAll: groupAll,\n dispose: dispose,\n remove: dispose // for backwards-compatibility\n };\n\n var one = ~m & -~m,\n // lowest unset bit as mask, e.g., 00001000\n zero = ~one,\n // inverted one, e.g., 11110111\n values,\n // sorted, cached array\n index,\n // value rank ↦ object id\n newValues,\n // temporary array storing newly-added values\n newIndex,\n // temporary array storing newly-added index\n sort = quicksort_by(function (i) {\n return newValues[i];\n }),\n refilter = crossfilter_filterAll,\n // for recomputing filter\n refilterFunction,\n // the custom filter function in use\n indexListeners = [],\n // when data is added\n dimensionGroups = [],\n lo0 = 0,\n hi0 = 0;\n\n // Updating a dimension is a two-stage process. First, we must update the\n // associated filters for the newly-added records. Once all dimensions have\n // updated their filters, the groups are notified to update.\n dataListeners.unshift(preAdd);\n dataListeners.push(postAdd);\n\n removeDataListeners.push(removeData);\n\n // Incorporate any existing data into this dimension, and make sure that the\n // filter bitset is wide enough to handle the new dimension.\n m |= one;\n if (M >= 32 ? !one : m & -(1 << M)) {\n filters = crossfilter_arrayWiden(filters, M <<= 1);\n }\n preAdd(data, 0, n);\n postAdd(data, 0, n);\n\n // Incorporates the specified new records into this dimension.\n // This function is responsible for updating filters, values, and index.\n function preAdd(newData, n0, n1) {\n\n // Permute new values into natural order using a sorted index.\n newValues = newData.map(value);\n newIndex = sort(crossfilter_range(n1), 0, n1);\n newValues = permute(newValues, newIndex);\n\n // Bisect newValues to determine which new records are selected.\n var bounds = refilter(newValues),\n lo1 = bounds[0],\n hi1 = bounds[1],\n i;\n if (refilterFunction) {\n for (i = 0; i < n1; ++i) {\n if (!refilterFunction(newValues[i], i)) filters[newIndex[i] + n0] |= one;\n }\n } else {\n for (i = 0; i < lo1; ++i) {\n filters[newIndex[i] + n0] |= one;\n }for (i = hi1; i < n1; ++i) {\n filters[newIndex[i] + n0] |= one;\n }\n }\n\n // If this dimension previously had no data, then we don't need to do the\n // more expensive merge operation; use the new values and index as-is.\n if (!n0) {\n values = newValues;\n index = newIndex;\n lo0 = lo1;\n hi0 = hi1;\n return;\n }\n\n var oldValues = values,\n oldIndex = index,\n i0 = 0,\n i1 = 0;\n\n // Otherwise, create new arrays into which to merge new and old.\n values = new Array(n);\n index = crossfilter_index(n, n);\n\n // Merge the old and new sorted values, and old and new index.\n for (i = 0; i0 < n0 && i1 < n1; ++i) {\n if (oldValues[i0] < newValues[i1]) {\n values[i] = oldValues[i0];\n index[i] = oldIndex[i0++];\n } else {\n values[i] = newValues[i1];\n index[i] = newIndex[i1++] + n0;\n }\n }\n\n // Add any remaining old values.\n for (; i0 < n0; ++i0, ++i) {\n values[i] = oldValues[i0];\n index[i] = oldIndex[i0];\n }\n\n // Add any remaining new values.\n for (; i1 < n1; ++i1, ++i) {\n values[i] = newValues[i1];\n index[i] = newIndex[i1] + n0;\n }\n\n // Bisect again to recompute lo0 and hi0.\n bounds = refilter(values), lo0 = bounds[0], hi0 = bounds[1];\n }\n\n // When all filters have updated, notify index listeners of the new values.\n function postAdd(newData, n0, n1) {\n indexListeners.forEach(function (l) {\n l(newValues, newIndex, n0, n1);\n });\n newValues = newIndex = null;\n }\n\n function removeData(reIndex) {\n for (var i = 0, j = 0, k; i < n; ++i) {\n if (filters[k = index[i]]) {\n if (i !== j) values[j] = values[i];\n index[j] = reIndex[k];\n ++j;\n }\n }\n values.length = j;\n while (j < n) {\n index[j++] = 0;\n } // Bisect again to recompute lo0 and hi0.\n var bounds = refilter(values);\n lo0 = bounds[0], hi0 = bounds[1];\n }\n\n // Updates the selected values based on the specified bounds [lo, hi].\n // This implementation is used by all the public filter methods.\n function filterIndexBounds(bounds) {\n var lo1 = bounds[0],\n hi1 = bounds[1];\n\n if (refilterFunction) {\n refilterFunction = null;\n filterIndexFunction(function (d, i) {\n return lo1 <= i && i < hi1;\n });\n lo0 = lo1;\n hi0 = hi1;\n return dimension;\n }\n\n var i,\n j,\n k,\n added = [],\n removed = [];\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n filters[k = index[i]] ^= one;\n added.push(k);\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n filters[k = index[i]] ^= one;\n removed.push(k);\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n filters[k = index[i]] ^= one;\n added.push(k);\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n filters[k = index[i]] ^= one;\n removed.push(k);\n }\n }\n\n lo0 = lo1;\n hi0 = hi1;\n filterListeners.forEach(function (l) {\n l(one, added, removed);\n });\n return dimension;\n }\n\n // Filters this dimension using the specified range, value, or null.\n // If the range is null, this is equivalent to filterAll.\n // If the range is an array, this is equivalent to filterRange.\n // Otherwise, this is equivalent to filterExact.\n function filter(range) {\n return range == null ? filterAll() : Array.isArray(range) ? filterRange(range) : typeof range === \"function\" ? filterFunction(range) : filterExact(range);\n }\n\n // Filters this dimension to select the exact value.\n function filterExact(value) {\n return filterIndexBounds((refilter = crossfilter_filterExact(bisect, value))(values));\n }\n\n // Filters this dimension to select the specified range [lo, hi].\n // The lower bound is inclusive, and the upper bound is exclusive.\n function filterRange(range) {\n return filterIndexBounds((refilter = crossfilter_filterRange(bisect, range))(values));\n }\n\n // Clears any filters on this dimension.\n function filterAll() {\n return filterIndexBounds((refilter = crossfilter_filterAll)(values));\n }\n\n // Filters this dimension using an arbitrary function.\n function filterFunction(f) {\n refilter = crossfilter_filterAll;\n\n filterIndexFunction(refilterFunction = f);\n\n lo0 = 0;\n hi0 = n;\n\n return dimension;\n }\n\n function filterIndexFunction(f) {\n var i,\n k,\n x,\n added = [],\n removed = [];\n\n for (i = 0; i < n; ++i) {\n if (!(filters[k = index[i]] & one) ^ !!(x = f(values[i], i))) {\n if (x) filters[k] &= zero, added.push(k);else filters[k] |= one, removed.push(k);\n }\n }\n filterListeners.forEach(function (l) {\n l(one, added, removed);\n });\n }\n\n // Returns the top K selected records based on this dimension's order.\n // Note: observes this dimension's filter, unlike group and groupAll.\n function top(k) {\n var array = [],\n i = hi0,\n j;\n\n while (--i >= lo0 && k > 0) {\n if (!filters[j = index[i]]) {\n array.push(data[j]);\n --k;\n }\n }\n\n return array;\n }\n\n // Returns the bottom K selected records based on this dimension's order.\n // Note: observes this dimension's filter, unlike group and groupAll.\n function bottom(k) {\n var array = [],\n i = lo0,\n j;\n\n while (i < hi0 && k > 0) {\n if (!filters[j = index[i]]) {\n array.push(data[j]);\n --k;\n }\n i++;\n }\n\n return array;\n }\n\n // Adds a new group to this dimension, using the specified key function.\n function group(key) {\n var group = {\n top: top,\n all: all,\n reduce: reduce,\n reduceCount: reduceCount,\n reduceSum: reduceSum,\n order: order,\n orderNatural: orderNatural,\n size: size,\n dispose: dispose,\n remove: dispose // for backwards-compatibility\n };\n\n // Ensure that this group will be removed when the dimension is removed.\n dimensionGroups.push(group);\n\n var groups,\n // array of {key, value}\n groupIndex,\n // object id ↦ group id\n groupWidth = 8,\n groupCapacity = crossfilter_capacity(groupWidth),\n k = 0,\n // cardinality\n select,\n heap,\n reduceAdd,\n reduceRemove,\n reduceInitial,\n update = crossfilter_null,\n reset = crossfilter_null,\n resetNeeded = true,\n groupAll = key === crossfilter_null;\n\n if (arguments.length < 1) key = crossfilter_identity;\n\n // The group listens to the crossfilter for when any dimension changes, so\n // that it can update the associated reduce values. It must also listen to\n // the parent dimension for when data is added, and compute new keys.\n filterListeners.push(update);\n indexListeners.push(add);\n removeDataListeners.push(removeData);\n\n // Incorporate any existing data into the grouping.\n add(values, index, 0, n);\n\n // Incorporates the specified new values into this group.\n // This function is responsible for updating groups and groupIndex.\n function add(newValues, newIndex, n0, n1) {\n var oldGroups = groups,\n reIndex = crossfilter_index(k, groupCapacity),\n add = reduceAdd,\n initial = reduceInitial,\n k0 = k,\n // old cardinality\n i0 = 0,\n // index of old group\n i1 = 0,\n // index of new record\n j,\n // object id\n g0,\n // old group\n x0,\n // old key\n x1,\n // new key\n g,\n // group to add\n x; // key of group to add\n\n // If a reset is needed, we don't need to update the reduce values.\n if (resetNeeded) add = initial = crossfilter_null;\n\n // Reset the new groups (k is a lower bound).\n // Also, make sure that groupIndex exists and is long enough.\n groups = new Array(k), k = 0;\n groupIndex = k0 > 1 ? crossfilter_arrayLengthen(groupIndex, n) : crossfilter_index(n, groupCapacity);\n\n // Get the first old key (x0 of g0), if it exists.\n if (k0) x0 = (g0 = oldGroups[0]).key;\n\n // Find the first new key (x1), skipping NaN keys.\n while (i1 < n1 && !((x1 = key(newValues[i1])) >= x1)) {\n ++i1;\n } // While new keys remain…\n while (i1 < n1) {\n\n // Determine the lesser of the two current keys; new and old.\n // If there are no old keys remaining, then always add the new key.\n if (g0 && x0 <= x1) {\n g = g0, x = x0;\n\n // Record the new index of the old group.\n reIndex[i0] = k;\n\n // Retrieve the next old key.\n if (g0 = oldGroups[++i0]) x0 = g0.key;\n } else {\n g = { key: x1, value: initial() }, x = x1;\n }\n\n // Add the lesser group.\n groups[k] = g;\n\n // Add any selected records belonging to the added group, while\n // advancing the new key and populating the associated group index.\n while (!(x1 > x)) {\n groupIndex[j = newIndex[i1] + n0] = k;\n if (!(filters[j] & zero)) g.value = add(g.value, data[j]);\n if (++i1 >= n1) break;\n x1 = key(newValues[i1]);\n }\n\n groupIncrement();\n }\n\n // Add any remaining old groups that were greater than all new keys.\n // No incremental reduce is needed; these groups have no new records.\n // Also record the new index of the old group.\n while (i0 < k0) {\n groups[reIndex[i0] = k] = oldGroups[i0++];\n groupIncrement();\n }\n\n // If we added any new groups before any old groups,\n // update the group index of all the old records.\n if (k > i0) for (i0 = 0; i0 < n0; ++i0) {\n groupIndex[i0] = reIndex[groupIndex[i0]];\n }\n\n // Modify the update and reset behavior based on the cardinality.\n // If the cardinality is less than or equal to one, then the groupIndex\n // is not needed. If the cardinality is zero, then there are no records\n // and therefore no groups to update or reset. Note that we also must\n // change the registered listener to point to the new method.\n j = filterListeners.indexOf(update);\n if (k > 1) {\n update = updateMany;\n reset = resetMany;\n } else {\n if (!k && groupAll) {\n k = 1;\n groups = [{ key: null, value: initial() }];\n }\n if (k === 1) {\n update = updateOne;\n reset = resetOne;\n } else {\n update = crossfilter_null;\n reset = crossfilter_null;\n }\n groupIndex = null;\n }\n filterListeners[j] = update;\n\n // Count the number of added groups,\n // and widen the group index as needed.\n function groupIncrement() {\n if (++k === groupCapacity) {\n reIndex = crossfilter_arrayWiden(reIndex, groupWidth <<= 1);\n groupIndex = crossfilter_arrayWiden(groupIndex, groupWidth);\n groupCapacity = crossfilter_capacity(groupWidth);\n }\n }\n }\n\n function removeData() {\n if (k > 1) {\n var oldK = k,\n oldGroups = groups,\n seenGroups = crossfilter_index(oldK, oldK);\n\n // Filter out non-matches by copying matching group index entries to\n // the beginning of the array.\n for (var i = 0, j = 0; i < n; ++i) {\n if (filters[i]) {\n seenGroups[groupIndex[j] = groupIndex[i]] = 1;\n ++j;\n }\n }\n\n // Reassemble groups including only those groups that were referred\n // to by matching group index entries. Note the new group index in\n // seenGroups.\n groups = [], k = 0;\n for (i = 0; i < oldK; ++i) {\n if (seenGroups[i]) {\n seenGroups[i] = k++;\n groups.push(oldGroups[i]);\n }\n }\n\n if (k > 1) {\n // Reindex the group index using seenGroups to find the new index.\n for (var i = 0; i < j; ++i) {\n groupIndex[i] = seenGroups[groupIndex[i]];\n }\n } else {\n groupIndex = null;\n }\n filterListeners[filterListeners.indexOf(update)] = k > 1 ? (reset = resetMany, update = updateMany) : k === 1 ? (reset = resetOne, update = updateOne) : reset = update = crossfilter_null;\n } else if (k === 1) {\n if (groupAll) return;\n for (var i = 0; i < n; ++i) {\n if (filters[i]) return;\n }groups = [], k = 0;\n filterListeners[filterListeners.indexOf(update)] = update = reset = crossfilter_null;\n }\n }\n\n // Reduces the specified selected or deselected records.\n // This function is only used when the cardinality is greater than 1.\n function updateMany(filterOne, added, removed) {\n if (filterOne === one || resetNeeded) return;\n\n var i, k, n, g;\n\n // Add the added values.\n for (i = 0, n = added.length; i < n; ++i) {\n if (!(filters[k = added[i]] & zero)) {\n g = groups[groupIndex[k]];\n g.value = reduceAdd(g.value, data[k]);\n }\n }\n\n // Remove the removed values.\n for (i = 0, n = removed.length; i < n; ++i) {\n if ((filters[k = removed[i]] & zero) === filterOne) {\n g = groups[groupIndex[k]];\n g.value = reduceRemove(g.value, data[k]);\n }\n }\n }\n\n // Reduces the specified selected or deselected records.\n // This function is only used when the cardinality is 1.\n function updateOne(filterOne, added, removed) {\n if (filterOne === one || resetNeeded) return;\n\n var i,\n k,\n n,\n g = groups[0];\n\n // Add the added values.\n for (i = 0, n = added.length; i < n; ++i) {\n if (!(filters[k = added[i]] & zero)) {\n g.value = reduceAdd(g.value, data[k]);\n }\n }\n\n // Remove the removed values.\n for (i = 0, n = removed.length; i < n; ++i) {\n if ((filters[k = removed[i]] & zero) === filterOne) {\n g.value = reduceRemove(g.value, data[k]);\n }\n }\n }\n\n // Recomputes the group reduce values from scratch.\n // This function is only used when the cardinality is greater than 1.\n function resetMany() {\n var i, g;\n\n // Reset all group values.\n for (i = 0; i < k; ++i) {\n groups[i].value = reduceInitial();\n }\n\n // Add any selected records.\n for (i = 0; i < n; ++i) {\n if (!(filters[i] & zero)) {\n g = groups[groupIndex[i]];\n g.value = reduceAdd(g.value, data[i]);\n }\n }\n }\n\n // Recomputes the group reduce values from scratch.\n // This function is only used when the cardinality is 1.\n function resetOne() {\n var i,\n g = groups[0];\n\n // Reset the singleton group values.\n g.value = reduceInitial();\n\n // Add any selected records.\n for (i = 0; i < n; ++i) {\n if (!(filters[i] & zero)) {\n g.value = reduceAdd(g.value, data[i]);\n }\n }\n }\n\n // Returns the array of group values, in the dimension's natural order.\n function all() {\n if (resetNeeded) reset(), resetNeeded = false;\n return groups;\n }\n\n // Returns a new array containing the top K group values, in reduce order.\n function top(k) {\n var top = select(all(), 0, groups.length, k);\n return heap.sort(top, 0, top.length);\n }\n\n // Sets the reduce behavior for this group to use the specified functions.\n // This method lazily recomputes the reduce values, waiting until needed.\n function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }\n\n // A convenience method for reducing by count.\n function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }\n\n // A convenience method for reducing by sum(value).\n function reduceSum(value) {\n return reduce(crossfilter_reduceAdd(value), crossfilter_reduceSubtract(value), crossfilter_zero);\n }\n\n // Sets the reduce order, using the specified accessor.\n function order(value) {\n select = heapselect_by(valueOf);\n heap = heap_by(valueOf);\n function valueOf(d) {\n return value(d.value);\n }\n return group;\n }\n\n // A convenience method for natural ordering by reduce value.\n function orderNatural() {\n return order(crossfilter_identity);\n }\n\n // Returns the cardinality of this group, irrespective of any filters.\n function size() {\n return k;\n }\n\n // Removes this group and associated event listeners.\n function dispose() {\n var i = filterListeners.indexOf(update);\n if (i >= 0) filterListeners.splice(i, 1);\n i = indexListeners.indexOf(add);\n if (i >= 0) indexListeners.splice(i, 1);\n i = removeDataListeners.indexOf(removeData);\n if (i >= 0) removeDataListeners.splice(i, 1);\n return group;\n }\n\n return reduceCount().orderNatural();\n }\n\n // A convenience function for generating a singleton group.\n function groupAll() {\n var g = group(crossfilter_null),\n all = g.all;\n delete g.all;\n delete g.top;\n delete g.order;\n delete g.orderNatural;\n delete g.size;\n g.value = function () {\n return all()[0].value;\n };\n return g;\n }\n\n // Removes this dimension and associated groups and event listeners.\n function dispose() {\n dimensionGroups.forEach(function (group) {\n group.dispose();\n });\n var i = dataListeners.indexOf(preAdd);\n if (i >= 0) dataListeners.splice(i, 1);\n i = dataListeners.indexOf(postAdd);\n if (i >= 0) dataListeners.splice(i, 1);\n i = removeDataListeners.indexOf(removeData);\n if (i >= 0) removeDataListeners.splice(i, 1);\n m &= zero;\n return filterAll();\n }\n\n return dimension;\n }", "title": "" }, { "docid": "998bb47d7ae38b3a320b0daace9e7c86", "score": "0.54018956", "text": "function dimension(value) {\n var dimension = {\n filter: filter,\n filterExact: filterExact,\n filterRange: filterRange,\n filterFunction: filterFunction,\n filterAll: filterAll,\n top: top,\n bottom: bottom,\n group: group,\n groupAll: groupAll,\n dispose: dispose,\n remove: dispose // for backwards-compatibility\n };\n\n var one = ~m & -~m,\n // lowest unset bit as mask, e.g., 00001000\n zero = ~one,\n // inverted one, e.g., 11110111\n values,\n // sorted, cached array\n index,\n // value rank ↦ object id\n newValues,\n // temporary array storing newly-added values\n newIndex,\n // temporary array storing newly-added index\n sort = quicksort_by(function (i) {\n return newValues[i];\n }),\n refilter = crossfilter_filterAll,\n // for recomputing filter\n refilterFunction,\n // the custom filter function in use\n indexListeners = [],\n // when data is added\n dimensionGroups = [],\n lo0 = 0,\n hi0 = 0;\n\n // Updating a dimension is a two-stage process. First, we must update the\n // associated filters for the newly-added records. Once all dimensions have\n // updated their filters, the groups are notified to update.\n dataListeners.unshift(preAdd);\n dataListeners.push(postAdd);\n\n removeDataListeners.push(removeData);\n\n // Incorporate any existing data into this dimension, and make sure that the\n // filter bitset is wide enough to handle the new dimension.\n m |= one;\n if (M >= 32 ? !one : m & -(1 << M)) {\n filters = crossfilter_arrayWiden(filters, M <<= 1);\n }\n preAdd(data, 0, n);\n postAdd(data, 0, n);\n\n // Incorporates the specified new records into this dimension.\n // This function is responsible for updating filters, values, and index.\n function preAdd(newData, n0, n1) {\n\n // Permute new values into natural order using a sorted index.\n newValues = newData.map(value);\n newIndex = sort(crossfilter_range(n1), 0, n1);\n newValues = permute(newValues, newIndex);\n\n // Bisect newValues to determine which new records are selected.\n var bounds = refilter(newValues),\n lo1 = bounds[0],\n hi1 = bounds[1],\n i;\n if (refilterFunction) {\n for (i = 0; i < n1; ++i) {\n if (!refilterFunction(newValues[i], i)) filters[newIndex[i] + n0] |= one;\n }\n } else {\n for (i = 0; i < lo1; ++i) {\n filters[newIndex[i] + n0] |= one;\n }for (i = hi1; i < n1; ++i) {\n filters[newIndex[i] + n0] |= one;\n }\n }\n\n // If this dimension previously had no data, then we don't need to do the\n // more expensive merge operation; use the new values and index as-is.\n if (!n0) {\n values = newValues;\n index = newIndex;\n lo0 = lo1;\n hi0 = hi1;\n return;\n }\n\n var oldValues = values,\n oldIndex = index,\n i0 = 0,\n i1 = 0;\n\n // Otherwise, create new arrays into which to merge new and old.\n values = new Array(n);\n index = crossfilter_index(n, n);\n\n // Merge the old and new sorted values, and old and new index.\n for (i = 0; i0 < n0 && i1 < n1; ++i) {\n if (oldValues[i0] < newValues[i1]) {\n values[i] = oldValues[i0];\n index[i] = oldIndex[i0++];\n } else {\n values[i] = newValues[i1];\n index[i] = newIndex[i1++] + n0;\n }\n }\n\n // Add any remaining old values.\n for (; i0 < n0; ++i0, ++i) {\n values[i] = oldValues[i0];\n index[i] = oldIndex[i0];\n }\n\n // Add any remaining new values.\n for (; i1 < n1; ++i1, ++i) {\n values[i] = newValues[i1];\n index[i] = newIndex[i1] + n0;\n }\n\n // Bisect again to recompute lo0 and hi0.\n bounds = refilter(values), lo0 = bounds[0], hi0 = bounds[1];\n }\n\n // When all filters have updated, notify index listeners of the new values.\n function postAdd(newData, n0, n1) {\n indexListeners.forEach(function (l) {\n l(newValues, newIndex, n0, n1);\n });\n newValues = newIndex = null;\n }\n\n function removeData(reIndex) {\n for (var i = 0, j = 0, k; i < n; ++i) {\n if (filters[k = index[i]]) {\n if (i !== j) values[j] = values[i];\n index[j] = reIndex[k];\n ++j;\n }\n }\n values.length = j;\n while (j < n) {\n index[j++] = 0;\n } // Bisect again to recompute lo0 and hi0.\n var bounds = refilter(values);\n lo0 = bounds[0], hi0 = bounds[1];\n }\n\n // Updates the selected values based on the specified bounds [lo, hi].\n // This implementation is used by all the public filter methods.\n function filterIndexBounds(bounds) {\n var lo1 = bounds[0],\n hi1 = bounds[1];\n\n if (refilterFunction) {\n refilterFunction = null;\n filterIndexFunction(function (d, i) {\n return lo1 <= i && i < hi1;\n });\n lo0 = lo1;\n hi0 = hi1;\n return dimension;\n }\n\n var i,\n j,\n k,\n added = [],\n removed = [];\n\n // Fast incremental update based on previous lo index.\n if (lo1 < lo0) {\n for (i = lo1, j = Math.min(lo0, hi1); i < j; ++i) {\n filters[k = index[i]] ^= one;\n added.push(k);\n }\n } else if (lo1 > lo0) {\n for (i = lo0, j = Math.min(lo1, hi0); i < j; ++i) {\n filters[k = index[i]] ^= one;\n removed.push(k);\n }\n }\n\n // Fast incremental update based on previous hi index.\n if (hi1 > hi0) {\n for (i = Math.max(lo1, hi0), j = hi1; i < j; ++i) {\n filters[k = index[i]] ^= one;\n added.push(k);\n }\n } else if (hi1 < hi0) {\n for (i = Math.max(lo0, hi1), j = hi0; i < j; ++i) {\n filters[k = index[i]] ^= one;\n removed.push(k);\n }\n }\n\n lo0 = lo1;\n hi0 = hi1;\n filterListeners.forEach(function (l) {\n l(one, added, removed);\n });\n return dimension;\n }\n\n // Filters this dimension using the specified range, value, or null.\n // If the range is null, this is equivalent to filterAll.\n // If the range is an array, this is equivalent to filterRange.\n // Otherwise, this is equivalent to filterExact.\n function filter(range) {\n return range == null ? filterAll() : Array.isArray(range) ? filterRange(range) : typeof range === \"function\" ? filterFunction(range) : filterExact(range);\n }\n\n // Filters this dimension to select the exact value.\n function filterExact(value) {\n return filterIndexBounds((refilter = crossfilter_filterExact(bisect, value))(values));\n }\n\n // Filters this dimension to select the specified range [lo, hi].\n // The lower bound is inclusive, and the upper bound is exclusive.\n function filterRange(range) {\n return filterIndexBounds((refilter = crossfilter_filterRange(bisect, range))(values));\n }\n\n // Clears any filters on this dimension.\n function filterAll() {\n return filterIndexBounds((refilter = crossfilter_filterAll)(values));\n }\n\n // Filters this dimension using an arbitrary function.\n function filterFunction(f) {\n refilter = crossfilter_filterAll;\n\n filterIndexFunction(refilterFunction = f);\n\n lo0 = 0;\n hi0 = n;\n\n return dimension;\n }\n\n function filterIndexFunction(f) {\n var i,\n k,\n x,\n added = [],\n removed = [];\n\n for (i = 0; i < n; ++i) {\n if (!(filters[k = index[i]] & one) ^ !!(x = f(values[i], i))) {\n if (x) filters[k] &= zero, added.push(k);else filters[k] |= one, removed.push(k);\n }\n }\n filterListeners.forEach(function (l) {\n l(one, added, removed);\n });\n }\n\n // Returns the top K selected records based on this dimension's order.\n // Note: observes this dimension's filter, unlike group and groupAll.\n function top(k) {\n var array = [],\n i = hi0,\n j;\n\n while (--i >= lo0 && k > 0) {\n if (!filters[j = index[i]]) {\n array.push(data[j]);\n --k;\n }\n }\n\n return array;\n }\n\n // Returns the bottom K selected records based on this dimension's order.\n // Note: observes this dimension's filter, unlike group and groupAll.\n function bottom(k) {\n var array = [],\n i = lo0,\n j;\n\n while (i < hi0 && k > 0) {\n if (!filters[j = index[i]]) {\n array.push(data[j]);\n --k;\n }\n i++;\n }\n\n return array;\n }\n\n // Adds a new group to this dimension, using the specified key function.\n function group(key) {\n var group = {\n top: top,\n all: all,\n reduce: reduce,\n reduceCount: reduceCount,\n reduceSum: reduceSum,\n order: order,\n orderNatural: orderNatural,\n size: size,\n dispose: dispose,\n remove: dispose // for backwards-compatibility\n };\n\n // Ensure that this group will be removed when the dimension is removed.\n dimensionGroups.push(group);\n\n var groups,\n // array of {key, value}\n groupIndex,\n // object id ↦ group id\n groupWidth = 8,\n groupCapacity = crossfilter_capacity(groupWidth),\n k = 0,\n // cardinality\n select,\n heap,\n reduceAdd,\n reduceRemove,\n reduceInitial,\n update = crossfilter_null,\n reset = crossfilter_null,\n resetNeeded = true,\n groupAll = key === crossfilter_null;\n\n if (arguments.length < 1) key = crossfilter_identity;\n\n // The group listens to the crossfilter for when any dimension changes, so\n // that it can update the associated reduce values. It must also listen to\n // the parent dimension for when data is added, and compute new keys.\n filterListeners.push(update);\n indexListeners.push(add);\n removeDataListeners.push(removeData);\n\n // Incorporate any existing data into the grouping.\n add(values, index, 0, n);\n\n // Incorporates the specified new values into this group.\n // This function is responsible for updating groups and groupIndex.\n function add(newValues, newIndex, n0, n1) {\n var oldGroups = groups,\n reIndex = crossfilter_index(k, groupCapacity),\n add = reduceAdd,\n initial = reduceInitial,\n k0 = k,\n // old cardinality\n i0 = 0,\n // index of old group\n i1 = 0,\n // index of new record\n j,\n // object id\n g0,\n // old group\n x0,\n // old key\n x1,\n // new key\n g,\n // group to add\n x; // key of group to add\n\n // If a reset is needed, we don't need to update the reduce values.\n if (resetNeeded) add = initial = crossfilter_null;\n\n // Reset the new groups (k is a lower bound).\n // Also, make sure that groupIndex exists and is long enough.\n groups = new Array(k), k = 0;\n groupIndex = k0 > 1 ? crossfilter_arrayLengthen(groupIndex, n) : crossfilter_index(n, groupCapacity);\n\n // Get the first old key (x0 of g0), if it exists.\n if (k0) x0 = (g0 = oldGroups[0]).key;\n\n // Find the first new key (x1), skipping NaN keys.\n while (i1 < n1 && !((x1 = key(newValues[i1])) >= x1)) {\n ++i1;\n } // While new keys remain…\n while (i1 < n1) {\n\n // Determine the lesser of the two current keys; new and old.\n // If there are no old keys remaining, then always add the new key.\n if (g0 && x0 <= x1) {\n g = g0, x = x0;\n\n // Record the new index of the old group.\n reIndex[i0] = k;\n\n // Retrieve the next old key.\n if (g0 = oldGroups[++i0]) x0 = g0.key;\n } else {\n g = { key: x1, value: initial() }, x = x1;\n }\n\n // Add the lesser group.\n groups[k] = g;\n\n // Add any selected records belonging to the added group, while\n // advancing the new key and populating the associated group index.\n while (!(x1 > x)) {\n groupIndex[j = newIndex[i1] + n0] = k;\n if (!(filters[j] & zero)) g.value = add(g.value, data[j]);\n if (++i1 >= n1) break;\n x1 = key(newValues[i1]);\n }\n\n groupIncrement();\n }\n\n // Add any remaining old groups that were greater than all new keys.\n // No incremental reduce is needed; these groups have no new records.\n // Also record the new index of the old group.\n while (i0 < k0) {\n groups[reIndex[i0] = k] = oldGroups[i0++];\n groupIncrement();\n }\n\n // If we added any new groups before any old groups,\n // update the group index of all the old records.\n if (k > i0) for (i0 = 0; i0 < n0; ++i0) {\n groupIndex[i0] = reIndex[groupIndex[i0]];\n }\n\n // Modify the update and reset behavior based on the cardinality.\n // If the cardinality is less than or equal to one, then the groupIndex\n // is not needed. If the cardinality is zero, then there are no records\n // and therefore no groups to update or reset. Note that we also must\n // change the registered listener to point to the new method.\n j = filterListeners.indexOf(update);\n if (k > 1) {\n update = updateMany;\n reset = resetMany;\n } else {\n if (!k && groupAll) {\n k = 1;\n groups = [{ key: null, value: initial() }];\n }\n if (k === 1) {\n update = updateOne;\n reset = resetOne;\n } else {\n update = crossfilter_null;\n reset = crossfilter_null;\n }\n groupIndex = null;\n }\n filterListeners[j] = update;\n\n // Count the number of added groups,\n // and widen the group index as needed.\n function groupIncrement() {\n if (++k === groupCapacity) {\n reIndex = crossfilter_arrayWiden(reIndex, groupWidth <<= 1);\n groupIndex = crossfilter_arrayWiden(groupIndex, groupWidth);\n groupCapacity = crossfilter_capacity(groupWidth);\n }\n }\n }\n\n function removeData() {\n if (k > 1) {\n var oldK = k,\n oldGroups = groups,\n seenGroups = crossfilter_index(oldK, oldK);\n\n // Filter out non-matches by copying matching group index entries to\n // the beginning of the array.\n for (var i = 0, j = 0; i < n; ++i) {\n if (filters[i]) {\n seenGroups[groupIndex[j] = groupIndex[i]] = 1;\n ++j;\n }\n }\n\n // Reassemble groups including only those groups that were referred\n // to by matching group index entries. Note the new group index in\n // seenGroups.\n groups = [], k = 0;\n for (i = 0; i < oldK; ++i) {\n if (seenGroups[i]) {\n seenGroups[i] = k++;\n groups.push(oldGroups[i]);\n }\n }\n\n if (k > 1) {\n // Reindex the group index using seenGroups to find the new index.\n for (var i = 0; i < j; ++i) {\n groupIndex[i] = seenGroups[groupIndex[i]];\n }\n } else {\n groupIndex = null;\n }\n filterListeners[filterListeners.indexOf(update)] = k > 1 ? (reset = resetMany, update = updateMany) : k === 1 ? (reset = resetOne, update = updateOne) : reset = update = crossfilter_null;\n } else if (k === 1) {\n if (groupAll) return;\n for (var i = 0; i < n; ++i) {\n if (filters[i]) return;\n }groups = [], k = 0;\n filterListeners[filterListeners.indexOf(update)] = update = reset = crossfilter_null;\n }\n }\n\n // Reduces the specified selected or deselected records.\n // This function is only used when the cardinality is greater than 1.\n function updateMany(filterOne, added, removed) {\n if (filterOne === one || resetNeeded) return;\n\n var i, k, n, g;\n\n // Add the added values.\n for (i = 0, n = added.length; i < n; ++i) {\n if (!(filters[k = added[i]] & zero)) {\n g = groups[groupIndex[k]];\n g.value = reduceAdd(g.value, data[k]);\n }\n }\n\n // Remove the removed values.\n for (i = 0, n = removed.length; i < n; ++i) {\n if ((filters[k = removed[i]] & zero) === filterOne) {\n g = groups[groupIndex[k]];\n g.value = reduceRemove(g.value, data[k]);\n }\n }\n }\n\n // Reduces the specified selected or deselected records.\n // This function is only used when the cardinality is 1.\n function updateOne(filterOne, added, removed) {\n if (filterOne === one || resetNeeded) return;\n\n var i,\n k,\n n,\n g = groups[0];\n\n // Add the added values.\n for (i = 0, n = added.length; i < n; ++i) {\n if (!(filters[k = added[i]] & zero)) {\n g.value = reduceAdd(g.value, data[k]);\n }\n }\n\n // Remove the removed values.\n for (i = 0, n = removed.length; i < n; ++i) {\n if ((filters[k = removed[i]] & zero) === filterOne) {\n g.value = reduceRemove(g.value, data[k]);\n }\n }\n }\n\n // Recomputes the group reduce values from scratch.\n // This function is only used when the cardinality is greater than 1.\n function resetMany() {\n var i, g;\n\n // Reset all group values.\n for (i = 0; i < k; ++i) {\n groups[i].value = reduceInitial();\n }\n\n // Add any selected records.\n for (i = 0; i < n; ++i) {\n if (!(filters[i] & zero)) {\n g = groups[groupIndex[i]];\n g.value = reduceAdd(g.value, data[i]);\n }\n }\n }\n\n // Recomputes the group reduce values from scratch.\n // This function is only used when the cardinality is 1.\n function resetOne() {\n var i,\n g = groups[0];\n\n // Reset the singleton group values.\n g.value = reduceInitial();\n\n // Add any selected records.\n for (i = 0; i < n; ++i) {\n if (!(filters[i] & zero)) {\n g.value = reduceAdd(g.value, data[i]);\n }\n }\n }\n\n // Returns the array of group values, in the dimension's natural order.\n function all() {\n if (resetNeeded) reset(), resetNeeded = false;\n return groups;\n }\n\n // Returns a new array containing the top K group values, in reduce order.\n function top(k) {\n var top = select(all(), 0, groups.length, k);\n return heap.sort(top, 0, top.length);\n }\n\n // Sets the reduce behavior for this group to use the specified functions.\n // This method lazily recomputes the reduce values, waiting until needed.\n function reduce(add, remove, initial) {\n reduceAdd = add;\n reduceRemove = remove;\n reduceInitial = initial;\n resetNeeded = true;\n return group;\n }\n\n // A convenience method for reducing by count.\n function reduceCount() {\n return reduce(crossfilter_reduceIncrement, crossfilter_reduceDecrement, crossfilter_zero);\n }\n\n // A convenience method for reducing by sum(value).\n function reduceSum(value) {\n return reduce(crossfilter_reduceAdd(value), crossfilter_reduceSubtract(value), crossfilter_zero);\n }\n\n // Sets the reduce order, using the specified accessor.\n function order(value) {\n select = heapselect_by(valueOf);\n heap = heap_by(valueOf);\n function valueOf(d) {\n return value(d.value);\n }\n return group;\n }\n\n // A convenience method for natural ordering by reduce value.\n function orderNatural() {\n return order(crossfilter_identity);\n }\n\n // Returns the cardinality of this group, irrespective of any filters.\n function size() {\n return k;\n }\n\n // Removes this group and associated event listeners.\n function dispose() {\n var i = filterListeners.indexOf(update);\n if (i >= 0) filterListeners.splice(i, 1);\n i = indexListeners.indexOf(add);\n if (i >= 0) indexListeners.splice(i, 1);\n i = removeDataListeners.indexOf(removeData);\n if (i >= 0) removeDataListeners.splice(i, 1);\n return group;\n }\n\n return reduceCount().orderNatural();\n }\n\n // A convenience function for generating a singleton group.\n function groupAll() {\n var g = group(crossfilter_null),\n all = g.all;\n delete g.all;\n delete g.top;\n delete g.order;\n delete g.orderNatural;\n delete g.size;\n g.value = function () {\n return all()[0].value;\n };\n return g;\n }\n\n // Removes this dimension and associated groups and event listeners.\n function dispose() {\n dimensionGroups.forEach(function (group) {\n group.dispose();\n });\n var i = dataListeners.indexOf(preAdd);\n if (i >= 0) dataListeners.splice(i, 1);\n i = dataListeners.indexOf(postAdd);\n if (i >= 0) dataListeners.splice(i, 1);\n i = removeDataListeners.indexOf(removeData);\n if (i >= 0) removeDataListeners.splice(i, 1);\n m &= zero;\n return filterAll();\n }\n\n return dimension;\n }", "title": "" }, { "docid": "f146b92d76107d4ab902c0bc302f7ca7", "score": "0.54009104", "text": "getHeight() {\n return data.height * data.zoom;\n }", "title": "" }, { "docid": "cead9e1e7f31dd66c3101c995a5f17cd", "score": "0.53967625", "text": "getScale() {\n return this.scale;\n }", "title": "" }, { "docid": "5d6902b79609a3131ed6dd8955577904", "score": "0.5389318", "text": "getValue () {\n if (this.param && this._axesSubset.t.coord !== undefined) {\n let val = this.range.get({t: this._axesSubset.t.idx})\n return val\n } \n }", "title": "" }, { "docid": "0034a83e66613cff5d58af355273e146", "score": "0.538505", "text": "_getDimensions() {\n this.cfg.width = parseInt(this.selection.node().offsetWidth);\n this.cfg.height = parseInt(this.selection.node().offsetHeight);\n this.element.parentElement.parentElement.style.zIndex = '999';\n }", "title": "" }, { "docid": "2ab0e651706e165471557cde57da6c94", "score": "0.53819114", "text": "getSize(scale) {\n return {\n s: 32,\n m: 56,\n l: 80\n }[scale];\n }", "title": "" }, { "docid": "252a1ed5a05d575d55714327be302ef4", "score": "0.53768325", "text": "function getXXDimension (idSchema, idCube, type) {\n if (!isAllowedDimensionType(type))\n throw new Query.IllegalDimensionTypeError();\n\n // Retrieve all dimensions to get it in cache\n Query.getDimensions(idSchema, idCube);\n // Get from cache to have all dimensions, with the Measure one\n var dimensions = Query.cache.getDimensionsFromCache(idSchema, idCube);\n for (var key in dimensions) {\n if (dimensions[key].type == type)\n return key;\n }\n throw \"There's no dimension of type \"+type+\" in cube \"+idCube+\" of schema \"+idSchema;\n }", "title": "" }, { "docid": "cd9d601335239ff658e6a319d14e6c2c", "score": "0.53764206", "text": "get width() { return this.bound.width; }", "title": "" }, { "docid": "013d9d1db731fc8f9348cda0ab5512af", "score": "0.53727955", "text": "function eval_selSize() {\n\tvar sel = app.activeDocument.selection;\n\tvar selCount = sel.length;\n\tif (selCount === 0) {\n\t\talert('Please select the die line to record the dimensions.');\n\t\treturn JSON.stringify(['error', 'no selection'])\n\t}\n\tvar i, thisObjGB;\n\tvar left = sel[0].geometricBounds[0],\n\t\t\ttop = sel[0].geometricBounds[1],\n\t\t\tright = sel[0].geometricBounds[2],\n\t\t\tbottom = sel[0].geometricBounds[3];\n\tfor (i = 1; i < selCount; i++) {\n\t\tthisObjGB = sel[i].geometricBounds;\n\t\tif (thisObjGB[0] < left) {left = thisObjGB[0]}\n\t\tif (thisObjGB[1] > top) {top = thisObjGB[1]}\n\t\tif (thisObjGB[2] > right) {right = thisObjGB[2]}\n\t\tif (thisObjGB[3] < bottom) {bottom = thisObjGB[3]}\n\t}\n\t\n\treturn JSON.stringify([Math.abs(right - left), Math.abs(top - bottom)]);\n}", "title": "" }, { "docid": "eaf6994262536896d0818dfb3587bb39", "score": "0.5371939", "text": "function getGridSize(id) {\n return grid_result[id];\n}", "title": "" } ]
57eb3ca10ad0abfb5d5c685ac3353f2e
changes results to series only
[ { "docid": "4054da84350e08f355706883f3dd9965", "score": "0.0", "text": "function changeToSeries(){\r\n searchType = \"series\";\r\n // console.log(\"Series\");\r\n document.getElementById('seriesContainer').style.backgroundColor = \"#ed5f25\";\r\n document.getElementById('movieContainer').style.backgroundColor = \"transparent\";\r\n // document.getElementById('searchInput').style.placeholder = \"Search Series\";\r\n document.getElementById('mainBody').style.paddingTop = \"170px\";\r\n $(\"#message\").html(\"\");\r\n goHomeSeries();\r\n}", "title": "" } ]
[ { "docid": "a6105b33b9c50b9ffbf740436ba0baf7", "score": "0.65650797", "text": "_getData(complete){return{series:complete}}", "title": "" }, { "docid": "c9bfddf50caa8440b6fcdeafb0ed8e4e", "score": "0.6528709", "text": "function convertTimeSeries(series) {\n\tfor (var i = 0; i < series.length; ++i) {\n series[i][0] *= 1000;\n\t}\n return series;\n}", "title": "" }, { "docid": "31a556577f7d17d9ddb2a7490b3fa588", "score": "0.625742", "text": "function getSeries(){\n\t\t\t\t\t\treturn series;\n\t\t\t\t\t}", "title": "" }, { "docid": "d86b49d3448c94488140d38f1886fddd", "score": "0.6173366", "text": "calculateVisibleSeries() {\n this.visibleSeries = [];\n for (let i = 0, length = this.series.length; i < length; i++) {\n this.series[i].index = i;\n if (this.series[i].type === this.type && this.visibleSeries.length === 0) {\n this.visibleSeries.push(this.series[i]);\n break;\n }\n }\n }", "title": "" }, { "docid": "e63929e0292cc65108c08d84b4abade5", "score": "0.6143669", "text": "function extractSeries(queryResult) {\n return queryResult ? queryResult.series() : undefined;\n}", "title": "" }, { "docid": "ef13833ade786bf534d94b3d8aeeebaa", "score": "0.6046115", "text": "refreshSeries() {\n for (const series of this.visibleSeries) {\n this.refreshPoints(series.points);\n }\n }", "title": "" }, { "docid": "edfd30597c419c79f60024526f82c29e", "score": "0.60161275", "text": "function prepareSeries(data){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n series.color = index;\n });\n}", "title": "" }, { "docid": "edfd30597c419c79f60024526f82c29e", "score": "0.60161275", "text": "function prepareSeries(data){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n series.color = index;\n });\n}", "title": "" }, { "docid": "11fbca71cc2ea384be03b27e75c47492", "score": "0.5879994", "text": "function onAxisPostProcessData() {\n const series = this.series;\n series.forEach((series) => {\n if (series.is('heikinashi')) {\n const heikinashiSeries = series;\n heikinashiSeries.heikiashiData.length = 0;\n heikinashiSeries.getHeikinashiData();\n }\n });\n }", "title": "" }, { "docid": "09fb0250d66325739271e1e76ae44ba9", "score": "0.5863024", "text": "function getAllSerie(){\n var respuesta=apiServicio.getAllSerie($scope.filtro);\n respuesta.then(\n function successCallback(response) { \n $scope.visualizar2=true;\n $scope.series =response.data.results; \n }, \n function errorCallback(reason) {\n $scope.series = [];\n $scope.visualizar2=false;\n }\n );\n }", "title": "" }, { "docid": "72d443481492633ade6219e9fe1389cc", "score": "0.5840685", "text": "function prepareSeries(data, noMatchColor){\r\n var result = data.result;\r\n\r\n // Keep only series when needed\r\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\r\n // Insensitive case matching\r\n var regexp = new RegExp(seriesFilter, 'i');\r\n result.series = $.grep(result.series, function(series, index){\r\n return regexp.test(series.label);\r\n });\r\n }\r\n\r\n // Keep only controllers series when supported and needed\r\n if(result.supportsControllersDiscrimination && showControllersOnly){\r\n result.series = $.grep(result.series, function(series, index){\r\n return series.isController;\r\n });\r\n }\r\n\r\n // Sort data and mark series\r\n $.each(result.series, function(index, series) {\r\n series.data.sort(compareByXCoordinate);\r\n if(!(noMatchColor && noMatchColor===true)) {\r\n\t series.color = index;\r\n\t }\r\n });\r\n}", "title": "" }, { "docid": "72d443481492633ade6219e9fe1389cc", "score": "0.5840685", "text": "function prepareSeries(data, noMatchColor){\r\n var result = data.result;\r\n\r\n // Keep only series when needed\r\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\r\n // Insensitive case matching\r\n var regexp = new RegExp(seriesFilter, 'i');\r\n result.series = $.grep(result.series, function(series, index){\r\n return regexp.test(series.label);\r\n });\r\n }\r\n\r\n // Keep only controllers series when supported and needed\r\n if(result.supportsControllersDiscrimination && showControllersOnly){\r\n result.series = $.grep(result.series, function(series, index){\r\n return series.isController;\r\n });\r\n }\r\n\r\n // Sort data and mark series\r\n $.each(result.series, function(index, series) {\r\n series.data.sort(compareByXCoordinate);\r\n if(!(noMatchColor && noMatchColor===true)) {\r\n\t series.color = index;\r\n\t }\r\n });\r\n}", "title": "" }, { "docid": "72d443481492633ade6219e9fe1389cc", "score": "0.5840685", "text": "function prepareSeries(data, noMatchColor){\r\n var result = data.result;\r\n\r\n // Keep only series when needed\r\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\r\n // Insensitive case matching\r\n var regexp = new RegExp(seriesFilter, 'i');\r\n result.series = $.grep(result.series, function(series, index){\r\n return regexp.test(series.label);\r\n });\r\n }\r\n\r\n // Keep only controllers series when supported and needed\r\n if(result.supportsControllersDiscrimination && showControllersOnly){\r\n result.series = $.grep(result.series, function(series, index){\r\n return series.isController;\r\n });\r\n }\r\n\r\n // Sort data and mark series\r\n $.each(result.series, function(index, series) {\r\n series.data.sort(compareByXCoordinate);\r\n if(!(noMatchColor && noMatchColor===true)) {\r\n\t series.color = index;\r\n\t }\r\n });\r\n}", "title": "" }, { "docid": "72d443481492633ade6219e9fe1389cc", "score": "0.5840685", "text": "function prepareSeries(data, noMatchColor){\r\n var result = data.result;\r\n\r\n // Keep only series when needed\r\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\r\n // Insensitive case matching\r\n var regexp = new RegExp(seriesFilter, 'i');\r\n result.series = $.grep(result.series, function(series, index){\r\n return regexp.test(series.label);\r\n });\r\n }\r\n\r\n // Keep only controllers series when supported and needed\r\n if(result.supportsControllersDiscrimination && showControllersOnly){\r\n result.series = $.grep(result.series, function(series, index){\r\n return series.isController;\r\n });\r\n }\r\n\r\n // Sort data and mark series\r\n $.each(result.series, function(index, series) {\r\n series.data.sort(compareByXCoordinate);\r\n if(!(noMatchColor && noMatchColor===true)) {\r\n\t series.color = index;\r\n\t }\r\n });\r\n}", "title": "" }, { "docid": "72d443481492633ade6219e9fe1389cc", "score": "0.5840685", "text": "function prepareSeries(data, noMatchColor){\r\n var result = data.result;\r\n\r\n // Keep only series when needed\r\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\r\n // Insensitive case matching\r\n var regexp = new RegExp(seriesFilter, 'i');\r\n result.series = $.grep(result.series, function(series, index){\r\n return regexp.test(series.label);\r\n });\r\n }\r\n\r\n // Keep only controllers series when supported and needed\r\n if(result.supportsControllersDiscrimination && showControllersOnly){\r\n result.series = $.grep(result.series, function(series, index){\r\n return series.isController;\r\n });\r\n }\r\n\r\n // Sort data and mark series\r\n $.each(result.series, function(index, series) {\r\n series.data.sort(compareByXCoordinate);\r\n if(!(noMatchColor && noMatchColor===true)) {\r\n\t series.color = index;\r\n\t }\r\n });\r\n}", "title": "" }, { "docid": "72d443481492633ade6219e9fe1389cc", "score": "0.5840685", "text": "function prepareSeries(data, noMatchColor){\r\n var result = data.result;\r\n\r\n // Keep only series when needed\r\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\r\n // Insensitive case matching\r\n var regexp = new RegExp(seriesFilter, 'i');\r\n result.series = $.grep(result.series, function(series, index){\r\n return regexp.test(series.label);\r\n });\r\n }\r\n\r\n // Keep only controllers series when supported and needed\r\n if(result.supportsControllersDiscrimination && showControllersOnly){\r\n result.series = $.grep(result.series, function(series, index){\r\n return series.isController;\r\n });\r\n }\r\n\r\n // Sort data and mark series\r\n $.each(result.series, function(index, series) {\r\n series.data.sort(compareByXCoordinate);\r\n if(!(noMatchColor && noMatchColor===true)) {\r\n\t series.color = index;\r\n\t }\r\n });\r\n}", "title": "" }, { "docid": "72d443481492633ade6219e9fe1389cc", "score": "0.5840685", "text": "function prepareSeries(data, noMatchColor){\r\n var result = data.result;\r\n\r\n // Keep only series when needed\r\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\r\n // Insensitive case matching\r\n var regexp = new RegExp(seriesFilter, 'i');\r\n result.series = $.grep(result.series, function(series, index){\r\n return regexp.test(series.label);\r\n });\r\n }\r\n\r\n // Keep only controllers series when supported and needed\r\n if(result.supportsControllersDiscrimination && showControllersOnly){\r\n result.series = $.grep(result.series, function(series, index){\r\n return series.isController;\r\n });\r\n }\r\n\r\n // Sort data and mark series\r\n $.each(result.series, function(index, series) {\r\n series.data.sort(compareByXCoordinate);\r\n if(!(noMatchColor && noMatchColor===true)) {\r\n\t series.color = index;\r\n\t }\r\n });\r\n}", "title": "" }, { "docid": "72d443481492633ade6219e9fe1389cc", "score": "0.5840685", "text": "function prepareSeries(data, noMatchColor){\r\n var result = data.result;\r\n\r\n // Keep only series when needed\r\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\r\n // Insensitive case matching\r\n var regexp = new RegExp(seriesFilter, 'i');\r\n result.series = $.grep(result.series, function(series, index){\r\n return regexp.test(series.label);\r\n });\r\n }\r\n\r\n // Keep only controllers series when supported and needed\r\n if(result.supportsControllersDiscrimination && showControllersOnly){\r\n result.series = $.grep(result.series, function(series, index){\r\n return series.isController;\r\n });\r\n }\r\n\r\n // Sort data and mark series\r\n $.each(result.series, function(index, series) {\r\n series.data.sort(compareByXCoordinate);\r\n if(!(noMatchColor && noMatchColor===true)) {\r\n\t series.color = index;\r\n\t }\r\n });\r\n}", "title": "" }, { "docid": "72d443481492633ade6219e9fe1389cc", "score": "0.5840685", "text": "function prepareSeries(data, noMatchColor){\r\n var result = data.result;\r\n\r\n // Keep only series when needed\r\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\r\n // Insensitive case matching\r\n var regexp = new RegExp(seriesFilter, 'i');\r\n result.series = $.grep(result.series, function(series, index){\r\n return regexp.test(series.label);\r\n });\r\n }\r\n\r\n // Keep only controllers series when supported and needed\r\n if(result.supportsControllersDiscrimination && showControllersOnly){\r\n result.series = $.grep(result.series, function(series, index){\r\n return series.isController;\r\n });\r\n }\r\n\r\n // Sort data and mark series\r\n $.each(result.series, function(index, series) {\r\n series.data.sort(compareByXCoordinate);\r\n if(!(noMatchColor && noMatchColor===true)) {\r\n\t series.color = index;\r\n\t }\r\n });\r\n}", "title": "" }, { "docid": "72d443481492633ade6219e9fe1389cc", "score": "0.5840685", "text": "function prepareSeries(data, noMatchColor){\r\n var result = data.result;\r\n\r\n // Keep only series when needed\r\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\r\n // Insensitive case matching\r\n var regexp = new RegExp(seriesFilter, 'i');\r\n result.series = $.grep(result.series, function(series, index){\r\n return regexp.test(series.label);\r\n });\r\n }\r\n\r\n // Keep only controllers series when supported and needed\r\n if(result.supportsControllersDiscrimination && showControllersOnly){\r\n result.series = $.grep(result.series, function(series, index){\r\n return series.isController;\r\n });\r\n }\r\n\r\n // Sort data and mark series\r\n $.each(result.series, function(index, series) {\r\n series.data.sort(compareByXCoordinate);\r\n if(!(noMatchColor && noMatchColor===true)) {\r\n\t series.color = index;\r\n\t }\r\n });\r\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "de28d05708076cbc0dac9a4c724eb795", "score": "0.579692", "text": "function prepareSeries(data, noMatchColor){\n var result = data.result;\n\n // Keep only series when needed\n if(seriesFilter && (!filtersOnlySampleSeries || result.supportsControllersDiscrimination)){\n // Insensitive case matching\n var regexp = new RegExp(seriesFilter, 'i');\n result.series = $.grep(result.series, function(series, index){\n return regexp.test(series.label);\n });\n }\n\n // Keep only controllers series when supported and needed\n if(result.supportsControllersDiscrimination && showControllersOnly){\n result.series = $.grep(result.series, function(series, index){\n return series.isController;\n });\n }\n\n // Sort data and mark series\n $.each(result.series, function(index, series) {\n series.data.sort(compareByXCoordinate);\n if(!(noMatchColor && noMatchColor===true)) {\n\t series.color = index;\n\t }\n });\n}", "title": "" }, { "docid": "a0e33766188d4b8224f348dbdff4a665", "score": "0.5748293", "text": "function updateWreckSeries(){\n\tukcGraph.series[7].setData(wreckSeriesArr,false);\n}", "title": "" }, { "docid": "cdcd04b6143cf7124cbf23e126cb3473", "score": "0.5737573", "text": "querySeriesSet(query, seriesSet) {\n return seriesSet\n .valueSeq()\n .map(s =>\n filterAndAggregate(\n this.series[s],\n query.get('start'),\n query.get('end'),\n query.get('step')\n )\n )\n .reduce((results, data) => mergeWith((a, b) => a + b, results, data), []);\n }", "title": "" }, { "docid": "b9375a23f37e89f28c2d3fc547c8ca75", "score": "0.57267004", "text": "function changeTimeSeries() {\n\n timeSeries = [];\n trendSeries = [];\n\n // Load time series for selected variable.\n for (var i = 1; i < chartsData.length; i++) {\n firstRow = chartsData[i - 1];\n firstRowValue = firstRow[selectedAxis];\n firstRowDate = new Date(firstRow.Date);\n\n secondRow = chartsData[i];\n secondRowValue = secondRow[selectedAxis];\n secondRowDate = new Date(secondRow.Date);\n\n timeSeries.push([{\n 'date': firstRowDate,\n 'value': firstRowValue\n },\n {\n 'date': secondRowDate,\n 'value': secondRowValue\n }\n ])\n }\n\n // Load trend series for selected variable.\n for (var i = 1; i < yearlyData.length; i++) {\n firstRow = yearlyData[i - 1];\n firstRowValue = firstRow[selectedAxis];\n firstRowDate = new Date(firstRow.Year);\n\n secondRow = yearlyData[i];\n secondRowValue = secondRow[selectedAxis];\n secondRowDate = new Date(secondRow.Year);\n\n trendSeries.push([{\n 'date': firstRowDate,\n 'value': firstRowValue\n },\n {\n 'date': secondRowDate,\n 'value': secondRowValue\n }\n ])\n }\n}", "title": "" }, { "docid": "c5c1e24fe904d136797b63eea0fb87f7", "score": "0.5711437", "text": "getSeriesData() {\n let _seriesData = []\n for (const list of this.stateHistories) {\n if (list.length === 0) continue\n if (!list[0].state) continue\n const items = this._getGroupHistoryData(list)\n _seriesData.push(items)\n }\n return _seriesData\n }", "title": "" }, { "docid": "27da346b77438e01bcd7492bfe72630b", "score": "0.5641746", "text": "function onTimeSeriesSuccess(data){\n console.log(\"huzzah! %o\", data);\n scope.ts.ChartConfig.series = data.data;\n }", "title": "" }, { "docid": "27da346b77438e01bcd7492bfe72630b", "score": "0.5641746", "text": "function onTimeSeriesSuccess(data){\n console.log(\"huzzah! %o\", data);\n scope.ts.ChartConfig.series = data.data;\n }", "title": "" }, { "docid": "27da346b77438e01bcd7492bfe72630b", "score": "0.5641746", "text": "function onTimeSeriesSuccess(data){\n console.log(\"huzzah! %o\", data);\n scope.ts.ChartConfig.series = data.data;\n }", "title": "" }, { "docid": "27da346b77438e01bcd7492bfe72630b", "score": "0.5641746", "text": "function onTimeSeriesSuccess(data){\n console.log(\"huzzah! %o\", data);\n scope.ts.ChartConfig.series = data.data;\n }", "title": "" }, { "docid": "a1c565bf01423798b429dc11b36302b1", "score": "0.56397104", "text": "function manageDataResult() {\n let codeHTML = \"\";\n if (series.length === 0) {\n codeHTML = `<p class=\"error-text\">No conozco esa serie, lo siento</p>`;\n }\n for (let index = 0; index < series.length; index += 1) {\n let notInFavorites = true;\n // for para saber si una serie está en favoritas\n for (let i = 0; i < favorites.length; i += 1) {\n if (favorites[i].show.id === series[index].show.id) {\n notInFavorites = false;\n }\n }\n\n // si no está en favoritas lo pinta todo con normalidad (sin la clase \"favorite\")\n if (notInFavorites === true) {\n codeHTML += paintElement(series[index]);\n } else {\n // si está en favoritas\n codeHTML += paintElementWhenFavorite(series[index]);\n }\n }\n seriesName.innerHTML = codeHTML;\n addEventListenerToSeries();\n}", "title": "" }, { "docid": "f18689c0158023c7e22a04e3db22bf6a", "score": "0.5625238", "text": "function updateStaticDraughtSeries(){\n\tukcGraph.series[1].setData(staticDraughtArr);\t\n}", "title": "" }, { "docid": "c64ba75c8869f42c466ed4f1542c6bcd", "score": "0.5621756", "text": "push(series) {\n this.series.push(series);\n this.emit(\"changed\");\n }", "title": "" }, { "docid": "4d4a8c3a80bbbe4348a0ecfcf9d16f0a", "score": "0.55905133", "text": "function updateChart() {\n var dynatable = $table.data('dynatable'), categories = [];\n var passedValues = [], failedValues = [];\n $.each(dynatable.settings.dataset.records, function() {\n categories.push(this.date);\n passedValues.push(parseFloat(this.passed));\n failedValues.push(parseFloat(this.failed));\n });\n\n chart.xAxis[0].setCategories(categories);\n chart.series[0].setData(passedValues);\n chart.series[1].setData(failedValues);\n }", "title": "" }, { "docid": "6f0e414b1e1bc434b1689a28075e51b9", "score": "0.5537987", "text": "function onAfterSetScale() {\n this.series.forEach(function (series) {\n series.hasProcessed = false;\n });\n }", "title": "" }, { "docid": "aa59ba113c58a1ebc0ad4f4d53bfd70d", "score": "0.5527418", "text": "showChart() {\n this.updateCurrStocksDiffArr();\n this.options.series = [];\n for (let i = 0; i < this.currStocksDiffInfo.length; i++) {\n this.options.series.push({\n name: this.currStocksDiffInfo[i].name,\n data: [this.currStocksDiffInfo[i].yearLowDiff,this.currStocksDiffInfo[i].yearHighDiff]\n })\n }\n }", "title": "" }, { "docid": "e2a3d52029b956c903a009442db5f841", "score": "0.5522855", "text": "function onChartAfterAddSeries() {\n if (this.navigator) {\n // Recompute which series should be shown in navigator, and add them\n this.navigator.setBaseSeries(null, false);\n }\n }", "title": "" }, { "docid": "92991b526df50fe57322efb91da91cc3", "score": "0.5498827", "text": "mergeXvalues(visibleSeries) {\n let collection = [];\n for (let index = 0; index < visibleSeries.length; index++) {\n collection = collection.concat(visibleSeries[index].xData);\n }\n return collection.filter((item, index) => {\n return index === collection.indexOf(item);\n });\n }", "title": "" }, { "docid": "cf6403d0d8fdb8379571ed3a8da23f7a", "score": "0.54888046", "text": "processData() {\n let data = this.sparkline.dataSource;\n if (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(data) || !data.length) {\n return;\n }\n else if (!isNaN(this.sparkline.dataSource[0]) || this.sparkline.valueType === 'Numeric') {\n data = (this.sparkline.enableRtl) ? data.reverse() : data;\n this.sparkline.sparklineData = data; // extend([], data) as Object[];\n }\n else {\n this['process' + this.sparkline.valueType]();\n }\n this.axisCalculation();\n }", "title": "" }, { "docid": "b7329961295b64be9b66681798c648ca", "score": "0.54873955", "text": "convertToChartData(idx, referenceSeriesId) {\n return this.series.filter(s => s.visible && this.loaded && s.rendered).map(s => {\n if (referenceSeriesId !== NO_OPTION_SELECTED && s.normalisedData.get(referenceSeriesId)) {\n return {name: s.seriesName, data: s.normalisedData.get(referenceSeriesId), rms: s.rms()};\n } else {\n return {name: s.seriesName, data: s.rendered, rms: s.rms()}\n }\n }).map(d => Object.assign({id: this.getExternalId(), series: d.name, seriesIdx: idx}, d.data.toJS()));\n }", "title": "" }, { "docid": "bd683b238e95f9e5711e8ea357bd8113", "score": "0.54802465", "text": "convertMetrics(res) {\n var series = res.data.series\n if (!series) {\n series = res.data.streams\n }\n return _.map(series, (d, i) => {\n return {\n text: d.name,\n value: i\n };\n });\n }", "title": "" }, { "docid": "fcb97244522ee2afdfc5d2129093d9cc", "score": "0.5472033", "text": "processData(force) {\n let series = this, options = series.options, yData = series.yData, \n // #3710 Update point does not propagate to sum\n points = options.data, point, dataLength = yData.length, threshold = options.threshold || 0, subSum, sum, dataMin, dataMax, y, i;\n sum = subSum = dataMin = dataMax = 0;\n for (i = 0; i < dataLength; i++) {\n y = yData[i];\n point = points && points[i] ? points[i] : {};\n if (y === 'sum' || point.isSum) {\n yData[i] = correctFloat(sum);\n }\n else if (y === 'intermediateSum' ||\n point.isIntermediateSum) {\n yData[i] = correctFloat(subSum);\n subSum = 0;\n }\n else {\n sum += y;\n subSum += y;\n }\n dataMin = Math.min(sum, dataMin);\n dataMax = Math.max(sum, dataMax);\n }\n super.processData.call(this, force);\n // Record extremes only if stacking was not set:\n if (!options.stacking) {\n series.dataMin = dataMin + threshold;\n series.dataMax = dataMax;\n }\n return;\n }", "title": "" }, { "docid": "7e6302fd489820fad02f5ce0d2e6d8fb", "score": "0.545737", "text": "setSeriesData() {\n this.getSeriesOrderByLinks().forEach(function (series) {\n // We need to set data for series with sorting after series init\n if (!series.points && !series.data && series.enabledDataSorting) {\n series.setData(series.options.data, false);\n }\n });\n }", "title": "" }, { "docid": "c2f1e6b1338fe1ae4920976f53033596", "score": "0.5443144", "text": "function refreshSeriesList($scope) {\n $scope.allSeries = collectNamedSeries($scope.chartData);\n if (!$scope.selectedSeries.columnPath && $scope.allSeries[0]) {\n $scope.selectedSeries = $scope.allSeries[0];\n }\n }", "title": "" }, { "docid": "f8e57a2590236c75bdad070ba1252886", "score": "0.5401801", "text": "SET_SERIES(state, payload) {\n state.emasSeries = payload;\n }", "title": "" }, { "docid": "532bb1b8ee448ade0a460b0797210e13", "score": "0.5394519", "text": "function getOvertimeGraphYValues(data, metric, advertiser) {\n\n advertiser_series = [];\n\n // \"cpi\": \"spend/installs\",\n // \"arpu\": \"revenue/installs\",\n // \"cpt\": \"spend/trials\",\n // \"arp_trial\": \"revenue/trials\",\n // \"roas\": \"( (revenue/spend) - 1 ) * 100 \",\n // \"trials_per_user\": \"( (trials/installs) - 1 ) * 100 \",\n // \"subs_per_trial\": \"( (subs/trials) - 1 ) * 100 \",\n\n data.advertiser.map((d, i) => {\n if (d === advertiser){\n // console.log(\"series \", series);\n // console.log(\"advertiser \", advertiser);\n // console.log(\"value \", data[series][i]);\n if(metric === \"spend\" || metric === \"revenue\"){\n // console.log(\"spend or revenue\", data[metric][i]);\n advertiser_series.push( parseFloat(data[metric][i].toFixed(2)) );\n // advertiser_series.push( data[metric][i].toFixed(2) );\n // advertiser_series.push( (data[\"spend\"][i] / data[metric_divisor_lookup[metric]][i]).toFixed(2) );\n } \n else if(metric === \"cpi\" || metric === \"arpu\" || metric === \"cpt\" || metric === \"arp_trial\"){\n advertiser_series.push( parseFloat((data[metrics_info[metric].numerator][i] / data[metrics_info[metric].divisor][i]).toFixed(2)) );\n // advertiser_series.push( (data[\"spend\"][i] / data[metric_divisor_lookup[metric]][i]).toFixed(2) );\n }\n else if(metric === \"roas\"){ // roas\n advertiser_series.push( parseFloat(( ((data[metrics_info[metric].numerator][i] / data[metrics_info[metric].divisor][i]) - 1) * 100 ).toFixed(2)) );\n // advertiser_series.push( (data[\"ltv_subs_revenue\"][i] / data[metric_divisor_lookup[metric]][i]).toFixed(2) );\n }\n else if(metric === \"trials_per_user\" || metric === \"subs_per_trial\"){ // trials_per_user OR subs_per_trial\n advertiser_series.push( parseFloat(( (data[metrics_info[metric].numerator][i] / data[metrics_info[metric].divisor][i]) * 100 ).toFixed(2)) );\n // advertiser_series.push( (data[\"ltv_subs_revenue\"][i] / data[metric_divisor_lookup[metric]][i]).toFixed(2) );\n }\n else if(metric === \"yaxis_placeholder\"){ // trials_per_user OR subs_per_trial\n advertiser_series.push(0);\n // advertiser_series.push(( (data[metrics_info[metric].numerator][i] / data[metrics_info[metric].divisor][i]) * 100 ).toFixed(2) );\n // advertiser_series.push( (data[\"ltv_subs_revenue\"][i] / data[metric_divisor_lookup[metric]][i]).toFixed(2) );\n }\n else{\n advertiser_series.push(data[metric][i]);\n }\n\n }\n });\n\n return advertiser_series;\n\n}", "title": "" }, { "docid": "5f818c573f7d1dd070be9633f7f6087f", "score": "0.53773683", "text": "function processTimeseriesData (o) {\n let thirtyTwoDaysAgo = (+ new Date()) - (32 * 24 * 60 * 60 * 1000);\n let fourtyEightHoursAgo = (+ new Date()) - (48 * 60 * 60 * 1000);\n let twentyFourHoursAgo = (+ new Date()) - (24 * 60 * 60 * 1000);\n\n if (!o.timeseries) o = initializeTimeseriesData(o);\n\n /**\n * Create aggregates in alternate time resolutions\n */\n let hourlyData = formatTimeseriesData(o.timeseries.all, (60 * 60 * 1000));\n\n // hourlyData.pop(); // Try not popping so we get results faster. Also, if we always pop, dailyAggregates will never exceed 23 hours of data.\n\n let hourlyDataFromAggregate = obj2arr(o.timeseries.aggregates.hourly);\n\n let dailyData = formatTimeseriesData(hourlyDataFromAggregate, (24 * 60 * 60 * 1000));\n\n // dailyData.pop(); Do not pop dailyData, since we only collect 24h & each component is complete\n\n // Get daily data from previous aggregates, not volatile data\n let dailyDataFromAggregate = obj2arr(o.timeseries.aggregates.daily);\n\n let monthlyData = formatTimeseriesData(dailyDataFromAggregate, Math.floor(30.43685 * 24 * 60 * 60 * 1000));\n\n // monthlyData.pop(); Do not pop monthlyData\n\n hourlyData.forEach(item => {\n o.timeseries.aggregates.hourly[item.ts] = item;\n });\n\n dailyData.forEach(item => {\n o.timeseries.aggregates.daily[item.ts] = item;\n });\n\n monthlyData.forEach(item => {\n o.timeseries.aggregates.monthly[item.ts] = item;\n });\n\n\n /**\n * Cleanup old data over 24h old\n */\n o.timeseries.all.forEach((item, i) => {\n if (item.ts < twentyFourHoursAgo) o.timeseries.all.splice(i, 1);\n });\n\n // Cleanup hourly aggregates older than two days\n for (let k in o.timeseries.aggregates.hourly) {\n if (!o.timeseries.aggregates.hourly.hasOwnProperty(k)) continue;\n\n if (k < fourtyEightHoursAgo) delete o.timeseries.aggregates.hourly[k];\n }\n\n // Cleanup daily aggregates older than 32 days\n for (let k in o.timeseries.aggregates.daily) {\n if (!o.timeseries.aggregates.daily.hasOwnProperty(k)) continue;\n\n if (k < thirtyTwoDaysAgo) delete o.timeseries.aggregates.daily[k];\n }\n\n return o;\n}", "title": "" }, { "docid": "e330a3054a3b647b772c5e5848cffbe0", "score": "0.53693104", "text": "function updateResult (value) {\n var x = value\n , y = comptuteValue (value)\n ;\n\n if ($(\".add-points input\").prop(\"checked\")) {\n var seriesObj = expGraph.series[0];\n seriesObj.data.push([x, y]);\n seriesObj.data.sort (function (a, b) {\n return a[0] - b[0];\n });\n\n expGraph.drawSeries({},0);\n }\n\n $(\".amp input\").val(y.toFixed(2));\n }", "title": "" }, { "docid": "ba3c5c83f8aa7152979b7816747dd9ce", "score": "0.5325903", "text": "[MUTATIONS.updateSeries](state, bme280) {\n let device = bme280.get(\"device\");\n // loop over all existing keys of current state\n for (const key of Object.keys(state)) {\n // unshift new value to all keys that match appropriate 'device{SEPARATOR}' tuple\n if (key.indexOf(device + SEPARATOR) !== -1) {\n // unshift new value\n let series = state[key];\n series.labels.unshift(bme280.get(\"createdAt\"));\n series.temperatures.unshift(bme280.get(\"temperature\"));\n series.humidities.unshift(bme280.get(\"humidity\"));\n series.pressures.unshift(bme280.get(\"pressure\"));\n series.altitudes.unshift(bme280.get(\"altitude\"));\n // call reducer function to define if any former values needs to be removed\n let i = series.reduceFunction(\n series,\n series.offsetFromNowInMillis,\n series.limit\n );\n // remove amout of former values accordingly\n let start = i * -1;\n series.labels.splice(start, i);\n series.temperatures.splice(start, i);\n series.humidities.splice(start, i);\n series.pressures.splice(start, i);\n series.altitudes.splice(start, i);\n }\n }\n }", "title": "" }, { "docid": "b2f153e737283a85082a1c2823599668", "score": "0.5321132", "text": "function createDateSeries(fromDate, toDate){\n\n var totalsForPeriod = _(averaged)\n .filter(function(data){\n var date = new Date(data.date);\n var matched = date >= fromDate && date < toDate;\n //console.log('%s >= %s && %s < %s == %s', date, fromDate, date, toDate, matched);\n return matched;\n })\n .map(function(data, i){\n data.index = i;\n return data;\n })\n .value();\n\n totalsForPeriod.forEach(function(t, i){\n if(i==0){\n t.avgSum = Math.abs(t.avg);\n }else{\n t.avgSum = totalsForPeriod[i-1].avgSum + Math.abs(t.avg);\n }\n });\n\n return totalsForPeriod;\n }", "title": "" }, { "docid": "897dd0e994c88fede28f60202f07ff5a", "score": "0.53035784", "text": "static findAll () {\n return Series({\n method: 'GET',\n url: '/series'\n })\n }", "title": "" }, { "docid": "03c82ec5eb5ed38e326379bd82bf94ff", "score": "0.5286877", "text": "setFlippedSeries(dataTableKeys) {\n let chart = this,\n chartData = chart.data.chartData,\n dataTable = chart.data.dataTable,\n dataLabel = chart.data.xAxisData.label,\n flippedData = [],\n flippedDataTable = {},\n valueCount = 1,\n filteredDataTableArray = [];\n\n for (let k in dataTable) {\n if (dataTable.hasOwnProperty(k)) {\n let flippedObject = {};\n if (dataTable[k] !== dataLabel) {\n flippedObject[dataLabel] = dataTable[k];\n for (let chartEle of chartData) {\n flippedObject[chartEle[dataLabel]] = chartEle[dataTable[k]];\n if (filteredDataTableArray.indexOf(chartEle[dataLabel]) === -1) {\n flippedDataTable['value ' + valueCount] = chartEle[dataLabel];\n valueCount++;\n filteredDataTableArray.push(chartEle[dataLabel]);\n }\n }\n flippedData.push(flippedObject);\n }\n }\n }\n flippedDataTable.label = dataLabel;\n chart.flippedData = { chartData: flippedData, dataTable: flippedDataTable };\n\n if (chart.config.type === 'bar' || chart.config.type === 'line' || chart.config.type === 'area') {\n chart.flippedData.xAxisData = chart.setAxisData('x', chart.flippedData, dataTableKeys);\n chart.flippedData.yAxisData = chart.setAxisData('y', chart.flippedData, dataTableKeys);\n chart.flippedData.legendData = jvCharts.setBarLineLegendData(chart.flippedData);\n } else {\n console.log('Add additional chart type to set flipped series');\n }\n }", "title": "" }, { "docid": "201e586b87241e9876997996e77ea14b", "score": "0.5276385", "text": "function indexify(idx, data) {\n return data.map(function(line, i) {\n if (!line.values) {\n return line;\n }\n var v = lines.y()(line.values[idx], idx);\n\n //TODO: implement check below, and disable series if series loses 100% or more cause divide by 0 issue\n if (v < -.95 && !noErrorCheck) {\n //if a series loses more than 100%, calculations fail.. anything close can cause major distortion (but is mathematically correct till it hits 100)\n\n line.tempDisabled = true;\n return line;\n }\n\n line.tempDisabled = false;\n\n line.values = line.values.map(function(point, pointIndex) {\n point.display = {'y': (lines.y()(point, pointIndex) - v) / (1 + v) };\n return point;\n })\n\n return line;\n })\n }", "title": "" }, { "docid": "201e586b87241e9876997996e77ea14b", "score": "0.5276385", "text": "function indexify(idx, data) {\n return data.map(function(line, i) {\n if (!line.values) {\n return line;\n }\n var v = lines.y()(line.values[idx], idx);\n\n //TODO: implement check below, and disable series if series loses 100% or more cause divide by 0 issue\n if (v < -.95 && !noErrorCheck) {\n //if a series loses more than 100%, calculations fail.. anything close can cause major distortion (but is mathematically correct till it hits 100)\n\n line.tempDisabled = true;\n return line;\n }\n\n line.tempDisabled = false;\n\n line.values = line.values.map(function(point, pointIndex) {\n point.display = {'y': (lines.y()(point, pointIndex) - v) / (1 + v) };\n return point;\n })\n\n return line;\n })\n }", "title": "" }, { "docid": "201e586b87241e9876997996e77ea14b", "score": "0.5276385", "text": "function indexify(idx, data) {\n return data.map(function(line, i) {\n if (!line.values) {\n return line;\n }\n var v = lines.y()(line.values[idx], idx);\n\n //TODO: implement check below, and disable series if series loses 100% or more cause divide by 0 issue\n if (v < -.95 && !noErrorCheck) {\n //if a series loses more than 100%, calculations fail.. anything close can cause major distortion (but is mathematically correct till it hits 100)\n\n line.tempDisabled = true;\n return line;\n }\n\n line.tempDisabled = false;\n\n line.values = line.values.map(function(point, pointIndex) {\n point.display = {'y': (lines.y()(point, pointIndex) - v) / (1 + v) };\n return point;\n })\n\n return line;\n })\n }", "title": "" }, { "docid": "201e586b87241e9876997996e77ea14b", "score": "0.5276385", "text": "function indexify(idx, data) {\n return data.map(function(line, i) {\n if (!line.values) {\n return line;\n }\n var v = lines.y()(line.values[idx], idx);\n\n //TODO: implement check below, and disable series if series loses 100% or more cause divide by 0 issue\n if (v < -.95 && !noErrorCheck) {\n //if a series loses more than 100%, calculations fail.. anything close can cause major distortion (but is mathematically correct till it hits 100)\n\n line.tempDisabled = true;\n return line;\n }\n\n line.tempDisabled = false;\n\n line.values = line.values.map(function(point, pointIndex) {\n point.display = {'y': (lines.y()(point, pointIndex) - v) / (1 + v) };\n return point;\n })\n\n return line;\n })\n }", "title": "" }, { "docid": "1bf2a68579539063ff1dafe33f103b15", "score": "0.52740616", "text": "function temp_chart_remove_value() {\n temp_chart.data.labels.shift();\n temp_chart.data.datasets[0].data.shift();\n temp_chart.update();\n }", "title": "" }, { "docid": "524a29d9af65cabf1682e2d82f099de1", "score": "0.5272514", "text": "propFromSeries() {\n const chart = this, optionsChart = chart.options.chart, seriesOptions = chart.options.series;\n let i, klass, value;\n /**\n * The flag is set to `true` if a series of the chart is inverted.\n *\n * @name Highcharts.Chart#inverted\n * @type {boolean|undefined}\n */\n ['inverted', 'angular', 'polar'].forEach(function (key) {\n // The default series type's class\n klass = seriesTypes[optionsChart.type];\n // Get the value from available chart-wide properties\n value =\n // It is set in the options:\n optionsChart[key] ||\n // The default series class:\n (klass && klass.prototype[key]);\n // requires it\n // 4. Check if any the chart's series require it\n i = seriesOptions && seriesOptions.length;\n while (!value && i--) {\n klass = seriesTypes[seriesOptions[i].type];\n if (klass && klass.prototype[key]) {\n value = true;\n }\n }\n // Set the chart property\n chart[key] = value;\n });\n }", "title": "" }, { "docid": "a6cf5465a7cc446a0a8e0d3792e3eb14", "score": "0.52582985", "text": "set owningSeries(a) {\n if (a != this._a9) {\n let b = null;\n if (a == this) {\n b = ExcelUtils.ef(\"LE_Series_OwningSeries_Same\");\n }\n else {\n let c = this.chart;\n if (c != null && c._gc == false) {\n if (c.chartType != 116 || this.chartType != 116) {\n b = ExcelUtils.ef(\"LE_Series_OwningSeries_NotParetoLine\");\n }\n else if (a.chartType != 51) {\n b = ExcelUtils.ef(\"LE_Series_OwningSeries_NotClusteredColumn\");\n }\n }\n }\n if (stringIsNullOrEmpty(b) == false) {\n throw new BaseError(1, b);\n }\n let d = this._r(Series.$, Series.$, this, 22, this._a9, a);\n this._a9 = d.p2;\n }\n }", "title": "" }, { "docid": "0647aee3dc0a3fda2b38c3744bb20ef0", "score": "0.5255657", "text": "renderSeries() {\n this.series.forEach(function (serie) {\n serie.translate();\n serie.render();\n });\n }", "title": "" }, { "docid": "071349a501dd06f0d7693d4e3b2d7bff", "score": "0.5254572", "text": "update() {\n // multiple group by values - show them in the x-axis\n\t\t\tif (this.data.groups.length > 0) { \n\t\t\t\tthis.chart.data = {\n\t\t\t\t\tdatasets: this.data.groups.map(group => {\n return this.data.series.map(series => {\n return this.getGroupedDataSet(series, group, series);\n })\n }).flat()\n\t\t\t\t}\n\t\t\t\n\t\t\t} else { \n // no group by, show the series in the x-axis\n this.chart.data = {\n\t\t\t\t\tdatasets: [\n this.getDataSet()\n ],\n labels: this.data.series\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\n\t\t\t// update the chart.js chart\n\t\t\tthis.chart.update();\n }", "title": "" }, { "docid": "dd3659c365b6529325506ddb1c2c1dad", "score": "0.524966", "text": "function _getSerieDataSucceed(series) {\n \n var graph = new GraphTemplate.Graph(graphInfo.type, graphInfo.graphToSend.graph.connector_id, series.series[0].measure, graphInfo.yAxis, graphInfo.metric, graphInfo.connectorType, graphInfo.account, graphInfo.graphToSend.graph.measure);\n graph.setStatus(ChartHelper.SerieStatus.wakeUp);\n graph.setData(series.data[0]);\n graph.setDate(series.timestamps);\n graph.setFilters(series.series[0].filters);\n graph.setId(graphInfo.graphToSend.graph.measure);\n\n //var tabFullDate = [];\n //var tabId = [];\n //var tabDate = [];\n //var tabDay = [];\n //var tabYear = [];\n //var tabMonth = [];\n //var tabQuarter = [];\n //var tabHalf = [];\n\n //for (var x = 1; x <= series.timestamps.length; x++) {\n // var date = new Date(series.timestamps[x - 1]);\n // tabFullDate.push(date.getDate() + \"/\" + (parseInt(date.getMonth()) + 1) + \"/\" + date.getFullYear());\n // tabId.push(x);\n // tabDate.push(date.getDate());\n // switch (date.getDay()) {\n // case (1): {\n // tabDay.push(\"Monday\");\n // break;\n // }\n // case (2): {\n // tabDay.push(\"Tuesday\");\n // break;\n // }\n // case (3): {\n // tabDay.push(\"Wednesday\");\n // break;\n // }\n // case (4): {\n // tabDay.push(\"Thursday\");\n // break;\n // }\n // case (5): {\n // tabDay.push(\"Friday\");\n // break;\n // }\n // case (6): {\n // tabDay.push(\"Saturday\");\n // break;\n // }\n // case (0): {\n // tabDay.push(\"Sunday\");\n // break;\n // }\n // }\n\n // switch (date.getMonth()) {\n // case (0): {\n // tabMonth.push(\"January\");\n // tabQuarter.push(1);\n // tabHalf.push(1);\n // break;\n // }\n // case (1): {\n // tabMonth.push(\"February\");\n // tabQuarter.push(1);\n // tabHalf.push(1);\n // break;\n // }\n // case (2): {\n // tabMonth.push(\"March\");\n // tabQuarter.push(1);\n // tabHalf.push(1);\n // break;\n // }\n // case (3): {\n // tabMonth.push(\"April\");\n // tabQuarter.push(2);\n // tabHalf.push(1);\n // break;\n // }\n // case (4): {\n // tabMonth.push(\"May\");\n // tabQuarter.push(2);\n // tabHalf.push(1);\n // break;\n // }\n // case (5): {\n // tabMonth.push(\"June\");\n // tabQuarter.push(2);\n // tabHalf.push(1);\n // break;\n // }\n // case (6): {\n // tabMonth.push(\"July\");\n // tabQuarter.push(3);\n // tabHalf.push(2);\n // break;\n // }\n // case (7): {\n // tabMonth.push(\"August\");\n // tabQuarter.push(3);\n // tabHalf.push(2);\n // break;\n // }\n // case (8): {\n // tabMonth.push(\"September\");\n // tabQuarter.push(3);\n // tabHalf.push(2);\n // break;\n // }\n // case (9): {\n // tabMonth.push(\"October\");\n // tabQuarter.push(4);\n // tabHalf.push(2);\n // break;\n // }\n // case (10): {\n // tabMonth.push(\"November\");\n // tabQuarter.push(4);\n // tabHalf.push(2);\n // break;\n // }\n // case (11): {\n // tabMonth.push(\"December\");\n // tabQuarter.push(4);\n // tabHalf.push(2);\n // break;\n // }\n // }\n\n // tabYear.push(date.getFullYear());\n \n //}\n //tabFullDate.reverse();\n //tabId.reverse();\n //tabDate.reverse();\n //tabDay.reverse();\n //tabYear.reverse();\n //tabQuarter.reverse();\n //tabHalf.reverse();\n\n\n\n \n\n //var str = \"sep=;\\n\";\n //var data = series.data[0];\n \n //var nbValue = series.data[0].length;\n \n //str += \"date; value;\";\n //for (var i = 0; i < nbValue; i++) {\n // str += \"\\n\" + tabFullDate[i] + \";\" + data[i] + \";\";\n //}\n\n //var picker = new Windows.Storage.Pickers.FileSavePicker();\n\n //picker.fileTypeChoices.insert(\"CSV file\", [\".csv\"]);\n //picker.defaultFileExtension = \".csv\";\n //picker.suggestedFileName = \"Metric Data\";\n\n //picker.pickSaveFileAsync()\n //.then(function (file) {\n // if (file != null) {\n // file.openAsync(Windows.Storage.FileAccessMode.readWrite)\n // .then(function (streamWriter) {\n // var outputStream = streamWriter.getOutputStreamAt(0);\n // var writer = Windows.Storage.Streams.DataWriter(outputStream);\n\n // writer.writeString(str);\n\n // writer.storeAsync()\n // .then(function () {\n // // new version return writer.CommitAsync\n // return writer.flushAsync();\n // })\n // .then(function () {\n // writer.close();\n // });\n // })\n // .then(null, function (error) {\n // var y = 0;\n // });\n // }\n //});\n\n \n\n\n if (DataExplorerController.isEmptyExploration) {\n DataExplorerController.createNewExploration();\n DataExplorerController.exploration.setTimeStamps();\n }\n if (!DataExplorerController.exploration.isExistGraph(graph.id)) {\n \n DataExplorerController.exploration.addGraph(graph);\n\n DataExplorerController.formatGraphsData(DataExplorerController.exploration);\n\n DataExplorer.updateGraphsView();\n }\n else\n Messages.showCancelMessage(MessagesHelper.MSG_SERIES_TITLE, MessagesHelper.MSG_SERIES_EXIST);\n\n RightMenu.rightMenuLoading(false); \n }", "title": "" }, { "docid": "5c2beafe2a2c868e4528585741a279fc", "score": "0.52327836", "text": "function getPastSeasonalData(){\n\t\t\n\t\trolling_data = new Array;\n\t\t for (i=0; i<data_set.length-12; i++){\n\t\t\n\t\trolling_data[rolling_data.length] = [data_set[i+12][0], (data_set[i+1][1] + data_set[i+2][1] + data_set[i+3][1] + \n\t\t\t\t\t\t\t\t\t\tdata_set[i+4][1] + data_set[i+5][1] + data_set[i+6][1] + data_set[i+7][1] + data_set[i+8][1] + \t\t\t\t\t\t\t\t\t\t\t\tdata_set[i+9][1] + data_set[i+10][1] + data_set[i+11][1] + data_set[i+12][1])];\n\t}\n\t\n\tvar data = new Array;\n\tfor (i=0, j=0; i<rolling_data.length, j<data_set.length-12; i++, j++){\n\t\tdata[data.length] =[data_set[j+12][0], (data_set[j+12][1]/rolling_data[i][1])] \n\t\t\n\t}\n\t\n\treturn data;\n\t\t \n\t}", "title": "" }, { "docid": "946e2e9a99398b460f6db3de53260867", "score": "0.5221432", "text": "__cum_ops(ops) {\n\n let s_data = this.values\n let temp_val = s_data[0]\n let data = [temp_val]\n\n for (let i = 1; i < s_data.length; i++) {\n\n let curr_val = s_data[i]\n switch (ops) {\n case \"max\":\n if (curr_val > temp_val) {\n data.push(curr_val)\n temp_val = curr_val\n } else {\n data.push(temp_val)\n }\n break;\n case \"min\":\n if (curr_val < temp_val) {\n data.push(curr_val)\n temp_val = curr_val\n } else {\n data.push(temp_val)\n }\n break;\n case \"sum\":\n temp_val = temp_val + curr_val\n data.push(temp_val);\n break;\n case \"prod\":\n temp_val = temp_val * curr_val\n data.push(temp_val)\n break;\n\n }\n }\n return new Series(data)\n }", "title": "" }, { "docid": "9399df1e9fe27a5d51729264504b0416", "score": "0.5211271", "text": "function insertRandomDatapoints(value) {\n\t\t\t\t\t\tif(value == null){\n\t\t\t\t\t\t\tconsole.log(\"Opps its empty, im faster than the server :)\") // Incase the delay on > than what is being sent\n\n\t\t\t\t\t\t}\n\t\t\t\t\t else if(parseFloat(value) < 1.5 && parseFloat(value) > -0.5){ //Filter Mis interpreted data\n\t\t\t\t\t \tlet tmpData = {\n\t\t\t\t\t\t one: parseFloat(value)\n\t\t\t\t\t\t };\n\t\t\t\t\t\t \n\t\t\t\t\t\t //console.log(data.shift())\n\t\t\t\t\t\t chart1.series.addData(tmpData);\n\t\t\t\t\t\t chart1.render();\n\t\t\t\t\t\t}\n\t\t\t\t\t }", "title": "" }, { "docid": "9399df1e9fe27a5d51729264504b0416", "score": "0.5211271", "text": "function insertRandomDatapoints(value) {\n\t\t\t\t\t\tif(value == null){\n\t\t\t\t\t\t\tconsole.log(\"Opps its empty, im faster than the server :)\") // Incase the delay on > than what is being sent\n\n\t\t\t\t\t\t}\n\t\t\t\t\t else if(parseFloat(value) < 1.5 && parseFloat(value) > -0.5){ //Filter Mis interpreted data\n\t\t\t\t\t \tlet tmpData = {\n\t\t\t\t\t\t one: parseFloat(value)\n\t\t\t\t\t\t };\n\t\t\t\t\t\t \n\t\t\t\t\t\t //console.log(data.shift())\n\t\t\t\t\t\t chart1.series.addData(tmpData);\n\t\t\t\t\t\t chart1.render();\n\t\t\t\t\t\t}\n\t\t\t\t\t }", "title": "" }, { "docid": "354d8130dec1a68e792bc77e4927d738", "score": "0.520667", "text": "function onTimeSeriesSuccess(data){\n console.log(\"huzzah!\");\n }", "title": "" }, { "docid": "354d8130dec1a68e792bc77e4927d738", "score": "0.520667", "text": "function onTimeSeriesSuccess(data){\n console.log(\"huzzah!\");\n }", "title": "" }, { "docid": "354d8130dec1a68e792bc77e4927d738", "score": "0.520667", "text": "function onTimeSeriesSuccess(data){\n console.log(\"huzzah!\");\n }", "title": "" }, { "docid": "8d4dbfad473b1815d13c9b648ba0dd4c", "score": "0.52038354", "text": "function toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n } else {\n e.dataSeries.visible = true;\n };\n e.chart.render();\n }", "title": "" }, { "docid": "4a50a5950154e4355ad172c27568c529", "score": "0.5198826", "text": "get dt() {\n let timeseries = new TimeSeries({ data: this }); // parsed to date-time\n timeseries.preprocessed()\n return timeseries\n\n }", "title": "" }, { "docid": "e72fa17baa3f54e164b068e46ac610b8", "score": "0.5192274", "text": "async function prepareSeries(series) {\n var outputSeries = []\n\n for (var i = 0; i < series.length; i++) {\n const stages = await series[i].getStages()\n const seriesWithStages = {\n id: series[i].id,\n label: series[i].label,\n stages: prepareStages(stages)\n };\n\n outputSeries.push(seriesWithStages);\n }\n\n return outputSeries;\n}", "title": "" }, { "docid": "1f97c8fcfbb4861d79598cfbc92f2d2d", "score": "0.5181364", "text": "processData(render = true) {\n this.seriesCounts = 0;\n for (const series of this.visibleSeries) {\n series.dataModule = new Data(series.dataSource || this.dataSource, series.query);\n series.refreshDataManager(this, render);\n }\n }", "title": "" }, { "docid": "a2d4cce317d53fb80419c41cee726f60", "score": "0.51788425", "text": "prepareData() {\n let leftStack = 0;\n let midStack = 0;\n let rightStack = 0;\n\n const values = [];\n\n // The mid point should be between the left and side value, which are stacked.\n this.model.non_target_series().forEach((s) => {\n // Calculate the mid point boundaries\n const minValue = Math.min(leftStack + s.present_value(), rightStack + s.future_value());\n const maxValue = Math.max(leftStack + s.present_value(), rightStack + s.future_value());\n\n let midPoint =\n s.safe_future_value() > s.safe_present_value()\n ? s.safe_present_value()\n : s.safe_future_value();\n\n midPoint += midStack;\n\n // This ensures that if the chart shows an overall increasing trend that we do not plot a\n // value which appears to show a decrease in the midYear, and vice-versa.\n midPoint = midPoint < minValue ? minValue : midPoint > maxValue ? maxValue : midPoint;\n\n // The stacking function wants the non-stacked values\n midPoint -= midStack;\n\n midStack += midPoint;\n leftStack += s.safe_present_value();\n rightStack += s.safe_future_value();\n\n const id = s.get('gquery_key');\n const midYear = (this.startYear + this.endYear) / 2;\n\n values.push({ id, x: this.startYear, y: s.safe_present_value() });\n values.push({ id, x: midYear, y: midPoint });\n values.push({ id, x: this.endYear, y: s.safe_future_value() });\n });\n\n return values;\n }", "title": "" } ]
0e49d5f827e21f24a5db6ea49f4f0790
add selectors/cssText to node tree
[ { "docid": "e2fef9290a34a039a975164d7336099a", "score": "0.5356511", "text": "function parseCss(node, text) {\n var t = text.substring(node.start, node.end - 1);\n node.parsedCssText = node.cssText = t.trim();\n if (node.parent) {\n var ss = node.previous ? node.previous.end : node.parent.start;\n t = text.substring(ss, node.start - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n var s = node.parsedSelector = node.selector = t.trim();\n node.atRule = s.indexOf(AT_START) === 0;\n // note, support a subset of rule types...\n if (node.atRule) {\n if (s.indexOf(MEDIA_START) === 0) {\n node.type = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node.type = types.KEYFRAMES_RULE;\n node.keyframesName = node.selector.split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node.type = types.MIXIN_RULE;\n } else {\n node.type = types.STYLE_RULE;\n }\n }\n }\n var r$ = node.rules;\n if (r$) {\n for (var i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}", "title": "" } ]
[ { "docid": "6537af44625d406d54ac068dc45d6fd2", "score": "0.60261416", "text": "function addStyles() {\n document.body.previousElementSibling.appendChild(\n DOM('style', undefined, [document.createTextNode(css)])\n );\n }", "title": "" }, { "docid": "550a1999a0c0a4d13483cb2b1118aaef", "score": "0.6000518", "text": "function applyCSS() {\r\n [].forEach.call(arguments, function(cssText) {\r\n var style; with(style = document.createElement(\"style\")) {\r\n type = \"text/css\";\r\n appendChild(document.createTextNode(parseCSSRule(cssText)));\r\n } $(\"head\").appendChild(style);\r\n });\r\n }", "title": "" }, { "docid": "19c3b00d38952abade96dde46753991d", "score": "0.59481734", "text": "function addStyles() {\n var styles = document.createElement('style');\n styles.id = 'styles';\n document.documentElement.appendChild(styles);\n\n var cssText =\n '#root {' +\n ' position: relative;' +\n ' width: 400px;' +\n ' height: 200px;' +\n ' background: #eee' +\n '}' +\n '#grand-parent {' +\n ' position: relative;' +\n ' width: 200px;' +\n ' height: 200px;' +\n '}' +\n '#parent {' +\n ' position: absolute;' +\n ' top: 0px;' +\n ' left: 200px;' +\n ' overflow: hidden;' +\n ' width: 200px;' +\n ' height: 200px;' +\n ' background: #ddd;' +\n '}' +\n '#target1, #target2, #target3, #target4, #target5 {' +\n ' position: absolute;' +\n ' top: 0px;' +\n ' left: 0px;' +\n ' width: 20px;' +\n ' height: 20px;' +\n ' transform: translateX(0px) translateY(0px);' +\n ' transition: transform .5s;' +\n ' background: #f00;' +\n '}';\n\n // IE8 doesn't allow setting innerHTML on a <style> element.\n if (styles.styleSheet) {\n styles.styleSheet.cssText = cssText;\n }\n else {\n styles.innerHTML = cssText;\n }\n}", "title": "" }, { "docid": "617cc7c6fe0dbe8aa9b87ae68459889a", "score": "0.590363", "text": "function add_css$d() {\n var style = element(\"style\");\n style.id = \"svelte-146sq5f-style\";\n style.textContent = \".tree.svelte-146sq5f{--json-tree-font-family:monospace;--json-tree-font-size:14px;--json-tree-null-color:#757575}.label.svelte-146sq5f{margin-bottom:0;text-transform:none}h3.svelte-146sq5f{text-transform:uppercase}ul.svelte-146sq5f{padding-left:0}li.svelte-146sq5f{list-style:none;margin:0;margin-bottom:5px}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "68dd62ed5d30eec4938bbb70cc0a668f", "score": "0.58566046", "text": "function applyStyle(tree) {\n var all = tree.getElementsByTagName(\"*\");\n for (var i=0; i<all.length; i++) {\n applyStyleManual(all[i]);\n }\n return tree;\n}", "title": "" }, { "docid": "d97644b63be2c44bb3f14b06a9030650", "score": "0.5670026", "text": "function addDomNodes(){___jdce_logger(\"/build/elm.js\", 569);}", "title": "" }, { "docid": "305a725a95382d99d4486403d6b4caca", "score": "0.5668057", "text": "function GM_addStyle(css) {\r\n\tvar parent = document.getElementsByTagName(\"head\")[0];\r\n\tif (!parent) {\r\n\t\tparent = document.documentElement;\r\n\t}\r\n\tvar style = document.createElement(\"style\");\r\n\tstyle.type = \"text/css\";\r\n\tvar textNode = document.createTextNode(css);\r\n\tstyle.appendChild(textNode);\r\n\tparent.appendChild(style);\r\n}", "title": "" }, { "docid": "db6be2862f4f68f2caa9018a32531d5a", "score": "0.56656414", "text": "function add_css$1() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-1oysp7o-style\";\n \tstyle.textContent = \".menu.svelte-1oysp7o.svelte-1oysp7o{padding:3px;background-color:#0008;color:#EEF;border-radius:5px;margin-top:5px;position:absolute;backdrop-filter:blur(3px) saturate(160%) contrast(45%) brightness(140%);border:1px solid rgb(88,88,88);box-shadow:0 0 1px rgb(146,146,148) inset}.menuitem.svelte-1oysp7o.svelte-1oysp7o{display:flex;align-items:center;padding:1px 5px}.menuitem.svelte-1oysp7o.svelte-1oysp7o:hover{display:flex;align-items:center;background-color:rgb(57,131,223);padding:1px 5px;border-radius:5px}.menuitem.svelte-1oysp7o img.svelte-1oysp7o{padding-right:5px}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "bb8e4da29e69f29db95a69e64ed367e4", "score": "0.56095135", "text": "addStyle() {\n //write own css parser\n const style = document.createElement('style');\n const userStyles = this.styles();\n if (userStyles) {\n var text = \"\";\n Object.keys(userStyles).forEach(selector => {\n text += selector + \" { \\n\";\n userStyles[selector].forEach((item, _)=> {\n const key = Object.keys(item);\n const val = item[key];\n text += key + \":\" + val + \";\\n\";\n })\n text += \"}\\n\\n\";\n });\n //create style tag\n const cssNode = document.createElement('style');\n cssNode.type = 'text/css';\n if (css.styleSheet) {\n cssNode.styleSheet.cssText = text;\n } else {\n cssNode.appendChild(document.createTextNode(text));\n }\n document.getElementsByTagName('head')[0].appendChild(cssNode);\n }\n }", "title": "" }, { "docid": "b1ba8ed12903a9cd7c628ca09ef82849", "score": "0.5599428", "text": "function add_css() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-snamjk-style\";\n\tstyle.textContent = \".layers.svelte-snamjk{display:inline-block;position:relative}.layers.svelte-snamjk .fa{position:absolute;bottom:0;left:0;right:0;top:0;margin:auto;text-align:center}.layers.svelte-snamjk .layers-text{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.layers.svelte-snamjk .layers-text span{display:inline-block}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "56a4b824a4615b5f24753adb6d079ea3", "score": "0.5573382", "text": "function cacheSelectors() {\n nodes = {\n htmlEl: document.querySelector(selectors.htmlEl),\n header: document.querySelector(selectors.header),\n navToggle: document.querySelector(selectors.navToggle),\n slideOutMenu: document.querySelector(selectors.slideOutMenu),\n }\n }", "title": "" }, { "docid": "0a4b01fc175e6c05948200c8a5ea5860", "score": "0.5570355", "text": "static _appendStyleNode(root, child) {\n return root.appendChild(Node.createNode(child()))\n }", "title": "" }, { "docid": "f880eaab2372e5d93b4f5df5d6fd0306", "score": "0.55604374", "text": "applyCSS() {\n if (this.isUIcreated() && this.className !== undefined) {\n this.node.className = this.className;\n }\n }", "title": "" }, { "docid": "9b50916f51214357b0768a6e60f3b6fe", "score": "0.5548175", "text": "function add_css() {\n \tvar style = element(\"style\");\n \tstyle.id = 'svelte-1npu1ar-style';\n \tstyle.textContent = \".container.svelte-1npu1ar{position:absolute;opacity:0.9;background-color:#020;color:lime;font-family:monospace;font-size:12px;backface-visibility:hidden}.top-left.svelte-1npu1ar{top:0;left:0}.top-right.svelte-1npu1ar{top:0;right:0}.bottom-left.svelte-1npu1ar{bottom:0;left:0}.bottom-right.svelte-1npu1ar{bottom:0;right:0}.value.svelte-1npu1ar{will-change:content}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "8047eb8df8dcac4b2e6e46ecf25492fd", "score": "0.5510863", "text": "function add_css$d() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-16snxfm-style\";\n \tstyle.textContent = \".s-list-item-group .s-list-item.active{color:inherit}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "d3f537e54d79d561fd2542eb5dc91780", "score": "0.54953057", "text": "function GM_addStyle(css) {\r\n\t\tvar NSURI = 'http://www.w3.org/1999/xhtml';\r\n\t\tvar hashead = document.getElementsByTagName('head')[0];\r\n\t\tvar parentel = hashead || document.documentElement;\r\n\t\tvar newElement = document.createElementNS(NSURI,'link');\r\n\t\tnewElement.setAttributeNS(NSURI,'rel','stylesheet');\r\n\t\tnewElement.setAttributeNS(NSURI,'type','text/css');\r\n\t\tnewElement.setAttributeNS(NSURI,'href','data:text/css,'+encodeURIComponent(css));\r\n\t\tif( hashead ) {\r\n\t\t\tparentel.appendChild(newElement);\r\n\t\t} else {\r\n\t\t\tparentel.insertBefore(newElement,parentel.firstChild);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "2e03498347bdcc3377ef60bfd5b1e4ed", "score": "0.5467953", "text": "function add_css$1() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-3osed3-style\";\n\tstyle.textContent = \"#selected-weeks.svelte-3osed3 ul.svelte-3osed3{list-style:none}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "1701b9a2bca3ff778e264bc45dd107b8", "score": "0.54608697", "text": "function add_css$9() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-26hi2l-style\";\n\tstyle.textContent = \".priority-stripe.svelte-26hi2l{width:1px;position:relative;margin:-5px 4px -5px -4px}.both.svelte-26hi2l{background-color:purple}.urgent.svelte-26hi2l{background-color:red}.important.svelte-26hi2l{background-color:yellow}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "76c629a00300da0f04aea3a1f1b16727", "score": "0.5455211", "text": "function add_css() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-cuvd8d-style\";\n \tstyle.textContent = \".container.svelte-cuvd8d{padding:80px 16px 12px 16px;overflow-y:hidden;height:100vh}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "909d3980854772b0741e3e7fe33ed35d", "score": "0.54499865", "text": "function exportCss(){\n\tvar txt=\"\";\n\tvar selected=$(\".PassiveTreeNode[style]\");\n\t\n\tfor(var i=selected.length-1;i>=0;i--){\n\t\ttxt+=\"<div>#\"+selected[i].id+\"{\\n \"+$(selected[i]).attr(\"style\")+\"\\n}</div>\";\n\t}\n\t\n\t$(\"#calculator\")[0].innerHTML=txt;\n}", "title": "" }, { "docid": "cd90a6061f1eabce261eb2f975751949", "score": "0.54408574", "text": "function add_css$3() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-1i0zb4n-style\";\n \tstyle.textContent = \".tray-menus.svelte-1i0zb4n{display:flex;flex-direction:row;justify-content:flex-end}.wails-menubar.svelte-1i0zb4n{position:relative;display:block;top:0;height:2rem;width:100%;border-bottom:1px solid #b3b3b3;box-shadow:0 0 10px 0 #33333360}.time.svelte-1i0zb4n{padding-left:0.5rem;padding-right:1.5rem;overflow:visible;font-size:14px}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "c2f4685706aac2834f9b358ab1680bb1", "score": "0.54388547", "text": "function importCustomSelectorsFromCSSAST(root) {\n\treturn getCustomSelectors(root);\n}", "title": "" }, { "docid": "1d2404252c3b3a0b1d6c052c458433f7", "score": "0.54216623", "text": "add_selector(){\n\t\tlet new_selectors = Object.assign({}, this.state.selectors);\n\n\t\tlet new_id = uniqid();\n\t\tnew_selectors[new_id] = {\n\t\t\tselector_id: new_id,\n\t\t\tcss_selector: this.state.add_selector_field,\n\t\t\ttag: false,\n\t\t\tregex: '',\n\t\t\tattr: 'innerText',\n\t\t\turls: [],\n\t\t}\n\t\tthis.setState({selectors: new_selectors})\n\t\tthis.setState({add_selector_field: ''})\n\t\tthis.props.actions.set_crawl_selectors(new_selectors)\n\t}", "title": "" }, { "docid": "bb4d7bcd232d558375528ad61c956de7", "score": "0.5420793", "text": "function add_css$a() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-ei8tge-style\";\n\tstyle.textContent = \".tq-task.svelte-ei8tge.svelte-ei8tge{background-color:var(--background-secondary);border-bottom:thin solid var(--background-modifier-border);padding:5px}.task-row.svelte-ei8tge.svelte-ei8tge{display:flex}.task-line.svelte-ei8tge.svelte-ei8tge{flex:1}.expanded-root.svelte-ei8tge.svelte-ei8tge{margin:10px 0}.overdue-alert.svelte-ei8tge.svelte-ei8tge{padding:0 10px}.expand-chevron.svelte-ei8tge.svelte-ei8tge{display:inline-block;padding:0 10px}.rotated-180.svelte-ei8tge.svelte-ei8tge{transform:rotate(180deg)}.task-content.svelte-ei8tge div.svelte-ei8tge{margin:5px}.label.svelte-ei8tge.svelte-ei8tge{width:150px;display:inline-block}.value.svelte-ei8tge.svelte-ei8tge{width:300px}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "745a8228b9fa318dc4197631b59a6927", "score": "0.54096186", "text": "function addsCSS(css){\n var node = document.createElement(\"style\");\n node.appendChild(document.createTextNode(css));\n document.querySelector(\"head\").appendChild(node);\n}", "title": "" }, { "docid": "b590ef4bc991d027afc3f17b1fe114f1", "score": "0.5393012", "text": "function add_css$e() {\n var style = element(\"style\");\n style.id = \"svelte-13qih23-style\";\n style.textContent = \".item.svelte-13qih23.svelte-13qih23{padding:10px}.item.svelte-13qih23.svelte-13qih23:not(:first-child){border-top:1px dashed #aaa}.item.svelte-13qih23 div.svelte-13qih23{float:right;text-align:right}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "70b17dc86d29444bb6f67573acad6e21", "score": "0.5376271", "text": "function add_css$5() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-1xheq3f-style\";\n \tstyle.textContent = \".s-subheader.svelte-1xheq3f{align-items:center;display:flex;height:48px;font-size:0.875rem;font-weight:400;padding:0 16px 0 16px;color:var(--theme-text-secondary)}.s-subheader.inset.svelte-1xheq3f{margin-left:56px}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "270a0fe7e4f92207f252c0ae57757ba7", "score": "0.5374202", "text": "function parseCss(node, text) {\n\t\t var t = text.substring(node.start, node.end - 1);\n\t\t node.parsedCssText = node.cssText = t.trim();\n\t\t if (node.parent) {\n\t\t var ss = node.previous ? node.previous.end : node.parent.start;\n\t\t t = text.substring(ss, node.start - 1);\n\t\t t = _expandUnicodeEscapes(t);\n\t\t t = t.replace(RX.multipleSpaces, ' ');\n\t\t // TODO(sorvell): ad hoc; make selector include only after last ;\n\t\t // helps with mixin syntax\n\t\t t = t.substring(t.lastIndexOf(';') + 1);\n\t\t var s = node.parsedSelector = node.selector = t.trim();\n\t\t node.atRule = s.indexOf(AT_START) === 0;\n\t\t // note, support a subset of rule types...\n\t\t if (node.atRule) {\n\t\t if (s.indexOf(MEDIA_START) === 0) {\n\t\t node.type = types.MEDIA_RULE;\n\t\t } else if (s.match(RX.keyframesRule)) {\n\t\t node.type = types.KEYFRAMES_RULE;\n\t\t node.keyframesName = node.selector.split(RX.multipleSpaces).pop();\n\t\t }\n\t\t } else {\n\t\t if (s.indexOf(VAR_START) === 0) {\n\t\t node.type = types.MIXIN_RULE;\n\t\t } else {\n\t\t node.type = types.STYLE_RULE;\n\t\t }\n\t\t }\n\t\t }\n\t\t var r$ = node.rules;\n\t\t if (r$) {\n\t\t for (var i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) {\n\t\t parseCss(r, text);\n\t\t }\n\t\t }\n\t\t return node;\n\t\t}", "title": "" }, { "docid": "cb76cc47be8a9e4ed5052e05e0cc59ff", "score": "0.53391063", "text": "function add_css() {\n\tvar style = !(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(\"style\");\n\tstyle.id = \"svelte-yincb9-style\";\n\tstyle.textContent = \".is-borderless.svelte-yincb9{box-shadow:none}.is-bordered.svelte-yincb9{border-top:solid 1px rgba(10, 10, 10, 0.1);border-bottom:solid 1px rgba(10, 10, 10, 0.1);background-color:rgba(10, 10, 10, 0.035)}\";\n\t!(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(document.head, style);\n}", "title": "" }, { "docid": "91d761b3bdb599329b544e88f469a1bf", "score": "0.53387004", "text": "function cloneNodes(sourceNode,targetNode){var newNode=sourceNode.cloneNode(false);targetNode.appendChild(newNode);if(!sourceNode.tagName)return;// skip inner text\n// compare computed styles at this node and apply the differences directly\napplyStyles(sourceNode,newNode);_.each(sourceNode.childNodes,function(childNode){\n// clone each child node and apply styles\ncloneNodes(childNode,newNode)})}", "title": "" }, { "docid": "04fcef802384993bc8917f81ff651c45", "score": "0.5334416", "text": "function styleNodeByTag(node, tagName, className) {\n if (className === void 0) { className = ''; }\n if (node.localName === tagName) {\n node.classList.add('jp-mod-styled');\n }\n if (node.localName === 'select') {\n wrapSelect(node);\n }\n var nodes = node.getElementsByTagName(tagName);\n for (var i = 0; i < nodes.length; i++) {\n var child = nodes[i];\n child.classList.add('jp-mod-styled');\n if (className) {\n child.classList.add(className);\n }\n if (tagName === 'select') {\n wrapSelect(child);\n }\n }\n }", "title": "" }, { "docid": "88d9a08a479d8131a9d74e2a0244a000", "score": "0.5313659", "text": "function add_css() {\n\tvar style = !(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(\"style\");\n\tstyle.id = \"svelte-aiter3-style\";\n\tstyle.textContent = \".control-switch.svelte-aiter3{padding-top:0.4rem}.has-border.svelte-aiter3{border-color:#dbdbdb}.has-dark-background.svelte-aiter3{background-color:#484848;border-color:#484848;color:#fff}\";\n\t!(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(document.head, style);\n}", "title": "" }, { "docid": "7c31c88d2a6368c57decea597a09465b", "score": "0.52947325", "text": "function ensureCSSAdded() {\n if (!cssNode) {\n cssNode = document.createElement(\"style\")\n cssNode.textContent = \"/* ProseMirror CSS */\\n\" + accumulatedCSS\n document.head.insertBefore(cssNode, document.head.firstChild)\n }\n}", "title": "" }, { "docid": "dce6204ed772ae061cb46b9b169e7b1f", "score": "0.52786845", "text": "append(target, node){}", "title": "" }, { "docid": "77485be448d5a156f39101461bf1e69f", "score": "0.5269383", "text": "function addNodeTo(e,t){var n=y.createElement(\"div\");return t&&addClass(n,t),e.appendChild(n),n}", "title": "" }, { "docid": "1acbaf9cf8d7f7dd8eaa78cb3f3c7b78", "score": "0.52656597", "text": "function add_css$5() {\n\tvar style = element$1(\"style\");\n\tstyle.id = \"svelte-1widvzq-style\";\n\tstyle.textContent = \".dot.svelte-1widvzq,.hollow.svelte-1widvzq{display:inline-block;height:6px;width:6px;margin:0 1px}.filled.svelte-1widvzq{fill:var(--color-dot)}.active.filled.svelte-1widvzq{fill:var(--text-on-accent)}.hollow.svelte-1widvzq{fill:none;stroke:var(--color-dot)}.active.hollow.svelte-1widvzq{fill:none;stroke:var(--text-on-accent)}\";\n\tappend$1(document.head, style);\n}", "title": "" }, { "docid": "8775400c74c8650b00b0f6e35d941285", "score": "0.52617925", "text": "function add_css$o() {\n var style = element(\"style\");\n style.id = \"svelte-1fu900w-style\";\n style.textContent = \"label.svelte-1fu900w{color:#666}.option.svelte-1fu900w{margin-bottom:20px}.value.svelte-1fu900w{font-weight:bold;color:#000}input[type='checkbox'].svelte-1fu900w{vertical-align:middle}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "b846a034966896ee25a8eae2b17cb036", "score": "0.5261496", "text": "function applySettings(node) {\n node.style.color = settings.text_color;\n node.style.backgroundColor = settings.bg_color;\n node.style.fontFamily = settings.font_type;\n node.style.fontSize = settings.font_size;\n }", "title": "" }, { "docid": "e1d6b41cf344fa74525f1268764e3d20", "score": "0.525857", "text": "toggleSelectorType() {\n this.node.type = this.node.type === 'CSS' ? 'XPATH' : 'CSS';\n }", "title": "" }, { "docid": "59aee2878528e6f331dca9c89d882824", "score": "0.52582794", "text": "function add_css$3() {\n var style = element(\"style\");\n style.id = \"svelte-rwxv37-style\";\n style.textContent = \"label.svelte-rwxv37{display:inline-block}.indent.svelte-rwxv37{padding-left:var(--li-identation)}.collapse.svelte-rwxv37{--li-display:inline;display:inline;font-style:italic}.comma.svelte-rwxv37{margin-left:-0.5em;margin-right:0.5em}label.svelte-rwxv37{position:relative}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "a37b48c938706050b570cb14dce39cb9", "score": "0.5258025", "text": "function add_css(target) {\n\tappend_styles(target, \"svelte-k4twlx\", \".builder-add-item.svelte-k4twlx{position:absolute;top:12px;bottom:12px;right:146px;width:42px;background:rgba(0, 0, 0, 0.3);border:none;color:white}.builder-add-item.svelte-k4twlx:hover{text-decoration:underline}\");\n}", "title": "" }, { "docid": "0d3da8af7aef953f2a2ca31521cedee1", "score": "0.52460784", "text": "function add_css$7() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1ob2bqt-style\";\n\tstyle.textContent = \".expense-payee.svelte-1ob2bqt{width:100%}.expense-category.svelte-1ob2bqt{flex:1}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "9696002c153d6bedcd4a55663703282e", "score": "0.5240957", "text": "function add_css() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-sfucw8-style\";\n\tstyle.textContent = \".buttons.svelte-sfucw8.svelte-sfucw8{display:flex;justify-content:space-between;gap:5px}.buttons.svelte-sfucw8 button.svelte-sfucw8{flex:1;margin:5px 0;padding:5px 10px}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "cd6112c86e650d1d2a6009789bf7bb5b", "score": "0.5237478", "text": "function add_css() {\n\tvar style = !(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(\"style\");\n\tstyle.id = \"svelte-1uaw9yz-style\";\n\tstyle.textContent = \".panel-section.svelte-1uaw9yz.svelte-1uaw9yz{padding:1em}.panel-button.svelte-1uaw9yz.svelte-1uaw9yz{border-radius:4px}.is-darkmode.svelte-1uaw9yz .panel-heading.svelte-1uaw9yz{border:1px solid #363636}.is-darkmode.svelte-1uaw9yz .panel-section.svelte-1uaw9yz{background-color:#222 !important;border-color:#333}\";\n\t!(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(document.head, style);\n}", "title": "" }, { "docid": "2f177606f2accada85f005da9efce554", "score": "0.523176", "text": "function add_css() {\n\tvar style = !(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(\"style\");\n\tstyle.id = \"svelte-o7a14x-style\";\n\tstyle.textContent = \".toggle-icon.svelte-o7a14x{cursor:pointer}\";\n\t!(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(document.head, style);\n}", "title": "" }, { "docid": "8fcb82017e136dbf238aaab88c8f2a74", "score": "0.52287686", "text": "function useCSS() {\n// var style = document.createElement('style');\n// style.type = 'text/css';\n// style.innerHTML = 'content';\n// document.getElementsByTagName('head')[0].appendChild(style); \n}", "title": "" }, { "docid": "6143bb4b20a4fdf9dade4815a1c42d82", "score": "0.52219045", "text": "function add_css$8() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-thzc0h-style\";\n\tstyle.textContent = \".hidden.svelte-thzc0h{display:none}label.svelte-thzc0h{width:150px;display:inline-block}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "645cb6eacfb0918da379dadefb16c702", "score": "0.52218854", "text": "function add_css() {\n var style = element(\"style\");\n style.id = \"svelte-14p9tpy-style\";\n style.textContent = \".menu.svelte-14p9tpy{display:flex;margin-top:-10px;flex-direction:row-reverse;border:1px solid #ccc;border-radius:5px 5px 0 0;height:25px;line-height:25px;margin-right:-500px;transform-origin:bottom right;transform:rotate(-90deg) translate(0, -500px)}.menu-item.svelte-14p9tpy{line-height:25px;cursor:pointer;border:0;background:#fefefe;color:#555;padding-left:15px;padding-right:15px;text-align:center}.menu-item.svelte-14p9tpy:first-child{border-radius:0 5px 0 0}.menu-item.svelte-14p9tpy:last-child{border-radius:5px 0 0 0}.menu-item.active.svelte-14p9tpy{cursor:default;font-weight:bold;background:#ddd;color:#555}.menu-item.svelte-14p9tpy:hover,.menu-item.svelte-14p9tpy:focus{background:#eee;color:#555}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "0febd70ebbddc19feca08131aa31895d", "score": "0.52187437", "text": "function addAnimatedStyles(node, styles) {\n if ('update' in node) {\n styles.add(node);\n } else {\n node.getChildren().forEach(child => addAnimatedStyles(child, styles));\n }\n}", "title": "" }, { "docid": "0febd70ebbddc19feca08131aa31895d", "score": "0.52187437", "text": "function addAnimatedStyles(node, styles) {\n if ('update' in node) {\n styles.add(node);\n } else {\n node.getChildren().forEach(child => addAnimatedStyles(child, styles));\n }\n}", "title": "" }, { "docid": "e42af14d924706daf2931f03231aecb6", "score": "0.5215612", "text": "function addStyles(){\r\n var styleSheet = document.getElementsByTagName(\"style\")[0];\r\n var styles = \"\";\r\n\r\n styles += customPrettyPrint = this.createStyle(\".pretty-print-custom\",[\r\n {prop: \"margin-top\", value: \"1em\"},\r\n {prop: \"margin-left\", value: \"20px\"}\r\n ]);\r\n\r\n for (t of THEME_LIST){\r\n styles += this.createStyle(\"body.\" + t.name, [\r\n {prop: \"color\", value: t.textColor},\r\n {prop: \"background-color\", value: t.backgroundColor},\r\n {prop: \"font-family\", value: t.fontFamily},\r\n {prop: 'font-size', value: t.fontSize}\r\n ]);\r\n styles += this.createStyle(\"body.\" + t.name + \" .html-tag\", [{prop: \"color\", value: t.tag}]);\r\n styles += this.createStyle(\"body.\" + t.name + \" .html-attribute-name\", [{prop: \"color\", value: t.attrName}]);\r\n styles += this.createStyle(\"body.\" + t.name + \" .html-attribute-value\", [{prop: \"color\", value: t.attrValue}]);\r\n styles += this.createStyle(\"body.\" + t.name + \" .html-comment\", [{prop: \"color\", value: t.comment}]);\r\n }\r\n \r\n styleSheet.appendChild(document.createTextNode(styles));\r\n}", "title": "" }, { "docid": "0c1b8de844cb1b979b56a11956067eca", "score": "0.5210165", "text": "function add_css$2() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-1r8bagc-style\";\n\tstyle.textContent = \".form.svelte-1r8bagc input.svelte-1r8bagc{border-radius:0.5em;padding:19px 14px}#interval-selector.svelte-1r8bagc.svelte-1r8bagc{width:60px;height:40px}.interval-row.svelte-1r8bagc.svelte-1r8bagc{margin:5px 0px}#frequency-selector.svelte-1r8bagc.svelte-1r8bagc{width:103px;height:40px}#onthe-selector.svelte-1r8bagc.svelte-1r8bagc{width:60px;height:40px}\";\n\tappend(document.head, style);\n}", "title": "" }, { "docid": "befaeba46513667ae12509307f614859", "score": "0.5204368", "text": "function setupCssStyles() {\n var style = document.createElement('style');\n style.type = 'text/css';\n \n function setupSelectionCss(enabled) {\n var selectionString = \"-webkit-touch-callout: \"+(enabled?\"default\":\"none\")+\";\";\n helpers.forEachPrefix(function(prefix) {\n selectionString += prefix+\"user-select:\"+(enabled?\"text\":\"none\")+\";\";\n },true);\n return selectionString;\n }\n \n // FIXME: how to remove the html height requirement?\n // FIXME: how to remove the transform origin?\n style.innerHTML = \".zoomTarget{\"+setupSelectionCss(false)+\"}\"+\n \".zoomTarget:hover{cursor:pointer!important;}\"+\n \".zoomNotClickable{\"+setupSelectionCss(true)+\"}\"+\n \".zoomNotClickable:hover{cursor:auto!important;}\"+\n /* padding to fix margin collapse issues */\n \".zoomContainer{position:relative;padding:1px;margin:-1px;}\";\n \n document.getElementsByTagName('head')[0].appendChild(style);\n }", "title": "" }, { "docid": "bc2785f27aec9607a8d02ed918555192", "score": "0.52042955", "text": "function addAnimatedStyles(node, styles) {\n if ('update' in node) {\n styles.add(node);\n } else {\n node.getChildren().forEach(function (child) {\n return addAnimatedStyles(child, styles);\n });\n }\n}", "title": "" }, { "docid": "3f4a8255f2de2363e909d0c486ee02cc", "score": "0.52004856", "text": "function styleNodeByTag(node, tagName, className = '') {\n if (node.localName === tagName) {\n node.classList.add('jp-mod-styled');\n }\n if (node.localName === 'select') {\n wrapSelect(node);\n }\n let nodes = node.getElementsByTagName(tagName);\n for (let i = 0; i < nodes.length; i++) {\n let child = nodes[i];\n child.classList.add('jp-mod-styled');\n if (className) {\n child.classList.add(className);\n }\n if (tagName === 'select') {\n wrapSelect(child);\n }\n }\n }", "title": "" }, { "docid": "17939af9d7cd958434e4592a329f4903", "score": "0.51933324", "text": "function add_css(target) {\n\tappend_styles(target, \"svelte-133qdtd\", \"g.svelte-133qdtd{paint-order:stroke;stroke-width:3px;stroke:var(--visual-math-line-color);stroke-opacity:0.75}\");\n}", "title": "" }, { "docid": "b1fa10ecd6ccf7d7531a28d10b903fdf", "score": "0.51930946", "text": "function setupNodeDom(node, tree) {\n\n //get the first div element\n element.children(\":first\")\n //set the padding\n .css(\"padding-left\", (node.level * 20) + \"px\");\n\n //remove first 'ins' if there is no children\n //show/hide last 'ins' depending on children\n if (!node.hasChildren) {\n element.find(\"ins:first\").remove();\n element.find(\"ins\").last().hide();\n }\n else {\n element.find(\"ins\").last().show();\n }\n\n var icon = element.find(\"i:first\");\n icon.addClass(node.cssClass);\n icon.attr(\"title\", node.routePath);\n\n element.find(\"a:first\").html(node.name);\n\n if (!node.menuUrl) {\n element.find(\"a.umb-options\").remove();\n }\n\n if (node.style) {\n element.find(\"i:first\").attr(\"style\", node.style);\n }\n }", "title": "" }, { "docid": "a9860893611796d695bf26b16fbe1690", "score": "0.5180734", "text": "function insertCSS (text) {\n\t var cssEl = document.createElement('style')\n\t cssEl.textContent = text\n\t document.head.appendChild(cssEl)\n\t }", "title": "" }, { "docid": "b8b821e0308e44b2306769b475db82a3", "score": "0.51783836", "text": "function add_css$i() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-bhgnu-style\";\n \tstyle.textContent = \".s-item-group{flex:0 1 auto;position:relative;max-width:100%;transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1)}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "f907ebba6a3acc08c7558c6af6c7251e", "score": "0.5173068", "text": "function add_css$l() {\n var style = element(\"style\");\n style.id = \"svelte-ztcwsu-style\";\n style.textContent = \"table.svelte-ztcwsu.svelte-ztcwsu{font-size:12px;border-collapse:collapse;border:1px solid #ddd;padding:0}tr.svelte-ztcwsu.svelte-ztcwsu{cursor:pointer}tr.svelte-ztcwsu:hover td.svelte-ztcwsu{background:#eee}tr.selected.svelte-ztcwsu td.svelte-ztcwsu{background:#eee}td.svelte-ztcwsu.svelte-ztcwsu{padding:10px;height:10px;line-height:10px;font-size:12px;border:none}th.svelte-ztcwsu.svelte-ztcwsu{background:#888;color:#fff;padding:10px;text-align:center}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "ecd42f0143a332d253748e5d084d9296", "score": "0.5163343", "text": "function add_css$4() {\n\tvar style = element$1(\"style\");\n\tstyle.id = \"svelte-q3wqg9-style\";\n\tstyle.textContent = \".day.svelte-q3wqg9{background-color:var(--color-background-day);border-radius:4px;color:var(--color-text-day);cursor:pointer;font-size:0.8em;height:100%;padding:4px;position:relative;text-align:center;transition:background-color 0.1s ease-in, color 0.1s ease-in;vertical-align:baseline}.day.svelte-q3wqg9:hover{background-color:var(--interactive-hover)}.day.active.svelte-q3wqg9:hover{background-color:var(--interactive-accent-hover)}.adjacent-month.svelte-q3wqg9{opacity:0.25}.today.svelte-q3wqg9{color:var(--color-text-today)}.day.svelte-q3wqg9:active,.active.svelte-q3wqg9,.active.today.svelte-q3wqg9{color:var(--text-on-accent);background-color:var(--interactive-accent)}.dot-container.svelte-q3wqg9{display:flex;flex-wrap:wrap;justify-content:center;line-height:6px;min-height:6px}\";\n\tappend$1(document.head, style);\n}", "title": "" }, { "docid": "60041b898f211db45cd0c9c129695bec", "score": "0.51604253", "text": "function addStyle(css) {\r\n\r\n\tif (typeof GM_addStyle !== 'undefined') { \r\n\t\treturn GM_addStyle(css); \r\n\t\t}\r\n\r\n\telse if (heads = document.getElementsByTagName('head')) {\r\n\t\tvar style = document.createElement('style');\r\n\t\ttry { style.innerHTML = css; }\r\n\t\tcatch(x) { style.innerText = css; }\r\n\t\tstyle.type = 'text/css';\r\n\t\theads[0].appendChild(style);\r\n\t\t}\r\n}", "title": "" }, { "docid": "60041b898f211db45cd0c9c129695bec", "score": "0.51604253", "text": "function addStyle(css) {\r\n\r\n\tif (typeof GM_addStyle !== 'undefined') { \r\n\t\treturn GM_addStyle(css); \r\n\t\t}\r\n\r\n\telse if (heads = document.getElementsByTagName('head')) {\r\n\t\tvar style = document.createElement('style');\r\n\t\ttry { style.innerHTML = css; }\r\n\t\tcatch(x) { style.innerText = css; }\r\n\t\tstyle.type = 'text/css';\r\n\t\theads[0].appendChild(style);\r\n\t\t}\r\n}", "title": "" }, { "docid": "b1a07e4ef2d7112a692fb025ec44ffad", "score": "0.5151028", "text": "function addNodes(changes, nodes) {\n for (var i = 0; i < nodes.length; i++) {\n var el = nodes[i];\n if (!(el instanceof Element)) {\n continue;\n }\n\n var matches = selectorSet.matches(el);\n for (var j = 0; j < matches.length; j++) {\n var data = matches[j].data;\n\n changes.push(['add', el, data]);\n }\n\n var matches2 = selectorSet.queryAll(el);\n for (var _j = 0; _j < matches2.length; _j++) {\n var _matches2$_j = matches2[_j],\n _data = _matches2$_j.data,\n elements = _matches2$_j.elements;\n\n for (var k = 0; k < elements.length; k++) {\n changes.push(['add', elements[k], _data]);\n }\n }\n }\n}", "title": "" }, { "docid": "094e48e800f49c3aefdcd3e0c4dcf4e0", "score": "0.5150597", "text": "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "094e48e800f49c3aefdcd3e0c4dcf4e0", "score": "0.5150597", "text": "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "094e48e800f49c3aefdcd3e0c4dcf4e0", "score": "0.5150597", "text": "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "094e48e800f49c3aefdcd3e0c4dcf4e0", "score": "0.5150597", "text": "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "094e48e800f49c3aefdcd3e0c4dcf4e0", "score": "0.5150597", "text": "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "094e48e800f49c3aefdcd3e0c4dcf4e0", "score": "0.5150597", "text": "function addInternalSelectors(){\n container.find(options.sectionSelector).addClass(SECTION);\n container.find(options.slideSelector).addClass(SLIDE);\n }", "title": "" }, { "docid": "1dc0a30403bbf94dc73a5abcdccef118", "score": "0.5148637", "text": "function styleNode(node, className = '') {\n styleNodeByTag(node, 'select', className);\n styleNodeByTag(node, 'textarea', className);\n styleNodeByTag(node, 'input', className);\n styleNodeByTag(node, 'button', className);\n }", "title": "" }, { "docid": "6f50e0e0c99278bd45955400e6fa16d0", "score": "0.51428556", "text": "function addClassElementDecorationStatements(statements,node,isStatic){ts.addRange(statements,ts.map(generateClassElementDecorationExpressions(node,isStatic),expressionToStatement));}", "title": "" }, { "docid": "3da66425670c437f9f522f040801e069", "score": "0.5134307", "text": "function addInternalSelectors(){\n //adding internal class names to void problem with common ones\n $(options.sectionSelector).each(function(){\n $(this).addClass(SECTION);\n });\n $(options.slideSelector).each(function(){\n $(this).addClass(SLIDE);\n });\n }", "title": "" }, { "docid": "a533c83049f6c58c75aa0fd1fda25e22", "score": "0.5130888", "text": "function add_css(target) {\n\tappend_styles(target, \"svelte-5trppw\", \".visual-math.svelte-5trppw{display:block;background:var(--visual-math-bg);overflow:hidden;user-select:none;font-family:sans-serif;font-variant-numeric:tabular-nums;--visual-math-bg:#f1f1f1;--visual-math-fg:black;--visual-math-origin-color:var(--visual-math-fg);--visual-math-line-color:#555;--grid-line-subdivision-color:#222;--visual-math-red:#f10000;--visual-math-orange:#f18100;--visual-math-yellow:#f1f100;--visual-math-green:#00f181;--visual-math-blue:#0000f1;--visual-math-indigo:#8100f1;--visual-math-violet:#8100f1;--visual-math-pink:#f18181}\");\n}", "title": "" }, { "docid": "ab7a9dfe48cba617d74fa041378de1cf", "score": "0.51277727", "text": "function styleNode(node, className) {\n if (className === void 0) { className = ''; }\n styleNodeByTag(node, 'select', className);\n styleNodeByTag(node, 'textarea', className);\n styleNodeByTag(node, 'input', className);\n styleNodeByTag(node, 'button', className);\n }", "title": "" }, { "docid": "293bf0d682b76abb0c5e1de54964c26c", "score": "0.5126032", "text": "addStyle(doc, data) {\n if (this.hasStyle) {\n doc.getElementsByTagName(\"head\").item(0).appendChild(data.getElementsByTagName(\"style\").item(0).cloneNode(true));\n }\n }", "title": "" }, { "docid": "09515be78c7f48033c772fc6fd34e692", "score": "0.512315", "text": "function add_css() {\n\tvar style = !(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(\"style\");\n\tstyle.id = \"svelte-pb04qa-style\";\n\tstyle.textContent = \".navbar-dropdown.svelte-pb04qa.svelte-pb04qa{width:380px}@media screen and (min-width: 1024px){.navbar-dropdown.svelte-pb04qa .navbar-item.svelte-pb04qa{padding-right:20px}}.navbar-dropdown .navbar-item{justify-content:space-between}.has-dark-background.svelte-pb04qa.svelte-pb04qa{background-color:#484848;border-color:#484848;color:#fff}.has-dark-background.svelte-pb04qa.svelte-pb04qa::placeholder{color:#ccc}\";\n\t!(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(document.head, style);\n}", "title": "" }, { "docid": "38d7f5be14005ed9a0bd5d61fb1d8aa3", "score": "0.51230097", "text": "function addCss(css) {\n var head = document.head,\n style = document.createElement('style');\n\n style.type = 'text/css';\n style.appendChild(document.createTextNode(css));\n\n head.appendChild(style);\n}", "title": "" }, { "docid": "79096b103b49baf7a5c6d5eb5d927748", "score": "0.51196057", "text": "function add_css() {\n\tvar style = !(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(\"style\");\n\tstyle.id = \"svelte-15v28ah-style\";\n\tstyle.textContent = \".tab-content.svelte-15v28ah{display:none}.tab-content.is-active.svelte-15v28ah{display:block}\";\n\t!(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(document.head, style);\n}", "title": "" }, { "docid": "d0423b52826e33785f5c015d3131d86d", "score": "0.5116668", "text": "function add_css() {\n\tvar style = !(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(\"style\");\n\tstyle.id = \"svelte-odvey1-style\";\n\tstyle.textContent = \".has-space.svelte-odvey1{margin-bottom:2rem}.card-header-title.svelte-odvey1{display:block;text-align:center}.tag-fullwidth.svelte-odvey1{flex-grow:1;justify-content:start}\";\n\t!(function webpackMissingModule() { var e = new Error(\"Cannot find module 'svelte/internal'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }())(document.head, style);\n}", "title": "" }, { "docid": "a3b30d8d03f88b66bba49ad729aa0ffb", "score": "0.51151156", "text": "function GM_add_css(href) {\r\n var node = document.createElement('link');\r\n node.rel = 'stylesheet';\r\n node.href = href;\r\n node.type = 'text/css';\r\n document.getElementsByTagName('head')[0].appendChild(node);\r\n}", "title": "" }, { "docid": "f3ef4a0019fa481450e91fcd6ee27694", "score": "0.5112196", "text": "function addCss(options){\n\n if(options.id in cssRules === false || cssRules[options.id] !== css){\n cssRules[options.id] = options.css;\n }\n\n writeCss();\n\n }", "title": "" }, { "docid": "fc0abc94113718fca9686f759973efef", "score": "0.5105992", "text": "function add_css$d(target) {\n \tappend_styles(target, \"svelte-urasfe\", \"ol.svelte-urasfe{list-style-type:none}li.svelte-urasfe{display:inline-block;height:20px;width:20px;color:grey;visibility:hidden;margin-left:8px}li.active.svelte-urasfe{color:black;visibility:visible}\");\n }", "title": "" }, { "docid": "85ee6324ce965b4af0981579f85b41b5", "score": "0.51018775", "text": "function addStyle(css) {\n\tstyle.innerHTML = style.innerHTML + css;\n}", "title": "" }, { "docid": "1c90bdb5b1a61beaba4a366379b17a4b", "score": "0.50952655", "text": "function addCSS() {\n $('.vote-down-off, .vote-down-on, .vote-up-off, .vote-up-on, .star-off, .star-on').addClass('sox-better-css');\n $('head').append('<link rel=\"stylesheet\" href=\"https://rawgit.com/shu8/SE-Answers_scripts/master/coolMaterialDesignCss.css\" type=\"text/css\" />');\n $('#hmenus').css('-webkit-transform', 'translateZ(0)');\n }", "title": "" }, { "docid": "7a7fcac2fcc17f31e0bb6758699011ed", "score": "0.5079116", "text": "visitStylesheet(stylesheet) { }", "title": "" }, { "docid": "1ac0a63777c1b2988613fc804fb6b92a", "score": "0.5077964", "text": "function add_css$b() {\n var style = element(\"style\");\n style.id = \"svelte-c3lavh-style\";\n style.textContent = \"ul.svelte-c3lavh{padding-left:0}li.svelte-c3lavh{list-style:none;margin:none;margin-bottom:5px}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "4136b7ee4df4804cfab050405fb2a532", "score": "0.50774753", "text": "function add_css$2$1() {\n\tvar style = element$1(\"style\");\n\tstyle.id = \"svelte-1vwr9dd-style\";\n\tstyle.textContent = \".nav.svelte-1vwr9dd.svelte-1vwr9dd{align-items:center;display:flex;margin:0.6em 0 1em;padding:0 8px;width:100%}.nav.is-mobile.svelte-1vwr9dd.svelte-1vwr9dd{padding:0}.title.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--color-text-title);font-size:1.5em;margin:0}.is-mobile.svelte-1vwr9dd .title.svelte-1vwr9dd{font-size:1.3em}.month.svelte-1vwr9dd.svelte-1vwr9dd{font-weight:500;text-transform:capitalize}.year.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--interactive-accent)}.right-nav.svelte-1vwr9dd.svelte-1vwr9dd{display:flex;justify-content:center;margin-left:auto}.reset-button.svelte-1vwr9dd.svelte-1vwr9dd{cursor:pointer;border-radius:4px;color:var(--text-muted);font-size:0.7em;font-weight:600;letter-spacing:1px;margin:0 4px;padding:0px 4px;text-transform:uppercase}.is-mobile.svelte-1vwr9dd .reset-button.svelte-1vwr9dd{display:none}\";\n\tappend$1(document.head, style);\n}", "title": "" }, { "docid": "c25d52880780e8303442f3b114c404d8", "score": "0.5073147", "text": "function customCSS(css) {\n var style = document.createElement('style')\n style.innerText = css\n document.head.appendChild(style)\n}", "title": "" }, { "docid": "407e47f98aa1926fbb76700a41b76797", "score": "0.5070901", "text": "function add_css$7() {\n \tvar style = element(\"style\");\n \tstyle.id = \"svelte-syn7p7-style\";\n \tstyle.textContent = \".s-divider.svelte-syn7p7{display:block;flex:1 1 0;max-width:100%;height:0;max-height:0;border:solid;border-width:thin 0 0 0;border-color:var(--theme-dividers);transition:inherit}.s-divider.inset.svelte-syn7p7:not(.vertical){max-width:calc(100% - 72px);margin-left:72px}.s-divider.vertical.svelte-syn7p7{align-self:stretch;border:solid;border-width:0 thin 0 0;display:inline-flex;height:inherit;min-height:100%;max-height:100%;max-width:0;width:0;vertical-align:text-bottom}.s-divider.vertical.inset.svelte-syn7p7{margin-top:8px;min-height:0;max-height:calc(100% - 16px)}\";\n \tappend(document.head, style);\n }", "title": "" }, { "docid": "a50936dd111ef2361f510e312f2ec628", "score": "0.50699174", "text": "function node(opt)\r\n {\r\n if (!opt) return;\r\n// console.log(\"node(\"+c+\")\");\r\n function attr(name)\r\n {\r\n var value = opt[name];\r\n delete opt[name];\r\n return value;\r\n }\r\n var expandos = { id: 1, className: 1, title: 1, type: 1, checked: 1 };\r\n var id = opt.id;\r\n var n = $(id);\r\n if(!n)\r\n {\r\n var tag = attr(\"tag\") || \"div\";\r\n if (\"string\" == typeof tag) n = document.createElement(tag);\r\n else\r\n {\r\n var t=document.createElement(\"div\");\r\n t.innerHTML = tag.toXMLString();\r\n var ids = {};\r\n for each( var n in $x('.//*[@id]', t) ) ids[n.id]=1;\r\n if (!n) ids = null;\r\n var r = document.createRange();\r\n r.selectNodeContents(t);\r\n n = r.extractContents();\r\n if (n.childNodes.length == 1) n = n.firstChild;\r\n }\r\n var after = attr(\"after\");\r\n var before = opt.prepend ? opt.prepend.firstChild : attr(\"before\");\r\n var parent = attr(\"prepend\") || attr(\"append\") || (before || after || {}).parentNode;\r\n if (parent) {\r\n if (before)\r\n parent.insertBefore(n, before);\r\n else if (after)\r\n parent.insertBefore(n, after.nextSibling);\r\n else\r\n parent.appendChild(n);\r\n }\r\n if (id) n.id = id;\r\n }\r\n var html = attr(\"html\");\r\n if (\"undefined\" != typeof html) n.innerHTML = html;\r\n var text = attr(\"text\");\r\n if (\"undefined\" != typeof text) n.textContent = text;\r\n var style = attr(\"style\");\r\n if (style)\r\n for (var prop in style) n.style[prop] = style[prop];\r\n for (prop in opt)\r\n if (expandos[prop]) n[prop] = opt[prop];\r\n else n.setAttribute(prop, opt[prop]+\"\");\r\n if (ids)\r\n for (var id in ids)\r\n ids[id] = $(id);\r\n return ids || n;\r\n}", "title": "" }, { "docid": "f80deb1df25166028437bf2e32c1e043", "score": "0.50695556", "text": "function cacheSelectors() {\n nodes = {\n container: document.querySelector(selectors.container),\n slides: document.querySelectorAll(selectors.slides),\n };\n }", "title": "" }, { "docid": "f3c0074bd50909ae65f1e94c9f18b371", "score": "0.5067892", "text": "function add_css$m() {\n var style = element(\"style\");\n style.id = \"svelte-1f0amz4-style\";\n style.textContent = \".visualizer.svelte-1f0amz4{display:flex;flex-direction:column;align-items:center;padding:50px}.preview.svelte-1f0amz4{opacity:0.5}.icon.svelte-1f0amz4{color:#777;width:32px;height:32px;margin-bottom:20px}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "a06e5e0230fbfde8140419161ebe3b52", "score": "0.50675464", "text": "function add_css$p() {\n var style = element(\"style\");\n style.id = \"svelte-lifdi8-style\";\n style.textContent = \"ul.svelte-lifdi8{padding-left:0}li.svelte-lifdi8{list-style:none;margin:none;margin-bottom:5px}h3.svelte-lifdi8{text-transform:uppercase}label.svelte-lifdi8{color:#666}input[type='checkbox'].svelte-lifdi8{vertical-align:middle}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "4bf7fa6e24f65e13c78129b65b30dc55", "score": "0.5061494", "text": "function walk(node) {\n for (var i = 0, child; child = node.childNodes[i]; i++) {\n // Append text nodes to our description.\n if (child.nodeType === Node.TEXT_NODE) {\n var shouldTrim = result.description.length === 0;\n result.description += sanitizeString(child.nodeValue, shouldTrim);\n continue;\n }\n\n // Process and descend into a subset of recognized tags.\n if (child.nodeType === Node.ELEMENT_NODE &&\n (child.nodeName === 'dim' || child.nodeName === 'match' ||\n child.nodeName === 'url')) {\n var style = {\n 'type': child.nodeName,\n 'offset': result.description.length\n };\n $Array.push(result.descriptionStyles, style);\n walk(child);\n style.length = result.description.length - style.offset;\n continue;\n }\n\n // Descend into all other nodes, even if they are unrecognized, for\n // forward compat.\n walk(child);\n }\n }", "title": "" }, { "docid": "7ec2f65fe3e63a5a588e06bfad511756", "score": "0.50576603", "text": "function insertCSS(csstext)\r\n{\r\nvar head = document.getElementsByTagName('head');\r\nvar style = document.createElement('style');\r\nstyle.setAttribute('type','text/css');\r\nhead[0].appendChild(style);\r\nstyle.innerHTML = csstext;\r\n}", "title": "" }, { "docid": "ced27a386d353593c2cee9cfedfc48a1", "score": "0.50526327", "text": "toCSS(context, out) {\n const value = this.value;\n const loc = this.location;\n if (Array.isArray(value)) {\n value.forEach(n => {\n if (n instanceof Node) {\n n.toCSS(context, out);\n }\n else {\n out.add(n.toString(), loc);\n }\n });\n }\n else {\n if (value instanceof Node) {\n value.toCSS(context, out);\n }\n else {\n out.add(value.toString(), loc);\n }\n }\n }", "title": "" }, { "docid": "a70e39333268a01221bc9287d67ca10e", "score": "0.50504863", "text": "function add_css$9() {\n var style = element(\"style\");\n style.id = \"svelte-1mppqmp-style\";\n style.textContent = \".move.svelte-1mppqmp{display:flex;flex-direction:row;cursor:pointer;margin-left:10px;color:#666}.move.svelte-1mppqmp:hover{color:#333}.move.active.svelte-1mppqmp{color:#111;font-weight:bold}.arg-field.svelte-1mppqmp{outline:none;font-family:monospace}\";\n append(document.head, style);\n}", "title": "" }, { "docid": "372272e62cee195ea744d2e23470f617", "score": "0.50445914", "text": "function calculateStyles(dom, cssTree) {\n // Initialize el.styles with the element's inline styles\n forEachElement(dom, initializeStyles);\n // Add matching css rules to each element's el.styles\n applyStyles(dom, cssTree);\n}", "title": "" }, { "docid": "f2819a1449aa497a90d6c9f659626037", "score": "0.5042139", "text": "function CTATCSS() \r\n{\r\n\tvar currPair=0;\r\n\tvar attributeValuePairs=[];\r\n\t\r\n\tvar currSelector=0;\r\n\tvar selectorAttributes=new Array();\r\n\t\r\n\tvar currStr=0;\r\n\tvar cssStringArray=[];\r\n\t\r\n\tthis.resetSelectors=function resetSelectors ()\r\n\t{\r\n\t\tcurrSelector=0;\r\n\t\tselectorAttributes=new Array();\r\n\t\tselectorAttributes[currSelector]=new Array();\t\t\r\n\t};\r\n\t\r\n\tthis.resetCSSStringArray=function resetCSSStringArray()\r\n\t{\r\n\t\tcssStringArray=[];\r\n\t\tcurrStr=0;\r\n\t};\r\n\t\r\n\tthis.clearCSS=function clearCSS()\r\n\t{\r\n\t\tthis.resetSelectors();\r\n\t\tthis.resetCSSStringArray();\r\n\t\tattributeValuePairs=new Array();\r\n\t\tcurrPair=0;\r\n\t};\r\n\t\r\n\tthis.addStringCSS=function addStringCSS(str)\r\n\t{\r\n\t\tcssStringArray[currStr]=str;\r\n\t\tcurrStr++;\r\n\t};\r\n\r\n\tthis.addCSSAttribute=function addCSSAttribute(attribute, value) \r\n\t{\r\n\t\tattributeValuePairs[currPair]=attribute;\r\n\t\tattributeValuePairs[currPair+1]=value;\r\n\t\t\r\n\t\tcurrPair+=2;\r\n\t};\r\n\t\r\n\tthis.removeStringCSS=function removeStringCSS(str)\r\n\t{\r\n\t\tvar index=cssStringArray.indexOf(str);\r\n\t\tcssStringArray.splice(index, 1);\r\n\t};\r\n\t\r\n\tthis.removeCSSAttribute=function removeCSSAttribute(attribute)\r\n\t\t{ \r\n\t\tvar index=attributeValuePairs.indexOf(attribute);\r\n\t\tattributeValuePairs.splice(index, 2);\r\n\t};\r\n\t\r\n\tthis.modifyCSSAttribute=function modifyCSSAttribute(attribute, value)\r\n\t{\r\n\t\tvar attribIndex=attributeValuePairs.indexOf(attribute);\r\n\t\t\r\n\t\tif(attribIndex==-1) \r\n\t\t{\r\n\t\t\tthis.addCSSAttribute(attribute, value);\r\n\t\t\treturn; \r\n\t\t}\r\n\t\t\r\n\t\tattributeValuePairs[attribIndex+1]=value;\r\n\t};\t\r\n\t\r\n\tthis.addSelector=function addSelector(selector)\r\n\t{\r\n\t\tselectorAttributes[currSelector]=new Array();\r\n\t\tselectorAttributes[currSelector][0]=selector;\r\n\t\tcurrSelector++;\r\n\t};\r\n\t\r\n\tfunction getSelectorIndex(sel)\r\n\t{\r\n\t\r\n\t\t//Return 0 since we never added any selectors\r\n\t\tif(currSelector==0)\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\r\n\t\tfor(var i=0; i<selectorAttributes.length; i++)\r\n\t\t{\r\n\t\t\t//This means that what we are looking for does not exist \r\n\t\t\tif(selectorAttributes[i][0]==null)\r\n\t\t\t{\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//We found the selector we were looking for\r\n\t\t\tif(selectorAttributes[i][0]==sel)\r\n\t\t\t{\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn -1;\r\n\t}\r\n\r\n\tthis.addSelectorAttribute=function addSelectorAttribute(selector, attribute, value)\r\n\t{\r\n\t\tvar j=1;\r\n\t\tvar selectorIndex=getSelectorIndex(selector);\r\n\t\t\r\n\t\twhile(selectorAttributes[selectorIndex][j] != undefined) { j++; }\r\n\t\t\r\n\t\tselectorAttributes[selectorIndex][j]=attribute;\r\n\t\tselectorAttributes[selectorIndex][j+1]=value;\r\n\t};\r\n\t\t\r\n\tthis.toCSSString=function toCSSString()\r\n\t{\r\n\t\tvar cssString=\"\";\r\n\t\tvar doesNeedPixels=false;\r\n\t\t\r\n\t\tfor(var i=0; i<selectorAttributes.length; i++)\r\n\t\t{\r\n\t\t\tcssString+=selectorAttributes[i][0]+\" { \";\r\n\t\t\tfor(var j=1; j<selectorAttributes[i].length; j++)\r\n\t\t\t{\r\n\t\t\t\tcssString+=selectorAttributes[i][j];\r\n\t\t\t\r\n\t\t\t\tif(j%2==0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcssString+=\"; \";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tcssString+=\": \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tcssString+=\" }; \";\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tfor(var i=0; i<attributeValuePairs.length; i++)\r\n\t\t{\r\n\t\t\tcssString+=attributeValuePairs[i];\r\n\t\t\r\n\t\t\tif(i%2==0)\r\n\t\t\t{\r\n\t\t\t\tcssString+=\": \";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tcssString+=\"; \";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(var i=0; i<cssStringArray.length; i++)\r\n\t\t{\r\n\t\t\tcssString+=cssStringArray[i]+\" \";\r\n\t\t}\r\n\t\t\r\n\t\treturn cssString;\r\n\t};\r\n}", "title": "" } ]
ecb2d92d7384240447585cb8be5ddd63
header indent when has banner
[ { "docid": "84b233eea0759cfe36b0fb57aab1ecff", "score": "0.78733724", "text": "function headerIndent() {\n var bannerHeight = $('.banner-top').outerHeight();\n var mainHeader = $('.header');\n\n mainHeader.css(\"margin-top\", bannerHeight + \"px\");\n }", "title": "" } ]
[ { "docid": "497531a8deea4f9a30ea34f3c951bb87", "score": "0.6216406", "text": "function headerAdjustment() {\n\tvar height = $(\".header--main\").outerHeight();\n\t//$(\"#banner\").css('padding-top', ''+height+'px');\n\t$(\".title-holder\").css('padding-top', '' + height + 'px');\n\t$(\"main\").css('padding-top', '' + height + 'px');\n}", "title": "" }, { "docid": "93298e4dad92d3a2f62d3023de0e14a6", "score": "0.6102395", "text": "function addHeader() {\n var ptitle = \"Overall Summary\";\n ddCont.push(\n //header: no dice for classic header:\n {\n text: ptitle,\n margin: [0, 15, 40, 30],\n fontSize: 17,\n bold: true\n }\n );\n }", "title": "" }, { "docid": "75e39673c3a9f799289c282c02b150e3", "score": "0.6073153", "text": "function blockHeader(string, indentPerLevel) {\n\t var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n\t // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n\t var clip = string[string.length - 1] === '\\n';\n\t var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n\t var chomp = keep ? '+' : (clip ? '' : '-');\n\n\t return indentIndicator + chomp + '\\n';\n\t}", "title": "" }, { "docid": "8f68fdae8c566bfebce675e47dd32f58", "score": "0.6025188", "text": "function addHeader() {\n ddCont.push(\n //header: no dice for classic header:\n {\n text: \"Sector Wise Exposure\",\n //.left marg. may align with chart\n //.last marg. adds the gab to chart\n margin: [10, 5, 20, 0],\n fontSize: 17,\n color: '#333333',\n bold: true\n }\n );\n }", "title": "" }, { "docid": "6240535f5e5d29a8a68807ac228f3cd8", "score": "0.60191774", "text": "function adjust_padding_transparent_header(elem){\n\t\n\t// Check if Transparency is enabled.\n\tif(jQuery('body').find('header.banner[data-transparent-header=\"true\"]').length > 0) {\n\t\t\n\t\t// Get the height of the navigation header\n\t\tvar headerHeight = parseInt(jQuery(\"header.banner\").height());\n\t\t//console.log('DIGGITY DOG!');\n\t\t//console.log('Header Height '+headerHeight);\n\t\t\n\t\t// Adjust Padding for all sliders and page headers.\n\n\t\t\n\t\t\n\t\t//jQuery( \"#main-flex-slider .themo_slider_0, section#themo_page_header_1\" ).each(function() {\n\t\tjQuery( elem ).each(function() {\t\n\t\t\t// Get current padding\t\t\t\n\t\t\tvar currentPadding = parseInt(jQuery(this).css(\"padding-top\").replace(/[^-\\d\\.]/g, ''));\n\t\t\t//console.log('Current Padding '+currentPadding);\n\t\t\t\n\t\t\t// Calculate\n\t\t\tvar newPadding = currentPadding+headerHeight;\n\t\t\t//console.log('New Padding '+newPadding);\n\t\t\n\t\t\t// Adjust and set new padding.\n\t\t\tjQuery(this).css({\n\t\t\t\t\"padding-top\":newPadding+\"px\"\n\t\t\t});\n\t\t\t\n\t\t\t//console.log(\"----------------------------\");\n\t\t\n\t\t});\t\n\t\t\n\t};\n\n}", "title": "" }, { "docid": "f5661a327888b345666000ba1458cec7", "score": "0.60131514", "text": "function addHeader() {\n ddCont.push(\n //header: no dice for classic header:\n {\n text: \"Portfolio Summary / Exposure\",\n margin: [0, 5, 0, 0],\n fontSize: 15,\n bold: true,\n color: '#d4d',\n }\n );\n }", "title": "" }, { "docid": "05576d21e406eb94c0108f4bbf7a145a", "score": "0.60022074", "text": "function addHeader() {\n ddCont.push(\n //header: no dice for classic header:\n {\n text: \"Portfolio Summary / Analysis\",\n margin: [0, 5, 0, 0],\n fontSize: 15,\n bold: true,\n color: '#d4d'\n }\n );\n }", "title": "" }, { "docid": "774c6d9209f6f6fe2daae21d778c0927", "score": "0.5988241", "text": "function addHeader() {\n ddCont.push(\n //header: no dice for classic header:\n {\n text: \"Debt Portfolio / Performance\",\n margin: [0, 15, 40, 30],\n fontSize: 17,\n color: '#3399DD',\n bold: true\n }\n );\n }", "title": "" }, { "docid": "bf7eff0650ea81dc6ba28f8c004c2e30", "score": "0.59873164", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = string[0] === ' ' ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : clip ? '' : '-';\n\n return indentIndicator + chomp + '\\n';\n }", "title": "" }, { "docid": "e2a159dc0146a08a787847472cb5c995", "score": "0.5974103", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "e2a159dc0146a08a787847472cb5c995", "score": "0.5974103", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "e2a159dc0146a08a787847472cb5c995", "score": "0.5974103", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "e2a159dc0146a08a787847472cb5c995", "score": "0.5974103", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "e2a159dc0146a08a787847472cb5c995", "score": "0.5974103", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "e2a159dc0146a08a787847472cb5c995", "score": "0.5974103", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "65503acc949ccefa79421f011f000d9e", "score": "0.59640634", "text": "function addHeader() {\n ddCont.push(\n //header: no dice for classic header:\n {\n text: \"Portfolio Summary / Performance\",\n margin: [0, 5, 0, 0],\n fontSize: 15,\n bold: true,\n color: '#d4d'\n }\n );\n }", "title": "" }, { "docid": "7ed69e10cc547b2bd44d7d0e3798e726", "score": "0.5945899", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n }", "title": "" }, { "docid": "c000208458bf6016419abc5c8b6935ef", "score": "0.593391", "text": "function addHeader() {\n ddCont.push(\n //header: no dice for classic header:\n {\n text: \"Debt Portfolio / Analysis\",\n //.left marg. may align with chart\n //.last marg. adds the gab to chart\n margin: [10, 5, 20, 0],\n fontSize: 17,\n color: '#55DDFF',\n bold: true\n }\n );\n }", "title": "" }, { "docid": "ebdaec5ba26285b934709562dea47952", "score": "0.5925835", "text": "function addHeader() {\n ddCont.push(\n //header: no dice for classic header:\n {\n text: \"Debt Portfolio / Exposure\",\n //.left marg. may align with chart\n //.last marg. adds the gab to chart\n margin: [10, 5, 20, 0],\n fontSize: 17,\n color: '#55DDFF',\n bold: true\n }\n );\n }", "title": "" }, { "docid": "d6f2ff7e1c76b1279d17e555b6edd8b8", "score": "0.5922191", "text": "function addHeader() {\n ddCont.push(\n //header: no dice for classic header:\n {\n text: \"Equity Portfolio Performance\",\n margin: [0, 15, 40, 30],\n fontSize: 17,\n color: '#33AA66',\n bold: true\n }\n );\n }", "title": "" }, { "docid": "f7dd3f5b1ff5eaae983927d4d6df3a6a", "score": "0.59002066", "text": "function addHeader() {\n ddCont.push(\n //header: no dice for classic header:\n {\n text: \"Equity Portfolio Exposure\",\n //.left marg. may align with chart\n //.last marg. adds the gab to chart\n margin: [10, 5, 20, 0],\n fontSize: 17,\n color: '#33BB77',\n bold: true\n }\n );\n }", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5888364", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "184f1e0a3519134e513ba3cb90a07ab8", "score": "0.58635306", "text": "function addHeader() {\n ddCont.push(\n //header: no dice for classic header:\n {\n text: \"Equity Portfolio Analysis\",\n //.left marg. may align with chart\n //.last marg. adds the gab to chart\n margin: [10, 5, 20, 0],\n fontSize: 17,\n color: '#339933',\n bold: true\n }\n );\n }", "title": "" }, { "docid": "786d358bac828976934e1f6e95caf61d", "score": "0.5859287", "text": "function headerPadding(resize) {\n\tvar headerHeight = $(\".header\").outerHeight();\n\t\n\t$(\"body\").css(\"padding-top\", headerHeight);\t\n}", "title": "" }, { "docid": "d9582a3f92b4e76767e2a589a0f83345", "score": "0.5821286", "text": "function blockHeader(string, indentPerLevel) {\n const indentIndicator = needIndentIndicator(string)\n ? String(indentPerLevel) : \"\";\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n const clip = string[string.length - 1] === \"\\n\";\n const keep = clip &&\n (string[string.length - 2] === \"\\n\" || string === \"\\n\");\n const chomp = keep ? \"+\" : clip ? \"\" : \"-\";\n return `${indentIndicator}${chomp}\\n`;\n }", "title": "" }, { "docid": "22baed3e3f31642c8f013852ffff79b0", "score": "0.5747615", "text": "function bannerContentPadding(){\n var winWidth = $(window).width();\n var headerHeight = $('header.fixed--header').height();\n if(winWidth > 991){\n $('.banner__content').css('margin-top', headerHeight);\n }\n }", "title": "" }, { "docid": "ef445750be0a7674d3232c98e74f6a3d", "score": "0.5635559", "text": "indent(block, numberOfIndents = 1) {\n return leftPad(block, this.pref.indent * numberOfIndents);\n }", "title": "" }, { "docid": "0d92b3e504ede948b07e6d5dfafbd496", "score": "0.56284356", "text": "function addHeader() {\n ddCont.push({\n text: \"Glossary of Terms\",\n //.left marg. may align with chart\n //.last marg. adds the gab to chart\n margin: [10, 5, 20, 0],\n fontSize: 18,\n color: '#333333',\n bold: true\n });\n }", "title": "" }, { "docid": "4228cf3ec0fca8aadff866d078a5416d", "score": "0.56092256", "text": "function banner(){\n let\n nsp = core.peekNS(),\n id = nsp.get(\"id\"),\n meta = nsp.get(\"meta\");\n return [\"/*\", \"Auto generated by Kirby v\", MOD_DASH_VER,\n \" - \", new Date(), \"\\n\",\n \" \", id, \"\\n\",(meta ? std.prn(meta, true) : \"\"), \"\\n\", \"*/\\n\\n\"].join(\"\");\n }", "title": "" }, { "docid": "60af68218bebb75c9cf074ae876a2972", "score": "0.5593855", "text": "function getIndent(content) {\n\tvar indent = 0;\n\tvar i = 0;\n\twhile (content.startsWith(\" \", i)) {\n\t\tindent++;\n\t\ti += 4;\n\t}\n\treturn indent;\n}", "title": "" }, { "docid": "222fdadb5c792b6f0fedc039c997b543", "score": "0.5545184", "text": "function printBanner () {\n print.newline()\n print.fancy(colors.random(BANNER[0]))\n print.fancy(colors.random(BANNER[1]))\n print.fancy(colors.random(BANNER[2]))\n print.fancy(colors.random(BANNER[3]))\n print.fancy(colors.random(BANNER[4]))\n print.fancy(colors.random(BANNER[5]))\n print.fancy(colors.random(BANNER[6]))\n print.fancy(colors.random(BANNER[7]))\n print.newline()\n print.newline()\n print.fancy(colors.yellow(' https://github.com/infinitered/gluegun'))\n print.fancy(colors.white(` ${pkg.version}`))\n print.newline()\n print.divider()\n}", "title": "" }, { "docid": "0537a27341956e665a9ee9bbfdcc3a81", "score": "0.55167925", "text": "function adjust()\n {\n var mw = document.getElementById('app_content_8743457343').firstChild.firstChild.firstChild;\n if (mw) mw.nodeValue = mw.nodeValue.replace(/.app_content_8743457343 #app8743457343_header\\.*/,'.app_content_8743457343 #app8743457343_header { height: 15px; }');\n var mwb = document.getElementById('app8743457343_header');\n var mws = mwb.firstChild.nextSibling;\n if (mws) mws.style.paddingTop=0;\n }", "title": "" }, { "docid": "bacc8a266d9a12a27a4af8001e815195", "score": "0.5483109", "text": "function createSnippetHeader() {\n gees.dom.setHtml('ExistingSnippets', '<h1>Existing snippet profiles</h1>');\n}", "title": "" }, { "docid": "8769caa0cdcf3972b938c771d4b0e40a", "score": "0.5406953", "text": "function getIndent(state) {\n const { config, parent } = state;\n if (!parent || isSnippet(parent) || (parent.name && config.options['output.formatSkip'].includes(parent.name))) {\n return 0;\n }\n return 1;\n }", "title": "" }, { "docid": "eb2523d750b1ce4fe9d05adcb1f8d129", "score": "0.5397641", "text": "function doIndentation(arr) {\n arr.forEach(function(elem) {\n // if (elem.spacer > 0) {\n if (elem.line_type !== \"P\") {\n domStyle.set(query(\"#grid-row-\" + elem.id + \" .field-project\")[0], \"padding-left\", elem.spacer + \"px\");\n };\n });\n }", "title": "" }, { "docid": "8d4fdac9579173890ba3410ff9f5dd55", "score": "0.53474796", "text": "function makeBanner (someText){\n var bannerText \n var lengthOfText = someText.length\n console\n var headerFooter = ''\n var i\n // Compose the header and footer\n for(i=1; i <= lengthOfText+4; i++)\n {\n headerFooter = headerFooter+'*'\n } \n // Compose the text line of the banner\n bannerText = '* '+someText+' *'\n //Print the banner\n console.log(headerFooter)\n console.log(bannerText)\n console.log(headerFooter)\n return bannerText\n}", "title": "" }, { "docid": "f3c20e1a0f0a8f9939f92d24ae95c02b", "score": "0.5307642", "text": "function electionHeader() {\r\n\treturn S(\r\n\t\t'<div style=\"font-weight:bold;\">',\r\n\t\t'</div>'\r\n\t);\r\n}", "title": "" }, { "docid": "e00aa8159518b039d971a965fda4b81e", "score": "0.5302319", "text": "function setMainPaddingTop(){\n\tvar headerHeight = getHeaderHeight();\n\t$('.main').css('padding-top', headerHeight + 20);\n}", "title": "" }, { "docid": "b4ecec3f10d28691d830373f6a2cd456", "score": "0.5248936", "text": "function indent(text) { return text.replace(/^/gm, ' '); }", "title": "" }, { "docid": "b4ecec3f10d28691d830373f6a2cd456", "score": "0.5248936", "text": "function indent(text) { return text.replace(/^/gm, ' '); }", "title": "" }, { "docid": "b4ecec3f10d28691d830373f6a2cd456", "score": "0.5248936", "text": "function indent(text) { return text.replace(/^/gm, ' '); }", "title": "" }, { "docid": "61c0fc0c3a9dd5f5afbda21632c89d67", "score": "0.5206081", "text": "heading() {\n this.insertAroundCursor('# ', '#')\n }", "title": "" }, { "docid": "75000d91b6ea53849ac90ef7115e8c3f", "score": "0.5189891", "text": "function insert_option_report_table_header(table)\n {\n var header = new_row(table, -1, [\n \"Outcome\",\n \"Odds\",\n \"My wagers\",\n \"Payout\",\n \"Scenario P/L\"\n ]);\n\n header[1].style.textAlign = \"left\";\n }", "title": "" }, { "docid": "6d7997e2cca1fe3d9ddebea8008658fa", "score": "0.518293", "text": "getSectionHeader(path) {\n const orig = common.getOriginalPath(path.node);\n return printValue({\n VALUE: babelTypes.stringLiteral(SECTION_PREFIX + orig),\n });\n }", "title": "" }, { "docid": "d6943c22ec7b211e300bcdfef321b911", "score": "0.5174658", "text": "function addAriaLevels(){\r\n\t\t$(\":header\").attr('role','heading').attr('aria-level',function() {\r\n\t\t\treturn $(this).prop('tagName').slice(-1);\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "6af8b5f0cf1f8a9dec6ba7f14e88bd8c", "score": "0.5174323", "text": "function lcheadersmart() {\n var $headerheight = ($('#header').height()) + 3;\n $(\".slideshow-section, .default-page\").css(\"padding-top\", $headerheight);\n $(\".shadow-slider\").css(\"top\", $headerheight);\n}", "title": "" }, { "docid": "277f2dff9fd08556ea8032943255d6da", "score": "0.51685387", "text": "function generateHeader(doc) {\n doc\n .image(\"./logoCropped.jpeg\", (doc.page.width - 312) / 2, 0, {\n fit: [350, 250]\n })\n .moveDown()\n .font(\"Times-Bold\")\n .fontSize(15)\n\n .text(\"Dehmi Kalan, Near GVK Toll Plaza, Jaipur, Rajasthan, 303007\", {\n align: \"center\"\n })\n // .lineGap(0.05)\n .text(\"Department Of Computer Science & Engineering\", {\n align: \"center\"\n });\n}", "title": "" }, { "docid": "539464b7375fd59d8fd8cb71535050bc", "score": "0.515898", "text": "function header() {\n log();\n log(colors.bold(_package.default.name), colors.info(_package.default.version));\n}", "title": "" }, { "docid": "678dbeb64311c79a7594fc5a3d8b32b5", "score": "0.5155324", "text": "function insert_heading(event){\n var size = event.data.size;\n var string = \"\";\n for(var i = 0; i < size; i++)\n {\n string += \"#\";\n }\n modHighlightedString(string, string + \"Heading_title\" + string+ \"\\n\");\n}", "title": "" }, { "docid": "6873ab485e48bb0df4dbd667d4dac48c", "score": "0.51398754", "text": "function beforeHeader(pdict) {\n velocity.render('$velocity.remoteInclude(\\'GTM-BeforeHeader\\')', { velocity: velocity});\n}", "title": "" }, { "docid": "6873ab485e48bb0df4dbd667d4dac48c", "score": "0.51398754", "text": "function beforeHeader(pdict) {\n velocity.render('$velocity.remoteInclude(\\'GTM-BeforeHeader\\')', { velocity: velocity});\n}", "title": "" }, { "docid": "230bd6ce2c78974a1a3a6ba40dc8c9f6", "score": "0.5130434", "text": "function setFirstBucketHeaders() {\n\tif (document.getElementById(\"buckets\").getElementsByTagName(\"section\").length == 2) {\n\t\tdocument.getElementById(\"header1\").innerHTML = \"Starters\";\n\t\tdocument.getElementById(\"header2\").innerHTML = \"Counterpicks\";\n\t} else {\n\t\tdocument.getElementById(\"header1\").innerHTML = \"Bucket 1\";\n\t\tdocument.getElementById(\"header2\").innerHTML = \"Bucket 2\";\n\t}\n}", "title": "" }, { "docid": "cdbf8945d8d9622377e9ec7c6bc3b199", "score": "0.51162565", "text": "function header(text) {\n var matches = text.match(/\\*[^\\*]+\\*/g);\n matches.forEach(function (match) {\n var extracted = match.replace(/(^\\*)|(\\*$)/g, '');\n text = text.replace(match, $c.white.bold(extracted));\n });\n var stars = $c.yellow('***');\n return [stars, text, stars].join(' ');\n}", "title": "" }, { "docid": "fd887e3fe8c8add0942946af188dfc65", "score": "0.51123697", "text": "function spaceCalc(sbheader, header, obj) {\n var num = sbheader.length - (String(obj).length + header.length);\n return Array(num+1).join('\\u00A0');\n}", "title": "" }, { "docid": "688b2e695a0dfb6e339b0c4d320ec7fb", "score": "0.50992787", "text": "function beginHeading(order) {\n\t\t\tcloseBlockElement();\n\t\t\tbeginElement('h'+order);\n\t\t}", "title": "" }, { "docid": "09497f6d5494fa28ac584957578ae0ac", "score": "0.50852257", "text": "function centerHomeBannerText() {\n\t\t\tvar bannerText = jQuery('#header > .center');\n\t\t\tvar bannerTextTop = (jQuery('#header').actual('height')/2) - (jQuery('#header > .center').actual('height')/2) - 40;\t\t\n\t\t\tbannerText.css('padding-top', bannerTextTop+'px');\t\t\n\t\t\tbannerText.show();\n\t}", "title": "" }, { "docid": "4b4e8c8ebd384d0e223535bc3d0efcff", "score": "0.5083539", "text": "function stickHeader(){\n\t\tif (winScr > 0){\n\t\t\t$(\".tt-header\").addClass(\"stick\");\n\t\t\t\n\t\t} else {\n\t\t\t$(\".tt-header\").removeClass(\"stick\");\n\t\t}\n\t\tif($(\".tt-header-banner\").length){\n\t\t\tvar bannerH = $(\".tt-header-banner\").height();\n\t\t\tif (winScr > bannerH){\n\t\t\t\t$(\".tt-header\").addClass(\"move\");\n\t\t\t} else{\n\t\t\t\t$(\".tt-header\").removeClass(\"move\");\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "cdb123610c20ac6e6455dad8a70c4d88", "score": "0.50808495", "text": "header(pkg) {}", "title": "" }, { "docid": "f9657150473a9b0aa77024260a582608", "score": "0.5079495", "text": "function ridOfPaddingTopsOnLogo(contentSections)\r\n{\r\n\tconsole.log(window.innerWidth);\r\n\tfor(var i = 0; i < contentSections.length; i++)\r\n\t{\r\n\t\tcontentSections[i].style.paddingTop = \"0px\"; \r\n\t}\r\n}", "title": "" }, { "docid": "ccff9fc882ea8ec99f2a49de0fba8a59", "score": "0.5073012", "text": "function setPaddingTopOnUIcont(){\n\t\tvar UIheadPrimaryH = $(UIhead).children('.primary').outerHeight();\n\t\tvar UIheadNavMainH = $(UIhead).children('.navMain').outerHeight();\n\t\t\n\t\t$('#UIcont').css({'padding-top':(UIheadPrimaryH + UIheadNavMainH) + 'px'});\n\t}", "title": "" }, { "docid": "935e61f84571093874d6249f93e41244", "score": "0.50629467", "text": "insertBanner() {\n const alertBannerDiv = createElementWithAttrs('aside', `${this.message} `, {\n id: 'nyulibraries-alert-banner',\n class: this.bannerClass(),\n 'aria-label': 'Service Alert Banner',\n });\n const link = createElementWithAttrs('a', 'See more', { href: this.linkPath, target: '_blank' });\n alertBannerDiv.append(link);\n return document.body.insertBefore(alertBannerDiv, document.body.firstChild);\n }", "title": "" }, { "docid": "6482445c1e406caf9001c4d648899793", "score": "0.50487393", "text": "function insertTopSeparator( imagePath )\r\n{\r\n\tvar\t\ttopAltText = 'Top';\r\n\r\n\tif ( imagePath == null )\r\n\t{\r\n\t\tthis.imagePath = '../../images/';\r\n\t}\r\n\telse\r\n\t{\r\n\t\tthis.imagePath = imagePath;\r\n\t}\r\n\tdocument.write( '<table border=\"0\" cellpadding=\"0\" width=\"100%\" bgcolor=\"\">' );\r\n\tdocument.write( '<tr>' );\r\n\tdocument.write( '<td width=\"99%\" align=\"left\" valign=\"top\">' );\r\n\tdocument.write( '<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"100%\">' );\r\n\tdocument.write( '<TR>' );\r\n\tdocument.write( '<TD VALIGN=\"bottom\">&nbsp;</TD>' );\r\n\tdocument.write( '</TR>' );\r\n\tdocument.write( '<TR>' );\r\n\tdocument.write( '<TD BGCOLOR=\"#5F779E\"><IMG alt=\"\" title=\"\" height=\"2\" src=\"' + this.imagePath + 'spacer.gif\" width=\"2\"></TD>' );\r\n\tdocument.write( '</TR>' );\r\n\tdocument.write( '<TR>' );\r\n\tdocument.write( '<TD>&nbsp;</TD>' );\r\n\tdocument.write( '</TR>' );\r\n\tdocument.write( '</TABLE>' );\r\n\tdocument.write( '<td><a href=\"#Top\"><img src=\"' + this.imagePath + 'arrowup2.gif\" width=15 height=16 alt=\"Top\" title=\"Top\" border=\"0\"></a></td>' );\r\n\tdocument.write( '</tr>' );\r\n\tdocument.write( '</table>' );\r\n}", "title": "" }, { "docid": "7cd12e24b1076ec4da1c0e7302ad3f28", "score": "0.50431514", "text": "renderHeader() {\n return this.props.header.join('\\n');\n }", "title": "" }, { "docid": "3dd24abcc6a89dfa9d1a1d315fd3cc54", "score": "0.5039705", "text": "function header(ctx) {\n // Render the default html\n var html =\n \"<h1 style='background-color:brown; color:white;'>Above Header</h1>\" +\n RenderHeaderTemplate(ctx) +\n \"<h1 style='background-color:brown; color:white;'>Below Header</h1>\";\n\n // Return the html\n return html;\n }", "title": "" }, { "docid": "d9b9c5f42a7498a7d4499f3d8aac48de", "score": "0.50315523", "text": "Noop(path) {\n if (!thisMutator.isSectionStart(path)) {\n return;\n }\n const header = thisMutator.getSectionHeader(path);\n const footer = thisMutator.getSectionFooter(path);\n thisMutator.insertBeforeSkip(path, footer);\n thisMutator.insertBeforeSkip(path, header);\n }", "title": "" }, { "docid": "cee906a6418d0f1c54827db9381c3160", "score": "0.499978", "text": "function blockIndentation(source) {\n const lines = source.split('\\n');\n let closeTags = [];\n let nested = [];\n\n for (let i = 0; i < lines.length; ++i) {\n if (!lines[i].startsWith(':::')) continue;\n const tag = lines[i].slice(4);\n\n if (!tag) {\n lines[i] = '\\n' + closeTags.pop() + '\\n';\n nested.pop();\n continue;\n }\n\n if (tag.startsWith('column')) {\n let col = pug.render(tag.replace('column', 'div')).split('</')[0];\n col = col.replace(/width=\"([0-9]+)\"/, 'style=\"width: $1px\"');\n if (last(nested) === 'column') {\n lines[i] = '\\n</div>' + col + '\\n';\n } else {\n lines[i] = '<div class=\"row padded\">' + col + '\\n';\n nested.push('column');\n closeTags.push('</div></div>')\n }\n } else if (tag.startsWith('tab')) {\n let col = pug.render(tag.replace('tab', '.tab')).split('</')[0];\n if (last(nested) === 'tab') {\n lines[i] = '\\n</div>' + col + '\\n';\n } else {\n lines[i] = '<x-tabbox>' + col + '\\n';\n nested.push('tab');\n closeTags.push('</div></x-tabbox>')\n }\n } else {\n let wrap = pug.render(tag).split('</');\n closeTags.push('</' + wrap[1]);\n lines[i] = wrap[0] + '\\n';\n nested.push('');\n }\n }\n\n return lines.join('\\n');\n}", "title": "" }, { "docid": "00ef90a453040a1536c3c82e2a0a6c31", "score": "0.49956182", "text": "function addHeader(report) {\n var pageHeader = report.getHeader();\n pageHeader.addClass(\"header\");\n pageHeader.addParagraph(param.title, \"heading\");\n pageHeader.addParagraph(param.version, \"\");\n pageHeader.addParagraph(\" \", \"\");\n pageHeader.addParagraph(\"Elster Umsatzsteuer-Voranmeldung\", \"h1\");\n\n if (param.headerLeft) {\n pageHeader.addParagraph(param.headerLeft, \"bold\");\n }\n if (param.vatNumber) {\n pageHeader.addParagraph(\"Steuernummer: \" + param.vatNumber, \"bold\");\n }\n\n pageHeader.addParagraph(\"Periode: \" + Banana.Converter.toLocaleDateFormat(param.startDate) + \" - \" + Banana.Converter.toLocaleDateFormat(param.endDate), \"bold\");\n pageHeader.addParagraph(\" \", \"\");\n\n}", "title": "" }, { "docid": "17002fa2e4674c12b1aeaf981b750d0e", "score": "0.4993904", "text": "function showBlockHeader(block) {\n if (\n block?.hasAttribute('collapsed') && \n block.storeAttributes?.header\n ) {\n showHeaderContent(block.storeAttributes.header);\n return true;\n } \n return false;\n }", "title": "" }, { "docid": "da32d9dcd504d632da56cd412584d470", "score": "0.498615", "text": "function addHeader(param, report) {\n\tvar pageHeader = report.getHeader();\n\tpageHeader.addClass(\"header\");\n\t//pageHeader.addParagraph(param.text.title, \"heading\");\n\t//pageHeader.addParagraph(param.version, \"\");\n\t//pageHeader.addParagraph(\" \", \"\");\n}", "title": "" }, { "docid": "92b806569d610b0f78ff598701d08706", "score": "0.49849474", "text": "function instaheader() {\n\n var x = document.getElementById(\"header\");\n if (x.className === \"header\") {\n x.className += \" insta\";\n } else {\n x.className = \"header\";\n }\n\n}", "title": "" }, { "docid": "58bc1e2243586945b9c1ef51d79aaba2", "score": "0.49762395", "text": "enterProcedureSectionHeader(ctx) {\n\t}", "title": "" }, { "docid": "d379680029fea8295cbabbf324a5762d", "score": "0.49749422", "text": "function addSeparator(conteneur,name) {\nconteneur = addHGroup(conteneur);\nconteneur.margins = 5;\nif (name.length > 0)\n{\nvar textName = conteneur.add('statictext',undefined,name);\ntextName.alignment = ['left','fill'];\n}\nvar separator1 = conteneur.add('panel',undefined);\nseparator1.alignment = ['fill','center'];\nseparator1.height = 0;\n}", "title": "" }, { "docid": "834d4c524f819dc4692a41d3ac7a4ef3", "score": "0.49724966", "text": "increaseIndent() {\n this.indentLevel++;\n }", "title": "" }, { "docid": "3877a57a54b046782156b1f397ad172d", "score": "0.4968711", "text": "continue() {\n let parent = this.node.parent;\n return parent ? indentFrom(parent, this.pos, this.base) : 0;\n }", "title": "" }, { "docid": "ab5f69fc55ace491f6608c269a7d0f88", "score": "0.49618593", "text": "function header(){\n return `\n <header><a href=\"javascript:window.location.href=window.location.href\"><h1> Nasa Mars Rover Dashboard</h1></a></header>\n `\n }", "title": "" }, { "docid": "0205e7aef4a0547cc64a1e6f9cd4cb0f", "score": "0.49589527", "text": "function headerFixed() {\n\t\tif ($(window).width() > 991) {\n\t\t\tvar offerHeight = 0;\n\t\t\tif ($('.avail_offer').length > 0) {\n\t\t\t\tofferHeight = $('.avail_offer').height();\n\t\t\t}\n\t\t\t$('.lEditorHeader').css('top', offerHeight + 'px');\n\t\t\t$('.step-holder').css('padding-top', offerHeight + 60 + 'px');\n\t\t\t$('.step_6 .fix-padding').css('margin-top', '66px');\n\t\t\t$('#animation_box').css('padding-top', offerHeight + 20 + 'px');\n\t\t} else {\n\t\t\t$('.lEditorHeader').css('top', '0px');\n\t\t\t$('.step-holder').css('padding-top', '60px');\n\t\t\t$('.step_6 .fix-padding').css('margin-top', '66px');\n\t\t}\n\t}", "title": "" }, { "docid": "4aa958dfbe6f2ec2aa9508c7dd1e35f5", "score": "0.49488014", "text": "function outputHeader(version) {\n\n console.log(\n \"\\n\" + ac.blue(\"===========================================================================\") + \"\\n\"\n + ac.yellow.bold(\" Textrix v\" + version + \" -- Minimalist Unit/Regression Test Tool\") + \"\\n\"\n + ac.blue(\"===========================================================================\") + \"\\n\"\n );\n\n}", "title": "" }, { "docid": "5725c0f12e69211f78668a9d0eeb2858", "score": "0.49447066", "text": "function headerStyle() {\n\t\tif($('.main-header').length){\n\t\t\tvar mainHeader = $('.main-header').height();\n\t\t\tvar windowpos = $(window).scrollTop();\n\t\t\tif (windowpos >= mainHeader) {\n\t\t\t\t$('.bounce-in-header').addClass('now-visible');\n\t\t\t\t$('.scroll-to-top').fadeIn(300);\n\t\t\t} else {\n\t\t\t\t$('.bounce-in-header').removeClass('now-visible');\n\t\t\t\t$('.scroll-to-top').fadeOut(300);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "aa72f40b12aa8785f325e0c2dcb6df93", "score": "0.49446523", "text": "function hideDPHeader(){\n\n return `\n\n /* =========dp header styles ==========*/\n header._3AwwN{\n display:none;\n }\n\n\n `;\n }", "title": "" } ]
97b7037c90313fddd16f44f870fe53ca
Smoothly move a unit from its current position to it's destination position
[ { "docid": "161de02ff3f39ea90f3646ea927efada", "score": "0.7162162", "text": "function smoothMovement(unit, time)\n{\n BookWyrm.game.add.tween(unit).to( { x: unit.xPos * 120 + 15, y: unit.yPos * 120 }, time, Phaser.Easing.linear, true);\n}", "title": "" } ]
[ { "docid": "d8d3017fd13592354a4591e5a4e95847", "score": "0.7255052", "text": "move() {\n this.previousPosition = this.position.slice();\n this.position[0] += this.velocity[0];\n this.position[1] += this.velocity[1];\n }", "title": "" }, { "docid": "eeaaacf6b42de54b48a1080ed5b24d43", "score": "0.69244605", "text": "drive() {\n this.direction = this.position.directionTo(this.goalPoint);\n\n //Moving with a given speed (step length) towards a point. \n this.position = this.position.newPointAt(this.direction, this.speed);\n }", "title": "" }, { "docid": "a2e54ccfffe2f8f386cacd22a90ef196", "score": "0.67972565", "text": "move() {\n this.x = this.x + (this.sx / 300) * this.speed;\n this.y = this.y + (this.sy / 300) * this.speed;\n }", "title": "" }, { "docid": "befa0b756ecf2e943da013690533dcb1", "score": "0.6787486", "text": "move() {\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n }", "title": "" }, { "docid": "36333fd8a97599560a9af22370adb047", "score": "0.6755609", "text": "function move_v2(elem, startPos, speed, direction, duration, fps) {\n var dtime = 1 / fps;\n var ddist = startPos;\n var date = new Date();\n\n function m() {\n if (new Date - date > duration) return;\n ddist += speed * dtime;\n elem.style[direction] = ddist + 'px';\n setTimeout(function () {\n m();\n }, 1000 * dtime);\n }\n\n m();\n}", "title": "" }, { "docid": "38df36596f98c00b6a027cd739ea770b", "score": "0.6738975", "text": "moved() {\n this.x = this.x + (this.sx / 300) * this.speed;\n this.y = this.y + (this.sy / 300) * this.speed;\n }", "title": "" }, { "docid": "6a44e649312303389b4712bb9b967553", "score": "0.6728941", "text": "function move_v1(elem, startPos, speed, direction, duration, fps) {\n var dtime = 1 / fps;\n var ddist = startPos;\n\n var h = setInterval(function () {\n ddist += speed * dtime;\n elem.style[direction] = ddist + 'px';\n }, 1000 * dtime);\n\n setTimeout(function () {\n clearInterval(h);\n }, duration);\n}", "title": "" }, { "docid": "919629264585eb345af6b6e5ed2e849f", "score": "0.66996455", "text": "move(){\n\t\tthis.x += cos(-this.angle) * this.speed;\n\t\tthis.y += sin(-this.angle) * this.speed;\n\t}", "title": "" }, { "docid": "97e7ec3d8aea8c4f2ad5ec8753aefc80", "score": "0.6674788", "text": "travel() {\n this.x += this.xVelocity;\n this.y += this.yVelocity;\n }", "title": "" }, { "docid": "f9e3a3f11610694be6ee502c12ddebed", "score": "0.666435", "text": "function move(direction) {}", "title": "" }, { "docid": "dbd8a7cadde81f306679fe8a0872e901", "score": "0.66349065", "text": "move() {\n // Set velocity via noise()\n this.vx = map(noise(this.tx), 0, 1, -this.speed, this.speed);\n this.vy = map(noise(this.ty), 0, 1, -this.speed, this.speed);\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n // Handle wrapping\n this.handleWrapping();\n }", "title": "" }, { "docid": "be34692044a769b443a2ac8ee9e37de9", "score": "0.66304266", "text": "move() {\n this.position = this.nextPosition();\n }", "title": "" }, { "docid": "0100873bc150f48f7969d43bbffd84a2", "score": "0.66273564", "text": "move(){\n this.x += this.speed_x;\n this.y += this.speed_y;\n }", "title": "" }, { "docid": "43f69348e5de0914c4ce096efc729133", "score": "0.66132766", "text": "function move() {\n x += (targetX - x) * 0.1;\n y += (targetY - y) * 0.1;\n\n if (Math.abs(targetX - x) < 1 && Math.abs(targetY - y) < 1) {\n x = targetX;\n y = targetY;\n } else {\n requestAnimationFrame(move);\n }\n\n style.transform = \"translate(\" + Math.round(x) + \"px,\" + Math.round(y) + \"px)\";\n }", "title": "" }, { "docid": "ca44dac47d67d4c645888182b864e4a8", "score": "0.65757585", "text": "move() {\n this.x += this.fwd.x * this.speed;\n this.y += this.fwd.y * this.speed;\n }", "title": "" }, { "docid": "ca44dac47d67d4c645888182b864e4a8", "score": "0.65757585", "text": "move() {\n this.x += this.fwd.x * this.speed;\n this.y += this.fwd.y * this.speed;\n }", "title": "" }, { "docid": "56a88c214275e3b0a04ac70d66e32e8f", "score": "0.65755194", "text": "move() {\n this.x += this.xdir;\n this.y += this.ydir;\n }", "title": "" }, { "docid": "56a88c214275e3b0a04ac70d66e32e8f", "score": "0.65755194", "text": "move() {\n this.x += this.xdir;\n this.y += this.ydir;\n }", "title": "" }, { "docid": "c0ab1a26b830e17b4d236b9f3daa26e1", "score": "0.65289986", "text": "move() {\n this.x -= 1.5;\n if (this.x < 1) {\n this.x = 650;\n }\n }", "title": "" }, { "docid": "c9496bd3082a2ed64c0f0e79527b9115", "score": "0.65103453", "text": "move() {\n //when piece moves, x coordinate is equal to x coordinate + direction * velocity\n this.x += this.dx * this.dxv;\n //when piece moves, y coordinate is equal to y coordinate + direction * velocity\n this.y += this.dy * this.dyv;\n }", "title": "" }, { "docid": "787aaf465af182093c7862dea3d0fc2e", "score": "0.6492268", "text": "moveForward(dist) {\n let newVec = this.state.dir.multiplyScalar(dist);\n this.state.pos.add(newVec);\n }", "title": "" }, { "docid": "68c842aa8f1f9c3970b57ad2d83614fc", "score": "0.64740837", "text": "move() {\n\t\tthis.y += this.speedY;\n\t}", "title": "" }, { "docid": "82df4b3c63ec3684c19d9ac70ad89900", "score": "0.6447405", "text": "function MoveToPoint(targetPos : Vector3) {\n \n if(control < 1.0){ //Continue until we reach the destination\n control += Time.deltaTime/transitionTime; //move along transition\n transform.position = Vector3.Lerp(currentPos, targetPos, Mathf.SmoothStep(0.0, 1.0, control)); //Smoothing optional\n \n }else{\n \tcurrentPos = targetPos; //we're now at the target's position;\n control = 0;\n }\n \n \n}", "title": "" }, { "docid": "49b7e1baee8cf401495ea89f22852979", "score": "0.64193153", "text": "function MoveUp()\n{\n myTransform.position = new Vector2(myTransform.position.x, myTransform.position.y + speed);\n}", "title": "" }, { "docid": "819effb724bf55e655f89126e594298a", "score": "0.6415771", "text": "move() {\n this.x += this.deltaX;\n this.y += this.deltaY;\n }", "title": "" }, { "docid": "7587ca0b737f4631efcceb76401305c1", "score": "0.6397384", "text": "move() {\n this.x += 0;\n this.y -= 2;\n if (this.y < 0) {\n this.y = 365;\n }\n }", "title": "" }, { "docid": "4bde733b59d51c6182015038ceafd724", "score": "0.6378446", "text": "move() {\n this.y += this.velocity;\n this.velocity += this.gravity;\n }", "title": "" }, { "docid": "a0b01be9b4ceb10a4efe47526c1e4b9f", "score": "0.63739145", "text": "function MoveTo(totalMeters) {\n var meterChange = totalMeters-totalMeterChange;\n totalMeterChange=totalMeters;\n //setPos(totalMeterChange);\n\tvar positionChange = meterChange/METERS_PER_PIXEL;\n\tweight.position.y -= positionChange;\n hook.position.y -= positionChange;\n\tstringToBlock.scale.y -= positionChange;\n\tstringToBlock.position.x += positionChange/2;\n\tblock.position.x += positionChange;\n\tstringToWeight.position.y -= positionChange/2;\n\tstringToWeight.scale.y += positionChange;\n}", "title": "" }, { "docid": "f4b1c5dedb1e334453d8e0b3df60d0bd", "score": "0.637324", "text": "function move() {\n\tcurrentSpeed = speed;\n\tthis.transform.position += (currentSpeed * direction * Time.deltaTime);\n}", "title": "" }, { "docid": "eb8f3f90afd98804d5ada4531e536a10", "score": "0.6358034", "text": "function move() {\n var value = 0;\n var firstChar = '';\n getCurrs();\n \n value = 0;\n progress = (new Date() - time) / options.duration;\n\n if (progress > 1) {\n progress = 1;\n }\n\n for (var prop in props) {\n firstChar = props[prop].toString().charAt(0);\n if (firstChar.charAt(0) === '+' || firstChar === '-') {\n value = initialProps[prop] + parseFloat(props[prop]) * options.easing(progress);\n } else {\n value = currProps[prop] + (props[prop] - currProps[prop]) * options.easing(progress);\n }\n if (prop === 'opacity') {\n el.style.opacity = value;\n } else {\n el.style[prop] = Math.round(value) + 'px';\n }\n }\n\n if (progress === 1) {\n cancelAnimationFrame(timer);\n if (typeof cb === 'function') {\n cb();\n }\n return;\n }\n\n timer = requestAnimationFrame(move);\n }", "title": "" }, { "docid": "ed21115fa263b27b939bcde2278e8927", "score": "0.6354386", "text": "move() {\n this.xPos += this.xSpeed;\n this.yPos += this.ySpeed;\n if (this.xPos > width || this.xPos < 0) {\n // increase speed a little bit\n this.xSpeed *= -1.08;\n }\n if (this.yPos > height || this.yPos < 0) {\n // increase speed a little bit\n this.ySpeed *= -1.08;\n }\n }", "title": "" }, { "docid": "98a1b23fcdaf1bdc5ffa5dfe2bef5915", "score": "0.6346463", "text": "move(){\n this.a+=0.5;\n this.x = this.x+sin(this.a)*1.25;\n this.y = this.y+cos(this.a)*1.25;\n}", "title": "" }, { "docid": "83446817d4e732cc7af9f517adcfc24a", "score": "0.63394654", "text": "function to_move(){\n\t\t\t\t\tlet move_speed = parseFloat(our_speed);\n\t\t\t\t\tif (move_speed === 0) { //if speed is zero\n\t\t\t\t\t\tdiv2.style.margin = \"0px 0px 0px \" + position;\n\t\t\t\t\t}\n\t\t\t\t\telse { //if speed is not zero\n\t\t\t\t\t\tlet change = move_speed/10;\n\t\t\t\t\t\tlet new_position = parseFloat(position);\n\n\t\t\t\t\t\tif (new_position <= 0) { //if need to make box forward\n\t\t\t\t\t\t\tforward = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (new_position >= 85) { //if need to make box backward\n\t\t\t\t\t\t\tforward = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (forward === true) { //change position if forward\n\t\t\t\t\t\t\tnew_position = new_position + change;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse { //change position if backward\n\t\t\t\t\t\t\tnew_position = new_position - change;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tposition = new_position.toString() + \"%\";\n\t\t\t\t\t\tdiv2.style.margin = \"0px 0px 0px \" + position;\n\t\t\t\t\t}\n\n\t\t\t\t\tmove_call_back();\n\t\t\t\t}", "title": "" }, { "docid": "48eb36666dc98d44692e3da2f2abaa0b", "score": "0.63288856", "text": "move() {\r\n let xDiff = this.xTarget - this.x;\r\n let yDiff = this.yTarget - this.y;\r\n if (Math.abs(xDiff) < 0.5 && Math.abs(yDiff) < 0.5)\r\n this.setRandomTargetPosition();\r\n else {\r\n this.x += xDiff * this.speed;\r\n this.y += yDiff * this.speed;\r\n }\r\n }", "title": "" }, { "docid": "57f6f7f00bed3f0da68eb588e79b44bf", "score": "0.6328112", "text": "moveSkierJump() {\n const direction = this.direction;\n this.y += this.speed / Constants.SKIER_DIAGONAL_SPEED_REDUCER;\n this.skierJump(direction);\n //Reset skier direction with 200 milliseconds delay\n setTimeout(() => {\n this.setDirection(direction);\n }, 200);\n }", "title": "" }, { "docid": "2efa375ecef99a22081d900bf0cb6ded", "score": "0.63130975", "text": "move () {\n this.loc_x += this.move_x;\n this.loc_y += this.move_y;\n\n if ( this.loc_x >= width ) {\n this.move_x *= -1;\n this.loc_x = width - abs ( this.move_x );\n } else if ( this.loc_x <= 0 ) {\n this.move_x *= -1;\n this.loc_x = abs ( this.move_x );\n } else if ( this.loc_y >= height ) {\n this.move_y *= -1;\n this.loc_y = height - abs ( this.move_y );\n } else if ( this.loc_y <= 0 ) {\n this.move_y *= -1;\n this.loc_y = abs ( this.move_y );\n }\n }", "title": "" }, { "docid": "520fe3a4e679cb752f76930b2ff6d7ca", "score": "0.63120306", "text": "move() {\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Handle wrapping\n this.handleWrapping();\n }", "title": "" }, { "docid": "520fe3a4e679cb752f76930b2ff6d7ca", "score": "0.63120306", "text": "move() {\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Handle wrapping\n this.handleWrapping();\n }", "title": "" }, { "docid": "0b58ffc8a4b2ae4548f75d724f4486a5", "score": "0.6308143", "text": "move() {\n\t\tlet nextX = this.nextSegment.xPosition;\n\t\tlet nextY = this.nextSegment.yPosition;\n\n\t\tlet diffX = nextX - this.xPosition;\n\t\tlet diffY = nextY - this.yPosition;\n\n\t\tlet squareDistance = Math.pow(diffX, 2) + Math.pow( diffY, 2);\n\t\tlet modalDistance = Math.sqrt(squareDistance);\n\t\tlet distanceInSegments = modalDistance/this.width;\n\n\n\t\tif (distanceInSegments > this.maxStretch){\n\t\t\t// compensate for overstretch on the x and y axis proportionally\n\t\t\tlet overDistance = distanceInSegments - this.maxStretch;\n\t\t\tlet overDistanceProportion = overDistance / distanceInSegments;\n\t\t\tlet overDistanceX = diffX * overDistanceProportion;\n\t\t\tlet overDistanceY = diffY * overDistanceProportion;\n\n\t\t\tthis.xPosition += overDistanceX;\n\t\t\tthis.yPosition += overDistanceY;\n\t\t}\n\n\t\tthis.xPosition += (diffX * this.elasticity);\n\t\tthis.yPosition += (diffY * this.elasticity);\n\t}", "title": "" }, { "docid": "08af3e2f5995efb7fe91f952401ca727", "score": "0.6305129", "text": "moveStep() {\n this._pos.x += this._velocity.x;\n this._pos.y += this._velocity.y;\n this._velocity.x *= 1.0-this._friction;\n this._velocity.y *= 1.0-this._friction;\n if (this._velocity.x > -0.0001 && this._velocity.x < 0.0001) {\n this._velocity.x = 0.0;\n }\n if (this._velocity.y > -0.0001 && this._velocity.y < 0.0001) {\n this._velocity.y = 0.0;\n }\n }", "title": "" }, { "docid": "cef87ae56437c428911f1d47cf210390", "score": "0.62994665", "text": "move(){\r\n\t\tthis.position.x=this.velocity.x;\r\n\t\tthis.position.y=this.velocity.y;\r\n\t\tthis.position.z=this.velocity.z;\r\n\t\tthis.object.position.x+=this.velocity.x;\r\n\t\tthis.object.position.y+=this.velocity.y;\r\n\t\tthis.object.position.z+=this.velocity.z;\r\n\t}", "title": "" }, { "docid": "3c64544527d368c0e0cc09ddb4049929", "score": "0.6270106", "text": "function forward(distance){\n move(0,distance);\n}", "title": "" }, { "docid": "910cd19b65219d64be61560f43d7b328", "score": "0.624763", "text": "moveForward() {\n this.counter += this.speed;\n this.x += this.speed * -50;\n }", "title": "" }, { "docid": "de7d188dfb2f6be4cc5c75ee68daec9e", "score": "0.62461114", "text": "move() {\n // Check which way enemy is headed and update the speed\n if (this.direction == 1) {\n this.x = this.x - this.speed;\n } else if (this.direction == 2) {\n this.x = this.x + this.speed;\n } else if (this.direction == 3) {\n this.y = this.y - this.speed;\n } else {\n this.y = this.y + this.speed;\n }\n }", "title": "" }, { "docid": "0a66372e52d34c8526af98797fd0b4cd", "score": "0.6239226", "text": "move() {\n this.x = this.x + this.vx;\n this.y = this.y + this.vy;\n }", "title": "" }, { "docid": "9e7a7402522772c746d88ae2435f9fa3", "score": "0.62335306", "text": "moveForward() {\n clear();\n this.y1 -= movement;\n }", "title": "" }, { "docid": "1c0b24b3ee399f882fdaa6b707c9924c", "score": "0.6226527", "text": "function elem_move(elem, x, y) {\n var t = elem.transform.baseVal.getItem(0);\n t.matrix.e = x+0.5;\n t.matrix.f = y+0.5;\n}", "title": "" }, { "docid": "1c0b24b3ee399f882fdaa6b707c9924c", "score": "0.6226527", "text": "function elem_move(elem, x, y) {\n var t = elem.transform.baseVal.getItem(0);\n t.matrix.e = x+0.5;\n t.matrix.f = y+0.5;\n}", "title": "" }, { "docid": "c9ac48df3c39cd4ac2453354c0c49505", "score": "0.62149906", "text": "move() {\n\t\tthis.pos.x += this.vel.x;\n\t\tthis.pos.y += this.vel.y;\n\t}", "title": "" }, { "docid": "89b9b96e95c28911a33994615942b1b6", "score": "0.621433", "text": "function move() {\n\t\tvar maxdiff = -Infinity;\n\t\tvar newd;\n\t\tfor (d in DIRECTION) {\n\t\t\ttry {\n\t\t\t\tnewPosition = this.position.plus_position(DIRECTION[d].direction);\n\t\t\t\tif (\n\t\t\t\t\tnewPosition.i >= 0 &&\n\t\t\t\t\tnewPosition.i < 10 &&\n\t\t\t\t\tnewPosition.j >= 0 &&\n\t\t\t\t\tnewPosition.j < 10 &&\n\t\t\t\t\tboard[newPosition.i][newPosition.j] != WALL &&\n\t\t\t\t\tboard[newPosition.i][newPosition.j] < 100\n\t\t\t\t) {\n\t\t\t\t\tdiff =\n\t\t\t\t\t\t-shape.distance(\n\t\t\t\t\t\t\tthis.position.plus_position(DIRECTION[d].direction)\n\t\t\t\t\t\t) + shape.distance(this.position);\n\t\t\t\t\tif (diff > maxdiff) {\n\t\t\t\t\t\tnewd = d;\n\t\t\t\t\t\tmaxdiff = diff;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (error) {}\n\t\t}\n\t\t//assumption: wont stuck\n\t\tboard[this.position.i][this.position.j] -= 100;\n\t\tthis.direction = DIRECTION[newd];\n\t\tthis.position.add_position(this.direction.direction);\n\t\tboard[this.position.i][this.position.j] += 100;\n\t}", "title": "" }, { "docid": "4125500c5e486a40e856da96068800ea", "score": "0.621019", "text": "move(direction, modifier){\n this.sprite.updateAnimation();\n super.move(direction, modifier);\n }", "title": "" }, { "docid": "1c3ef21b9090ef1001574740482a9060", "score": "0.6209872", "text": "function moveContinuously () {\n $scope.tank.move();\n }", "title": "" }, { "docid": "214ce5733d767c487f5644601c152d58", "score": "0.6208498", "text": "move() {\n this.vx = this.speed * cos(this.angle);\n this.vy = this.speed * sin(this.angle);\n\n this.userX += this.vx;\n this.userY += this.vy;\n }", "title": "" }, { "docid": "7b443b4095b4684c4ed0da9e7d120615", "score": "0.62032217", "text": "update() {\n this.prev = this.pos.copy();\n let dv = this.vel.copy();\n dv.mult(dt);\n this.pos.add(dv);\n }", "title": "" }, { "docid": "dd4aec023351ff7a5e6f1a110da20139", "score": "0.61995476", "text": "move() {\n this.clear();\n this.draw();\n this.x += this.speed;\n }", "title": "" }, { "docid": "c9fce8e12a7c796bc5eba2d58d22f029", "score": "0.6189827", "text": "move() {\n if (this.autopilot == false) {\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update health or not\n // this.health = this.health - this.healthLossPerMove;\n // this.health = constrain(this.health, 0, this.maxHealth);\n // Handle wrapping\n this.handleWrapping();\n } else {\n // Set velocity via noise()\n this.vx = map(noise(this.tx), 0, 1, -this.speed, this.speed);\n this.vy = map(noise(this.ty), 0, 1, -this.speed, this.speed);\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update time properties\n this.tx += 0.0000000001;\n this.ty += 0.0000000001;\n // Handle wrapping\n this.handleWrapping();\n }\n }", "title": "" }, { "docid": "116879899b326d9a4eeb00c914a173bc", "score": "0.61727655", "text": "move(direction) {\n let xModifier = 0, yModifier = 0;\n switch (direction) {\n case UP: yModifier = -1; break;\n case DOWN: yModifier = 1; break;\n case LEFT: xModifier = -1; break;\n case RIGHT: xModifier = 1;\n }\n this.queue.forEach(coord => {\n coord.x += xModifier;\n coord.y += yModifier;\n });\n }", "title": "" }, { "docid": "0cdf0969ee981947a1dc522d8c2c773b", "score": "0.6161452", "text": "updatePosition(dt) {\n\t\tthis.x += (this.velocity.x / 50) * dt;\n\t\tthis.y += (this.velocity.y / 50) * dt;\n\t}", "title": "" }, { "docid": "cc5a48badf218e4558ac4f9cbc82521a", "score": "0.6151947", "text": "move() {\n if (this.direction === \"E\") {\n this.x += this.speed;\n }\n else if (this.direction === \"N\") {\n this.y -= this.speed;\n }\n else if (this.direction === \"S\") {\n this.y += this.speed;\n }\n else if (this.direction === \"W\") {\n this.x -= this.speed;\n }\n }", "title": "" }, { "docid": "fc2ecf2ccdfa17d7be80bca38efd9098", "score": "0.61375976", "text": "move (source, destination, number) {\n source.power -= number;\n destination.power += number;\n }", "title": "" }, { "docid": "49c9a1b8b7564dde6a6f71710b2a005d", "score": "0.6123939", "text": "function MoveDown()\n{\n myTransform.position = new Vector2 (myTransform.position.x, myTransform.position.y - speed); \n}", "title": "" }, { "docid": "87f55c3554ea638f41f88b5578bd0542", "score": "0.6118637", "text": "move(){\n let directionToPlay = this.getDirection();\n directionToPlay.normalize();\n\n this.zombie.lookAt(controls_3D.getObject().position.x, this.zombie.position.y, controls_3D.getObject().position.z);\n let speed = 0.1;\n this.zombie.position.x += directionToPlay.x * speed;\n this.zombie.position.z += directionToPlay.z * speed;\n\n }", "title": "" }, { "docid": "82c4360ca76bb4722cf66c4fc3dcbc3d", "score": "0.61013275", "text": "moveUp() {\n this.speedY = -8;\n this.moving = MoveState.UP;\n }", "title": "" }, { "docid": "361d3df01125ea0e7ffbfa2f15c939e6", "score": "0.60879505", "text": "move() {\n // Set velocity via noise()\n this.vx = map(noise(this.tx), 0, 1, -this.speed, this.speed);\n this.vy = map(noise(this.ty), 0, 1, -this.speed, this.speed);\n // Update position while constraining rat movement to the foreground so they can't float.\n this.x = constrain(this.x, 0, 940);\n this.x += this.vx;\n this.y = constrain(this.y, 390, 450);\n this.y += this.vy;\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n // Borrow handleWrapping() from Prey class to get the rats back onscreen if they escape.\n super.handleWrapping();\n }", "title": "" }, { "docid": "0bff12ff727d5cf24431d30bd64a8932", "score": "0.6077886", "text": "moveToward(obj, targetPos, delta) {\n obj.translateOnAxis(obj.worldToLocal(targetPos), delta)\n }", "title": "" }, { "docid": "95ff2aa183c3fb1dbfe7de41c86807fd", "score": "0.606889", "text": "up() {\n this.y = Math.max(0, this.y - this.speed);\n }", "title": "" }, { "docid": "2aa416ce3a3b8ae781c2c44ecfd7d6ca", "score": "0.6056461", "text": "moveTowardsPosition (x, y) {\r\n const dx = x - this.x\r\n const dy = y - this.y\r\n const len = Math.sqrt(dx * dx + dy * dy)\r\n //if (len > this.movementSpeed || this.chase) {\r\n this.body.velocity.x = dx * this.movementSpeed / len\r\n this.body.velocity.y = dy * this.movementSpeed / len\r\n /*} else {\r\n this.body.velocity.x = dx\r\n this.body.velocity.y = dy\r\n }*/\r\n }", "title": "" }, { "docid": "b8c1efbdf1e72d5a84c90c4ba8433f03", "score": "0.6055498", "text": "function moveup() {\n firstGamePiece.speedY -= 1;\n}", "title": "" }, { "docid": "d35718d6136cbdad547a2fe313dddbc8", "score": "0.60499203", "text": "function moveMountain(){\n let tl4 = new TimelineMax({repeat:0})\n .to(mountain, 2, {scale:1.25})\n .to(mountain, 2, {scale:1});\n}", "title": "" }, { "docid": "e853335829e9427fb3b51302c70c8ff3", "score": "0.60437155", "text": "move(x = 0, y = 0) {\n \n let xMagnitude = x * this.axis.x\n let yMagnitude = y * this.axis.y\n \n this.view.x += xMagnitude\n this.view.y += yMagnitude\n \n this.offset.x -= xMagnitude\n this.offset.y -= yMagnitude\n \n }", "title": "" }, { "docid": "72655a529823eb38561c94624b7e8a24", "score": "0.6043094", "text": "update() {\n\t\tthis.position.y += this.direction === 'up' ? -this.speed : this.speed;\n\t}", "title": "" }, { "docid": "c6838a8c3f6bf790f5dbba5017cb3ed9", "score": "0.6042841", "text": "moveStep() {\n this._pos.x += this._velocity.x;\n this._pos.y += this._velocity.y;\n this._velocity.x *= 1.0-this._friction;\n this._velocity.y *= 1.0-this._friction;\n this.borderCheck();\n // if (this._velocity.x > -0.0001 && this._velocity.x < 0.0001) {\n // this._velocity.x = 0.0;\n // }\n // if (this._velocity.y > -0.0001 && this._velocity.y < 0.0001) {\n // this._velocity.y = 0.0;\n // }\n }", "title": "" }, { "docid": "5f8095f6b328d909809b73fbf7b195ea", "score": "0.6036441", "text": "move (unit) {\n if (this.isInRange(unit)) return\n\n let targets = this.getGoalStates(unit)\n let fringe = [{ depth: 0, path: [{ x: unit.x, y: unit.y }] }]\n let visited = {}\n let current, pos\n\n while (fringe.length) {\n current = fringe[0]\n pos = current.path[0]\n\n // reaching a potential in-range target\n if (this.isGoalState(pos, targets)) {\n const newPosition = this.selectStep(fringe, targets)\n return this.set(unit, newPosition)\n }\n\n // do not visit positions multiple times\n if (visited[pos.x] && visited[pos.x][pos.y]) {\n fringe = [...fringe.slice(1)]\n continue\n }\n\n visited[pos.x] = visited[pos.x] || {}\n visited[pos.x][pos.y] = true\n\n // add neighbors to explore later\n for (let [ x, y ] of this.getFreeAdjacentPositions(pos)) {\n if (visited[x] && visited[x][y]) continue\n\n fringe.push({\n depth: current.depth + 1,\n path: [{ x, y }, ...current.path]\n })\n }\n\n fringe = [...fringe.slice(1)]\n }\n }", "title": "" }, { "docid": "18dd67b913eb10b005093304435907a8", "score": "0.60356647", "text": "moveDown() {\n this.yPos += this.speed;\n }", "title": "" }, { "docid": "250839dd93957234d478e2702eeae1e3", "score": "0.6033099", "text": "move(){\n const path = this.path();\n if(path){\n this.map.swap(this.current.pos, path[1]);\n this.current.move(path[1]);\n }\n }", "title": "" }, { "docid": "def330a228ba3ed30ea10751721a7c68", "score": "0.6026355", "text": "move(u) {\n const p = this.#path.getPointAtLength(u * this.#path.getTotalLength());\n\tlet y = p.y - (this.#sprite.getBBox().height)/2;\n this.#sprite.setAttribute(\"transform\", `translate(${p.x}, ${y})`);\n }", "title": "" }, { "docid": "a0c917e6a7f0b4d4f249441bd89829b2", "score": "0.60172534", "text": "function elementMoveUp(elementItem) {\n TweenMax.to(elementItem, 1.3, {\n top: \"-=20px\",\n ease: Power2.easeIn,\n onCompleteParams: [elementItem],\n onComplete: elementMoveDown\n });\n}", "title": "" }, { "docid": "fa4fc14c5813a9b4767bb79252fbe029", "score": "0.60126865", "text": "move(dir){\n this.pos.x += dir;\n if(this.arena.collide(this)){\n this.pos.x -= dir;\n return;\n }\n this.events.emit('pos', this.pos);\n }", "title": "" }, { "docid": "136afd3d2c1fe8a949680caf571d0c2b", "score": "0.6011203", "text": "updatePos() {\n //find the changes in x and y\n var yChange = this.speed * Math.sin(this.theta) ;\n var xChange = this.speed * Math.cos(this.theta) ;\n //update the positions\n this.posX = this.posX + xChange ;\n this.posY = this.posY + yChange ;\n //update css\n this.element.css(\"left\", this.posX) ;\n this.element.css(\"top\", this.posY) ;\n }", "title": "" }, { "docid": "e67c29b2e36886183333a5fabe478ef2", "score": "0.6009175", "text": "move() {\n\t\tthis.x -= 16;\n\t}", "title": "" }, { "docid": "83a72251711c3bc20c0c0bcfccdfbee2", "score": "0.60066193", "text": "function move1(selector, delay, step) {\n $(selector).delay(delay).animate({\n left: '+=' + step,\n }, 1000, function () {\n $(this).animate({\n top: '+=' + step,\n }, 1000, function () {\n $(this).animate({\n left: '-=' + step\n }, 1000, function () {\n $(this).animate({\n top: '-=' + step,\n }, 1000);\n });\n });\n });\n }", "title": "" }, { "docid": "48eb2b18a5a9b65108d967b8a840ed6e", "score": "0.6005524", "text": "move() {\n // Update the position of the object\n this.x += this.vx;\n this.y += this.vy;\n\n }", "title": "" }, { "docid": "7874f0a591bde0e63a01715eb4c46194", "score": "0.59995055", "text": "function move() {\n if (player.direction == MOVE_NONE) {\n player.moving = false;\n return;\n }\n player.moving = true;\n\n var new_x = player.x;\n var new_y = player.y;\n\n if (player.direction == MOVE_LEFT) new_x -= 64;\n else if (player.direction == MOVE_RIGHT) new_x += 64;\n else if (player.direction == MOVE_UP) new_y -= 64;\n else if (player.direction == MOVE_DOWN) new_y += 64;\n\n var collisionsDetected = detectCollisions(new_x, new_y, obstacles);\n if (collisionsDetected == false && new_x < 2048 && new_y < 2048) {\n createjs.Tween.get(player).to({x: new_x, y: new_y}, 200).call(move);\n }\n else {\n player.moving = false;\n }\n}", "title": "" }, { "docid": "e305dc2c698a50bf7793f7c9bee65810", "score": "0.59986687", "text": "move() {\n\n\t}", "title": "" }, { "docid": "4a5d65d06179a18d63407f534148027f", "score": "0.5991466", "text": "moveBar(){\n //\tthis.x = this.x;\n this.y = this.y + this.speed;\n }", "title": "" }, { "docid": "7dc47a0ece558ec4ccdccc59691fe229", "score": "0.598589", "text": "move(){\n ctx.fillStyle = this.trail\n ctx.fillRect(this.pos[0]*scale, this.pos[1]*scale, scale - moveOffsetUnit, scale - moveOffsetUnit);\n\n this.pos[0] += this.dir[0];\n this.pos[1] += this.dir[1];\n if (board.inBounds(this.pos[0],this.pos[1])){\n board.matrix[this.pos[0]][this.pos[1]] += 1;\n }\n }", "title": "" }, { "docid": "d7ef6fdf95198b9d7ab1fb881bb83378", "score": "0.59793496", "text": "function movePiece(piece, target = []) {\r\n piece.position.x = target[0] * 50 - 200;\r\n piece.position.z = target[1] * 50 - 200;\r\n}", "title": "" }, { "docid": "717ec9fa4f477a265377ecd60ae85bc9", "score": "0.5976751", "text": "moveUp(distance, duration) {\n if (distance < 0) {\n this.moveDown(-distance, duration);\n return;\n }\n if (duration < 0) {\n throw new Error(`duration should be non negative, got: ${duration}`);\n }\n\n let dCurrentToTop = 0;\n let nRotations = 0;\n let dBottomToFinal = 0;\n const distanceToTop = this.topPosition.y - this.sprite.getPositionY();\n const maxDistance = this.topPosition.y - this.bottomPosition.y;\n if (distance <= distanceToTop) {\n // distance is too small to spin icon\n dCurrentToTop = distance;\n } else {\n dCurrentToTop = distanceToTop;\n nRotations = Math.floor((distance - distanceToTop) / maxDistance);\n dBottomToFinal = distance - distanceToTop - nRotations * maxDistance;\n }\n\n const speed = distance / duration;\n // time to move from current position to \"top\"\n const tCurrentToTop = dCurrentToTop / speed;\n let action = new cc.MoveBy(tCurrentToTop, cc.p(0, dCurrentToTop));\n if (nRotations > 0) {\n // time of one rotation\n const tOneRotation = maxDistance / speed;\n const oneRotationAction = new cc.Sequence(\n new cc.Place(this.bottomPosition),\n new cc.MoveTo(tOneRotation, this.topPosition)\n );\n action = new cc.Sequence(\n action,\n new cc.Repeat(oneRotationAction, nRotations)\n );\n }\n if (dBottomToFinal > 0) {\n const tBottomToFinal = dBottomToFinal / speed;\n action = new cc.Sequence(\n action,\n new cc.MoveBy(tBottomToFinal, cc.p(0, dBottomToFinal))\n );\n }\n\n this.runAction(action);\n }", "title": "" }, { "docid": "1bed823300542d76c2bf664e281f9dd1", "score": "0.59600693", "text": "function Update ()\n{\n\t//Move the object in a Sine arc to give it a floating effect\n\ttransform.position.y = originalPosition + (Mathf.Sin((Time.time + Phase) * speed)) * height / 2;\n}", "title": "" }, { "docid": "7338e3a0686a6ac546a9ed146e238d5d", "score": "0.5958055", "text": "function move() {\n motor.setSpeed(5);\n motor.setDirection(0);\n motor.stepperSteps(11);\n}", "title": "" }, { "docid": "2c037897e3137e1fbb97fbcb3637c907", "score": "0.5955508", "text": "function SmoothMovement(position, target){\n position.x = Math.round(position.x);\n position.y = Math.round(position.y);\n target.x = Math.round(target.x);\n target.y = Math.round(target.y);\n // initialise the position, target, velocity, and animation interval\n this.position = (position == undefined ? {x: 0, y:0} : position);\n this.target = (target == undefined ? this.position : target);\n this.velocity = {x:0, y:0};\n this.animationInterval = null;\n}", "title": "" }, { "docid": "880306db8c684938ff15651a10257816", "score": "0.5954207", "text": "move() {\n this.clear()\n this.shift()\n this.draw()\n }", "title": "" }, { "docid": "5f2833c0099ac0b5a821c42ad717906c", "score": "0.59533167", "text": "move(xDirection, yDirection = 0) {\n this.x += xDirection * this.speed;\n this.y += yDirection * this.speed;\n }", "title": "" }, { "docid": "14bd1cc950d90e2cb4c76a26b5774ac6", "score": "0.59479827", "text": "function moveHuman(){\r\n\t\tchangeHuman();\r\n\r\n\t\t$('#human').animate({left: '-=2000px'}, 12000, move);\r\n\t}", "title": "" }, { "docid": "33b781529a175e82c9fb43bc0f7e49d3", "score": "0.59458345", "text": "function move() {\n if (player.direction == MOVE_NONE) {\n player.moving = false;\n console.log(player.y);\n return;\n }\n player.moving = true;\n console.log(\"move\");\n \n if (player.direction == 1) //go left\n createjs.Tween.get(player).to({x: player.x - 32}, 500).call(move);\n \n if (player.direction == 2) //go right\n createjs.Tween.get(player).to({x: player.x + 32}, 500).call(move);\n\n if (player.direction == 3) //go up\n createjs.Tween.get(player).to({y: player.y - 32}, 500).call(move);\n \n if (player.direction == 4) // go down\n createjs.Tween.get(player).to({y: player.y + 32}, 500).call(move);\n}", "title": "" }, { "docid": "80ae1006f630a7baee16c93a5f9fd6cf", "score": "0.59413034", "text": "update() {\n this.x += this.xVelocity\n this.y += this.yVelocity\n }", "title": "" }, { "docid": "6b5cb3f317a5b06c741d00e17b43286f", "score": "0.5930087", "text": "move() {\n if (this.y >= Abschlussaufgabe.canvas.height - 75) {\n this.moveUp = true;\n }\n else if (this.y <= 0) {\n this.moveUp = false;\n }\n if (this.moveUp == false) {\n this.y += this.speed;\n }\n else {\n this.y -= this.speed;\n }\n }", "title": "" }, { "docid": "6b2d81f7cfb15cfeaca571641c06409c", "score": "0.59180427", "text": "move(fromX, fromY, toX, toY, durationMS, callback = false) {\n var curS, step, steps;\n steps = durationMS / 16;\n curS = 0;\n step = () => {\n curS += Math.PI / steps;\n this.matrix[12] += ((toX - fromX) / steps) * (Math.sin(curS) ** 2) * 2;\n this.matrix[13] += ((toY - fromY) / steps) * (Math.sin(curS) ** 2) * 2;\n this.updateTransformationMatrix();\n if (curS < Math.PI) {\n return requestAnimationFrame(step);\n } else if (callback) {\n return callback();\n }\n };\n return requestAnimationFrame(step);\n }", "title": "" }, { "docid": "bf7e0b12aa57104d7412e286071f8f47", "score": "0.59092283", "text": "function move(unit, direction){\n face(unit, direction);\n if (!wallCollisionCheck(unit, direction)){\n switch (direction) {\n case \"right\":\n unit.x++;\n break;\n case \"left\":\n unit.x--;\n break;\n case \"up\":\n unit.y--;\n break;\n case \"down\":\n unit.y++;\n break;\n default:\n break;\n }\n }\n}", "title": "" }, { "docid": "7ae7babbf655f2d12383f8e3572ca7fa", "score": "0.59032303", "text": "move(target,blobs,index)\n {\n this.dir = target.sub(this.pos).normalize();\n let newPos = this.pos.add( this.dir.mul(this.velocity.current) );\n if(!this.conflict(newPos,blobs,index))\n {\n this.pos = newPos\n }\n }", "title": "" } ]
e7bc7e3bb68508942a4740f08977a00c
Resolves a provider and publishes it to the DI system.
[ { "docid": "c936c78c0be33332f8aa67965465e5ab", "score": "0.5183266", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (let i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n }\n else {\n const tView = getTView();\n const lView = getLView();\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n let providerFactory = providerToFactory(provider);\n const tNode = getCurrentTNode();\n const beginIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */;\n const endIndex = tNode.directiveStart;\n const cptViewProvidersCount = tNode.providerIndexes >> 20 /* CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);\n const existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex === -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n const existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n const existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n const factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n const indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex :\n existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent);\n registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1 ? existingProvidersFactoryIndex :\n existingViewProvidersFactoryIndex, indexInFactory);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" } ]
[ { "docid": "288a64c6054ea1209fc119c563de0200", "score": "0.6255568", "text": "register(provider) {\n\t\tthis.providers[provider.key] = provider;\n\t}", "title": "" }, { "docid": "19240526d4b154ccb4aca8cabf9a51af", "score": "0.5901705", "text": "function resolveReflectiveProvider(provider){return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide),[resolveReflectiveFactory(provider)],provider.multi||false);}", "title": "" }, { "docid": "d3dde52306a0c0ddea8a04d5dee9ed46", "score": "0.5867778", "text": "function Provider(provider) {\n this.provider = provider;\n }", "title": "" }, { "docid": "d3dde52306a0c0ddea8a04d5dee9ed46", "score": "0.5867778", "text": "function Provider(provider) {\n this.provider = provider;\n }", "title": "" }, { "docid": "d3dde52306a0c0ddea8a04d5dee9ed46", "score": "0.5867778", "text": "function Provider(provider) {\n this.provider = provider;\n }", "title": "" }, { "docid": "d3dde52306a0c0ddea8a04d5dee9ed46", "score": "0.5867778", "text": "function Provider(provider) {\n this.provider = provider;\n }", "title": "" }, { "docid": "d3dde52306a0c0ddea8a04d5dee9ed46", "score": "0.5867778", "text": "function Provider(provider) {\n this.provider = provider;\n }", "title": "" }, { "docid": "d3dde52306a0c0ddea8a04d5dee9ed46", "score": "0.5867778", "text": "function Provider(provider) {\n this.provider = provider;\n }", "title": "" }, { "docid": "d3dde52306a0c0ddea8a04d5dee9ed46", "score": "0.5867778", "text": "function Provider(provider) {\n this.provider = provider;\n }", "title": "" }, { "docid": "d3dde52306a0c0ddea8a04d5dee9ed46", "score": "0.5867778", "text": "function Provider(provider) {\n this.provider = provider;\n }", "title": "" }, { "docid": "8a4bc82855417a34321d952549cd17a2", "score": "0.58287245", "text": "function resolveFactory(provider) {\r\n\t var factoryFn;\r\n\t var resolvedDeps;\r\n\t if (lang_1.isPresent(provider.useClass)) {\r\n\t var useClass = forward_ref_1.resolveForwardRef(provider.useClass);\r\n\t factoryFn = reflection_1.reflector.factory(useClass);\r\n\t resolvedDeps = _dependenciesFor(useClass);\r\n\t }\r\n\t else if (lang_1.isPresent(provider.useExisting)) {\r\n\t factoryFn = function (aliasInstance) { return aliasInstance; };\r\n\t resolvedDeps = [Dependency.fromKey(key_1.Key.get(provider.useExisting))];\r\n\t }\r\n\t else if (lang_1.isPresent(provider.useFactory)) {\r\n\t factoryFn = provider.useFactory;\r\n\t resolvedDeps = _constructDependencies(provider.useFactory, provider.dependencies);\r\n\t }\r\n\t else {\r\n\t factoryFn = function () { return provider.useValue; };\r\n\t resolvedDeps = _EMPTY_LIST;\r\n\t }\r\n\t return new ResolvedFactory(factoryFn, resolvedDeps);\r\n\t}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "db545833977defc6712c31986264bde0", "score": "0.57145166", "text": "function resolveReflectiveProvider(provider) {\n return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)], provider.multi || false);\n}", "title": "" }, { "docid": "279f0b9e3fe920635be3d89e14c85482", "score": "0.5642724", "text": "function addProvider(provider) {\n return $q(function(resolve, reject) {\n ProviderResource.addProvider(provider).then(function (response) {\n var result = response.data;\n if(((result.responseCode != undefined && result.responseCode == Constants.RESPONSE_SUCCESS )))\n {\n storeProviderLocal(result.data);\n return resolve(result.data);\n }\n else\n {\n return reject({data: result.data, managed:true});\n }\n \n }, function (error) {\n return reject({data: error, managed:false});\n });\n })\n }", "title": "" }, { "docid": "3038a79c6b3abf1946095108158a7321", "score": "0.56130636", "text": "function providerToFactory(provider) {\n var factory = undefined;\n if (isTypeProvider(provider)) {\n return injectableDefFactory(resolveForwardRef(provider));\n }\n else {\n if (isValueProvider(provider)) {\n factory = function () { return resolveForwardRef(provider.useValue); };\n }\n else if (isExistingProvider(provider)) {\n factory = function () { return inject(resolveForwardRef(provider.useExisting)); };\n }\n else if (isFactoryProvider(provider)) {\n factory = function () { return provider.useFactory.apply(provider, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(injectArgs(provider.deps || []))); };\n }\n else {\n var classRef_1 = resolveForwardRef(provider.useClass || provider.provide);\n if (hasDeps(provider)) {\n factory = function () { return new ((classRef_1).bind.apply((classRef_1), Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])([void 0], injectArgs(provider.deps))))(); };\n }\n else {\n return injectableDefFactory(classRef_1);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "9cd63d266aafd1f107a59571c795fa6f", "score": "0.56080425", "text": "function Provider(provider) {\n\t this.provider = provider;\n\t }", "title": "" }, { "docid": "e6daf476d45319a78dc4c56241661564", "score": "0.5570913", "text": "function providerToFactory(provider,ngModuleType,providers){var factory=undefined;if(isTypeProvider(provider)){return injectableDefOrInjectorDefFactory(resolveForwardRef(provider));}else{if(isValueProvider(provider)){factory=function factory(){return resolveForwardRef(provider.useValue);};}else if(isExistingProvider(provider)){factory=function factory(){return inject(resolveForwardRef(provider.useExisting));};}else if(isFactoryProvider(provider)){factory=function factory(){return provider.useFactory.apply(provider,__spread(injectArgs(provider.deps||[])));};}else{var classRef_1=resolveForwardRef(provider&&(provider.useClass||provider.provide));if(!classRef_1){var ngModuleDetail='';if(ngModuleType&&providers){var providerDetail=providers.map(function(v){return v==provider?'?'+provider+'?':'...';});ngModuleDetail=\" - only instances of Provider and Type are allowed, got: [\"+providerDetail.join(', ')+\"]\";}throw new Error(\"Invalid provider for the NgModule '\"+stringify(ngModuleType)+\"'\"+ngModuleDetail);}if(hasDeps(provider)){factory=function factory(){return new(classRef_1.bind.apply(classRef_1,__spread([void 0],injectArgs(provider.deps))))();};}else{return injectableDefOrInjectorDefFactory(classRef_1);}}}return factory;}", "title": "" }, { "docid": "7c29f7364385fc38289f9bc69338b7fe", "score": "0.5545108", "text": "function Provider() {\n\tthis.type = \"Generic Provider\";\n}", "title": "" }, { "docid": "f4061f7bb103f18151a10689e1f4c83c", "score": "0.5467654", "text": "function resolveReflectiveFactory(provider) {\n\t var factoryFn;\n\t var resolvedDeps;\n\t if (isPresent(provider.useClass)) {\n\t var useClass = resolveForwardRef(provider.useClass);\n\t factoryFn = reflector.factory(useClass);\n\t resolvedDeps = _dependenciesFor(useClass);\n\t }\n\t else if (isPresent(provider.useExisting)) {\n\t factoryFn = function (aliasInstance) { return aliasInstance; };\n\t resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n\t }\n\t else if (isPresent(provider.useFactory)) {\n\t factoryFn = provider.useFactory;\n\t resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n\t }\n\t else {\n\t factoryFn = function () { return provider.useValue; };\n\t resolvedDeps = _EMPTY_LIST;\n\t }\n\t return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n\t}", "title": "" }, { "docid": "52e10e5b7dbdbb12caabb26780299cd2", "score": "0.5466628", "text": "function resolveReflectiveFactory(provider) {\n\t var factoryFn;\n\t var resolvedDeps;\n\t if (isPresent(provider.useClass)) {\n\t var useClass = resolveForwardRef(provider.useClass);\n\t factoryFn = reflector.factory(useClass);\n\t resolvedDeps = _dependenciesFor(useClass);\n\t }\n\t else if (isPresent(provider.useExisting)) {\n\t factoryFn = function (aliasInstance) { return aliasInstance; };\n\t resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n\t }\n\t else if (isPresent(provider.useFactory)) {\n\t factoryFn = provider.useFactory;\n\t resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n\t }\n\t else {\n\t factoryFn = function () { return provider.useValue; };\n\t resolvedDeps = _EMPTY_LIST;\n\t }\n\t return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n\t }", "title": "" }, { "docid": "d124a1d8cbae1cb73be234158d100f66", "score": "0.5437937", "text": "function ModuleWithProviders() {}", "title": "" }, { "docid": "9279f385b16a1e16a70ae9f5d3e1a64e", "score": "0.54277223", "text": "function _provide(callback) {\n // Execute callback with $provide\n module(function($provide) {\n callback($provide);\n });\n }", "title": "" }, { "docid": "fced885cb6970a6f2f7b34afe7bf3a92", "score": "0.5422178", "text": "function resolveReflectiveFactory(provider) {\n\t var factoryFn;\n\t var resolvedDeps;\n\t if (provider.useClass) {\n\t var useClass = resolveForwardRef(provider.useClass);\n\t factoryFn = reflector.factory(useClass);\n\t resolvedDeps = _dependenciesFor(useClass);\n\t }\n\t else if (provider.useExisting) {\n\t factoryFn = function (aliasInstance) { return aliasInstance; };\n\t resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n\t }\n\t else if (provider.useFactory) {\n\t factoryFn = provider.useFactory;\n\t resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n\t }\n\t else {\n\t factoryFn = function () { return provider.useValue; };\n\t resolvedDeps = _EMPTY_LIST;\n\t }\n\t return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n\t }", "title": "" }, { "docid": "0af45c3bbced73c9ccc3669a64a404e0", "score": "0.5404872", "text": "function providerToFactory(provider, ngModuleType, providers) {\n var factory = undefined;\n if (isTypeProvider(provider)) {\n return injectableDefOrInjectorDefFactory(resolveForwardRef(provider));\n }\n else {\n if (isValueProvider(provider)) {\n factory = function () { return resolveForwardRef(provider.useValue); };\n }\n else if (isExistingProvider(provider)) {\n factory = function () { return ɵɵinject(resolveForwardRef(provider.useExisting)); };\n }\n else if (isFactoryProvider(provider)) {\n factory = function () { return provider.useFactory.apply(provider, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(injectArgs(provider.deps || []))); };\n }\n else {\n var classRef_1 = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (!classRef_1) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = function () { return new ((classRef_1).bind.apply((classRef_1), Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])([void 0], injectArgs(provider.deps))))(); };\n }\n else {\n return injectableDefOrInjectorDefFactory(classRef_1);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "8a7be43e59e9324a43e1b822def799a6", "score": "0.5398148", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (var i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider);\n }\n }\n else {\n var lView = getLView();\n var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n var providerFactory = providerToFactory(provider);\n var tNode = getPreviousOrParentTNode();\n var beginIndex = tNode.providerIndexes & 65535 /* ProvidersStartIndexMask */;\n var endIndex = tNode.directiveStart;\n var cptViewProvidersCount = tNode.providerIndexes >> 16 /* CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n var factory = new NodeInjectorFactory(providerFactory, isViewProvider, directiveInject);\n var existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex == -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n var existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n var existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n var doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n var doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n var factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent$$1, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent$$1);\n }\n if (!isViewProvider && isComponent$$1 && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" }, { "docid": "8a7be43e59e9324a43e1b822def799a6", "score": "0.5398148", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (var i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider);\n }\n }\n else {\n var lView = getLView();\n var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n var providerFactory = providerToFactory(provider);\n var tNode = getPreviousOrParentTNode();\n var beginIndex = tNode.providerIndexes & 65535 /* ProvidersStartIndexMask */;\n var endIndex = tNode.directiveStart;\n var cptViewProvidersCount = tNode.providerIndexes >> 16 /* CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n var factory = new NodeInjectorFactory(providerFactory, isViewProvider, directiveInject);\n var existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex == -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n var existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n var existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n var doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n var doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n var factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent$$1, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent$$1);\n }\n if (!isViewProvider && isComponent$$1 && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" }, { "docid": "8a7be43e59e9324a43e1b822def799a6", "score": "0.5398148", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (var i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider);\n }\n }\n else {\n var lView = getLView();\n var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n var providerFactory = providerToFactory(provider);\n var tNode = getPreviousOrParentTNode();\n var beginIndex = tNode.providerIndexes & 65535 /* ProvidersStartIndexMask */;\n var endIndex = tNode.directiveStart;\n var cptViewProvidersCount = tNode.providerIndexes >> 16 /* CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n var factory = new NodeInjectorFactory(providerFactory, isViewProvider, directiveInject);\n var existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex == -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n var existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n var existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n var doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n var doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n var factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent$$1, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent$$1);\n }\n if (!isViewProvider && isComponent$$1 && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" }, { "docid": "8a7be43e59e9324a43e1b822def799a6", "score": "0.5398148", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (var i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider);\n }\n }\n else {\n var lView = getLView();\n var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n var providerFactory = providerToFactory(provider);\n var tNode = getPreviousOrParentTNode();\n var beginIndex = tNode.providerIndexes & 65535 /* ProvidersStartIndexMask */;\n var endIndex = tNode.directiveStart;\n var cptViewProvidersCount = tNode.providerIndexes >> 16 /* CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n var factory = new NodeInjectorFactory(providerFactory, isViewProvider, directiveInject);\n var existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex == -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n var existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n var existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n var doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n var doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n var factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent$$1, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent$$1);\n }\n if (!isViewProvider && isComponent$$1 && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" }, { "docid": "8a7be43e59e9324a43e1b822def799a6", "score": "0.5398148", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (var i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider);\n }\n }\n else {\n var lView = getLView();\n var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n var providerFactory = providerToFactory(provider);\n var tNode = getPreviousOrParentTNode();\n var beginIndex = tNode.providerIndexes & 65535 /* ProvidersStartIndexMask */;\n var endIndex = tNode.directiveStart;\n var cptViewProvidersCount = tNode.providerIndexes >> 16 /* CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n var factory = new NodeInjectorFactory(providerFactory, isViewProvider, directiveInject);\n var existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex == -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n var existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n var existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n var doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n var doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), lView, token);\n var factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent$$1, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent$$1);\n }\n if (!isViewProvider && isComponent$$1 && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" }, { "docid": "8bf6e818be04753c1209655d2cb56bae", "score": "0.5397934", "text": "function providerToFactory(provider, ngModuleType, providers) {\n var factory = undefined;\n if (isTypeProvider(provider)) {\n return injectableDefOrInjectorDefFactory(resolveForwardRef(provider));\n }\n else {\n if (isValueProvider(provider)) {\n factory = function () { return resolveForwardRef(provider.useValue); };\n }\n else if (isExistingProvider(provider)) {\n factory = function () { return inject(resolveForwardRef(provider.useExisting)); };\n }\n else if (isFactoryProvider(provider)) {\n factory = function () { return provider.useFactory.apply(provider, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(injectArgs(provider.deps || []))); };\n }\n else {\n var classRef_1 = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (!classRef_1) {\n var ngModuleDetail = '';\n if (ngModuleType && providers) {\n var providerDetail = providers.map(function (v) { return v == provider ? '?' + provider + '?' : '...'; });\n ngModuleDetail =\n \" - only instances of Provider and Type are allowed, got: [\" + providerDetail.join(', ') + \"]\";\n }\n throw new Error(\"Invalid provider for the NgModule '\" + stringify(ngModuleType) + \"'\" + ngModuleDetail);\n }\n if (hasDeps(provider)) {\n factory = function () { return new ((classRef_1).bind.apply((classRef_1), Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])([void 0], injectArgs(provider.deps))))(); };\n }\n else {\n return injectableDefOrInjectorDefFactory(classRef_1);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "8bf6e818be04753c1209655d2cb56bae", "score": "0.5397934", "text": "function providerToFactory(provider, ngModuleType, providers) {\n var factory = undefined;\n if (isTypeProvider(provider)) {\n return injectableDefOrInjectorDefFactory(resolveForwardRef(provider));\n }\n else {\n if (isValueProvider(provider)) {\n factory = function () { return resolveForwardRef(provider.useValue); };\n }\n else if (isExistingProvider(provider)) {\n factory = function () { return inject(resolveForwardRef(provider.useExisting)); };\n }\n else if (isFactoryProvider(provider)) {\n factory = function () { return provider.useFactory.apply(provider, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(injectArgs(provider.deps || []))); };\n }\n else {\n var classRef_1 = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (!classRef_1) {\n var ngModuleDetail = '';\n if (ngModuleType && providers) {\n var providerDetail = providers.map(function (v) { return v == provider ? '?' + provider + '?' : '...'; });\n ngModuleDetail =\n \" - only instances of Provider and Type are allowed, got: [\" + providerDetail.join(', ') + \"]\";\n }\n throw new Error(\"Invalid provider for the NgModule '\" + stringify(ngModuleType) + \"'\" + ngModuleDetail);\n }\n if (hasDeps(provider)) {\n factory = function () { return new ((classRef_1).bind.apply((classRef_1), Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])([void 0], injectArgs(provider.deps))))(); };\n }\n else {\n return injectableDefOrInjectorDefFactory(classRef_1);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "8bf6e818be04753c1209655d2cb56bae", "score": "0.5397934", "text": "function providerToFactory(provider, ngModuleType, providers) {\n var factory = undefined;\n if (isTypeProvider(provider)) {\n return injectableDefOrInjectorDefFactory(resolveForwardRef(provider));\n }\n else {\n if (isValueProvider(provider)) {\n factory = function () { return resolveForwardRef(provider.useValue); };\n }\n else if (isExistingProvider(provider)) {\n factory = function () { return inject(resolveForwardRef(provider.useExisting)); };\n }\n else if (isFactoryProvider(provider)) {\n factory = function () { return provider.useFactory.apply(provider, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(injectArgs(provider.deps || []))); };\n }\n else {\n var classRef_1 = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (!classRef_1) {\n var ngModuleDetail = '';\n if (ngModuleType && providers) {\n var providerDetail = providers.map(function (v) { return v == provider ? '?' + provider + '?' : '...'; });\n ngModuleDetail =\n \" - only instances of Provider and Type are allowed, got: [\" + providerDetail.join(', ') + \"]\";\n }\n throw new Error(\"Invalid provider for the NgModule '\" + stringify(ngModuleType) + \"'\" + ngModuleDetail);\n }\n if (hasDeps(provider)) {\n factory = function () { return new ((classRef_1).bind.apply((classRef_1), Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])([void 0], injectArgs(provider.deps))))(); };\n }\n else {\n return injectableDefOrInjectorDefFactory(classRef_1);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "8bf6e818be04753c1209655d2cb56bae", "score": "0.5397934", "text": "function providerToFactory(provider, ngModuleType, providers) {\n var factory = undefined;\n if (isTypeProvider(provider)) {\n return injectableDefOrInjectorDefFactory(resolveForwardRef(provider));\n }\n else {\n if (isValueProvider(provider)) {\n factory = function () { return resolveForwardRef(provider.useValue); };\n }\n else if (isExistingProvider(provider)) {\n factory = function () { return inject(resolveForwardRef(provider.useExisting)); };\n }\n else if (isFactoryProvider(provider)) {\n factory = function () { return provider.useFactory.apply(provider, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(injectArgs(provider.deps || []))); };\n }\n else {\n var classRef_1 = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (!classRef_1) {\n var ngModuleDetail = '';\n if (ngModuleType && providers) {\n var providerDetail = providers.map(function (v) { return v == provider ? '?' + provider + '?' : '...'; });\n ngModuleDetail =\n \" - only instances of Provider and Type are allowed, got: [\" + providerDetail.join(', ') + \"]\";\n }\n throw new Error(\"Invalid provider for the NgModule '\" + stringify(ngModuleType) + \"'\" + ngModuleDetail);\n }\n if (hasDeps(provider)) {\n factory = function () { return new ((classRef_1).bind.apply((classRef_1), Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])([void 0], injectArgs(provider.deps))))(); };\n }\n else {\n return injectableDefOrInjectorDefFactory(classRef_1);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "8bf6e818be04753c1209655d2cb56bae", "score": "0.5397934", "text": "function providerToFactory(provider, ngModuleType, providers) {\n var factory = undefined;\n if (isTypeProvider(provider)) {\n return injectableDefOrInjectorDefFactory(resolveForwardRef(provider));\n }\n else {\n if (isValueProvider(provider)) {\n factory = function () { return resolveForwardRef(provider.useValue); };\n }\n else if (isExistingProvider(provider)) {\n factory = function () { return inject(resolveForwardRef(provider.useExisting)); };\n }\n else if (isFactoryProvider(provider)) {\n factory = function () { return provider.useFactory.apply(provider, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(injectArgs(provider.deps || []))); };\n }\n else {\n var classRef_1 = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (!classRef_1) {\n var ngModuleDetail = '';\n if (ngModuleType && providers) {\n var providerDetail = providers.map(function (v) { return v == provider ? '?' + provider + '?' : '...'; });\n ngModuleDetail =\n \" - only instances of Provider and Type are allowed, got: [\" + providerDetail.join(', ') + \"]\";\n }\n throw new Error(\"Invalid provider for the NgModule '\" + stringify(ngModuleType) + \"'\" + ngModuleDetail);\n }\n if (hasDeps(provider)) {\n factory = function () { return new ((classRef_1).bind.apply((classRef_1), Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])([void 0], injectArgs(provider.deps))))(); };\n }\n else {\n return injectableDefOrInjectorDefFactory(classRef_1);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b72b4bdb80d4a067210f4820bfefbbaa", "score": "0.53968817", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "1079e022cd3749db04fec51c25a7a4c6", "score": "0.53940713", "text": "function ModuleWithProviders() { }", "title": "" }, { "docid": "1079e022cd3749db04fec51c25a7a4c6", "score": "0.53940713", "text": "function ModuleWithProviders() { }", "title": "" }, { "docid": "1079e022cd3749db04fec51c25a7a4c6", "score": "0.53940713", "text": "function ModuleWithProviders() { }", "title": "" }, { "docid": "1079e022cd3749db04fec51c25a7a4c6", "score": "0.53940713", "text": "function ModuleWithProviders() { }", "title": "" }, { "docid": "a6b08e472247f7fea5b22e3262d1b044", "score": "0.53861016", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (var i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent$$1, isViewProvider);\n }\n }\n else {\n var viewData = getViewData();\n var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n var providerFactory = providerToFactory(provider);\n var previousOrParentTNode = getPreviousOrParentTNode();\n var beginIndex = previousOrParentTNode.providerIndexes & 65535 /* ProvidersStartIndexMask */;\n var endIndex = previousOrParentTNode.flags >> 16 /* DirectiveStartingIndexShift */;\n var cptViewProvidersCount = previousOrParentTNode.providerIndexes >> 16 /* CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n var factory = new NodeInjectorFactory(providerFactory, isViewProvider, directiveInject);\n var existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex == -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(previousOrParentTNode, viewData), viewData, token);\n tInjectables.push(token);\n previousOrParentTNode.flags += 1 << 16 /* DirectiveStartingIndexShift */;\n if (isViewProvider) {\n previousOrParentTNode.providerIndexes +=\n 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n viewData.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n viewData[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n var existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n var existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n var doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n var doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(previousOrParentTNode, viewData), viewData, token);\n var factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent$$1, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n tInjectables.push(token);\n previousOrParentTNode.flags += 1 << 16 /* DirectiveStartingIndexShift */;\n if (isViewProvider) {\n previousOrParentTNode.providerIndexes +=\n 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n viewData.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent$$1);\n }\n if (!isViewProvider && isComponent$$1 && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" }, { "docid": "d07e605f3e9158192f8698c21d57e994", "score": "0.53576493", "text": "function providerToFactory(provider, ngModuleType, providers) {\n var factory = undefined;\n if (isTypeProvider(provider)) {\n var unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n }\n else {\n if (isValueProvider(provider)) {\n factory = function () { return resolveForwardRef(provider.useValue); };\n }\n else if (isFactoryProvider(provider)) {\n factory = function () { return provider.useFactory.apply(provider, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(injectArgs(provider.deps || []))); };\n }\n else if (isExistingProvider(provider)) {\n factory = function () { return ɵɵinject(resolveForwardRef(provider.useExisting)); };\n }\n else {\n var classRef_1 = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (!classRef_1) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = function () { return new ((classRef_1).bind.apply((classRef_1), Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])([void 0], injectArgs(provider.deps))))(); };\n }\n else {\n return getFactoryDef(classRef_1) || injectableDefOrInjectorDefFactory(classRef_1);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "e3f78e3b29d06aaebd854f67c802b7ae", "score": "0.5314168", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__forward_ref__[\"a\" /* resolveForwardRef */])(provider.useClass);\n factoryFn = __WEBPACK_IMPORTED_MODULE_0__reflection_reflection__[\"a\" /* reflector */].factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(__WEBPACK_IMPORTED_MODULE_5__reflective_key__[\"a\" /* ReflectiveKey */].get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "e3f78e3b29d06aaebd854f67c802b7ae", "score": "0.5314168", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (provider.useClass) {\n var useClass = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__forward_ref__[\"a\" /* resolveForwardRef */])(provider.useClass);\n factoryFn = __WEBPACK_IMPORTED_MODULE_0__reflection_reflection__[\"a\" /* reflector */].factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(__WEBPACK_IMPORTED_MODULE_5__reflective_key__[\"a\" /* ReflectiveKey */].get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "27ccd91d0db9cd9607fd6411d9527dfb", "score": "0.5312078", "text": "function resolveReflectiveFactory(provider){var factoryFn;var resolvedDeps;if(provider.useClass){var useClass=resolveForwardRef(provider.useClass);factoryFn=reflector.factory(useClass);resolvedDeps=_dependenciesFor(useClass);}else if(provider.useExisting){factoryFn=function factoryFn(aliasInstance){return aliasInstance;};resolvedDeps=[ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];}else if(provider.useFactory){factoryFn=provider.useFactory;resolvedDeps=constructDependencies(provider.useFactory,provider.deps);}else{factoryFn=function factoryFn(){return provider.useValue;};resolvedDeps=_EMPTY_LIST;}return new ResolvedReflectiveFactory(factoryFn,resolvedDeps);}", "title": "" }, { "docid": "c5bfa7ae5ad7684999b5f4a036f09437", "score": "0.5310467", "text": "function resolveReflectiveFactory(provider) {\n let factoryFn;\n let resolvedDeps;\n if (provider.useClass) {\n const useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = (aliasInstance) => aliasInstance;\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = () => provider.useValue;\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "c5bfa7ae5ad7684999b5f4a036f09437", "score": "0.5310467", "text": "function resolveReflectiveFactory(provider) {\n let factoryFn;\n let resolvedDeps;\n if (provider.useClass) {\n const useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = (aliasInstance) => aliasInstance;\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = () => provider.useValue;\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "c5bfa7ae5ad7684999b5f4a036f09437", "score": "0.5310467", "text": "function resolveReflectiveFactory(provider) {\n let factoryFn;\n let resolvedDeps;\n if (provider.useClass) {\n const useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = (aliasInstance) => aliasInstance;\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = () => provider.useValue;\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "c5bfa7ae5ad7684999b5f4a036f09437", "score": "0.5310467", "text": "function resolveReflectiveFactory(provider) {\n let factoryFn;\n let resolvedDeps;\n if (provider.useClass) {\n const useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = (aliasInstance) => aliasInstance;\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = () => provider.useValue;\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "c5bfa7ae5ad7684999b5f4a036f09437", "score": "0.5310467", "text": "function resolveReflectiveFactory(provider) {\n let factoryFn;\n let resolvedDeps;\n if (provider.useClass) {\n const useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = (aliasInstance) => aliasInstance;\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = () => provider.useValue;\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "c5bfa7ae5ad7684999b5f4a036f09437", "score": "0.5310467", "text": "function resolveReflectiveFactory(provider) {\n let factoryFn;\n let resolvedDeps;\n if (provider.useClass) {\n const useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (provider.useExisting) {\n factoryFn = (aliasInstance) => aliasInstance;\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n }\n else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = () => provider.useValue;\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "277b13008bdd771e2482a6f5aaa98cbb", "score": "0.52554804", "text": "function resolve(ctx, injection) {\n if (injection.resolve) {\n // A custom resolve function is provided\n return injection.resolve(ctx, injection);\n }\n // Default to resolve the value from the context by binding key\n const binding = ctx.getBinding(injection.bindingKey);\n return binding.getValue(ctx);\n}", "title": "" }, { "docid": "8944b3c86eabeb44e0db0733a46b8023", "score": "0.5248991", "text": "getProvider(name4) {\n if (this.providers.has(name4)) {\n return this.providers.get(name4);\n }\n const provider = new Provider(name4, this);\n this.providers.set(name4, provider);\n return provider;\n }", "title": "" }, { "docid": "1b2de67c91ca1ad2e5f1a05eb733ffac", "score": "0.5225943", "text": "setProvider(provider) {\n this.provider = provider;\n }", "title": "" }, { "docid": "97f25fd8cbcca468b32b30ef04a3fc2f", "score": "0.51553684", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (var i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n }\n else {\n var tView = getTView();\n var lView = getLView();\n var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n var providerFactory = providerToFactory(provider);\n var tNode = getPreviousOrParentTNode();\n var beginIndex = tNode.providerIndexes & 65535 /* ProvidersStartIndexMask */;\n var endIndex = tNode.directiveStart;\n var cptViewProvidersCount = tNode.providerIndexes >> 16 /* CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n var factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);\n var existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex === -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n var existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n var existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n var doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n var doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n var factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1 ?\n existingProvidersFactoryIndex :\n existingViewProvidersFactoryIndex);\n multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" }, { "docid": "839a81ef6da32ff500052551e0684a3c", "score": "0.51413745", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (var i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n }\n else {\n var lView = getLView();\n var tView = lView[TVIEW];\n var token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n var providerFactory = providerToFactory(provider);\n var tNode = getPreviousOrParentTNode();\n var beginIndex = tNode.providerIndexes & 65535 /* ProvidersStartIndexMask */;\n var endIndex = tNode.directiveStart;\n var cptViewProvidersCount = tNode.providerIndexes >> 16 /* CptViewProvidersCountShift */;\n if (isClassProvider(provider) || isTypeProvider(provider)) {\n var prototype = (provider.useClass || provider).prototype;\n var ngOnDestroy = prototype.ngOnDestroy;\n if (ngOnDestroy) {\n (tView.destroyHooks || (tView.destroyHooks = [])).push(tInjectables.length, ngOnDestroy);\n }\n }\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n var factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);\n var existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex == -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n var existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n var existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n var doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n var doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n var factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 65536 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" }, { "docid": "2bfbd0525e3da494a36367b2d7c65458", "score": "0.51329094", "text": "function resolveProvider$1(provider, tInjectables, lInjectablesBlueprint, isComponent, isViewProvider) {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (let i = 0; i < provider.length; i++) {\n resolveProvider$1(provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n }\n else {\n const tView = getTView();\n const lView = getLView();\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n let providerFactory = providerToFactory(provider);\n const tNode = getPreviousOrParentTNode();\n const beginIndex = tNode.providerIndexes & 1048575 /* ProvidersStartIndexMask */;\n const endIndex = tNode.directiveStart;\n const cptViewProvidersCount = tNode.providerIndexes >> 20 /* CptViewProvidersCountShift */;\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n const factory = new NodeInjectorFactory(providerFactory, isViewProvider, ɵɵdirectiveInject);\n const existingFactoryIndex = indexOf(token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount, endIndex);\n if (existingFactoryIndex === -1) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n }\n else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n const existingProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n const existingViewProvidersFactoryIndex = indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, token);\n const factory = multiFactory(isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver, lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n registerDestroyHooksIfSupported(tView, provider, tInjectables.length, 0);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += 1048576 /* CptViewProvidersCountShifter */;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n }\n else {\n // Cases 1.b and 2.b\n const indexInFactory = multiFactoryAdd(lInjectablesBlueprint[isViewProvider ? existingViewProvidersFactoryIndex :\n existingProvidersFactoryIndex], providerFactory, !isViewProvider && isComponent);\n registerDestroyHooksIfSupported(tView, provider, existingProvidersFactoryIndex > -1 ? existingProvidersFactoryIndex :\n existingViewProvidersFactoryIndex, indexInFactory);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;\n }\n }\n }\n}", "title": "" }, { "docid": "c02c1e2c69b7f44035ab20d5e2d0166d", "score": "0.5129794", "text": "function providerToFactory(provider, ngModuleType, providers) {\n let factory = undefined;\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n }\n else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n }\n else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n }\n else if (isExistingProvider(provider)) {\n factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));\n }\n else {\n const classRef = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (!classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new (classRef)(...injectArgs(provider.deps));\n }\n else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "b44f6eac62b345ac6b03b41758cf6c89", "score": "0.51277125", "text": "constructor(pkg, name, props, opts = {}, dependency = false) {\n super(`pulumi:providers:${pkg}`, name, props, opts, dependency);\n this.pkg = pkg;\n }", "title": "" }, { "docid": "d2414a263f05d6c026f24bf4da2c1e27", "score": "0.51143914", "text": "function providerToFactory(provider, ngModuleType, providers) {\n let factory = undefined;\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n }\n else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n }\n else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n }\n else if (isExistingProvider(provider)) {\n factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));\n }\n else {\n const classRef = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (ngDevMode && !classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new (classRef)(...injectArgs(provider.deps));\n }\n else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "d2414a263f05d6c026f24bf4da2c1e27", "score": "0.51143914", "text": "function providerToFactory(provider, ngModuleType, providers) {\n let factory = undefined;\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n }\n else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n }\n else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n }\n else if (isExistingProvider(provider)) {\n factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));\n }\n else {\n const classRef = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (ngDevMode && !classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new (classRef)(...injectArgs(provider.deps));\n }\n else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "d2414a263f05d6c026f24bf4da2c1e27", "score": "0.51143914", "text": "function providerToFactory(provider, ngModuleType, providers) {\n let factory = undefined;\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n }\n else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n }\n else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n }\n else if (isExistingProvider(provider)) {\n factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));\n }\n else {\n const classRef = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (ngDevMode && !classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new (classRef)(...injectArgs(provider.deps));\n }\n else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "d2414a263f05d6c026f24bf4da2c1e27", "score": "0.51143914", "text": "function providerToFactory(provider, ngModuleType, providers) {\n let factory = undefined;\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n }\n else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n }\n else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n }\n else if (isExistingProvider(provider)) {\n factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));\n }\n else {\n const classRef = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (ngDevMode && !classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new (classRef)(...injectArgs(provider.deps));\n }\n else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "d2414a263f05d6c026f24bf4da2c1e27", "score": "0.51143914", "text": "function providerToFactory(provider, ngModuleType, providers) {\n let factory = undefined;\n if (isTypeProvider(provider)) {\n const unwrappedProvider = resolveForwardRef(provider);\n return getFactoryDef(unwrappedProvider) || injectableDefOrInjectorDefFactory(unwrappedProvider);\n }\n else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n }\n else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n }\n else if (isExistingProvider(provider)) {\n factory = () => ɵɵinject(resolveForwardRef(provider.useExisting));\n }\n else {\n const classRef = resolveForwardRef(provider &&\n (provider.useClass || provider.provide));\n if (ngDevMode && !classRef) {\n throwInvalidProviderError(ngModuleType, providers, provider);\n }\n if (hasDeps(provider)) {\n factory = () => new (classRef)(...injectArgs(provider.deps));\n }\n else {\n return getFactoryDef(classRef) || injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}", "title": "" }, { "docid": "b9b89d64e4a403b703a8fa1c1386da0b", "score": "0.51100266", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"e\" /* isPresent */])(provider.useClass)) {\n var useClass = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__forward_ref__[\"a\" /* resolveForwardRef */])(provider.useClass);\n factoryFn = __WEBPACK_IMPORTED_MODULE_2__reflection_reflection__[\"a\" /* reflector */].factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"e\" /* isPresent */])(provider.useExisting)) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(__WEBPACK_IMPORTED_MODULE_7__reflective_key__[\"a\" /* ReflectiveKey */].get(provider.useExisting))];\n }\n else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"e\" /* isPresent */])(provider.useFactory)) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "b9b89d64e4a403b703a8fa1c1386da0b", "score": "0.51100266", "text": "function resolveReflectiveFactory(provider) {\n var factoryFn;\n var resolvedDeps;\n if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"e\" /* isPresent */])(provider.useClass)) {\n var useClass = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__forward_ref__[\"a\" /* resolveForwardRef */])(provider.useClass);\n factoryFn = __WEBPACK_IMPORTED_MODULE_2__reflection_reflection__[\"a\" /* reflector */].factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n }\n else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"e\" /* isPresent */])(provider.useExisting)) {\n factoryFn = function (aliasInstance) { return aliasInstance; };\n resolvedDeps = [ReflectiveDependency.fromKey(__WEBPACK_IMPORTED_MODULE_7__reflective_key__[\"a\" /* ReflectiveKey */].get(provider.useExisting))];\n }\n else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__facade_lang__[\"e\" /* isPresent */])(provider.useFactory)) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n }\n else {\n factoryFn = function () { return provider.useValue; };\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}", "title": "" }, { "docid": "080e390f0069f1e3d87602908a808af8", "score": "0.5109973", "text": "static invoke(target, providers = []) {\n const locals = new LocalsContainer_1.LocalsContainer();\n providers.forEach((p) => {\n locals.set(p.token, p.use);\n });\n locals.set(InjectorService_1.InjectorService, DITest.injector);\n const instance = DITest.injector.invoke(target, locals, { rebuild: true });\n if (instance && instance.$onInit) {\n // await instance.$onInit();\n const result = instance.$onInit();\n if (result instanceof Promise) {\n return result.then(() => instance);\n }\n }\n return instance;\n }", "title": "" }, { "docid": "7556ea7e7baba452130af3964a8fc9a6", "score": "0.5100578", "text": "function getProvider(args, source) {\r\n\t\tvar method = args.method;\r\n\t\tvar args = args.args;\r\n\r\n\t\treturn new producers[method](args);\r\n\t}", "title": "" }, { "docid": "b7aa2554446e7e8475fe988d6e15cedb", "score": "0.5096819", "text": "function PackageProvider(config) {\n var self = Object.create(PackageProvider.prototype)\n self.config = config\n self.logger = Logger.logger.child({ sub: 'packages' })\n\n var plugin_params = {\n config: config,\n logger: self.logger\n }\n\n // load all plugins referenced by any package\n for (var i in config.packages) {\n if(config.packages[i].plugin) {\n config.packages[i].loaded_plugins = load_plugins(config.packages[i].plugin, plugin_params, 'package_provider', ['allow_access'])\n }\n }\n\n self.default_plugin = new ConfigPackageProvider({}, plugin_params)\n\n return self\n}", "title": "" }, { "docid": "abe453bababdc361ceaea670d2735b78", "score": "0.5051128", "text": "function createProvider() {\n return (new LocalProvider());\n }", "title": "" }, { "docid": "0b1d0cda2d4cdf2442a0040dcd89b60e", "score": "0.50451684", "text": "function resolveMe(resolve) {\n resolveMeResolver();\n }", "title": "" } ]
2d2df46c6563548c43009a12e293c212
Register a vendor component name: name used in import/require value: module to resolve
[ { "docid": "950fab4e23eb4e2b83d667c0b645c5f1", "score": "0.65051156", "text": "static register(name, value) {\n components[name] = value\n }", "title": "" } ]
[ { "docid": "2233b413592c2d0100118df25e7cbb1f", "score": "0.61244214", "text": "useComponent(component) {\n if (window[component]) {\n Vue.use(window[component]);\n // let vcomponent = Vue.component('SuiInput').extend({props:{isFluid: true}});\n // console.log(vcomponent);\n } else {\n console.error('Unable to register component: '+ component + '. Make sure it is load correctly.');\n }\n }", "title": "" }, { "docid": "50d4bd4928ad259f9784c688f5b9daaf", "score": "0.5950531", "text": "useComponent(component) {\n if (window[component]) {\n Vue.use(window[component]);\n } else {\n console.error('Unable to register component: ' + component + '. Make sure it is load correctly.');\n }\n }", "title": "" }, { "docid": "f7faadebf4e1dabfc905b70857372c7b", "score": "0.59278375", "text": "register() {\n Vue.component(this.name, this)\n }", "title": "" }, { "docid": "3da6f0cc34454632f4fbc8f8568158b4", "score": "0.5926974", "text": "function component_install(Vue) {\n var name = this.name;\n Vue.component(name, this);\n Vue.component(camelize(\"-\".concat(name)), this);\n} // unify slots & scopedSlots", "title": "" }, { "docid": "a26f4b441f3ea83deba44e516b5526d9", "score": "0.5879776", "text": "async register(name) {\n if (!this.instants[name]) {\n throw new Error(`The extension \"${name}\" is not loaded.`);\n }\n await this.instants[name].register();\n }", "title": "" }, { "docid": "abc7c136e17b57ea2358bc0c562db90e", "score": "0.58568966", "text": "async function installComponent({registryName, options = '', name, type = 'component'}) {\n\tif (!name) {\n\t\thelpers.message('yellow', helpers.msg.warning('Please provide the name!'));\n\t\treturn;\n\t}\n\n\ttry {\n\t\tconst config = Veams.getBlueprintConfig({name, type});\n\t\tconst src = `${process.cwd()}/node_modules/${registryName}`;\n\t\tconst dest = `${config.path}/${config.name}`;\n\n\t\tVeams\n\t\t\t.installPkg(registryName, options)\n\t\t\t.then(() => {\n\t\t\t\treturn helpers.copy({\n\t\t\t\t\tsrc,\n\t\t\t\t\tdest\n\t\t\t\t});\n\t\t\t})\n\t\t\t.then(() => {\n\t\t\t\tlet stylePath = `${dest}/styles/${name}`;\n\t\t\t\tlet scriptPath = fs.pathExistsSync(`${dest}/scripts/${name}.js`) ? `${dest}/scripts/${name}` : '';\n\n\t\t\t\treturn Veams.updateImportFiles(stylePath, scriptPath);\n\t\t\t})\n\t\t\t.then(() => {\n\t\t\t\tVeams.insertBlueprint(dest);\n\t\t\t\thelpers.message('green', helpers.msg.success(registryName));\n\t\t\t});\n\n\t} catch (err) {\n\t\thelpers.message('red', helpers.msg.error(err));\n\t}\n}", "title": "" }, { "docid": "6992815721a9392d94042e23a6b77e4f", "score": "0.58177924", "text": "function registerVendor() {\n var url = [refstackApiUrl, '/vendors/', ctrl.vendorId,\n '/action'].join('');\n $http.post(url, {register: null}).success(function() {\n ctrl.getVendor();\n }).error(function(error) {\n raiseAlert('danger', 'Error: ', error.detail);\n });\n }", "title": "" }, { "docid": "54518ddfe8020c07d742e80cf6164ba8", "score": "0.57520986", "text": "function componentAdd( $component, $name )\n\t{\n\t\t_components[$name] = $component;\n\t}", "title": "" }, { "docid": "89e1edb54d9e12fa9250ca10fe85d856", "score": "0.5720303", "text": "function register () {\n return resolveModule()\n }", "title": "" }, { "docid": "98323e3be7d9342a3cd32e7b6af0c15c", "score": "0.57032335", "text": "function registerComponent(cmp) {\n const tag = cmp.tag.toUpperCase();\n if (Object.prototype.hasOwnProperty.call(data.components, tag))\n console.warn('Doz', `component ${tag} overwritten`);\n data.components[tag] = cmp;\n}", "title": "" }, { "docid": "5082bd526ffca79302d192a754faafd1", "score": "0.5688734", "text": "function install(Vue) {\n var name = this.name;\n Vue.component(name, this);\n Vue.component(Object(string[\"a\" /* camelize */])(\"-\" + name), this);\n} // unify slots & scopedSlots", "title": "" }, { "docid": "5082bd526ffca79302d192a754faafd1", "score": "0.5688734", "text": "function install(Vue) {\n var name = this.name;\n Vue.component(name, this);\n Vue.component(Object(string[\"a\" /* camelize */])(\"-\" + name), this);\n} // unify slots & scopedSlots", "title": "" }, { "docid": "7952f6f888a6a7a7ff3ed7a6b0045648", "score": "0.56887233", "text": "registerComponent(component) {\n // check if that component is already registered\n const registered = this.vues.filter((comp) => comp.name === component.name);\n if (registered.length > 0) {\n registered[0].ids.push(component.ids[0]);\n } else {\n this.vues.push(component);\n }\n }", "title": "" }, { "docid": "7c5a539c3bebebc66361885aed1ad855", "score": "0.5640667", "text": "function registerComponent(cmp) {\n\n const tag = cmp.tag.toUpperCase();\n\n if (Object.prototype.hasOwnProperty.call(data.components, tag))\n console.warn('Doz', `component ${tag} overwritten`);\n\n data.components[tag] = cmp;\n}", "title": "" }, { "docid": "b34713e1bfa16be5de8e481eb7c742cc", "score": "0.5626491", "text": "addByName(cName){\n\t\t\tlet c;\n\t\t\tif(!(c = Components(cName))){\n\t\t\t\tconsole.log(\"Could not found component \", cName);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tthis.addCom( c );\n\t\t\treturn c;\n\t\t}", "title": "" }, { "docid": "e434d30dab247aef6189d862417fc4b6", "score": "0.5593737", "text": "static get tag() {\n return \"dynamic-import-registry\";\n }", "title": "" }, { "docid": "405802e7b9685d18b5c5f1f2ebe67432", "score": "0.55349785", "text": "function addDep(props, packageName, version) {\n if (props.dependencies[packageName]) {\n return;\n }\n props.dependencies[packageName] = version;\n props.requireCode += 'var ' + packageName + ' = require(\\'' + packageName + '\\');\\n';\n }", "title": "" }, { "docid": "f636a03445007fedc1812a64cc0b3860", "score": "0.54764557", "text": "function registerComponent(name, options) {\n var controller = options.controller || function () {};\n\n function factory($injector) {\n function makeInjectable(fn) {\n if (angular.isFunction(fn) || angular.isArray(fn)) {\n return function (tElement, tAttrs) {\n return $injector.invoke(fn, this, { $element: tElement, $attrs: tAttrs });\n };\n } else {\n return fn;\n }\n }\n\n var template = !options.template && !options.templateUrl ? '' : options.template;\n var ddo = {\n controller: controller,\n controllerAs: identifierForController(options.controller) || options.controllerAs || '$ctrl',\n template: makeInjectable(template),\n templateUrl: makeInjectable(options.templateUrl),\n transclude: options.transclude,\n scope: {},\n bindToController: options.bindings || {},\n restrict: 'E',\n require: options.require\n };\n\n // Copy annotations (starting with $) over to the DDO\n angular.forEach(options, function(val, key) {\n if (key.charAt(0) === '$') ddo[key] = val;\n });\n\n return ddo;\n }\n\n // Copy any annotation properties (starting with $) over to the factory and controller constructor functions\n // These could be used by libraries such as the new component router\n angular.forEach(options, function(val, key) {\n if (key.charAt(0) === '$') {\n factory[key] = val;\n // Don't try to copy over annotations to named controller\n if (angular.isFunction(controller)) controller[key] = val;\n }\n });\n\n factory.$inject = ['$injector'];\n\n registerHotDirective(name, factory);\n\n return hotNgModule;\n }", "title": "" }, { "docid": "7488f0e1d93864fe3cce08abafdbc80c", "score": "0.546642", "text": "function vendors () {\n const dest = process.env.dest\n const src = process.env.src\n\n // files that need to be bundled via browserify\n const moduleFiles = [\n `${src}/../node_modules/uuid/`,\n `${src}/../node_modules/@blinkmobile/angular-camera/`,\n `${src}/../node_modules/@blinkmobile/angular-location/lib/index.js`,\n `${src}/../node_modules/getusermedia/`,\n `${src}/../node_modules/signature_pad/`,\n `${src}/../node_modules/@blinkmobile/canvas-manipulation`,\n `${src}/../node_modules/@blinkmobile/angular-signature-pad`\n ]\n\n const b = browserify({\n entries: globby.sync(moduleFiles),\n debug: true\n })\n\n return b.bundle()\n .pipe(through())\n .pipe(source(VENDOR_BUNDLE_NAME))\n .pipe(buffer())\n .pipe(gulp.dest(dest))\n}", "title": "" }, { "docid": "32d0788fef0699a06bef7b0cad4be696", "score": "0.5461024", "text": "static async registerComponent(_, {device_id, model_name = \"Unknown\", type, builtin, status}) {\r\n console.log(\"PREREGISTER Component\")\r\n try {\r\n let _result = await this.insert({\r\n data: {\r\n device_id,\r\n model_name,\r\n\t\t\t\t\ttype,\r\n builtin,\r\n status\r\n }\r\n })\r\n return this.getByID(_, {id: _result.insertId})\r\n } finally {\r\n\t\t\tconsole.log(\"Registered component\");\r\n }\r\n }", "title": "" }, { "docid": "5168b50bed0d6f2441641c204bbf54bf", "score": "0.54520047", "text": "install(Vue) {\n Vue.component('SGBackground', SGBackground);\n Vue.component('SGSection', SGSection);\n Vue.component('SGBlock', SGBlock);\n Vue.component('SGBlockWrapper', SGBlockWrapper);\n Vue.component('SGButton', SGButton);\n }", "title": "" }, { "docid": "68879c211d7eb8456cbea933645dcc90", "score": "0.544598", "text": "register() {\n this.bindToVue()\n this.registerBindings()\n this.registerDependants()\n }", "title": "" }, { "docid": "3a5028ae0c4166b73bfe851534632482", "score": "0.54441", "text": "plugin (_plugin, name) {\n \treturn this.Modules.registerModule(_plugin, name);\n }", "title": "" }, { "docid": "a99257265d60cc2f18f2dda0d2655647", "score": "0.5409145", "text": "function install(Vue) {\n Vue.component('HelloA', HelloA)\n Vue.component('HelloB', HelloB)\n}", "title": "" }, { "docid": "c641720bda11d4b5b7d2f94f8c952054", "score": "0.5397426", "text": "static register(cls, tagname) {\n // Compute tag name from class name if no tag name provided.\n if (!tagname) {\n tagname = cls.name.match(/[A-Z][a-z]*/g).join(\"-\").toLowerCase();\n }\n\n // Check if tag name has already been registered.\n if (window.customElements.get(tagname)) return;\n\n // Register custom element.\n window.customElements.define(tagname, cls);\n\n // Register style sheet for web component.\n if (cls.stylesheet) {\n if (!stylesheets.includes(cls.stylesheet)) {\n stylesheets.push(cls.stylesheet);\n let css = cls.stylesheet().replace(/\\$/g, tagname);\n stylesheet(css);\n }\n }\n }", "title": "" }, { "docid": "933f96dec81222745b1194681bc7ff02", "score": "0.5382025", "text": "static load(components, callback) {\n if (components.length) {\n // Necessary for dependency mapping\n window.React = React\n window.ReactNative = ReactNative\n $scriptjs(components.map((vc) => vc[2]), () => {\n components.forEach((vc) => {\n // Inject into vendor components\n VendorComponents.register(vc[0], getObjectFromKeyPath(window, vc[1]))\n })\n callback()\n })\n } else {\n callback()\n }\n }", "title": "" }, { "docid": "9256dd3b75cbe92d5744bc3c8601fce1", "score": "0.53686607", "text": "function replaceVendorJS() {\n var vendorJSONPath = path.resolve(__dirname, '../dist/vendor-name.json')\n var isExist = fs.existsSync(vendorJSONPath)\n var fileContent,\n newContent\n if(!isExist) {\n throw 'vendor-name.json is nonexistent.Please check the process of build-dll.'\n } else {\n if(!fs.existsSync(baseConfig.filePath.templatePath)) {\n throw 'index.html is nonexistent, please provide it in the root directory.'\n }\n fileContent = fs.readFileSync(baseConfig.filePath.templatePath, {encoding: 'utf8'})\n var fileName = require(path.resolve(__dirname, '../dist/vendor-name.json'))['vendor.js']\n var lastSlash = fileName.lastIndexOf('/')\n\n if(fileContent.indexOf('/dist/vendor/') !== -1) {\n newContent = fileContent.replace(/vendor\\.[0-9a-z]+\\.js/, function(_) {\n return fileName.slice(lastSlash+1)\n })\n fs.writeFile(baseConfig.filePath.templatePath, newContent, function (err) {\n if(err) throw 'Replace hash of vendor.js in template failed.'\n console.log('The hash of vendor.js has been modified to the latest.')\n })\n }else {\n newContent = fileContent.replace(/\\<\\/body\\>/, function(_) {\n return '<script src=\"/dist/vendor/'+ fileName.slice(lastSlash+1) + '\"></script>' + '</body>'\n })\n fs.writeFile(baseConfig.filePath.templatePath, newContent, function (err) {\n if(err) throw 'Add vendor.js to template failed.'\n console.log('The path of vendor.js has been adding to the template.')\n })\n }\n }\n}", "title": "" }, { "docid": "7a4bedaeafa3f9dcaecfb1cba581e553", "score": "0.53597957", "text": "function install(Vue) {\n if (install.installed) return;\n install.installed = true;\n\n // For each matching file name...\n requireComponent.keys().forEach(fileName => {\n // Get the component config\n const componentConfig = requireComponent(fileName);\n // Get the PascalCase version of the component name\n const componentName = fileName\n .split(\"/\")\n .pop()\n .replace(/\\.\\w+$/, \"\");\n // Globally register the component\n Vue.component(componentName, componentConfig.default || componentConfig);\n });\n}", "title": "" }, { "docid": "cf30c2eb8764c13cabd7733bfadbc968", "score": "0.534194", "text": "function register() {\n var registerEle = require('../element');\n registerEle('mip-pix', require('./mip-pix'));\n registerEle('mip-img', require('./mip-img'));\n registerEle('mip-carousel', require('./mip-carousel'));\n registerEle('mip-iframe', require('./mip-iframe'));\n registerEle('mip-video', require('./mip-video'));\n }", "title": "" }, { "docid": "fc27969c6f85a65126ecdd34b8626279", "score": "0.53021985", "text": "function registerVersion(libraryKeyOrName, version, variant) {\r\n var _a;\r\n // TODO: We can use this check to whitelist strings when/if we set up\r\n // a good whitelist system.\r\n let library = (_a = PLATFORM_LOG_STRING[libraryKeyOrName]) !== null && _a !== void 0 ? _a : libraryKeyOrName;\r\n if (variant) {\r\n library += `-${variant}`;\r\n }\r\n const libraryMismatch = library.match(/\\s|\\//);\r\n const versionMismatch = version.match(/\\s|\\//);\r\n if (libraryMismatch || versionMismatch) {\r\n const warning = [\r\n `Unable to register library \"${library}\" with version \"${version}\":`\r\n ];\r\n if (libraryMismatch) {\r\n warning.push(`library name \"${library}\" contains illegal characters (whitespace or \"/\")`);\r\n }\r\n if (libraryMismatch && versionMismatch) {\r\n warning.push('and');\r\n }\r\n if (versionMismatch) {\r\n warning.push(`version name \"${version}\" contains illegal characters (whitespace or \"/\")`);\r\n }\r\n logger$1.warn(warning.join(' '));\r\n return;\r\n }\r\n _registerComponent(new Component(`${library}-version`, () => ({ library, version }), \"VERSION\" /* VERSION */));\r\n}", "title": "" }, { "docid": "22450c3461c25483254dedfc831ee1f6", "score": "0.5300085", "text": "function defineComponentConstructor(name, Com) {\n if (ComponentConstructorMap.has(name)) {\n console.warn(`You are trying to overwrite component definition \"${name}\"!`);\n }\n ComponentConstructorMap.set(name, Com);\n}", "title": "" }, { "docid": "ae094f3ac329381ae83efe34ec667c14", "score": "0.5298584", "text": "loadVendorModules() {\n\n\t\t// load the connection modules\n\t\ttry {\n\t\t\tthis.ConnectionConstructor = require(`related-${this.driverName}-connection`);\n\t\t} catch(e) {\n\t\t\tthrow new Error(`Failed to load the ${this.driverName} connection driver: ${e}`);\n\t\t}\n\n\t\t// load the query builder nodule\n\t\ttry {\n\t\t\tthis.QueryBuilderConstructor = require(`related-${this.driverName}-query-builder`);\n\t\t} catch(e) {\n\t\t\tthrow new Error(`Failed to load the ${this.driverName} query builder: ${e}`);\n\t\t}\n\n\t\t// load the query compiler nodule\n\t\ttry {\n\t\t\tlet QueryCompilerConstructor = require(`related-${this.driverName}-query-compiler`);\n\t\t\tthis.compiler = new QueryCompilerConstructor();\n\t\t} catch(e) {\n\t\t\tthrow new Error(`Failed to load the ${this.driverName} query compiler: ${e}`);\n\t\t}\n\n\t\t// load the analyzer nodule\n\t\ttry {\n\t\t\tthis.AnalyzerConstructor = require(`related-${this.driverName}-analyzer`);\n\t\t} catch(e) {\n\t\t\tthrow new Error(`Failed to load the ${this.driverName} database analyzer: ${e}`);\n\t\t}\n\t}", "title": "" }, { "docid": "79e94239dfd6e723c2bc35a2056f96c6", "score": "0.5294907", "text": "register(componentObject) {\n this.componentsMap[componentObject.hash] = componentObject;\n }", "title": "" }, { "docid": "624b095f6575972ea0eaeabdcd3258ef", "score": "0.5233045", "text": "function register (i) { // i is the passed vue instance\n i.component('bcenter-box', centerBox);\n i.component('bform', form);\n i.component('bsubmit', submit);\n i.component('binput', input);\n i.component('bselect', select);\n i.component('bedgebar', edgeBar);\n i.component('bmenubar', menuBar);\n}", "title": "" }, { "docid": "e437526f5c5c583f337f086251909a40", "score": "0.52282673", "text": "function registerComponent(Ctor, { name, tmpl: template }) {\n signedComponentToMetaMap.set(Ctor, { name, template });\n // chaining this method as a way to wrap existing\n // assignment of component constructor easily, without too much transformation\n return Ctor;\n}", "title": "" }, { "docid": "40dfd25767e4932941aa0a1af9392ef4", "score": "0.5217423", "text": "function entity_manager_add_component(entity, component_name, component) {\n if (entity in _component_map[component_name]) {\n throw new Error(\"Attempted to register the component '\" + component_name + \"' twice in entity \" + entity);\n }\n\n entity_manager_update_component(entity, component_name, component);\n}", "title": "" }, { "docid": "8c4463044fb745161e600ef489313a03", "score": "0.5179955", "text": "_bindComponentNames() {\n this.components.forEach((component) => {\n var nm = component.smoName + 'Ctrl';\n this[nm] = component;\n });\n }", "title": "" }, { "docid": "132aeae13e339a3a517fad0cbc011bc1", "score": "0.51793396", "text": "function install(Vue) {\n if (install.installed) return;\n install.installed = true;\n Vue.component('MyComponent', MyComponent);\n Vue.component('BlueComponent', BlueComponent);\n}", "title": "" }, { "docid": "e946bf0024d40bf36a43057aca952aa1", "score": "0.5174432", "text": "beforeRegister () {\n this.is = 'lib-loader'\n\n // Define the properties object in beforeRegister.\n this.properties = {\n /** Link of the library */\n lib: {\n type: String\n },\n /** <script id=\"\" */\n libUniqueId: {\n type: String\n },\n /** True when the lib is ready */\n libReady: {\n type: Boolean,\n value: false,\n reflectToAttribute: true\n }\n }\n }", "title": "" }, { "docid": "3cb950330f7e905f737d78234918eb8b", "score": "0.5163282", "text": "function add(name, plugin) {\n\t\tvar a = registry[name];\n\n\t\tif (a == null) {\n\t\t\ta = registry[name] = [];\n\t\t}\n\n\t\tplugin = aperture.util.viewOf(plugin);\n\n\t\t// clear this in case there is a problem loading it\n\t\tvar m = plugin.module;\n\t\tplugin.module = null;\n\n\t\t// register the plugin.\n\t\ta.push(plugin);\n\n\t\t// load required modules\n\t\tif (u.isString(m)) {\n\t\t\trequire([m], function(module) {\n\t\t\t\tplugin.module = module;\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "c79f602fe254028829819f13afe03ce5", "score": "0.5162189", "text": "function register(name, resourceType) { registry[name.singularize()] = resourceType; }", "title": "" }, { "docid": "c79f602fe254028829819f13afe03ce5", "score": "0.5162189", "text": "function register(name, resourceType) { registry[name.singularize()] = resourceType; }", "title": "" }, { "docid": "a3a2ebe591ccf8ae8c83ca416400e305", "score": "0.51358503", "text": "function register(opts) {\n var callback = __webpack_require__(631);\n if (opts != null) callback(opts);\n return callback;\n}", "title": "" }, { "docid": "9af160a283df11bffa678417744614ae", "score": "0.5121144", "text": "async load(name) {\n /* Load extension. */\n let extension = await Promise.resolve().then(() => __importStar(require(name)));\n /* Check package format. */\n if (typeof extension.Extension !== 'undefined') {\n /* Create instant. */\n let instant = new extension.Extension(this.di);\n /* Add instant to list. */\n this.instants[name] = instant;\n }\n else {\n throw new Error(`Incorrect package format for \"${name}\" extension.`);\n }\n }", "title": "" }, { "docid": "8e4e61e7053de67967e30c0599d0d306", "score": "0.51108676", "text": "extend(config, { isDev, isModern, isClient }) {\n const getLocalIdent = generateGetLocalIdent(isDev)\n const buildType = isModern ? 'modern' : isClient ? 'client' : 'server'\n console.log(buildType)\n config.plugins.push(\n new LicensePlugin({\n outputFilename: `license-${buildType}.json`,\n unacceptableLicenseTest: (licenseType) => licenseType.match(/GPL/i),\n })\n )\n\n /* config.optimization.concatenateModules = false\n */\n config.module.rules.forEach((rule) => {\n rule.oneOf &&\n rule.oneOf.forEach((useOf) => {\n String(useOf.resourceQuery) === '/module/' &&\n useOf.use &&\n useOf.use.forEach((use) => {\n if (use.loader.match(/vue-style-loader|css-loader/g)) {\n if (!use.options.modules) {\n use.options.modules = {\n getLocalIdent,\n }\n } else {\n delete use.options.modules.localIdentName\n use.options.modules.getLocalIdent = getLocalIdent\n }\n }\n })\n const cssLoaderIndex = useOf.use.findIndex((use) => {\n return use.loader && use.loader.includes('css-loader')\n })\n if (cssLoaderIndex > -1) {\n useOf.use.splice(cssLoaderIndex + 1, 0, {\n loader: path.resolve('fix-classnames-before.js'),\n })\n }\n })\n })\n\n config.module.rules[1].oneOf[0].use.unshift({\n loader: path.resolve('fix-html.js'),\n })\n\n // Sets webpack's mode to development if `isDev` is true.\n if (isDev) {\n config.mode = 'development'\n }\n }", "title": "" }, { "docid": "bb565258bab90a17d6704e3f4f741d97", "score": "0.51093745", "text": "function loadComponent(path) {\n // Note: webpack is currently dependent on `customizations` being hardcoded in the path. Without it, the customizations \n // will not be included in the bundle. However, this also means that all tenant customizations are bundled which is not\n // what we want!\n var componentFactory = require('customizations/' + path);\n if (componentFactory && componentFactory.componentName && !ko.components.isRegistered(componentFactory.componentName)) {\n componentFactory.synchronous = true; // enforce all components to be rendered synchronously to ensure proper order\n ko.components.register(componentFactory.componentName, componentFactory);\n }\n }", "title": "" }, { "docid": "a0a469496fed546ca77102ccc68398b5", "score": "0.5090497", "text": "registerPlugin (plugin, name) {\n \treturn this.Modules.initializeModule(plugin, name);\n }", "title": "" }, { "docid": "5e8c28a5193a7c9fcfbf32d443fda659", "score": "0.507249", "text": "function registerComponent(Ctor, _a) {\n var name = _a.name, template = _a.tmpl;\n signedComponentToMetaMap.set(Ctor, { name: name, template: template });\n return Ctor;\n }", "title": "" }, { "docid": "3fe510d8d54a62a19b68be501f330ff4", "score": "0.50436825", "text": "vendor() {\n\t\t\treturn [\n\t\t\t\tCONFIG.JS.input + 'vendor/jquery*',\n\t\t\t\tCONFIG.JS.input + 'vendor/popper*',\n\t\t\t\tCONFIG.JS.input + 'vendor/tether*',\n\t\t\t\tCONFIG.JS.input + 'vendor/bootstrap*',\n\t\t\t\tCONFIG.JS.input + 'vendor/**/*.js',\n\t\t\t];\n\t\t}", "title": "" }, { "docid": "34c638fb337b8c37f296fefc32ce4f0f", "score": "0.5031672", "text": "setComponent(internal_name, component) {\n if (IsString(internal_name, true) && IsObject(component, ['type'])) {\n PopLog.info(this.name, `Component set for ${internal_name}`, component);\n this.asset.component.set(internal_name, component);\n }\n }", "title": "" }, { "docid": "26bfcdb9d753365ef368221eff4c600d", "score": "0.5014012", "text": "function registerComponents(components) {\n for (let key in components)\n Vue.component(key, components[key])\n}", "title": "" }, { "docid": "17315b9c457d0cc3ded2e92ecf2b4150", "score": "0.49964428", "text": "lookupComponentDefinition(name, meta) {\n var handle = this.lookupComponentHandle(name, meta);\n\n if (handle === null) {\n (true && !(false) && (0, _debug.assert)(\"Could not find component named \\\"\" + name + \"\\\" (no component or template with that name was found)\"));\n return null;\n }\n\n return this.resolve(handle);\n }", "title": "" }, { "docid": "b2266cdffd56edba8857619f47be10c3", "score": "0.49934587", "text": "addUserDefinedComponent(params, cb = Function.prototype) {\n validate_1.default.args(cb, \"function=\");\n const promiseResolver = (resolve) => {\n this.routerClient.query(\"Launcher.userDefinedComponentUpdate\", {\n type: \"add\",\n name: params.name,\n url: params.url,\n }, function (err, response) {\n cb(err, response.data);\n resolve({ err, data: response.data });\n });\n };\n return new Promise(promiseResolver);\n }", "title": "" }, { "docid": "6496c25deb0cc7cf979f1b33f7f0af1b", "score": "0.49900565", "text": "register(element) {\n\n }", "title": "" }, { "docid": "4ccd66ef8b5e2b306172f98c7d4b9d49", "score": "0.49859023", "text": "_registerPlugin (plugin) {\n if (plugin.name && !_.has(this._pluginRegistry, `[\"${plugin.name}\"]`)) {\n this._pluginRegistry[plugin.name] = plugin\n this._mergeDefinition(plugin)\n if (_.isFunction(plugin.install)) plugin.install(this._factory)\n }\n }", "title": "" }, { "docid": "bf6dd68a181f01c549ab5017ed7594ba", "score": "0.49786308", "text": "extend(config, ctx) { \n config.resolve.alias['vue'] = 'vue/dist/vue.common'\n }", "title": "" }, { "docid": "0695f5b99ffa585ee86922129286125a", "score": "0.49683082", "text": "extend(config, ctx) {\n /*\n * This alias is necesary to work with Prismic-vue\n * because prismic-vue requires template compiler\n */\n config.resolve.alias.vue = 'vue/dist/vue.common'\n }", "title": "" }, { "docid": "3419a77cb5786135eeb557d94052ca3c", "score": "0.49628612", "text": "match (originalTag, { kebabTag, camelTag, path, component }) {\n if (kebabTag.startsWith('core-')) {\n return [\n camelTag,\n `import ${camelTag} from '@/components/core/${camelTag.substring(4)}.vue'`\n ]\n }\n }", "title": "" }, { "docid": "c694821a3c0b92f30cc848ade741d235", "score": "0.4959683", "text": "extend(config, ctx) {\n config.resolve.alias['vue'] = 'vue/dist/vue.common'\n }", "title": "" }, { "docid": "4ae580e91df4af140e83f8670cf6725f", "score": "0.4958831", "text": "static getProduct(name){\n switch (name) {\n case \"haobeo\":\n return new Hanbao();\n break;\n case \"jitui\":\n return new Jitui();\n break;\n default:\n throw new Error(\"Product doesnt exist\");\n break;\n }\n }", "title": "" }, { "docid": "243c77507d1bf8d99acaa5f976aaa34a", "score": "0.49551606", "text": "function createDekuComponent (jsx, name) {\n const source = DEKU_TEMPLATE.replace('__SOURCE__', jsx).replace('__NAME__', name)\n return transform('element', source)\n}", "title": "" }, { "docid": "0733407927afc6dc0145209e67fd7c90", "score": "0.49451867", "text": "function default_1(PluginHost) {\n PluginHost.owner.converter.addComponent('respect-name-tag', RespectNameTagPlugin);\n}", "title": "" }, { "docid": "3f7e74193ab5149e610d8ab541a6e4aa", "score": "0.49443266", "text": "function RegisterBase(registername) {\r\n this.$registername = registername;\r\n BaseObject.apply(this, arguments);\r\n}", "title": "" }, { "docid": "e57c1016f357d761db6f207a3aa748db", "score": "0.49440902", "text": "static register() {\n __WEBPACK_IMPORTED_MODULE_2__common_plugin__[\"a\" /* PLUGINS */][\"FullTextSearch\"] = FullTextSearch;\n }", "title": "" }, { "docid": "b32c8b405ce05d1837fdde2a57348485", "score": "0.49351278", "text": "function install(Vue) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (install.installed) return; // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n\n install.installed = true;\n Vue.component('MarkdownEditor', _MarkdownEditor_vue__WEBPACK_IMPORTED_MODULE_0__[/* default */ \"a\"]);\n} // Create module definition for Vue.use()", "title": "" }, { "docid": "9f81c750929412c2cfca234118bf6203", "score": "0.492838", "text": "function addComponent (componentName) {\n var name = componentName.split(MULTIPLE_COMPONENT_DELIMITER)[0];\n if (!COMPONENTS[name]) { return; }\n componentsToUpdate[componentName] = true;\n }", "title": "" }, { "docid": "7696a356c25b925a81a650d05dab126b", "score": "0.49276772", "text": "constructor(name, components = []) {\n this.name = name;\n this.components = components;\n }", "title": "" }, { "docid": "86e94c49a577094d16d9d239c7e38cd7", "score": "0.49218076", "text": "function getComponentConstructor(name) {\n return ComponentConstructorMap.get(name);\n}", "title": "" }, { "docid": "3627e334eec2c47ce17584bf4fc1255a", "score": "0.49217474", "text": "function addComponentMapping (componentName, mappings) {\n var schema = components[componentName].schema;\n Object.keys(schema).map(function (prop) {\n // Hyphenate where there is camelCase.\n var attrName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n // If there is a mapping collision, prefix with component name and hyphen.\n if (mappings[attrName] !== undefined) { attrName = componentName + '-' + prop; }\n mappings[attrName] = componentName + '.' + prop;\n });\n}", "title": "" }, { "docid": "c429c272a2ea2e66e239b135900b716a", "score": "0.49160886", "text": "extend(config, ctx) {\n config.resolve.alias['vue'] = 'vue/dist/vue.common'\n }", "title": "" }, { "docid": "c429c272a2ea2e66e239b135900b716a", "score": "0.49160886", "text": "extend(config, ctx) {\n config.resolve.alias['vue'] = 'vue/dist/vue.common'\n }", "title": "" }, { "docid": "3dcf2d4b256d967d4459a1de46240c73", "score": "0.49021187", "text": "function IzendaComponent(moduleOrName, selector, dependencies, options) {\n return function (controller) {\n var module = typeof (moduleOrName) === 'string' ? angular.module(moduleOrName) : moduleOrName;\n var extendedOptions = angular.copy(options);\n var $inject = controller.$inject = dependencies;\n controller.prototype.$inject = $inject;\n controller.$inject = $inject;\n extendedOptions.controller = dependencies.concat(controller);\n module.component(selector, extendedOptions);\n };\n }", "title": "" }, { "docid": "2bc1b50c4eca3b95e28f4509730c9818", "score": "0.48997092", "text": "RegisterAssembly() {\n\n }", "title": "" }, { "docid": "c17e2271fa4f8f7996c86c36c5eab6d8", "score": "0.4897901", "text": "install(Vue, options) {\n if (typeof options === \"undefined\") {\n for (let c of components) {\n Vue.component(c.default.name, c.default);\n }\n } else {\n if (!(options instanceof Array)) {\n throw new TypeError(\"options must be an array\");\n }\n\n for (let c of components) {\n // register only components specified in the options\n if (options.includes(c.default.name)) {\n Vue.component(c.default.name, c.default);\n }\n }\n }\n }", "title": "" }, { "docid": "f6bfe4a435096b51642da75f83bcef83", "score": "0.4892481", "text": "match (originalTag, { kebabTag, camelTag, path, component }) {\n if (kebabTag.startsWith('_base-')) {\n return [camelTag, `import ${camelTag} from '@/components/${kebabTag}.vue'`]\n }\n }", "title": "" }, { "docid": "8555fe9008c8532c37996f2f6a77b3ed", "score": "0.488688", "text": "function importComponent(p, cb, ignoreTags){\r\n\t\tvar path = resolvePath(p);\r\n\t\tvar paths = __qCompPaths;\r\n\r\n\t\tif(paths[path] == null || paths[path] == 'error'){\r\n\t\t\t__qCompPaths[path] = 'loading';\r\n\t\t\tQComps.update(path, function(success){\r\n\t\t\t\t__qCompPaths[path] = (success) ? 'complete':'error';\r\n\t\t\t\tif(cb)cb(success);\r\n\t\t\t}, ignoreTags)\r\n\r\n\t\t}else{\r\n\t\t\tconsole.log(\"Already Loaded:\" + p);\r\n\t\t\tif(cb)cb(true);\r\n\t\t}\t\r\n\t}", "title": "" }, { "docid": "555545e76755660a550a94ffeaa3f3f5", "score": "0.48805058", "text": "function registerWireService() { }", "title": "" }, { "docid": "40035a33dcb16d357043e9d804d283f4", "score": "0.48798522", "text": "function registerComponent() {\n\t if (self.options.filter) {\n\t FilterFieldsStorage.addFilterFieldController(self);\n\t } else {\n\t EditEntityStorage.addFieldController(self);\n\t }\n\t }", "title": "" }, { "docid": "fb5e4aabd454128d1f3d2948d46b815f", "score": "0.48770827", "text": "function install(Vue) {\n if (install.installed) {\n return;\n }\n\n install.installed = true;\n \n Vue.component('vue-awesome-grid', VueAwesomeGrid);\n}", "title": "" }, { "docid": "2923148fbd2d77f3e9ffb1a77d8196bd", "score": "0.48750433", "text": "install(Vue, options) {\n Vue.use(VueProgressBar, progressOptions)\n Vue.use(VueResource)\n\n Vue.prototype.$titleField = 'title_tesim'\n\n // We call Vue.mixin() here to inject functionality into all components.\n \tVue.mixin({\n install(Vue, options) {\n Vue.component(Search.name, Search)\n Vue.component(ShowPage.name, ShowPage)\n }\n });\n }", "title": "" }, { "docid": "5075586897a66455840f7818270dc5a1", "score": "0.48627877", "text": "function Re(t,e,n){var r=t;return r.install=function(a,o){a.component(e||o||r.name,t),n&&a.directive(n.name,n.comp)},r}", "title": "" }, { "docid": "f8f53cf5b8d343701f45d2225275ce96", "score": "0.48619914", "text": "register() {\n log.debug('Registering components protocol');\n session.fromPartition('persist:arc-window')\n .protocol\n .registerStringProtocol('arc-components', this._requestHandler, this._registrationHandler);\n }", "title": "" }, { "docid": "a2bba5ef165f8f3cd65bad29df038625", "score": "0.48615238", "text": "autoRegister () {\n super.autoRegister('data-provider');\n }", "title": "" }, { "docid": "8f8c4372b697fbb35367ec055bb0ba74", "score": "0.4853829", "text": "_register(options) {\n\n const record = _registry__WEBPACK_IMPORTED_MODULE_0__[\"default\"].get(this.id);\n\n try {\n\n //resolve to latest version of component\n this.proxyTarget = new record.component(options);\n\n } catch (e) {\n\n const rb = record.rollback;\n\n if (!rb) {\n console.error(e);\n console.warn('Full reload required. Please fix component errors and reload the whole page');\n return;\n }\n\n groupStart(this._debugName + ' Errors');\n\n console.warn(e);\n console.warn(this._debugName + ' could not be hot-loaded because it has an error');\n\n //resolve to previous working version of component\n this.proxyTarget = new rb(options);\n console.info('%c' + this._debugName + ' rolled back to previous working version', 'color:green');\n\n //set latest version as the rolled-back version\n record.component = rb;\n\n groupEnd();\n\n }\n\n _registry__WEBPACK_IMPORTED_MODULE_0__[\"default\"].set(this.id, record);\n\n //register current instance, so that\n //we can re-render it when required\n _registry__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerInstance(this);\n\n //proxy custom methods\n const self = this;\n let methods = Object.getOwnPropertyNames(Object.getPrototypeOf(self.proxyTarget));\n methods.forEach(function(method) {\n if (!handledMethods.includes(method) && !forwardedMethods.includes(method)) {\n self[method] = function() {\n return self.proxyTarget[method].apply(self.proxyTarget, arguments);\n };\n }\n });\n\n //(re)expose properties that might be used from outside\n this.refs = this.proxyTarget.refs || {};\n this._fragment = this.proxyTarget._fragment;\n this._slotted = this.proxyTarget._slotted;\n this.root = this.proxyTarget.root;\n this.store = this.proxyTarget.store || null;\n }", "title": "" }, { "docid": "9c8b50038492fe341638048fbbb5ede3", "score": "0.4848432", "text": "register(keyword, instance) {\n\t\tconsole.log('express', keyword, instance);\n switch(keyword) {\n case 'stanza-webpack': this.setupWebpackConfig(instance); break;\n default: console.log('nothing was found');\n }\n }", "title": "" }, { "docid": "992f5a8e23fd56f52b36e328ed5fc417", "score": "0.4843858", "text": "markComponentLoaded(name) {\n this.vues.forEach((component) => {\n if (component.name === name) {\n component.isLoaded = true;\n }\n });\n }", "title": "" }, { "docid": "55a23da549e0f960cae343135e5d3708", "score": "0.48418915", "text": "getPackageName(component) {\n return (0, _componentIdToPackageName().default)(component.state._consumer);\n }", "title": "" }, { "docid": "a16af0150333d94e29e31f6192b38493", "score": "0.483222", "text": "function registerForLocalization(component) {\n var ctx = {\n kendoLocalizationService: prop_types__WEBPACK_IMPORTED_MODULE_0__[\"object\"]\n };\n if (component.contextTypes) {\n Object.assign(component.contextTypes, ctx);\n }\n else {\n component.contextTypes = ctx;\n }\n}", "title": "" }, { "docid": "9071909ac7d19ba66887a01106b1a3d6", "score": "0.48274577", "text": "registerFile(path) {\n if (module.name === null) {\n console.log(\"The module does not have a name\");\n return;\n }\n\n try {\n const module = require(path);\n\n if (this.check(module, path)) {\n let initModule = new module;\n\n // Add module to register\n this.register.set(initModule.name, initModule);\n\n // Handle the newly registered module\n this.handle(initModule);\n\n if (config.debug) console.log(` - \"${initModule.name}\" has been added to the module register.`);\n }\n } catch (error) {\n console.log(error.stack);\n }\n }", "title": "" }, { "docid": "806194a9aabe6488d141264d18bb4dde", "score": "0.48262513", "text": "function vendor(){\n return gulp.src(cfg.vendor.js)\n .pipe(concat('vendor.min.js'))\n .pipe(gulp.dest(cfg.build+cfg.dest.js))\n .pipe(connect.reload())\n}", "title": "" }, { "docid": "116ecf56046b1b2c951f8feb5daac3b6", "score": "0.48101324", "text": "function isVendorPrefixed(name) {\n return name.indexOf('moz') === 0 ||\n name.indexOf('webkit') === 0 ||\n name.indexOf('ms') === 0;\n}", "title": "" }, { "docid": "bc71f0b522ccef23d23252e10e526e76", "score": "0.4801072", "text": "registerDependency(dependency) {\n this.allDependencies.push(dependency);\n this.dependenciesByName[dependency.name] = dependency;\n }", "title": "" }, { "docid": "41215ddfcdbe2228322cf58ecf254049", "score": "0.47990075", "text": "register() {\n this.app.container.singleton('Adonis/Addons/Bouncer', () => {\n const { Bouncer } = require('../src/Bouncer');\n return new Bouncer(this.app);\n });\n }", "title": "" }, { "docid": "5046217978b487361f80e0d0a4e790ec", "score": "0.4792846", "text": "async register (Bootstrapper) {\n await new Bootstrapper(this).boot()\n }", "title": "" }, { "docid": "33a4da1f4af89b1a78541a684bd4769f", "score": "0.47808316", "text": "function entity_manager_get_with_component(component_name) {\n return _component_map[component_name];\n}", "title": "" }, { "docid": "50484670fa86ef5098ed2e0f1494f546", "score": "0.4777811", "text": "function install(Vue) {\n if (install.installed) return;\n install.installed = true;\n Object.keys(components).forEach((componentName) => {\n Vue.component(componentName, components[componentName]);\n });\n}", "title": "" }, { "docid": "dbbd67ecacfc7a72aec823fcc09f4086", "score": "0.47702175", "text": "extend(config, ctx) {\n // Include the compiler version of Vue so that wp-content works\n config.resolve.alias[\"vue$\"] = \"vue/dist/vue.esm.js\"\n }", "title": "" }, { "docid": "cff1e79e4758ff39247dfc76af0a9bd5", "score": "0.476902", "text": "register(kind, enhancer) {\n if (enhancer == null) {\n enhancer = kind\n kind = null\n }\n invariant(\n isElementRef(kind) || kind == null,\n 'You must provide a valid element reference to register'\n )\n invariant(\n enhancer != null && typeof enhancer === 'function',\n 'You must provide an enhancer function'\n )\n\n kind != null\n ? readDependentRegistry.register(kind, enhancer)\n : readIndependentList.push(enhancer)\n }", "title": "" }, { "docid": "58bd3378b56e16ad3044442ac1024b29", "score": "0.47665718", "text": "function ImportNow(name) {\n return exports_container[name];\n}", "title": "" }, { "docid": "f8aa5935fa62e65758259220ed0d6adf", "score": "0.47602072", "text": "install(Vue) {\n Vue.component('CalendarByWeek', Calendar);\n }", "title": "" } ]
c707157d4f5cf48fc29f825dcb208436
Calculate running total for denials and payments
[ { "docid": "16fd1cd0cc5bafa3befece50fc4c88c5", "score": "0.6984412", "text": "calculateDenialRunningTotal(inventories) {\n let current = 0;\n return inventories.map(inventory => {\n if (inventory.isPayment) {\n current = current - inventory.amount;\n } else if (inventory.credited) {\n current = current - inventory.creditAmount;\n } else {\n current = current + inventory.rejectAmount;\n }\n inventory.rejectionRunningTotal = current;\n return inventory;\n });\n }", "title": "" } ]
[ { "docid": "75b1610e6eb2c95c6c245135a3ce1b1e", "score": "0.71879685", "text": "getTotal(){\n this.totalPaid = this.periods * this.scPayment\n this.totalInterest = this.totalPaid - this.loanAmount\n }", "title": "" }, { "docid": "765eb3bb08e400482cfc6f61a12441b5", "score": "0.7033611", "text": "calcTotal(){\n\t\t\tlet length = this.sales.length;\n\t\t\tthis.paidCommissionTotal = 0;\n\t\t\tthis.commissionTotal = 0;\n\t\t\tfor(let i = 0; i < length; ++i){\n\t\t\t\t\tthis.commissionTotal += this.sales[i].commission;\n\t\t\t\t\tif(this.sales[i].paid == true){\n\t\t\t\t\t\tthis.paidCommissionTotal += this.sales[i].commission;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tthis.sales.length;\n\t\t}", "title": "" }, { "docid": "5870a2646a7c51de411600ea89553625", "score": "0.6698542", "text": "getTotalPayment() {\n let total = 0;\n this.operations.forEach(op => {\n total += op.amount;\n });\n return total;\n }", "title": "" }, { "docid": "1f9c7b79aee3cd358921daf8edf84ce8", "score": "0.6601917", "text": "function calculateTotalMontlyPay(loans) {\n const total = loans.reduce(function (sum, currentElement) {\n if (!currentElement.closed) {\n return sum + currentElement.perMonth.value;\n }\n return sum;\n }, 0);\n\n return total;\n}", "title": "" }, { "docid": "57e0104beea4ada8254aef63c35c5f8f", "score": "0.6598163", "text": "getTotalWithExtra(extra){\n let numMonthes = 0\n let beginBalance = this.loanAmount\n let totalInterest = 0\n let totalPaid = 0\n let scPayment = this.scPayment + extra\n\n while (beginBalance > 0){\n numMonthes += 1\n let interest = beginBalance * this.rate\n let principal = scPayment - interest\n \n totalInterest += interest\n totalPaid += scPayment \n beginBalance -= principal\n }\n\n // If begin balance is less than 0\n totalPaid += beginBalance\n\n this.totalPaidWithExtra = totalPaid\n this.totalInterestWithExtra = totalInterest\n this.totalMonthesWithExtra = numMonthes\n this.totalYearsWithExtra = parseInt(numMonthes/12)\n this.timeSavedMonthes = this.periods - numMonthes\n this.amountSaved = this.totalPaid - this.totalPaidWithExtra\n\n }", "title": "" }, { "docid": "0d0b4c32abbae09462f60d60fedf8c93", "score": "0.64721465", "text": "function calcTotals() {\n var incomes = 0;\n var expenses = 0;\n var budget;\n // calculate total income\n data.allItems.inc.forEach(function(item) {\n incomes+= item.value;\n })\n //calculate total expenses\n data.allItems.exp.forEach(function(item) {\n expenses+= item.value;\n })\n //calculate total budget\n budget = incomes - expenses;\n // Put them in our data structure\n data.total.exp = expenses;\n data.total.inc = incomes;\n //Set Budget\n data.budget = budget;\n }", "title": "" }, { "docid": "131ac3e3d6c3ed7f117b5ea58489757a", "score": "0.64170635", "text": "function calculatePaidTotal (currentBill) {\n var paidTotal = 0;\n\n angular.forEach(currentBill.payments, function (value, key) {\n paidTotal += value.amount;\n });\n\n return paidTotal;\n }", "title": "" }, { "docid": "99a652e10b074f138d56ddfc7df639b7", "score": "0.6372997", "text": "function calculateToBePaidTotal (currentBill) {\n var toBePaidTotal = 0;\n var paidTotal = 0;\n\n angular.forEach(currentBill.payments, function (value, key) {\n console.log(value);\n paidTotal += value.amount;\n });\n\n toBePaidTotal = parseFloat(currentBill.totalAmount) - parseFloat(paidTotal);\n\n return toBePaidTotal;\n }", "title": "" }, { "docid": "253c78100f0b4be4cc6bc03d478a1e52", "score": "0.636192", "text": "function accumulatePaidAmount(params) {\n if (params.paidTranEntry.id !== preTranEntryId) {\n precedingTransPaidAmount += params.paidAmount;\n }\n preTranEntryId = params.paidTranEntry.id;\n }", "title": "" }, { "docid": "65182ee0b9a1798aa5a42e875678ded5", "score": "0.6326936", "text": "static _calculateBillRunNetTotal (invoices) {\n return invoices.reduce((acc, invoice) => {\n const invoiceValue = invoice.deminimisInvoice ? 0 : invoice.netTotal\n return acc + invoiceValue\n }, 0)\n }", "title": "" }, { "docid": "7d723ba160dc063e6acc2e0ddd1005e5", "score": "0.62970066", "text": "function totalBilled() {\n total = months * rate\n return total;\n}", "title": "" }, { "docid": "af50d408fd4e9e1b5ce0c8b8cc15035d", "score": "0.62617046", "text": "function totalcalc() {\n let total = 1299 + rmemory + ssd + deli;\n return total;;\n}", "title": "" }, { "docid": "369f630bf3cfc297ff62e68ef4df6f97", "score": "0.6249273", "text": "function calculateBuy() {\n var bestTotalIndexBuy = -1;\n var bestMonthlyIndexBuy = -1;\n var bestTotalIndexLease = -1;\n var bestMonthlyIndexLease = -1;\n\n var iterLease = 0;\n var iterBuy = 0;\n\n //Process the Lease Modules in the array\n leaseModules.forEach(function(element) {\n //Initialize Parameters\n var monthlyPayment = 0;\n var total = 0;\n var downPayment = 0;\n\n //If there is no monthly payment, dont bother calculating\n if (element.monthlyPaymentInput.value == \"\") {\n element.total.innerHTML = \"-\";\n element.monthlyPayment.innerHTML = \"-\";\n return;\n }\n\n //Get monthly payment\n monthlyPayment = parseFloat(element.monthlyPaymentInput.value);\n\n //If theres a payment length, calculate the total and subtract the discounts\n if (element.paymentLength.value != \"\") {\n var total = parseFloat(element.monthlyPaymentInput.value) * parseFloat(element.paymentLength.value);\n //Subtract the discounts\n element.discounts.forEach(function(element1) {\n if (element1.value != \"\") {\n total = total - parseFloat(element1.value);\n }\n });\n\n //Check if total is negative, show an error if true\n if (total < 0) {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"LightCoral\";\n });\n element.total.innerHTML = \"Error: Discounts can't be more than total\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"white\";\n });\n }\n\n //If there is a downPayment, process it\n if (element.downPayment.value != \"\") {\n\n //If downpayment is in money\n if (element.downMoney.checked) {\n downPayment = parseFloat(element.downPayment.value);\n if ((total - downPayment) < 0) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment more than MSRP - Discounts\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n\n }\n\n //If downpayment is in percent of total\n else {\n if (parseFloat(element.downPayment.value) > 100) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment cannot be more than 100%\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n downPayment = total / 100 * parseFloat(element.downPayment.value);\n }\n }\n\n //If the three mile parameters are filled, process that\n if (element.allotedMiles.value != \"\" && element.mileCost.value != \"\" && element.averageMiles.value != \"\") {\n if (parseFloat(element.allotedMiles.value) < parseFloat(element.averageMiles.value)) {\n total = total + ((parseFloat(element.averageMiles.value) - parseFloat(element.allotedMiles.value)) * parseFloat(element.mileCost.value));\n }\n }\n\n //Calculate the monthly payment given the total and the paymentLength (instead of just monthly payment parameter)\n var monthlyPayment = total / parseFloat(element.paymentLength.value);\n }\n element.total.style.color = \"black\";\n element.monthlyPayment.style.color = \"black\";\n\n //If the total or monthlyPayment isn't 0, print it out (note total includes the down-payment where as the monthly payment does not)\n total = total + downPayment;\n if (total != 0) {\n element.total.innerHTML = \"$\" + total.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.total.innerHTML = \"-\";\n }\n if (monthlyPayment != 0) {\n element.monthlyPayment.innerHTML = \"$\" + monthlyPayment.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.monthlyPayment.innerHTML = \"-\";\n }\n\n //Determine if the current module now has the lowest total and/or monthly payment compared to other lease modules\n //If it is, store the index\n if (total != 0) {\n if (bestTotalIndexLease == -1) {\n bestTotalIndexLease = iterLease;\n } else if (total < parseFloat(leaseModules[bestTotalIndexLease].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestTotalIndexLease = iterLease;\n }\n }\n if (monthlyPayment != 0) {\n if (bestMonthlyIndexLease == -1) {\n bestMonthlyIndexLease = iterLease;\n } else if (monthlyPayment < parseFloat(leaseModules[bestMonthlyIndexLease].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestMonthlyIndexLease = iterLease;\n }\n }\n\n iterLease = iterLease + 1;\n\n });\n\n\n //Process all BUY modules\n buyModules.forEach(function(element) {\n //Initialize variables\n var total = 0.0;\n var monthlyPayment = 0.0;\n var downPayment = 0.0;\n var interest = 0.0;\n\n //If the MSRP is blank, dont bother calculating\n if (element.MSRP.value == \"\") {\n element.total.innerHTML = \"-\";\n element.monthlyPayment.innerHTML = \"-\";\n return;\n }\n\n //Get the MSRP\n var total = parseFloat(element.MSRP.value);\n\n //Subtract the discounts\n element.discounts.forEach(function(element1) {\n if (element1.value != \"\") {\n total = total - parseFloat(element1.value);\n }\n });\n\n //Check if total is negative, if it is show an error\n if (total < 0) {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"LightCoral\";\n });\n element.total.innerHTML = \"Error: Discounts can't be more than total\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.discounts.forEach(function(element1) {\n element1.style.backgroundColor = \"white\";\n });\n }\n\n //If there is a downpayment\n if (element.downPayment.value != \"\") {\n //If downpayment is in money\n if (element.downMoney.checked) {\n downPayment = parseFloat(element.downPayment.value);\n if ((total - downPayment) < 0) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment more than MSRP - Discounts\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n\n }\n //If downpayment is in percent of total\n else {\n if (parseFloat(element.downPayment.value) > 100) {\n element.downPayment.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Down Payment cannot be more than 100%\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n element.downPayment.style.backgroundColor = \"white\";\n }\n downPayment = total / 100 * parseFloat(element.downPayment.value);\n }\n }\n\n //If there is interest, calculate the amount of interest based on the total\n if (element.interest.value != \"\") {\n if (parseFloat(element.interest.value) > 100) {\n element.interest.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Interest cannot be more than 100%\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n }\n element.interest.style.backgroundColor = \"white\";\n interest = (total / 100 * parseFloat(element.interest.value));\n }\n\n //Add the interst to the total\n total = total + interest;\n\n //If there is a payment length, calcualte the monthly payment\n if (element.paymentLength.value != \"\") {\n if (parseFloat(element.paymentLength.value) == 0) {\n element.paymentLength.style.backgroundColor = \"LightCoral\";\n element.total.innerHTML = \"Error: Payment length cannot be 0\";\n element.total.style.color = \"darkred\";\n element.monthlyPayment.innerHTML = \"-\";\n element.monthlyPayment.style.color = \"darkred\";\n return;\n } else {\n monthlyPayment = (total - downPayment) / parseFloat(element.paymentLength.value);\n }\n }\n element.total.style.color = \"black\";\n element.monthlyPayment.style.color = \"black\";\n\n //If total/monthly payment isnt 0, display it\n if (total != 0) {\n element.total.innerHTML = \"$\" + total.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.total.innerHTML = \"-\";\n }\n if (monthlyPayment != 0) {\n element.monthlyPayment.innerHTML = \"$\" + monthlyPayment.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n } else {\n element.monthlyPayment.innerHTML = \"-\";\n }\n\n //Compare total and monthly payment to see if it is the cheapest in the buy group\n if (total != 0) {\n if (bestTotalIndexBuy == -1) {\n bestTotalIndexBuy = iterBuy;\n } else if (total < parseFloat(buyModules[bestTotalIndexBuy].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestTotalIndexBuy = iterBuy;\n }\n }\n if (monthlyPayment != 0) {\n if (bestMonthlyIndexBuy == -1) {\n bestMonthlyIndexBuy = iterBuy;\n } else if (monthlyPayment < parseFloat(buyModules[bestMonthlyIndexBuy].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''))) {\n bestMonthlyIndexBuy = iterBuy;\n }\n }\n\n iterBuy = iterBuy + 1;\n\n });\n //Determine if the lease or buy index is the smallest and set it to green\n //It will independently set the total and monthly payment to limegreen\n\n //Set to max int\n var bestTotalBuy = 9007199254740992;\n var bestTotalLease = 9007199254740992;\n var bestMonthlyBuy = 9007199254740992;\n var bestMonthlyLease = 9007199254740992;\n if (bestTotalIndexBuy != -1) {\n bestTotalBuy = parseFloat(buyModules[bestTotalIndexBuy].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n if (bestTotalIndexLease != -1) {\n bestTotalLease = parseFloat(leaseModules[bestTotalIndexLease].total.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n if (bestMonthlyIndexBuy != -1) {\n bestMonthlyBuy = parseFloat(buyModules[bestMonthlyIndexBuy].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n if (bestMonthlyIndexLease != -1) {\n bestMonthlyLease = parseFloat(leaseModules[bestMonthlyIndexLease].monthlyPayment.innerHTML.replace('$', '').replace('-', 0).replace(',', ''));\n }\n\n if (bestTotalLease < bestTotalBuy) {\n if (bestTotalIndexLease != -1) {\n leaseModules[bestTotalIndexLease].total.style.color = \"limegreen\";\n }\n } else {\n if (bestTotalIndexBuy != -1) {\n buyModules[bestTotalIndexBuy].total.style.color = \"limegreen\";\n }\n }\n\n if (bestMonthlyLease < bestMonthlyBuy) {\n if (bestMonthlyIndexLease != -1) {\n leaseModules[bestMonthlyIndexLease].monthlyPayment.style.color = \"limegreen\";\n }\n } else {\n if (bestMonthlyIndexBuy != -1) {\n buyModules[bestMonthlyIndexBuy].monthlyPayment.style.color = \"limegreen\";\n }\n }\n\n\n}", "title": "" }, { "docid": "8b42a90eae2f584df2e551953032e92d", "score": "0.62193185", "text": "getCumulativeTotal() {\n var transactions = fake_data.transactions.sort((a, b) => {\n return new Date(a.date) - new Date(b.date);\n });\n console.log(transactions);\n var starting_balance = fake_data.balance;\n var totalValues = [];\n var total = 0;\n transactions.forEach((t) => {\n starting_balance += t.amount;\n totalValues.push(starting_balance);\n });\n return totalValues;\n }", "title": "" }, { "docid": "72e5f9580830f43ebdb8515599983dd6", "score": "0.6213823", "text": "function calculateMortgagePayment(){\n const loan = parseFloat($(\"#js-house-price\").val()) - parseFloat($(\"#js-down-payment\").val())\n const numberOfMonths = parseInt($(\"#js-amort-years\").val())* 12\n const interestRate = parseFloat($(\"#js-interest\").val())/12/100\n //console.log(loan,numberOfMonths,interestRate)\n const numerator = interestRate * Math.pow((1+interestRate),numberOfMonths) \n const denominator = Math.pow((1+interestRate),numberOfMonths)-1\n mortgagePmt = Math.round(loan * numerator / denominator*100)/100\n updatePmt()\n buildMonthlyCostsBase()\n const loanObj = {\n \"P\":loan,\n \"PMT\":mortgagePmt,\n \"I\":interestRate,\n }\n buildAmortTable(loanObj)\n buildSummary()\n \n}", "title": "" }, { "docid": "fcaff379c8bc9e716783fa245dcbb4b8", "score": "0.62137663", "text": "function billsTotal(){\n totally = totalCall + totalSms;\n }", "title": "" }, { "docid": "3d2f5535d5deea81180c0b00bbab9e82", "score": "0.6208099", "text": "totalSpent(){\n return this.meals().reduce((a,b)=>(a += b.price), 0);\n }", "title": "" }, { "docid": "2e420a970d435e4886f1245b315ef1a8", "score": "0.62046605", "text": "function calcSubtotal() {\n const sub = Object.keys(lineStates)\n .reduce((acum, lineKey) => {\n if (lineKey === 'shippingState') {\n return acum;\n } else {\n const {liveQuantity, unitPrice} = lineStates[lineKey].getState();\n const nextAcum = acum + (liveQuantity * unitPrice);\n return nextAcum;\n }\n }, 0);\n getElements.subtotalPrice().innerHTML = formatMoney(sub, theme.moneyFormat);\n return sub;\n}", "title": "" }, { "docid": "04a84abb29774ebc2c69e3b579151735", "score": "0.6198173", "text": "computeTotals()\n {\n if (this.file.transactions.length == 0)\n return\n\n this.totalSpendings = this.file.transactions\n .map(x => Math.min(x.amount, 0))\n .reduce((acc, x) => acc + x)\n\n this.totalIncome = this.file.transactions\n .map(x => Math.max(x.amount, 0))\n .reduce((acc, x) => acc + x)\n }", "title": "" }, { "docid": "fe2a766c571ea15cdbc7ff9ba0c3fb31", "score": "0.61923176", "text": "function totalDeduc(monthlyIncome, insurance, dependents){\r\n \r\n var pagibig = (monthlyIncome*0.01375)*12; // calculates pagibig deduction\r\n var philhealth = (monthlyIncome* 0.035)*12; // calculates philhealth deduction\r\n \r\n var total = insurance + dependents + pagibig + philhealth + 50000; // calculates total deduction\r\n\r\nreturn total; //returns value for deductions\r\n}", "title": "" }, { "docid": "962b76a5b0c61160a2438f3798c1ddd7", "score": "0.61815226", "text": "function getTotal() {\n if (!runningTotal) {\n operate(x, sign, y);\n runningTotal = true;\n } else if (runningTotal) {\n operate(total, sign, y);\n } \n}", "title": "" }, { "docid": "3781b15b01a777a27b2d0d0f298215ef", "score": "0.6153434", "text": "calculateSalary(periodInDays) {\n let total = 0;\n for (let p of this.participants)\n {\n if(typeof this.pricing[p.seniorityLevel] === 'undefined') throw new Error(\"No pricing found\");\n total += periodInDays * 8 * this.pricing[p.seniorityLevel];\n }\n return total;\n }", "title": "" }, { "docid": "50ce18ab09b50101d5fc889fe0f7b0b1", "score": "0.6147666", "text": "total(){\n return operations.incomes() + operations.expenses()\n }", "title": "" }, { "docid": "591e213fafff8da257955aba344fbd1c", "score": "0.6133997", "text": "total () {\n\t\treturn this.subtotal() - this.discounts();\n\t}", "title": "" }, { "docid": "7897841531b236136baefe95bcd3ce36", "score": "0.61320996", "text": "forAllDays() {\n if (this.breakDown() !== 'No Information to display') {\n let totalCost = this.breakDown().reduce((acc, item) => acc += item.totalCost, 0)\n return totalCost || 0;\n }\n }", "title": "" }, { "docid": "8ad0cf3f4555851338f2778085948460", "score": "0.61307955", "text": "total() {\n return transactionObj.incomes() + transactionObj.expenses()\n }", "title": "" }, { "docid": "b059224c25a5a6cbf4b872e2498d9d48", "score": "0.61281836", "text": "total() {\n const rawTotal = this.rawTotal();\n const appliedDiscounts = this.getAppliedDiscounts();\n const discountTotal = this.discountSrv.total(appliedDiscounts);\n return rawTotal - discountTotal;\n }", "title": "" }, { "docid": "e6b3ae1a09d3bb857923798f330f66b4", "score": "0.6120698", "text": "function calcBudget() {\n inputStatusCheck();\n const persons = Number(inputPerson.value);\n const budgetPerPerson = Number(inputBudget.value);\n budgetTotal.innerHTML = multiply(persons, budgetPerPerson);\n}", "title": "" }, { "docid": "2e83fd19c35952951be3a802a1d8f31c", "score": "0.6119096", "text": "function findTotal() {\n monthlyTotal = 0;\n for (let employee of employeeInfo) {\n monthlyTotal += employee.annualSalary /12;\n\n }\n\n bleedingCash();\n\n}", "title": "" }, { "docid": "30f759a896f991951a423f20d2e8723f", "score": "0.6103447", "text": "totalSpent() {\n return this.meals().reduce(function(sum, meal) {\n return sum + meal.price;\n }, 0);\n }", "title": "" }, { "docid": "30f759a896f991951a423f20d2e8723f", "score": "0.6103447", "text": "totalSpent() {\n return this.meals().reduce(function(sum, meal) {\n return sum + meal.price;\n }, 0);\n }", "title": "" }, { "docid": "fb144470b1e868d1af729c0e74384792", "score": "0.6092691", "text": "function getTotalAmountFinanced(){\n\t\treturn parseInt(localStorage.pSlider)-parseInt(localStorage.dPayment);\t\t\n\t}", "title": "" }, { "docid": "6cbaf265abb892dff3de15208898673a", "score": "0.6070736", "text": "total(){\n return Transaction.incomes() + Transaction.expenses();\n }", "title": "" }, { "docid": "8e7cebd736bd7e3e7cbd5d0f2c7d3a39", "score": "0.6050663", "text": "function totalCalculation() {\n const firstClassTicketCount = getTicketInput('firstClass');\n const economyTicketCount = getTicketInput('economy');\n const subTotal = firstClassTicketCount * 150 + economyTicketCount * 100;\n document.getElementById('subTotal').innerText = subTotal;\n const vat = subTotal / 10;\n document.getElementById('vat').innerText = vat;\n const total = subTotal + vat;\n document.getElementById('total').innerText = total;\n document.getElementById('confirmAmount').innerText = total;\n}", "title": "" }, { "docid": "cff9c22aa1b9b5ad61eed3509d74b6a9", "score": "0.60453373", "text": "function getTotal() {\n const firstClassCount = getInputValue('firstClass');\n const economyCount = getInputValue('economy');\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('subTotalAmount').innerText = subTotal;\n\n const vat = subTotal * 0.1;\n const total = subTotal + vat;\n document.getElementById('vatAmount').innerText = vat;\n document.getElementById('totalAmount').innerText = total;\n}", "title": "" }, { "docid": "fa7e7d99fea72bafbf2e5938dd2dadad", "score": "0.6038179", "text": "function runningTotal() {\n let total = 0;\n let sumTotal = \"\";\n //main conference \n if (mainCon.firstElementChild.checked) {\n total = total + parseInt(mainConPrice);\n sumTotal = total;\n } \n if (mainCon.firstElementChild.checked === false) {\n sumTotal = sumTotal - mainConPrice;\n }\n\n //js libraries workshop\n if (jsWorkshop.firstElementChild.checked) {\n total = total + parseInt(jsWorkshopPrice);\n sumTotal = total;\n jsFrameWorkshop.firstElementChild.disabled = true;\n jsFrameWorkshop.classList.add('disabled');\n }\n if (jsWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - jsWorkshopPrice;\n jsFrameWorkshop.firstElementChild.disabled = false;\n jsFrameWorkshop.classList.remove('disabled');\n }\n\n //node js workshop\n if (nodeWorkshop.firstElementChild.checked) {\n total = total + parseInt(nodeWorkshopPrice);\n sumTotal = total;\n buildWorkshop.firstElementChild.disabled = true;\n buildWorkshop.classList.add('disabled');\n }\n if (nodeWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - nodeWorkshopPrice;\n buildWorkshop.firstElementChild.disabled = false;\n buildWorkshop.classList.remove('disabled');\n }\n\n //js frameworks workshop\n if (jsFrameWorkshop.firstElementChild.checked) {\n total = total + parseInt(jsFrameWorkshopPrice);\n sumTotal = total;\n jsWorkshop.firstElementChild.disabled = true;\n jsWorkshop.classList.add('disabled');\n }\n if (jsFrameWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - jsFrameWorkshopPrice;\n jsWorkshop.firstElementChild.disabled = false;\n jsWorkshop.classList.remove('disabled');\n }\n\n //build tools workshop\n if (buildWorkshop.firstElementChild.checked) {\n total = total + parseInt(buildWorkshopPrice);\n sumTotal = total;\n nodeWorkshop.firstElementChild.disabled = true;\n nodeWorkshop.classList.add('disabled');\n }\n if (buildWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - buildWorkshopPrice;\n nodeWorkshop.firstElementChild.disabled = false;\n nodeWorkshop.classList.remove('disabled');\n }\n\n //npm workshop\n if (npmWorkshop.firstElementChild.checked) {\n total = total + parseInt(npmWorkshopPrice);\n sumTotal = total;\n }\n if (npmWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - npmWorkshopPrice;\n }\n\n //express workshop\n if (expressWorkshop.firstElementChild.checked) {\n total = total + parseInt(expressWorkshopPrice);\n sumTotal = total;\n }\n if (expressWorkshop.firstElementChild.checked === false) {\n sumTotal = sumTotal - expressWorkshopPrice;\n }\n\n priceTotal.textContent = `Total: $${total}`;\n \n if (total > 0) {\n return true;\n } else if (total === 0) {\n return false;\n }\n \n}", "title": "" }, { "docid": "a77b4466b060bab6a82864e93976dd5a", "score": "0.60365355", "text": "function calculateTotal() {\n const firstCount = getInputValue('first');\n const economyCount = getInputValue('economy');\n\n const totalPrice = firstCount * 150 + economyCount * 100;\n document.getElementById('total-price').innerText = totalPrice;\n\n const tax = totalPrice * 0.1;\n document.getElementById('tax-amount').innerText = tax;\n\n const finalTotal = totalPrice + tax;\n document.getElementById('final-total').innerText = finalTotal\n}", "title": "" }, { "docid": "9ff7e779e320e2eb6fa176401f6540c5", "score": "0.60322654", "text": "function calculus(loanAmount, numberPayments, rate) {\n let monthlyPayment = 0;\n let totalCost = 0;\n let totalInterest = 0;\n let eachMonth = {\n month: [0],\n payment: 0,\n principal: [0],\n interest: [0],\n totalInterestObj: [0],\n balance: [loanAmount],\n totalInterestEnd: 0,\n totalCost: 0,\n term: 0,\n loanAmount: 0,\n };\n \n //payment est la mensualité\n monthlyPayment = (loanAmount) * (rate / 1200) / (1 - (1 + rate / 1200) ** (-60));\n //25000 × (5 ÷ 1200) ÷ (1 - (1 + 5 ÷ 1200))^(-60)=471.7808411\n eachMonth.payment = monthlyPayment;\n eachMonth.loanAmount = loanAmount;\n totalInterest = parseFloat((monthlyPayment * numberPayments) - loanAmount);\n eachMonth.totalInterestEnd = parseFloat(totalInterest);\n totalCost = parseFloat(loanAmount) + parseFloat(totalInterest);\n eachMonth.totalCost = totalCost;\n eachMonth.term = numberPayments;\n\n for (let i = 1; i <= numberPayments; i++) {\n eachMonth.month.push(i);\n eachMonth.interest.push(eachMonth.balance[i - 1] * rate / 1200);\n eachMonth.principal.push(monthlyPayment - eachMonth.interest[i]);\n eachMonth.totalInterestObj.push(eachMonth.interest[i - 1] + eachMonth.interest[i]);\n eachMonth.balance.push(eachMonth.balance[i - 1] - eachMonth.principal[i]);\n }\n return eachMonth;\n // formules a verifier:\n //balance 0 =loanAmount\n /* first Term: interest1==balance0*5/1200\n principal1==payment-interest1\n balance1==balance0-principal1\n\n eachMonth.interest[i]==eachMonth.balance[i-1]*5/1200\n principali==payment-interesti\n balancei==balance[i-1]]-principali */\n}", "title": "" }, { "docid": "e0d30322119571367a6e1a820c4a6e16", "score": "0.60255843", "text": "function CalculateAllTotals() {\n //use temp variables to prevent multiple dom updates\n var wt = 0;\n var dt = 0;\n var gt = 0;\n for (var i = 0; i < vm.territorySalesNumbers.length; i++) {\n wt += vm.territoryWritten[i];\n dt += vm.territoryDelivered[i];\n gt += vm.goals[i];\n }\n\n vm.writtenTotal = Round(wt, 2);\n vm.deliveredTotal = Round(dt, 2);\n vm.goalsTotal = Round(gt, 2);\n vm.goalsWrittenDifference = Round(vm.writtenTotal - vm.goalsTotal, 2);\n\n if (vm.goalsWrittenDifference > 0)\n vm.goalsWrittenDifference = '+' + vm.goalsWrittenDifference;\n\n }", "title": "" }, { "docid": "792b38917072472785a082ee0345f124", "score": "0.6023187", "text": "rawTotal() {\n return this._checkoutProducts\n .map((checkoutProduct) => checkoutProduct.count * checkoutProduct.price.value)\n .reduce((total, productPrice) => total + productPrice, 0);\n }", "title": "" }, { "docid": "3aaaedc6c70a6eb8a1562e0a198453e0", "score": "0.60209715", "text": "function calculateTotal() {\n const firstClassCount = getInputValue('first-class');\n const economyCount = getInputValue('economy');\n\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById('sub-total').innerText = '$' + subTotal;\n\n const vat = subTotal * 0.1;\n document.getElementById('vat').innerText = '$' + vat;\n\n const total = subTotal + vat;\n document.getElementById('total').innerText = '$' + total;\n}", "title": "" }, { "docid": "513a5082f2c976f7fd965ecd871a1061", "score": "0.60195804", "text": "function finalTotalAmountOfThisOrder()\n {\n return (nanCheck(parseFloat(subTotalWithoutShippingCost())) + nanCheck(parseFloat(shippingCostOfThisMainOrder()))).toFixed(2);\n }", "title": "" }, { "docid": "08fb859e8e4172640d034f56fecabae6", "score": "0.5983397", "text": "calculateAnnuityPaymentAmount(p) {\n\t\treturn new AnnuitySchedule(this.options).calculateAnnuityPaymentAmount(p);\n\t}", "title": "" }, { "docid": "57245fa65849c1949c633ae021e32bf0", "score": "0.59776", "text": "total (itens) {\n prod1 = list[0].amount\n prod2 = list[1].amount\n prod3 = list[2].amount\n prod4 = list[3].amount\n\n itens = prod1 + prod2 + prod3 + prod4\n\n return itens\n }", "title": "" }, { "docid": "59b787792ec37db630436d2d54fbe41d", "score": "0.5973529", "text": "function profitGenerated(days,clicks,rClick,renewingCost)\r\n{\r\n var nbo_generated = clicks * rClick;\r\n var nbo_eachDayCosts = ( (100-discountObtained()) * renewingCost / 100 ) / 30;\r\n var nbo_expenses = nbo_eachDayCosts * days;\r\n return (nbo_generated - nbo_expenses);\r\n}", "title": "" }, { "docid": "b6f0e55e15769448f53cda58c38b1f7c", "score": "0.59735125", "text": "function calc() {\n //Blank out existing values\n loanAmt = 0;rate = 0; month = 0; day = 0; year = 0; payment = 0; pmtfreq = 0;\n totInt = 0;\n //////////////////////////////////////////////////////////////////////////////\n loanAmt = document.getElementById(\"loanamt\").value;\n rate = document.getElementById(\"interest\").value;\n month = document.getElementById(\"months\").value;\n day = document.getElementById(\"days\").value;\n year = document.getElementById(\"years\").value;\n payment = document.getElementById(\"payment\").value;\n pmtfreq = document.getElementById(\"pmtfreq\").value;\n//Edits\nif(loanAmt == 0){\n alert(\"Loan Amount is required\");\n}\nif(rate == 0){\n alert(\"Interest Rate is required\")\n}\nif(payment == 0){\n alert(\"Payment is required\")\n}\n//Convert Payment Frequency to 1 or 2; 1 = Monthly; 2 = Bi-Weekly\n switch (pmtfreq) {\n case \"Monthly\":\n pmtfreq = 1;\n break;\n case \"Bi-Weekly\":\n pmtfreq = 2;\n }\n//Calculations\n intRate = rate/100; //Percent\n if (pmtfreq == 1){\n moInt = intRate/13; //Every 4 Weeks Interest rate\n }else{\n moInt = intRate/26; //Bi-Weekly Interest Rate\n }\n i = 0; //Counter\nwhile(loanAmt > 0){\n if(pmtfreq == 1){\n i++; //Increment Month Count\n }else{\n i = (i + 0.5); //Increment Month Count by Half due to Bi-Weekly Payments\n }\n int = moInt * loanAmt; //Monthly Interest Paid\n totInt += int;\n prinPayment = payment - int;\n loanAmt = loanAmt - prinPayment;\n }\n//Convert Month to be 1-12\nswitch (month) {\n case \"January\":\n month = 1;\n break;\n case \"February\":\n month = 2;\n break;\n case \"March\":\n month = 3;\n break;\n case \"April\":\n month = 4;\n break;\n case \"May\":\n month = 5;\n break;\n case \"June\":\n month = 6;\n break;\n case \"July\":\n month = 7;\n break;\n case \"August\":\n month = 8;\n break;\n case \"September\":\n month = 9;\n break;\n case \"October\":\n month = 10;\n break;\n case \"November\":\n month = 11;\n break;\n case \"December\":\n month = 12;\n}\n\n\n date = month+'/'+day+'/'+year;\n date = new Date(date);\n date = date.setMonth(date.getMonth() + i);\n date = new Date(date);\n date = date.toDateString();\n totInt = Math.round(100 * totInt)/100;\n document.getElementById(\"enddate\").textContent=date;\n document.getElementById(\"totInterest\").textContent=totInt;\n document.getElementById(\"payments\").textContent=i;\n}", "title": "" }, { "docid": "2b21307b38b3afd7716b6deca0b338c9", "score": "0.5970162", "text": "function calLedgerTotalValues(){\n\tvar finalBillAmount=0;\n\tvar finalAmountPaid=0;\n\tvar finalCumulativeAmount=0;\n\tvar finalRecoveryAmount=0;\n\t\n\t$(\".BillAmountCls\").each(function(){\n\t\tfinalBillAmount+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\t$(\".AmountPaidCls\").each(function(){\n\t\tfinalAmountPaid+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\t$(\".CumulativeAmountCls\").each(function(){\n\t\tfinalCumulativeAmount+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\t$(\".RecoveryAmountCls\").each(function(){\n\t\tfinalRecoveryAmount+=parseFloat($(this).text()==''?0:$(this).text().replace(/,/g,''));\n\t})\n\n\t$(\"#TotalBillAmount\").html(inrFormat(finalBillAmount.toFixed(2)));\n\t$(\"#TotalAmountPaid\").html(inrFormat(finalAmountPaid.toFixed(2)));\n\t$(\"#TotalRecoveryAmount\").html(inrFormat(finalRecoveryAmount.toFixed(2)));\n\t//$(\"#TotalCumulativeAmount\").html(finalCumulativeAmount.toFixed(2));\n}", "title": "" }, { "docid": "02c427557aca18fa1cba57a3add08796", "score": "0.59700537", "text": "function calculateTotal(){\n \n var childPrice = (getageGroupPrice() * getlengthOfDayInput()) * \n getdaysperweekInput() * gettimeframeInput() +\n summerClassPrice() + nonstudentfeeInput();\n\n// Display the results\n var grandTotal = document.getElementById('totalPrice');\n grandTotal.style.display='block';\n grandTotal.innerHTML = \"Total price for this child is $\"+childPrice.toFixed(2);\n}", "title": "" }, { "docid": "07c877d61f2ad4802cb3d2888c8e3d11", "score": "0.5967716", "text": "function singleClickTotalPaid(){\n\t\t$.ajax({\n\t\t type: 'GET',\n\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/grandtotal_paidamount?startkey=[\"'+fromDate+'\"]&endkey=[\"'+toDate+'\"]',\n\t\t\ttimeout: 10000,\n\t\t\tsuccess: function(data) {\n\n\t\t\t\tvar temp_totalOrders = 0;\n\t\t\t\tvar temp_totalPaid = 0;\n\n\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\ttemp_totalOrders = data.rows[0].value.count;\n\t\t\t\t\ttemp_totalPaid = data.rows[0].value.sum;\n\t\t\t\t}\n\n\t\t\t\tcompleteReportInfo.push({\n\t\t\t\t\t\t\"name\": \"Total Paid Amount\",\n\t\t\t\t\t\t\"value\": temp_totalPaid,\n\t\t\t\t\t\t\"count\": temp_totalOrders,\n\t\t\t\t\t\t\"split\": []\n\t\t\t\t});\n\n\t\t\t\tnetSalesWorth = temp_totalPaid;\n\n\t\t\t\t//Step 1-2:\n\t\t\t\tsingleClickTotalGuests();\n\n\t\t\t},\n\t\t\terror: function(data){\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 1,\n\t\t\t\t\t\"error\": \"Failed to load net sales figure. Report can not be generated.\"\n\t\t\t\t});\n\t\t\t\tstopReportAnimation('ERROR');\n\t\t\t\tsingleClickLoadErrors();\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}); \n\t}", "title": "" }, { "docid": "6d94c60ba54ecfab3949910fcb2e2feb", "score": "0.5964458", "text": "function findTotalPaid(rate, months) {\n return rate * months;\n }", "title": "" }, { "docid": "61db225233894fa0f8c4313941085533", "score": "0.5949952", "text": "function CalculateDeposit(percent_In_Year, mount, capitalization, first_payment, add_summ) {\r\n var percent_In_Mount = percent_In_Year / 12;\r\n var total = first_payment;\r\n var total_interest = 0;\r\n var all_made = first_payment;\r\n\r\n var result = {};\r\n console.log(\"Сумма на момент открытия вклада: \", total, \" процент по вкладу: \", percent_In_Year, \"%\", \"Ежемесячная процентная ставка:\", percent_In_Mount, \"%\", \"капитализация :\", capitalization);\r\n result.pay_percents = [];\r\n result.pay_percents.push({\r\n 'mount': 0,\r\n 'total': first_payment.toFixed(2)\r\n });\r\n for (var i = 1; i <= mount; i++) {\r\n var pay_percent = (capitalization ? total : first_payment) / 100 * percent_In_Mount;\r\n total_interest += pay_percent;\r\n total = total + pay_percent;\r\n console.log(\"Платеж по процентам в \", i, \" месяце равен \", pay_percent)\r\n\r\n if (mount > 1) {\r\n total += add_summ;\r\n all_made += add_summ;\r\n }\r\n result.pay_percents.push({\r\n 'mount': i,\r\n 'total': total.toFixed(2)\r\n });\r\n }\r\n var effectiv_percent = (total - all_made) / (all_made * 0.01);\r\n console.log(\"Сумма на момент закрытия вклада:\", total)\r\n console.log(\"Прибыль:\", total_interest)\r\n console.log(\"Сумма выросла на\", effectiv_percent + \"%\")\r\n result.total = total.toFixed(2);\r\n result.effectiv_percent = effectiv_percent.toFixed(2);\r\n result.total_interest = total_interest.toFixed(2);\r\n return result;\r\n}", "title": "" }, { "docid": "22a3eeaa27c61b7fd82e870ef3c4f092", "score": "0.5939199", "text": "function totalBill()\n{\n var result = 0.00;\n\n for (var i = 0; i < outstandingBill.length; i++)\n {\n result += outstandingBill[i].cost;\n }\n\n //console.log(\"bill total = \" + result);\n return result;\n}", "title": "" }, { "docid": "26a166701c2838fe04889e7187ff1e6c", "score": "0.5938575", "text": "function interestCalculator(r, balance, n, monthly_payment){\n \n //put all results in arrays to return out of the function\n let interest_array = [];\n let principal_array = [];\n //let remainder_array = [];\n let month_array = [];\n let balance_array = [];\n let total_interest_array = [];\n\n var interest_payment;\n var remainder;\n var x;\n let costObj = {};\n\n //iterate over the number of payment periods \n for (let i = 0; i < n; i++) {\n\n //what month are you paying?\n month_array.push(i+1);\n\n //how much interest are you paying this month?\n if (balance_array.length == 0) {\n interest_payment = r*balance.toFixed(2);\n interest_array.push(interest_payment);\n }\n else {\n interest_payment = r*balance_array[i-1].toFixed(2);\n interest_array.push(interest_payment);\n }\n \n \n //how much of payment goes towards principal?\n let prince_payment = monthly_payment - interest_payment;\n principal_array.push(prince_payment);\n \n //how much principal do you still owe? \n if (balance_array.length == 0) {\n remainder = balance - prince_payment;\n balance_array.push(remainder); // 0th item in balance remainder\n }\n else {\n remainder = balance_array[i-1] - prince_payment;\n balance_array.push(remainder); // 0th item in balance remainder\n }\n \n //update balance array that was passed into function\n //balance_array.push(remainder.toFixed(2));\n //check this out!\n x = balance_array.length;\n\n }\n\n //sum all the values in the interest array\n let int_length = interest_array.length;\n let total_interest = 0;\n\n for (let i = 0; i < int_length; i++) {\n //add the interest value for the ith, month, to the total interest\n total_interest += interest_array[i];\n //accumulated total interest\n total_interest_array.push(total_interest);\n }\n\n //Calculate total cost\n //let total_cost = balance[0] + total_interest;\n\n costObj.remaining_balance = balance_array;\n costObj.total_interest = total_interest;\n //costObj.total_cost = total_cost.toFixed(2);\n costObj.interest_payments = interest_array;\n costObj.principal_payment = principal_array;\n costObj.months = month_array;\n costObj.total_interest_array = total_interest_array;\n //costObj.principal_balance = remainder_array;\n\n return costObj;\n\n //am I allowed to return different data types from one function?\n //return [interest_array, principal_array, remainder_array, total_cost];\n\n}", "title": "" }, { "docid": "64b2892b90f909d6978729ea2c63e6a3", "score": "0.5937245", "text": "function totalDue() {\n\tconsole.log(\"Adding Bills\");\n\n\t$.get(\"/totalPayments\", function(data) {\n\t\tconsole.log(\"Back from the server with: \" );\n\t\tconsole.log(data);\n\n var total = data.results.sum[0].sum;\n \n \n $(\"#tableTotalDue\").append(\"<tr><th>Total Monthly Payments</th></tr>\");\n\n\t\t$(\"#tableTotalDue\").append(\"<tr><td>\" + total + \"</td></tr>\");\n });\n \n }", "title": "" }, { "docid": "1e04df711a0bec891486dafeb3a4d64d", "score": "0.59277594", "text": "getOrderTotal() {\n\n return Object.values(this.lineItems).reduce(\n (total, {product, sku, quantity}) =>\n total + quantity * this.plans[0].amount,\n 0\n );\n }", "title": "" }, { "docid": "ae080adab4dae8311d24d34aecc3acbb", "score": "0.5917733", "text": "function calculateTotal() {\n const phoneTotal = getInputValue('phone') * 1219;\n const caseTotal = getInputValue('case') * 59;\n const subTotal = phoneTotal + caseTotal;\n console.log(subTotal);\n\n}", "title": "" }, { "docid": "9158ce0b282fb75fa6342979cfc2c211", "score": "0.59051394", "text": "totalSpent(){\n let sum = 0;\n for(const meal of this.meals()){\n sum += meal.price;\n }\n return sum;\n\n \n }", "title": "" }, { "docid": "ec63c1a9ab9d6d805fdf5b4ffae5effb", "score": "0.59019357", "text": "function totalPay() {\n var google = 400;\n var amazon = 380;\n var facebook = 350;\n return ((google * 6) + (amazon * 4) + (facebook * 10));\n}", "title": "" }, { "docid": "866d0558bb5e49d2df3b42f012e68a42", "score": "0.58971184", "text": "function calculateTotalExpenses(passedState) {\n console.log('calculateTotalExpenses ran.');\n // if state has been established, calculate total expenses\n if (Object.keys(passedState).length > 0) {\n let expenseTotal = 0;\n const getKeys = Object.keys(passedState);\n const getValues = Object.values(passedState);\n if (passedState[getKeys[0]][0] !== undefined) {\n for (let iterateIDs = 0; iterateIDs <= getValues.length - 1; iterateIDs++) {\n const getLengthOfExpenses = Object.keys(getValues[iterateIDs]).length;\n for (let iterateExpenses = 0; iterateExpenses <= getLengthOfExpenses - 1; iterateExpenses++) { // eslint-disable-line max-len\n expenseTotal += getValues[iterateIDs][`${iterateExpenses}`].expenseAmt;\n console.log(getValues[iterateIDs][`${iterateExpenses}`].expenseAmt);\n }\n }\n }\n return expenseTotal;\n } // else\n // if state is not yet a state array...\n return 0;\n }", "title": "" }, { "docid": "eff80df46a62ed065170220f39b17cc9", "score": "0.5892891", "text": "function deductible(rentals)\n{\n for (var i = 0; i < rentals.length; i++)\n {\n if (rentals[i].options.deductibleReduction == true)\n {\n rentals[i].price += 4 * getDays(rentals[i].pickupDate, rentals[i].returnDate);\n }\n }\n}", "title": "" }, { "docid": "5531fa56ccdb812008258b531fff9df7", "score": "0.58882886", "text": "function calculateAcitivtyTotalAndUpdate(activityAmount) {\n let currentAmount = parseInt($(\"span#total-activities\").text());\n currentAmount += activityAmount;\n $(\"span#total-activities\").empty().text(currentAmount);\n\n }", "title": "" }, { "docid": "35a3d89586fe2ffa3c961b18e042f7bf", "score": "0.5875731", "text": "calculateTotal() {\n\t\t//Réinitialise le total\n\t\tthis.total = 0\n\t\tfor (let product of this.products) {\n\t\t\tthis.total += product.price * product.number\n\t\t}\n\t}", "title": "" }, { "docid": "0100e17cd9dcb0e16cd890f476670f91", "score": "0.5864921", "text": "outstandingBalance() {\n const amountPaid = this.amountPaidOnInvoice();\n const invoiceTotal = this.amount;\n const tip = this.tip || 0;\n return (invoiceTotal + tip) - amountPaid;\n }", "title": "" }, { "docid": "5401ab377407297a85ff8dc0d59f3c98", "score": "0.5859661", "text": "function totalAmount() {\n var subTotal = 0;\n var grandTotal = 0;\n var amt = getAllElement(\".amt\");\n amt.forEach(function(ele) {\n subTotal += parseInt(ele.value);\n });\n\n // getting discount applied\n var discount = getElement(\"#discount\").value;\n if (parseInt(discount) < parseInt(subTotal)) {\n grandTotal = subTotal - discount;\n }\n\n // calculate gst applied\n var gst = getElement(\"#gst\").value;\n if (gst > 0) {\n grandTotal = ((100 + parseInt(gst)) * parseInt(grandTotal)) / 100;\n grandTotal = Math.round(grandTotal);\n }\n\n // calculate service tax\n var serviceTax = getElement(\"#serviceTax\").value;\n if (serviceTax > 0) {\n grandTotal = ((100 + parseInt(serviceTax)) * parseInt(grandTotal)) / 100;\n grandTotal = Math.round(grandTotal);\n }\n\n getElement(\"#subtotal\").value = parseInt(subTotal);\n getElement(\"#total\").value = parseInt(grandTotal);\n}", "title": "" }, { "docid": "cd4210b925b02fd00f07eafacf45c648", "score": "0.5855985", "text": "function getTotal() {\n\t\treturn cart.reduce((current, next) => {\n\t\t\treturn current + next.price * next.count;\n\t\t}, 0);\n\t}", "title": "" }, { "docid": "ae058dcae3b7f578466ce2fd8b9622aa", "score": "0.58451754", "text": "async getInvoiceTotal(user) {\n const reassigned = this.isReassignedToUser(user);\n if (!reassigned && this.amount) {\n if (User.isManager(user)) {\n return `${this.addServiceFee(this.amount).toFixed(2)}`;\n }\n return `${this.amount.toFixed(2)}`;\n } else if (reassigned && this._requests) {\n let reassigneeTotal = 0;\n this._requests.forEach((request) => {\n if (request._reassignedTo && String(request._reassignedTo._id) === String(user._id)) {\n reassigneeTotal += request.total;\n }\n });\n return `${reassigneeTotal.toFixed(2)}`;\n }\n return 0;\n }", "title": "" }, { "docid": "5c7684106b8e8c516cf9e3934744ce0d", "score": "0.58417547", "text": "function calculateTotal() {\n const firstClassCount = getInputValue(\"first-class\");\n const economyCount = getInputValue(\"economy\");\n\n // Calculating subtotal\n const subTotal = firstClassCount * 150 + economyCount * 100;\n document.getElementById(\"subtotal-amount\").innerText = '$' + subTotal;\n\n // Calculating VAT\n const vat = Math.round(subTotal * 0.1);\n document.getElementById(\"vat-amount\").innerText = '$' + vat;\n\n // Calculating Total\n const Total = subTotal + vat;\n document.getElementById(\"total-amount\").innerText = '$' + Total;\n}", "title": "" }, { "docid": "f90f0f5bcf5ba9fae6c4e4b809bcba4e", "score": "0.5838519", "text": "function remainingBalance(payments) {\n var amountPaid = 0;\n angular.forEach(payments, function(payment) {\n angular.forEach(payment.appliedPayments, function(applied) {\n amountPaid += applied.amount;\n });\n });\n return this.total - amountPaid;\n }", "title": "" }, { "docid": "63b3810405a46a6769d05e81cd1d822d", "score": "0.58335674", "text": "payment(P, Y, R) {\n var n = 12 * Y;\n var r = R / (12 * 100);\n var payment = (P * r) / (1 - (1 + r) ^ (-n));\n console.log(\"Monthly Payment is:\" + payment);\n\n\n\n\n }", "title": "" }, { "docid": "2999bf34d5afe7db7fb8a71bf8706d45", "score": "0.5829156", "text": "function subTotal(amount) {\n var subTotal = numPizzas * PRICEPIZZA - DISCOUNTRATE;\n return subTotal;\n}", "title": "" }, { "docid": "459aa183ec1ed484a4880cad99ade210", "score": "0.58287954", "text": "function countTotal() {\n var all_subtotals_length = $('.subtotal').length;\n var grand_subtotal = 0;\n\n for (i = 0; i < all_subtotals_length; i++) {\n grand_subtotal = grand_subtotal + (parseFloat($('.subtotal:eq(' + i + ')').val() || 0));\n }\n\n var discount = parseFloat($(\"#discount\").val() || 0);\n\n discount = discount / 100 * grand_subtotal;\n var down_payment = $(\"#dp\").val();\n\n if (down_payment >= grand_subtotal) {\n if (!$('#dp').prop('disabled') && items_count > 0) {\n swal({\n text: \"Please check your Down Payment!\",\n icon: \"error\"\n });\n $(\"#dp\").val(0);\n $(\"#dp\").focus();\n }\n } else {\n var grand_total = grand_subtotal - discount - down_payment;\n this.varGrand = grand_total;\n $(\"#subtotal\").val(grand_subtotal);\n $(\"#grand-total-span\").html(\"Rp \" + number_format(grand_subtotal) + \",-\");\n $(\"#grand-total-span-input\").val(grand_subtotal);\n $(\"#grand-total-input\").val(grand_total);\n }\n}", "title": "" }, { "docid": "ee9b9ef52bcd9d58af72679b8d6e633d", "score": "0.5803208", "text": "function calculate()\n{\t\n\tvar total_balance = 0\n\tvar total_payment = 0\n\n\t//$( '#total_balance' ).text('').empty()\n\n\t$( '.balance' ).each(\n\t\tfunction()\n\t\t{\n\t\t\tvar val = $( this ).val() * 1\n\t\t\tif( ! isNaN( val ) )\n\t\t\t\ttotal_balance += val\n\t\t} // function\n\t) // each\n\t\n\t$( '.minimum_payment' ).each(\n\t\tfunction()\n\t\t{\n\t\t\tvar val = $( this ).val() * 1\n\t\t\tif( ! isNaN( val ) )\n\t\t\t\ttotal_payment += val\n\t\t} // function\n\t) // each\n\t\n\t\n\t$( '#total_balance' ).text( money_format( total_balance ) )\n\t$( '#total_payment' ).text( money_format( total_payment ) )\n} // calculate", "title": "" }, { "docid": "da337081beaa0a0fcb0dac1f1026d913", "score": "0.5794608", "text": "function amountAfterCommission(pdName){\n var pdTotal = betting.productTotal(pdName);\n //commission appled for each product\n var cRate = cms.get(pdName);\n return pdTotal - ( pdTotal * cRate / 100);\n\n}", "title": "" }, { "docid": "e90b9dbeeebb6fbcb73688e1f3c8731c", "score": "0.57943606", "text": "balance(){\nlet sum = 0\nfor (let i=0; i < this.transactions.length; i++) {\n sum = sum + this.transactions[i].amount;\n} return sum\n }", "title": "" }, { "docid": "6aef55ed0ada1fe465a44f835e2d9892", "score": "0.578841", "text": "async function updateTotal() {\n try {\n const stats = await request({\n uri: urls_1.GDQUrls.total,\n json: true\n });\n const freshTotal = parseFloat(stats.agg.amount || 0);\n if (freshTotal === total.value.raw) {\n return false;\n }\n total.value = {\n raw: freshTotal,\n formatted: util_1.formatDollars(freshTotal, { cents: false })\n };\n return true;\n }\n catch (error) {\n let msg = 'Could not get donation total, unknown error';\n if (error) {\n msg = `Could not get donation total:\\n${error.message}`;\n }\n nodecg.log.error(msg);\n }\n return false;\n}", "title": "" }, { "docid": "f1d666ef7a93f87b1981c16a2d95c054", "score": "0.57875085", "text": "function calculate() {\n\tconst principal = parseFloat(billInput.value);\n\tconst percent = selectedTip / 100;\n\tconst people = parseFloat(peopleInput.value);\n\tconst amount = (principal * percent) / people;\n\tconst total = principal / people + amount;\n\t\n\ttipPerson.textContent = '$' + amount.toFixed(2);\n\ttotalPerson.textContent = '$' + total.toFixed(2);\n\treturn;\n}", "title": "" }, { "docid": "7c9a00c9ddf54453c5d96200f61ddb36", "score": "0.57821286", "text": "totalSpent() {\n let prices = this.meals().map(\n function(meal) {\n return meal.price;\n }\n );\n\n return prices.reduce(\n function (total, price) {\n return total + price;\n }\n )\n\n }", "title": "" }, { "docid": "b4993ccd567d278c86b2b47251221307", "score": "0.57799786", "text": "function calculatTotal(){\n const ticketCount = getInputValue(\"first-class-count\");\n const economyCount = getInputValue(\"economy-count\");\n const totalPrice = ticketCount * 150 + economyCount * 100;\n elementId(\"total-price\").innerText = '$' + totalPrice;\n const vat = totalPrice * .1;\n elementId(\"vat\").innerText = \"$\" + vat;\n const grandTotal = totalPrice + vat;\n elementId(\"grandTotal\").innerText = \"$\" + grandTotal;\n}", "title": "" }, { "docid": "8cf58688d8b39631625c55ce718291fe", "score": "0.57797486", "text": "function fnAlltotal(){\n console.log(\"TOTAL hit\")\n var subTotal=0;\n\n $(\".amount\").each(function(){\n subTotal += parseFloat($(this).val()||0);\n });\n\n \n final.subTotal = subTotal\n final.total = subTotal\n $('#td-subtotal').html(( final.subTotal).toFixed(3)); \n $('#td-total').html(( final.total).toFixed(3) - lead['discount'].toFixed(3));\n}", "title": "" }, { "docid": "fcf0346302ca56cd94fed1762afea7e8", "score": "0.57796985", "text": "function calculateGraduatedMonthlyPayment(loansArray) {\n\n var total = { initial : 0 };\n var federalLoans = getLoansByType(loansArray, loanType.FEDERAL);\n\n for (var i = 0; i < federalLoans.length; i++) {\n var loan = federalLoans[i];\n //QC 6032 If interest is 0% then there is no payment due the first 2 years.\n if ((parseInt(loan.InterestRate, 10)) === 0) { //QC-6377\n total.initial += 0;\n } else {\n total.initial += ((loan.OriginalLoanAmount * ((loan.InterestRate / 100) / 12)));\n }\n }\n return total;\n }", "title": "" }, { "docid": "f1e1359b61e187f562d2856b7b466765", "score": "0.5777434", "text": "function calculateMonthlyPayment(values) {\n // let x = getCurrentUIValues();\n let p = values.loanAmount;\n let i = (values.loanRate) / 12;\n let n = (values.loanYears) * 12;\n return parseFloat(((p * i) / (1 - (1 + i) ** -(n))).toFixed(2));\n}", "title": "" }, { "docid": "d208a40f64c768aecdfdbb14ae2f0362", "score": "0.5758869", "text": "getAmount(){ \n var totalAmount = (this.gallonsRequested * this.getPrice());\n\n return totalAmount;\n }", "title": "" }, { "docid": "c571507cf0114d874d138e228bfd80c8", "score": "0.5754376", "text": "function calculateTotal() {\n let tipPerPerson = (billObj._billAmount * billObj._tipAmount) / billObj._numOfPeople;\n let billPerPerson = billObj._billAmount / billObj._numOfPeople;\n let totalAmount = tipPerPerson + billPerPerson;\n if (isNaN(tipPerPerson) && isNaN(billPerPerson)) {\n return;\n }\n else {\n //This should output to DOM;\n document.querySelector(\".display_tip_value\").innerHTML = tipPerPerson.toFixed(2).toString();\n document.querySelector(\".display_total_value\").innerHTML = totalAmount.toFixed(2).toString();\n }\n ;\n}", "title": "" }, { "docid": "edea576f8cdccf0ab58aa06a1afb26fa", "score": "0.5749161", "text": "function calculateTotal() {\n calculateSubtotals();\n for (var x in subtotal) {\n preuTotal+=subtotal[x].value;\n }\n console.log('Total: '+preuTotal);\n}", "title": "" }, { "docid": "2c531d402681f6062217c74e3a5a6b56", "score": "0.5744998", "text": "function runningReduceInitial() {\n\t\t\treturn {\n\t\t\t\ttotal: 0,\n\t\t\t\tcount: 0,\n\t\t\t\t//average: 0,\n\t\t\t\ttype: 'runningTotal'\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "dfb0d5e7cb666eacbbd75efeb9ae3aa0", "score": "0.5743854", "text": "function calculateTotalLoan(monthlyPayment,term)\n{\n var totalLoan = monthlyPayment*term;\n return totalLoan;\n}", "title": "" }, { "docid": "cf514c0e2ac7bf3c0c5a17b3a46de78a", "score": "0.57404584", "text": "function updateSums() {\n // Create array of transaction amounts from transactions array\n const amounts = transactions.map( transaction => transaction.amount );\n \n // Calculate total value for balance\n const total = amounts\n .reduce( (acc, amount) => ( acc += amount ), 0 )\n .toFixed(2);\n \n // Calculate total income\n const income = amounts\n .filter( amount => amount > 0 )\n .reduce( (acc, amount) => ( acc += amount ), 0 )\n .toFixed(2);\n\n // Calculate total expense\n const expense = amounts\n .filter( amount => amount < 0 )\n .reduce( (acc, amount) => ( acc += amount ), 0 )\n .toFixed(2);\n \n // Update Balance in DOM\n balance.innerText = `${total} PKR`\n\n // Update Income in DOM\n money_plus.innerText = `${income} PKR`\n\n // Update Expense in DOM\n money_minus.innerText = `${expense} PKR`\n}", "title": "" }, { "docid": "31f3e34934d60e265a9d0cc23cb64d72", "score": "0.57396746", "text": "function calculateIncomeBasedMonthlyPayment(loansArray, income, familySize, filingStatus, stateOfResidence) {\n var total = { initial : 0 };\n\n if (!income || !familySize || !filingStatus || !stateOfResidence) {\n return total;\n }\n //Calculate standard payment\n var standardPayment = calculateStandardMonthlyPayment(loansArray);\n var discretionaryIncome = 0;\n if (stateOfResidence === 'OTHER') {\n discretionaryIncome = 0.15 * (income - (11730 + (6480 * familySize))) / 12;\n } else if (stateOfResidence === 'AK') {\n discretionaryIncome = 0.15 * (income - (14670 + (8100 * familySize))) / 12;\n } else if (stateOfResidence === 'HI') {\n discretionaryIncome = 0.15 * (income - (13485 + (7455 * familySize))) / 12;\n }\n\n if (discretionaryIncome <= 0) {\n return total;\n } else if (discretionaryIncome > 0 && discretionaryIncome <= 5) {\n total = { initial : 5 };\n return total;\n } else if (discretionaryIncome > 5 && discretionaryIncome <= 10) {\n total = { initial : 10 };\n return total;\n } else {\n if (discretionaryIncome < standardPayment.initial) {\n //return the lesser of both standard repayment and discretionaryIncome\n total.initial = discretionaryIncome;\n return total;\n } else {\n return standardPayment;\n }\n }\n }", "title": "" }, { "docid": "3c050e4d2fef5a3d698ba87d83d55bcd", "score": "0.57394093", "text": "function price(activity_time, start_time, end_time) {\n var tick = new Date(start_time);\n var today = new Date(end_time);\n var month_accounts = {};\n var outstanding = 0;\n while (tick < today) {\n var strtick = tick.toISOString().split(\"T\")[0];\n var month = tick.getFullYear() + (tick.getMonth() + 1).pad(2);\n var user_count = 0;\n if (!month_accounts[month]) {\n month_accounts[month] = {};\n }\n for (var user_id in activity_time[strtick]) {\n if (activity_time[strtick][user_id] > 0) {\n if (!month_accounts[month][user_id]) {\n month_accounts[month][user_id] = 1;\n } else {\n month_accounts[month][user_id] = month_accounts[month][user_id] + 1;\n }\n user_count = user_count + 1;\n } else {\n if (!month_accounts[month][user_id]) {\n month_accounts[month][user_id] = 0;\n } \n }\n }\n tick.setDate(tick.getDate() + 1);\n }\n total_amount = 0;\n total_deduction = 0;\n for (var month_key in month_accounts) {\n month_count = new Date(month_key.substring(0 ,4), month_key.substring(4, 6), 0).getDate();\n month_amount = 0;\n month_deduction = 0;\n for (var user in month_accounts[month_key]) {\n if (month_accounts[month_key][user] == month_count) {\n month_amount = month_amount + slack_monthly_license;\n } else {\n month_amount = month_amount + slack_monthly_license;\n if (month_accounts[month_key][user] == 0) {\n month_deduction = month_deduction + slack_monthly_license;\n } else {\n month_deduction = month_deduction + parseInt(slack_monthly_license * (month_count - month_accounts[month_key][user]) / month_count);\n }\n }\n }\n console.log(\" - \" + month_key + \" ( \" + month_count + \" days ) | $\" + month_amount.space(5) + \" - $\" + month_deduction.space(5) + \" = $\" + (month_amount - month_deduction).space(5).toString());\n total_amount = total_amount + month_amount;\n total_deduction = total_deduction + month_deduction;\n }\n console.log(\"------------------------------------------------------\");\n console.log(\"total upfront : $\" + total_amount.space(6));\n console.log(\"total paid : $\" + (total_amount - total_deduction).space(6));\n}", "title": "" }, { "docid": "2ad6f502083461edf8c1f12018951aa1", "score": "0.573892", "text": "function calculateRelease(currentBalanceP1,currentBalanceP2,arbPaidFee,arbFeePayorName,person1,person2,arbAccount,feeAccount) {\r\n \r\n var person1Release = 0;\r\n var person2Release = 0;\r\n var doneeRelease = 0;\r\n var totalWallet = Number(currentBalanceP1) + Number(currentBalanceP2);\r\n\r\n // validate the totalWallet\r\n if (totalWallet < 0) {\r\n outputMessage = \"error2000\";\r\n totalWallet = 0;\r\n }\r\n\r\n // check that the total wallet is bigger than the fee\r\n if (totalWallet <= Number(arbPaidFee)) {\r\n \r\n // if balances are too small, dust goes to fee\r\n arbPaidFee = totalWallet; \r\n\r\n } else {\r\n\r\n // calculate the ruling amounts from the percentages - ensure 4 decimals of precision\r\n if (Number(rulingDonee) > 0) {\r\n person1Release = (parseFloat(ruling1)/100) * totalWallet;\r\n person1Release = Number(person1Release.toFixed(4));\r\n person2Release = (parseFloat(ruling2)/100) * totalWallet;\r\n person2Release = Number(person2Release.toFixed(4));\r\n doneeRelease = totalWallet - person1Release - person2Release; \r\n } else if (Number(ruling2) > 0) { \r\n person1Release = (parseFloat(ruling1)/100) * totalWallet;\r\n person1Release = Number(person1Release.toFixed(4));\r\n person2Release = totalWallet - person1Release;\r\n doneeRelease = 0; \r\n } else {\r\n person2Release = (parseFloat(ruling2)/100) * totalWallet;\r\n person2Release = Number(person2Release.toFixed(4));\r\n person1Release = totalWallet - person2Release;\r\n doneeRelease = 0; \r\n }\r\n\r\n // remove the fee from the appropriate person\r\n if (arbFeePayorName == person1) {\r\n person1Release = Number(person1Release) - Number(arbPaidFee);\r\n }\r\n\r\n // remove the fee from the appropriate person\r\n if (arbFeePayorName == person2) {\r\n person2Release = Number(person2Release) - Number(arbPaidFee);\r\n }\r\n\r\n // validate the release amount\r\n if (person1Release < 0) { \r\n\r\n // adjust the arbPaidFee to come from donee, if person doesn't have enough balance\r\n if (Number(doneeRelease) >= Number(person1Release) * (-1)) {\r\n // person 1 is negative, so adding reduces it\r\n doneeRelease = Number(doneeRelease) + Number(person1Release); \r\n } else {\r\n // donee doesn't have enough balance either, just reduce fee rather than taking from person2\r\n // because person2 should have good ruling if no doneeRelease balance \r\n arbPaidFee = Number(arbPaidFee) + Number(person1Release);\r\n }\r\n\r\n person1Release = 0;\r\n } \r\n\r\n if (person2Release < 0) {\r\n \r\n // adjust the arbPaidFee to come from donee, if person doesn't have enough balance\r\n if (Number(doneeRelease) >= Number(person2Release) * (-1)) {\r\n // person 2 is negative, so adding reduces it\r\n doneeRelease = Number(doneeRelease) + Number(person2Release); \r\n } else {\r\n // donee doesn't have enough balance either, just reduce fee rather than taking from person1\r\n // because person1 should have good ruling if no doneeRelease balance \r\n arbPaidFee = Number(arbPaidFee) + Number(person2Release);\r\n }\r\n\r\n person2Release = 0;\r\n }\r\n\r\n\r\n // convert to 4 decimal precision\r\n person1Release = person1Release.toFixed(4);\r\n person2Release = person2Release.toFixed(4);\r\n doneeRelease = doneeRelease.toFixed(4);\r\n\r\n // validate the total released is the total wallet - 4 digits of precision\r\n if (Math.abs(Number(person1Release) + Number(person2Release) + Number(doneeRelease) + Number(arbPaidFee) - Number(totalWallet.toFixed(4))) < 0.00001 ) {\r\n \r\n // validate all balances are positive\r\n if (Number(person1Release) < 0) {\r\n outputMessage = \"error3001\";\r\n }\r\n\r\n // validate all balances are positive\r\n if (Number(person2Release) < 0) {\r\n outputMessage = \"error3002\";\r\n }\r\n\r\n // validate all balances are positive\r\n if (Number(doneeRelease) < 0) {\r\n outputMessage = \"error3003\";\r\n }\r\n\r\n // validate all balances are positive\r\n if (Number(arbPaidFee) < 0) {\r\n outputMessage = \"error3004\";\r\n }\r\n\r\n } else {\r\n\r\n // balance error, fee too big for balances\r\n outputMessage = \"error3000\";\r\n \r\n }\r\n\r\n }\r\n\r\n if (outputMessage == \"success\") {\r\n // update contract\r\n updateContract(person1Release,person2Release,doneeRelease,arbPaidFee,person1,person2,arbAccount,feeAccount);\r\n } else {\r\n finalReturn(outputMessage);\r\n }\r\n \r\n}", "title": "" }, { "docid": "e261478978a7d6204542857bc964e6a0", "score": "0.573808", "text": "function standardCalculations() {\n // 1. has been populated for the first time, mark default checkboxes\n const perPhone = $( '#perPhone' ).prop('checked');\n const perPhoneLongDistance = $( '#perPhoneLongDistance' ).prop('checked');\n if (isCheckboxOff('#perPhone') && isCheckboxOff('#allPhones')) {\n $( '#perPhone' ).prop('checked', true);\n }\n if (isCheckboxOff('#perPhoneLongDistance') && isCheckboxOff('#allPhonesLongDistance')) {\n $( '#perPhoneLongDistance' ).prop('checked', true);\n }\n\n const plansCount = parseInt($( '#plansCount' ).val().replace(/,/g, ''));\n const monthlyPayment = valueOf('#monthlyPayment');\n const longDistance = valueOf('#longDistance');\n\n let monthlyExpense = 0;\n monthlyExpense += perPhone ? plansCount * monthlyPayment : monthlyPayment\n monthlyExpense += perPhoneLongDistance ? plansCount * longDistance : longDistance\n\n $( '#monthlyExpense' ).text(`$ ${addCommas(monthlyExpense)}`);\n $( '#yearlyExpense' ).text(`$ ${addCommas(12 * monthlyExpense)}`);\n\n const nineYearExpense = 9 * 12 * monthlyExpense;\n $( '#nineYearExpense' ).text(`$ ${addCommas(nineYearExpense)}`);\n\n let newNineYearExpense\n if ($('#viewDetailsButtonBottom').css('display') === 'none') {\n newNineYearExpense = plansCount * 500;\n $( '#newNineYearExpense' ).text(`$ ${addCommas(newNineYearExpense)}`);\n\n \n } else {\n newNineYearExpense = $('#newNineYearExpense').text().replace(/(\\s|\\$|,)/g, '');\n newNineYearExpense = parseFloat(newNineYearExpense);\n\n }\n\n const nineYearSaving = nineYearExpense - newNineYearExpense;\n $( '#nineYearSaving' ).text(`$ ${addCommas(nineYearSaving)}`);\n\n $( '#yearlySaving' ).text(`$ ${addCommas(nineYearSaving / 9)}`);\n}", "title": "" }, { "docid": "fe674be2e2f24cc4cbc4fd1400f30084", "score": "0.5737754", "text": "calculateTotals(data) {\n let calculate = (acc, current) => acc + current;\n let total = data.reduce(calculate);\n return total;\n }", "title": "" }, { "docid": "095b4f28a5fd81f19d67a6752d8dac2a", "score": "0.5726836", "text": "function updateTotal() {\n\t\tgrandTotal = 0;\n\t\tgendiscount = $(\"#gendiscount\").val();\n\t\tgendisctype = $(\"#gendiscounttype\").val();\n\t\tshippingamt = $(\"#shippingamt\").val();\n\n\t\t$.each(prItems, function(index, value) { \n\t\t var total = parseFloat(value.total);\n\t grandTotal += total;\n\t\t});\n\t\t$(\"#totalamt\").val(grandTotal);\n\n\t\tif (gendisctype == 2) {\n\t\t\tgrandDiscount = parseFloat(grandTotal) * (parseFloat(gendiscount) / 100);\n\t\t}\n\t\telse {\n\t\t\tgrandDiscount = gendiscount;\n\t\t}\n\n\t\tdiscountedGrandTotal = (parseFloat(grandTotal) - parseFloat(grandDiscount)) + parseFloat(shippingamt);\n\n\t\tif (discountedGrandTotal <= 0) {\n\t\t\tdiscountedGrandTotal = 0;\n\t\t}\n\n\t\tif (grandTotal > 0) {\n\t\t\t$(\".btnProceed\").prop('disabled',false);\n\t\t}\n\t\telse {\n\t\t\t$(\".btnProceed\").prop('disabled',true);\n\t\t}\n\n\t\t$(\".btnGrandtotal\").html(\"TOTAL: \" + formatMoney(discountedGrandTotal));\n }", "title": "" }, { "docid": "843e3d1ccf58feb762b49a8719d44016", "score": "0.57195055", "text": "function calcTotalTotal() {\n totalTotal = 0;\n for (var i = 0; i < hours.length; i++) {\n totalTotal += combinedHourlyCookies[i];\n }\n}", "title": "" }, { "docid": "584f6240a576936163f7787153dc262b", "score": "0.5714797", "text": "function totalFine(items) {\n return items.reduce(function (total, item) {\n return total + item.fine_due - item.fine_paid;\n }, 0);\n }", "title": "" }, { "docid": "5b0e887b8a567bb6e07a3e052a9e97ae", "score": "0.57128584", "text": "function calculDeductible () {\n for (var i = 0; i < deliveries.length; i++) {\n if (deliveries[i].options.deductibleReduction == true) {\n deliveries[i].price += deliveries[i].volume\n deliveries[i].commission.convargo += deliveries[i].volume\n }\n }\n}", "title": "" }, { "docid": "fc6639e1016fafc41107d49485c71fe8", "score": "0.57123214", "text": "function calculateTotalCost(series, contractPeriod) {\n var total = 0;\n\n switch (series.repeat) {\n case 'once':\n total = total + series.amount;\n break;\n case 'monthly':\n total = total + series.amount * 12 * contractPeriod;\n break;\n case 'quarterly':\n total = total + series.amount * 4 * contractPeriod;\n break;\n case 'half yearly':\n total = total + series.amount * 2 * contractPeriod;\n break;\n case 'yearly':\n total = total + series.amount * contractPeriod;\n break;\n default:\n total = total;\n }\n return total;\n}", "title": "" }, { "docid": "c9a6c2805c888aa7048f423a0657478c", "score": "0.5710463", "text": "function getALoanEstimate() {\n while (true) {\n prompt(MESSAGES.welcome);\n\n let loanAmount = getLoanAmount();\n\n let annualPercentageRate = getAnnualPercentageRate();\n\n let loanDuration = getLoanDuration();\n\n decideHowToCalculateMonthlyPayment(\n loanAmount,\n annualPercentageRate,\n loanDuration\n );\n\n let doesUserWantToCalculateAgain = askToCalculateAgain();\n\n if (doesUserWantToCalculateAgain === \"n\") {\n prompt(MESSAGES.goodbye);\n break;\n }\n }\n}", "title": "" }, { "docid": "170ab35566d6522874dc8946dc7a343e", "score": "0.5702814", "text": "function calcLoanPayment(p, r, t, n){ // calculates loan payments given principal, interest rate, number of years, and number of times a year interest is compounded\n var payment = p * (r/n) * Math.pow(1 + r/n, t*n) / (Math.pow(1 + r/n, t*n) - 1); // equation for monthly payment on a mortgage\n return payment; // output for function is payment\n}", "title": "" }, { "docid": "c3c5c5072ae70890f3daa83f8c802aa2", "score": "0.57014894", "text": "function amountcommi()\n{\n for (var i=0; i<rentals.length;i++)\n {\n //Drivy take a 30% commission on the rental price to cover their costs.\n var commission= rentals[i].price *0.3;\n\n //insurance: half of commission\n rentals[i].commission.insurance = commission *0.5;\n\n //roadside assistance 1€ per day\n rentals[i].commission.assistance = getRentDays(rentals[i].pickupDate,rentals[i].returnDate) +1;\n\n //drivy takes the rest\n rentals[i].commission.drivy= commission - (rentals[i].commission.insurance + rentals[i].commission.assistance);\n }\n\n}", "title": "" } ]
dd275c03d59d381ca2ca76333b89dba6
Updateable: margin, limit, step, range, animate, snap
[ { "docid": "643d44bc05be54130f3239c9fa923b2d", "score": "0.0", "text": "function updateOptions ( optionsToUpdate ) {\n\n\t\tvar v = valueGet(), i, newOptions = testOptions({\n\t\t\tstart: [0, 0],\n\t\t\tmargin: optionsToUpdate.margin,\n\t\t\tlimit: optionsToUpdate.limit,\n\t\t\tstep: optionsToUpdate.step,\n\t\t\trange: optionsToUpdate.range,\n\t\t\tanimate: optionsToUpdate.animate,\n\t\t\tsnap: optionsToUpdate.snap === undefined ? options.snap : optionsToUpdate.snap\n\t\t});\n\n\t\t['margin', 'limit', 'step', 'range', 'animate'].forEach(function(name){\n\t\t\tif ( optionsToUpdate[name] !== undefined ) {\n\t\t\t\toptions[name] = optionsToUpdate[name];\n\t\t\t}\n\t\t});\n\n\t\tscope_Spectrum = newOptions.spectrum;\n\n\t\t// Invalidate the current positioning so valueSet forces an update.\n\t\tscope_Locations = [-1, -1];\n\t\tvalueSet(v);\n\n\t\tfor ( i = 0; i < scope_Handles.length; i++ ) {\n\t\t\tfireEvent('update', i);\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "131c5b1a69a963f4ba86147be45aeee5", "score": "0.65201813", "text": "_updateBounds() {\n this.$el\n .move(this.model.get('x') * this._scale,\n this.model.get('y') * this._scale,\n 'absolute')\n .width(this.model.get('width') * this._scale)\n .height(this.model.get('height') * this._scale);\n }", "title": "" }, { "docid": "157ed07ff2b97999c9a0493a155dd757", "score": "0.63701636", "text": "set(current, min, max, scroll_ratio){\n this.position.current = current;\n this.position.min = min;\n this.position.max = max;\n this.position.scroll_ratio = scroll_ratio;\n this.move();\n }", "title": "" }, { "docid": "5cdf4656155d7b6f14fffd3ccbf9a352", "score": "0.61448807", "text": "function updateRangeFromUI () {\n var uirangeL = parseFloat(slider.style(\"left\"));\n var uirangeW = parseFloat(slider.style(\"width\"));\n var conW = sliderBox.node().clientWidth; //parseFloat(container.style(\"width\"));\n var slope = (conW - minWidth) / (rangeMax - rangeMin);\n var rangeW = (uirangeW - minWidth) / slope;\n if (conW == uirangeW) {\n var uislope = 0;\n } else {\n var uislope = (rangeMax - rangeMin - rangeW) / (conW - uirangeW);\n }\n var rangeL = rangeMin + uislope * uirangeL;\n sliderRange.begin = Math.round(rangeL);\n sliderRange.end = Math.round(rangeL + rangeW);\n\n //Fire change listeners\n changeListeners.forEach(function (callback) {\n callback({begin: sliderRange.begin, end: sliderRange.end});\n });\n }", "title": "" }, { "docid": "2ba6041991d315d6d6a79ebf439560ab", "score": "0.61177135", "text": "update(){\n\t\t//returns if the item no longer needs to move around\n\t\tif(this.staticPos)\n\t\t\treturn;\n\t\t\n\t\t//adds a segment to the tracer\n\t\tthis.currentTracer.trace(this.pos);\n\t\t\n\t\t//calls inherited update method\n\t\tsuper.update();\n\t\t\n\t\tthis.applyGravity();\n\t}", "title": "" }, { "docid": "10d2269c970ce34ac12a31640ddc32ce", "score": "0.6093572", "text": "function update_position(selection) {\n\t\tselection.attr({\n\t\t\twidth: function (datum, index) { return datum.width = (datum.duration / total_duration) * innerWidth },\n\t\t x: function (d,i) { return d.x = prev(d.position).width + prev(d.position).x }\n\t\t})\n\t}", "title": "" }, { "docid": "b1bd6528613fb67ae06993f672ae19ec", "score": "0.6089978", "text": "function updateSlider() {\r\n \r\n }", "title": "" }, { "docid": "a643c1935c99d7d3f3829a2b4a16226f", "score": "0.6083099", "text": "function animate(last){\n if(isIncrease) {\n ov += delta;\n }else{\n ov -= delta;\n }\n\n if ((isIncrease && ov >= nv) || (!isIncrease && ov <= nv)) {\n requestAnimFrame(function () {\n\n scope.$apply(function(){\n scope.value = Math.round(nv);\n });\n });\n return;\n }\n\n requestAnimFrame(function () {\n scope.$apply(function(){\n scope.value = Math.round(ov);\n });\n });\n\n var now = Date.now(),\n deltaTime = now - last;\n\n if (deltaTime >= stepDuration) {\n animate(now);\n } else {\n setTimeout(function () {\n animate(Date.now());\n }, stepDuration - deltaTime);\n }\n }", "title": "" }, { "docid": "c53811e80da67a44e1e725605840b1fe", "score": "0.60129887", "text": "update() {\r\n this.size += 5;\r\n }", "title": "" }, { "docid": "a6b5b0664f0f6426f0c98781c3dd7afe", "score": "0.59977216", "text": "update_(entry) {\n dev().assert(this.adjustedViewportHeight_);\n // outside viewport\n if (!entry.positionRect ||\n entry.positionRect.top > this.adjustedViewportHeight_) {\n return;\n }\n\n // User provided factor is 1-based for easier understanding.\n // Also negating number since we are using tranformY so negative = upward,\n // positive = downward.\n const adjustedFactor = -(this.factor_ - 1);\n const top = entry.positionRect.top;\n // Offset is how much extra to move the element which is position within\n // viewport times adjusted factor.\n const offset = (this.adjustedViewportHeight_ - top) * adjustedFactor;\n\n // Translate the element offset pixels.\n // No need for vsync mutate, position observer only calls back at most\n // every animation frame and we are only changing `translate` which does\n // not cause relayouts.\n setStyles(this.element_,\n {transform: `translateY(${offset.toFixed(0)}px)`}\n );\n }", "title": "" }, { "docid": "4dffa59cf32611e19b7af23e52af4c32", "score": "0.59669596", "text": "function setCircumference(event, incrementModifier) {\r\n let rangeHTMLParts = rangeCircleDiv.children();\r\n\r\n let line, circle,distance;\r\n\r\n //change for grow and shrink\r\n if(event.deltaY < 0) {\r\n incrementModifier[0] = 0 - incrementModifier[0];\r\n incrementModifier[1] = 0 - incrementModifier[1];\r\n }\r\n\r\n for(let i = 0; i< rangeHTMLParts.length; i++){\r\n if(selected.idName.slice(7, 8) === rangeHTMLParts[i].id.split('-')[0].slice(7,8)){\r\n line = rangeHTMLParts[i];\r\n circle = rangeHTMLParts[i+1];\r\n distance = rangeHTMLParts[i+2];\r\n break;\r\n }\r\n }\r\n if(selected.range >= 0 ) {\r\n //prevents neg range numbers\r\n if (selected.range + incrementModifier[0] < 0) {\r\n selected['range'] = 0;\r\n } else {\r\n selected['range'] += incrementModifier[0];\r\n\r\n line.style.width = ((selected.range/2)-1)+'px';\r\n\r\n circle.style.width = selected.range+'px';\r\n circle.style.height = selected.range+'px';\r\n\r\n circle.style.top = (parseInt(circle.style.top.split(\"px\")[0]) - incrementModifier[1])+'px';\r\n circle.style.left = (parseInt(circle.style.left.split(\"px\")[0]) - incrementModifier[1])+'px';\r\n\r\n distance.innerHTML = selected.range/2 + ' km';\r\n\r\n document.getElementById('rangeSize').innerHTML = (selected.range/2).toString();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0cc006a169e125711f2cf017fac5e268", "score": "0.5952323", "text": "update() {\n // move its position\n // etc.\n }", "title": "" }, { "docid": "f2bab2af22f35e40470c5d518524da7d", "score": "0.59356624", "text": "update () {\n super.update();\n\n }", "title": "" }, { "docid": "72e855fc8418d54488cc7dd85cd40112", "score": "0.593135", "text": "update() {\n this.breathe();\n\n this.animateNegativeChildren();\n }", "title": "" }, { "docid": "63b9c95be4954077cee287ff897fe930", "score": "0.5905653", "text": "updateDimensions() {\n let left = this.element.offsetLeft;\n // this is the true current width\n // it is used to calculate the ink bar position\n let currentWidth = this.element.offsetWidth;\n this.setProperties({ left, currentWidth });\n }", "title": "" }, { "docid": "4ca8ce335088027278b475a21f8e1ec0", "score": "0.5885292", "text": "update(delta) {\n super.update(delta);\n this.originX = this.width / 2;\n this.originY = this.height / 2;\n }", "title": "" }, { "docid": "c796d0aeb81a09146d466c4a3ec114e2", "score": "0.585786", "text": "setPublicRect () { // 计算所有矩形区域\n const count = this.config.range\n let spaceX\n\n this.rectChart = offsetRect(this.rectMain, this.layout.margin)\n\n let start, stop, spaceY\n if (this.config.direct === 'horizontal') {\n spaceX = this.rectMain.width / (count - 1)\n spaceY = this.rectMain.height - this.scale * 2\n start = this.rectMain.left + spaceX * this.config.select.min\n stop = this.rectMain.left + spaceX * this.config.select.max\n if (this.config.shape === 'free') {\n this.rectMin = {\n left: start - this.layout.scroll.size / 2,\n top: this.rectMain.top + this.scale,\n width: this.layout.scroll.size,\n height: spaceY\n }\n this.rectMax = {\n left: stop - this.layout.scroll.size / 2,\n top: this.rectMain.top + this.scale,\n width: this.layout.scroll.size,\n height: spaceY\n }\n this.rectMid = {\n left: start + this.layout.scroll.size / 2,\n top: this.rectMain.top + this.scale,\n width: stop - start - this.layout.scroll.size,\n height: spaceY\n }\n } else {\n this.rectMid = {\n left: start,\n top: this.rectMain.top + this.scale,\n width: stop - start,\n height: spaceY\n }\n }\n } else {\n // spaceX = this.rectMain.height / (count - 1);\n // spaceY = this.rectMain.width - this.scale * 2;\n // start = this.rectMain.top + spaceX * this.config.select;\n // stop = this.rectMain.top + spaceX * this.config.select;\n }\n }", "title": "" }, { "docid": "4e8508d9fc420da95a90c6f723ec8e88", "score": "0.5856444", "text": "function update() {\n var snap = $snap.prop(\"checked\"),\n liveSnap = $liveSnap.prop(\"checked\");\n\tDraggable.create(\".button\", {\n\t\tbounds:$zoomwrapper,\n\t\tedgeResistance:0.65,\n\t\ttype:\"x,y\",\n\t\tthrowProps:true,\n\t\tliveSnap:liveSnap,\n\t\tsnap:{\n\t\t\tx: function(endValue) {\n\t\t\t\treturn (snap || liveSnap) ? Math.round(endValue / gridWidth) * gridWidth : endValue;\n\t\t\t},\n\t\t\ty: function(endValue) {\n\t\t\t\treturn (snap || liveSnap) ? Math.round(endValue / gridHeight) * gridHeight : endValue;\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6ae22f0bd71248eaaa9d9c463063dab8", "score": "0.58480096", "text": "update() {\n this.element.style = {};\n this.element.update();\n this.element.controller.onupdate(0, 0.999999);\n this.element.controller.selector.style.width = \"calc(100% - 8px)\";\n }", "title": "" }, { "docid": "c3cde224012fc4e71bcf154f558bfb9e", "score": "0.58469903", "text": "refresh() {\n\n if (this.count === 0) return\n\n // Common ratios for converting between coordinate systems.\n\n this.dw_sw = this.count / container.scrollWidth\n this.sw_dw = container.scrollWidth / this.count\n this.sw_cw = container.scrollWidth / container.clientWidth\n this.cw_sw = container.clientWidth / container.scrollWidth\n\n // Catch should exceed throw; else, system oscillates.\n\n const hiddenWidth = container.scrollWidth - container.clientWidth\n this.bias.throw = this.bias.threshold.throw * hiddenWidth\n this.bias.catch = this.bias.threshold.catch * hiddenWidth\n }", "title": "" }, { "docid": "4f32fe6bfc8a8596a0150a8d0b62b4de", "score": "0.5841468", "text": "update() {\n let newX = this.following.pointAt.x - this.center.x;\n let newY = this.following.pointAt.y - this.center.y;\n\n this.elm.setAttribute(\"x\", newX);\n this.elm.setAttribute(\"y\", newY);\n\n //FIXME - This works for this animation, but only checks if the object has passed it's x or y. This should be changed to a better proximity detector.\n if (newX > this.basePosition.x || newY > this.basePosition.y) {\n this.pastStart = true;\n }\n }", "title": "" }, { "docid": "130def457a21794a82ebee17c49d7eac", "score": "0.5826903", "text": "function Slider(prefix,dir,dim,progress,add_px)\n\t{\n\t//get block and asign it with events\n\tthis.scroll_left_button = document.getElementsByClassName(prefix+'_scroll_button_left')[0];\n\tthis.scroll_right_button = document.getElementsByClassName(prefix+'_scroll_button_right')[0];\n\tthis.container = document.getElementsByClassName(prefix+'_item_container')[0];\n\tthis.container_visible = document.getElementsByClassName(prefix+'_block')[0]; //to calculate margin distance for moving\n\ttry\n\t\t{\n\t\tthis.progress_bar = document.getElementsByClassName(prefix+'_progress_bar')[0]; //for progress bar \n\t\tthis.progress_bar_feel = this.progress_bar.getElementsByClassName(prefix+'_feel')[0];\t\t\t\n\t\t}\n\tcatch(err){};\n\n\t\t\n\tvar obj = this; //nessesary for passing OBJECT for next functions\n\t\n\n\tthis.scroll_left_button.addEventListener('click',function() {obj.move_left()},false);\n\tthis.scroll_right_button.addEventListener('click',function() {obj.move_right()},'false');\n\tthis.container.addEventListener('mousedown',function(event) {obj.touch_click_on(event);event.preventDefault();},false);\n\tthis.container.addEventListener('mouseup',function(event) {obj.touch_click_off(event)},false);\n\tthis.container.addEventListener('mousemove',function(event) {obj.mouse_move(event)},false);\n\n\t//for touch events add new listener\n\n\tthis.container.addEventListener('touchstart',function(event) {obj.touch_click_on(event);event.preventDefault()},false);\n\tthis.container.addEventListener('touchend',function(event) {obj.touch_click_off(event);event.preventDefault()},false);\n\tthis.container.addEventListener('touchmove',function(event) {obj.mouse_move(event);event.preventDefault(); return false;},false);\n\n\n\n\tthis.prefix = prefix;\n\t\n\tthis.dir = dir; //direction X - horizontal, Y - vertical\n\tthis.dim = dim; // dimensions px - pixels, % - interests\n\tthis.add_px = add_px; //add pixels to distanse between items\n\n\tthis.cur_transX = 0; //current translate X value\n\tthis.cur_transY = 0; //current translate Y value;\n\tthis.cur_transY_tmp = 0; //using for previous value of transX.Y during mousemoving\n\tthis.cur_transX_tmp = 0;\n\n\tthis.cur_mouse_flag = 'stop'; //flag for touch scroll activation\n\tthis.cur_mouseX = 0; //current mouse coordinates (retrives from listener when flag !=stop)\n\tthis.cur_mouseY = 0; \n\tthis.onclick_mouseX = 0; //coordinates of mouse cursor when mouse buttons had pressed\n\tthis.onclick_mouseY = 0;\t\n\t\n\tthis.container_height = 0; //is determinig during set_container_size execution\n\tthis.container_width = 0; //nessesary to know margin top and left distance\n\tthis.container_X_width = 0; //width of block, using for screen size changing (width of visible container on load page moment)\n\n\n\tthis.max_left = 0; //max left - max dis for move to the end on X (set cont size)\n\tthis.max_top = 0; //max top - max distance for moving to the down on Y line \n\tthis.innertion_array = []; //array for innertion\n\tthis.innertion_array_time = [] //array with time\n\tthis.innertion_prev_time = 0; //previous timestamp\n\tthis.innertion_prev_trans = 0; //previous cur_transX\n\tthis.innertion_items=5; //kolvo items in array for avg speed calculations\n\n/// train with speed\n\tthis.prev_time = 0;\n\tthis.progress_bar_par = progress; //\"on\" - parametr to switch on progress bar animate\n\tthis.feel_width = 0; // width of feeling div from progress bar (X line) in %%\n\tthis.feel_height = 0; // height of feeling div from progress bar (Y line in %%)\n\tthis.pb_length = 0; //length of progress bar (by X or by Y) \n\n\t/////////////////////////\n\n\tthis.move_left = function()\n\t\t{\n\n\t\tthis.check_container_size(); // it to keep actual block size when screen size changing\n\t\t//for click efect\n\t\tthis.scroll_left_button.className += ' '+this.prefix+'_scroll_button_left_click';\n\n\t\tthis.id_timer = setInterval(\n\t\t\tfunction()\n\t\t\t{\n\t\t\tobj.scroll_left_button.className = obj.prefix+'_scroll_button_left';clearInterval(obj.id_timer);\n\t\t\t},100)\n\n\n\t\t//forsmoth moving\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tif (this.cur_transX==0) //for spring\n\t\t\t\t{\n\t\t\t\tback_ = function()\n\t\t\t\t\t{\n\t\t\t\t\tobj.transition_on_off(0.2);\n\t\t\t\t\tobj.container.style['left'] = '0px';\n\t\t\t\t\tclearInterval(obj.id_ttt);\n\t\t\t\t\t}\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['left'] = '50px';\n\t\t\t\tthis.id_ttt = setInterval(back_,100);\n\t\t\t\t}\n\t\t\telse //simple moving by X\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(1);\n\t\t\t\tthis.move_by(200);\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (this.cur_transY==0) //for spring\n\t\t\t\t{\n\t\t\t\tback_ = function()\n\t\t\t\t\t{\n\t\t\t\t\tobj.transition_on_off(0.2);\n\t\t\t\t\tobj.container.style['top'] = '0px';\n\t\t\t\t\tclearInterval(obj.id_ttt);\n\t\t\t\t\t}\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['top'] = '50px';\n\t\t\t\tthis.id_ttt = setInterval(back_,100);\n\t\t\t\t}\n\t\t\telse //simple moving by Y\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(1);\n\t\t\t\tthis.move_by(200);\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\n\tthis.move_right = function()\n\t\t{\n\t\tthis.check_container_size(); // it to keep actual block size when screen size changing\n\n\t\t//for click effect\n\t\tthis.scroll_right_button.className += ' '+this.prefix+'_scroll_button_right_click';\n\t\tthis.id_timer = setInterval(\n\t\t\tfunction()\n\t\t\t{\n\t\t\tobj.scroll_right_button.className = obj.prefix+'_scroll_button_right';clearInterval(obj.id_timer);\n\t\t\t},100)\n\t\t\n\n\t\t//for smoth\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tif (this.cur_transX==-this.max_left) //for spring\n\t\t\t\t{\n\t\t\t\tback_ = function()\n\t\t\t\t\t{\n\t\t\t\t\tobj.transition_on_off(0.2);\n\t\t\t\t\tobj.container.style['left'] = -obj.max_left+'px';\n\t\t\t\t\tclearInterval(obj.id_ttt);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\td = -this.max_left-50;\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['left'] = d+'px';\n\t\t\t\tthis.id_ttt = setInterval(back_,100);\n\t\t\t\t}\n\t\t\telse //simple moving by X\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(1);\n\t\t\t\tthis.move_by(-200);\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (this.cur_transY==-this.max_top) //for spring\n\t\t\t\t{\n\t\t\t\tback_ = function()\n\t\t\t\t\t{\n\t\t\t\t\tobj.transition_on_off(0.2);\n\t\t\t\t\tobj.container.style['top'] = -obj.max_top+'px';\n\t\t\t\t\tclearInterval(obj.id_ttt);\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\td = -obj.max_top-50;\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['top'] = d+'px';\n\t\t\t\tthis.id_ttt = setInterval(back_,100);\n\t\t\t\t}\n\t\t\telse //simple moving by Y\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(1);\n\t\t\t\tthis.move_by(-200);\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\n\tthis.touch_click_on = function(e)\n\t\t{\n\t\tthis.check_container_size(); // it to keep actual block size when screen size changing\n\t\tif (!e) {e = window.event}\n\t\ttry //for touches\n\t\t\t{\n\t\t\n\t\t\tthis.innertion('start'); //for innertion (initial prev variables)\n\t\n\t\t\tt = e.changedTouches[0];\n\t\t\tthis.onclick_mouseY = t.clientY;\n\t\t\tthis.onclick_mouseX = t.clientX;\n\t\t\tthis.cur_mouse_flag = 'start';\n\t\t\tthis.cur_transX_tmp = this.cur_transX;\n\t\t\tthis.cur_transY_tmp = this.cur_transY;\n\n\t\t\t}\n\t\tcatch(err)\n\t\t\t{\n\t\t\tthis.innertion('start'); //for innertion (initial prev variables)\n\n\t\t\tthis.onclick_mouseX = e.clientX;\n\t\t\tthis.onclick_mouseY = e.clientY;\n\t\t\tthis.cur_mouse_flag = 'start';\n\t\t\tthis.cur_transX_tmp = this.cur_transX;\n\t\t\tthis.cur_transY_tmp = this.cur_transY;\n\t\t\t}\n\n\t\t}\n\n\tthis.touch_click_off = function(e)\n\t\t{\n\n\t\tif (!e) {e = window.event}\n\t\tthis.cur_mouse_flag = 'stop';\n\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tif (this.cur_transX>0) //spring\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['left'] = '0px'; \n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\tthis.cur_transX = 0;\n\t\t\t\t}\n\t\t\tif (this.cur_transX>=-this.max_left-50&this.cur_transX<-this.max_left)\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['left'] = -this.max_left;\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\tthis.cur_transX = -this.max_left;\n\t\t\t\t}\n\n\t\t\tif (this.cur_transX>-this.max_left&this.cur_transX<0)\n\t\t\t\t{\n\t\t\t\tspeed = this.innertion('stop'); //for innertion\n\t\t\t\tdis = speed*300*0.7;\n\t\t\t\tif (dis!=0)\n\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tthis.transition_on_off(1);\n\t\t\t\t\tthis.move_by(dis);\n\t\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\telse\n\t\t\t{\n\t\t\tif (this.cur_transY>0) //spring\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['top'] = '0px';\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\tthis.cur_transY = 0;\n\t\n\t\t\t\t}\n\t\t\tif (this.cur_transY>=-this.max_top-50&this.cur_transY<-this.max_top)\n\t\t\t\t{\n\t\t\t\tthis.transition_on_off(0.2);\n\t\t\t\tthis.container.style['top'] = -this.max_top;\n\t\t\t\tthis.transition_on_off(0);\n\t\t\t\tthis.cur_transY = -this.max_top;\n\t\n\t\t\t\t}\n\t\t\tif (this.cur_transY>-this.max_top&this.cur_transY<0)\n\t\t\t\t{\n\t\t\t\tspeed = this.innertion('stop'); //for innertion\n\t\t\t\tdis = speed*300*0.7;\n\t\t\t\tif (dis!=0)\n\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tthis.transition_on_off(1);\n\t\t\t\t\tthis.move_by(dis);\n\t\t\t\t\tthis.transition_on_off(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t}\n\n\t\t}\n\n\n\t\n\n\n//////////////////////////////\n\n\tthis.set_container_size = function() //fit size of container, by X or Y, add_px - add_px to each item\n\t\t{\n\t\t//get item container size\n\t\tarray_items = document.getElementsByClassName(prefix+'_item')\n\t\tlen_arr = array_items.length;\n\t\tlen_itemX = array_items[0].offsetWidth;\n\t\tlen_itemY = array_items[0].offsetHeight;\n\n\t\tif (this.dir=='X')\n\t\t\t{\n\n\t\t\tif (this.container_visible.offsetWidth!=this.container_X_width)\n\t\t\t\t{\n\t\t\t\tthis.container_X_width = this.container_visible.offsetWidth;\n\t\t\t\t}\n\n\t\t\tthis.container_width = len_arr*(len_itemX+this.add_px);\n\t\t\tthis.container.style.width = this.container_width+'px';\n\t\t\tthis.max_left = this.container_width - this.container_visible.offsetWidth;\n\t\t\t}\n\n\t\telse\n\t\t\t{\n\n\t\t\t//width of items may be different because text may lay verticaly caused screen declining and different items can havedifferent desciption\n\n\t\t\tvar total_width\t=0;\n\t\t\tfor (i=0;i<len_arr;i=i+1)\n\t\t\t\t{total_width = total_width+array_items[i].offsetHeight}\n\n\t\t\t\n\t\t\tthis.container_height = len_arr*(this.add_px)+total_width+30; //30px is height of free item above all other items (under top line), also you need to correct check_size() function\n\t\t\tthis.container.style.height = this.container_height+'px';\n\t\t\tthis.max_top = this.container_height - this.container_visible.offsetHeight;\n\t\t\t\n\t\t\t}\n\n\n\t\t//set progress bar height or width\n\t\tif (this.dir=='X'&this.progres_bar_par=='on')\n\t\t\t{\n\t\t\tdif_koef = this.max_left/this.container_width;\n\t\t\tthis.feel_width = 1 - dif_koef;\t\t\t\n\t\t\tthis.progress_bar_feel.style['width'] = this.feel_width*100+'%';\n\t\t\tthis.pb_length = this.progress_bar.offsetWidth;\t\n\t\t\t}\n\t\n\t\tif (this.dir=='Y'&this.progress_bar_par=='on')\n\t\t\t{\n\t\t\tdif_koef = this.max_top/this.container_height;\n\t\t\tthis.feel_height = 1 - dif_koef;\t\t\t\n\t\t\tthis.progress_bar_feel.style['height'] = this.feel_height*100+'%';\n\t\t\tthis.pb_length = this.progress_bar.offsetHeight;\t\n\t\t\t}\n\n\t\t//set no-selection for all images in container\n\t\tfor (i=0;i<len_arr;i=i+1)\n\t\t\t{\n\t\t\timages = array_items[i].getElementsByTagName('img');\n\t\t\tkolvo_img = images.length;\n\t\t\tfor (k=0;k<kolvo_img;k=k+1)\n\t\t\t\t{\n\t\t\t\timg_ = images[k];\n\t\t\t\timg_.addEventListener('mousedown',function(event){event.preventDefault()},false)\t\t\n\t\n\t\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t}\n\n\tthis.set_container_size() //put it to the end of file to provide firtsly initializing of function and next execution;\n\n\n\n\tthis.check_container_size = function() //it is nessesary when window size is changing to keep scrolling (calculation of new block size and free width, it is only for X direction)\n\t\t{\n\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tif (this.container_visible.offsetWidth!=this.container_X_width)\n\t\t\t\t{\n\t\t\t\tthis.max_left = this.container_width - this.container_visible.offsetWidth;\n\t\t\t\tthis.container_X_width = this.container_visible.offsetWidth;\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\n\t\t\t//for y we need to calculate new height in a case of changing screen width, because text push block height\n\t\t\tif (this.container_visible.offsetWidth!=this.container_X_width)\n\t\t\t\t{\n\t\t\t\tarray_items = document.getElementsByClassName(prefix+'_item')\n\t\t\t\tlen_arr = array_items.length;\n\t\t\t\tlen_itemY = array_items[0].offsetHeight;\n\t\t\t\t\n\t\t\t\tvar total_width\t=0;\n\t\t\t\tfor (i=0;i<len_arr;i=i+1)\n\t\t\t\t\t{total_width = total_width+array_items[i].offsetHeight}\n\n\t\t\t\n\t\t\t\tthis.container_height = len_arr*(this.add_px)+total_width+30;\n\t\t\t\tthis.container.style.height = this.container_height+'px';\n\t\t\t\tthis.max_top = this.container_height - this.container_visible.offsetHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}\n\n\n\n\n\tthis.innertion = function(status_)\n\t\t{\n\t\n\t\tif (status_=='start')\n\t\t\t{\n\t\t\tthis.innertion_array = []; //new inner masiv for distansecollection\n\t\t\tthis.innertion_array_time = [] //new array for time collection\n\t\t\tthis.innertion_prev_time = new Date().getTime();\n\t\t\tif (this.dir=='X')\n\t\t\t\t{\n\t\t\t\tthis.innertion_prev_trans = this.cur_transX;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tthis.innertion_prev_trans = this.cur_transY;\n\t\t\t\t}\n\t\t\t}\n\n\t\n\t\tif (status_=='moving')\n\t\t\t{\n\t\t\tif (this.dir=='X')\n\t\t\t\t{\n\t\t\t\tdif = this.cur_transX-this.innertion_prev_trans;\n\t\t\t\tthis.innertion_prev_trans = this.cur_transX;\n\t\t\t\tcur_time = new Date().getTime();\n\t\t\t\ttime_dif = cur_time - this.innertion_prev_time;\n\t\t\t\tthis.innertion_prev_time = cur_time;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tdif = this.cur_transY-this.innertion_prev_trans;\n\t\t\t\tthis.innertion_prev_trans = this.cur_transY;\n\t\t\t\tcur_time = new Date().getTime();\n\t\t\t\ttime_dif = this.innertion_prev_time - cur_time;\n\t\t\t\tthis.innertion_prev_time = cur_time;\n\t\t\t\t}\n\n\t\t\tthis.innertion_array.push(dif);\n\t\t\tthis.innertion_array_time.push(time_dif);\n\t\t\t}\n\t\telse //stop\n\t\t\t{\n\t\t\tlen = this.innertion_array.length;\n\t\t\ttotal_time = 0;\n\t\t\ttotal_dis = 0;\n\t\t\tfor (i=0;i<this.innertion_items;i=i+1)\n\t\t\t\t{\n\t\t\t\ttotal_dis = total_dis+Math.abs(this.innertion_array[len-1-i]);\n\t\t\t\ttotal_time = total_time+Math.abs(this.innertion_array_time[len-1-i]);\n\t\t\t\t\n\t\t\t\t}\n\t\t\tlast_dis = this.innertion_array[len-1]; \n\t\t\tspeed = total_dis/total_time;\n\t\t\tif (last_dis>0)\n\t\t\t\t{\n\t\t\t\tspeed = speed;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tspeed = -speed;\n\t\t\t\t}\n\t\t\tif (this.innertion_array.length<this.innertion_items)\n\t\t\t\t{speed=0}\n\t\t\tthis.innertion_array = [];\n\t\t\tthis.innertion_array_time = [];\n\t\t\treturn speed;\n\t\t\t}\n\t\t}\n\n\n\n\n\tthis.move_by = function(dis) //obj = this,dis = distance for moving, dim = dimensions:px or %%, dir = direction:'X' or 'Y'\n\t\t{\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tdis_move = dis+this.cur_transX;\n\t\t\tif (dis_move<=-this.max_left)\n\t\t\t\t{dis_move = -this.max_left}\n\t\t\tif (dis_move>=0)\n\t\t\t\t{dis_move = 0}\n\t\t\tthis.container.style['left'] = dis_move+this.dim;\n\t\t\tthis.cur_transX = dis_move;\n\t\t\t\n\t\t\tif(this.progress_bar_par=='on')\n\t\t\t\t{\n\t\t\t\tpb_mv = -this.cur_transX/this.container_width;\n\t\t\t\tpb_mv = pb_mv*this.pb_length;\n\t\t\t\tthis.progress_bar_feel.style['margin'] = '0px 0px 0px '+pb_mv+'px';\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tdis_move = dis+this.cur_transY;\n\t\t\tif (dis_move<=-this.max_top)\n\t\t\t\t{dis_move = -this.max_top}\n\t\t\tif (dis_move>=0)\n\t\t\t\t{dis_move = 0}\n\n\t\t\tthis.container.style['top'] = dis_move+this.dim;\n\t\t\tthis.cur_transY = dis_move;\n\t\t\tif(this.progress_bar_par=='on') //for progress bar moving\n\t\t\t\t{\n\t\t\t\tpb_mv = -this.cur_transY/this.container_height;\n\t\t\t\tpb_mv = pb_mv*this.pb_length; //calculate in pixels length\n\t\t\t\tthis.progress_bar_feel.style['margin'] = pb_mv+'px 0px 0px -1px';\n\t\t\t\t}\n\t\t\t}\n\n\t\n\t\t}\n\n\tthis.move_by(0); //this is nessesary to provide smoth moving from the first click\n\n\tthis.transition_on_off = function(speed)\n\t\t{\n\t\tthis.container.offsetHeight;\n\t\tif (this.dir=='X')\n\t\t\t{\n\t\t\tthis.container.style['transition'] = 'left '+speed+'s ease';\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tthis.container.style['transition'] = 'top '+speed+'s ease';\n\t\t\tthis.container.style['-moz-transition'] = 'top '+speed+'s ease';\n}\n\t\t}\n\n\n\n\t//mouse move listener, translate in specific direction by move px\n\tthis.mouse_move = function(e)\n\t\t{\n\t\t\n\t\tif (obj.cur_mouse_flag!='stop')\n\t\t\t{\n\t\t\tif (!e) e = window.event;\n\t\t\ttry\n\t\t\t\t{\n\t\t\t\tt = e.changedTouches[0]\n\t\t\t\tobj.cur_mouseX = t.clientX;\n\t\t\t\tobj.cur_mouseY = t.clientY;\n\t\t\t\t}\n\t\t\tcatch(err)\n\t\t\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\tobj.cur_mouseX = e.clientX; \n\t\t\t\tobj.cur_mouseY = e.clientY;\t\t\n\t\t\t\t}\n\t\t\n\t\n\t\t\tif (this.dir=='X')\n\t\t\t\t{\n\t\t\t\tdif = obj.cur_mouseX - obj.onclick_mouseX;\n\n\t\t\t\tdif = dif/1;\n\t\t\t\tdif = dif.toFixed(0);\n\t\t\t\tdif = dif*1;\n\n\t\t\t\tmove_dif = obj.cur_transX_tmp+dif;\n\t\t\t\tif (move_dif<=-this.max_left-50)\n\t\t\t\t\t{\n\t\t\t\t\tmove_dif = -this.max_left-50;\n\t\t\t\t\tthis.container.style['left'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transX = move_dif;\n\t\t\t\t\treturn false;\t\n\t\t\t\t\t}\n\t\t\t\n\t\t\t\tif (move_dif>=50) //check if if edge has riched\n\t\t\t\t\t{\n\t\t\t\t\tmove_dif = 50;\n\t\t\t\t\tthis.container.style['left'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transX = move_dif;\n\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tthis.container.style['left'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transX = move_dif;\n\t\t\t\t\tthis.innertion('moving'); //for innertion pass distance (loging)\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif<=0&move_dif>=-this.max_left)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tpb_mv = -this.cur_transX/this.container_width;\n\t\t\t\t\t\tpb_mv = pb_mv*this.pb_length;\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = '0px 0px 0px '+pb_mv+'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif>=0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = '0px 0px 0px -1px';\n\t\t\t\t\t\t}\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif<=-this.max_left)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tpb_mv = (1-this.feel_width)*this.pb_length;\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = '0px 0px 0px '+pb_mv+'px';\n\t\t\t\t\t\t}\t\n\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tdif = obj.cur_mouseY - obj.onclick_mouseY;\n\t\t\t\tdif = dif/1;\n\t\t\t\tdif = dif.toFixed(0);\n\t\t\t\tdif = dif*1;\n\t\t\t\t\n\t\t\t\tmove_dif = obj.cur_transY_tmp+dif;\n\t\t\t\tif (move_dif<=-this.max_top-50)\n\t\t\t\t\t{\n\t\t\t\t\tmove_dif = -this.max_top-50;\n\t\t\t\t\tthis.container.style['top'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transY = move_dif;\n\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\tif (move_dif>=50) //checkinf if edge has riched \n\t\t\t\t\t{\n\t\t\t\t\tmove_dif = 50;\n\t\t\t\t\tthis.container.style['top'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transY = move_dif;\n\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\tthis.container.style['top'] = move_dif+this.dim;\n\t\t\t\t\tthis.cur_transY = move_dif;\n\t\t\t\t\tthis.innertion('moving'); //for innertion pass distance\t(loging)\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif<=0&move_dif>=-this.max_top)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tpb_mv = -this.cur_transY/this.container_height;\n\t\t\t\t\t\tpb_mv = pb_mv*this.pb_length;\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = pb_mv+'px 0px 0px -1px';\n\t\t\t\t\t\t}\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif>=0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = '0px 0px 0px -1px';\n\t\t\t\t\t\t}\n\t\t\t\t\tif (this.progress_bar_par=='on'&move_dif<=-this.max_top)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tpb_mv = (1-this.feel_height)*this.pb_length;\n\t\t\t\t\t\tthis.progress_bar_feel.style['margin'] = pb_mv+'px 0px 0px -1px';\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\n\n\t\t\t\n\n\t\t\t}\n\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "690730c1a030d16f6123834d47259be0", "score": "0.58259475", "text": "update() {\n let instance = this;\n let {widget, container, scrollBody} = instance;\n let {clientWidth, scrollWidth} = container;\n widget.style.width = `${clientWidth}px`;\n if (!scrollBody) {\n widget.style.left = `${container.getBoundingClientRect().left}px`;\n }\n widget.firstElementChild.style.width = `${scrollWidth}px`;\n // Fit widget height to the native scroll bar height if needed\n if (scrollWidth > clientWidth) {\n widget.style.height = `${widget.offsetHeight - widget.clientHeight + 1}px`; // +1px JIC\n }\n instance.syncWidget();\n instance.checkVisibility(); // fixes issue Amphiluke/floating-scroll#2\n }", "title": "" }, { "docid": "e842c8ef57f92c2ca883c29ab2435a46", "score": "0.58251977", "text": "function update() {\n me.stop(); // determine interval to refresh\n\n var scale = me.body.range.conversion(me.body.domProps.center.width).scale;\n var interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n me.redraw();\n me.body.emitter.emit('currentTimeTick'); // start a renderTimer to adjust for the new time\n\n me.currentTimeTimer = setTimeout$2(update, interval);\n }", "title": "" }, { "docid": "f854eae65229a514e9b8e2d65fbff4a6", "score": "0.5823575", "text": "function redrawSlider() {\n // Redraws the scrollbars against new content height\n contentHeight = node.get('.scroll-content').height();\n sliderSize = (height/contentHeight); \n sliderSize = sliderSize * height; \n\t\t\t\t\n if (sliderSize < 40) { sliderSize = 40; } // Fix min height - design guide\n if (sliderSize > 88) { sliderSize = 88; } // Fix max height - design guide \n Slider.element.get('.slider-handle').height(sliderSize); \n Slider._handleSize = sliderSize;\n Slider._pixelsPerVal = ((Slider._trackSize - Slider._handleSize) / 100);\n\n // Arrow positioned this way since IE doesn't do opacity of child elements with position: absolute\n bottomArrowMargin = sliderSize - Slider.element.get('.slider-handle-hover span').height();\n Slider.element.get('.slider-handle-hover span').css('margin-top', bottomArrowMargin); \n }", "title": "" }, { "docid": "2143fe84b55bcc9d3a38527cdc53f9dc", "score": "0.58141404", "text": "updateDimensions() {\n\n const { page } = this.state\n\n this.width = this.el.clientWidth\n const posX = -(this.width * page)\n\n if (this.carouselEl) {\n // hardware accelerated transforms for the carousel\n this.carouselEl.style[animate.format('transform')] = `translateX(${ posX }px)`\n }\n\n }", "title": "" }, { "docid": "962a5cf40a916ee74b873c1a5e595bc7", "score": "0.58112013", "text": "updateAnimation() {\n return;\n\n // NOTE: This is just in place so you'll be able to call updateAnimation()\n // on geometry that don't animate. No need to change anything.\n }", "title": "" }, { "docid": "962a5cf40a916ee74b873c1a5e595bc7", "score": "0.58112013", "text": "updateAnimation() {\n return;\n\n // NOTE: This is just in place so you'll be able to call updateAnimation()\n // on geometry that don't animate. No need to change anything.\n }", "title": "" }, { "docid": "a7807b6255108b1e08b8708037ad23d3", "score": "0.57827944", "text": "_updateValueFromPosition(pos) {\n if (!this._sliderDimensions) {\n return;\n }\n let offset = this.vertical ? this._sliderDimensions.top : this._sliderDimensions.left;\n let size = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;\n let posComponent = this.vertical ? pos.y : pos.x;\n // The exact value is calculated from the event and used to find the closest snap value.\n let percent = this._clamp((posComponent - offset) / size);\n if (this._shouldInvertMouseCoords()) {\n percent = 1 - percent;\n }\n // Since the steps may not divide cleanly into the max value, if the user\n // slid to 0 or 100 percent, we jump to the min/max value. This approach\n // is slightly more intuitive than using `Math.ceil` below, because it\n // follows the user's pointer closer.\n if (percent === 0) {\n this.value = this.min;\n }\n else if (percent === 1) {\n this.value = this.max;\n }\n else {\n const exactValue = this._calculateValue(percent);\n // This calculation finds the closest step by finding the closest\n // whole number divisible by the step relative to the min.\n const closestValue = Math.round((exactValue - this.min) / this.step) * this.step + this.min;\n // The value needs to snap to the min and max.\n this.value = this._clamp(closestValue, this.min, this.max);\n }\n }", "title": "" }, { "docid": "a7807b6255108b1e08b8708037ad23d3", "score": "0.57827944", "text": "_updateValueFromPosition(pos) {\n if (!this._sliderDimensions) {\n return;\n }\n let offset = this.vertical ? this._sliderDimensions.top : this._sliderDimensions.left;\n let size = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;\n let posComponent = this.vertical ? pos.y : pos.x;\n // The exact value is calculated from the event and used to find the closest snap value.\n let percent = this._clamp((posComponent - offset) / size);\n if (this._shouldInvertMouseCoords()) {\n percent = 1 - percent;\n }\n // Since the steps may not divide cleanly into the max value, if the user\n // slid to 0 or 100 percent, we jump to the min/max value. This approach\n // is slightly more intuitive than using `Math.ceil` below, because it\n // follows the user's pointer closer.\n if (percent === 0) {\n this.value = this.min;\n }\n else if (percent === 1) {\n this.value = this.max;\n }\n else {\n const exactValue = this._calculateValue(percent);\n // This calculation finds the closest step by finding the closest\n // whole number divisible by the step relative to the min.\n const closestValue = Math.round((exactValue - this.min) / this.step) * this.step + this.min;\n // The value needs to snap to the min and max.\n this.value = this._clamp(closestValue, this.min, this.max);\n }\n }", "title": "" }, { "docid": "a7807b6255108b1e08b8708037ad23d3", "score": "0.57827944", "text": "_updateValueFromPosition(pos) {\n if (!this._sliderDimensions) {\n return;\n }\n let offset = this.vertical ? this._sliderDimensions.top : this._sliderDimensions.left;\n let size = this.vertical ? this._sliderDimensions.height : this._sliderDimensions.width;\n let posComponent = this.vertical ? pos.y : pos.x;\n // The exact value is calculated from the event and used to find the closest snap value.\n let percent = this._clamp((posComponent - offset) / size);\n if (this._shouldInvertMouseCoords()) {\n percent = 1 - percent;\n }\n // Since the steps may not divide cleanly into the max value, if the user\n // slid to 0 or 100 percent, we jump to the min/max value. This approach\n // is slightly more intuitive than using `Math.ceil` below, because it\n // follows the user's pointer closer.\n if (percent === 0) {\n this.value = this.min;\n }\n else if (percent === 1) {\n this.value = this.max;\n }\n else {\n const exactValue = this._calculateValue(percent);\n // This calculation finds the closest step by finding the closest\n // whole number divisible by the step relative to the min.\n const closestValue = Math.round((exactValue - this.min) / this.step) * this.step + this.min;\n // The value needs to snap to the min and max.\n this.value = this._clamp(closestValue, this.min, this.max);\n }\n }", "title": "" }, { "docid": "f901bde108347e47975c521a07c1d225", "score": "0.577768", "text": "function updateValues(id,withoutStep){if(!withoutStep){margin=(areaLength-totalLength-itemLength)/2;if(margin<posMin){margin=(areaLength-itemLength)/2;totalLength=0;step++;}}steps[id]=step;margins[step]=$$.isLegendInset?10:margin;offsets[id]=totalLength;totalLength+=itemLength;}", "title": "" }, { "docid": "f901bde108347e47975c521a07c1d225", "score": "0.577768", "text": "function updateValues(id,withoutStep){if(!withoutStep){margin=(areaLength-totalLength-itemLength)/2;if(margin<posMin){margin=(areaLength-itemLength)/2;totalLength=0;step++;}}steps[id]=step;margins[step]=$$.isLegendInset?10:margin;offsets[id]=totalLength;totalLength+=itemLength;}", "title": "" }, { "docid": "680fe485856b0e97544a61025ad7f748", "score": "0.5768539", "text": "action(delta)\n\t{\n\t\tsuper.action(delta);\n\t\tfor (var i = 0; i < this.bricks.length; i++)\n\t\t\tthis.bricks[i].scroll(this.offset.multiply(delta));\n\t}", "title": "" }, { "docid": "27a45777e79c2287c7fef02cac3b5ced", "score": "0.5762934", "text": "_updateSlider() {\n assert( this._range.contains( this._numberProperty.value ), 'numberProperty outside of range of slider' );\n\n // Calculate the percentage that the thumb is across the slider track.\n const percentage = ( this._numberProperty.value - this._range.min ) / this._range.length;\n\n // Update the slider thumb center-x position based on the numberProperty's value.\n this._thumb.centerX = percentage * this._track.width + this._track.left;\n }", "title": "" }, { "docid": "9cb6e7db0abc0b8987474d62fa813297", "score": "0.57621807", "text": "move() {\n this.grow()\n this.shrink()\n }", "title": "" }, { "docid": "16a541d9d78a02d7cb6c57151b89b28a", "score": "0.57542175", "text": "animate() {\n\n const scope = this;\n this.sliderTimer = setInterval(() => {\n\n const nextValue = (scope.sliderValue + 1) % scope.dates.length;\n scope.slider.setValue(nextValue);\n }, 1000);\n }", "title": "" }, { "docid": "1a271215288c62ee326b9d78ed004af3", "score": "0.57500577", "text": "redrawSliderWorkaround() {\n if (!this.matSlider) {\n return;\n }\n this.matSlider.step = this.luxStep - 1;\n setTimeout(() => {\n this.matSlider.step = this.luxStep;\n });\n }", "title": "" }, { "docid": "a1a2e0674f813519c71613d1fc235bb3", "score": "0.57493937", "text": "function sliderUpdate(perc)\r\n{\r\n\tpercent_complete = parseInt(perc);\r\n\textent = percent_complete*(extent_range)/100+min_extent;\r\n\tupdate(false);\r\n}", "title": "" }, { "docid": "06abd33cea9bf63720e7b45e4bafa333", "score": "0.5741729", "text": "setDrawRange(value) {\n this.drawRange = value;\n // console.log('Draw range is value ' + value);\n this.geometry.setDrawRange(0, this.aliveCount * this.drawRange);\n // console.log('Set draw range ' + (this.aliveCount * this.drawRange) );\n }", "title": "" }, { "docid": "d330f47094cda3650a2f50a003d69b85", "score": "0.5740012", "text": "function updateBar (element, maxValue, currentValue)\r\n{\r\n //the rate at with the bar is increased\r\n let dy = element.clientHeight / maxValue;\r\n\r\n //updates the height of the bar by changing its top margin\r\n element.style.marginTop = `${dy * currentValue}px`\r\n \r\n}", "title": "" }, { "docid": "2900babf264406db46bfb69e4912575e", "score": "0.57276917", "text": "function updateWalkSlider(e) {\n walkLengthLabel.innerText = walkLengthSlider.value + \"min\";\n walkLength = walkLengthSlider.value;\n updateCostEstimate();\n}", "title": "" }, { "docid": "81f9c822284ac66dc9e7f0806989d3fb", "score": "0.5726383", "text": "scrollMove(delta){\n this.position.setCurrent(this.position.current + delta * this.position.scroll_ratio);\n this.move();\n }", "title": "" }, { "docid": "4472c59c4188ef78322a6289011a9a71", "score": "0.5713937", "text": "updateViewMetrics() {\n this.leftLimit = 0;\n this.rightLimit = this.calculateRightLimit();\n this.viewportWidth = this.viewport.offsetWidth;\n this.viewportCenter = this.viewportWidth / 2;\n\n const slack = this.viewportWidth / 2;\n\n this.leftLimit = slack;\n this.rightLimit = this.rightLimit + slack;\n\n this.determineChildrensMainAxisCenter();\n }", "title": "" }, { "docid": "5ae3b54c0508cc6ce591c8e223ab6be3", "score": "0.57079077", "text": "update() {\n\t\tthis.paint();\n\t\tthis.move();\n\t}", "title": "" }, { "docid": "eb4720108531be4381de54702984706f", "score": "0.57074624", "text": "function update() {\n me.stopRolling();\n me.rolling = true;\n var interval = me.end - me.start;\n var t = util$1.convert(new Date(), 'Date').valueOf();\n var rollingModeOffset = me.options.rollingMode && me.options.rollingMode.offset || 0.5;\n var start = t - interval * rollingModeOffset;\n var end = t + interval * (1 - rollingModeOffset);\n var options = {\n animation: false\n };\n me.setRange(start, end, options); // determine interval to refresh\n\n var scale = me.conversion(me.body.domProps.center.width).scale;\n interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n me.body.dom.rollingModeBtn.style.visibility = \"hidden\"; // start a renderTimer to adjust for the new time\n\n me.currentTimeTimer = setTimeout$2(update, interval);\n }", "title": "" }, { "docid": "210ce881bef6e67a385c1eda4a92c580", "score": "0.5698441", "text": "animate(timestamp = 0) {\n this.progress = super.animateBase(this, timestamp);\n if (this.progress > 0) { //Only proceed if there is a progress measurement\n let height = this.bHeight * (1 - this.progress); //Progress is a countdown, so reverse the progress to find how tall the bar should be right now\n this.elm.setAttribute(\"height\", height);\n //The height moves in reverse (y @ 0 = top), so find the y where the (current height + y) will put the bottom of the bar at the baseline\n let setLine = (this.bLine - this.fHeight) * this.progress;\n setLine += this.fHeight;\n this.elm.setAttribute(\"y\", setLine);\n } else if (this.progress === 0) { //Reset the bars to their starting positions once the animation is complete\n this.elm.setAttribute(\"height\", this.bHeight);\n this.elm.setAttribute(\"y\", this.fHeight);\n }\n }", "title": "" }, { "docid": "b98e41ca3276808750f400e07e797c12", "score": "0.5687348", "text": "positionSlider(newVal) {\n let slider = this.svgNode.querySelector(\".slider\");\n let rail = this.svgNode.querySelector(\".sliderRail\");\n const newY = rail.y.animVal.value + (1 - (newVal / 127.0)) * rail.height.animVal.value;\n slider.setAttribute('y', newY);\n }", "title": "" }, { "docid": "f75f547344d450106681e9553d42cd83", "score": "0.56861776", "text": "_internalUpdate() {\r\n this._computeSizes();\r\n this._updateInfiniteLoop();\r\n this._computeSlidesPerViewLayout();\r\n this._shiftSlides(this._slides.map(slide => slide.layoutIndex), true);\r\n this._slideTo(this.selected);\r\n this._updatePagination();\r\n this._updateNavigation();\r\n this._updateDragEventListeners();\r\n this._updateSlidesA11y();\r\n this._updateAriaLiveDom();\r\n \r\n this._enableWrapperTransitions();\r\n }", "title": "" }, { "docid": "75c86174730001ac40e53c8b9facdfcc", "score": "0.5661695", "text": "function updateControl() {\n var options = {\n value: scope.value * 1,\n cap: { radius: 7, style: { fill: 'black', stroke: 'none'} },\n pointer: { style: { fill: 'black', stroke: 'none'} },\n face: { style: { fill: 'none', stroke: 'none'} },\n startAngle: 0,\n sweepAngle: 90,\n min: 0,\n max: scope.max * 1,\n tickMajor: { interval: 100000, style: { fill: 'none', stroke: 'none'} },\n tickMinor: { interval: 50000, style: { fill: 'none', stroke: 'none'} },\n labels: { format: function (val) { return Globalize.format(val / 1000, 'n0') + 'k' } },\n origin: { x: 0.8, y: 0.8 },\n height: 140,\n width: 230,\n radius: 125,\n //animation: { enabled: false },\n ranges: [\n {\n startValue: 0,\n endValue: scope.max * 1,\n startWidth: 24,\n endWidth: 24,\n startDistance: 0.5,\n endDistance: 0.5,\n style: { fill: '#ccc', stroke: 'none', opacity: 0.4 }\n }, {\n startValue: 0,\n endValue: scope.value * 1,\n startWidth: 24,\n endWidth: 24,\n startDistance: 0.5,\n endDistance: 0.5,\n style: { fill: scope.color, stroke: 'none' }\n }]\n };\n\n // update/recreate the control\n element.wijradialgauge(options);\n }", "title": "" }, { "docid": "9a0a9fffb0fd5929bb1e54c184aca073", "score": "0.56462485", "text": "updateAnimation() {\n return;\n }", "title": "" }, { "docid": "e27af54873b8d5a2d9cc800dfa72c629", "score": "0.5645518", "text": "updateDim() {\n const { em, el, $el } = this;\n const { style } = el;\n const device = em.getDeviceModel();\n const currW = style.width || '';\n const currH = style.height || '';\n const newW = device ? device.get('width') : '';\n const newH = device ? device.get('height') : '';\n const noChanges = currW == newW && currH == newH;\n style.width = newW;\n style.height = newH;\n this.updateOffset();\n // Prevent fixed highlighting box which appears when on\n // component hover during the animation\n em.stopDefault({ preserveSelected: 1 });\n noChanges ? this.updateOffset() : $el.on(motionsEv, this.updateOffset);\n }", "title": "" }, { "docid": "38dc036edf11003cc8ff2d828161900b", "score": "0.5629217", "text": "updateStep()\n {\n let width = window.innerWidth;\n\n //Check the length of the items to not use a step bigger that the item count\n if(width < 768)\n this.step = 1;\n else if(width < 992 && this.items.length >= 2)\n this.step = 2;\n else if(this.items.length >= 3)\n this.step = 3;\n else\n this.step = this.items.length; \n\n //Reset the slider on width update\n this.page = 0;\n \n this.updateImage();\n }", "title": "" }, { "docid": "77148c406ee156bb2aa70022ebe80faf", "score": "0.5625328", "text": "setRangeSliderPos(newPosition){\n document.querySelector('input[type=range]').value = newPosition;\n this.updateSpeedCount();\n }", "title": "" }, { "docid": "7db8a42b3c82cd672c3d35d9072cbf0a", "score": "0.5617898", "text": "_recalculate() {\n const manualStart = typeof this.options.start !== 'undefined';\n const manualEnd = typeof this.options.end !== 'undefined';\n const duration = this.options.duration;\n let min = Infinity;\n let max = -Infinity;\n this.timelines.forEach((timeline) => {\n if (timeline.start < min) {\n min = timeline.start;\n }\n if (timeline.end > max) {\n max = timeline.end;\n }\n });\n if (!manualStart) {\n this.start = min;\n this._timeSlider.min = min === Infinity ? 0 : min;\n this._timeSlider.value = this._timeSlider.min;\n }\n if (!manualEnd) {\n this.end = max;\n this._timeSlider.max = max === -Infinity ? 0 : max;\n }\n this._stepSize = Math.max(1, (this.end - this.start) / this.options.steps);\n this._stepDuration = Math.max(1, duration / this.options.steps);\n }", "title": "" }, { "docid": "f5d8dddca577f2fc513cef2e216a0a62", "score": "0.5615858", "text": "grow() {\n this.s += this.deltaS;\n }", "title": "" }, { "docid": "2746881cf83f5983133181153bd72bfb", "score": "0.5612042", "text": "function gsSEVupdate() {\n //dirty check if nothing changed return\n if (!dirty.gsSEV) return;\n\n //if there is no item with the class name in the document\n if (!gsSEVitem) {\n console.log(\"Error: Animation targetClassName: \" + targetClassName + \" not found\");\n return false;\n }\n\n //if dirty reset dirty status and run code\n dirty.gsSEV = false;\n\n //min should be when the animation begins and that should be\n //when the bottom of viewport meets top of the element\n var min = Math.abs(gsSEVitem.offsetTop - vh);\n //max should be when element is in view port: three fourths of item height\n //but what if item is very long and 3/4 of it is already greater than vh?\n //take the min of two values: 3/4 of item height if item is short or a fraction value of vh\n var max = Math.round(Math.min(min + (gsSEVitem.offsetHeight*(3/4)), min + (vh*(4/5))));\n\n var norm = clamp(normalize(window.pageYOffset, min, max), 0, 1);\n\n gsSEVanimation.progress(norm);\n\n //debug\n // var text = \"\";\n // text += \"Min: Math.abs(item.offsetTop - vh) = \" + min + \"\\n\";\n // text += \"MaxElement: min + (item.offsetHeight*(3/4)) = \" + (min + (item.offsetHeight*(3/4))) + \"\\n\";\n // text += \"MaxVH: min + (vh*(4/5)) = \" + (min + (vh*(4/5))) + \"\\n\";\n // text += \"Item.offsetTop: \" + item.offsetTop + \"\\n\";\n // text += \"Item.offsetHeight: \" + item.offsetHeight + \"\\n\";\n // text += \"Viewport Height: \" + vh + \"\\n\";\n // text += \"Document Client Height: \" + size + \"\\n\";\n // text += \"Scroll Value: \" + window.pageYOffset + \"\\n\";\n // text += \"Percent Visibility: \" + Math.round(norm * 100) + \"%\";\n\n // console.log(text);\n }", "title": "" }, { "docid": "7e91e037eb1d412723d9b01e7ea270b9", "score": "0.5611416", "text": "update() { }", "title": "" }, { "docid": "83a160788341e855d1d9e6d3bd1466df", "score": "0.5607568", "text": "componentWillUpdate () {\n\t\tlet offset = this.props.fromTop\n\t\tif (offset < 350 ) return this.tl.progress(0)\n\t\tlet position = ((offset - 350) / 350) * 0.4\n\t\t// this.tl.progress(position)\n\t}", "title": "" }, { "docid": "0e8d516363b5414a0f2b004f99046bd3", "score": "0.5605239", "text": "function moveSlider(movement) {\n //accepted range of movement \n if (movement > 7 && movement < 312) {\n slider.style.marginLeft = movement + \"px\"; \n } \n\n //If slider is at start, make sure it does not touch the edge\n else if (movement == 0) {\n slider.style.marginLeft = movement + \"7px\"; \n } \n\n //If slider moves to end, start over\n else if (movement >= 312) {\n slider.style.marginLeft = \"312px\";\n \n //Animation, scale down and fade\n document.getElementsByClassName(\"container\")[0].style.opacity = 0;\n document.getElementsByClassName(\"container\")[0].style.transform = \"scale(0.25, 0.25)\";\n \n //Small delay, don't reload before animation is done\n setTimeout(function() {\n location.reload();\n }, 500);\n }\n}", "title": "" }, { "docid": "b5b2169338cc23b262191ecbf68e0e40", "score": "0.56049895", "text": "animate(timestamp = 0) { //Each ojbect type will have its own type of animation requirements\n this.progress = super.animateBase(this, timestamp);\n this.elm.style.strokeDashoffset = this.lLength * this.progress; //Set line position\n this.pointAt = this.elm.getPointAtLength(this.lLength - this.elm.style.strokeDashoffset);\n }", "title": "" }, { "docid": "02a78050c7632b2c2e543498d885fb3d", "score": "0.5602128", "text": "update() {\n this.x += this.xSpeed;\n this.y += this.ySpeed;\n this.shrink();\n }", "title": "" }, { "docid": "625ea83760c05ef4ccee0e8bc00defc2", "score": "0.5601737", "text": "update() {\n const scroll = window.pageYOffset\n const expand = window.innerHeight\n\n /* Calculate new bounds */\n const offset = this.bounds_.top - scroll\n const height = expand\n - Math.max(0, scroll + expand - this.bounds_.bottom)\n - Math.max(offset, this.offset_)\n\n /* If height changed, update element */\n if (height !== this.height_)\n this.el_.style.height = `${this.height_ = height}px`\n\n /* Sidebar should be locked, as we're below parent offset */\n if (offset < this.offset_) {\n if (!this.el_.dataset.mdLocked)\n this.el_.dataset.mdLocked = \"\"\n\n /* Sidebar should be unlocked, if locked */\n } else if (typeof this.el_.dataset.mdLocked === \"string\") {\n delete this.el_.dataset.mdLocked\n }\n }", "title": "" }, { "docid": "0455dce86f9243699f9229e413b12a0b", "score": "0.5596444", "text": "_updateProgress() {\n super._updateProgress();\n\n const that = this,\n radius = that.indeterminate ? Math.PI * 100 : Math.PI * 100 - that._percentageValue * Math.PI * 100,\n isIE = /*@cc_on!@*/false || !!document.documentMode,\n isEdge = !isIE && !!window.StyleMedia;\n\n if (that.showProgressValue) {\n const percentage = parseInt(that._percentageValue * 100);\n\n that.$.label.innerHTML = that.formatFunction ? that.formatFunction(percentage) : percentage + '%';\n }\n else {\n that.$.label.innerHTML = '';\n }\n\n //Check if the browser is Edge to make the animation\n if (isIE || isEdge) {\n if (that.value === null || that.indeterminate) {\n that.$.value.style.strokeDashoffset = '';\n that.$.value.setAttribute('class', 'jqx-value jqx-value-animation-ms');\n return;\n }\n else {\n that.$.value.setAttribute('class', 'jqx-value');\n that.$.value.style.strokeDashoffset = that.inverted ? -radius : radius;\n return;\n }\n }\n\n that.$.value.style.strokeDashoffset = that.inverted ? -radius : radius;\n if (that.value === null || that.indeterminate) {\n that.$value.addClass('jqx-value-animation');\n return;\n }\n\n that.$value.removeClass('jqx-value-animation');\n }", "title": "" }, { "docid": "2b92cf1ad54fac0c4a12a79ed1c43675", "score": "0.5592711", "text": "seekBarUpdate() {\n const ratio = this.video.currentTime / this.video.duration\n this.seekBarFillElement.style.transform = `scaleX(${ratio})`\n }", "title": "" }, { "docid": "1af357a4598ce802916a7578395a8f1f", "score": "0.558933", "text": "function animateStep() {\n slideIndex += (inc *= (((slideIndex >= slideCount-1 || slideIndex <= 0 ) && -1) || 1)); // magiclogic;)\n updateViewport();\n}", "title": "" }, { "docid": "fdc29acfdd8724e30d4ea9836d320bba", "score": "0.55832833", "text": "_updateProgress() {\n super._updateProgress();\n\n const that = this;\n\n //Label for Percentages\n if (that.showProgressValue) {\n const percentage = parseInt(that._percentageValue * 100);\n\n that.$.label.innerHTML = that.formatFunction ? that.formatFunction(percentage) : percentage + '%';\n }\n else {\n that.$.label.innerHTML = '';\n }\n\n if (that.value === null || that.indeterminate) {\n that.$value.addClass('jqx-value-animation');\n }\n else {\n that.$value.removeClass('jqx-value-animation');\n }\n\n that.$.value.style.transform = that.orientation === 'horizontal' ? 'scaleX(' + that._percentageValue + ')' : 'scaleY(' + that._percentageValue + ')';\n }", "title": "" }, { "docid": "22c4a6c107a68d7c55a0acdf82e8be66", "score": "0.5582666", "text": "_animate(){\n\n \n\n if(this._stats){\n this._stats.update();\n }\n\n if( this._ready){\n \n // updating the control is necessary in the case of a TrackballControls\n this._quadViews[3].updateControl();\n \n if(this._refreshUniformsCounter){\n this._planeManager.updateUniforms();\n this._refreshUniformsCounter --;\n \n // render only when uniforms where updated\n this._render();\n }\n \n // render no matter what\n //this._render();\n }\n\n \n\n // call a built-in method for annimation\n requestAnimationFrame( this._animate.bind(this) );\n }", "title": "" }, { "docid": "f3314e1edcb24f0f95cb0c1044df33ad", "score": "0.55797106", "text": "update() {\n //console.log(this);\n W_RAT = $(window).width() / $(window).height();\n //var diopterColor =\n var aspectRatio = 4 / 3;\n /* Microscope animations */\n // console.log(this.slideBlur)\n this.translateReduceSVG(\"#ocularRight, #ocularRightCopy\", this.eyepiecePosition, 0);\n this.translateReduceSVG(\"#ocularLeftCopy\", -1 * this.eyepiecePosition, 0);\n this.translateReduceSVG(\"#ocularLeftDiopter, #friend\", -1 * this.eyepiecePosition, this.diopterPosition);\n this.translateReduceSVG(\"#ocularLeftStick\", -1 * this.eyepiecePosition, 0);\n this.translateReduceSVG(\"#ocularLeft\", -1 * this.eyepiecePosition, 0);\n this.translateReduceSVG(\"#slideStage\", 0, this.knobPosition);\n this.translateReduceSVG(\"#slide\", this.xcaliper, this.ycaliper);\n this.translateReduceSVG(\"#apertureKnob\", this.diaphragmLightPosition * -1, this.knobPosition + this.diaphragmHeightPosition / 3);\n this.translateReduceSVG(\"#diaphragm, #aperture, #diaphragmCopy\", 0, this.knobPosition + this.diaphragmHeightPosition / 3);\n this.translateReduceSVG(\"#adjustDHeight\", 0, this.diaphragmHeightPosition);\n this.translateReduceSVG(\"#caliperMetal\", this.xcaliper, 0);\n this.translateReduceSVG(\"#ycaliper\", this.caliperBlade / 2.8, this.ycaliper);\n this.translateReduceSVG(\"#xcaliper\", this.caliperBlade / 2, 0);\n this.translateReduceSVG(\"#cover\", 0, this.ycaliper);\n this.rotateReduceSVG(\"#caliperBlade\", this.caliperBlade, 0, -25);\n this.rotateReduceSVG(\".knob\", this.diaphragmHeightPosition * 10, 0, 0);\n // console.log(this.knobPosition)\n\n // Aperture precision\n // $(\"#stageLight ellipse\").attr(\"rx\", 12 - ((sm_orig.MAX_DIAPHRAGM_HEIGHT - this.diaphragmHeightPosition) / 2));\n //$(\"#stageLight ellipse\").attr(\"ry\", 6 - ((sm_orig.MAX_DIAPHRAGM_HEIGHT - this.diaphragmHeightPosition) / 4));\n caliperYUpperLimit = this.yheight + 15;\n caliperYLowerLimit = this.yheight - 40;\n\n //FIX LENSES\n //+25 to x slideviews\n //25% width and height\n\n //this.translateReduce(\".sviewContainer\", -110, 0);\n\n if (W_RAT < aspectRatio) {\n this.translateReduce(\".slideRect, #slideView\", (this.eyepiecePosition * (Math.pow(4 * (1 / W_RAT), -1) + aspectRatio)) + 5, 0);\n this.translateReduce(\".slideRect,#slideView2\", -this.eyepiecePosition * ((Math.pow(3 * (1 / W_RAT), -1) + aspectRatio)) + 5, 0);\n } else {\n this.translateReduce(\".slideRect,#slideView\", (this.eyepiecePosition * Math.pow(4 * (1 / W_RAT), 2)) + 5, 0);\n this.translateReduce(\".slideRect,#slideView2\", (-this.eyepiecePosition * Math.pow(3 * (1 / W_RAT), 2)) + 5, 0);\n }\n var yCali = ((this.ycaliper)) + 17;\n var xCali = (this.xcaliper * 10) - 100;\n // Microscope darkness (hack is based off of a black background to darken)\n // [0,40] -> Expand to [0,60]\n\n var illumination = `rgba(${Math.min(232, 232*this.illuminationBrightness)},${Math.min(224, 224*this.illuminationBrightness)},${Math.min(152, 152*this.illuminationBrightness)},1)`\n oculusState = {\n zoom: this.zoomPosition, //still need to adjust to lense states\n row: ((this.ycaliper + 38.5) / 55),\n col: ((this.xcaliper + 57) / 70),\n index: 0,\n brightness: ((this.illuminationBrightness)/1.25 + (this.diaphragmLightPosition/100)), //Need to implement diaphragmLightPosition into this\n focusLeft: this.slideBlur,\n focusRight: this.slideBlur\n }\n\n if(slideZoomInstance){\n //console.log(this.illuminationBrightness,slideZoomInstance)\n slideZoomInstance.showSlide(oculusState);\n }\n $(\"#light_1_\").css(\"fill\", illumination);\n\n this.diaphragmBrightness = this.diaphragmLightPosition + this.condenserBrightness;\n\n // console.log(\"new illumination = \", illumination)\n $(\"#slideContents,#slideContents2, #stageLight, .slideRect\").css({\n \"opacity\": (0.4) + ((0.8 * this.diaphragmBrightness) / 100)\n });\n\n //Add a bind that dynamically changes opacity of #stageLight based on condenser\n // console.log(state)\n\n if (document.getElementById(\"stageLight\")) {\n\n var box = document.getElementById(\"stageLight\").getBBox();\n var cx = box.x + box.width / 2;\n var cy = box.y + box.height / 2;\n\n $(\"#stageLight\").attr(\"transform\", \"translate(\" + cx + \" \" + cy + \") scale(\" + this.diaphragmLightWidth + \") translate(\" + (-cx) + \" \" + (-cy) + \")\");;\n }\n\n $(\".slideRect\").css({\n // \"transform\": \"scale(\" + this.zoom + \") \"\n \"transform\": \"translate(\" + xCali + \" % , \" + yCali + \" % )\"\n });\n\n //magniifcation based on objectiv lenses\n // $(\"#slideContents\").css({\n // display: \"none\"\n // });\n\n $(\"#slideContents\").css({\n \"transform\": \"scale(\" + this.magnification + \")\"\n });\n\n if (!this.inBounds) {}\n\n // Initializes both slide contents to blur\n $(\"#canvasRight\").css({\n \"-ms-filter\": \"blur(\" + Math.abs(state.focusRight) + \"px)\",\n \"-webkit-filter\": \"blur(\" + Math.abs(state.focusRight) + \"px)\",\n \"filter\": \"blur(\" + Math.abs(state.focusRight) + \"px)\"\n });\n\n $(\"#canvasLeft\").css({\n \"-ms-filter\": \"blur(\" + Math.abs(state.focusLeft) + \"px)\",\n \"-webkit-filter\": \"blur(\" + Math.abs(state.focusLeft) + \"px)\",\n \"filter\": \"blur(\" + Math.abs(state.focusLeft) + \"px)\"\n });\n\n\n // Reblurs the second slide contents (with diopter as a factor)\n var chosenBlur = this.eyepiecePosition + this.slideBlur2\n $(\"#slideContents2\").css({\n \"-ms-filter\": \"blur(\" + Math.abs(chosenBlur) + \"px)\",\n \"-webkit-filter\": \"blur(\" + Math.abs(chosenBlur) + \"px)\",\n \"filter\": \"blur(\" + Math.abs(chosenBlur) + \"px)\"\n });\n\n }", "title": "" }, { "docid": "cae5adfd1586f7efd70e602dd747bf7a", "score": "0.5574251", "text": "update(now){\n\t\tconsole.log( \"Calc pos of \"+this.name);\n\t\t// Recalculate drawing location and if different, update the DOM\n\t\tif( Previous_Meter===undefined ) {\n\t\t\tconsole.log( \".Using parent\");\n\t\t\t// First meter is drawn relative to parent skin!\n\t\t\t//this.xpos = this.parent.config.windowx+this.config.x[0];\n\t\t\t//this.ypos = this.parent.config.windowy+this.config.y[0];\n\t\t\tif(this.xpos==-1) this.xpos = this.config.x[0];\n\t\t\tif(this.ypos==-1) this.ypos = this.config.y[0];\n } else {\n\t\t\tconsole.log( \".Using Previous_Meter \"+ Previous_Meter.name);\n\t\t\tif(this.xpos==-1) {\n // Draw relative to Previous_Meter\n switch( this.config.x[1] ){\n case 'r':\t//Relative to left of Previous_Meter\n this.xpos = Previous_Meter.xpos+this.config.x[0];\t\t\t\n break;\n case 'R':\t//Relative to right of Previous_Meter\n this.xpos = Previous_Meter.xpos+Previous_Meter.width+this.config.x[0];\n break;\n default:\n //this.xpos = this.parent.config.windowx+this.config.x[0];\n this.xpos = this.config.x[0];\n };\n };\n\t\t\tif(this.ypos==-1) {\n //console.log( \". X=\"+this.xpos+\",\"+this.config.x );\n switch( this.config.y[1]){\n case 'r':\t//Relative to left of Previous_Meter\n this.ypos = Previous_Meter.ypos+this.config.y[0];\t\t\t\n break;\n case 'R':\t//Relative to right of Previous_Meter\n this.ypos = Previous_Meter.ypos+Previous_Meter.height+this.config.y[0];\n break;\n default:\n //this.ypos = this.parent.config.windowy+this.config.y[0];\n this.ypos = this.config.y[0];\n }\n };\n//\t\t\tthis.width = 10;\n//\t\t\tthis.height = 10;\n\t\t}\n \n\t\t// Update DOM\n\t\tthis.dom.style.left = this.xpos+\"px\";\n\t\tthis.dom.style.top = this.ypos+\"px\";\n\t\tthis.dom.style.paddingTop = this.config.padding.top+\"px\";\n\t\tthis.dom.style.paddingRight = this.config.padding.right+\"px\";\n\t\tthis.dom.style.paddingBottom = this.config.padding.bottom+\"px\";\n\t\tthis.dom.style.paddingLeft = this.config.padding.left+\"px\";\n \n // Get size including padding...\n\t\tthis.width = this.dom.offsetWidth;\n\t\tthis.height = this.dom.offsetHeight;\n\t\tthis.width += this.config.padding.left+this.config.padding.right;\n\t\tthis.height += this.config.padding.top+this.config.padding.bottom;\n \n // Save the location into 'Previous_Meter'\n\t\tPrevious_Meter = this;\n \n // Set next update duration\n this.next_update = now+this.parent.config.update*this.config.updatedivider;\n\t}", "title": "" }, { "docid": "6a6de8da439755bb97b82dd0faa19f3b", "score": "0.5572874", "text": "function animateKnob ($elem) {\n var endval = parseInt($elem.attr(\"data-oldvalue\"));\n var m1 = 0;\n var tmr1;\n\n function delayProgress(){\n m1 += 5;\n if (m1 > endval)\n {\n m1 = endval;\n }\n $elem.val(m1).trigger('change');\n if(m1 === endval || m1 === 100) {\n clearInterval(tmr1);\n }\n }\n\n if (m1 < endval) {\n tmr1 = self.setInterval(delayProgress,10);\n }\n }", "title": "" }, { "docid": "4d574ade4730c0aac04ddbb4b1742295", "score": "0.55677944", "text": "__compute () {\n const { onScrollBefore, onScrollAfter, onScrollBetween, onScroll, onHitTop, onHitBottom } = this.options;\n // top position for the start and end point\n const { startPoint, endPoint } = this;\n // run only if the animation is started\n if (!this.started) return;\n // user scroll position\n const scroll = this._getScrollPosition();\n // call scroll animation hook\n onScroll && onScroll(scroll);\n // if scroll is between the start and the end position\n if (scroll > startPoint && scroll < endPoint) { // BETWEEN\n this.appliedAllBefore = false;\n this.appliedAllAfter = false;\n const scrollPercent = calculatePercent(startPoint, endPoint, scroll);\n // call Animator to apply animations\n this._animator.applyAnimations(scrollPercent);\n // call animation hook\n onScrollBetween && onScrollBetween(scroll, scrollPercent);\n } else if (scroll < startPoint) { // BEFORE\n onScrollBefore && onScrollBefore(scroll);\n // apply only once\n if (!this.appliedAllBefore) {\n onHitTop && onHitTop();\n // if the scroll position is before the start point set element style to the initial keyframe rules with 0 percent\n this.appliedAllBefore = true;\n this._animator.applyNoAnimations();\n }\n } else if (scroll > endPoint) { // AFTER\n onScrollAfter && onScrollAfter(scroll);\n // apply only once\n if (!this.appliedAllAfter) {\n onHitBottom && onHitBottom();\n // if the scroll position if after the start set element style to all keyframes with 100 percent\n this.appliedAllAfter = true;\n this._animator.applyAllAnimations();\n }\n }\n }", "title": "" }, { "docid": "2728aff5f09496f486e50a662817b7f5", "score": "0.55626017", "text": "scaleChanged() {\n this.updateBoundary();\n }", "title": "" }, { "docid": "1f36237726993f1b4cdcba8e7add1398", "score": "0.55580586", "text": "update() {\n // Update position with velocity\n this.x += this.vx;\n this.y += this.vy;\n\n this.handleWrapping();\n }", "title": "" }, { "docid": "b8793e87154cc183a1a48d1a1c9a5429", "score": "0.5552168", "text": "update() {\n this.valid ? (this.dirtyId++, this.dirtyStyleId++, this.emit(\"update\", this)) : this.width > 0 && this.height > 0 && (this.valid = !0, this.emit(\"loaded\", this), this.emit(\"update\", this));\n }", "title": "" }, { "docid": "94452a33ee20f202978af5b3a57fc316", "score": "0.55518895", "text": "setInstanceBounds() {\n // make sure we calculate the non-block bounding box\n this.originalContent.style.display = `inline-block`;\n\n this.bounds = {\n element: this.element.getBoundingClientRect(),\n content: this.element.querySelector('.marquee-container').getBoundingClientRect()\n };\n }", "title": "" }, { "docid": "235659609c96c518653e6b18bae1d0a1", "score": "0.5550393", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "0b5d9cf4be4fdeaa72cf7ad101a339cf", "score": "0.55433303", "text": "sizeChanged() {\n this.updateBoundary();\n }", "title": "" }, { "docid": "79ffdf1bf2c929c4ede42e32a3078248", "score": "0.5541145", "text": "updateBoundsPos(newX = this.pos.x, newY = this.pos.y) {\n // call the parent method\n super.updateBoundsPos(newX, newY);\n\n // Notify children that the parent's position has changed\n this.forEach((child) => {\n if (child.isRenderable) {\n child.updateBoundsPos(\n child.pos.x + newX - this.pos.x,\n child.pos.y + newY - this.pos.y\n );\n }\n });\n }", "title": "" }, { "docid": "12336623419febb9d069c1ac0cda681b", "score": "0.5538207", "text": "update() {\r\n if (this.isBoosting) {\r\n //se a nave 'está acelerando' o metodo boost é chamado\r\n this.boost();\r\n }\r\n\r\n this.angulo += this.k; //adiciona ao angulo o multiplicador 'k' \r\n //se não é adicionado ao vetor posição o vetor velocidade\r\n this.posicao.add(this.velocidade);\r\n\r\n //diminiu o vetor velocidade em 1% a cada vez que o metodo é chamado\r\n this.velocidade.mult(0.99);\r\n }", "title": "" }, { "docid": "2d10913f35d497e240615bac580c3f9a", "score": "0.55359566", "text": "apply() {\n // move to center\n translate(this.center.x, this.center.y);\n\n // scale scene\n scale(this.scale);\n\n // move to offset\n translate(this.offset.x, this.offset.y);\n }", "title": "" }, { "docid": "2f07488b92c6ece2e705a5bafef23501", "score": "0.5533134", "text": "update(){\r\n\t\tthis.lifespan=this.lifespan-1;\r\n\t\tthis.render();\r\n\t}", "title": "" }, { "docid": "cca79e12c9b6885c19df9ef36c4e2eed", "score": "0.55299765", "text": "animate() {\n }", "title": "" }, { "docid": "a3e582084279f8ee0d34c3a63a5c40b8", "score": "0.5529529", "text": "function updateprogressionstepsize() {\n var widthreference = (($(window).width() - 60) / 2) - 25;\n var progressionstep = $('.progression-steps-container');\n if (progressionstep.length > 0) {\n var width = Math.min(widthreference, 400);\n var step = $('.progression-steps-container .progression-max');\n step.width(width * 5);\n step.height(width * 6);\n step.addClass('animate');\n }\n }", "title": "" }, { "docid": "339c6b940a9eafc443dde21b087d4883", "score": "0.55271643", "text": "stepAnimate() {\n const { percent } = this.props;\n if (this.displayPercent === percent) clearInterval(this.animationLoop);\n if (this.displayPercent < percent) this.displayPercent++;\n else if (this.displayPercent > percent) this.displayPercent--;\n this.drawGauge();\n }", "title": "" }, { "docid": "d14c2a7e8b80963b43205b631e9b1f23", "score": "0.55247355", "text": "function AnimateVisibleScore () {\n\n iTween.ValueTo ( gameObject,\n {\n \"from\" : visibleScore,\n \"to\" : currentScore,\n \"onupdate\" : \"ChangeVisibleScore\",\n \"time\" : 1\n }\n );\n\n}", "title": "" }, { "docid": "9ba4e9638ea05b605fe2f3b18a8fe892", "score": "0.55245847", "text": "update() {\n if (this.y === 25) {\n this.x = 200;\n this.y = 400;\n score++;\n sidebarScore.innerHTML = score;\n \t}\n }", "title": "" }, { "docid": "cb2ee5045057882227c0c66734313219", "score": "0.55198985", "text": "update(){\n this.move();\n }", "title": "" }, { "docid": "17684bc746d6c7dc974b4cd28c48184a", "score": "0.55149055", "text": "update(val) {\n val = Math.max(Math.min(val, 100), 0);\n if (val !== this.val) {\n this.val = val;\n this.g.noStroke();\n this.g.fill(...this.bgColor);\n this.g.rect(0, 0, this.barWidth, this.barHeight);\n this.g.fill(...this.fillColor);\n this.g.rect(0, 0, this.barWidth*(this.val/100), this.barHeight);\n }\n }", "title": "" }, { "docid": "3db8ebc49bc1bcc8f5b8b2a4d935892f", "score": "0.5511188", "text": "_onResize() {\n this.update();\n }", "title": "" }, { "docid": "ff8d3d58320438a2e45d198cdda493c4", "score": "0.55054647", "text": "update()\n {\n }", "title": "" }, { "docid": "977a00c6562cb34617a433b74dd48b9f", "score": "0.550507", "text": "function animate() {\n window.requestAnimationFrame(animate);\n that.controls.update();\n }", "title": "" }, { "docid": "5dd17b888c0791824fdeb781d43b5376", "score": "0.55014133", "text": "function setParams(w) {\n if (w < 551) {\n slidesPerPage = 1;\n } else {\n if (w < 901) {\n slidesPerPage = 2;\n } else {\n if (w < 1101) {\n slidesPerPage = 3;\n } else {\n slidesPerPage = 4;\n }\n }\n }\n slidesCount = slides - slidesPerPage;\n if (currentPosition > slidesCount) {\n currentPosition -= slidesPerPage;\n };\n currentMargin = - currentPosition * (100 / slidesPerPage);\n slider.style.marginLeft = currentMargin + '%';\n if (currentPosition > 0) {\n arrow[0].classList.remove('inactive');\n }\n if (currentPosition < slidesCount) {\n arrow[1].classList.remove('inactive');\n }\n if (currentPosition >= slidesCount) {\n arrow[1].classList.add('inactive');\n }\n}", "title": "" }, { "docid": "4f98b3bf2651b451e5666dee0ceb9463", "score": "0.55006534", "text": "sliderHelper(newPosition) {\n\n let newTranslatePosition = newPosition - this.state.fixedPositions;\n\n if (newPosition < this.state.fixedPositions) {\n newTranslatePosition = 0;\n }\n \n if (newPosition > this.state.data.length - this.state.fixedPositions) {\n newTranslatePosition = this.state.data.length - (this.state.fixedPositions * 2);\n }\n\n // New Values\n this.setState({\n currentPosition: newPosition,\n translatePosition: newTranslatePosition\n });\n \n }", "title": "" }, { "docid": "1730ee9b0e00be8033975fe6e1f39d1c", "score": "0.5499157", "text": "animate(){\n if(this.deltaT == null || this.done) {\n return;\n }\n \n let newPosition = vec3.create();\n\n this.calcDeltaDistance();\n\n if(this.deltaDistance > this.activeSegmentDistance) {\n this.deltaDistance -= this.activeSegmentDistance;\n\n for(let i=0; i<3; i++) {\n newPosition[i] = this.controlPoints[this.activeSegment + 1][i];\n this.translate[i] += (newPosition[i] - this.oldPosition[i]);\n }\n\n this.oldPosition = newPosition;\n\n this.updateActiveSegment();\n\n if (this.done) {\n return;\n }\n\n this.activeSegmentDistance = this.segmentsDistance[this.activeSegment];\n }\n else {\n this.activeSegmentDistance -= this.deltaDistance;\n }\n\n for(let i=0; i<3; i++) {\n newPosition[i] = this.oldPosition[i] + this.deltaDistance/this.segmentsDistance[this.activeSegment] * this.segments[this.activeSegment][i];\n this.translate[i] += (newPosition[i] - this.oldPosition[i]);\n }\n\n this.oldPosition = newPosition;\n }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.5498492", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.5498492", "text": "update() { }", "title": "" }, { "docid": "eee99849d696522bea770b0fcfb2ecaa", "score": "0.54977137", "text": "function moveSlider(){\n\t\t\t\t\t$slide_inner.animate({\n\t\t\t\t\t\t'marginLeft' : slide_width * (-curr)\n\t\t\t\t\t}, 200);\n\t\t\t\t}", "title": "" }, { "docid": "8cc32979f51607ef4879217a1c15f256", "score": "0.54970926", "text": "_updateRangeSliderPosition()\n {\n let infoboxDiv = $('#box-input-timeline');\n $('#slider').css(\n {\n 'width': (infoboxDiv.width()*(main.modules.timeController.getMaxYear() - main.modules.timeController.getMinYear())) / (main.config.time.maxYear - main.config.time.minYear),\n 'left': (infoboxDiv.width()*(main.modules.timeController.getMinYear() - main.config.time.minYear)) / (main.config.time.maxYear - main.config.time.minYear),\n }\n )\n $('#background-slider').css(\n {\n 'width': infoboxDiv.width(),\n }\n )\n \n let rangeDiv = $('.ui-slider-range');\n $('#range-slider').css(\n {\n 'top': rangeDiv.offset().top,\n 'left': rangeDiv.offset().left + RANGE_SLIDER_OFFSET,\n 'width': rangeDiv.width() - RANGE_SLIDER_OFFSET*2,\n 'height': rangeDiv.height(),\n }\n )\n \n }", "title": "" }, { "docid": "28d307ca46e34f980973efd589781f4f", "score": "0.5491783", "text": "update() {\n this._scale = (this._end - this._start) / this._viewportWidth;\n this._currentLevelId = this._calculateLevelId();\n console.debug('view state update, level', this._currentLevelId);\n\n this._precalculatedScales = getScalesForLevels(this._levels, this._preferredUnitWidth);\n //\n const newState = this.getState();\n\n if (!_.isEqual(newState, this._lastState)) {\n this._event.fireEvent(EVENT_NAME, this);\n if (this.stats) {\n this.stats.addEntry({\n time: new Date().getTime(),\n state: newState\n });\n }\n }\n this._lastState = newState;\n }", "title": "" }, { "docid": "5fb025787672961505a9a0f7dcf3697d", "score": "0.549036", "text": "update () {\n\n }", "title": "" }, { "docid": "1e4587a37fc538165684d29dbd397766", "score": "0.54869294", "text": "grow() {\n this.crestRadius += this.crestVelocity;\n }", "title": "" } ]
cd6ad77edb2419a6018bb5224c9633de
Configuration de mon minuteur
[ { "docid": "cc1da85c10a86cf05f1bbb63da97439b", "score": "0.0", "text": "constructor(props){\n super(props)\n this.state = {\n sec: 0,\n min: 0,\n title: \"\",\n input_show: true,\n finish: \"\"\n }\n }", "title": "" } ]
[ { "docid": "d4ae8a02e41b13f98b722bfc0c4e0e8e", "score": "0.623342", "text": "function konversiMenit(menit) {\n \n var minute = menit % 60\n var hour = (menit - minute) / 60\n strMinute = '' + minute\n if (strMinute.length === 1){\n return hour+':0'+minute\n }\n else {\n return hour+':'+minute\n }\n}", "title": "" }, { "docid": "beef776adf6b20a8d5af9ef8bcc6332a", "score": "0.5956247", "text": "static get schedule() {\n // once every minute\n return '0 0 10 1/1 * ? *'\n }", "title": "" }, { "docid": "558d7a3b4a20ec6a1d4282c173880bbb", "score": "0.5908678", "text": "function temporizador1()\n{\n \n s = document.getElementById(\"segundos1\")\n m = document.getElementById(\"minutos1\")\n cronometro1 = setInterval(\n function(){\n if (contador1_s==60)\n {\n contador1_s = 0\n contador1_m ++\n //agrego un cero si los minutos son menores a 10\n if (contador1_m<10)\n {\n m.innerText = \"0\" + contador1_m\n } else\n {\n m.innerText = contador1_m\n }\n }\n //agrego un cero si los segundos son menores a 10\n if (contador1_s<10)\n {\n s.innerText = \"0\" + contador1_s\n } else\n {\n s.innerText = contador1_s\n }\n contador1_s ++\n \n }\n ,1000)\n}", "title": "" }, { "docid": "4b6683c2101ecea0fd610b461b0ddfdd", "score": "0.58954394", "text": "interval (){\n const d = this.timer.currentDuration;\n const qs = (s) => this.target.querySelector(s);\n const f = Math.floor;\n\n //minutes\n qs('[data-timer-value=minutes-dozen]').innerText = f((d / 60) / 10);\n qs('[data-timer-value=minutes]').innerText = f((d / 60) % 10);\n\n //seconds (always)\n qs('[data-timer-value=seconds-dozen]').innerText = f((d % 60) / 10);\n qs('[data-timer-value=seconds]').innerText = d % 60 % 10;\n }", "title": "" }, { "docid": "651cf7ef83400fcc970a4885a84b0843", "score": "0.58802927", "text": "function updateMinute() {\n // Update time\n var minute = document.querySelector('.clock .minute');\n var mins = new Date().getMinutes().toString();\n if (mins < 10)\n mins = '0' + mins;\n minute.textContent = mins;\n\n // Update theme\n // Make sure theme still exists\n try {\n updateTheme();\n } catch (ex) {\n console.warn('Unable to update theme. Was it deleted?');\n }\n\n // Set clock to update mext minute\n setTimeout(updateMinute, millisUntilMin());\n }", "title": "" }, { "docid": "9cc8febd1f21aa58e64cd8b789f85bb3", "score": "0.5868564", "text": "mostrarTiempo() {\n let tiempo = this.time.split(\":\");\n let horas = parseInt(tiempo[0]);\n let minutos = parseInt(tiempo[1]);\n let segundos = parseInt(tiempo[2]);\n\n segundos++;\n if (segundos === 60) {\n segundos = 0;\n minutos++;\n }\n if (minutos === 60) {\n minutos = 0;\n horas++;\n }\n\n let nuevoTiempo = `${(horas < 10) ? '0' + horas : horas}:${(minutos < 10) ? '0' + minutos : minutos}:${(segundos < 10) ? '0' + segundos : segundos }`;\n\n CRONOMETRO.innerHTML = nuevoTiempo;\n this.time = nuevoTiempo;\n }", "title": "" }, { "docid": "14892a11dbcdd184a8482bb9c4cdb2ca", "score": "0.58463466", "text": "function temporizador2()\n{\n \n s = document.getElementById(\"segundos2\")\n m = document.getElementById(\"minutos2\")\n cronometro2 = setInterval(\n function(){\n if (contador2_s==60)\n {\n contador2_s = 0\n contador2_m ++\n //agrego un cero si los minutos son menores a 10\n if (contador2_m<10)\n {\n m.innerText = \"0\" + contador2_m\n } else\n {\n m.innerText = contador2_m\n }\n }\n //agrego un cero si los segundos son menores a 10\n if (contador2_s<10)\n {\n s.innerText = \"0\" + contador2_s\n } else\n {\n s.innerText = contador2_s\n }\n contador2_s ++\n }\n ,1000)\n}", "title": "" }, { "docid": "3a71faeacd033b13a37f6beaf056d31b", "score": "0.5810837", "text": "function getCronConfig() {\n return {\n daily: `${wakeUpMinute} ${wakeupHour} * * *`,\n weekly: {\n sun: `${wakeUpMinute} ${wakeupHour} * * sun`,\n mon: `${wakeUpMinute} ${wakeupHour} * * mon`,\n tue: `${wakeUpMinute} ${wakeupHour} * * tue`,\n wed: `${wakeUpMinute} ${wakeupHour} * * wed`,\n thu: `${wakeUpMinute} ${wakeupHour} * * thu`,\n fri: `${wakeUpMinute} ${wakeupHour} * * fri`,\n sat: `${wakeUpMinute} ${wakeupHour} * * sat`,\n },\n makeDaily: makeDaily,\n makeWeekly: makeWeekly,\n makeMonthly: makeMonthly\n }\n}", "title": "" }, { "docid": "0c2bc7bfac4e55d3373c671b1f940576", "score": "0.58101714", "text": "init(){\r\n document.querySelector(\".start\").addEventListener(\"click\",this.cronometrar);\r\n document.querySelector(\".stop\").addEventListener(\"click\",this.parar);\r\n document.querySelector(\".reiniciar\").addEventListener(\"click\",this.reiniciar);\r\n this.d = 0;\r\n this.h = 0;\r\n this.m = 0;\r\n this.s = 0;\r\n document.getElementById(\"control\").innerHTML=\"00:00:00:00\";\r\n }", "title": "" }, { "docid": "b705bd73a71d81db5991dc84287df20d", "score": "0.58066666", "text": "function konversiMenit(menit) {\r\nvar menitt1 = Math.floor(menit/60);\r\nvar detik = menit%60 ;\r\nif (detik < 10) {\r\ndetik = '0' + detik\r\n}\r\nreturn (menitt1 + ':' + detik) \r\n}", "title": "" }, { "docid": "336d2031785692262daca1c82342ef33", "score": "0.5796944", "text": "function temps_qui_passe()\n{\n \n\n var temps_actuel = new Date();\n\n document.getElementById('heure_actuelle').childNodes[0].innerHTML=temps_actuel.getHours();\n //console.log(\"bwaaaaaaaaaaaaaaaaaaaaaaah\"); POUR VERIFIER EN CONSOLE QUE CA VA JUSQU'ICI\n document.getElementById('minute_actuelle').childNodes[0].innerHTML=temps_actuel.getMinutes();\n document.getElementById('seconde_actuelle').childNodes[0].innerHTML=temps_actuel.getSeconds();\n \tsetTimeout(temps_qui_passe, 1000); \n}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.57916015", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.57916015", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.57916015", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.57916015", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.57916015", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.57916015", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.57916015", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "5c2a1d20b0895c059e91b74cd015e3eb", "score": "0.5781482", "text": "function getDefaultClock() {\n \n titleSize = 50;\n timeSize = 70;\n dateSize = 30;\n \n if (window.screen.availWidth <= 480) {\n titleSize = 30;\n timeSize = 40;\n dateSize = 22; \n }\n\n var defaultSettings = {\n id: \"\",\n localeData: {\n code: \"en-US\",\n description: \"English (United States)\",\n common: \"true\"\n },\n tzData: \"\",\n selected: true,\n settings: {\n ampm: \"24hr\",\n backgroundColor: \"#ffffff\",\n title: {\n fontSize: titleSize,\n fontFamily: \"Arial\",\n fontColor: \"#000000\",\n bold: false,\n italic: false,\n underline: false,\n extraCSS: {}\n },\n time: {\n fontSize: timeSize,\n fontFamily: \"Arial\",\n fontColor: \"#000000\",\n bold: false,\n italic: false,\n underline: false,\n extraCSS: {}\n },\n date: {\n fontSize: dateSize,\n fontFamily: \"Arial\",\n fontColor: \"#000000\",\n bold: false,\n italic: false,\n underline: false,\n extraCSS: {}\n },\n blinkOn: true,\n calendarSystem: \"gregory\",\n dateFormat: \"shortday\",\n display: true,\n extraCSS: {},\n highlightNonLocalDates: false,\n highlightNonlocalDatesColor: \"#000000\",\n highlightNonbusinessHours: false,\n highlightNonbusinessHoursColor: \"#000000\",\n numberSystem: \"latn\",\n showSeconds: \"none\",\n theme: \"none\",\n titleFormat: \"city\"\n }\n }\n return defaultSettings;\n}", "title": "" }, { "docid": "7d2c3d8ca657e916aed839776bcf7bda", "score": "0.57774407", "text": "static get schedule() {\n // once every hour\n return '* */1 * * *';\n }", "title": "" }, { "docid": "d199be1a3bd00fde4f0b19df2cb7849c", "score": "0.5776029", "text": "initialize_clock() {\n\t\tthis.$clock.html( theme_utils.get_current_localized_time() );\n\n\t\tsetInterval( () => _self.$clock.html( theme_utils.get_current_localized_time() ), 60000 );\n\t}", "title": "" }, { "docid": "4b63df9b5ad6a557fe485e810691e34d", "score": "0.57719594", "text": "function TimeManager(value){\n var content = value.split(\":\");\n var hora = parseInt(content[0]);\n var minuto = parseInt(content[1]);\n var segundos = parseInt(content[2]);\n\n if(segundos<59)\n segundos=segundos+1;\nelse if(segundos==59){\n segundos=00;\n if(minuto<59)\n minuto=minuto+1;\n else if(minuto==59){\n minuto=00;\n hora=hora+1;\n }\n}\n\n if(segundos<10)\n segundos = \"0\"+segundos;\n if(minuto<10)\n minuto = \"0\"+minuto;\n if(hora<10)\n hora = \"0\"+hora;\n\n return hora+\":\"+minuto+\":\"+segundos;\n}", "title": "" }, { "docid": "5610943d32b06835aae0bea699b6c922", "score": "0.57295084", "text": "function printMinutes() {\n minDec.textContent = chronometer.twoDigitsNumber(chronometer.getMinutes())[0];\n minUni.textContent = chronometer.twoDigitsNumber(chronometer.getMinutes())[1];\n}", "title": "" }, { "docid": "41c014d68e0f932aaeae55a182ae332c", "score": "0.57152843", "text": "function atualizaTempoNaPagina(){\n\ttempo = horas+\"<font color=#000000>:</font>\"+minutos+\"<font color=#000000>:</font>\"+segundos; // procura o local onde o tempo deve aparecer\n\tdocument.getElementById('clock1').innerHTML=tempo; //mostra o tempo atual na pagina\n}", "title": "" }, { "docid": "eabf40cda6b21c40d5415b5f3795e7f7", "score": "0.5711976", "text": "function jam() {\n setInterval(function () {\n let waktu = new Date();\n let jam = document.getElementById(\"jam\");\n let hours = waktu.getHours();\n let minutes = waktu.getMinutes();\n let seconds = waktu.getSeconds();\n\n if (waktu.getHours() < 10) {\n hours = \"0\" + waktu.getHours();\n }\n if (waktu.getMinutes() < 10) {\n minutes = \"0\" + waktu.getMinutes();\n }\n if (waktu.getSeconds() < 10) {\n seconds = \"0\" + waktu.getSeconds();\n }\n\n jam.innerHTML = \"<span>\" + hours + \" : \" + \"</span>\" + \"<span>\" + minutes + \" : \" + \"</span>\" + \"<span>\" + seconds + \"</span>\";\n }, 1000);\n }", "title": "" }, { "docid": "84f6a6f985fd6b56f1a583bbb3db5b7a", "score": "0.57029825", "text": "function setCurrentTime(){\n let now = new Date();\n let hours = now.getHours();\n let setHours = hours > 9 ? hours : `0${hours}`\n let minutes = now.getMinutes();\n let setMinutes = minutes > 9 ? minutes : `0${minutes}`;\n TIME.textContent = `${setHours}:${setMinutes}`;\n DATE.textContent = `${now.toLocaleDateString('en-US', { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric'})}`;\n }", "title": "" }, { "docid": "a56af68164dca6bafd1149a18cb9ce36", "score": "0.5702633", "text": "function wrapper(){\nconst date = new Date();\nlet hour = date.getHours();\nconst min = date.getMinutes();\ntoday.textContent = date.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit'\n \n});\nconsole.log(hour);\n\nsetInterval(wrapper, 1000)\n}", "title": "" }, { "docid": "10b96177f51b68cd4c42f1e8be87b01c", "score": "0.5684355", "text": "function startAutoMode() {\r\n\r\n console.log(\"le mode automatique a démarrer interval\");\r\n timermodeauto = setInterval(function() {\r\n if (new Date().getMinutes() === 0) {\r\n runAuto();\r\n }\r\n }, 60000);\r\n\r\n setInterval(function() {\r\n if (new Date().getSeconds() === 0) {\r\n console.log(\"new minute !\");\r\n }\r\n }, 1000);\r\n }", "title": "" }, { "docid": "8a3078d8e12de23a4cf51f98fdb11c84", "score": "0.56701607", "text": "function konversiMenit(menit) {\r\n // you can only write your code here!\r\n var jam = menit/60;\r\n var isHours = Math.floor(jam);\r\n //console.log(isHours);\r\n \r\n var minute = menit % 60;\r\n //console.log(minute);\r\n var nol='';\r\n if(minute < 10) {\r\n nol += 0;\r\n }\r\n return isHours+ ':' +nol+ +minute; \r\n}", "title": "" }, { "docid": "8a3078d8e12de23a4cf51f98fdb11c84", "score": "0.56701607", "text": "function konversiMenit(menit) {\r\n // you can only write your code here!\r\n var jam = menit/60;\r\n var isHours = Math.floor(jam);\r\n //console.log(isHours);\r\n \r\n var minute = menit % 60;\r\n //console.log(minute);\r\n var nol='';\r\n if(minute < 10) {\r\n nol += 0;\r\n }\r\n return isHours+ ':' +nol+ +minute; \r\n}", "title": "" }, { "docid": "d9d31e5f2eedc38d7cda6ed0ec668f85", "score": "0.56562513", "text": "function iniciarCronometro(){\n \n intervaloTempo = setInterval(function(){\n\n tempoJogo.segundos++;\n \n if(tempoJogo.segundos < 10){\n tempoJogo.segundos = '0'+tempoJogo.segundos;\n }\n if(tempoJogo.segundos < 60 && tempoJogo.minutos === 0){\n tempoJogo.minutos=0;\n tempoJogo.minutos = '0'+tempoJogo.minutos;\n }\n \n if(tempoJogo.segundos === 60){\n tempoJogo.minutos++;\n tempoJogo.segundos = '0'+0;\n if(tempoJogo.minutos < 10){\n tempoJogo.minutos = '0'+tempoJogo.minutos;\n }\n }\n\n if(tempoJogo.minutos === 60){\n tempoJogo.minutos = 0;\n tempoJogo.horas++;\n if(tempoJogo.horas < 10){\n tempoJogo.horas = '0'+tempoJogo.horas;\n }\n }\n\n if(tempoJogo.horas == 24){\n tempoJogo.horas = 0;\n tempoJogo.dias++\n }\n\n //Ganho de estamina por tempo\n if(tempoJogo.minutos % 5 == 0 && tempoJogo.segundos == 0 && jogador1.estamina < 100){\n jogador1.estamina++;\n gravarLS('estaminaJ', jogador1.estamina);\n mostraInfoJogador();\n }\n\n //Tempo referente ao rendimento no banco\n if(tempoJogo.horas % 1 == 0 && tempoJogo.minutos == 0 && tempoJogo.segundos == 0){\n jogador1.saldoConta += jogador1.rendimento;\n jogador1.saldoConta = parseInt(jogador1.saldoConta);\n console.log(`saldo: ${jogador1.saldoConta}`)\n gravarLS('saldo', jogador1.saldoConta);\n mostraInfoJogador(); \n }\n\n //Ganhos diários do cabaré\n if(tempoJogo.horas % 6 == 0 && tempoJogo.minutos == 0 && tempoJogo.segundos == 0){\n if(cabareG1.pagamentoDia == null){\n return\n }else{\n cabareG1.ganhos = parseInt(cabareG1.ganhos)\n cabareG1.ganhos += (cabareG1.pagamentoDia);\n localStorage.setItem('meuCabare', JSON.stringify(cabareG1))\n mostraMeuCabare()\n } \n }\n \n gravarLS('min', tempoJogo.minutos);\n gravarLS('horas', tempoJogo.horas);\n gravarLS('dias', tempoJogo.dias);\n \n $horas.innerHTML = `<i class=\"far fa-clock\"></i> ${tempoJogo.horas} : ${tempoJogo.minutos}`;\n $dias.innerHTML = `<i class=\"far fa-calendar-alt\"></i> Dia: ${tempoJogo.dias}` ;\n },100) \n}", "title": "" }, { "docid": "e8d9b129b979c706d3d50e4c4d94da0a", "score": "0.56448555", "text": "function conversion() {\n setMinutes(Math.floor(time / 60));\n setSeconds(time % 60);\n donePomodorosFunction();\n }", "title": "" }, { "docid": "4945f8f0e89349abddd4ca688ce4b351", "score": "0.56435555", "text": "function r(t,a,l,o){var M=t+\" \";switch(l){case\"s\":return a||o?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return t===1?M+=a?\"sekundo\":\"sekundi\":t===2?M+=a||o?\"sekundi\":\"sekundah\":t<5?M+=a||o?\"sekunde\":\"sekundah\":M+=\"sekund\",M;case\"m\":return a?\"ena minuta\":\"eno minuto\";case\"mm\":return t===1?M+=a?\"minuta\":\"minuto\":t===2?M+=a||o?\"minuti\":\"minutama\":t<5?M+=a||o?\"minute\":\"minutami\":M+=a||o?\"minut\":\"minutami\",M;case\"h\":return a?\"ena ura\":\"eno uro\";case\"hh\":return t===1?M+=a?\"ura\":\"uro\":t===2?M+=a||o?\"uri\":\"urama\":t<5?M+=a||o?\"ure\":\"urami\":M+=a||o?\"ur\":\"urami\",M;case\"d\":return a||o?\"en dan\":\"enim dnem\";case\"dd\":return t===1?M+=a||o?\"dan\":\"dnem\":t===2?M+=a||o?\"dni\":\"dnevoma\":M+=a||o?\"dni\":\"dnevi\",M;case\"M\":return a||o?\"en mesec\":\"enim mesecem\";case\"MM\":return t===1?M+=a||o?\"mesec\":\"mesecem\":t===2?M+=a||o?\"meseca\":\"mesecema\":t<5?M+=a||o?\"mesece\":\"meseci\":M+=a||o?\"mesecev\":\"meseci\",M;case\"y\":return a||o?\"eno leto\":\"enim letom\";case\"yy\":return t===1?M+=a||o?\"leto\":\"letom\":t===2?M+=a||o?\"leti\":\"letoma\":t<5?M+=a||o?\"leta\":\"leti\":M+=a||o?\"let\":\"leti\",M}}", "title": "" }, { "docid": "5aee132f47b61d2adfd42602874cd9e7", "score": "0.5632083", "text": "function turnHoursToMinutes() {\n\n}", "title": "" }, { "docid": "93a03502cb8653c63040e4b7436475fc", "score": "0.56218857", "text": "function setTime() {\n\n\ttime = new Date();\n\ttime.setTime(time.getTime() + 60000);\n\tinterval = setInterval(cronos, 10);\n}", "title": "" }, { "docid": "603f234622918521f53ccade2a697256", "score": "0.56212807", "text": "function Timer(){\n\t\tvar segundos = (_segundos <= 9) ? '0'+_segundos : _segundos ;\n\t\tdocument.getElementById('relogio').innerHTML = '0'+_minutos+':'+segundos;\n\t\tif(_minutos==0 && _segundos==10){\n\t\t\tdocument.getElementById('relogio').style.color = '#cc3300';\n\t\t}\n\t\tif(_segundos==0){\n\t\t\tif(_minutos==0){\n\t\t\t\tFimJogo();\n\t\t\t}else{\n\t\t\t\t_minutos--;\n\t\t\t\t_segundos = 59;\n\t\t\t}\n\t\t}else{\n\t\t\t_segundos--;\n\t\t}\n\t}", "title": "" }, { "docid": "19c3ccdc060dde02d82addcc2ff43e03", "score": "0.5612393", "text": "initChronometer() {\n let self = this;\n\n setInterval(() => {\n self.allDuration();\n }, 1000);\n\n }", "title": "" }, { "docid": "25d3eb188278b37a902d52f306c20164", "score": "0.55920833", "text": "function cronometro () { \n timeActual = new Date();\n acumularTime = timeActual - timeInicial;\n acumularTime2 = new Date();\n acumularTime2.setTime(acumularTime);\n ss = acumularTime2.getSeconds();\n mm = acumularTime2.getMinutes();\n hh = acumularTime2.getHours()-21;\n if (ss < 10) {ss = \"0\"+ss;} \n if (mm < 10) {mm = \"0\"+mm;}\n if (hh < 10) {hh = \"0\"+hh;}\n timer.innerHTML = hh+\" : \"+mm+\" : \"+ss;\n}", "title": "" }, { "docid": "2f1724c47e9f0c45e508a53d6655d217", "score": "0.55892926", "text": "function switchToMinuteMode() {\n\t\t\t\tif (selectionMode == 'MINUTE') return;\n\t\t\t\trepaintClockMinuteCanvas();\n\t\t\t\tclockMinuteCanvas.stop().css('display', 'block')\n\t\t\t\t\t\t\t\t\t\t.css('zoom', '80%')\n\t\t\t\t\t\t\t\t\t\t.css('left', '10%')\n\t\t\t\t\t\t\t\t\t\t.css('top', '10%')\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t.css('opacity', 0)\n\t\t\t\t\t\t\t\t\t\t.css('zIndex', 1)\n\t\t\t\t\t\t\t\t\t\t.animate({opacity: 1, zoom:'100%', left:'0px', top:'0px'});\n\t\t\t\tselectionMode = 'MINUTE';\n\t\t\t\tsettings.onModeSwitch(selectionMode);\n\t\t\t}", "title": "" }, { "docid": "af12ca3c29cb5d96a34b5b61a3bef4b8", "score": "0.5588346", "text": "function setMediumTempo() {\n blinkGapDuration = 1200;\n if (currentRound < 3 && currentRound < 6) {\n blinkDuration = 900;\n } else if (currentRound > 6 && currentRound < 10) {\n blinkDuration = 700;\n } else {\n blinkDuration = 400;\n }\n}", "title": "" }, { "docid": "3c6e0351a0dc87ceffced6da8bb900b9", "score": "0.55615234", "text": "_applyInitialSettings() {\n const that = this,\n value = that.value;\n let hours, minutes;\n\n hours = value.getHours();\n minutes = value.getMinutes();\n\n if (that.format === '12-hour') {\n if (hours < 12) {\n that._ampm = 'am';\n that.$amContainer.addClass('jqx-selected');\n\n if (hours === 0) {\n hours = 12;\n }\n }\n else {\n that._ampm = 'pm';\n that.$pmContainer.addClass('jqx-selected');\n\n if (hours > 12) {\n hours -= 12;\n }\n }\n }\n else {\n that.$ampmContainer.addClass('jqx-hidden');\n }\n\n minutes = minutes.toString();\n\n if (minutes.length === 1) {\n minutes = '0' + minutes;\n }\n\n that.$.hourContainer.innerHTML = hours;\n that.$.minuteContainer.innerHTML = minutes;\n\n if (that.selection === 'hour') {\n that.$hourContainer.addClass('jqx-selected');\n }\n else {\n that.$minuteContainer.addClass('jqx-selected');\n }\n }", "title": "" }, { "docid": "a3a63c7dd7d87e2b3a9fa31f94f858ee", "score": "0.5557347", "text": "function konversiMenit(menit) {\n // you can only write your code here!\n var jam = menit/60;\n var isHours = Math.floor(jam);\n //console.log(isHours);\n \n var minute = menit % 60;\n //console.log(minute);\n var nol='';\n if(minute < 10) {\n nol += 0;\n }\n return isHours+ ':' +nol+ +minute; \n}", "title": "" }, { "docid": "a3a63c7dd7d87e2b3a9fa31f94f858ee", "score": "0.5557347", "text": "function konversiMenit(menit) {\n // you can only write your code here!\n var jam = menit/60;\n var isHours = Math.floor(jam);\n //console.log(isHours);\n \n var minute = menit % 60;\n //console.log(minute);\n var nol='';\n if(minute < 10) {\n nol += 0;\n }\n return isHours+ ':' +nol+ +minute; \n}", "title": "" }, { "docid": "08bafce764af1c03f47cb84032b1799b", "score": "0.55569834", "text": "function setTimeOnAllDisplays(minutes, seconds) {\n if (minutes >= 60) {\n // Add an hours section to all displays\n hours = Math.floor(minutes / 60);\n minutes = minutes % 60;\n clockHours = hours + ':';\n document.title = '(' + hours + 'h' + minutes + 'm) Pomodoro';\n } else {\n clockHours = '';\n document.title = '(' + minutes + 'm) Pomodoro';\n }\n \n clockMinutes = minutes < 10 ? '0' + minutes : minutes;\n clockMinutes += ':';\n clockSeconds = seconds < 10 ? '0' + seconds : seconds;\n\n timerDisplay.textContent = clockHours + clockMinutes + clockSeconds;\n }", "title": "" }, { "docid": "9a060a76c55adc46715ca1e49f165f25", "score": "0.55508465", "text": "function addMinute()\n {\n if(this.parentNode.className === 'session-length')\n that.addMinute('session');\n else\n that.addMinute('break');\n }", "title": "" }, { "docid": "536f1713b0c59636b03b62fc19e2cd47", "score": "0.55404294", "text": "constructor() {\n // Date and time constants.\n this.MS_IN_SEC = 1000;\n this.SEC_IN_HOUR = 3600;\n this.MIN_IN_HOUR = 60;\n this.MIN_IN_HALF_HOUR = 30;\n this.HOURS_IN_DAY = 24;\n this.DOUBLE_DIGITS = 10;\n this.DAY_NAMES = [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"];\n this.WEEK_REF = [\"היום\", \"מחר\", \"מחרתיים\"];\n this.now = new Date(); // Assign var with Date object of current time and date.\n }", "title": "" }, { "docid": "4c3c3b62399092652c6e6622201732da", "score": "0.55395305", "text": "get meridiem() {\n\t\treturn (this.hour>11)?\"pm\":\"am\";\n\t}", "title": "" }, { "docid": "97d6656879ae0d60a5f08c9f0d135645", "score": "0.55385286", "text": "function setTimer() {\n let int = setInterval(() => {\n if (haveData) {\n timer = luxon.DateTime.local().setZone(sevenDay.data.timezone)\n } else {\n timer = luxon.DateTime.local();\n }\n $('h3').text(timer.toLocaleString(luxon.DateTime.DATETIME_FULL))\n }, 1000)\n}", "title": "" }, { "docid": "ba781fa49f2ccdb1486c45ff2dc7589b", "score": "0.5528142", "text": "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}}", "title": "" }, { "docid": "d7e8bfa9525a6c9b2201fa1130195725", "score": "0.55176306", "text": "get minute() {\n\t\treturn (this.worldTime.getMinutes()<10)?`0${this.worldTime.getMinutes()}`:this.worldTime.getMinutes();\n\t}", "title": "" }, { "docid": "73eabb2f4e35fb1ebad633ee167ba8a9", "score": "0.5510448", "text": "twelveClock () {\n const shiftAM = () => this.#hour < 4\n ? eveningGreet.run()\n : morningGreet.run()\n\n const shiftPM = () => this.#hour > 4 && this.#hour !== 12\n ? eveningGreet.run()\n : afternoonGreet.run()\n\n return this.#shift === 'AM'\n ? shiftAM()\n : shiftPM()\n }", "title": "" }, { "docid": "b27b825af53efff0612eec9ca176a840", "score": "0.55063725", "text": "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}}", "title": "" }, { "docid": "5b187f6634c89b6e487795ee447b6722", "score": "0.5502364", "text": "function setScreenTime(minut) {\n $('#lcd').val(addZero(minut) + ':00')\n }", "title": "" }, { "docid": "9df96f2071232e67aef9947201d0028f", "score": "0.5496479", "text": "function horloge(){\n\tvar date = new Date();\n\tvar heure = date.getHours();\n\tvar minutes = date.getMinutes();\n\tvar secondes = date.getSeconds();\n\tvar minutes_time = heure*60 + minutes;\n\n\tif (heure < 10) {\n\t\theure = '0' + heure;\n\t}\n\tif (minutes < 10) {\n\t\tminutes = '0' + minutes;\n\t}\n\tif (secondes < 10) {\n\t\tsecondes = '0' + secondes;\n\t}\n\n\tdocument.getElementById(\"time\").innerHTML = heure + ':' + minutes + ':' + secondes;\t\n\tsetTimeout(horloge, 1000);\n\n\treveil_veille(minutes_time);\n\t\n\t}", "title": "" }, { "docid": "68a17f57a75fce50ddd7ccf4c8c03c67", "score": "0.5494605", "text": "function setClosestMin(){\n var date = new Date();\n var m =date.getMinutes();\n var h = date.getHours();\n var defH = $('#hours').children('option:selected').val();\n var firstH = $('#hours').children('[active=\"\"]').val();\n if(defH==firstH || defH==h){ // pokud je aktivní hodnota hodiny shodná s reálným časem -> disable minut\n $('#minutes').children().each(function(){\n var realStep =($(this).val())-(minuteStep);\n if(realStep < m){\n $(this).attr('disabled','disabled');\n }\n });\n //store set values\n var currStep = ($('#currentState').attr('minute'))-(minuteStep);\n if(($('#currentState').attr('minute').length)>0 && (currStep>m)){\n $('#minutes option[value=\"'+$('#currentState').attr('minute')+'\"]').prop('selected',true);\n }else{\n $('#minutes').children('option:enabled').eq(0).prop('selected',true);\n }\n }else{ // selected 1h+ from curr time\n $('#minutes').children().each(function(){\n $(this).removeAttr('disabled','disabled');\n });\n var currStep = ($('#currentState').attr('minute'));\n if((currStep.length)>0){\n $('#minutes option[value=\"'+currStep+'\"]').prop('selected',true);\n }else{\n $('#minutes').children('option:enabled').eq(0).prop('selected',true);\n }\n }\n\n var countDisabled = $('#minutes').children('option:disabled').length;\n if(countDisabled > 5){ // plus 1 hour\n $('#currentState').attr('deprecated',h);\n $('#hours').children('option:enabled').eq(0).prop('disabled',true);\n $('#hours').children('option:enabled').eq(0).prop('selected',true);\n setClosestMin();\n }\n\n\n if((defH-h)==1){ // conversion minutes in next hour (16.51 -> 17:20)\n $('#minutes').children().each(function(){\n var remainsMin = 60-m;\n var realStep =($(this).val())-(minuteStep-remainsMin);\n if(realStep <= 0){\n $(this).attr('disabled','disabled');\n }\n });\n // store set values\n var currStep = ($('#currentState').attr('minute'));\n var firstEnabled = $('#minutes').children('option:enabled').eq(0).val();\n if(($('#currentState').attr('minute').length)>0 && currStep>firstEnabled){\n $('#minutes option[value=\"'+$('#currentState').attr('minute')+'\"]').prop('selected',true);\n }else{\n $('#minutes').children('option:enabled').eq(0).prop('selected',true);\n }\n }\n}", "title": "" }, { "docid": "62256205acd73e6e5cd23c9935c7c0f9", "score": "0.5487332", "text": "function cronCallbackTimer(arg, cron_id) {\n let hourNow = rtc.getTimeHours();\n let minNow = rtc.getTimeMinutes();\n\n print('[cronCallbackTimer] Hour: ' + JSON.stringify(hourNow));\n print('[cronCallbackTimer] Min: ' + JSON.stringify(minNow));\n\n if (hourOn !== hourOff) {\n if (yHour[hourNow]) {\n if (hourNow === JSON.parse(hourOn)) {\n if (minNow >= JSON.parse(minOn)) {\n print('On')\n applyBoardConfig();\n } else {\n print('Off');\n turnOffLed();\n }\n } else {\n print('On')\n applyBoardConfig();\n }\n } else {\n if (hourNow === JSON.parse(hourOff)) {\n if (minNow >= JSON.parse(minOff)) {\n print('Off');\n turnOffLed();\n } else {\n print('On')\n applyBoardConfig();\n }\n } else {\n print('Off');\n turnOffLed();\n }\n }\n }\n\n if (JSON.parse(hourOn) === JSON.parse(hourOff)){\n if (yHour[hourNow]) {\n if (hourNow === JSON.parse(hourOn)) {\n if(yMin[minNow]) {\n applyBoardConfig();\n } else {\n turnOffLed();\n }\n } else {\n applyBoardConfig();\n }\n } else {\n if (hourNow === JSON.parse(hourOff)) {\n if(yMin[minNow]) {\n applyBoardConfig();\n } else {\n turnOffLed();\n }\n } else {\n turnOffLed();\n }\n }\n }\n \n}", "title": "" }, { "docid": "b8dba033df70b800c76b904000942a6d", "score": "0.5482578", "text": "function contador() {\r\n\t\tvar minutes_day = 1440;\r\n\r\n\t\tvar hora_inicio_clases = 8;\r\n\t\tvar minuto_inicio_clases = 30;\r\n\t\tvar hora_inicio = (hora_inicio_clases*60)+minuto_inicio_clases;\r\n\r\n\t\tvar hora_fin_clases = 14;\r\n\t\tvar minuto_fin_clases = 20;\r\n\t\tvar hora_fin = (hora_fin_clases*60)+minuto_fin_clases;\r\n\r\n\t\tvar hoy = new Date();\r\n\t\tvar h = hoy.getHours();\r\n\t\tvar m = hoy.getMinutes();\r\n\t\tvar hora_actual = (h*60) + m;\r\n\r\n\t\tvar day = hoy.getDay();\r\n\r\n\t\tif ((day == 6 || day == 0) || hora_actual < hora_inicio || hora_actual > hora_fin) // Sábado o domingo, o antes de inicio, o después de fin\r\n\t\t{\r\n\t\t\tvar horas_proxima_clase = 0;\r\n\r\n\t\t\thoras_proxima_clase = horas_proxima_clase + (minutes_day - hora_actual); // Suma los minutos que quedan del día actual\r\n\t\t\thoras_proxima_clase = horas_proxima_clase + hora_inicio; // Suma minutos hasta inicio primera clase\r\n\r\n\t\t\tif (day == 6) { // Si además es sabado\t\r\n\t\t\t\thoras_proxima_clase = horas_proxima_clase + minutes_day; // Suma todos los minutos del domingo\r\n\t\t\t} \r\n\r\n\r\n\t\t\tdocument.getElementById('contador_texto').innerHTML= \"Tiempo para próxima clase:\" + \"<br/>\" + PonerCero(parseInt(horas_proxima_clase/60)) + \":\" + PonerCero(horas_proxima_clase%60) + \"h\";\r\n\t\t} else {\r\n\t\t\tvar horas_fin_clase = hora_fin - hora_actual;\r\n\t\t\tdocument.getElementById('contador_texto').innerHTML= \"Tiempo para final clases:\" + \"<br/>\" + PonerCero(parseInt(horas_fin_clase/60)) + \":\" + PonerCero(horas_fin_clase%60) + \"h\";\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e85fd3e8785d97ce24604f8853407b01", "score": "0.5480782", "text": "function inicializaCronometro() {\n\t\n\tcampo.one(\"focus\", function () { // a função one descarta eventos iguais seguintes\n//campo.on(\"focus\", function () { // a função on capta o 1º e todos os eventos posteriores\n\t\tvar tempoRestanteSPAN = $(\"#tempo-digitacao\");\n\t\tvar tempoRestante = tempoRestanteSPAN.text();\n\n\t\tdesabilitaIcon(\"#botao-reiniciar\");\n\t\t\t/*$(\"#botao-reiniciar\").attr(\"disabled\",true);\n\t\t\t$(\"#botao-reiniciar\").addClass(\"disabled\");*/\n\t\tvar cronometroID = setInterval(function () {\n\t\t\ttempoRestanteSPAN.text(--tempoRestante);\n\t\t\t// .attr(\"atributo da tag\", ?) devolve e define, como a .text(?).\n\t\t\tif( tempoRestante < 1 ) {\n\t\t\t\tclearInterval(cronometroID);\n\t\t\t\tfinalizaJogo();\n\t\t\t}\n\n\t\t}, 1000);\n\t});\n}", "title": "" }, { "docid": "025662668da75ab5c172c1ba5ae9b5f3", "score": "0.5463344", "text": "function clock() {\n clearInterval(timer);\n\tt = getTime();\n\tsetNum(\"sec2\" ,t[\"s2\"]);\n\tif(parseInt(t[\"s2\"], 10) == 0){\n\t\tsetNum(\"sec1\" ,t[\"s1\"]);\n\t\tif(parseInt(t[\"s1\"], 10) == 0){\n\t\t\tsetNum(\"min2\" ,t[\"m2\"]);\n\t\t\tif(parseInt(t[\"m2\"], 10) == 0){\n\t\t\t\tsetNum(\"min1\" ,t[\"m1\"]);\t\n\t\t\t\tif(parseInt(t[\"m1\"], 10) == 0){\n\t\t\t\t\tsetNum(\"hours2\" ,t[\"h2\"]);\n\t\t\t\t\tif(parseInt(t[\"h2\"], 10) == 0){\n\t\t\t\t\t\tsetNum(\"hours1\" ,t[\"h1\"]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ttimer = setTimeout(\"clock()\",1000)\n}", "title": "" }, { "docid": "7e1657b6617657dfedf4375f51ed1f9e", "score": "0.5461662", "text": "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}}", "title": "" }, { "docid": "7e1657b6617657dfedf4375f51ed1f9e", "score": "0.5461662", "text": "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}}", "title": "" }, { "docid": "f03052594ade2d8be2a3609bb645dc32", "score": "0.5459263", "text": "setMinutes(e) {\n this.setState({ minutes: e.target.value });\n let m = moment(this.props.date._d)\n m.hour(this.state.hours)\n m.minute(e.target.value)\n this.props.onTimeChange(m)\n this.toggleMinutes()\n }", "title": "" }, { "docid": "8bd670326029a8f6b88961bf1887d6a1", "score": "0.54568416", "text": "function setTime() {\n // Create date instance\n var date = new Date();\n // Get hours and minutes and store in variables\n var hours = date.getHours(),\n minutes = date.getMinutes();\n // If number of minutes < 10, the time looks like this: 6:6. We want 6:06 instead, so add a 0\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n // Define elements where to put hours and minutes\n var $hoursElement = $('#time .time-hours'),\n $minutesElement = $('#time .time-minutes');\n // Put hours and minutes in the elements\n $hoursElement.text(hours);\n $minutesElement.text(minutes);\n }", "title": "" }, { "docid": "cd3dad80a24753c46cbaea01a56b9f87", "score": "0.5452059", "text": "function timer(){\n cronometro = window.setInterval(Iniciar, 1000);\n}", "title": "" }, { "docid": "e16317252c5908725aa55d3341c53d43", "score": "0.54507875", "text": "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}}", "title": "" }, { "docid": "b5f5d31de6f07f88f1bd7c17b283a833", "score": "0.54506963", "text": "function timeManagement() {\n var day = $(\"#currentDay\"); \n var date = moment().format('llll').toString();\n day.text(date);\n var ampm = date.split(\" \");\n hour = parseInt(moment().format('LT').toString());\n if (ampm[5] === \"PM\") {\n hour = hour + 12;\n return hour;\n }\n return hour;\n }", "title": "" }, { "docid": "a5ab6ae24f9ac37351307df208761a0b", "score": "0.5448405", "text": "function Exo_4_2()\r\n // DEBUT\r\n\t{\r\n var iHeures, iMinutes;\r\n\r\n //Ecrire \"Entrez l'heure actuelle :\"\r\n //Lire iHeures\r\n iHeures=prompt(\"Entrez l'heure actuelle :\");\r\n //Ecrire \"Entrez les minutes :\"\r\n //Lire iMinutes\r\n iMinutes=prompt(\"Entrez les minutes :\");\r\n\r\n iMinutes=parseInt(iMinutes)+1;\r\n\r\n //Si iMinutes=60 alors\r\n if (iHeures!=23 & iMinutes==60)\r\n {\r\n iHeures=parseInt(iHeures)+1;\r\n iMinutes=\"00\";\r\n //Ecrire \"Dans une minute, il sera \" + iHeure + \" heure(s) \" + iMinutes\r\n alert(\"Dans une minute, il sera \" + iHeures + \" heure(s) \" + iMinutes);\r\n }\r\n\r\n //SINON SI iHeures=23 ET iMinutes=60 alors\r\n else if (iHeures==23 & iMinutes==60)\r\n {\r\n //Ecrire \"Dans une minute, il sera 00 heure 00\"\r\n alert(\"Dans une minute, il sera 00 heure 00\");\r\n }\r\n //SINON\r\n else\r\n {\r\n //Ecrire \"Dans une minute, il sera \" + iHeure + \" heure(s) \" + iMinutes\r\n alert(\"Dans une minute, il sera \" + iHeures + \" heure(s) \" + iMinutes + \" minutes\");\r\n }\r\n //FINSI\t\t\r\n //FIN\t\r\n }", "title": "" }, { "docid": "d2e2e252b6f078496eb57c662204e828", "score": "0.54471403", "text": "function timerSetup() {\n // MINIGAME 1: 35sec\n if (minigame1) {\n timer = 35;\n }\n // MINIGAME 2: 5sec\n else if (minigame2) {\n timer = 5;\n }\n}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "792129a2f87dbfe232a8191ccfe18a2b", "score": "0.54432994", "text": "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\"}}", "title": "" }, { "docid": "3a0ead13fd8f156f0391ca167642999d", "score": "0.5442377", "text": "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}}", "title": "" }, { "docid": "161b0521c016d807c6630d8566818893", "score": "0.54399884", "text": "function SetTime() {\r\n let date = new Date();\r\n let time = (date.getHours()+1) + ':' + (date.getMinutes() < 10 ? '0' : '') + (date.getMinutes());\r\n \r\n document.querySelector('.order--timer').textContent = time;\r\n // console.log('updated at',time)\r\n setTimeout(SetTime, 60000);\r\n }", "title": "" }, { "docid": "aa3acd6b13015954b4d82176b9162c85", "score": "0.54320306", "text": "timer() {\n this.sethandRotation('hour');\n this.sethandRotation('minute');\n this.sethandRotation('second');\n }", "title": "" }, { "docid": "5dfc791add384cb6b54a9485c688bd65", "score": "0.5430314", "text": "function mini() {\n\n //If e2 errors that means, the data has reached it's conclusion. at which point the models will reset and start again.\n try {\n minim = globaldata[e2]['minute'] \n }\n catch {\n console.log('Reset')\n clear()\n speedreset()\n getdata()\n }\n\n if (minim < 10) {\n minute.push(`:0${minim}`)\n }\n else {\n minute.push(`:${minim}`)\n }\n\n minute.shift()\n e2= e2 + 1\n // console.log(minute)\n return minute;\n}", "title": "" }, { "docid": "5deade3709ca6374a5a7bb538b465199", "score": "0.5428954", "text": "function loadTimer() {\n currentTimerType = PEvents.nextTimer(currentTimerType);\n \n switch (currentTimerType) {\n case PEvents.Timers.pomodoro:\n minutes = 25;\n seconds = 0;\n break;\n \n case PEvents.Timers.short_break:\n minutes = 5;\n seconds = 0;\n break;\n\n case PEvents.Timers.long_break:\n minutes = 25;\n seconds = 0;\n break;\n }\n\n render();\n }", "title": "" }, { "docid": "d324529678bd91feed2a78bcf0282d2b", "score": "0.54264516", "text": "function adicionaMinutos() {\n\n\n if(minutos === 5){\n setMinutos(10);\n setSegundos(0);\n }\n\n if(minutos === 10){\n setMinutos(15);\n setSegundos(0);\n }\n\n if(minutos === 10){\n setMinutos(15);\n setSegundos(0);\n }\n\n if(minutos === 15){\n setMinutos(20);\n setSegundos(0);\n }\n\n if(minutos === 20){\n setMinutos(25);\n setSegundos(0);\n }\n\n if(minutos === 25){\n setMinutos(30);\n setSegundos(0);\n }\n\n if(minutos === 30){\n setMinutos(35);\n setSegundos(0);\n }\n\n if(minutos === 35){\n setMinutos(40);\n setSegundos(0);\n }\n\n if(minutos === 40){\n setMinutos(5);\n setSegundos(0);\n }\n}", "title": "" }, { "docid": "84f7b3d99a4b8f8013d5bc67f5808618", "score": "0.5421214", "text": "function timer(){\n if (segundos == 0 && minuto > 0) {\n segundos = 59\n minuto --\n } else if (segundos !== 0 && minuto >= 0) {\n segundos --\n } else if (segundos == 0 && minuto == 0) {\n clearInterval(myTimer);\n terminaTiempo()\n }\n if(segundos>9){\n $(\"#timer\").html(\"0\"+minuto+\":\"+segundos)\n } else {\n $(\"#timer\").html(\"0\"+minuto+\":0\"+segundos)\n }\n }", "title": "" }, { "docid": "ca1193cb6d47310f7844c8751a352c01", "score": "0.5415281", "text": "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}}", "title": "" }, { "docid": "5dfbeef021008e1770a2a3659ad3f711", "score": "0.5411722", "text": "function clock() {\n //Function untuk animasi\n function animation(span) {\n span.className = \"turn\";\n setTimeout(function () {\n span.className = \"\";\n }, 700);\n }\n //Function untuk menentukan jam\n function jam() {\n setInterval(function () {\n let waktu = new Date();\n let jam = document.getElementById(\"jam\");\n let hours = waktu.getHours();\n let minutes = waktu.getMinutes();\n let seconds = waktu.getSeconds();\n\n if (waktu.getHours() < 10) {\n hours = \"0\" + waktu.getHours();\n }\n if (waktu.getMinutes() < 10) {\n minutes = \"0\" + waktu.getMinutes();\n }\n if (waktu.getSeconds() < 10) {\n seconds = \"0\" + waktu.getSeconds();\n }\n\n jam.innerHTML = \"<span>\" + hours + \" : \" + \"</span>\" + \"<span>\" + minutes + \" : \" + \"</span>\" + \"<span>\" + seconds + \"</span>\";\n }, 1000);\n }\n jam();\n //Function untuk memulai animasinya\n function jam2() {\n let spans = jam2.getElementByTagName(\"span\");\n animation(spans[2]);\n if (seconds == 0) animation(spans[1]);\n if (minutes == 0 && seconds == 0) animation(spans[0]);\n }\n}", "title": "" }, { "docid": "df03a2bc01a51ccda9559cbdbd6b892a", "score": "0.5411309", "text": "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}}", "title": "" }, { "docid": "df03a2bc01a51ccda9559cbdbd6b892a", "score": "0.5411309", "text": "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}}", "title": "" } ]
d8e9f12ea9e1bf42ed0729daf9f326f7
This function checks if a checkbox has been checked
[ { "docid": "296e25fb706bf79bc64d55cacbcebd6e", "score": "0.6247058", "text": "function checkCheckbox(checkbox) {\n\tvar p = checkbox.parentNode;\n\tif (checkbox.checked){\n\t\tp.className = \"welldone\";\n\t} else {\n\t\tp.className = \"\";\n\t}\n}", "title": "" } ]
[ { "docid": "ad8971f35fcd3dfcd5f0cc81f56bf70b", "score": "0.7984677", "text": "function isChecked(checkbox){\r\n if(checkbox.checked == false){\r\n console.log(\"Checkbox is not checked!\");\r\n return false;\r\n }\r\n console.log(\"Checkbox is checked.\");\r\n return true;\r\n }", "title": "" }, { "docid": "1c4a73ae059f57854a13e075fad9ac59", "score": "0.7840046", "text": "function isChecked(checkbox){\n if(checkbox.checked == false){\n console.log(\"Checkbox is not checked!\");\n return false;\n }\n console.log(\"Checkbox is checked.\");\n return true;\n}", "title": "" }, { "docid": "19eaa36f016128843fa93c173fedd207", "score": "0.78151673", "text": "function isChecked() {\n return check.checked;\n }", "title": "" }, { "docid": "d70604b2b950cd5ee14a67f3e63f93eb", "score": "0.7547559", "text": "function checkboxCheck(){\n checkboxStatus(seaweedCheckbox,seaweedDiv,false);\n checkboxStatus(birdCheckbox,birdDiv,false);\n checkboxStatus(herbCheckbox,herbDiv,false);\n checkboxStatus(treeCheckbox,treeDiv,true);\n checkboxStatus(fruitTreeCheckbox,fruitTreeDiv,true);\n}", "title": "" }, { "docid": "6d44412696f10a47a2d6412a55a8c939", "score": "0.7453856", "text": "function cehckBox() {\r\n const check = document.getElementById(\"inputBookIsComplete\");\r\n if (check.checked) {\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "c0278f8e6c967ae03c4b60b314cddc62", "score": "0.7345259", "text": "function isCheckboxSelected(szFormName, szCheckBoxName) \n{\n return getSelectedCheckbox(szFormName, szCheckBoxName).length > 0;\n}", "title": "" }, { "docid": "6810769a0e3e2b43286fe9f978255746", "score": "0.73198825", "text": "function alreadyRead(checkbox) {\n if (checkbox.checked) {\n return true\n } else return false\n}", "title": "" }, { "docid": "536875512d0d091715ccab3e7bf9ed33", "score": "0.7302347", "text": "isCheckOn() {\n return has(['checkbox', 'radio'], el.type);\n }", "title": "" }, { "docid": "f9bb34cbbe5965263d652e7d241a9433", "score": "0.72285944", "text": "function checkboxValidation() {\n\n for (let i=0; i < checkboxes.length; i++){\n if(checkboxes[i].checked){\n return true;\n }\n }\n}", "title": "" }, { "docid": "9a9e785e0ea7c82c775ed35db60b60ed", "score": "0.7214941", "text": "check() {\n if (this.checked === true) {\n this.checked = false;\n } else {\n this.checked = true;\n }\n }", "title": "" }, { "docid": "fcdc1b8e430b542d0050b1ee9be97333", "score": "0.7209374", "text": "function checkedTrue(e){\n\tvar checkId = e.target.dataset.check;\n\tallBookList[checkId].bookStatus = !allBookList[checkId].bookStatus;\n\tdisplayBookList(allBookList);\n}", "title": "" }, { "docid": "68f7ca4bb907efbbd66406178cae0ea3", "score": "0.7193931", "text": "function checkBoxChecker() {\n\treturn $('#js-hide-checked-items').prop('checked');\n}", "title": "" }, { "docid": "9084887e9090649822ffb86849b6b9de", "score": "0.7125853", "text": "function CheckboxSet_isChecked(name) {\n var checkboxObj = this.getCheckboxObj(name);\n return checkboxObj.isChecked();\n}", "title": "" }, { "docid": "45d7bd7bda93a6a67ec8414ade1360ed", "score": "0.70904094", "text": "checked() {\n\t\treturn this._checkbox.hasCssClass(\"checked\");\n\t}", "title": "" }, { "docid": "501fc0be4174edee8be995cdbb207c32", "score": "0.7064308", "text": "function getCheckBox() {\n const checkBoxList = document.querySelectorAll('#checkbox');\n const submitButton = document.getElementById('checkBoxSubmit');\n isChecked(checkBoxList, submitButton);\n}", "title": "" }, { "docid": "e0e4c1d822d86df15526defd4a9ba11d", "score": "0.700319", "text": "function checkIfChecked(field) {\n\n for (i in field) {\n if (field[i].checked == true) {\n return true;\n }\n }\n\n setinvalidWithoutColor(field[field.length - 1], `Should be selected`);\n\n return false;\n}", "title": "" }, { "docid": "010cb54905a5dc9b44716d19e2dbb7dd", "score": "0.6900432", "text": "static async checkboxChecked(selector, checked) {\n const condition = Condition.checkboxChecked(checked);\n return WaitCondition.check('for checkbox is selected', condition, selector);\n }", "title": "" }, { "docid": "03a8b415f9f030cba7b5f855d3a6df32", "score": "0.68940663", "text": "function IsCheckBoxChecked(chkboxName)\n{\n\n var arrElem = document.getElementsByName(chkboxName);\n\n for (var i = 0; i < arrElem.length; i++)\n {\n if (arrElem[i].checked == true)\n {\n return true;\n }\n\n }\n\n return false;\n}", "title": "" }, { "docid": "d7f62d32c242bb2a1fef3220418ca198", "score": "0.68480927", "text": "function handleCheckbox($tag)\t{\n\t\t\t\t\t\tif($tag.is(':checked'))\t{return 1}\n\t\t\t\t\t\telse\t{return 0}\n\t\t\t\t\t\t}", "title": "" }, { "docid": "10fc28359323ae3610e3ce3c199f9535", "score": "0.6836972", "text": "function fcPayoneCheckTerms(oTermCheckbox) {\n var sState = oTermCheckbox.prop('checked');\n if ( sState == true || sState == 1 || sState == 'checked' ) {\n fcPayoneEnableSubmit();\n } else {\n fcPayoneDisableSubmit();\n }\n }", "title": "" }, { "docid": "00662c2b84133960e249afdaa3bc5852", "score": "0.6820134", "text": "function check() {\n if ((lowerChecked.checked === false) &&\n (upperChecked.checked === false) &&\n (numberChecked.checked === false) &&\n (symbolChecked.checked === false)\n ) { \n alert(\"You must first select at least one checkbox\");\n } else {\n // compiles the array\n compileArray();\n // generates a password \n generatePassword();\n }\n }", "title": "" }, { "docid": "a0c1f65b59dec54784b52be27be556f9", "score": "0.68108696", "text": "function onCheckboxClick() {\n // check if its true and set it to false\n if (shopItems[i][0] === true) {\n shopItems[i][0] = false;\n } else {\n shopItems[i][0] = true;\n }\n newCheckbox();\n }", "title": "" }, { "docid": "21b50ade5f1b19b478ab48e36320818c", "score": "0.6806357", "text": "function isChecked(fieldname,fieldId)\n{\n\t/*var str=checkTrim(fieldvalue)\n\tif(str=='Yes')\n\t{\n\t\treturn true;\n\t}\n\telse\n\treturn false;*/\n\t//var setHasChecked=false\n\tfor ( i =0 ; i < fieldId.length; i++)\n\t{\n //alert(fieldId[i].checked);\n\n\t\tif(fieldId[i].checked ==true)\n\t\t{\n\t//alert(\"hello\");\n\t\t\treturn true;\n\t\t}\n\t}\n alert(fieldname + \" must be selected \");\n\treturn false;\n}", "title": "" }, { "docid": "d563fb2565aa07b4eb7eacf13e108dd5", "score": "0.68036836", "text": "function checkTheCheckBox(itemsToCheck, shouldBeChecked) {\n $.each( itemsToCheck, function( i,val ) {\n $(\":checkbox[value=\"+val+\"]\").prop(\"checked\", shouldBeChecked);\n });\n }", "title": "" }, { "docid": "e7032e55c2ed868780a7512e9ef59e67", "score": "0.6799238", "text": "function checkSelected() {\n if (running) return;\n var inputs = document.getElementsByTagName('input');\n var checks = []\n for (var i=0; i<inputs.length; i++) {\n var input = inputs[i];\n if (!keep(input)) continue;\n if (input.checked) {\n checks.push(input);\n }\n }\n check(checks,0);\n}", "title": "" }, { "docid": "476a76688c2bf7a96bef636b900e62be", "score": "0.67920876", "text": "function checkBox(pos){\n return $SR.eq(pos).find(\"#checkbX\").is(':checked');\n }", "title": "" }, { "docid": "4b143ade36a44b49c7fbf0dcc85963df", "score": "0.6786292", "text": "function CBOX_Btn_Check(CBox, offSet){\n\tvar Check_Cnt = 0;\n\n\tif(CBox == null){\n\t\talert(\"선택할 항목이 없습니다.\");\n\t\treturn false;\n\t}\n\telse{\n\n\t\tif(CBox.length == undefined){\n\t\t\tif(CBox.checked == false){\n\t\t\t\talert(\"1개이상 선택해주세요.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tfor(x=0;x<CBox.length;x++){\n\t\t\t\tif(CBox[x].checked == true){\n\t\t\t\t\tCheck_Cnt++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(offSet == true){\n\t\t\t\tif(Check_Cnt == 1){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\talert(\"1개만 선택가능합니다.\");\n\t\t\t\t\tCBOX_Btn_Check_Off(CBox)\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(Check_Cnt == 0){\n\t\t\t\t\talert(\"1개이상 선택해주세요.\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6300a0c9ede9a73d6cb8c7cf9368c4ce", "score": "0.67741424", "text": "function check(id){\n let val =document.getElementById(id).checked;\n return Boolean(val);\n}", "title": "" }, { "docid": "aff71d3d05b21e9cf3acf0f4538f08d6", "score": "0.6768728", "text": "function isChecked(itemName) {\n\treturn get(itemName).isChecked();\n}", "title": "" }, { "docid": "359808a7e6b2dbfbf3c60cf78966f876", "score": "0.6748366", "text": "checks(){\n\t\t\tvar check = checkbox();\n\t\t\tif(check == true){\n\t\t\t\tconst current = 1;\n\t\t\t\tthis.setState({ current });\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ccc5c058ddcf8231d459ab059cb5d8f1", "score": "0.67469025", "text": "function checked() {\n var cbx = popup.find(\"#markallrecipients\");\n return cbx.prop('checked');\n }", "title": "" }, { "docid": "1f46c4c1b2d6c2db9d66aa664a282b67", "score": "0.66891766", "text": "function checkear() {\r\n var flag = false;\r\n for (var index = 0; index < 6; index++)\r\n if (checks[index].checked == true) {\r\n flag = true;\r\n break;\r\n }\r\n if (flag == false) {\r\n alert(\"Debe seleccionar uno o mas lenguajes de programacion\");\r\n }\r\n return flag;\r\n}", "title": "" }, { "docid": "6601551fc50a254d7c6b507997334b54", "score": "0.6666431", "text": "isChecked(option) {\n if(!this.getCheckboxElement(option).prop('checked')) return false;\n return true;\n }", "title": "" }, { "docid": "1b96e155dd7f7a6ae863b57235c48d94", "score": "0.66575366", "text": "function CheckCheckbox(elementForm) {\n\tif(elementForm.value == \"0\") {\n\t\telementForm.value = \"1\";\n\t\telementForm.checked = true;\n\t} else if(elementForm.value == \"1\") {\n\t\telementForm.value = \"0\";\n\t\telementForm.checked = false;\n\t}\n}", "title": "" }, { "docid": "20de676e72298428c6432ce7f3cc6ac9", "score": "0.6627567", "text": "function isChecked(el){\n\t\tif(document.getElementById(el))\n\t\treturn document.getElementById(el).checked;\n\t}", "title": "" }, { "docid": "a2eab67247302774dc8765b79a2734cc", "score": "0.6616823", "text": "function handleCheckBox(checkbox) {\n switch (checkbox) {\n case \"cbStatus\":\n console.log(`Status anterior ${checkedStatus}`);\n setCheckedStatus(!checkedStatus);\n\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "a4bc2d0d799c82cbfcd8bebcb4e235d2", "score": "0.6607192", "text": "function consoleLogChecked() {\nconsole.log(\"Lower Character Checkbox \" + lowerChecked.checked);\nconsole.log(\"Upper Character Checkbox \" + upperChecked.checked);\nconsole.log(\"Number Checkbox \" + numberChecked.checked);\nconsole.log(\"Symbol Checkbox \" + symbolChecked.checked);\n}", "title": "" }, { "docid": "2e7847c8e32914120dcdaabe937c35df", "score": "0.66017026", "text": "_checkboxListener() {\n const checkedBoxes = document.querySelectorAll(`input[name=\"${this.el.name}\"]:checked`);\n if (! checkedBoxes || ! checkedBoxes.length) {\n this._validate(null);\n return;\n }\n\n [...checkedBoxes].forEach(box => {\n this._validate(box.value);\n });\n }", "title": "" }, { "docid": "04b29a52c9c1e5a55ea9bb22267481a4", "score": "0.65991294", "text": "checked(a, b) {\r\n return b.nodeName.toLowerCase() === 'input' && ['checkbox', 'radio'].includes(b.type) && !!b.checked\r\n }", "title": "" }, { "docid": "0ec579ab8d7e4b66cd7a0fe920d3f502", "score": "0.65934384", "text": "function isChecked(itemCode) {\n if (props.actionCode in taxonomyPermissionStore && props.group.code in taxonomyPermissionStore[props.actionCode]) {\n if (taxonomyPermissionStore[props.actionCode][props.group.code].includes(itemCode)) {\n checkedCheckboxesCount += 1;\n\n if (isAllChecked) {\n setIsAllChecked(false);\n }\n\n return true;\n }\n }\n\n return false;\n } // Use the json string data in the dom to define the default 'all' checkbox state", "title": "" }, { "docid": "45d69208f636dfee9c811c4713c89c8c", "score": "0.65896285", "text": "function isOneCheckboxChecked(checkboxClass) {\n var isChecked = false;\n $(checkboxClass).each(function() {\n if ( $(this).hasClass(\"w--redirected-checked\") ) {\n console.log(\"One checkbox is checked\");\n isChecked = true;\n }\n });\n return isChecked;\n }", "title": "" }, { "docid": "b232443d4c2a1badc2b16c6abc0074b5", "score": "0.657297", "text": "function validCheckboxes() {\n for (let i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "9c1ee40ff8881b75634e3a52ff120dd3", "score": "0.6553312", "text": "@computed('checked')\n /**\n * Determine whether or not input should be checked\n * @param {Boolean|null|undefined} checked - desired checked state\n * @returns {Boolean} whether or not input should be checked\n */\n isChecked (checked) {\n return [null, undefined, false].indexOf(checked) === -1\n }", "title": "" }, { "docid": "fcd61ef3cea620ad11d40c2806a3e819", "score": "0.65389574", "text": "function checkBoxArrayHasChecked(arrayId) {\n\tfor (i = 0;; i++) {\n\t\tid = arrayId + '[' + i + ']';\n\t\telem = getObj(id);\n\t\tif (elem == null) {\n\t\t\tbreak;\n\t\t} else if (elem.checked) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "488283c39fd005fac922ade6a4afda50", "score": "0.6524733", "text": "function Checker(){\r\n if (check===\"unchecked\"){\r\n changecheck(\"checked\")\r\n } else if (check === \"checked\"){\r\n changecheck(\"unchecked\")\r\n }\r\n}", "title": "" }, { "docid": "71040bed6676c72c7338034abe659cd6", "score": "0.65014946", "text": "function checkBoxValidation() {\n var select = false; \n for(var i = 0; i < checkBoxValid.length; i++){\n if(checkBoxValid[i].checked == true){\n select = true;\n }\n } if (!select){\n alert(\"Please select the days we can best reach you!\")\n return false; \n }\n}", "title": "" }, { "docid": "6ecd003a6248411d78dfbd75841d8b02", "score": "0.6496199", "text": "function check() {\r\n document.getElementById(\"All\").checked = true;\r\n}", "title": "" }, { "docid": "22958f7716b56f238957dd783984a0a9", "score": "0.6482672", "text": "function checkResumecheckbox() // Checkbox Resume Validation \n{\n\t\n\t\n\tvar o = document.getElementById('resumeRequired');\n\t\n\tif ( (o.checked == false ) )\n\t{\n\t\tdocument.getElementById('resumeclikerror').innerHTML=\" Select Resume Required\";\n\t}\n\t\n\telse\n\t{\n\t\tdocument.getElementById('resumeclikerror').innerHTML=\" \";\n\t\t\n\t}\n\t\n}", "title": "" }, { "docid": "38bc8db429f159ff6f89a35e416c70d8", "score": "0.6474847", "text": "function checkCheckBox () {\n let inputs = Array.from(document.querySelectorAll('.task-check input')) \n\n function checkState (e) {\n let position = e.path[2]\n\n if (position.style.textDecoration === 'line-through') { // nao concluido\n position.style.textDecoration = 'none'\n position.style.color = 'inherit'\n } else { //concluido\n position.style.textDecoration = 'line-through'\n position.style.color = 'grey'\n } \n \n }\n inputs.forEach ( item => item.addEventListener ('click', checkState))\n }", "title": "" }, { "docid": "d78abbb94e5d03cd9b0839fef55e50a5", "score": "0.6452377", "text": "function checkBoxRec() {\n if (selectedValuesArr.length !== 0) {\n jq('.customerChannelList .dropdown-menu input[type=\"checkbox\"]').each(function() {\n var val = jq(this).attr('value');\n if (jq.inArray(val, selectedValuesArr) !== -1) {\n jq(this).prop('checked', true);\n jq(this).prop('disabled', true);\n jq(this).next('label').addClass('selected');\n jq(this).next('label').addClass('disabled');\n } else {\n jq(this).prop('checked', false);\n jq(this).prop('disabled', false);\n jq(this).next('label').removeClass('selected');\n jq(this).next('label').removeClass('disabled');\n }\n });\n }\n }", "title": "" }, { "docid": "792591e3c97efa722a8329e96c353e7d", "score": "0.6451045", "text": "function validateCheckBox(){\n var smokerInput = document.querySelector(\"input[name=smoker]\");\n return smokerInput.checked ? \"Smoker\" : \"Non-smoker\";\n}", "title": "" }, { "docid": "1cf4d988feebc50b7d76a809ff89be9a", "score": "0.6444786", "text": "function verificar() {\n\n\tvar falsos = 0;\n\t// Itera pelos checkbox\n\t$('input[type=checkbox]').each(function(){\n\t\t// Contabiliza checkbox desmarcados\n\t\tif ($(this).attr('checked') == false) {\n\t\t\tfalsos++;\n\t\t}\n\t});\n\t\n\t// Se não houver linhas desmarcadas, marca 'checkAll'\n\tif (falsos == 1) { // limiar 1 po causa do próprio checkAll\n\t\t$('#checkAll').attr('checked', true);\n\t}\n}", "title": "" }, { "docid": "223954fe8beef385c2a162086455f5af", "score": "0.64426565", "text": "function checkChckBoxes(){\n \t\tlet checkedInputs = $('.activities').find('input:checked');\n \t\tif (checkedInputs.length===0) {\n \t\t\t$(\".activities\").css(\"border\", \"2px solid red\"); \n \t\t\treturn false;\n \t\t}\n \t\telse{\n \t\t\t$(\".activities\").css(\"border\", \"\");\n \t\t\treturn true;\n \t\t}\n \t}", "title": "" }, { "docid": "e8ab17e9cae37b7f828612cfac6d1603", "score": "0.64421177", "text": "get isCheckboxSelection() {\n return this.selectionType === SelectionType.checkbox;\n }", "title": "" }, { "docid": "f445753006edb4194bfa786e909d2d09", "score": "0.64190114", "text": "function checkall(name){\r\n\tif(name=='') return false;\r\n\t\r\n\tvar aCache=getCheckBoxes(name);\r\n\t\r\n\tif(aCache.length>0){\r\n\t\tfor(var i=0,shu=aCache.length;i<shu;i++){\r\n\t\t\taCache[i].checked=aCache[i].checked?false:true;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "title": "" }, { "docid": "a95c86853fbde9d9aabc013f14471d5c", "score": "0.6411253", "text": "function val1CollegePressed(fieldElem) {\n for(let i = 0; i<fieldElem.length; i++){\n if(fieldElem[i].checked){\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "a181865e601bc3ee6b148c7b23c7caa5", "score": "0.64050233", "text": "function CWM_ELP_DPL_54_ASB_validateASIPTCOCheckbox(){\r\ntry{\r\n var asiPTCO = AInfo[\"I certify under the pains and penalties of perjury that I am the board approved PTCO\"];\r\n logDebug(\"asiPTCO \"+asiPTCO);\r\n var vFlag = true;\r\n if(asiPTCO==\"CHECKED\"){\r\n vFlag = false;\r\n }\r\n if(vFlag){ \r\n cancel = true;\r\n showMessage = true;\r\n comment(\"The board approved PTCO must be the individual who completes the renewal of the license. Please contact the board for further instructions.\");\r\n }\r\n}catch(err){\r\n logDebug(\"Error message: \"+err.message);\r\n}\r\n} // end of function", "title": "" }, { "docid": "5fbce7006c17a00f9fd656d7fdb7e265", "score": "0.63905585", "text": "function seeWhichChecked(){\n if (checkFace.checked || checkInsta.checked || checkSnap.checked || checkTwit.checked){\n userChoseSocial = true;\n }\n else if (checkSocial.checked){\n userNoSocial = true;\n }\n}", "title": "" }, { "docid": "f2a88bc856c566f90cbc26914b0da39e", "score": "0.6382419", "text": "function checkboxRecurrenceChecker() {\n if (document.getElementById('chkRecurrence').checked) {\n recurrenceChecked = true;\n }\n else {\n recurrenceChecked = false;\n }\n}", "title": "" }, { "docid": "00f54c214e0857ed83a6492b11dceb61", "score": "0.63769144", "text": "function activeCheckedbox(){\n\t\tif(walk(\"repostOption\").checked){\n\t\t\trepostValue = walk(\"repostOption\").value;\n\t\t}else{\n\t\t\trepostValue = \"No\"\n\t\t}\n\t}", "title": "" }, { "docid": "90632651d684acb6736b338d8bb03a8d", "score": "0.6363664", "text": "function check(id)\n{\n $(id).checked = true;\n}", "title": "" }, { "docid": "f1521069789937d68fbcc861b1592477", "score": "0.63625354", "text": "function checkTheBox () {\r\n\tvar chk = document.getElementById('id_20');\r\n\tchk.checked=true;\r\n\treturn true;\r\n}", "title": "" }, { "docid": "7156f5ee974fd1f3cdd5ef097e0de745", "score": "0.6361459", "text": "function regActValidation() {\n let isChecked = 0;\n for (let i = 0; i < inputCheckbox.length; i++) {\n if(inputCheckbox[i].checked) {\n isChecked += 1;\n } else {\n isChecked += 0;\n }\n }\n return isChecked;\n}", "title": "" }, { "docid": "70bb4c7b629f17415188d79ee274f533", "score": "0.6357542", "text": "function anyChecked(form) {\n\tvar theForm = form, z = 0, numChecked=0;;\n\t for(z=0; z<theForm.length;z++){\n if(theForm[z].type == 'checkbox' && theForm[z].checked === true){\n\t numChecked ++;\n\t }\n }\n\t if(numChecked >0) {\n\t\t\n\t\t return true;\n\t } else {\n\t\t alert(\"Please select checkbox(es) on current page.\");\n\t\t return false;\n\t }\n}", "title": "" }, { "docid": "62f9cb2dc96b1b701dcb0d45c6fe1b42", "score": "0.6355336", "text": "function handleCheckBoxStatus(checkbox) {\n switch (checkbox) {\n case \"cbStatus\":\n console.log(`Status anterior ${checkedStatus}`);\n setCheckedStatus(!checkedStatus);\n break;\n\n default:\n break;\n }\n }", "title": "" }, { "docid": "03a74acc30a202088d83e454540a6f63", "score": "0.63274336", "text": "function preprocess(){\n\t{\n\n\tvar x=document.form1.checkbox;\n\n\tif(x.checked){\n\t\treturn false;//alert(\"thanks\");//user finally selected check box(true)aka return false\n\t\t\n\t}\n\t\n\telse{\n\t\treturn true;//user did not select box, go to top(false)aka true\n\t}\n}\n\t\n\n}", "title": "" }, { "docid": "e07be98b23827ec0fb5f3ec21cb3703a", "score": "0.63246995", "text": "function VerifyCheckboxes()\n{\n\tvar checkboxColl = document.getElementsByTagName(\"input\");\n\tvar aleastOneChecked = false;\n\tfor (i = 0; i < checkboxColl.length; i++)\n\t{\n\t\tif (checkboxColl[i].type.toLowerCase() == \"checkbox\")\n\t\t{\n\t\t\tif (checkboxColl[i].getAttribute(\"mode\") == \"clarification\")\n\t\t\t{\n\t\t\t\tif (checkboxColl[i].checked == true)\n\t\t\t\t{\n\t\t\t\t\taleastOneChecked = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif (aleastOneChecked == true)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\tvar hiddenColl = document.getElementsByTagName(\"input\");\n\t\tfor (j = 0; j < hiddenColl.length; j++)\n\t\t{\n\t\t\tif (hiddenColl[j].type.toLowerCase() == \"hidden\")\n\t\t\t{\n\t\t\t\tif (hiddenColl[j].getAttribute(\"mode\") == \"clarification\")\n\t\t\t\t{\n\t\t\t\t\talert(hiddenColl[j].value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "5e0dbd05b9be2f122728d1f44da55865", "score": "0.63130426", "text": "function CheckAll(e) {\r\n var xState = e.checked;\r\n var theBox = e;\r\n var elm = theBox.form.elements;\r\n var i = 0;\r\n for (i = 0; i < elm.length; i++)\r\n if (elm[i].type == \"checkbox\" && elm[i].id != theBox.id)\r\n if (elm[i].checked != xState && !elm[i].disable)\r\n elm[i].click();\r\n }", "title": "" }, { "docid": "acc4d9aa707082c231e4c08a9aa2eb52", "score": "0.6312515", "text": "function userAnswer() {\n if ($('input.form-check-input').prop('checked')){ \n console.log($('input.form-check-input').val());\n }\n}", "title": "" }, { "docid": "5df95485286f0ec936a9b2b124946f4a", "score": "0.6309009", "text": "function checkAddOption() {\n\n if (document.getElementById('add-bottom').checked) \n {\n chechBtn = \"checked\";\n }\n}", "title": "" }, { "docid": "b3fd2f69e19d5081590139fb0b154e47", "score": "0.6306204", "text": "function checkState(){\t\t\n\t\tif($(this).is(\":checked\")) {\n\t\t\ttoggleButtons(false);\n\t\t\t$(\"#visual\").show();\n\t\t} else {\n\t\t\ttoggleButtons(true);\n\t\t\t$(\"#visual\").hide();\n\t\t}\n\t}", "title": "" }, { "docid": "444e9ecbd9a6776f6decf4713e8f3368", "score": "0.629678", "text": "function checkAtLeastOneSelec(checkBoxSelected){\n\tif(!checkBoxSelected[0]){\n\t\tvar settings = {\n\t\t\t\ttheme: 'teal',\n\t\t\t\tsticky: false,\n\t\t\t\thorizontalEdge: 'top',\n\t\t\t\tverticalEdge: 'right',\n\t\t\t\tlife: 5000\n\t\t};\n\t\t$.notific8('zindex', 11500);\n\t\t$.notific8('Nessun elemento selezionato ', settings);\n\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "04c62a479e4fe552205b6b5f48a57644", "score": "0.6293145", "text": "function displayFeedback(checkboxFeedback){\n if (checkboxFeedback.checked){\n GetSeenFeedbackList();\n } else {\n GetAllFeedbackList();\n }\n}", "title": "" }, { "docid": "e670f37dc475e3efbcb6a3f8601488bb", "score": "0.62871516", "text": "function isSelected(id){\n\tvar elem = document.getElementById(id);\n\tif(elem.checked == true){\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "789a8965746e26d52f671ec996f252ca", "score": "0.62868017", "text": "function breakpointRespChecked() {\n\t//--------variable\n\tvar checkbox = $(\".responsive-breakpoint-checkbox__checkbox\"),\n\t\tcheckboxAddClass = $(\".responsive-breakpoint\");\n\t//--------function\n\tcheckbox.on(\"click\", function() {\n\t\tvar checkboxState = checkbox.is(':checked');\n\t\tif (checkboxState == true) {\n\t\t\tcheckboxAddClass.addClass('js-checkbox--checked');\n\t\t} else if (checkboxState == false) {\n\t\t\tcheckboxAddClass.removeClass('js-checkbox--checked');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "0de28aae1c8243814856639a2cf93e90", "score": "0.6281931", "text": "function isBoxCheckedById(id) {\r\n if ($(id).prop(\"checked\") == 0) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "title": "" }, { "docid": "03abddb69c23cb333c414599a66e50ae", "score": "0.62789756", "text": "function IsStuntDie() {\n\tvar checkBox = document.getElementById(\"stuntDieCheck\");\n\tif (checkBox.checked == true){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "cb694e76beab4bef08625026fdfc8bd9", "score": "0.6263364", "text": "function check_checkboxes() {\n var itemsArray = JSON.parse(localStorage.getItem('hearthtax_databasket')) ||[];\n for (var outerCount = 0;\n outerCount < itemsArray.length;\n outerCount++) {\n $('p, tr').each(function () {\n if ($(this).attr('xml:id') == itemsArray[outerCount].xml_id) {\n $(this).find('input:checkbox.cb').prop('checked', true);\n };\n });\n };\n}", "title": "" }, { "docid": "661359c99633c5d3df8c53356acc0d46", "score": "0.6245653", "text": "function checkBox1() {\n if (document.getElementById('cb1').checked)\n socket.emit('cb1 checked');\n else\n socket.emit('cb1 unchecked');\n}", "title": "" }, { "docid": "25a0011a34e5703e80313b1488633465", "score": "0.6242367", "text": "getChecked() {}", "title": "" }, { "docid": "00f22f76be2b94f926112530e0cc559a", "score": "0.62416005", "text": "function isChecked(id){\n var ReturnVal = false;\n $(\"#\" + id).find('input[type=\"radio\"]').each(function(){\n if ($(this).is(\":checked\")) \n ReturnVal = true;\n });\n $(\"#\" + id).find('input[type=\"checkbox\"]').each(function(){\n if ($(this).is(\":checked\")) \n ReturnVal = true;\n });\n return ReturnVal;\n}", "title": "" }, { "docid": "674a052569a40f3aa812f679585c71e6", "score": "0.6240191", "text": "function checkBoxValidation(){\n let numOfChecks = [document.getElementById(\"python_checkbox_one\"),\n document.getElementById(\"python_checkbox_two\"), document.getElementById(\"python_checkbox_three\")];\n let counter = 0;\n for(let i = 0; i < numOfChecks.length; i++){\n if(numOfChecks[i].checked === true){\n counter++;\n }\n\n if(counter > 1){\n counter--;\n numOfChecks[i].checked = false;\n }\n }\n}", "title": "" }, { "docid": "006d5583f5a33709900be438c3d6d766", "score": "0.6228755", "text": "function check(field, checker){\n\tif(checker.checked == true){\n\t\tfor(i = 0; i < field.length; i++){\n\t\t\tfield[i].checked = true;\n\t\t}\n\t}else{\n\t\tfor(i = 0; i < field.length; i++){ \n\t\t\tfield[i].checked = false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "51578f263c5ec3f19e78c3d34f6ea469", "score": "0.62253195", "text": "function validateChecked(element) {\n\t\treturn element.attr(\"checked\") === \"checked\";\n\t}", "title": "" }, { "docid": "16b56416387d7cf991688265a60e79b3", "score": "0.62237227", "text": "isChecked(e) {\n const value = e.target.checked ? 1 : 0;\n const checkedValues = { id: Number(e.target.name), verify: value };\n this.setState({ verified: [...this.state.verified, checkedValues] });\n }", "title": "" }, { "docid": "89f5f41986d54740f89c49c91873fe50", "score": "0.62201536", "text": "function checkboxFieldValidator(checkboxes) {\n let isSelected = false;\n for (let i = 0; i < checkboxes.length; i++) {\n // at least one box must be checked\n if (checkboxes[i].checked) {\n isSelected = true;\n break;\n }\n }\n if (!isSelected) {\n activities.classList.add('not-valid');\n activities.classList.remove('valid');\n activitiesHint.style.display = 'inline';\n return false;\n } else {\n activities.classList.add('valid');\n activities.classList.remove('not-valid');\n activitiesHint.style.removeProperty('display');\n return true;\n }\n}", "title": "" }, { "docid": "bc1ff8db01cccfea8c360c5074af0d7a", "score": "0.6216007", "text": "function IsElementChecked(sID)\n\t{\n\tvar elemCheck = document.getElementById(sID);\n\tif (elemCheck && elemCheck.checked)\n\t\t{\n\t\treturn true;\n\t\t}\n\treturn false;\n\t}", "title": "" }, { "docid": "042bec6ea7805a16c5e2b633e523427f", "score": "0.6209757", "text": "function checkToggle(){\n var datesCheckbox = document.getElementById(\"datesCheckbox\");\n if (datesCheckbox){\n var checked = checkbox.hasAttribute(\"checked\");\n if (checked){\n enableDates();\n }\n else{\n disableDates();\n }\n }\n}", "title": "" }, { "docid": "a26473b896009f0b1df62bef6b094223", "score": "0.62085557", "text": "function isSMSopt() {\n var smsBox = document.getElementById('sms-toggle');\n if (smsBox.checked) {\n return true;\n } else \n {\n return false;\n }\n}", "title": "" }, { "docid": "d456e2a5e36aed0b0e754032c31b3615", "score": "0.6206962", "text": "function reseller_interest_checkbox()\n{\n\tvar reseller_msg = \"We are thrilled that you want to learn more about the Fonality Reseller Program. \" +\n\t\t\t\t\t\t\"However, please note:\\n\\n\" +\n\t\t\t\t\t\t\"1. Fonality does not offer reseller discounts on your first order.\\n\\n\" +\n\t\t\t\t\t\t\"2. A Fonality Reseller Manager *will* be contacting you to discuss the program and how it might work for you. \" +\n\t\t\t\t\t\t\"This qualification process is required and may slow down your order.\";\n\tif (document.form.reseller_interest.checked == true)\n\t{\n\t\talert(reseller_msg);\n\t}\n}", "title": "" }, { "docid": "f9802da9871678943d5031f19b5f6ca5", "score": "0.6203424", "text": "function yesNoMaybeStatus() {\n if ($('input.case').is(':checked')) {\n } else {\n if ($('#btnviewOne').length) {\n $('.SelectAll').attr('checked', true);\n }\n else {\n $('.case').each(function () {\n if (this.value == 5) {\n $(this).attr('checked', true);\n }\n });\n }\n }\n }", "title": "" }, { "docid": "4140de5939ef7832eab4d09cef39cf04", "score": "0.6199217", "text": "function checkActivites(list) {\n for ( let i = 0; i < list.length; i++ ) {\n if ( list[i].checked ) {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "2b34fb697b50ecd109940c8e43513616", "score": "0.61968535", "text": "function checkBoxClick() {\n const checkbox = document.querySelector(\"#checkbox\");\n localStorage.setItem(\"status\", checkbox.checked);\n setToggleState();\n}", "title": "" }, { "docid": "2e4930e6f7d7bb7a0c7f99b7b053f8ba", "score": "0.61932474", "text": "function checkRobot(form, checkbox_stat, radio_stat){\n\tvar valid = false,\n\t\thuman = $(\"input:checkbox\").prop(\"checked\"),\n\t\tradio = $(\"input:radio:checked\").val();\n\n\tif(human===checkbox_stat && radio===radio_stat){\n\t\tvalid = true;\n\t}else{\n\t\tpopup.showPopup(\"Айзеку Азимову было бы стыдно за такого врушу\",2500);\n\t}\n\n\treturn valid;\n}", "title": "" }, { "docid": "d4263849467e97151d0dae69083c3c0e", "score": "0.6188367", "text": "function validateCheckboxes() {\n const email = document.getElementById('contactChoice1');\n const phone = document.getElementById('contactChoice2');\n\n if (email.checked === false && phone.checked === false) {\n alert('Please select a contact method');\n return false;\n }\n}", "title": "" }, { "docid": "4eeeb391ad7b422aa8121273311e410c", "score": "0.6184458", "text": "function OBcheck()\n{ \n\t\n\tvar value1=document.getElementById('usId');\n\tvar value2=document.getElementById('ausId');\n\tvar value3=document.getElementById('middleId'); \n\tvar value4=document.getElementById('ukId');\n\t\n\t\n\t\n\tif( (value1.checked == true) || (value2.checked == true) || (value3.checked == true) || (value4.checked == true))\n\t{\n\t\t\n\t\tdocument.getElementById('workerror').innerHTML=\" \";\n\t}\n\telse\n\t\n\t{\n\t\t\n\t\tdocument.getElementById('workerror').innerHTML=errMsg[\"90004\"];\t\t\t \n\t} \n\t\n}", "title": "" }, { "docid": "a75a5a49ab557c3053763e7e81ab8936", "score": "0.6181932", "text": "function validateCheckbox(temp1, temp2, temp3, temp4) {\n\t\t result = false\n\t\t if (temp1 == false && temp2 == false && temp3 == false && temp4 == false) {\n result = true;\n }\n\t\t return result;\n }", "title": "" }, { "docid": "9d45fe289579c878392217e02688b7d7", "score": "0.61813796", "text": "function boxesChecked(a, b, c, d, e) {\n if (a && b && c && d && e) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "91b6d37e587f9debb045e3879ef9fcba", "score": "0.618123", "text": "function isProjectChecked()\n{\n\tif (typeof document.publishForm.prj.length == 'undefined')\n\t{\n\t\tif (document.publishForm.prj.checked === true) return true;\n\t} else {\n\t\tfor(i=0;i<document.publishForm.prj.length;i++) if (document.publishForm.prj[i].checked === true) return true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "a7b8ce625f8a300b36d9ea1a2c027ce1", "score": "0.61737406", "text": "function checkOnlyOne(){\n $(document).on('click', 'input[type=\"checkbox\"]', function() {\n x = $('input[type=\"checkbox\"]').not(this).prop('checked', false);\n\n let y = $(this).val();\n\n \n //--------------------->\n if ($('input[type=\"checkbox\"]').is(':checked')){\n /*\n $(\"#user-resume,#user-update,#user-delete\").attr(\"disabled\",false)\n $(\"#iduserupdate\").val($(this).attr(\"id\"))\n\n clearAll()\n readeClientesOne($('input[name=\"idX\"]:checked').attr(\"id\"))\n */ \n $(\"#btnDetallesCierres\").attr(\"disabled\",false)\n \n } else {\n /*\n $(\"#user-resume,#user-update,#user-delete\").attr(\"disabled\",true)\n $(\"#iduserupdate\").val(0) \n */\n $(\"#btnDetallesCierres\").attr(\"disabled\",true)\n }\n //--------------------->\n })\n}", "title": "" } ]
01706f857ed67c72436a028ee9cb454e
get data of user selected corpus getDataFunc: function, request data from docusky
[ { "docid": "87570998403f029d1b53d2d511923009", "score": "0.6668735", "text": "getSelectedData(getDataFunc) {\n\n\t\t// each selected corpus\n\t\t$(this.tableUI).find('.select').each(function() {\n\t\t\tgetDataFunc({\n\t\t\t\ttarget: $('#load-from-docusky-btn').attr('data-target'),\n\t\t\t\tdb: $(this).find('td[name=\"db\"]').text(),\n\t\t\t\tcorpus: $(this).find('td[name=\"corpus\"]').text()\n\t\t\t});\n\t\t});\n\n\t\t// UI\n\t\tthis.modal('hide');\n\t}", "title": "" } ]
[ { "docid": "239301639f6a62cf7ddf0c9df17fe304", "score": "0.82514155", "text": "function getDataFromDocusky(param) {\n\tparam.callback = processDataFromDocusky;\n\t_ui.addCorpus(param.corpus);\n\t_docusky.getData(param);\n\t//console.log('send', param.db + '-' + param.corpus, +new Date());\n}", "title": "" }, { "docid": "ca1209e1c3701442204c7360da3ebef8", "score": "0.698447", "text": "function processDataFromDocusky(param) {\n\t//console.log('receive', param.db + '-' + param.corpus, +new Date());\n\tvar data = _parser.processDocuSkyRowData(param.docList);\n\t//console.log('parse fin', +new Date(),data)\n\t_ui.setCorpusData(param.corpus, data);\n}", "title": "" }, { "docid": "d76aee9a23048990caba21c2d013235c", "score": "0.6336087", "text": "function loadData(doc, args=[])\n{\n\tconst oArgs = args.join(\"&\");\n\tvar request = new XMLHttpRequest();\n request.open('GET', doc + \"?\" + oArgs.replace(/\\?/, \"[QUEST]\").replace(/\\&/, \"[AND]\"), false);\n\trequest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\trequest.send();\n\treturn request.responseText;\n}", "title": "" }, { "docid": "6f95de6119960b182d164d6fb84d4f92", "score": "0.6192241", "text": "get corpus() {\n return stemming.getStemmingData(data).corpus;\n }", "title": "" }, { "docid": "b724b2d26897b57a951a5dee1d4dfaee", "score": "0.60863805", "text": "function loadData(doc, args=[])\n{\n\tOArgs = doc + args.join(\"&\");\n\n\tvar request = new XMLHttpRequest();\n request.open('POST', doc , false);\n\trequest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n request.send(OArgs)\n\treturn request.responseText;\n}", "title": "" }, { "docid": "80e111a882c5bdc6714c833a1b4b365f", "score": "0.60610896", "text": "function accessThroughDocuSky($event) {\n\t_docuSkyObj.getDbCorpusDocuments('', '', '', $event, getEntireDbCorpusText);\n}", "title": "" }, { "docid": "8b103e96083b853e2a26ff40de16473f", "score": "0.60121983", "text": "function dcData(c) {\n return c.doc.data()\n}", "title": "" }, { "docid": "819f34fd36b1a15090ffa9961dbc58a3", "score": "0.5807556", "text": "function _getDocuments(data) {\r\n return $http.get('profile/getDocuments/' + data);\r\n }", "title": "" }, { "docid": "def334efac956d1804f710f7bf557bf9", "score": "0.5712707", "text": "function GetPickedCorpus(){\n return picked_corpus;\n }", "title": "" }, { "docid": "a217a90ee1cd2c6bb237425c02f14cb3", "score": "0.57100904", "text": "mapData (documents) { return documents; }", "title": "" }, { "docid": "8657d01809f8b8b75eb4b846917ac21a", "score": "0.5661349", "text": "_getData() {\n \n }", "title": "" }, { "docid": "b24eecb69055d7ac9c52e11d4e7ce3b3", "score": "0.5605701", "text": "getData()\n {\n \n }", "title": "" }, { "docid": "135fcee2ee4ecbff0ecab22e2a9ca8cd", "score": "0.5549126", "text": "function getData() {\n\n}", "title": "" }, { "docid": "2d606aa7acc5b66fc27d42e31e9ad30d", "score": "0.5527255", "text": "function doData(telex)\n{\n\n}", "title": "" }, { "docid": "b031b85a29532511475f045e4e7b2741", "score": "0.54589146", "text": "function getDataBoth() {\n getKeyword();\n getSentiment();\n }", "title": "" }, { "docid": "2d0fea79225911aae71ceb4796579afd", "score": "0.5457274", "text": "function getDocuments(){\n\tconst packet = new GetDocumentListRequestPacket();\n documents = []\n\n CommunicationManager.send(packet, success, fail);\n function success(packet) {\n if(packet.result === \"Valid\") { \n for(var doc of packet.documents){\n\n var nameSpan = $(\"<span>\")\n nameSpan.text(doc.name)\n \n\n requestOptions.each(function(i, option){\n $(\"<option data-id=\\\"\"+(documents.length)+\"\\\" data-isTop = false>\" +(nameSpan.html())+\"</option>\").appendTo(option);\n documents.push(doc.name)\n })\n }\n }\n }\n\n function fail() {\n console.log(\"This method is called if something went wrong during the general communication.\");\n }\n\n}", "title": "" }, { "docid": "103f52b2fcb2ff72f6367ce129e02401", "score": "0.5442392", "text": "function fetchData(word) {\n\tconst xhr = new XMLHttpRequest();\n\txhr.responseType = 'document';\n\tconst url = PROXY + SERVICE + word.replace(' ', '_');\n\txhr.open('GET', url);\n // Em caso de sucesso, atualiza o model\n\txhr.onload = (event) => {\n\t\tconst data = scrape(event);\n\t\tupdateModel(word, data);\n\t};\n\txhr.send();\n}", "title": "" }, { "docid": "7b865cdf79c454e72e0e56ed395e8337", "score": "0.5432615", "text": "async function getTrainingData(corpus) {\n // log to console\n console.log('Generating training data from corpus', corpus);\n\n // read in the file, clean it and turn it into an array\n let data = await fs.readFile(corpus, 'utf-8');\n let table = await jquery.toArrays(data);\n // console.log(table);\n console.log('Read ' + table.length + ' rows from file ' + corpus);\n\n // split training data into headers, train and test\n let headers = table[0];\n let trainData = table.slice(1, table.length - 200);\n let testData = table.slice(table.length - 200, table.length);\n\n // turn trainData and testData into tensors\n let [trainXs, trainYs] = toTensors(trainData);\n let [testXs, testYs] = toTensors(testData);\n // trainXs.print();\n // trainYs.print();\n // testXs.print();\n // testYs.print();\n\n // return\n return [trainXs, trainYs, testXs, testYs, headers.length - 1];\n}", "title": "" }, { "docid": "6a17e12ebdb0ac3b88928bbe460c16cf", "score": "0.54302937", "text": "function TextData() {}", "title": "" }, { "docid": "6a17e12ebdb0ac3b88928bbe460c16cf", "score": "0.54302937", "text": "function TextData() {}", "title": "" }, { "docid": "76e46fdf0087b8a596e17b7dbae81619", "score": "0.53914076", "text": "function getAllData () {\n return db_tk.allDocs(options);\n }", "title": "" }, { "docid": "ed7163127cb4d4d7ddb24281192ec497", "score": "0.5364786", "text": "function getAnnotatedDocuments() {\n var ccc=0;\n //Recupero documenti annotati\n // localhost franky simone\n var query = prefissi + \"SELECT DISTINCT ?item ?title\\\n WHERE { GRAPH \\<http://vitali.web.cs.unibo.it/raschietto/graph/ltw1539> {\\\n ?item a fabio:Item ;\\\n rdfs:label ?title .\\\n } }\";\n\n $(document).trigger('loadingAnnotatedDocs');\n\n var encodedQuery = encodeURIComponent(query);\n url = spar + \"?query=\" + encodedQuery + \"&format=json\";\n $.ajax({\n url: url,\n dataType: \"jsonp\",\n success: function(data) {\n var bindings = data.results.bindings;\n for (var i in bindings) {\n //verifica che i documenti recuperati non siano delle citazioni\n if ((bindings[i].item.value.indexOf(\"_cited_\") == -1) && (bindings[i].item.value.indexOf(\"_Reference\") == -1) && (bindings[i].item.value.indexOf(\"_ver\") == -1)) {\n var found = true;\n if(listaDocumenti.indexOf(bindings[i].item.value)==-1){\n listaDocumenti.push(bindings[i].item.value);\n found=false;\n ccc++;\n }\n if (!found) {\n //$(\".document [name='document']\").append(new Option(bindings[i].title.value, bindings[i].item.value, null, null));\n ////console.log(\"title: \" + bindings[i].title.value + \" value: \" + bindings[i].item.value);\n var $titoloDocumento = bindings[i].title.value;\n var $uriDocumento = bindings[i].item.value;\n var $puntini = \"\";\n if($titoloDocumento.length>=24){\n $puntini=\"...\";\n }\n $idDoc = \"doc\"+$contatoreDocs;\n var $documento = \"<li>\" +\n \"<a id=\\\"open_\"+$idDoc+\"\\\" getdocument=\\\"\"+$idDoc+\"\\\" title=\\\"\"+$titoloDocumento+\"\\\" uri=\\\"\"+$uriDocumento +\"\\\" short-title=\\\"\"+$titoloDocumento.substr(0,12)+\"...\\\">\"+$titoloDocumento.substr(0,24)+$puntini+\"</a>\" +\n \"</li>\";\n //console.log($('#'+$idDoc));\n $(\"#documenti_annotati\").append($documento);\n //$(\"#\"+$idDoc).on('click',function(){console.log('click');});\n loadClickedDocument(\"#open_\"+$idDoc);\n $contatoreDocs++;\n //console.log(new Option(bindings[i].title.value, bindings[i].item.value, null, null));\n };\n }\n }\n //loadAnnotatedDocs();\n $(document).trigger('annotatedDocsSuccess');\n },\n error: function(){\n $(document).trigger('annotatedDocsSuccess');\n $.notify({\n message: 'A causa di un errore di comunicazione con il server, non e\\' stato possibile scaricare i documenti annotati.'\n },{\n type: 'danger',\n position: 'fixed',\n placement: {\n from: \"bottom\",\n align: \"right\"\n },\n animate: {\n enter: 'animated fadeInDown',\n exit: 'animated fadeOutUp'\n },\n delay: 0\n });\n }\n }).then(function(){\n console.log(\"cont \" + ccc);\n });\n}", "title": "" }, { "docid": "1df542163694459e6234bbc8eebac9eb", "score": "0.5310226", "text": "function getDatamuse (req, res){\n console.log( 'Routing request for', req.params[0] );\n request.get({url:`https://api.datamuse.com/words?${req.params[0]}`}, function(err,response){\n res.send(response)\n })\n}", "title": "" }, { "docid": "c7e912c9c5da8d2eb55e138d262881ba", "score": "0.53054696", "text": "function getData(j){\n const testQuestions = jsonDoc['questions'][j];\n return testQuestions;\n}", "title": "" }, { "docid": "ff271b9037beef0d11a5af71358867ac", "score": "0.5305258", "text": "function doctype (data){\n\tvar response = null;\n\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: '../apirest/getdatadoc',\n\t\t\tdataType: 'json',\n\t\t\tdata: data,\n\t\t\tasync: false,\n\t\t\tsuccess: function(msg) {\n\t\t\t\tresponse = msg;\n\t\t\t}\n\t});\n\treturn response;\t\n}", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.5300904", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.5300904", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.5300904", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.5300904", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.5300904", "text": "function TextData() { }", "title": "" }, { "docid": "5988ed9fff86cbf0febf9a6782b40342", "score": "0.52887046", "text": "async retrieveDocuments(fulfillmentData, documentType) {}", "title": "" }, { "docid": "0b8a0e9d466d41ba5737b5be0d61f142", "score": "0.52524155", "text": "function wordnikResults(data){\n//var len=data.examples.length;\n\tif(!jQuery.isEmptyObject(data)){\ntextWordnik=data.examples[0].text;\n}\nelse(textWordnik=\"\");\n}", "title": "" }, { "docid": "8cd9700c17b9dd4a446ee7ac279a173b", "score": "0.5248209", "text": "async function getDatauseCallback(callback){\n\tlet {\n\t\ttext,\n\t\turl,\n\t\telements,\n\t\tpaginate:{\n\t\t\tpage, \n\t\t\tcount,\n\t\t\ttotal_pages\n\t\t}\n\t} = state;\n\n \tif(total_pages === page) return null;\n \t\n \t//replace url con datos actuales\n \turl = url\n \t\t.replace('{{page}}', total_pages? (page+1) : page)\n \t\t.replace('{{count}}', count)\n \t\t+((text !== '')? `&search=${text}`:'');\n\t\n\tlet response = await get(url);\n\tif(response){\n\n\t\tstate = {\n\t\t\t...state,\n\t\t\tpaginate: response.metadata,\n\t\t\telements: elements.concat(response.elements),\n\t\t};\n\t}\n\tcallback(new Date());\n}", "title": "" }, { "docid": "a8253ed83126820759bd414bf96d60fd", "score": "0.52255905", "text": "getTutorial(filterAllDocs, getOneDoc) {\n let httpOptions = { headers: new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__[\"HttpHeaders\"]({ 'Content-Type': 'application/json', 'token': localStorage.getItem('token') ? localStorage.getItem('token') : \"\" }) };\n let formData = !filterAllDocs ? { _id: \"\", code: \"\", descr: '' } : filterAllDocs;\n formData._id = !getOneDoc ? \"\" : getOneDoc;\n formData.code = filterAllDocs && filterAllDocs.code ? filterAllDocs.code : \"\";\n formData.descr = filterAllDocs && filterAllDocs.descr ? filterAllDocs.descr : \"\";\n let graphqlQuery = {\n \"query\": \"query getTutorialCode($_id: String!,$code: String!,$descr: String!) { getTutorialCode_Q(_id: $_id, code: $code, descr: $descr) { _id code descr Tutorial_role Tutorial_duty Tutorial_descr comments message } }\",\n \"variables\": {\n \"_id\": formData._id,\n \"code\": formData.code,\n \"descr\": formData.descr\n }\n };\n return this._http.post(this._graphQLURL, graphqlQuery, httpOptions);\n }", "title": "" }, { "docid": "42a18966eb1a9316fd001b7a1667d758", "score": "0.522279", "text": "function First_Generation_Survey_Information_BYDocumentID_fetch() {\r\n\r\n}", "title": "" }, { "docid": "894254e494465d667ed74a53e33e9712", "score": "0.5179964", "text": "function SetCurrentCorpus(callback){\n $.get(\"php/ajax/get_corpus_information.php\",\n {action:\"corpus_name\"}, function(corpus_name){\n $(\".corpus_select\").text(corpus_name)\n picked_corpus = corpus_name;\n callback(corpus_name);\n });\n }", "title": "" }, { "docid": "af8b96ca496812c2ec48a3e0fffbc94e", "score": "0.5179849", "text": "function TextData(){}", "title": "" }, { "docid": "f30489d3e19b178229dbc21cefb7c156", "score": "0.5169513", "text": "async function load_doc_topic_distr(model_name) {\r\n let filename = DATA_DIR + PREFIX + DOCTOPICS_FILENAME + \"_\" + model_name + \".txt\";\r\n return load_headerless_csv(filename);\r\n }", "title": "" }, { "docid": "bf1a06dd40621c9c3def619d38b1a3fc", "score": "0.5156404", "text": "async function getData() {\r\n // Hide result div initially =>\r\n dispNode(result,\"none\");\r\n\r\n // ## Clear previous results, by setting text(innerHTML) of divs =>\r\n setTextNode(list, \"\");\r\n setTextNode(title,\"\");\r\n setTextNode(speech, \"\");\r\n setTextNode(noRes, \"\");\r\n\r\n // Getting value typed in by the user =>\r\n var word = document.getElementById(\"searchBox\").value;// ## assign the value of the input element with id \"searchBox\"\r\n\r\n // CASE 1: Nothing has been typed by the user\r\n if (word == \"\" || word == null) {\r\n setTextNode(\r\n document.getElementsByClassName(\"errorMsg\")[0],\"Please Enter Any word\"\r\n );\r\n } else {\r\n // Build API URL =>\r\n var baseUrl = \"https://dictionaryapi.com/api/v3/references/learners/json/\";\r\n var apikey = \"6b5f2059-92e7-4761-b787-d7ff3514ae73\";\r\n var query = word;\r\n var url = baseUrl + query + \"?key=\" + apikey;\r\n console.log(url); // ## try it out in browser both for valid word and invalid word !note it returns a list\r\n // ## use this to inspect better if needed https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc\r\n \r\n // Fetch data from the built URL =>\r\n const def = await fetch(url);\r\n\r\n // Parse the data to JSON, jsonObj(camelCasing) =>\r\n const jsonObj = await def.json();\r\n\r\n // Logging Json object to console, to check result =>\r\n console.log(jsonObj[0]);\r\n\r\n // CASE 2: No such word exists, fetch closest ones, also provided by the API =>\r\n if (typeof jsonObj[0] == \"string\") {\r\n // Suggested words is passed =>\r\n var sugg = jsonObj[0];\r\n var len = jsonObj.length; //assign length of the jsonObj returned \r\n // Iterate through the jsonObj, and build suggested words list =>\r\n for (var i = 1; i < len; i++) {\r\n sugg = sugg + \", \" + jsonObj[i];\r\n }\r\n\r\n // Logging the suggested list =>\r\n console.log(sugg);\r\n\r\n\t\t\t// Set the results and reflect on page =>\r\n\t\t\tsetTextNode( noRes, \"Sorry! No results found. Did you mean any of \" + sugg + \"?\");\r\n\t\t\t\r\n } else {\r\n // CASE 3: Legit word searched, and API returns data, parse JSON =>\r\n // Access part of speech =>\r\n var partOfSpeech = jsonObj[0].fl;\r\n console.log(typeof jsonObj[0]);\r\n\r\n // Access definitons =>\r\n var defs = [];\r\n defs = jsonObj[0].shortdef;\r\n\r\n\t\t\t// Build definition output string =>\r\n var output = \"\";\r\n for (var i = 0; i < defs.length; i++) {\r\n output = output + '<li class=\"define\">' + defs[i] + \"</li>\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Set the results and reflect on page =>\r\n\t\t\tsetTextNode(speech,partOfSpeech);\r\n\t\t\tsetTextNode(list,output);\r\n }\r\n\r\n\t\tsetTextNode(title,word);\r\n\t\tdispNode(result,\"flex\");\r\n }\r\n}", "title": "" }, { "docid": "3e2816546b38273d0d0a07060db1341a", "score": "0.51516706", "text": "setCorpusData(name, data) {\n\t\tvar metadata = [];\n\t\tvar aligntype = [];\n\n\t\t// extract data from each document\n\t\tdata.forEach(docObj => {\n\n\t\t\t// system defined\n\t\t\tdocObj.metadata.forEach(entry => {\n\t\t\t\tlet metaname = entry.zhname;\n\t\t\t\tif (metadata.indexOf(metaname) < 0) metadata.push(metaname);\n\t\t\t});\n\n\t\t\t// user defined\n\t\t\tdocObj.udefmetadata.forEach(entry => {\n\t\t\t\tlet metaname = entry.name;\n\t\t\t\tif (metadata.indexOf(metaname) < 0) metadata.push(metaname);\n\t\t\t});\n\n\t\t\t// align tag\n\t\t\t$(docObj.content).find('AlignBegin').each(function() {\n\t\t\t\tlet type = $(this).attr('Type');\n\t\t\t\tif (aligntype.indexOf(type) < 0) aligntype.push(type);\n\t\t\t});\n\t\t});\n\n\t\t// default align type\n\t\taligntype.push('FullText');\n\n\t\t// record corpus name - unique corpus id as corpus name\n\t\tthis.corporaRecord[name] = (name in this.corporaRecord) ?this.corporaRecord[name]+1 :0;\n\t\tvar suffix = (this.corporaRecord[name] > 0) ?`(${ this.corporaRecord[name] })` :'';\n\t\tname += suffix;\n\n\t\t// sub UI\n\t\tthis.metaSettingUI.addItems(metadata, name);\n\t\tthis.alignSettingUI.addItems(aligntype, name);\n\t\tthis.mainUI.setCorpusData(name, data, aligntype, {\n\t\t\tmetadata: this.metaSettingUI.target,\n\t\t\taligntype: this.alignSettingUI.target\n\t\t});\n\t}", "title": "" }, { "docid": "3bf1545f629dc14d9f8ef24738d7431f", "score": "0.51515335", "text": "function handleDocData(response) {\n if (response.doc_Id > 0)\n intakeTemplatestDatalayer.DownloadTemplate(response.doc_Id);\n }", "title": "" }, { "docid": "a9cf915b10330380fccd008e5cff3ed1", "score": "0.5146221", "text": "getDoc() {\n let dataPointDoc = {\n latitude: this.position.lat,\n longitude: this.position.lon,\n acceleration: this.acceleration,\n speed: this.speed,\n time: this.time,\n suggestion: this.suggestion\n }\n return dataPointDoc;\n }", "title": "" }, { "docid": "31faa6add13e5261d88f06d21105e0df", "score": "0.5145241", "text": "function getData() {\n\tclearOutputFiles();\n\tyelp.search({term: term, location: location, sort: sort}, function(error, data) {\n\t\tvar err = error;\n\t\tvar total = data[\"total\"];\n\t\tvar requests = [];\n\t\tfor (var offset = 0; offset < total; offset += 20) {\n\t\t\tvar restaurantCB = function(error, data) {\n\t\t\t\taddData(data);\n\t\t\t}\n\t\t\trequests.push(yelp.search({term: term, location: location, offset: offset}, restaurantCB))\n\t\t}\n\t\tprint(\"# Running async requests for Yelp and Google data.\");\n\t\tasync.seq(requests);\n\t});\n}", "title": "" }, { "docid": "f29c08acc8c48b6fdb388a045df9f1bd", "score": "0.51326144", "text": "function getNewsData() {\n request({\n url: nyTimesApi,\n json: true\n }, function (err, res, body) {\n news = body.results;\n return news;\n });\n\n\n}", "title": "" }, { "docid": "b16b9ced66be57e55f7cd9ec375bed37", "score": "0.512557", "text": "function getCollectionData(collection) {\n return collection.docs.map(getDocData);\n}", "title": "" }, { "docid": "5e6097a4a60c76e72f05fbbc1b709167", "score": "0.50949913", "text": "async function getData () {\n db.collection('products').get().then((doc)=>{\n doc.docs.forEach(item=>{\n const data = item.data()\n const defaultProduct = data.params.recommendedProducts[\"Size Özel\"] // First Product\n const defaulCategories = data.params.userCategories // Categories Data\n loadingCart(); // Loading\n getCategories(defaulCategories) // Call Categories\n getProducts(defaultProduct) // Call Products\n NavbarClickEvent('click',data); // Click Event\n })\n })\n}", "title": "" }, { "docid": "39555799a302af8076c4888e55bc258b", "score": "0.5094895", "text": "function dataResponse(tempData) {\r\n\tmyData = tempData;\r\n\tfor (var i = 0; i < tempData.response.docs.length; i++) {\r\n\t\ttempTextH = tempData.response.docs[i].headline.print_headline;\r\n\t\ttempTextS = tempData.response.docs[i].snippet;\r\n\t}\r\n}", "title": "" }, { "docid": "dade57346beabe129abad3c4d266222b", "score": "0.5076629", "text": "function getData (args, ref, done) {\n var str = qb.otm.select(args, ref);\n args.db.client.query(str, function (err, rows) {\n if (err) return done(err);\n done(null, rows);\n });\n}", "title": "" }, { "docid": "6558f8a84f481a1c59fb9e263878de78", "score": "0.50739795", "text": "function getData(string, callback) {\n var forms = retrieve(string);\n callback(forms);\n }", "title": "" }, { "docid": "e71d7ad546ec70ecc2d706f2415e7de8", "score": "0.5062126", "text": "function getData() {\n var dropdownMenu = d3.select(\"#selDataset\");\n // Assign the value of the dropdown menu option to a variable\n var dataset = dropdownMenu.property(\"value\");\n // Initialize an empty array for the data\n var data = [];\n\n if (dataset == 'sc') {\n data = sc;\n }\n else if (dataset == 'mc') {\n data = mc;\n }\n else if (dataset == 'lc') {\n data = lc;\n }\n else if (dataset == 'all') {\n data = all;\n }\n // Call function to update the chart\n updatePlotly(data);\n}", "title": "" }, { "docid": "ae465b70e1d3a5752a3833a94c8682da", "score": "0.5060512", "text": "function handleDocData(response) {\n if (response.doc_Id > 0)\n templatestDatalayer.DownloadTemplate(response.doc_Id);\n }", "title": "" }, { "docid": "6610cdd5f17294f2a91e3d011a6bcb24", "score": "0.5056521", "text": "function getDocData( f, useAppPop ) {\n\t\t//needed on popups in popups\n\tif( useAppPop == undefined )\n\t\tuseAppPop = false;\n\n\tvar i, types = [], mArgs = [], type, fretval = \"\";\n\n\t\t//adds a type to the types list if it doesnt exist yet\n\tvar tryAddType = function( typelst ) {\n\t\tvar tlst = typelst.split( \"\\n\" )\n\t\tfor( i = 0; i < tlst.length; i++ ) {\n\t\t\tif( !tlst[i] ) return;\n\t\t\tif( types.indexOf( tlst[i] + \"\\n\" ) == -1 )\n\t\t\t\ttypes.push( tlst[i] + \"\\n\" );\n\t\t}\n\t}\n\n\t\t//convert constructor line\n\tfor( i in f.pNames )\n\t\tif( f.pNames[i] == \"event\" ) {\n\t\t\tGlobals.useEventPop = true;\n\t\t\tmArgs.push(\n\t\t\t\t\"<a pop = \\\"\" + Globals.saveHref + '\" href = \"\" onclick = \\'$( this.getAttribute( \"pop\" ) ).bind( {popupafterclose:function(){$( \"#pop_std_evt\" ).popup( \"open\", {\"transition\":\"pop\"} )}} );$( this.getAttribute( \"pop\" ) ).popup( \"close\" )\\'>event</a>'\n\t\t\t);\n\t\t} else if( useAppPop ) {\n\t\t\tmArgs.push( appPopup.replace( \"%s\", typeDesc( f.pTypes[i] ) )\n\t\t\t\t.replace( \"%s\", f.pNames[i] ).replace( \"<b>\", \"\" ).replace( \"</b>\", \"\" ) )\n\t\t} else {\n\t\t\tvar pop = argToPop( f.pNames[i], f.pTypes[i] );\n\t\t\tmArgs.push( pop.txt );\n\t\t\ttryAddType( pop.fnc );\n\t\t}\n\n\tmArgs = mArgs.length? \" \" + mArgs.join( \", \" ) + \" \" : \"\";\n\n\t\t//convert return value\n\tif( f.retval.length ) {\n\t\tvar type = f.retval;\n\t\ttype = skeys( consts ).indexOf( type + \"\\\"\" ) > -1 ? consts[type] : type;\n\t\tfretval = \" -> \" + typeDesc( type, true );\n\t}\n\n\t\t//return data if there are no subfunctions\n\tif( !Object.keys( f.subf ).length )\n\t\tif( useAppPop ) return { args : mArgs, ret : fretval }\n\t\telse return { args : mArgs, mets : \"\", pops : types.join( \"\" ), ret : fretval }\n\n\tvar k, methods = \"\",\n\t//fuction list\n\t\tkeys = Object.keys( f.subf ).sort();\n\n\tfor( k = 0; k < keys.length; k++ ) {\n\t\tvar met = f.subf[keys[k]], retval = \"\", type;\n\n\t\t\t//special popup for OnTouvh-event-object\n\t\tif( met.pNames.length == 1 && met.pTypes[0].constructor.name == \"Object\" &&\n\t\t\tmet.pTypes[0].pNames.length == 1 && met.pTypes[0].pNames[0] == \"event\" )\n\t\t\tGlobals.saveHref = true;\n\n\t\t\t//convert return value\n\t\tif( met.retval.length ) {\n\t\t\tvar type = met.retval;\n\t\t\ttype = ( skeys( consts ).indexOf( type + \"\\\"\" ) > -1 ) ? consts[type] : type;\n\t\t\tretval = \" -> \" + typeDesc( type );\n\t\t}\n\n\t\t\t//convert function types\n\t\tif( met.isfunc ) {\n\t\t\tvar args = [], type, pop;\n\t\t\tfor( i in met.pNames ) {\n\t\t\t\ttype = met.pTypes[i];\n\t\t\t\tif( type.constructor.name != \"Object\" )\n\t\t\t\t\ttype = ( skeys( consts ).indexOf( type + \"\\\"\" ) >= 0 ) ? consts[type] : type;\n\t\t\t\tpop = argToPop( met.pNames[i], type );\n\t\t\t\targs.push( pop.txt );\n\t\t\t\ttryAddType( pop.fnc );\n\t\t\t}\n\t\t\tpop = descPopup( met.name, replW( met.desc ) );\n\t\t\ttryAddType( pop.fnc );\n\t\t\tmethods += funcBase.replace( \"%s\", pop.txt + ( args.length? \"( \" +\n\t\t\t\targs.join( \", \" ) + \" )\" : \"()\" ) + retval );\n\t\t} else { //convert other types\n\t\t\tvar pop = descPopup( met.name, replW( met.desc ) );\n\t\t\ttryAddType( pop.fnc );\n\t\t\tmethods += funcBase.replace( \"%s\", pop.txt + retval );\n\t\t}\n\t}\n\tif( Globals.useEventPop )\n\t\ttryAddType( eventPop );\n\treturn { args : mArgs, mets : methods, pops : types.join( \"\" ), ret : fretval }\n}", "title": "" }, { "docid": "5cf9155fb74faffaff22c435b7325562", "score": "0.5056014", "text": "function getDataGuide(cb) {\n nodbUtil.checkAsyncArgs(arguments, 1, 1);\n this._getDataGuide(cb);\n}", "title": "" }, { "docid": "e3320357bacbac64d9830e357a00e0b9", "score": "0.5054091", "text": "async function fetchThesis(val) {\n await db.collection('thesis').doc(val).get().then((doc) => {\n if (doc.exists) {\n questionHeader.innerText = doc.data().title;\n questionText.innerText = doc.data().thesis;\n loading();\n } else {\n // doc.data() will be undefined in this case\n alert(\"Leider ist ein Fehler aufgetreten :-( \");\n }\n }).catch((error) => {\n console.log(\"Error getting document:\", error);\n });\n}", "title": "" }, { "docid": "ca08e281e52b201c845241158e11a330", "score": "0.5049381", "text": "async getDataApiKeyword() {\n try {\n const answer = await fetch(`${this.getUrl}${this.getKeyword}${this.getApiKey}&limit=100`);\n let data = await answer.json();\n return data.data;\n } catch {\n console.error(error);\n }\n }", "title": "" }, { "docid": "246703552b4fc7ab0e4cb8b9dc16ced5", "score": "0.502586", "text": "function _getProgramDocument() {\r\n return $http.get('/admin/getProgramDocument');\r\n }", "title": "" }, { "docid": "078d4fcbb91817f949075f7f6741c116", "score": "0.5020647", "text": "function UpdateSubCorpus(){\n $.getJSON(\"php/ajax/get_corpus_information.php\",\n {\n action: \"text_names\", \n lang: picked_lang,\n corpus_name:picked_corpus, \n },\n function(textlist){\n var $ul = $(\"<ul>\");\n var $a = $(\"<a href='javascript:void(0);' >Unselect all</a>\");\n $a.click(function(){\n Utilities.SelectAll($(this));\n SetPickedTexts();\n });\n $ul.append($(\"<li class='sel_all_link'></li>\").append($a));\n $.each(textlist,function(idx,el){\n var $gal = $(\"<span><input type='checkbox' checked='true' value='\" \n + el.code + \"'></input></span>\");\n var $name = $(`<span> <strong>${el.code}:</strong> <span class='el_title'>${el.title}</span> </span>`);\n var $li = $(\"<li>\").append($gal).append($name);\n $ul.append($li);\n });\n $ul.appendTo($(\"#text_picker_for_sobcorpus\").html(\"\"));\n //Updating when picking the texts for the current subcorpus\n $(\"#text_picker_for_sobcorpus input[type='checkbox']\").click(function(){SetPickedTexts();});\n SetPickedTexts();\n }); }", "title": "" }, { "docid": "cf172f57262c0cc541b434fb9ba67fb7", "score": "0.50198364", "text": "async parseDocument(doc)\n {\n // dumb helper function \n function isString (obj) {\n return (Object.prototype.toString.call(obj) === '[object String]');\n }\n\n if (isString(doc))\n doc = JSON.parse(doc)\n \n if (doc.hasOwnProperty('text_snippet') && \n doc.text_snippet.hasOwnProperty('content'))\n {\n console.log(\"*****Reparsing data from file****\")\n let sentencesSplit = split(doc.text_snippet.content)\n console.log(sentencesSplit)\n\n return {\n documentData: doc,\n sentenceData: sentencesSplit \n }\n }\n else\n throw new Error(\"Schema Validation Error: \"+ JSON.stringify(doc).substr(0,500)+\" ... \");\n }", "title": "" }, { "docid": "8889a1334a9bc0baceea158c73f63527", "score": "0.5018147", "text": "function getData() {\r\n var loadedData = loadData();\r\n return loadedData;\r\n}", "title": "" }, { "docid": "c2b5d4339c64292ed25b4cf97b8a2815", "score": "0.5018047", "text": "_dataObjectStructure(doc) {\n let entry = [doc.id, doc.data()]\n const dataObject = new this.DataObject()\n dataObject.fromEntry(entry)\n return dataObject\n }", "title": "" }, { "docid": "ca6d526ee21a3d5a4ebb22c2e658940c", "score": "0.50052094", "text": "getDataInfo(dataId) {\n return this.texData.get(dataId);\n }", "title": "" }, { "docid": "ca6d526ee21a3d5a4ebb22c2e658940c", "score": "0.50052094", "text": "getDataInfo(dataId) {\n return this.texData.get(dataId);\n }", "title": "" }, { "docid": "f9719d418d964a2cc1f3d340573f3fdd", "score": "0.49881005", "text": "function listDocsbyUserAndCat(idCate) {\n\t\t$scope.loading=true;\n\t\t$http({\n\t\t\tmethod : 'GET',\n\t\t\turl : baseUrl+'mon_espace/documents/list/'+parseInt(idADmin)+'/'+parseInt(idCate),\n\t\t\tdata : {},\n\t\t\theaders:{'Authorization': 'Bearer '+localStorage.getItem('jeton')}\n\t\t}).then(function successCallback(response) {\n\t\t\t$scope.loading=false;\n\t\t\t//console.log(\"$scope.listDocsbyUserAndCats \",response.data)\n\t\t\t$scope.listDocsbyUserAndCats = response.data.documents_list;\n\t\t}).catch(function (err) {\n\t\t\tif(err.status==500 && localStorage.getItem('jeton')!='' && localStorage.getItem('jeton')!=null && localStorage.getItem('jeton')!=undefined){\n\t\t\t\tdeconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function (response) {\n\t\t\t\t\t\t\t$location.url('/access/login');\n\t\t\t\t\t\t\t$state.go('access.login');\n\t\t\t\t\t\t}).catch(function (response) {\n\t\t\t\t});\n\t\t\t};\n\t\t});\n\t}", "title": "" }, { "docid": "7f1efcd4a110710888ccf162eed2333d", "score": "0.49861372", "text": "function grab_data(anon_id)\n{\n // set the apikey and limit\n var apikey = process.env.TENOR_API;\n console.log(\"TENOR API - \" + apikey)\n var lmt = 50;\n\n // test search term\n var search_term = \"monke\";\n\n // using default locale of en_US\n var search_url = \"https://api.tenor.com/v1/search?contentfilter=medium&tag=\" + search_term + \"&key=\" +\n apikey + \"&limit=\" + lmt + \"&anon_id=\" + anon_id;\n \n\n httpGetAsync(search_url,tenorCallback_search);\n\n // data will be loaded by each call's callback\n return;\n}", "title": "" }, { "docid": "1b8cb7ecc436b89d3cbff1d6945e284c", "score": "0.49689552", "text": "static async getUserData(userId) {\n const doc = await firebase\n .firestore()\n .collection(\"users\")\n .doc(userId)\n .get();\n\n return doc.data();\n }", "title": "" }, { "docid": "83b5ad477211c5120fcc2e3f61436f85", "score": "0.49457404", "text": "function peticionAutor(nombreAutor){\n peticion=\"http://openlibrary.org/search.json?author=\"\n request.get(peticion+nombreAutor,(err,res,body)=>{\n const json=JSON.parse(body)\n let datosLibros=json.docs\n console.log(\"********* Libros de : \"+nombreAutor+\" ***************\");\n for (var i = 0; i < datosLibros.length; i++) {\n console.log(datosLibros[i].title);\n }\n })\n}", "title": "" }, { "docid": "ac1056fb26d60e410746bdf0ddbf1a52", "score": "0.49395123", "text": "async function getDataFrom(query)\n{\n const baseUrl = \"https://crossref.citation-api.com/query?search=\";\n\n const fetchUrl = baseUrl + url.parse(query).href;\n const response = await fetch(fetchUrl);\n const text = await response.text();\n\n const textObject = JSON.parse(text).results;\n\n return textObject.map(e => e.data);\n}", "title": "" }, { "docid": "fc145473364c8517ca181a64af60867e", "score": "0.4928273", "text": "function get_mongo_data(docs){\n db_verguenza = docs;\n}", "title": "" }, { "docid": "968b7bda22f4aa954e6af78f3766e2cc", "score": "0.4923686", "text": "function getData() {\n http_request.method = \"GET\";\n http_request.endPoint = \"selectCYE\";\n Http_Request.Http_Request(http_request,{},function (response) {\n if(response.data.success)$scope.lista_criterios_y_estandares = response.data.data;\n else $.notify(\"Error!\",response.data.message,\"info\")\n });\n http_request.endPoint = \"selectComponentes\";\n Http_Request.Http_Request(http_request,{},function (response) {\n if(response.data.success) $scope.lista_componentes = response.data.data;\n else $.notify(\"Error!\",response.data.message,\"info\");\n });\n }", "title": "" }, { "docid": "2efe22c05c0a37e321e4faff632af942", "score": "0.4923332", "text": "function getSpaceDocs(filterSpace) { \t\t\r\n jQuery.ajax({\r\n url: webServicePath,\r\n\t\t\tcrossDomain: true,\r\n type: 'GET',\r\n dataType: 'json',\r\n data: {\r\n FunctionName: 'getSpaceDocs',\r\n\t\t\t\tSpaceID: filterSpace\r\n },\r\n success: function (data) { \r\n\t\t\t\tbuildDocs(data);\r\n }\r\n });\r\n }", "title": "" }, { "docid": "00c844d4e9ccb0ad7a7f40afadc3ac2f", "score": "0.4923329", "text": "function getData() {\n var dropdownMenu = d3.select(\"#selDataset\");\n // Assign the value of the dropdown menu option to a variable\n var dataset = dropdownMenu.property(\"value\");\n // Initialize an empty array for the country's data\n \n \n for (var i = 0; i < data.names.length; i++) {\n if (dataset === data.names[i]) {\n init(i);\n return\n }\n }\n // Call function to update the chart\n //updatePlotly(data);\n }", "title": "" }, { "docid": "c7afd191914f4ca49921fc71b8523816", "score": "0.49146524", "text": "function loadDoc(url, cFunction) {\n var xhttp;\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n cFunction(this);\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "title": "" }, { "docid": "19010bddab5f788b9db2cb496c2f6038", "score": "0.491139", "text": "function getData(text, withGlobalSession) {\n if (withGlobalSession) {\n return {\n \"ApiKey\": \"\" + settings.ApiKey + \"\",\n \"GlobalSessionId\": \"\" + globalSessionId + \"\",\n \"Text\": \"\" + text + \"\",\n \"Language\": \"\" + settings.Lang + \"\",\n \"Rule\": \"\" + settings.Rule + \"\",\n \"Grammar\": \"\" + checkGrammar + \"\",\n \"Spell\": \"\" + checkSpelling + \"\",\n \"Style\": \"\" + checkStyle + \"\",\n \"RequestFormat\": \"\" + settings.requestFormat + \"\",\n \"IEDomain\": \"\" + window.location + \"\",\n \"SessionMetadata\": \"\" + buildSessionMetadata() + \"\"\n\n };\n }\n else {\n return {\n \"ApiKey\": \"\" + settings.ApiKey + \"\",\n \"Text\": \"\" + text + \"\",\n \"Language\": \"\" + settings.Lang + \"\",\n \"Rule\": \"\" + settings.Rule + \"\",\n \"Grammar\": \"\" + checkGrammar + \"\",\n \"Spell\": \"\" + checkSpelling + \"\",\n \"Style\": \"\" + checkStyle + \"\",\n \"RequestFormat\": \"\" + settings.requestFormat + \"\",\n \"IEDomain\": \"\" + window.location + \"\",\n \"SessionMetadata\": \"\" + buildSessionMetadata() + \"\"\n };\n\n }\n }", "title": "" }, { "docid": "b8cbaf8aadf43ec0ecfff2d83e77a441", "score": "0.4894976", "text": "async function getDocmentsList() {\n const docsResu = await queryService({\n uri:\n \"http://eip-med-tst-sesd.applications.services.axa-tech.intraxa/ws/fr-ged-src-documents-v4-vs\",\n body: searchEmployee()\n });\n\n const docs = get(docsResu, [\n \"soapenv:Envelope\",\n \"soapenv:Body\",\n \"tns1:SearchDocumentsResponse\",\n \"Documents\",\n \"Document\"\n ]);\n console.log(\"docs: \", docs);\n\n let newDocs = docs.map(item => {\n let properties = get(item, \"Properties.Property\");\n let types = properties.filter(p => p.Key === \"ecm_TypeDocument\");\n\n return {\n docId: item.DocId,\n type: types[0].Value\n };\n });\n\n return newDocs;\n}", "title": "" }, { "docid": "5df9087d9030070085b02a35b7cfb243", "score": "0.48892066", "text": "async getDataset(projectId, callback, options) {\n // Users\n let users = null\n try {\n const userRes = await scitran.getUsers()\n users = !options.isPublic && userRes ? userRes.body : null\n } catch (err) {\n // The user request failed\n }\n\n // Dataset\n try {\n const projectRes = await scitran.getProject(projectId, options)\n if (projectRes.status !== 200) {\n return callback(projectRes)\n }\n const project = projectRes ? projectRes.body : null\n if (project) {\n let tempFiles = project.files ? this._formatFiles(project.files) : null\n this.getMetadata(\n project,\n metadata => {\n let dataset = this.formatDataset(\n project,\n metadata['dataset_description.json'],\n users,\n )\n dataset.README = metadata.README\n dataset.CHANGES = metadata.CHANGES\n crn.getDatasetJobs(projectId, options).then(res => {\n dataset.jobs = res.body\n dataset.children = tempFiles\n dataset.showChildren = true\n this.usage(projectId, usage => {\n if (usage) {\n dataset.views = this.views(dataset, usage)\n dataset.downloads = this.downloads(dataset, usage)\n }\n callback(dataset)\n })\n })\n },\n options,\n )\n }\n } catch (err) {\n callback(err)\n }\n }", "title": "" }, { "docid": "4edcb1e1786077ca7f9a57c41aa5e6a8", "score": "0.48868847", "text": "function process(req_parameters, callback) {\n\t\n\tvar Cloudant = require('cloudant');\n\t\n\tvar cloudant = Cloudant({\n\t\taccount:req_parameters.username, \n\t\tpassword:req_parameters.password\n\t});\n\t\n\tvar db = cloudant.db.use(req_parameters.dbName);\n\n\t// gets docname from the database with query string {params}.\n\tdb.get(req_parameters.docId, { revs_info: false }, function(err, body) {\n\t if (!err)\n\t console.log(body);\n\t});\n\t\n}", "title": "" }, { "docid": "2289ad12ca0a9433ccb2b268a5198cd6", "score": "0.48729843", "text": "function doRequest(provincie){\n var xhr = new XMLHttpRequest();\n var url = ' https://ckan.dataplatform.nl/api/3/action/package_search?q=organization:' + provincie + '&rows=1000';\n xhr.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n var myArr = JSON.parse(this.responseText);\n console.log('\\n', provincie , '\\n');\n // console.log( myArr)\n dataCrunch(myArr)\n }\n export_file(dataset_list)\n };\n xhr.open(\"GET\", url, true);\n xhr.send();\n}", "title": "" }, { "docid": "44faa9978e1bb19fd62c84ed418bc46f", "score": "0.48699018", "text": "async getDocument () {\n if (!fs.existsSync(this.config.input)) {\n throw new GoldDiggerError(`File not exists ${this.config.input}`);\n }\n if (this.config.debug) console.log('Reading pdf');\n // read file\n const data = fs.readFileSync(this.config.input);\n if (this.config.debug) console.log(data.length);\n const doc = await pdf.getDocument({\n data: data,\n password: this.config.password,\n }).promise;\n return doc;\n }", "title": "" }, { "docid": "a9e2a25ae80f9db901b5690ad5ede9b4", "score": "0.48601255", "text": "function selectData(){\n MongoClient.connect(url, function(err, db){\n if (err) throw err; \n const dbo = db.db ('mydb'); \n dbo.collection ('medidas').findOne({}, {sort:{$natural:-1}},function(err, doc){\n //dbo.collection ('medidas').findOne({Medida:'humedad'}, {sort:{$natural:-1}},function(err, doc){ //Filtrar datos por medida\n if(err) throw err;\n console.log(doc);\n dato = doc;\n //Obtener datos del json\n /*console.log(\"Temperatura:\" + doc.temperatura);\n console.log(\"Viento:\" + doc.viento);\n console.log(\"Temperatura:\" + doc.humedad);*/\n db.close();\n }); \n\n });\n}", "title": "" }, { "docid": "b57c189c7cb50c795c380c7e45c0b147", "score": "0.4855109", "text": "function getData(req,res){\n res.send(sentimentData);\n}", "title": "" }, { "docid": "982204baeda2ba62206b769b30adcbad", "score": "0.48505506", "text": "async function getData (req, store) {\n\tlet session = req.session;\n\tlet view;\n\n\tif (req.args._trace) {\n\t\treq.args._trace.push ([\"getData-start\", new Date ().getTime ()]);\n\t}\n\tif (req.args.query) {\n\t\tview = store.getView (req.args.query);\n\t} else\n\tif (req.args.model) {\n\t\tview = getModelView (req.args.model, store, req.args);\n\t} else {\n\t\tthrow new Error (\"query or model not exist\");\n\t}\n\tif (!req.args.hasOwnProperty (\"offset\")) {\n\t\treq.args.offset = 0;\n\t}\n\tif (!req.args.hasOwnProperty (\"limit\")) {\n\t\treq.args.limit = config.query.maxCount;\n\t}\n\tlet query = view.get (\"query\");\n\tlet tokens = [], json = \"\", str = \"\", classMap = {}, caMap = {}, selectAliases = [], aliasPrefix = {};\n\tlet hasSelectCount = false, hasTree = false;\n\n/*\n\tfor (let i = 0; i < query.length; i ++) {\n\t\tlet c = query [i];\n\n\t\tif (c == \"{\") {\n\t\t\ttokens.push (str);\n\t\t\tstr = \"\";\n\t\t\tjson += c;\n\t\t} else\n\t\tif (c == \"}\") {\n\t\t\tjson += c;\n\t\t\tjson = JSON.parse (json);\n\n\t\t\tif (json [\"param\"]) {\n\t\t\t\ttokens.push (json);\n\t\t\t} else\n\t\t\tif (json [\"class\"] || json [\"model\"]) {\n\t\t\t\tlet cls = store.getClass (json [\"class\"] || json [\"model\"]);\n\n\t\t\t\ttokens.push (cls.getTable () + \" \" + json [\"alias\"]);\n\t\t\t\tclassMap [json [\"alias\"]] = cls\n\t\t\t} else {\n\t\t\t\tif (json [\"count\"] == \"begin\") {\n\t\t\t\t\thasSelectCount = true;\n\t\t\t\t}\n\t\t\t\tif (json [\"tree\"] == \"filter\") {\n\t\t\t\t\thasTree = true;\n\t\t\t\t}\n\t\t\t\ttokens.push (json);\n\t\t\t}\n\t\t\tjson = \"\";\n\t\t} else\n\t\tif (json == \"\") {\n\t\t\tstr += c;\n\t\t} else {\n\t\t\tjson += c;\n\t\t}\n\t}\n\tif (str) {\n\t\ttokens.push (str);\n\t}\n*/\n\tlet queryTokens = query.split (\"{\");\n\n\ttokens.push (queryTokens [0]);\n\n\tfor (let i = 1; i < queryTokens.length; i ++) {\n\t\tlet strTokens = queryTokens [i].split (\"}\");\n\n\t\tjson = JSON.parse (`{${strTokens [0]}}`);\n\n\t\tif (json [\"param\"]) {\n\t\t\ttokens.push (json);\n\t\t} else\n\t\tif (json [\"class\"] || json [\"model\"]) {\n\t\t\tlet cls = store.getClass (json [\"class\"] || json [\"model\"]);\n\n\t\t\ttokens.push (cls.getTable () + \" \" + json [\"alias\"]);\n\t\t\tclassMap [json [\"alias\"]] = cls\n\t\t} else {\n\t\t\tif (json [\"count\"] == \"begin\") {\n\t\t\t\thasSelectCount = true;\n\t\t\t}\n\t\t\tif (json [\"tree\"] == \"filter\") {\n\t\t\t\thasTree = true;\n\t\t\t}\n\t\t\ttokens.push (json);\n\t\t}\n\t\ttokens.push (strTokens [1]);\n\t}\n\tif (req.args.accessFilters && req.args.accessFilters.length) {\n\t\ttokens = addAccessFilters (tokens, req.args.accessFilters);\n\t}\n\tfor (let i = 0; i < tokens.length; i ++) {\n\t\tlet o = tokens [i];\n\n\t\tif (o && typeof (o) == \"object\") {\n\t\t\tif (o [\"attr\"] || o [\"prop\"]) {\n\t\t\t\tlet t = (o [\"attr\"] || o [\"prop\"]).split (\".\");\n\t\t\t\tlet f, ca;\n\n\t\t\t\tif (t [1] == \"id\") {\n\t\t\t\t\tf = t [0] + \".fobject_id\";\n\t\t\t\t\tca = {\n\t\t\t\t\t\tname: \"id\",\n\t\t\t\t\t\tcode: \"id\",\n\t\t\t\t\t\tclassId: classMap [t [0] || \"\"].get (\"id\"),\n\t\t\t\t\t\tclassAttrId: null,\n\t\t\t\t\t\ttype: 2,\n\t\t\t\t\t\tisId: true\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tif (!classMap [t [0] || \"\"]) {\n\t\t\t\t\t\tthrow new Error (`unknown model: ${JSON.stringify (o)}`);\n\t\t\t\t\t}\n\t\t\t\t\tca = classMap [t [0] || \"\"].attrs [t [1]];\n\n\t\t\t\t\tif (!ca) {\n\t\t\t\t\t\tthrow new Error (`unknown property: ${t [1]}, model: ${classMap [t [0] || \"\"].getPath ()}`);\n\t\t\t\t\t}\n\t\t\t\t\tf = t [0] + \".\" + ca.getField ();\n\t\t\t\t}\n\t\t\t\tif (o [\"alias\"] || o [\"as\"]) {\n\t\t\t\t\tf += \" as \" + (o [\"alias\"] || o [\"as\"]);\n\t\t\t\t\tcaMap [o [\"alias\"] || o [\"as\"]] = ca;\n\t\t\t\t\tselectAliases.push (o [\"alias\"] || o [\"as\"]);\n\t\t\t\t\taliasPrefix [o [\"alias\"] || o [\"as\"]] = t [0];\n\t\t\t\t}\n\t\t\t\ttokens [i] = f;\n\t\t\t}\n\t\t}\n\t}\n\tif (req.args.filters && req.args.filters.length) {\n\t\ttokens = addFilters (tokens, req.args.filters, caMap, aliasPrefix);\n\t}\n\tif (req.args.getColumns) {\n\t\ttokens = removeWhere (tokens);\n\t}\n\tif (req.args.order && _.isArray (req.args.order)) {\n\t\ttokens = addOrder (tokens, req.args.order, caMap, aliasPrefix);\n\t}\n\tlet fields = [];\n\tlet data = {\n\t\trecs: await store.query ({session, sql: getQuery ({code: \"data\", tokens, args: req.args}), fields, rowMode: \"array\", _trace: req.args._trace}),\n\t\tposition: []\n\t};\n\tdata.cols = await getViewAttrs (data.recs, view, caMap, store, fields, selectAliases);\n\n\tif (_.has (req.args, \"offset\") && _.has (req.args, \"limit\") && !req.args.getColumns) {\n\t\tif (hasSelectCount) {\n\t\t\tif (req.args.limit != config.query.maxCount) {\n\t\t\t\tlet recs = await store.query ({session, sql: getQuery ({code: \"count\", tokens, args: req.args}), _trace: req.args._trace});\n\n\t\t\t\tdata.length = recs [0].num;\n\t\t\t} else {\n\t\t\t\tdata.length = data.recs.length;\n\t\t\t}\n\t\t}\n\t\tif (hasTree) {\n\t\t\tif (data.recs.length) {\n\t\t\t\tlet parents = [];\n\n\t\t\t\tfor (let i = 0; i < fields.length; i ++) {\n\t\t\t\t\tif (fields [i].alias == \"id\") {\n\t\t\t\t\t\tparents = _.map (data.recs, (rec) => {\n\t\t\t\t\t\t\treturn rec [i];\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\tdata.childs = await store.query ({session, sql: getQuery ({code: \"tree\", tokens, args: req.args, parents})});\n\t\t\t} else {\n\t\t\t\tdata.childs = [];\n\t\t\t}\n\t\t\t// position\n\t\t\tlet pos = {};\n\n\t\t\t_.each (fields, f => {\n\t\t\t\tif (f.alias == \"id\") {\n\t\t\t\t\tpos.table = f.table;\n\t\t\t\t\tpos.id = f.column;\n\t\t\t\t}\n\t\t\t\tif (f.alias == \"parent\") {\n\t\t\t\t\tpos.parent = f.column;\n\t\t\t\t}\n\t\t\t\tif (f.alias == \"name\") {\n\t\t\t\t\tpos.name = f.column;\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (req.args.parent) {\n\t\t\t\tlet recs = await store.query ({\n\t\t\t\t\tsession, sql: `\n\t\t\t\t\t\twith recursive getParent as (\n\t\t\t\t\t\t\tselect ${pos.id}, ${pos.parent}, ${pos.name} from ${pos.table}\n\t\t\t\t\t\t\twhere ${pos.id} = ${req.args.parent}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tunion all\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tselect a.${pos.id}, a.${pos.parent}, a.${pos.name} from ${pos.table} a\n\t\t\t\t\t\t\tjoin getParent on getParent.${pos.parent} = a.${pos.id}\n\t\t\t\t\t\t)\n\t\t\t\t\t\tselect ${pos.id} as id, ${pos.parent} as parent, ${pos.name} as name from getParent\n\t\t\t\t\t\torder by ${pos.id}\n\t\t\t\t\t`\n\t\t\t\t});\n\t\t\t\tdata.position = recs;\n\t\t\t}\n\t\t}\n\t}\n\tif (req.args._trace) {\n\t\treq.args._trace.push ([\"getData-end\", new Date ().getTime ()]);\n\t\tdata._trace = req.args._trace;\n\t}\n\treturn data;\n}", "title": "" }, { "docid": "45072e0e27d9ef6c6f2562d500f66bd7", "score": "0.48450953", "text": "function getData(ct){\n\thttp.get(process.argv[ct + 2], function(response){\n\n\t\tresponse.pipe(bl(function(err, data){\n\n\t\t\tif(err){\n\t\t\t\treturn console.error(err);\n\t\t\t}\n\n\t\t\tdata = data.toString();\n\n\t\t\tdataList[ct] = data;\n\t\t\tindex++;\n\n\t\t\tif (index == 3) {\n\t\t\t\tdataList.forEach(function(data){\n\t\t\t\t\tconsole.log(data);\n\t\t\t\t});\n\t\t\t}\n\n\t\t}));\n\n\t});\n\n}", "title": "" }, { "docid": "b63ec38559f66b1a0a9587954aebe961", "score": "0.4842676", "text": "function textAnalysisCall(){\n event.preventDefault();\n let text=document.getElementById('txt').value;\n getAPIKey().then(function(keyDetails){\n let data=`key=${keyDetails.key}&of=JSON&lang=${keyDetails.lang}&txt=${text}`;\n textAnalysis(keyDetails.baseURL,data).then(function(data){\n updateUI(data);\n });\n});\n}", "title": "" }, { "docid": "0675f6d35a0a8fabec33871e3efedcd0", "score": "0.4840956", "text": "function _parseRdfaApiData(data){var dataset={};dataset['@default']=[];var subjects=data.getSubjects();for(var si=0;si<subjects.length;++si){var subject=subjects[si];if(subject===null){continue;}// get all related triples\nvar triples=data.getSubjectTriples(subject);if(triples===null){continue;}var predicates=triples.predicates;for(var predicate in predicates){// iterate over objects\nvar objects=predicates[predicate].objects;for(var oi=0;oi<objects.length;++oi){var object=objects[oi];// create RDF triple\nvar triple={};// add subject\nif(subject.indexOf('_:')===0){triple.subject={type:'blank node',value:subject};}else{triple.subject={type:'IRI',value:subject};}// add predicate\nif(predicate.indexOf('_:')===0){triple.predicate={type:'blank node',value:predicate};}else{triple.predicate={type:'IRI',value:predicate};}// serialize XML literal\nvar value=object.value;if(object.type===RDF_XML_LITERAL){// initialize XMLSerializer\nif(!XMLSerializer){_defineXMLSerializer();}var serializer=new XMLSerializer();value='';for(var x=0;x<object.value.length;x++){if(object.value[x].nodeType===Node.ELEMENT_NODE){value+=serializer.serializeToString(object.value[x]);}else if(object.value[x].nodeType===Node.TEXT_NODE){value+=object.value[x].nodeValue;}}}// add object\ntriple.object={};// object is an IRI\nif(object.type===RDF_OBJECT){if(object.value.indexOf('_:')===0){triple.object.type='blank node';}else{triple.object.type='IRI';}}else{// object is a literal\ntriple.object.type='literal';if(object.type===RDF_PLAIN_LITERAL){if(object.language){triple.object.datatype=RDF_LANGSTRING;triple.object.language=object.language;}else{triple.object.datatype=XSD_STRING;}}else{triple.object.datatype=object.type;}}triple.object.value=value;// add triple to dataset in default graph\ndataset['@default'].push(triple);}}}return dataset;}// register the RDFa API RDF parser", "title": "" }, { "docid": "03b63f67546e52127b23d917786a0c56", "score": "0.4838451", "text": "function getDocuments() {\n return new Promise((resolve, reject) => {\n $.ajax({\n url: \"https://raw.githubusercontent.com/sedc-codecademy/sedc7-04-ajs/master/g2/Class7/documents.json\",\n success: response => {\n resolve(JSON.parse(response))\n },\n error: error => {\n reject(error)\n }\n })\n })\n}", "title": "" }, { "docid": "c238e71e7b8d37d5e773d29fd828f48b", "score": "0.48372227", "text": "function getSomeExternalDataFromServer(text) {\n\treturn text;\n}", "title": "" }, { "docid": "b597c36b09ca785a37535744c594845a", "score": "0.48349106", "text": "function preParseData(getDataFunc = getData) {\n if (results.length == 0) {\n results = getDataFunc(fileName);\n }\n}", "title": "" }, { "docid": "7e139e6e26af55371bc9a9b6d448b5c8", "score": "0.48336595", "text": "function getData() {\n return data;\n }", "title": "" }, { "docid": "b8f1432e3e8f738f90cfc311b3c5da56", "score": "0.4830685", "text": "function getDati()\n{\n}", "title": "" }, { "docid": "3f1a3e92d8591ad47a91a66055b1f4a9", "score": "0.48299855", "text": "function FetchData(term) {\n\t\t\n\t\tvar requestData = {\n\t\t\t\t\"title-suggest\" : {\n\t\t\t\t\t\"prefix\" : term,\n\t\t\t\t\t\"completion\" : {\n\t\t\t\t\t\t\"field\" : \"title\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn new bbPromise(function(resolve, reject) {\t\t\t\n\t\t\trequest('http://10.0.2.2:9200/books/_suggest?pretty=true',{ json: true, body: requestData },function(error, res, body) {\n\t\t\t\tif(error){reject(error)};\n\t\t\t\tconsole.log(util.inspect(body, {showHidden: false, depth: null}));\n\t\t\t\tvar data = body['title-suggest'][0].options;\t\t\t\t\n\t\t\t\tvar results = lodash.map(data, '_source');\n\t\t\t\tresolve(results)\t\t\t\n\t\t\t});\t\t\t\n\t\t})\n\t}", "title": "" }, { "docid": "777f3d63568d44c8c10a3f7c40015c02", "score": "0.4825101", "text": "function getData(dataset, callback, errorCallback, options) {\n options = options || {};\n var api = _getAPI(dataset.api);\n api.getData(dataset, callback, errorCallback, options);\n }", "title": "" }, { "docid": "777f3d63568d44c8c10a3f7c40015c02", "score": "0.4825101", "text": "function getData(dataset, callback, errorCallback, options) {\n options = options || {};\n var api = _getAPI(dataset.api);\n api.getData(dataset, callback, errorCallback, options);\n }", "title": "" }, { "docid": "ea894b6cac840bfb732ef23c5a893d78", "score": "0.48216525", "text": "function GetDocumentList() {\n SMDocumentCtrl.ePage.Masters.Document.ListSource = undefined;\n let _filter = {\n Status: \"Success\",\n EntityRefKey: SMDocumentCtrl.ePage.Entities.EntityRefKey,\n };\n\n if (SMDocumentCtrl.ePage.Entities.IsDisableParentEntity != true) {\n _filter.ParentEntityRefKey = SMDocumentCtrl.ePage.Entities.ParentEntityRefKey;\n }\n\n if (SMDocumentCtrl.ePage.Entities.IsDisableAdditionalEntity != true) {\n _filter.AdditionalEntityRefKey = SMDocumentCtrl.ePage.Entities.AdditionalEntityRefKey;\n }\n\n if (SMDocumentCtrl.ePage.Masters.Document.RadioButtonValue == \"Upload\") {\n if (SMDocumentCtrl.mode == \"2\") {\n _filter.DocumentType = SMDocumentCtrl.type.DocType;\n } else {\n _filter.DocumentType = SMDocumentCtrl.ePage.Masters.Document.ActiveDocumentType.DocType == \"ALL\" ? SMDocumentCtrl.ePage.Masters.Document.DocumentTypeConfigValue : SMDocumentCtrl.ePage.Masters.Document.ActiveDocumentType.DocType;\n }\n } else if (SMDocumentCtrl.ePage.Masters.Document.RadioButtonValue == \"Generate\") {\n if (SMDocumentCtrl.mode == \"2\") {\n _filter.DocumentType = SMDocumentCtrl.type.DocType;\n } else {\n _filter.DocumentType = SMDocumentCtrl.ePage.Masters.Document.ActiveDocumentGenerate.Code == \"ALL\" ? SMDocumentCtrl.ePage.Masters.Document.DocumentGenerateConfigValue : SMDocumentCtrl.ePage.Masters.Document.ActiveDocumentGenerate.Code;\n }\n }\n\n let _input = {\n \"searchInput\": helperService.createToArrayOfObject(_filter),\n \"FilterID\": appConfig.Entities.JobDocument.API.FindAllWithAccess.FilterID\n };\n\n apiService.post(\"eAxisAPI\", appConfig.Entities.JobDocument.API.FindAllWithAccess.Url + authService.getUserInfo().AppPK, _input).then(response => {\n if (response.data.Response && response.data.Response.length > 0) {\n SMDocumentCtrl.ePage.Masters.Document.ListSource = response.data.Response;\n\n if (SMDocumentCtrl.ePage.Masters.Document.ListSource.length > 0) {\n SMDocumentCtrl.ePage.Masters.Document.ListSource.map(x => {\n x.DocumentNameTemp = x.DocumentName;\n x.GroupMapping = PrepareAccessInput(x);\n x.MailObj = PrepareEmailAsAttachment(x);\n x.SaveBtnTxt = \"Save\";\n x.IsDisableSaveBtn = false;\n });\n }\n } else {\n SMDocumentCtrl.ePage.Masters.Document.ListSource = [];\n }\n });\n }", "title": "" }, { "docid": "9a1270eb486ff6981b859018850f1b23", "score": "0.4819131", "text": "function getData(url, tagInfo, index){\r\n\t\treturn new Promise(function(resolve, reject){\r\n\t\t\tnoodle.query({\r\n\t\t\t\turl: url,\r\n\t\t\t\tselector: tagInfo[index].tag,\r\n\t\t\t\ttype: 'html',\r\n\t\t\t\textract: 'text'\r\n\t\t\t}).then(function(data){\r\n\t\t\t\tcontent[tagInfo[index].fieldName] = data.results;\r\n\t\t\t\tif (tagInfo.length > index+1){\r\n\t\t\t\t\tgetData(url, tagInfo, index+1)\r\n\t\t\t\t\t\t.then(function(){\r\n\t\t\t\t\t\t\tresolve();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresolve();\r\n\t\t\t\t}\r\n\t\t\t}).catch(function(err){\r\n\t\t\t\tgetData(url, tagInfo, index+1);\r\n\t\t\t});\r\n\t\t});\r\n}", "title": "" }, { "docid": "0430d4a33e55be733748eb85e69403e2", "score": "0.48128211", "text": "function getDocumentById (indexName, docId){\n\t\tconsole.log(indexName);\n\t\tconsole.log(docId);\n\t\tclient.get({\n\t\t index: indexName,\n\t\t id: docId\n\t\t}).then(function (resp) {\n\t\t\tconsole.log(resp);\n\t\t\tif(resp.hits.total === 0){\n\t\t\t\t$scope.hits = [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"_id\": \"No Document Found with id: \" + $scope.inputId,\n\t\t\t\t\t\t\"_type\": \"N/A\"\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t} else {\n\t\t\t\t$scope.result = resp;\n\t\t\t\t$scope.hits = resp.hits.hits;\n\t\t\t\tconsole.log(resp);\t\n\t\t\t}\n\t\t}, function (err) {\n\t\t\tconsole.log(err);\n\t\t})\n\t}", "title": "" }, { "docid": "0836b6324f71beeb2d335f0d2c0904c4", "score": "0.4803523", "text": "function DataApi() { }", "title": "" }, { "docid": "5fb5853d2e7f79054a5421cc53af30c2", "score": "0.48012656", "text": "function getCity() {\nvar docRef = db.collection(\"cities\").doc(\"SF\");\n\ndocRef.get().then(function(doc) {\n if (doc.exists) {\n console.log(\"Document data:\", doc.data());\n } else {\n // doc.data() will be undefined in this case\n console.log(\"No such document!\");\n }\n}).catch(function(error) {\n console.log(\"Error getting document:\", error);\n});\n\n}", "title": "" }, { "docid": "de1da447b9afb08d2be5311493b470bb", "score": "0.4800319", "text": "function GetDoc(URL, Callback) {\r\n var Rest = [];\r\n for (var N = 2; N < arguments.length; N++) {\r\n Rest.push(arguments[N]);\r\n }\r\n GM_xmlhttpRequest({\r\n method: \"GET\",\r\n url: URL,\r\n onload: function (responseDetails) {\r\n var Doc = document.implementation.createDocument(\"\", \"\", null),\r\n HTML = document.createElement(\"html\"),\r\n Head = document.createElement(\"head\"),\r\n Body = document.createElement(\"body\");\r\n Head.innerHTML = /<\\s*head[^>]*>((?:.|\\s)+?)<\\s*\\/head\\s*>/mi.\r\n exec(responseDetails.responseText)[1];\r\n Body.innerHTML = /<\\s*body[^>]*>((?:.|\\s)+?)<\\s*\\/body\\s*>/mi.\r\n exec(responseDetails.responseText)[1];\r\n Doc.appendChild(HTML);\r\n HTML.appendChild(Head);\r\n HTML.appendChild(Body);\r\n eval(\"Callback(Doc\" + (Rest.length ? \",\" : \"\") + Rest.join(\",\") + \");\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "585351214bdc2df018ebd595373fd6c9", "score": "0.47976446", "text": "function RecognitionLanguagesData() {\n }", "title": "" }, { "docid": "a93e90d411ba12c96ced2e6a6404128d", "score": "0.4791726", "text": "renderWithFreshData(searchTerm, cb) {\n return fetchTweets.byTopic(searchTerm, webTweets =>\n Tweet.searchTweets(searchTerm, function(dbTweets) {\n // Fetch matching db results\n const data = mergeResults(webTweets, dbTweets);\n const cloudData = formatResultsForCloud(data, true);\n const sentence = makeSentence(data, searchTerm);\n sentence.topWords = findTopWords(cloudData);\n sentence.trending = findTrendingWords(cloudData);\n return cb(cloudData, sentence);\n })\n );\n }", "title": "" } ]
a76f61c5a588420ba09cf253bdc82741
Function to get room name given room id
[ { "docid": "5d79c9907ff96d7ad0c4f0d044c60e7f", "score": "0.6695636", "text": "function getRoomNames(roomID, callback){\n\n\t\t\tmongoFind(\"roomid\", \"_id\", new ObjectID(roomID), null, function(result, extra){\n\t\t\t\tcallback(result);\n\t\t\t});\n\t}", "title": "" } ]
[ { "docid": "e2c1cfe4be86dba63d1c7639d585e5f6", "score": "0.7761873", "text": "function findTitle(room_id){\n\t\tvar n = 0;\n\t\twhile (n < rooms.length) {\n\t\t\tif (rooms[n].room_number == room_id) {\n\t\t\t\treturn rooms[n].room_name;\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tn++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "f4a21dc78bf0ce8d9d85e8ae75733d16", "score": "0.7758094", "text": "function findTitle(room_id){\n\t\tvar n=0;\n\t\twhile(n<rooms.length){\n\t\t\tif(rooms[n].room_number == room_id){\n\t\t\t\treturn rooms[n].room_name;\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tn++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "81a404cef16424dd311b195dbcf19c0f", "score": "0.7469606", "text": "function getRoomName(socket){\n\t// console.log(Object.keys(socket.rooms));\n\t// return Object.keys(socket.rooms)[1]\n\treturn roomStore[socket.id]\n}", "title": "" }, { "docid": "ac6cf4bd47266a7b7728e6582ea79b05", "score": "0.72333634", "text": "function getRoomName() {\n let regexUrl = /([a-z]+:\\/\\/){1}([a-z]+(:[0-9]+|(\\.[a-z]+)+)\\/(code){1}\\/)/;\n\n let url = window.location.href.replace(regexUrl, '');\n\n let roomName = url.split('/')[0];\n \n return roomName;\n}", "title": "" }, { "docid": "f41283c6c52270d5d49821bf927f6ac9", "score": "0.7223254", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n }", "title": "" }, { "docid": "2eb18a6187a561cbefbed5e73c192ee3", "score": "0.7217327", "text": "function outputRoomName(room) {\n roomName.innerHTML = room;\n}", "title": "" }, { "docid": "2eb18a6187a561cbefbed5e73c192ee3", "score": "0.7217327", "text": "function outputRoomName(room) {\n roomName.innerHTML = room;\n}", "title": "" }, { "docid": "d42bf1bde3f05960b366d4b2da86a28d", "score": "0.72151625", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n }", "title": "" }, { "docid": "80f069eff8e1036afaa7dd4e147044e9", "score": "0.7209807", "text": "function getGameRoomName(socket){\n return Object.keys(socket.rooms).find(function(room){\n return room.startsWith('game');\n });\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "79765aa8caf9249c182ea8420bf6cbc9", "score": "0.7036437", "text": "function outputRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "831c3440f974eaa320762a014f7a4e49", "score": "0.6983814", "text": "function outputRoomName (room) {\n\troomName.innerText = room\n}", "title": "" }, { "docid": "d99a5fcaca7e7251645065edf2b9fce1", "score": "0.69780433", "text": "function displayRoomName(room) {\n roomName.innerText = room;\n}", "title": "" }, { "docid": "2e81c8dbf36657aca8d490126f1a588c", "score": "0.69405377", "text": "function outputRoomName(room) {\n\troomName.innerText = room;\n}", "title": "" }, { "docid": "eebff36981192c50b37e25f8f617dfb4", "score": "0.6925679", "text": "function outputRoomName(room){\n roomName.innerText = room;\n}", "title": "" }, { "docid": "e09bf384bd905723a31fb81e817fdd0e", "score": "0.67874557", "text": "async function getRoom(client, name) {\n return client.getRoom((await client.getRoomIdForAlias(name)).room_id)\n}", "title": "" }, { "docid": "6c342056ebca7e6318c9e4b402d78eae", "score": "0.6734993", "text": "function outputRoomName(room){\n roomName.innerText = room;\n}", "title": "" }, { "docid": "37078f35599ba3d3dd18b99832625207", "score": "0.6703484", "text": "function findCreator(room_id){\n\t\tvar n=0;\n\t\twhile(n<rooms.length){\n\t\t\tif(rooms[n].room_number == room_id){\n\t\t\t\treturn rooms[n].room_by;\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tn++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "0681387510544a68e39cc65b98ef5a78", "score": "0.6685111", "text": "getChatRoomByName(gameId, chatRoomName) {\n return ChatPath.CHAT_ROOMS_COLLECTION(this.db, gameId).where(ChatPath.FIELD__NAME, \"==\", chatRoomName).get();\n }", "title": "" }, { "docid": "cd211d27185ad6ddde9e69b8a5c478b7", "score": "0.6667484", "text": "function outputRoomName(room){\nconst roomDom=document.getElementById('room-name');\nroomDom.textContent=room;\n}", "title": "" }, { "docid": "a1192d8b3bc164b1fd98cca1b06bfe68", "score": "0.65930694", "text": "function outputRoomName(room) {\n roomName.innerText = room_name;\n}", "title": "" }, { "docid": "bfd118a583073879810df5d80f19085f", "score": "0.6569032", "text": "function getRoom(data){\n return (strapi.query('Room').find({id: data})) // check for a solution for the whole run\n }", "title": "" }, { "docid": "f93546f9489282b48e43f36b530d9e94", "score": "0.6555625", "text": "getRoomNameById(roomId)\n {\n for (let i in this.state.rooms)\n {\n const room = this.state.rooms[i];\n if(room.id == roomId.toString())\n return { name: room.name, show: (room.show == undefined || room.show), index: i };\n }\n return { name:\"\", show: true, index: -1};\n }", "title": "" }, { "docid": "7b720a2c068fd8abd3c75c8a3feae7cd", "score": "0.6548517", "text": "function outputRoomName(room) {\n roomName.innerHTML = `<p><span>${room}</span></p>`;\n}", "title": "" }, { "docid": "f381dc7d9b265b674553b2437ebb6435", "score": "0.6437239", "text": "function outputRoomName(chatroom) {\n sideRoom.innerText = chatroom;\n}", "title": "" }, { "docid": "2e935ffb670509527359a31a29bb44c0", "score": "0.6372162", "text": "function outputRoomName(room){\n roomName.innerText = room\n console.log(\"room is updated to \"+room)\n}", "title": "" }, { "docid": "95a1488dd7095e476d9d0fc4abf2658e", "score": "0.6354759", "text": "function getRoomInfo(roomName){\n for(var i = 0; i < adventureJSON.rooms.length; i++){\n if(adventureJSON.rooms[i].name == roomName){\n return adventureJSON.rooms[i];\n }\n }\n return {};\n}", "title": "" }, { "docid": "f8bd11ac5a310eef607532cb4bf2b2f5", "score": "0.62521094", "text": "function getPlayerName(lobby, role) {\n return getPlayer(lobby, role).name;\n}", "title": "" }, { "docid": "869b4c7e3d021658ee5f92c809e8fdd6", "score": "0.62366384", "text": "function getRoom(socket) {\n const sid = socket.id;\n const roomsList = Object.keys(socket.rooms);\n // Searching for the game room with the user\n for (let i = 0; i < roomsList.length; ++i) {\n if (roomsList[i] !== sid) {\n return roomsList[i]; // It's found and returning\n }\n }\n return socket.id; // Nothing found. User's own room is returning\n}", "title": "" }, { "docid": "f9671fc784628b2741ba6bd5c8332739", "score": "0.6223857", "text": "function generateRoomIdentifier() {\n // make a list of legal characters\n // we're intentionally excluding 0, O, I, and 1 for readability\n var chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';\n var result = '';\n\tfor (var i = 0; i < 6; i++)\n\t\tresult += chars.charAt(Math.floor(Math.random() * chars.length)); \n return result;\n}", "title": "" }, { "docid": "9c671dd572f35ae1f0595e1cd781d678", "score": "0.62179565", "text": "roomDetails() {\n console.log(\"player is in room: \" + this.currentRoom);\n var details = this.world.rooms[this.currentRoom].id.toUpperCase() + '\\n' + this.world.rooms[this.currentRoom].description + '\\n\\n';\n details += this.formatRooms(this.currentRoom);\n return details;\n }", "title": "" }, { "docid": "eb885e426aadcf3843f6685490b319c0", "score": "0.61878383", "text": "function getname (id) {\n for (var i=0; i<champions.length; i++){\n if (champions[i].id===id){\n return champions[i].name;\n }\n }\n }", "title": "" }, { "docid": "1eeccc0e1713ff72a008898341aa30c0", "score": "0.61706644", "text": "function generateRoomID() {\n return 'r_' + Math.random().toString(36).substr(2, 9);\n}", "title": "" }, { "docid": "46a1f5b772faf86aa05353105ece6438", "score": "0.61544144", "text": "function getRoom(request, response){\n response.render('room', {title: 'chatroom', roomName: request.params.roomName, newRoomId: roomGenerator.roomIdGenerator()});\n}", "title": "" }, { "docid": "5b9d21c9cb0aa8bd00ea80bea5e80050", "score": "0.6147682", "text": "function outputChatRoomName(chatroom){\n chatRoomName.innerText = chatroom;\n}", "title": "" }, { "docid": "a5d0fbbe520205a27065f7d5aea24ed1", "score": "0.6107499", "text": "function GetRoom (room) {\n \n return users.filter(user => user.room === room);\n \n}", "title": "" }, { "docid": "d251db06a99303fec1f9217dcdcb0cd9", "score": "0.60439926", "text": "function findRoom(roomId) {\n var room = registeredRooms.find(function (room) {\n return room.id === roomId;\n });\n\n return room;\n}", "title": "" }, { "docid": "4de0a6e11c0875b400c24986c7f5f5e0", "score": "0.59814817", "text": "function getRoomId() {\n const result = window.location.pathname.split('/')[3]\n if ( result != null ){\n return decodeURI(result);\n }\n else{\n return null;\n }\n}", "title": "" }, { "docid": "cd7c3774ebbfb70fc022d5bac38de473", "score": "0.59737533", "text": "function roomFormat (value, row, index)\r\n{\r\n\r\n\tvar displayname;\r\n\t$.ajax({\r\n\t\turl : 'http://localhost:8000/room/',\r\n\t\tcache : false,\r\n\t\tprocessData : false,\r\n\t\ttype : 'GET',\r\n\t\tsuccess : function (data) {\r\n\r\n\t\t\tfor (index = 0; index < data.results.length; ++index)\r\n\t\t\t{\r\n\t\t\t\tif (data.results[index].ID == value)\r\n\t\t\t\t{\r\n\t\t\t\t\tdisplayname = data.results[index].name;\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\tasync : false\r\n\t});\r\n\r\n\treturn displayname;\r\n}", "title": "" }, { "docid": "506874a6c08015f4fe75fc84d4aaabf9", "score": "0.5959483", "text": "function generateNewMeetingRoomName() {\n console.log(\"generate meeting room name\")\n sendEvent(\"create-room\", localVideoCallerId, {})\n\n}", "title": "" }, { "docid": "f05d277d7ea7e801f1ac1983a13f11af", "score": "0.59482735", "text": "function getRoom() {\n\tlet room = null;\n\tlet args = splitTheUrl();\n\tif (args.length <= 1) {\n\t\tconsole.log('new room');\n\t\troom = getUniqueStr();\n\t\twindow.history.pushState('room', null, '#' + room);\n\t\tlocalStorage.setItem(\"ownerId\", room);\n\t} else if (args.length == 2 && args[1] == localStorage.getItem(\"ownerId\")) {\n\t\tconsole.log('room refreshing');\n\t\troom = args[1];\n\t}\n\n\treturn room;\n}", "title": "" }, { "docid": "7fbdd767d8b3648d92f6acf1f6fc6d2b", "score": "0.5943105", "text": "function getRoom(socket, io) {\n return Object.keys(io.sockets.adapter.sids[socket.id])[0];\n}", "title": "" }, { "docid": "05ffa118e5860eeeb43c90b1802a5fdf", "score": "0.59338915", "text": "function joinRoom(name, room_id) {\n if (rc && rc.isOpen()) {\n console.log(\"already connected to a room\");\n } else {\n rc = new RoomClient(\n localMedia,\n remoteVideos,\n remoteAudios,\n window.mediasoupClient,\n socket,\n room_id,\n name,\n roomOpen\n );\n $(\"#username\").text(name);\n addListeners();\n }\n}", "title": "" }, { "docid": "e8175ec8e188844f4256860cd10dc353", "score": "0.59262055", "text": "function findRoom(string) {\n for(var i=0;i<arrayOfRooms.length;i++){\n if(string === arrayOfRooms[i].number){\n return arrayOfRooms[i];\n }\n }\n}", "title": "" }, { "docid": "25967af57f1a5170e0a623f655fec222", "score": "0.5925847", "text": "function findGame(socketID) {\r\n let possibleRooms = rooms.values();\r\n for (let element of possibleRooms) {\r\n if (element.publicGame && element.playerCount < 9) {\r\n return element.roomName;\r\n }\r\n }\r\n //No public room found, make a new one\r\n //The one is necessary because they're already in a room of their socketID\r\n let room = new Room(socketID + \"1\", true, DEFAULT_OPTIONS);\r\n rooms.set(socketID + \"1\", room);\r\n return socketID + \"1\";\r\n}", "title": "" }, { "docid": "b81ecc8571a6baa8ef5b61762a66e5a7", "score": "0.5890942", "text": "function checkroom() {\n return champ.getAttribute('current-room');\n \n}", "title": "" }, { "docid": "fb6324218a459ffd9882790927e70769", "score": "0.58863467", "text": "function createRoomID(){\n let key = keyGen();\n while(Object.keys(io.sockets.adapter.rooms).includes(key)) key = keyGen();\n return key;\n}", "title": "" }, { "docid": "0de7d1ef0d621d5711e886d01bf43099", "score": "0.5884179", "text": "function getPlanetName(id){\n var name;\n switch(id){\n case 1:\n name = 'Mercury'\n break;\n case 2:\n name = 'Venus'\n break;\n case 3:\n name = 'Earth'\n break;\n case 4:\n name = 'Mars'\n break;\n case 5:\n name = 'Jupiter'\n break;\n case 6:\n name = 'Saturn'\n break;\n case 7:\n name = 'Uranus'\n break;\n case 8:\n name = 'Neptune'\n break;\n }\n return name;\n}", "title": "" }, { "docid": "7e871f31a74da1e85b30fe258837750e", "score": "0.5855206", "text": "function getRoom(){\n switch(Math.floor(Math.random() * 5)){\n case 0: return \"stuffy, musty smell of the old clothes and unwashed linens that has gradually accumulated in the corners of your room and on your bed\"; break;\n case 1: return \"stuffy, musty smell of the old clothes and unwashed linens that has gradually accumulated in the corners of your room and on your bed\"; break;\n case 2: return \"blank white walls and deeply stained, ancient hardwood floors you walk on. You have memorized the floor's patterns, seen rainbow static coalesce into shapes on the walls. Thinking about this freaks you out\"; break;\n case 3: return \"obviously false but still compelling notion that your room is a quarantine and not you but your anxiety lives here, undisturbed, free to linger and fester when you refuse to leave for days on end\"; break;\n case 4: return \"constant reminders of bills and upkeep and self-care and every other responsibility that you shirk when you stay inside for multiple days on end. Getting outside helps remind you that everyone has these issues as well, and that your daily struggles are valid\"; break;\n }\n}", "title": "" }, { "docid": "3a7a000bd9532d7f60c5fded8ca85114", "score": "0.58550763", "text": "function getRoomObject (roomName) {\n\t//console.log('number of rooms = ' + listOfRooms.length);\n\tfor ( var i = 0; i < listOfRooms.length; i++){\n\t\tif (listOfRooms[i].name === roomName){\n\t\t\t//console.log('Inside if : room object : ');\n\t\t\t//console.log(listOfRooms[i]);\n\t\t\treturn listOfRooms[i];\n\t\t}\n\t}\n}", "title": "" }, { "docid": "c2d001cc65d584e3139c20f88ac4c3e3", "score": "0.58527106", "text": "get roomId() {\n \treturn this._roomId;\n }", "title": "" }, { "docid": "24e284531eea175139c14e3b31a8fb5d", "score": "0.58435583", "text": "function era4(currentRoom){\n\n}", "title": "" }, { "docid": "f3261f038a3b575ca2d873c70fe3c1c5", "score": "0.5808513", "text": "function getRoom(request, response) {\n let name = request.params.roomName;\n let messages;\n Chatrooms.Chatroom.find({roomid:name}, (err, rooms) => {\n if (err) return handleError(err);\n if (rooms.length != 0) {\n messages = rooms[0].messages;\n messages = JSON.parse(JSON.stringify(messages));\n messages.forEach((message, i) => {\n messages[i].time = moment(message.time).local().format('YYYY-MM-DD HH:mm:ss');\n });\n response.render('room', {title: 'chatroom', roomName: request.params.roomName, newRoomId: roomGenerator.roomIdGenerator(), messagesList: messages}); \n\n } \n });\n}", "title": "" }, { "docid": "ac1597be2e4c3d87559ae4cd48e56ed2", "score": "0.578395", "text": "function getUserName(id) {\n const user = users[id - 1];\n if (user) {\n const username = `${user.firstname} ${user.lastname}`;\n return username;\n }\n return '';\n}", "title": "" }, { "docid": "d98d3704efb41acfbb71aed44bee63a8", "score": "0.57782984", "text": "function outputRoomName(room) {\n document.getElementById(\"roomname\").innerHTML = room;\n document.getElementById(\"roomlist\").value = room;\n}", "title": "" }, { "docid": "af11c370c03aa21ac91514313d8fae3b", "score": "0.57736933", "text": "getCurrentRoom() {\n const map = this.game.maps.find(map => map.id === this.mapId);\n return map.rooms.find(room => room.id === this.roomId);\n }", "title": "" }, { "docid": "92b9e098c701740931b0fd146775acd5", "score": "0.57707125", "text": "function findRoomPlayer(socket){\n let data = null;\n Object.keys(socket.rooms).forEach(function (room) {\n // let roomIndex = rooms.findIndex(r => r.id === room);\n if (rooms[room]) {\n let player = rooms[room].players.find(p => p.id === socket.id);\n\n if (player){\n data = {room: room, username: player.username};\n }\n }\n });\n return data;\n}", "title": "" }, { "docid": "f81abb1ade7a02a24bc352b1498b5e41", "score": "0.57699496", "text": "function parseRoom(room){\r\n var parts = room.split(\"-\").map( (part) => { return part.replace(\"]\", \"\").split('[') } );\r\n var name = parts.slice(0, parts.length-1);\r\n name = name.reduce( (a, b) => { return a+b});\r\n var sector = parts[parts.length-1][0];\r\n var checksum = parts[parts.length-1][1];\r\n return {name:name, sector:sector, checksum:checksum};\r\n}", "title": "" }, { "docid": "3d20ab26630a725da4c7bff241d3ed70", "score": "0.5760218", "text": "async getNewRoomId() {\n return Rooms.getNewId();\n }", "title": "" }, { "docid": "473ab3e2c4ef22ed4e9c50cac1905623", "score": "0.5734732", "text": "function getNameFromId(id){for (let i = 0; i < connections.length; i++){if (id == connections[i][1]){return connections[i][0]}}}", "title": "" }, { "docid": "6908d4109bf4431d8453773dcc567c5a", "score": "0.5722312", "text": "function getRooms(roomEl, prefix) {\n\t\tprefix = prefix || '#room/';\n\t\troomEl = roomEl || roomList;\n\t\t$.ajax({\n\t\t\ttype: \"GET\",\n\t\t\turl: 'room/list'\n\t\t}).done(function( msg ) {\n\t\t\tmsg.forEach(function(room){\n\t\t\t\troomEl.append('<li><a href=\"'+prefix+room.id+'\" data-id=\"'+room.id+'\"><i class=\"icon-align-justify\"></i> '+room.id+'</a></li>');\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "06d44111abd65a08f7db0fc9b0b1aec6", "score": "0.5712761", "text": "function getTrumpRoom() {\n let rooms = signalServer.nsps['/'].adapter.rooms\n let nrooms = Object.keys(rooms).length\n let result = \"NO_ROOMS\"\n let i = 1\n console.log(\"n rooms:\" + nrooms.toString())\n for (let roomName in rooms) {\n let roomContents = rooms[roomName]\n let roomSize = Object.keys(roomContents).length\n if (roomName.startsWith(\"trump\")\n && roomSize > 0 && roomSize < 3\n && Math.random() < (1.0/i)) {\n result = roomName\n i ++;\n }\n }\n return result\n}", "title": "" }, { "docid": "e43d8e73f7619048ecf907f68319c6bb", "score": "0.5712135", "text": "function getRoomId(itemId) {\n for(var i=0; i<room.length; i++) {\n if(room[i].itemId.includes(itemId)){\n return room[i].roomId;\n }\n }\n}", "title": "" }, { "docid": "fd42a83553046a7443981d4674855ebf", "score": "0.5702853", "text": "function getName(input){\n return input.id.charAt(0).toUpperCase()+input.id.slice(1)\n}", "title": "" }, { "docid": "4e64867dfd63c27fdaae48852a36aae2", "score": "0.5700673", "text": "function generateUniqueRoomIdentifier() {\n\tvar id = generateRoomIdentifier();\n\twhile (room_map[id] != undefined) {\n\t\tid = generateRoomIdentifier();\n\t}\n\troom_map[id] = true;\n\treturn id;\n}", "title": "" }, { "docid": "a7079c2c905630e9f8bd4a3e2776f4bb", "score": "0.5692015", "text": "getPkmnName(id) {\r\n //TODO missingno / old fakemon\r\n //Handle errors better\r\n if (!id.includes(\"-\")) {\r\n if (id.length === 4) {\r\n return \"???\";\r\n }\r\n\r\n //Normal\r\n try {\r\n return Pokemon.getName(parseInt(id), 'en');\r\n }\r\n catch{\r\n return \"???\"\r\n }\r\n }\r\n else {\r\n //Sirius\r\n try {\r\n return Pokemon.getName(parseInt(id), 'de');\r\n }\r\n catch{\r\n return \"???\"\r\n }\r\n }\r\n }", "title": "" }, { "docid": "e636e768f50cc29f565db22ad0f426b8", "score": "0.56693125", "text": "function getRoomParams() {\n let r = map.rooms[selectedRoom];\n return 'id: ' + r.id + '\\n ' +\n 'x: ' + r.x + '\\n ' +\n 'y: ' + r.y + '\\n ' +\n 'height: ' + r.height + '\\n ' +\n 'width: ' + r.width + '\\n ';\n }", "title": "" }, { "docid": "b16b3d7ac82f14ba4c50d0113f488696", "score": "0.5657451", "text": "function champIdToName(id) {\n switch (id) {\n case 1: return \"Annie\";\n case 2: return \"Olaf\";\n case 3: return \"Galio\";\n case 4: return \"Twisted Fate\";\n case 5: return \"Xin Zhao\";\n case 6: return \"Urgot\";\n case 7: return \"Leblanc\";\n case 8: return \"Vladimir\";\n case 9: return \"Fiddlesticks\";\n case 10: return \"Kayle\";\n case 11: return \"Master Yi\";\n case 12: return \"Alistar\";\n case 13: return \"Ryze\";\n case 14: return \"Sion\";\n case 15: return \"Sivir\";\n case 16: return \"Soraka\";\n case 17: return \"Teemo\";\n case 18: return \"Tristana\";\n case 19: return \"Warwick\";\n case 20: return \"Nunu\";\n case 21: return \"Miss Fortune\";\n case 22: return \"Ashe\";\n case 23: return \"Tryndamere\";\n case 24: return \"Jax\";\n case 25: return \"Morgana\";\n case 26: return \"Zilean\";\n case 27: return \"Singed\";\n case 28: return \"Evelynn\";\n case 29: return \"Twitch\";\n case 30: return \"Karthus\";\n case 31: return \"Cho'gath\";\n case 32: return \"Amumu\";\n case 33: return \"Rammus\";\n case 34: return \"Anivia\";\n case 35: return \"Shaco\";\n case 36: return \"Dr. Mundo\";\n case 37: return \"Sona\";\n case 38: return \"Kassadin\";\n case 39: return \"Irelia\";\n case 40: return \"Janna\";\n case 41: return \"Gangplank\";\n case 42: return \"Corki\";\n case 43: return \"Karma\";\n case 44: return \"Taric\";\n case 45: return \"Veigar\";\n case 48: return \"Trundle\";\n case 50: return \"Swain\";\n case 51: return \"Caitlyn\";\n case 53: return \"Blitzcrank\";\n case 54: return \"Malphite\";\n case 55: return \"Katarina\";\n case 56: return \"Nocturne\";\n case 57: return \"Maokai\";\n case 58: return \"Renekton\";\n case 59: return \"Jarvan IV\";\n case 60: return \"Elise\";\n case 61: return \"Orianna\";\n case 62: return \"Wukong\";\n case 63: return \"Brand\";\n case 64: return \"Lee Sin\";\n case 67: return \"Vayne\";\n case 68: return \"Rumble\";\n case 69: return \"Cassiopeia\";\n case 72: return \"Skarner\";\n case 74: return \"Heimerdinger\";\n case 75: return \"Nasus\";\n case 76: return \"Nidalee\";\n case 77: return \"Udyr\";\n case 78: return \"Poppy\";\n case 79: return \"Gragas\";\n case 80: return \"Pantheon\";\n case 81: return \"Ezreal\";\n case 82: return \"Mordekaiser\";\n case 83: return \"Yorick\";\n case 84: return \"Akali\";\n case 85: return \"Kennen\";\n case 86: return \"Garen\";\n case 89: return \"Leona\";\n case 90: return \"Malzahar\";\n case 91: return \"Talon\";\n case 92: return \"Riven\";\n case 96: return \"Kog'Maw\";\n case 98: return \"Shen\";\n case 99: return \"Lux\";\n case 101: return \"Xerath\";\n case 102: return \"Shyvana\";\n case 103: return \"Ahri\";\n case 104: return \"Graves\";\n case 105: return \"Fizz\";\n case 106: return \"Volibear\";\n case 107: return \"Rengar\";\n case 110: return \"Varus\";\n case 111: return \"Nautilus\";\n case 112: return \"Viktor\";\n case 113: return \"Sejuani\";\n case 114: return \"Fiora\";\n case 115: return \"Ziggs\";\n case 117: return \"Lulu\";\n case 119: return \"Draven\";\n case 120: return \"Hecarim\";\n case 121: return \"Kha'zix\";\n case 122: return \"Darius\";\n case 126: return \"Jayce\";\n case 127: return \"Lissandra\";\n case 131: return \"Diana\";\n case 133: return \"Quinn\";\n case 134: return \"Syndra\";\n case 143: return \"Zyra\";\n case 150: return \"Gnar\";\n case 154: return \"Zac\";\n case 157: return \"Yasuo\";\n case 161: return \"Vel'koz\";\n case 201: return \"Braum\";\n case 222: return \"Jinx\";\n case 223: return \"Tahm Kench\";\n case 236: return \"Lucian\";\n case 238: return \"Zed\";\n case 245: return \"Ekko\";\n case 254: return \"Vi\";\n case 266: return \"Aatrox\";\n case 267: return \"Nami\";\n case 268: return \"Azir\";\n case 412: return \"Thresh\";\n case 421: return \"Rek'Sai\";\n case 429: return \"Kalista\";\n case 432: return \"Bard\";\n case 999: return \"All Mages\";\n default: return \"Unknown\";\n }\n}", "title": "" }, { "docid": "4f7cf06158d50feb9af5d192b66eb44e", "score": "0.56554675", "text": "getUserName(regId) {\n var contactName = this.contactManager.getDisplayName(regId);\n return contactName ? contactName : regId.toString();\n }", "title": "" }, { "docid": "92607eabe3c2b47bc625341b7a676b87", "score": "0.5653758", "text": "function getPieceNameFromId(id) {\n\tid = id[0];\n\tswitch (id) {\n\t\tcase 'Q':\n\t\t\treturn 'Queen';\n\t\tcase 'R':\n\t\t\treturn 'Rook';\n\t\tcase 'B': //Bishop has Bi, but just looking at the first letter here\n\t\t\treturn 'Bishop';\n\t\tcase 'L':\n\t\t\treturn 'Knight';\n\t\tcase 'P':\n\t\t\treturn 'Pawn';\n\t\tcase 'K':\n\t\t\treturn 'King';\n\t\tdefault:\n\t\t\tthrow ({name: \"Error\", message: \"Invalid Piece Id\"});\n\t}\n}", "title": "" }, { "docid": "d964e857442bce4e45f15a84cb359547", "score": "0.56404805", "text": "function showRoomDescription(room) {\n descriptionDiv.innerHTML = room.description;\n}", "title": "" }, { "docid": "7180b9ebf502fcbcc630b79014b9c8fc", "score": "0.5634811", "text": "returnResource(id){\n if(this.props.roomDetail!=null){\n for(var i=0; i<this.props.roomDetail.length; i++){\n if(this.props.roomDetail[i].room==id+1 && this.props.roomDetail[i].status!=\"End\"){\n return this.props.roomDetail[i].resource_id\n }\n }\n }\n }", "title": "" }, { "docid": "d9ff28e626c0ac239bac658d896a1e6a", "score": "0.56227094", "text": "function get_room_obj(roomid)\n{\n\tconsole.log(\"enter get_room_obj, roomid = %s\", roomid);\n\t\n\tfor(var i = 0; i < history_array.length; i++){\n\t\tconsole.log(\"history_array[i].room_id = %s\",history_array[i].room_id)\n\t\tif(history_array[i].room_id == roomid){\n\t\t\t//console.log(history_array[i]);\n\t\t\treturn history_array[i];\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "19cbc55c5b9da783420c351efa343ec7", "score": "0.56143785", "text": "function renderCurrentRoom(room) {\n var current__room__info = `<div class=\"current__room__logo\" >\n <img src=\"img/logo.png\" alt=\"room\" />\n </div>\n <div class=\"current__room__details\">\n <h1>${room.RoomName}</h1>\n <p>created on ${room.DateCreated}</p>\n <h2>All Users : <span>${totalUsers}</span></h2>\n </div>`;\n current__room.innerHTML = current__room__info;\n}", "title": "" }, { "docid": "9757d120c00ee492d9892d1cf1e2d621", "score": "0.56051743", "text": "function getUserRoom(room_id) {\n var user = [];\n for (var key in io.sockets.adapter.rooms[room_id]) {\n if (io.sockets.adapter.rooms[room_id][key] == true) {\n user.push(key);\n }\n }\n return user;\n}", "title": "" }, { "docid": "cc7522902ea7864f3599cb63bfe52e02", "score": "0.5595167", "text": "function getUsername(socketId) {\n var name = currentUsers.find(function(user) {\n return user.socketId == socketId;\n }).username;\n\n return name;\n}", "title": "" }, { "docid": "8471454636766671765a75a5e3e85dcc", "score": "0.5588074", "text": "function getUsernameForPlayer(id) {\n\t//console.log('getUsernameForPlayer id:',id)\n\tlet players = S.gameConfig.players;\n\tlet pl = firstCond(players, x => x.id == id);\n\tlet uname = pl.username;\n\treturn uname;\n}", "title": "" }, { "docid": "bbdc26c1bbc9065526ec5106c8a947e3", "score": "0.55814266", "text": "function getName(id)\n{\n var val = getValue(id);\n if(val === undefined) {\n return val;\n }\n // strip spaces\n val = val.replace(/\\s+/g, '');\n\n // parse comma to find last name, first name\n var nameFields = val.split(',');\n var name = \"\";\n if(nameFields.length > 0) {\n name = nameFields[0];\n }\n if(nameFields.length > 1) {\n name += '^' + nameFields[1];\n }\n return name;\n}", "title": "" }, { "docid": "7f7a59e61acb5267b8f89b420095ea2e", "score": "0.5564019", "text": "function formatRoomInfo(roomObj){\n let roomAddress = roomObj.location.address.join('\\n');\n return `${roomObj.roomname} with capacity ${roomObj.capacity}\\nThe room is located at:\\n${roomAddress}`\n}", "title": "" }, { "docid": "f628158e8c7a2c7a5df5a00fd11fd6e3", "score": "0.5544282", "text": "function searchRoom (handlerInput, roomName) {\n \n console.log(\"Searching for room \" + roomName);\n \n const ROOMS = handlerInput.attributesManager.getSessionAttributes().ROOMS;\n var roomSearched = null;\n \n // check each room in ROOMS Object\n Object.keys(ROOMS).forEach(function(key,index) {\n // key: the name of the object key\n // index: the ordinal position of the key within the object \n \n if (ROOMS[key].name == roomName){\n \troomSearched = ROOMS[key]\n }\n });\n \n console.log(\"roomFound \" + JSON.stringify(roomSearched));\n \n return roomSearched;\n}", "title": "" }, { "docid": "fe86c647008547e0e360597ba5c64087", "score": "0.5526345", "text": "function findRoom(rooms) {\n\tfor (let i = 0; i < rooms.length; i++) {\n\t\tif (rooms[i].status === config.ROOM_STATUS_OPEN) {\n\t\t\treturn rooms[i];\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0f3820f448159fc204164fa89fa71aaa", "score": "0.5525556", "text": "function anitialsCreator(id) {\n const fullNameString = MODEL.returnMemberById(id).name;\n const nameToArray = fullNameString.split(' ').map((n) => n[0]);\n return nameToArray.join('');\n }", "title": "" }, { "docid": "0ff803933e43f067c1b600bff0651517", "score": "0.55238754", "text": "getCurrentRoomText() {\n\t\t\treturn currentAdventure.rooms[currentRoom].description;\n\t\t}", "title": "" }, { "docid": "335dacd293edc9c9a1492605488aa30e", "score": "0.55228794", "text": "function getRoomPosition(id)\n{\n\t// Now let's see if it appears in the previously known rooms\n\tfor (x=0; x<8; x++) \n\t{\n\t\tfor (y=0; y<8; y++) \n\t\t{\n\t\t\t// We found the matching room!!! Yay!\n\t\t\tif (_map_room_ids[x][y] == id)\n\t\t\t{\n\t\t\t\treturn {x:x+1, y:y+1};\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n}", "title": "" }, { "docid": "869f680b967dd606ee925080d8d888b0", "score": "0.5521551", "text": "function getRoleName(id) {\n const roleName = roles[id - 1].name;\n return roleName;\n}", "title": "" }, { "docid": "59ca66d8f53dc7a4ffebf040c26fb465", "score": "0.5517991", "text": "function getRoundName(roundId){\n if(roundId == 1 || roundId == 4 || roundId == 7)\n return \"BEAT\";\n else if(roundId == 2 || roundId == 5 || roundId == 8)\n return \"HR\";\n return \"RR\";\n}", "title": "" }, { "docid": "d1449ed33ba053bcb30780845fe8933a", "score": "0.55177176", "text": "function getNameBySeat(seat) {\n try {\n if (seat == playerSeat) {\n return playerName.slice(0, -6);\n }\n else {\n return oppName.slice(0, -6);\n }\n }\n catch (e) {\n return \"???\";\n }\n}", "title": "" }, { "docid": "347f216a889f8ccd4dc6f7477942f199", "score": "0.5517695", "text": "function buildingName(){\r\n return document.getElementById(\"lmid2\").textContent.split(\" level\")[0];\r\n}", "title": "" }, { "docid": "b81cfc029f6e6d657c8274df38b3620b", "score": "0.55164444", "text": "function getName(input) {\n return input.id.charAt(0).toUpperCase() + input.id.slice(1);\n}", "title": "" }, { "docid": "619a9fe50e8d91eb1444035a7831d89c", "score": "0.5508916", "text": "function createRoomId() {\n let characters = \"ABCDEFGHIJKLMNOPQRSTUVWXTZ\";\n let lengthOfCode = 6;\n let newCode = \"\";\n for (let i = 0; i < lengthOfCode; i++) {\n let rnum = Math.floor(Math.random() * characters.length);\n newCode += characters.substring(rnum, rnum + 1);\n }\n return newCode;\n}", "title": "" }, { "docid": "b3a94734e6fc117e9d4ec1279925bf2c", "score": "0.5503951", "text": "function getBotNameById(team, botId) {\n let bots = team.bots;\n for (let x = 0; x < bots.length; x++) {\n if (bots[x].id == botId) return bots[x].name;\n }\n return 'Mystery Bot';\n}", "title": "" } ]
a6c9560d7c6abe8bb92d15b996f96c3d
Check if a string is prefixed by 0x
[ { "docid": "adb074b1de45dde28fcdc4f1d67d4f65", "score": "0.8185683", "text": "function isHexPrefixed(str) {\n return str.slice(0, 2) === '0x';\n}", "title": "" } ]
[ { "docid": "1df2eba7a8163114b5a050747e260327", "score": "0.69156903", "text": "function isReserved(str){var c=(str+'').charCodeAt(0);return c===0x24||c===0x5F;}", "title": "" }, { "docid": "1df2eba7a8163114b5a050747e260327", "score": "0.69156903", "text": "function isReserved(str){var c=(str+'').charCodeAt(0);return c===0x24||c===0x5F;}", "title": "" }, { "docid": "1df2eba7a8163114b5a050747e260327", "score": "0.69156903", "text": "function isReserved(str){var c=(str+'').charCodeAt(0);return c===0x24||c===0x5F;}", "title": "" }, { "docid": "1df2eba7a8163114b5a050747e260327", "score": "0.69156903", "text": "function isReserved(str){var c=(str+'').charCodeAt(0);return c===0x24||c===0x5F;}", "title": "" }, { "docid": "ae8e86a134254289639bb5f27c3b6374", "score": "0.6894806", "text": "function isNameStartChar(c){return c>=0x41&&c<=0x5A||c>=0x61&&c<=0x7A||c===0x3A||c===0x5F||c===0x200C||c===0x200D||c>=0xC0&&c<=0xD6||c>=0xD8&&c<=0xF6||c>=0x00F8&&c<=0x02FF||c>=0x0370&&c<=0x037D||c>=0x037F&&c<=0x1FFF||c>=0x2070&&c<=0x218F||c>=0x2C00&&c<=0x2FEF||c>=0x3001&&c<=0xD7FF||c>=0xF900&&c<=0xFDCF||c>=0xFDF0&&c<=0xFFFD||c>=0x10000&&c<=0xEFFFF;}", "title": "" }, { "docid": "ae8e86a134254289639bb5f27c3b6374", "score": "0.6894806", "text": "function isNameStartChar(c){return c>=0x41&&c<=0x5A||c>=0x61&&c<=0x7A||c===0x3A||c===0x5F||c===0x200C||c===0x200D||c>=0xC0&&c<=0xD6||c>=0xD8&&c<=0xF6||c>=0x00F8&&c<=0x02FF||c>=0x0370&&c<=0x037D||c>=0x037F&&c<=0x1FFF||c>=0x2070&&c<=0x218F||c>=0x2C00&&c<=0x2FEF||c>=0x3001&&c<=0xD7FF||c>=0xF900&&c<=0xFDCF||c>=0xFDF0&&c<=0xFFFD||c>=0x10000&&c<=0xEFFFF;}", "title": "" }, { "docid": "ff9a88796ebc24ea30fb692b47c27997", "score": "0.67733866", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n }", "title": "" }, { "docid": "2aac34a219de3d97790fe4aef03a49b1", "score": "0.6753296", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0)\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "c9670bf86ec08a095403d3f6eda6dd55", "score": "0.6742554", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n }", "title": "" }, { "docid": "c9670bf86ec08a095403d3f6eda6dd55", "score": "0.6742554", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n }", "title": "" }, { "docid": "c9670bf86ec08a095403d3f6eda6dd55", "score": "0.6742554", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n }", "title": "" }, { "docid": "c9670bf86ec08a095403d3f6eda6dd55", "score": "0.6742554", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n }", "title": "" }, { "docid": "d496356a1a00f3b8c879e512d70fcfd0", "score": "0.67355794", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n }", "title": "" }, { "docid": "d496356a1a00f3b8c879e512d70fcfd0", "score": "0.67355794", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n }", "title": "" }, { "docid": "83a77f4f1c40d2780fbe2a33110e373c", "score": "0.67321515", "text": "function isReserved (str) {\n const c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.67298836", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.67298836", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.67298836", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.67298836", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.67298836", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.67298836", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.67298836", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.67298836", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "3144627539ec186f2a1f68364c107a98", "score": "0.67298836", "text": "function isReserved(str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F;\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" }, { "docid": "594f5ff9dec6fc75a881276c681c41f6", "score": "0.6717861", "text": "function isReserved (str) {\n var c = (str + '').charCodeAt(0);\n return c === 0x24 || c === 0x5F\n}", "title": "" } ]
746e9d71fb0eadc55128168e0c9783f4
Uses the Current Weather API to get the city lon and lat coordinates
[ { "docid": "6bfedd61576a1aa7e8e13c878893fe68", "score": "0.7617857", "text": "function getCoordinates(city) {\n var apiUrl = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&appid=6b2382b59ee5c3585d2c8565974577ef\";\n fetch(apiUrl).then(function (response) {\n if (response.ok) {\n response.json().then(function (data) {\n getWeather(data.coord.lon, data.coord.lat, city);\n });\n }\n else {\n alert(\"Hmmm we can't seem to find \" + city + \" on the map. Please try another city.\");\n }\n })\n .catch(function (error) {\n alert(\"We are unable to connect to OpenWeather's Weather Vane at the moment.\");\n });\n}", "title": "" } ]
[ { "docid": "cf5bcfee0431085268b9c94fafe40261", "score": "0.78066236", "text": "function getCoordinates(city) {\n var apiUrl = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&appid=aa5d1cd32b930fb9d0bbbffde6f83c5f\";\n fetch(apiUrl).then(function(response) {\n if (response.ok) {\n response.json().then(function(data) {\n \n $(\".location\").text(data.name);\n lat = data.coord.lat;\n lng = data.coord.lon;\n \n getWeather();\n })\n } else {\n // request went wrong\n $(\".location\").text(\"Something went wrong! Please enter just the city name\");\n }\n \n })\n}", "title": "" }, { "docid": "19f79a596fc2e59b5bcd72bdb1c7f457", "score": "0.7621138", "text": "function getCityCoord(name){\n var geoApiUrl = 'https://api.openweathermap.org/geo/1.0/direct?q=' + name + '&limit=1&appid=' + key;\n fetch(geoApiUrl)\n .then(function(response){\n if(response.ok){\n return response.json();\n } else {\n alert(\"Error: \" + response.statusText);\n }\n })\n .then(function(data){\n var lat = data[0].lat;\n var lon = data[0].lon;\n var cityVal = data[0].name;\n getWeather(cityVal, lat, lon);\n })\n}", "title": "" }, { "docid": "e387fae717271356151fc4d34ad2664c", "score": "0.75931513", "text": "function findLatLon (city) {\n let key = 'cd9757a25f0b56fd1aaa0121fbcec723';\n fetch('http://api.openweathermap.org/data/2.5/weather?q=' + city + '&appid=' + key)\n .then(function(resp) {\n return resp.json();\n })\n .then(function(data) {\n if (data.cod == 404) alert('Invalid city name.'); \n let cityLat = data.coord.lat;\n let cityLong = data.coord.lon;\n getWeather(cityLat, cityLong);\n })\n \n}", "title": "" }, { "docid": "988c72a814ae8755450f536944f16789", "score": "0.7591038", "text": "function getLatLong(cityName){\n\nvar geoUrl = \"https://api.openweathermap.org/geo/1.0/direct?q=\"+ cityName + \"&limit=5&appid=\" + apiKey;\n\nfetch(geoUrl).then(function(response){\n return response.json() \n\n}).then(function(data){\n lat = data[0].lat\n lon = data[0].lon\n console.log(data)\n getCurrentCity(cityName)\n saveToLocal()\n \n \n}).catch(e => {\n console.log(e);\n})\n}", "title": "" }, { "docid": "d724f2c97e4da7d49c68509d9a3bd948", "score": "0.75630844", "text": "function getLonLat() {\n var geoApiUrl =\n \"https://api.openweathermap.org/geo/1.0/direct?q=\" +\n currentCity +\n \"&limit=1&appid=bcf0f3e083d40c7832b737bfb3c1e368\";\n $.ajax({\n url: geoApiUrl,\n method: \"GET\",\n }).then(function (response) {\n console.log(response);\n if (response.length == 0) {\n alert(\"Please enter a valid city name.\");\n } else {\n console.log(response[0].lon);\n console.log(response[0].lat);\n lon = response[0].lon;\n lat = response[0].lat;\n getWeatherInfo(lat, lon);\n }\n });\n}", "title": "" }, { "docid": "407c88493f74fd53f6ba9a3444998c42", "score": "0.7511846", "text": "function getCityByLatLong(result){\n\tconst lat = result.results[0].geometry.location.lat;\n\tconst long = result.results[0].geometry.location.lng;\n\tconsole.log(lat, long)\n\tconst query = {\n\t\turl: `https://api.openweathermap.org/data/2.5/weather`,\n\t\tdata: {\n\t\t\tlat: lat,\n\t\t\tlon: long,\n\t\t\tappid: '5e5df2be1d3b2a169cf5895f07e31d61',\n\t\t},\n\t\tsuccess: renderWeather\n\t};\n\t$.ajax(query);\n}", "title": "" }, { "docid": "d7638e882a477a9adbe8fc487fa5e237", "score": "0.7491796", "text": "async function getWeather({cityName, latitude, longitude}) {\r\n let response;\r\n if (cityName) {\r\n // Fetch city weather\r\n response = await fetch(`${baseURL}&q=${cityName}`); \r\n } else {\r\n // Fetch weather using coordinates\r\n response = await fetch(`${baseURL}&lat=${latitude}&lon=${longitude}`);\r\n }\r\n if (!response.ok) return;\r\n // Create Weather object\r\n const weather = new Weather(await response.text());\r\n // Return weather\r\n return weather;\r\n}", "title": "" }, { "docid": "e9b02bccc515e8f2987fd4defcce37eb", "score": "0.7360815", "text": "function getWeatherData(city) {\n $.ajax({\n url: `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}`,\n method: \"GET\",\n }).then(function (response) {\n const { lat, lon } = response.coord;\n $.ajax({\n url: `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&appid=${apiKey}`,\n method: \"GET\",\n }).then(function (response2) {\n showWeather(response2.current, response2.daily);\n });\n });\n}", "title": "" }, { "docid": "9e58f52a813b7cf559c91443df15a315", "score": "0.7359218", "text": "function getWeatherByCoords(lon, lat) {\n // weather?lat=35&lon=139&appid\n clearWeatherData();\n // &units=imperial\n queryURL = apiCall + \"weather?lat=\" + lat + \"&lon=\" + lon + \"&units=imperial\" + \"&APPID=\" + apiKey;\n console.log(queryURL);\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).done(function (response) {\n console.log(response);\n showWeatherData(response);\n getForecast(response.id);\n\n }).fail(function (response) {\n console.log(response.responseJSON.message);\n $(\"#searchMsg\").html(response.responseJSON.message);\n });\n }", "title": "" }, { "docid": "f8250c34e7f55e0b100990a99eb8f635", "score": "0.73431116", "text": "function getGeo() {\n navigator.geolocation.getCurrentPosition(function(position) {\n lat = position.coords.latitude;\n long = position.coords.longitude;\n return weather();\n \n }); // end getCurrentPosition()\n }", "title": "" }, { "docid": "385ff7cfd466e8f0118627ee24bcde2c", "score": "0.7331524", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var lat = position.coords.latitude;\n var lon = position.coords.longitude;\n getWeather(lat, lon);\n });\n }\n }", "title": "" }, { "docid": "60936496db8506ea900ab7c62e15e825", "score": "0.72944903", "text": "async getFullWeather(lat, lon){\n const responseForCity = await fetch(`https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&\n exclude=minutely&units=metric&appid=${this.apiKey}`);\n const dataForCity = await responseForCity.json();\n\n const weatherData = new WeatherData (this.City, dataForCity.current, dataForCity.daily, dataForCity.hourly);\n\n return weatherData;\n }", "title": "" }, { "docid": "0fd1af216e8dae64c2203c7e45efb825", "score": "0.72907734", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n loadWeather(position.coords.latitude + ',' + position.coords.longitude);\n });\n }\n }", "title": "" }, { "docid": "e89dad6057dba6570cafae1a7df8fed4", "score": "0.7280344", "text": "function getWeather(lon, lat, city) {\n var apiUrl = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&exclude=minutely&units=imperial&appid=6b2382b59ee5c3585d2c8565974577ef\";\n fetch(apiUrl).then(function (response) {\n if (response.ok) {\n response.json().then(function (data) {\n displayCurrentWeather(data.current, city);\n displayForecast(data.daily);\n });\n }\n // This case will likely never fire as it should have been caught in the getCoordinates function.\n else {\n alert(\"Please enter a valid city name\");\n }\n })\n .catch(function (error) {\n alert(\"We are unable to connect to OpenWeather.\")\n });\n}", "title": "" }, { "docid": "a04c86a152060b4968413b51592e1637", "score": "0.72605896", "text": "function getLocation() {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(function(position) {\r\n var lat = position.coords.latitude;\r\n var lon = position.coords.longitude;\r\n getLocalWeatherData(lat, lon);\r\n });\r\n }\r\n }", "title": "" }, { "docid": "208483243a336ae703eee13c1a03f8be", "score": "0.724868", "text": "async getWeatherFromGeo(lon, lat) { \n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&units=imperial&appid=${this.apiKey}`);\n const responseData = await response.json();\n return responseData; \n }", "title": "" }, { "docid": "55dddaf7431c32f828462067a631d841", "score": "0.7240521", "text": "function getLocation(loc) {\n $.getJSON(\n `https://api.opencagedata.com/geocode/v1/json?q=${loc}&key=14b2d2e206d945e6931169bc7e1ed01c`,\n function (data) {\n var latLong = data.results[0][\"geometry\"];\n var lat = latLong.lat;\n var long = latLong.lng;\n timeZoneDiff = data.results[0].annotations.timezone.offset_sec / 3600;\n getWeather(\n \"https://api.forecast.io/forecast/ded538b1a8782c194aee5d645961af0f/\" +\n lat +\n \",\" +\n long +\n \"?callback=?&extend=hourly\"\n );\n }\n );\n}", "title": "" }, { "docid": "2a1bd4436fe127776dfd202961d19434", "score": "0.7239442", "text": "function getCityInfo (city) {\n // format openweather api\n var apiUrl = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&appid=27a6e74d4260774945191a8dc4b750e0&units=imperial\"\n\n //make request to url\n fetch(apiUrl)\n .then(function(response){\n if(response.ok){\n return response.json()\n } else {\n getCityInfo(cityNameArray[cityNameArray.length-1])\n }\n })\n .then(function(data){\n var cityLat = data.coord.lat;\n var cityLon = data.coord.lon;\n \n \n //send info\n cityUvInfo (cityLat, cityLon);\n \n });\n}", "title": "" }, { "docid": "9f120ba31af9551f08406e9da5861297", "score": "0.7239327", "text": "function fetchLatLon(cityInput) {\n fetch(\"https://api.openweathermap.org/geo/1.0/direct?q=\" + cityInput + \"&limit=1&appid=c8aa884e6f28d929f55e9ba1856815bd\")\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n lat = data[0].lat;\n lon = data[0].lon;\n\n fetchWeather(lat, lon, satellitePasses);\n })\n}", "title": "" }, { "docid": "7b1a4a590c661e721a81e4d08bd3fda8", "score": "0.7236563", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n getWeather();\n });\n } else {\n latitude = 37.7749;\n longitude = 122.4194;\n getWeather();\n }\n}", "title": "" }, { "docid": "1ad37f5c3d41ee0051b9579ef99d55f3", "score": "0.72203887", "text": "function requestWeatherAndForecast(apiKey, lat, lon, city) {\n\tvar getWeatherInfo = $.getJSON(\n\t\t`https://api.darksky.net/forecast/${apiKey}/${lat},${lon}?exclude=minutely,hourly,alerts,flags&units=si&callback=?`);\n\tgetWeatherInfo.then(function(data) {\n\t\tdisplayWeather(data, city);\n\t\tdisplayForecast(data);\n\t});\n\tgetWeatherInfo.catch(function(err) {\n\t\tconsole.log('WeatherInfo: ' + JSON.stringify(err));\n\t});\n}", "title": "" }, { "docid": "03c7abc6dfa8517b99ca8e5436ef0dc4", "score": "0.72197306", "text": "function fecthCoords(city, country, state) {\n let countryCode = getCountryCode(country);\n fetch(\n `http://api.openweathermap.org/geo/1.0/direct?q=${city},${state},${countryCode}&appid=${API_KEY}`\n )\n .then((response) => response.json())\n .then((data) => displayCoords(data));\n}", "title": "" }, { "docid": "8f6a6a21d260c5ea7d7c98641fe1a8c7", "score": "0.7218958", "text": "function cityFind() {\n\n // console.log(apiUrl)\n console.log(city);\n fetch('https://api.openweathermap.org/data/2.5/weather?q=' + city + '&appid=' + apiKey)\n .then(function (response) {\n\n console.log(response);\n return response.json();\n })\n .then(function (data) {\n lat = data.coord.lat;\n lon = data.coord.lon;\n // console.log(lat)\n // console.log(lon)\n\n console.log(data);\n cityData()\n });\n}", "title": "" }, { "docid": "4f26398c807cfd0249a1c87d919bbbf0", "score": "0.7211232", "text": "function getcity() {\n $.get(\"http://ipinfo.io\", function(response) {\n console.log(response.city);\n $(\"#city\").html(response.city);\n weather(response.city);\n }, \"jsonp\")\n }", "title": "" }, { "docid": "a3caa8f7986255e43dc1fd5cc6821c38", "score": "0.72010285", "text": "function getLocation() {\n\t$.getJSON(\"http://ip-api.com/json\", function(res){\n\t\tcity = res.city;\n\t\tcountry = res.countryCode;\n\t\tlat = parseFloat(res.lat);\n\t\tlong = parseFloat(res.lon);\n\t\tgetWeather();\n\t\t$(\"#city\").html(city+\", \");\n\t\t$(\"#country\").html(country);\n\t});\n}", "title": "" }, { "docid": "2b3f049c08e2d02d293809493becbe9a", "score": "0.7197761", "text": "function getCoords(query){\n $.ajax({\n url: 'https://cors-anywhere.herokuapp.com/http://api.positionstack.com/v1/forward',\n data: {\n access_key: '1665e6e9379ebb7b035db50a9c23beec',\n query: query,\n limit: 1\n }\n }).then(function(response) {\n console.log(response.data);\n \n const lat = response.data[0].latitude;\n const lon = response.data[0].longitude;\n // insert coordinates into API call for weather\n const weatherURL = 'https://api.openweathermap.org/data/2.5/onecall?lat=' + lat + '&lon=' + lon + '&exclude=minutely,hourly,alerts&units=imperial&appid=4fee5100753d9c5843938d03bf31bfce';\n $.get(weatherURL).then(function(data){\n console.log(data);\n clearAll();\n // get current weather and push to page\n const current = data.current\n $('#city').text(response.data[0].label);\n $('#date').text(`(${dayjs.unix(current.dt).format('M/D/YY')})`);\n $('#icon').attr('src','http://openweathermap.org/img/wn/'+current.weather[0].icon+'@2x.png');\n $('#temp').text(`Temperature: ${current.temp}°F`);\n $('#hum').text(`Humidity: ${current.humidity}%`);\n $('#wind').text(`Wind: ${current.wind_deg}°, ${current.wind_speed} MPH`);\n // check UV index, add a class based on range\n const uvi = parseInt(current.uvi);\n const uv = $('#uvi');\n uv.text(uvi);\n if(uvi < 3){\n uv.addClass('low');\n }else if(uvi >= 3 && uvi < 6){\n uv.addClass('mod');\n }else if(uvi >= 6 && uvi < 8){\n uv.addClass('high');\n }else if(uvi >= 8 && uvi < 10){\n uv.addClass('vhigh');\n }else if(uvi >= 10){\n uv.addClass('extr');\n }; \n // fetch and push 5 day forecast\n for(i=0;i<5;i++){\n const daily = data.daily[i];\n $('#day'+i).text(dayjs.unix(daily.dt).format('ddd, MMM D'));\n $('#hi'+i).text(`H: ${Math.round(daily.temp.max)}°F`);\n $('#low'+i).text(`L: ${Math.round(daily.temp.min)}°F`);\n $('#hum'+i).text(`Humidity: ${daily.humidity}%`);\n $('#con'+i).text(daily.weather[0].description);\n $('#icon'+i).attr('src','http://openweathermap.org/img/wn/'+daily.weather[0].icon+'@2x.png');\n };\n });\n });\n \n}", "title": "" }, { "docid": "b9772fa8fde0d3bb92ad3002e8b591a7", "score": "0.71974397", "text": "function getLocation() {\n /* start of the weather api */\n var weather_api =\n \"https://api.forecast.io/forecast/d472859494062b7bddec5d4602dc98a7/\";\n\n /* if there is a way to get geolocation on your device then go through */\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n\n /* the geolocation api url call */\n var geo_api =\n \"http://api.geonames.org/findNearbyPostalCodesJSON?lat=\" +\n position.coords.latitude + \"&lng=\" +\n position.coords.longitude + \"&username=ekeitho\";\n /* call ajax on the api call */\n $.ajax({\n url: geo_api,\n success: function(data) {\n var loc = \"\" + data['postalCodes'][0]['adminName2'] +\n \", \" + data[\n 'postalCodes'][0]['adminCode1'];\n // append forcast to label\n $('#forecastLabel').append(\"<p> (\" + loc + \")</p>\");\n }\n });\n /* set the new api for weather to be the long and latitude of the geolcation */\n weather_api = weather_api + position.coords.latitude + \",\" +\n position.coords\n .longitude + \"?callback=?\";\n /* call the getTemperature with the UNIQUE lat and long* */\n getTemp(weather_api);\n },\n /* if there is an error */\n function(error) {\n // return for default lng and lat\n getTemp(weather_api + \"35.300399,-120.662362?callback=?\");\n });\n } else {\n // return default lng and lat\n getTemp(weather_api + \"35.300399,-120.662362?callback=?\");\n }\n}", "title": "" }, { "docid": "236fe3dcb285d42d17a7b8c3137fd13c", "score": "0.71944207", "text": "function getCoordinatesForCity(cityName) {\n var url = `${GOOGLE_MAPS_API_URL}?address=${cityName}&key=${GOOGLE_MAPS_API_KEY}`;\n\n // cityWeather.innerText = \"Weather in \" + cityName + \": \";\n\n return (\n fetch(url) //returns promise for a Response\n .then(response => response.json()) //Returns promise for the parsed JSON\n .then(function(data) {\n var coordinates = data.results[0].geometry.location;\n\n location = data.results[0].formatted_address;\n\n return coordinates;\n }) //Transform the response to only send back an object with lat and lng coordinates\n );\n }", "title": "" }, { "docid": "f530363e8979ff90f72b387cb295e54e", "score": "0.7182668", "text": "function getLatLong(response) {\n let weatherApiKeySearched = \"a0ec055234934001bdc16c33f46f3ecb\";\n let latitude = response.data.coord.lat;\n let longitude = response.data.coord.lon;\n let units = \"metric\";\n let cnt = 8;\n\n let forecastSearchedUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${latitude}&lon=${longitude}&appid=${weatherApiKeySearched}&units=${units}&cnt=${cnt}`;\n\n //GETTING FORECAST FOR THE NEXT FEW DAYS\n\n function getTomorrowWeather(response) {\n //UPDATE TOMORROW EMOJI ICON\n let updateTomWeatherEmoji = document.querySelector(\"#tom-weather-emoji\");\n\n updateTomWeatherEmoji.innerHTML = response.data.daily[0].weather[0].icon;\n let updateEmojiIcon = response.data.daily[0].weather[0].icon;\n updateTomWeatherEmoji.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${updateEmojiIcon}@2x.png`\n );\n\n updateTomWeatherEmoji.setAttribute(\n \"alt\",\n response.data.daily[0].weather[0].main\n );\n\n //UPDATING CURRENT POP HERE AS OTHER API DOES NOT HAVE INFO\n let updateRainCurr = document.querySelector(\".rain-curr\");\n updateRainCurr.innerHTML = Math.trunc(response.data.hourly[0].pop * 100);\n\n //UPDATING TOMORROW FACTORS IN WEATHER\n\n let updateTomWeatherTemp = document.querySelector(\".currentTempNumberT\");\n updateTomWeatherTemp.innerHTML = `${Math.round(\n response.data.daily[0].temp.day\n )}°C`;\n\n let updateTomFeelsTemp = document.querySelector(\".tom-Feel\");\n updateTomFeelsTemp.innerHTML = `${Math.round(\n response.data.daily[0].feels_like.day\n )}°C`;\n\n let updateTomWindSpeed = document.querySelector(\".tom-wind-speed\");\n updateTomWindSpeed.innerHTML = Math.round(\n response.data.daily[0].wind_speed\n );\n\n let updateRainfall = document.querySelector(\".tom-rainfall\");\n updateRainfall.innerHTML = Math.trunc(response.data.daily[0].pop * 100);\n\n let updateTomLowTemp = document.querySelector(\".tom-low-temp\");\n updateTomLowTemp.innerHTML = Math.round(response.data.daily[0].temp.min);\n\n let updateTomHighTemp = document.querySelector(\".tom-high-temp\");\n updateTomHighTemp.innerHTML = Math.round(response.data.daily[0].temp.max);\n\n // 7 DAY FORECAST FOR SEARCHED CITY\n\n function formatWeekday(timestamp) {\n let date = new Date(timestamp * 1000); //this is * 1000 because this is based off of a specific year API time was started\n\n let day = date.getDay(); //converts timestamp number into a single digit that represents Sun - Sat from #0 - 6\n\n let days = [\n \"SUNDAY\",\n \"MONDAY\",\n \"TUESDAY\",\n \"WEDNESDAY\",\n \"THURSDAY\",\n \"FRIDAY\",\n \"SATURDAY\",\n ];\n\n return days[day]; //have the day index go through the days array created to match number to string\n }\n\n let forecast = document.querySelector(\"#forecast\");\n\n let forecastHtml = `<div class=\"row\">`; //Opened a div so need to close it to prevent errors\n\n let weatherForEachDay = response.data.daily;\n\n weatherForEachDay.forEach(function (day, index) {\n //index represents each forecastHTML value 0 - w.e number, can cap the index numbers to display only a specific number of forecastHTML\n if (index < 7) {\n forecastHtml =\n forecastHtml +\n `<div class=\"col day-container forecast-font\">\n ${formatWeekday(day.dt)}\n <p class=\"status-font\">${day.weather[0].main}</p>\n <img\n src=\"http://openweathermap.org/img/wn/${\n day.weather[0].icon\n }@2x.png\"\n alt=\"Rain\"\n id=\"forecast-icon\"\n />\n <p class=\"forecast-temp-num\">${Math.round(\n day.temp.max\n )}°C</p>\n <p class=\"status-font\">HIGH</p>\n <p class=\"forecast-temp-num\">${Math.round(\n day.temp.min\n )}°C</p>\n <p class=\"status-font\">LOW</p>\n </div>`;\n }\n });\n forecastHtml = forecastHtml + `</div>`; //Need to close the div opened at the beginning\n forecast.innerHTML = forecastHtml;\n }\n\n axios.get(forecastSearchedUrl).then(getTomorrowWeather);\n }", "title": "" }, { "docid": "ed45d062b70c8aa9cbc633f8afe17baa", "score": "0.717403", "text": "function getCityWeather(lat, lon) {\n var queryURL = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&units=imperial&exclude=hourly,minutely&appid=362001ca18aa50ad6cce0cd209741e8b\";\n $.ajax({\n url: queryURL,\n method: \"GET\",\n success: function (response) {\n console.log(response)\n //current weather\n var currentIcon = \"https://openweathermap.org/img/w/\" + response.current.weather[0].icon + \".png\";\n var currentTemp = response.current.temp;\n var currentHumidity = response.current.humidity;\n var currentWind = response.current.wind_speed;\n var currentUV = response.current.uvi;\n var currentPrecip = Math.round(response.daily[0].pop * 100);\n var currentDescription = response.current.weather[0].description;\n var currentDay = moment.unix(response.current.dt).format('dddd MMMM Do YYYY');\n $(\".city-icon\").attr(\"src\", currentIcon);\n $(\".city-description\").text(currentDescription);\n $(\".city-temp\").text(\"Temperature: \" + currentTemp + \" °F\");\n $(\".city-precip\").text(\"Precipitation: \" + currentPrecip + \"%\")\n $(\".city-humidity\").text(\"Humidity: \" + currentHumidity + \"%\");\n $(\".city-wind\").text(\"Wind Speed: \" + currentWind + \" MPH\")\n $(\".city-UV\").text(currentUV);\n $(\".city-date\").text(currentDay);\n\n //UV Index Color Formatting\n if (currentUV < 3) {\n $(\".city-UV\").css(\"background-color\", \"green\");\n } else if (currentUV > 2 && currentUV < 6) {\n $(\".city-UV\").css(\"background-color\", \"yellow\");\n $(\".city-UV\").css(\"color\", \"black\");\n } else if (currentUV > 5 && currentUV < 8) {\n $(\".city-UV\").css(\"background-color\", \"orange\");\n $(\".city-UV\").css(\"color\", \"black\");\n } else if (currentUV > 7 && currentUV < 11) {\n $(\".city-UV\").css(\"background-color\", \"red\");\n } else {\n $(\".city-UV\").css(\"background-color\", \"#954F71\");\n }\n\n //5 day forecast\n for (let i = 1; i < response.daily.length - 2; i++) {\n var forecastIcon = \"https://openweathermap.org/img/w/\" + response.daily[i].weather[0].icon + \".png\";\n var forecastTemp = response.daily[i].temp.day;\n var forecastPrecip = Math.round(response.daily[i].pop * 100);\n var forecastHumidity = response.daily[i].humidity;\n var forecastDay = moment.unix(response.daily[i].dt).format('ddd D');\n $(\".city-day\").each(function () {\n if (i == $(this).attr(\"data-value\")) {\n $(this).empty();\n $(this).append(forecastDay);\n }\n })\n $(\".city-card-daily\").each(function () {\n if (i == $(this).attr(\"data-value\")) {\n $(this).empty();\n $(this).append(\"Temp: \" + forecastTemp + \" °F\" + \"<br>\" + \"Humidity: \" + forecastHumidity\n + \"%\" + \"<br>\" + \"Precipitation: \" + forecastPrecip + \"%\");\n }\n })\n $(\".city-card-icon\").each(function () {\n if (i == $(this).attr(\"alt\")) {\n $(this).attr(\"src\", forecastIcon);\n }\n })\n }\n }\n })\n}", "title": "" }, { "docid": "2e5f0fd455188c79e653a3f8bc053840", "score": "0.7152623", "text": "function getCity() {\n var xhr = new XMLHttpRequest;\n xhr.open(\"GET\", \"https://maps.googleapis.com/maps/api/geocode/json?latlng=\" +\n location.latitude + \",\" + location.longitude + \"&key=\" + GOOGLE_MAPS_KEY);\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 3) {\n console.log(\"loading\");\n } else if (xhr.readyState == xhr.DONE && xhr.status == 200) {\n parseCity(JSON.parse(xhr.responseText));\n makeWeatherRequest(new Date());\n }\n }\n xhr.send();\n }", "title": "" }, { "docid": "7b27e73091d563fe85f2171b0bb312c8", "score": "0.7141417", "text": "function getWeather( lat, lon ) {\n let key = 'cd9757a25f0b56fd1aaa0121fbcec723';\n fetch('https://api.openweathermap.org/data/2.5/onecall?lat=' + lat + '&lon=' + lon + '&units=imperial' + '&appid=' + key )\n .then(function(resp) {\n return resp.json();\n })\n .then(function(data) {\n insertWeatherData(data);\n })\n inputCityStorage(citySearch.value);\n removeButtons();\n getStoredCities();\n}", "title": "" }, { "docid": "334daced78d098060b80cd4ac6445b57", "score": "0.7126662", "text": "function findCity(coord) {\n $.get(\"https://api.openweathermap.org/data/2.5/forecast\", {\n lon: coord[1],\n lat: coord[0],\n appid: open_weatherToken,\n units: \"imperial\"\n }).done(function (results) {\n city = results.city.name;\n\n $(\".city\").html(\"<h6>Current city: <span>\" + city + \"</span> </h6>\");\n });\n }", "title": "" }, { "docid": "995c830e4e102afa104272c4b9878285", "score": "0.71135473", "text": "async function getWeatherStatusCoord(lat, lon) {\n const response = await fetch(`https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&cnt=1&appid=74cf9aad542ba0362b638cca56523499&units=metric`); \n const weather = await response.json();\n return weather;\n\n}", "title": "" }, { "docid": "83406f49750ad092507bb9b22da89578", "score": "0.7110752", "text": "function callWeather() {\n let queryURL =\n \"https://api.openweathermap.org/data/2.5/weather?q=\" +\n city +\n \"&appid=\" +\n APIKey +\n \"&units=imperial\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (response) {\n lat = response.coord.lat;\n lon = response.coord.lon;\n displayMainWeather(response);\n });\n}", "title": "" }, { "docid": "d6407390433779b53742d6a6fccbc9ba", "score": "0.71092284", "text": "function getCurrentGeoPosition() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n let result = fetchWeatherData(\n null,\n position.coords.latitude,\n position.coords.longitude\n );\n return result;\n });\n } else {\n alert(\"Your browser does not support Geolocation API!\");\n }\n}", "title": "" }, { "docid": "f03bcf45541218f5f4c5db06409b6cde", "score": "0.7087027", "text": "function getLocation()\n {\n var url = 'http://freegeoip.net/json/';\n //build variables where to store parsed data from JSON\n var parseLoc,\n city,\n region,\n latitude,\n longitude,\n displayLoc;\n //send a request to get the location using standard javascript syntax\n\n var requestLoc = new XMLHttpRequest();\n requestLoc.onreadystatechange = function() {\n \n // if the connection is successful and the request goes thru\n if (requestLoc.readyState === 4) \n {\n loc.innerHTML = '... request received ...';\n \n // check if the API sent back OK TO GO\n if (requestLoc.status === 200)\n {\n // parse the JSON response\n parseLoc = JSON.parse(requestLoc.responseText);\n \n // assign parsed response to variables\n city = parseLoc.city;\n region = parseLoc.region_name;\n latitude = parseLoc.latitude;\n longitude = parseLoc.longitude;\n \n \n // what I want to display is the city, with the region\n displayLoc = city + ', ' + region;\n \n \n // assign to innerHtml\n loc.innerHTML = displayLoc;\n \n //Repeat same reasoning for the weather\n //Need to fix my API key\n var weatherUrl = 'http://api.openweathermap.org/data/2.5/weather?lat='+latitude+'&lon='+longitude+'&APPID=80058d224d4915384c1749bf88529005';\n var parsedWeather,\n icon,\n \ttemp,\n C,\n F,\n celsius,\n displayWeather,\n degHtml;\n\n var wRequest = new XMLHttpRequest();\n wRequest.onreadystatechange = function()\n {\n if (wRequest.readyState === 4) \n {\n weather.innerHTML = '... request received ...';\n if (wRequest.status === 200) \n {\n parsedWeather = JSON.parse(wRequest.responseText);\n icon = parsedWeather.weather[0].id;\n temp = parsedWeather.main.temp;\n C = Math.round(temp - 273.15);\n F = Math.round((temp * (9 / 5)) - 459.67);\n displayWeather = '<div>' \n + '<i class=\"wi wi-owm-' + icon + '\"></i></div>';\n\n celsius = true;\n degHtml = C + '&deg; C';\n deg.innerHTML = degHtml;\n\n var switcher = document.getElementById('switcher');\n switcher.addEventListener('click', function() {\n \n if (celsius === true) \n {\n degHtml = F + '&deg; F';\n deg.innerHTML = degHtml;\n celsius = false;\n } else \n {\n degHtml = C + '&deg; C';\n deg.innerHTML = degHtml;\n celsius = true;\n }\n \n }, false);\n\n weather.innerHTML = displayWeather;\n\n } else\n {\n weather.innerHTML = 'Request for weather received by server, but there is a problem with response: ' + wRequest.status;\n }\n }\n }\n\n wRequest.open('GET', weatherUrl, false);\n wRequest.send(null);\n } else\n {\n loc.innerHTML = 'Request for location received by server, but there is a problem with response: ' + requestLoc.status;\n }\n }\n }\n \n requestLoc.open('GET', url, true);\n requestLoc.send(null);\n }", "title": "" }, { "docid": "075b562f1f7178eaadda2f154d16fda1", "score": "0.7085468", "text": "function weatherData(city){\n $.ajax({\n url: \"http://api.openweathermap.org/data/2.5/weather?q=\"+city+\"&appid=4990a0ba671639637ded74843defb334\",\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n updateWeather(response);\n uvIndex(response.coord.lat, response.coord.lon);\n });\n}", "title": "" }, { "docid": "9f1d26dbdfc509a7a981d71ca673607c", "score": "0.70819217", "text": "function getLocation(){\n var city;\n var country;\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position){\n /// console.log(position); debugging\n lat = position.coords.latitude;\n lng = position.coords.longitude;\n\n console.log(lat);\n if(lat && lng){\n $.ajax({\n\n url: \"https://maps.googleapis.com/maps/api/geocode/json?latlng=\" + lat +\",\"+ lng + \"&key=\" + googleApiKey,\n type: \"GET\",\n dataType: \"json\",\n success: function(data){\n city = data.results[0].address_components[4].short_name;\n country = data.results[0].address_components[7].short_name;\n // console.log(city);\n viewWeather(city,country);\n }\n\n })\n }\n else{\n $(\"#message\").text(\"Cannot find geoLocation\");\n }\n\n });\n } else {\n $(\"#message\").text(\"Cannot find geoLocation\");\n }\n}", "title": "" }, { "docid": "ee9670258da2b6c8e1b2a80fa89e5158", "score": "0.7040054", "text": "function getWeatherAPI(city) {\n // sending a request to the open weather map site to get the weather data\n fetch(`http://api.openweathermap.org/data/2.5/weather?q=${city.cityName}&units=${tempUnits}&appid=${WEATHER_API_KEY}`)\n .then(response => response.json())\n .then(data => setWeather(data))\n .then(weather => displayWeather(weather, city));\n}", "title": "" }, { "docid": "289a115b99107460824a5f82440307a0", "score": "0.70394176", "text": "function findCurrentWeatherData(cityName) {\n console.log(\"this is city name\", cityName);\n let requestUrl = `https://api.openweathermap.org/data/2.5/weather?q=${cityName}&units=imperial&appid=${apiKey}`;\n $.ajax({\n url: requestUrl,\n method: \"GET\",\n }).then(function (response) {\n console.log(\"Single Day Forecast\", response);\n latitude = response.coord.lat;\n longitude = response.coord.lon;\n console.log(\"lat lon\", latitude, longitude);\n displayCurrentWeather(response);\n\n // displayDayWeather(response);\n // const customWeatherDataObj = {};\n // customWeatherDataObj.currentWeather = {};\n // customWeatherDataObj.currentWeather.weather = response.weather;\n // customWeatherDataObj.currentWeather.wind.deg = response.wind.deg;\n // customWeatherDataObj.currentWeather.wind.speed = response.speed;\n\n findFiveDayForecastWeatherData(cityName)\n\n });\n}", "title": "" }, { "docid": "8a0e794d08b37f32e7b11b1f9b516622", "score": "0.7035648", "text": "function getCity(latitude, longitude) {\n const apiKey = `&key=${config.GOOGLE_KEY}`;\n const url = 'https://maps.googleapis.com/maps/api/geocode/json';\n const latlong = `?latlng=${longitude},${latitude}`;\n const locality = '&result_type=locality';\n const endpoint = `${url}${latlong}${locality}${apiKey}`;\n\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'json';\n xhr.onreadystatechange = () => {\n if (xhr.status >= 200 && xhr.status < 400) {\n renderCityResponse(xhr.response);\n\n }\n else {\n // sumthn went wrong bud :(\n }\n }\n xhr.open('GET', endpoint);\n xhr.send();\n\n}", "title": "" }, { "docid": "cabf593318a7ae4a46c9c0bf20f7cf21", "score": "0.7030848", "text": "function weather()\n{\n\tvar url = null;\n\t\n\t// URL for service\n\turl = WEATHER_ROOT + \"?\" + LATITUDE + \"=\" + latitude + \"&\" + LONGITUDE + \"=\" + longitude;\n\t\n\t// Call service\n\tcloud.get( url ).then( doWeatherLoad, doWeatherError );\n}", "title": "" }, { "docid": "2910cb1a09ac52a9289813d809ca3087", "score": "0.7025806", "text": "function getOWMData() {\n fetch(\n 'https://api.openweathermap.org/data/2.5/weather?q=Stuttgart,DE&APPID=5f867317a42e45aad8ac2fd5f92ddec3'\n )\n .then((res) => res.json())\n .then((json) => parseWeatherData(json));\n navigator.geolocation.getCurrentPosition((data) => {\n fetch(\n 'https://api.openweathermap.org/data/2.5/weather?APPID=5f867317a42e45aad8ac2fd5f92ddec3&lon=' +\n data.coords.longitude +\n '&lat=' +\n data.coords.latitude\n )\n .then((res) => res.json())\n .then((json) => parseWeatherData(json));\n });\n}", "title": "" }, { "docid": "d073a4b51c6f81da1371d073dce7c3c4", "score": "0.7024658", "text": "function getLocation() {\n // CHECKS FOR VALID GEO DATA\n if (\"geolocation\" in navigator) {\n navigator.geolocation.getCurrentPosition(function (position) {\n // SENDS POSITION TO GET WEATHER\n var coords = position.coords.latitude + \",\" + position.coords.longitude;\n getWeather(coords);\n });\n } else {\n // HANDLE NO GEO DATA\n alert(\"Your Browser Does Not Support Geographical Information\");\n }\n}", "title": "" }, { "docid": "eab318f2773bf593a99ce298dd6eae62", "score": "0.70235217", "text": "async currentWeather(){\n return getWeatherLocation(this.lat,this.lon,'weather')\n }", "title": "" }, { "docid": "53f31e26992d3af08a55bd0890c6f5ad", "score": "0.70176566", "text": "function getForecastWeatherAPI() {\n displayForecastWeather(5);\n $.get(\"https://api.openweathermap.org/data/2.5/forecast?q=\" + cityName + \"&units=\" + tempUnit[1] + \"&APPID=\" + apiKey)\n .then(function(res) {\n // res.setHeader(\"Set-Cookie\", \"HttpsOnly;Secure;SameSite=Strict\")\n $(\".city\").text(res.city.name);\n lon = res.city.coord.lon;\n lat = res.city.coord.lat;\n console.log(res);\n getUVindexForecast(lon, lat);\n sortForecast(res);\n });\n}", "title": "" }, { "docid": "7e956574f0aec429286382c4783f3109", "score": "0.7016989", "text": "function getWeatherData(city) {\n\tvar appid = '9aae1d7d5854d6a61065bbbf23e68178';\n\n\t// format api url\n\tvar currentWeatherUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=imperial&appid=${appid}`;\n\n\t// make a request to url for current weather\n\tfetch(currentWeatherUrl)\n\t\t.then(function(res) {\n\t\t\t// verify response\n\t\t\tif (res.ok) {\n\t\t\t\t// parse response\n\t\t\t\tres.json().then(function(data) {\n\t\t\t\t\t// if city is not already displayed in city list, display it (and save to array & LS). if city is already displayed, don't call update function, just carry on\n\t\t\t\t\tif (!cities.includes(data.name)) {\n\t\t\t\t\t\tupdateCities(data.name);\n\t\t\t\t\t}\n\n\t\t\t\t\t// send data to be displayed\n\t\t\t\t\tdisplayCurrentWeather(data);\n\n\t\t\t\t\t// get coordinates to pass as params to uv and forecast endpoints\n\t\t\t\t\tvar lat = data.coord.lat;\n\t\t\t\t\tvar lon = data.coord.lon;\n\n\t\t\t\t\t// format UV index fetch request with coordinates\n\t\t\t\t\tvar uvIndexUrl = `https://api.openweathermap.org/data/2.5/uvi?appid=${appid}&lat=${lat}&lon=${lon} `;\n\t\t\t\t\t// make a request for current UV Index\n\t\t\t\t\tfetch(uvIndexUrl).then(function(uvRes) {\n\t\t\t\t\t\tif (uvRes.ok) {\n\t\t\t\t\t\t\tuvRes.json().then(function(uvData) {\n\t\t\t\t\t\t\t\t// send data to be displayed\n\t\t\t\t\t\t\t\tdisplayUVIndex(uvData);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\talert('Sorry, the UV Index was not found for that city');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\t// format 5-day forecast fetch request with coordinates\n\t\t\t\t\tvar forecastWeatherUrl = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&units=imperial&exclude={current, hourly, minutely}&appid=${appid}`;\n\n\t\t\t\t\tfetch(forecastWeatherUrl).then(function(forecastRes) {\n\t\t\t\t\t\tif (forecastRes.ok) {\n\t\t\t\t\t\t\tforecastRes.json().then(function(forecastData) {\n\t\t\t\t\t\t\t\t// send data to be displayed\n\t\t\t\t\t\t\t\tdisplayForecastWeather(forecastData);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\talert(\n\t\t\t\t\t\t\t\t'Sorry, the 5-day forecast data is not available for that city'\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} else {\n\t\t\t\t// alert('Error: ' + Response.statusText);\n\t\t\t\talert('Sorry, that city was not found, please try again.');\n\t\t\t}\n\t\t})\n\t\t// catch network errors\n\t\t.catch(function(error) {\n\t\t\talert('Unable to connect to Open Weather Map');\n\t\t});\n}", "title": "" }, { "docid": "374735e9c774ba46fa08fa240081490d", "score": "0.70169365", "text": "function getOWMForecast() {\n fetch(\n 'https://api.openweathermap.org/data/2.5/forecast?q=Stuttgart,DE&APPID=5f867317a42e45aad8ac2fd5f92ddec3'\n )\n .then((res) => {\n return res.json();\n })\n .then((json) => parseWeatherForecast(json));\n navigator.geolocation.getCurrentPosition((data) =>\n fetch(\n 'https://api.openweathermap.org/data/2.5/forecast?APPID=5f867317a42e45aad8ac2fd5f92ddec3&lon=' +\n data.coords.longitude +\n '&lat=' +\n data.coords.latitude\n )\n .then((res) => {\n return res.json();\n })\n .then((json) => parseWeatherForecast(json))\n );\n}", "title": "" }, { "docid": "1bee5be8bc844be560758fe7b831e0e9", "score": "0.7013544", "text": "async getCoords() {\n try {\n const data = await getCurrentLocation({\n enableHighAccuracy: true,\n maximumAge: 0,\n });\n this.coords = [ data.coords.latitude, data.coords.longitude ];\n } catch(err) {\n const parent = document.querySelector('.current_weather')\n renderError(parent, 'You have to enable the location')\n }\n }", "title": "" }, { "docid": "8e153bd9777f807ee3d140a5a73a276e", "score": "0.7006384", "text": "function getCurrentWeather(city) {\n fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}`\n )\n .then((res) => res.json())\n .then(console.log);\n}", "title": "" }, { "docid": "a99d4585e262a87f3e61037524686b82", "score": "0.69908", "text": "function getWeatherAPI() {\n // get the geo location\n navigator.geolocation.getCurrentPosition(function (location) {\n var geo = location.coords.latitude + ',' + location.coords.longitude;\n // Form the url\n var url = 'http://api.apixu.com/v1/current.json?key=caefebf6e1904ebcae3130449192601&q=' + geo;\n // API Endpoint\n $.getJSON(url, function (data) {\n // Update weather\n weather = data.current.temp_c;\n feelsLike = data.current.feelslike_c;\n weatherIcon = data.current.condition.icon;\n weather_f = data.current.feelslike_f;\n condition = data.current.condition.text;\n humidity = data.current.humidity;\n feelslike = data.current.feelslike_c;\n feelslike_f = data.current.feelslike_f;\n wind_mph = data.current.wind_mph;\n wind_kph = data.current.wind_kph;\n vis_km = data.current.vis_km;\n vis_m = data.current.vis_miles;\n // Update Weather data in Local Storage\n writeWeather();\n // Update UI of Weather (Fixes Bug)\n updateWeatherUI(set_weather_scale_f);\n })\n });\n }", "title": "" }, { "docid": "d2b5dbec91b2ab95cbf5bad734912683", "score": "0.6987879", "text": "function getCoordsFromCity(JSON) {\n const lat = `${JSON.data.city.coord.lat}`;\n const lon = `${JSON.data.city.coord.lon}`;\n apiCall(lat, lon);\n}", "title": "" }, { "docid": "f9c6d00726dc52357e24909612700a94", "score": "0.6982832", "text": "function corrfind() {\n cities.push(inputCity.value);\n localStorage.setItem(\"cities\", JSON.stringify(cities));\n showHistory();\n let key = \"720340e154314c77dd80d328e3567077\";\n // this element is holding the api link for the\n let weatherURL =\n \"https://api.openweathermap.org/data/2.5/forecast?q=\" +\n inputCity.value +\n \"&appid=\" +\n key;\n fetch(weatherURL)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data);\n // confirming the location of the coordinates in the api data\n let lat = data.city.coord.lat;\n let lon = data.city.coord.lon;\n console.log(lat);\n console.log(lon);\n weather(data);\n });\n}", "title": "" }, { "docid": "4c1e7dfdd822b3a87119d94f36ebdbb2", "score": "0.6976811", "text": "function getLocalWeather(){\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position){\n long = position.coords.longitude;\n lat = position.coords.latitude;\n\n weatherRequest();\n });\n }\n}", "title": "" }, { "docid": "8901b4629a83dd4d296f3463384517bb", "score": "0.6964676", "text": "function getWeather(searchCity) {\n var lat;\n var lon;\n // Gets coordinates by city name so we can make the onecall ajax call \n $.ajax({\n url: queryURL_getCoords + searchCity,\n method: 'GET'\n }).then(function(response) {\n lat = response.coord.lat;\n lon = response.coord.lon;\n console.log(response)\n // Get city name\n $('#city-name').text(response.name)\n var queryURL = 'https://api.openweathermap.org/data/2.5/onecall?units=imperial&appid=7eef78754aaa2ca60da79139ada4f6f4&lat=' + lat + '&lon=' + lon;\n // Uses coordinates from weather ajax call\n $.ajax({\n url: queryURL,\n method: 'GET'\n }).then(function(response){\n console.log(response)\n // Loop through daily array to get today + 5 days\n for (var i = 0; i < response.daily.length - 2; i++) {\n // Get date from unix time stamp and format to XX/XX/XXXX\n var unixTimeStamp = response.daily[i].dt\n var date = new Date(unixTimeStamp * 1000);\n var month = (date.getMonth() + 1).toString().padStart(2, '0');\n var day = date.getDate().toString().padStart(2, '0');\n var year = date.getFullYear();\n console.log(month + '/' + day + '/' + year);\n $('#date-' + i).text(month + '/' + day + '/' + year);\n \n // Get weather icons\n var iconID = response.daily[i].weather[0].icon\n $('#weather-img-' + i).attr('src', 'http://openweathermap.org/img/wn/' + iconID + '@2x.png');\n \n // Get temperature\n var tempID = Math.floor(response.daily[i].temp.max);\n $('#temp-' + i).text('Temp: ' + tempID + ' °F')\n\n // Get humidity\n var humidID = response.daily[i].humidity;\n $('#humid-' + i).text('Humidity: ' + humidID + ' %')\n }\n // Get windspeed\n var windID = Math.floor(response.daily[0].wind_speed);\n $('#wind-0').text('Wind Speed: ' + windID + ' MPH')\n\n // Get uv index\n var uvIndex = response.daily[0].uvi;\n $('#uvi-0').html('<b>UV Index: <b>' + '<div id=\"uvi-badge\" class=\"badge badge-light\">' + uvIndex + '</div>');\n if (uvIndex < 3) {\n $('#uvi-badge').css('background', 'darkgreen')\n } else if (uvIndex >= 3 && uvIndex < 6) {\n $('#uvi-badge').css('background', 'gold')\n } else if (uvIndex >= 6 && uvIndex < 8) {\n $('#uvi-badge').css('background', 'orange')\n } else if (uvIndex >= 8 && uvIndex < 11) {\n $('#uvi-badge').css('background', 'red')\n } else {\n $('#uvi-badge').css('background', 'darkviolet')\n }\n });\n }); \n}", "title": "" }, { "docid": "a52fb853b7634826b7f3bb7a99e69060", "score": "0.6959206", "text": "function getWeather(city) {\n // setting api key to a variable\n let apiKey = \"6d2d2840d31a11364a7bbe1cba528b23\";\n // setting api url to a variable\n let apiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=imperial`;\n\n // fetching apiUrl\n fetch(apiUrl).then(function (response) {\n response.json().then(function (data) {\n // getting current weather conditions and displaying to page\n createCurrentConditions(data, city);\n });\n });\n}", "title": "" }, { "docid": "ba2a64bf03140503e5ce3ed54b4d25aa", "score": "0.69494146", "text": "function getCityName(name) {\n var queryURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + name + \"&appid=3e0e5c5529a43577f74e6903ca5baa30\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n initMap(response.city.coord.lat, response.city.coord.lon);\n weatherAPI(response.city.coord.lat, response.city.coord.lon);\n });\n}", "title": "" }, { "docid": "bba62c67393dbbcd93b02d083f171297", "score": "0.69454664", "text": "function getLocationInfo(response) {\n cityName = response.data.name;\n latitude = response.data.coord.lat;\n longitude = response.data.coord.lon;\n return response;\n}", "title": "" }, { "docid": "3f04440d24c9ffc754682721af80d2b4", "score": "0.69362736", "text": "function getCoords(position){\n var lat = position.coords.latitude;\n var lon = position.coords.longitude;\n //Get data of API\n $.getJSON(API_WEATHER_URL + \"lat=\" + lat + \"&lon=\" + lon,getCurrentWeather);\n\n }", "title": "" }, { "docid": "1627dba4f5440f93cd7fd1b407fa7cc0", "score": "0.69249827", "text": "function getWeather(userLong, userLat){\n const weatherParams = {\n lat: userLat,\n lon: userLong,\n appid: openWeatherAPIKey\n };\n const weatherQueryString = formatQueryParams(weatherParams)\n const openWeatherURL = openWeatherSearchURL + '?' + weatherQueryString;\n\n fetch(openWeatherURL)\n .then(response=>response.json())\n .then(data => {\n weather = data.current.weather[0].main;\n uvi = data.current.uvi;\n getPollen(userLong, userLat);\n })\n .catch(err=> alert(\"Something went wrong. Make sure you're connected to the internet, or try again.\")\n\n );\n}", "title": "" }, { "docid": "75c06e7e5f694ac2177fd66e90156ece", "score": "0.6917389", "text": "getGeoLocationWeather(){\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(shareLocation,showError); \n } else {\n alert(\"Geolocation is not supported by this browser.\");\n }\n //saving current this object properties in that to use inside sharedLocation function.\n const that=this;\n function shareLocation(position){\n that.query = `geolookup/conditions/q/${position.coords.latitude},${position.coords.longitude}.json`;\n console.log('Giving cordinates to the api', that.query, position.coords);\n getWeather();\n }\n\n function showError(error){\n switch (error.code) {\n case error.PERMISSION_DENIED:\n alert(\"User denied the request for Geolocation.\");\n break;\n case error.POSITION_UNAVAILABLE:\n alert(\"Location information is unavailable.\");\n break;\n case error.TIMEOUT:\n alert(\"The request to get user location timed out.\");\n break;\n case error.UNKNOWN_ERROR:\n alert(\"An unknown error occurred.\");\n break;\n }\n }\n }", "title": "" }, { "docid": "25be66b7444c0231ccc284b04aa2aa67", "score": "0.6900741", "text": "function getLocationFromAPI(city) {\n console.log('requesting info from api');\n const url = 'https://us1.locationiq.com/v1/search.php';\n return superagent.get(url)\n .query({\n key: process.env.GEO_KEY,\n q: city,\n format: 'json'\n })\n .then(locationResponse => {\n let geoData = locationResponse.body;\n const location = new Location(city, geoData);\n setLocationInDB(location);\n return location;\n }).catch(err => {\n console.log(err);\n errorHandler(err, request, response);\n });\n }", "title": "" }, { "docid": "d5fef5103b8185ab5d106019f14c10cf", "score": "0.68989706", "text": "function getCityCoords(cityName) {\n $(\".city-name\").text(cityName)\n var coordsURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + cityName + \"&appid=362001ca18aa50ad6cce0cd209741e8b\";\n $.ajax({\n url: coordsURL,\n method: \"GET\",\n error: function() { //if error reset list and alert user\n console.log(\"ERROR HEHE\");\n cityList.pop();\n localStorage.setItem(\"allCities\", JSON.stringify(cityList));\n alert(\"Unknown city, please try again\");\n generateCityList(cityList);\n getCityCoords(cityList[0].city);\n } ,\n success: function (coordsResponse) {\n console.log(coordsResponse);\n var lat = coordsResponse.coord.lat;\n var lon = coordsResponse.coord.lon;\n getCityWeather(lat, lon);\n }\n })\n}", "title": "" }, { "docid": "6e53243519e309de4b784130c7b5d084", "score": "0.68939847", "text": "async getWeather() {\n const response = await fetch(`http://api.wunderground.com/api/${this.apiKey}/conditions/q/${this.state}/${this.city}.json`);\n\n const responseData = await response.json();\n\n return responseData.current_observation;\n }", "title": "" }, { "docid": "f064f6bbbc4efd1d56c9b7abe84dd927", "score": "0.68916464", "text": "function weatherAPI(city) {\n let weatherPath = \"/weather\";\n axios\n .get(\n apiRoot +\n weatherPath +\n \"?q=\" +\n city +\n \"&appid=\" +\n apiKey +\n \"&&units=\" +\n weatherUnits\n )\n .then(displayTemp);\n}", "title": "" }, { "docid": "28489d70bf9cf288db99ae5b70abd2b4", "score": "0.6887397", "text": "function getLocationByKey(cityKey) {\n const API_KEY = 'Your API Key Goes Here';\n const URL = 'https://dataservice.accuweather.com/locations/v1/'+cityKey+'?apikey='+API_KEY;\n fetch(URL)\n .then(response => response.json())\n .then(function (data) {\n console.log('Json object from getLocationByKey function:');\n console.log(data);\n const locData = {}; // Create an empty object\n locData['key'] = data.Key; // Add the value to the object\n locData['name'] = data.LocalizedName;\n locData['postal'] = data.PrimaryPostalCode;\n locData['state'] = data.AdministrativeArea.LocalizedName;\n locData['stateAbbr'] = data.AdministrativeArea.ID;\n let lat = data.GeoPosition.Latitude;\n let long = data.GeoPosition.Longitude;\n const LOCALE = lat+', '+long;\n locData['geoposition'] = LOCALE;\n locData['elevation'] = data.GeoPosition.Elevation.Imperial.Value;\n getWeather(locData);\n })\n .catch(error => console.log('There was a getLocationByKey error: ', error))\n } // end getLocationByKey function", "title": "" }, { "docid": "e9e6519d342fe5505c3aadebd485470d", "score": "0.68854535", "text": "function getCoordinates(searchInp) {\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + searchInp + \"&appid=\" + APIKey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n\n latCity = response.coord.lat;\n longCity = response.coord.lon;\n\n getUVIndex(latCity, longCity);\n });\n\n //GET UV INDEX INFORMATION USING GEOGRAPHIC COORDINATES\n}", "title": "" }, { "docid": "84b7842da39a0de57cb006e2cd1cb39a", "score": "0.6877333", "text": "async function getWeatherAW(lat, lon) {\r\n try{ \r\n const Response = await fetch(`${proxy}${myApi}onecall?lat=${lat}&lon=${lon}&exclude=${part}&appid=${key}&lang=en&units=metric`);\r\n const data = await Response.json();\r\n console.log(data);\r\n const today = data.daily[0];\r\n await showdata(today);\r\n }\r\n catch(error) {\r\n console.log(error);\r\n }\r\n }", "title": "" }, { "docid": "391547d30a45c173db6c04bfa6711c2e", "score": "0.68772185", "text": "function getWeather(position) {\r\n try {\r\n //saving the latitude and longitude\r\n let latitude = position.coords.latitude;\r\n let longitude = position.coords.longitude;\r\n\r\n //Instatiate new XMLHttpRequest object \r\n const Http = new XMLHttpRequest();\r\n //URL to weatherunlockedapi\r\n //added a proxy of cors-anywhere to allow a cross-orgin request\r\n let url = \"https://cors-anywhere.herokuapp.com/http://api.weatherunlocked.com/api/current/\" + latitude + \",\" + longitude + \"?app_id=0a3bdae3&app_key=24f675edf002ea1e74ef3ec002d31fc5\";\r\n Http.open(\"GET\", url);\r\n //send Http request\r\n Http.send();\r\n //when the request is rechieved work with the responseText\r\n Http.onload = (e) => {\r\n //saving the text form the response as a JSON object\r\n let weatherInfo = JSON.parse(Http.responseText);\r\n weatherPara.textContent = \"Local Temperature: \" + weatherInfo.temp_c + \"\\u00B0C\" + \" Wind Speed: \" + weatherInfo.windspd_kmh + \"km/hr \" + weatherInfo.winddir_compass;\r\n };\r\n } catch (e) {\r\n //calls the error function and passes the exception \r\n\r\n error(e);\r\n }\r\n}", "title": "" }, { "docid": "5cc66ef90814cc7390839bc7c7197171", "score": "0.68721783", "text": "function getWeather(city) {\n\n let queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + city + \"&appid=\" + APIKey;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n\n // gets all the info needed from response & stores in variables\n let cityName = response.name;\n let weatherIcon = response.weather[0].icon; // returns weather icon code\n let wiconURL = `https://openweathermap.org/img/w/${weatherIcon}.png`\n let kTemp = response.main.temp; // returns current temp in Kelvin\n let currentTemp = ((kTemp - 273.15) * 9 / 5 + 32).toFixed(1); // converts Kelvin to Fahrenheit\n let currentHumidity = response.main.humidity;\n let windSpeed = response.wind.speed;\n let latitude = response.coord.lat;\n let longitude = response.coord.lon;\n\n const currentHeadlineEl = $(\"#display-headline\");\n const currentTempEl = $(\"#current-temp\");\n const currentHumidityEl = $(\"#current-humidity\");\n const currentWindspeedEl = $(\"#current-windspeed\");\n\n // WHEN I view current weather conditions for that city\n\n // THEN I am presented with city name, date, weather icon, temperature, humidity, wind speed, and UV index\n currentHeadlineEl.html(`${cityName} (${today})` + \" <img id='wicon' src='\" + wiconURL + \"'>\");\n currentTempEl.html(`Temperature: ${currentTemp} °F`);\n currentHumidityEl.html(`Humidity: ${currentHumidity}%`);\n currentWindspeedEl.html(`Wind Speed: ${windSpeed} MPH`);\n\n // calls fiveDays function and passes lat & long results from this function\n\n fiveDays(latitude, longitude);\n });\n}", "title": "" }, { "docid": "d70770657806719542e20392fa042252", "score": "0.6871746", "text": "function getCurrentWeather() {\n \tvar dataObj = {\n \t\tlat: '',\n \t\tlon: '',\n \t\tAPPID: '923ac7c7344b6f742666617a0e4bd311',\n \t\tunits: 'metric'\n \t}\n }", "title": "" }, { "docid": "a55b7bc72b14763679df0803003b6b87", "score": "0.6871639", "text": "async getWeather(){\n const response = await fetch(`http://api.weatherapi.com/v1/current.json?key=${this.apiKey}&q=${this.location}`);\n\n const reponseData = await response.json();\n\n return reponseData;\n }", "title": "" }, { "docid": "39dbd1899de370986ce9088f8c064802", "score": "0.6867093", "text": "function getCityWeather(myCity) {\n let apiKey = \"ab10edc1d32f1dd18832060f89f088c3\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric&appid=${apiKey}`;\n axios.get(apiUrl).then(displayTemperature);\n}", "title": "" }, { "docid": "515fc4cd6f3a00892e93e388453ebce6", "score": "0.68654275", "text": "function getTheWeather() {\n // uses the city \"state\" variable to fill out the queryURL's\n // makes the call, on data returned...updates state again (a different state), our markup will then be re rendered with our desired output\n\n const weatherURL =\n \"https://api.openweathermap.org/data/2.5/weather?q=\" +\n city +\n \"&appid=f57cc3d88487e632b111d5d350ce8f21&units=imperial\";\n getWeather(weatherURL);\n }", "title": "" }, { "docid": "0e56fe7ee392d5b4427895ef6e3b3443", "score": "0.6864061", "text": "async getWeather() {\n const response = await fetch(`http://api.openweathermap.org/data/2.5/weather?q=${this.city},${this.zipcode}&APPID=9d0317c32366d083e6e35b438595476c&units=imperial`);\n const responseData = await response.json();\n return responseData.current_observation;\n }", "title": "" }, { "docid": "ae6582adedf3bb8e2a232b814a43b63c", "score": "0.686329", "text": "getCurrentWeather(data) {\n const {latitude, longitude} = data\n let qp = '' \n if(latitude){\n qp+=`&lat=${latitude}`\n }\n if(longitude){\n qp+=`&lon=${longitude}`\n }\n return client.get(`/weather?units=metric&appid=${process.env.REACT_APP_WEATHER_API_KEY}${qp}`);\n }", "title": "" }, { "docid": "4529c3775f5d1c5e1eee6619388c9bf3", "score": "0.6863136", "text": "function getLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(function(position){\n x = position.coords.longitude;\n y = position.coords.latitude;\n getWeather(x, y);\n });\n } else {\n alert(\"Geolocation is not supported by this browser\");\n }\n}", "title": "" }, { "docid": "9a270bf630881de56c1e5b67672b5c9c", "score": "0.6855526", "text": "getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(position => {\n this.setState({\n lat: position.coords.latitude.toFixed(3),\n lon: position.coords.longitude.toFixed(3)\n })\n this.getWeather()\n })\n }\n }", "title": "" }, { "docid": "df83889446852486ee6172dce08051e6", "score": "0.68518114", "text": "function getCityWeather(city) {\n return City_search.dispatch(`https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${API_KEY}`)\n}", "title": "" }, { "docid": "cd5c3804c208ec1db9695a870b34d93a", "score": "0.6850023", "text": "async getWeather() {\n const response = await fetch(\n `api.openweathermap.org/data/2.5/weather?q={${this.city}},{${this.state}}&appid={${this.apiKey}}`\n );\n\n const reponseData = await response.json();\n\n return reponseData.weather; //.weather is just to test out\n }", "title": "" }, { "docid": "a4d10c8e75aec3d9d4b773720cb4b809", "score": "0.6846111", "text": "function getLocation(locale) {\n\tconst URL = \"https://api.weather.gov/points/\" + locale; \n\tconsole.log('getLocation() URL: ' + URL);\n\t// NWS User-Agent header (built above) will be the second parameter \n\tfetch(URL, idHeader) \n\t.then(function(response){\n\t if(response.ok){ \n\t return response.json(); \n\t } \n\t throw new ERROR('Response not OK.');\n\t})\n\t.then(function (data) { \n\t // Let's see what we got back\n\t console.log('Json object from getLocation function:'); \n\t console.log(data);\n\t\t// Store data to localstorage \n\t\tconsole.log(\"City: \" + data.properties.relativeLocation.properties.city);\n\t\tconsole.log(\"State: \" + data.properties.relativeLocation.properties.state);\n\t storage.setItem(\"locName\", data.properties.relativeLocation.properties.city); \n\t storage.setItem(\"locState\", data.properties.relativeLocation.properties.state); \n\t\t\n\t // Next, get the weather station ID before requesting current conditions \n\t // URL for station list is in the data object \n\t let stationsURL = data.properties.observationStations; \n\t storage.setItem(\"hourlyURL\", data.properties.forecastHourly);\n\t storage.setItem(\"forecastURL\", data.properties.forecast);\n\t// console.log(\"hourlyURL is: \" + hourlyURL);\n\n\t // Call the function to get the list of weather stations\n\t getStationId(stationsURL); \n\t }) \n\t.catch(error => console.log('There was a getLocation error: ', error)) \n\t } // end getLocation function", "title": "" }, { "docid": "b341674336008161ed5c04d53305d74f", "score": "0.68458873", "text": "function getCurrentWeather(coords) {\n //Using template strings!\n var url = `${CORS_PROXY}${DARKSKY_API_URL}${DARKSKY_API_KEY}/${coords.lat},${coords.lng}?units=si&exclude=minutely,hourly,daily,alerts,flags`;\n\n return ( //fetch promise enclosed in brackets so you can make chain look nice on next line break. Wo brackets, Node REPL will run, but there will be error on browser\n fetch(url)\n .then(response => response.json())\n .then(data => data.currently)\n );\n\n }", "title": "" }, { "docid": "a7751492f929d18528bc333931c704bb", "score": "0.6845592", "text": "function renderCityInfo(lat, lon) {\n\tvar queryURL2 =\n\t\t\"https://api.openweathermap.org/data/2.5/onecall?lat=\" +\n\t\tlat +\n\t\t\"&lon=\" +\n\t\tlon +\n\t\t\"&units=imperial&appid=\" +\n\t\tAPIKey;\n\n\t$.ajax({\n\t\turl: queryURL2,\n\t\tmethod: \"GET\",\n\t}).then(function (response) {\n\t\t// THEN I am presented with the city name, the date, an icon representation of weather conditions, the temperature, the humidity, the wind speed, and the UV index\n\t\t$(\"#temperature\").text(`Temperature: ${response.current.temp} \\xB0F`);\n\t\t$(\"#humidity\").text(`Humidity: ${response.current.humidity}%`);\n\t\t$(\"#wind-speed\").text(`Wind Speed: ${response.current.wind_speed} MPH`);\n\t\t$(\"#uv-index\").text(`UV Index: `);\n\n\t\t// WHEN I view the UV index\n\t\tvar uviSpan = $(\"<span>\");\n\t\tuviSpan.text(`${response.current.uvi}`);\n\t\t// THEN I am presented with a color that indicates whether the conditions are favorable, moderate, or severe\n\t\tvar uvi = response.current.uvi;\n\t\tif (uvi <= 2) {\n\t\t\tuviSpan.addClass(\"badge badge-success\");\n\t\t} else if (uvi <= 5) {\n\t\t\tuviSpan.addClass(\"badge badge-warning\");\n\t\t} else if (uvi <= 7) {\n\t\t\tuviSpan.addClass(\"badge\");\n\t\t\tuviSpan.css(\"background-color\", \"orange\");\n\t\t} else if (uvi <= 9) {\n\t\t\tuviSpan.addClass(\"badge badge-danger\");\n\t\t} else {\n\t\t\tuviSpan.addClass(\"badge\");\n\t\t\tuviSpan.css(\"background-color\", \"purple\");\n\t\t\tuviSpan.css(\"color\", \"white\");\n\t\t}\n\t\t$(\"#uv-index\").append(uviSpan);\n\n\t\t// render 5-Day Forecast\n\t\trenderForecast(response);\n\t});\n}", "title": "" }, { "docid": "885ebc9f737222cdb9eb7c0937afcf43", "score": "0.6845158", "text": "function fetchWeatherData(city = null, lat, long) {\n if (!city) {\n fetch(`${api.base}/current.json?key=${api.key}&q=${lat},${long}`)\n .then(function (response) {\n return response.json();\n })\n .then(function (result) {\n displayWeatherData(result);\n })\n .catch(function (err) {\n return err;\n });\n } else {\n fetch(`${api.base}/current.json?key=${api.key}&q=${city}`)\n .then(function (response) {\n return response.json();\n })\n .then(function (result) {\n displayWeatherData(result);\n })\n .catch(function (err) {\n return err;\n });\n }\n}", "title": "" }, { "docid": "882b0836232f0ff958bd64bc08a4b567", "score": "0.684513", "text": "async getWeather() {\n const response = await fetch(\n `${this.base}weather?q=${this.city}&units=metric&APPID=${this.key}`\n );\n\n const responseData = await response.json();\n\n // Return weather data from API\n return responseData;\n }", "title": "" }, { "docid": "fe03517039f336fca812a546185319d4", "score": "0.6839954", "text": "function getCurrentWeatherAPI() {\n $.get(\"https://api.openweathermap.org/data/2.5/weather?q=\" + cityName + \"&units=\" + tempUnit[1] + \"&APPID=\" + apiKey)\n .then(function(res) {\n // console.log(res)\n lon = res.coord.lon;\n lat = res.coord.lat;\n // console.log(res);\n const icon = \"https://openweathermap.org/img/wn/\" + res.weather[0].icon + \"@2x.png\";\n $(\".current-weather-icon\").attr(\"src\", icon);\n // console.log(icon)\n // lat = lat;\n // lon = lon;\n getUVindexCurrent(lon, lat);\n displayCurrentWeather(res);\n });\n}", "title": "" }, { "docid": "7ad7cf5005874866a28a211eb9dd847e", "score": "0.6837191", "text": "async getWeather() {\n const response = await fetch(\n `http://api.wunderground.com/api/${this.apiKey}/conditions/q/${\n this.state\n }/${this.city}.json`\n );\n\n const responseData = await response.json();\n\n // Return the object (using the name defined in the API)\n return responseData.current_observation;\n }", "title": "" }, { "docid": "2d958f8f10db01cb38bfd065def52050", "score": "0.68329334", "text": "function getLocationByKey(cityKey) {\n const API_KEY = 'MQv9yHvhKRzuqis8pW460KHVjOjmE6El';\n const URL = 'https://dataservice.accuweather.com/locations/v1/'+cityKey+'?apikey='+API_KEY;\n fetch(URL)\n .then(response => response.json())\n .then(function (data) {\n console.log('Json object from getLocationByKey function:');\n console.log(data);\n const locData = {}; // Create an empty object\n locData['key'] = data.Key; // Add the value to the object\n locData['name'] = data.LocalizedName;\n locData['postal'] = data.PrimaryPostalCode;\n locData['state'] = data.AdministrativeArea.LocalizedName;\n locData['stateAbbr'] = data.AdministrativeArea.ID;\n let lat = data.GeoPosition.Latitude;\n let long = data.GeoPosition.Longitude;\n const LOCALE = lat+', '+long;\n locData['geoposition'] = LOCALE;\n locData['elevation'] = data.GeoPosition.Elevation.Imperial.Value;\n getWeather(locData);\n })\n .catch(error => console.log('There was a getLocationByKey error: ', error))\n } // end getLocationByKey function", "title": "" }, { "docid": "8b767d7503abcb1defb071faf9656f60", "score": "0.682957", "text": "async getWeatherByLocation(){\n await navigator.geolocation.getCurrentPosition(this.showDefaultWeather);\n }", "title": "" }, { "docid": "74cc53ee05e1824b150115fef4088853", "score": "0.68268996", "text": "function weatherByCity(city) {\n return fetch(`http://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${ow_api_key}&units=metric`)\n .then(response => response.json())\n .then(weather => `${weather.main.temp} C°`)\n .catch(error => error);\n}", "title": "" }, { "docid": "027bfb176ae0a561a90f0465c2d2a5ee", "score": "0.68239194", "text": "function getLocationByKey(cityKey) {\n const API_KEY = '4Rv2CjA4GQnBDGrZYKmg9WEC8SxyYhmL';\n const URL = 'https://dataservice.accuweather.com/locations/v1/'+cityKey+'?apikey='+API_KEY;\n fetch(URL)\n .then(response => response.json())\n .then(function (data) {\n console.log('Json object from getLocationByKey function:');\n console.log(data);\n const locData = {}; // Create an empty object\n locData['key'] = data.Key; // Add the value to the object\n locData['name'] = data.LocalizedName;\n locData['postal'] = data.PrimaryPostalCode;\n locData['state'] = data.AdministrativeArea.LocalizedName;\n locData['stateAbbr'] = data.AdministrativeArea.ID;\n let lat = data.GeoPosition.Latitude;\n let long = data.GeoPosition.Longitude;\n const LOCALE = lat+', '+long;\n locData['geoposition'] = LOCALE;\n locData['elevation'] = data.GeoPosition.Elevation.Imperial.Value;\n getWeather(locData);\n })\n .catch(error => console.log('There was a getLocationByKey error: ', error))\n } // end getLocationByKey function", "title": "" }, { "docid": "e30f6641ab2d9b745e43b7ef6200028b", "score": "0.682061", "text": "function getLocation(locale) {\n const URL = \"https://api.weather.gov/points/\" + locale; \n // NWS User-Agent header (built above) will be the second parameter \n fetch(URL, idHeader) \n .then(function(response){\n if(response.ok){ \n return response.json(); \n } \n throw new ERROR('Response not OK.');\n })\n .then(function (data) { \n // Let's see what we got back\n console.log('Json object from getLocation function:'); \n console.log(data);\n // Store data to localstorage \n storage.setItem(\"locName\", data.properties.relativeLocation.properties.city); \n storage.setItem(\"locState\", data.properties.relativeLocation.properties.state); \n \n // Next, get the weather station ID before requesting current conditions \n // URL for station list is in the data object \n let stationsURL = data.properties.observationStations; \n // Call the function to get the list of weather stations\n getStationId(stationsURL); \n }) \n .catch(error => console.log('There was a getLocation error: ', error)) \n } // end getLocation function", "title": "" }, { "docid": "1d5ef694a14822ef481dcaf1a19d3600", "score": "0.68182945", "text": "function getWeather(latitude, longitude) {\n if (latitude != '' && longitude != '') {\n $(\"#weather\").html(\"Retrieving Weather...\");\t\t\t\t\t\t\t\t\t\t// write temporary response while we get the weather\n $.getJSON(\"https://api.openweathermap.org/data/2.5/weather?lat=\" + latitude + \"&lon=\" + longitude + \"&units=metric\" + '&appid=1e1dfc63a4f20867543bd3d8fbb81a30', function (data) {\t// add '&units=imperial' to get U.S. measurements\n var currWeather = new Array();\t\t\t\t\t\t\t\t// create array to hold our weather response data\n currWeather['currTemp'] = Math.round(data.main.temp);\t\t\t\t// current temperature\n currWeather['highTemp'] = Math.round(data.main.temp_max);\t\t\t// today's high temp\n currWeather['lowTemp'] = Math.round(data.main.temp_min);\t\t\t// today's low temp\n currWeather['humidity'] = Math.round(data.main.humidity);\t\t\t// humidity (in percent)\n\n currWeather['description'] = data.weather[0].description;\t\t\t\t// short text description (ie. rain, sunny, etc.)\n currWeather['icon'] = \"https://openweathermap.org/img/w/\" + data.weather[0].icon + \".png\";\t// 50x50 pixel png icon\n currWeather['cloudiness'] = data.clouds.all;\t\t\t\t\t\t\t// cloud cover (in percent)\n currWeather['windSpeed'] = Math.round(data.wind.speed);\t\t\t\t// wind speed\n\n currWeather['windDegree'] = data.wind.deg;\t\t\t\t\t\t\t// wind direction (in degrees)\n currWeather['windCompass'] = Math.round((currWeather['windDegree'] - 11.25) / 22.5);\t// wind direction (compass value)\n\n currWeather['city'] = data.name;\n\n\n // array of direction (compass) names\n var windNames = new Array(\"North\", \"North Northeast\", \"Northeast\", \"East Northeast\", \"East\", \"East Southeast\", \"Southeast\", \"South Southeast\", \"South\", \"South Southwest\", \"Southwest\", \"West Southwest\", \"West\", \"West Northwest\", \"Northwest\", \"North Northwest\");\n // array of abbreviated (compass) names\n var windShortNames = new Array(\"N\", \"NNE\", \"NE\", \"ENE\", \"E\", \"ESE\", \"SE\", \"SSE\", \"S\", \"SSW\", \"SW\", \"WSW\", \"W\", \"WNW\", \"NW\", \"NNW\");\n currWeather['windDirection'] = windNames[currWeather['windCompass']];\t// convert degrees and find wind direction name\n\n\n var response = \"<h3 style='color:white;'><img src='\" + currWeather['icon'] + \"'>\" + currWeather['currTemp'] + \" &deg;C</h3><div class=''><ul><li>\" + currWeather['city'] + \"</li><li>\" + currWeather['description'] + \"</li><li>High: \" + currWeather['highTemp'] + \" &deg;C, Low: \" + currWeather['lowTemp'] + \" &deg;C</li></ul></div>\";\n\n //var response = \"Current Weather: \" + currWeather['currTemp'] + \"\\xB0 and \" + currWeather['description'];\n //var spokenResponse = \"It is currently \" + currWeather['currTemp'] + \" degrees and \" + currWeather['description'];\n\n //if (currWeather['windSpeed'] > 0) {\t\t\t\t\t\t\t\t\t\t\t// if there's wind, add a wind description to the response\n // response = response + \" with winds out of the \" + windNames[currWeather['windCompass']] + \" at \" + currWeather['windSpeed'];\n // spokenResponse = spokenResponse + \" with winds out of the \" + windNames[currWeather['windCompass']] + \" at \" + currWeather['windSpeed'];\n // if (currWeather['windSpeed'] == 1) {\n // response += \" mile per hour\";\n // spokenResponse += \" mile per hour\";\n // } else {\n // response += \" miles per hour\";\n // spokenResponse += \" miles per hour\";\n // }\n //}\t\t\t\t\t\t\t\t\t\t// log weather data for reference (json format) \n $(\"#weather\").html(response);\t\t\t\t\t\t\t\t\t// write current weather to textarea\n });\n } else {\n return false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t// respond w/error if no address entered\n }\n }", "title": "" }, { "docid": "e96d3f330a9114a550ad9966bbfc793e", "score": "0.68150574", "text": "function getWeatherInformation(response) {\n let apiCurrentTemp = response.data.main.temp;\n let apifeelsLikeTemp = response.data.main.feels_like;\n let wind = response.data.wind.speed;\n let weatherIconId = response.data.weather[0].icon;\n cityName = response.data.name;\n coordinates[0] = response.data.coord.lon; //longitude\n coordinates[1] = response.data.coord.lat; //latitude\n longitude = response.data.coord.lon;\n latitude = response.data.coord.lat;\n apiUrl2 = `https://api.openweathermap.org/data/2.5/onecall?lat=${latitude}&lon=${longitude}&units=${units}&appid=${apiKey}`;\n axios.get(apiUrl2).then(getDailyWeatherInfo);\n console.log(response);\n\n //update h1 Location and country\n document.querySelector(\n \"#current-location\"\n ).innerText = `${response.data.name}, ${response.data.sys.country}`;\n\n //update description\n document.querySelector(\n \"#weather-description\"\n ).innerText = `${response.data.weather[0].description}`;\n\n //update main weather icon\n document\n .querySelector(\"#main-weather-icon\")\n .setAttribute(\"src\", `images/${weatherIconId}.svg`);\n\n //update visibility details\n document.querySelector(\"#visibility\").innerText = `Visibility: ${Math.round(\n response.data.visibility\n )}`;\n\n //update pressure details\n document.querySelector(\"#pressure\").innerText = `Pressure: ${Math.round(\n response.data.main.pressure\n )}hpa`;\n\n //update humidity details\n document.querySelector(\"#humidity\").innerText = `Humidity: ${Math.round(\n response.data.main.humidity\n )}%`;\n\n if (units === \"metric\") {\n document.querySelector(\"#currentTempInfo\").innerText = `${Math.round(\n apiCurrentTemp\n )}°C`;\n\n document.querySelector(\n \"#feelsLikeTemp\"\n ).innerText = `Feels like: ${Math.round(apifeelsLikeTemp)}°C`;\n\n document.querySelector(\"#wind-info\").innerText = `Wind: ${Math.round(\n wind\n )} m/s`; //meters per sec\n } else {\n document.querySelector(\"#currentTempInfo\").innerText = `${Math.round(\n apiCurrentTemp\n )}°F`;\n document.querySelector(\n \"#feelsLikeTemp\"\n ).innerText = `Feels like: ${Math.round(apifeelsLikeTemp)}°F`;\n\n document.querySelector(\"#wind-info\").innerText = `Wind: ${Math.round(\n wind\n )} m/h`; //miles per hour\n }\n\n //get sunset/surise data\n let unix_timestamp_sunrise = response.data.sys.sunrise;\n let unix_timestamp_sunset = response.data.sys.sunset;\n let sunriseTime = new Date(unix_timestamp_sunrise * 1000).toLocaleTimeString(\n [],\n {\n hour: \"2-digit\",\n minute: \"2-digit\",\n hour12: false,\n }\n );\n let sunsetTime = new Date(unix_timestamp_sunset * 1000).toLocaleTimeString(\n [],\n {\n hour: \"2-digit\",\n minute: \"2-digit\",\n hour12: false,\n }\n );\n\n document.querySelector(\"#sunrise\").innerText = sunriseTime;\n document.querySelector(\"#sunset\").innerText = sunsetTime;\n\n return coordinates;\n}", "title": "" }, { "docid": "3b53ecd04b25a46ca3b7a1e10b010ec0", "score": "0.68107736", "text": "function getLocation(locale) {\n const URL = \"https://api.weather.gov/points/\" + locale; \n // NWS User-Agent header (built above) will be the second parameter \n fetch(URL, idHeader) \n .then(function(response){\n if(response.ok){ \n return response.json(); \n } \n throw new ERROR('Response not OK.');\n })\n .then(function (data) { \n // Let's see what we got back\n console.log('Json object from getLocation function:'); \n console.log(data);\n // Store data to localstorage \n storage.setItem(\"locName\", data.properties.relativeLocation.properties.city); \n storage.setItem(\"locState\", data.properties.relativeLocation.properties.state); \n \n // Next, get the weather station ID before requesting current conditions \n // URL for station list is in the data object \n let stationsURL = data.properties.observationStations;\n getHourly(data.properties.forecastHourly);\n getForecast(data.properties.forecast);\n // Call the function to get the list of weather stations\n getStationId(stationsURL); \n }) \n .catch(error => console.log('There was a getLocation error: ', error)) \n } // end getLocation function", "title": "" }, { "docid": "433151ff8a3e3106b9183c97fe793fd5", "score": "0.6809831", "text": "function weatherByLatitudeAndLongitude(lon, lat) {\n return fetch(`http://api.openweathermap.org/data/2.5/forecast?lat=${lat}&lon=${lon}&appid=${ow_api_key}&units=metric`)\n .then(response => response.json())\n .then(response => {\n const weatherObject = {\n city: response.city.name,\n weathers : response.list\n };\n return weatherObject;\n })\n .then(result => {\n result.weathers = result.weathers.map(getDay);\n return result;\n })\n .then(result => {\n result.weathers.map(weather => {\n weather.weathers = weather.weathers.map(getWeather);\n return weather.weathers;\n });\n return result;\n })\n .catch(error => error);\n}", "title": "" }, { "docid": "13656e7bbceabbfed4d5920ebecc1db3", "score": "0.68088603", "text": "function getWeather(cityName) {\n console.log(cityName);\n var currentUrl = 'http://api.openweathermap.org/data/2.5/weather?q=' + cityName + '&appid=' + API_key;\n $.ajax({\n url: currentUrl,\n type: \"GET\",\n success: function (result) {\n console.log(result);\n console.log(result.coord);\n document.getElementById(\"name\").innerHTML = result.name;\n document.getElementById(\"temp\").innerHTML = result.main.temp;\n document.getElementById(\"humidity\").innerHTML = result.main.humidity;\n document.getElementById(\"speed\").innerHTML = result.wind.speed;\n document.getElementById(\"weatherIcon\").src = 'http://openweathermap.org/img/wn/' + result.weather[0].icon + '@2x.png';\n var lat = result.coord.lat;\n var lon = result.coord.lon;\n console.log(\"lat and lon\", lat, lon);\n\n var currentUrl = 'http://api.openweathermap.org/data/2.5/uvi?lat=' + lat +'&lon=' + lon + '&appid=' + API_key;\n $.ajax({\n url: currentUrl,\n type: \"GET\",\n success: function (result) {\n console.log(\"result: \", result);\n console.log(result.value);\n document.getElementById(\"uv\").innerHTML = result.value;\n \n \n }\n \n \n \n \n })\n \n //getUVIndex(result.data.coord.lat, long); yada\n\n }\n\n })\n\n\n\n //localStorage.setItem(JSON.stringify(cityName)) THIS BORKS THE WHOLE THING AS-IS\n}", "title": "" }, { "docid": "66b86fa70483950d1a864de748b27af4", "score": "0.6807621", "text": "function weatherSearch (cityname) {\n var queryURL = \"https://api.openweathermap.org/data/2.5/weather?q=\" + cityname + \"&appid=\" + myAPI;\n \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n var tempF = (response.main.temp - 273.15) * 1.80 + 32;\n var windMph = (response.wind.speed * 2.23694);\n $(\".city\").empty().append(response.name);\n $(\".icon\").empty().attr(\"src\", \"https://openweathermap.org/img/wn/\" + response.weather[0].icon + \"@2x.png\");\n $(\".temp\").empty().append(\"Temperature: \" + tempF.toFixed() + \" °F\");\n $(\".humidity\").empty().append(\"Humidity: \" + response.main.humidity + \"%\");\n $(\".wind\").empty().append(\"Wind Speed: \" + windMph.toFixed(1) + \" mph\");\n \n var lat = response.coord.lat;\n var lon = response.coord.lon;\n\n uvAndTime(lat, lon);\n });\n}", "title": "" }, { "docid": "5041c50f95a5b21a68d725a36804dd55", "score": "0.6806148", "text": "function getCurrentLocation(latitude, longitude) {\n fetch(\"http://api.openweathermap.org/data/2.5/weather?lat=\" + latitude + \"&lon=\" + longitude + \"&APPID=\" + OWM_API_KEY).then(function (resp) {\n return resp.json()\n }) // Convert data to json\n .then(function (data) {\n cityname = data.name;\n document.getElementById(\"locationCity\").innerHTML = cityname;\n }).catch(function () {\n // catch any errors\n });\n}", "title": "" } ]
b7d3fcad3fb8c3b18e491a2a4c035846
plot the bar charts to visualize the amplitude of b_n
[ { "docid": "18c805cb02292dd6ff4c63c78a6a0aaf", "score": "0.68743384", "text": "function plot_bn(){\n var N = parseFloat(document.getElementById('NController').value);\n\n [n, an, bn, alpha_n, theta_n] = coefficient(N);\n\n var data =\n [{\n type:\"bar\",\n x: n,\n y: bn,\n marker: {\n color:'rgb(60,120,180)',\n opacity: 0.7\n },\n\n },\n ];\n return data;\n}", "title": "" } ]
[ { "docid": "1a8755756655c634f67b821777d7aab8", "score": "0.66059333", "text": "plotBarChart(data) {\n this.graph.xAxis('Story')\n .yAxis('Memory used (MiB)')\n .title('Labels')\n .setData(data, story => app.$emit('bar_clicked', story))\n .plotBar();\n }", "title": "" }, { "docid": "d3a0afdc10cc91c1c03c55c828ed8642", "score": "0.6502633", "text": "function barchartwn(pndataset){\nd3.select(\"#nbar\").select(\"svg\").remove();\nif (pndataset==\"hardcode_bardata_oneweek\"){\n var bardata=hardcode_bardata_oneweek\n}else if (pndataset==\"hardcode_bardata_onemonth\"){\n var bardata=hardcode_bardata_onemonth\n}else{\n var bardata=hardcode_bardata_oneyear\n}\nvar bardata=pndataset;\n\nif (bgwidth<768){\nvar margin = {top: 20, right: 10, bottom: 30, left: 10},\n width = 280 - margin.left - margin.right,\n height = 280 - margin.top - margin.bottom;\n }else if (bgwidth>1200){\n var margin = {top: 30, right: 20, bottom: 10, left: 50},\n width = 300 - margin.left - margin.right, //400,400\n height = 230 - margin.top - margin.bottom;\n }else{\n var margin = {top: 30, right: 10, bottom: 10, left: 50},\n width = 280 - margin.left - margin.right, //300,400\n height = 230 - margin.top - margin.bottom;\n }\n\nvar x = d3.scale.linear()\n .range([0, width]);\n\nvar y = d3.scale.ordinal()\n .rangeRoundBands([0, height], .2);\n\nvar xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"top\");\n\nvar svg = d3.select(\"#nbar\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n //.style(\"border\",\"1px solid green\")\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n x.domain(d3.extent(bardata, function(d) { return d.pnvalue; })).nice();\n y.domain(bardata.map(function(d) { return d.name; }));\n\n\nvar color = d3.scale.ordinal() //d3.scale.category10()\n //.range([\"#1f77b4\", \"#ff7f0e\", \"#2ca02c\", \"#d62728\", \"#9467bd\", \"#8c564b\",]);\n //.range([\"#996bc3\", \"#386ac5\", \"#5dc74c\", \"#e9c71f\", \"#ea762f\", \"#f495a3\"]);\n .range([\"#6fce1d\", \"#ae018d\", \"#5254a3\", \"#d62728\", \"#f1a61f\", \"#12b895\"]);\n\nsvg.selectAll(\".bar\")\n .data(bardata)\n .enter().append(\"rect\")\n .attr(\"class\", function(d) { return d.pnvalue < 0 ? \"bar negative\" : \"bar positive\"; })\n //.attr(\"x\", function(d) { return x(Math.min(0, d.pnvalue)); })\n .attr(\"x\",0)\n .attr(\"y\", function(d) { return y(d.name); })\n //.attr(\"width\", function(d) { return Math.abs(x(d.pnvalue) - x(0)); })\n .attr(\"width\",0)\n .attr(\"height\", y.rangeBand())\n .style(\"fill\",function(d,i){return color(i)})\n\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n //.style(\"fill\",\"white\") \n .call(xAxis);\n\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n //.style(\"fill\",\"white\") \n .append(\"line\")\n //.style(\"fill\",\"white\") \n .attr(\"x1\", x(0))\n .attr(\"x2\", x(0))\n .attr(\"y2\", height);\n\n svg.selectAll(\".bar\")\n .data(bardata)\n .transition()\n .delay(function(d, i) { return i * 100; })\n .duration(1000)\n .attr(\"x\", function(d) { return x(Math.min(0, d.pnvalue)); })\n .attr(\"width\", function(d) { return Math.abs(x(d.pnvalue) - x(0)); })\n\nfunction type(d) {\n d.pnvalue = +d.pnvalue;\n return d;\n}\n}", "title": "" }, { "docid": "6df3f3da53329508252b4823033029e7", "score": "0.64276385", "text": "function expRespAnalysisBar(){\n\n var margin = {top:20,bottom:100,left:60,right:0};\n var w = 8000 - margin.left - margin.right;\n var h = 600 - margin.top - margin.bottom;\n\n var yScale = d3.scale.linear()\n .domain([0,d3.max(exrespana,function(d){ return d.value;})])\n .range([0,h]);\n\n var svg = d3.select(\"#responder-chart-1\").append(\"svg\").style(\"background\",\"#FFF\")\n .attr(\"width\",w + margin.left + margin.right)\n .attr(\"height\",h + margin.top + margin.bottom)\n\n d3.select(\"#responder-chart-1 svg\").append(\"g\").attr(\"id\",\"graph-bar-exp-resp-ana\").attr(\"transform\",\"translate(\"+(margin.left)+\",\"+(margin.top)+\")\")\n .selectAll(\"rect\").data(exrespana).enter().append(\"rect\").attr({\n x:function(d,i){ return i*(w/exrespana.length)},\n width: function(d,i){ return w/exrespana.length-2 },\n y:function(d,i){return h-yScale(d.value); },\n height:function(d,i){ return yScale(d.value);}\n }).style(\"fill\",\"#4E8AD9\")\n .on(\"mouseover\",function(d){\n d3.select(this).style(\"opacity\",\".8\");\n tooltip.style(\"opacity\",\"1\")\n tooltip.html(d.value)\n .style(\"left\",(d3.event.pageX)+\"px\")\n .style(\"top\",(d3.event.pageY)-15+\"px\")\n })\n .on(\"mouseout\",function(d){\n d3.select(this).style(\"opacity\",\"1\");\n tooltip.style(\"opacity\",\"0\")\n });\n\n var yScaleAxis = d3.scale.linear()\n .domain([0,d3.max(exrespana,function(d){ return d.value;})])\n .range([h,0]);\n\n var yAxis = d3.svg.axis().scale(yScaleAxis).orient(\"left\");\n var yAxisGen = d3.select(\"#responder-chart-1\").select(\"svg\").append(\"g\").attr(\"class\",\"y-axis\");\n yAxis(yAxisGen);\n\n yAxisGen.attr(\"transform\",\"translate(\"+margin.left+\",\"+margin.top+\")\");\n yAxisGen.selectAll(\"path\").style({fill:\"none\",stroke:\"#000\"});\n yAxisGen.selectAll(\"line\").style({stroke:\"#000\"});\n\n d3.select(\"#responder-chart-1\").select(\"svg\").append(\"g\").attr(\"transform\",\"translate(\"+(margin.left+20)+\",\"+(h)+\")\").selectAll(\"text\").data($scope.method.allgene).enter().append(\"text\").attr(\"id\",\"expinfotextana\").text(function(d){ return d;}).attr({\n \"fill\":\"green\",\n x:-100,\n y:function(d,i){\n return i*(w/$scope.method.allgene.length);\n },\n\n })\n\n var lineFun = d3.svg.line()\n .x(function(d,i){ return i*(w/exrespana.length)+((w/exrespana.length)/2)})\n .y(function(d){ return h-yScale(d.value);})\n .interpolate(\"linear\"); \n\n var viz = d3.select(\"#responder-chart-1\").select(\"svg\").append(\"path\").attr(\"id\",\"graph-line-exp-resp-ana\").attr(\"transform\",\"translate(\"+(margin.left)+\",\"+(margin.top)+\")\")\n .attr({\n d:lineFun(exrespana), \n \"stroke\":\"purple\",\n \"stroke-width\":2,\n \"fill\":\"none\",\n });\n\n }", "title": "" }, { "docid": "42215c0bf871c0343994cd4f37168b42", "score": "0.6377564", "text": "function barChartPlotter(e) {\n var ctx = e.drawingContext;\n var points = e.points;\n var y_bottom = e.dygraph.toDomYCoord(0);\n\n ctx.fillStyle = darkenColor(e.color);\n\n // Find the minimum separation between x-values.\n // This determines the bar width.\n var min_sep = Infinity;\n for (var i = 1; i < points.length; i++) {\n var sep = points[i].canvasx - points[i - 1].canvasx;\n if (sep < min_sep) min_sep = sep;\n }\n var bar_width = Math.floor(2.0 / 3 * min_sep);\n\n // Do the actual plotting.\n for (var i = 0; i < points.length; i++) {\n var p = points[i];\n var center_x = p.canvasx;\n\n ctx.fillRect(center_x - bar_width / 2, p.canvasy,\n bar_width, y_bottom - p.canvasy);\n\n ctx.strokeRect(center_x - bar_width / 2, p.canvasy,\n bar_width, y_bottom - p.canvasy);\n }\n}", "title": "" }, { "docid": "8033a50abdbb2f630027b3de9f4af8f8", "score": "0.6349272", "text": "function plot_an(){\n var N = parseFloat(document.getElementById('NController').value);\n\n [n, an, bn, alpha_n, theta_n] = coefficient(N);\n\n var data =\n [{\n type:\"bar\",\n x: n,\n y: an,\n name: 'Secondary Product',\n marker: {\n color: 'rgb(180,120,60)',\n opacity: 0.7\n }\n },\n ];\n return data;\n}", "title": "" }, { "docid": "00d9b7befa35d3917984adef11604a53", "score": "0.63275844", "text": "function runBarVisualization() {\n\n var fillColor;\n\n if(visual.options.color != \"\" && visual.options.color != null) {\n fillColor = visual.options.color;\n } else {\n fillColor = \"#00D1B2\";\n }\n\n // requestAnimationFrame will make sure loop doesn't run too fast\n requestAnimationFrame(runBarVisualization);\n\n analyser.getByteFrequencyData(soundData);\n\n svg.selectAll('rect')\n .data(soundData)\n // update height of bars\n .attr('y', function(d) {\n return 495 - d;\n })\n .attr('height', function(d) {\n return d;\n })\n // fill with color (if only a static color is used this can\n // be moved to loadBarVisualization method for better performance)\n .attr('fill', fillColor);\n}", "title": "" }, { "docid": "95f7e8530d72057de2f4dc3eee181fa0", "score": "0.6290171", "text": "drawBarrel() {\n stroke(this.border);\n fill(this.secondary);\n rect(0, -this.width * ts / 2, this.length * ts, this.width * ts);\n }", "title": "" }, { "docid": "a972df51afead385b8734651b30bd974", "score": "0.62532055", "text": "function barplot(data){\n parameters = basicParameters();\n var xValue = d => d.values;\n var yValue = d => d.key;\n\n var xScale = d3.scale.linear()\n .domain([0, d3.max(data, xValue)])\n .range([0, parameters.width]);\n\n var yScale = d3.scale.ordinal()\n .domain(data.map(yValue))\n .rangeRoundBands([parameters.height, 0], .25);\n\n var xAxis = d3.svg.axis()\n .scale(xScale)\n .orient(\"bottom\");\n\n var yAxis = d3.svg.axis()\n .scale(yScale)\n .orient(\"left\");\n\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-5, 0])\n .html(function(d) {\n return \"<strong>\" + yValue(d) + \":</strong> <span style='color:\" + color + \"'>\" + xValue(d) + \"</span>\";\n })\n\n var g = svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + parameters.left + \",\" + parameters.top + \")\");\n\n g.call(tip);\n\n g.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + parameters.height + \")\")\n .call(xAxis.ticks(5, \"s\"))\n .append(\"text\")\n .attr(\"class\", \"label\")\n .style(\"font-size\", 20)\n .attr(\"transform\", \"translate(\" + parameters.width / 2 + \",\" + parameters.bottom / 1.5 + \")\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Frequência\");\n\n var axisy = g.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n\n var n = data.length;\n\n g.append(\"g\")\n .selectAll(\"rect\")\n .data(data)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"width\", d => xScale(xValue(d)))\n .attr(\"y\", d => yScale(yValue(d)))\n .attr(\"height\", parameters.height/n - 25)\n .style(\"fill\", color)\n .style(\"opacity\", opacity)\n .on(\"mouseover\", function(d){\n tip.show(d);\n d3.select(this)\n .style(\"opacity\", 1);\n })\n .on(\"mouseout\", function(d){\n tip.hide(d);\n d3.select(this)\n .style(\"opacity\", opacity);\n });\n\n // Define responsive behavior\n function resize() {\n var parameters = basicParameters();\n\n // Update the range of the scale with new width/height\n xScale.range([0, parameters.width]);\n yScale.rangeRoundBands([parameters.height, 0], .25);\n\n // Update the axis and text with the new scale\n svg.select(\".x.axis\")\n .call(xAxis)\n .attr(\"transform\", \"translate(0,\" + parameters.height + \")\")\n .call(xAxis.ticks(10, \"s\"))\n .select(\".label\")\n .attr(\"transform\", \"translate(\" + parameters.width / 2 + \",\" + parameters.bottom / 1.5 + \")\");\n\n svg.select(\".y.axis\")\n .call(yAxis);\n\n // Update the tick marks\n xAxis.ticks(Math.max(parameters.width/75, 2), \" $\");\n\n // Force D3 to recalculate and update the line\n svg.selectAll(\".bar\")\n .attr(\"width\", d => xScale(xValue(d)))\n .attr(\"y\", d => yScale(yValue(d)))\n .attr(\"height\", yScale.rangeBand());\n };\n\n d3.select(window).on('resize', resize);\n\n // Call the resize function\n resize();\n }", "title": "" }, { "docid": "da8da411fb272d89cbf8d18650acc5ea", "score": "0.62417674", "text": "function drawBars() {\n var multiplier = 2,\n bar_width = 20,\n barCount,\n magnitude;\n\n drawBackground();\n ctx.fillStyle = color;\n\n analyser.getByteFrequencyData(freqByteData); // this what updates the area with new info\n barCount = Math.round(canvas.width / bar_width);\n\n for (i = 0; i < barCount; i += 1) {\n magnitude = freqByteData[i];\n // magnitude = Math.round(Math.random()*50+1);\n // some values need adjusting to fit on the canvas\n // fillRect(x, y, width, height)\n\n // drawing origin: middle\n // ctx.fillRect(bar_width * i, height/2, bar_width - 1, -magnitude * multiplier);\n\n // drawing origin: middle\n // bars expand out from middle\n ctx.fillRect(bar_width * i, (canvas.height/2+ Math.round(magnitude/2)), bar_width - 1, -magnitude * multiplier);\n\n // drawing origin: bottom\n // ctx.fillRect(bar_width * i, height, bar_width - 1, -magnitude * multiplier);\n }\n }", "title": "" }, { "docid": "9d084e417333a81a8b23b9e1d6a03634", "score": "0.6235388", "text": "function loadBarVisualization() {\n\n // update svg\n svg = d3.select('#svg-container')\n // add svg element to DOM\n .append('svg')\n // match height and width to parent dimensions\n .attr('height', 495)\n .attr('width', 660);\n\n // select virtual rects\n svg.selectAll('rect')\n // add soundData\n .data(soundData)\n // data join\n .enter()\n // add rect\n .append('rect')\n // for every data point set x value\n .attr('x', function (d, i) {\n return i * (660 / soundData.length);\n })\n // set width of bars\n .attr('width', 660 / soundData.length - 1);\n\n svgText = svg.selectAll(\"text\")\n .data(soundData)\n .enter();\n\n\n setSvgText();\n\n // start barchart visualization loop\n runBarVisualization();\n}", "title": "" }, { "docid": "2b88e981e1408968173c155b44a5b57f", "score": "0.6234727", "text": "function graphPlot() { //variabe domain?\n plot.setAttribute('style','visibility: visible');\n // var clickArray = [];\n // for (var i = 0; i < imgObjs.length; i++) {\n // var datum = (imgObjs[i].timesClicked);\n // clickArray.push(datum);\n // }\n var percentages = [];\n for (var i = 0; i < imgObjs.length; i++) {\n var datum = 100 * (imgObjs[i].timesClicked / imgObjs[i].timesShown);\n percentages.push(datum);\n }\n var snakeHats = [];\n for (var i = 0; i < imgObjs.length; i++) {\n snakeHats.push(imgObjs[i].productName);\n }\n var resultChart = new Chart(plot, {\n type: 'bar',\n data: {\n labels: snakeHats,\n datasets: [{\n label: '% of times clicked when shown',\n data: percentages,\n }]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: { beginAtZero:true }\n }]\n }\n }\n });\n}", "title": "" }, { "docid": "ee614476de45cba426bcf7e016f17cc7", "score": "0.62134796", "text": "function bar_chart(element, property) {\n $(\"#\" + element).html(\"\");\n // espace pour lebarchart\n var svg = d3.select(\"#\" + element).append(\"svg\").attr(\"width\", 300).attr(\"height\", 300);\n // emplacement du barchart par rapport au côté de la zone\n var width = +svg.attr(\"width\") - margin.left - margin.right;\n var height = +svg.attr(\"height\") - margin.top - margin.bottom;\n var g = svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var nested_data = d3.nest()\n .key(function (d) {\n return d[property];\n })\n .rollup(function (d) {\n return {\n size: d.length, total_time: d3.sum(d, function (d) {\n return d.time;\n })\n };\n })\n .entries(data);\n\n nested_data = nested_data.sort(function (a, b) {\n return d3.ascending(a.key, b.key)\n });\n\n\n console.log(\"BARCHART DATA\");\n console.log(nested_data);\n\n if (property ===\"time\"){\n var x = d3.scaleLinear()\n .rangeRound([0, width]);}\n\n else{\n x = d3.scaleBand()\n .rangeRound([0, width])\n .paddingInner(0.1);\n }\n\n var y = d3.scaleLinear()\n .rangeRound([height, 0]);\n\n// couleur du barchart\n var z = d3.scaleOrdinal(['#7C1354','#B2190E','#FF9F1C','#7CAD2E','#21DADD']);\n\n if (property === \"time\") {\n x.domain([0, d3.max(nested_data.map(function (d) {\n return +d.key;\n })) + 1]);\n } else {\n x.domain(nested_data.map(function (d) {\n return d.key;\n }));\n\n }\n\n y.domain([0, d3.max(nested_data, function (d) {\n return d.value.size;\n })]);\n z.domain(nested_data.map(function (d) {\n return d.key;\n }));\n\n g.selectAll(\".bar\")\n .data(nested_data)\n .enter()\n .append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function (d) {\n return x(d.key)\n })\n .attr(\"y\", function (d) {\n return y(d.value.size)\n })\n .attr(\"height\", function (d) {\n return height - y(d.value.size);\n })\n .attr(\"width\", function (d) {\n if (property ===\"time\"){\n return(10);\n }\n else{\n return x.bandwidth();\n }\n return (1000);\n })\n .style(\"fill\", function (d) {\n return z(d.key)\n\n })\n .on(\"mouseover\", function(d){\n d3.select(this)\n .transition().duration(100)\n .attr(\"fill\", \"black\")\n .attr(\"y\", y(d.value.size) - 100)\n })\n .on(\"mouseout\", function(d){\n d3.select(this)\n .transition().duration(100)\n .attr(\"fill\", \"black\")\n .attr(\"y\", y(d.value.size))\n })\n\n\n g.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x));\n\n g.append(\"g\")\n .attr(\"class\", \"axis\")\n .call(d3.axisLeft(y).ticks(null, \"s\"))\n}", "title": "" }, { "docid": "8c39e73b3be88aaadb3849e4a7e9fb1e", "score": "0.6192547", "text": "function barchart(values, country){\n\n // specify margin of bar svg\n var margin = {\n top: 30,\n right: 30,\n bottom: 40,\n left: 80\n }\n var height = 300 - margin.top - margin.bottom;\n var width = 300 - margin.right - margin.left;\n\n // specify duration and delay of the animation\n var durationAnimation = 700\n var delayAnimation = 30\n\n // create interaction with some styles\n var tooltip = d3.select(\"body\").append(\"div\")\n .style('position','absolute')\n .style('background','#f4f4f4')\n .style('padding','5 15px')\n .style('border','1px #333 solid')\n .style('border-radius','5px')\n .style('opacity','0')\n\n // specify scales\n var yScale = d3.scaleLinear()\n .domain([0, d3.max(values)])\n .range([0, height]);\n\n var xScale = d3.scaleBand()\n .domain(d3.range(0, values.length))\n .range([0, width])\n\n // create dynamic colorspectrum\n var colors = d3.scaleLinear()\n .domain([0,values.length])\n .range([\"rgb(158,202,225)\",\"rgb(33,113,181)\",\"rgb(3,19,43)\"]);\n\n // create new chart svg\n var myChart = d3.select('#chart').append('svg')\n .attr('width', width + margin.right + margin.left)\n .attr('height', height + margin.top + margin.bottom)\n .append('g')\n .attr(\"id\",\"#chart\")\n .attr('transform', 'translate('+margin.left+','+margin.top+')')\n .style('background', '#f4f4f4')\n\n // make bars\n .selectAll('rect')\n .data(values)\n .enter().append('rect')\n .style('fill', function(d, i){\n return colors(i);\n })\n\n // specify ranges of bars\n .attr('width', xScale.bandwidth())\n .attr('height', 0)\n .attr('x', function(d, i){\n return xScale(i);\n })\n .attr('y', height)\n\n // create interaction over bar svg\n .on('mouseover', function(d){\n tooltip.transition()\n .style('opacity', 1)\n tooltip.html(d)\n .text(\"Population:\" + d)\n .style('left', (d3.event.pageX)+'px')\n .style('top', (d3.event.pageY+'px'))\n d3.select(this).style('opacity', 0.5)\n })\n .on('mouseout', function(d){\n tooltip.transition()\n .style('opacity', 0)\n d3.select(this).style('opacity', 1)\n })\n\n // create animation\n myChart.transition()\n .attr('height', function(d){\n return yScale(d);\n })\n .attr('y', function(d){\n return height - yScale(d)\n })\n .duration(durationAnimation)\n .delay(function(d, i){\n return i * delayAnimation\n })\n .ease(d3.easeElastic)\n\n // adjust scales of axes\n var vScale = d3.scaleLinear()\n .domain([0, d3.max(values)])\n .range([height, 0]);\n\n var hScale = d3.scaleBand()\n .domain(d3.range(1960, 2020))\n .range([0, width])\n\n var vAxis = d3.axisLeft()\n .scale(vScale)\n .ticks(5)\n .tickPadding(5)\n\n // apply styles to axes\n var vGuide = d3.select(\"#chart\").select('svg')\n .append('g')\n vAxis(vGuide)\n vGuide.attr('transform', 'translate('+margin.left+','+margin.top+')')\n vGuide.selectAll('path')\n .style('fill', 'none')\n .style('stroke', '#000')\n vGuide.selectAll('line')\n .style('stroke', '#000')\n\n // select text elements for xaxis\n d3.select(\"#chart\").selectAll(\".xaxis text\")\n .attr(\"transform\", function(d) {\n return \"translate(\" + this.getBBox().height*-2 + \",\" + this.getBBox().height + \")rotate(-45)\";\n })\n\n // add titles to axes\n d3.select(\"#chart\").select('svg')\n .append(\"text\")\n .attr(\"text-anchor\", \"centre\")\n .attr('x', 1)\n .attr(\"transform\", \"translate(\" + (60/2) + \",\"+(height/6.5) + \")rotate(-90)\")\n .style('font-size', '15px')\n .text(\"Value\");\n\n d3.select(\"#chart\").select('svg')\n .append(\"text\")\n .attr('x', 150)\n .attr('y', 300)\n .style('font-size', '15px')\n .text(\"Year\");\n\n d3.select(\"#chart\").select('svg')\n .append(\"text\")\n .attr('x', 100)\n .attr('y', 20)\n .style('font-size', '20px')\n .text(country);\n\n // specify values shown on xaxis\n var hAxis = d3.axisBottom()\n .scale(hScale)\n .tickValues(hScale.domain().filter(function(d, i){\n return !(i % 10);\n }));\n\n var hGuide = d3.select(\"#chart\").select('svg')\n .append('g')\n hAxis(hGuide)\n hGuide.attr('transform', 'translate('+margin.left+','+(height + margin.top)+')')\n hGuide.selectAll('path')\n .style('fill', 'none')\n .style('stroke', '#000')\n hGuide.selectAll('line')\n .style('stroke', '#000')\n }", "title": "" }, { "docid": "8cf5f4bd9fa1d240fa8ea94e76625ff6", "score": "0.6189424", "text": "function BarChart() {\n\t\t_parent.apply(this, arguments);\n\t\tthis.setSwitchAxes(true);\n\t}", "title": "" }, { "docid": "2b67fa5307e66fb0c2cf9ebcac55acc9", "score": "0.61774194", "text": "function chartBar(ele) {\n if ($(ele).length) {\n $.plot($('#bar-chart1'), [{\n label: 'Page Views',\n data: [\n [0, 7],\n [1, 13],\n [2, 17],\n [3, 20],\n [4, 26],\n [5, 37],\n [6, 35],\n [7, 28],\n [8, 38],\n [9, 38],\n [10, 32],\n [11, 25]\n ]\n }, {\n label: 'Unique Visitor',\n data: [\n [0, 15],\n [1, 10],\n [2, 15],\n [3, 25],\n [4, 30],\n [5, 29],\n [6, 25],\n [7, 33],\n [8, 45],\n [9, 43],\n [10, 38],\n [11, 36]\n ]\n }], {\n series: {\n bars: {\n order: 2,\n align: 'center',\n show: !0,\n barWidth: .3,\n lineWidth: .7,\n fill: !0,\n fillColor: {\n colors: [{\n opacity: 1\n }, {\n opacity: 1\n }]\n }\n },\n shadowSize: 2\n },\n legend: {\n show: !1\n },\n grid: {\n margin: 0,\n show: !1,\n labelMargin: 10,\n axisMargin: 500,\n hoverable: !0,\n clickable: !0,\n tickColor: 'rgba(0,0,0,0.15)',\n borderWidth: 0\n },\n tooltip: {\n show: !0,\n cssClass: 'tooltip-chart',\n content: '<div class=\\'content-chart\\'> <span> %s </span> <div class=\\'label\\'> <div class=\\'label-x\\'> %x.0 </div> - <div class=\\'label-y\\'> %y.0 </div> </div></div>',\n defaultTheme: !1\n },\n colors: ['#4386f4', '#acc9fa'],\n xaxis: {\n ticks: 11,\n tickDecimals: 0\n },\n yaxis: {\n ticks: 4,\n tickDecimals: 0\n }\n })\n\n $(ele).bind('plothover', function(event, pos, item) {\n var width = $('.tooltip-chart').width();\n if (item) {\n $('.tooltip-chart').css({\n top: item.pageY - 60,\n left: item.pageX - (width / 2),\n }).fadeIn(200);\n } else {\n $('.tooltip-chart').hide()\n }\n });\n }\n}", "title": "" }, { "docid": "56065168d20c47b522ba5a074811c085", "score": "0.61594176", "text": "function drawBarChart() {\n\t// more stuff will go here\n\tbarGrow();\n}", "title": "" }, { "docid": "e3c4befa8c74ed99d35819767f38b10c", "score": "0.61396235", "text": "function Frame_Barchart(bar_data, width, height) {\n\n div2 = d3.select(\"body\")\n .append(\"div\")\n .attr(\"id\", \"barchart\")\n\n var formatValue = d3.format(\".2s\");\n \n \n svg2 = div2.append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", (height) + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\")\n .attr(\"class\", \"barchart_y\")\n \n\n svg2.append(\"text\")\n .attr(\"id\", \"barchart-title\")\n .attr(\"x\", (width / 2))\n .attr(\"y\", 0 - (margin.top / 2))\n .attr(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"15px\")\n .style(\"text-decoration\", \"underline\")\n .text(\"Comperison of deaths in region in year: \");\n\n var countryNames = bar_data[\"2015\"]\n .map(function(d) { return d.country_Name; });\n var serieNames = bar_data[\"2015\"][0]\n .country.map(function(d) { return d.serie; });\n \n \n // scaling of the bar chart frame\n y_1 = d3.scale.linear().range([height, 0]);\n x_1 = d3.scale.ordinal().rangeRoundBands([0, width], .1);\n x_2 = d3.scale.ordinal();\n\n x_1.domain(countryNames);\n x_2.domain(serieNames)\n .rangeRoundBands([0, x_1.rangeBand()]);\n y_1.domain([0, 5000000]);\n \n // create X and Y axis\n var xAxis = d3.svg.axis()\n .scale(x_1)\n .orient(\"bottom\");\n\n var yAxis = d3.svg.axis()\n .scale(y_1)\n .tickFormat(function(d) { return formatValue(d)})\n .orient(\"left\");\n\n // call X and Y axis\n d3.select(\".barchart_y\").append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n .selectAll(\"text\")\n .style(\"text-anchor\", \"end\")\n .attr(\"transform\", \"translate(0,\" + 10 + \")rotate(-45)\")\n\n d3.select(\".barchart_y\").append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 0 - 80)\n .attr(\"x\", 0 - (height / 2))\n .attr(\"dy\", \"3em\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Number of Deaths\")\n .attr(\"class\", \"y axis label\");\n}", "title": "" }, { "docid": "eb73936d6a0418ce1212800a42da8953", "score": "0.6130673", "text": "function create_BarChart()\r\n{\r\n var margin = {top: 30, right: 30, bottom: 70, left: 220},\r\n width = 500,\r\n height = 400;\r\n\r\n // Het aanmaken van een svg waar de barchart in gaat komen in de div barChart die in de index.html staat\r\n svg_BarChart = d3.select(\"#barChart\")\r\n .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\r\n // Hier wordt de x Axis aangemaakt, waarbij het eind punt de hoogste aantal errors van de huidige data set pakt \r\n x = d3.scaleLinear()\r\n .domain([0, Math.max.apply(Math, error_Number_List.map(function(d) { return d.aantal; }))])\r\n .range([0 , width]);\r\n xAxis = svg_BarChart.append(\"g\")\r\n .attr(\"transform\", \"translate(0,\" + height + \")\")\r\n .call(d3.axisBottom(x));\r\n\r\n // Hier wordt de y Axis aangemaakt, waarbij alle punten een soort error krijgt van de huidige data set \r\n y = d3.scaleBand()\r\n .range([height, 0])\r\n .domain(error_Number_List.map(function(d) { return d.soort; }))\r\n .padding(0.2);\r\n yAxis = svg_BarChart.append(\"g\")\r\n .attr(\"class\", \"axisY\")\r\n .call(d3.axisLeft(y));\r\n}", "title": "" }, { "docid": "5ae5bf1299695c43010a5e7102a1c099", "score": "0.61305946", "text": "function drawBarChart() {\r\n\tconsole.log(\"drawBarChart Fired\");\r\n valueChart.container(\"barChart\");\r\n valueChart();\r\n}", "title": "" }, { "docid": "437f09240424ec10a62bb2d728ddae93", "score": "0.61078876", "text": "function plot_alpha(){\n var N = parseFloat(document.getElementById('NController').value);\n\n [n, an, bn, alpha_n, theta_n] = coefficient(N);\n\n var data =\n [{\n type:\"bar\",\n x: n,\n y: alpha_n,\n marker: {\n color:'rgb(200,100,0)',\n opacity: 0.7\n },\n\n },\n ];\n return data;\n}", "title": "" }, { "docid": "07fb91d8ad9d5e529b8c09c46e1a6fa0", "score": "0.60911953", "text": "function setBars() {\n $container.innerHTML = \"\";\n buckets = [];\n\n $size.value <= 15 ? pauseTime = 800\n : $size.value <= 50 ? pauseTime = 100\n : pauseTime = 1400 / $size.value;\n\n $size.value <= 120 ? barWidth = 70/$size.value\n : barWidth = 0.5;\n\n barsUniform();\n}", "title": "" }, { "docid": "db6bfbf2944c62e935d3d7775d26ec55", "score": "0.6085979", "text": "function displayBarChart(positionProfile, subTable, heading)\r\n{\r\n // default to horizontal bar chart\r\n // this requires reversing some of the series data\r\n // and labels to achieve the required display order.\r\n var horizontal = true;\r\n\r\n if(!subTable)\r\n {\r\n identifier = 0;\r\n }\r\n else\r\n {\r\n identifier = 1;\r\n }\r\n\r\n if (language == 1)\r\n {\r\n pctstring = 'Canran';\r\n }\r\n\r\n $.jqplot.config.enablePlugins = true;\r\n\r\n var labsArray = eval(\"strLabs\" + positionProfile).split(\"*\");\r\n //alert(labsArray);\r\n // Ticks should match up one for each y value (category) in the series.\r\n var ticks = labsArray;\r\n if(horizontal)\r\n {\r\n ticks.reverse();\r\n }\r\n\r\n var s1 = new Array();\r\n var s2 = new Array();\r\n var s3 = new Array();\r\n var s4 = new Array();\r\n var s5 = new Array();\r\n var s6 = new Array();\r\n var s7 = new Array();\r\n var s8 = new Array();\r\n var s9 = new Array();\r\n var s10 = new Array();\r\n var s11 = new Array();\r\n var s12 = new Array();\r\n var s13 = new Array();\r\n var s14 = new Array();\r\n var s15 = new Array();\r\n var s16 = new Array();\r\n var s17 = new Array();\r\n var s18 = new Array();\r\n var s19 = new Array();\r\n var s20 = new Array();\r\n var s21 = new Array();\r\n var s22 = new Array();\r\n var s23 = new Array();\r\n var s24 = new Array();\r\n var s25 = new Array();\r\n var s26 = new Array();\r\n var s27 = new Array();\r\n var s28 = new Array();\r\n var s29 = new Array();\r\n var s30 = new Array();\r\n var s31 = new Array();\r\n var s32 = new Array();\r\n var s33 = new Array();\r\n var s34 = new Array();\r\n var s35 = new Array();\r\n var s36 = new Array();\r\n var s37 = new Array();\r\n var s38 = new Array();\r\n var s39 = new Array();\r\n var s40 = new Array();\r\n var s41 = new Array();\r\n var s42 = new Array();\r\n var s43 = new Array();\r\n var s44 = new Array();\r\n var s45 = new Array();\r\n var s46 = new Array();\r\n var s47 = new Array();\r\n var s48 = new Array();\r\n var s49 = new Array();\r\n var s50 = new Array();\r\n var s51 = new Array();\r\n var s52 = new Array();\r\n var s53 = new Array();\r\n var s54 = new Array();\r\n var s55 = new Array();\r\n var s56 = new Array();\r\n var s57 = new Array();\r\n var s58 = new Array();\r\n var s59 = new Array();\r\n var s60 = new Array();\r\n var s61 = new Array();\r\n var s62 = new Array();\r\n var s63 = new Array();\r\n var s64 = new Array();\r\n var s65 = new Array();\r\n var s66 = new Array();\r\n var s67 = new Array();\r\n var s68 = new Array();\r\n var s69 = new Array();\r\n var s70 = new Array();\r\n\r\n // Convert string array into number array for data values\r\n for (var a=1; a <= XstrSeriesData[positionProfile][identifier].length; a++)\r\n {\r\n str = eval(\"XstrSeriesData[\" + positionProfile + \"][identifier][a-1]\").split(\"*\");\r\n\r\n for( var b=0; b < str.length; b++)\r\n {\r\n // Store each item in an array (s1 for area 1, s2 for area 2, etc)\r\n eval(\"s\" + a).push(parseFloat(eval(\"str\")[b]));\r\n }\r\n\r\n // Issue with horizontal bar chart displaying series & legend opposite way around\r\n // to vertical bar chart. Have to supply data in reverse order (fix to reverse\r\n // order of the legend done separately)\r\n if(horizontal)\r\n {\r\n eval(\"s\" + a).reverse();\r\n }\r\n }\r\n\r\n//alert('s1 = ' + s1);\r\n//alert('s1 = ' + eval(\"s\" + XstrSeriesData[positionProfile][identifier].length));\r\n // Create a string of the series array to supply to the chart\r\n // Again done in reverse order as using horizontal bar chart)\r\n // Format: [s3,s2,s1]\r\n var strSeriesArrayReversed = \"[\";\r\n for( var b=XstrSeriesData[positionProfile][identifier].length; b > 0; b--) // reversed order\r\n //for( var b=1; b <= XstrSeriesData[positionProfile][identifier].length; b++)\r\n {\r\n //alert('b=' + b);\r\n if(b > 0) // reversed\r\n //if(b < XstrSeriesData[positionProfile][identifier].length)\r\n {\r\n strSeriesArrayReversed = strSeriesArrayReversed + \"s\" + b + \",\";\r\n }\r\n else\r\n {\r\n strSeriesArrayReversed = strSeriesArrayReversed + \"s\" + b;\r\n }\r\n }\r\n strSeriesArrayReversed = strSeriesArrayReversed + \"]\";\r\n\r\n //alert('strSeriesArrayReversed = ' + strSeriesArrayReversed);\r\n var sKD = null;\r\n // Convert back to array (initially string array)\r\n if(!subTable)\r\n {\r\n sKD = eval(\"strKeyDim\" + positionProfile + \"_0\").split(\"*\");\r\n }\r\n else\r\n {\r\n sKD = eval(\"strKeyDim\" + positionProfile + \"_1\").split(\"*\");\r\n }\r\n var strLabelArray = \"\";\r\n\r\n //alert('sKD.length = ' + sKD.length);\r\n for (var a = sKD.length-1; a > -1; a--) // reversed\r\n //for (var a = 0; a < sKD.length; a++)\r\n {\r\n //alert('a='+a);\r\n if(a == sKD.length-1) // reversed\r\n //if(a == 0)\r\n {\r\n strLabelArray = strLabelArray + \"[{label:sKD[\" + a + \"]}\";\r\n }\r\n else\r\n {\r\n strLabelArray = strLabelArray + \",{label:sKD[\" + a + \"]}\";\r\n }\r\n }\r\n strLabelArray = strLabelArray + \"]\";\r\n //alert(strLabelArray);\r\n\r\n var chartHeightValue = 55;\r\n var minChartHeightValue = 300;\r\n if(!subTable)\r\n {\r\n chartHeightValue = s1.length * 55;\r\n }\r\n else\r\n {\r\n chartHeightValue = (s1.length + sKD.length) * 75;\r\n }\r\n if(chartHeightValue >= minChartHeightValue)\r\n {\r\n chartHeight = chartHeightValue + \"px\";\r\n }\r\n else\r\n {\r\n chartHeight = minChartHeightValue + \"px\";\r\n }\r\n\r\n //alert(sKD.length);\r\n var seriesCol = getSeriesColours(sKD.length, \"BAR\");\r\n //alert(seriesCol.toString());\r\n\r\n //plot = $.jqplot(eval(\"'chartProfile\" + positionProfile + \"'\"), [s1, s2, s3], { // order for vertical bar chart\r\n plotA = $.jqplot(eval(\"'chartProfile\" + positionProfile + \"_\" + identifier + \"'\"), eval(strSeriesArrayReversed), { // order for horizontal bar chart\r\n //plot = $.jqplot(eval(\"'\" + plotname + \"'\"), eval(strSeriesArrayReversed), { // order for horizontal bar chart\r\n title: heading,\r\n\r\n // Only animate if we're not using excanvas (not in IE 7 or IE 8)..\r\n animate: !$.jqplot.use_excanvas,\r\n\r\n // Provide a custom seriesColors array to override the default colours.\r\n seriesColors: eval(seriesCol),\r\n\r\n // The \"seriesDefaults\" option is an options object that will\r\n // be applied to all series in the chart.\r\n seriesDefaults:{renderer:$.jqplot.BarRenderer,\r\n rendererOptions: {fillToZero: true, barHeight: 10 },\r\n pointLabels: {show: false},\r\n rendererOptions: {barDirection: 'horizontal', barWidth:9, barMargin:4, barPadding:1},\r\n shadow: false\r\n },\r\n // Custom labels for the series are specified with the \"label\"\r\n // option on the series option. Here a series option object\r\n // is specified for each series.\r\n series:\r\n eval(strLabelArray) //{label:sKD[0]}, {label:sKD[1]}, {label:sKD[2]} // order for vertical bar chart {label:sKD[2]}, {label:sKD[1]}, {label:sKD[0]} // order for horizontal bar chart\r\n ,\r\n // Show the legend and put it outside the grid, but inside the\r\n // plot container, shrinking the grid to accomodate the legend.\r\n // A value of \"outside\" would not shrink the grid and allow\r\n // the legend to overflow the container.\r\n legend: { show: true, \r\n placement: 'insideGrid',\r\n\t\tlocation: 'e'\r\n },\r\n sortData: false,\r\n height: chartHeight,\r\n axes: {\r\n // Use a category axis on the x axis and use our custom ticks.\r\n yaxis: { renderer: $.jqplot.CategoryAxisRenderer,\r\n labelRenderer: $.jqplot.CanvasAxisLabelRenderer,\r\n tickRenderer: $.jqplot.CanvasAxisTickRenderer,\r\n markerRenderer: $.jqplot.MarkerRenderer( {shadow:false} ),\r\n ticks: ticks,\r\n tickOptions: {\r\n angle: 0,\r\n //fontSize: '10pt',\r\n showTickMarks: false,\r\n textColor: \"black\"\r\n }\r\n },\r\n // Pad the y axis just a little so bars can get close to, but\r\n // not touch, the grid boundaries. 1.2 is the default padding.\r\n xaxis: {\r\n labelRenderer: $.jqplot.CanvasAxisLabelRenderer,\r\n tickRenderer: $.jqplot.CanvasAxisTickRenderer,\r\n markerRenderer: $.jqplot.MarkerRenderer( {shadow:false} ),\r\n label: pctstring,\r\n tickOptions: {\r\n formatString:'%.0f', // use whole numbers on axis scale\r\n textColor: \"black\"\r\n },\r\n pad: 1.5,\r\n min: 0,\r\n //max: 100\r\n }\r\n },\r\n\r\n highlighter: {\r\n show: true,\r\n sizeAdjust: 10,\r\n tooltipContentEditor: tooltipContentEditorBar,\r\n tooltipLocation: 'n',\r\n fadeTooltip: true,\r\n tooltipFadeSpeed: \"slow\",\r\n tooltipOffset: 2\r\n }\r\n });\r\n\r\n // Store plots into separate variables to enable them to be\r\n // destroyed successfully - IMPORTANT as there is a memory\r\n // leak in Firefox, Chrome and Safari and it will crash the\r\n // browser if producing lots of charts numerous times!\r\n storePlotsSeparately(positionProfile, subTable);\r\n\r\n // Commented out as seems to cause problem in IE, so that never completes\r\n // Doesn't appear to be a memory leak looking in Task Manager\r\n //windowResize(plotA, positionProfile, \"BAR\");\r\n \r\n reverseChartLegend(positionProfile, identifier);\r\n}", "title": "" }, { "docid": "e0b4974dbb5fc5655dafbd74438f3aaf", "score": "0.607227", "text": "function buildBarChart() {\n var valueLabels = [];\n var dataPoints = [];\n for (var i in dataVis.dataFrequencies) {\n valueLabels.push(i.toString());\n dataPoints.push(dataVis.dataFrequencies[i]);\n }\n var canvas = $('#data-vis-barchart');\n if (dataVis.chartBar) {\n dataVis.chartBar.destroy();\n }\n canvas.attr('width', Math.min(800, 0.8 * $( window ).width())); // 800 is the value in the html\n canvas.attr('height', canvas.attr('width') / 2);\n dataVis.chartBar = new CHART.Chart(canvas, {\n type: 'bar',\n data: {\n labels: valueLabels,\n datasets: [{\n label: gettext(\"Occurences\"),\n backgroundColor: '#2a3da0', // Primary CSFG colour\n data: dataPoints\n }]\n },\n options: {\n responsive: true,\n legend: {\n display: false\n },\n title: {\n display: true,\n text: TITLES.BAR\n }\n }\n });\n canvas.removeClass('d-none');\n}", "title": "" }, { "docid": "bea837dfaff98bdef742dcf82decbfe0", "score": "0.6047796", "text": "function sortBarchart() {\n\t \tvar x0 = x.domain(bc_data.sort(this.value == \"2\"\n\t \t? function(a, b) { return b.value - a.value; }\n\t \t: function(a, b) { return d3.ascending(a.id, b.id); })\n\t \t.map(function(d) { return d.id; }))\n\t \t.copy();\n\n\t \tsvg.selectAll(\".bar\")\n\t \t.sort(function(a, b) { return x0(a.id) - x0(b.id); });\n\t\t\t\n\t\t\t// set the duration of the visualization\n\t\t\tvar transition = svg.transition().duration(1500);\n\t var delay = function(d, i) { return i * 50; };\n\n\t \ttransition.selectAll(\".bar\")\n\t \t.delay(delay)\n\t \t.attr(\"x\", function(d) { return x0(d.id); });\n\t\t\t\n\t\t\t// sort the axis tick labels\n\t \ttransition.select(\".x.axis\")\n\t\t\t\t.call(axisX)\n\t\t\t\t.selectAll(\"text\")\n\t\t\t\t.style(\"font-size\", \"10px\")\n\t\t\t\t.style(\"font-family\", \"sans-serif\")\n\t\t\t\t.attr(\"dx\", \"-.8em\")\n\t\t\t\t.attr(\"dy\", \"-.180em\")\n\t\t\t\t.style(\"text-anchor\", \"end\")\n\t\t\t\t.attr(\"transform\", \"rotate(-55)\")\n\t\t\t\t.selectAll(\"g\")\n\t\t\t\t.delay(delay);\n\t\t}", "title": "" }, { "docid": "534841cc201870f85658a41fbce2ee1c", "score": "0.6034098", "text": "function graphBar(){\n\n var s1 = [200, 600, 700, 1000];\n var s2 = [460, -210, 690, 820];\n var s3 = [-260, -440, 320, 200];\n // Can specify a custom tick Array.\n // Ticks should match up one for each y value (category) in the series.\n var ticks = new Array();\n //模仿data格式產生資料\n var data2 = new Array();\n for(var i=0;i<(itemName.length-1);i++){\n \n data2[i]= parseInt(itemCount[i],10); //注意input的格式是數字\n\t ticks[i]= itemName[i];\n }\n var plot1 = $.jqplot('chart2', [data2], {\n // The \"seriesDefaults\" option is an options object that will\n // be applied to all series in the chart.\n seriesDefaults:{\n renderer:$.jqplot.BarRenderer,\n rendererOptions: {fillToZero: true}\n },\n // Custom labels for the series are specified with the \"label\"\n // option on the series option. Here a series option object\n // is specified for each series.\n series:[\n {label:'num'}\n\n ],\n // Show the legend and put it outside the grid, but inside the\n // plot container, shrinking the grid to accomodate the legend.\n // A value of \"outside\" would not shrink the grid and allow\n // the legend to overflow the container.\n legend: {\n show: true,\n placement: 'outsideGrid'\n },\n axes: {\n // Use a category axis on the x axis and use our custom ticks.\n xaxis: {\n renderer: $.jqplot.CategoryAxisRenderer,\n ticks: ticks\n },\n // Pad the y axis just a little so bars can get close to, but\n // not touch, the grid boundaries. 1.2 is the default padding.\n yaxis: {\n pad: 1.12,\n tickOptions: {formatString: '$%d'}\n }\n }\n });\n\n}", "title": "" }, { "docid": "13036f3610a7bb3d6206dfd7fe8fc6dd", "score": "0.6017338", "text": "function drawBars(){\n var bars = svg.select('.chart-group').selectAll('.bar')\n .data(data);\n\n // Enter\n bars.enter()\n .append('rect')\n .classed('bar', true)\n .attr('x', function(d) { return xScale(d.letter); })\n .attr('y', function(d) { return yScale(d.frequency); })\n .attr('width', xScale.bandwidth())\n .attr('height', function(d) { return chartHeight - yScale(d.frequency); })\n .on('mouseover', function() {\n dispatcher.call('customMouseOver', this);\n });\n\n // Exit\n bars.exit()\n .style('opacity', 0)\n .remove();\n }", "title": "" }, { "docid": "5d171ababcf9cfd072d6995836cd0adb", "score": "0.60085934", "text": "function createDynamicBarsChart()\n{\t\t\n\tvar data = {\n\t\t\t labels: devices_labels,\n\t\t\t series: voltage_series\n\t\t\t};\n\t\n\tnew Chartist.Bar('.ct-chart',data, {distributeSeries: true });\n}", "title": "" }, { "docid": "4b9c058a5e8f1b2d05214b6230f92496", "score": "0.5997473", "text": "drawBars() {\n const canvas = this.canvas;\n const context = canvas.getContext(\"2d\");\n const numBars = 100;\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.fillStyle = BAR_COLOR;\n for (let n = 0; n < numBars; n++) {\n bar_x = n * (CANVAS_WIDTH / numBars);\n bar_width = 2;\n bar_height = -(data[n] / 6);\n context.fillRect(bar_x, canvas.height, bar_width, bar_height);\n }\n }", "title": "" }, { "docid": "389e4cda6cbc7a0694fa2618a8801e42", "score": "0.5988054", "text": "function barChartOver(){ \n TweenMax.to(\"#bar,#twentybar\", 1, {y:0, height:53.3});\n TweenMax.to(\"#bar_3_,#thirtyFive_1_\", 1, {y:0, height:125.2});\n TweenMax.to(\"#bar_2_,#fourtySeven_1_\", 1, {y:0, height:182});\n TweenMax.to(\"#bar_1_,#ninetyTwo_1_\", 1, {y:0, height:309});\n}", "title": "" }, { "docid": "b36eb6b383e59478cf92095cc603e7dd", "score": "0.59672284", "text": "function createBarChartZeroState() {\n let data = householdZerostate\n\n let width = document.querySelector('.chart').getBoundingClientRect().width - 190,\n height = document.querySelector('.chart').getBoundingClientRect().height,\n svg = d3.select('.chart')\n\n let x = d3.scaleLinear()\n .range([width, 0])\n .domain([0, Math.max.apply(Math, data.map(o => (Math.max(o.bedragen[0].bedrag, o.bedragen[1].bedrag))))])\n\n let y0 = d3.scaleBand()\n .rangeRound([0, height])\n .paddingInner(0.3)\n // Om het eerste karakter van de string naar een hoofdletter te veranderen is de volgende bron gebruikt: https://stackoverflow.com/questions/1026069/how-do-i-make-the-first-letter-of-a-string-uppercase-in-javascript\n .domain(data.map(d => d.post.charAt(0).toUpperCase() + d.post.slice(1)))\n\n let xAxis = d3.axisBottom()\n .scale(x)\n\n let yAxis = d3.axisLeft()\n .scale(y0)\n .tickSize(0)\n\n let groups = svg.append('g')\n .attr(\"transform\", \"translate(140, 0)\")\n\n // Aanmaken X-as\n groups.append(\"g\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .attr('class', 'x axis')\n .call(xAxis);\n\n //Aanmaken Y-as\n groups.append(\"g\")\n .attr('class', 'y axis')\n .call(yAxis)\n .selectAll(\".tick text\")\n .call(wrap, 140)\n\n let barchart = d3.select('svg > g')\n barchart.selectAll(\"bars\")\n .data(data)\n .enter().append(\"g\")\n // Om het eerste karakter van de string naar een hoofdletter te veranderen is de volgende bron gebruikt: https://stackoverflow.com/questions/1026069/how-do-i-make-the-first-letter-of-a-string-uppercase-in-javascript\n .attr(\"transform\", (d => \"translate(0,\" + y0(d.post.charAt(0).toUpperCase() + d.post.slice(1)) + \")\"))\n .attr('class', 'group')\n}", "title": "" }, { "docid": "68de7f354b2cbfe16309f8f9ac18bd91", "score": "0.5966818", "text": "function render() {\n bars('biBars', biAmountsAvg, bjAmountsAvg);\n bars('bjBars', bjAmountsAvg, biAmountsAvg);\n\n histogram('biHist', biTotals);\n histogram('bjHist', bjTotals);\n}", "title": "" }, { "docid": "b0b8d7b682c0a17db9ee6f646fb95a4b", "score": "0.5955354", "text": "function renderBarChart() {\n d3.csv(\"data/vis_1_Graduate_Dropout_rate_Year.csv\", function(d, i, columns) {\n for (var i = 1, n = columns.length; i < n; ++i) d[columns[i]] = +d[columns[i]];\n return d;\n }, function(error, data) {\n if (error) throw error;\n\n q2X0.domain(data.map(function(d) {\n return d.sy;\n }));\n q2X.domain(data_keys).rangeRound([0, q2X0.bandwidth()]);\n q2Y.domain([0, d3.max(data, function(d) {\n return d3.max(data_keys, function(key) {\n return d[key];\n });\n })]).nice();\n\n // x axis\n q2_svg.append(\"g\")\n .attr(\"class\", \"q2axis_x\")\n .attr(\"transform\", \"translate(0,\" + q2Height + \")\")\n .call(d3.axisBottom(q2X0));\n\n //y axis\n q2_svg.append(\"g\")\n .attr(\"class\", \"q2axis_y\")\n .call(q2yAxis)\n .append(\"text\")\n .attr(\"x\", 2)\n .attr(\"y\", q2Y(q2Y.ticks().pop()) + 0.5)\n .attr(\"dy\", \"0.32em\")\n .attr(\"fill\", \"#000\")\n .attr(\"font-weight\", \"bold\")\n .attr(\"text-anchor\", \"start\")\n .text(\"Count\");\n });\n // legend\n var q2_legend = q2_svg.append(\"g\")\n .attr(\"class\", \"q2lgd\")\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", 10)\n .attr(\"text-anchor\", \"end\")\n .selectAll(\"g\")\n .data(colNames_Q2.slice())\n .enter().append(\"g\")\n .attr(\"transform\", function(d, i) {\n return \"translate(-550,\" + i * 20 + \")\";\n });\n\n q2_legend.append(\"rect\")\n .attr(\"x\", q2Width - 19)\n .attr(\"width\", 19)\n .attr(\"height\", 19)\n .attr(\"fill\", color);\n\n q2_legend.append(\"text\")\n .attr(\"x\", q2Width - 24)\n .attr(\"y\", 9.5)\n .attr(\"dy\", \"0.32em\")\n .text(function(d) {\n return d;\n });\n\n}", "title": "" }, { "docid": "13061994389511677d20cc199631e031", "score": "0.59477544", "text": "function barChartInit(dataset, value) {\n\n //console.log(dataset);\n\n //set the scales to linear code from class tutorial\n var xScale = d3.scale.linear()\n // .domain( [d3.min( dataset, function( d ){\n // return parseFloat( d['x'] );\n // } )-1, d3.max( dataset, function( d ){\n // return parseFloat( d['x'] );\n // } )+1] )\n //\n //above code does not place bars in the correct position\n //hard code domain instead\n .domain([0, 11]) //hard code domain\n .range([xOffset + margin, w - margin]);\n\n var yScale = d3.scale.linear()\n .domain([d3.min(dataset, function(d) {\n return parseFloat(d[yVal]);\n })-1, d3.max(dataset, function(d) {\n return parseFloat(d[yVal]);\n })+1])\n .range([h - yOffset - margin, margin]);\n // SVG element to contain our visualization\n //code from tutorial\n var barSvg = d3.select('#barchart').append('svg:svg')\n //var svg = d3.select('#pointsSVG').append('svg:svg')\n .attr('width', w)\n .attr('height', h);\n // Specify the axis scale and general position\n var xAxis = d3.svg.axis()\n .scale(xScale)\n .orient('bottom')\n .ticks(5);\n\n // Add a graphics element to hold the axis we created above (xAxis)\n var xAxisG = barSvg.append('g')\n .attr('class', 'axis')\n .attr('transform', 'translate(0, ' + (h - yOffset) + ')')\n .call(xAxis);\n //.style?\n var yAxis = d3.svg.axis()\n .scale(yScale)\n .orient('left')\n .ticks(5);\n\n var yAxisG = barSvg.append('g')\n .attr('class', 'axis')\n .attr('transform', 'translate(' + xOffset + ', 0)')\n .call(yAxis);\n // Axis labels\n var xLabel = barSvg.append('text')\n .attr('class', 'label')\n .attr('x', w/2)\n .attr('y', h - margin/2)\n .text(xVal);\n var yLabel = barSvg.append('text')\n .attr('class', 'label')\n .attr('x', xOffset/2)\n .attr('y', h/2)\n .text(yVal);\n\n //Maximum value that bar can be\n var maxVal = d3.max(dataset, function(d) { return parseFloat(d[value]); })+1;\n\n //bars on graph\n //code used from https://bost.ocks.org/mike/bar/\n var bar = barSvg.selectAll('rect')\n .data(dataset)\n .enter().append('rect')\n\n bar.attr('id', function(d, i) { return 'rect_' + i; });\n bar\n .attr('class', 'bar')\n .attr('width', 30)\n .attr('height', function(d) { return yScale(maxVal - d[xVal])})\n .attr('x', function(d, i) {return (xScale(i))})\n .attr('y', function(d) {return (h - yOffset - yScale(maxVal - d[xVal]))})\n .style('fill', 'green');\n\n bar.append('text')\n .attr('x', function(d) { return (d[value]) - 3; })\n .attr('y', maxVal / 2)\n .attr('dy', '.35em')\n .text(function(d) { return d[value]; });\n\n}", "title": "" }, { "docid": "ea95c0cceff67ae4bead5352a084db30", "score": "0.59326005", "text": "function updateBarChart() {\r\n $scope.barchart.data = [ $scope.rssi.max, $scope.rssi.avg, $scope.rssi.min ];\r\n }", "title": "" }, { "docid": "e809c2ffc4e2c0ed16cad198d889c6db", "score": "0.59302926", "text": "function barplot(LL_nsdata){ // nsdata = not scaled data\n\n// data division:\n var L_ns_x = LL_nsdata[0];\n var L_ns_y = LL_nsdata[1];\n\n// SVG/image size:\n var w_svg = 2000;\n var h_svg = 400;\n var pad_bar = 3;\n\n//Create SVG element:\n var svg = d3.select(\"body\")\n .append(\"svg\")\n .attr(\"height\", h_svg)\n .attr(\"width\", w_svg);\n\n// Scaling:\n\n// Padding:\n var paddingx = 50;\n var paddingy = 50;\n// Data values:\n var x_min = d3.min(L_ns_x);\n var x_max = d3.max(L_ns_x);\n var y_min = d3.min(L_ns_y);\n var y_max = d3.max(L_ns_y);\n// Screen values:\n var sx_min = 0;\n var sx_max = w_svg - paddingx; // width of SVG\n var sy_min = 0;\n var sy_max = h_svg - paddingy; // Height of SVG\n// domain and range x:\n var input_dom_x = [x_min, x_max]; // depends on data\n var output_range_x = [sx_min, sx_max]; // depends on pixels of image, you decide\n// domain and range y:\n var input_dom_y = [y_min, y_max]; // depends on data\n var output_range_y = [sy_max, sy_min]; // depends on pixels of image, you decide\n// Creates scale functions:\n var xScale = d3.scaleLinear().domain(input_dom_x).range(output_range_x);\n var yScale = d3.scaleLinear().domain(input_dom_y).range(output_range_y);\n\n//scaling values:\n var L_s_y = []; // scaled x values\n for(var dat in L_ns_y){\n y_s = yScale(L_ns_y[dat]);\n L_s_y.push(y_s);}\n\n// change name\n var dataset = L_s_y;\n\n// Add axes:\n// x-axis:\n var x_axis = d3.axisTop().tickFormat(\"\").scale(xScale);\n svg.append(\"g\").attr(\"transform\", \"translate(49,350)\")\n .call(x_axis);\n// y-axis:\n var y_axis = d3.axisLeft().scale(yScale);\n svg.append(\"g\").attr(\"transform\",\"translate(49,0)\") // linkerlimit is paddingx\n .call(y_axis);\n\n// plotting bars:\n svg.selectAll(\"rect\")\n .data(dataset)\n .enter()\n .append(\"rect\")\n .attr(\"height\", function(d) {\n return d; })\n .attr(\"width\", w_svg / dataset.length - pad_bar)\n .attr(\"y\", function(d) {\n return (h_svg-paddingy) - d; }) //Height minus data value\n .attr(\"x\", function(d, i) {\n return paddingx + i * ((w_svg - paddingx) / dataset.length); })\n .attr(\"fill\", \"rgb(0, 100, 120)\");\n\n\n// adding years:\n svg.selectAll(\"text.axis\")\n .data(L_ns_x).enter().append(\"text\")\n .text(function(d){return d})\n .attr(\"x\", function(d,i){ return (paddingx +i*((w_svg-paddingx) / dataset.length)) })\n .attr(\"transform\",\"translate(0,\"+ (h_svg-paddingy + 20) +\")\")\n .style(\"font-size\",\"14px\");\n// .attr('transform', 'rotate(45 -10 10)');\n\n}", "title": "" }, { "docid": "f6469c1f7fbdab5fe99a10fec12c02e5", "score": "0.59271145", "text": "function initBarChart( element ) {\n\tvar barChart = new $jit.BarChart({\n\t\t// Id of the visualization container.\n\t\tinjectInto: element,\n\t\t// Whether to add animations.\n\t\tanimate: false,\n\t\t// Horizontal or vertical barcharts.\n\t\torientation: 'horizontal',\n\t\t// Bars separation spacing.\n\t\tbarsOffset: 20,\n\t\t// Visualization offset.\n\t\tMargin: {\n\t\t\ttop:5,\n\t\t\tleft: 5,\n\t\t\tright: 5,\n\t\t\tbottom:5\n\t\t},\n\t\t// Label offset position.\n\t\tlabelOffset: 5,\n\t\t// Bar style.\n\t\ttype: 'stacked',\n\t\t// Whether to show the aggregation of the values.\n\t\tshowAggregates: true,\n\t\t// Whether to show the labels for the bars.\n\t\tshowLabels: true,\n\t\t// Labels style.\n\t\tLabel: {\n\t\t\t// Native (drawn into canvas) or HTML (additonal element).\n\t\t\ttype: 'HTML',\n\t\t\t// Text size.\n\t\t\tsize: 42,\n\t\t\t// Font and text color.\n\t\t\tfamily: 'Arial',\n\t\t\tcolor: '#FFFFFF'\n\t\t},\n\t\t// Disable tooltips (mouse over info).\n\t\tTips: {\n\t\t\tenable: false,\n\t\t}\n\t});\n\t\n\treturn barChart;\n}", "title": "" }, { "docid": "c23cb967539fd1be83fbfdb646bdb86a", "score": "0.5901427", "text": "function updateChart(bars, n, colorScale){\n\t\t//position bars\n\t\tbars.attr(\"x\", function(d, i){\n\t\t\t\treturn i * (chartInnerWidth / n) + leftPadding;\n\t\t\t})\n\t\t\t//size/resize bars\n\t\t\t.attr(\"height\", function(d, i){\n\t\t\t\treturn 500 - yScale(parseFloat(d[expressed]));\n\t\t\t})\n\t\t\t.attr(\"y\", function(d, i){\n\t\t\t\treturn yScale(parseFloat(d[expressed])) + topBottomPadding;\n\t\t\t})\n\t\t\t//color/recolor bars\n\t\t\t.style(\"fill\", function(d){\n\t\t\t\tvar value = d[expressed];\n\t\t\t\tif(value) {\n\t\t\t\t\treturn colorScale(value);\n\t\t\t\t} else {\n\t\t\t\t\treturn \"#a8a8a8\";\n\t\t\t\t}\n\t\t});\n\t\tvar chartTitle = d3.select(\".chartTitle\")\n\t\t\t.text(expressed); //change title as variable does DYNAMIC\n\t\t\n\t}", "title": "" }, { "docid": "57a42438250a79ba464f2648c7d4e792", "score": "0.5893724", "text": "function createBarChart(infos){\n var arrOfQuarters = ['Trimestre 1', 'Trimestre 2', 'Trimestre 3', 'Trimestre 4' ];\n var quarterArray = [];\n //set up a counter to store the number of sales for every quarter\n var counter = 0;\n for (var m = 0; m < 12; m++) {\n //for every month calculate the amount of sales\n for (var i = 0; i < infos.length; i++) {\n //create a moment obj\n var dateToCheck = moment(infos[i].date, 'DD, MM, YYYY');\n //check if the month of the obj is the same\n if(m == dateToCheck.month()){\n counter++;\n }\n }\n if(((m + 1) % 3) == 0){\n quarterArray.push(counter);\n counter = 0;\n }\n }\n var chartDataObj = {\n label: 'Numero vendite per trimestre',\n data: quarterArray,\n backgroundColor: ['#007a78', '#7e1f2a', '#61d4fb', '#ffc371'],\n };\n var nameOfCanvas = $('#myChart3').attr('id');\n var optionObj = {scales: {yAxes: [{ticks: {beginAtZero:true}}]}};\n generateCharts('bar', chartDataObj, nameOfCanvas, arrOfQuarters, optionObj);\n}", "title": "" }, { "docid": "12b8450c38a3ce56f914287f210f9a32", "score": "0.5888718", "text": "function createBarGraph(data) {\n console.log('create bar graph');\n console.log(data);\n // Clear chart svg.\n $('.chart').empty();\n\n // Set up array for feature labels for scale\n var featureLabels = Object.keys(data);\n\n // Create mapping of features to feature values for each current song,\n // popular average, and unpopular average\n featureValsDict['currSong'] = data;\n\n // Normalize data\n normFeatureValsDict = normalizeAudioFeatureVals(featureValsDict);\n\n // {\n // 'feature': 'key',\n // 'bars': [\n // {\n // 'name': 'currSong',\n // 'normValue': 20\n // 'value': 20\n // },\n // {\n // 'name': 'popular',\n // 'normValue': 20\n // 'value': 30\n // }\n // ]\n // }\n var featuresArray = [];\n for (var i = 0; i < featureLabels.length; i++) {\n var key = featureLabels[i];\n tempDict = {\n 'feature': key,\n 'bars': []\n }\n tempDict['bars'].push({\n 'name': 'currSong',\n 'value': featureValsDict['currSong'][key].toFixed(2),\n 'normValue': normFeatureValsDict['currSong'][key],\n 'label': 'Song Value: '\n })\n tempDict['bars'].push({\n 'name': 'popular',\n 'value': featureValsDict['popular'][key].toFixed(2),\n 'normValue': normFeatureValsDict['popular'][key],\n 'label': 'Popular Average: '\n })\n tempDict['bars'].push({\n 'name': 'unpopular',\n 'value': featureValsDict['unpopular'][key].toFixed(2),\n 'normValue': normFeatureValsDict['unpopular'][key],\n 'label': 'Unpopular Average: '\n })\n featuresArray.push(tempDict);\n }\n\n ////////\n // D3 //\n ////////\n\n // Chart dimensions\n var margin = {top: 19.5, right: 19.5, bottom: 19.5, left: 50};\n var width = 900 - margin.right;\n var height = 500 - margin.top - margin.bottom;\n\n // Create the SVG container\n var svg = d3.select(\".chart\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr('transform', 'translate(' + margin.left + ', 21.0)');\n\n var options = ['currSong', 'popular', 'unpopular'];\n\n // Initialize axis\n var x0 = d3.scaleBand()\n .domain(featureLabels)\n .rangeRound([0, width])\n .paddingInner(0.1);\n var x1 = d3.scaleBand()\n .domain(options)\n .rangeRound([0, x0.bandwidth()])\n .padding(0.05)\n var y = d3.scaleLinear()\n .domain([-1.0, 1.0])\n .rangeRound([height, 0]);\n\n var z = d3.scaleOrdinal()\n .domain(options)\n .range([\"#98abc5\", \"#6b486b\", \"#ff8c00\"]);\n\n // Tooltip\n var tip = d3.tip().attr('class', 'd3-tip').html(function(d) { return d.label + d.value; });\n svg.call(tip);\n\n // Draw x-axis\n svg.append('g')\n .attr('class', 'axis')\n .attr('transform', 'translate(0,' + height + ')')\n .call(d3.axisBottom(x0))\n .selectAll(\".tick text\")\n .style(\"text-anchor\", \"middle\");\n\n // Draw bars\n var bars = svg.append('g')\n .selectAll('g')\n .data(featuresArray)\n .enter().append('g')\n .attr('transform', function(d) {\n return 'translate(' + x0(d.feature) + ',0)';\n })\n\n bars.selectAll('rect')\n .data(function(d) {\n return d.bars\n })\n .enter().append('rect')\n .attr('x', function(d) {\n return x1(d.name);\n })\n .attr('y', function(d) {\n return y(d.normValue);\n })\n .attr('width', x1.bandwidth())\n .attr('height', function(d) { return height - y(d.normValue); })\n .attr('fill', function(d) { return z(d.name) })\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide);\n }", "title": "" }, { "docid": "7e783ab09da59da9451c232b1bf9d08e", "score": "0.58843714", "text": "function barChartMethod() {\n svg\n barChart.data(dataset)\n .enter()\n .append(\"rect\")\n .attr(\"fill\", \"#ffb000\")\n .attr(\"id\", \"bar\")\n .attr(\"y\", function (d) {\n return svgHeight - yScale(d) //Hoe meer de y as is hoe lager het getal van de informatie is. Dus stel ik heb een dataset van 80, 50, 30, 70. Dan wordt er bij het getal 30 meer afgehaald om ervoor te zorgen dat deze op de goede plek staat. Dit is wat de ingebouwde scaleLinear functie doet. Die ik hier gebruik om de hoogte van de bars aan te passen aan de data.\n\n })\n .attr(\"height\", function (d) {\n return yScale(d); //past de hoogte van de bars op de juiste manier aan.\n })\n .attr(\"width\", barWidth - barPadding) //haalt de padding eraf om zo de juiste width mee te geven.\n .attr(\"transform\", function (d, i) {\n //zorgt ervoor dat de bars de juiste dikte hebben zodat ze in het canvas passen.\n var translate = [barWidth * i, 0];\n return \"translate(\" + translate + \")\";\n });\n \n }", "title": "" }, { "docid": "81b9137210fcd7aa3bca65749765c527", "score": "0.58821535", "text": "function plot_bar_graph (dataArray, htmlObjectId, width, height) {\n\n // set margins for a nice looking bar chart\n var margin = {top: 20, right: 50, bottom: 100, left: 10},\n width = width - margin.left - margin.right,\n height = height - margin.top - margin.bottom;\n\n // Determine max data to set the axis limits\n // This is not a neat fix, but a hack!\n // D3 adjusts ticks in multiples of 5 - so add 1 if it is a exact multiple\n var maxData = Math.max.apply(Math,dataArray.map(function(d){return d[1];}))\n if (maxData%5==0){\n maxData = maxData + 1;\n }\n\n // Define linear scale for y-axis\n // Note that the height range is reversed. This\n // is to make sure that the bars start frmo the bottom rather than the top\n var heightScale = d3.scaleLinear()\n .domain([0,maxData])\n .range([height, 0])\n ;\n\n // define scale for categorical x-axis\n var widthScale = d3.scaleBand()\n .range([0, width])\n .padding(0.1)\n .domain(dataArray.map(function(d) { return d[0]; }))\n ;\n\n // define x,y-axes scale and align them bottom and right\n var yaxis = d3.axisRight()\n .scale(heightScale)\n .tickSize(3)\n ;\n\n var xaxis = d3.axisBottom()\n .scale(widthScale)\n .tickSize(0)\n ;\n\n // Define the canvas which will hole the bar chart\n var canvas = d3.select(htmlObjectId)\n .append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\")\n ;\n\n // add bars to the canvas \n var bars = canvas.selectAll(\"rect\")\n .data(dataArray)\n .enter()\n .append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"y\", function(d) {return heightScale(d[1]);})\n .attr(\"x\", function(d) {return widthScale(d[0]);})\n .attr(\"height\", function(d) {return height - heightScale(d[1]);})\n .attr(\"width\", widthScale.bandwidth())\n .attr(\"fill\", \"gray\")\n .on(\"mouseover\", function(d) {\n d3.select(this).attr(\"fill\",\"red\");\n })\n .on(\"mouseout\", function(d) {\n d3.select(this).attr(\"fill\",\"gray\");\n }) \n .on(\"click\", function(d) {\n console.log(d);\n })\n ;\n\n\n // Add x-axis to the bar chart canvas\n canvas.append(\"g\")\n .call(xaxis)\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .attr(\"class\", \"axis x\") \n .selectAll(\"text\")\n .style(\"text-anchor\", \"end\")\n .attr(\"dx\", \"-4\")\n .attr(\"dy\", \"4\")\n .attr(\"transform\", \"rotate(-75)\" )\n ;\n\n // add y-axis to the bar chart canvas\n canvas.append(\"g\")\n .call(yaxis)\n .attr(\"transform\", \"translate(\" + width + \",0)\")\n .attr(\"class\", \"axis y\") \n ;\n \n}", "title": "" }, { "docid": "f4c66ff59b9ddcbe1f881d6b7fc34a4f", "score": "0.58435917", "text": "function updateChart(bars, n, colorScale) {\n\t\t// position bars\n\t\tbars.attr(\"x\", function(d, i){\n\t\t\treturn i * (chartInnerWidth_S / n) + leftPadding_S;\n\t\t})\n\t\t//resize bars\n\t\t.attr(\"height\", function(d, i){\n\t\t\tconsole.log(d[expressed]);\n\t\t\treturn 463 - yScale_S(parseFloat(d[expressed]));\n\t\t})\n\t\t.attr(\"y\", function(d, i){\n\t\t\treturn yScale_S(parseFloat(d[expressed])) + topBottomPadding_S;\n\t\t})\n\t\t//recolor bars\n\t\t.style(\"fill\", function(d){\n\t\t\treturn choropleth(d, colorScale);\n\t\t});\n\n\t\tvar chartTitle = d3.select(\".chartTitle\")\n .text (expressed.replace(/_/g, \" \") + \"\\n Wildfire Destruction in Total square miles\");\n\t\t\t/*.text(expressed.replace(/_/g, \" \"));*/\n\t}", "title": "" }, { "docid": "5535d030d53f17c0ff47ba1492695165", "score": "0.5841608", "text": "function barInit() {\n // Initialize SVGs\n d3.select('.charts')\n .append('svg')\n .attr('id', 'lineEvents')\n .classed('linechart', true)\n .attr('width', barWidth)\n .attr('height', barHeight);\n\n d3.select('.charts')\n .append('svg')\n .attr('id', 'barTotals')\n .classed('barchart', true)\n .attr('width', barWidth)\n .attr('height', barHeight);\n\n // Populate the status variables\n for (const el in data[0]) {\n if (data[0][el].side1killed > 0) {\n let temp = true;\n if (side1killed.length > 0) {\n if (side1killed[side1killed.length - 1].side1killed == data[0][el].side1killed) {\n if (side1killed[side1killed.length - 1].action == data[0][el].action && side1killed[side1killed.length - 1].event == data[0][el].event) {\n temp = false;\n }\n }\n if (temp) side1killed.push(data[0][el]);\n } else side1killed.push(data[0][el]);\n }\n if (data[0][el].side1arrests > 0) {\n let temp = true;\n if (side1arrests.length > 0) {\n if (side1arrests[side1arrests.length - 1].side1arrests == data[0][el].side1arrests) {\n if (side1arrests[side1arrests.length - 1].action == data[0][el].action && side1arrests[side1arrests.length - 1].event == data[0][el].event) {\n temp = false;\n }\n }\n if (temp) side1arrests.push(data[0][el]);\n } else side1arrests.push(data[0][el]);\n }\n if (data[0][el].side1injured > 0) {\n let temp = true;\n if (side1injured.length > 0) {\n if (side1injured[side1injured.length - 1].side1injured == data[0][el].side1injured) {\n if (side1injured[side1injured.length - 1].action == data[0][el].action && side1injured[side1injured.length - 1].event == data[0][el].event) {\n temp = false;\n }\n }\n if (temp) side1injured.push(data[0][el]);\n } else side1injured.push(data[0][el]);\n }\n if (data[0][el].side2killed > 0) {\n let temp = true;\n if (side2killed.length > 0) {\n if (side2killed[side2killed.length - 1].side2killed == data[0][el].side2killed) {\n if (side2killed[side2killed.length - 1].action == data[0][el].action && side2killed[side2killed.length - 1].event == data[0][el].event) {\n temp = false;\n }\n }\n if (temp) side2killed.push(data[0][el]);\n } else side2killed.push(data[0][el]);\n }\n if (data[0][el].side2arrests > 0) {\n let temp = true;\n if (side2arrests.length > 0) {\n if (side2arrests[side2arrests.length - 1].side2arrests == data[0][el].side2arrests) {\n if (side2arrests[side2arrests.length - 1].action == data[0][el].action && side2arrests[side2arrests.length - 1].event == data[0][el].event) {\n temp = false;\n }\n }\n if (temp) side2arrests.push(data[0][el]);\n } else side2arrests.push(data[0][el]);\n }\n if (data[0][el].side2injured > 0) {\n let temp = true;\n if (side2injured.length > 0) {\n if (side2injured[side2injured.length - 1].side2injured == data[0][el].side2injured) {\n if (side2injured[side2injured.length - 1].action == data[0][el].action && side2injured[side2injured.length - 1].event == data[0][el].event) {\n temp = false;\n }\n }\n if (temp) side2injured.push(data[0][el]);\n } else side2injured.push(data[0][el]);\n }\n }\n\n updateAtEvents();\n updateBarData();\n}", "title": "" }, { "docid": "59681ed75099c3fb544dd91c4ba93f38", "score": "0.58400106", "text": "function ready(error, datapoints) {\n console.log(\"Data is\", datapoints)\n\n datapoints.sort((a, b) => d3.ascending(a.count, b.count));\n\n // d3 code goes here\n // Creating scales\n var xPositionScale = d3.scaleLinear().range([0, width])\n .domain([0, d3.max(datapoints, function (d) {\n return d.count;\n })]);\n\n var yPositionScale = d3.scaleBand().rangeRound([height, 0]).padding(0.07)\n .domain(datapoints.map(function (d) {\n return d.word;\n }));\n\n\n\n var bars = svg.selectAll(\".bar\")\n\n .data(datapoints)\n .enter()\n .append(\"g\")\n\n\n\n bars.append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"y\", function (d) {\n return yPositionScale(d.word);\n })\n .attr(\"height\", yPositionScale.bandwidth())\n .attr(\"x\", 0)\n .attr(\"width\", function (d) {\n return xPositionScale(d.count);\n })\n .attr(\"fill\", \"#E9B230\")\n .attr(\"opacity\", 0.8)\n\n bars.append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"fill\", \"white\")\n //y position of the label is halfway down the bar\n .attr(\"y\", function (d) {\n return yPositionScale(d.word) + yPositionScale.bandwidth() / 2 + 4;\n })\n //x position is 3 pixels to the right of the bar\n .attr(\"x\", function (d) {\n return xPositionScale(d.count) - 40;\n })\n .text(function (d) {\n return d.count;\n });\n\n // Always cut and paste the code for the axes, too!\n var yAxis = d3.axisLeft(yPositionScale);\n svg.append(\"g\")\n .attr(\"class\", \"axis y-axis axisWhiteBis\")\n\n .call(yAxis).tick;\n\n var xAxis = d3.axisBottom(xPositionScale)\n svg.append(\"g\")\n .attr(\"class\", \"axis x-axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n svg.selectAll(\".x-axis\").remove()\n\n\n\n\n }", "title": "" }, { "docid": "65dd901a96a896fdc1ea91f0d2a5247e", "score": "0.58387053", "text": "function displayBarChart() {\n var ctx = document.getElementById('myChart').getContext('2d');\n var myChart = new Chart(ctx, {\n type: 'bar',\n data: {\n labels: chartLabels(Product.allImages),\n datasets: [\n {\n label: 'Number of clicks',\n data: chartData(Product.allImages),\n backgroundColor: chartColors(),\n borderColor: chartColors(),\n borderWidth: 1\n },\n {\n label: 'Number of times seen by users',\n data: chartShown(Product.allImages),\n backgroundColor: chartColors(),\n borderColor: chartColors(),\n borderWidth: 1\n }\n ]\n },\n options: {\n scales: {\n yAxes: [\n {\n ticks: {\n beginAtZero: true\n },\n scaleLabel: {\n display: true,\n labelString: 'Number of totalClicks'\n }\n }\n ]\n }\n }\n });\n}", "title": "" }, { "docid": "a6c8bcdca69dfe9f36c43c21cc1cd0a1", "score": "0.5827681", "text": "function updateBarChart(data) \r\n{\r\n // De x Axis updaten\r\n x.domain([0, d3.max(data, function(d) { return d.aantal }) ]);\r\n xAxis.call(d3.axisBottom(x))\r\n\r\n // De y Axis updaten\r\n y.domain(data.map(function(d) { return d.soort; }))\r\n yAxis.transition().duration(1000).call(d3.axisLeft(y));\r\n\r\n // Alle rects worden in de variabel bars gestopt\r\n var bars = svg_BarChart.selectAll(\"rect\")\r\n .data(data)\r\n bars\r\n .enter()\r\n .append(\"rect\")\r\n // Wanneer de gebruiker over een Bar gaat met de muis verschijnt hoe vaak de error is voorgekomen\r\n .on('mouseover', function(d)\r\n {\r\n tooltip_BarChart.transition().duration(200).style('opacity', 0.9);\r\n tooltip_BarChart.html(`<span>${d.aantal}</span>`)\r\n .style(\"top\", (event.pageY-10)+\"px\").style(\"left\",(event.pageX+10)+\"px\")\r\n })\r\n // Tooltip verdwijnt zodra de gebruiker van de Bar af gaat\r\n .on('mouseout', () => \r\n {\r\n tooltip_BarChart.transition().duration(500).style('opacity', 0)\r\n }) \r\n // Hier worden alle bars samengevoegd, gebruiker ziet dit gebeuren aan de hand van een animatie\r\n .merge(bars)\r\n .transition()\r\n .duration(1000)\r\n .attr(\"x\", x(0) )\r\n .attr(\"y\", function(d) { return y(d.soort); })\r\n .attr(\"width\", function(d) { return x(d.aantal); })\r\n .attr(\"height\", y.bandwidth() )\r\n .attr(\"fill\", \"#92A1CF\")\r\n \r\n // Hier worden de bars die niet meer gebruikt worden verwijderd\r\n bars\r\n .exit()\r\n .remove()\r\n}", "title": "" }, { "docid": "7be44fd81a08eecde25a6d5d8e90fc4a", "score": "0.5827205", "text": "function renderChart() {\n requestAnimationFrame(renderChart);\n\n \n analyser.getByteFrequencyData(frequencyData);\n\n // color panel\n var color_panel = d3.scale.linear()\n .domain([0, bar_count])\n .range([d3.rgb(\"#43C6AC\"), d3.rgb('#F8FFAE')]);\n\n\n var height = d3.scale.linear()\n .domain([0, d3.max(frequencyData)])\n .range([0, svgHeight]);\n\n svg.selectAll('rect')\n .data(frequencyData)\n .attr('y', function(d) {\n return svgHeight - height(d);\n })\n .attr('height', function(d) {\n return height(d);\n })\n .attr('fill', function(d, i) {\n return color_panel(i);\n });\n }", "title": "" }, { "docid": "bf3007523db9aa0b53b19f1ab4cd64a2", "score": "0.5813727", "text": "function displayBarChart() {\n\n // Reading csv and pouring their content in their respect data object\n d3.queue()\n .defer(d3.csv, \"src/data/Kyoto_targets.csv\", function(d) {\n data_target[\"target1\"][d.Party] = -parseFloat(d.target1); // minus to convert it to a \"reduction\" in emission\n data_target[\"target1noLULUCF\"][d.Party] = -parseFloat(d.target1no);\n data_target[\"target2\"][d.Party] = -parseFloat(d.target2);\n data_target[\"target2noLULUCF\"][d.Party] = -parseFloat(d.target2no);\n\t\t\t\t\t\t\t\tkp_percentage[d.Party] = {\"kp1\": -parseFloat(d[\"Kyoto target 2008-2012\"]), \"kp2\": -parseFloat(d[\"Kyoto target 2013-2020\"])};\n\t\t\t\t\t\t\t})\n .defer(d3.csv, PATH + \"/unfcc/time_series/data_for_greenhouse_gas_total/Time Series - GHG total with LULUCF, in kt CO₂ equivalent.csv\", function(d) {\n for (i = 1990; i <= 2018; i++) {\n data_GHG_LULUCF[String(i)][d.Party] = parseFloat(d[1990]) - parseFloat(d[String(i)]); // storing the reduction compared to the year 1990\n }\n\n })\n .defer(d3.csv, PATH + \"/unfcc/time_series/data_for_greenhouse_gas_total/Time Series - GHG total without LULUCF, in kt CO₂ equivalent.csv\", function(d) {\n for (i = 1990; i <= 2018; i++) {\n data_GHG_no_LULUCF[String(i)][d.Party] = parseFloat(d[1990]) - parseFloat(d[String(i)]);\n }\n\n })\n .await(ready); // Once the loading is over, we enter the ready function that takes care of the plotting\n\n // Function executed after data has been loaded:\n function ready(error) {\n\n //if error during the logging:\n if (error) throw error;\n\n\t\tk = Object.keys(data_target[target]).length/2;\n\t\tk_new = k;\n createBarChart();\n\n\t\t//////////////////////////////////\n\t\t//////////ADDING BUTTONS//////////\n\t\t//////////////////////////////////\n\n\t\t// Creating a Dropdown Menu for choosing the number of countries to display\n\t\td3.select(\"#select_k_Button\")\n\t\t.selectAll('myOptions')\n\t\t.data(d3.range(Object.keys(data_target[target]).length / 2, 9, -1))\n\t\t.enter()\n\t\t.append('option')\n\t\t.text(function (d) { return d; })\n\t\t.attr(\"value\", function (d) { return d; })\n\n\t\t// Creating a Dropdown Menu for choosing the dataset (LULUCF or no LULUCF)\n\t\td3.select(\"#select_LULUCF_Button\")\n\t\t.selectAll('myOptions')\n\t\t.data([\"No Land Use, Land-Use Change and Forestry (No LULUCF)\", \"Land Use, Land-Use Change and Forestry (LULUCF)\"])\n\t\t.enter()\n\t\t.append('option')\n\t\t.text(function (d) { return d; })\n\t\t.attr(\"value\", function (d, i) { return i; })\n\n\t\t// Event listener to update the chart when the user changes some parameters\n\t\td3.selectAll(\".button\").on(\"change\", function() {\n\n\t\t\tLULUCF = d3.select(\"#select_LULUCF_Button\").property(\"value\");\n\t\t\tk_new = d3.select(\"#select_k_Button\").property(\"value\");\n\t\t\tupdateBarChart();\n\t\t\tloadAreaChart(selected_country);\n\t\t\tdisplayDynamicText(selected_country);\n\t\t})\n }\n}", "title": "" }, { "docid": "c532b4a5e2595f8c8febbbb30bacc1ae", "score": "0.581094", "text": "function setUpBars() {\n for (var i = 0; i < 60; i++) {\n bars.push(0);\n }\n}", "title": "" }, { "docid": "c89c6e5a5adc305ac07048f1b9955c54", "score": "0.58076864", "text": "function BarGraph(divName){\n\tGraph.call(this,divName);\n\tthis.barLengthsArr=[10,10,10,10];\n\tthis.maxValue=100;//scaled to max 100\n \tthis.barMargin = 20;//distance between bars deafult value\n \tthis.colors = \"blue\";\n }", "title": "" }, { "docid": "78f8a74cb77aff31473f721886f99d7b", "score": "0.5795062", "text": "function multiColumnBarPlotter2(e) {\n // We need to handle all the series simultaneously.\n if (e.seriesIndex !== 0) return;\n\n var g = e.dygraph;\n var ctx = e.drawingContext;\n var sets = e.allSeriesPoints;\n var y_bottom = e.dygraph.toDomYCoord(0);\n\n // Find the minimum separation between x-values.\n // This determines the bar width.\n var min_sep = Infinity;//516\n for (var j = 0; j < sets.length; j++) {\n var points = sets[j];\n for (var i = 1; i < points.length; i++) {\n var sep = points[i].canvasx - points[i - 1].canvasx;\n if (sep < min_sep) min_sep = sep;\n }\n }\n //alert(min_sep);\n\n //adjust this to change the initial position\n var bar_width = Math.floor(2.0 * 15 / 16 * min_sep);\n\n var fillColors = [];\n var strokeColors = g.getColors();\n for (var i = 0; i < strokeColors.length; i++) {\n fillColors.push(darkenColor(strokeColors[i]));\n }\n\n for (var j = 0; j < sets.length; j++) {\n ctx.fillStyle = fillColors[j];\n ctx.strokeStyle = strokeColors[j];\n for (var i = 1; i < sets[j].length; i++) {\n var p = sets[j][i];\n var setsLen = sets.length;\n var center_x = p.canvasx;\n var x_left = center_x - (bar_width / 2) * (1 - j / (sets.length - 1));\n\n ctx.fillRect(x_left, p.canvasy,\n bar_width / sets.length, y_bottom - p.canvasy);\n\n ctx.strokeRect(x_left, p.canvasy,\n bar_width / sets.length, y_bottom - p.canvasy);\n\n\n }\n }\n}", "title": "" }, { "docid": "e7857761c73b2c09707fd465460f9ea9", "score": "0.5785856", "text": "function bars(parent) {\n parent.append('rect')\n .attr('class', 'bars')\n .attr('y', d => yScale(d.name))\n .attr('height', () => yScale.bandwidth())\n .attr('x', d => xScaleL(Math.max(0, +d[seriesNames[0]])))\n .attr('width', d => Math.abs(xScaleL(+d[seriesNames[0]]) - xScaleL(0)))\n .attr('fill', colourScale(0));\n\n parent.append('rect')\n .attr('class', 'bars')\n .attr('y', d => yScale(d.name))\n .attr('height', () => yScale.bandwidth())\n .attr('x', d => xScaleR(Math.min(0, +d[seriesNames[1]])))\n .attr('width', d => Math.abs(xScaleR(+d[seriesNames[1]]) - xScaleR(0)))\n .attr('fill', colourScale(1));\n\n if (showNumberLabels) {\n parent.append('text')\n .html(d => +d[seriesNames[0]])\n .attr('y', d => yScale(d.name) + (yScale.bandwidth() / 2) + (rem / 2.5))\n .attr('x', xScaleL(0) - (rem / 2))\n .attr('class', 'highlight-label')\n .attr('font-size', rem)\n .style('text-anchor', 'end');\n\n parent.append('text')\n .html(d => +d[seriesNames[1]])\n .attr('y', d => yScale(d.name) + (yScale.bandwidth() / 2) + (rem / 2.5))\n .attr('x', xScaleR(0) + (rem / 2))\n .attr('class', 'highlight-label')\n .attr('font-size', rem)\n .style('text-anchor', 'start');\n }\n }", "title": "" }, { "docid": "5240ec6f22c037e089a3e5c155bd13f3", "score": "0.57798994", "text": "function drawBarchart() {\n\t// set the dimensions of the canvas\n\tvar margin = {top: 80, right: 20, bottom: 70, left: 70}, \n\t\twidth = 1200 - margin.left - margin.right,\n\t\theight = 500 - margin.top - margin.bottom;\n\n\t// set the ranges\n\tvar x = d3.scale.ordinal().rangeRoundBands([0, width], 0.1);\n\tvar y = d3.scale.linear().range([height, 0]);\n\n\t// define the x-axis\n\tvar axisX = d3.svg.axis()\n\t\t.scale(x)\n\t\t.orient(\"bottom\");\n\n\t// define the y-axis\n\tvar axisY = d3.svg.axis()\n\t\t.scale(y)\n\t\t.orient(\"left\")\n\t\t.tickSize(-width)\n\t\t.ticks(10);\n\n\t// add the SVG element\n\tvar svg = d3.select(\"body\").append(\"svg\")\n\t\t.attr(\"id\", \"svgBarchart\")\n\t\t.attr(\"width\", width + margin.left + margin.right)\n\t\t.attr(\"height\", height + margin.top + margin.bottom)\n\t\t.append(\"g\")\n\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\t\n\t// initialize a tooltip\n\tvar tip = d3.tip()\n\t\t.attr('class', 'd3-tip')\n\t\t.offset([-10, 0])\n\t\t.html(function(d) { return \"<center><span style = 'color: #b08db8'>\" + d.id.toLocaleString() + \"<br>\" + \n\t\t\td.value.toLocaleString() + \"</span></center>\"; });\n\tsvg.call(tip);\n\n\t// load the data\n\tvar bc_counter = 0;\n\tvar bc_data_total = [];\n\tvar bc_countries = [];\n\t\n\td3.json(\"../../Data/immigrationData.json\", function(error, data) { Object.keys(data).forEach(function(key) {\n\t\tif (error) throw error;\n\t\t\n\t\t// store all the data in arrays\n\t\tif (data[key][\"Total\"] != \"No Data Available\") {\n\t\t\tvar bc_data_EU28 = data[key][\"EU28 countries except reporting country\"];\n\t\t\tvar bc_data_non_EU28 = data[key][\"Non-EU28 countries nor reporting country\"];\n\t\t\tvar bc_data_reporting = data[key][\"Reporting country\"];\n\t\t\tvar bc_data_stateless = data[key][\"Stateless\"];\n\t\t\tvar bc_data_unknown = data[key][\"Unknown\"];\n\t\t\tbc_data_total[bc_counter] = bc_data_EU28 + bc_data_non_EU28 + bc_data_reporting + bc_data_stateless + bc_data_unknown;\n\t\t\tbc_countries[bc_counter] = key;\n\t\t\tbc_counter++\n\t\t\t}\n\t\t});\n\t\t\n\t\t// convert the data to a dict-like structure\n\t\tvar bc_data = [];\n\t\tfor (i = 0; i < bc_data_total.length; i++){\n\t\t\tbc_data.push({\"id\" : bc_countries[i], \"value\" : bc_data_total[i]});\n\t\t}\n\t\t\n\t\t\n\t\t// append a title to the chart\n\t\tsvg.append(\"text\")\n\t\t\t.attr(\"x\", (width / 2)) \n\t\t\t.attr(\"y\", 0 - (margin.top / 2))\n\t\t\t.attr(\"text-anchor\", \"middle\") \n\t\t\t.style(\"font-size\", \"20px\")\n\t\t\t.style(\"font-family\", \"sans-serif\")\n\t\t\t.text(\"The number of immigrants that has entered a country in 2015\");\n\n\t\t// scale chart\n\t\tx.domain(bc_data.map(function(d) { return d.id; }));\n\t\ty.domain([0, (Math.floor(d3.max(bc_data_total) / 200000) + 1) * 200000]);\n\t\n\t\t// initialize x-axis\n\t\tsvg.append(\"g\")\n\t\t\t.attr(\"class\", \"x axis\")\n\t\t\t.attr(\"transform\", \"translate(0,\" + height + \")\")\n\t\t\t.call(axisX)\n\t\t\t// append x-axis tick labels\n\t\t\t.selectAll(\"text\")\n\t\t\t.style(\"font-size\", \"10px\")\n\t\t\t.style(\"font-family\", \"sans-serif\")\n\t\t\t.attr(\"dx\", \"-.8em\")\n\t\t\t.attr(\"dy\", \"-.180em\")\n\t\t\t.style(\"text-anchor\", \"end\")\n\t\t\t.attr(\"transform\", \"rotate(-55)\");\n\t\n\t\t// append x-axis title\n\t\tsvg.append(\"text\")\n\t\t .attr(\"text-anchor\", \"end\")\n\t\t .attr(\"transform\", \"translate(\" + (width) + \",\" + (height + margin.bottom) + \")\")\n\t\t .style(\"font-size\", \"10px\")\n\t\t\t.style(\"font-family\", \"sans-serif\")\n\t\t .text(\"Countries\");\n\t\t\n\t\t// initialize y-axis\n\t\tsvg.append(\"g\")\n\t\t\t.attr(\"class\", \"y axis\")\n\t\t\t.call(axisY)\n\t\t\t// append y-axis title\n\t\t\t.append(\"text\")\n\t\t\t.attr(\"y\", -60)\n\t\t\t.attr(\"dy\", \".69em\")\n\t\t\t.style(\"text-anchor\", \"end\")\n\t .style(\"font-size\", \"10px\")\n\t\t\t.style(\"font-family\", \"sans-serif\")\n\t\t\t.attr(\"transform\", \"rotate(-90)\")\n\t\t\t.text(\"Number of Immigrants\");\n\t\t\n\t\t// add bars to chart\n\t\tsvg.selectAll(\"bar\")\n\t\t\t.data(bc_data)\n\t\t\t.enter().append(\"rect\")\n\t\t\t.attr(\"class\", \"bar\")\n\t\t\t.attr(\"x\", function(d) { return x(d.id); })\n\t\t\t.attr(\"width\", x.rangeBand())\n\t\t\t.attr(\"y\", function(d) { return y(d.value); })\n\t\t\t.attr(\"height\", function(d) { return height - y(d.value); })\n\t\t\t.on('click', function(d) { zoomSunburst(d.id); selectDropdownCountry(d.id) })\n\t\t\t.on('mouseover', function(d) { d3.select(this).style(\"cursor\", \"pointer\"); tip.show(d); highlightCountryChart(d.id, \"highlight\") })\n\t\t\t.on('mouseout', function(d) { tip.hide(d); highlightCountryChart(d.id, \"de-highlight\") });\n\t\n\t\t// call 'sort'-function when radio button is clicked\n\t\td3.select(\"#sorting-radio1\").on(\"click\", sortBarchart);\n\t\td3.select(\"#sorting-radio2\").on(\"click\", sortBarchart);\n\t\n\t\t// sort or unsort the barchart\n\t function sortBarchart() {\n\t \tvar x0 = x.domain(bc_data.sort(this.value == \"2\"\n\t \t? function(a, b) { return b.value - a.value; }\n\t \t: function(a, b) { return d3.ascending(a.id, b.id); })\n\t \t.map(function(d) { return d.id; }))\n\t \t.copy();\n\n\t \tsvg.selectAll(\".bar\")\n\t \t.sort(function(a, b) { return x0(a.id) - x0(b.id); });\n\t\t\t\n\t\t\t// set the duration of the visualization\n\t\t\tvar transition = svg.transition().duration(1500);\n\t var delay = function(d, i) { return i * 50; };\n\n\t \ttransition.selectAll(\".bar\")\n\t \t.delay(delay)\n\t \t.attr(\"x\", function(d) { return x0(d.id); });\n\t\t\t\n\t\t\t// sort the axis tick labels\n\t \ttransition.select(\".x.axis\")\n\t\t\t\t.call(axisX)\n\t\t\t\t.selectAll(\"text\")\n\t\t\t\t.style(\"font-size\", \"10px\")\n\t\t\t\t.style(\"font-family\", \"sans-serif\")\n\t\t\t\t.attr(\"dx\", \"-.8em\")\n\t\t\t\t.attr(\"dy\", \"-.180em\")\n\t\t\t\t.style(\"text-anchor\", \"end\")\n\t\t\t\t.attr(\"transform\", \"rotate(-55)\")\n\t\t\t\t.selectAll(\"g\")\n\t\t\t\t.delay(delay);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7fdcd874aa80798d4c4cb6ef0bbadca0", "score": "0.57760745", "text": "function plot_theta(){\n var N = parseFloat(document.getElementById('NController').value);\n\n [n, an, bn, alpha_n, theta_n] = coefficient(N);\n\n var data =\n [{\n type:\"bar\",\n x: n,\n y: theta_n,\n marker: {\n color:'rgb(0,100,200)',\n opacity: 0.7\n },\n\n },\n ];\n return data;\n}", "title": "" }, { "docid": "4ba2d0c248d41d7e827a8b54ac8e4e28", "score": "0.57645386", "text": "function charts_show(obja,objb) {\n \n var sam_values = objb.sample_values.slice(0, 10).reverse();\n var otuids = objb.otu_ids.slice(0, 10).reverse();\n var otulabels = objb.otu_labels.slice(0, 10).reverse();\n var ylabel = otuids.map(item => `OTU_${item}`);\n var wfre = obja.wfreq;\n \n //console.log(ylabel);\n\n // Trace1 for the top 10 OTU Data\n var trace1 = {\n x: sam_values,\n y: ylabel,\n text: otulabels,\n name: \"Top 10 Otu Facts\",\n type: \"bar\",\n orientation: \"h\"\n };\n\n var chartData = [trace1];\n\n var layout = {\n title: `Top 10 Otu Facts of Test ID${obja.id}`,\n xaxis:{title:{text:\"Sample_Values\"}},\n yaxis: {title:{text:\"OTU_IDS\"}},\n //height: 300,\n //width: 480,\n\n margin: {\n l: 100,\n r: 100,\n t: 100,\n b: 100\n }\n };\n\n Plotly.newPlot(\"bar\", chartData, layout);\n\n //bubble workshop\n var yvalues = objb.sample_values;\n var xvalues = objb.otu_ids; \n var texts = objb.otu_labels; \n\n console.log(texts);\n console.log(yvalues);\n console.log(xvalues);\n\n var colorlist =[];\n var opalist = [];\n var sizelist = [];\n var lengthh = xvalues.length;\n \n //use sample values to fabricate size list, otu_id to fabricate the color list\n //use random to fabricate the opacity list\n for (var i = 0; i < lengthh; i++) {\n var si = getSize(yvalues[i]);\n var co = getColor(xvalues[i]);\n var op = getRandomOpacity();\n colorlist.push(co);\n opalist.push(op);\n sizelist.push(si);\n };\n\n // console.log(colorlist);\n // console.log(opalist);\n // console.log(sizelist);\n\n var trace2 = {\n x: xvalues,\n y: yvalues,\n text : texts,\n mode: 'markers',\n marker: {\n color: colorlist,\n opacity: opalist,\n size: sizelist\n }\n };\n \n var data = [trace2];\n \n var layout = {\n title: `OTU ID vs. Sample_Values of Test ID${obja.id}`,\n xaxis:{title:{text:\"OTU_IDS\"}},\n yaxis: {title:{text:\"Sample_values\"}},\n showlegend: false,\n height: 500,\n width: 800\n };\n \n Plotly.newPlot('bubble', data, layout);\n\n //function to make color with each input value\n function getColor(a) { \n var num = a.toString(16);\n var len = num.length;\n\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6 - len; i++) {\n color += letters[Math.floor(Math.random() * 16)];\n }\n color += num;\n //console.log(color);\n return color;\n }\n \n //function for bubble size with each input value\n function getSize(b) {\n var size = b * 5 > 100 ? 100 : b * 5;\n //var size = Math.floor(Math.random() * inisize) + 1;\n //console.log(size);\n return size;\n }\n\n //function for opacity value\n function getRandomOpacity() {\n var opa = Math.random();\n //console.log(opa);\n return opa;\n }\n \n //draw the gauge chart\n var data = [\n {\n domain: { x: [0, 1], y: [0, 1] },\n value: wfre || 0,\n title: { text: `Weekly Belly Button Washing Frequency of Test ID${obja.id}` },\n type: \"indicator\",\n mode: \"gauge+number+delta\",\n //delta: { reference: 4 },\n gauge: {\n axis: { range: [null, 10] },\n steps: [\n { range: [0, 2], color: \"#F5FAF9\" },\n { range: [2, 4], color: \"#CAF7F4\" },\n { range: [4, 6], color: \"#9BF3ED\" },\n { range: [6, 8], color: \"#51DBD2\" },\n { range: [8, 10], color:\"#23C7BC\" }\n ],\n threshold: {\n line: { color: \"blue\", width: 4 },\n thickness: 0.75,\n value: 9\n }\n }\n }\n ];\n \n var layout = { width: 600, height: 450, margin: { t: 0, b: 0 } };\n Plotly.newPlot('gauge', data, layout);\n \n\n // console.log(si);\n // console.log(co);\n // console.log(op);\n \n }", "title": "" }, { "docid": "2dbebde5f47b5e33dffffecb62f8569c", "score": "0.57640785", "text": "function drawBarGraphIndicator() {\r\n\tif (coin!==null) {\r\n\t\tif (mouseCoordX>=padding.left && mouseCoordX<=width-padding.right) {\r\n\t\t\tlet eachBand = xbarScale.step(); //distance between 2 bands\r\n\t\t\tlet index = Math.floor((mouseCoordX - X_BAR_START_OFFSET - bar_graph_padding.left) / eachBand + 0.05);\r\n\t\t\tbar_graph.select(\"#bar\"+index).attr(\"stroke\",\"black\");\r\n\t\t\tbar_graph.selectAll(\"rect:not(#bar\"+index+\")\").attr(\"stroke\",null);\r\n\r\n\t\t\tlet bar = bar_graph.select(\"#bar\"+index);\r\n\t\t\tlet bar_data = bar.datum();\r\n\t\t\tlet bar_x = parseFloat(bar.attr(\"x\"));\r\n\t\t\tlet bar_width = parseFloat(bar.attr(\"width\"));\r\n\r\n\t\t\tif (bar_data) {\r\n\t\t\t\tbar_graph.selectAll(\".bar_graph_value_text\").remove()\r\n\t\t\t\tlet bar_date = bar_data.time\r\n\t\t\t\tlet before_date = new Date(bar_data.time.getTime())\r\n\t\t\t\tbefore_date.setHours(before_date.getHours() - last_requested_time_between)\r\n\r\n\t\t\t\tlet bar_x_offset = bar_x + (bar_width / 2)\r\n\r\n\t\t\t\tlet bar_text = format_volume_text(bar_data.volumeto)\r\n\r\n\t\t\t\tbar_graph.append(\"text\")\r\n\t\t\t\t\t.attr(\"class\", \"bar_graph_value_text\")\r\n\t\t\t\t\t.style(\"text-anchor\", \"middle\")\r\n\t\t\t\t\t.style(\"font-size\", \"small\")\r\n\t\t\t\t\t.attr(\"x\", Math.max(bar_x_offset, (bar_text.length / 2) * 8 + 3))\r\n\t\t\t\t\t.attr(\"y\", Math.max(bar.attr(\"y\") - 40, 2))\r\n\t\t\t\t\t.text(bar_text)\r\n\t\t\t\t\t.style(\"display\",function () {\r\n\t\t\t\t\t\tlet lineX = document.getElementsByClassName('line_graph_line_class')[barindex].getPointAtLength(0).x;\r\n\t\t\t\t\t\tif (lineX<=mouseCoordX && lineX!==0) {\r\n\t\t\t\t\t\t\treturn \"\"\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\treturn \"none\"\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\tbar_graph.append(\"text\")\r\n\t\t\t\t\t.attr(\"class\", \"bar_graph_value_text\")\r\n\t\t\t\t\t.style(\"text-anchor\", \"middle\")\r\n\t\t\t\t\t.style(\"font-size\", \"small\")\r\n\t\t\t\t\t.attr(\"x\", bar_x_offset)\r\n\t\t\t\t\t.attr(\"y\", bar_graph_height)\r\n\t\t\t\t\t.attr(\"dy\",\"1.5em\")\r\n\t\t\t\t\t.text(format_bar_date(bar_date))\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "a3f08ab522bb7c0924318b835942760a", "score": "0.5757996", "text": "function updateChart (bars, n, colorScale) {\n bars.attr('x', function (d, i) { // position bars\n return i * (chartInnerWidth / n) + leftPadding\n })\n .attr('height', function (d, i) { // size/resize bars\n return 400 - yScale(parseFloat(d[expressed]))\n })\n .attr('y', function (d, i) {\n return yScale(parseFloat(d[expressed])) + topBottomPadding\n })\n\n .style('fill', function (d) { // color/recolor bars\n return choropleth(d, colorScale)\n })\n\n // add title to chart based on array value\n let chartTitle = attrDict[expressed].title\n\n // d3.select('.chartTitle').text(chartTitle)\n $('#map-title').text(chartTitle)\n $('#attr-desc').text(attrDict[expressed].description)\n\n // Format y-axis\n let yAxis = d3.axisLeft()\n .scale(yScale)\n .tickFormat(function (d) { // display unit abbreviations for large numbers\n let array = ['', 'K', 'M', 'G', 'T', 'P']\n\n let i = 0\n\n while (d >= 1000) {\n i++\n d = d / 1000\n }\n\n d = d + array[i]\n\n return d\n })\n\n // update the charts axis\n d3.selectAll('g.axis')\n .call(yAxis)\n }", "title": "" }, { "docid": "6f8ec7c20655af5716b61804db149ef4", "score": "0.57573533", "text": "function multiColumnBarPlotter(e) {\n // We need to handle all the series simultaneously.\n if (e.seriesIndex !== 0) return;\n\n var g = e.dygraph;\n var ctx = e.drawingContext;\n var sets = e.allSeriesPoints;\n var y_bottom = e.dygraph.toDomYCoord(0);\n\n // Find the minimum separation between x-values.\n // This determines the bar width.\n var min_sep = Infinity;\n for (var j = 0; j < sets.length; j++) {\n var points = sets[j];\n for (var i = 1; i < points.length; i++) {\n var sep = points[i].canvasx - points[i - 1].canvasx;\n if (sep < min_sep) min_sep = sep;\n }\n }\n var bar_width = Math.floor(2.0 / 3 * min_sep);\n\n var fillColors = [];\n var strokeColors = g.getColors();\n for (var i = 0; i < strokeColors.length; i++) {\n fillColors.push(darkenColor(strokeColors[i]));\n }\n\n for (var j = 0; j < sets.length; j++) {\n ctx.fillStyle = fillColors[j];\n ctx.strokeStyle = strokeColors[j];\n for (var i = 0; i < sets[j].length; i++) {\n var p = sets[j][i];\n var center_x = p.canvasx;\n var x_left = center_x - (bar_width / 2) * (1 - j / (sets.length - 1));\n\n ctx.fillRect(x_left, p.canvasy,\n bar_width / sets.length, y_bottom - p.canvasy);\n\n ctx.strokeRect(x_left, p.canvasy,\n bar_width / sets.length, y_bottom - p.canvasy);\n }\n }\n}", "title": "" }, { "docid": "2a2f705f7e845a7bcd9fd0769d09322c", "score": "0.5753711", "text": "function createBar(data) {\n var trace = {\n x: data.map(x=>x.otu_value),\n y: data.map(x=>`OTU ${x.otu_id}`),\n type: \"bar\",\n orientation: \"h\",\n text: data.map(x=>x.label),\n labels: data.map(x=>x.label),\n hoverinfo: \"labels\"\n }\n\n Plotly.newPlot(\"bar\", [trace], {title: \"<b>Top 10 otus</b>\"});\n}", "title": "" }, { "docid": "fa7a55c1f669c0edfaa55fcf99837b29", "score": "0.57505167", "text": "function demoBarGraph() {\n const body = document.getElementsByTagName(\"body\")[0];\n const graph = pureknob.createBarGraph(400, 40);\n graph.setProperty(\"colorFG\", \"#44ff44\");\n graph.setProperty(\"colorMarkers\", \"#ffffff\");\n graph.setProperty(\"markerStart\", -60);\n graph.setProperty(\"markerEnd\", 0);\n graph.setProperty(\"markerStep\", 10);\n graph.setProperty(\"valMin\", -145);\n graph.setProperty(\"valMax\", 0);\n graph.setValue(-25);\n graph.setPeaks([-18]);\n const node = graph.node();\n body.appendChild(node);\n window.graph = graph;\n\n /*\n * This is executed on each timer tick.\n */\n const t = function (e) {\n let v = graph.getValue();\n\n /*\n * As long as value is greater than -80, decrement it.\n */\n if (v > -80) {\n v--;\n graph.setValue(v);\n }\n };\n\n window.setInterval(t, 200);\n}", "title": "" }, { "docid": "1a34de4fbc59373433876daeda46e5fe", "score": "0.5749057", "text": "function drawBar(k){\n var bar_height = 20;\n d3.select(\"#biopsy-result #biopsy-section svg\").append(\"g\").attr(\"class\",\"bar-rect-\"+k).attr(\"transform\",\"translate(\"+(margin.left)+\",\"+(k*bar_height+margin.top)+\")\").selectAll(\"rect\").data(data.genomicProfileList[k].mutationList).enter().append(\"rect\")\n .on(\"click\",function(d){\n d3.select(this).style(\"fill\",\"red\")\n var obAnalyticDet = {\n entrezGeneId: d.entrezGeneId,\n geneSymbol: d.geneSymbol,\n referenceGenome: d.referenceGenome,\n chromosome: d.chromosome,\n dnaStartPosition: d.dnaStartPosition,\n dnaEndPosition: d.dnaEndPosition,\n strand: d.strand,\n variantClassification: d.variantClassification,\n referenceAllele: d.referenceAllele,\n variantAllele: d.variantAllele,\n alternativeAlleleReads: d.alternativeAlleleReads,\n referenceAlleleReads: d.referenceAlleleReads,\n dbSnpRsId: d.dbSnpRsId,\n dbSnpRsValStatus: d.dbSnpRsValStatus,\n annotationTranscript: d.annotationTranscript,\n transcriptStrand: d.transcriptStrand,\n cDnaChange: d.cDnaChange,\n codonChange: d.codonChange,\n aaChange: d.aaChange,\n otherTranscript: d.otherTranscript,\n refseqMrnaId: d.refseqMrnaId,\n refseqProtId: d.refseqProtId,\n swissprotAccession: d.swissprotAccession,\n swissprotEntry: d.swissprotEntry,\n uniprotAaPosition: d.uniprotAaPosition,\n uniprotRegion: d.uniprotRegion,\n uniprotSite: d.uniprotSite,\n vertebrateAaAlignment: d.vertebrateAaAlignment\n }\n analyticDetails(obAnalyticDet);\n })\n // .on(\"mouseover\",function(d){\n // d3.select(this).style(\"opacity\",\".8\");\n // tooltip.transition().style(\"opacity\",\"1\")\n // // console.log(d)\n // tooltip.html(d.geneSymbol)\n // .style(\"left\",(d3.event.pageX)+\"px\")\n // .style(\"top\",(d3.event.pageY)-15+\"px\")\n // })\n // .on(\"mouseout\",function(d){\n // d3.select(this).style(\"opacity\",\"1\");\n // tooltip.transition().style(\"opacity\",\"0\")\n // })\n.attr({\n width:width/(data.genomicProfileList[k].mutationList.length)-5,\n x:function(d,i){ return i*(width/(data.genomicProfileList[k].mutationList.length))},\n height:bar_height,\n y:k*bar_height+5\n}).style(\"fill\",\"#575757\").style(\"cursor\",\"pointer\");\n\nd3.select(\" #biopsy-result #biopsy-section svg\").append(\"g\").attr(\"class\",\"bar-text-\"+k).attr(\"transform\",\"translate(\"+(margin.left)+\",\"+(k*bar_height+margin.top)+\")\").selectAll(\"text\").data(data.genomicProfileList[k].mutationList).enter().append(\"text\").text(function(d){\n return d.chromosome.substring(3,5);\n}).attr({\n \"text-anchor\":\"middle\",\n \"font-size\":\"10px\",\n x:function(d,i){ return i*(width/(data.genomicProfileList[k].mutationList.length))+8},\n y:k*bar_height+19,\n \"fill\":\"#FFF\",\n \"font-weight\":\"bold\",\n \"cursor\":\"pointer\"\n})\n.on(\"click\",function(d,i){\n d3.select(\".bar-rect-\"+k).select(\"rect:nth-child(\"+(i+1)+\")\").style(\"fill\",\"red\");\n var obAnalyticDet = {\n entrezGeneId: d.entrezGeneId,\n geneSymbol: d.geneSymbol,\n referenceGenome: d.referenceGenome,\n chromosome: d.chromosome,\n dnaStartPosition: d.dnaStartPosition,\n dnaEndPosition: d.dnaEndPosition,\n strand: d.strand,\n variantClassification: d.variantClassification,\n referenceAllele: d.referenceAllele,\n variantAllele: d.variantAllele,\n alternativeAlleleReads: d.alternativeAlleleReads,\n referenceAlleleReads: d.referenceAlleleReads,\n dbSnpRsId: d.dbSnpRsId,\n dbSnpRsValStatus: d.dbSnpRsValStatus,\n annotationTranscript: d.annotationTranscript,\n transcriptStrand: d.transcriptStrand,\n cDnaChange: d.cDnaChange,\n codonChange: d.codonChange,\n aaChange: d.aaChange,\n otherTranscript: d.otherTranscript,\n refseqMrnaId: d.refseqMrnaId,\n refseqProtId: d.refseqProtId,\n swissprotAccession: d.swissprotAccession,\n swissprotEntry: d.swissprotEntry,\n uniprotAaPosition: d.uniprotAaPosition,\n uniprotRegion: d.uniprotRegion,\n uniprotSite: d.uniprotSite,\n vertebrateAaAlignment: d.vertebrateAaAlignment\n }\n analyticDetails(obAnalyticDet);\n\n\n})\n // .on(\"mouseover\",function(d){\n // d3.select(this).style(\"opacity\",\".8\");\n // tooltip.transition().style(\"opacity\",\"1\")\n // // console.log(d)\n // tooltip.html(d.geneSymbol)\n // .style(\"left\",(d3.event.pageX)+\"px\")\n // .style(\"top\",(d3.event.pageY)-15+\"px\")\n // })\n // .on(\"mouseout\",function(d){\n // d3.select(this).style(\"opacity\",\"1\");\n // tooltip.transition().style(\"opacity\",\"0\")\n // })\n}", "title": "" }, { "docid": "1b7ae259e5d65cd3b0d08b0f19a3550b", "score": "0.5736377", "text": "function buildBarGraph(data, div) {\n var drugs = ['Neomycin', 'Penicilin', 'Streptomycin'];\n var traces = [];\n \n // This one uses basically the raw js object\n // group are by drug (each drug column) and are 'tagged' by bacteria (the Bacteria column, same order)\n for (var i = 0; i < drugs.length; i++) {\n var trace = {\n y: data[drugs[i]],\n x: data['Bacteria'],\n type: 'bar',\n name: drugs[i]\n };\n\n traces.push(trace);\n }\n\n // construct layout\n var layout = {\n title: 'Bacteria Resistance to Drugs',\n margin: {b: 200},\n titlefont: {\n size: 20\n },\n yaxis: {\n type: 'log',\n autorange: true,\n title: 'Concentration Required to Prevent Growth',\n titlefont: {\n size: 18\n }\n },\n xaxis: {\n title: 'Bacteria',\n titlefont: {\n size: 18\n }\n },\n staticPlot: true,\n height: $(window).height() * 0.75,\n showlegend: true,\n boxmode: 'group'\n };\n\n Plotly.newPlot(div, traces, layout);\n }", "title": "" }, { "docid": "d35c771ce49cc1ae04b10865d1442cb3", "score": "0.5733516", "text": "function drawBarChart(data, interval) {\n if (BARCHART1) {\n BARCHART1.destroy();\n }\n\n if (!data) return;\n const [labels, counts] = barChartRange(data, interval, 10);\n const BARCHART = $(`#BAR1`);\n $(`#BAR1-heading`).text(\"Electricity Bill\");\n\n BARCHART1 = new Chart(BARCHART, {\n type: \"bar\",\n data: {\n labels: labels,\n datasets: [\n {\n label: \"Bill per houseold\",\n backgroundColor: colors,\n data: counts\n }\n ]\n },\n options: {\n legend: { display: false },\n title: {\n display: true,\n text: \"Amount charged by electricity company per month in naira\",\n fontSize: 14\n },\n tooltips: {\n callbacks: {\n label: function(tooltipItem, data) {\n let label = data.labels[tooltipItem.index] || \"\";\n\n if (label) {\n label += \": \";\n }\n\n const total = data.datasets[0].data.reduce(\n (total, num) => total + num,\n 0\n );\n const number = data.datasets[0].data[tooltipItem.index];\n label += Math.round(number * 100 / total) + \"%\";\n return label;\n }\n }\n }\n }\n });\n }", "title": "" }, { "docid": "2b1375f113950d31998cbf19001f9fbc", "score": "0.5721501", "text": "function barChart(start, end) {\n let sliced_data = getTopPlayers(start, end)\n // console.log(sliced_data)\n \n var svg = d3.select(\"svg\"),\n margin = {\n top: 20,\n right: 20,\n bottom: 30,\n left: 50\n },\n width = +svg.attr(\"width\") - margin.left - margin.right,\n height = +svg.attr(\"height\") - margin.top - margin.bottom,\n g = svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n var x = d3.scaleBand()\n .rangeRound([0, width])\n .padding(0.1);\n\n var y = d3.scaleLinear()\n .rangeRound([height, 0]);\n\n x.domain(sliced_data.map(function (d) {\n return d.key;\n }));\n y.domain([0, d3.max(sliced_data, function (d) {\n return d.value;\n })]);\n\n g.append(\"g\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x))\n\n g.append(\"g\")\n .call(d3.axisLeft(y))\n .append(\"text\")\n .attr(\"fill\", \"#000\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \"0.71em\")\n .attr(\"text-anchor\", \"end\")\n .text(\"Wins\");\n\n g.selectAll(\".bar\")\n .data(sliced_data)\n .enter()\n .append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function (d) {\n return x(d.key);\n })\n .attr(\"width\", x.bandwidth());\n\n g.selectAll(\"rect\")\n .transition()\n .delay(function (d) {return Math.random()*1000;})\n .duration(500)\n .attr(\"y\", function (d) {\n return y(d.value);\n })\n .attr(\"height\", function (d) {\n return height - y(d.value);\n });\n \n\n svg.selectAll(\".bar\").on('click', function(d, i) {\n d3.select(\"#main-chart\").style(\"display\", \"none\");\n d3.select(\"#misc-stats\").style(\"display\", \"none\");\n d3.select(\"#support-charts\").style(\"display\", \"block\");\n d3.select(\"#player-name\").text(d.key);\n selectedPlayer = d;\n showPlayerPerformanceByYear(d)\n showPlayerAttributes(d)\n populatePlayerListForCompare()\n d3.select(\"#select-other-player\").on(\"change\", comparePlayers); //attach listener\n d3.select(\"#back-btn\").on(\"click\", ()=> { location.reload()} )\n });\n\n}", "title": "" }, { "docid": "2bcd6f1bc026fb08b00657c68c00b443", "score": "0.5720498", "text": "function buildbar(datedisasters,datesent,inputelement)\r\n{\r\n\r\n arr22=datedisasters;\r\n const out = arr22.map((obj) => {\r\n return {\r\n incident_type: obj.incident_type,\r\n state: obj.state,\r\n };\r\n })\r\n if (out.length==0) { \r\n alert('No data available for this date range');\r\n resetdata();\r\n return;\r\n }\r\n console.log(out)\r\n \r\n// create object to store relevant data for plotting\r\n var occurrences1 = {};\r\n\r\n// Object iteration to get count of states in which any incident occured (in given date range), and the total\r\n for (var i = 0, j = out.length; i < j; i++) {\r\n occurrences1[out[i].state] = (occurrences1[out[i].state] || 0) + 1;\r\n }\r\n \r\n list_of_states = (Object.keys(occurrences1))\r\n \r\n//console.log(list_of_states.length)\r\n var all_traces=[]\r\n \r\n for(var i = 0, k = list_of_states.length; i < k; i++) {\r\n state = list_of_states[i]\r\n var newArray = arr22.filter(function (el) {\r\n return el.state ==state\r\n });\r\n \r\n var occurrences = {};\r\n//console.log(newArray)\r\n\r\n// Object iteration to get count of any incident that occured (in given date range), and the total\r\n for (var m = 0, n = newArray.length; m < n; m++) {\r\n occurrences[newArray[m].incident_type] = (occurrences[newArray[m].incident_type] || 0) + 1;\r\n }\r\n//create trace\r\n var trace={\r\n x :Object.keys(occurrences),\r\n y : Object.values(occurrences1),\r\n name:state,\r\n type:'bar', \r\n opacity: 0.6\r\n };\r\n all_traces.push(trace)\r\n }\r\n \r\n//console.log(all_traces)\r\n\r\n//set layout options\r\nvar layout = {\r\n barmode: 'stack',\r\n height: 600,\r\n width: 900,\r\n paper_bgcolor: 'transparent',\r\n plot_bgcolor: 'transparent',\r\n legend: {\r\n bgcolor: 'black'\r\n },\r\n font: {\r\n color: 'white', \r\n size: 12\r\n },\r\n title:'Disasters between '+inputelement+' & '+datesent,\r\n font: {\r\n color: 'white',\r\n },\r\n yaxis: {\r\n title: \"Cumulative number\", \r\n color: 'white',\r\n size: 20,\r\n gridcolor: 'black',\r\n gridwidth: '3px'\r\n },\r\n xaxis: {\r\n title: \"Incidents/Disasters\", \r\n size: 20,\r\n color: 'white',\r\n tickcolor: 'white'\r\n }\r\n };\r\n \r\n//plot the pie chart \r\n \r\n Plotly.newPlot('Visualization', all_traces, layout);\r\n }", "title": "" }, { "docid": "4293f740c9f7773d0848dc54b656b0c4", "score": "0.5713202", "text": "function Barchart(bar_data, year) {\n\n // remove old graph\n var clear_barchart = d3.selectAll(\".g\").remove();\n\n // create list\n bar_data = bar_data[year]\n\n\n var slice = svg2.selectAll(\".slice\")\n .data(bar_data)\n .enter().append(\"g\")\n .attr(\"class\", \"g\")\n .attr(\"transform\",function(d) { \n return \"translate(\" + x_1(d.serie) + \",0)\"; });\n \n svg2.select(\".y\")\n .transition()\n .duration(350)\n .delay(1500)\n .style(\"opacity\",\"1\");\n\n // create and fill single bar chart\n var single_bar = slice.selectAll(\"rect\")\n .data(function(d) { return d.country; })\n .enter().append(\"rect\")\n .attr(\"width\", x_2.rangeBand())\n .attr(\"height\", function(d) { return height - y_1(0); })\n .attr(\"y\", function(d) { return y_1(0); })\n .attr(\"x\", function(d) { return x_2(d.serie); })\n .style(\"fill\", function(d) { return color(d.serie) })\n .on(\"mouseover\", function(d) {\n d3.select(this).style(\"fill\", \"steelblue\") })\n .on(\"mouseout\", function(d) {\n d3.select(this).style(\"fill\", color(d.serie)); });\n\n\n slice.selectAll(\"rect\")\n .transition()\n .attr(\"height\", function(d) { return height - y_1(d.value); })\n .attr(\"y\", function(d) { return y_1(d.value); })\n .duration(1250);\n\n}", "title": "" }, { "docid": "a888e584f3875df1527fc58811c3765d", "score": "0.57062817", "text": "function makeBars(data) {\n\n var countryData = data.data;\n\n // tooltip for barchart\n var tip = d3.tip()\n .attr(\"class\", \"tooltipBarEU\")\n .offset([25, 0])\n .html(function (d, i) {\n return d.percentage\n });\n\n // set margins\n margin = { top: 15, right: 25, bottom: 35, left: 150 },\n width = 400 - margin.left - margin.right,\n height = 300 - margin.top - margin.bottom;\n\n // set svg margins\n svg = d3.select(\"#container-bar\")\n .append(\"class\", \"barchart-EU\")\n .append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n // show tooltip\n svg.call(tip);\n\n // make x scale\n xBar = d3.scale.linear()\n .range([0, width])\n .domain([0, 10]);\n\n // make y scale\n yBar = d3.scale.ordinal()\n .rangeRoundBands([height, 0], .1)\n .domain(countryData.map(function (d) {\n return d.topic;\n }));\n\n // set y axis according to axisScale\n var yAxis = d3.svg.axis()\n .scale(yBar)\n .orient(\"left\");\n\n // set x axis according to xScale\n var xAxis = d3.svg.axis()\n .scale(xBar)\n .orient(\"bottom\")\n .ticks(10);\n\n // create Y axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .call(yAxis);\n\n // create bars\n var bars = svg.selectAll(\".bar\")\n .data(countryData)\n .enter()\n .append(\"g\");\n\n // draw bars\n bars.append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"y\", function (d){\n return yBar(d.topic);\n })\n .attr(\"height\", yBar.rangeBand())\n .attr(\"x\", 0)\n .attr(\"width\", function(d) {\n return xBar(d.percentage);\n })\n .attr(\"fill\", function(d){\n var n = +d.percentage;\n return checkBucket(n);\n })\n .on(\"mouseover\", tip.show)\n .on(\"mouseout\", tip.hide);\n\n // draw X axis\n svg.append(\"g\")\n .attr(\"class\",\"axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n // write title\n svg.append(\"text\")\n .attr(\"id\", \"bar-title\")\n .attr(\"class\", \"title-normal\")\n .attr(\"y\", - 20)\n .attr(\"x\", 50)\n .attr(\"dy\", \"1em\")\n .text(\"Trust in \" + selectedCountry);\n\n // append xAxis title\n svg.append(\"text\")\n .attr(\"y\", 245)\n .attr(\"x\", 168)\n .style(\"font-size\", \"10px\")\n .style(\"font-family\", \"calibri\")\n .style(\"text-anchor\", \"middle\")\n .text(\"grades given on scale 1 - 10\");\n\n // close makeBars\n }", "title": "" }, { "docid": "0ebed1a1da134826f4998198cc9c52bc", "score": "0.57026166", "text": "function barplot(spec,objectin) {\n var object = objectin[0]||objectin;\n spec.mark = \"bar\";\n spec.encoding = {\n x: {field: object.field, type: object.type},\n y: {aggregate: \"count\", field: \"*\"}\n };\n delete spec.config.extraconfig;\n if (object.type===\"quantitative\"){\n spec.encoding.x.bin ={};\n spec.encoding.y.type = object.type;\n }else if(object.primitiveType ===\"string\"){\n spec.encoding.y.type = \"quantitative\";\n }else if (object.type===\"temporal\"){\n spec.encoding.x.bin ={};\n //spec.encoding.x.type = \"ordinal\";\n spec.encoding.x.timeUnit = \"year\";\n spec.encoding.y.type = \"quantitative\";\n }\n if (spec.config&&spec.config.extraconfig) delete spec.config.extraconfig;\n }", "title": "" }, { "docid": "cc1317f1c00737cb493d0e75ec24f243", "score": "0.56953645", "text": "function updateChart(bars, n, colorScale) {\n bars.attr(\"x\", function(d, i){\n return i * (chartInnerWidth / n) + leftPadding;\n })\n .attr(\"height\", function(d, i){\n return 279 - yScale(parseFloat(d[expressed]));\n })\n .attr(\"y\", function(d, i){\n return yScale(parseFloat(d[expressed])) + topBottomPadding;\n })\n .style(\"fill\", function(d){\n return choropleth(d, colorScale);\n })\n\n var chartTitle = d3.select(\".chartTitle\")\n .text(\"Average science scores for \");\n}", "title": "" }, { "docid": "8a608aba67039775fd519a7ca8a72d8d", "score": "0.5691766", "text": "function dispArrBar(c1, c2){\n translate(0, height);\n scale(1, -1);\n strokeWeight(.5);\n rectMode(CORNERS);\n for(var i=0;i<size;++i){\n if(i==c1||i==c2)\n fill(255,0,0);\n else\n fill(255,255,255);\n rect(strokeSize*i, 0, strokeSize*(i+1), arr[i]*(height/size));\n }\n}", "title": "" }, { "docid": "7a55a2aa03ef471b14ad934c77c64def", "score": "0.56861454", "text": "function bacFunc(valueSelect) {\r\n var filterValue = data.samples.filter(value => value.id == valueSelect);\r\n var ouid = filterValue.map(v => v.otu_ids);\r\n ouid = Ouid(ouid[0].slice(0, 10));\r\n var Xaxis = filterValue.map(v => v.sample_values);\r\n Xaxis = Xaxis[0].slice(0, 10);\r\n\r\n var out_label = filterValue.map(v => v.otu_labels);\r\n var names = BacID(out_label[0]).slice(0, 10);\r\n\r\n\r\n // Create the Trace\r\n var trace = {\r\n x: Xaxis,\r\n y: ouid,\r\n text: names,\r\n type: \"bar\",\r\n orientation: \"h\"\r\n };\r\n\r\n //arrange in descending order\r\n var layout = {\r\n yaxis: {\r\n autorange: \"reversed\"\r\n }\r\n };\r\n\r\n // Create the data array for the plot\r\n var bac = [trace];\r\n\r\n // Plot the chart to be placed in the div tag with id \"bar\"\r\n Plotly.newPlot(\"bar\", bac, layout);\r\n}", "title": "" }, { "docid": "ccb1a6c6a9d7d363ef6cc56ca590bbaa", "score": "0.56715775", "text": "function BBANDScharts() {\n var symbol = jsonObj[\"basic info\"][\"symbol\"];\n\n var arrayDate=[];\n var arraySma=[];\n var arrayK=[];\n var arrayUpper = [];\n\n for(num in jsonObj[\"basic info\"][\"arrayDate\"]) {\n arrayDate.push(jsonObj[\"basic info\"][\"arrayDate\"][num]);\n }\n var indicatorName=\"BBANDS\";\n\n for(num in jsonObj[indicatorName][indicatorName][\"Real Middle Band\"]) { //change\n arraySma.push(jsonObj[indicatorName][indicatorName][\"Real Middle Band\"][num]); //change\n }\n arraySma = arraySma.map(Number);\n\n for(num in jsonObj[indicatorName][indicatorName][\"Real Lower Band\"]) { //change\n arrayK.push(jsonObj[indicatorName][indicatorName][\"Real Lower Band\"][num]); //change\n }\n arrayK = arrayK.map(Number);\n\n for(num in jsonObj[indicatorName][indicatorName][\"Real Upper Band\"]) { //change\n arrayUpper.push(jsonObj[indicatorName][indicatorName][\"Real Upper Band\"][num]); //change\n }\n arrayUpper = arrayUpper.map(Number);\n\n var maxSma = Math.max.apply(null,arraySma);\n var minSma = Math.min.apply(null,arraySma);\n\n var maxK = Math.max.apply(null,arrayK);\n var minK = Math.min.apply(null,arrayK);\n\n var maxUpper = Math.max.apply(null,arrayUpper);\n var minUpper = Math.min.apply(null,arrayUpper);\n\n var chartConfig = { //change\n chart: {\n zoomType: 'x',\n borderWidth: 1,\n borderColor: '#D6D6D6',\n marginBottom: 100 //put legend at bottom\n // alignTicks: false\n },\n title: {\n text: \"Bollinger Bands (BBANDS)\" //change\n },\n subtitle: {\n text: '<a href=\"https://www.alphavantage.co/\" >Source: Alpha Vantage </a>',\n useHTML: true\n\n },\n xAxis: [{\n\n categories: arrayDate,\n minTickInterval: 5\n\n }],\n yAxis: [{ // Primary yAxis\n labels: {\n\n style: {\n color: Highcharts.getOptions().colors[1]\n }\n },\n min: minK, //change\n max: maxUpper, //change\n // startOnTick: false,\n // tickInterval: 2,\n title: {\n text: 'BBANDS', // change\n style: {\n color: Highcharts.getOptions().colors[1]\n }\n }\n }],\n\n legend: {\n align: 'center',\n verticalAlign: 'bottom',\n backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'\n },\n series: [{\n name: symbol+\" Real Middle Band\",\n type: 'line',\n color: '#D6391F',\n fillOpacity: 0.6,\n lineWidth: 1,\n marker: {\n radius: 2\n },\n data: arraySma,\n zIndex: 1\n\n }\n ,{\n name: symbol+\" Real Lower Band\",\n type: 'line',\n // color: '#D6391F',\n fillOpacity: 0.6,\n lineWidth: 1,\n marker: {\n radius: 2\n },\n data: arrayK,\n zIndex: 2\n\n }\n\n ,{\n name: symbol+\" Real Upper Band\",\n type: 'line',\n // color: '#D6391F',\n fillOpacity: 0.6,\n lineWidth: 1,\n marker: {\n radius: 2\n },\n data: arrayUpper,\n zIndex: 3\n\n\n }\n\n\n ]\n };\n\n chartConfigObject[\"bbands\"]=chartConfig;\n\n var chart= new Highcharts.chart('bbands-chart',chartConfig);\n}", "title": "" }, { "docid": "cd0560d37b3995c6c7cd8a3bcdd5efba", "score": "0.5669694", "text": "function plotForecastBranchGender(ageGroup, forecastMale, forecastFemale){\n\t// hide warning message and show chart upon select product\n\tdocument.getElementById(\"txtFBranchGenWarning\").style.display = \"none\";\n\tdocument.getElementById(\"FBranchGenChart\").style.display = 'block';\n\t\n\t// set all female data positive value to negative to plot the bar towards left\n\tfor(var i = 0; i < forecastFemale.length; i++){\n\t\tforecastFemale[i] = -Math.abs(forecastFemale[i]);\n\t}\n\t\n\tvar ctx = document.getElementById('FBranchGenChart').getContext(\"2d\");\t\t\t\t\t\n\tvar options = {\n\t\tlayout: {\n\t\t\tpadding: {\n\t\t\t\ttop: 5,\n\t\t\t}\n\t\t},\n\t\tscales:\n\t\t{\n\t\t\tyAxes: [{\n\t\t\t\tdisplay: true,\n\t\t\t\tbarPercentage: 0.4,\n\t\t\t\tticks: {\n\t\t\t\t\tfontSize: 11 // set y-axis label size\n\t\t\t\t},\n\t\t\t\tstacked: true, \n\t\t\t}],\n\t\t\txAxes: [{ \n\t\t\t\tticks: {\n\t\t\t\t\tfontSize: 11,\n\t\t\t\t\t// show positive value on x-axis\n\t\t\t\t\tcallback: function(t, i) {\n\t\t\t\t\t\treturn t < 0 ? Math.abs(t) : t;\n\t\t\t\t\t},\n\t\t\t\t\t// position y-axis to center\n\t\t\t\t\t//min: -2.0\n\t\t\t\t\tstepSize: 1\n\t\t\t\t},\n\t\t\t\tstacked: true, \n\t\t\t}]\n\t\t},\n\t\tresponsive: true,\n\t\tmaintainAspectRatio: false,\n\t\tlegend: {\n\t\t\tdisplay: false,\n\t\t},\n\t\tanimation: {\n\t\t\tanimateScale: true,\n\t\t\tanimateRotate: true\n\t\t},\n\t\ttooltips: {\n\t\t\tcallbacks: {\n\t\t\t\tlabel: function(t, d) {\n\t\t\t\t\t// show positive value on tooltip\n\t\t\t\t\tvar datasetLabel = d.datasets[t.datasetIndex].label;\n\t\t\t\t\tvar xLabel = Math.abs(t.xLabel);\n\t\t\t\t\treturn datasetLabel + ': ' + xLabel + ' person(s)';\n\t\t\t\t}\n\t\t\t}\n\t\t}, \n\t\t};\n\t\t\t\t\t\n\t\tvar opt = {\n\t\t\ttype: \"horizontalBar\",\n\t\t\tdata: { \n\t\t\tlabels: ageGroup, \n\t\t\tdatasets: [{ \n\t\t\t\tlabel: 'Male',\n\t\t\t\tdata: forecastMale, \n\t\t\t\tbackgroundColor: '#fff',\n\t\t\t\tborderColor: '#2196F3',\n\t\t\t\tborderWidth: 1.5,\n\t\t\t\thoverBackgroundColor: '#2196F3'\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: 'Female',\n\t\t\t\tdata: forecastFemale,\n\t\t\t\tbackgroundColor: '#fff',\n\t\t\t\tborderColor: '#E91E63',\n\t\t\t\tborderWidth: 1.5,\n\t\t\t\thoverBackgroundColor: '#E91E63'\n\t\t\t}] \n\t\t\t}, \n\t\t\toptions: options\n\t\t};\n\t\t\t\t\n\t\tif (FBranchGenChart) FBranchGenChart.destroy();\n\t\tFBranchGenChart = new Chart(ctx, opt);\t\t\t\t\t\n\t\tFBranchGenChart.update();\t\n}", "title": "" }, { "docid": "11da9e7bfc62bd1f889437f42ae688b8", "score": "0.56648946", "text": "function ploxAmplitudeBode (plox, N, D, startFreq, endFreq) {\n\t//Find a good clean start frequency\n\tstartFreq=Math.pow(10, Math.floor(log10(startFreq)));\n\n\tif (startFreq > 1){\n\t\tstartFreq = 1;\n\t}\n\n\tplox.data[0].points = [];\n\tvar ymax = 0, ymin = 0;\n\n\n\t// Draw amplitude graph\n\tfor (var f = startFreq; f<endFreq; f *=1.2){\n\t\tvar Nr = 0, Ni = 0, Dr = 0, Di = 0;\n\n\t\tvar sign = 1;\n\t\tfor (var i = 0; i<N.length; i+=2){\n\t\t\tNr += sign*N[i]*Math.pow(2*Math.PI*f, i);\n\t\t\tsign = -sign;\n\t\t}\n\n\t\tsign = 1;\n\t\tfor (var i = 1; i<N.length; i+=2){\n\t\t\tNi += sign*N[i]*Math.pow(2*Math.PI*f, i);\n\t\t\tsign = -sign;\n\t\t}\t\t\n\n\t\tsign = 1;\n\t\tfor (var i = 0; i<D.length; i+=2){\n\t\t\tDr += sign*D[i]*Math.pow(2*Math.PI*f, i);\n\t\t\tsign = -sign;\n\t\t}\t\t\n\n\t\tsign = 1;\n\t\tfor (var i = 1; i<D.length; i+=2){\n\t\t\tDi += sign*D[i]*Math.pow(2*Math.PI*f, i);\n\t\t\tsign = -sign;\n\t\t}\t\t\n\n\t\tvar y = 10*log10(Nr*Nr+Ni*Ni)-10*log10(Dr*Dr+Di*Di);\n\t\tif (y < ymin){\n\t\t\tymin = y;\n\t\t}\n\t\tif (y > ymax){\n\t\t\tymax = y;\n\t\t}\n\n\t\tplox.data[0].points.push({\n\t\t\t'x':log10(f), \n\t\t\t'y':y\n\t\t});\n\t}\n\n\t// Set graph dimensions\n\tplox.xProperties.min = log10(startFreq);\n\tplox.xProperties.max = log10(endFreq);\n\n\tplox.yProperties.min = ymin-5;\n\tplox.yProperties.max = ymax+5;\n\n\n\t// Draw grid\n\tplox.yGrid = [];\n\tfor (var g = 0.1, gain = 20; g > 0.0001; g /= 10, gain +=20){\n\t\tplox.yGrid.push({\n\t\t\t'label':'-'+gain+'dB',\n\t\t\t'y':20*log10(g)\n\t\t});\n\t}\n\n\tplox.xGrid = [];\n\tfor (var f = startFreq; f<endFreq; f *=10){\n\t\tfor (var ff = f; ff<f*10; ff+=f){\n\t\t\tplox.xGrid.push({\n\t\t\t\t'label':(ff==f)?unitStringfromFloat(f):'',\n\t\t\t\t'x':log10(ff)\n\t\t\t});\n\t\t}\n\t}\n}", "title": "" }, { "docid": "76dce17a9160dcfa93d78857a5e5f3e1", "score": "0.5664484", "text": "function updateChart(bars, n, colorScale){\n //position bars\n bars.attr(\"x\", function(d, i){\n return i * (chartInnerWidth / n) + leftPadding;\n })\n //size/resize bars\n .attr(\"height\", function(d, i){\n return 463 - yScale(parseFloat(d[expressed]));\n })\n .attr(\"y\", function(d, i){\n return yScale(parseFloat(d[expressed])) + topBottomPadding;\n })\n //color/recolor bars\n .style(\"fill\", function(d){\n return choropleth(d, colorScale);\n });\n \n //add text to chart title\n var chartTitle = d3.select(\".chartTitle\")\n .text(\"Number of Variable \" + expressed[3] + \" in each region\");\n}", "title": "" }, { "docid": "cee616ebfed76cbb47405c96de018ed9", "score": "0.5661605", "text": "function showBar(backwards = false) {\r\n console.log(\"show bar\");\r\n if (backwards) {\r\n d3.selectAll(\".Area-layer\").call(hide);\r\n d3.selectAll(\".Bar-layer\").call(show);\r\n } else {\r\n d3.selectAll(\".map.inner-layer\").call(hide);\r\n d3.selectAll(\".Bar-layer\").call(show);\r\n }\r\n showAxis(xAxisBar);\r\n }", "title": "" }, { "docid": "8f165ef803b045112fab74366ad87f93", "score": "0.56600255", "text": "function barPosition(bar) {\n bar.attr(\"x\", function(d, i) {\n return xScale(i);\n });\n bar.attr(\"width\", function(d, i) {\n return xScale(i + 1) - xScale(i);\n })\n }", "title": "" }, { "docid": "8f165ef803b045112fab74366ad87f93", "score": "0.56600255", "text": "function barPosition(bar) {\n bar.attr(\"x\", function(d, i) {\n return xScale(i);\n });\n bar.attr(\"width\", function(d, i) {\n return xScale(i + 1) - xScale(i);\n })\n }", "title": "" }, { "docid": "836464efce91c7c3466ea664812de97a", "score": "0.56600076", "text": "function barChart(data) {\n var div = d3.select(\"body\").append(\"div\").attr(\"class\", \"toolTip\");\n\n var axisMargin = 20,\n margin = 40,\n valueMargin = 4,\n width = parseInt(d3.select('body').style('width'), 10),\n height = parseInt(d3.select('body').style('height'), 10),\n barHeight = (height - axisMargin - margin * 2) * 0.4 / data.length,\n barPadding = (height - axisMargin - margin * 2) * 0.6 / data.length,\n labelWidth = 0;\n\n var max = d3.max(data, function (d) {\n return d.value;\n });\n\n var colors = ['#7E57C2', '#3F51B5', '#039BE5', '#009688', '#43A047', '#827717'];\n var colorScale = d3.scale.quantize()\n .domain([0, data.length])\n .range(colors);\n\n var svg = d3.select('body')\n .append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n var bar = svg.selectAll(\"g\")\n .data(data)\n .enter()\n .append(\"g\")\n .style('fill', function (d, i) {\n return colorScale(i);\n });\n\n bar.attr(\"class\", \"bar\")\n .attr(\"cx\", 0)\n .attr(\"transform\", function (d, i) {\n return \"translate(\" + margin + \",\" + (i * (barHeight + barPadding) + barPadding) + \")\";\n });\n\n bar.append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"y\", barHeight / 2)\n .attr(\"dy\", \".35em\")\n .text(function (d) {\n return d.label;\n }).each(function () {\n labelWidth = Math.ceil(Math.max(labelWidth, this.getBBox().width));\n });\n\n var scale = d3.scale.linear()\n .domain([0, max])\n .range([0, width - margin * 2 - labelWidth]);\n\n var xAxis = d3.svg.axis()\n .scale(scale)\n .tickSize(-height + 2 * margin + axisMargin)\n .orient(\"bottom\");\n\n bar.append(\"rect\")\n .attr(\"transform\", \"translate(\" + labelWidth + \", 0)\")\n .attr(\"height\", barHeight)\n .attr(\"width\", function (d) {\n return scale(d.value);\n });\n\n bar.append(\"text\")\n .attr(\"class\", \"value\")\n .attr(\"y\", barHeight / 2)\n .attr(\"dx\", -valueMargin + labelWidth)\n .attr(\"dy\", \".35em\")\n .attr(\"text-anchor\", \"end\")\n .text(function (d) {\n return d.value;\n })\n .attr(\"x\", function (d) {\n var width = this.getBBox().width;\n return Math.max(width + valueMargin, scale(d.value));\n });\n\n bar.on(\"mousemove\", function (d) {\n div.style(\"left\", d3.event.pageX + 10 + \"px\");\n div.style(\"top\", d3.event.pageY - 25 + \"px\");\n div.style(\"display\", \"inline-block\");\n div.html((d.label) + \"<br>\" + d.value);\n });\n\n bar.on(\"mouseout\", function () {\n div.style(\"display\", \"none\");\n });\n\n svg.insert(\"g\", \":first-child\")\n .attr(\"class\", \"axisHorizontal\")\n .attr(\"transform\", \"translate(\" + (margin + labelWidth) + \",\" + (height - axisMargin - margin) + \")\")\n .call(xAxis);\n }", "title": "" }, { "docid": "78e1d3eb437f6466769a1e31d31880c0", "score": "0.5654976", "text": "function createBarGraph(data, total, id) {\n const container = document.getElementById(id);\n\n const barsDiv = document.createElement(\"div\");\n barsDiv.style.width = \"400px\";\n barsDiv.style.height = \"400px\";\n barsDiv.style.borderLeft = \"1px solid #515ada\";\n barsDiv.style.borderBottom = \"1px solid #515ada\";\n barsDiv.style.display = \"flex\";\n barsDiv.style.flexDirection = \"row\";\n barsDiv.style.alignItems = \"flex-end\";\n// barsDiv.style.backgroundColor = \"#3c3c3c\";\n\n const labelsDiv = document.createElement(\"div\");\n labelsDiv.style.width = \"400px\";\n labelsDiv.style.display = \"flex\";\n labelsDiv.style.flexDirection = \"row\";\n labelsDiv.style.alignItems = \"flex-end\";\n\n Object.keys(data).forEach(key => {\n console.log(key, data[key]);\n const el = document.createElement(\"div\");\n el.style.width = `100px`;\n el.style.height = `${(data[key] / total) * 400}px`;\n el.style.border = \"1px solid #515ada\";\n el.style.marginLeft = \"20px\";\n el.style.borderTopLeftRadius = \"25px\";\n el.style.borderTopRightRadius = \"25px\";\n // text\n el.style.fontSize = \"16px\";\n el.style.textAlign = \"center\";\n el.innerText = `${data[key]}`;\n el.style.paddingBottom = \"20px\";\n // colors\n el.style.background = \"linear-gradient(135deg, #efd5ff 0%, #515ada 100%)\";\n // append to graph\n barsDiv.appendChild(el);\n\n // labels\n const el_label = document.createElement(\"div\");\n el_label.style.width = `100px`;\n el_label.style.height = \"20px\";\n el_label.style.marginLeft = \"20px\";\n el_label.style.marginTop = \"10px\";\n el_label.style.textAlign = \"center\";\n el_label.style.fontSize = \"16px\";\n el_label.style.fontWeight = \"bold\";\n el_label.innerText = key;\n labelsDiv.appendChild(el_label);\n });\n\n container.appendChild(barsDiv);\n container.appendChild(labelsDiv);\n}", "title": "" }, { "docid": "560d97aa639275f9870a530ad545a1f2", "score": "0.5649542", "text": "function getWeekChart () {\r\n\r\n addActive(\"W\");\r\n\r\n let weekChart = new Chart(myChart, {\r\n type: 'bar',\r\n data: {\r\n labels:[j-4, j- 3, j-2, j-1, j],\r\n datasets:[{\r\n label: 'Errands',\r\n data: [\r\n weekArray[j-5].length,\r\n weekArray[j-4].length,\r\n weekArray[j-3].length,\r\n weekArray[j-2].length,\r\n weekArray[j-1].length,\r\n ],\r\n backgroundColor: color,\r\n }]\r\n },\r\n options:{\r\n maintainAspectRatio: false,\r\n legend: {\r\n display: false,\r\n },\r\n events: [],\r\n scales: {\r\n yAxes: [{\r\n ticks: {\r\n min: 0,\r\n }\r\n }]\r\n }\r\n }\r\n });\r\n\r\n document.getElementById(\"sum\").innerHTML = (weekArray[j-1].length + weekArray[j-2].length + weekArray[j-3].length + weekArray[j-4].length + weekArray[j-5].length);\r\n }", "title": "" }, { "docid": "2b66b275a1d684a98c8d84cb0ca852eb", "score": "0.5647378", "text": "function barChart(forward)\r\n{ \t\t\r\n // Set the domains of axes.\r\n x.domain(cur.map(function(d) { return d.date; }));\r\n y.domain([0, d3.max(cur, selectBars)]);\r\n\r\n // Set transition time.\r\n t0 = svg.transition().duration(750);\r\n t1 = svg.transition().duration(duration/2);\r\n t2 = svg.transition().duration(duration/2);\r\n\r\n // Add animations to bars and axes.\r\n t2.selectAll(\".bar\")\r\n .attr(\"y\", function(d) { return peight; })\r\n .attr(\"height\", function(d) { return 0; });\r\n\r\n t0.selectAll(\"#axisX\").call(xAxis);\r\n t1.selectAll(\".barCurrent\")\r\n .delay(function(d, i) { \r\n // The delay time presents the visual effects of a cascade animation.\r\n var order = i * 30;\r\n if(forward == 1)\r\n return order;\r\n if(pre.length > cur.length)\r\n {\r\n order = (cur.length - i) * 30;\r\n }\r\n return order; \r\n })\r\n .attr(\"x\", function(d) { return x(d.date); })\r\n .attr(\"width\", x.rangeBand());\r\n t0.selectAll(\"#axisY\").call(yAxis);\r\n t1.selectAll(\".barCurrent\")\r\n .delay(function(d, i) { \r\n var order = i * 30;\r\n if(forward == 1)\r\n return order;\r\n if(pre.length > cur.length)\r\n {\r\n order = (cur.length - i) * 30;\r\n }\r\n return order;\r\n })\r\n .attr(\"y\", selectBarsY)\r\n .attr(\"height\", selectBarsPY);\t\t\t\t \r\n}", "title": "" }, { "docid": "ccdcbc9d1d87d24d5431b32d185331fd", "score": "0.5639794", "text": "createBarChart() { \n var t = d3.transition()\n .duration(750);\n\n var svg = d3.select(\"#svg1\");\n svg.selectAll(\".bar\").remove();\n svg.selectAll(\".domain\").remove();\n\n\n\n \n var svgWidth = +svg.attr('width');\n var svgHeight = +svg.attr('height');\n\n\n // Compute chart dimensions\n var chartWidth = svgWidth - padding.l - padding.r;\n var chartHeight = svgHeight - padding.t - padding.b;\n\n // Compute the spacing for bar bands based on all 26 letters\n var barBand = chartHeight / 26;\n var barHeight = barBand * 0.7;\n \n \n\n var y = d3.scaleLinear()\n .rangeRound([0, chartHeight])\n .domain([0,1]);\n\n var z = d3.scaleOrdinal()\n .range([\"#98abc5\",\"#ff8c00\"]);\n\n var keys= [\"Real HDI\", \"Predicted HDI\"]\n\n // Make the y axis......\n var yScale = d3.scaleLinear()\n .domain([0, 1])\n .range([chartHeight - 10, 10]);\n \n var yAxis = d3.axisLeft(yScale); \n\n chartG.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(20,0)\")\n //.attr(\"y\", 30)\n .call(yAxis)\n //.call(d3.axisLeft(y).ticks(8))\n \n chartG.append(\"text\")\n .attr(\"x\", 2)\n .attr(\"y\", 10)\n .attr(\"dy\", \"0.32em\")\n .attr(\"fill\", \"#000\")\n .attr(\"font-weight\", \"bold\")\n .attr(\"text-anchor\", \"start\");\n\n // Makes the legends......\n var legend = chartG.append(\"g\")\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", 10)\n .attr(\"text-anchor\", \"end\")\n .selectAll(\"g\")\n .data(keys.slice().reverse())\n .enter().append(\"g\")\n .attr(\"transform\", function(d, i) { return \"translate(10,\" + i * 20 + \")\"; });\n\n legend.append(\"rect\")\n .attr(\"x\", chartWidth - 90)\n .attr(\"width\", 19)\n .attr(\"height\", 19)\n .attr(\"fill\", z);\n\n legend.append(\"text\")\n .attr(\"x\", chartWidth - 95)\n .attr(\"y\", 9.5)\n .attr(\"dy\", \"0.32em\")\n .text(function(d) { return d; });\n\n updateChart(data_1);\n\n\n function updateChart(data_1){\n\n var bars= chartG.selectAll('.bar')\n .data(data_1, function(d){\n return d.city;\n });\n \n // bars.attr(\"class\", \"exit\")\n // .transition(t)\n // .attr(\"y\", 60)\n // .style(\"fill-opacity\", 1e-6)\n\n // bars.attr(\"class\", \"update\")\n // .attr(\"y\", 0)\n // .style(\"fill-opacity\", 1)\n // .transition(t)\n // .attr(\"x\", function(d, i) { return i * 32; });\n \n var barsEnter= bars.enter()\n .append('g')\n .attr('class', 'bar');\n\n bars.merge(barsEnter)\n .attr('transform', function(d,i){\n return 'translate('+[(i*6 * barBand + 40), (chartHeight- y(d.real_hdi))]+')';\n });\n\n\n barsEnter.append('rect')\n .transition(t)\n .attr('width', barHeight+10)\n .attr('height', function(d){\n return y(d.real_hdi)\n })\n .style(\"fill\", z );\n\n barsEnter.append('rect')\n .transition(t) \n .attr('x', barHeight+10)\n .attr('y', function(d){\n return (y(d.real_hdi)-y(d.predicted_hdi));\n })\n .attr('width', barHeight+10)\n .attr('height', function(d){\n return y(d.predicted_hdi)\n })\n .style(\"fill\", z(1) );\n\n\n barsEnter.append('text')\n .attr('x', barHeight+15)\n .attr('y', function(d){\n if (d.real_hdi < d.predicted_hdi){\n console.log(\"in Here\");\n return (y(d.real_hdi)- y(d.predicted_hdi)-10);\n }\n else{\n console.log(\"Not\");\n return -10\n }\n })\n .attr(\"transform\", \"rotate(-45)\")\n .text(function(d){\n return d.city;\n });\n\n bars.exit().remove(); \n };\n\n }", "title": "" }, { "docid": "7fc590bf8d9556cb7d32f959686f15bc", "score": "0.5638903", "text": "function createbar(d) {\n // const maxwidth = 300;\n // const widthPerPercent = maxwidth / 100;\n if (d.value == null) { return document.createElement(\"div\") };\n function perccheck(value, ranges, rangee) {\n let singleperc = (rangee - ranges) / 100;\n return (value - ranges) / singleperc;\n }\n let gbar = d3.select(document.createElement(\"div\"));\n gbar.attr(\"class\", \"gbar\");\n let namefield = gbar.append(\"div\");\n namefield.attr(\"class\", \"namef\");\n namefield.style(\"width\", \"30%\");\n var unit='';\n\n\n if (d.name == 'Weight') {unit = ' lbs'}\n if (d.name == 'Height') {unit = ' in '}\n if (d.name == 'Vertical') {unit = ' in '}\n if (d.name == 'Forty') {unit = ' sec '}\n\n\n namefield.text(d.name);\n \n \n let mbar = gbar.append(\"div\");\n // let mainbar = d3.select(mbar).attr(\"class\", \"mbar\");\n mbar.attr(\"class\", \"mbar\");\n mbar.style(\"width\", \"70%\");\n mbar.attr(\"data-toggle\", \"tooltip\");\n mbar.attr(\"data-html\", \"true\");\n // mbar.attr(\"data-placement\", \"top\");\n // $(mbar.node()).tooltip({ container: chart.node() });\n if (getPlayersData) {\n function showmodal() {\n drawloader(\"#players\");\n $(\"#chartmodal\").modal(\"show\");\n getPlayersData({\n position: position,\n attribute: d.field\n }, function (response) {\n drawTable(mapPlayersForTable(response), \"#players\")\n });\n }\n $(mbar.node()).on(\"click\", showmodal);\n }\n let barEnter = mbar.append(\"div\");\n\n barEnter.style(\"width\", perccheck(d.value, d.range[0], d.range[1]) + \"%\");\n let props = {};\n props.color = \"green\";\n if (d.value < d.ftick && d.value < d.stick) {\n barEnter.style(\"background-color\", \"orange\");\n props.color = \"orange\";\n }\n if (d.ftick == null && d.value < d.stick) {\n barEnter.style(\"background-color\", \"orange\");\n props.color = \"orange\";\n }\n if (d.value < d.ftick && d.stick == null) {\n barEnter.style(\"background-color\", \"orange\");\n props.color = \"orange\";\n }\n mbar.attr(\"title\", getTooltip(d.field, props));\n $(mbar.node()).tooltip({ container: chart.node() });\n // barEnter.text(function () { return d.perc + \"%\"; });\n barEnter.attr(\"class\", \"perc\");\n if (d.value == null) { gbar.style(\"display\", \"none\"); }\n let ftick = mbar.append(\"div\");\n ftick.attr(\"class\", \"tick red\");\n\n ftick.style(\"left\", function () {\n return perccheck(d.ftick, d.range[0], d.range[1]) + \"%\";\n });\n if (d.ftick == null) { ftick.style(\"display\", \"none\"); }\n let stick = mbar.append(\"div\");\n stick.attr(\"class\", \"tick\");\n\n stick.style(\"left\", function () {\n return perccheck(d.stick, d.range[0], d.range[1]) + \"%\";\n });\n if (d.stick == null) { stick.style(\"display\", \"none\"); }\n function displayvalue(value, style, fractiondigits) {\n let fractiondigitsval = 1;\n if (d.fractiondigits != null) {\n fractiondigitsval = d.fractiondigits;\n }\n if (d.style == \"percent\") {\n return (d.value / 100).toLocaleString(undefined, {\n style: \"percent\",\n useGrouping: false,\n maximumFractionDigits: fractiondigitsval,\n minimumFractionDigits: fractiondigitsval\n })+ unit;\n } else {\n return d.value.toLocaleString(undefined, {\n useGrouping: false,\n maximumFractionDigits: fractiondigitsval,\n minimumFractionDigits: fractiondigitsval\n }) + unit;\n }\n }\n // const percentText = (d.value / 100).toLocaleString(undefined, {\n // style: \"percent\",\n // minimumFractionDigits: 1\n // });\n mbar\n .append(\"div\")\n .text(displayvalue(d.value, d.style))\n .attr(\"class\", \"val\");\n\n return gbar.node();\n }", "title": "" }, { "docid": "090da1157a5bb4c7e5a1a140000995c3", "score": "0.56283027", "text": "function drawBars(animPc){\n\t\t\tctx.lineWidth = config.barStrokeWidth;\n\t\t\t//i is looping through the datasets ...\n\t\t\tfor (var i=0; i<data.datasets.length; i++){\n\t\t\t\t\tctx.strokeStyle = data.datasets[i].strokeColor;\n\t\t\t\t//... wheras j is looping through the individual data points\n\t\t\t\tfor (var j=0; j<data.datasets[i].data.length; j++){\n\t\t\t\t\tctx.save();\n\t\t\t\t\t\n\t\t\t\t\tctx.fillStyle = getFillColor(data.datasets[i].fillColor, j, data.datasets[i].data[j], animPc);\n\t\t\t\t\t\n\t\t\t\t\tvar barOffset = yAxisPosX + config.barValueSpacing + valueHop*j + barWidth*i + config.barDatasetSpacing*i + config.barStrokeWidth*i;\n\t\t\t\t\tvar barTop = xAxisPosY - animPc * calculateOffset(data.datasets[i].data[j], calculatedScale, scaleHop) + (config.barStrokeWidth / 2);\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t//bottom left corner\n\t\t\t\t\tctx.moveTo(barOffset, xAxisPosY);\n\t\t\t\t\t//top left corner\n\t\t\t\t\tctx.lineTo(barOffset, barTop);\n\t\t\t\t\t//top right corner\n\t\t\t\t\tctx.lineTo(barOffset + barWidth, barTop);\n\t\t\t\t\t//bottom right corner\n\t\t\t\t\tctx.lineTo(barOffset + barWidth, xAxisPosY);\n\t\t\t\t\tif(config.barShowStroke){\n\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t}\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\tctx.fill();\n\t\t\t\t\tctx.restore();\n\t\t\t\t\tif (config.barShowLabels) {\n\t\t\t\t\t\tctx.save();\n\t\t\t\t\t\tctx.textAlign = \"center\";\n\t\t\t\t\t\tctx.font = config.barLabelFontStyle + \" \" + config.barLabelFontSize + \"px \" + config.barLabelFontFamily;\n\t\t\t\t\t\tvar label = config.barLabelFormatter(data.datasets[i].data[j]);\n\t\t\t\t\t\tctx.textBaseline = \"bottom\";\n\t\t\t\t\t\tctx.fillStyle = config.barLabelFontColor;\n\t\t\t\t\t\tctx.fillText(label, barOffset + barWidth / 2, barTop - 4);\n\t\t\t\t\t\tctx.restore();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//check the previous pull request for any other changes?\n\t\t\t\t\t//update documentation\n\t\t\t\t\tif ( data.datasets[i].error && config.errorDir != \"none\"){\n\t\t\t\t\t\t//draw upper error bar\n\t\t\t\t\t\tif ( config.errorDir != \"down\") {\t\t\n\t\t\t\t\t\t\tctx.strokeStyle = config.errorStrokeWidth;\n\t\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t\t\tctx.moveTo(barOffset + barWidth/2, xAxisPosY - animPc*calculateOffset(data.datasets[i].data[j],calculatedScale,scaleHop)+(config.barStrokeWidth/2));\n\t\t\t\t\t\t\tctx.lineTo(barOffset + barWidth/2, xAxisPosY - animPc*calculateOffset(data.datasets[i].data[j] + data.datasets[i].error[j],calculatedScale,scaleHop)+(config.barStrokeWidth/2))\n\t\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t\t\tvar cap = (config.errorCapWidth * barWidth) || 1;\n\t\t\t\t\t\t\tcapOffset = (barWidth - cap)/2;\n\t\t\t\t\t\t\tctx.moveTo(barOffset + capOffset, xAxisPosY - animPc*calculateOffset(data.datasets[i].data[j] + data.datasets[i].error[j],calculatedScale,scaleHop)+(config.barStrokeWidth/2));\n\t\t\t\t\t\t\tctx.lineTo(barOffset + barWidth - capOffset, xAxisPosY - animPc*calculateOffset(data.datasets[i].data[j] + data.datasets[i].error[j],calculatedScale,scaleHop)+(config.barStrokeWidth/2));\n\t\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//draw lower error bar\n\t\t\t\t\t\tif (config.errorDir != \"up\") {\t\t\t\t\t\t\n\t\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t\t\tctx.moveTo(barOffset + barWidth/2, xAxisPosY - animPc*calculateOffset(data.datasets[i].data[j],calculatedScale,scaleHop)+(config.barStrokeWidth/2));\n\t\t\t\t\t\t\tctx.lineTo(barOffset + barWidth/2, xAxisPosY - animPc*calculateOffset(data.datasets[i].data[j] - data.datasets[i].error[j],calculatedScale,scaleHop)+(config.barStrokeWidth/2))\n\t\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t\t\tvar cap = (config.errorCapWidth * barWidth) || 1;\n\t\t\t\t\t\t\tcapOffset = (barWidth - cap)/2;\n\t\t\t\t\t\t\tctx.moveTo(barOffset + capOffset, xAxisPosY - animPc*calculateOffset(data.datasets[i].data[j] - data.datasets[i].error[j],calculatedScale,scaleHop)+(config.barStrokeWidth/2));\n\t\t\t\t\t\t\tctx.lineTo(barOffset + barWidth - capOffset, xAxisPosY - animPc*calculateOffset(data.datasets[i].data[j] - data.datasets[i].error[j],calculatedScale,scaleHop)+(config.barStrokeWidth/2));\n\t\t\t\t\t\t\tctx.stroke();\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}", "title": "" }, { "docid": "3ee4b6e3e12e5e0aaab18a909dfe1b05", "score": "0.5625095", "text": "function bar_chart(attribute_first, correlation_first, attribute_second, correlation_second, graph_name) {\n $(\"#results_div\").hide();\n // cleanin svg field\n $(\"#svg\").empty();\n\n // setting svg boundaries\n var svg = d3.select(\"svg\"),\n margin = {top: 10, right: 10, bottom: 10, left: 10},\n width = +document.getElementById('dashboard').offsetWidth - 100,\n height = +document.getElementById('dashboard').offsetWidth - 100;\n\n g = svg.append(\"g\").attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n// creating scale for x axis - scale with oridnal values\n var x = d3.scaleOrdinal()\n .domain([\"\", attribute_first, attribute_second])\n .range([0, width / 3, (width / 3) * 2, width]);\n\n // creating scale for y axis - scake with linear values from 0 to 1\n var y = d3.scaleLinear()\n .domain([-1, 1])\n .range([height, 0]);\n\n var startPosition = 0;\n var endPosition = 0;\n\n if (correlation_first > 0) {\n startPosition = height / 2 - correlation_first - (height / 2) * correlation_first;\n }\n else {\n startPosition = height / 2 - correlation_first;\n }\n endPosition = (height / 2) * Math.abs(correlation_first);\n\n // creating rectangle for first attribute\n g.append(\"rect\")\n .attr(\"x\", 30)\n .attr(\"y\", startPosition)\n .attr(\"fill\", \"blue\")\n .attr(\"width\", width / 3)\n .attr(\"height\", endPosition);\n\n if (correlation_second > 0) {\n startPosition = height / 2 - correlation_second - (height / 2) * correlation_second;\n }\n else {\n startPosition = height / 2 - correlation_second;\n }\n endPosition = (height / 2) * Math.abs(correlation_second);\n\n // creating rectangle for second attribute\n g.append(\"rect\")\n .attr(\"x\", width - width / 3 - 30)\n .attr(\"y\", startPosition)\n .attr(\"fill\", \"red\")\n .attr(\"width\", width / 3)\n .attr(\"height\", endPosition);\n\n // adding x axis to svg graph\n g.append(\"g\")\n .attr(\"class\", \"axis axis--x\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(d3.axisBottom(x));\n\n // adding y axis to svg graph\n g.append(\"g\")\n .attr(\"class\", \"axis axis--y\")\n .attr(\"transform\", \"translate(\" + width + \",0)\")\n .call(d3.axisRight(y));\n\n // adding text on the top of the chart\n svg.append(\"text\")\n .attr(\"x\", (width / 2))\n .attr(\"y\", 15)\n .attr(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"16px\")\n .text(graph_name);\n}", "title": "" }, { "docid": "ef00a9982f5a1f6e4a7e20f458a6f4ec", "score": "0.56229794", "text": "function printBarChart(presentData,absentData,monthName){\r\n \t\tconsole.log(\"data received for monthly graph present: \"+presentData+\" absentdata: \"+absentData+\" mon name: \"+monthName);\r\n \t\t$(barChartDiv_id).show();\r\n \t\t$(\"#barLegend\").show();\r\n \t\tvar barChartData = {\r\n \t\t\t\tlabels : [monthName],\r\n \t\t\t\tdatasets :[\t{\r\n \t\t\t\t\t\tlabel:\"Working Hours\",\r\n \t\t\t\t\t\tfillColor : \"#0085b3\",\r\n \t\t\t\t\t\tstrokeColor : \"#002633\",\r\n \t\t\t\t\t\thighlightFill: \"#4dd1ff\",\r\n \t\t\t\t\t\thighlightStroke: \"#005f80\",\r\n \t\t\t\t\t\tdata:presentData\r\n \t\t\t\t\t},\r\n \t\t\t\t\t{ label:\"Non working Hours\",\r\n \t\t\t\t\t\tfillColor : \"#b30000\",\r\n \t\t\t\t\t\tstrokeColor : \"#800000\",\r\n \t\t\t\t\t\thighlightFill : \"#cc0000\",\r\n \t\t\t\t\t\thighlightStroke : \"#330000\",\r\n \t\t\t\t\t\tdata : absentData\r\n \t\t\t\t\t}\r\n \t\t\t\t]\r\n\r\n \t\t\t};\r\n \t\t\r\n \t\tif(window.myBar!=null){\r\n \t\t\t console.log(\"destroying bar graph\");\r\n\t\t \t window.myBar.destroy();\r\n\t\t}\r\n \t\tvar ctx = document.getElementById(\"barChartMonthly\").getContext(\"2d\");\r\n \t\twindow.myBar = new Chart(ctx).Bar(barChartData, {\r\n \t\t\tresponsive : true\r\n \t\t});\r\n \t\t\r\n \t\t//document.getElementById('barLegend').innerHTML = myBar.generateLegend();\r\n \t\t//$scope.legend = Bar.generateLegend();\r\n \t\t//$(\"#barLegend\").html( myBar.generateLegend());\r\n \t\t\r\n \t\t$(\"#bar-holder\").show();\r\n \t\t$(\"#barLegend\").show();\r\n\r\n\t\t}", "title": "" }, { "docid": "837461ac57f1609abe10829f57de54f2", "score": "0.5620126", "text": "function init() {\n \n \n // Bar Plot trace\n var trace1 = [{\n x: top_10_values[0],\n y: string_otu_ids[0],\n hovertext: top_10_otu_labels[0],\n type: \"bar\",\n orientation: \"h\",\n ids: string_otu_ids[0],\n marker: { color: `rgb(78, 116, 125)` }\n }];\n\n // Bar Plot layout\n var layout1 = {\n title: \"Top 10 OTUs Found in Test Subject\",\n xaxis: {\n title: \"Sample Values\"\n },\n yaxis: {\n // title: \"OTU IDs\",\n type: \"category\"\n }, \n font: { family: 'Times' }\n };\n\n // Bubble Plot trace\n var trace2 = [{\n x: otu_ids[0],\n y: values[0],\n hovertext: otu_labels[0],\n mode: 'markers',\n marker: {\n color: otu_ids[0],\n size: values[0]\n }\n }];\n \n // Bubble plot layout\n var layout2 = {\n title: \"Number of OTUs per Sample\",\n showlegend: false,\n // height: 600,\n // width: 1200,\n xaxis: {\n title: \"OTU ID\"\n },\n yaxis: {\n title: \"Sample Values\",\n //type: \"category\"\n },\n font: { family: 'Times'}\n };\n \n // Indicator Plot trace\n var trace3 = [\n {\n domain: { x: [0, 1], y: [0, 1] },\n value: wfreq[0],\n title: \"Mouse Age<br><span style='font-size:0.8em;color:gray'>Months\", // { text: \"Washing Frequency\" },\n type: \"indicator\",\n mode: \"gauge+number\",\n // delta: { reference: 3 },\n gauge: {\n bar: { color: '#518290' }, // 'rgb(239, 203, 104)', '#518290'\n axis: { range: [0, 9] },\n steps: [\n { range: [0, 1], color: '#F2F7F8'},\n { range: [1, 2], color: '#E5EEF0'},\n { range: [2, 3], color: '#D8E6E9'},\n { range: [3, 4], color: '#CBDDE2'},\n { range: [4, 5], color: '#BED5DA'},\n { range: [5, 6], color: '#B1CCD3'},\n { range: [6, 7], color: '#9BBEC7'},\n { range: [7, 8], color: '#89B3BD'},\n { range: [8, 9], color: '#7CAAB6'}\n \n ],\n threshold: {\n line: { color: \"#33535B\" , width: 4 }, //'rgb(239, 203, 104)', \"#33535B\"\n thickness: 0.75,\n value: wfreq[0]\n }\n }\n }\n ];\n \n // Indicator Layout\n var layout3 = { margin: { t: 100, b: 100 }, font: { family: 'Times' } };\n // var layout3 = { width: 500, height: 300, margin: { t: 0, b: 0 } };\n\n var config = { responsive: true };\n \n // Define where the plots will live\n var bar_plot = d3.selectAll(\"#bar-plot\").node();\n var bubble_plot = d3.selectAll(\"#bubble-plot\").node();\n var indicator_plot = d3.selectAll(\"#indicator-plot\").node();\n\n // Plot the plots\n Plotly.newPlot(bar_plot, trace1, layout1, config);\n Plotly.newPlot(bubble_plot, trace2, layout2, config);\n Plotly.newPlot(indicator_plot, trace3, layout3, config);\n \n }", "title": "" }, { "docid": "caea4cf3574ece4bb030d21284a7aadd", "score": "0.5618965", "text": "function drawBarUpdate(ob){\n var width = ob.width;\n d3.select(\".bar-rect-\"+ob.k).selectAll(\"rect\").data(data.genomicProfileList[ob.k].mutationList)\n .attr({\n width:width-5,\n x:function(d,i){ return i*(width)},\n });\n\n d3.select(\".bar-text-\"+ob.k).selectAll(\"text\").data(data.genomicProfileList[ob.k].mutationList).text(function(d){\n if (ob.val == \"geneSymbol\") {\n return d.geneSymbol;\n } else if (ob.val == \"strand\") {\n return d.strand;\n } else {\n return d.chromosome.substring(3,5);\n }\n })\n .attr({\n \"font-size\":\"10px\",\n x:function(d,i){ return i*(width)+ob.offset},\n })\n .on(\"click\",function(d,i){\n d3.select(\".bar-rect-\"+ob.k).select(\"rect:nth-child(\"+(i+1)+\")\").style(\"fill\",\"red\");\n var obAnalyticDet = {\n entrezGeneId: d.entrezGeneId,\n geneSymbol: d.geneSymbol,\n referenceGenome: d.referenceGenome,\n chromosome: d.chromosome,\n dnaStartPosition: d.dnaStartPosition,\n dnaEndPosition: d.dnaEndPosition,\n strand: d.strand,\n variantClassification: d.variantClassification,\n referenceAllele: d.referenceAllele,\n variantAllele: d.variantAllele,\n alternativeAlleleReads: d.alternativeAlleleReads,\n referenceAlleleReads: d.referenceAlleleReads,\n dbSnpRsId: d.dbSnpRsId,\n dbSnpRsValStatus: d.dbSnpRsValStatus,\n annotationTranscript: d.annotationTranscript,\n transcriptStrand: d.transcriptStrand,\n cDnaChange: d.cDnaChange,\n codonChange: d.codonChange,\n aaChange: d.aaChange,\n otherTranscript: d.otherTranscript,\n refseqMrnaId: d.refseqMrnaId,\n refseqProtId: d.refseqProtId,\n swissprotAccession: d.swissprotAccession,\n swissprotEntry: d.swissprotEntry,\n uniprotAaPosition: d.uniprotAaPosition,\n uniprotRegion: d.uniprotRegion,\n uniprotSite: d.uniprotSite,\n vertebrateAaAlignment: d.vertebrateAaAlignment\n }\n analyticDetails(obAnalyticDet);\n });\n}", "title": "" }, { "docid": "552a07fe74344b163fa1a9de909dd524", "score": "0.56185955", "text": "function randomBars() {\r\n\tvar k;\r\n\tfor (k=0; k<dataset.length; k++) {\r\n\t\tdataset[k].v = Math.random()*25.0 + 5.0;\r\n\t}\r\n\tdumpDataset();\r\n}", "title": "" }, { "docid": "b5fd95fe7001422508de3559067630a0", "score": "0.5616804", "text": "function BarChart(graph_data){\n\n var MonthGroup = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\",\n \"Jun\", \"Jul\", \"Aug\", \"Sep\",\"Oct\",\"Nov\",\"Dec\"];\n\n var uk_number = graph_data.map(function(t, i){\n return t.detail.map(function(d,i){\n return parseFloat(d.UK_Visits_M);\n })})\n // console.log(uk_number)\n\n var os_number = graph_data.map(function(t, i){\n return t.detail.map(function(d,i){\n return parseFloat(d.OS_Visits_M);\n })})\n // console.log(os_number)\n\n var YearMap_uk= {};\n var YearMap_os = {};\n for (let e = 0; e < year.length; e++){\n YearMap_uk[year[e]]=uk_number[e];\n YearMap_os[year[e]]=os_number[e];\n }\n\n console.log(YearMap_uk)\n // console.log(YearMap_os)\n\n // Define dimensions of vis\n var width = 680;\n var height = 275;\n\n var margin = {\n top: 40,\n left: 40,\n right: 60,\n bottom: 65\n };\n\n width = width - margin.left - margin.right,\n height = height - margin.top - margin.bottom;\n\n // Make x scale\n var xScale = d3.scaleBand()\n .domain(MonthGroup)\n .rangeRound([0, width])\n .padding(0.1);\n\n // Make y scale, the domain will be defined on bar upPeriod\n var yScale = d3.scaleLinear()\n .range([height, 0]);\n\n // Create svg\n var svg = d3.select(\"#month_chart\")\n .append(\"svg\")\n .attr(\"class\",\"barbar\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n svg.append(\"text\")\n .attr(\"x\", width / 2 )\n .attr(\"y\", -40)\n .attr(\"class\",\"title\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-weight\",\"bold\")\n .text(\"Visits to and from the UK, 1996 to 2017\");\n\n // Make x-axis and add to svg\n var xAxis = d3.axisBottom(xScale);\n\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis)\n .append(\"text\")\n .attr(\"y\", 30)\n .attr(\"x\", width+ 30)\n .attr(\"fill\", \"#000\")\n .attr(\"font\",\"7px sans-serif\")\n .text(\"Month\");\n // Make y-axis and add to svg\n\n var yAxis = d3.axisLeft(yScale)\n .ticks(5); // 链接:https://www.jianshu.com/p/88f305000465\n\n var yAxisHandleForUpPeriod = svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n\n\n yAxisHandleForUpPeriod.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"class\",\"billion\")\n .attr(\"y\", 6)\n .attr(\"dy\", -30)\n .attr(\"fill\", \"#000\")\n .attr(\"font\",\"7px sans-serif\")\n .style(\"text-anchor\", \"end\")\n .text(\"Visits in Millions\");\n\n\n var updateBars = function(data) {\n\n // First upPeriod the y-axis domain to match data\n yScale.domain([0,6.5]);\n // yScale.domain([2,d3.max(data)]);\n yAxisHandleForUpPeriod.call(yAxis);\n\n var bars = svg.selectAll(\".bar\").data(data);\n\n var tooltip = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n\n // Add bars for new data\n bars.enter()\n .append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function(d,i) { return xScale( MonthGroup[i]); })\n .attr(\"width\", 20)\n .attr(\"y\", function(d,i) { return yScale(d); })\n .attr(\"height\", function(d,i) { return height - yScale(d); })\n .style(\"fill\",\"rgb(142, 185, 30)\")\n .on(\"mouseover\", function(d) {\n tooltip.transition()\n .duration(200)\n .style(\"opacity\", 1);\n tooltip.html(\"UK: \" + d +\"m\")\n .style(\"left\", (d3.event.pageX) + \"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\n // UpPeriod old ones, already have x / width from before\n bars\n .transition().duration(250)\n .attr(\"y\", function(d,i) { return yScale(d); })\n .attr(\"height\", function(d,i) { return height - yScale(d); });\n\n // Remove old ones\n bars.exit().remove();\n\n var legend = svg.selectAll(\".legend_u\")\n .data(data)\n .enter().append(\"g\")\n .attr(\"class\", \"legend_u\")\n .attr(\"transform\",\"translate(0, -25)\");\n\n legend.append(\"rect\")\n .attr(\"x\", width -50)\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", \"rgb(142, 185, 30)\");\n\n legend.append(\"text\")\n .attr(\"x\", width - 24)\n .attr(\"y\", 9)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"start\")\n .style(\"font\",\"15px\")\n .text(\"UK\");\n\n\n };\n\n var updateBars_os = function(data) {\n\n // First upPeriod the y-axis domain to match data\n yScale.domain([0,6.5]);\n // yScale.domain([2,d3.max(data)]);\n yAxisHandleForUpPeriod.call(yAxis);\n\n var bar = svg.append(\"svg\")\n .selectAll(\".bar\")\n .data(data);\n\n var tooltip = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"tooltip\")\n .style(\"opacity\", 0);\n\n\n // Add bars for new data\n bar.enter()\n .append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"transform\", \"translate(20,0)\")\n .attr(\"x\", function(d,i) { return xScale( MonthGroup[i]); })\n .attr(\"width\", 20)\n .attr(\"y\", function(d,i) { return yScale(d); })\n .attr(\"height\", function(d,i) { return height - yScale(d); })\n .style(\"fill\",\"rgb(103, 115, 74)\")\n // .attr(\"data-legend\",\"Overseas\")\n .on(\"mouseover\", function(d) {\n tooltip.transition()\n .duration(200)\n .style(\"opacity\", 1);\n tooltip.html(\"Overseas: \" + d +\"m\")\n .style(\"left\", (d3.event.pageX) + \"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\n // UpPeriod old ones, already have x / width from before\n bar\n .transition().duration(250)\n .attr(\"y\", function(d,i) { return yScale(d); })\n .attr(\"height\", function(d,i) { return height - yScale(d); });\n\n // Remove old ones\n bar.exit().remove();\n console.log(data[0])\n\n var legend = svg.selectAll(\".legend\")\n .data(data)\n .enter().append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\",\"translate(0, -5)\");\n\n legend.append(\"rect\")\n .attr(\"x\", width -50)\n .attr(\"width\", 18)\n .attr(\"height\", 18)\n .style(\"fill\", \"rgb(103, 115, 74)\");\n\n legend.append(\"text\")\n .attr(\"x\", width - 24)\n .attr(\"y\", 9)\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"start\")\n .style(\"font\",\"15px\")\n .text(\"Overseas\");\n };\n\n // Handler for dropdown value change\n var dropdownChange = function() {\n var newyear = d3.select(this).property('value'),\n newData_uk = YearMap_uk[newyear],\n newData_os = YearMap_os[newyear];\n\n // console.log(newData_os)\n // console.log(newData_uk)\n updateBars(newData_uk);\n updateBars_os(newData_os);\n\n };\n\n // Get years, for dropdown\n var years = Object.keys(YearMap_uk).sort();\n\n var dropdown = d3.select(\"#dropdown\")\n .insert(\"select\", \"svg\")\n .attr(\"id\",\"change\")\n .on(\"change\", dropdownChange);\n\n dropdown.selectAll(\"option\")\n .data(years)\n .enter().append(\"option\")\n .attr(\"value\", function (d) { return d; })\n .text(function (d) {\n return d[0].toUpperCase() + d.slice(1,d.length); // capitalize 1st letter\n });\n\n var initialData_uk = YearMap_uk[ years[0] ];\n var initialData_os = YearMap_os[ years[0] ];\n\n updateBars(initialData_uk);\n updateBars_os(initialData_os);\n}", "title": "" }, { "docid": "5aee2704a849f123cb4b0aaf952fcd89", "score": "0.561659", "text": "function bar(canvas,col,label,x,w,val,note=\"\",depth=0)\r\n{\r\n\t// Calculate fraction of value compared to scale max \r\n\tvar per = (val-minVal)/(maxVal-minVal);\r\n\r\n\t// Get 2D context for drawing\r\n\tvar ctx = canvas.getContext(\"2d\");\r\n\r\n // Draw bar\r\n\tvar top = tSpace + tSpace + (pHeight-tSpace) - ((pHeight-tSpace)*per);\r\n\tctx.beginPath();\r\n\tctx.lineWidth = \"1\";\r\n\tctx.fillStyle = col;\r\n\tctx.fillRect(x+depth, top-depth, w, ((pHeight-tSpace)*per));\r\n\tctx.stroke();\t\t\r\n\tctx.beginPath();\r\n\tctx.lineWidth = \"1\";\r\n\tctx.strokeStyle = \"black\";\r\n\tctx.rect(x+depth, top-depth, w, ((pHeight-tSpace)*per));\r\n\tctx.stroke();\t\t\r\n\tctx.beginPath();\r\n\tctx.lineWidth = \"1\";\r\n\tctx.strokeStyle = \"black\";\r\n\tctx.moveTo(x+depth, top-depth);\r\n\tctx.lineTo(x+10+depth, top-10-depth);\r\n\tctx.lineTo(x+10+w+depth, top-10-depth);\r\n\tctx.lineTo(x+w+depth, top-depth);\r\n\tctx.closePath();\r\n\tctx.stroke();\t\t\r\n\tctx.fillStyle=col;\r\n\tctx.fill();\r\n\tctx.beginPath();\r\n\tctx.lineWidth = \"1\";\r\n\tctx.strokeStyle = \"black\";\r\n\tctx.moveTo(x+w+depth, top-depth);\r\n\tctx.lineTo(x+w+10+depth, top-10-depth);\r\n\tctx.lineTo(x+w+10+depth, tSpace+pHeight-10-depth);\r\n\tctx.lineTo(x+w+depth, tSpace+pHeight-depth);\r\n\tctx.closePath();\r\n\tctx.stroke();\t\t\r\n\tctx.fillStyle=col;\r\n\tctx.fill();\r\n\t// Draw note\r\n\tctx.font = \"20px Georgia\";\r\n\tctx.fillStyle = \"black\";\r\n\tif(note==\"\")\r\n\t{\r\n\t\tctx.fillText(\"$\"+val.toFixed(2),x+depth,top-35);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tctx.fillText(note,x+depth,top-35);\r\n\t}\r\n\t// Draw label\r\n\tctx.fillText(label,x+depth,tSpace+pHeight+25);\r\n}", "title": "" }, { "docid": "e50fc991e4590be3049949070e5f76d6", "score": "0.56099623", "text": "function makeVertBarPlot(names, nums, plotId, title) {\n //positions and dimensions\n var margin = {\n top: 100,\n right: 200,\n bottom: -80,\n left: 200\n };\n var width = 700;\n var height = 400;\n var color = d3.scale.category10();\n names.unshift(\" \")\n nums.unshift(0)\n\n updateDimensions(window.innerWidth, margin);\n\n //calculating max for data\n var maxNum = Math.max.apply(null, nums)\n\n //set range for data by domain, and scale by range\n var xrange = d3.scale.linear()\n .domain([0, names.length])\n .range([0, width]);\n\n var yrange = d3.scale.linear()\n .domain([0, maxNum])\n .range([height, 0]);\n\n //set axes for graph\n var xAxis = d3.svg.axis()\n .scale(xrange)\n .orient(\"bottom\")\n .tickPadding(2)\n .tickFormat(function(d,i){ return names[i] })\n .tickValues(d3.range(names.length));\n\n var yAxis = d3.svg.axis()\n .scale(yrange)\n .orient(\"left\")\n .tickSize(5)\n .tickFormat(d3.format(\"s\"));\n\n\n // Add the svg canvas\n var svg = d3.select(\"#\" + plotId)\n .append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .attr(\"id\", \"barPlot\" + plotId)\n .append(\"g\")\n .attr(\"transform\",\n \"translate(\" + margin.left + \",\" + margin.top + \")\")\n .attr(\"fill\", \"white\");\n\n // graph title\n svg.append(\"text\")\n .attr(\"text-anchor\", \"middle\")\n .attr(\"fill\",\"black\")\n .attr(\"dy\", 0)\n .style(\"font-size\", \"23px\")\n .attr(\"transform\", \"translate(\"+ (width/2.2) +\",\"+ -50 +\")\")\n .text(title)\n .call(wrap, width)\n\n // Add the Y Axis\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", 1)\n .call(yAxis)\n\n svg.selectAll(\".tick\")\n .select(\"text\")\n .attr(\"fill\", \"black\")\n .attr(\"stroke\", \"none\")\n\n // Add the X Axis\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", 1)\n .call(xAxis)\n .selectAll(\"text\")\n .attr(\"fill\", \"#207cc1\")\n .attr(\"stroke\", \"none\")\n .on(\"click\", function(i){\n document.location.href = \"/search?q=\" + names[i]\n })\n .on({\n \"mouseover\": function(d) {\n d3.select(this).transition().duration(400).style(\"opacity\", 0.5);\n d3.select(this).style(\"cursor\", \"pointer\");\n },\n \"mouseout\": function(d) {\n d3.select(this).transition().duration(400).style(\"opacity\", 1);\n d3.select(this).style(\"cursor\", \"default\");\n }\n });\n\n\n //for resizing\n d3.selectAll(\"#barPlot\" + plotId)\n .attr( 'preserveAspectRatio',\"xMinYMin meet\")\n .attr(\"viewBox\", \"80 0 900 500\")\n .attr('width', '700')\n\n //adding chart group\n var chart = svg.append('g')\n .attr(\"transform\", \"translate(0,0)\")\n .attr('id','chart')\n\n // adding each bar\n chart.selectAll('.bar')\n .data(nums)\n .enter()\n .append(\"a\")\n .attr(\"xlink:href\", function(d,i) {\n return \"/search?q=\" + names[i]\n })\n .append('rect')\n .attr(\"class\", \"bar\")\n .attr('width', 60)\n .attr({\n 'x':function(d,i){ return xrange(i) - 30}, // each i is the number of the dataset\n 'y':function(d){ return yrange(d)} // each d is the actual number of drugs (the num)\n })\n .style('fill',\"#2d5faf\") // blue\n .attr('height',function(d){ return height - yrange(d);})\n .on({\n \"mouseover\": function(d,i) {\n d3.select(this).transition()\n .duration(300).style(\"opacity\", 0.6);\n d3.select(\"#\" + names[i] + plotId+ \"num\").transition()\n .duration(300).style(\"opacity\", 1);\n d3.select(this).style(\"cursor\", \"pointer\");\n },\n \"mouseout\": function(d,i) {\n d3.select(this).transition()\n .duration(300).style(\"opacity\", 1);\n d3.select(\"#\" + names[i] + plotId + \"num\").transition()\n .duration(300).style(\"opacity\", 0);\n d3.select(this).style(\"cursor\", \"default\");\n }\n })\n\n // for some reason i can't append text onto the end of the bars\n // and so i must do it here\n for (var i = 1; i < nums.length; i++) {\n svg.append(\"text\")\n .attr({'x': xrange(i), 'y': yrange(nums[i])-10})\n .attr(\"id\", names[i] + plotId + \"num\")\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", \"16px\")\n .attr(\"fill\", \"black\")\n .style(\"opacity\", 0)\n .text(nums[i])\n }\n\n var arrTemp = title.split(\" \");\n var descriptor = arrTemp[0] + \"-\" + arrTemp[1] + \"-\" + arrTemp[2]\n\n d3.select(\"#\" + plotId).append(\"button\")\n .attr(\"type\",\"button\")\n .attr(\"id\", \"button\" + plotId)\n .attr(\"class\", \"downloadButton\")\n .text(\"Download SVG\")\n .on(\"click\", function() {\n // download the svg\n downloadSVG(plotId, descriptor);\n });\n\n\n\n}", "title": "" }, { "docid": "93590ab3a529def7c85d79f99111b03d", "score": "0.560824", "text": "function drawBarplot(Origin, Year, flag){\n if (flag==0){\n svg = svg1\n title = \"Outgoing refugees from \" + Origin + \" in \" + Year\n }\n else{\n svg=svg2\n title = \"Incoming refugees to \" + Origin + \" in \" + Year\n\n }\n\n var yName = \"Number of refugees\"\n var xName = \"Country\"\n var xScale = d3.scale.ordinal().rangeRoundBands([0, viewWidth], .05); // value -> display\n xMap = function(d) { return xScale(d.key);}, // data -> display\n xAxis = d3.svg\n .axis()\n .scale(xScale)\n .orient(\"bottom\")\n // setup y\n var yScale = d3.scale.linear().range([viewHeight, 0]), // value -> display\n yMap = function(d) {return yScale(d.values);}, // data -> display\n yAxis = d3.svg\n .axis()\n .scale(yScale)\n .orient(\"left\");\n //remove the previous barblot\n svg.selectAll(\"g\").remove() \n svg.selectAll(\"text\").remove()\n\n try{ \n\n var g = svg.append(\"g\")\n //Get the data\n var countriesPerOriginPerYear = getcountriesPerOriginPerYear(data, Origin, Year, flag) \n\n xScale.domain(countriesPerOriginPerYear.map(function(d) { return d.key; }));\n var yMax = d3.max(countriesPerOriginPerYear, function(d) { return d.values; });\n yScale.domain([0, yMax + 0.1*yMax]);\n\n g.append(\"g\")\n .attr(\"class\", \"xAxis\")\n .attr(\"transform\", \"translate(0,\" + viewHeight + \")\")\n .call(xAxis)\n .selectAll(\"text\")\n .attr(\"y\", 6)\n .attr(\"x\", 0)\n .attr(\"dy\", \".75em\")\n .attr(\"transform\", \"rotate(25)\")\n .style(\"text-anchor\", \"start\");\n\n g.append(\"g\")\n .attr(\"class\", \"yAxis\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \"0.71em\")\n .attr(\"text-anchor\", \"end\")\n\n//Title of the graph\n svg.append(\"text\")\n .attr(\"x\", (width*0.6)) \n .attr(\"y\", 0 - (margin.top - 30))\n .attr(\"text-anchor\", \"middle\") \n .attr(\"class\", \"title\")\n .text(title);\n\n g.selectAll(\".bar\")\n .data(countriesPerOriginPerYear)\n .enter().append(\"rect\")\n .attr(\"class\", \"bar\")\n .attr(\"x\", function(d) { return xMap(d); })\n .attr(\"y\", function(d) { return yMap(d); })\n .attr(\"width\", xScale.rangeBand())\n .attr(\"height\", function(d) { return viewHeight - yMap(d); })\n .on(\"mouseover\", mouseOver)\n .on(\"mouseout\", mouseOut);\n\n function mouseOver (d){\n tooltip.transition()\n .duration(200)\n .style(\"opacity\", .9);\n d3.select(this).style(\"fill\", \"LightSkyBLue\"); \n tooltip.html(getTextMouseOver(d))\n .style(\"left\", (d3.event.pageX + 5) + \"px\")\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\n }\n\n function getTextMouseOver(d) {\n var result = \"<big>\" + xName + \": \" + d.key + \"</br>\" + \n yName + \": \" + d.values + \"</big>\";\n return result;\n }\n\n function mouseOut(d) {\n tooltip.transition()\n .duration(500)\n .style(\"opacity\", 0);\n d3.select(this).style(\"fill\", \"steelblue\"); \n }}\n catch(err){\n svg.selectAll(\"g\").remove()\n\n console.log(\"Not defined\", err)\n }\n}", "title": "" }, { "docid": "9aa41aef7b767e74a9dd3f5d7e73babf", "score": "0.5602259", "text": "function drawBars(A) {\n //clear screen:\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n \n // set width of bar so it shrinks if the \n // bars would overflow the screen:\n var barWidth = 10;\n if (A.length * barWidth > canvas.width) {\n \tbarWidth = canvas.width / A.length;\n }\n\n\n // itterate over the array and draw bars\n for (var i = 0; i < A.length; i++) {\n \t// set rainbow colors:\n \tctx.fillStyle = \"#000000\";\n \tif (gay) {\n \t\tctx.fillStyle = rainbow[Math.floor(A[i] * (rainbow.length))];\n \t}\n var pos = i*barWidth;\n var height = Math.floor(A[i] * canvas.height)\n ctx.fillRect(pos, canvas.height-5, barWidth, -height);\n //ctx.strokeRect(pos, canvas.height, barWidth, -height);\n }\n}", "title": "" }, { "docid": "041d8c774a7571ac3d2a257080561cc1", "score": "0.56013095", "text": "function createBarchart(data1, selection) {\n // sizing the bar chart\n var chartWidth = 300,\n barHeight = 20,\n groupHeight = barHeight * data1.series.length,\n gapBetweenGroups = 10,\n spaceForLabels = 150,\n spaceForLegend = 150;\n\n // zip the series data together (first values, second values, etc.)\n var zippedData = [];\n for (var i = 0; i < data1.labels.length; i++) {\n for (var j = 0; j < data1.series.length; j++) {\n zippedData.push(data1.series[j].values[i]);\n }\n }\n\n // set up the colors for several lines\n var color = d3.scale.ordinal().range([\"#8dd3c7\", \"#bebada\", \"#fb8072\", \"#80b1d3\", \"#fdb462\", \"#b3de69\", \"#fccde5\", \"#d9d9d9\", \"#bc80bd\"]);\n var chartHeight = barHeight * zippedData.length + gapBetweenGroups * data1.labels.length;\n\n // x-axis\n var x = d3.scale.linear()\n .domain([0, d3.max(zippedData)])\n .range([0, chartWidth]);\n\n // y -axis\n var y = d3.scale.linear()\n .range([chartHeight + gapBetweenGroups, 0]);\n var yAxis = d3.svg.axis()\n .scale(y)\n .tickFormat('')\n .tickSize(0)\n .orient(\"left\");\n\n // specify the chart area and dimensions\n var chart = d3.select(\".\" + selection)\n .attr(\"width\", spaceForLabels + chartWidth + spaceForLegend)\n .attr(\"height\", chartHeight);\n\n // create bars\n var bar = chart.selectAll(\"g\")\n .data(zippedData);\n\n // enter the bar\n var barEnter = bar\n .enter().append(\"g\")\n .attr(\"transform\", function (d, i) {\n return \"translate(\" + spaceForLabels + \",\" + (i * barHeight + gapBetweenGroups * (0.5 + Math.floor(i / data1.series.length))) + \")\";\n });\n\n // creates rectangles with the correct width\n barEnter.append(\"rect\")\n .attr(\"fill\", function (d, i) {\n return color(i % data1.series.length);\n })\n .attr(\"class\", \"bar\")\n .attr(\"width\", x)\n .attr(\"height\", barHeight - 1);\n\n // adds text label in bar\n barEnter.append(\"text\")\n .attr(\"x\", function (d) {\n return x(d) - 3;\n })\n .attr(\"y\", barHeight / 2)\n .attr(\"fill\", \"red\")\n .attr(\"dy\", \".35em\")\n .text(function (d) {\n return d;\n });\n\n // draws the labels\n barEnter.append(\"text\")\n .attr(\"class\", \"label\")\n .attr(\"x\", function (d) {\n return -10;\n })\n .attr(\"y\", groupHeight / 2)\n .attr(\"dy\", \".35em\")\n .text(function (d, i) {\n if (i % data1.series.length === 0)\n return data1.labels[Math.floor(i / data1.series.length)];\n else\n return \"\"\n });\n\n // changes the y axis\n chart.append(\"g\")\n .attr(\"class\", \"y axis\")\n .attr(\"transform\", \"translate(\" + spaceForLabels + \", \" + -gapBetweenGroups / 2 + \")\")\n .call(yAxis);\n\n // UPDATE PART\n\n // set up for the transition\n barUpdate = d3.transition(bar);\n\n // updates the bar\n barUpdate.select('rect')\n .transition().duration(600)\n .attr(\"fill\", function (d, i) {\n return color(i % data1.series.length);\n })\n .attr(\"width\", x)\n .attr(\"height\", barHeight - 1);\n\n // updates the bar text label\n barUpdate.select('text')\n .transition().duration(600)\n .attr(\"x\", function (d) {\n return x(d) - 3;\n })\n .attr(\"y\", barHeight / 2)\n .attr(\"fill\", \"red\")\n .attr(\"dy\", \".35em\")\n .text(function (d) {\n return d;\n });\n\n // removes the previous one\n bar.exit().remove();\n\n // draws legend\n var legendRectSize = 18,\n legendSpacing = 4;\n\n // setting up the legend\n var legend = chart.selectAll('.legend')\n .data(data1.series)\n .enter()\n .append('g')\n .attr('transform', function (d, i) {\n var height = legendRectSize + legendSpacing;\n var offset = -gapBetweenGroups / 2;\n var horz = spaceForLabels + chartWidth + 40 - legendRectSize;\n var vert = i * height - offset;\n return 'translate(' + horz + ',' + vert + ')';\n });\n\n // adds color block for the legend\n legend.append('rect')\n .attr('width', legendRectSize)\n .attr('height', legendRectSize)\n .style('fill', function (d, i) {\n return color(i);\n })\n .style('stroke', function (d, i) {\n return color(i);\n });\n\n // adds text after the color block\n legend.append('text')\n .attr('class', 'legend')\n .attr('x', legendRectSize + legendSpacing)\n .attr('y', legendRectSize - legendSpacing)\n .text(function (d) {\n return d.label;\n });\n}", "title": "" }, { "docid": "237f7d646bf0da5478603ed568bd228a", "score": "0.55991685", "text": "function ServiceGenYNbar(data){\n $('#SalesBarParam').hide();\n $('#SalesBarGraph').show();\n var _data = jQuery.parseJSON(data);\n var _get = '';\n var lup=0;\n var _qno = [];\n var _yes = [];\n var _no = [];\n var i = 0;\n var qList = '';\n\n $.each(_data,function(){\n _qno[i] = 'Q' + _data[i]['Qno'];\n _yes[i] = _data[i]['YesPercent'];\n _no[i] = _data[i]['NoPercent'];\n i++;\n });\n\n Chart.plugins.register({\n beforeDraw: function(chartInstance) {\n var ctx = chartInstance.chart.ctx;\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, chartInstance.chart.width, chartInstance.chart.height);\n }\n });\n\n var ctx = document.getElementById('myChart').getContext('2d');\n // Global Options\n Chart.defaults.global.defaultFontFamily = 'Lato';\n Chart.defaults.global.defaultFontSize = 18;\n Chart.defaults.global.defaultFontColor = '#000';\n\n var massPopChart = new Chart(ctx, {\n type:'bar', // bar, horizontalBar, pie, line, doughnut, radar, polarArea\n data:{\n labels:_qno,\n datasets:[{\n label:'YES %',\n data:_yes,\n //backgroundColor:'green',\n backgroundColor:\n 'RGB(139, 0, 0)'\n ,\n borderWidth:1,\n borderColor:'#777',\n hoverBorderWidth:3,\n hoverBorderColor:'#000'\n },\n {\n label:'NO %',\n data:_no,\n //backgroundColor:'green',\n backgroundColor:\n '#FFC0CB'\n ,\n borderWidth:1,\n borderColor:'#777',\n hoverBorderWidth:3,\n hoverBorderColor:'#000'\n }]\n },\n options:{\n title:{\n display:true,\n text:$('#inpDtFrm').val() + ' to ' + $('#inpDtTo').val() + ' Service Survey Bar Graph Report',\n fontSize:25\n },\n legend:{\n display:true,\n position:'bottom',\n labels:{\n fontColor:'#000'\n }\n },\n layout:{\n padding:{\n left:50,\n right:0,\n bottom:0,\n top:0\n }\n },\n tooltips:{\n enabled:true\n }\n }\n });\n}", "title": "" }, { "docid": "873f8123cde3940d438773a1dc1f74b0", "score": "0.5593281", "text": "function BAMEBar(cf) {\n\t// dimension on borough names, group on BAME percentage\n\tvar BAMEBoroughDim = cf.dimension(dc.pluck(\"Area_name\"));\n\tvar BAMEGroup = BAMEBoroughDim.group().reduceSum(dc.pluck(\"Proportion_of_population_from_BAME_groups\"));\n\tvar BAMEBarChart = dc.barChart(\"#bar-BAME\");\n\n\tBAMEBarChart\n\t\t.width(600)\n\t\t.height(200)\n\t\t.useViewBoxResizing(true) // adds responsiveness\n\t\t.gap(1)\n\t\t.title(function(d) {\n\t\t\treturn `${d.key}: ${d.value}%`;\n\t\t})\n\t\t.group(BAMEGroup)\n\t\t.dimension(BAMEBoroughDim)\n\t\t.margins({\n\t\t\ttop: 10,\n\t\t\tright: 30,\n\t\t\tbottom: 85,\n\t\t\tleft: 40\n\t\t})\n\t\t.x(d3.scale.ordinal())\n\t\t.xUnits(dc.units.ordinal);\n\n}", "title": "" }, { "docid": "ebced121487dafd2c68162105c8121d0", "score": "0.55929154", "text": "function generateBars(data){\n if (stopSort) return;\n //Generate all the bars\n var barChart = svg.selectAll(\"g\") \n .data(data)\n .transition()\n .attr(\"transform\", function(d, i){return \"translate(\" + (barWidth * i) + \",\" + (svgHeight-barHeight(d)-yAdjust) + \")\";});\n \n barChart.select(\"rect\")\n .attr(\"height\",function(d) {return barHeight(d);})\n\n barChart.select(\"text\")\n .attr(\"x\",(barWidth-barPadding)/2)\n .text(function(d) {return d;});\n}", "title": "" }, { "docid": "d705268329c954230c482d6eb660a1c2", "score": "0.55861634", "text": "function barToolTip(d, svg) {\n svg.append(\"text\")\n .style(\"font-size\", 14)\n .attr(\"x\", histogram_width*0.75)\n .attr(\"y\", 0).attr(\"class\", \"tooltip\")\n .style(\"font-size\", 12)\n .text(function() {\n return \"Range: [\"+d.x0.toFixed(4)+\", \"+d.x1.toFixed(3)+\"]\";\n });\n \n svg.append(\"text\")\n .style(\"font-size\", 14)\n .attr(\"x\", histogram_width*0.75)\n .attr(\"y\", 15).attr(\"class\", \"tooltip\")\n .style(\"font-size\", 12)\n .text(function() {\n return \"Count: \" + d.length;\n });\n}", "title": "" } ]
a2c09260c9363f5cc9f0c3137f2bf7a8
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below n.
[ { "docid": "8f19b5cabd1619b9b01d5983446b6813", "score": "0.7797722", "text": "function primeSummation(n) {\n let arr = [2];\n let nextElement = 3;\n let sum = 2;\n while (nextElement < n) {\n for (let elem of arr) {\n if (elem > Math.sqrt(nextElement)) {\n arr.push(nextElement);\n sum += nextElement;\n break;\n } else {\n if (nextElement % elem === 0) {\n break;\n }\n }\n }\n nextElement += 2;\n }\n return sum;\n}", "title": "" } ]
[ { "docid": "95c7b0ea77b2efbc03d8728d00878c52", "score": "0.843893", "text": "function sumOfNPrimes(n) {\n let sumOfPrimes = 0;\n let nthPrime = 0;\n let i = 2;\n\n while (nthPrime < n) {\n if (isPrime(i)) {\n sumOfPrimes += i;\n nthPrime += 1;\n };\n i ++;\n }\n return sumOfPrimes\n}", "title": "" }, { "docid": "d92bbb4da1d8bce0e960cb52434e22f3", "score": "0.8390982", "text": "function sumOfNPrimes(n) {\n var counter = 0;\n var sum = 0;\n for (var i = 2; counter < n; i++) {\n if (isPrime(i)) {\n sum += i;\n counter++;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "ba98bff08cee57105dd5b6a250a051c7", "score": "0.8333594", "text": "function sumOfNPrimes(n) {\n let arr = [];\n function firstNPrimes(n) {\n let count = 0;\n \n for (let i = 2; count < n; i++) {\n \n if (isPrime(i)) {\n \n arr.push(i);\n count += 1;\n }\n }\n }\n firstNPrimes(n)\n let sum = 0\n arr.forEach(ele => sum += ele)\n return sum\n}", "title": "" }, { "docid": "68dfee0169d38fdf97aef325511942f8", "score": "0.83174545", "text": "function sumOfNPrimes(n){\n let answer = 0;\n let primescount = 0;\n let i = 2;\n\n while (primescount < n){\n if (isPrime(i)) {\n answer += i\n primescount++;\n }\n i++;\n }\n\n return answer;\n}", "title": "" }, { "docid": "5d21ed4869dc15e97d82b588da57fe38", "score": "0.8219206", "text": "function summationOfPrimes(n) {\n var sum = 0;\n var i;\n for(i = 2; i <= n; i++) {\n if(isPrime(i)) {\n sum += i;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "f3a8e428c774ab43e04a20fa5ebade16", "score": "0.7678305", "text": "function firstNPrimes (num) {\n let sum = 0;\n\n}", "title": "" }, { "docid": "0aa8accff7c77388c90d33c6d7f6004d", "score": "0.7497694", "text": "function sumAllPrimes() {}", "title": "" }, { "docid": "2cc026ae59bd94e0e34b887b09c35025", "score": "0.7442205", "text": "function sumPrime(num) {\n // Function to get the primes up to max in an array\n function getPrimes(max) {\n var sieve = [];\n var i;\n var j;\n var primes = [2];\n for (i = 3; i <= max; i+=2) {\n if (!sieve[i]) {\n // i has not been marked -- it is prime\n primes.push(i);\n for (j = i << 1; j <= max; j += i) {\n // make all multiples equal true, so they don't get pushed\n sieve[j] = true; \n }\n }\n }\n return primes;\n }\n // Sum All primes\n var primes = getPrimes(num);\n return primes.reduce((total, item) => total + item);\n}", "title": "" }, { "docid": "3cdeb4203d119a9295a1f086ca4f6f34", "score": "0.7433955", "text": "function allPrimesLessThanN(n) {\n for (let i = 0; i < n; i++) {\n if (isPrime2(i)) {\n \n }\n }\n}", "title": "" }, { "docid": "37ae8741222eef49ac6e0851e21b062c", "score": "0.7276577", "text": "function sumPrimes(num) {\n // Check all numbers for primality\n let primes = [];\n for (let i = 2; i <= num; i++) {\n if (primes.every((prime) => i % prime !== 0))\n primes.push(i);\n }\n return primes.reduce((sum, prime) => sum + prime, 0);\n}", "title": "" }, { "docid": "811f19ed32ce4a520d5ae10cd5837d5c", "score": "0.7248373", "text": "function sumPrimes(num) {\n // CREATE ARRAY TO STORE PRIMES\n var result = [];\n // GO OVER THE NUMBERS +1 BECAUSE WE WANT TO TEST THE GIVEN NUMBER AS WELL\n for (var i = 1; i < num + 1; i++) {\n // 2 IS THE FIRST PRIME SO WE PUSH\n if (i === 2) {\n result.push(i);\n } else {\n var x = 1;\n // WHILE THE X IS SMALLER THEN THE I UNTIL THE LAST\n while (x < i) {\n x++;\n if (i % x === 0) {\n break;\n }\n // -1 BECAUSE WE LOOK IF X<I THIS IS THE LAST PRIME IN I\n if (x === i - 1) result.push(i);\n }\n }\n }\n // console.log(result)\n return result.reduce((a, b) => a + b);\n}", "title": "" }, { "docid": "b31e3e2b90ff39c4ac63284749c052f9", "score": "0.72254485", "text": "function sums(n) {\n let sum = 0;\n for (let i = 0; i <= n; i++) {\n sum+=i;\n }\n return sum;\n}", "title": "" }, { "docid": "b5252aa7c7c9275f6e702a43e11b6058", "score": "0.7193409", "text": "function sumPrimes(num) {\n var sum = 0;\n if(isPrime(num)){\n sum = sum+num;\n }\n for(j=2; j<num; j++){\n if(isPrime(j)){\n console.log(j);\n sum = sum + j;\n }\n\n }\n return sum;\n}", "title": "" }, { "docid": "7dcdeaad99dca5d0dac59ab2dd3ce1ae", "score": "0.71786124", "text": "function findSum(n) {\n var final = 0;\n for (var i=3; i<=n; i++) {\n if (i%3==0||i%5===0) {\n final+=i;\n }\n }\n return final;\n}", "title": "" }, { "docid": "ffd44e2224d72835248ece7232ee95e8", "score": "0.7161186", "text": "function sumPrimes(num) {\n if (typeof num !== 'number') {\n throw new Error('input should be a number.');\n }\n if (num % 1 !== 0) {\n throw new Error('input should be an integer.');\n }\n\n if (num === 1) {\n return 1;\n }\n var res = 0;\n\n for (var i = 2; i <= num; i++) {\n if (i % 2 === 0 && i !== 2) {\n continue;\n }\n\n if (i === 2 || i === 3 || i === 5 || i === 7) {\n res += i;\n continue;\n }\n\n\n\n var flag = true;\n for (var j = 3; j <= Math.sqrt(i); j++) {\n if (i % j === 0) {\n flag = false;\n }\n }\n if (flag) {\n res += i;\n }\n }\n\n return res;\n}", "title": "" }, { "docid": "d8a46d2422e562adfdfd8b2d8cc54064", "score": "0.7153002", "text": "function sumAllPrimes (num) {\n\tlet total = 0;\n\n\tfunction checkForPrime (i) {\n\t\tfor (let j = 2; j < i; j++) {\n\t\t\tif (i % j === 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n\tfor (let i = 2; i <= num; i++) {\n\t\tif (checkForPrime(i)) {\n\t\t\ttotal += i;\n\t\t}\n\t}\n\treturn total;\n}", "title": "" }, { "docid": "75f2a81dfac75a29f25eaf61c78704b1", "score": "0.7150155", "text": "function sumUpto(n) {\n return n * (n + 1)/ 2 ;\n}", "title": "" }, { "docid": "3bbdf9ff216a8ac9ebc4f5d964f3cbc4", "score": "0.714739", "text": "function findPrimes(n) {\n const primes = new Array(n + 1).fill(true);\n\n for (let i = 2; Math.pow(i, 2) <= n; i++) {\n if (primes[i]) {\n for (let j = Math.pow(i, 2); j <= n; j = j + i) {\n primes[j] = false;\n }\n }\n }\n\n for (let i = 2; i <= n; i++) {\n if (primes[i]) console.log(i);\n }\n}", "title": "" }, { "docid": "95767a2d9f0b7142f508e11c834abc3c", "score": "0.7138664", "text": "function sumPrimes(num) {\n let sum = 0;\n for (var i = 2; i <= num; i++) {\n if(isPrime(i)){\n sum+=i;\n console.log(i);\n }\n\n }\n return sum;\n}", "title": "" }, { "docid": "16ea7e6dc5fad6c668c3abd6f2487193", "score": "0.71312785", "text": "function sumPrime(x) {\n let primeArr = [];\n let sum = 0;\n for (let i = 2; primeArr.length < x; i++) {\n if (prim(i)) {\n primeArr.push(i);\n }\n }\n for (let j = 0; j < primeArr.length; j++) {\n sum += primeArr[j];\n }\n return sum;\n}", "title": "" }, { "docid": "a6c801e577c8096ab51a5c0903597c97", "score": "0.7116394", "text": "function sumPrimes(num) {\n let sum = 0;\n while (num > 1) {\n if (isPrime(num)) {\n sum += num;\n }\n num--;\n }\n return sum;\n}", "title": "" }, { "docid": "75b8a833625bad6bd8de50e18b929205", "score": "0.71142805", "text": "function findSum(n) {\n var sum = 0;\n var newArr = [];\n for(var i = 0; i <= n; i++){\n \tif(i % 3 === 0 || i % 5 === 0){\n \t\tnewArr.push(i);\n \t}\n }\n for(var j = 0; j < newArr.length; j++){\n \t\tsum += newArr[j];\n \t}\n return sum;\n}", "title": "" }, { "docid": "c386f7dbdcb668c4f4bfe5ba2298022f", "score": "0.7109929", "text": "function sumAllPrimes(num) {\r\n\r\n let total = 0;\r\n\r\n function checkIsPrime(i){\r\n for (let j = 2; j < i; j++){\r\n if(i % j === 0)\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n for (let i = 2; i <= num; i++){\r\n if(checkIsPrime(i)){\r\n total += i\r\n }\r\n }\r\n\r\n return total;\r\n}", "title": "" }, { "docid": "78381fd7e84ea3f97e5b4f5757093909", "score": "0.7104935", "text": "function sumPrimes(num) {\n if (num === null) throw new Error(\"Input is null\");\n if (num === 0) return 0;\n let current = 2;\n let sum = 0;\n while (current <= num) {\n if (isPrime(current)) {\n sum += current;\n }\n current++;\n }\n return sum;\n}", "title": "" }, { "docid": "37b854e06e0cebd5735cb9e59c5a8030", "score": "0.7097924", "text": "function sumAllPrimes(num) {\n let total = 0;\n \n function checkForPrime(i) {\n for (let j = 2; j < i; j++) {\n if (i % j === 0) {\n return false;\n }\n }\n return true;\n }\n \n for (let i = 2; i <= num; i++) {\n if (checkForPrime(i)) {\n total += i;\n }\n }\n return total;\n }", "title": "" }, { "docid": "ad74cb7e7df8a8e8195111e42eedc430", "score": "0.70850086", "text": "function sumPrimes(num) {\r\n var count;\r\n var sum = 0;\r\n for(var i = 2; i <= num; i++){\r\n count = 0;\r\n for(var j = 1; j < i; j++){\r\n if(i % j === 0){\r\n count++; \r\n }\r\n } \r\n if (count === 1){\r\n sum += i;\r\n }\r\n }\r\n return sum;\r\n}", "title": "" }, { "docid": "57ca25220f36c4aebf333094a166a100", "score": "0.70804846", "text": "function sumFibs(n) {\n var fibs = [1,1];\n\n while(fibs[fibs.length -1] < n){\n fibs = genFib(fibs);\n }\n if (fibs[fibs.length -1] > n){\n fibs.pop();\n }\n return sum(filterOdds(fibs)); \n}", "title": "" }, { "docid": "95019ddfdb3b1cd120e27be1c1c5dc58", "score": "0.70763934", "text": "function findPrimes(n) {\n var i,s,p,ans;\n s=new Array(n);\n for (i=0;i<n;i++)\n s[i]=0;\n s[0]=2;\n p=0; //first p elements of s are primes, the rest are a sieve\n for(;s[p]<n;) { //s[p] is the pth prime\n for(i=s[p]*s[p]; i<n; i+=s[p]) //mark multiples of s[p]\n s[i]=1;\n p++;\n s[p]=s[p-1]+1;\n for(; s[p]<n && s[s[p]]; s[p]++); //find next prime (where s[p]==0)\n }\n ans=new Array(p);\n for(i=0;i<p;i++)\n ans[i]=s[i];\n return ans;\n }", "title": "" }, { "docid": "c0bf0a1c405b3f17496c98f7ca455115", "score": "0.7066383", "text": "function sumofN(n){\n var sum = 0;\n for (var i = 1; i<=n; i++){\n // sum = sum+i;\n sum+=i;\n }\n return sum;\n}", "title": "" }, { "docid": "dc58801053e270161b9611373a2b1667", "score": "0.70640165", "text": "function numberSum(n) {\n let total = 0;\n for(var i = 1; i <= n; i++){\n total += i;\n }\n return total;\n}", "title": "" }, { "docid": "b450969491c790169321a1fd52188bb9", "score": "0.70565444", "text": "function sumPrimes(num) {\n let sum = 0;\n\n function isPrime(val) {\n for (let i = 2; i < val; i++) {\n if (val % i === 0) {\n return false;\n }\n }\n return true;\n }\n\n for (let i = 2; i <= num; i++) {\n if (isPrime(i)) {\n sum += i;\n }\n }\n return sum;\n}", "title": "" }, { "docid": "0241d863ed1bdf16503c58be5b331e39", "score": "0.70398605", "text": "function sum(n) {\n\tlet s = 0\n\tfor(let i = 0; i <= n; i++) {\n\t\ts += i\n\t}\n\treturn s\n}", "title": "" }, { "docid": "7710dcdeb049fbe0671c80e78f0f29f4", "score": "0.70310545", "text": "function findPrimes(n) {\n var i, s, p, ans;\n s = new Array(n);\n for (i = 0; i < n; i++)\n s[i] = 0;\n s[0] = 2;\n p = 0; //first p elements of s are primes, the rest are a sieve\n for (; s[p] < n; ) { //s[p] is the pth prime\n for (i = s[p] * s[p]; i < n; i += s[p]) //mark multiples of s[p]\n s[i] = 1;\n p++;\n s[p] = s[p - 1] + 1;\n for (; s[p] < n && s[s[p]]; s[p]++); //find next prime (where s[p]==0)\n }\n ans = new Array(p);\n for (i = 0; i < p; i++)\n ans[i] = s[i];\n return ans;\n }", "title": "" }, { "docid": "2d0650e12e50ffbf2169b4b685625112", "score": "0.70302755", "text": "function sumPrimes(num) {\n let sum = 2\n while (num > 2){\n for(let i = num - 1; i > 1; i-- ){\n if(num % i == 0){\n num--\n i = num\n } else if(i == 2){\n sum += num\n num--\n i = num\n }\n \n }\n \n }\n return sum;\n}", "title": "" }, { "docid": "83633b55b7bd7be95b214c44760e7761", "score": "0.70290244", "text": "function primesUntil(n) {\n const segSize = segmentSize(n);\n const base = primeBase(segSize);\n\n // concat subsequent segments to base\n return segments(n, segSize).reduce((acc, s) =>\n acc.concat(sweptSegment(s[0], s[1], base)), base);\n}", "title": "" }, { "docid": "6cf9c293770b1bbbef0fbab1439a3e9b", "score": "0.7025797", "text": "function sieveOfEratosthenes(n) {\n let primes = [];\n\n for(let i=0; i <= n; i++) {\n if(isPrime(i)) primes.push(i);\n }\n return primes;\n}", "title": "" }, { "docid": "75dbf4060f2abc2bab10eb602ca9a2e7", "score": "0.7006112", "text": "function sumPrimes(num) {\n sum = 1;\n for (let i=2;i<=num;i++) {\n console.log(\"-----\");\n console.log(\"i=\"+i);\n for (let j=2;j<i;j++) {\n console.log(\"j=\"+j);\n if (i % j == 0) {\n break;\n }\n }\n sum = sum + i;\n console.log(\"sum=\"+sum);\n }\n return sum;\n}", "title": "" }, { "docid": "31a882991fa35b681cf7c4285c8b2e35", "score": "0.7002377", "text": "function sum(n) {\n var total = 0;\n for (var i = 0; i < n; i++) {\n total += i;\n }\n return total\n}", "title": "" }, { "docid": "6d0709570a82f18d56f7ff67c38a40c4", "score": "0.6980087", "text": "function sumPrimes(num) {\n let myNums = [];\n for(let i = 3; i <= num; i+=2){\n myNums.push(i);\n }\n myNums = myNums.filter(x => {\n if(x === 3 || x === 5 || x === 7 || x === 11){\n return true;\n }else if(x % 3 === 0 || x % 5 === 0 || x % 7 === 0 || x % 11 === 0){\n return false;\n }\n return true;\n });\n let j = 4;\n while(Math.pow(myNums[j],2) < num){\n myNums.splice(myNums.indexOf(Math.pow(myNums[j],2)),1);\n j++;\n }\n let u = 4;\n let h = u + 1;\n while(myNums[u] * myNums[h] <= num){\n while(myNums[u] * myNums[h] <= num){\n myNums.splice(myNums.indexOf(myNums[u] * myNums[h]),1);\n h++;\n }\n u++;\n h = u+1;\n }\n console.log(myNums);\n return 2 + myNums.reduce((x,y) => x+y);\n}", "title": "" }, { "docid": "8219a0112163e9f6b99683cebf8b5d12", "score": "0.69756883", "text": "function mySumPrimes(num) {\n /* source isPrime(): <https://stackoverflow.com/questions/11966520/how-to-find-prime-numbers-between-0-100?page=1&tab=votes#tab-top> */\n const isPrime = (number) => {\n if (number < 2) return false;\n \n const squareRootN = Math.floor(Math.sqrt(number));\n for (let index = 2; index <= squareRootN; index += 1) {\n if (number % index === 0) return false;\n }\n return true;\n }\n\n const primeNumbers = [];\n for (let dividend = 0; dividend <= num; dividend += 1) {\n if (isPrime(dividend)) primeNumbers.push(dividend);\n }\n return primeNumbers.reduce((acc, curr) => acc + curr);\n}", "title": "" }, { "docid": "a3506b92c6ba001722e9a00e0808ea06", "score": "0.6963439", "text": "function TotalOfPrime(num) {\n let primeTotal = 0\n for (var i = 2; i < num; i++) {\n for(var j = 2; j < num; j++) {\n if(i === j) {\n primeTotal += i\n }\n if(i % j == 0) {\n break\n }\n }\n }\n return primeTotal\n}", "title": "" }, { "docid": "276fe636188fa8e2516b888183c4164d", "score": "0.69377446", "text": "function iterate(n) {\n for (let i = 0; i < n; i++) {\n findSmallerPrimes();\n }\n}", "title": "" }, { "docid": "00edf27bfb3e03bc4abf189111c3d334", "score": "0.6919982", "text": "function fn(n) {\n let total = 0;\n for (let i = 1; i <= n; i++) {\n total += i;\n }\n return total;\n}", "title": "" }, { "docid": "e305c9845a7dcd4cb80cdbe8edc5feff", "score": "0.6877542", "text": "function sumPrimes(num) {\n \nvar Sum=2;\nvar primeNum=[2]\n\n//Checks for every number lower or equals to num\n for (var i=3;i<=num;i++){\n var test=0;\n \n //Check if the number is prime (is if divisible by any other prime?)\n //If it is, adds one to test value. If test value stays to 0, the number is prime\n //and is added to the sum (value Sum) and to the array containing all prime.\n for (var j=0;j<primeNum.length;j++){\n if (i%primeNum[j]==0)\n {test+=1;}\n }\n\n if (test ==0)\n {Sum+=i;\n primeNum.push(i) \n }\n \n } \n \n return Sum;\n}", "title": "" }, { "docid": "62937fb6c82f74e9d4b65db99df20a65", "score": "0.68702394", "text": "function Sum1toN(n){\n var x=0 \n for(i=0; i<= n; i++){\n x+=i\n }\n return x\n}", "title": "" }, { "docid": "2c90c384e66c35e08c1a4a3ea041d646", "score": "0.6869423", "text": "function sumPrimes(num) {\n let primes = [];\n for (let i = 0; i <= num; i++) {\n if (isPrime(i)) {\n primes.push(i);\n }\n }\n function isPrime(num) {\n for(let i = 2; i < num; i++) {\n if (num % i === 0) {\n return false\n }\n }\n return num !== 1\n }\n return primes.reduce((a, b) => a + b)\n}", "title": "" }, { "docid": "04f4fc046d0db75192e236b105796c4e", "score": "0.68642193", "text": "function sumPrimes(num) {\nlet sumaPrimo = 0,\n j = 2; // se inicio desde 2 dado que el 1 digamos es un numero ya considerado como primo.\n\nwhile( j <= num){\n if(primo(j)){\n sumaPrimo += j; \n }\n j++;\n}\nreturn sumaPrimo\n}", "title": "" }, { "docid": "c3ad8461020e5260a3de6a3b4346fbd3", "score": "0.68555814", "text": "function sum(n) {\n return (n * (n + 1)) / 2;\n}", "title": "" }, { "docid": "cb1eb039ea9463893236d261ffb51bea", "score": "0.6845954", "text": "function nthPrime(n) {\n let arr = [2];\n let nextElement = 3;\n while (arr.length < n) {\n for (let elem of arr) {\n if (elem > Math.sqrt(nextElement)) {\n arr.push(nextElement);\n break;\n } else {\n if (nextElement % elem === 0) {\n break;\n }\n }\n }\n nextElement += 2;\n }\n\n return arr[arr.length - 1];\n}", "title": "" }, { "docid": "5868e027ae7265102397aa79d6d98e1c", "score": "0.68424743", "text": "function sumPrime(num) {\r\n function isPrime(num) {\r\n var primeNumbers = [];\r\n var sieve = [];\r\n for (var i = 2; i <= num; i++) {\r\n if (!sieve[i]) {\r\n primeNumbers.push(i);\r\n for (var j = i; j <= num; j += i) {\r\n sieve[j] = true;\r\n }\r\n }\r\n }\r\n return primeNumbers;\r\n }\r\n return isPrime(num).reduce((x, y) => x + y);\r\n}", "title": "" }, { "docid": "bff41071183226f3920ea613a668d829", "score": "0.6842241", "text": "function nthPrime(n) {\n var primesArray = [2,3];\n var i = 5;\n while ( primesArray.length < n) {\n if (checkPrime(i)) {\n primesArray.push(i)\n i += 2 // increment by 2 because evens are not prime by default\n } else {\n i += 2\n }\n }\n return primesArray[n-1];\n}", "title": "" }, { "docid": "052da5e66c8a1e02ef43632f02444611", "score": "0.683965", "text": "function sumPrimes(num) {\n \n var sum = 0;\n for(var i = 2; i <= num; i++) {\n sum += (isPrime(i)) ? i : 0;\n console.log(isPrime(i));\n }\n \n return sum;\n}", "title": "" }, { "docid": "99dcb810921160f582dba26dc79e645c", "score": "0.6837973", "text": "function sum1ToN(n){\n\n}", "title": "" }, { "docid": "673da1bfcb341c615158a5b64b81c231", "score": "0.6835184", "text": "function addUpTo(n) { \n let total = 0;\n for (let i = 1; i <= n; i++) {\n total += i;\n }\n return total;\n}", "title": "" }, { "docid": "592db805d5f10dff2e0cf46dd0571896", "score": "0.68166405", "text": "function numPrimorial(n) {\n let i = 1;\n let counter = 2;\n while (n != 0) {\n if (isPrime(counter)) {\n i *= counter; \n n--;\n }\n counter++;\n }\n return i;\n}", "title": "" }, { "docid": "b92323c824bbc13fedda822242da115b", "score": "0.679004", "text": "function sumAll(n) { \n let result;\n\n if(n !== 1){\n result = n + sumAll(n-1);\n } else {\n result = n;\n }\n return result;\n }", "title": "" }, { "docid": "a75ca0522b87fd1e59fbde6d73e4b978", "score": "0.67855567", "text": "function Sum1toN(n){\n sum = 0\n for (var i=1; i<=n; i++){\n sum += i\n }\n return sum\n}", "title": "" }, { "docid": "7da298258367def341a2975307d6f166", "score": "0.67808944", "text": "function nPrimeList(n) {\n var primelist = []\n for (let i = 2; primelist.length < n; i++) {\n if (isPrime(i)) {\n primelist.push(i);\n }\n }\n return primelist;\n}", "title": "" }, { "docid": "c875aa2fa4431b62231457b0731bf4c5", "score": "0.6780758", "text": "function sieve(n) {\n\tfor (let i = 0; i < n; i++) {\n\t\tif (esPrimo(i)) {\n\t\t\tconsole.log(i)\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6123ed5cda4abc0622172231acd6b508", "score": "0.6778751", "text": "static sumPrimes(num) {\n const isPrime = num => {\n for(let i=2 ; i<= Math.sqrt(num) ; ++i) {\n if(num % i == 0) {\n return false;\n }\n }\n return true;\n }\n\n let sum = 0;\n for(let i=2 ; i<=num ; ++i) {\n console.log(sum);\n if(isPrime(i)) {\n sum += i;\n }\n }\n return sum;\n }", "title": "" }, { "docid": "85f59d959fcd55c698b4053c372633bd", "score": "0.6777787", "text": "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}", "title": "" }, { "docid": "1467950559e6103ffeb40daad830cc37", "score": "0.67763877", "text": "function addUpTo(n) {\n let total = 0;\n for (let i = 1; i <= n; i++) {\n total += i;\n }\n return total;\n}", "title": "" }, { "docid": "a08a0329a87782fe2137e7b1156ba609", "score": "0.6767109", "text": "function addUpTo(n) {\n let total = 0\n for (let i = 0; i <= n; i++) {\n total += i\n }\n\n return total\n}", "title": "" }, { "docid": "a156a5d0f8e6205923be18aeb3d554b5", "score": "0.676141", "text": "function countOfPrimeNumbers(n, m){\n let count=0;\n for(let i = n; i<= m; i++){\n if(isPrime2(i)){\n count++\n }\n }\n return count;\n}", "title": "" }, { "docid": "725073ed658b8c6773922dfa8814f38c", "score": "0.6757974", "text": "function sumPrimes(num) {\n\n\tlet primes = [2, 3];\n\n\tfor (let i = 2; i <= num; i++) {\n\n\t\t// keep track of whether prime.\n\t\t// At end use to decide to push() or not\n\t\tlet prime = true;\n\t\t\n\t\tif((i % 2 !== 0) && (i % 3 !== 0)) {\n\n\t\t\t// use another loop to assess divisors\n\t\t\tfor (let j = 5; j < i; j+=2) {\n\t\t\t\tif(i % j === 0 ) {\n\t\t\t\t\tprime = false;\n\t\t\t\t\t//console.log('i not prime', i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tprime = false;\n\t\t}\n\n\t\tif(prime) {\n\t\t\tprimes.push(i);\n\t\t}\n\t}\n\t\n\tconst reducer = (total, value) => total + value;\n return primes.reduce(reducer);\n}", "title": "" }, { "docid": "a65e88648db3f22a0f83961cfa7e1459", "score": "0.6756699", "text": "function addUpTo(n) {\n let total = 0;\n for (i = 0; i <= n; i++) {\n total += i;\n }\n return total;\n}", "title": "" }, { "docid": "a1e54f54e4279fa4aa4722a2754713b8", "score": "0.674764", "text": "function sumPrimes(num) {\n\n var primeArr = [];\n\n // loop through all numbers between 2 (inclusive) to number (not inclusive)\n // start at 2 because we know that the number is divisible by 1\n // check for a 0 remainder\n // if there is no 0 remainder, return true\n\n // check if number is prime\n function isPrime(n){\n for (let a = 2; a < n; a++){\n if (n%a === 0){\n return false;\n }\n }\n return true;\n }\n\n // add prime numbers to array\n for (let i = num; i > 1; i--){\n if (isPrime(i)){\n primeArr.unshift(i);\n }\n }\n\n // sum of all prime numbers\n return primeArr.reduce((a, b) => a+b);\n}", "title": "" }, { "docid": "f01c809956d5b9ddda076e1ab8c83c36", "score": "0.6738084", "text": "function sumToN(n){\n let sum = 0;\n for (let j = 0; j <= n; j++){\n sum +=j;\n console.log(sum);\n }\n return sum;\n}", "title": "" }, { "docid": "830b85ca20f13efc10a89d7b99274d04", "score": "0.673119", "text": "function prime2(n) {\n const data = [];\n for (let i = 1; i < n; i += 2) {\n data.push(i);\n }\n data[0] = 0;\n for(let i = 1; i < data.length; i+= 1) {\n if (data[i] > 0) {\n let k = data[i];\n let u = i * (1 + k);\n if (u > data.length) { break; }\n for (let j = u; j < data.length; j += k) {\n data[j] = 0;\n }\n }\n }\n const result = [2];\n for (let i of data) {\n if (i > 0) {\n result.push(i);\n }\n }\n return result;\n }", "title": "" }, { "docid": "fcb5a0eeaa822e3749b52d0385c14afc", "score": "0.6726546", "text": "function sumPrimes(num) {\n\tconst numsArray = [];\n\n\t// Add each num smaller or equal than num in an initial Array\n\tfor (let i = 1; i <= num; i++) {\n\t\tnumsArray.push(i);\n\t}\n\n\t// Filter the Array to only include primes and then reduce it with a sum\n\tconst primes = numsArray\n\t\t.filter((num) => {\n\t\t\tfor (let i = 2; i < num; i++) if (num % i === 0) return false;\n\t\t\treturn num > 1;\n\t\t})\n\t\t.reduce((accumulator, currentValue) => accumulator + currentValue);\n\tconsole.log(numsArray, primes);\n\treturn primes;\n}", "title": "" }, { "docid": "3541ff53c0675b80399df299a26b1bbf", "score": "0.6721526", "text": "function sumPrimes(num) {\n\n //array starts with the first prime numb since its the only non-odd prime.\n var arr = [2];\n\n\nfunction isOdd(n) {\n return Math.abs(n % 2) == 1;\n}\n \nfunction checkIfNOTPrime(max,counter) {\n return Math.abs(max % counter) == 0;\n}\n \n\n //add all odd numbers to array. if not prime , then arr.pop()\n for(var i = 2;i<=num;i++){\n if(isOdd(i)){\n arr[i] =i;\n \n //check all numbers up to i if they can be divided by i\n for(var j = 1;j<i;j++){\n if(checkIfNOTPrime(i,arr[j])){\n arr.pop();\n break;\n\n }\n } \n }\n }\n\n \n \n function add(a, b) {\n return a + b;\n }\n \n //adding all primes to get the sum\n var sum = arr.reduce(add, 0);\n\n\n\n return sum;\n}", "title": "" }, { "docid": "80a2e6566c076a9c44605a4993b04050", "score": "0.67196137", "text": "function sumAllPrimes(num) {\r\n let sum = 0;\r\n\r\n checkForPrime = num =>{\r\n for (let j = 2; j < num; j++) {\r\n if(num % j === 0){\r\n return false;\r\n }\r\n }\r\n return true\r\n }\r\n for(let i = 2; i <= num; i++){\r\n if(checkForPrime(i)){\r\n sum += i;\r\n }\r\n }\r\n return sum\r\n}", "title": "" }, { "docid": "64a9576d09192200978e09910a94a483", "score": "0.6711048", "text": "function sumPrimes(num) {\n // Helper function to check primality\n function isPrime(num) {\n for (let i = 2; i <= Math.sqrt(num); i++) {\n if (num % i == 0)\n return false;\n }\n return true;\n }\n \n // Check all numbers for primality\n let sum = 0;\n for (let i = 2; i <= num; i++) {\n if (isPrime(i))\n sum += i;\n }\n return sum;\n }", "title": "" }, { "docid": "c2e0a7a2797c30c861483ba432c2b301", "score": "0.670184", "text": "function primeNumbers(n) {\n let primes = [];\n\n nextPrime:\n for (let i = 2; i <= n; i++) {\n for (let j = 2; j < i; j++) {\n if (i % j === 0) {\n continue nextPrime;\n }\n }\n \n primes.push(i);\n }\n\n return primes;\n}", "title": "" }, { "docid": "d5b972095d61277db18225a760faea66", "score": "0.66988885", "text": "function primesToN(n) {\n\tvar result = [];\n\tfor (var i = 2; i <= n; i++) {\n\t\tif (testPrime(i)) {\n\t\t\tresult.push(i);\n\t\t}\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "a65283a1806d2991f26b77ec60e36704", "score": "0.66959786", "text": "function sum(n){\n for(i=0;i<n;++i){\n suma = suma + i;\n }\n return suma;\n}", "title": "" }, { "docid": "d3c5ed09cb374d782311e333df07a4e3", "score": "0.6695031", "text": "function sumThreeFive(n) {\n if (n < 0) {\n return 0;\n } else {\n let nums = [0];\n for (let i = 0; i < n; i++) {\n if (i % 3 === 0 || i % 5 === 0) {\n nums.push(i);\n }\n }\n return nums.reduce((sum, num) => sum + num);\n }\n}", "title": "" }, { "docid": "20f5c12db5a60854fd5d61e23ccc1cb0", "score": "0.66890085", "text": "function sumofNnumbers(number){\n let sum = 0;\n for(let count = 1; count <= number; count++){\n sum = sum + count;\n }\n return sum;\n }", "title": "" }, { "docid": "e45a082784e29827d30729dfb0924684", "score": "0.6684731", "text": "function printNPrimes(n) {\n var count = 0;\n var numberToEvaluate = 2;\n while (count <= n) {\n let possiblePrime = checkPrime(numberToEvaluate);\n if (possiblePrime) {\n console.log(possiblePrime);\n count++;\n }\n numberToEvaluate++;\n }\n}", "title": "" }, { "docid": "af599d8671ccd280bb505689d0d6fa19", "score": "0.66805756", "text": "function sumPrimes(num){\n var arr = [];\n var sum = 0;\n for (var i = num; i > 0; i--){\n if(isPrime3(i)){\n arr.push(i);\n }\n }\n console.log(arr);\n sum = sumArray(arr);\n return sum;\n}", "title": "" }, { "docid": "c67678e2e35b80686706bb0fd84b88f4", "score": "0.6671207", "text": "function sumMultiplesOf(n, p) {\n const N = Math.floor((p - 1) / n);\n return (n * (N * (N + 1))) / 2;\n}", "title": "" }, { "docid": "5dfe2fc657d7e29efa768a2332ae68e2", "score": "0.6668392", "text": "function firstPrimeAbove(n){\n var i = somePrimes.length;\n while(somePrimes[--i] > n);\n return somePrimes[++i];\n }", "title": "" }, { "docid": "ca3a941d1f6fe6c6c3e8564f00034e1c", "score": "0.66585654", "text": "function sum (n){\n\tvar result =0;\n\twhile(n > 0){\n\t\tresult = result + n--;\n\t}\nreturn result;\n}", "title": "" }, { "docid": "4263f2eca81fb6d5df4b5df3668c514d", "score": "0.6633494", "text": "function printSum(n) {\n var sum = 0;\n for (var i = 0; i <= n; i++) {\n sum += i;\n console.log(`Number: ${i}, sum: ${sum}`)\n\n }\n}", "title": "" }, { "docid": "d900ef2ab32dd75cacb77c7f6631320c", "score": "0.6627476", "text": "function Sum1toN(n) {\r\n var sum = 0;\r\n for (var i = 1; i <= n; i++) {\r\n sum += i;\r\n }\r\n return sum;\r\n}", "title": "" }, { "docid": "66345b84f83c822daecd484535765ed1", "score": "0.66198087", "text": "function sum(n) {\n\tif (n == 1) {\n\t\treturn n;\n\t}\n\treturn n + sum(n-1);\n}", "title": "" }, { "docid": "2c97a17d97c3b45d37969330b8a6e0f8", "score": "0.6590982", "text": "function sum(n) {\n // TODO: your code here\n var result=0;\n while(n>=0){\n \tresult +=n;\n n--;\n }\n return result;\n}", "title": "" }, { "docid": "0344aa0c6c22e4add7617d5a9c758763", "score": "0.6580843", "text": "function nthPrime(n) {\n let count = 0; //how many primes we have\n let curNum = 1; //which num were looking at\n while (count < n) {\n curNum++;\n if (checkPrime(curNum) === true) count++;\n }\n return curNum;\n}", "title": "" }, { "docid": "bf5030a0487dbb7aa2e95feb51506b2d", "score": "0.6577992", "text": "function sumOfFirstNCubes(n) {\n return Math.pow((n * (n + 1)) / 2, 2);\n}", "title": "" }, { "docid": "947e7b92f5786a688cd80039284174d9", "score": "0.65546083", "text": "function nth_prime(n) {\n\n}", "title": "" }, { "docid": "45cac850a3ff53501369433fb41397c2", "score": "0.6552157", "text": "function powerfulDigitSum(n) {\n var maxSum = 0;\n var a, b, sum;\n var bigInt;\n for (i = 2; i < n; i++) {\n bigInt = bigInteger(i);\n for (j = 1; j < n; j++) {\n sum = bigInt.sum();\n if (sum > maxSum) {\n maxSum = sum;\n }\n bigInt.multiply(i);\n }\n }\n return maxSum;\n}", "title": "" }, { "docid": "ccca26818e638cc58b3a54dac7e35218", "score": "0.6533064", "text": "function sumOfDistinctPrimeFactor(n){\n let sumODP = 0, factor = 2; /* 1 is not a prime number */\n while (n>1){\n if (n % factor === 0){\n sumODP += factor;\n while(n % factor === 0){\n n /= factor; /* This to makes the loop stop if n is <= 1 */\n }\n }\n factor++;\n }\n return sumODP;\n}", "title": "" }, { "docid": "b3e499f00110c0be03f11dc7d6a6303d", "score": "0.6530345", "text": "function smallestPrimeOf(n) {\n for(let i=2; i<Math.ceil(Math.sqrt(n)); i++) {\n if(n % i == 0) {\n return i;\n }\n }\n return n;\n}", "title": "" }, { "docid": "2a6b1ef39a4f33188cd5c8044029d6ba", "score": "0.6523095", "text": "function addUp(n){\n let total = 0;\n for(let i = 1;i <= n; i++){\n total += i;\n }\n return total;\n}", "title": "" }, { "docid": "9c2af7ad8e5f1eb20baaf461258b61d9", "score": "0.6522424", "text": "function bench03(n, state) {\n\tvar nHalf = n >> 1, // div 2\n\t\tx, sieve1, i, j, m;\n\n\tif (!state.bench03Sieve) {\n\t\tstate.bench03Sieve = typeof Uint8Array !== \"undefined\" ? new Uint8Array(nHalf + 1) : new Array(nHalf + 1); // set the size we need, only for odd numbers\n\t}\n\tsieve1 = state.bench03Sieve;\n\n\t// initialize sieve\n\tif (sieve1.fill) {\n\t\tsieve1.fill(0);\n\t} else {\n\t\tfor (i = 0; i <= nHalf; i++) {\n\t\t\tsieve1[i] = 0; // odd numbers are possible primes\n\t\t}\n\t}\n\n\t// compute primes\n\ti = 0;\n\tm = 3;\n\tx = 1; // number of primes below n (2 is prime)\n\twhile (m * m <= n) {\n\t\tif (!sieve1[i]) {\n\t\t\tx++; // m is prime\n\t\t\tj = (m * m - 3) >> 1; // div 2\n\t\t\twhile (j < nHalf) {\n\t\t\t\tsieve1[j] = 1;\n\t\t\t\tj += m;\n\t\t\t}\n\t\t}\n\t\ti++;\n\t\tm += 2; // or: =2 * i + 3;\n\t}\n\n\t// count remaining primes\n\twhile (m <= n) {\n\t\tif (!sieve1[i]) {\n\t\t\tx++; // m is prime\n\t\t}\n\t\ti++;\n\t\tm += 2;\n\t}\n\treturn x;\n}", "title": "" }, { "docid": "f905cd2a0db3f643e3f440b480c88c56", "score": "0.6513859", "text": "function listPrimes(n) {\n const list = [];\n const output = [];\n // Make an array from 2 to (n-1)\n for (let i = 0; i < n; i += 1) {\n list.push(true);\n }\n // remove multiples of primes starting from 2,3,5...\n for (let i = 2; i <= Math.sqrt(n); i += 1) {\n if (list[i]) {\n for (let j = i * i; j < n; j += i) {\n list[j] = false;\n }\n }\n }\n\n // All array[i] set to ture are primes\n for (let i = 2; i < n; i += 1) {\n if (list[i]) {\n output.push(i);\n }\n }\n return output;\n}", "title": "" }, { "docid": "75cc36bb59164e22d2043ad7a8c41da2", "score": "0.6500704", "text": "function sumEvenNumbers(n){\n let sum = 0;\n for(let i=1; i<=2*n-1; i+=2)\n {\n sum+=i;\n }\n return sum; \n}", "title": "" }, { "docid": "e9904d236d44d743f5e746dbac58544d", "score": "0.65000606", "text": "function addUpToFirst(n) {\n let total = 0;\n for (let i = 1; i <= n; i++) {\n total += i;\n }\n return total;\n}", "title": "" }, { "docid": "55775e1d344d605e3c474c35d9fd80d9", "score": "0.64984304", "text": "function sum(n) { \n \tif (n === 0){//stop condition\n \t\treturn 0;\n \t}\n return n + sum (n-1);\n }", "title": "" }, { "docid": "32486391f1d26407b2d10af27e45640c", "score": "0.6495808", "text": "function sumAll(n){\n if(n!==0){\n return n + sumAll(n-1)\n }\n else{\n return n\n }\n}", "title": "" } ]
c53df2009af888a515afc33c2418e767
Handles reading through each message asynchronusly Reads the new value Updates the new value in sensor API
[ { "docid": "099a5f5929d8b84892f0d59216211efb", "score": "0.0", "text": "async function kafkaListners(topic_array,username,floorNum, roomNum , type) \n{\n console.log(\"Called KafkaListner Method\")\n\n //url to Alert to send an email when required\n const url2 = \"http://localhost:8081/emailAlertToUser\";\n\n //Starts listenning to a channel\n const consumer = kafka.consumer({ groupId: `${topic_array.topic}-alert-monitor` })\n await consumer.connect();\n\n await consumer.subscribe(topic_array)\n\n //This method runs every time a new senor value is added\n await consumer.run({\n eachMessage: async ({ topic, partition, message }) => {\n \n //Caturing the sensor reading and timeStamp of each senor emmited\n let reading = Number(JSON.parse(message.value.toString()).reading);\n let timeStamp = new Date(JSON.parse(message.value.toString()).timeStamp);\n\n //Updating the main senosor server reading of corresponding sensor in the sensor API\n updateSensorReading(topic , reading)\n\n if( reading > 5 )\n {\n //Compoing the email body\n let msg = `${username} Your ${type} sensor ${topic} on floor ${floorNum} room ${roomNum} has shown a reading of ${JSON.parse(message.value.toString()).reading} on ${timeStamp.toDateString()} ${timeStamp.toTimeString()}`;\n \n //Calling the alert API to send a message\n fetch( \n url2, \n { \n method:\"POST\" , \n body: JSON.stringify({\"username\": `${username}` , \"message\": `${msg}`}) , \n \t\theaders: { \t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t'Content-Type': 'application/JSON'\n },\n } \n )\n .then( res => console.log(res.status))\n }\n },\n })\n}", "title": "" } ]
[ { "docid": "4ef9d6bd362ee759d2cbf6a5420cb922", "score": "0.64873916", "text": "function repeat(){ \n var value;\n value = analogPin0.read();\n \n socket.emit('readvalue',value);\n }", "title": "" }, { "docid": "3a269536e421daea294684b82146821e", "score": "0.6431298", "text": "function readSensor() {\n // read data from sensors\n var tempData = temp.readTemps();\n\n // add tempData to configData\n for (key in configValues) {\n if (key.indexOf(\"SENSOR_\") > -1) {\n var sensorID = configValues[key]['SENSOR_ID'];\n for (id in tempData) {\n if (id == sensorID) {\n configValues[key]['MEASUREMENT_VALUE'] = tempData[id];\n }\n }\n // add measurement ID\n configValues[key]['ID'] = uuidV4();\n }\n }\n\n // get datetime\n configValues['DATE'] = new Date().toISOString().slice(0, 19).replace('T', ' ');\n\n // get xbee port\n xbeePort = configValues['XBEE_PORT'];\n\n // attempt to measure voltage\n adc.readVoltage(function(voltage){\n if (voltage > 0) {\n configValues['VOLTAGE'] = voltage;\n }\n\n // write to database\n db.writeDb(configValues);\n\n // convert data to byte string\n var byteData = converter.arrayToByteString(configValues);\n\n // send data to xbee\n sendToXbee(byteData,serialport,0)\n });\n}", "title": "" }, { "docid": "e5825394e4cd0bd9d6fb9e477925b34e", "score": "0.6413587", "text": "function readSensor(){\n \n analogValue = analogPin0.read(); //read the value of the analog pin \n var resistance = (1023 - analogValue) * 10000 / analogValue; //get the resistance of the sensor;\n var celsius_temperature = 1 / (Math.log(resistance / 10000) / B + 1 / 298.15) - 273.15; //convert to temperature via datasheet ;\n\n console.log('Temp: ' + celsius_temperature + \" C\");\n\n analogValueS = soundSensor.read(); \n console.log('sound: ' + analogValueS );\n\n analogValueL = lightSensor.read(); \n console.log('light: ' + analogValueL);\n\n \nconst url =\" https://api.thingspeak.com/update?api_key=VSJL44RKBR7O189N&field1=\"+celsius_temperature+\"&field2=\"+analogValueL+\"&field3=\"+analogValueS;\nrequest.get(url, (error, response, body) => {\n console.log(\"Data Uploaded\");\n});\n\n}", "title": "" }, { "docid": "bb3bda55a894ac346b8f52e35d883ef7", "score": "0.64121985", "text": "on_message(message) {\r\n // database just saved a value check if our sensor is involved and if so refresh the data\r\n if (message.sender == \"controller/db\" && message.command == \"SAVED\") {\r\n for (var sensor of this.widget[\"sensors\"]) {\r\n if (message.args == sensor) {\r\n this.request_data()\r\n return\r\n }\r\n }\r\n if (\"icon_sensor\" in this.widget && message.args == this.widget[\"icon_sensor\"]) this.request_data()\r\n }\r\n if (message.sender == \"controller/db\" && message.command.startsWith(\"GET\")) {\r\n var session = gui.sessions.restore(message)\r\n if (session == null) return\r\n var data = message.get(\"data\")\r\n // add last value\r\n if (session[\"component\"] == \"value\") {\r\n var sensor = gui.configurations[\"sensors/\"+session[\"sensor_id\"]].get_data()\r\n var tag = \"#\"+this.id+\"_value\"\r\n // add value and suffix\r\n $(tag).html(data.length == 1 ? data[0] : \"N/A\");\r\n if (\"unit\" in sensor) $(tag+\"_suffix\").html(sensor[\"unit\"]);\r\n }\r\n // add timestamp\r\n else if (session[\"component\"] == \"timestamp\") {\r\n this.timestamp = data.length != 1 ? null : data[0]\r\n // update the timestsamp value\r\n this.update_timestamp()\r\n // periodically refresh the elapsed time\r\n if (this.timestamp_timer != null) clearInterval(this.timestamp_timer)\r\n this.schedule_update_timestamp()\r\n }\r\n // add chart data\r\n else if (session[\"component\"] == \"chart\") {\r\n var tag = \"#\"+this.id+\"_chart\"\r\n var chart = $(tag).highcharts();\r\n chart.hideLoading()\r\n var sensor = gui.configurations[\"sensors/\"+session[\"sensor_id\"]].get_data()\r\n // add the sensor to the xAxis of the chart\r\n chart['xAxis'][0]['categories'][session[\"index\"]] = sensor[\"description\"];\r\n // apply the suffix to the today's series\r\n var unit = \"unit\" in sensor ? sensor[\"unit\"] : \"\"\r\n chart.series[1].update({\"dataLabels\":{\"enabled\": true,\"format\":'{y}'+unit}});\r\n // add the point to the series\r\n chart.series[session[\"series\"]].addPoint([session[\"index\"], data[0], data[1]]);\r\n }\r\n // add icon\r\n else if (session[\"component\"] == \"icon\") {\r\n if (data.length != 1) return\r\n $(\"#\"+this.id+\"_icon\").removeClass()\r\n $(\"#\"+this.id+\"_icon\").addClass(\"icon-logo fas fa-5x fa-\"+data[0])\r\n }\r\n }\r\n }", "title": "" }, { "docid": "fac56e272cbedcaee9a98609d734d5d6", "score": "0.6167268", "text": "read()\n {\n var that = this;\n var motionSensorName = this.options.motionSensorName;\n\n fhem.readValue(motionSensorName, \"state\", function(err, body)\n {\n if (err) {\n that.logger.error(err);\n } else {\n var isOpen = body.indexOf(\"open\") !== -1;\n var isClosed = body.indexOf(\"closed\") !== -1;\n\n if (!isOpen && !isClosed)\n {\n that.logger.error(\"z-wave motion sensor unknown state: \" + body);\n }\n\n var state = (isOpen ? 1 : 0);\n\n that.senddata(state, that);\n }\n\n setTimeout(function()\n {\n that.read();\n }, that.options.interval * 1000);\n });\n }", "title": "" }, { "docid": "98389ff99fefd55b4f69069af0ae243a", "score": "0.6136889", "text": "function Dashbaord_update_values(){\n load_mapping_data(collect_sensors_to_read);\n}", "title": "" }, { "docid": "040d4801e3a0217568dc7d72b9dfd2b5", "score": "0.6050483", "text": "function waitForNewValue() {\n io.socket.on('CPU_STAT', function(stat) {\n vm.tempCpuGauge.refresh(stat.temperature);\n vm.voltageCpuGauge.refresh(stat.voltage);\n vm.chargeCpuGauge.refresh(stat.usage);\n vm.ramGauge.refresh(stat.ram);\n vm.socketCpuIsBusy = false;\n $scope.$apply()\n });\n\n io.socket.on('PORT_STAT', function(port) {\n vm.port = port;\n vm.socketPortIsBusy = false;\n $scope.$apply()\n });\n }", "title": "" }, { "docid": "e42c861308db9b6d4f048348a30a74c4", "score": "0.6049549", "text": "readSensor() {\n const self = this;\n if (this.i2c1) {\n async.eachSeries(this.detectors,\n (detector, next) => {\n if (detector.type === 'co2') {\n self.readCO2((err, co2) => {\n if (err) {\n console.error('CO2 READ ERROR', err);\n }\n if (co2) {\n return self.processSensorValue(detector, co2, next);\n }\n });\n } else {\n return next('Detector type not implemented');\n }\n },\n (err) => {\n if (err) {\n console.error('CO2 err', err);\n }\n if (err) {\n logger.error(err);\n }\n setTimeout(() => self.readSensor(), self.sensorReadIntervall);\n });\n } else {\n setTimeout(() => self.readSensor(), self.sensorReadIntervall);\n }\n }", "title": "" }, { "docid": "532b6bbf081e3f1731c4b9c31b361ca2", "score": "0.6004468", "text": "async readLoop() {\n\n //-- Se ejecuta indefinidamente\n //-- hasta que stream de entrada desaparezca\n while (true) {\n\n //-- Leer el valor del stream de entrada\n const { value, done } = await this.reader.read();\n\n //-- El stream se ha eliminado\n if (done) {\n console.log('[readLoop] DONE', done);\n this.reader.releaseLock();\n break;\n }\n\n //--Debug\n //console.log(\"Redeived: \" + value);\n\n //--Llamar a la funcion de procesado de datos\n if (value) {\n this.serial_received(value)\n }\n }\n }", "title": "" }, { "docid": "118a3672564287f4b3e0118f81e18bd2", "score": "0.6001048", "text": "function handleNotifications(data) {\n // console.log(\"data: \", data);\n myValue = Number(data);\n console.log(myValue);\n light_red_Value = myValue;\n myBLE_Rece.write(light_red_Characteristic, light_red_Value);\n}", "title": "" }, { "docid": "55e20fb873c966a6516b69560506fbf6", "score": "0.59605056", "text": "function read_sensor(cb){\n\n \tread_lux = light.value();\n \tread_temp = temp.value();\n\n \tcb();\n }", "title": "" }, { "docid": "d0ee4fca0e2dc09693bea3195b7626a8", "score": "0.59519047", "text": "read(callback) {\n this.sensor.read(callback);\n }", "title": "" }, { "docid": "d4c7928a4161d2be2168c96cae22d7dc", "score": "0.59061426", "text": "async function ebusd_ReadValues() {\n\n if (oPolledVars.length > 0) {\n\n adapter.log.debug(\"to poll ctr \" + oPolledVars.length + \" vals: \" + JSON.stringify(oPolledVars));\n\n try {\n const socket = new net.Socket();\n const promiseSocket = new PromiseSocket(socket);\n\n await promiseSocket.connect(parseInt(adapter.config.targetTelnetPort), adapter.config.targetIP);\n adapter.log.debug(\"telnet connected to poll variables \" + adapter.config.targetIP + \" port \" + adapter.config.targetTelnetPort);\n promiseSocket.setTimeout(5000);\n\n let retries = 0;\n for (let nCtr = 0; nCtr < oPolledVars.length; nCtr++) {\n\n let circuit = \"\";\n let params = \"\";\n if (oPolledVars[nCtr].circuit != null && oPolledVars[nCtr].circuit.length > 0) {\n circuit = \"-c \" + oPolledVars[nCtr].circuit + \" \";\n }\n if (oPolledVars[nCtr].parameter != null && oPolledVars[nCtr].parameter.length > 0) {\n params = \" \" + oPolledVars[nCtr].parameter;\n }\n let cmd = \"read -f \" + circuit + oPolledVars[nCtr].name + params;\n\n adapter.log.debug(\"send cmd \" + cmd);\n\n cmd += \"\\n\";\n await promiseSocket.write(cmd);\n\n const data = await promiseSocket.read();\n\n //received ERR: arbitration lost for YieldThisYear\n if (data.includes(\"ERR\")) {\n adapter.log.warn(\"sent \" + cmd + \", received \" + data + \" for \" + JSON.stringify(oPolledVars[nCtr]) + \" please check ebusd logs for details!\");\n\n /*\n * sent read -f YieldLastYear, received ERR: arbitration lost for {\"circuit\":\"\",\"name\":\"YieldLastYear\",\"parameter\":\"\"}\n * */\n if (data.includes(\"arbitration lost\")) {\n\n retries++;\n if (retries > adapter.config.maxretries) {\n adapter.log.error(\"max retries, skip cmd \" + cmd);\n retries = 0;\n }\n else {\n nCtr--;\n adapter.log.debug(\"retry to send data \");\n }\n }\n }\n else {\n adapter.log.debug(\"received \" + data + \" for \" + JSON.stringify(oPolledVars[nCtr]));\n }\n }\n promiseSocket.destroy();\n adapter.log.debug(\"telnet disonnected\");\n\n } catch (e) {\n adapter.log.error(\"exception from tcp socket in ebusd_ReadValues \" + \"[\" + e + \"]\");\n }\n\n\n }\n else {\n adapter.log.debug(\"nothing to poll; skip telnet\");\n }\n\n}", "title": "" }, { "docid": "eb6ee4c604e612da5132ae8d5a96aa33", "score": "0.5903179", "text": "on_message(message) {\r\n // database just saved a value check if our sensor is involved and if so refresh the data\r\n if (message.sender == \"controller/db\" && message.command == \"SAVED\") {\r\n if (message.args == this.widget[\"sensor\"]) this.request_data()\r\n }\r\n else if (message.sender == \"controller/db\" && message.command.startsWith(\"GET\")) {\r\n var session = gui.sessions.restore(message)\r\n if (session == null) return\r\n var data = message.get(\"data\")\r\n if (data.length == 1) $(\"#\"+this.id+\"_text\").html(data[0].replaceAll(\"\\n\", \"<br>\"))\r\n }\r\n }", "title": "" }, { "docid": "5c1ebc208db5343986071bb161365dba", "score": "0.58707625", "text": "function WAQIReader(manager, refreshInterval, config_waqi) {\n\n /**\n * Starts reading values.\n */\n this.startReading = function() {\n setInterval(this.read, refreshInterval);\n }\n\n this.read = function() {\n\n // Building query URL from the WAQI config file.\n var url = \"\"+ config_waqi.url + \"@\" + config_waqi.uid + \"/?token=\" + config_waqi.token;\n console.log('Querying API URL : '+url); //debug - to clean up\n\n // Querying WAQI API for data\n request({\n url: url,\n json: true\n }, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n\n console.log('--------------');\n\n if(body.data.hasOwnProperty('time')){\n console.log('time: '+body.data.time.s);\n manager.publish('aqi-s1-time', body.data.time.s);\n }else {\n console.log('temperature offline');\n }\n\n if(body.data.iaqi.hasOwnProperty('pm25')){\n console.log('PM 2.5: '+body.data.iaqi.pm25.v);\n manager.publish('aqi-s2-pm25', body.data.iaqi.pm25.v);\n }else {\n console.log('pm25 offline');\n }\n\n if(body.data.iaqi.hasOwnProperty('pm10')){\n console.log('PM 10: '+body.data.iaqi.pm10.v);\n manager.publish('aqi-s3-pm10', body.data.iaqi.pm10.v);\n }else {\n console.log('pm10 offline');\n }\n\n if(body.data.iaqi.hasOwnProperty('co')){\n console.log('CO2: '+ body.data.iaqi.co.v);\n manager.publish('aqi-s4-co2', body.data.iaqi.co.v);\n }else {\n console.log('co offline');\n }\n\n if(body.data.iaqi.hasOwnProperty('no2')){\n console.log('NO2: '+ body.data.iaqi.no2.v);\n manager.publish('aqi-s5-no2', body.data.iaqi.no2.v);\n }else {\n console.log('no2 offline');\n }\n\n if(body.data.iaqi.hasOwnProperty('so2')){\n console.log('SO2: '+ body.data.iaqi.so2.v);\n manager.publish('aqi-s6-so2', body.data.iaqi.so2.v);\n }else {\n console.log('so2 offline');\n }\n\n if(body.data.iaqi.hasOwnProperty('o3')){\n console.log('O3: '+ body.data.iaqi.o3.v);\n manager.publish('aqi-s7-o3', body.data.iaqi.o3.v);\n }else {\n console.log('o3 offline');\n }\n\n if(body.data.iaqi.hasOwnProperty('t')){\n console.log('temperature: '+body.data.iaqi.t.v);\n manager.publish('aqi-s8-temperature', body.data.iaqi.t.v);\n }else {\n console.log('temperature offline');\n }\n\n if(body.data.iaqi.hasOwnProperty('p')){\n console.log('ATM pressure: '+body.data.iaqi.p.v);\n manager.publish('aqi-s9-atmpressure', body.data.iaqi.p.v);\n }else {\n console.log('atm pressure offline');\n }\n }\n })\n }\n}", "title": "" }, { "docid": "28e7940127b6965dc5658fa93b92a1ed", "score": "0.5868053", "text": "function periodicActivity()\n{\n\n\n\ttouch_sensor_value = digital_pin_D2.read();\n\n\t if (touch_sensor_value === 1 && last_t_sensor_value === 0) {\n console.log(\"Buzz ON!!!\");\n digital_pin_D6.write(touch_sensor_value);\n } else if (touch_sensor_value === 0 && last_t_sensor_value === 1) {\n console.log(\"Buzz OFF!!!\");\n //socket.emit('message', \"absent\");\n digital_pin_D6.write(touch_sensor_value);\n }\n\n last_t_sensor_value = touch_sensor_value;\n\n\n\t//var analogValueFloat = analogPin0.read();\n\n \n\n //const client = mqtt.connect('mqtt://iot.eclipse.org', 1883, 60);\n\n\n//var msg=\"\"+analogValueFloat;\n\n/*client.on('connect', function () {\n\n\tvar topic1 = 'topic/GeneralizedIoT/'+process.env.RESIN_DEVICE_UUID;\n\tconsole.log(\"Connection Successful \"+ topic1);\n\n\tclient.publish(topic1,msg);\n});*/\n\n\n\n setTimeout(periodicActivity,1000); //call the indicated function after 1 second (1000 milliseconds)\n}", "title": "" }, { "docid": "bb7a6cdde462bd164295614e7ffe2164", "score": "0.5835164", "text": "preformDummyUpdate(){\r\n this.getSensorState();\r\n this.state.sensors.map(sensor => {\r\n //looping each sensor\r\n let updation = sensor;\r\n //to check status of each sensor has changed while we looping through\r\n //this might happen if desktop client perform update while looping through each object\r\n return fetch(`http://localhost:8080/api/sensor/${sensor.id}`)\r\n .then(response => {\r\n return response.json();\r\n })\r\n .then(result => {\r\n //only perform updation if the current status is active\r\n //1 - active, 0 - inactive\r\n if(result.status === 1){\r\n console.log(\"status active\");\r\n //change status randomly\r\n //using Math.random\r\n //range 0 - 10\r\n updation.co2Level = Math.ceil(Math.random() * Math.floor(10));\r\n updation.smokeLevel = Math.ceil(Math.random() * Math.floor(10));\r\n updation.status = 1;\r\n //calling update method\r\n this.updateSensorState(sensor.id, updation);\r\n }\r\n })\r\n .catch(error => {\r\n //if there are errors\r\n console.log(error)\r\n });\r\n });\r\n }", "title": "" }, { "docid": "05b6b8d928e2d27069f9479080ac5290", "score": "0.5831808", "text": "function startReading() {\n readSensor();\n sleep(900000).then(()=>{\n startReading();\n });\n}", "title": "" }, { "docid": "689f1b2a3af42b414e44a4a6ab2a3751", "score": "0.58030796", "text": "update(){\n axios.get(\"http://127.0.0.1:1337/read\")\n .then((result)=>{this.setState({messages : result.data})})\n .catch((err)=>{console.log(err)});\n setTimeout(()=>{this.update()},200);//check for new messages every .2 seconds\n }", "title": "" }, { "docid": "ad19bd88e5d9fb0295abe56031d6fa27", "score": "0.58014387", "text": "_onMessage (message) {\n\t\tlet valArray = new Float32Array(message.data)\n\t\tthis.emit('value', valArray)\n\t}", "title": "" }, { "docid": "3195b0e5a5d401506f5cc4a818a76493", "score": "0.5793263", "text": "async function readLoop() {\n while (true) {\n const { value, done } = await reader.read();\n if (value) {\n console.log('[READ]', value);\n textOutput.value += value + '\\n';\n }\n if (done) {\n console.log('[readLoop] DONE', done);\n reader.releaseLock();\n break;\n }\n }\n}", "title": "" }, { "docid": "9d2808186be78c5447c3fd4ffbeab953", "score": "0.5790732", "text": "function getReading() {\n console.log('Creating socket');\n let socket = new WebSocket('wss://shipchain-backend.mybluemix.net/public/messagereceive');\n socket.onopen = function() {\n\n console.log('Socket open.');\n socket.send(JSON.stringify({\n message: 'What is the meaning of life, the universe and everything?'\n }));\n console.log('Message sent.')\n };\n socket.onmessage = function(message) {\n console.log('Socket server message', message);\n let data = JSON.parse(message.data);\n temp = JSON.stringify(data, null, 2);\n\n if (temp > 25) {\n console.log(\"compensate\");\n money += 10;\n $('#money').html(\"$ \" + money);\n }\n $('#temp').html(temp + \" &#186;C\");\n console.log(\"tempd \" + temp);\n setReading(JSON.stringify(data, null, 2), money);\n getChainLength();\n\n $('#blockChain').append('<div class=\"block\"><p class=\"blockText yellow-to-gray\">' + blockHeight + '</p></div>');\n\n };\n }", "title": "" }, { "docid": "1424efd88853ad788b533da0e752c776", "score": "0.5784723", "text": "refresh() { this.data = this.read() }", "title": "" }, { "docid": "959bc5e77b078c4d52cdd939815f6a72", "score": "0.57017857", "text": "_parseDataSensor(data_buf) {\n let data = {};\n let offset = 0;\n let fail = false;\n while (offset < data_buf.length) {\n let descriptor = data_buf.readUInt8(offset);\n let size_code = (descriptor >>> 6);\n let type = descriptor & 0b00111111;\n\n let size = 0;\n if (size_code === 0b00) {\n size = 1;\n } else if (size_code === 0b01) {\n size = 2;\n } else if (size_code === 0b10) {\n size = 4;\n } else {\n fail = true;\n break;\n }\n offset += 1;\n\n if (offset + size > data_buf.length) {\n fail = true;\n break;\n }\n\n let content_buf = data_buf.slice(offset, offset + size);\n\n if (type === 0x00) {\n // Temperature (degC)\n data.temperature = content_buf.readInt16LE(0) / 100;\n } else if (type === 0x01) {\n // Voltage (mV)\n data.voltage = content_buf.readInt16LE(0) / 2;\n } else if (type === 0x02) {\n // Energy Level (%)\n data.energy = content_buf.readUInt8(0) / 2;\n } else if (type === 0x04) {\n // Illumination (Solar cell) (lx)\n data.illuminationSolarCell = content_buf.readUInt16LE(0);\n } else if (type === 0x05) {\n // Illumination (Sensor)\n data.illumination = content_buf.readUInt16LE(0);\n } else if (type === 0x06) {\n // Relative Humidity (%RH)\n data.humidity = content_buf.readUInt8(0) / 2;\n } else if (type === 0x0A) {\n // Acceleration Vector (g)\n let cont = content_buf.readUInt32BE(0);\n let status = ((cont & 0xC0000000) >>> 30);\n let status_desc = '';\n if (status === 0b00) {\n status_desc = 'Acceleration value out of bound';\n } else if (status === 0b01) {\n status_desc = 'Periodic update';\n } else if (status === 0b10) {\n status_desc = 'Acceleration wake';\n } else if (status === 0b11) {\n status_desc = 'Sensor disabled';\n }\n data.acceleration = {\n status: status,\n description: status_desc,\n x: (((cont & 0x3FF00000) >>> 20) - 512) / 100,\n y: (((cont & 0x000FFC00) >>> 10) - 512) / 100,\n z: ((cont & 0x000003FF) - 512) / 100\n }\n } else if (type === 0x23) {\n // Magnet Contact\n let v = content_buf.readUInt8(0);\n if (v === 0x01) {\n data.contact = false; // open\n } else if (v === 0x02) {\n data.contact = true; // close\n }\n }\n\n offset += size;\n }\n if (fail) {\n return null;\n } else {\n return data;\n }\n }", "title": "" }, { "docid": "fce4b06bb7e2a5576ce78995bcf18de2", "score": "0.5696086", "text": "async readWait() {\n this.notifyFromServer(\"onread\", { data: this.data });\n return this.data;\n }", "title": "" }, { "docid": "db2ebd5fa29344c07d0bcac0f4628e31", "score": "0.569489", "text": "function getReadings() {\n // get readings:\n tempSensor.read(getTemperature);\n humiditySensor.read(getHumidity);\n // if they're both numbers:\n if (!isNaN(device.temperature) && !isNaN(device.humidity)) {\n // print them and send to server:\n console.log(device);\n sendToServer(JSON.stringify(device));\n // stop reading:\n clearInterval(readingInterval);\n }\n}", "title": "" }, { "docid": "1bbcf6719f5f1617e6ab6b691450c741", "score": "0.56938356", "text": "function handleMessages() {\r\n client.on('message', (topic, incomingMessage) => {\r\n const rawMessage = incomingMessage.toString();\r\n const message = parse(rawMessage, topic);\r\n tempdata.add(message);\r\n });\r\n}", "title": "" }, { "docid": "91c30cad9e5d90059e7dc23d86d40084", "score": "0.56914306", "text": "function pullData(sensor){\n child.send(sensor);\n var timeout = setTimeout(pullData, sensor.config.clientRequestInterval, sensor);\n for (var i = 0; i < intervalArray.length; i++) {\n if(intervalArray[i].id === sensor.id){\n intervalArray.splice(i, 1); \n }\n }\n intervalArray.push({id: sensor.id, timeout:timeout});\n}", "title": "" }, { "docid": "48cae697634b2e44455c7a71e64f5703", "score": "0.56849444", "text": "async refresh() {\n const cameraUpdates = await this.fetchUpdates();\n if (cameraUpdates.res === 'busy')\n return null;\n if (cameraUpdates.res !== 'ok')\n return this.handleResponseError(cameraUpdates.res);\n Object.assign(this.rawProperties, helpers_1.deepMerge(this.rawProperties, cameraUpdates));\n this.emit('rawUpdate', cameraUpdates, this);\n // Sends to events map\n for (const updatedKey in cameraUpdates)\n if (cameraUpdates.hasOwnProperty(updatedKey))\n if (this.rawPropertyMap[updatedKey])\n this.rawPropertyMap[updatedKey](cameraUpdates[updatedKey]);\n }", "title": "" }, { "docid": "69ca39c739b90b08b0754db8eca15e0d", "score": "0.5674775", "text": "function readAllSensorData()\r\n{\r\n loadSensorData(Flow_IN_url, writeSensorValue, 'Flow_IN'); \r\n loadSensorData(Flow_OUT_url, writeSensorValue, 'Flow_OUT');\r\n loadSensorData(Pressure_url, writeSensorValue, 'Pressure');\r\n loadSensorData(O2_url, writeSensorValue, 'O2');\r\n}", "title": "" }, { "docid": "8a3ccb69af57050cdf8936225128be21", "score": "0.563816", "text": "function startPolling() {\n // Poll every 5 minute\n\n setInterval(function() {\n //Update device data\n console.log('[AtagOne] Polling data');\n Object.keys(devices).forEach(function(id) {\n updateState(devices[id].data, false);\n });\n }, 300000);\n}", "title": "" }, { "docid": "b4c1f12adf22e87d17bde50b67ef46de", "score": "0.56303716", "text": "async function onReceiveCT(node, value) {\n point = mapCT.get(node);\n if (point != null) {\n point.value = value;\n received_count +=1;\n //console.log(\"Update \"+node+\"=\"+JSON.stringify(point));\n }\n}", "title": "" }, { "docid": "30dddddcc22b458d8cb085ac646b336e", "score": "0.56282896", "text": "function UpdateRSSIAndAverage (peripheral) {\n // update RSSI every 100th of a second for each shield\n var counter1 = 0;\n var counter2 = 0;\n // create variables to store the latest average rssi value for each shield\n var averageResults1, averageResults2;\n setInterval(function () {\n peripheral.updateRssi(function(error, rssi) {\n if (error) {\n console.log(\"the error: \" + error);\n }\n // if it's Gus's shield\n if (peripheral.uuid == 'd49abe6bfb9b4bc8847238f760413d91') {\n Generate_numArr(rssi, numberArrayBLE1);\n averageResults1 = CalculateAverage(numberArrayBLE1);\n console.log('average results for ' + peripheral.advertisement.localName + ': ', averageResults1.average);\n if (counter1 > 50) {\n var rssiAvgData1 = '{\\\"deviceName\\\":\\\"' + peripheral.advertisement.localName + '\\\",\\\"rssiValue\\\":\\\"' + averageResults1.average + '\\\"}';\n console.log('rssiAvgData1: ', rssiAvgData1);\n sb.send(\"rssi\", \"rssi_info\", rssiAvgData1);\n counter1 = 0;\n }\n counter1++;\n }\n // if it's Jennifer's shield\n if (peripheral.uuid == '9e2aab25f29d49078577c1559f8f343d') {\n Generate_numArr(rssi, numberArrayBLE2);\n averageResults2 = CalculateAverage(numberArrayBLE2);\n console.log('average results for ' + peripheral.advertisement.localName + ': ', averageResults2.average);\n if (counter2 > 50) {\n var rssiAvgData2 = '{\\\"deviceName\\\":\\\"' + peripheral.advertisement.localName + '\\\",\\\"rssiValue\\\":\\\"' + averageResults2.average + '\\\"}';\n console.log('rssiAvgData2: ', rssiAvgData2);\n sb.send(\"rssi\", \"rssi_info\", rssiAvgData2);\n counter2 = 0;\n }\n counter2++;\n }\n\n console.log(\"Rssi for \" + peripheral.advertisement.localName + \": \" + rssi.toString());\n });\n }, 10);\n}", "title": "" }, { "docid": "4a92d061d49a826a3a68025eccb18419", "score": "0.5625785", "text": "function proccess_data_acquisition(data) {\n if(data.length < 1) {\n console.log(\"No data available.\");\n return;\n }\n\n console.log(\"Data available: \" + data.length);\n\n var record = underscore.max(data, record => new Date(record.time).getTime());\n\n last_timestamp = record.time;\n write_last_date();\n\n console.log(`Updating last_timestamp to ${last_timestamp}!`);\n var data_to_send = [];\n for(i=0;i<data.length;i++) {\n data_to_send.push(__ws_parser_callback(device_info, data[i]));\n }\n\n send_data_to_server(data_to_send);\n\n }", "title": "" }, { "docid": "cb8808900404a1300e3e093e666a2bcd", "score": "0.56197274", "text": "function updateSensorReading(sensorUID, reading)\n {\n fetch(`http://localhost:5000/api/updateSensorReading/${sensorUID}`, {\n method: 'put',\n body: JSON.stringify({\"reading\" : reading}),\n headers: { 'Content-Type': 'application/json' },\n })\n .then(res => console.log(res))\n \n }", "title": "" }, { "docid": "be576d044a5018ce0b511b79cb070607", "score": "0.56149834", "text": "function changeSensor() {\n // Get the new sensor ID from the dropdown menu\n let newSensor = sensorOptions.value;\n console.log(\"Changed sensor to: \" + newSensor);\n // getSensorInfo(newSensor);\n // Get the new sensor information. The callback is run when the sensor data is received\n socket.emit('sensorInfo', newSensor, setSensorValues);\n // Empty last values in newest sensor values\n}", "title": "" }, { "docid": "d8e3d07164f81500b170c177df05dc5a", "score": "0.5609463", "text": "function onMessageArrived(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n let readings = JSON.parse(message.payloadString);\n $('#Total').text(readings['Total']);\n $('#Yesterday').text(readings['Yesterday']);\n $('#Today').text(readings['Today']);\n $('#Period').text(readings['Period']);\n $('#Power').text(readings['Power']);\n $('#ApparentPower').text(readings['ApparentPower']);\n $('#ReactivePower').text(readings['ReactivePower']);\n $('#Factor').text(readings['Factor']);\n $('#Voltage').text(readings['Voltage']);\n $('#Current').text(readings['Current']); \n }", "title": "" }, { "docid": "06309f51f73954c365590513522e26e3", "score": "0.5606479", "text": "_startPollingData() {\n this._pollDataInterval = setInterval(() => this._updateEthBalance(), 5000);\n // We run it once immediately so we don't have to wait for it\n this._updateEthBalance();\n }", "title": "" }, { "docid": "cb15ebafb5d444fd5a97db72878b613f", "score": "0.5605554", "text": "update_temperature() {\n axios.get(`https://opendata-download-metobs.smhi.se/api/version/latest/parameter/1/station/162860/period/latest-hour/data.json`).\n then(response => {\n try {\n console.log(\"SMHI temp updated:\", response.data.value[0].value);\n this.temperature = response.data.value[0].value;\n this.last_temp_update_tick = this.tick;\n this.consumer.set_temperature(this.temperature);\n this.consumer.recalc();\n } catch (error) {\n console.log(\"SMHI value probably empty, retrying next tick\");\n }\n })\n .catch(error => {\n console.log(\"Something went wrong at SMHI API, keeping the last data.\");\n reject();\n });\n }", "title": "" }, { "docid": "24b8a4f1eaf2152d262741b59cb803cd", "score": "0.55992204", "text": "function humidity(){\n request('http://10.0.0.100:8181/cxf/humidity/devices/sensor/humidity', function (error, res, body) {\n if (!error && res.statusCode == 200) {\n sensor['humidity'] = body;\n console.log('Humidity Updated');\n }\n lamp();\n});}", "title": "" }, { "docid": "a65bbf2274e11d63686a9a72385d6524", "score": "0.5598947", "text": "function intervalFunc() {\n getData(function(response) {\n io.emit('data', response);\n });\n}", "title": "" }, { "docid": "a8e4d677f8e7ba0edcfeb6536779d520", "score": "0.55871564", "text": "function gotValue(error, value) {\n if (error) console.log('error: ', error);\n console.log('value: ', value);\n temp = value;\n // After getting a value, call p5ble.read() again to get the value again\n myBLE.read(valueCharacteristic, gotValue);\n}", "title": "" }, { "docid": "07b3492f5cd9cee96f3bda6cba52756a", "score": "0.55782294", "text": "function onMessageArrived_plug2(message) {\n console.log(\"onMessageArrived:\"+message.payloadString);\n let readings = JSON.parse(message.payloadString);\n $('#Total').text(readings['Total']);\n $('#Yesterday').text(readings['Yesterday']);\n $('#Today').text(readings['Today']);\n $('#Period').text(readings['Period']);\n $('#Power').text(readings['Power']);\n $('#ApparentPower').text(readings['ApparentPower']);\n $('#ReactivePower').text(readings['ReactivePower']);\n $('#Factor').text(readings['Factor']);\n $('#Voltage').text(readings['Voltage']);\n $('#Current').text(readings['Current']); \n }", "title": "" }, { "docid": "99085c3a8fd26de6bbbc53b9965da0d9", "score": "0.5573657", "text": "function UpdateToServer(){\n\tconsole.log(\"Sending motion sensor update\");\n}", "title": "" }, { "docid": "90a3b418df57883bf7e5b75b2f996368", "score": "0.55733526", "text": "refreshData() {\n this.log('refreshData');\n\n if (this.emuraIsDeleted) {\n this.log('Emura device has been deleted, the refresh loop is now stopped...');\n\n return;\n }\n\n const settings = this.getSettings();\n const emura_ip = settings.emura_ip;\n this.log('Emura ip-address: ', emura_ip);\n const emura_interval = settings.emura_interval || 10; // to prevent \"undefined\"...\n this.log('Refresh interval: ', emura_interval);\n\n this.deviceRequestControl(emura_ip);\n this.deviceRequestSensor(emura_ip);\n\n setTimeout(this.refreshData.bind(this), emura_interval * 1000);\n }", "title": "" }, { "docid": "b2b976209f3d8b0bcc8375d3a469452e", "score": "0.55651724", "text": "async ReadingSubscribers_state() {\n // initial sync\n if (!this.data.subscribers) {\n this.data.subscribers = []\n const json = await blockstack.getFile(this.subscribers_file)\n // initially there's no subscribers\n if (json) {\n this.data.subscribers = JSON.parse(json)\n this.state.add(\"SyncingExternalDBs\")\n // read in parallel\n await Promise.all(\n this.data.subscribers.map(sub => this.readExternalDB(sub.username))\n )\n this.state.drop(\"SyncingExternalDBs\")\n await this.saveFile()\n }\n // 2nd and later syncs\n } else {\n this.state.add(\"SyncingExternalDBs\")\n // read in parallel\n await Promise.all(\n this.data.subscribers.map(sub => this.readExternalDB(sub.username))\n )\n this.state.drop(\"SyncingExternalDBs\")\n this.state.add(\"SubscribersReadingDone\")\n }\n this.state.add(\"SubscribersReadingDone\")\n }", "title": "" }, { "docid": "5402d28470e254b1b44e0f8d14721543", "score": "0.5555465", "text": "onInput(msg) {\n var deviceID = this.deviceID;\n if (this.deviceID == 0) {\n deviceID = String(msg.topic);\n }\n\n if (msg.events) {\n let orgDeviceID = this.fibaro.translateDeviceID(deviceID);\n if (orgDeviceID) deviceID = orgDeviceID;\n\n this.fibaro.queryDeviceHistory(deviceID, msg.events, (result) => {\n msg.currentState = result;\n if (this.resultToPayload) {\n msg.payload = result;\n }\n this.node.send(msg);\n this.node.status({});\n }, (error) => this.node.status({ fill: \"red\", shape: \"dot\", text: error.text }));\n } else if (msg.api) {\n this.fibaro.callAPI(msg.topic, {}, (msg) => {\n this.node.send(msg);\n this.node.status({});\n });\n } else if (deviceID.includes(\"=\")) {\n this.fibaro.queryDevices(deviceID, (currentState) => {\n msg.currentState = currentState;\n if (this.resultToPayload) {\n msg.payload = currentState;\n }\n this.node.send(msg);\n this.node.status({});\n }, (error) => this.node.status({ fill: \"red\", shape: \"dot\", text: error.text }));\n } else {\n let orgDeviceID = this.fibaro.translateDeviceID(deviceID);\n if (orgDeviceID) deviceID = orgDeviceID;\n\n var property = msg.property || 'value';\n this.fibaro.queryState(deviceID, property, (currentState) => {\n msg.currentState = currentState;\n //if (property == \"value\") {\n if (this.resultToPayload) {\n msg.payload = currentState.value;\n }\n //}\n this.node.send(msg);\n this.node.status({});\n }, (error) => this.node.status({ fill: \"red\", shape: \"dot\", text: error.text }));\n }\n }", "title": "" }, { "docid": "dddb3a4629134fd5aee40c9dbf4076a9", "score": "0.5534701", "text": "function listenForTempHumidityReading() {\n\t\ttag.on('humidityChange', function(temperature, humidity) {\n\t\t\tconsole.log('\\ttemperature = %d °C', temperature.toFixed(1));\n\t\t\tconsole.log('\\thumidity = %d %', humidity.toFixed(1));\n\t\t\tvar port = 9838; //The same port that the server is listening on\n\t\t\tvar host = '127.0.0.1';\n\t\t\tvar socket = new JsonSocket(new net.Socket()); //Decorate a standard net.Socket with JsonSocket\n\t\t\tsocket.connect(port, host);\n\t\t\tsocket.on('error', function(e) {\n\t\t\t\tif(e.code == 'ECONNREFUSED') {\n\t\t\t\t\tconsole.log('wating for connection to port ' + port);\n\t\t\t\t\tsocket.setTimeout(5000, function() {\n\t\t\t\t\t\tsocket.connect(port, host, function(){\n\t\t\t\t\t\t\tconsole.log('connected to : ' + host + ':' + port);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\tconsole.log('Timeout for 5 seconds before trying port:' + port + ' again');\n\t\t\t\t}\n\t\t\t});\n\t\t\tsocket.on('connect', function() { //Don't send until we're connected\n\t\t\t\tsocket.sendMessage({\n\t\t\t\t\tTemperature: temperature.toFixed(1), Humidity: humidity.toFixed(1),\n\t\t\t\t\tMacAddr: tag._peripheral.address, SensorID: tag.id,\n\t\t\t\t\tSensorName: tag._peripheral.advertisement.localName\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "6b0bb7b1d975d93face3ff9d56fb8002", "score": "0.55282176", "text": "reportSensors() {\n let command = 1;\n let checksum = this._generateChecksum(command);\n console.log(`Sent: <${checksum}~${this.version}~${this.companyId}~255~${command}>`); //TODO: REMOVE before prod\n if (this.serialPort) {\n this.serialPort.write(`<${checksum}~${this.version}~${this.companyId}~255~${command}>`)\n }\n return new Promise((resolve, reject) => {\n let data = this.data;\n setTimeout(()=>reject(\"Timeout Error\"), 5000);\n setInterval(()=>{\n if(data !== this.data) {\n resolve(this.data);\n }\n }, 250);\n })\n }", "title": "" }, { "docid": "d887fdb5ac3c6f115a3d07237d235c87", "score": "0.5524328", "text": "continualUpdate() {\n winston.info(\"Starting the continual update...\")\n this.updateMode = true;\n this.web3.eth.subscribe('newBlockHeaders')\n .on('data', (blockHeader) => {\n winston.info(`Processing Block: ${blockHeader.number}`)\n this.currentBlock = blockHeader.number;\n this.lastBlock = blockHeader.number;\n this.processBlocks(); // Process this new block\n })\n }", "title": "" }, { "docid": "da2eca1961e79338115f0afe3004660b", "score": "0.5519085", "text": "function sendSensorReadings(socket) {\n const requestUrl = url.format({protocol: 'http', hostname: 'localhost', port: config.server.port, pathname: '/api/streams/sensorreading'});\n request({\n url: requestUrl,\n method: 'GET',\n json: true\n }, function(err, req, data) {\n if (err) {\n logger.info('Error getting Sensor Reading', err);\n return;\n }\n\n socket.emit('sensorreading', _.last(data));\n });\n}", "title": "" }, { "docid": "ce198fffed412e4f370e04a8335d51c8", "score": "0.54905605", "text": "configureSensor() {\n this.date = this.payload.split(\" \")[0]\n let sensorDetails = this.payload.split(\" \")[1].split(\",\");\n this.time = sensorDetails[0]\n this.location = sensorDetails[1]\n this.motion = sensorDetails[2]\n this.battery = sensorDetails[3]\n }", "title": "" }, { "docid": "b1d479ee8bea6265712f1b0ecf1f99bf", "score": "0.5488086", "text": "function refresh() {\n for (let _i = 0, subscribers_2 = subscribers; _i < subscribers_2.length; _i++) {\n let sub = subscribers_2[_i];\n sub(value, value);\n }\n }", "title": "" }, { "docid": "2abab63bc26be0985fbd399983b77a76", "score": "0.54813755", "text": "function processMessage(m) {\n\tswitch(m) {\n\t\tcase \"get\":\n\t\t\tprocess.send(JSON.stringify(reportJSON));\n\t\t\tbreak;\n\t\t\n\t\tcase \"start\":\n\t\t\tvar port = new SerialPort(\"/dev/ttyS0\", {\n\t\t\t\t parser: SerialPort.parsers.byteLength(3)\n\t\t\t});\n\t\t\t\n\t\t\tfunction error(err) {\n\t\t\t\tif (err) {\n\t\t\t\t\tconsole.log('AR - Error on write: ' + String(err.message));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* set up the handlers for port events */ \n\t\t\t\n\t\t\t// open errors will be emitted as an error event \n\t\t\tport.on('error', error);\n\n\t\t\t// fires whenever data arrives on the input buffer\n\t\t\tport.on('data', function (data) {\n\t\t\t\tconsole.log(\"AR - Got a message back from the Arduino: [\" + String(data[0]) + \",\" + String(data[1]) + \",\" + String(data[2]) + \"]\");\n\t\t\t\tvar d = data.readInt16LE(); // takes the first two bytes from the data buffer and turns them into a 16 bit int\n\t\t\t\tvar incomingCRC = data[2]; // this is the CRC\n\t\t\t\tvar calculatedCRC = calcCRC([data[0], data[1]]);\n\t\t\t\tvar goodCRC = true;\n\t\t\t\t\n\t\t\t\tif (d == -256) {\n\t\t\t\t\tconsole.log(\"AR - Bad Master->Slave CRC, retrying sensor read\");\n\t\t\t\t\tgoodCRC = false;\n\t\t\t\t} else if (calculatedCRC != incomingCRC) {\n\t\t\t\t\tconsole.log(\"AR - Bad Slave->Master CRC, retrying sensor read\");\n\t\t\t\t\tgoodCRC = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (startMode == true) {\n\t\t\t\t\tif (d == -512) {\n\t\t\t\t\t\tconsole.log(\"AR - Start mode ready received\");\n\t\t\t\t\t\tgoodCRC = false;\n\t\t\t\t\t\tstartMode = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(\"AR - Message received in startMode, but bad message\");\n\t\t\t\t\t\tgoodCRC = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (goodCRC) {\n\t\t\t\t\tconsole.log(\"AR - CRC passed, got regular message\")\n\t\t\t\t\treportJSON.dataValues[dataNumber] = d;\t\n\t\t\t\t\treportJSON.error = false;\n\t\t\t\t\tdataNumber++;\n\t\t\t\t\tif (dataNumber > maxdataNumber) {\n\t\t\t\t\t\tdataNumber = 0;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tport.flush();\n\t\t\t\t}\n\t\t\t\tarduinoReady = true;\n\t\t\t\n\t\t\t});\n\t\t\t\n\t\t\t// Start polling the arduino \n\t\t\tsetInterval(function() {\n\t\t\t\tif (arduinoReady) {\n\t\t\t\t\t\n\t\t\t\t\tvar messageBytes;\n\t\t\t\t\t\n\t\t\t\t\tif (startMode) {\n\t\t\t\t\t\tconsole.log(\"AR - Sending start mode bytes\")\n\t\t\t\t\t\tmessageBytes = [2, 0];\t\n\t\t\t\t\t\tport.drain();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmessageBytes = [0, dataNumber];\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmessageBytes.push(calcCRC(messageBytes));\n\t\t\t\t\t\n\t\t\t\t\twriteAndDrain(port, messageBytes, error);\n\t\t\t\t\tconsole.log(\"AR - Sending message to arduino: [\" + String(messageBytes) + \"]\");\t\t\t\t\t\n\t\t\t\t\tnumResponseErrors = 0;\n\t\t\t\t\t\n\t\t\t\t\tarduinoReady = false;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"Arduino not ready, misses: \" + String(numResponseErrors));\n\t\t\t\t\tnumResponseErrors++;\n\t\t\t\t\tif (numResponseErrors > 100) {\n\t\t\t\t\t\tconsole.log(\"Big Problem\");\n\t\t\t\t\t\treportJSON.error = true;\n\t\t\t\t\t\tport.drain();\n\t\t\t\t\t\tarduinoReady = true;\n\t\t\t\t\t\tstartMode = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 100);\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "77b9b2c22961f9c0527aecdf42744d97", "score": "0.547716", "text": "function requestDataFromBoard(interval, sensor, num) { //Sensor 0 for temp, sensor 1 for light. Num 0-3 for esp32\r\n socket.emit('requestDataFromOneBoard', [interval,sensor,num]); //Here we tell the server to call the function \"requestDataFromBoard\" with a argument called \"intervall\"\r\n //The intervall value is the period of time between each data transmit from the ESP32 to the server. Typical values can be everything form 100ms to 100s\r\n console.log(\"requestDataFromBoard was called with intervall: \" + interval + \", Sensor: \" + sensor + \" HOUSE: \" + num);\r\n}", "title": "" }, { "docid": "87146fdefe99102432a3566a4c2c213b", "score": "0.54767084", "text": "async function update_value() {\n if(document.getElementById('error_message')) {\n document.getElementById('error_message').remove();\n }\n\n counter = 0;\n create_spinner();\n slide = document.getElementById('slide');\n document.getElementById('feed').innerHTML = \"\";\n this.error_message = \"\";\n\n // send Get request \n const response = await fetch(repfeed_url + slide.value, {method: 'GET',})\n .then(response => response.text())\n .then((response) => {\n // if the backend returns empty list, set an error message\n if (response.length != 2) {//the lengh is 2 because it is the length of empty arry\n //clean respond\n tweets_array = response.split(\",\");\n more_twwets();\n } else {\n create_error_message();\n }\n // stop spinner\n document.getElementById('spinner').remove();\n }) \n .catch ((error) => {\n console.log(error);\n })\n }", "title": "" }, { "docid": "f7782c9a095fc1e85bf65c2941d374e1", "score": "0.5467123", "text": "ModbusUpdate(callback) {\n this.connect(()=>{\n this.ReadAction((err, data)=>{\n callback(err, data);\n });\n });\n }", "title": "" }, { "docid": "2e29cb03dc13e8226a9c400dd09d34d7", "score": "0.5467047", "text": "_triggerRandomUpdate() {\n return WebSocketService.getRandom('pulsar.dedis.ch:9000')\n .then(msg => {\n this._timestamp = Date.now();\n this.setState({\n random: buf2hex(msg.R),\n timestamp: msg.T.time,\n counter: 0\n });\n\n const self = this;\n setTimeout(() => self._checkCountDown(), REFRESH_COUNTER_INTERVAL);\n })\n .catch((e) => {\n console.error(e);\n\n this.setState({\n error: 'Oops, something went wrong.'\n });\n });\n }", "title": "" }, { "docid": "f00c8c7c951eb69354c7ba1ad41e3912", "score": "0.5457282", "text": "function setupSensors() {\n let writableSensors = {};\n\n virtualDev.onChange = tupples => {\n tupples.forEach(tupple => {\n var show = {\n name: tupple.attribute.id,\n lastUpdate: tupple.attribute.lastUpdate,\n oldValue: tupple.oldValue,\n newValue: tupple.newValue\n };\n console.log('------------------ON VIRTUAL DEVICE CHANGE ---------------------');\n console.log(JSON.stringify(show, null, 4));\n console.log('----------------------------------------------------------------');\n if (writableSensors[tupple.attribute.id]) writableSensors[tupple.attribute.id].write(tupple.newValue);\n // sensor[tupple.attribute.id] = tupple.newValue;\n });\n };\n\n sensorConfig.forEach(sensor => {\n var pinMatch = sensor.pin.match(/([AD])(\\d+)/);\n var isAnalog = pinMatch[1] === 'A';\n var pin = parseInt(pinMatch[2]);\n\n // initialize sensor data\n if( sensor.attr !== null ) {\n currentData[sensor.attr] = sensor.val;\n }\n\n switch (sensor.type) {\n case 'TemperatureAndHumiditySensor':\n let tempHumSensor = new DHTDigitalSensor(pin,DHTDigitalSensor.VERSION.DHT11,DHTDigitalSensor.CELSIUS);\n tempHumSensor.stream(200, function(res) {\n if (res) {\n let change = false;\n if (res[0] !== currentData['temperature']) {\n currentData['temperature'] = res[0];\n change = true;\n }\n if (res[1] !== currentData['humidity']) {\n currentData['humidity'] = res[1];\n change = true;\n }\n if (res[2] !== currentData['heatIndex']) {\n currentData['heatIndex'] = res[2];\n change = true;\n }\n if (change) dataChange();\n }\n // console.log('TemperatureAndHumiditySensor temp = ', temp,'hum = ', hum,'heatIndex = ', heatIndex);\n });\n break;\n\n case 'LightAnalogSensor':\n new LightAnalogSensor(pin).stream(2000, function(res) {\n if (res !== currentData[sensor.attr] && res !== false) {\n \tif (Math.abs(res- currentData[sensor.attr]) > 2 ) {\n \tcurrentData[sensor.attr] = res;\n \tdataChange();\n \t\t\t}\n }\n });\n break;\n\n case 'Button':\n new Digital(pin).stream(100, function(res) {\n if (res !== currentData[sensor.attr] && res !== false) {\n currentData[sensor.attr] = res !== 0;\n dataChange();\n }\n });\n break;\n\n case 'UltrasonicRanger':\n new UltrasonicDigitalSensor(pin).stream(100, function(res) {\n if (res !== currentData['range'] && res !== false) {\n currentData['range'] = res;\n dataChange();\n }\n });\n break;\n\n case 'SoundAnalogSensor':\n new Analog(pin).stream(100, function(res) {\n if (res !== currentData['sound'] && res !== false) {\n currentData['sound'] = res;\n dataChange();\n }\n });\n break;\n\n case 'RotaryAngleAnalogSensor':\n new Analog(pin).stream(1000, function(res) {\n if (res !== currentData[sensor.attr] && res !== false) {\n\t\t // RXIE: filter out little noise\n if (Math.abs(res- currentData[sensor.attr]) > 5 ) {\n \t\t\tcurrentData[sensor.attr] = res;\n dataChange();\n }\n }\n });\n break;\n\n case 'LEDSocketKit':\n writableSensors['led'] = new Digital(pin);\n break;\n\n case 'Buzzer':\n writableSensors['buzzer'] = new Digital(pin);\n break;\n }\n });\n}", "title": "" }, { "docid": "46486b39adf367a8c393fbff1408aa56", "score": "0.5452757", "text": "continualUpdate() {\n logger.info(\"Starting the continual update...\")\n this.updateMode = true;\n this.web3.eth.subscribe('newBlockHeaders')\n .on('data', (blockHeader) => {\n logger.info(`Processing Block: ${blockHeader.number}`)\n this.currentBlock = blockHeader.number;\n this.lastBlock = blockHeader.number;\n this.processBlocks(); // Process this new block\n })\n }", "title": "" }, { "docid": "e2e1775c189bb4b4fb47af81b4c0c001", "score": "0.544177", "text": "function readFoodStock(){\nvar readFood = database.ref('Food')\nreadFood.on(\"value\",(data)=>{\n foodS = data.val();\n foodObj.updateFoodStock(foodS);\n})\n\n\n}", "title": "" }, { "docid": "ed683b4741d113b78ac4d149a1ea7705", "score": "0.5430395", "text": "function loopUpdates(){\n\n\t\tvar loopInterval = setInterval(function(){\n\n\t\t\tif(isConnected){\n\t\t\t\tsendComStatus(false);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tclearInterval(loopInterval);\n\t\t\t}\n\t\t}, timeInterval);\t\n\t}", "title": "" }, { "docid": "b4e4e872c497a8251ca6181d093ef8ed", "score": "0.54195994", "text": "function messageEventHandler(topic, message, packet){\n\t\n\tconsole.log('The message has been published on topic ' + topic);\n\tif (topic == topicSub){//timeInterval\n\t\tintervalTime = message;\t\t\n\t\tconsole.log(\"Inerval time has changed to \" + intervalTime);\n\t\t\n\t\t //time interval changed, new timer will be set\n\t\tclearInterval(timeout);\n\t\ttimeout = setInterval(readPeriodically, intervalTime*1000, peripheralGlobal);\n\n\t\t//handling energy saving mode\n\t\tif(intervalTime > 10 && enableEnergySavingMode){\n\t\t\tenergySavingMode = 1;\n\t\t\tmqttClient.publish(\"refreshInfo\",\"Refresh rate is \" + intervalTime + \" seconds. Energy Saving Mode ON\");\n\t\t}\n\t\telse {\n\t\t\tenergySavingMode = 0;\n\t\t\tclearInterval(timeoutEnergyCon);//when to wake up device from a sleep\n\t\t\tmqttClient.publish(\"refreshInfo\",\"Refresh rate is \" + intervalTime + \" seconds. Energy Saving Mode OFF\");\n\t\t}\n\n\t}else if(topic == topicSubLED){//displayStatus\n\t\tif (message == 'on' && s == 0){//prevent from uncotroled turning off and on with unrelevant messages\n\t\t\ts = 1;\n\t\t\twriteChar.write(new Buffer([0]), false, writeDataCallback);\n\t\t\t\n\t\t}else if(message == 'off' && s == 1){\n\t\t\ts = 0;\n\t\t\twriteChar.write(new Buffer([0]), false, writeDataCallbackOff);\n\n\t\t}\n\n\t\t\n\t}else if(topic == topicSubMicro){//microbitStatus\n\t\tvar accelerationX = accMemoryNew[0]+0.01;\n\t\tvar accelerationY = accMemoryNew[1]+0.01;\n\t\tvar accelerationZ = accMemoryNew[2]+0.01;\n\t\tvar M_PI = 3.14159;\n\t\tvar pitch = 180 * Math.atan (accelerationX/Math.sqrt(accelerationY**2 + accelerationZ**2))/M_PI;\n\t\tvar roll = 180 * Math.atan (accelerationY/Math.sqrt(accelerationX**2+ accelerationZ**2))/M_PI;\n\t\tvar yaw = 180 * Math.atan (accelerationZ/Math.sqrt(accelerationX**2 + accelerationZ**2))/M_PI;\n\t\t//comaparing acceleration from a consecutive measurements\n\t\t/*if(accMemory[0]**2 + accMemory[2]**2 + accMemory[1]**2 < accMemoryNew[0]**2 + accMemoryNew[2]**2 + accMemoryNew[1]**2){\n\t\t\t//mqttClient.publish(\"info\", \"Microbit has a positive acceleration. Euler's angles are: pitch = \"+accelerationX + \" roll = \" + roll + \" yaw = \" + yaw, publishCallback);\n\t\t\t//mqttClient.publish(topicPub, \"Microbit has a positive acceleration\", publishCallback);\n\t\t} else{\n\t\t\t//mqttClient.publish(\"info\", \"Microbit has a positive acceleration\", publishCallback);\n\t\t\t//mqttClient.publish(topicPub, \"Microbit has a negative acceleration. Euler's angles are: pitch = \"+pitch + \" roll = \" + roll + \" yaw = \" + yaw, publishCallback);\n\t\t}*/\n\t}else if(topic == savingT){\n\t\tif(message == \"1\")\n\t\t\tenableEnergySavingMode=1;\n\n\n\t\tmqttClient.publish(\"refreshInfo\", \"Energy Saving Mode: \" + enableEnergySavingMode );\n\t\tconsole.log(\"Energy Saving Mode: \" + enableEnergySavingMode);\n\t}\n\n}", "title": "" }, { "docid": "b8ad9141c275905fdbfe0237c6cd0063", "score": "0.54087716", "text": "updateSensorListeners(sensor_info) {\n this.log('updateSensorListeners');\n\n const oldInsideTemperature = this.getState()['measure_temperature.inside'];\n this.log('oldInsideTemperature: ', oldInsideTemperature);\n const oldOutsideTemperature = this.getState()['measure_temperature.outside'];\n this.log('oldOutsideTemperature: ', oldOutsideTemperature);\n\n const inside = Number(sensor_info[1]);\n const outside = Number(sensor_info[3]);\n this.setCapabilityValue('measure_temperature', inside);\n this.setCapabilityValue('measure_temperature.inside', inside);\n this.log('Temp inside:', inside);\n this.setCapabilityValue('measure_temperature.outside', outside);\n this.log('Temp outside:', outside);\n\n // --- Flowcards logic\n if (oldInsideTemperature !== inside) {\n this.log('new inside airco temperature °C:', inside);\n this.setCapabilityValue('measure_temperature.inside', inside);\n\n const device = this;\n const tokens = {\n inside_temperature: inside,\n };\n\n const state = {\n 'measure_temperature.inside': inside,\n };\n\n // trigger inside temperature flows\n const driver = this.getDriver();\n driver\n .triggerInsideTemperatureMoreThan(device, tokens, state)\n .triggerInsideTemperatureLessThan(device, tokens, state)\n .triggerInsideTemperatureBetween(device, tokens, state)\n .v3triggerInsideTemperatureMoreThan(device, tokens, state)\n .v3triggerInsideTemperatureLessThan(device, tokens, state)\n .v3triggerInsideTemperatureBetween(device, tokens, state);\n }\n\n if (oldOutsideTemperature !== outside) {\n this.log('new outside airco temperature °C:', outside);\n this.setCapabilityValue('measure_temperature.outside', outside);\n\n const device = this;\n const tokens = {\n outside_temperature: outside,\n };\n\n const state = {\n 'measure_temperature.outside': outside,\n };\n\n // trigger outside temperature flows\n const driver = this.getDriver();\n driver\n .triggerOutsideTemperatureMoreThan(device, tokens, state)\n .triggerOutsideTemperatureLessThan(device, tokens, state)\n .triggerOutsideTemperatureBetween(device, tokens, state)\n .v3triggerOutsideTemperatureMoreThan(device, tokens, state)\n .v3triggerOutsideTemperatureLessThan(device, tokens, state)\n .v3triggerOutsideTemperatureBetween(device, tokens, state);\n }\n\n return Promise.resolve();\n }", "title": "" }, { "docid": "7e7f389f1ad3765d843e2e87b54950ca", "score": "0.5406926", "text": "function loop() {\n let ir1_value = ir1.readSync();\n if (ir1_value === 1) {\n parking_status.parkingFirst = \"available\";\n redLED1.writeSync(0);\n greenLED1.writeSync(1);\n }\n else {\n parking_status.parkingFirst = \"not_available\";\n greenLED1.writeSync(0);\n redLED1.writeSync(1);\n }\n\n let ir2_value = ir2.readSync();\n if (ir2_value === 1) {\n parking_status.parkingSecond = \"available\";\n redLED2.writeSync(0);\n greenLED2.writeSync(1);\n }\n else {\n parking_status.parkingSecond = \"not_available\";\n greenLED2.writeSync(0);\n redLED2.writeSync(1);\n }\n\n post(parking_status);\n}", "title": "" }, { "docid": "b2bf0f0a2fd20b6fa545b7ab57d360f5", "score": "0.5404453", "text": "function gotData() {\n //Read the data between line breaks\n var currentString = serial.readStringUntil(\"\\r\\n\");\n\n //Trigger the right drum\n if(currentString == '1'){\n kick.amp(0.8);\n\n //Release note\n setTimeout(function(){\n kick.amp(0.0, 0.1);\n }, 100);\n }\n if(currentString == '2'){\n snare.amp(0.8);\n\n //Release note\n setTimeout(function(){\n snare.amp(0.0, 0.1);\n }, 100);\n }\n if(currentString == '3'){\n hat.amp(0.5);\n\n //Release note\n setTimeout(function(){\n hat.amp(0.0);\n }, 20);\n }\n if(currentString == '4'){\n tomOne.amp(0.5);\n\n //Release note\n setTimeout(function(){\n tomOne.amp(0.0, 0.1);\n }, 100);\n }\n if(currentString == '5'){\n tomTwo.amp(0.5);\n\n //Release note\n setTimeout(function(){\n tomTwo.amp(0.0, 0.1);\n }, 100);\n }\n\n\n console.log(currentString);\n}", "title": "" }, { "docid": "eda7b82ed8b093d67492c6c37cd18d6f", "score": "0.53958964", "text": "function aReadDataCallback(error, data) { \n\tif (error) {\n\t\tconsole.log(\"error reading data\");\n\t} else {\n\t\t//memory elements for tracking microbit's acceleration\n\t\taccMemory[a] = accMemoryNew[a];\n\t\t//unsigned int, microbit range is +/-2g\n\t\taccMemoryNew[a] = parseInt(data.toString('hex'), 16);\n\t\taccMemoryNew[a] = accMemoryNew[a]*5/Math.pow(2,8);//to get the real acc, this value needs to be multiplied with g = 9,81 m/s^2\n\t\t//accMemoryNew[a] = accMemoryNew[a]*5/Math.pow(2,16);\n\t\t\t\n\n\t\t//writing values with corresponding label into console and .txt file\n\t\tif(a == 0)\n\t\t\tconsole.log('Accelerometer data: ');\n\n\t\tconsole.log(\"a\" + coordinates[(a)%3] + \" = \"+ data.toString('hex') + \", a\" + coordinates[(a)%3] + \" = \" +accMemoryNew[a]+ \"*9.81 m/s^2\");\n\t\taccStream.write('a' + coordinates[(a)%3] + \" = \" + data.toString('hex') + ' ');\n\n\t\tmqttClient.publish('acc', accMemoryNew[a]+ \"*9.81 m/s^2\");\n\n\t\t//the way of tracking if current data label is x, y or z\n\t\tif (a === 2){\n\t\t\taccStream.write('\\r\\n ');\n\t\t\ta = 0;\n\t\t} else a++;\t\t\t\n\t\t\n\n\n\t\t//peripheralGlobal.disconnect(disconnectCallback);\n\t}\n}", "title": "" }, { "docid": "2702d10f566e880127d06ec2aa24cb27", "score": "0.53953207", "text": "update(mode = \"Read\") {\n if (this.config == {}) {\n this.notify(\"No configuration selected, can't update\", \"danger\");\n return;\n }\n\n let masterAddr = this.config.masterAddr;\n\n // If the mode is write then set it, 'Read' is the default value provided by prepareConfig()\n this.config.mode = mode;\n // Set default values for anything that might be null\n this.config = this.prepareConfig(this.config);\n\n console.log(\"Updating with mode: \" + mode);\n\n // Send it to the master\n this.requestOut = true;\n this.statusMsg = \"Request Out...\";\n axios\n .post(`http://${masterAddr}/model`, this.config, {\n headers: {\n \"Content-Type\": \"application/json\",\n },\n })\n .then((resp) => {\n // console.log(resp);\n // I despise the next ~10 lines of code\n for (let rtu_index = 0; rtu_index < resp.data.RTUs.length; rtu_index++) {\n let rtu = resp.data.RTUs[rtu_index];\n for (let device_index = 0; device_index < rtu.devices.length; device_index++) {\n const device = rtu.devices[device_index];\n this.config.RTUs[rtu_index].devices[device_index].state = device.state;\n this.config.RTUs[rtu_index].devices[device_index].pv = device.pv;\n this.config.RTUs[rtu_index].devices[device_index].sv = device.sv;\n }\n }\n // We don't just want to do this:\n // this.config = resp.data;\n // Because then every time the config is updated (frequently), a new object would be\n // loaded into memory, and all the Vue components that use the devices in the config\n // would have to rebind to them. This way, we only update the state, not the whole object.\n this.requestOut = false;\n this.statusMsg = \"Request returned OK.\";\n })\n .catch((_err) => {\n // console.log(err);\n console.error(\"The master API is not responding (tried at %s). Is it running?\", masterAddr);\n this.requestOut = false;\n this.statusMsg = \"Request Error: see console.\";\n });\n }", "title": "" }, { "docid": "9b32cd9432b44fadb4b812ae4a317e4b", "score": "0.5390467", "text": "function read_sensor_values () {\n var sensor_values = {}\n console.log(\"start reading sensor values\");\n try {\n var temperature_val = read_temp();\n sensor_values.luminosity = read_luminosity();\n sensor_values.temperature_c = temperature_val.temp_c || 0;\n sensor_values.temperature_f = temperature_val.temp_f || 0;\n sensor_values.humidity = read_humidity();\n console.log(temperature_val);\n } catch (e) {\n console.log(\"You killed me! =(... \" + e);\n } finally {\n //cleanup();\n }\n \n return sensor_values;\n}", "title": "" }, { "docid": "658e45651244046ca90869fca5780524", "score": "0.53841734", "text": "on_message(message) {\r\n // database just saved a value check if our sensor is involved and if so refresh the data\r\n if (message.sender == \"controller/db\" && message.command == \"SAVED\") {\r\n if (message.args == this.widget[\"sensor\"]) {\r\n if (\"group_by\" in this.widget) {\r\n if (! message.has(\"group_by\") || message.get(\"group_by\") != this.widget[\"group_by\"]) return\r\n } else {\r\n if (message.has(\"group_by\")) return\r\n }\r\n // remove all series\r\n var chart = $(\"#\"+this.id+\"_body\").highcharts();\r\n while(chart.series.length > 0) chart.series[0].remove(false)\r\n chart.redraw()\r\n chart.colorCounter = 0;\r\n // request the updated data\r\n this.request_data()\r\n }\r\n }\r\n else if (message.sender == \"controller/db\" && message.command.startsWith(\"GET\")) {\r\n var session = gui.sessions.restore(message)\r\n if (session == null) return\r\n var data = message.get(\"data\")\r\n var chart = $(\"#\"+this.id+\"_body\").highcharts();\r\n chart.hideLoading()\r\n var sensor = gui.configurations[\"sensors/\"+session[\"sensor_id\"]].get_data()\r\n var series = {}\r\n series[\"name\"] = sensor[\"description\"]+\" \"+session[\"label\"]\r\n series[\"type\"] = session[\"style\"]\r\n series[\"id\"] = message.args\r\n series[\"data\"] = data\r\n if (!(\"tooltip\" in series)) series[\"tooltip\"] = {};\r\n if (!(\"dataLabels\" in series)) series[\"dataLabels\"] = {};\r\n var unit = \"unit\" in sensor ? sensor[\"unit\"] : \"\"\r\n series[\"tooltip\"][\"valueSuffix\"] = unit\r\n series[\"dataLabels\"][\"format\"] = \"{y}\"+unit\r\n // if the data is a string, add flags\r\n if (sensor[\"format\"] == \"string\") {\r\n flags = [];\r\n for (var i = 0; i < data.length; i++) {\r\n if (data[i][1] === null || data[i][1] === \"\") continue;\r\n // TODO: replace img with icon\r\n flags[i] = {'x': data[i][0], 'shape': 'circlepin', 'title': '<img width=\"'+series['width']+'\" heigth=\"'+series['heigth']+'\" src=\"images/'+sensor['module_id']+\":\"+sensor['group_id']+\":\"+sensor['sensor_id']+\"_\"+data[i][1]+'.png\">'};\r\n }\r\n series['data'] = flags;\r\n }\r\n // ensure a series with the same name is not already in the chart\r\n for (var existing_series of chart.series) {\r\n if (existing_series[\"name\"] == series[\"name\"]) return\r\n }\r\n // attach the series to the chart\r\n chart.addSeries(series);\r\n }\r\n }", "title": "" }, { "docid": "c9715a8fba32806c1042b1a4509d70d4", "score": "0.5379871", "text": "function onRead(readInfo) {\n if (conn_id < 1 || !f_openport) {\n return;\n }\n var uint8View = new Uint8Array(readInfo.data);\n var len = uint8View.length;\n\n if (!len) {\n console.log('read null', readIndex);\n extractPackage(readArray, readIndex, function() {\n readIndex = 0;\n setTimeout(function() {\n chrome.serial.read(conn_id, 1, onRead);\n }, 200);\n });\n return;\n }\n if (readIndex + len >= readBuffSize) {\n extractPackage(readArray, readIndex, function() {\n readIndex = 0;\n });\n }\n readArray.set(uint8View, readIndex);\n readIndex += len;\n // Keep on reading.\n chrome.serial.read(conn_id, 64, onRead);\n}", "title": "" }, { "docid": "0f86796d76f1a65648f40374cd26f1a3", "score": "0.53731674", "text": "function dataStream(data){\n //lets just make sure that initConfig has been setup\n if(!initConfigComplete){\n return;\n }\n //serial connection is active\n serialConnect = true;\n\n //storing data as global variable\n window.serialChannel = data;\n //console.log(data);\n for (var i in data) {\n var value = Math.round((data[i] + Number.EPSILON) * 100) / 100;\n\n if(GlobalConfigArray['serialChannel'][i]['transform'] === 'on'){\n value = TransformData(GlobalConfigArray['serialChannel'][i],'serialChannel',value);\n if(typeof window.transformSerial == 'undefined' || !(window.transformSerial instanceof Array)){\n window.transformSerial = new Array();\n }\n window.transformSerial[i] = value;\n }\n //change title if set\n if(GlobalConfigArray['serialChannel'][i]['serialChannel-Name']){\n var channelName = GlobalConfigArray['serialChannel'][i]['serialChannel-Name'];\n changeInnerHTMLbyClass('serialChannel-'+i+'-title',channelName);\n }\n if(GlobalConfigArray['serialChannel'][i]['serialChannel-Unit']){\n //change units if Set\n var channelUnit = GlobalConfigArray['serialChannel'][i]['serialChannel-Unit'];\n changeInnerHTMLbyClass('serialChannel-'+i+'-unit',channelUnit);\n }\n changeInnerHTMLbyClass('serialChannel-'+i+'-value',value);\n };\n\n\n if(GlobalConfigArray['userChannel'] && GlobalConfigArray['userChannel'].length > 0){\n if(typeof window.userChannel == 'undefined' || !(window.userChannel instanceof Array)){\n window.userChannel = new Array();\n }\n var userChannels = GlobalConfigArray['userChannel'];\n for (var chNum in userChannels) {\n\n window.userChannel[chNum] = TransformData(userChannels[chNum],'userChannel',null);\n //console.log( TransformData(userChannels[chNum],'userChannel',null));\n //change title if set\n var channelName = GlobalConfigArray['userChannel'][chNum]['userChannel-Name'];\n changeInnerHTMLbyClass('userChannel-'+chNum+'-title',channelName);\n //change units if Set\n var channelUnit = GlobalConfigArray['userChannel'][chNum]['userChannel-Unit'];\n changeInnerHTMLbyClass('userChannel-'+chNum+'-unit',channelUnit);\n changeInnerHTMLbyClass('userChannel-'+chNum+'-value',window.userChannel[chNum]);\n }\n }\n\n //save data if needed/requested\n let timenow = Date.now();\n\n //store incoming data in local array\n localDataStreamArray(timenow);\n\n if(startRecordData == 0 && recordingData) {\n startRecordData = Date.now();\n saveData();\n }\n\n if(recordingData)(setRecordTime(timenow,startRecordData));\n\n if(recordingData && $('#statusText').html() != 'Recording'){\n $('#statusText').html('Recording');\n $('#recordCircleIcon').removeClass('text-muted');\n $('#recordCircleIcon').addClass('text-danger');\n $('#recordCircleIcon').addClass('RecordBlink');\n }\n\n if(!recordingData && $('#statusText').html() != 'Not recording'){\n $('#statusText').html('Not recording');\n $('#recordCircleIcon').removeClass('text-danger');\n $('#recordCircleIcon').addClass('text-muted');\n $('#recordCircleIcon').removeClass('RecordBlink');\n }\n\n\n}", "title": "" }, { "docid": "2c7b9545d9e7c7c9e59e87f1dbe35f4c", "score": "0.5352566", "text": "function sendcc() {\n var output = midi.outputs.get(device_output_ID);\n var init_off = [0x80, 55, 55]; // note on, middle C, full velocity\n output.send(init_off); //\n sleep(100);\n\n //sleep(100);\n\n console.log(analog_cc.length + toggle_cc.length + 1);\n\n console.log(\"values_sent = \" + values_sent);\n\n if(values_sent==0){\n\n for (i = 0; i < analog_cc.length + toggle_cc.length + toggle_2_CC.length + toggle_3_CC.length + 1; i++) {\n sleep(10);\n //if field is empty send a a skip message and get out of the loop\n if (document.getElementById(\"form_cc\").elements[i].value == \"\") {\n var init = [0xD0, 84];\n var output = midi.outputs.get(device_output_ID);\n output.send(init); //\n sleep(10);\n continue;\n }\n var noteOnMessage = [0xC0, parseInt(document.getElementById(i).value)]; // note on, middle C, full velocity\n var output = midi.outputs.get(device_output_ID);\n output.send(noteOnMessage); //omitting the timestamp means send immediately.\n }\n\n console.log(\"values_sent = \" + values_sent);\n\n values_sent = 1;\n\n document.getElementById(\"state\").innerHTML = \"CC values loaded succesfully\";\n\n sleep(1000);\n }\n\n /*\n if (device_is_finished) {\n document.getElementById(\"state\").innerHTML = \"CC values loaded succesfully\";\n device_is_finished = 0;\n }\n */\n}", "title": "" }, { "docid": "981a454e6677a3a565b3527da570dcc0", "score": "0.53482574", "text": "update(sensorVal) {\n let now = millis();\n if (now - this.lastUpdate > this.updateInterval)\n {\n this.lastUpdate = now; \n this.er = sensorVal - (this.black/2.0); // >0 -> dann auf linie; >0 -> dann neben Linie\n let dT = (now-this.lastTime) ; // Zeitdifferenz in Millisekunden.\n this.lastTime = now;\n this.integral = this.er*dT;\n this.derivative = (this.er-this.erLast)/dT;\n \n let dAngV = this.ki*this.integral + this.kd * this.derivative + this.kp * this.er;\n if (this.log)\n print(\"dT: \" + dT \n + \", Error:\" + this.er\n + \", kp: \", (this.kp * this.er)\n + \", kd: \" + (this.kd * this.derivative)\n + \", deltaAngularV: \", dAngV);\n this.bot.angularVelLeft = constrain(this.bot.maxAngularV + dAngV, 0, this.bot.maxAngularV); // mehr nach rechts, also linkes Rad schneller\n this.bot.angularVelRight = constrain(this.bot.maxAngularV - dAngV, 0, this.bot.maxAngularV); // und rechtes Rad langsamer\n \n //bot.setMotorL((int) constrain(bot.maxAngularV + dAngV, 0, bot.maxAngularV)); // mehr nach rechts, als linkes Rad schneller\n //bot.angularVelRight = constrain(bot.maxAngularV - dAngV, 0, bot.maxAngularV); // und rechtes Rad langsamer\n \n this.er_last = this.er;\n }\n }", "title": "" }, { "docid": "9035a073dde89ef81cb65206e62e56b6", "score": "0.5345854", "text": "function getData() {\r\n // this part is the same as usual. Get values from PHP, parse, and then store in array\r\n var ajax_two = new XMLHttpRequest();\r\n ajax_two.open(\"GET\", \"../../403/php/getValues.php\", true);\r\n ajax_two.send();\r\n var tempStore = [];\r\n\r\n ajax_two.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n var data_ = JSON.parse(this.responseText);\r\n for (var a = 0; a < data_.length; a++) {\r\n // if the value read is less than the min sensor value\r\n // make the percentage 0\r\n if(Number(data_[a].value) < min_sensor_values[a]){\r\n tempStore[a] = 0;\r\n }\r\n // if the value read is larger than the max sensor value\r\n // make the percentage 100\r\n else if(Number(data_[a].value) > max_sensor_values[a]){\r\n tempStore[a] = 100;\r\n }\r\n // else, convert to percentage\r\n else{\r\n var val = Number(data_[a].value);\r\n // input gets converted to percentage and stored\r\n tempStore[a] = (val/max_sensor_values[a])*100;\r\n }\r\n }\r\n }\r\n };\r\n // we return the resolved promise\r\n return new Promise(resolve => {\r\n setTimeout(() => {\r\n resolve(tempStore);\r\n }, updateEverySeconds/2);\r\n });\r\n}", "title": "" }, { "docid": "88f99602d70da3ac943f7ecc20789e5f", "score": "0.534359", "text": "sensorStats() {\n const {\n props: {\n range,\n },\n } = this\n this.clearSensorLoop = setTimeoutLoop(() => {\n const newEnd = new Date().setMilliseconds(0)\n // 604800000 = 7 days ago, 432000000 = 5 days ago, 86400000 = 24 hours ago \n const newStart = newEnd - (range * 60 * 60 * 1000)\n return ajaxGet(`${cmdGetSensorStats}?newStart=${newStart}&newEnd=${newEnd}`)\n .then((data) => {\n const {\n loadSensorData,\n } = this.props\n\n loadSensorData({ data })\n })\n .catch(err => {\n console.log(`CATCH ERR (sensorStats): ${err.message}`)\n throw new Error(err.message)\n })\n },\n 5000, 5)\n }", "title": "" }, { "docid": "951650174384cd28a21db75d1dc397c5", "score": "0.53396624", "text": "async function update_device_cache_data(jsonObj){\n var date = new Date(); // current datetime\n var log_time = date.toISOString().slice(0, 19).replace('T', ' '); // string that is excepted by mysql DATETIME format\n var currentUpdateTime = log_time;\n\n // if emergancy button has been pressed\n // create new record in sos_incidents table\n if(jsonObj.sos_status == 1){\n // check incident status: if there is already an incident from this device with status \"open\" of \"handle\" - dont add new incident\n // if there are incidents from this device with status \"closed\" or no incidents at all from this device - add new incident\n mysqlPool.query(`SELECT * FROM sos_incidents WHERE device_sn = ${jsonObj.GSTSerial} AND status=\"open\" OR status=\"handle\"`,function(err, result, fields){\n if(err) throw err;\n else{\n // if there is a new incidient and it is not a repeated insident from same device\n // add new incident\n if(result.length == 0){\n mysqlPool.query(`INSERT INTO sos_incidents(device_sn, latitude, longitude, pulse, time_log, status)\n VALUES(${jsonObj.GSTSerial}, \"${jsonObj.latitude}\", \"${jsonObj.longitude}\", ${jsonObj.pulse}, \"${log_time}\", \"open\");`, function(err, result, fields){\n if(err) throw err;\n else{\n /* ################ for local test - uncomment this part ################ */\n console.log(`device : ${jsonObj.GSTSerial} - emergancy!!`);\n }\n })\n }\n }\n })\n }\n \n // pass the update object and the time stamp to the function\n calcAvgSpeedAndUpdateCacheTable(jsonObj, log_time); \n \n\n /* updating the last update time of the device inside ./util_files/devices_update_status.txt */\n // the goal is to store last update time for all connected devices\n // this way we can check if the device was disconnected or not\n // by comparing the update time in the file with the current time and \n // if the difference is longer then 8 second - device is concidered as 'offline'\n await update_devices_status_file(jsonObj,currentUpdateTime);\n \n\n\n setTimeout(function(){\n // get the object with the same deviceId from ./util_files/devices_update_status.txt file\n // read from 'updateTime' file - get all content of the file\n fs.readFile('./database/database_files/util_files/devices_update_status.txt', 'utf8', function(err, data) {\n if (err) throw err;\n \n // parsing the data to JSON array - we know it's not empty because of previous actions\n // we know the json object with update time and device id is in the array\n var dataJsonArr = JSON.parse(data);\n \n // find the object by deviceId\n for(var i=0; i<dataJsonArr.length; i++){\n // if found the object\n if(dataJsonArr[i].deviceId == jsonObj.GSTSerial){\n // if compared to current time (past 8 sec) - no change - the device is considered offline\n if(dataJsonArr[i].lastUpdateTime.localeCompare(currentUpdateTime) == 0){\n // remove the object from the array\n dataJsonArr.splice(i, 1);\n \n // write to file - write the updated Json Array - overwrite the existing data of the txt file\n fs.writeFile('./database/database_files/util_files/updateTimeDevices.txt', JSON.stringify(dataJsonArr), function (err) {\n if (err) throw err;\n });\n \n set_device_status(jsonObj.GSTSerial, 0);\n console.log(`device id: ${jsonObj.GSTSerial} - offline`);\n // output in terminal - for debugging purposes\n }\n }\n }\n });\n },8000); // 8 sec\n}", "title": "" }, { "docid": "1a6c706af72807398294fc79b64c40b3", "score": "0.53366935", "text": "function apiUpdator()\n{\napiUpdateInterval= setInterval(function () {\n callApiToUpdate(n);\n n=parseInt(n)+1;\n io.sockets.emit(\"upbroadcast\", { code: 1, log: \"updated\" });\n}, 20000);\n}", "title": "" }, { "docid": "ef067adaa2ea863db0e2e132a096829f", "score": "0.5333718", "text": "listen() {\n setInterval(async () => {\n const val = await readVal(this.ch, true);\n\n this.log(val);\n\n if (this.on && val > this.threshold) {\n this.log('Put off');\n this.putOffTool();\n } else if (!this.on && val <= this.threshold) {\n this.log('Put on');\n this.putOnTool();\n }\n }, 1000)\n }", "title": "" }, { "docid": "1add4b1a54fde8b5b52cb141daeb346c", "score": "0.5331186", "text": "_read(sz){\n console.log('sz ' + sz);\n if(this.count > 0){\n console.log('pushing');\n \n /*\n Pushing the data to the readable buffer when <streamObject>.read method is called\n This fires \"data\" event.\n */ \n let ret = true;\n while(ret) {\n ret = this.push(`Data From Explicit Read Call : ${this.count} \\n`);\n }\n //Decrement the count.\n this.count--;\n } else {\n // console.log('not pushing');\n // this.push();\n }\n }", "title": "" }, { "docid": "bd09c698f02eec395b1720319b420944", "score": "0.5327674", "text": "function updateMessages () { // 19255\n getCurrentDisplayValue().then(function (msg) { // 19256\n ctrl.messages = [ getCountMessage(), msg ]; // 19257\n }); // 19258\n } // 19259", "title": "" }, { "docid": "b6fe63e05bd2bf33b6374ab524a91cdf", "score": "0.53104997", "text": "request_data() {\r\n // ask for the icon\r\n if (\"icon_sensor\" in this.widget) {\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"GET\"\r\n message.args = this.widget[\"icon_sensor\"]\r\n gui.sessions.register(message, {\r\n \"component\": \"icon\",\r\n \"sensor_id\": this.widget[\"icon_sensor\"]\r\n })\r\n this.send(message)\r\n }\r\n // ask data for the chart\r\n for (var i = 0; i < this.widget[\"sensors\"].length; i++) {\r\n var sensor_id = this.widget[\"sensors\"][i]\r\n // request sensor's configuration\r\n this.add_configuration_listener(\"sensors/\"+sensor_id, gui.supported_sensors_config_schema)\r\n // for the first sensor in the list ask for current measures to populate the header\r\n if (i == 0) {\r\n // ask for the current measure\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"GET\"\r\n message.args = sensor_id\r\n gui.sessions.register(message, {\r\n \"component\": \"value\",\r\n \"sensor_id\": sensor_id\r\n })\r\n this.send(message)\r\n // ask for the timestamp\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"GET_TIMESTAMP\"\r\n message.args = sensor_id\r\n gui.sessions.register(message, {\r\n \"component\": \"timestamp\",\r\n \"sensor_id\": sensor_id\r\n })\r\n this.send(message)\r\n }\r\n // ask for yesterday's range\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"GET\"\r\n message.args = sensor_id+\"/day/range\"\r\n message.set(\"timeframe\", \"yesterday\")\r\n gui.sessions.register(message, {\r\n \"component\": \"chart\",\r\n \"sensor_id\": sensor_id,\r\n \"series\": 0,\r\n \"index\": i\r\n })\r\n this.send(message)\r\n // ask for today's range\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"GET\"\r\n message.args = sensor_id+\"/day/range\"\r\n message.set(\"timeframe\", \"today\")\r\n gui.sessions.register(message, {\r\n \"component\": \"chart\",\r\n \"sensor_id\": sensor_id,\r\n \"series\": 1,\r\n \"index\": i\r\n })\r\n this.send(message)\r\n }\r\n }", "title": "" }, { "docid": "018962c64476958abb042967cc6accfd", "score": "0.53090996", "text": "function updateValue() {\r\n var message = xRTML.MessageManager.create({action:'update', trigger:'chart1Trigger', data:{index:1, value:50}});\r\n xRTML.ConnectionManager.getById('myConnection').send({channel:'myChannel', content:message}); \r\n}", "title": "" }, { "docid": "3e0c61b31952096a9373aab896709c4f", "score": "0.5305248", "text": "async function db_data() {\r\n var tempStore = [];\r\n tempStore = await getData();\r\n var returnVal = sensor_value(tempStore);\r\n return returnVal;\r\n}", "title": "" }, { "docid": "2d865d6df7d3c2e3d42b0662b6061865", "score": "0.5300664", "text": "putData(newValue) {\n let now = new Date(Date.now());\n for (let i = 0; i < 4; i++) {\n // push new value to 4 sample qtyt data array\n // while pop out value which is \"outdated\"\n let currLength = this.qtytMonitor[i].length;\n this.qtytMonitor[i].push(newValue);\n let popped = 0;\n\n // only process data if there are atleast 10 data points\n if (this.qtytMonitor[i].length < 0) continue;\n\n while (\n (now - new Date(this.qtytMonitor[0].recv_time)) / 60000 >\n qtyt[i].duration.value\n ) {\n popped += qtytMonitor[i].shift();\n }\n // recalc\n this.qtytAvg[i] =\n (this.qtytAvg[i] * currLength -\n popped +\n newValue.temp_value.value) /\n this.qtytMonitor[i].length;\n // fire event if avg temp is in range\n if (\n this.qtytAvg[i] >= qtyt[i].temp_from.value &&\n this.qtytAvg[i] < qtyt[i].temp_to.value\n ) {\n eventEmitter.emit(\n 'inrange',\n this.mqttconnection,\n qtyt[i],\n this.pat_id,\n this.device,\n this.qtytAvg[i]\n );\n }\n }\n }", "title": "" }, { "docid": "1320ebec129e23a9102b78d88094984b", "score": "0.52916723", "text": "function gotData() {\n var currentString = serial.readLine(); // read the incoming string\n trim(currentString); // remove any trailing whitespace\n if (!currentString) return; // if the string is empty, do no more\n console.log(currentString); // println the string\n valeurArduino = currentString; // save it for the draw method\n}", "title": "" }, { "docid": "923f444fd7f89fb62d404e80d1ad4e5d", "score": "0.52906543", "text": "function onMessageArrived(message) {\n var arrvMessage = message.payloadString;\n var dataTemp = arrvMessage.split(\",\");\n if(dataTemp[0]==='temp'){\n var temperature = parseFloat(dataTemp[1]).toFixed(2);;\n $scope.safeApply(function() {\n $scope.temperature=temperature+' °C';\n });\n }\n else if(dataTemp[0]==='turn'){\n if(dataTemp[2]==='1'){\n $scope.lightStatus1 = (dataTemp[1]==='on');\n }\n else if(dataTemp[2]==='2'){\n $scope.lightStatus2 = (dataTemp[1]==='on');\n }\n else if(dataTemp[2]==='3'){\n $scope.lightStatus3 = (dataTemp[1]==='on');\n }\n else if(dataTemp[2]==='4'){\n $scope.lightStatus4 = (dataTemp[1]==='on');\n }\n else if(dataTemp[2]==='5'){\n $scope.lightStatus5 = (dataTemp[1]==='on');\n }\n }\n else if(dataTemp[0]==='servo'){\n if(dataTemp[2]==='1'){\n $scope.servoStatus1 = (dataTemp[1]==='on');\n }\n else if(dataTemp[2]==='2'){\n $scope.servoStatus2 = (dataTemp[1]==='on');\n }\n }\n\n }", "title": "" }, { "docid": "c57ba84634be868aae74b0330e9c1f75", "score": "0.5278992", "text": "received(incoming) {\n if (incoming.type === 'minute') {\n setBitCoinData({ ...bitCoinData, minute: incoming.data });\n }\n }", "title": "" }, { "docid": "97c76f77e58b50336a767f0430382fa2", "score": "0.5277762", "text": "function onMessageArrived(message) {\r\n console.log(\"El mensaje recibido es: \"+message.payloadString);\r\n\t//sensor=document.getElementById(\"sensor_val\");\r\n\t//sensor.innerHTML=message.payloadString;\r\n\taccion(message.payloadString);\r\n }", "title": "" }, { "docid": "a7653af41dd67126584dc8a77823070a", "score": "0.52760255", "text": "function vibeReading(data) {\n var vibeSensorValue = data.VibeValue;\n if (vibeSensorValue == 0) {\n $('#vibeValue').html(\"OK\").css(\"color\", \"green\");\n } else {\n $('#vibeValue').html($(\"#vibrationAlert\").html()).css(\"color\", \"red\");\n }\n}", "title": "" }, { "docid": "e4fe50799e99f76dc1691887b5e919ba", "score": "0.52748376", "text": "function StatusReader() {\n var reader = new EventEmitter();\n var currTemp = 20;\n var currDepth = 0;\n var processSettings = function processSettings(parts) {\n var setparts = parts.split(',');\n var settingsCollection = {};\n for (var s = 0; s < setparts.length; s++) {\n var lastParts = setparts[s].split('|');\n settingsCollection[lastParts[0]] = lastParts[1];\n }\n reader.emit('firmwareSettingsReported', settingsCollection);\n return settingsCollection;\n };\n var processItemsInStatus = function processItemsInStatus(status) {\n if ('iout' in status) {\n status.iout = parseFloat(status.iout);\n }\n if ('btti' in status) {\n status.btti = parseFloat(status.btti);\n }\n if ('vout' in status) {\n status.vout = parseFloat(status.vout);\n }\n };\n reader.parseStatus = function parseStatus(rawStatus) {\n var parts = rawStatus.split(';');\n var status = {};\n for (var i = 0; i < parts.length; i++) {\n var subParts = parts[i].split(':');\n switch (subParts[0]) {\n case '*settings':\n status.settings = processSettings(subParts[1]);\n break;\n default:\n status[subParts[0]] = subParts[1];\n }\n }\n processItemsInStatus(status);\n return status;\n };\n return reader;\n }", "title": "" }, { "docid": "5b2997de36167919a15b86bbef75c7a5", "score": "0.5273933", "text": "function poll_sensors()\n{\n let button_values = [];\n for (let i = 0; i < button_gpios.length; i++) {\n button_values[i] = !GPIO.read(button_gpios[i]);\n if (button_values[i]) {\n print('BTN', i + 1, ' is pressed');\n }\n }\n\n let message = {\n temperature: bme.readTemperature(),\n humidity: bme.readHumidity(),\n pressure: bme.readPressure(),\n light_level: bh1730.read_lux(),\n buttons: button_values,\n system: {\n uptime: Sys.uptime(),\n free_ram: Sys.free_ram(),\n },\n };\n\tprint('Temperature: ', message.temperature, '*C');\n\tprint('Humidity: ', message.humidity, '%RH');\n\tprint('Pressure: ', message.pressure, 'hPa');\n print('Light level: ', message.light_level, ' lux');\n\n let topic = Cfg.get('device.id') + '/sensors';\n let ok = MQTT.pub(topic, JSON.stringify(message), 1);\n print('Published: ', ok ? 'yes' : 'no', ' topic: ', topic);\n}", "title": "" }, { "docid": "82f7060c169b1f7c22bff59927d9dc3d", "score": "0.5272404", "text": "function getResponse(message) {\n // extract pin state 0:\n if (message.pinStates[0] === 1){ // if it's high\n sensorState = 'HIGH'; // change the text\n bgColor = '#FF0000'; // change the fill color\n } else { // if it's low\n sensorState = 'low'; // change the text\n bgColor = 0; // change the fill color\n }\n httpGet('/json','json',getResponse); // get another reading\n}", "title": "" }, { "docid": "ff20333614b3b49eda550e87fa3135c4", "score": "0.5265042", "text": "function onMessageArrived(message) {\n console.log(message.payloadString);\n console.log(typeof message.payloadString)\n \n // dataTest = JSON.stringify(dataTest);\n // console.log(dataTest.Battery);\n console.log(message.destinationName);\n\n if (message.destinationName == \"FlightLog\") {\n var data = eval('(' + message.payloadString + ')');\n // battery\n\n var battery = data.Battery.split(\",\")\n var voltage = batteryTmp[0];\n var level = batteryTmp[1];\n var current = batteryTmp[2];\n\n // time\n // now = new Date();\n // now.setTime(dataTest.TimeStamp * 1000);\n // dateTmp = now.toLocaleTimeString();\n // date.push(dateTmp);\n\n // channels\n // channelsTmp = dataTest.ServoOutput.split(\",\");\n // channelOne.push(channelsTmp[0]);\n // channelTwo.push(channelsTmp[1]);\n // channelThr.push(channelsTmp[2]);\n // channelFou.push(channelsTmp[3]);\n // channelFiv.push(channelsTmp[4]);\n // channelSix.push(channelsTmp[5]);\n // channelSev.push(channelsTmp[6]);\n // channelEig.push(channelsTmp[7]);\n // channelFiv.push(1500);\n\n // velocity\n velocityTmp = dataTest.Velocity.split(\",\");\n EKF = dataTest.EKF;\n Mode = dataTest.Mode;\n Status = dataTest.SystemStatus;\n\n // attitude\n attitudeTmp = dataTest.Attitude.split(\",\");\n\n // x = document.getElementById(\"EKF\"); //查找元素\n // x.innerHTML=\"EKF : \" + EKF + \" \";\n\n // y = document.getElementById(\"Mode\"); //查找元素\n // y.innerHTML=\"Mode : \" + Mode + \" \";\n\n // z = document.getElementById(\"Status\"); //查找元素\n // z.innerHTML=\"System Status : \" + Status + \" \";\n\n var \n\n // data\n batteryNumber.innerHTML= current; \n batteryLevel.innerHTML= level;\n heightValue.innerHTML= \"10.0\";\n disValue.innerHTML= \"10.0\";\n vsValue.innerHTML= \"10.0\";\n hsValue.innerHTML= \"10.0\";\n\n len = date.length\n if (len > 20) {\n voltage.shift();\n current.shift();\n level.shift();\n\n date.shift();\n\n channelOne.shift();\n channelTwo.shift();\n channelThr.shift();\n channelFou.shift();\n channelFiv.shift();\n channelSix.shift();\n channelSev.shift();\n channelEig.shift();\n\n };\n\n // ecahrts\n option.series[0].data[0].value = 11\n eChart.setOption(option,true);\n\n // battery\n if (batteryTmp > 30) {\n var tmp = batteryTmp - 30;\n var width = tmp.toString() + '%';\n $(\".progress-bar-info\").css(\"width\", width);\n }\n else if(batteryTmp > 10){\n var tmp = batteryTmp - 10;\n var width = tmp.toString() + '%';\n $(\".progress-bar-info\").css(\"width\", 0);\n $(\".progress-bar-warning\").css(\"width\", width);\n }else{\n var tmp = batteryTmp;\n var width = tmp.toString() + '%';\n $(\".progress-bar-info\").css(\"width\", 0);\n $(\".progress-bar-warning\").css(\"width\", 0);\n $(\".progress-bar-danger\").css(\"width\", width);\n }\n\n }\n\n // for decision\n\n // else if (message.destinationName == \"Navigation\"){\n // decision = dataTest.Navigation;\n // // decision = \"a\";\n\n // // time\n // now = new Date();\n // now.setTime(dataTest.TimeStamp * 1000);\n // dateTmp = now.toLocaleTimeString();\n\n // de = document.getElementById(\"decision\"); //查找元素\n // de.innerHTML += \"<p>\" + dateTmp + \" : \" + decision + \"</p>\";\n // de.scrollTop = de.scrollHeight;\n // }\n\n\n}", "title": "" }, { "docid": "8cc6f511a7e63f6c08adfdceeeffc77b", "score": "0.52601594", "text": "reportAnalogPins() {\n this.firmataBoard.analogPins.forEach((element,analogPinNumber) => {\n this.firmataBoard.analogRead(analogPinNumber, (d) => {\n const pinNumber = this.firmataBoard.analogPins[analogPinNumber]\n\n if (d !== this.previousValues[pinNumber]) {\n this.newDataSubject.next(this.firmataBoard.pins); \n this.analogReadSubject.next({analogPin:analogPinNumber, pin:pinNumber, value:d});\n }\n this.previousValues[pinNumber] = d;\n });\n });\n }", "title": "" }, { "docid": "8241aeec13e5880bf3f40d12b50e8f07", "score": "0.52593327", "text": "async _read() {\n // Should start pushing data into the queue\n // Read data from the underlying Web-API-readable-stream\n if (this.released) {\n this.push(null); // Signal EOF\n return;\n }\n this.pendingRead = this.reader.read();\n const data = await this.pendingRead;\n // clear the promise before pushing pushing new data to the queue and allow sequential calls to _read()\n delete this.pendingRead;\n if (data.done || this.released) {\n this.push(null); // Signal EOF\n }\n else {\n this.bytesRead += data.value.length;\n this.push(data.value); // Push new data to the queue\n }\n }", "title": "" }, { "docid": "f601069ff2fef92e46f5fe17c0e3f839", "score": "0.5258063", "text": "async function conf(){\n \n const options = {\n method: 'GET',\n url: Host+`api/obtenerPines/${agentID}`,\n //url: `http://173.212.235.89:3000/api/obtenerPines/${agentID}`,\n json: true\n }\n \n \n \n try {\n ObtPines = await request(options)\n } catch (e) {\n this.error = e.error.error\n return\n }\n \n \n \n //itera sobre todo el json para colocar cada valor del pin en un array diferente\n if (Array.isArray(ObtPines)) {\n ObtPines.forEach(m => {\n idPin.push(m.id)\n estado.push(m.estado)\n clasePin.push(m.clasePin)\n accion.push(m.accionPin)\n descripcion.push(m.descripcionPin)\n temp.push(-1)\n Auxtemp.push(-1)\n sensorId.push(m.sensorId)\n descansoVentilador.push(false)\n nroPin.push(m.nroPin)\n estadoPuertas.push(false)\n depende.push(m.depende)\n tiempoMotorAuxi.push(m.tiempoMotor)\n swPuertas.push(false)\n swMotor.push(false)\n swPuertas2.push(0)\n })\n }\n //la variable tiempoMotorAuxi se agarra el tiempo como string y aqui se lo transforma a numeros enteros en milisegundos\nfor (let i = 0; i < tiempoMotorAuxi.length; i++) {\n var a=parseInt(tiempoMotorAuxi[i].substring(3,5))\n var b=parseInt(tiempoMotorAuxi[i].substring(6,8))\n \n var c = b*1000\n var d= (a*60)*1000\n var time = d+c\n tiempoMotor.push(time)\n\n \n \n}\n \n temp[14]=35\n console.log(temp)\n // temp[16]=600\n // temp[17]=600\n //descansoVentilador[18]=true\n //descansoVentilador[19]=true\n \n \n\n \n}", "title": "" }, { "docid": "4bd94ea44cc14b90b6f46f5efe18df8c", "score": "0.5257427", "text": "async function workerMessaged(ev) {\n updateArray(ev.data);\n log(\"chart updated\");\n ipcRenderer.send('asynMessage', normalData)\n}", "title": "" }, { "docid": "5731fc2423e188e4f23d2c00f341bc56", "score": "0.5255781", "text": "function updateTickets() {\r\n lastRead = lastUnread;\r\n}", "title": "" }, { "docid": "a37f6402e267e680b7b840498457047d", "score": "0.5247713", "text": "function Tick() {\n\n\tif( streamClient.isRunning() ) {\n\t\tif( streamClient.secondsSinceInput() > config.timeoutSecs ) {\n\t\t\tconsole.log( \"#\", interval_s, \"s since last data; reconnecting.\" );\n\t\t\tstreamClient.launch( config, termTracker );\n\t\t}\n\t\tconsole.log( termTracker.getCountLine( config.stringPadding ) );\n\t\ttermTracker.endEpoch();\n\t\ttermTracker.startEpoch();\n\t}\n\n\tsetTimeout( Tick, config.updateIntervalSecs*1000 );\n}", "title": "" }, { "docid": "181b25a69339c33375ca2fd15641a1f1", "score": "0.52406025", "text": "readData() {\n console.log(\"reading data in nutritional tip \" + userid);\n fb.database()\n .ref(\"response/\" + userid + \"/avatarHealth\")\n .once(\"value\", (dataSnapShot) => {\n var temp = dataSnapShot.val();\n baseHealth = temp;\n this.setState({ baseHealth: temp });\n });\n fb.database()\n .ref(\"response/\" + userid + \"/avatarStatus\")\n .once(\"value\", (dataSnapShot) => {\n var temp = dataSnapShot.val();\n baseStatus = temp;\n this.setState({ baseStatus: temp });\n });\n fb.database()\n .ref(\"response/\" + userid + \"/currency\")\n .once(\"value\", (dataSnapShot) => {\n var temp = dataSnapShot.val();\n baseCurrency = temp;\n this.setState({ baseCurr: temp });\n });\n fb.database()\n .ref(\"response/\" + userid + \"/backgroundColor\")\n .once(\"value\", (dataSnapShot) => {\n var tempColor = dataSnapShot.val();\n this.setState({ backgroundColor: tempColor });\n });\n }", "title": "" } ]
06f5379d1b028a9dcc6f775b810963c6
requests file content using link parameter
[ { "docid": "59fad8d5374b8af9ebc51753bb37d64f", "score": "0.61030203", "text": "async requestFile(path) {\n\t\tif (typeof path !== 'string') return;\n\n\t\t// Sends an HTTP request to \"path\" and returns text content\n\t\tlet fileContents = await axios({\n\t\t\turl: path,\n\t\t\tresponseType: 'blob',\n\t\t\tmethod: 'get'\n\t\t})\n\t\t\t.then(async response => response.data)\n\t\t\t.catch(error => console.error(`Error: Failed to download file from url ${path}`));\n\n\t\t// returns data fetched from source\n\t\treturn fileContents;\n\t}", "title": "" } ]
[ { "docid": "06e05ce0a07eb408521593d8578061a3", "score": "0.6471518", "text": "function getDocument(url) {\n var ajax;\n\n ajax=new XMLHttpRequest();\n if(ajax) {\n ajax.onreadystatechange = function() {\n if(ajax.readyState==4 || ajax.readyState=='complete') {\n processLinks(ajax);\n }\n };\n \n ajax.open('get', url, true); \n ajax.setRequestHeader('accept', g.mediaType);\n ajax.send(null);\n }\n }", "title": "" }, { "docid": "f066a9b23cdce566126938a0fcf75a4b", "score": "0.6436449", "text": "function requestPageFromInternet(fileName) {\r\n fs.readFile(fileName, \"utf8\", function(err, data) {\r\n if (err) {\r\n return console.log(err);\r\n }\r\n actualLinks = JSON.parse(data);\r\n\r\n for (let i = 0; i < actualLinks.pages.length; i++) {\r\n pagesToVisit[actualLinks.pages[i].address] = actualLinks.pages[i].links;\r\n }\r\n crawl(actualLinks.pages[0]);\r\n });\r\n}", "title": "" }, { "docid": "7661879601f3f98caa184c03ad3eb34d", "score": "0.63626295", "text": "async function getRemoteFile(href, debugLog) {\n if (debugLog) {\n console.log(\"to retrive : \" , href);\n }\n try {\n let response = await fetch(href, { headers: new Headers({'Content-Type': 'text/x-scss'}) });\n if (!response.ok || response.headers.get(\"Content-Type\").startsWith(\"text/html\")) {\n if (debugLog) {\n console.warn(\"fetch response : \", response);\n }\n throw new Error(response.status + \" : \" + response.statusText + \" \" + href);\n }\n let content = await response.text();\n return {content: content};\n\n } catch(ex) {\n return {error: ex.message};\n }\n}", "title": "" }, { "docid": "0905744f98c1b8a7e116086d3078cb7d", "score": "0.6359447", "text": "function getFile(url, section) {\n const req = new XMLHttpRequest();\n req.open('GET', url, false);\n req.send(null);\n document.getElementById(section).innerHTML = req.responseText;\n}", "title": "" }, { "docid": "32f0ac384994e968c758d334b1d08497", "score": "0.6238896", "text": "static processLink(link) {\n let options = {\n url: `${cloudURL}/${link.href}`,\n method: link.method,\n headers: {\n 'Authorization' : `Basic ${cloudKey}`,\n 'Accept': 'application/json',\n 'User-Agent': 'request',\n 'Content-Type': 'application/json'\n }\n };\n\n return request(options);\n }", "title": "" }, { "docid": "29e91c551f68837bf5cffe320797b8dc", "score": "0.6191082", "text": "function request_files(){\n var res = [];\n // md file\n if (\"file\" in vars){\n var get_doc = $.ajax({ url: vars['file'], success: function(data) {\n doc_str = data;\n document.title = extract_filename(vars[\"file\"]);\n }\n });\n res.push(get_doc);\n }\n // bib text file\n if(\"bib\" in vars){\n var get_bib_url = $.ajax({ url: vars['bib'], success: function(data){\n if(data != \"\"){\n bib_str = data;\n //console.log(\"bib_str:\");\n //console.log(bib_str);\n }\n } \n });\n res.push(get_bib_url);\n }\n return res;\n}", "title": "" }, { "docid": "a38e1ea7ac2b038d2a5c37a921110741", "score": "0.61181974", "text": "function linkFile(filename) {\n return HtmlService.createHtmlOutputFromFile(filename).getContent();\n}", "title": "" }, { "docid": "fda716a94e44a20759af2430538a7ee3", "score": "0.60326076", "text": "function getFile(url) {\n \"use strict\";\n var js = new XMLHttpRequest();\n js.open(\"GET\", url, false);\n js.send();\n return js.responseText;\n}", "title": "" }, { "docid": "9f39e52d2c3e9a10a745f0a9309da8a4", "score": "0.6026942", "text": "function openFile(cmd) {\n getCommand(\"DownloadURL\", cmd).done(function (result, status, xhr) {\n dnn.dom.navigate(result, \"_new\");\n }).fail(function (xhr, result, status) {\n showError(status, xhr.responseText);\n });\n }", "title": "" }, { "docid": "35938c4bb3292b9aa3d566b3870619ac", "score": "0.6005259", "text": "function requestContent(file) {\n contentContainer.load(file + ' #content', function () {\n console.log(file + ' #content');\n });\n }", "title": "" }, { "docid": "36d501b415f1d2e72249131410681524", "score": "0.59345526", "text": "function linkGet(){\n var file ;\n chrome.storage.sync.get({arr:[]},(result)=>\n { file = result.arr;\n linkDisp(file);\n });\n}", "title": "" }, { "docid": "9d1cc08d0454fabbb16976d49cc8e185", "score": "0.58566713", "text": "function getFileContents(file, callback) {\n\n\t// ajax linker\n\t$.ajax({\n\t\turl : file,\n\n\t\t// on success, call callback\n\t\tsuccess : function(result){\n\t\t\tif ($.isFunction(callback))\n\t\t\t\tcallback.apply(null, [result]);\n\t\t}\n\n\t});\n}", "title": "" }, { "docid": "781919928e34d6b3a47fe9b0fe8ae9ef", "score": "0.5809561", "text": "function getUrlById (fileownerid, req, res, writeJSONResponse) {\n con.query(\n \"SELECT* FROM file WHERE fileownerid='\" + fileownerid + \"' \",\n function (err, result, fields) {\n if (err) throw err\n URL = result\n writeJSONResponse(req, res, URL)\n }\n )\n}", "title": "" }, { "docid": "b11a4ee3aa499e62f7636a545a1b02c6", "score": "0.579537", "text": "async function getFile(url, binary) {\n\t\t\t\tvar count = 0;\n\n\t\t\t\t// on error retry 3 times\n\t\t\t\twhile (count < 3) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar i = await fetch(url);\n\n\t\t\t\t\t\tvar t = i.status;\n\n\t\t\t\t\t\tif (t >= 200 && t < 300) {\n\t\t\t\t\t\t\tif (binary) return await i.arrayBuffer();\n\n\t\t\t\t\t\t\treturn await i.text();\n\t\t\t\t\t\t} else console.log(\"getFile_Buffer\", i.statusText);\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\tappendLog(\"getFile_Error\", err.message);\n\t\t\t\t\t}\n\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t}", "title": "" }, { "docid": "f102b6fd892b9d8b5b6352cb15c6ce48", "score": "0.5783101", "text": "function fromExtLink(host, callback){\n\thttp.get(host, function(res){\n\t\t\tlet str = '';\n\n\t\t\tres.on('data', function (chunk) {\n\t\t\t\tstr += chunk;\n\t\t\t});\n\n\t\t\tres.on('end', function () {\n\t\t\t\tcallback(str);\n\t\t\t});\n\n\t}).on(\"error\", function (){\n\t\tcallback(\"GET request error\");\n\t});\n}", "title": "" }, { "docid": "b5699019926bd6ff5acc4563b11922f3", "score": "0.57563716", "text": "function _fetch() {\n return _parameters.file\n ? fetch(_getURL())\n : fetch(_getURL(), _getPayload());\n }", "title": "" }, { "docid": "1e0207ad909ea43a106b22a02c1f7ca8", "score": "0.57359403", "text": "async function getLink() {\n //Access API for random cat image/gif\n let { body } = await superagent\n .get(`http://aws.random.cat/meow`)\n .on(\"error\", err => {\n //console.log(err);\n return message.channel.send(\n \"Unknown Error Occurred.\\n\\n**If this problem keeps arising, make sure you use the `.issue` command to report any issues with the bot**\"\n );\n });\n let link = body.file; //url of cat\n return link;\n }", "title": "" }, { "docid": "a086191355c99bc9c3d460f0de6db2f2", "score": "0.5717775", "text": "function getTextFile(filePath) {\n return $.ajax({\n url: 'http://www.friskylingo.com/' + filePath,\n type: 'GET',\n dataType: 'text',\n crossDomain: true\n });\n}", "title": "" }, { "docid": "a086191355c99bc9c3d460f0de6db2f2", "score": "0.5717775", "text": "function getTextFile(filePath) {\n return $.ajax({\n url: 'http://www.friskylingo.com/' + filePath,\n type: 'GET',\n dataType: 'text',\n crossDomain: true\n });\n}", "title": "" }, { "docid": "c33c47de98391e81ccce3f36a4aef6fe", "score": "0.57177645", "text": "function doGet(fileUrl, callback) {\n\t// TODO load doesn't work in IE for pikaday\n\tvar fileTypeRegex = /\\w+$/;\n\tvar typeRegRes = fileTypeRegex.exec(fileUrl);\n\tif (typeRegRes != null) {\n\t\tvar fileType = typeRegRes[0];\n\t\tvar fileRef = null;\n\t\tswitch (fileType) {\n\t\t\tcase 'js':\n\t\t\t\tfileRef = document.createElement('script');\n\t\t\t\tfileRef.setAttribute(\"type\", \"text/javascript\");\n\t\t\t\tfileRef.setAttribute(\"src\", fileUrl);\n\t\t\t\tbreak;\n\t\t\tcase 'css':\n\t\t\t\tfileRef = document.createElement(\"link\");\n\t\t\t\tfileRef.setAttribute(\"rel\", \"stylesheet\");\n\t\t\t\tfileRef.setAttribute(\"type\", \"text/css\");\n\t\t\t\tfileRef.setAttribute(\"href\", fileUrl);\n\t\t\t\tbreak;\n\t\t\tcase 'json':\n\t\t\t\tvar xobj = new XMLHttpRequest();\n\t\t\t\t// special for IE \n\t\t\t\tif (xobj.overrideMimeType) {\n\t\t\t\t\txobj.overrideMimeType(\"application/json\");\n\t\t\t\t}\n\t\t\t\txobj.open('GET', fileUrl, true); // Replace 'my_data' with the path to your file\n\t\t\t\txobj.onreadystatechange = function () {\n\t\t\t\t\tif (xobj.readyState == 4 && xobj.status == \"200\") {\n\t\t\t\t\t\tif (callback) {\n\t\t\t\t\t\t\tcallback(xobj.responseText);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\txobj.send(null);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.error(getDebugMessage('Unknown type of style {}', fileType))\n\t\t}\n\t\tif (fileRef) {\n\t\t\tdocument.getElementsByTagName(\"head\")[0].appendChild(fileRef);\n\t\t\tfileRef.onload = callback;\n\t\t}\n\t} else {\n\t\tconsole.error(getDebugMessage('File type regex failed for filename \"{}\"', fileUrl));\n\t}\n}", "title": "" }, { "docid": "7d04091ffb9ea3c443450a23cce89e12", "score": "0.57176286", "text": "function getFile(file) {\n var x = new XMLHttpRequest();\n x.open('GET', file, false);\n x.send();\n return x.responseText;\n}", "title": "" }, { "docid": "2cd66130cdc723c7389754e5096eccc7", "score": "0.57041174", "text": "function requestFile ( url, callback ) {\n\n\tconst xhr = new XMLHttpRequest();\n\txhr.open( \"GET\", url, true );\n\txhr.onerror = ( xhr ) => console.log( \"error:\", xhr );\n\t//xhr.onprogress = ( xhr ) => console.log( 'bytes loaded:', xhr.loaded );\n\txhr.onload = ( xhr ) => callback( xhr.target.response );\n\txhr.send( null );\n\n}", "title": "" }, { "docid": "619af33218635d2907c6e33710708906", "score": "0.5698791", "text": "function fileUrls(ref, files){\n\n\tlet urls = [];\n\tif (SERVER == SERVER_GL){\n\t\tlet endpoint = `${REPO_API}/files/`;\n\t\tfor (file of files){\n\t\t\turls.push(`${endpoint}${trimPath(file)}/raw?ref=${ref}`);\n\t\t}\n\t}\n\tif (SERVER == SERVER_GH){\n\t\tlet endpoint = `${REPO_API}/contents/`;\n\t\tfor (file of files){\n\t\t\turls.push(`${endpoint}${file}?ref=${ref}`);\n\t\t}\n\t}\n\treturn urls;\n}", "title": "" }, { "docid": "82607743e0364282af7a94000ce0d2dd", "score": "0.56886405", "text": "function readFile(url) {\n\n var xhr = new XMLHttpRequest();\n\n xhr.onload = function () {\n original = this.responseText; //HACKED save in element called file, since can'it use global varibale in async anonymous function\n original= original.replace(/\\</g,\"&lt\");\n \n \n\n };\n\n\n\n\n xhr.open('GET', url,false);\n xhr.send();\n\n\n\n}", "title": "" }, { "docid": "82607743e0364282af7a94000ce0d2dd", "score": "0.56886405", "text": "function readFile(url) {\n\n var xhr = new XMLHttpRequest();\n\n xhr.onload = function () {\n original = this.responseText; //HACKED save in element called file, since can'it use global varibale in async anonymous function\n original= original.replace(/\\</g,\"&lt\");\n \n \n\n };\n\n\n\n\n xhr.open('GET', url,false);\n xhr.send();\n\n\n\n}", "title": "" }, { "docid": "1e490814809a3664d57854ad9811c923", "score": "0.5679175", "text": "function getfilestree(path) {\n console.log(path);\n xhr.open(\"GET\", path + '/', true);\n xhr.send(); \n}", "title": "" }, { "docid": "028dbdc14807c64d48bc3a1c40bf2bd3", "score": "0.5674881", "text": "function getFile(url) {\n\t\tGMlog(\"getFile: \"+url);\n\t\twindow.location = url;\n\t}", "title": "" }, { "docid": "00577bf934f1eca9747ce2e35c782010", "score": "0.565796", "text": "function readFile(url, content, res)\r\n{\r\n fs.readFile(url, function(err, data) \r\n {\r\n if(err) \r\n {\r\n console.log(err );\r\n }\r\n else \r\n {\r\n res.writeHead(success , {'Content-type' : content});\r\n res.write(data);\r\n res.end();\r\n }\r\n })\r\n}", "title": "" }, { "docid": "f5308f4aabe3dafdb356dc8148b85c0f", "score": "0.56547296", "text": "function get_file (request, response, url, local)\r\n{\r\n var data = local_data (url, \"\"), size = 0;\r\n\r\n if (!data) url = local_link (url, local); else\r\n {\r\n proc_done (response, data, mime_type (url), 0); return;\r\n }\r\n\r\n if (fs.existsSync (url)) size = fs.statSync (url).size;\r\n if (!size) { default_handler (response, 777, local); return; }\r\n var start = 0, end = size - 1, range = request.headers [\"range\"];\r\n\r\n if (!range) size = -size; else\r\n {\r\n range = range.substr (range.indexOf (\"=\") + 1);\r\n range = range.split (\"-\"); end = range[1] ? range[1] * 1 : 0;\r\n if (range[0]) start = range[0] * 1; else { start = size - end - 1; end = 0; }\r\n if (!end || end >= size) end = size - 1;\r\n if (start > end) start = end;\r\n if (end < start) end = start;\r\n }\r\n\r\n var stream = fs.createReadStream (url, { start: start, end: end });\r\n\r\n stream.on (\"error\", function (err) { default_handler (response, 777, local); });\r\n\r\n stream.on (\"open\", function()\r\n {\r\n proc_done (response, [size, start, end], mime_type (url), local);\r\n stream.pipe (response, { end:true });\r\n });\r\n}", "title": "" }, { "docid": "1bd27f038fc65b664edc1e0828738cc8", "score": "0.5652928", "text": "function fileOnClick(info, tab) {\r\n\tsendFileToWA(info.linkUrl);\r\n}", "title": "" }, { "docid": "bd8a52a2be15d9c787a986a6017bf9cf", "score": "0.5643794", "text": "function linkDownload(a, filename, type,content) {\n\tvar uriContent = type+\",\"+encodeURIComponent(content);\n\ta.setAttribute('href', uriContent);\n\ta.setAttribute('download', filename);\n}", "title": "" }, { "docid": "f8cce2259da476fbf75a78770bac8a09", "score": "0.56430703", "text": "function SendRequest( url ) \n{ \n var url = app.ReadFile(\"/sdcard/url.txt\");\n var httpRequest = new XMLHttpRequest(); \n httpRequest.onreadystatechange = function() { HandleReply(httpRequest); }; \n httpRequest.open(\"GET\", url, true); \n\n httpRequest.send(null); \n \n app.ShowProgress( \"Scanning Source Code...\" ); \n}", "title": "" }, { "docid": "574d7d0c741377f171846ad5682d1523", "score": "0.56278175", "text": "function RequestedFile(url) {\r\n\t\t\t\tthis.url = url;\r\n\t\t\t\tthis.content = null;\r\n\t\t\t}", "title": "" }, { "docid": "e88c191adc15d8023d2e00231538adb6", "score": "0.56233984", "text": "function makes() {\n var link = document.getElementById('downloadlink');\n link.href = makeTextFile(abc);\n link.style.display = 'block';\n}", "title": "" }, { "docid": "b9305169803e8d63b119cffc2e91e295", "score": "0.56173635", "text": "function getContents(directory_path, file_extensions){\n\t\tclient.readdir(directory_path, function(error, entries){\n\t\t\tif(error){\n\t\t\t\tvar meta_url = \"https://api.dropbox.com/1/metadata/auto/\" + directory_path;\n\t\t\t\treturn showError(error);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//console.log(entries);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "2241dffb18da44ea672bdb4862c50b21", "score": "0.5593632", "text": "async links(link) {\n const page = await Browser.newOptimizedPage()\n const downloadLinks = []\n\n try {\n link = decodeURIComponent(link)\n await page.goto(oploverz_url + link)\n\n await Util.sleep(15000)\n \n const soraddls = await page.$$('#op-single-post > div.epsc > div[class=\"soraddl op-download\"]')\n await Util.asyncForEach(soraddls, async soraddl => {\n const sorattls = await soraddl.$$('div[class=\"sorattl title-download\"]')\n const soraurls = await soraddl.$$('div[class=\"soraurl list-download\"]')\n await Util.asyncForEach(soraurls, async (soraurl, index) => {\n let quality = await Browser.getPlainProperty(sorattls[index], 'innerText')\n quality = this.parseQuality(quality)\n\n const anchors = await soraurl.$$('a')\n await Util.asyncForEach(anchors, async anchor => {\n const host = await Browser.getPlainProperty(anchor, 'innerText')\n const link = await Browser.getPlainProperty(anchor, 'href')\n\n downloadLinks.push({\n quality: quality,\n host: host,\n link: link\n })\n })\n })\n })\n\n await page.close()\n\n return downloadLinks\n } catch (error) {\n await page.close()\n\n return Handler.error(error)\n }\n }", "title": "" }, { "docid": "8811323030e01f21102fbeac4c830b32", "score": "0.5590145", "text": "function getRequest(file, params) {\n\tvar request;\n\trequest = ajaxRequest();\n\trequest.open(\"GET\", file, true);\n\t\n\trequest.send(params);\t\n}", "title": "" }, { "docid": "3bfbe8854ab52785baacab88fab761ea", "score": "0.5578114", "text": "function repo_info(id, search_file) {\n if(invocation) { \n url = url+id+'/dir/' //For the URL of the repos inside the repo with given id\n url_print = \"https://cloud.iitmandi.ac.in/library/ed3d09f5-7904-4c46-9cc7-9d181991973f/My%20Library/\";\n invocation.open('GET', url, true); //Opens the URL\n invocation.setRequestHeader(\"Authorization\", \"Token \" + token); //For Authorisation with token\n invocation.onreadystatechange = function() {\n if(invocation.readyState == 4 && invocation.status == 200) {\n var results = JSON.parse(invocation.responseText);\n //iterate through all the repos\n for (var i=0 ; i < results.length ; i++)\n { \n if(results[i][\"name\"] === search_file){\n console.log(url_print); //Prints URL of found File\n }\n if(results[i][\"type\"] === \"dir\"){\n dir_info(url + '?repo_id&p=/' + results[i][\"name\"],1, url_print+results[i][\"name\"]+'/', search_file) //Looks the file in the inside directories\n }\n }\n }\n };\n\n invocation.send();\n }\n}", "title": "" }, { "docid": "c0bf3bbdd2df2a748f25522f5b6e91a2", "score": "0.5568739", "text": "function downloadContent(url, ret) {\n let xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function()\n {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n ret(xhr.responseText)\n } else {\n throw new TypeError('can not download content');\n }\n }\n };\n xhr.open('GET', url, true);\n xhr.send();\n}", "title": "" }, { "docid": "0a4dda460fcfa6b6507b671fafa99b42", "score": "0.55649054", "text": "function getFile(file) {\n\tfakeAjax(file,function(text){\n\t\t// what do we do here?\n\t\tprocessResponse(file, text);\n\t});\n}", "title": "" }, { "docid": "dd70cd8e1eb2a6f72c7462db74dab8bb", "score": "0.5560728", "text": "function requestPage(url) {\n return new Promise(function(resolve, reject) {\n request(url, function(error, response, body) {\n if (error) {\n reject(error);\n } else {\n\n var $ = cheerio.load(body);\n $('a[data-tn-element=\"jobTitle\"]').each(function(i, elem) {\n links.push(base + elem.attribs.href);\n });\n console.log(\"Links Collected:\", links.length);\n\n resolve(\"Success\");\n }\n });\n });\n}", "title": "" }, { "docid": "5f6a513ad4c318026471c16add957a7a", "score": "0.55587745", "text": "downloadFile(fileMetadata) {\n }", "title": "" }, { "docid": "f3db75f894a89c3fc7be5ac9fd8835ad", "score": "0.55483377", "text": "function getFileForUrl(res, resFile) {\n fs.readFile(resFile, function (err, data) {\n if (err) {\n return console.log(err);\n }\n res.write(data);\n res.end();\n });\n}", "title": "" }, { "docid": "c4fceb9f92f4add3e1299fc665cdebe3", "score": "0.5548251", "text": "function getFile(url, cb) {\n var request = require(\"request\");\n\n request(url, function (err, res, body) {\n if (err || res.statusCode !== 200) return cb(err || 'Nope');\n cb(null, body);\n });\n}", "title": "" }, { "docid": "d2348588cff76c16770ea8c490cd4e66", "score": "0.5546504", "text": "async readlink({path}) {\n const id = (await browser.tabs.query({ active: true, lastFocusedWindow: true }))[0].id;\n return { buf: \"by-id/\" + id };\n }", "title": "" }, { "docid": "e08bbcac8ecdf4f4fd2feb93ca9ff535", "score": "0.55426276", "text": "function getContent( url )\n {\n // attempt to create XMLHttpRequest object and make the request\n try\n {\n asyncRequest = new XMLHttpRequest(); // create request object\n\n // register event handler\n asyncRequest.addEventListener(\n \"readystatechange\", stateChange, false); \n asyncRequest.open( \"GET\", url, true ); // prepare the request\n asyncRequest.send( null ); // send the request\n } // end try\n catch ( exception )\n {\n alert( \"Request failed.\" );\n } // end catch\n } // end function getContent", "title": "" }, { "docid": "899cd103de2b628add22f0db8dfad454", "score": "0.5525767", "text": "function openURL(url) {\r\n var html = new File(Folder.temp.absoluteURI + '/aisLink.html');\r\n html.open('w');\r\n var htmlBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT=\"0; URL=' + url + '\"></head><body> <p></body></html>';\r\n html.write(htmlBody);\r\n html.close();\r\n html.execute();\r\n}", "title": "" }, { "docid": "5aa4e69e8625b2082731c638a8113eef", "score": "0.55249965", "text": "function getFileUR(path, GUID, callback){\r\n dropboxClient.authenticate(function (error, client){\r\n if (error) { throw error; };\r\n client.readFile(path, null, function (error, content, sta, fileRange){\r\n var fileArray = content.split('\\r\\n');\r\n $(fileArray).each( function (key, value){\r\n if(value != '' && value.search('URL=') != -1){\r\n return callback($.trim(value.replace('URL=', '')));\r\n };\r\n });\r\n //return callback('');\r\n });\r\n });\r\n }", "title": "" }, { "docid": "c4b8b93ef485085d1e04f5a77defc59c", "score": "0.55242723", "text": "function getTextFile(filePath) {\n\treturn $.ajax({\n\t\turl: 'http://www.friskylingo.com/' + filePath,\n\t\ttype: 'GET',\n\t\tdataType: 'text',\n\t\tcrossDomain: true\n\t});\n}", "title": "" }, { "docid": "537642d39e97b5fe59277f65bac250e7", "score": "0.5513287", "text": "function fetchFile(path, callback) {\n\t\tlet request = new XMLHttpRequest();\n\t\trequest.onload = () => {\n\t\t\treturn callback(request.responseText);\n\t\t};\n\t\trequest.open(\"GET\", path);\n\t\trequest.send(null);\n\t}", "title": "" }, { "docid": "d814803b46fd2a02fecd16b242e2821c", "score": "0.550626", "text": "function read_file(path, callback) {\n var request = new XMLHttpRequest();\n\n request.onreadystatechange = function () {\n if (this.readyState == 4) {\n if (this.status === 200) {\n callback(this.responseText);\n } else {\n console.error(this.statusText);\n }\n }\n };\n request.open(\"GET\", window.location.href + path, true);\n request.send();\n}", "title": "" }, { "docid": "67ac4ff4736df8aa27f83a686756904c", "score": "0.55000603", "text": "function getMatch(link) {\n request(link, dataReceiver);\n}", "title": "" }, { "docid": "608e20e0d52e8fd324a0e54683014eb0", "score": "0.5497211", "text": "handleFile(name, value) {\n getSignedUrl(name, value, this.handleUrls);\n }", "title": "" }, { "docid": "f9d19cdaa883aefbe07853aaa09d5aa7", "score": "0.5493806", "text": "async download() {}", "title": "" }, { "docid": "617e206df61434b07baa3d10aee690a9", "score": "0.54895526", "text": "function readFileContents(url) {\n var request = chooseAppropriateRequestObject();\n request.open(\"GET\", url, false);\n request.send(null);\n return JSON.parse(request.responseText);\n }", "title": "" }, { "docid": "66ab9c7c627734910bbf6db80a423733", "score": "0.5484575", "text": "function getData(file) {\n return $.ajax({\n url: file\n });\n}", "title": "" }, { "docid": "8d26a2ec8214c0db78a9adddd3db59bc", "score": "0.54772997", "text": "function linkDownload(id) {\n\t\tconsole.log(' - Baixando: ', r[id])\n\t\tlet video_mp4_url = video_m3u8_array[id];\n\n\t\tlet fileSize = \"\";\n\t\tlet http = (window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject(\"Microsoft.XMLHTTP\"));\n\t\thttp.onreadystatechange = () => {\n\t\t\tif (http.readyState == 4 && http.status == 200) {\n\t\t\t\tfileSize = http.getResponseHeader('content-length');\n\t\t\t\tif (!fileSize && !needs_proxy)\n\t\t\t\t\treturn setTimeout(() => linkDownload(id), 5000);\n\t\t\t\telse {\n\t\t\t\t\tlet sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\n\t\t\t\t\tif (fileSize == 0) return pM2[id].reject('addSource#fileSize == 0');\n\t\t\t\t\tlet i = parseInt(Math.floor(Math.log(fileSize) / Math.log(1024)));\n\t\t\t\t\tif (i == 0) return pM2[id].reject('addSource#i== 0');\n\t\t\t\t\tlet return_fileSize = (fileSize / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i];\n\t\t\t\t\tconsole.log(`[CR Premium] Source adicionado: ${r[id]} (${return_fileSize})`);\n\t\t\t\t\ts[id] = return_fileSize;\n\t\t\t\t\tu[id] = video_mp4_url;\n\t\t\t\t\trequest[id].resolve();\n\t\t\t\t}\n\t\t\t} else if (http.readyState == 4)\n\t\t\t\treturn setTimeout(() => linkDownload(id), 5000);\n\t\t}\n\t\thttp.open(\"HEAD\", video_mp4_url, true);\n\t\thttp.send();\n\t}", "title": "" }, { "docid": "cf044e9c48ab17752c3a10a95790d951", "score": "0.54692334", "text": "function loadDoc(url, cFunction) {\n var xhttp;\n xhttp=new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n cFunction(this);\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "title": "" }, { "docid": "c4782ca6cdb9bf61cb0ec7cfeae74a0e", "score": "0.5432086", "text": "function GetFile(name) {\n //cambia la ip deacuerdo ala compu servidor\n window.open('http://10.21.6.53:3000/Archivos?archivo=' + name + '');\n}", "title": "" }, { "docid": "57380067877ec4e07f92f2df85190550", "score": "0.542829", "text": "function file_get_contents(filename) {\n\tfetch(filename).then((resp) => resp.text()).then(function(data) {\n\t\tconsole.log(data);\n\t\treturn data;\n\t});\n}", "title": "" }, { "docid": "bc1510689bf298ceb620fabecca175bf", "score": "0.54281104", "text": "function handleGetRequest(url, request, response) {\n var type = findType(request, url);\n if (type == null) return fail(response, BadType, \"File type unsupported\");\n var file = \"./public\" + url;\n fs.readFile(file, ready);\n function ready(err, content) { deliver(response, type, err, content); } \n}", "title": "" }, { "docid": "ef2ab255ba916c8a0c745b4eeca36693", "score": "0.5421232", "text": "function openURL(url) {\n var html = new File(Folder.temp.absoluteURI + '/aisLink.html');\n html.open('w');\n var htmlBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT=\"0; URL=' + url + '\"></head><body> <p></body></html>';\n html.write(htmlBody);\n html.close();\n html.execute();\n}", "title": "" }, { "docid": "ef2ab255ba916c8a0c745b4eeca36693", "score": "0.5421232", "text": "function openURL(url) {\n var html = new File(Folder.temp.absoluteURI + '/aisLink.html');\n html.open('w');\n var htmlBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT=\"0; URL=' + url + '\"></head><body> <p></body></html>';\n html.write(htmlBody);\n html.close();\n html.execute();\n}", "title": "" }, { "docid": "ef2ab255ba916c8a0c745b4eeca36693", "score": "0.5421232", "text": "function openURL(url) {\n var html = new File(Folder.temp.absoluteURI + '/aisLink.html');\n html.open('w');\n var htmlBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT=\"0; URL=' + url + '\"></head><body> <p></body></html>';\n html.write(htmlBody);\n html.close();\n html.execute();\n}", "title": "" }, { "docid": "ef2ab255ba916c8a0c745b4eeca36693", "score": "0.5421232", "text": "function openURL(url) {\n var html = new File(Folder.temp.absoluteURI + '/aisLink.html');\n html.open('w');\n var htmlBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT=\"0; URL=' + url + '\"></head><body> <p></body></html>';\n html.write(htmlBody);\n html.close();\n html.execute();\n}", "title": "" }, { "docid": "ef2ab255ba916c8a0c745b4eeca36693", "score": "0.5421232", "text": "function openURL(url) {\n var html = new File(Folder.temp.absoluteURI + '/aisLink.html');\n html.open('w');\n var htmlBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT=\"0; URL=' + url + '\"></head><body> <p></body></html>';\n html.write(htmlBody);\n html.close();\n html.execute();\n}", "title": "" }, { "docid": "dcbad74597ab0d3b8fe4e213526a5c49", "score": "0.54177153", "text": "async getFromLink (request, link) {\n const result = await Client.requestFromLink(await EntityApi.getAuth(request), link)\n if (result._embedded) {\n return Promise.all(result._embedded[this.path].map(m => this.mapper(request, m)))\n } else {\n result.id = EntityApi.keyFromLink(result)\n return result\n }\n }", "title": "" }, { "docid": "9a688d43f33ec0bb99a5a597d2374441", "score": "0.541218", "text": "function get(url, cb , ff) {\n GM_xmlhttpRequest({\n method: \"GET\",\n url: url,\n onload: function(xhr) { cb(xhr.responseText,ff); }\n });\n}", "title": "" }, { "docid": "ddbe1b29ddaed3357e07f0515ff93227", "score": "0.53981066", "text": "function get(url, success, fail) {\n httpRequest.open(\"GET\", url);\n httpRequest.onload = function () {\n if (httpRequest.status === 200) {\n success(httpRequest.responseText);\n } else {\n fail(httpRequest.status);\n }\n };\n httpRequest.send();\n}", "title": "" }, { "docid": "0cbd204139b6b01f94c8a53beacca298", "score": "0.5397073", "text": "function getFile (file) {\n // OR: fs.getDataUrl to get a data url blob\n fs.get(file, function (err, url) {\n if (err) throw err\n window.open(url)\n })\n}", "title": "" }, { "docid": "61085265a645982fb28b0c92f500aa97", "score": "0.53906924", "text": "function getUrl(i) {\n request(urls[i], function(error, response, body){\n if (!error && response.statusCode == 200) {\n // console.log ('/home/ec2-user/environment/data/m0'+i+'.txt', body);\n fs.writeFileSync('/home/ec2-user/environment/week01/data/m0'+(i+1)+'.txt', body);\n }\n else {console.log(\"Request failed!\")}\n })\n}", "title": "" }, { "docid": "597fb3fe9b6a8c7e3dd70fcc4e8ace6f", "score": "0.53826046", "text": "function get(url, cb) {\r\nGM_xmlhttpRequest({\r\n method: 'GET',\r\n url: url,\r\n //headers: {'Accept': 'application/atom+xml,application/xml,text/xml,text/html'},\r\n onload: function(r) {cb(r);}\r\n});\r\n}", "title": "" }, { "docid": "95ea8e204a3570a787713fb063b128f1", "score": "0.5379094", "text": "function getFile(file) {\n util.fakeAjax(file, function(text) {\n fileReceived(file, text);\n });\n}", "title": "" }, { "docid": "a1a60cab28f3d7796fc0f33d8996018a", "score": "0.53787994", "text": "getResultDownloadTicket(snapshotId, jobId, file, callback) {\n let filePath = file === 'all' ? file : file.path\n if (filePath === 'all-results') {\n let downloadUrl =\n config.crn.url +\n 'jobs/' +\n jobId +\n '/results/' +\n 'fileName' +\n '?ticket=' +\n 'ticket'\n callback(downloadUrl)\n } else {\n callback('https://s3.amazonaws.com/' + filePath)\n }\n }", "title": "" }, { "docid": "277c4df9a5a206ddbdd2433d35db8133", "score": "0.5378437", "text": "function getSingleFile( file, folder ) {\n\n // Use \"dlFiles()\" to file-check & download the single file\n // Pass \"file\" & \"folder\" params above, \"dlFiles()\" does the rest\n dlFiles( file, folder );\n\n}", "title": "" }, { "docid": "718eedce456bc81ee2d8a8cb45ef4038", "score": "0.53758717", "text": "function downloadTheFile(fileName, anchor) {\n var $aVideoLink = $('a[href*=\"' + fileName + '\"]');\n var theDownloadLink = $aVideoLink.attr('href') + '#' + anchor;\n\n //console.log(theDownloadLink);\n window.location.href = theDownloadLink;\n}", "title": "" }, { "docid": "56e456c70679ea481e45575eb90a9a19", "score": "0.53693235", "text": "function fetchLink() {\n cfpLoadingBar.start();\n $http.get('/api/srcsettings/' + $scope.shortCode)\n .success(function (result) {\n // if result.owner is not === logged in user,\n if (Auth.getCurrentUser()._id !== result.owner._id) {\n $state.go('main');\n return;\n }\n\n $scope.link = result;\n\n console.log('fetched link', $scope.link);\n })\n .error(function (err) {\n console.error('err', err);\n if (err) {\n $state.go('main');\n return;\n }\n })\n .finally(function() {\n cfpLoadingBar.complete();\n });\n }", "title": "" }, { "docid": "effddd988ccfab4f89467790af424187", "score": "0.53570753", "text": "list() {\n let headers = new Headers({\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': 'Basic ' + this.opts.bearerToken\n })\n\n let request = new Request(this.opts.host + this.opts.getFilesUrl, {\n method: 'get',\n headers: headers\n });\n\n return fetch(request)\n .then((res) => {\n return res.json()\n })\n }", "title": "" }, { "docid": "811492d5646e33d05875fc39bebbda19", "score": "0.53535056", "text": "resolveLInk(params) {\n return ApiService.get('/link', { path: params.path });\n }", "title": "" }, { "docid": "8bcca7a4884a21fa73960f632ebf044c", "score": "0.53448206", "text": "getUrl(fileName){\n DB.GetPostUrl(fileName)\n}", "title": "" }, { "docid": "76e2f1c3b4ee55e18a6a8f66e99fd514", "score": "0.53446805", "text": "function loadContentFile(filename, successBlock) {\n\t$.ajax({\n\t\turl: './content/' + filename,\n\t\tdataType: 'text',\n\t\tsuccess: successBlock,\n\t\terror: function(){\n\t\t\tconsole.error(\"Error loading \" + filename);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9017eeb1e973fa01008ac282e1dbb3ed", "score": "0.5344327", "text": "_fileFromUrl(url, referencedFrom) {\n let dir;\n if (referencedFrom && (url[0] !== '/')) {\n dir = pathlib.dirname(referencedFrom);\n } else {\n dir = this.publicFolder;\n }\n const file = pathlib.join(dir, url);\n return pathlib.normalize(file);\n }", "title": "" }, { "docid": "8d237015207f0ca1e03775b9e3f94173", "score": "0.53306407", "text": "async function getHtml(fileName, url) {\n if (fs.existsSync(fileName)) {\n return fs.readFileSync(fileName).toString();\n } else {\n const html = (await axios.get(url, {\n headers: {\n 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) ' +\n 'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36',\n },\n })).data;\n await fs.writeFileSync(fileName, html);\n return html;\n }\n}", "title": "" }, { "docid": "6d1413a141d03a40517dca4ca5d55542", "score": "0.53266364", "text": "static getUrlContents(url) {\n let scope = this;\n let urlType = InetUtils.getUrlType(url);\n let contents;\n return new Promise((resolve, reject) => {\n let urlTypeStr = InetUtils.urlTypeToString(urlType);\n if (urlType == UrlType.Http) {\n InetUtils.getHttp(url).then((contents) => {\n resolve(contents);\n }).catch((err) => {\n logger_1.Logger.logError(\"getUrlContents (HTTP) : \" + err.code, url);\n reject(err);\n });\n }\n else if (urlType == UrlType.Https) {\n InetUtils.getHttps(url).then((contents) => {\n resolve(contents);\n }).catch((err) => {\n logger_1.Logger.logError(\"getUrlContents (HTTPS) : \" + err.code, url);\n reject(err);\n });\n }\n else {\n let error = new Error(\"Unknown protocol\");\n reject(error);\n }\n });\n }", "title": "" }, { "docid": "d10ff852209a54d2ece2584f1a7c53fd", "score": "0.5324136", "text": "function getFile(file) {\n requestOrder.push(file);\n\tfakeAjax(file,function(text){\n // what do we do here?\n\t\tstate[file] = text;\n \n\t output(text,state,requestOrder);\n });\n \n}", "title": "" }, { "docid": "e8681bd0979d63f65db1e967fc194d95", "score": "0.53230834", "text": "function loadFileAJAX(name) {\n var xhr = new XMLHttpRequest(),\n okStatus = document.location.protocol === \"file:\" ? 0 : 200;\n xhr.open('GET', name, false);\n xhr.send(null);\n return xhr.status == okStatus ? xhr.responseText : null;\n }", "title": "" }, { "docid": "0735bb0c929eba0134c6a7a8d7ab0afc", "score": "0.53223217", "text": "loadResource(params) {\n let appPath = NSBundle.mainBundle.bundlePath;\n let pathUrl = params.url.replace('file://', appPath);\n let fileManager = NSFileManager.defaultManager;\n let data = fileManager.fileExistsAtPath(pathUrl) ? fileManager.contentsAtPath(pathUrl) : undefined;\n let content = data ? NSString.alloc().initWithDataEncoding(data, NSUTF8StringEncoding) : '';\n return {\n content: content.toString(),\n mimeType: 'application/octet-stream',\n status: 200,\n };\n }", "title": "" }, { "docid": "e8329a6756e1009dff8453147108286a", "score": "0.531979", "text": "function fetchRaw(file, fn) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', file);\n // Using 'arraybuffer' as the responseType ensures that the raw data is returned,\n // rather than letting XMLHttpRequest decode the data first.\n xhr.responseType = 'arraybuffer';\n xhr.onload = function () {\n if (this.status == 200) {\n fn(this.response);\n //console.log(this.response)\n } else {\n console.error('Error while requesting', file, this);\n }\n };\n xhr.send();\n}", "title": "" }, { "docid": "f71e2dc60f9fda7c98e23d4eaf67b937", "score": "0.5318712", "text": "function loadFile(url) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlet xhr = new XMLHttpRequest();\n\t\t\txhr.open('GET', url);\n\t\t\txhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\t\t\txhr.responseType = \"arraybuffer\";\n\t\t\txhr.onload = () => {\n\t\t\t\tif (xhr.readyState === 4 && (xhr.status === 200 || xhr.status === 0)) {\n\t\t\t\t\tresolve(xhr.response || xhr.responseText);\n\t\t\t\t} else {\n\t\t\t\t\tresolve('');\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.onerror = () => reject(\"Error \" + xhr.status + \" while fetching remote file: \" + url);\n\t\t\txhr.send();\n\t\t});\n\t}", "title": "" }, { "docid": "1fdba7c8c61b95adb246edc85b97fab0", "score": "0.53161025", "text": "function loopAndDownload(theItem) {\n var theDownloadLink = theItem.downloadLink;\n var theSceneLink = theItem.sceneLink;\n\n\n var theFileExtensionFromTheLink = theDownloadLink.split('/')[5];\n theFileExtensionFromTheLink = theFileExtensionFromTheLink.first(3);\n\n var theSceneTitleFromTheLink = theSceneLink.split('/')[6];\n\n\n var theAnchor = '#' + theItem.siteType + '__' + theItem.sceneId + '__' + theItem.releaseDate + '__' + theItem.rating + '__' + theSceneTitleFromTheLink + '.' + theFileExtensionFromTheLink;\n console.log(theItem.downloadLink + theAnchor);\n window.open(theItem.downloadLink + theAnchor, '_blank');\n}", "title": "" }, { "docid": "3f6581802e690f317a4f4587ca710d2d", "score": "0.53078264", "text": "function buttonControlFiledetails(id) {\n $(id).click(function() {\n var url = this.href;\n var targetfile = $(this).attr('class');\n\n fileid = { 'targetfile': targetfile};\n $.get(url, fileid, function(data) {});\n return false;\n });\n}", "title": "" }, { "docid": "698c4fd3db8b75da100edadf86e0fef7", "score": "0.5297612", "text": "function asyncGetFile(url) {\r\n console.log(\"Getting text file\");\r\n return new Promise((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", url);\r\n xhr.onload = () => resolve(xhr.responseText);\r\n xhr.onerror = () => reject(xhr.statusText);\r\n xhr.send();\r\n console.log(\"Made promise\"); \r\n });\r\n}", "title": "" }, { "docid": "eeeef06faa317ba1685ee062f2071e01", "score": "0.5296014", "text": "function get_DownloadFile_HTML_ForJobID(theID)\n{\n var theHref = baserequesturl+'getFileForJobID/?id=' + theID;\n \n var retHTML = \"\";\n retHTML += \"<a href='\";\n retHTML += theHref;\n retHTML += \"' target='_blank'>\";\n retHTML += \"Click Here to Download File\";\n retHTML += \"</a>\";\n \n return retHTML;\n}", "title": "" }, { "docid": "504b251fa607189e1bf65a2b0bf981cc", "score": "0.52954227", "text": "function getFileContent (file, callback) {\n\tvar funToCall = \"getFileContent\"+currentHost+'(\\''+file+'\\','+callback+')';\n\teval(funToCall);\n}", "title": "" }, { "docid": "cbea94ccd97f54386d489e28581f296d", "score": "0.5290988", "text": "function getFileContents(filename){\n\t\n\tvar contents;\n\t\n\t//handle good requests\n\tconsole.log(\"Getting file\");\n\ttry{\n\t\tcontents = fs.readFileSync(filename);\n\t}catch(ENOENT){\n\t\tconsole.log(\"404\");\n\t\tfilename = ROOT + \"\\\\404.html\"\n\t\tcontents = fs.readFileSync(filename);\n\t}\n\tconsole.log(\"typeof: \"+typeof(contents));\n\treturn contents;\n}", "title": "" }, { "docid": "cedba8d7efe82c15d5b2e713d8f6ff55", "score": "0.5290373", "text": "function fetch_file(url, async)\n{\n return new Promise(function(resolve,reject) {\n\t var request = new XMLHttpRequest();\n\t request.open(\"GET\", url);\n\t request.overrideMimeType(\"text/plain\");\n\n request.onload = function() {\n // Called even on 404 errors, so check the status\n if (request.status == 200) {\n // Resolve the promise with the response text\n resolve(request.responseText);\n } else {\n // Otherwise reject with the status text\n // which will hopefully be a meaningful error\n reject(request.statusText);\n }\n };\n // Handle network errors\n request.onerror = function() {\n reject(\"Network Error\");\n };\n\t request.send();\n });\n}", "title": "" }, { "docid": "05ed7367dfa401fbb70a0a50da1f7066", "score": "0.528527", "text": "async function loadFile( url ) {\n\tconst req = await fetch( url );\n\treturn req.text();\n}", "title": "" }, { "docid": "11f37636cf4c2a09cfd49121b7ca2adf", "score": "0.5284029", "text": "function createDownloadLink(searchable)\n{\n var file = null;\n var text = Papa.unparse(JSON.stringify(searchable));\n\n if (file !== null) {\n window.URL.revokeObjectURL(file);\n }\n\n file = window.URL.createObjectURL(new Blob([text], {type: \"text/plain\"}));\n\n $(\"#datasource-link\").attr(\"href\", file).show();\n}", "title": "" }, { "docid": "93ba310b0d4f15067691688e304b9cc9", "score": "0.52791685", "text": "function content(theUrl) {\n var xhttp;\n if (theUrl.length == 0) {\n return;\n }\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n\t\t alert(this.response);\n }\n\telse{\n\t}\n };\n xhttp.open(\"GET\", \"http://localhost/chromeextension/data/getMetaData.php?q=\"+theUrl, true);\n xhttp.send();\n}", "title": "" }, { "docid": "34f7fdf9630373f181b572af088251c9", "score": "0.5278594", "text": "function request(link, func){\n var req = https.request(link, function(res){\n //console.log(res.statusCode);\n if(res.statusCode == 301){\n request(res.headers.location, func);\n }\n else if(res.statusCode == 200){\n var datastring = \"\";\n res.setEncoding('utf8');\n res.on('data', function(data){\n datastring += data;\n });\n res.on('end', function(){\n //console.log(\"request datastring: \", datastring);\n func(JSON.parse(datastring));\n }) \n }\n });\n req.end();\n}", "title": "" } ]
90abe98c280c99cbaa5631a158c8c9e4
Registers a new handler.
[ { "docid": "b1118d694b81fd4006ec83b987963e76", "score": "0.74447334", "text": "static registerHandler(handler) {\n this.handlers.push(handler);\n return this;\n }", "title": "" } ]
[ { "docid": "000b95150b99bf9e80669647bdcc1142", "score": "0.74720293", "text": "function registerHandler (handler) {\n app[handler.method]( handler.path, handler.func() );\n }", "title": "" }, { "docid": "643c619f267d4c60d77883ddb716ee96", "score": "0.74468005", "text": "addHandler(handler) {\n if (Handler.validate(handler)) {\n this.handlers[handler.id] = handler;\n }\n }", "title": "" }, { "docid": "2d9e5bc6e679f6d11d886c2d8fc9f60a", "score": "0.7190144", "text": "addHandler (handler, type) {\n\t\tthis.handlers.push(handler)\n\t}", "title": "" }, { "docid": "c5cf0eb68ced2d322ac237d19425b29f", "score": "0.7121454", "text": "addHandler(handler) {\n handlers.push(handler);\n }", "title": "" }, { "docid": "7634b895db6e7d6780aa5175c927b52b", "score": "0.67861444", "text": "addHandler(handler) {\n this.handlers.add(handler);\n handler(this.state);\n }", "title": "" }, { "docid": "7634b895db6e7d6780aa5175c927b52b", "score": "0.67861444", "text": "addHandler(handler) {\n this.handlers.add(handler);\n handler(this.state);\n }", "title": "" }, { "docid": "ea57cc57440658ae994705afca64d0b6", "score": "0.67411554", "text": "register (name, handler) {\n this.local.push(name);\n return this.use( this.callback(name, handler) );\n }", "title": "" }, { "docid": "1fa5969e3ce61c924163a070101c3666", "score": "0.6737883", "text": "async function registerCommandHandler(newHandler) {\n const commandHandler = await E(newHandler).getCommandHandler();\n registeredHandlers.push(commandHandler);\n }", "title": "" }, { "docid": "0d1cbc5de0fd2f4fc59e3be71fe6fe2f", "score": "0.650831", "text": "function installHandler(name, wrappedHandler) {\n if (hasOwn.call(boundCore, name)) {\n throw new Error('Opcode handler for \"' + name + '\" has already been installed');\n }\n\n boundCore[name] = wrappedHandler;\n }", "title": "" }, { "docid": "84b450ed6893d5c472f47cca7eee7b7f", "score": "0.65045595", "text": "async function registerURLHandler(newHandler, url) {\n const commandHandler = await E(newHandler).getCommandHandler();\n let reg = registeredURLHandlers.get(url);\n if (!reg) {\n reg = [];\n registeredURLHandlers.set(url, reg);\n }\n reg.push(commandHandler);\n }", "title": "" }, { "docid": "473d614605b3aa212c1dca3516b8fdf9", "score": "0.64363897", "text": "function registerHandler(name, instance) {\n externals[name] = instance;\n }", "title": "" }, { "docid": "70ae49ce63c26f3346bfe2ac63017649", "score": "0.637987", "text": "static set(path, handler) {\n Registry.set('stateHandlers.' + path, handler);\n }", "title": "" }, { "docid": "332ddead36032e97e3b91e001d03d196", "score": "0.63528126", "text": "register(event_id, handler_id, callback)\n {\n if (!(event_id in this.handlers))\n {\n // no callback was registered for this event id, update client callbacks\n this.handlers[event_id] = [];\n this.client.on(event_id, ((...args) => {\n for (let h of this.handlers[event_id])\n {\n h.cb(args);\n }\n }).bind(this));\n }\n if (this.handlers[event_id].find(e => e.id == handler_id))\n {\n // handler id already registered: skipping\n throw `${handler_id} already registered for event ${event_id}`\n }\n\n this.handlers[event_id].push({\n id: handler_id,\n cb: callback\n });\n }", "title": "" }, { "docid": "bac11ebe888c82c0c60698706cef8692", "score": "0.63185835", "text": "function on(name, handler) {\n var parts = getNameParts(name);\n var handlers = registry.get(parts);\n\n if (handlers) {\n handlers.push(handler);\n }\n else {\n registry.set(parts, [ handler ]);\n }\n\n return bus;\n }", "title": "" }, { "docid": "f14021743adb52306d45412cd883400b", "score": "0.62787336", "text": "regsiterLocalHandler(event, Handler) {\n this.session.localHandlers[event] = new Handler(this)\n }", "title": "" }, { "docid": "873a4a5597bc7c61f29fba320bf21b28", "score": "0.62036544", "text": "function registerHandler(onMessageReceived) {\n socket.on('message', onMessageReceived)\n }", "title": "" }, { "docid": "fe7102555b0991aa3656a9242d69fdd4", "score": "0.6156081", "text": "on(name, handler) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this[EVENT_NAME_TO_HANDLER_NAME[name]] = handler;\n }", "title": "" }, { "docid": "9a2a928eaf8b82bd52242ea62cac9442", "score": "0.6116782", "text": "regsiterRemoteHandler(event, Handler) {\n this.session.connectionHandlers[event] = new Handler(this)\n }", "title": "" }, { "docid": "5b17cf1a0049a1b8c27d127904cd3cc2", "score": "0.6041829", "text": "registerActionHandler(action, handler, actionToken) {\n\t\t\tvar handle = action;\n\t\t\t//if (actionToken) { handle += ':' + actionToken }\n\t\t\tBig.log('registering action handler for: '+handle);\n\t\t\tActionHandlers[handle] = handler;\n\t\t}", "title": "" }, { "docid": "075fb7ea5a4ec48c3c15e2dd2b2224db", "score": "0.6011305", "text": "function register_handlers(handlers) {\n $.each(handlers, function(selector, handler) {\n // register each handler\n self.handler(selector, function() {\n // bind self as an argument for the custom handler\n return handler.apply(this, [self]);\n });\n });\n }", "title": "" }, { "docid": "b377a7a6de003dc45e1c9e3216bd6c2b", "score": "0.6007134", "text": "function registerValueHandler (handlers, type, handler) {\n let typeofType = typeof type;\n\n if (typeofType !== 'function' && typeofType !== 'string') {\n throw new Error(\"type must be a class constructor or string\");\n }\n\n if (typeof handler !== 'function') {\n throw new Error(\"handler must be a function\");\n }\n\n for (let typeHandler of handlers) {\n if (typeHandler.type === type) {\n typeHandler.handler = handler;\n\n return;\n }\n }\n\n handlers.push({\n type: type,\n handler: handler,\n });\n}", "title": "" }, { "docid": "f5dc558cbf0283b7a712013c0c516da6", "score": "0.5993086", "text": "function addHandler(name, definition) {\n var handler = new $$MdGestureHandler(name);\n angular.extend(handler, definition);\n HANDLERS[name] = handler;\n\n return self;\n }", "title": "" }, { "docid": "f854733c72d09178c9f095119ba84393", "score": "0.5970152", "text": "registerInteractionHandler(evtType,handler) {\n debug(LOG,'registerInteractionHandler',{evtType,handler})\n this._updateEventListener(evtType,handler)\n }", "title": "" }, { "docid": "798bedc7770a54c7f8b0aa4aa11067bf", "score": "0.5953942", "text": "function addHandler(name, definition) {\n var handler = new $$MdGestureHandler(name);\n angular.extend(handler, definition);\n HANDLERS[name] = handler;\n\n return self;\n }", "title": "" }, { "docid": "798bedc7770a54c7f8b0aa4aa11067bf", "score": "0.5953942", "text": "function addHandler(name, definition) {\n var handler = new $$MdGestureHandler(name);\n angular.extend(handler, definition);\n HANDLERS[name] = handler;\n\n return self;\n }", "title": "" }, { "docid": "798bedc7770a54c7f8b0aa4aa11067bf", "score": "0.5953942", "text": "function addHandler(name, definition) {\n var handler = new $$MdGestureHandler(name);\n angular.extend(handler, definition);\n HANDLERS[name] = handler;\n\n return self;\n }", "title": "" }, { "docid": "477437c4ae9ac6e4a8fe5512024be862", "score": "0.5942569", "text": "bindRouteHandler() {\n\t\tthis.app.singleton('router.handler', Handler);\n\t}", "title": "" }, { "docid": "58ca20750c488846678b0561d0c8ec0c", "score": "0.5930292", "text": "on(type, handler) {\n if (!this.handlers[type]) {\n this.handlers[type] = [handler];\n }\n else {\n this.handlers[type].push(handler);\n }\n return this;\n }", "title": "" }, { "docid": "ac659fed3afddb3fb34acd792f95d595", "score": "0.59166205", "text": "addHandler(handler) {\n let handlers = this._handlers;\n if (handlers === undefined) {\n if (this.requested) {\n throw new TypeError(\n \"cannot add a handler to an already canceled token\"\n );\n }\n\n handlers = this._handlers = [];\n }\n handlers.push(handler);\n return removeHandler.bind(this, handler);\n }", "title": "" }, { "docid": "b9a3788f929a666173ed0d1ced87393e", "score": "0.59079415", "text": "function addHandler(name,definition){var handler=new $$MdGestureHandler(name);angular.extend(handler,definition);HANDLERS[name]=handler;return self;}", "title": "" }, { "docid": "48107f394f502e88c9bbf324567e3231", "score": "0.58907914", "text": "createHandlerFactory() {\n logger.debug('createHandlerFactory()');\n return () => {\n const internal = { handlerId: (0, uuid_1.v4)() };\n const handler = new Handler_1.Handler({\n internal,\n channel: this._channel\n });\n this._handlers.add(handler);\n handler.on('@close', () => this._handlers.delete(handler));\n return handler;\n };\n }", "title": "" }, { "docid": "dbdbcf5fbe57fe0c22a7a24e0c670b1a", "score": "0.5879796", "text": "function _addHandlerForRule(_ruleID, _handlerFn) {\n _ruleHandlersList[_ruleID] = _handlerFn;\n}", "title": "" }, { "docid": "84f52bcdc4963ba9d3d05fe5dca630d0", "score": "0.5839131", "text": "function addHandler(name, definition) {\n var handler = new $$MdGestureHandler(name);\n angular.extend(handler, definition);\n HANDLERS[name] = handler;\n\n return self;\n }", "title": "" }, { "docid": "41295ff66a268cbc6df3de5d4928d60a", "score": "0.5829375", "text": "function addInstrumentationHandler(handler) {\n // tslint:disable-next-line:strict-type-predicates\n if (!handler || typeof handler.type !== 'string' || typeof handler.callback !== 'function') {\n return;\n }\n handlers[handler.type] = handlers[handler.type] || [];\n handlers[handler.type].push(handler.callback);\n instrument(handler.type);\n}", "title": "" }, { "docid": "17371a77d67fe2efa0922e6278b4c94e", "score": "0.5809451", "text": "function addInstrumentationHandler(handler) {\n if (!handler || typeof handler.type !== 'string' || typeof handler.callback !== 'function') {\n return;\n }\n handlers[handler.type] = handlers[handler.type] || [];\n handlers[handler.type].push(handler.callback);\n instrument(handler.type);\n}", "title": "" }, { "docid": "17371a77d67fe2efa0922e6278b4c94e", "score": "0.5809451", "text": "function addInstrumentationHandler(handler) {\n if (!handler || typeof handler.type !== 'string' || typeof handler.callback !== 'function') {\n return;\n }\n handlers[handler.type] = handlers[handler.type] || [];\n handlers[handler.type].push(handler.callback);\n instrument(handler.type);\n}", "title": "" }, { "docid": "eb5dd4e1b7e82c215b350e6814094d6b", "score": "0.580593", "text": "setHandler(handler) {\r\n this.handler = handler\r\n return this\r\n }", "title": "" }, { "docid": "e0860a0da418d7aed6375480c7d6d5fd", "score": "0.5780843", "text": "function Handler() {\n this.$handlers = {};\n return this;\n }", "title": "" }, { "docid": "0d8a7498ac029e48e4b9da822ff499e4", "score": "0.57480663", "text": "onAuth(handler) {\n this.authHandlers.push(handler);\n }", "title": "" }, { "docid": "6ff22ba0ef0aac9881f81cb9513d776d", "score": "0.5702966", "text": "function registerMessageHandler(handlerFunction) {\n\tsocket.onmessage = (event) => {\n\t\tlet data = JSON.parse(event.data);\n\t\thandlerFunction(data);\n\t}\n}", "title": "" }, { "docid": "76eeb4ea2add40c80bef5e7ab2233ef4", "score": "0.5614288", "text": "registerHandlers() {\n this.fieldSlaveChannel.subscribe(PUT_FIELD_REQUEST, putFieldHandler.bind(this));\n this.fieldSlaveChannel.subscribe(PATCH_FIELD_STATUS_REQUEST, patchStatusHandler.bind(this));\n this.fieldSlaveChannel.subscribe(PATCH_FIELD_SETTINGS_REQUEST, patchSettingsHandler.bind(this));\n }", "title": "" }, { "docid": "8d429564b75761097d0c26ca5aa8e053", "score": "0.560144", "text": "function setEventHandler ( event, handler ) {\n HANDLERS.push ( Event.on ( event, handler ) );\n}", "title": "" }, { "docid": "bbea833802001e88db1d5ae9133bd0e2", "score": "0.55974686", "text": "defineRequestType(name, handler) {\n this.types[name] = handler\n }", "title": "" }, { "docid": "b6d416a58329115cf7515aa70c88712a", "score": "0.555937", "text": "bindRouteHandler() {\n this.app.singleton('router.handler', _Handler.default);\n }", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "294c6044676ba1e79caf05a04d97862d", "score": "0.55517864", "text": "function Handler() {}", "title": "" }, { "docid": "76e51f1fe937cb9a73a43971093ef452", "score": "0.55501974", "text": "function addHandlers(type, handlers) {\n for (var i = 0; i < handlers.length; i++) {\n var handler = handlers[i];\n handler.spec.method = type;\n addMethod(appHandler, handler.action, handler.spec);\n }\n}", "title": "" }, { "docid": "3410909ceaf3f741b281386587bc8368", "score": "0.55285156", "text": "addResolvedHandler(lifecycle, action, handler) {\n const handlers = this.getActionHandlers(lifecycle, action);\n if (handlers) {\n handlers.add(handler);\n }\n else {\n this.hooks[lifecycle].set(action, new Set([handler]));\n }\n }", "title": "" }, { "docid": "224d2aa0597967ffc466ca7bd6197e0d", "score": "0.55090153", "text": "function register_goldmeterhandler(event, handler) \n{\n parent.prev_handlersgoldmeter.push([event, handler]);\n parent.socket.on(event, handler);\n}", "title": "" }, { "docid": "9e8a41bed992d88265262badd06a74ac", "score": "0.54992086", "text": "on(eventType, handler) {\n // Register the handler\n this.handlers[eventType].push(handler);\n // If this is the first handler for an event type and the cache for this event type is not empty\n if (this.handlers[eventType].length === 1 && this._cache[eventType] >= 0) {\n // Fire the handler for each item in the cache\n this._cache[eventType].forEach(payload => {\n __processEvent(eventType, payload);\n });\n // Clear the cache\n this._cache[eventType] = [];\n }\n }", "title": "" }, { "docid": "dd2e1ae831c781302340ce766094e41e", "score": "0.5490848", "text": "function shutdownRegister(name, handler) {\n if (name && handler) {\n shutdownHandlers.push({name: name, handler: handler});\n }\n }", "title": "" }, { "docid": "4c06f16d9adf50810f9f9aa6296e5eca", "score": "0.5487439", "text": "post(path, handler) {\n\t\tconst {routMap} = this;\n\t\tconst key = getHandlerKey('POST', path);\n\t\troutMap[key] = handler;\n\t\treturn this;\n\t}", "title": "" }, { "docid": "4da5e27160b4d942c28809ffe46a7e92", "score": "0.5467235", "text": "function registerUploadEventHandler(event, handler)\n{\n\treturn uploads.registerEventHandler(event, handler);\n}", "title": "" }, { "docid": "e87dd903b60aa6fe336eefeb3ee8da2d", "score": "0.54552335", "text": "on(eventName, handler) {\n this.eventsMap[eventName] = handler;\n }", "title": "" }, { "docid": "3bd278d7afcc8441f8ff3ccd840aec88", "score": "0.54183227", "text": "addHandlerRender(handler) {\n // to run multiple events that use the same function\n ['hashchange', 'load'].forEach(ev => window.addEventListener(ev, handler));\n }", "title": "" }, { "docid": "ee5856ebd512d59d3c459640eb7577ad", "score": "0.54043776", "text": "_registerHandlers(target, becameInvalid, becameValid) {\n this.on('becameInvalid', target, becameInvalid);\n this.on('becameValid', target, becameValid);\n }", "title": "" }, { "docid": "ff3a96b1a2267c995caac0795d2e3786", "score": "0.5393516", "text": "use (...handlers) { this.handlers = this.handlers.concat(handlers) }", "title": "" }, { "docid": "39e24fe0efe12cf1d32f2feec8a87fdb", "score": "0.5392522", "text": "function registerMessageHandler(handlerFunction) {\n socket.onmessage = function (e) {\n console.log.apply('message', e.data);\n var data = JSON.parse.parse(e.data);\n handlerFunction(data);\n };\n}", "title": "" }, { "docid": "99566ef1e3919a12569be6b5f48fae39", "score": "0.53791803", "text": "function listen(key, callback) {\n handlers[key] = callback;\n}", "title": "" }, { "docid": "92dd6bcb305c38327880f3331e26fe7a", "score": "0.53773475", "text": "function importHandler(handler) {\n Object.keys(handler.prototype).forEach(function(method) {\n FSWatcher.prototype[method] = handler.prototype[method];\n });\n}", "title": "" }, { "docid": "6f85fcd79e44704768b471fe8e69ff77", "score": "0.5377287", "text": "async configure (handler) {\n\n\t\tif (!(handler instanceof Handler)) { throw new Error(`You can only configure handler objects.`); }\n\n\t\tconst handlerType = handler.getType();\n\n\t\tswitch (handlerType) {\n\t\t\tcase `adapter`: await this.__configureAdapterHandler(handler); break;\n\t\t\tcase `analytics`: await this.__configureAnalyticsHandler(handler); break;\n\t\t\tcase `custom`: this.__configureCustomInputHandler(handler); break;\n\t\t\tcase `database`: this.__configureDatabaseHandler(handler); break;\n\t\t\tcase `logger`: this.__configureLoggerHandler(handler); break;\n\t\t\tcase `nlp`: this.__configureNlpHandler(handler); break;\n\t\t\tcase `periodic`: this.__configurePeriodicHandler(handler); break;\n\t\t\tcase `scheduler`: this.__configureSchedulerHandler(handler); break;\n\t\t\tdefault: throw new Error(`Invalid handler type of \"${handlerType}\".`);\n\t\t}\n\n\t}", "title": "" }, { "docid": "f554db51dfb27fd43c2e91e333036c62", "score": "0.53637254", "text": "function importHandler(handler) {\n Object.keys(handler.prototype).forEach(function (method) {\n FSWatcher.prototype[method] = handler.prototype[method];\n });\n}", "title": "" }, { "docid": "f554db51dfb27fd43c2e91e333036c62", "score": "0.53637254", "text": "function importHandler(handler) {\n Object.keys(handler.prototype).forEach(function (method) {\n FSWatcher.prototype[method] = handler.prototype[method];\n });\n}", "title": "" }, { "docid": "22a7d353578eb27669f767b2af18c0c9", "score": "0.5336998", "text": "function registerHandler(app)\n{\n return function(req, res)\n {\n let view = {};\n res.send(doMustache(app, 'register', view));\n }\n}", "title": "" }, { "docid": "1548500e4a08aeacc896c4b029e53c34", "score": "0.53277814", "text": "if (handlers[event].indexOf(handler) === -1) {\n handlers[event].push(handler);\n }", "title": "" }, { "docid": "f0b5ed44f4bbec50647ca20c87954b8e", "score": "0.53155667", "text": "_createHandler () {\n return new Handler(\n Object.assign({}, {\n handlers: this.$schema.handlers,\n firstErrorOnly: this.$schema.firstErrorOnly,\n context: this\n })\n );\n }", "title": "" }, { "docid": "e99ed91ce378e8d136958b78d9f83ba2", "score": "0.5310839", "text": "function addEventHandler(element, type, handler) {\n element.attachEvent(type, handler);\n // store the handler so it can be detached later\n eventHandlers.push(arguments);\n}", "title": "" }, { "docid": "f86be553772356796fc47be25ff989df", "score": "0.53094244", "text": "handlerWillAdd (event, when, handler) {\n\n }", "title": "" }, { "docid": "fb0b8b02ce5ae82e6e14057bc7da589b", "score": "0.52866966", "text": "function bind(eventName, handler) {\n\t\t\t_this.on(eventName, handler);\n\t\t\tbindTuples.push([ eventName, handler ]);\n\t\t}", "title": "" }, { "docid": "fb0b8b02ce5ae82e6e14057bc7da589b", "score": "0.52866966", "text": "function bind(eventName, handler) {\n\t\t\t_this.on(eventName, handler);\n\t\t\tbindTuples.push([ eventName, handler ]);\n\t\t}", "title": "" }, { "docid": "fb0b8b02ce5ae82e6e14057bc7da589b", "score": "0.52866966", "text": "function bind(eventName, handler) {\n\t\t\t_this.on(eventName, handler);\n\t\t\tbindTuples.push([ eventName, handler ]);\n\t\t}", "title": "" }, { "docid": "fb0b8b02ce5ae82e6e14057bc7da589b", "score": "0.52866966", "text": "function bind(eventName, handler) {\n\t\t\t_this.on(eventName, handler);\n\t\t\tbindTuples.push([ eventName, handler ]);\n\t\t}", "title": "" }, { "docid": "d57bf1e70fa75ec221263cff1e3ed76f", "score": "0.5283389", "text": "function addHandler(name, o) {\n // adds a handler for a particular type of exception\n var handler = $.extend({}, defaultHandler, o || {});\n reportHandlers[name] = handler;\n }", "title": "" }, { "docid": "17ed82382c247b4cb8504d9f7328e50b", "score": "0.52823424", "text": "function add_handler(folder, file) {\n\n reg(file + ' -> ' + folder + '/' + file);\n ß.app.get('/' + file, function(req, res) {\n fs.readFile(folder + '/' + file, 'utf8', function(err, data) {\n if (err) {\n console.log('ERROR could not serve', folder, file);\n res.send('ERROR');\n return;\n }\n\n // send the data, and apply some Cashe-control in production to these statically localized files\n res.setHeader('Cache-Control', 'no-cache');\n res.setHeader('Content-Type', req.is('*/*'));\n\n res.send(data);\n\n });\n });\n}", "title": "" }, { "docid": "273dcebc8444ea7f244f2af32de6b0ed", "score": "0.52777", "text": "setIntentHandlers() {\n let intentHandlers = {};\n intentHandlers[Constants.INTENT_ADD] = addIntentHandler;\n intentHandlers[Constants.INTENT_ASK] = askIntentHandler;\n intentHandlers[Constants.INTENT_DELETE] = deleteIntentHandler;\n this._alexa.setIntentHandlers(intentHandlers);\n }", "title": "" }, { "docid": "e27b809900cdad49a045ed6d9b99ba21", "score": "0.5273877", "text": "function registerNamespaceRequestHandler(requestKey, callback, context) {\n if( !isUndefined(context) ) {\n callback = callback.bind(context);\n }\n\n var requestHandler = function(params) {\n var callbackResponse = callback(params);\n this.publish( createEnvelope('request.' + requestKey + '.response', callbackResponse) );\n }.bind(this);\n\n var handlerSubscription = this._subscribe('request.' + requestKey, requestHandler);\n this.requestHandlers.push(handlerSubscription);\n\n return handlerSubscription;\n}", "title": "" }, { "docid": "82a0e1cdbd86a36beb384a9c6ebe8635", "score": "0.5268438", "text": "function setMessageHandler(messageHandler) { this.messageHandler = messageHandler; }", "title": "" }, { "docid": "74863ee37b86c9a825aca95dbe74078c", "score": "0.5258281", "text": "function createHandler(eventType) {\n xhr['on' + eventType] = function (event) {\n copyLifecycleProperties(lifecycleProps, xhr, fakeXHR);\n dispatchEvent(fakeXHR, eventType, event);\n };\n }", "title": "" }, { "docid": "a817a610b3801630887675e79965e0d2", "score": "0.52540153", "text": "__configureAnalyticsHandler (handler) {\n\n\t\tconst handlerId = handler.getHandlerId();\n\n\t\t// Doesn't make sense to allow more than one analytics handler to be configured.\n\t\tif (this.analytics[handlerId]) {\n\t\t\tthrow new Error(`You have already configured the \"${handlerId}\" analytics handler.`);\n\t\t}\n\n\t\tthis.analytics[handlerId] = handler;\n\n\t\t// Inject dependencies.\n\t\thandler.inject(`sharedLogger`, sharedLogger);\n\n\t}", "title": "" }, { "docid": "b1a3dfff4e9a6b617451927daf8e643e", "score": "0.5253263", "text": "function registerNotificationHandlers() {\n notificationHandlersRegistered = true;\n\n // Attach an onClicked event handler.\n paragon.notifications.onClicked.addListener(function (notificationId) {\n // Bring the main Symphony window to the foreground.\n symphony.app.window.showWindow(\"main\");\n\n // Extract the callback for the current notification.\n var cb = notificationIds[notificationId];\n if (cb) {\n // We found stored callback info, execute it.\n execCallback(cb.method, cb.args);\n }\n });\n\n // Attach an onClosed event handler.\n paragon.notifications.onClosed.addListener(function (notificationId) {\n // Remove the callback info for the notification that has closed.\n delete notificationIds[notificationId];\n });\n }", "title": "" }, { "docid": "912de73a778ea495321c661f6a94fffd", "score": "0.52518713", "text": "function registerEventHandler(pElementId, pEventType, pHandler){\n\t\t\t\tlogger.debug(\"registerEventHandler\", pElementId + \" \" + pEventType);\n\t\t\t\ttry{\n\t\t\t\t\t$(jqe(pElementId)).on(pEventType, pHandler);\n\t\t\t\t}\tcatch(excp){\n\t\t\t\t\tlogger.debug(\"Exception in registerEventHandler elementID=\"+pElementId+\", EventType=\"\n\t\t\t\t\t\t+pEventType +\" & error message\", excp);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "662e3ba96deaa514071258c570b6eead", "score": "0.52506953", "text": "addLogsHandler(logsHandler) {\n this.logsHandlers.push(logsHandler);\n }", "title": "" }, { "docid": "a4d948d59f09c31ae437af34a64b3076", "score": "0.524723", "text": "function add_route(path, handler, verb) {\n\tverb = verb || 'get';\n\tthis.server[verb].call(this.server, path, this.create_route(handler));\n}", "title": "" }, { "docid": "aa80103ab88da8e1d3296c807f3e6f08", "score": "0.52456445", "text": "setObserver(handler) {\n this.handler = handler;\n }", "title": "" }, { "docid": "0bb3d8b43dcd263211cfc5ff2ec25b80", "score": "0.52115166", "text": "addRoute(method, route, ...handlers) {\n this.routes.add({\n method,\n route,\n handlers\n });\n }", "title": "" }, { "docid": "4f0d70e712119821d94527112af74d4d", "score": "0.52093375", "text": "on(type, handler) {\n const name = this.eventName(type),\n h = this._handlers,\n i = this._handlerIndex(h[name], type, handler);\n\n if (i < 0) {\n eventListenerCheck(this, type);\n (h[name] || (h[name] = [])).push({\n type: type,\n handler: handler\n });\n }\n\n return this;\n }", "title": "" }, { "docid": "fe0a3843f5efe0077e721c18a68723c4", "score": "0.5208165", "text": "function setNewModuleHandler(newModuleHandler) {\n myNewModuleHandler = newModuleHandler;\n }", "title": "" }, { "docid": "fa354d259e8633581c61688e33438f24", "score": "0.5196926", "text": "on(event, handler) {\n if (this._eventHandlers[event] === undefined) {\n this._eventHandlers[event] = [];\n }\n this._eventHandlers[event].push(handler);\n return this.removeListener(event, handler);\n }", "title": "" }, { "docid": "72320a3d4384578bbf12b65e9f695823", "score": "0.51916164", "text": "on(test, handler) {\n if (test == null) {\n throw TypeError('test must be provided');\n }\n\n if (!(test instanceof RegExp) &&\n typeof test != 'string' &&\n typeof test != 'function') {\n throw TypeError('test must be a regular expression, a string or a function');\n }\n\n if (handler == null) {\n throw TypeError('handler must be provided');\n }\n\n if (typeof handler != 'function') {\n throw TypeError('handler must be a function');\n }\n\n let handlers = this._events.get(test);\n\n if (handlers == null) {\n handlers = new Map();\n this._events.set(test, handlers);\n }\n\n handlers.set(handler, handler);\n }", "title": "" }, { "docid": "e9ff9e1f7b414d00848ea578bb86411a", "score": "0.5181344", "text": "function registerTaskHandler(taskHandler) {\n if (taskHandlers[taskHandler.taskType]) {\n console.log('attempt to register duplicate task handler \"', taskHandler.taskType, '\"');\n\n return false;\n }\n taskHandlers[taskHandler.taskType] = taskHandler;\n if (initialized) {\n taskHandler.initialize(config.taskConfiguration);\n }\n}", "title": "" }, { "docid": "5882503cfe477ba637f43986f2dafaa0", "score": "0.51799536", "text": "function registerOpenHandler(handlerFunction) {\n socket.onopen = function () {\n console.log('open');\n handlerFunction();\n };\n}", "title": "" } ]
4725feb77c7961d4b45711f9eff2a994
! Public Function showSearch() ! This function shows a search dialog. ! This function is considered public and may be used ! by developers.
[ { "docid": "d26832a322b9ff1068025aea42adce9b", "score": "0.7972722", "text": "function showSearch(strURL) {\n showNonModalDialog(strURL, 700, 500,true);\n}", "title": "" } ]
[ { "docid": "e400dde6f267cd10704e1665716356d5", "score": "0.76165426", "text": "function showSearchPage(){\r\n}", "title": "" }, { "docid": "6d40b44c5edb4af32eb8dfcd405f88b1", "score": "0.75143844", "text": "function showSearchScreen(cmd, url) {\n\tvar windowPopup = window.open(\"\",\"Search\", getPopupPositionProps(400, 400)+\",scrollbars=yes,toolbar=no,status=yes,resizable=yes\");\n\ttry {\n\t\twindowPopup.document.writeln('<span>...searching...</span>');\n\t} catch (e) {\n\t\twindowPopup.close();\n\t}\n \twindowPopup.document.location.replace(url);\n}", "title": "" }, { "docid": "eb38e7c424e18b4d3689699d0110f935", "score": "0.7174721", "text": "function onSearchClicked() {\r\n if (CZ.Tours.isTourWindowVisible && CZ.Tours.onTourClicked)\r\n CZ.Tours.onTourClicked();\r\n\r\n if (Search.isSearchWindowVisible) {\r\n $(\"#search\").hide('slide', {}, 'slow');\r\n } else {\r\n $(\"#search\").show('slide', {}, 'slow', function () {\r\n $(\"#searchTextBox\").focus();\r\n });\r\n }\r\n Search.isSearchWindowVisible = !Search.isSearchWindowVisible;\r\n }", "title": "" }, { "docid": "407583b26171defc8d3e9aebcd222b08", "score": "0.7167356", "text": "function search() {\n\t\thideContent(true);\n\t\t$(\"#ajaxLoader\").show();\n\t\t$(\"#search-input\").val(uri.search(true).input);\n\t\tgetData(populateHTML.bind(null));\n\t}", "title": "" }, { "docid": "2f7ec282ce8304e237d4e7f242c445d6", "score": "0.715928", "text": "function getSearch(event,id,mode) {\n var cont = \"<fieldset><legend><b>Search</b></legend>\";\n cont += \"<input id='invSearch' type='text' onkeypress=\\\"if(getKey(event)==13){searchSpec('invSearch','\"+id+\"','\"+mode+\"');} else {return tanpa_kutip(event)}\\\" />\";\n cont += \"<img src='images/search.png' onclick=\\\"searchSpec('invSearch','\"+id+\"','\"+mode+\"')\\\" style='cursor:pointer'>\";\n cont += \"</fieldset>\";\n \n cont += \"<fieldset><legend><b>Result</b></legend><div id='sResult' style='height:315px;overflow:auto'>\";\n cont += \"</div></fieldset>\";\n showDialog2('Search',cont,'500','400',event);\n}", "title": "" }, { "docid": "878d75ffd2d0b6c575abb019c2b208e4", "score": "0.7133741", "text": "function showSearch() {\n $(\"#navigation\").show();\n $(\"#image\").show();\n $(\"#top-news\").show();\n $(\"#moviesandshows\").show();\n }", "title": "" }, { "docid": "9f25c4ef65ee7c5fbbd1cf96b5a0ddd7", "score": "0.7075449", "text": "function openSearch(){\n topFunction();\n maximise('seachAccount');\n minimise('classViewer');\n minimise('deleteClass');\n minimise('classAdd');\n minimise('updateClass');\n minimise('addAcount');\n}", "title": "" }, { "docid": "93a745a58934623489ffd94ac2928f4a", "score": "0.7066925", "text": "function onclickSearch(){\n\t$('#search_submit').click(function() {\n\t\t//console.log(\"beginning\");\n\n\t\tvar search_input = $('#search_input').val();\n\t\tif (search_input != \"\"){\n\t\t\t//console.log(search_input);\n\t\t\tsearchItem(search_input);\n\t\t\tsearchTag(search_input);\n\t\t}else {\n\t\t\t//console.log(\"search nothing\");\n\t\t\t//not implemented\n\t\t\t//window.open('.html','1494164703883','width=300,height=200,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=1,left=0,top=0');\n\t\t}\n });\n}", "title": "" }, { "docid": "90f4a04c7a4c6e5d42f832038cd88e65", "score": "0.7058793", "text": "function search() {\n E.display.content.hideMain();\n E.display.hideRouteNavigation();\n E.display.hideMainSearch();\n E.display.hideRouteSearch();\n E.display.header.hideButton();\n E.display.header.hideHeader();\n E.display.header.showLogo();\n E.display.content.hideToggle();\n E.display.hidePageLoader();\n E.display.hideMapControllers();\n }", "title": "" }, { "docid": "b9c2a7194a2605224f3f97634a56d402", "score": "0.703549", "text": "function showSearch() {\n\tvar search = document.getElementById(\"searchField\");\n\n\tif (search.classList.contains(\"visible\")) {\n\t\tsearch.classList.remove(\"visible\");\n\t} else {\n\t\tsearch.classList.add(\"visible\");\n\t}\n}", "title": "" }, { "docid": "ba6a749983cf499dd656617f8743467d", "score": "0.70166963", "text": "function showSearchList()\n{\n // clear the main list display UI\n\tdocument.getElementById(\"list-results\").innerHTML = \"\";\n \n // slide the 'wish list' view upwards to hide it\n\t$(\"#list-view\").slideUp();\n \n // slide the 'search results' view downwards to show it\n\t$(\"#search-view\").slideDown();\n \n // clear the previous search results from the UI\n\tdocument.getElementById(\"search-results\").innerHTML = \"\";\n \n // display the results of searching for the query string in the 'Search...' text box\n\tdisplayResults(searchResults);\n \n // un-highlight the 'List' tab menu item to mark it as 'inactive'\n\t$(\"#list-menu-button\").removeClass(\"active\");\n \n // highlight the 'Search' tab menu item to mark it as 'active'\n\t$(\"#search-menu-button\").addClass(\"active\");\n}", "title": "" }, { "docid": "65d185ae51153d8470950174907db173", "score": "0.7004", "text": "function showSearch(){\n\t\t$('.nav-item').css('visibility','hidden');\n\t\t$('#search-module').show();\n\t\t$('#clear').show();\n\t}", "title": "" }, { "docid": "d6b764a58441bcd5e80b4518fba6ecbf", "score": "0.69912916", "text": "function showSearch(noHistory) {\r\n\t//Change to search\r\n\tvar changeHash = (noHistory) ? false : true;\r\n\t$.mobile.changePage('#pgSearch', { transition: \"none\", reverse: true, changeHash: changeHash });\r\n\r\n\t//Set focus to search box\r\n\t$('#search-mini').focus();\r\n}", "title": "" }, { "docid": "0b2f9154528943955c9c2c2ca4fce328", "score": "0.69665647", "text": "search(query) {\r\n this.searchBoxComponentService.search(query, this.config);\r\n // force the searchbox to open\r\n this.open();\r\n }", "title": "" }, { "docid": "8ac2d88b91b549fa6855e8f346abbcae", "score": "0.69367313", "text": "function showResults() {\n var searchTextBox = document.getElementById(\"fbSearchTextBox\"),\n searchString = searchTextBox.value;\n\n if (searchString) {\n searchTextBox.classList.remove(\"error\");\n getSearchResults(searchString, \"pagesCall\");\n } else {\n searchTextBox.classList.add(\"error\");\n }\n }", "title": "" }, { "docid": "b63205edd7a9c2e7c99fa809071e6513", "score": "0.6881659", "text": "function search() {\r\n var search_value = $(this).find(\"input[type=text]\").val();\r\n load(\"/Music/Search/\" + search_value, null, function(data) {\r\n $(config.resultsTab).show().find(\"a\").html('<span id=\"lblSearchResults\">' + language.SearchResults + '</span>: ' + search_value);\r\n tabs.tabs(\"select\", 4);\r\n if (searchTable == null) {\r\n var searchDiv = $(config.searchDiv);\r\n searchDiv.empty();\r\n searchTable = $(\"<table></table>\").appendTo(searchDiv);\r\n }\r\n searchTable.empty();\r\n for (var i = 0; i < data.Tracks.length; i++) {\r\n var item = data.Tracks[i];\r\n var row = $(\"<tr />\");\r\n row.append(createTrackTd(item));\r\n row.append(createTrackLengthTd(item));\r\n row.append(createArtistTd(item.Artist));\r\n row.append(createAlbumTd(item.Album));\r\n row.appendTo(searchTable);\r\n }\r\n });\r\n return false;\r\n }", "title": "" }, { "docid": "6daa96517d3386c998f7f80208149014", "score": "0.68801796", "text": "function showAdvSearch(event) {\n\tevent.preventDefault();\n\t$('#advSearchBar').show();\n}", "title": "" }, { "docid": "24e9f30550e4d0cf565f8dea862f9c03", "score": "0.6845903", "text": "searchSuper(event){\n document.getElementById(\"search-popup\").style.display = \"block\";\n }", "title": "" }, { "docid": "d7fed52eb729303be5e92d1dbc22f02d", "score": "0.68387395", "text": "function showSearch(options) {\n\t\tvar $hint, $input, $results;\n\n\t\tvar settings = $.extend(true, $[deck].defaults[searchSettings], options);\n\t\n\t\t/* Remove any previous instances and re-initialize, if running this function again for some reason. */\n\t\tremoveSearch();\n\n\n\t\t/* Init container. */\n\t\t$cont = $('<div id=\"'+settings.container.id+'\" />')\n\t\t\t.css(settings.container.styleDefault)\n\t\t\t.bind('focusin', function() {\n\t\t\t\tif ($hint) {\n\t\t\t\t\t$hint.remove();\n\t\t\t\t\t$hint = null;\n\t\t\t\t}\n\t\t\t\t$input.css(settings.input.styleActive);\n\t\t\t})\n\t\t\t.bind('focusout', function() {\n\t\t\t\t$input.removeAttr('placeholder');\n\t\t\t\tif (!$results.html()) {\n\t\t\t\t\t$input.css(settings.input.styleInactive);\n\t\t\t\t\t$cont.css(settings.container.styleDefault);\n\t\t\t\t}\n\t\t\t});\n\t\t\n\n\t\t/* Add hint text. */\n\t\tif (settings.hint.show) {\n\t\t\t$hint = $('<div id=\"'+settings.hint.id+'\">'+settings.hint.text+'</div>')\n\t\t\t\t.css(settings.hint.style)\n\t\t\t\t.appendTo($cont);\n\t\t}\n\n\n\t\t/* Init search box. */\n\t\t$input = $('<input id=\"'+settings.input.id+'\" type=\"search\" results=\"5\" autocomplete=\"on\" placeholder=\"Search...\" />')\n\t\t\t.css(settings.input.styleInactive)\n\t\t\t/* Handle events related to search-field. */\n\t\t\t.bind('keyup keydown keypress', function(event) {\n\t\t\t\t/* Stop event propagation from the search box not to get mixed with normal deck navigation. */\n\t\t\t\tevent.stopPropagation();\n\t\t\t\t\n\t\t\t\t/* Work only on keyup events */\n\t\t\t\tif (event.type !== 'keyup') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* Search and display results */\n\t\t\t\tvar searchString = $(this).val();\n\t\t\t\tvar links = [];\n\t\t\t\tif (searchString.length) {\t\n\t\t\t\t\tvar regex = new RegExp(searchString, 'img');\n\t\t\t\t\t$('.slide').each(function(i,n) {\n\t\t\t\t\t\tvar $slide = $(this);\n\t\t\t\t\t\tvar hits = $slide.text().match(regex);\n\t\t\t\t\t\tif (hits || i === parseInt(searchString, 10)) {\n\t\t\t\t\t\t\tvar title = \"\", details = \"\", resultStyle = \"\";\n\n\t\t\t\t\t\t\tvar $parentSlide = $slide.parent().closest('.slide');\n\n\t\t\t\t\t\t\tif (!$parentSlide.length) {\n\t\t\t\t\t\t\t\tresultStyle = 'margin: 0.5em 0 0;'\n\t\t\t\t\t\t\t\t// Show title of main slides\n\t\t\t\t\t\t\t\ttitle = $slide.children(settings.slideTitleSelectors).first().text();\n\t\t\t\t\t\t\t\tif (title.length > 25) {\n\t\t\t\t\t\t\t\t\ttitle = title.substring(0, 22) + \"...\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Small indent for child-slides in result list\n\t\t\t\t\t\t\t\tresultStyle += 'margin: 0 0 0 0.5em;';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (hits) {\n\t\t\t\t\t\t\t\tdetails = ['(', hits.length, ' hit', (hits.length > 1 ? 's' : ''), ')'].join('');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdetails = '(slide #'+i+')';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tlinks.push([\n\t\t\t\t\t\t\t\t'<div class=\"', settings.results.resultClass, '\" style=\"', resultStyle ,'\">',\n\t\t\t\t\t\t\t\t\t'<a id=\"result', i , '\" href=\"#', this.id ,'\"><span style=\"font-weight: bold;\">', title, '</span>', (title ? '<br>' : ''), '#', this.id , '</a> ',\n\t\t\t\t\t\t\t\t\t'<span style=\"', settings.results.hitsStyle,'\">', details, '</span>',\n\t\t\t\t\t\t\t\t'</div>'\n\t\t\t\t\t\t\t\t].join('')\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 (!links.length) {\n\t\t\t\t\t\tlinks.push('(no results)');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvar resultsHTML = links.join('');\n\t\t\t\t$cont.css(resultsHTML ? settings.container.styleWithResults : settings.container.styleDefault);\n\t\t\t\t$cont.css({'max-height': $(window).height()});\n\n\t\t\t\t$results.html(resultsHTML);\n\t\t\t\t\n\n\t\t\t\t/* Navigate to first search result. (Default = ENTER) */\n\t\t\t\tvar key = event.keyCode || event.which;\n\t\t\t\tif (key === settings.keys.navigateToResult) {\n\t\t\t\t\t$results.find('a:first').click();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* Blur the search field to allow normal keyboard navigation. (Default = ESC) */\n\t\t\t\telse if (key === settings.keys.blurSearch) {\n\t\t\t\t\t$(this).blur();\n\t\t\t\t}\n\t\t\t})\n\t\t\t/* Empty results, when the \"empty this input\" -icon in search field is clicked. */\n\t\t\t.bind('click', function() {\n\t\t\t\tif (!$(this).val().length) {\n\t\t\t\t\t$results.empty();\n\t\t\t\t}\n\t\t\t})\n\t\t\t.appendTo($cont);\n\n\n\t\t/* Focus search field. (Default = f) */\n\t\t$d.bind('keyup.decksearch', function(event) {\n\t\t\tvar key = event.keyCode || event.which;\n\t\t\tif (key === settings.keys.focusSearch) {\n\t\t\t\t$input.removeAttr('placeholder');\n\t\t\t\t$input.focus();\n\t\t\t}\n\t\t})\n\t\t/* Empty search if clicked outside search container. */\n\t\t.bind('click', function(event) {\n\t\t\tif (!$(event.target).closest('#'+settings.container.id).length) {\n\t\t\t\t$input.val('').trigger('click');\n\t\t\t\t$cont.trigger('focusout');\n\t\t\t}\n\t\t});\n\t\t\n\n\n\t\t/* Init results list. */\n\t\t$results = $('<div id=\"'+settings.results.id+'\" />')\n\t\t\t.delegate('a', 'click', function() {\n\t\t\t\tif (settings.useGo) {\n\t\t\t\t\t// Navigate the deck when clicking on result-link using the deck.core 'go'-function.\n\t\t\t\t\t// It seems, that without 'go' the page can get messed up more easily in some slideshows?\n\t\t\t\t\tvar index = this.id.match(/\\d*$/)[0];\n\t\t\t\t\t$.deck('go', parseInt(index, 10) );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.delegate('a', 'keyup keydown keypress', function(event) {\n\t\t\t\tvar key = event.keyCode || event.which;\t\t\t\n\t\t\t\tif (key && key != 13 && key != 32) {\n\t\t\t\t\t// Key pressed, but it wasn't ENTER or SPACE, let them pass through normally.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Stop event propagation from the results not to get mixed with normal deck navigation.... */\n\t\t\t\tevent.stopPropagation();\n\n\t\t\t\t// ... but do something only on keyup events.\n\t\t\t\tif (event.type !== 'keyup') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Handle keyup as click. Note, that this simple approach doesn't work if not using 'go'.\n\t\t\t\t// That's because space/enter on links won't be handled as they normally would in browsers (deck.core probably stops them).\n\t\t\t\t// We would have to simulate \"real\" mouse click, see e.g. http://stackoverflow.com/questions/1421584/how-can-i-simulate-a-click-to-an-anchor-tag.\n\t\t\t\t$(this).click();\n\t\t\t\treturn false;\n\t\t\t})\n\t\t\t/* Hide results if ESC is pressed when focused on results. */\n\t\t\t.bind('keyup', function(event) {\n\t\t\t\tvar key = event.keyCode || event.which;\t\n\t\t\t\tif (key === settings.keys.blurSearch) {\n\t\t\t\t\t$input.val('').trigger('click');\n\t\t\t\t\t$cont.trigger('focusout');\n\t\t\t\t}\n\t\t\t})\n\t\t\t.appendTo($cont);\n\n\t\t/* Handle scrollbar appear/disappear if window resized. */\n\t\t$(window).bind('resize', function() {\n\t\t\t$cont.css({'max-height': $(window).height()});\n\t\t});\n\n\t\t/* Add search-box to document. */\n\t\t$cont.appendTo(settings.container.target);\n\t}", "title": "" }, { "docid": "a108f4631d5387d35bacbaa00fa020f9", "score": "0.6778694", "text": "function openSearch(url, winTitle) {\r\n var screenWidth = parseInt(screen.availWidth);\r\n var screenHeight = parseInt(screen.availHeight);\r\n\r\n var winParams = \"width=\" + screenWidth + \",height=\" + screenHeight;\r\n winParams += \",left=0,top=0,toolbar,scrollbars,resizable,status=yes\";\r\n\r\n openWindow(url, winTitle, winParams);\r\n}", "title": "" }, { "docid": "a108f4631d5387d35bacbaa00fa020f9", "score": "0.6778694", "text": "function openSearch(url, winTitle) {\r\n var screenWidth = parseInt(screen.availWidth);\r\n var screenHeight = parseInt(screen.availHeight);\r\n\r\n var winParams = \"width=\" + screenWidth + \",height=\" + screenHeight;\r\n winParams += \",left=0,top=0,toolbar,scrollbars,resizable,status=yes\";\r\n\r\n openWindow(url, winTitle, winParams);\r\n}", "title": "" }, { "docid": "41dc516f9104f3bae67a010313e07d9a", "score": "0.67556304", "text": "function doSearch(){\n window.location = (currEng.url+currEng.query+input.value);\n return false;\n }", "title": "" }, { "docid": "0f7ae5cc5b9af59879e6b0129c46a97b", "score": "0.6743487", "text": "function openSearch(url, winTitle) {\n var screenWidth = parseInt(screen.availWidth);\n var screenHeight = parseInt(screen.availHeight);\n\n var winParams = \"width=\" + screenWidth + \",height=\" + screenHeight;\n winParams += \",left=0,top=0,toolbar,scrollbars,resizable,status=yes\";\n\n openWindow(url, winTitle, winParams);\n}", "title": "" }, { "docid": "de0a34e0733b34d03ba12115f7634c98", "score": "0.6732682", "text": "function openSearch(url, winTitle) {\n var screenWidth = parseInt(screen.availWidth);\n var screenHeight = parseInt(screen.availHeight);\n\n var winParams = \"width=\" + screenWidth + \",height=\" + screenHeight;\n winParams += \",left=0,top=0,toolbar,scrollbars,resizable,status=yes\";\n\n openWindow(url, winTitle, winParams);\n}", "title": "" }, { "docid": "f048c0c4ccd5223245d71cb212f26e4a", "score": "0.67057854", "text": "function searchFromInput() {\n if (actualSearch.value.trim() == \"\") {\n makePopup(\"Enter a search query\", true)\n return\n }\n fadeInLoading()\n searchSpotify(actualSearch.value)\n}", "title": "" }, { "docid": "236bdab60d1b058c13e8a67ab8f588ad", "score": "0.6671358", "text": "function openSearchDesktop(){\r\n document.getElementById(\"searchPlane\").style.display = \"block\";\r\n document.getElementById(\"search\").autocomplete = \"off\";\r\n\r\n document.getElementById(\"closeSearch\").style.display = \"block\";\r\n\r\n document.getElementById(\"search\").style.width = \"70%\";\r\n document.getElementById(\"search\").style.borderTopRightRadius = \"0\";\r\n document.getElementById(\"search\").style.borderBottomRightRadius = \"0\";\r\n\r\n}", "title": "" }, { "docid": "5727011c327cf99f86fe93d3e28f85fd", "score": "0.6667801", "text": "function openSearchPage (searchString) {\n var temp = encodeURIComponent(searchString.trim()); // Remove white spaces and and replace spaces with %20\n var relevantString = \"https://search2.info.yorku.ca/?q=\" + temp + \"&client=External&proxystylesheet=External&site=default_collection&output=xml_no_dtd\";\n window.open(relevantString); // Open the results in a new window\n}", "title": "" }, { "docid": "40514b69b167b3457071e0473154ae00", "score": "0.6646775", "text": "function showSearchBar(){\t\n\t\t\t(searchBar.style.display == \"block\") ? searchBar.style.display = \"none\" : searchBar.style.display = \"block\";\n\t\t}", "title": "" }, { "docid": "ac3723c0844363d4b5887551e1a043c7", "score": "0.6609508", "text": "function beginSearch() {\n search(false);\n }", "title": "" }, { "docid": "c697a125b4643aa2f29fcc30883d24be", "score": "0.66089475", "text": "function search() {}", "title": "" }, { "docid": "57a21e0986fd905b2414c94e9a3ae3bc", "score": "0.65974253", "text": "function search() {\n var params = {\n // retrieve maximum 50 values per facet to display the \"more\" link\n maxValuesPerFacet: 50\n };\n // if we're sorting by something,\n // make the typo-tolerance more strict\n if (helper.index != index) {\n // disable if not the \"default\" index (sort by price, etc...)\n helper.state.setTypoTolerance(false);\n }\n // perform the query\n\n helper.setQuery($q.val());\n lastQueryStr = $q.val(); \n helper.search();\n }", "title": "" }, { "docid": "987332104788440fd789e476ecc20955", "score": "0.658583", "text": "function searchClick() {\n var doc = $(\"#search-input\").val();\n if (doc && (!(doc.trim() == \"\"))) {\n document.location.href = global.context + \"/jsp/kb/search-item.jsp?keywords=\" + doc;\n } else {\n $.dialog({\n type: 'alert',\n content: '请输入要搜索的条目!'\n });\n }\n\n}", "title": "" }, { "docid": "68bd45c7f137387f8fec1ee09ba50104", "score": "0.65798366", "text": "function showSearch(){\n document.getElementById('MenuArea').style.display=\"none\";\n document.getElementById('SearchArea').style.display=\"block\";\n}", "title": "" }, { "docid": "88bcfd9e1e1adfb3b14329285ab0455d", "score": "0.65706563", "text": "function results() {\n // Actually show the results\n searchSection.removeAttribute('hidden');\n searchSection.scrollIntoView({\n behavior: 'smooth'\n });\n\n $(searchEl).find('.mdc-list-item').off('click').click(() => {\n $(dialogEl).attr('style', 'z-index:10000!important;');\n MDCDialog.attachTo(dialogEl).open();\n });\n}", "title": "" }, { "docid": "c48d964dab2b3fc5598c5b5dbc65610f", "score": "0.6567991", "text": "function loadSearch() {\n}", "title": "" }, { "docid": "3934f1a2a625aaf4fc8181db544e94c6", "score": "0.6531913", "text": "function onSearchButt() {\n\t\t// var uri = new URI();\n\t\t// var queries = uri.search(true)\n\t\t// console.log(queries)\n\t\turi.setSearch({input: $(\"#search-input\").val()});\n\t\turi.setSearch({source: $(\"#data-source-selection\").val()});\n\t\t// queries['input'] = $(\"#search-input\").val();\n\t\t// queries['source'] = $(\"#data-source-selection\").val()\n\t\t\n\t\t// if user is dumb and pressed search on empty input\n\t\tif (! uri.search(true).input) {\n\t\t\thideContent(true)\n\t\t\t$(\"#emptySearch\").show()\n\t\t\treturn false;\n\t\t}\n\t\t// wrong\n\t\t// pushGuai(queries)\n\t\t\n\t\tsearch();\n\t\t// why is this return false here?\n\t\treturn false;\n\t}", "title": "" }, { "docid": "a1b0fe097a2df3e7eb028967f188a55a", "score": "0.6528747", "text": "function displaySearch(){\n $(\"div.no-result\").hide(); \n $(\".new-search-button-container\").hide(); \n $(\"section.result\").hide();\n $(\"section.search\").show();\n $(\"body\").removeClass(\"result\");\n $(\"body\").addClass(\"search\");\n}", "title": "" }, { "docid": "5811131d91ed50ea5b7af75cecec4eea", "score": "0.6511663", "text": "function show_search() {\n\nctnBarsSearch.style.top = '140px'; //para que baje xq lo tengo escondido arriba \nbackCtnSearch.style.display = 'block'; //para que aparezca el fondo translucido negro\ninputSearch.focus(); //para que funcione la barra al tipear\nif (inputSearch.value === '') {\n boxSearch.style.display = 'none'; \n}\n\n}", "title": "" }, { "docid": "87e5abc76547ac410b7b482ce7412967", "score": "0.65102047", "text": "function showSearchResults(searchInput) {\n if (searchInput) {\n const searchResults = searchStudents(searchInput, data);\n if (searchResults.length > 0) {\n showPage(searchResults, 1);\n addPagination(searchResults);\n } else {\n studentList.innerHTML = `\n <div>\n <h1>Sorry, we couldn't find a student with that name. Please check your spelling or try a different name.</h1>\n </div>\n `\n addPagination(searchResults);\n }\n linkList.addEventListener('click', (event) => {\n if (event.target.tagName === 'BUTTON') {\n showPage(searchResults, event.target.textContent);\n }\n })\n } else {\n showDefaultStudentList();\n }\n}", "title": "" }, { "docid": "42465e068e93719644f22e588bdb42ed", "score": "0.65075", "text": "function doSearch(){\n\t\t//$('#advanced, #mid').css('opacity','0.5');\n\t\t$('#result-placeholder').html('Loading...');\n\t\t$('#loading').show();$('#clearSearch').hide();\n\t\t$('#map-stuff').hide();\n\t\t$('.ui-autocomplete').hide();\n\t\t$('#map-help-stuff').html('Please wait...');\n\t\tif(n!=''){\n\t\t\tdoSpatialSearch();\n\t\t}else{\n\t\t\tdoNormalSearch();\n\t\t}\n\n\t\t\n\t\t\n\t\t$('.gotoPage').live('click', function(){\n\t\t\tvar id = $(this).attr('id');\n\t\t\tvar term = '#'+search_term+'/p'+id;\n\t\t\tchangeHashTo(formatSearch(search_term, id, classFilter));\n\t\t\tpage = id;\n\t\t\t$(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\n\t\t});\n\n\t}", "title": "" }, { "docid": "c75548dd1126c5ec7adf1dfafbbdfc62", "score": "0.6505967", "text": "onSearchClick() {\n let options = { skip: 0, top: 5 };\n this._doSearch(options);\n }", "title": "" }, { "docid": "9efa428728910d3baac08534c04da87a", "score": "0.6503479", "text": "function search(e) {\n if (e.keyCode == 13) {\n var val = document.getElementById(\"search-field\").value;\n window.open(searchUrl + val);\n }\n}", "title": "" }, { "docid": "24df4f322f089050fdcc82e32be5bce4", "score": "0.65007466", "text": "function searchFor(searchTerm) {\n document.getElementById(\"demoframe\").src = document.getElementById(\"searchUrl\").value +\n encodeURIComponent(searchTerm);\n document.demo.searchTerm.value = searchTerm;\n return false;\n}", "title": "" }, { "docid": "7b4a1002fcd8d48454830626fef19c9c", "score": "0.64957094", "text": "function displaySearchResults() {\r\nelement(\"search-results\").style.display = \"block\";\r\n}", "title": "" }, { "docid": "9b81050afa235bdf81a4905af1586fad", "score": "0.6493535", "text": "function search() {\n const frame = document.getElementById('searchFrame').contentDocument;\n const allFields = frame.getElementById('lkenhmdSEARCH_ALL');\n const theForm = frame.getElementById('theForm');\n allFields.checked = true;theForm.submit();\n const resFrame = document.getElementById('resultsFrame');\n resFrame.onload = function() {\n const resDoc = resFrame.contentDocument;\n const rows = resDoc.querySelector('.list').rows;\n if (rows.length === 2) {\n rows[1].cells[0].firstElementChild.click();\n window.close();\n }\n };\n }", "title": "" }, { "docid": "e6154884936ca76b79f4640d081ac722", "score": "0.64894664", "text": "function searchKeyPressed(e, search_val){\n\tif(search_val != \"\"){\n\t\tdocument.title = 'FREE NOMS! - Find \"' + search_val + '\"';\n\t} else {\n\t\tdocument.title = 'FREE NOMS! - Find';\n\t}\n\n\tupdateSearchURL(search_val);\n\tfilterReports(search_val);\n}", "title": "" }, { "docid": "6149f1704f86a497405e1ce197511893", "score": "0.6482969", "text": "function showSearchExpression() {\n var searchStr = constructSearchStr();\n $(\"#searchExpression\").html(searchStr);\n }", "title": "" }, { "docid": "3ac22aaff971eeaed417e91befbceea9", "score": "0.64809054", "text": "function searchbar() {\n var x = document.getElementById(\"searching\");\n \n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n } else {\n x.style.display = \"none\";\n \n } \n}", "title": "" }, { "docid": "8b6e1d571fd5571b2f4dfd13d3b57cb2", "score": "0.64791644", "text": "function showWindowFind(fields, table, where, titles, trg, titwin) {\n var x = (screen.Width - 200) / 2;\n var props = 'scrollbars=no,resizable=no,toolbar=no,menubar=no,status=yes,location=no,directories=no,width=200,height=100,top=200,left=' + x;\n var url = Rutac + '/Build/Search';\n var param = '', output = '', field = '', macro = '', newWhere = '', i = 0;\n if (newWindowFind != null) {\n newWindowFind.close();\n newWindowFind = null;\n }\n\n if (Trim(table) != '') {\n while (table.indexOf('&') != -1) {\n field = table.substring(table.indexOf('&') + 1);\n field = field.substring(0, field.indexOf('&'));\n table = table.replace('&' + field + '&', getValue(field));\n }\n }\n\n if (Trim(where) != '') {\n while (where.indexOf('&') != -1) {\n field = where.substring(where.indexOf('&') + 1);\n field = field.substring(0, field.indexOf('&'));\n where = where.replace('&' + field + '&', getValue(field));\n }\n }\n\n trgCurrent = trg;\n if (fields != '')\n param = '?fields=' + fields;\n if (table != '')\n param += '&table=' + table;\n if (where != '')\n param += '&where=' + where;\n if (titles != '')\n param += '&titles=' + titles;\n if (titwin != '')\n param += '&titwin=' + titwin;\n url += param;\n output += '<html>';\n output += '<head>';\n output += '<title>Generando Datos...</title>';\n output += '<link rel=\"stylesheet\" href=\"' + Rutav + '/vista/css/estilos.css\">';\n output += '<script language=\"JavaScript\" type=\"text/JavaScript\" src=\"' + Rutav + '/vista/script/Funciones.js\">';\n output += '</script>';\n output += '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">';\n output += '</head>';\n output += '<body rightmargin=\"0\" leftMargin=\"0\" topMargin=\"0\" marginheight=\"0\" marginwidth=\"0\" onLoad=\"reDirect(\\'' + url + '\\')\">';\n output += '<table width=\"220\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">';\n output += ' <tr valign=\"middle\" height=\"100\">';\n output += ' <td class=\"caption\" align=\"center\">Cargando, espere por favor...</td>';\n output += ' </tr>';\n output += '</table>';\n output += '</body>';\n output += '</html>';\n newWindowFind = window.open('', 'newWindowFind', props);\n newWindowFind.document.open();\n newWindowFind.document.write(output);\n newWindowFind.document.close();\n newWindowFind.focus();\n}", "title": "" }, { "docid": "4450570c1313d8e6926ea1773b107f85", "score": "0.64771575", "text": "function openSearchClientModal() {\n\tModalbox.show(contextPath+\"/GIISAssuredController?action=openSearchClientModal&ajaxModal=1\", \n\t\t\t\t {title: \"Search Assured Name\", \n\t\t\t\t width: 800});\t\n}", "title": "" }, { "docid": "cac981ebde63b8ccfe3818cd5921aa89", "score": "0.64731747", "text": "function SearchAssistant() { }", "title": "" }, { "docid": "f853067f96390aafb3e1b309cf4f0bb1", "score": "0.6462742", "text": "function openSearch() {\n setIsSearch(!isSearch)\n }", "title": "" }, { "docid": "3083988ab1a370ced6d3d6229c1c26c3", "score": "0.6461385", "text": "function showSearchForm() {\n $template.find('.panel-body').show();\n $template.find('.panel-footer').hide();\n }", "title": "" }, { "docid": "bb86e9218cebfc836922d6791f8d7c79", "score": "0.64595634", "text": "function doSearch() {\r\n\tif (guiseinput.value != \"\" && guiseinput.value == searchString) { resulttable.style.display = \"\"; return; }\r\n\tsearchString = guiseinput.value;\r\n\tif (searchString.length < 3) { alert('Error:\\nSearch string has an insufficient number of characters.'); return; }\r\n\tsearchinput.value = \"wait....\";\r\n\tsearchinput.onclick = null;\r\n\tfetchData(\"chardesc\",searchString);\r\n}", "title": "" }, { "docid": "9f84dcfb87cd591fff4069ddb07c825f", "score": "0.64589673", "text": "function toggleSearchBox() {\n if (isSearchBoxShow()) {\n hiddenSearchBox()\n } else {\n showSearchBox()\n }\n }", "title": "" }, { "docid": "3abf64cd890956e427eb0791d22252e2", "score": "0.6452904", "text": "function showSearchPopup() {\n if (firstShow) {\n searcher.set('showSearch', false);\n firstShow = false;\n // open modal dialog\n $('.globalSearchModal').attr('popup-hidden', 'false').modal('show');\n } else if ($('.globalSearchModal').attr('popup-hidden') != 'true') {//user doesn't hide it after first time it showed\n $('.globalSearchModal').modal('show');\n }\n }", "title": "" }, { "docid": "d0ffa4081ffef10de8acada3b56ef77b", "score": "0.64367783", "text": "function showAdvancedSearchModal() {\n //clear any previous entry\n $(\"#input-player-name\").val(\"\");\n\n\n document.querySelector(\".player-advanced-search-border\").style.display = \"flex\";\n\n setupMatchAutoCompleteAdvancedSearch();\n setupMatchErrorCheckingAdvancedSearch();\n}", "title": "" }, { "docid": "b6d505b40385c78bebd35e13c5b48075", "score": "0.6429387", "text": "function ACXSearch(){\n\t\tvar action = \"search\";\n\t\tvar actiontemp = getActionTemp(action)\n\t\tvar dbname = getDBName(action)\n\t\tsetCookie(\"PagingMove\" + MainWindow.dbname + MainWindow.formgroup ,\"first_record\",1)\n\t\tgetStructureFields()\n\t\tgetFormulaFields()\n\t\tgetMolWeightFields()\n\t\tgetRelationalFields()\n\t\tmissingfields = getSearchStrategy()\n\t\tif (needToAuthenticate){\n\t\t\tMainWindow.document.cows_input_form.action = \"../postrelay.asp?dataaction=search&formmode=list\" + \"&formgroup=\" + formgroup + \"&dbname=\" + dbname \n\t\t}\n\t\telse{\n\t\t\tMainWindow.document.cows_input_form.action = actiontemp + \"?formmode=\" + formmode + \"&formgroup=\" + formgroup + \"&dataaction=\" + action + \"&dbname=\" + dbname\n\t\t}\n\t\tMainWindow.document.cows_input_form.submit();\t\n}", "title": "" }, { "docid": "88e29cd7b2c3af0930272024702cdbb7", "score": "0.64264596", "text": "displaySearch(url) {\n\t\taxios\n\t\t\t.get(url)\n\t\t\t.then((resp) => {\n\t\t\t\tconsole.log(\n\t\t\t\t\tboxen(chalk.green.bold('** Search results: **'), {\n\t\t\t\t\t\tborderColor : 'green'\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\tlet searchResults = resp.data.items;\n\t\t\t\tthis.displaySearchList(searchResults);\n\t\t\t\tthis.addToReadingList(searchResults);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.log(\n\t\t\t\t\tboxen(chalk.red.bold(' *** ERROR *** '), {\n\t\t\t\t\t\tborderColor : 'red'\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t\tconsole.log(\n\t\t\t\t\tboxen(\n\t\t\t\t\t\tchalk.red.bold(\n\t\t\t\t\t\t\t' Something went wrong! Be sure you enter a valid search term, and that you have a valid API key. '\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tborderColor : 'red'\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tthis.menuDisplay();\n\t\t\t});\n\t}", "title": "" }, { "docid": "241d9a4bb59fb8a4a7a2ce63b0350492", "score": "0.6426229", "text": "search() {\n\n }", "title": "" }, { "docid": "c482783c90878772b4cd4fbbb39cf2f0", "score": "0.64136446", "text": "async clickSearch () {\n await (await this.searchBar).click();\n \n }", "title": "" }, { "docid": "299f7a029d189114eac3c2338039fb56", "score": "0.6401794", "text": "function nearbySearch() {\n\t\tsearchType = 'nearby';\n\t\tclearOverlays();\n\t\tvar keyword = document.getElementById('keyword').value;\n\t\tif (keyword == '') {\n\t\t\tkeyword = 'food';\t\n\t\t}\n\t\tvar request = {\n\t\t\tlocation: pos,\n\t\t\tkeyword: keyword,\t\t\t\n\t\t\tradius: '1000',\n\t\t\ttypes: ['food']\n\t\t};\t\t\n\t\tinfowindow = new google.maps.InfoWindow();\n\t\tservice = new google.maps.places.PlacesService(map);\n\t\tservice.nearbySearch(request, callback);\n\t}", "title": "" }, { "docid": "7b7e9d22ab7557e73a32deb980a45f89", "score": "0.6395687", "text": "function Search_Photos() {\n\tvar search_key = document.getElementById(\"photos-search-input\").value;\n\tShow_Photos(search_key);\n}", "title": "" }, { "docid": "8eff08582e4f40c26483be56dc782dd8", "score": "0.6393909", "text": "function mostrar_buscador() {\n bars_search.style.top = \"80px\";\n cover_ctn_search.style.display = \"block\";\n inputSearch.focus();\n\n if (inputSearch.value === \"\") {\n box_search.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "02319a728c5e772b97e277e37be48a25", "score": "0.6385694", "text": "function ActionSearchInvoice() {\n \n\n $(\"#xSalesList\").hide();\n $(\"#xSalesForm\").hide();\n $('#xLSalesInvoiceSearch').show();\n\n $('#txt_sales_search').val('');\n RefNoAutoComplete();\n}", "title": "" }, { "docid": "fea73d3011c1584a7e36da19a242f6d8", "score": "0.63802296", "text": "function ld_show_search_result_in_dialog($type, $data) {\n // check the modal dialog is showing or not\n if ($ld_in_searching == false) {\n console.warn(\"search modal is hidden when get search result.\")\n return;\n }\n // check the search sequence is matched or not\n if ($ld_in_searching_req != $ld_in_searching_seq) {\n console.warn(\"search modal is not in same seq.\")\n return;\n }\n if ($type == 0) {\n ld_set_search_result($data);\n return;\n }\n if ($data.length == 0) {\n ld_set_search_result('No records.');\n return;\n }\n ld_set_search_result_records($data);\n}", "title": "" }, { "docid": "ad80008a494087520a7ac50bfc8182b5", "score": "0.6378619", "text": "function search() {\n\t\t// clear the current contacts list\n\t\twhile (parent.lastChild)\n\t\t\tparent.removeChild(parent.lastChild);\n\t\t\n\t\tvar search = document.getElementById(\"searchField\").value;\n\t\trequest.open(\"POST\", \"http://students.engr.scu.edu/~adiaztos/resources/contacts.php?query=\" + search, true);\n\t\trequest.send();\n\t}", "title": "" }, { "docid": "926313c6283d03c01f278fb9a7a6185a", "score": "0.6375743", "text": "function onSearch() {\n\n \n var nameFindVal = document.forms[0].findVal.value;\n var nameFindIn = document.forms[0].findIn.value;\n \n //Show error message to the user if he has select only findVal and not find In.\n if(nameFindVal !=\"\" && nameFindIn == \"\"){\n showBarMessage('Please specific find value.', ERROR_MSG);\n return false;\n }\n \n //Show error message to the user if he has select only findVal and not find In.\n if(nameFindVal ==\"\" && nameFindIn != \"\"){\n showBarMessage('Please specific find in.', ERROR_MSG);\n return false;\n }\n \n //Clear the Data Table\n// clearDiv('search_result');\n \n \n //set the action\n document.forms[0].currPageNo.value = 1;\n document.forms[0].action = BROWSE_FSC_LOOKUP;\n \n document.forms[0].submit();\n return false;\n}", "title": "" }, { "docid": "ad7b14629780ebc8040e6c93143645fa", "score": "0.63491446", "text": "function showSearchSuggestions() {\n $('#searchSuggestions').css('display', 'block');\n}", "title": "" }, { "docid": "ae3c9b3e1d6db153b22b1f2208439fb2", "score": "0.6344619", "text": "function googleSearch (){\n event.preventDefault();\n \n if (searchInput.val())\n {\n window.open(\"https://www.google.com/search?q=\" + searchInput.val());\n }\n}", "title": "" }, { "docid": "8aa5f49686444b01702fd04011ad0924", "score": "0.63417625", "text": "function googleSearchFn() {\n vscode.window\n .showInputBox({\n password: false,\n ignoreFocusOut: true,\n placeHolder: 'google what?',\n })\n .then(function (msg) {\n openGoogle(msg);\n });\n}", "title": "" }, { "docid": "d802289d3d9975e4285dad2ebc567017", "score": "0.6339489", "text": "function triggerSearch() {\r\n searchButton();\r\n}", "title": "" }, { "docid": "d2e2f0501a7fcdb67ce206db150d055a", "score": "0.6332165", "text": "function showSearch() {\n const s = document.getElementById(\"show-search\");\n\n if (s.style.display == \"none\") {\n s.style.display = \"block\";\n s.style.paddingBottom = \"0.5rem\";\n } else {\n s.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "5aa2f21d681d9cb8bcbe7e8d7e419b9b", "score": "0.6331788", "text": "function search() {\n searchInputTable(\"input-management\",\"table-management\")\n}", "title": "" }, { "docid": "34a961fb60be7e603440740b608a4e6b", "score": "0.6323016", "text": "function searchResult()\n{\n $(\".gif-container\").css(\"visibility\", \"visible\");\n $(\".search-results\").empty();\n query = $(\"#query\").val();\n $.ajax({\n\t\turl:'/searchResult',\n\t\ttype:'GET',\n\n\t\tdata:{query: query},\n\t\tsuccess:function(data, status, xhr) {\n\t\t\tdata = JSON.parse(data);\n\t\t\tlist = data;\n\t\t\t$(\".gif-container\").css(\"visibility\", \"hidden\");\n\t\t\tif(list.length > 0)\n\t\t\t showList();\n\t\t\telse\n\t\t\t showNotFoundMessage(query);\n\t\t},\n\t\terror:function(xhr, status, error) {\n\t\t\t\t$(\".gif-container\").css(\"visibility\", \"hidden\");\n\t\t\t\tconsole.error(xhr, status, error);\n\t\t}\n\t});\n $(\"#show_summary\").attr(\"src\", '../static/js/showSummary.js');\n}", "title": "" }, { "docid": "b5df46205ab7d07303ad8c7cf4ff3c05", "score": "0.631839", "text": "function openFindDialog(dialog, event) {\n openDialog(dialog, event);\n var find = $('searchfind');\n find.focus();\n find.select();\n return false;\n}", "title": "" }, { "docid": "a8dc56b3f8597183f46ddab45da65780", "score": "0.63123626", "text": "function showbetterSearch(routeObj) {\n//\tdump('----> showing better Search');\n\toptStrs = routeObj.optionList;\n\trouteObj.params.options = routeObj.params.options || {};\n\tfor(var i in optStrs){\n//\t\tdump('----> optStrs[i]'); dump(optStrs[i]);\n\t\tvar o = optStrs[i];\n\t\tif(_app.ext.store_filter.vars.elasticFields[o]){\n\t\t\trouteObj.params.options[o] = $.extend(true, {}, _app.ext.store_filter.vars.elasticFields[o]);\n//\t\t\tdump('routeObj.params.options[o]'); dump(routeObj.params.options[o]); \n\t\t\tif(routeObj.searchParams && routeObj.searchParams[o]){\n\t\t\t\tvar values = routeObj.searchParams[o].split('|');\n\t\t\t\tfor(var i in routeObj.params.options[o].options){\n\t\t\t\t\tvar option = routeObj.params.options[o].options[i];\n\t\t\t\t\tif($.inArray(option.v, values) >= 0){\n\t\t\t\t\t\toption.checked = \"checked\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tdump(\"Unrecognized option \"+o+\" on filter page \"+routeObj.params.id);\n\t\t}\n\t}\n\t_app.ext.quickstart.a.showContent(routeObj.value,{\n\t\t\"pageType\" : \"static\",\n\t\t\"require\" : ['templates.html','store_search','store_filter','store_routing','prodlist_infinite','store_cc'],\n\t\t\"templateID\" : \"betterSearchTemplate\",\n\t//\t\"dataset\" : $.extend(routeObj.params, {\"baseFilter\" : {\"query\" : {\"query_string\" : {\"query\" : routeObj.params.KEYWORDS}}},'options':routeObj.params.options})\n\t\t\"dataset\" : routeObj.params\n\t});\n}", "title": "" }, { "docid": "638628df27de6e80956fe527531ecdcf", "score": "0.63112736", "text": "function search() {\r\n\t//Get search input\r\n\tvar searchInput = $.trim($(\"#search-mini\").val());\r\n\r\n\t//Detach the word list and clear\r\n\tvar lsWords = $('#lsWords').detach();\r\n\t$(lsWords).html('');\r\n\r\n\t//Clear more results list\r\n\tMoreResults = null;\r\n\r\n\t//If search isn't blank\r\n\tif (searchInput != \"\") {\r\n\t\t//Search according to search type (selected English or language button)\r\n\t\tvar english = $('#langEnglish').hasClass('ui-btn-active');\r\n\t\tif (english) {\r\n\t\t\tSearchResults = englishSearch(searchInput);\r\n\t\t} else {\r\n\t\t\tSearchResults = languageSearch(searchInput);\r\n\t\t}\r\n\r\n\t\t//Set the search input on the results (for future highlighting)\r\n\t\tSearchResults.searchInput = searchInput;\r\n\r\n\t\t//Set the indexes for each word search results\r\n\t\t$(SearchResults).each(function (i) {\r\n\t\t\tthis.originalIndex = this.index;\r\n\t\t\tthis.index = i;\r\n\t\t});\r\n\r\n\t\t//Display the search results\r\n\t\tdisplaySearchResults(SearchResults, lsWords);\r\n\t}\r\n\r\n\t//Add html list back to page\r\n\t$('#divSearchContent').append(lsWords);\r\n\r\n\t//Refresh the search result list\r\n\t$(lsWords).listview(\"refresh\");\r\n}", "title": "" }, { "docid": "e1c60d4d4b913638648ef50dcdb82518", "score": "0.6310349", "text": "function showSearch(){\n\tvar checkSearch = 0;\n\tvar input = change_alias(readlineSync.question('Enter the information you want to search! '));\n\tfor(var i of phonedata){\n\t\tfor(var j in i){\n\t\t\tif(change_alias(i[j]).toLowerCase() === input.toLowerCase())\n\t\t\t{\n\t\t\t\tconsole.log(i.name, i.phone);\n\t\t\t\tcheckSearch = 1;\n\t\t\t}\n\t\t}\n\t}\n\tif(checkSearch === 0) console.log('Not Found!');\n\t}", "title": "" }, { "docid": "77feb58b7acf93cf983d1139f2cb0ec1", "score": "0.630574", "text": "function basic_search()\n{\n\n //advanced search is what actually does the seraching\n\tadvanced_search(1);\n}", "title": "" }, { "docid": "fbe39c0122780d01f97bc892294a634f", "score": "0.6302747", "text": "function searchFor(query) {\r\n inputBox.value = query;\r\n search(query);\r\n}", "title": "" }, { "docid": "d23aef72179ea0d2d672384b43496904", "score": "0.62977225", "text": "function search(){\n\t\tswal({\n\t\t\ttitle: \"Hello!\",\n\t\t\ttext: \"What would you like to search for?\",\n\t\t\ttype: \"input\",\n\t\t\tshowCancelButton: true,\n\t\t\tcloseOnConfirm: false,\n\t\t\tanimation: \"slide-from-top\",\n\t\t\tinputPlaceholder: \"Write something\"\n\t\t},\n\t\tfunction(inputValue){\n\n\t\t\tif (inputValue === false){\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (inputValue === \"\") {\n\t\t\t\tswal.showInputError(\"You need to write something!\");\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t// Geocode our address\n\t\t\tgeocoder.geocode({ \"address\": inputValue }, function(results, status) {\n\n\t\t\t // Check for a successful result\n\t\t\t if (status == google.maps.GeocoderStatus.OK) {\n\n\t\t\t\t // Recenter the map over the address\n\t\t\t\t map.setCenter(results[0].geometry.location);\n\t\t\t\t console.log(results, status)\n\t\t\t\t} else {\n\n\t\t\t\t // Show an error message with the status if our request fails\n\t\t\t\t alert(\"Geocoding was not successful - STATUS: \" + status);\n\t\t\t\t}\n\n\t\t\t\t// Add the marker to our existing map\n\t\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\t\tposition: (results[0].geometry.location),\n\t\t\t\t\tmap: map\n\t\t\t\t});\n\t\t\t\tvar infowindow = new google.maps.InfoWindow({\n\t\t\t\t content: \"Changing the world, one programmer at a time.\"\n\t\t\t\t});\n\t\t\t\t infowindow.open(map, marker);\n\n\n\t\t\t\tswal(\"Nice!\", \"Searching for \" + inputValue, \"success\");\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "46892e0b7a142f12776cfd1d68367cdb", "score": "0.62924886", "text": "showSearch() {\n this.showingAffiliateProfile = false;\n\n Vue.nextTick(function () {\n $('#kiosk-affiliates-search').focus();\n });\n }", "title": "" }, { "docid": "038b99c77e483df424e2b8c2545cfe1c", "score": "0.6290704", "text": "function showSearchBar(){\n $('#container2').show();\n $('#container3').show();\n $('#title').text('Search #Tags');\n $('#title-p').text('Search and Select 6 Pics.');\n }", "title": "" }, { "docid": "3eb73df4ed1c433c7f366287afcb370a", "score": "0.62900364", "text": "function runSearch() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\n \"View Products for Sale\",\n \"View Low Inventory\",\n \"Add to Inventory\",\n \"Add new product\"\n ]\n })\n .then(function(answer) {\n switch (answer.action) {\n case \"View Products for Sale\":\n viewProducts();\n break;\n\n case \"View Low Inventory\":\n viewInventory();\n break;\n\n case \"Add to Inventory\":\n addInventory();\n break;\n\n case \"Add new product\":\n addProduct();\n break;\n }\n });\n}", "title": "" }, { "docid": "f0da0be70829585b99bf7f27963f7bea", "score": "0.62898326", "text": "function viewSearch(){\n\tif(profile == null){\n\t\tswitchView(\"profilesPage\");\n\t}else{\n\t\tlogin(profile.profilename);\n\t}\n}", "title": "" }, { "docid": "1115d2c8625c652526e10ce2708b8cf3", "score": "0.62886506", "text": "function searchFunction() {\n\tsetResultErrorString(\"\");\n\treplaceResultTableBody();\n\treplaceResultSummaryList();\n\ttry {\n\t\tconst searchString = document.getElementById(\"searchText\").value;\n\t\tif (searchString == \"\") throw \"Empty search string.\"\n\t\tconst mode = document.querySelector(\"input[name = 'mode']:checked\").value;\n\t\tconst data = JSON.stringify({\"searchString\": searchString, \"mode\": mode});\n\t const xmlhttp = new XMLHttpRequest();\n\t xmlhttp.onreadystatechange = queryStatusChange;\n\t xmlhttp.open(\"POST\", \"http://localhost:8765/api/index.php\", true);\n\t xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\t xmlhttp.send(\"q=\" + data);\n\t}\n\tcatch(err) {\n\t\tsetResultErrorString(\"Error searching. \" + err);\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.6287394", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.6287394", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.6287394", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.6287394", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.6287394", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "a026b8803659893479bb42f7b29bdf2a", "score": "0.6278121", "text": "function showsearch(){\r\n\t$('.search-container').toggleClass('searchShown');\r\n}", "title": "" }, { "docid": "319120d0db78727f6d7157a1cfd7cdce", "score": "0.62753576", "text": "async function searchForShowAndDisplay() {\n const term = $(\"#searchForm-term\").val();\n const shows = await getShowsByTerm(term);\n populateShows(shows);\n}", "title": "" }, { "docid": "aa21189f23bafb0bff644f710955a8bf", "score": "0.6275058", "text": "function search() {\n // To be implemented.\n // Continue to run\n }", "title": "" }, { "docid": "1efef828140d7dd2f2446e66e6b83c29", "score": "0.6273259", "text": "function searchClicked()\n{\t\n\tvar query;\n\tquery= $(\"#query\").val();\n\t\n\tif(query.length>0)\n\t{\n\t\tvar apiLink =\"https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=info|extracts&exintro&explaintext&exsentences=1&exlimit=max&gsrsearch=\";\n\t\tapiLink = apiLink + query + \"&callback=?\";\n\t\t\n\t\t$.getJSON(apiLink,function(json)\n\t\t\t{\n\t\t\t\t// shift the search bar up from the middle position\n\t\t\t\t$(\"#title-area\").removeClass(\"initial-state\");\n\t\t\t\t$(\"#title-area\").addClass(\"result-state\");\n\t\t\t\t\n\t\t\t\tvar pages= json.query.pages;\n\t\t\t\t\n\t\t\t\tvar title, pageId, information,html=\"\", pageLink=\"https://en.wikipedia.org/?curid=\", wikiLink;\n\t\t\n\t\t\t\t$.each(pages,function(key,value)\n\t\t\t\t\t{\n\t\t\t\t\t\twikiLink=\"\"\n\t\t\t\t\t\t\n\t\t\t\t\t\t//get all the variables needed\n\t\t\t\t\t\ttitle= value.title;\n\t\t\t\t\t\tpageId= value.pageid;\n\t\t\t\t\t\tinformation= value.extract;\n\t\t\t\t\t\twikiLink = pageLink + pageId;\n\t\t\t\t\t\t\n\t\t\t\t\t\thtml+= '<a href='+wikiLink+' target=\"_blank\"><div class=\"row results text-left\"> <h3>' + title + '</h3> <p class=\"text-justify\">'+information+'</p> </div> </a>';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//window.alert(wikiLink);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t// insert all combined html elements to page\n\t\t\t\t$(\"#result-area\").html(html);\n\t\t\t}\n\t\t);\n\t}\n\t\n\telse\n\t{\n\t\t$(\"#query\").attr(\"placeholder\",\"FILL THIS FIELD\");\n\t}\n}", "title": "" }, { "docid": "13c7dca03042195d1ea24b65ec1caf19", "score": "0.6273035", "text": "function autoSearch() {\n search(getSearchModel());\n}", "title": "" }, { "docid": "727cd44159387aec563930f3edd0db3f", "score": "0.6267935", "text": "function CustomSearchService() {\n var ListBoxCustomSearchValue = HomeScreen.ListBoxCustomSearch.selectedKey;\n if (ListBoxCustomSearchValue === \"none\") {\n searchProduct = searchWord;\n } else {\n searchProduct = searchWord + \" & \" + ListBoxCustomSearchValue;\n }\n ProductListScreen.LblResult.text = \"Results for: \" + searchWord;\n SearchCancelButton();\n customSearchOperations();\n ProductListScreen.show();\n}", "title": "" }, { "docid": "02d247c1185f6afda7f668a40a529f36", "score": "0.6264688", "text": "async clickSearch() {\n return (await this[privateGetMenu]()).clickSearch();\n }", "title": "" }, { "docid": "c8576d8d0a9a8f3ec04d57bf1f8a0b06", "score": "0.62629277", "text": "function displayGNSearch() {\n var url = 'http://www.life.gov.lk/LIFe/navigate/';\n displayPopup(url);\n}", "title": "" } ]
67cdd6f7b55611ba7044cceba5cf8761
Given a window button (close, maximize, minimize) this function, finds the related window and closes it.
[ { "docid": "c617e25c013ecae4594f7e81dd01efd6", "score": "0.7113021", "text": "function closeWindow(closeBtn){\n\tvar winDiv = $(closeBtn).parent().closest('[data-role], .dialog');\n\tmetroDialog.close(winDiv);\n}", "title": "" } ]
[ { "docid": "03d920168936f7cf3bb431a886c62dea", "score": "0.73202914", "text": "function _closeWindow(){}", "title": "" }, { "docid": "69fe94aeb135c8843cccb74737d32f06", "score": "0.7003663", "text": "function closeWindow() {\r\n remote.getCurrentWindow().close()\r\n }", "title": "" }, { "docid": "c9021c16d4136f1b1ded5428b48fb1fc", "score": "0.69137853", "text": "function closeWindow() {\n\t\twin.close();\n\t}", "title": "" }, { "docid": "c9021c16d4136f1b1ded5428b48fb1fc", "score": "0.69137853", "text": "function closeWindow() {\n\t\twin.close();\n\t}", "title": "" }, { "docid": "c9021c16d4136f1b1ded5428b48fb1fc", "score": "0.69137853", "text": "function closeWindow() {\n\t\twin.close();\n\t}", "title": "" }, { "docid": "783fc9417ca869bb1a0fd452326a96fa", "score": "0.674279", "text": "function closeWindow() {\n temp_window.close();\n }", "title": "" }, { "docid": "5a6c499248bf9ccfb0d8f5e8f0326c77", "score": "0.6716744", "text": "function closeWindow() {\n temp_window.close();\n }", "title": "" }, { "docid": "20d0edce477731d26e46085adbcd5817", "score": "0.6665259", "text": "function closeWindow() {\n\t\tTi.App.fireEvent('ModuleHiding');\n\t\twin.close();\n\t}", "title": "" }, { "docid": "65e8d7a5bfb94654c8e19f7d0f04571f", "score": "0.6657418", "text": "close(params, callback = Function.prototype) {\n logger_1.default.system.debug(\"StackedWindowManager.close\", params);\n // if operating on StackedWindow then operation should apply to the visible window\n if (params.removeFromWorkspace || this.operatingDirectlyOnStackedWindow(params)) {\n this.closeStackedWindow(params, callback);\n }\n else {\n this.deleteWindow(params, callback);\n }\n }", "title": "" }, { "docid": "f6b4e610d2e5117b7c5e1d217f7c1554", "score": "0.6594299", "text": "function close_window() {\n // close window\n var win = remote.getCurrentWindow();\n win.close();\n}", "title": "" }, { "docid": "23fad1f471cbaab001ab143cee43ca5c", "score": "0.6581658", "text": "function closeWindow() {\n window.close();\n}", "title": "" }, { "docid": "23fad1f471cbaab001ab143cee43ca5c", "score": "0.6581658", "text": "function closeWindow() {\n window.close();\n}", "title": "" }, { "docid": "a983b820a46827f5f58703a56781336f", "score": "0.6581048", "text": "function closeWin(win) {\r\n win.close();\r\n}", "title": "" }, { "docid": "b67f63802f15a5dbbb11146aa1fffabd", "score": "0.6562218", "text": "function CloseWindows()\n{\n\tif (typeof(helpDialog) != \"undefined\" && helpDialog && !helpDialog.closed)\n\t\thelpDialog.close();\n\tif (opener != null)\n\t\tself.close();\n}", "title": "" }, { "docid": "b5d7f93247838f38eb79978764385adb", "score": "0.65453523", "text": "function closeWindow(windowID) {\n\t$(windowID).focusout(function () {\n\t\t$(this).css(\"display\",\"none\");\n\t})\n}", "title": "" }, { "docid": "1d2e43767c96299e42e52bbd9fee0d1d", "score": "0.6518347", "text": "function closeWindows(){\n\t\n\t\n\tdetails.close();\n\tsale.close();\n\tprovider.close();\n\tptype.close();\n\tobj.close();\n\tbusiness.close();\n\tbasket.close();\n\tregister.close();\n\tlogin.close();\n\torder.close();\n\tcamera.close();\n\tphotolist.close();\n\tpmenu.close();\n\tmap.close();\n\tcal.close();\n\tnewcal.close();\n\topeneventcal.close();\n\n\t\n\tcrow.close();\n\tcobj.close();\n\tcord.close();\n\tcpkg.close();\n\t\n}", "title": "" }, { "docid": "4452e823fbc98916e8b5afbfc7d141b4", "score": "0.64726233", "text": "function closewindow(){\n\t\tif(newwindow && !newwindow.closed){\n\t\t\tnewwindow.close();\n\t\t\t}\n\t}", "title": "" }, { "docid": "095c5f6625cc45d03606ae8fe8fef03d", "score": "0.64628935", "text": "function close() {\n window.close();\n }", "title": "" }, { "docid": "80c40c6ff6bea989f723de435ac345a7", "score": "0.64592654", "text": "function closeWindow(win, options = {}) {\n chrome.tabs.query({ windowId: win.id }, (tabs) => {\n const tabsToClose = []\n let passedCurrent = false\n\n for (const i in tabs) {\n const tab = tabs[i]\n\n if (tab.active) {\n passedCurrent = true\n continue\n }\n\n if (passedCurrent) { // right of current\n if (options.closeAllLeft) {\n break\n }\n\n if (options.closeAllRight) {\n tabsToClose.push(tab.id)\n }\n } else if (options.closeAllLeft) {\n tabsToClose.push(tab.id)\n }\n }\n\n if (tabsToClose.length) {\n chrome.tabs.remove(tabsToClose).then(() => { })\n }\n })\n}", "title": "" }, { "docid": "23df021f6fea475e82260e283a9c61d0", "score": "0.6441788", "text": "close () {\r\n this.onClose();\r\n window.close();\r\n }", "title": "" }, { "docid": "6b25c876e143b9ce3509faaf1a606838", "score": "0.63974756", "text": "function closeWindow(evt) {\n\tAlloy.Globals.closeWindow($.detailWindow);\n}", "title": "" }, { "docid": "31cda363996d6c6c408c528973ff9b7e", "score": "0.6354067", "text": "function closeLastOpenedInfoWindow() {\r\n if (windowControl) {\r\n windowControl.close();\r\n }\r\n}", "title": "" }, { "docid": "b9ea2494ed0bbdd7bf020503774e2159", "score": "0.63313425", "text": "function exitOpenWindows() {\r\n\tif (windowId) {\r\n\t\tif (!(windowId.closed)) {\r\n\t\t\twindowId.close();\r\n\t\t}\r\n\t}\r\n\tif (calendar) {\r\n\t\tif (!(calendar.closed)) {\r\n\t\t\tcalendar.close();\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "f03f2026d07920775d5520e92c133efd", "score": "0.6313768", "text": "function closeWindow() {\n\tif (OS_IOS) {\n\t\tvar tabWindow = Alloy.Globals.openWindows.pop();\n\t\ttabWindow[Object.keys(tabWindow)].close();\n\t\ttabWindow[Object.keys(tabWindow)] = null;\n\t\ttabWindow = null;\n\t}\n}", "title": "" }, { "docid": "0a77be49b431e7f97973456cf8413913", "score": "0.6261286", "text": "function eFapsCommonCloseWindow() {\n top.window.close();\n return;\n}", "title": "" }, { "docid": "392934db6b8f3c6c8a379555bcd75f0b", "score": "0.6237639", "text": "function cancel() { window.close(); }", "title": "" }, { "docid": "011bc8f23bf4fce6d336eae92ed6c460", "score": "0.6231289", "text": "function fnCloseWindow()\n{\nwindow.close();\n}", "title": "" }, { "docid": "5e9f443b72a3216fc1186cf9aa28afbd", "score": "0.6224025", "text": "function unminimizeWindow() {\n\t// event is not bound in FireFox\n\tif (typeof event === 'undefined') {\n\t\treturn; // needs to be fixed\n\t}\n\t\n\tvar $buttonElem = typeof event !== 'undefined' && $(event.srcElement).closest('button');\n\tvar $winData = $buttonElem.data('winData');\n\tvar $winDiv = $buttonElem.data('winDiv');\n\t\n\t\n\t\n\tresizeWindow2Normal($winDiv, $winData);\n\t\n\t$($buttonElem).remove();\n\t\n\t if($('#bottomCharm').find('button').length==0){\n\t\thideMetroCharm('#bottomCharm');\n\t} \n}", "title": "" }, { "docid": "58cbea0ead8afba4a42e90af71f6850d", "score": "0.6175423", "text": "close(params = {}, callback) {\n this.queryWindowService(\"close\", params, callback);\n }", "title": "" }, { "docid": "d3a69940cda7db41022567f06a592744", "score": "0.614858", "text": "static closeWindow() {\n browser.closeWindow();\n }", "title": "" }, { "docid": "8e6b741b99836320062a9cdbcd05b05f", "score": "0.6146809", "text": "_close(params, cb = Function.prototype) {\n logger_1.default.system.debug(\"WRAP CLOSE. BaseWindow._close\", this.name, params);\n params = params || {};\n const parentWindow = this.parentWindow;\n if (params.fromSystem) {\n // If the close is initiated from a system close (i.e. close from the taskbar or using the hotkey) and we're closing a stacked window, close the entire stacked window.\n // Except for when a native window is part of that stack and the system close is initiated on the native window, in which case we only close the native window instead of the whole stack.\n // fromSystem is only set by the openfinWindowWrapper in _systemClosed. It is not set by other kinds of windows.\n if (parentWindow && parentWindow.componentType.toLowerCase() === \"stackedwindow\") {\n params = {};\n params.removeFromWorkspace = true;\n params.fromSystem = true;\n params.stackedWindowIdentifier = parentWindow.identifier;\n parentWindow.close(params, function (err, result) {\n logger_1.default.system.debug(\"BaseWindow.close stacked window\", result);\n cb(err, { shouldContinue: false });\n });\n }\n else {\n cb(null, { shouldContinue: true });\n }\n }\n else if (!params.invokedByParent && !params.ignoreParent && parentWindow) {\n // if parent defined and not circular loop, invoke parent functionality. Parent result passed back to caller\n params.windowIdentifier = this.identifier; // add this window's identifier for parent invocation\n params.noDocking = true; // when removing from stacked window don't register child with docking\n parentWindow._removeWindow(params, function (err, result) {\n logger_1.default.system.debug(\"BaseWindow._close parent\", result);\n cb(err, { shouldContinue: true });\n });\n }\n else {\n cb(null, { shouldContinue: true });\n }\n }", "title": "" }, { "docid": "2e9483f922bfa310f64b786f445f2129", "score": "0.61365473", "text": "close() {\n this._qs(\"#close-popup\").addEventListener(\"click\", () => {\n this.exitDock();\n });\n }", "title": "" }, { "docid": "2e9483f922bfa310f64b786f445f2129", "score": "0.61365473", "text": "close() {\n this._qs(\"#close-popup\").addEventListener(\"click\", () => {\n this.exitDock();\n });\n }", "title": "" }, { "docid": "11eee607e117e64609b2b524e610d601", "score": "0.6122134", "text": "function closeAppLauncher()\n{\n var launcher = document.getElementById('applauncher');\n if (launcher)\n {\n if (launcher.classList.contains('opened'))\n {\n launcher.classList.remove('opened');\n var applButtons = document.getElementsByClassName('appl-button');\n if (applButtons)\n {\n for (var buttonIndex = 0; buttonIndex < applButtons.length; buttonIndex++)\n {\n if (applButtons[buttonIndex].classList.contains('opened'))\n {\n applButtons[buttonIndex].classList.remove('opened');\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "f0bb7d8f72073ecbc60cdb09b1b612cd", "score": "0.6089163", "text": "function closeAppLauncher()\r\n{\r\n var launcher = document.getElementById('applauncher');\r\n if (launcher)\r\n {\r\n if (launcher.classList.contains('opened'))\r\n {\r\n launcher.classList.remove('opened');\r\n var applButtons = document.getElementsByClassName('appl-button');\r\n if (applButtons)\r\n {\r\n for (var buttonIndex = 0; buttonIndex < applButtons.length; buttonIndex++)\r\n {\r\n if (applButtons[buttonIndex].classList.contains('opened'))\r\n {\r\n applButtons[buttonIndex].classList.remove('opened');\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "81a7d7ee78af0f9df0ffeb0109c5fe1c", "score": "0.6083488", "text": "restoreWindow() {\n this.window = this.window || requireNode('electron').remote.getCurrentWindow();\n\n if (this.window && !this.window.isVisible()) {\n this.window.show();\n }\n\n if (this.window && this.window.isMinimized()) {\n this.window.restore();\n }\n }", "title": "" }, { "docid": "ce90fd2d0bef21dcd623356e5b8651a5", "score": "0.60722125", "text": "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "title": "" }, { "docid": "1e225477265b7e1972c9a4c774bd9638", "score": "0.60707426", "text": "function fecharJanela() {\r\n\twindow.close();\r\n}", "title": "" }, { "docid": "9e237a5853aea408fd9e43d1b530540c", "score": "0.60554624", "text": "makeWindowButtons() {\n let obj = this;\n\n let minimize = document.createElement(\"button\");\n $(minimize).html('<i class=\"far fa-window-minimize\">');\n $(minimize).attr({\n \"class\": \"ect-titlebar_b\",\n \"id\": \"ect-minimize_window\"\n });\n $(minimize).css({\n \"background-color\": obj.params.windowButtonColor,\n });\n $(minimize).hover(function () {\n $(this).css({\n \"background-color\": obj.params.windowButtonHoverColor,\n });\n });\n $(minimize).mouseleave(function () {\n $(this).css({\n \"background-color\": obj.params.windowButtonColor,\n });\n });\n $(minimize).click(function () {\n obj.electronWindow.minimize();\n });\n\n\n let restore_maximize_window = document.createElement(\"button\");\n $(restore_maximize_window).html('<i class=\"far fa-window-restore\" id=\"ect-restore_icon\"></i><i class=\"far fa-window-maximize\" id=\"ect-maximize_icon\"></i>');\n $(restore_maximize_window).attr({\n \"class\": \"ect-titlebar_b\",\n \"id\": \"ect-restore_maximize_window\"\n });\n $(restore_maximize_window).css({\n \"background-color\": obj.params.windowButtonColor,\n });\n $(restore_maximize_window).hover(function () {\n $(this).css({\n \"background-color\": obj.params.windowButtonHoverColor,\n });\n });\n $(restore_maximize_window).mouseleave(function () {\n $(this).css({\n \"background-color\": obj.params.windowButtonColor,\n });\n });\n $(restore_maximize_window).click(function () {\n obj.toggleMaximizeRestoreDown();\n });\n\n\n let close = document.createElement(\"button\");\n $(close).html('<i class=\"fas fa-times\">');\n $(close).attr({\n \"class\": \"ect-titlebar_b\",\n \"id\": \"ect-close_window\"\n });\n $(close).css({\n \"background-color\": obj.params.windowButtonColor,\n });\n $(close).hover(function () {\n $(this).css({\n \"background-color\": obj.params.closeButtonHoverColor,\n });\n });\n $(close).mouseleave(function () {\n $(this).css({\n \"background-color\": obj.params.backgroundColor,\n });\n });\n $(close).click(function () {\n obj.electronWindow.close();\n });\n\n\n let zone3 = $(\"#ect-titlebar\").children(\".ect-titlebar_panel\").get(2);\n $(zone3).append([minimize, restore_maximize_window, close]);\n\n $(\".ect-titlebar_b\").css({\n \"display\": \"inline-block\",\n \"border\": \"none\",\n \"width\": \"45px\",\n \"height\": \"30px\",\n \"padding-left\": \"5px\",\n \"padding-right\": \"5px\",\n \"color\": \"#D3D3D3\",\n \"font-size\": \"16px\",\n \"background-color\": \"#484848\",\n \"outline\": \"none\",\n \"cursor\": \"pointer\",\n \"float\": \"left\"\n });\n }", "title": "" }, { "docid": "a249a756b2492910e5854ac712565627", "score": "0.60454005", "text": "static async close(){\n\t\tif(typeof browser !== 'undefined') {\n\t\t\tconst {id: windowId,} = (await apis.windows.getCurrent());\n\t\t\tapis.windows.remove(windowId);\n\t\t} else {\n\t\t\twindow.onbeforeunload = () => {};\n\t\t\twindow.close();\n\t\t}\n\t}", "title": "" }, { "docid": "09ebba6bcd874ddb206981b7f47c78f4", "score": "0.60428125", "text": "function closeWin(){\n var Browser = { \n Version: function() {\n var version = 999; // we assume a sane browser\n if (navigator.appVersion.indexOf(\"MSIE\") != -1)\n // bah, IE again, lets downgrade version number\n version = parseFloat(navigator.appVersion.split(\"MSIE\")[1]);\n return version;\n }\n }\n if (Browser.Version() < 7) {\n window.opener = null;\n window.close();\n }else if (Browser.Version() >= 7){\n window.open('','_parent','');\n window.close();\n }\n }", "title": "" }, { "docid": "b32a51fce3fa24998e4058986adbe8ac", "score": "0.6015395", "text": "function closeWindowFun(e) {\n\t$.EmergencyScreen.close();\n}", "title": "" }, { "docid": "849cc914e96c22a33fbb3458751682ad", "score": "0.60092396", "text": "function loginMinCloseBtns() { \n // if we close the login we close the app\n var close = document.getElementById(\"login-close-btn\");\n close.addEventListener('click', function() {\n const window = remote.getCurrentWindow();\n window.close();\n });\n \n document.getElementById(\"login-min-btn\").addEventListener(\"click\", function(e) {\n const window = remote.getCurrentWindow();\n window.minimize(); \n }); \n}", "title": "" }, { "docid": "ae525a5cf4343cff98dfd276606261e8", "score": "0.5985218", "text": "function removeWindow()\n{\n\tlet wnd = this;\n\n\tfor (let i = 0; i < wrappers.length; i++)\n\t\tif (wrappers[i].window == wnd)\n\t\t\twrappers.splice(i--, 1);\n}", "title": "" }, { "docid": "ddbf3978fd2914ebc65b9e91b22486f3", "score": "0.59827", "text": "function onClose() {\n setShow(false);\n window.opener = null;\n window.open(' ', '_self');\n window.close();\n }", "title": "" }, { "docid": "ff410c195b880b5d90b89d3d4a98a98e", "score": "0.59803647", "text": "function onWindowClose (leonaApp) {\n const { processSaveWinPosition, windowClear } = leonaApp;\n\n processSaveWinPosition(leonaApp);\n windowClear(leonaApp);\n}", "title": "" }, { "docid": "91385117b2c7e55bb0f7c326458e06c2", "score": "0.5972545", "text": "function windowClose(){\n\tconsole.log(\"rocket window close\");\n\t$.rocket.close();\n}", "title": "" }, { "docid": "97e73692a225ff6959949337d3f91c7c", "score": "0.5971205", "text": "function handleWindowClosed () {\n mainWindow = null;\n}", "title": "" }, { "docid": "0a8a2aa33222569405721304a023f5d2", "score": "0.595929", "text": "function cancel()\n{\n\twindow.close();\n}", "title": "" }, { "docid": "d6ffee2c2c0e1b1bfb80f435416e3156", "score": "0.5942811", "text": "close() {\n this.parentNode.removeChild(this);\n this.shadowRoot.querySelector('draggable-window').close();\n }", "title": "" }, { "docid": "dcbe315980e1001927f9887e8eb7b9dc", "score": "0.59301364", "text": "function closeWin() {\r\n var myWindow;\r\n let option=false;\r\n var retVal = confirm(\"Do you want to Close Program ?\");\r\n if( retVal == true ) {\r\n alert(''+retVal)\r\n // myWindow.close();\r\n top.close()\r\n // document.write (\"User wants to continue!\");\r\n return true;\r\n }\r\n else {\r\n // document.write (\"User does not want to continue!\");\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "341f308abbaabde8a0440662bc0c504b", "score": "0.5930119", "text": "function closeInfoWindow() {\n infoWindow.style.display = \"none\";\n selectedCharId = null;\n selectedChar = null;\n dehighlightSameRadicalWords();\n updateNodeLinkHighlighting();\n }", "title": "" }, { "docid": "9b4cd992d8dda525477fb19d74c13f7a", "score": "0.5925302", "text": "cancel() {\n // reset and close the window\n this.cancelInternal_();\n this.close_();\n }", "title": "" }, { "docid": "766a9cce88982e3e99dc9fab8635d51f", "score": "0.59105045", "text": "function exit() {\n\tvar gui = require('nw.gui');\n\tgui.Window.get().close();\n}", "title": "" }, { "docid": "3ec4fd01cfbad04e124e86c07e4fccd7", "score": "0.5906333", "text": "function closeWindows() {\n if (_windows) {\n for (i=0; i<_windows.length; i++) {\n _windows[i].close();\n }\n }\n }", "title": "" }, { "docid": "f8793b4c38f7db280a70c7b01e72898f", "score": "0.58923024", "text": "function setupWindows () {\n dragDrop.dragDrop()\n\n document.addEventListener('click', event => {\n let current = event.target.closest('.window')\n\n if (event.target.className === 'minimize') { current.querySelector('.windowContent').classList.toggle('windowMinimize') }\n if (event.target.className === 'close') { document.body.removeChild(current) }\n })\n }", "title": "" }, { "docid": "dc28edbf17377cad9c866af360d60aca", "score": "0.58893317", "text": "function SRC_closedWindowOpenerAlert()\n{\n var element;\n\n top.document.__disabled = \"true\";\n\n element = document.getElementById(\"editor-integration-disconnect\");\n if (element != null)\n {\n element.style.display = \"inline\";\n SRC_disableAddButtons();\n return\n }\n\n\tif (confirm(\"This Library Resource Search window can no longer access the HTML editor\\r\\n\\r\\n\"\n\t\t\t+ \" Close the search window?\"))\n {\n window.close();\n }\n}", "title": "" }, { "docid": "7f2037194e7693e0fa228aa8cd9da90c", "score": "0.5873216", "text": "close(confirmation) {\n if (this.isFullscreen) {\n this.exitFullscreen();\n }\n if (!this.isClosed()) {\n if (this.window) {\n if (confirmation) {\n if (confirm(confirmation)) {\n this.window.style.display = \"none\";\n this.closeCallback();\n }\n }\n else {\n this.window.style.display = \"none\";\n this.closeCallback();\n }\n }\n else {\n throw new Error(\"The window is not built.\");\n }\n }\n }", "title": "" }, { "docid": "805922ed56e8532866178a03f63252e3", "score": "0.58640325", "text": "function closeImg(){\r\n //close window\r\n document.querySelector(\".img-window\").remove();\r\n //close btns\r\n document.querySelector(\".img-btn-next\").remove();\r\n document.querySelector(\".img-btn-prev\").remove();\r\n}", "title": "" }, { "docid": "c9c95053163b8c86618d9f9409a07e1d", "score": "0.5860956", "text": "function ao_module_close(){\n if (!ao_module_virtualDesktop){\n window.close('','_parent','');\n window.location.href = ao_root + \"SystemAO/closeTabInsturction.html\";\n return;\n }\n parent.closeFwProcess(ao_module_windowID);\n}", "title": "" }, { "docid": "80650bd41fad266197d060d324f0204a", "score": "0.5854402", "text": "function search () {\n let exitButton = document.querySelectorAll('.exitButton')\n exitButton.forEach(element => {\n element.addEventListener('click', event => {\n deleteWindow(event.target)\n })\n })\n /* Delete Windows */\n function deleteWindow (selected) {\n if (selected.parentNode.parentNode.parentNode === null) {\n console.log('')\n } else {\n selected.parentNode.parentNode.parentNode.removeChild(selected.parentNode.parentNode)\n }\n }\n}", "title": "" }, { "docid": "c9f7e4161f7cbd19953e3707b2c3f2a5", "score": "0.5848888", "text": "function libCloseModalWindow(idModal){\n\t\n\t$(idModal).dialog('close');\n}", "title": "" }, { "docid": "96367fb40a02ec49f1531946eb1b506a", "score": "0.5841903", "text": "function closeInfoWindow() {\n infoWindow.style.display = \"none\";\n selectedCharId = null;\n selectedChar = null;\n dehighlightSameRadicalWords();\n updateNodeLinkHighlighting();\n}", "title": "" }, { "docid": "c5f30651341fbd529262783533afeb00", "score": "0.58362746", "text": "function closeMe(){\n clo=confirm(\"Are you sure you want to close this Webpage?\")\n if(clo==true){\n window.close();\n }\n else{\n\n } \n}", "title": "" }, { "docid": "83d7279d05f8cdb303540869f39b6df3", "score": "0.58130604", "text": "function WindowCloseButton(servletPath, widgetID) { // constructor\n GenericWidget.call(this, servletPath, widgetID);\t// call superconstructor\n if (!widgetID) { // required so other widgets can inherit from this\n \treturn;\n }\n var bt = this;\n $(\"#\" + widgetID).find(\"#ogemaButton\")[0].addEventListener('click', function () {\n bt.sendPOST();\n setTimeout(function() {\n \twindow.close();\n }, 1000); \n });\n this.sendGET();\n}", "title": "" }, { "docid": "15bc0ee75b42648bfef45db049550e13", "score": "0.58037406", "text": "toggleClose() {\n if (this.minimized) {\n this.open();\n return;\n }\n this.close();\n }", "title": "" }, { "docid": "2d35a9999b08a77f5929115f5ad4049d", "score": "0.580222", "text": "function closeWindow(){\n props.onHide()\n setExerciseSetList([]);\n setSetId([]);\n }", "title": "" }, { "docid": "281352410d08ddb0631188e892cc7895", "score": "0.57995534", "text": "function powerButtonClicked() {\n alert(\"Thank you for playing the game\");\n window.close();\n}", "title": "" }, { "docid": "5477ff21ca540a09ea4fbd47b04a2e5a", "score": "0.57909966", "text": "function win_close() {\n\n\twindow.opener.frmMain.submit();\n\tself.close();\n}", "title": "" }, { "docid": "f648e8bb75cb49c311efb2f2dfae25ec", "score": "0.57906127", "text": "static close() {\r\n\t var _a;\r\n\t (_a = top === null || top === void 0 ? void 0 : top.opener) === null || _a === void 0 ? void 0 : _a.postMessage({\r\n\t 'https://purl.org/pio/a/ServiceMessage': ['close']\r\n\t }, '*');\r\n\t window.close();\r\n\t }", "title": "" }, { "docid": "7ff0d55986584374f9bf77d5cfc6e94c", "score": "0.5776751", "text": "function closeWindows() {\n if (infoObj.length > 0) {\n infoObj[0].close();\n infoObj[0].length = 0;\n }\n}", "title": "" }, { "docid": "041655f82d67ab53e9547091e83ca7f3", "score": "0.57698834", "text": "function closeRegisterWindow(){\n\t\n\tinitialWindow.animate({opacity:0, duration:100}, function(){\n\t\tregisterWindow.close();\n\t\twindow.remove(initialWindow);\n\t\tleftTableView.fireEvent('click', {menuItem:MENU_PROFILE});\n\t});\n}", "title": "" }, { "docid": "29b8800848ce8461e824e116bff7b547", "score": "0.5767725", "text": "function close_window(w, fname)\n{\n\t//close pop-up\n\twindow.focus();\n\tif (typeof w != 'undefined')\n\t\tw.close();\n\t//save name of currently graded file\n\tphpFileToGrade.cur_sid = fname;\n\t//reset the query and result links in table to point to selected file\n\tupdate_links(cur_sid, fname);\n}", "title": "" }, { "docid": "5d922909226fe84b2929c0cd0592e4ed", "score": "0.57615924", "text": "function win_close(){\n\twindow.opener.frmMain.submit();\n\tself.close();\n}", "title": "" }, { "docid": "88a0f1b7b02f6552989392d89394528d", "score": "0.57541686", "text": "function finish()\n{\n window.close();\n}", "title": "" }, { "docid": "a9061a51ff4c04359e029207fe44d896", "score": "0.5749574", "text": "function windowClose() {\n info.style.display = 'none';\n done.style.display = 'none';\n gameLock = false;\n}", "title": "" }, { "docid": "37ab91562b5581fa7eab6826611311da", "score": "0.5742732", "text": "close() {\n if (this.preventExit()) return;\n\n this.hide();\n }", "title": "" }, { "docid": "c86d55f3fc56e9ce91c398f8a8e801df", "score": "0.5739635", "text": "function maximizeWindow(maxBtn){\n\tvar winDiv = getDialogFromBtn(maxBtn);\n\tvar winFrame = winDiv.find('iframe');\n\tvar winData = winDiv.data('winData');\n\t\n\tdocWidth = $(window).width();\n\tdocHeight = $(window).height();\n\t\n\tif(winDiv.position().left>0){\n\t\twinDiv.animate({\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\theight: \"100%\",\n\t\t\t\twidth: \"100%\",\n\t\t\t\topacity: 1,\n\t\t},300);\n\t\twinFrame.animate({\n\t\t\t\tposition: \"absolute\",\n\t\t\t\ttop: 0,\n\t\t\t\tleft: 0,\n\t\t\t\theight: docHeight-60,\n\t\t\t\twidth: docWidth-20,\n\t\t\t\topacity: 1,\n\t\t},300);\n\t}\n\telse{\n\t\tresizeWindow2Normal(winDiv, winData);\n\t}\n}", "title": "" }, { "docid": "b7e788e604e4bbe03ce2dab952876783", "score": "0.57380134", "text": "function closeCourseWindow(){\n\ttop.close();\t\t\t \n}", "title": "" }, { "docid": "0dc51427c4dcf03735b25e7d6d75ffeb", "score": "0.5737625", "text": "function setupWindowButtons()\n{\n\tdocument.getElementById(\"min-btn\").addEventListener(\"click\", function (e) {\n\t var window = remote.getCurrentWindow();\n\t window.minimize(); \n\t});\n\n\tdocument.getElementById(\"max-btn\").addEventListener(\"click\", function (e) {\n\t var window = remote.getCurrentWindow();\n\t window.maximize(); \n\t});\n\n\tdocument.getElementById(\"close-btn\").addEventListener(\"click\", function (e) {\n\t var window = remote.getCurrentWindow();\n\t window.close();\n\t}); \n}", "title": "" }, { "docid": "fbd7ed6bd1f50d3da996c5b83addd1e9", "score": "0.5732569", "text": "close() {\n if (this._windowRef) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close(this.animation).subscribe(() => {\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n });\n }\n }", "title": "" }, { "docid": "e767468c59bbb2001294410da170738b", "score": "0.5729439", "text": "function unminimizeWindowFromJS(minButton){\n\tif(typeof minButton === 'undefined') \n\t\treturn;\n\t\n\tvar $winData = $(minButton).data('winData');\n\tvar $winDiv = $(minButton).data('winDiv');\n\t\n\tresizeWindow2Normal($winDiv, $winData);\n\t\n\t$(minButton).remove();\n\t\n\t if($('#bottomCharm').find('button').length==0){\n\t\thideMetroCharm('#bottomCharm');\n\t} \n}", "title": "" }, { "docid": "c670beda25cb352a305fb5c293d6ecdb", "score": "0.5722499", "text": "function closeForm() {\n window.close();\n}", "title": "" }, { "docid": "f04ef41fbc6b963a57580458ee4899fe", "score": "0.5722402", "text": "onWindowHidden(event) {\n\t\tlet dockableWindow = this.getWindow(event.data.name);\n\t\t// need to set hide state in dockable window, but cannot call hide() or it will cause an infinite loop\n\t\tif (dockableWindow) {\n\t\t\tdockableWindow.setHidden();\n\t\t}\n\t}", "title": "" }, { "docid": "304af3db19e064db1ad7e86156a46931", "score": "0.5719532", "text": "function removeWindow(name) {\n name = name = sanitizeWindowName(name);\n \n if (!name) {\n return;\n }\n \n let data = WINDOWS[name];\n \n if (!data) {\n return;\n }\n \n data.instance = null;\n WINDOWS[name] = null;\n}", "title": "" }, { "docid": "753cc4788863a3893882d539a3ea2303", "score": "0.571638", "text": "_onWindowResize() {\n // close all popups\n if (qx.ui.popup && qx.ui.popup.Manager) {\n qx.ui.popup.Manager.getInstance().hideAll();\n }\n\n // close all menus\n if (qx.ui.menu && qx.ui.menu.Manager) {\n qx.ui.menu.Manager.getInstance().hideAll();\n }\n }", "title": "" }, { "docid": "68fcb10b4cfc87826e7c69f7deac14a4", "score": "0.570528", "text": "function closeWindow() {\r\n infowindow.close();\r\n }", "title": "" }, { "docid": "8c2aa50a82bb554526726e81b22c6b65", "score": "0.5702338", "text": "function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n\n return closeButton;\n }", "title": "" }, { "docid": "8c2aa50a82bb554526726e81b22c6b65", "score": "0.5702338", "text": "function findCloseButton() {\n var closeButton = element[0].querySelector('.dialog-close');\n\n if (!closeButton) {\n var actionButtons = element[0].querySelectorAll('.md-actions button, md-dialog-actions button');\n closeButton = actionButtons[actionButtons.length - 1];\n }\n\n return closeButton;\n }", "title": "" }, { "docid": "fcdc96985f35acb8251fee9c0d98e247", "score": "0.5696433", "text": "function closeAddEventWindow () {\n\t$('#addEvent').hide();\n}", "title": "" }, { "docid": "fa791228fc32101a15eb41c1d51ecbf9", "score": "0.569636", "text": "function closePopbox() {\n\tjQuery.closeDOMWindow();\n}", "title": "" }, { "docid": "befd53c3e8009ea36fd4478e966235f5", "score": "0.56868285", "text": "function closeAllInfoWindows(inforWindows){\n\t\t\t\tfor (var i = 0; i < inforWindows.length; i++ ) {\n\t\t\t\t\t inforWindows[i].close();\n\t\t\t\t}\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "dc58c664e9555830780b87bddf415a3d", "score": "0.5676393", "text": "function eventWinClose() {\n $.win.removeEventListener('open', eventWinOpen);\n $.win.removeEventListener('close', eventWinClose);\n $.win = null;\n}", "title": "" }, { "docid": "819b6e68e359345826d7f1b7ac426c73", "score": "0.5674976", "text": "function gCloseDownloadManager()\n{\n window.close();\n}", "title": "" }, { "docid": "e313a8f7876ebd05318daa92e917c54b", "score": "0.5669797", "text": "function _invokeGlobalShutdown() {\n window.close();\n}", "title": "" }, { "docid": "d89895c5e2d002805d8672120050aa75", "score": "0.566812", "text": "closeActivePaneItemOrEmptyPaneOrWindow() {\n if (this.getCenter().getActivePaneItem() != null) {\n this.getCenter()\n .getActivePane()\n .destroyActiveItem();\n } else if (this.getCenter().getPanes().length > 1) {\n this.getCenter().destroyActivePane();\n } else if (this.config.get('core.closeEmptyWindows')) {\n atom.close();\n }\n }", "title": "" }, { "docid": "fcda61d3560b9eec47d0853103e61935", "score": "0.56569624", "text": "function closeModalWindow() {\n $('.modal-close-btn').on('click', function() {\n $('.modal-container').remove();\n });\n }", "title": "" }, { "docid": "e79a4d7d01e81e1adf13bf3598364f54", "score": "0.56502867", "text": "function onBackBtnClick(e) {\n\t\twin.close();\n\t}", "title": "" }, { "docid": "afe671fb72d0661516b378c913a6bbb2", "score": "0.5649272", "text": "function dt_close_modal_window(){\r\n\t\t$( 'div#dt_dialog_modal, div.dt_modal_blocker' ).remove();\r\n\t\t$('html:not(:animated),body:not(:animated)').animate({ scrollTop: $('#dt_page_builder').offset().top - 100 }, 500);\r\n\t}", "title": "" }, { "docid": "21a3e02049a69bb7ae6361b5ebc41aea", "score": "0.56433433", "text": "function closeConfigureOverlay() {\n d3.select(\"#configureWindow\").style(\"display\", \"none\");\n d3.select(\"#overlayBkgrd\").style(\"display\", \"none\");\n}", "title": "" } ]
a9a9c15322dc1c8a08a8651db79b4400
Creates the basic question slides/divs and the results slide
[ { "docid": "90d8d8b86ec56def6e79bc6ec82a50ff", "score": "0.76143765", "text": "function createSlides() {\n var slides = $(\"#slides_container\");\n slides.empty();\n shuffle(characterArray);\n for (var i = 0; i < characterArray.length; i++) {\n slides.append(\n $(\"<div/>\", {class: \"slide\", id: \"question\" + i})\n .append(\n $(\"<h1/>\", {class: \"questionChar\"})\n ).append(\n $(\"<div/>\", {class: \"questionChoices\"})\n )\n );\n createQuestionText(i);\n }\n slides.append(\n $(\"<div/>\", {class: \"slide\", id: \"resultDiv\"})\n .append(\n $(\"<h1/>\", {class: \"questionChar\", id: \"resultH1\"})\n ).append(\n $(\"<input/>\", {type: \"button\",\n value: \"再\",\n id: \"restartButton\",\n title: \"Restart Quiz\"})\n .click(createSlides)\n )\n );\n contentSlide();\n }", "title": "" } ]
[ { "docid": "7ee60c74ef0d8900944b694c8780d943", "score": "0.72647357", "text": "function make_slides(f) {\n var slides = {};\n \n //block enter key for every instance of class \"slide\" so that exp doesn't start from beginning when entering answer\n $('html').bind('keypress', function(e)\n {\n if(e.keyCode == 13)\n {\n return false;\n }\n });\n\n slides.i0 = slide({\n name : \"i0\",\n start: function() {\n exp.startT = Date.now();\n }\n });\n\n slides.instructions = slide({\n name : \"instructions\",\n button : function() {\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n });\n \nslides.example = slide({\n name : \"example\",\n button : function() {\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n });\n \nslides.quant = slide({\n \tname: \"quant\", //id of div element where info should be presented\n \tpresent: get_quant_items(), //gets items via function\n \n/* urn_image: function(stim) { //id of div element, if same item is to be shown on different slides (with different tasks, for example\n //show only one urn picture\n $(\".pic\").hide();\n var uniform = jStat.uniform.sample(1,5);\n var pic_id = Math.round(uniform);\n $(\"#\" + pic_id).show();\n $(\"#name\").html(stim.name); //from items array, use property item\n },*/\n \n\n rating_task: function(stim) { //id of div element, if same item is to be shown on different slides (with different tasks, for example //from items array, use property item\n //random choice of LP or HP\n \n var context_sentence = stim.context;\n var context_elements = context_sentence.split(\"__\"); //split context at __\n var context_begin = context_elements[0]; \n var context_end = context_elements[1]; \n \n var context_quant = stim.quantifier;\n $(\"#context_begin\").html(context_begin);\n $(\"#context_quant\").html(context_quant);\n $(\"#context_end\").html(context_end);\n \n \n var question = stim.question;\n $(\"#question\").html(question);\n \n $(\"#min\").html(stim.min);\n\t\t$(\"#max\").html(\" \"+stim.max + \" or more\");\n _s.init_slider(stim.min, stim.max);\n \t_s.current_response_data = null;\n\t\t$(\"#number_guess\").html(\"?\");\n },\n\n \n present_handle: function(stim) {\n //reset input elements\n //$(\"#number_guess_likely\").html(\"?\");\n //hide parts of subslides, only show after each other\n $(\".subslide\").hide();\n //for sliders\n \t_s.this_trial_data = clone(stim);\n //stage of Manski task?\n \t_s.measure = stim.measure;\n console.log('stim measure '+stim.measure);\n \t_s.trial_start = Date.now();\n \t_s.measure = stim.measure;\n _s.trial_start = Date.now();\n $(\"#number_guess\").html(\"?\");\n $(\".err\").hide();\n $(\"#\" + _s.measure).show();\n _s[_s.measure](stim); //_s[_s.measure] calls the function inside the current measure, it basically creates the items as defined in the measure\n },\n \n button : function() {\n //check if slider has been clicked\n if (_s.current_response_data == null) {\n\t\t\t$(\"#quant_err\").show();\n\t\t}\n else{ //save responses and present next item\n response = _s.current_response_data;\n _s.log_responses();\n\t\t _stream.apply(this);\n }\n },\n init_slider : function(min, max) {\n utils.make_slider(\"#give_number_single_slider\", function(event, ui) {\n _s.current_response_data = Math.round(ui.value * (max - min) + min);\n $(\"#number_guess\").html(_s.current_response_data);\n });\n },\n log_responses: function() {\n \t \t_s.this_trial_data[\"response\"] = response;\n //change this!!\n _s.this_trial_data[\"modifier\"] = \"unmodified\";\n _s.this_trial_data[\"task\"] = \"interpretation\";\n\t \t_s.this_trial_data[\"rt\"] = Date.now() - _s.trial_start;\n\t \texp.data_trials.push(clone(_s.this_trial_data));\n \t_s.current_response_data = null;\n }\n \n });\n \n\n slides.subj_info = slide({\n name : \"subj_info\",\n submit : function(e){\n //if (e.preventDefault) e.preventDefault(); // I don't know what this means.\n exp.subj_data = {\n language : $(\"#language\").val(),\n enjoyment : $(\"#enjoyment\").val(),\n asses : $('input[name=\"assess\"]:checked').val(),\n age : $(\"#age\").val(),\n gender : $(\"#gender\").val(),\n education : $(\"#education\").val(),\n comments : $(\"#comments\").val(),\n };\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n });\n\n slides.thanks = slide({\n name : \"thanks\",\n start : function() {\n exp.data= {\n \"trials\" : exp.data_trials,\n \"catch_trials\" : exp.catch_trials,\n \"system\" : exp.system,\n \"condition\" : exp.condition,\n \"subject_information\" : exp.subj_data,\n \"clicks\" : exp.clicks,\n \"time_in_minutes\" : (Date.now() - exp.startT)/60000\n };\n setTimeout(function() {turk.submit(exp.data);}, 1000);\n }\n });\n\n return slides;\n}", "title": "" }, { "docid": "ab0fad5d7d84779c820084056cec292d", "score": "0.6645481", "text": "function buildQuiz(){\n\n // Store the HTML output\n const output = [];\n\n // Loop to iterate through each question...\n myQuestions.forEach(\n (currentQuestion, questionNumber) => {\n // Store the list of answer choices\n const answers = [];\n // Iterate through each answer in a question\n for(letter in currentQuestion.answerList){\n // Add HTML radio buttons for each answer choice\n answers.push(\n `<label class=\"radio\">\n <input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\">\n ${currentQuestion.answerList[letter][0]}\n </label>`\n );\n }\n\n // Add this question and its answers to the output\n output.push(\n `<div class=\"slide\">\n <div class=\"question\"> ${currentQuestion.question} </div>\n <div class=\"answers\"> ${answers.join('')} </div>\n </div>`\n );\n }\n );\n // Combine our output list into one string of HTML and put it on the page\n quizContainer.innerHTML = output.join('');\n}", "title": "" }, { "docid": "6f99af0394e444c6a3b1b0e6decbec9a", "score": "0.65531224", "text": "function makePage() {\n // Create main container for page\n display_element.append($('<div>', {\n \"id\": 'mainContainer',\n 'class': 'container'\n }));\n\n // Create question element\n $('#mainContainer').append($('<div>', {\n \"id\": 'instructions',\n \"class\": 'jumbotron text-center'\n }));\n\n $('#instructions').text('Now, using the sliders, please indicate how '+\n 'biased you believe each news source to be.')\n\n var newsLogos = ['alpha_news', 'premier_news', 'first_news'];\n\n // Create page rows and columns\n for(var i=0; i < 4; i++){\n $('#mainContainer').append($('<div>', {\n 'id': 'row'+i,\n 'class': 'row mt-3'\n }));\n\n $('#row'+i).append($('<div>', {\n 'id': 'row'+i+'-col0',\n 'class': 'col-3 my-auto',\n 'align': 'center'\n }));\n\n $('#row'+i).append($('<div>', {\n 'id': 'row'+i+'-col1',\n 'class': 'col-9'\n }));\n\n if (i < 3){\n $('#row'+i+'-col0').append($('<img>', {\n 'id': newsLogos[i].slice(0,5),\n 'src': './images/'+newsLogos[i]+'.png',\n 'class': 'img-fluid',\n 'alt': newsLogos[i]\n }));\n\n\n } else {\n // Create button\n $('#row3-col1').append($('<button>', {\n 'id': 'next',\n 'class': 'btn btn-default pull-right',\n 'html': 'Continue'\n }));\n\n $(\"#next\").prop('disabled', true);\n\n }\n\n $(\"#next\").click(function() {\n var endTime = (new Date()).getTime();\n var response_time = endTime - startTime;\n\n var trial_data = {\n 'alphaBias': $('#sliderrow0-col1').slider('value'),\n 'premierBias': $('#sliderrow1-col1').slider('value'),\n 'firstBias': $('#sliderrow2-col1').slider('value'),\n \"rt\": response_time\n };\n // goto next trial in block\n display_element.html('');\n jsPsych.finishTrial(trial_data);\n });\n\n };\n\n }", "title": "" }, { "docid": "184560a8f8d8cf8cb15870f6641004e6", "score": "0.6507871", "text": "function displaySliderQuestion() {\n $questionHeader.html($nextSliderTitle);\n $sliderQuestion.show();\n}", "title": "" }, { "docid": "cfd0a4483d0472503bcef32128c731d8", "score": "0.6481439", "text": "function buildQuiz() {\n //place to store HTML output\n const output = [];\n\n //for each question\n triviaQuestions.forEach((currentQuestion, questionNumber) => {\n //store the list of answer choices\n const answers = [];\n\n //and each available answer\n for (letter in currentQuestion.answers) {\n //add HTML radio button\n answers.push(\n `<label>\n <input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\">\n ${currentQuestion.answers[letter]}\n </label>`\n );\n }\n\n //add this question and its answers to the output\n output.push(\n `<div class=\"slide\">\n <div class=\"question\"> ${currentQuestion.question}</div>\n <div class=\"answers\"> ${answers.join(\"\")} </div>\n </div>`\n );\n });\n\n //combine the output list into one string of HTML and put it on the page\n quizContainer.innerHTML = output.join(\"\");\n } //end of buildQuiz", "title": "" }, { "docid": "013dc5f1800709ffc1779ddcf51a3951", "score": "0.6472866", "text": "function buildQuiz () {\n startQuiz();\n renderCurrentQuestion();\n selectAnswer();\n renderNextQuestion();\n}", "title": "" }, { "docid": "668cd87d98655d4917a911d6655b2204", "score": "0.6442886", "text": "function createQuestioncontainer(index) {\n var qContainer = $('<div class=\"trivia-questions\">', {\n id: 'question-number'\n });\n var currentScore = calculateScore();\n var questionPtvalue = questionSet[index].point_value;\n for (var i = 0; i < questionSet[index].choices.length; i++) {\n $('#question-score.q-score-css').text((questionPtvalue) + 'pts');\n }\n \n\n\n // questionSet = questions[0];\n choices = questions[0,0].correctAnswer;\n\n\n \n \n\n var questionNo = $('<h2>QUESTION ' + 0 + (index + 1) + ':</h2>');\n \t$('#question-number.question-01').html(questionNo);\n \n var question = $('<div class=\"question-text\">').append(questionSet[index].question);\n qContainer.append(question);\n $('header ul li.total-score').text(currentScore[1]);\n\n\t\n var radioButtons = createRadios(index);\n qContainer.append(radioButtons);\n \n return qContainer;\n }", "title": "" }, { "docid": "32ed26b057e600110049ca3bbfa535f3", "score": "0.64281124", "text": "function generateQuizContent() {\r\n if (currentQuestion < allQuestions.length) {\r\n $(\"#current-question-title\").text(currentQuestion + 1);\r\n $('.question-text').text(allQuestions[currentQuestion].question);\r\n for (var i = 0; i < allQuestions[currentQuestion].answers.length; i++) {\r\n $('#answer-list').append('<li class=\"answers-text\">' + allQuestions[currentQuestion].answers[i] + '</li>');\r\n }\r\n } else {\r\n /*---ONCE CURRENTQUESTION IS GREATER THAN ARRAY LENGTH, RESULTS PAGE IS PRESENTED ---*/\r\n showResults();\r\n }\r\n }", "title": "" }, { "docid": "71311e4cf6bd7bb462a4488f63c0cbe2", "score": "0.64066094", "text": "function questionSetUp(data){\n let results = data.results\n clickCount = 0\n shuffle(results)\n shuffledQs = results\n for (i =0; i<allAnswers.length; i=i+1){\n allAnswers[i].style.display = 'inline'\n }\n answerBox.style.display = 'grid'\n\n nextQuestion(questionArr)\n return questionArr\n\n}", "title": "" }, { "docid": "61b67cf41492d16f18db39a74cde2017", "score": "0.63920915", "text": "function startQuestions() {\n // Shows the question\n allQuestion = questions[questionArray];\n questionElement.textContent = allQuestion.question;\n\n // Show the answer choices\n answer1.textContent = allQuestion.choices[0];\n answer2.textContent = allQuestion.choices[1];\n answer3.textContent = allQuestion.choices[2];\n answer4.textContent = allQuestion.choices[3];\n}", "title": "" }, { "docid": "ea694cc8f33cdb43572fdcb658235997", "score": "0.6391152", "text": "function setUpQuestionResultPage() {\n $('.question-page').hide();\n $('#questionButton').hide();\n $('.answer').hide();\n $('.question-result').show();\n}", "title": "" }, { "docid": "c3a8954ec5de8e78352d571d04eec2fb", "score": "0.63812417", "text": "function buildQuestions(){\n var questionHTML = ''\n for (var i = 0; i<game.questions.length; i++) {\n questionHTML = questionHTML + formTemplate(game.questions[i]);\n }\n $('#questions-container').append(questionHTML); \n }", "title": "" }, { "docid": "f68ec6d05ad3cbcbcbfc58397431cfac", "score": "0.63635695", "text": "function createQuizHTML(questionAnswers) {\n\t // Question will be something like:\n\t // {questions:[{\"question\":\"Name the best Rugby team?\", \n\t //\t\t\t\t\t\t\"answers\":[\"Leinster\", \"Munster\", \"Ulster\", \"Connaught\"],\n\t //\t\t\t\t\t\t\"correct_answer\":\"Leinster\"},\n\t //\t\t\t {\"question\":\"Name the best DJ?\", \n\t //\t\t\t\t\t\t\"answers\":[\"Warren K\", \"Pressure\", \"Digweed\", \"Sasha\"],\n\t //\t\t\t\t\t\t\"correct_answer\":\"Leinster\"}]};\n\t //\n\t var returnString = new Array();\n\t $.each(questionAnswers.questions, function(i, val){\t\n\n\t // panel div begin\n\t\t\tif (i === 0) {\n\t\t\t returnString.push('<div class=\"questionContainer radius\">');\n\t\t\t} else {\n\t\t\t returnString.push('<div class=\"questionContainer hide radius\">');\n\t\t\t}\n\t\t\treturnString.push('<div class=\"question\"><b>Question ' + (i+1) + ': ' + '</b><b><span>' + val.question + '</span></b></div>');\n\n\t\t\treturnString.push('<div class=\"answers\">'); // answers div begin\n\t\t\treturnString.push('<ul>'); // list begin\n\t\t\t\n\t\t\tvar textForAnswers = val.answers;\n\t\t\t$.each(textForAnswers, function(j, answer) {\n\t\t\t // get answer.\n\t\t\t\tvar actualAnswer = val.correct_answer;\n\t\t\t\tif (val.correct_answer.split(',').length === 1) {\n\t\t\t\t\t// use check boxes\n\t\t\t\t\treturnString.push('<li class=\"answeritem\"><label><input type=\"radio\" name=\"q' + i + '\" id=\"q' + i + '-' + j + '\"/><span>' + answer + '</span></label></li>'); // Add each answer\n\t\t\t\t} else {\n\t\t\t\t\t// else use radio buttons.\n\t\t\t\t\treturnString.push('<li class=\"answeritem\"><label><input type=\"checkbox\" name=\"q' + i + '\" id=\"q' + i + '-' + j + '\"/><span>' + answer + '</span></label></li>'); // Add each answer\n\t\t\t\t}\n\t\t\t}); // end answer iteration.\n\t\t\t\n\t\t\treturnString.push('</ul>');\t\t\t\t\t\t\t// list end\n\t\t\treturnString.push('</div>'); \t\t \t\t// answers div end\n\t\t\t// next / prev button\n\t\t\treturnString.push('<div class=\"btnContainer\">');\n returnString.push('<div class=\"prev\">');\n\t\t\tif (i > 0) {\n\t\t\t\treturnString.push('<a class=\"btnPrev pretty\">&lt;&lt; Prev</a>');\n\t\t\t}\n returnString.push('</div>'); \t\t\t// end prev div\n\t\t\t// Is it the last? \n\t\t\tif (i === (questionAnswers.questions.length - 1)) { \n\t\t\t returnString.push('<div class=\"next\">');\n returnString.push('<a class=\"btnShowResult pretty\">Finish!</a>');\n\t\t\t\treturnString.push('</div>');\n\t\t\t} else {\n\t\t\t\treturnString.push('<div class=\"next\">');\n\t\t\t\treturnString.push('<a class=\"btnNext pretty\">Next &gt;&gt;</a>');\n\t\t\t\treturnString.push('</div>'); \t\t\t// end next div\n\t\t\t}\n returnString.push('<div class=\"clear\"></div>'); \t// begin / end clear div\n\t\t\treturnString.push('</div>'); \t\t// end btn contained div \n\t\t\treturnString.push('</div>'); // end panel div\n\n\t });\n\t returnString.push('<div id=\"txtStatusBar\">Progess Bar</div>');\n\t returnString.push('<div id=\"progressKeeper\" class=\"radius\">');\n\t returnString.push('<div id=\"progress\"></div>');\n\t returnString.push('</div>');\n\t returnString.push('<div id=\"resultKeeper\" class=\"radius hide\"></div>');\n \n\t return returnString.join('');\n\t}", "title": "" }, { "docid": "5d30c57c8e6d94d65d53c475848fecb4", "score": "0.63579565", "text": "function question() {\n var qHero = store.questions[store.questionNumber].question;\n var ansOne = store.questions[store.questionNumber].answers[0];\n var ansTwo = store.questions[store.questionNumber].answers[1];\n var ansThree = store.questions[store.questionNumber].answers[2];\n var ansFour = store.questions[store.questionNumber].answers[3];\n\n $(\".hero\").append(questionTemplate(qHero, ansOne, ansTwo, ansThree, ansFour));\n}", "title": "" }, { "docid": "5a46957f876de78b14978491970ea26e", "score": "0.63388413", "text": "function showSlides(n) {\n var i;\n var slides = document.getElementsByClassName(\"myQuestions\");\n var dots = document.getElementsByClassName(\"dot\");\n if (n > slides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = slides.length}\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" active\";\n if(slideIndex != 1){\n document.getElementById(\"prev\").style.display = \"block\";\n }else{\n document.getElementById(\"prev\").style.display = \"none\";\n }\n if(slideIndex != numberOfQuestions+1){\n document.getElementById(\"next\").style.display = \"block\";\n }else{\n document.getElementById(\"next\").style.display = \"none\";\n }\n}", "title": "" }, { "docid": "c21ce4f982fda1285d9d1ab05da2d8b3", "score": "0.6314866", "text": "function addQuestionsToDom(numberofQuestions, question, optionA, optionB, optionC, optionD, questionNum) {\n // if(numberofQuestions > 5){numberofQuestions = 5}\n\n for(i=0; i<5; i++){\n if(i === 0){\n\n // Adding those div boxes\n let questionBox = document.createElement(\"div\")\n questionBox.className = \"question-slide\"\n questionBox.style.marginTop = `${imageProps.marginTop[i]}px`\n questionBox.style.width = `${imageProps.width[i]}%`\n questionBox.innerHTML = questionTemplate(question, `A. ${optionA}`, `B. ${optionB}`, `C. ${optionC}`, `D. ${optionD}`, questionNum)\n \n // Adding the div boxes with questions to the screen\n questionContent.insertBefore(questionBox, questionContent.children[0])\n\n disbleButtons()\n \n circle = document.querySelector(`.progress-ring__circle`)\n radius = circle.r.baseVal.value;\n circumference = radius * 2 * Math.PI;\n \n circle.style.stroke = 'transparent'\n \n circle.style.strokeDasharray = circumference;\n circle.style.strokeDashoffset = circumference; \n\n QuestionNum += 1\n \n }\n \n else{\n \n let questionBox = document.createElement(\"div\")\n \n questionBox.className = \"question-slide\"\n questionBox.style.marginTop = `${imageProps.marginTop[i]}px`\n questionBox.style.width = `${imageProps.width[i]}%`\n questionContent.insertBefore(questionBox, questionContent.children[0])\n }\n }\n}", "title": "" }, { "docid": "821c053b854c77a9aea64cb96cf7e326", "score": "0.6313586", "text": "function createQuiz() {\n\tstartQuiz();\n\trenderQuestion();\n\tuserSelectAnswer();\n\trenderNextQuestion();\n}", "title": "" }, { "docid": "4a6273452a89b5d467ad62b44c0255c1", "score": "0.6299836", "text": "function buildQuiz(){\n\n //Declaramos una variable output\n const output = [];\n\n//Este forEach nos permitirá recorrer el array de objetos en el que tenemos guardado el TEST\n\n myQuestions.forEach((currentQuestion, questionNumber) => {\n\n //We declare a variable that will contain all the answers\n const answers = [];\n\n //The for in loop allows as to run and have access to an object data. In this case we need to combine it with the for each. The foreach lets us have access to the different\n //elements of the array of objects, and thanks to the for in loop we can have access to the elemens of the answers object\n\n for(letter in currentQuestion.answers){\n answers.push(\n `<label>\n <input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\" style=\"opacity:1; position: relative; \">\n ${letter} :\n ${currentQuestion.answers[letter]}\n </label>`\n );\n }\n\n /* We push all the data to the output array that we previously declared. */\n\n output.push(\n\n `<div class='slide'>\n <div class='flags'> <img src=\"${currentQuestion.flag}\" height=\"300\" width=\"400\"> </div>\n <div class='question'> ${currentQuestion.question} </div>\n <div class='answers'>${answers.join('')} </div>\n </div>`\n );\n\n }\n );\n\n //We use the constant that holds the div where we want to show all the test and put it using the innerHTML method.\n\n quizContainer.innerHTML = output.join('');\n}", "title": "" }, { "docid": "91bc7543a4acdbd6ad15a9153027f879", "score": "0.62886983", "text": "function questionContent() {\n\t\t// a for loop would be cool here...\n \t$(\"#gameScreen\").append(\"<p><strong>\" + \n \t\tquestions[questionCounter].question + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[0] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[1] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[2] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[3] + \n \t\t\"</strong></p>\");\n\t}", "title": "" }, { "docid": "91bc7543a4acdbd6ad15a9153027f879", "score": "0.62886983", "text": "function questionContent() {\n\t\t// a for loop would be cool here...\n \t$(\"#gameScreen\").append(\"<p><strong>\" + \n \t\tquestions[questionCounter].question + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[0] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[1] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[2] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[3] + \n \t\t\"</strong></p>\");\n\t}", "title": "" }, { "docid": "91bc7543a4acdbd6ad15a9153027f879", "score": "0.62886983", "text": "function questionContent() {\n\t\t// a for loop would be cool here...\n \t$(\"#gameScreen\").append(\"<p><strong>\" + \n \t\tquestions[questionCounter].question + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[0] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[1] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[2] + \n \t\t\"</p><p class='choices'>\" + \n \t\tquestions[questionCounter].choices[3] + \n \t\t\"</strong></p>\");\n\t}", "title": "" }, { "docid": "93aab1b5249dbd9fed136e0c2a9d0a66", "score": "0.62785697", "text": "function generateQuestionView() {\r\n let answers = store.questions[store.questionNumber].answers;\r\n return `\r\n <div id=\"question-page\">\r\n <div id=\"question-count\">Question ${store.questionNumber + 1} of ${store.questions.length}</div>\r\n <h2 id=\"question\">${store.questions[store.questionNumber].question}</h2>\r\n <form>\r\n <ul id=\"answers\">\r\n <li><input type=\"radio\" name=\"answer\" id=\"\" value=\"${answers[0]}\" checked= \"checked\"/>${answers[0]}</li>\r\n <li><input type=\"radio\" name=\"answer\" id=\"\" value=\"${answers[1]}\" />${answers[1]}</li>\r\n <li><input type=\"radio\" name=\"answer\" id=\"\" value=\"${answers[2]}\" />${answers[2]}</li>\r\n <li><input type=\"radio\" name=\"answer\" id=\"\" value=\"${answers[3]}\" />${answers[3]}</li>\r\n </ul>\r\n <div>\r\n <p id=\"count\">Score: ${store.score} out of ${store.questions.length}</p>\r\n <button type=\"submit\" id=\"submit\">SUBMIT</button>\r\n </div>\r\n </form>\r\n </div>`;\r\n}", "title": "" }, { "docid": "ba885a9162741428e005d1c4de5d5cc4", "score": "0.6278271", "text": "function buildQuestions() {\n var questionHTML = ''\n for (var i = 0; i < game.questions.length; i++) {\n questionHTML = questionHTML + formTemplate(game.questions[i]);\n console.log('questionHTML');\n }\n $('#questions-container').append(questionHTML);\n\n }", "title": "" }, { "docid": "7c7c16c05731b139586ddc672cbaffcc", "score": "0.62704474", "text": "function displayQueastions() {\n for (questionIndex; questionIndex < questionPerPage; questionIndex++) {\n if (questionIndex > totalQuestion - 1) {\n noOfQuest = questionIndex;\n // change the position of ans options\n let optContainer = $('.mcqWrapper #mcqWrapper .optContainer');\n $.each(optContainer, function(index, value) {\n let ansContainer = $(this).find('.ans');\n $.each(ansContainer, function(index, value) {\n $(this).css({\n 'order': Math.floor((Math.random() * 4) + 1)\n });\n })\n }) // end change the position of ans options\n return false;\n }\n let html = `<div class='questionContainer animated fadeInUp'><div class='questOptContainer'><div class='questContainer'><h3 class='question'>${data[questionIndex].question}\n <img src='img/right.png' class='right' /><img src='img/wrong.png' class='wrong' /></h3></div><div class='optContainer'><div class='ans'><label class='labelContainer'><input type='radio' id='corrAns0${questionIndex}' class=\"corrAns\" value='' name='data${questionIndex}'><span class='checkmark'></span></label><label for='corrAns0${questionIndex}' ><p>${data[questionIndex].corrAns}</p></label></div><div class='ans'><label class='labelContainer'><input type='radio' id='opt1${questionIndex}' value='' name='data${questionIndex}'><span class='checkmark'></span></label><label for='opt1${questionIndex}' ><p>${data[questionIndex].sugg1}</p></label></div><div class='ans'><label class='labelContainer'><input type='radio' id='opt2${questionIndex}' value='' name='data${questionIndex}'><span class='checkmark'></span></label><label for='opt2${questionIndex}' ><p>${data[questionIndex].sugg2}</p></label></div><div class='ans'><label class='labelContainer'><input type='radio' id='opt3${questionIndex}' value='' name='data${questionIndex}'><span class='checkmark'></span></label><label for='opt3${questionIndex}' ><p>${data[questionIndex].sugg3}</p></label></div></div></div><div class='videoContainer'><video src='${data[questionIndex].video}' controls /></div></div>`;\n\n mcqContainer.append(html);\n\n } //for loop end here\n\n // change the position of ans options\n let optContainer = $('.mcqWrapper #mcqWrapper .optContainer');\n $.each(optContainer, function(index, value) {\n let ansContainer = $(this).find('.ans');\n $.each(ansContainer, function(index, value) {\n $(this).css({\n 'order': Math.floor((Math.random() * 4) + 1)\n });\n })\n }) // end change the position of ans options\n\n }", "title": "" }, { "docid": "04538ec38190224a2e8482469fbca451", "score": "0.6270293", "text": "function setUpQuestionPage() {\n $('.start-page').hide();\n $('.question-page').show();\n $('#questionButton').show();\n $('.nav-items').show();\n $('.question-result').hide();\n}", "title": "" }, { "docid": "b585f1c4d4cdec791520840dd8c90dd6", "score": "0.6264317", "text": "function createQuestionElements() {\n for (i = 0; i < questions.length; i++) {\n // create a div with a class to hold the true false questions\n var newQuestion = $(`<div id=\"question-${i}\">`);\n\n var radioAnswerTrue = $(`<input class=true value=true id=\"${i}-true\" name=\"${i}\" type= radio >True<br>`);\n var radioAnswerFalse = $(`<input class=false value=false id=\"${i}-false\" name=\"${i}\" type= radio>False<br>`);\n\n // Put the divs and the radio buttons on the screen\n newQuestion.text(questions[i].question);\n $(\"#questionBox\").append(newQuestion); \n $(\"#questionBox\").append(radioAnswerTrue);\n $(\"#questionBox\").append(radioAnswerFalse);\n\n $(`#${i}-true`).on('click', function(event) {\n handleItemClick(event.currentTarget.id, true);\n });\n\n $(`#${i}-false`).on('click', function(event) {\n handleItemClick(event.currentTarget.id, false);\n });\n }\n }", "title": "" }, { "docid": "8b5bde9e99fd14ded14650abb801609e", "score": "0.6259213", "text": "function createQHtml(contents, quizname, point_arr){\n\tvar div = document.createElement(\"div\");\n\tdiv.innerHTML = \"\"; // initialize the html portion\n\n\t// var quizname = contents[0].quiz_name;\n\tdiv.innerHTML += \"<h1>\" + quizname + \"</h1><br><br>\"; // header in a sense\n\n\tfor(var i=0; i<contents.length; i++){\n\t\t\t\t// generate the question\n\t\tdiv.innerHTML += \"<br>\" + \"<h3>Q\" + (i+1)+ \"\\t(\"+ point_arr[i] +\" Points)\" + \"</h3> \" + ' <p style=\"display:inline\" class=\"theQues\">' + contents[i].Question + \"</p><br><br>\";\n\t\t// auto generate ids for the textfields\n\t\tdiv.innerHTML += \"<textarea autocomplete='off' placeholder='answer' rows='10' cols='80'\" + \"id='answer\"+ (i+1) + \"'\" + \"></textarea>\" + \"<br>\";\n\t}\n\treturn div;\n}", "title": "" }, { "docid": "a8f8d72737e01f59460cb79e7a5481e7", "score": "0.62494755", "text": "function showQuestion(counter) {\n // creating new div, fieldset, legend\n var newDiv = $(\"<div>\").addClass(\"row primary\").attr(\"id\", \"content\");\n var newFieldSet = $(\"<fieldset>\").addClass(\"small-6 columns newDiv\").attr(\"id\", \"\");\n var newLegend = $(\"<legend>\").text(arrayOfQuestions[counter].Question).attr(\"id\", \"\");\n\n // pushing newLegend and newFieldSet to newDiv and then pushing newDiv to inputForm\n $(\".inputForm\").append(newDiv.append(newLegend, newFieldSet));\n\n getGiphyImage(counter);\n}", "title": "" }, { "docid": "591fb6b24778d0604c530d77a8f4bdfd", "score": "0.62358856", "text": "function renderQuestion () {\n $('main').html(generateQuestion());\n}", "title": "" }, { "docid": "45cbc278a74f21c5912be119dae65ad1", "score": "0.62313944", "text": "function questions () { \n timer();\n content.html(\"\");\n\n for (var k = 0; k < allQuestions.length; k++) {\n \n var newDiv = $(\"<div>\");\n var newQ = $(\"<h3>\");\n var newA = $(\"<h4>\");\n newDiv.attr(\"id\", \"question\");\n \n \n content.append(newDiv);\n newDiv.append(newQ);\n newQ.text(allQuestions[k].question);\n newDiv.append(newA);\n\n for (var i=0; i < allQuestions[k].answers.length; i++) {\n var options = allQuestions[k].answers[i]; \n var select = $(\"<input>\")\n select.attr({\n type: \"radio\",\n name: \"q\" + k,\n id: \"a\" + i,\n value: options\n });\n newA.append(select, \" \" + options + \" \");\n \n \n }\n \n }\n \n submitButton();\n }", "title": "" }, { "docid": "e91e141b099bb3d1d8af54e2279341eb", "score": "0.6228121", "text": "function buildQuiz(){\n\n // variable to store the HTML output\n const output = [];\n\n \n quizQuestions.forEach(\n (currentQuestion, questionNumber) => {\n\n // variable to store the list of possible answers\n const answers = [];\n\n // and for each available answers\n for(letter in currentQuestion.answers){\n\n //add an HTML radio button\n answers.push(\n `<label>\n <input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\">\n ${letter} :\n ${currentQuestion.answers[letter]}\n </label>`\n );\n }\n\n // add this question and its answers to the output\n output.push(\n `<div class=\"slide\">\n <div class=\"question\"> ${currentQuestion.question} </div>\n <div class=\"answers\"> ${answers.join(\"\")} </div>\n </div>`\n );\n\n }\n );\n\n //combine the output list into one string of HTML and put it on the page\n quiz.innerHTML = output.join('');\n}", "title": "" }, { "docid": "0cd768a1f8350d991aa1c378bba03d6a", "score": "0.62205", "text": "function set_div(){\n\t// equation_index = \"equation_\" + getNumberOfEquationInTab();\n\tequation_index = \"equation_1\"\n\tcount_pg = 0\n\tfor(var pg in mathInteractiveContent)\n\t{\n\t\teval(`\n\t\t\t\tpage${count_pg+1}X = (count_pg+1 )*(117+10);\n\t\t\t\tpage${count_pg+1}Y = 0, page${count_pg+1}W = 117 , page${count_pg+1}H = 117;\n\t\t\t`)\n\t\tcount_pg++\n\t}\n\teval(`pageRightX = (count_pg+1 )*(117+10) , pageRightY = 0, pageRightW = 117 , pageRightH = 117;`)\n\t\tconsole. log(count_pg)\n\tmathInteractiveContentCopy= bestCopyEver(mathInteractiveContent)\n\t// Equation Text Div > Maximum only two last solution can show\n\tquestion_div = createDiv(\"\"); \t\t\t\t\t// Question Text \n\t// question_di = createDiv(\"\");\n\tquestion_div_content = createDiv(\"\")\n\tsolution_equation_1_div = createDiv(\"\")\t\t\t\t \t\t\t\t\t// Expanded 2nd last equation\n\tsolution_equation_1_div_content = createDiv(\"\")\n\tsolution_equation_2_div = createDiv(\"\")\t\t\t\t \t\t\t\t\t// Expanded last equation \n\tsolution_equation_2_div_content = createDiv(\"\")\n\tsolution_equation_3_div = createDiv(\"\")\t\t\t\t \t\t\t\t\t// Expanded last equation \n\tsolution_equation_3_div_content = createDiv(\"\")\n\tseprate_line = createDiv(\"\")\n\tseprate_line2 = createDiv(\"\")\n\tapply_law_btn = createDiv(\"\")\n\treset_btn = createDiv(\"\");\n\tgo_to_exercise = createDiv(\"\")\n\tapply_line = createDiv(\"\");\n\tapply_box = createDiv(\"\");\n\tapply_box_content = createDiv(\"\")\n\n\n\t// #Copy of orignal Div\n\tsolution_equation_1_div_copy = createDiv(\"\")\n\tsolution_equation_1_div_content_copy = createDiv(\"\")\n\tsolution_equation_1_div_content_copy. parent(solution_equation_1_div_copy)\n\tsolution_equation_2_div_copy = createDiv(\"\")\n\tsolution_equation_2_div_content_copy = createDiv(\"\")\n\tsolution_equation_2_div_content_copy. parent(solution_equation_2_div_copy)\n\tsolution_equation_3_div_copy = createDiv(\"\")\n\tsolution_equation_3_div_content_copy = createDiv(\"\")\n\tsolution_equation_3_div_content_copy. parent(solution_equation_3_div_copy)\n\n\t\n\t// Next Button\n\tnext_step_div = createDiv(\"\") \t\t\t\t\t// Change Step Button\n\t// previous Button\n\tprev_step_div = createDiv(\"\") \t\t\t\t\t// Change Step Button\n\t\n\t// set parent \n\tquestion_div_content. parent(question_div)\t\t\t\t\t\t\t\t//Question could place\t\n\tsolution_equation_1_div_content. parent(solution_equation_1_div)\n\tsolution_equation_2_div_content. parent(solution_equation_2_div)\n\tsolution_equation_3_div_content. parent(solution_equation_3_div)\n\tapply_box_content. parent(apply_box)\n\n\tseprate_line. style(\"background-color\" , \"rgb(102 , 102 , 102)\")\n\tseprate_line2. style(\"background-color\" , \"rgb(102 , 102 , 102)\")\n\tapply_line. style(\"background-color\" , \"rgb(102 , 102 , 102)\")\n\t// #SET PROPERTIES\n\tquestion_div. style(\"position\" , \"absolute\")\n\tsolution_equation_1_div. style(\"position\" , \"absolute\")\n\tsolution_equation_2_div. style(\"position\" , \"absolute\")\n\tsolution_equation_3_div. style(\"position\" , \"absolute\")\n\n\tquestion_div_content. style(\"position\" , \"absolute\")\n\tquestion_div_content. style(\"text-align\" , \"center\");\n\tquestion_div_content. style(\"top\" , \"50%\");\n\tquestion_div_content. style(\"left\" , \"50%\");\n\tquestion_div_content. style(\"transform\" , \"translate(-50% , -50%)\")\n\tquestion_div_content. style(\"font-size\" , font_size+\"px\")\n\n\tsolution_equation_1_div_content. style(\"position\" , \"absolute\")\n\tsolution_equation_1_div_content. style(\"text-align\" , \"center\");\n\tsolution_equation_1_div_content. style(\"top\" , \"50%\");\n\tsolution_equation_1_div_content. style(\"transform\" , \"translate(0% , -50%)\")\n\tsolution_equation_1_div_content. style(\"font-size\" , font_size+\"px\")\n\n\tsolution_equation_2_div_content. style(\"position\" , \"absolute\")\n\tsolution_equation_2_div_content. style(\"text-align\" , \"center\");\n\tsolution_equation_2_div_content. style(\"top\" , \"50%\");\n\tsolution_equation_2_div_content. style(\"transform\" , \"translate(0% , -50%)\")\n\tsolution_equation_2_div_content. style(\"font-size\" , font_size+\"px\")\n\n\tsolution_equation_3_div_content. style(\"position\" , \"absolute\")\n\tsolution_equation_3_div_content. style(\"text-align\" , \"center\");\n\tsolution_equation_3_div_content. style(\"top\" , \"50%\");\n\tsolution_equation_3_div_content. style(\"transform\" , \"translate(0% , -50%)\")\n\tsolution_equation_3_div_content. style(\"font-size\" , font_size+\"px\")\n\n\tapply_box_content. style(\"position\" , \"absolute\")\n\t// apply_box_content. style(\"text-align\" , \"center\");\n\tapply_box_content. style(\"top\" , \"50%\");\n\tapply_box_content. style(\"text-align\" , \"center\")\n\tapply_box_content. style(\"left\" , \"20%\")\n\t// apply_box_content. style(\"right\" , \"20%\")\n\tapply_box_content. style(\"transform\" , \"translate( -10% , -50%)\")\n\n\t// Copy div set properties\n\n\tsolution_equation_1_div_copy. style(\"position\" , \"absolute\")\n\tsolution_equation_2_div_copy. style(\"position\" , \"absolute\")\n\tsolution_equation_3_div_copy. style(\"position\" , \"absolute\")\n\n\tsolution_equation_1_div_content_copy. style(\"position\" , \"absolute\")\n\tsolution_equation_1_div_content_copy. style(\"text-align\" , \"center\");\n\tsolution_equation_1_div_content_copy. style(\"top\" , \"50%\");\n\tsolution_equation_1_div_content_copy. style(\"transform\" , \"translate(0% , -50%)\")\n\tsolution_equation_1_div_content_copy. style(\"font-size\" , font_size+\"px\")\n\n\tsolution_equation_2_div_content_copy. style(\"position\" , \"absolute\")\n\tsolution_equation_2_div_content_copy. style(\"text-align\" , \"center\");\n\tsolution_equation_2_div_content_copy. style(\"top\" , \"50%\");\n\tsolution_equation_2_div_content_copy. style(\"transform\" , \"translate(0% , -50%)\")\n\tsolution_equation_2_div_content_copy. style(\"font-size\" , font_size+\"px\")\n\n\tsolution_equation_3_div_content_copy. style(\"position\" , \"absolute\")\n\tsolution_equation_3_div_content_copy. style(\"text-align\" , \"center\");\n\tsolution_equation_3_div_content_copy. style(\"top\" , \"50%\");\n\tsolution_equation_3_div_content_copy. style(\"transform\" , \"translate(0% , -50%)\")\n\tsolution_equation_3_div_content_copy. style(\"font-size\" , font_size+\"px\")\n\n\tnext_step_div. style(\"background-image\" , \"url('img/Arrow.png')\");\n\tnext_step_div. style(\"repeat\" , \"none\")\n\tnext_step_div. style(\"z-index\" , \"5\")\n\tnext_step_div. style(\"cursor\" , \"pointer\")\n\n\tprev_step_div. style(\"background-image\" , \"url('img/Arrow.png')\");\n\tprev_step_div. style(\"repeat\" , \"none\")\n\tprev_step_div. style(\"z-index\" , \"5\")\n\tprev_step_div. style(\"cursor\" , \"pointer\")\n\tprev_step_div. style(`transform-origin`, `50% 50%`)\n \tprev_step_div. style(\"transform\" , \"rotate(180deg)\")\n\n\treset_btn. style(\"background-image\" , \"url('img/reset.png')\");\n\treset_btn. style(\"background-repeat\" , \"none\");\n\treset_btn. style(\"z-index\" , \"1\");\n\treset_btn. hide();\n\n\tgo_to_exercise. style(\"background-image\" , \"url('img/go_to_exercise.png')\");\n\tgo_to_exercise. style(\"background-repeat\" , \"none\");\n\tgo_to_exercise. style(\"z-index\" , \"1\");\n\tgo_to_exercise. style(\"cursor\" , \"pointer\")\n\tgo_to_exercise. hide();\n\n\tapply_box. style(\"background-image\" , \"url('img/ref_applybg.png')\");\n\tapply_box. style(\"background-repeat\" , \"none\");\n\tapply_box. style(\"z-index\" , \"1\");\n\tapply_box. hide();\n\n\t// #MOUSE EVENTS:\n\n\t// When click on arrow btn then chnage the step\n\t// Next btn Events\t\n\tnext_step_div. mouseClicked(function (){\n\t\tnext_step_div. hide();\n\t\tforce_to_animation_stop = false;\n\t\t// length_exp_btn = \n\t\tfor(var i = 0; i < position_exp_btn_list. length; i++){\n\t\t\tif(eval(`mathInteractiveContentCopy. page_${ Tab }. ${equation_index}. solution. step_${current_step}. type`) != \"law\"){\n\t\t\t\teval(`dynamic_exp_btn_${i}. remove()`)\n\t\t\t}\n\t\t}\n\t\tconsole. log(\"exp btn removed\")\n\t\t// console. log(position_exp_btn_list)\n\t\tcurrent_step ++;\n\t\tif(current_step > 1){\n\t\t\t// animation_start = true;\n\t\t\t// starting_time = new Date() . getTime();\n\t\tanimation_completed = false\n\t\t\tclick_next = true\n\t\t}\n\t\tshow_next_btn = false\n\t\tshow_apply_btn = false;\n\t\tclicked_apply_btn = false\n\t\tintractiveText(createExpandBtn);\n\t\tsolution_equation_3_div. hide();\n\t\tsolution_equation_3_div_copy. hide();\n\t\tconsole. log(position_exp_btn_list)\n\t\t// solution_equation_2_div. hide();\n\t\t// solution_equation_2_div_copy. hide();\n\t\t// solution_equation_1_div. hide();\n\t\t// solution_equation_1_div_copy. hide();\n\t\t// expand_btn_remove = 0\n\t})\n\tnext_step_div. mouseOver( function (){\n\t\thoverNext_btn = true;\n\t\t// \n\t})\n\tnext_step_div. mouseOut( function (){\n\t\thoverNext_btn = false;\n\t\t// \n\t})\n\n\tprev_step_div. mouseClicked(function (){\n\t\tpreviousBtn();\n\t})\n\tprev_step_div. mouseOver( function (){\n\t\thoverPrev_btn = true;\n\t\t// \n\t})\n\tprev_step_div. mouseOut( function (){\n\t\thoverPrev_btn = false;\n\t\t// \n\t})\n\n\treset_btn. mouseOver(function(){\n\t\treset_btn. style(\"cursor\" , \"pointer\")\n\t\thoverReset_btn = true\n\t})\n\treset_btn.mouseOut( function (){\n\t\thoverReset_btn = false\n\t})\n\n\treset_btn. mouseClicked ( function (){\n\t\thoverReset_btn = false\n\t\tsetTimeout( function (){\n\t\t\thoverReset_btn = true;\n\t\t\treset_page();\n\t\t} , 200)\n\t})\n\n\tgo_to_exercise. mouseClicked(function(){\n\t\thoverGoToBtn = false\n\t\tsetTimeout(function (){\n\t\t\thoverGoToBtn = true\n\t\t} , 200)\n\t\tcurrent_step = 1\n\t\tEXERCISE = true\n\t\tsetExe_div();\n\t\tgo_to_exercise. hide()\n\t\t// alert(\"Under Development!!!\")\n\t})\n\tgo_to_exercise. mouseOver(function (){\n\t\thoverGoToBtn = true\n\t})\n\tgo_to_exercise. mouseOut(function (){\n\t\thoverGoToBtn = false\n\t})\n\t\n\t//---------Pagination Button----------//\n\t\tpage = createDiv(\"\");\n\t\tpage. style(\"position\" , \"absolute\");\n\t\tpage. hide();\n\n\t\tpageLeft = createDiv(\"\"); //<\n\t\tpageLeft. style(\"background-image\" , \"url('img/prev.png')\");\n\t\tpageLeft. style(\"cursor\" , \"pointer\")\n\t\tpageLeft. parent(page);\n\t\tpageLeft. hide();\n\n\t\tpageRight = createDiv(\"\"); //<\n\t\tpageRight. style(\"background-image\" , \"url('img/prev.png')\");\n\t\tpageRight. parent(page);\n\t\tpageRight. style(\"cursor\" , \"pointer\")\n\t\tpageRight. hide();\n\n\t\tfor(var k = 1 ; k <= count_pg ;k++){\n\t\t\teval(`\n\t\t\t\t\tif(k == 1){\n\t\t\t\t\t\tpage1 = createDiv(\"\"); //1\n\t\t\t\t\t\tpage1. style(\"background-image\" , \"url('img/keyselect.png')\");\n\t\t\t\t\t\tpage1. parent(page);\n\t\t\t\t\t\tpage1. hide();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tpage${k} = createDiv(\"\"); //1\n\t\t\t\t\t\tpage${k}. style(\"background-image\" , \"url('img/key.png')\");\n\t\t\t\t\t\tpage${k}. parent(page);\n\t\t\t\t\t\tpage${k}. hide();\n\t\t\t\t\t}\n\t\t\t\t`)\n\t\t}\n\n\t\t// page1 = createDiv(\"\"); //1\n\t\t// page1. style(\"background-image\" , \"url('img/keyselect.png')\");\n\t\t// page1. parent(page);\n\t\t// page1. hide();\n\n\t\t// page2 = createDiv(\"\"); //2\n\t\t// page2. style(\"background-image\" , \"url('img/key.png')\");\n\t\t// page2. parent(page);\n\t\t// page2. hide();\n\n\t\t// page3 = createDiv(\"\");//3\n\t\t// page3. style(\"background-image\" , \"url('img/key.png')\");\n\t\t// page3. parent(page);\n\t\t// page3. hide();\n\n\n\t\tfor( i = 1; i <= count_pg ; i++){\n\t\t\ttemp_i = i;\n\t\t\t// console. log(temp_i)\n\t\t\teval(`var temp_${i} = i`)\n\t\t\t// eval(`temp_${i} `)\n\t\t\teval(`page${temp_i}. mouseOver( function (){\n\t\t\t\t// console. log(\"hover\")\n\t\t\t\tif(Tab != temp_${i}){\n\t\t\t\t\tpage${eval(`temp_${i} `)}. style(\"cursor\" , \"pointer\")\n\t\t\t\t\tpage${eval(`temp_${i} `)}. style(\"background-image\" , \"url('img/keyover.png')\")\n\t\t\t\t}\n\t\t\t})\n\t\t\tpage${temp_i}. mouseOut( function (){\n\t\t\t\tif(Tab != temp_${i}){\n\t\t\t\t\tpage${eval(`temp_${i} `)}. style(\"background-image\" , \"url('img/key.png')\")\n\t\t\t\t}\n\t\t\t})\n\t\t\tpage${temp_i}. mouseClicked( function (){\n\t\t\t\tif(Tab != temp_${i}){\n\t\t\t\t\treset_key();\n\t\t\t\t\t// console. log(Tab , \"tab\")\n\t\t\t\t\tTab = temp_${i};\n\t\t\t\t\tconsole. log(temp_${i})\n\t\t\t\t\tpage${eval(`temp_${i} `)}. style(\"background-image\" , \"url('img/keyselect.png')\")\n\t\t\t\t\tpage${eval(`temp_${i} `)}. style(\"cursor\" , \"default\")\n\t\t\t\t\treset_page();\n\t\t\t\t}\n\t\t\t})\n\t\t\t`)\n\t\t}\n\n\t\tpageRight. mouseClicked( function (){\n\t\t\tif(Tab != count_pg){\n\t\t\t\treset_key();\n\t\t\t\tTab ++;\n\t\t\t\tif(Tab == count_pg){\n\t\t\t\t\tpageRight. style(\"cursor\" , \"default\")\n\t\t\t\t\thoverRight == false\n\t\t\t\t}\n\t\t\t\teval(`page${Tab}. style(\"background-image\" , \"url('img/keyselect.png')\") `)\n\t\t\t\treset_page();\n\t\t\t\t\n\t\t\t}\n\t\t})\n\t\tpageRight. mouseOver( function (){\n\t\t\tif(Tab == count_pg){\n\t\t\t\thoverRight = false\n\t\t\t\tpageRight. style(\"cursor\" , \"default\")\n\t\t\t\t// pageRight. style(\"pointer-events\" , \"none\")\n\t\t\t}else{\n\t\t\t\tpageRight. style(\"cursor\" , \"pointer\")\n\t\t\t\thoverRight = true\n\t\t\t}\n\t\t})\n\t\tpageRight. mouseOut(function (){\n\t\t\thoverRight = false;\n\t\t})\n\t\tpageLeft. mouseOut(function (){\n\t\t\thoverLeft = false;\n\t\t})\n\n\t\tpageLeft. mouseClicked( function (){\n\t\t\tif(Tab !== 1){\n\t\t\t\treset_key();\n\t\t\t\tTab --;\n\t\t\t\tif(Tab == 1){\n\t\t\t\t\thoverLeft = false\n\t\t\t\t\tpageLeft. style(\"cursor\" , \"default\")\n\t\t\t\t}\n\t\t\t\teval(`page${Tab}. style(\"background-image\" , \"url('img/keyselect.png')\") `)\n\t\t\t\treset_page();\n\t\t\t\t\n\t\t\t}\n\t\t})\n\t\tpageLeft. mouseOver( function (){\n\t\t\tif(Tab == 1){\n\t\t\t\thoverLeft = false\n\t\t\t\tpageLeft. style(\"cursor\" , \"default\")\n\t\t\t\t// pageLeft. style(\"pointer-events\" , \"none\")\n\t\t\t}else{\n\t\t\t\thoverLeft = true\n\t\t\t\tpageLeft. style(\"cursor\" , \"pointer\")\n\t\t\t\t// pageLeft. style(\"pointer-events\" , \"auto\")\n\t\t\t}\n\t\t})\n\n\t/*\\\\(\\\\newcommand{ \\\\scdot }{ {\\\\cdot} }*/ \n\t// create New comand remove extra space\n\tnew_cmd = createDiv(\"\")\n\tnew_cmd. html(`(\\\\ \\\\(\\\\newcommand{ \\\\scdot }{ {\\\\cdot} } \\\\)`) \n\tMathJax. Hub. Queue( [\"Typeset\",MathJax.Hub] , function (){\n\t\tnew_cmd. show();\n\t\twait_new_cmd = false;\n\t})\n\t\t\n}", "title": "" }, { "docid": "d6a12600fd80b75eafdcc7d140f4d9b2", "score": "0.62157667", "text": "function questionPage(){\n return `\n <div class=\"noBorder\">\n <img src=${store.questions[store.questionNumber].image}><div class=\"group\">\n <div class=\"item\"> <p>Question ${store.questionNumber + 1} of 8</p>\n </div>\n <div class=\"item\"><p>Score: ${store.score}</p>\n </div>\n </div>\n <div class=\"container\">\n <form id=\"js-questions-form\">\n <h3>${store.questions[store.questionNumber].question}</h3>\n <input type=\"radio\" name=\"option\" value=\"${store.questions[store.questionNumber].answers[0]}\">\n <label for=\"ansOpt\">${store.questions[store.questionNumber].answers[0]}</label></br>\n <input type=\"radio\" name=\"option\" value=\"${store.questions[store.questionNumber].answers[1]}\">\n <label for=\"ansOpt\">${store.questions[store.questionNumber].answers[1]}</label></br>\n <input type=\"radio\" name=\"option\" value=\"${store.questions[store.questionNumber].answers[2]}\">\n <label for=\"ansOpt\">${store.questions[store.questionNumber].answers[2]}</label></br>\n <input type=\"radio\" name=\"option\" value=\"${store.questions[store.questionNumber].answers[3]}\">\n <label for=\"ansOpt\">${store.questions[store.questionNumber].answers[3]}</label></br>\n <button class=\"enter-answer\"><span class=\"button-label\">Submit</span></button>\n </form></div></div>\n`\n}", "title": "" }, { "docid": "6ae4cac5a1cc6d6bba6bee71661e2d27", "score": "0.6214127", "text": "function buildQuiz() {\n // we'll need a place to store the HTML output\n const output = [];\n\n // for each question...\n myQuestions.forEach(\n (currentQuestion, questionNumber) => {\n\n const answers = [];\n\n for (letter in currentQuestion.answers) {\n\n answers.push(`<label><input type=\"radio\" name=\"question${questionNumber}\" value=\"${letter}\">\n ${letter} :\n ${currentQuestion.answers[letter]}\n </label>`\n );\n }\n\n // add this question and its answers to the output\n output.push(\n `<div class=\"question\"> ${currentQuestion.question} </div>\n <div class=\"answers\"> ${answers.join('')} </div>`\n );\n }\n );\n // place quiz into html\n quizContainer.innerHTML = output.join('');\n }", "title": "" }, { "docid": "d94b19625af925efcb4ca91fc25af950", "score": "0.6213561", "text": "function generateQuestionReviewView() {\r\n let question = store.questions[store.questionNumber];\r\n let html = `\r\n <div id=\"question-page\">\r\n <div id=\"question-count\">Question ${store.questionNumber + 1} of ${store.questions.length}</div>\r\n <h2 id=\"question\">${question.question}</h2>\r\n <h3> You got the question ${(question.correctAnswer === store.submittedAnswer) ? 'correct!' : 'wrong!'}</h3>\r\n <ul id=\"answers-results\">`;\r\n //For each answer, check if it's right or wrong and highlight it appriorately\r\n question.answers.forEach(answer => {\r\n //answer right\r\n if(answer === question.correctAnswer) {\r\n html += `<li class=\"correct-answer\">${answer}</li>`;\r\n }\r\n //answer wrong and user selected\r\n else if(answer !== question.correctAnswer && answer === store.submittedAnswer) {\r\n html += `<li class=\"wrong-answer\">${answer}</li>`;\r\n }\r\n //answer wrong\r\n else {\r\n html += `<li>${answer}</li>`;\r\n }\r\n });\r\n html += `\r\n </ul>\r\n <div>\r\n <p id=\"count\">Score: ${store.score} out of ${store.questions.length}</p>\r\n <button id=\"next\">${(store.questionNumber < store.questions.length - 1) ? 'NEXT' : 'FINISH'}</button>\r\n </div>\r\n </div>`;\r\n return html;\r\n}", "title": "" }, { "docid": "6d6773feae809516ce95dc667e058338", "score": "0.61991435", "text": "function displayQuestions() {\t\n\t\tvar questionText = '';\n\t\tfor (var i=0; i<quiz.trivia.length; i++) {\n\t\t\tvar answerOptions = '';\n\t\t\tquestionText = '<div class=\"bold-text center\">' + quiz.trivia[i].question + '</div>';\n\n\t\t\tfor(var a=0; a < quiz.trivia[i].answers.length; a++) {\n \tanswerOptions += '<input class=\"answer js-choice\" type=\"radio\" name=\"' + i +'\" data-name=\"'+ \n \tquiz.trivia[i].answers[a] +'\">' + quiz.trivia[i].answers[a] + '</input>';\n }\n\n \t$('#js-quiz').append('<div class=\"question center\">' + questionText + answerOptions + '</div>');\n\t\t}\n\t}", "title": "" }, { "docid": "f98ec7a9ac0a9b0967d84008e43d4beb", "score": "0.61982125", "text": "function questionResult() {\n deleteChildren()\n //display the picture--picture displayed depends on the integer in the questionSelector\n var isAnswerCorrect = $(\"<p>\")\n if (answerIsCorrect == true) {\n isAnswerCorrect.text(\"Correct!\");\n } else {\n isAnswerCorrect.text(\"Nope!\");\n }\n var resultText = $(\"<p>\");\n resultText.text(triviaObject.explanations[questionSelector]);\n var brak = $(\"<br>\")\n var resultPic = $(\"<img>\");\n resultPic.attr(\"src\", triviaObject.pictures[questionSelector]);\n //I chose a button instead of a timer, because a timer felt rushed between questions. A button allows the player to play at their own pace.\n var nextButton = $(\"<button>\");\n nextButton.addClass('btn btn-info')\n nextButton.text(\"Next Question\");\n //appends everything in the right order\n $(\"#current-question\").append(isAnswerCorrect, resultText, resultPic, brak, nextButton);\n \n nextButton.on(\"click\", function() {\n if (questionSelector == 4) {\n deleteChildren();\n finalScreen();\n } else {\n \n questionSelector++;\n resetClock();\n currentQuestion();\n makeAnswers();\n };\n });\n }", "title": "" }, { "docid": "42b6f778dcbe20247bea7c4908f077b5", "score": "0.618762", "text": "function displayQuestion() {\n \n var question = $(\"<div></div>\", {class: 'question'});\n var questionObj = questions[curIndex];\n var text = $(\"<div class='questionText'></div>\").append((curIndex+1), \". \", questionObj.questionText);\n \n question.append(text);\n \n\n //display answer options\n var options = $(\"<div></div>\", {class: 'options'});\n for (var i = 0; i < questionObj.options.length; i++) {\n var option = $(\"<div></div>\", {class: 'option'});\n var radio = $(\"<input>\", {type: \"radio\", \n name: \"choice\" + curIndex, \n value: questionObj.options[i]}); \n option.append(radio, \" \", questionObj.options[i]);\n options.append(option);\n }\n \n var answerFeedback = $(\"<span></span>\", {class: 'feedback'});\n var checkAns = $(\"<button></button>\", {class: 'check',\n text: \"Check Answer\"});\n var nextQuestion = $(\"<div></div>\", {class: 'nextQ'});\n var next = $(\"<button></button>\", {class: 'next', text: 'next'});\n \n checkAns.on(\"click\", getAnswers);\n \n next.on(\"click\", nextQuestions);\n nextQuestion.append(next);\n \n $(\".quiz\").append(question, options, checkAns, answerFeedback, nextQuestion);\n }", "title": "" }, { "docid": "a397f07c25184ee6733c83f28a2539ed", "score": "0.61840534", "text": "function createQuestionsPages(questionsData) {//questionsData = {data: [array of 10 question objects at most]}\n const container = document.createElement('container');\n for (let i = 0; i < questionsData.data.length; i++) {\n\n const h3 = document.createElement('h3');\n h3.innerText = questionsData.data[i].question;\n container.appendChild(h3);\n\n if (questionsData.data[i].answer) {//answer is not empty(there is answer)\n const p = document.createElement('p');\n p.innerText = questionsData.data[i].answer;\n container.appendChild(p);\n } else {\n const input = document.createElement('input');\n const br = document.createElement('br');\n input.type = 'text';\n input.classList.add('answer-box');\n input.placeholder = 'Answer here';\n input.id = questionsData.data[i].id;\n container.appendChild(input);\n container.appendChild(br);\n }\n if (i != questionsData.data.length - 1) {\n const hr = document.createElement('hr');\n container.appendChild(hr);\n }\n }\n return container;\n}", "title": "" }, { "docid": "9497c47299f5e285fa9ff307a655a9dc", "score": "0.61832494", "text": "function slidesFor(cohortKey) {\n const students:CohortT = cohorts[cohortKey];\n\n var slides:[QuestionT] = [];\n slides.push({ type: 'Overview', el:\n <div>\n <div>1. Review context</div>\n <div>Imagine yourself giving feedback to students on Explore Performance Tasks that they've just finished and submitted. You won't know all the answers, and will have to improvise and adapt to make the best of the situation.</div>\n <br />\n <div>2. Anticipate</div>\n <div>Skim the project assignment. You shouldn't have an in-depth understanding.</div>\n <br />\n <div>3. Try it!</div>\n <div>When you're ready, you'll go through a set of short scenes that simulate interactions between you and some students about their projects.</div>\n <br />\n <div>4. Reflect</div>\n <div>Finally, you'll reflect on your experience.</div>\n <br />\n <div>5. Discussion</div>\n <div>When you're done here, share your responses with your cohort on online at <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://twitter.com/search?q=%23https://twitter.com/search?q=%23TeacherPracticeSpaces\">#TeacherPracticeSpaces</a>.</div>\n </div>\n });\n\n\n // Context\n slides.push({ type: 'Context', text:\n`For this assignment, you'll be helping out another teacher in the school, Ms. Ada. This takes place in an urban public high school, towards the end of the school year.\n\nMs. Ada is teaching an AP Computer Science Principles class and asked you to help out. Her students have worked on the Explore Performance Task and already submitted it to the College Board. While they're waiting for formal feedback and scores, Ms. Ada wants to give them an opportunity to get more immediate feedback and on their project.\n\nThis isn't your class, so you so you won't have all the answers and will have to improvise and make the best of the situation.\n`});\n\n slides.push({ type: 'Context', text:\n`Here's a description of the assignment:\n\nComputing innovations impact our lives in ways that require considerable study and reflection for us to fully understand them. In this Performance Task, you will explore a computing innovation of your choice. Your close examination of this computing innovation will deepen your understanding of computer science principles.\n`});\n\n slides.push({ type: 'Context', text:\n`There are two parts of the performance task: a computational artifact and written responses.\n\nThe computational artifact must provide an illustration, representation, or explanation of the computing innovation’s intended purpose, its function or its effect. The computational artifact must not simply repeat the information supplied in the written responses and should be primarily non‐textual.\n\nThe written responses must provide evidence of the extensive knowledge they have developed about their chosen computing innovation and its impact. Responses should be understandable to someone who is not familiar with the computing innovation, and include citations as applicable.\n`});\n\n slides.push({ type: 'Context', text:\n`In this scenario, you'll look at projects for five students. You'll share two questions that their project left your with. These are intended to reflect your genuine curiosity and interest in their project, or to help engage them with an interesting aspect of the topic.\n\nThen, you'll provide written feedback that will be submitted anonymously and also score their project. Each project will receive a score of 0-7 points. The categories for points are:\n\n 3 pts: Analyzing Impact of Computing\n 2 pts: Analyzing Data and Information\n 1 pt: Using Development Processes & Tools\n 1 pt: Finding and Evaluating Information\n\nThese point categories will be visible to you during the scenario as well.\n`});\n\n slides.push({ type: 'Context', text:\n`Here's an example of what the scoring and feedback sheet will look like for each student. Feel free to try it out.\n`, scores, studentName: 'this example', projectLabel: 'demo'});\n\n\n // Anticipate\n slides.push({ type: 'Anticipate', text:\n`Before you begin, we have three questions about what you anticipate.\n`});\n\n slides.push({ type: 'Anticipate', text:\n`After skimming the performance task, what do you anticipate students' projects will be like?\n`, ask: true, force: true});\n\n slides.push({ type: 'Anticipate', text:\n`What ways might bias inadvertently come up when asking questions about the projects and sharing feedback?\n`, ask: true, force: true});\n\n slides.push({ type: 'Anticipate', text:\n`What are some best case and worst case outcomes for students during this scenario?\n`, ask: true, force: true});\n\n\n // Try it!\n slides.push({ type: 'Try it!', text:\n`When you're ready, you'll go through a set of scenes. Imagine you're walking around the classroom, and meeting with each student individually. \n\nIn the simulation, you'll visit one student, ask them a question about their project intended to express interest, evoke curiosity, or get them excited about computing. Then, you'll thank them and walk away to complete written feedback.\n\nImprovise how you would act as a teacher in those moments. Click and speak aloud the words you'd say to those students, and type the written feedback you'd share with them.\n\n\nReady to start?\n`});\n\n slides = slides.concat(interactionSlides(students.A, projects.A)); \n slides = slides.concat(interactionSlides(students.E, projects.E));\n slides = slides.concat(interactionSlides(students.C, projects.C));\n slides = slides.concat(interactionSlides(students.D, projects.D));\n\n\n // Reflect\n slides.push({ type: 'Reflect', text:\n`That's the end of the simulation. Thanks!\n\nLet's shift to reflecting on your experience.\n`});\n\n slides.push({ type: 'Reflect', text:\n`Before you finish, we have four questions about what you experienced in this simulation.\n\nAfter that, you'll take some of your reflection and share it with your cohort.\n\nAlso, for now please hold questions or feedback about this activity itself.\n`});\n\n slides.push({ type: 'Reflect', text:\n`Which projects did you score the highest and lowest?\n`, writtenReflection: true});\n\n slides.push({ type: 'Reflect', text:\n`What kinds of feedback did you give?\n`, writtenReflection: true});\n\n slides.push({ type: 'Reflect', text:\n`Where did you struggle in grading student work?\n`, writtenReflection: true});\n\n slides.push({ type: 'Reflect', text:\n`Were there ways where bias could have inadvertently come up when asking questions about the projects and sharing feedback?\n`, writtenReflection: true});\n\n slides.push({ type: 'Reflect', el:\n <div>\n <div>Finally, on the next screen you can review your reflections before sharing back with your cohort (eg., on a discussion board or in class).</div>\n <br />\n <div>If you'd like, you can also share online at <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://twitter.com/search?q=%23https://twitter.com/search?q=%23TeacherPracticeSpaces\">#TeacherPracticeSpaces</a>.</div>\n <br />\n <div>And if you're curious to learn more, check out the commentaries on these projects and scoring guidelines from the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"http://apcentral.collegeboard.com/apc/public/exam/exam_information/231726.html\">College Board</a>.</div>\n </div>\n });\n\n return slides;\n}", "title": "" }, { "docid": "e1450561fb67d14ed9728e581aee0d47", "score": "0.6163633", "text": "function setupQuestion() {\n // find out the current percentage of completion and updates the css\n var progress = 20 + currentQn * 20;\n var progressbar = document.getElementById(\"progress\");\n progressbar.style.width = progress + \"%\";\n progressbar.innerText = currentQn + 1 + \"/5\";\n\n // get the current questions content\n var qn = questions[\"question\" + currentQn];\n var qnText = document.getElementById(\"question\");\n qnText.innerText = qn.question;\n\n // updates each of the options for the current question\n for (var i = 0; i < 4; i++) {\n var option = document.getElementById(\"option\" + i);\n var content = option.getElementsByClassName(\"content\")[0];\n var qnOption = qn[\"option\" + i];\n if (qnOption.type == \"image\") {\n var htmlStr = \"<img src='\" + qnOption.content + \"'>\";\n content.innerHTML = htmlStr;\n } else {\n var htmlStr = \"<p>\" + qnOption.content + \"</p>\";\n content.innerHTML = htmlStr;\n }\n }\n}", "title": "" }, { "docid": "ea83b3e8974caa33b451735a5cb89ab9", "score": "0.61626977", "text": "function generateStart(){\n\t\n\tvar questionsHTML = $(\"<div>\");\n\n\tvar questionDiv = $(\"<div class='questionDiv'>\").text(\"1. \" + questionsArray[questionCount]);\n\tquestionsHTML.append(questionDiv);\n\n\tvar answer1 = $(\"<div class='answer'>\").text(\"A. \" + answersOptions[questionCount][0]);\n\tquestionsHTML.append(answer1);\n\n\tvar answer2 = $(\"<div class='answer'>\").text(\"B. \" + answersOptions[questionCount][1]);\n\tquestionsHTML.append(answer2);\n\n\tvar answer3 = $(\"<div class='answer'>\").text(\"C. \" + answersOptions[questionCount][2]);\n\n\tquestionsHTML.append(answer3);\n\tvar answer4 = $(\"<div class='answer'>\").text(\"D. \" + answersOptions[questionCount][3]);\n\n\tquestionsHTML.append(answer4);\n\t$('.mainArea').html(questionsHTML);\n\t$('.timerArea').show();\n}", "title": "" }, { "docid": "8f92017f557ac8fdb8f3811dac6d870c", "score": "0.6159144", "text": "function createSliderQuestion() {\n\n $slider.slider({\n value: 50\n });\n\n let $sliderType = $sliders[randomIndex(0, $sliders.length - 1)];\n\n if ($sliderType === 'feeling') {\n $nextSliderTitle = setTitles('SLIDER', 'slider');\n // Set slider image source, prevent caching\n $sliderImage.attr('src','https://loremflickr.com/800/400/silly/?random=' + i);\n i++;\n // Apply a random css filter to the slider image\n let $f = ['grayscale(100%)', 'contrast(200%)', 'hue-rotate(90deg)', 'hue-rotate(180deg)'];\n $sliderImage.css('filter', $f[randomIndex(0, $f.length - 1)]);\n // Set slider titles randomly to emoji or kaomoji\n let $t = ['emoji', 'kaomoji'];\n setSliderLabels($t[randomIndex(0, $t.length - 1)]);\n }\n else if ($sliderType === 'agree') {\n // Get random keyword\n $sliderKeyword = $art[randomIndex(0,$art.length - 1)];\n // Set title according to keyword\n $nextSliderTitle = setTitles('AGREESLIDER', $sliderKeyword);\n // Set slider image source, prevent caching\n $sliderImage.attr('src','https://loremflickr.com/800/400/art/?random=' + i);\n i++;\n setSliderLabels('agree');\n\n }\n\n // console.log('next slider: ' + $nextSliderTitle);\n\n}", "title": "" }, { "docid": "b93ce0a2e05a5f26aced70e8bae9d658", "score": "0.61524", "text": "function startExercise() {\n document.body.innerHTML = ''\n document.body.append(exerciseContainer)\n exerciseContainer.style.display = 'flex'\n bringQuestion()\n}", "title": "" }, { "docid": "b49016759c0e6d4726c1cc9feb8e3f0c", "score": "0.6150347", "text": "function makeSlide(ref) {\n let curr = questions[ref];\n $(actionBlock).append(\"<form></form>\");\n let slide = $(\"form\");\n //makes el with id ref\n slide.addClass(ref);\n //make question\n $(slide).append(\"<h1>\" + curr.question + \"<h1>\");\n //make options\n for (let i = 0; i < curr.options.length; i++) {\n $(slide).append(\n $(\n \"<button class='option' name='question' value='\" +\n curr.options[i] +\n \"'>\" +\n curr.options[i] +\n \"</button>\"\n )\n );\n }\n $(slide).append(\"<h3 class='answerDisplay'><h1>\");\n\n //onclick submit button\n $(\"button\").on(\"click\", (e) => {\n e.preventDefault();\n handleSubmit(e);\n });\n //TODO: add transition animation\n}", "title": "" }, { "docid": "8dfc93e44eeebad4a183c77ad01b2053", "score": "0.614867", "text": "render() {\n\n\t\t// Update the progressbar view first which is the quickest in term of DOM.\n\t\tthis.renderProgressBar();\n\n\t\t// Filter the questions.\n\t\tvar questions = this.questionCollection.getFilteredQuestions(this.isShortVersion);\n\t\tvar counter = questions.length;\n\n\t\t// Render intermediate content in a temporary DOM.\n\t\tvar container = document.createDocumentFragment();\n\t\tfor (let question of questions) {\n\t\t\tlet content = this.renderOne(question, counter);\n\t\t\tcontainer.appendChild(content);\n\t\t\tcounter--;\n\t\t}\n\n\t\t$('#container-question-list').html(container);\n\t\tthis.linkToDirectoriesIfAllQuestionsAnswered();\n\t\tthis.defineQuestionnaireVisibility();\n\t}", "title": "" }, { "docid": "6d9e24bcbeb9267a369e2819cd87a2d5", "score": "0.6146554", "text": "function runQuestions(){\n console.log(quizQuestions[qIndex])\n var thisQuestion = quizQuestions [qIndex]\n console.log(thisQuestion.question)\n var questionDisplay = document.createElement(\"h3\")\n questionDisplay.textContent = thisQuestion.question\n currentQuestion.appendChild(questionDisplay)\n var answer1 = document.createElement (\"p\")\n answer1.textContent = thisQuestion.choiceA\n currentQuestion.appendChild(answer1)\n var answer2 = document.createElement (\"p\")\n answer2.textContent = thisQuestion.choiceB\n currentQuestion.appendChild(answer2)\n var answer3 = document.createElement (\"p\")\n answer3.textContent = thisQuestion.choiceB\n currentQuestion.appendChild(answer3)\n var answer4 = document.createElement (\"p\")\n answer4.textContent = thisQuestion.choiceB\n currentQuestion.appendChild(answer4)\n \n\n\n \n }", "title": "" }, { "docid": "b342494ff1f4efe5978ed8d36fba06b4", "score": "0.61422", "text": "function createQuestion(questions) {\n for (var i = 0; i < questions.length; i++) {\n $(\".start\").hide();\n $(\"#questions\").append('<form id=\"' + i + '\" class=\"center-text\"><p>Question ' + (i + 1) + ' of ' + questions.length + '</p><h3 class=\"question\">' + questions[i].q + '</h3>' + radioButtons(questions[i].s, i) + '<button type=\"submit\" class=\"next\">NEXT &#8594;</button></p></form>');\n }\n //This hides all except the first question:\n for (var k = questions.length - 1; k > 0; k--) {\n $('#' + k).hide();\n }\n }", "title": "" }, { "docid": "b9cc3a937435f7eae85995ea7e0ceafb", "score": "0.6140192", "text": "function showQuestions() {\n for (var i = 0; i < questionsArray.length; i++) {\n var questionHTML = getQuestionHTML(questionsArray[i], i + 1)\n $(\"#questions\").append(questionHTML);\n }\n }", "title": "" }, { "docid": "b8fe7febd04478ab53175e6f8220078e", "score": "0.6129856", "text": "function main() {\n slideEls = document.querySelectorAll('.presentation > div')\n\n // Set up\n getSlideNumberFromUrlFragment()\n showSlide(true, true)\n onSlideEntry(slideEls[currentSlideNumber], false)\n\n // Specific slide preparations\n prepareFillLoupe()\n underlinePlaygroundPosition({ target: document.querySelector('#upo-p') })\n underlinePlaygroundSize({ target: document.querySelector('#upo-s') })\n underlinePlaygroundClearing({ target: document.querySelector('#upo-c') })\n underlinePlaygroundOpacity({ target: document.querySelector('#upo-o') })\n document.querySelectorAll('label').forEach(function(el) { el.classList.remove('visible') })\n\n // Slide manipulation\n hyphenateSlides()\n setUpBetterPunctuation()\n\n document.body.addEventListener('keydown', onKeyDown)\n document.body.focus()\n}", "title": "" }, { "docid": "a2a9f4ee50b8e076c867ebf8f8cf3989", "score": "0.6128413", "text": "function displayQuestion() {\n for (var i = 0; i < questionArray.length; i++) {\n var div = $(\"<div>\");\n div.text(questionArray[i].question);\n for (var j = 0; j < questionArray[i].choiceList.length; j++) {\n var choiceDiv = $(\"<div>\");\n var label = $(\"<label>\");\n var input = $(\"<input>\");\n label.text(questionArray[i].choiceList[j] + \" \");\n input.attr(\"type\", \"radio\");\n input.attr(\"name\", \"question\"+i);\n input.attr(\"value\", j);\n label.append(input);\n div.append(choiceDiv);\n choiceDiv.append(label);\n }\n\n $(\"#gameArea\").append(div);\n\n }\n }", "title": "" }, { "docid": "b5faabacff38c5577d4d0f3e41004e1b", "score": "0.6121934", "text": "function generateQuestionPage(){\n clearPage();\n $('.noBorder').append(questionPage())\n}", "title": "" }, { "docid": "100beeee55f108d0b84d6e0879e42bd9", "score": "0.61206645", "text": "function loadQuestions() {\n // set timer variable\n // add question dynamically\n // loop to go through questions\n const triviaQuestion = daQuiz[activeQuestion].triviaQuestion;\n const choices = daQuiz[activeQuestion].choices;\n var $question = $(\"<div>\")\n .html(\"<h2>\" + triviaQuestion + \"</h2>\")\n .appendTo($(\".trivia\"));\n\n var $choices = (\"<form>\")\n for (var i = 0; i < choices.length; i++) {\n // create an input tag for radio buttons\n var $radiobutton = $(\"<input>\");\n //css style that shows the radio buttons\n $radiobutton.attr({\n type: \"button\",\n value: choices[i],\n class: \"form-check-input\"\n })\n .appendTo($choices);\n }\n}", "title": "" }, { "docid": "7358bfdb9a3507f36ed8725498a137d4", "score": "0.6115269", "text": "function showNextQA(){\n renderQuestion();\n renderChoices();\n\n}", "title": "" }, { "docid": "6445fdf1cd2e1cd1c12f48fff1ac6298", "score": "0.6106478", "text": "function renderQuestionnaire(){\n reveal.remove();\n const section = document.getElementById('questionnaire');\n let customIndex = 0;//customIndex was made as i tried to use x and i from the loops to keep track\n //of indexing and adding/modifying elements and crashed my own pc in the process\n const qTitle = document.createElement('h1');\n\n qTitle.innerHTML = questionnaireToBeRendered[0].title;\n section.appendChild(qTitle);\n\n for (let i = 0; i < questionnaireToBeRendered.length ; i++){\n const question = document.createElement('h2');\n const newSection = document.createElement('section');\n newSection.id = i;\n\n question.innerHTML = questionnaireToBeRendered[i].question;\n newSection.appendChild(question);\n section.appendChild(newSection);\n \n for (let x = 0; x < questionnaireToBeRendered[customIndex].answers.length; x++){\n\n if (questionnaireToBeRendered[customIndex].answerType == \"text\"){\n const answerText = document.createElement('input');\n\n answerText.type = \"text\";\n answerText.placeholder = 'Enter an answer.';\n answerText.id = \"text\" + uniqueIDCounter;\n answerText.class = \"textClass\";\n textArray.push(answerText);\n\n newSection.appendChild(answerText);\n section.appendChild(newSection);\n }\n\n if (questionnaireToBeRendered[customIndex].answerType == \"radio\"){\n const answerRadio = document.createElement('input');\n const label = document.createElement('label');\n \n answerRadio.type = \"radio\";\n answerRadio.name = 'radio' + customIndex;\n answerRadio.value = 'radio' + customIndex;\n answerRadio.id = \"radio\" + uniqueIDCounter;\n radioArray.push(answerRadio);\n\n label.htmlFor = 'radio' + customIndex;\n label.innerHTML = questionnaireToBeRendered[customIndex].answers[x];\n\n newSection.appendChild(answerRadio);\n newSection.appendChild(label);\n section.appendChild(newSection);\n }\n uniqueIDCounter+=1;\n }\n customIndex+=1;\n uniqueIDCounter+=1; \n }\n const submitAnswers = document.createElement('input');\n submitAnswers.type = 'button';\n submitAnswers.id = \"submitAnswersButton\";\n submitAnswers.value = \"Submit your answers\";\n\n section.appendChild(submitAnswers);\n\n submitAnswers.addEventListener('click', event =>{\n readAnswers();\n sendResultsToServer();\n });\n}", "title": "" }, { "docid": "624c29282d2775399f7904c5db676372", "score": "0.6103055", "text": "function renderQuestion() {\n if (qIndex === 0) {\n $(\".question\").html(questionsArray[qIndex].question);\n $(\"#choice1\").html(\"<h4>\" + questionsArray[qIndex].choices[0] + \"</h4>\");\n $(\"#choice2\").html(\"<h4>\" + questionsArray[qIndex].choices[1] + \"</h4>\");\n $(\"#choice3\").html(\"<h4>\" + questionsArray[qIndex].choices[2] + \"</h4>\");\n $(\"#choice4\").html(\"<h4>\" + questionsArray[qIndex].choices[3] + \"</h4>\");\n };\n if (qIndex === 1) {\n $(\".question\").html(questionsArray[qIndex].question);\n $(\"#choice1\").html(\"<h4>\" + questionsArray[qIndex].choices[0] + \"</h4>\");\n $(\"#choice2\").html(\"<h4>\" + questionsArray[qIndex].choices[1] + \"</h4>\");\n $(\"#choice3\").html(\"<h4>\" + questionsArray[qIndex].choices[2] + \"</h4>\");\n $(\"#choice4\").html(\"<h4>\" + questionsArray[qIndex].choices[3] + \"</h4>\");\n };\n if (qIndex === 2) {\n $(\".question\").html(questionsArray[qIndex].question);\n $(\"#choice1\").html(\"<h4>\" + questionsArray[qIndex].choices[0] + \"</h4>\");\n $(\"#choice2\").html(\"<h4>\" + questionsArray[qIndex].choices[1] + \"</h4>\");\n $(\"#choice3\").html(\"<h4>\" + questionsArray[qIndex].choices[2] + \"</h4>\");\n $(\"#choice4\").html(\"<h4>\" + questionsArray[qIndex].choices[3] + \"</h4>\");\n };\n if (qIndex === 3) {\n $(\".question\").html(questionsArray[qIndex].question);\n $(\"#choice1\").html(\"<h4>\" + questionsArray[qIndex].choices[0] + \"</h4>\");\n $(\"#choice2\").html(\"<h4>\" + questionsArray[qIndex].choices[1] + \"</h4>\");\n $(\"#choice3\").html(\"<h4>\" + questionsArray[qIndex].choices[2] + \"</h4>\");\n $(\"#choice4\").html(\"<h4>\" + questionsArray[qIndex].choices[3] + \"</h4>\");\n };\n if (qIndex === 4) {\n $(\".question\").html(questionsArray[qIndex].question);\n $(\"#choice1\").html(\"<h4>\" + questionsArray[qIndex].choices[0] + \"</h4>\");\n $(\"#choice2\").html(\"<h4>\" + questionsArray[qIndex].choices[1] + \"</h4>\");\n $(\"#choice3\").html(\"<h4>\" + questionsArray[qIndex].choices[2] + \"</h4>\");\n $(\"#choice4\").html(\"<h4>\" + questionsArray[qIndex].choices[3] + \"</h4>\");\n };\n if (qIndex === 5) {\n $(\".question\").html(questionsArray[qIndex].question);\n $(\"#choice1\").html(\"<h4>\" + questionsArray[qIndex].choices[0] + \"</h4>\");\n $(\"#choice2\").html(\"<h4>\" + questionsArray[qIndex].choices[1] + \"</h4>\");\n $(\"#choice3\").html(\"<h4>\" + questionsArray[qIndex].choices[2] + \"</h4>\");\n $(\"#choice4\").html(\"<h4>\" + questionsArray[qIndex].choices[3] + \"</h4>\");\n };\n }", "title": "" }, { "docid": "8e1ce32ab528e2243afb5665311cc072", "score": "0.6102487", "text": "function Questions (name, question, answer, rightAnswer) {\n\t\tthis.name = name;\n\t\tthis.question = question;\n\t\tthis.answer = answer;\n\t\tthis.rightAnswer = rightAnswer;\n\t\n\t//sayAnswer.innerHTML += 'The right answer is ' + '\"' + rightAnswer + '\"';\n\n//creates an div for each question\n\tvar div = document.createElement(\"div\");\n\ttestContent.appendChild(div);\t\n\tdiv.setAttribute(\"id\", name);\n\tdiv.setAttribute(\"class\", \"question\");\n\t\n\t//nextQ = document.getElementById('q1');\n\t\n\t//qClass = div.getAttribute(\"class\");\n\t//qClass += \" hide\";\n\t\n//obj for the question content\n\tthis.createQuestion = function(qName) {\n\t\n\t//create the question with h2\n\th2 = document.createElement(\"h2\");\n\tdiv.appendChild(h2);\n\t\n\t//creates title with question\n\th2.innerHTML = qName.question;\n\t\n\t} // createQuestion END\n\t\n\n//obj for the answer content\n\tthis.createAnswers = function() {\n\t\n\t//create the answers with input, label\n\tinput = document.createElement(\"input\");\n\tinput.setAttribute(\"type\", \"radio\");\n\t\n\tlabel = document.createElement(\"label\");\n\t\n\tdiv.appendChild(input);\n\tdiv.appendChild(label);\n\t\n\t\n\t} // createAnswers END\n\t\n\t\n\t\n//get the answers of the form\n\tthis.eachQuestionAnswer = function() {\n\t\tconsole.log('this is your ' + rightAnswer);\n\t \n\t\t\tfor (var i =0; i < this.answer.length; i++) {\n\t\t \t\tconsole.log(answer[i])\n\t\t \t\t\n\t\t \t}\n\t\t\t\n\t\t} // eachQuestionAnswer END\n\t\t\n\t} // Questions constructor Object END", "title": "" }, { "docid": "3ece0d7f2fe5632c94b8b3c5f66b5d1b", "score": "0.6101939", "text": "function generateQuestions(){\n\t//#1 - Get questions from DB\n\t$.get(\"./server/getQuestions.php\", function(data, status){\n\n\t\tvar questionsList = JSON.parse(data).questions;\n\n\t\t//#2 - add question pages\n\t\tfor(var index = 0; index < questionsList.length; index++){\n\t\t\tvar isLastQuestion = (index === (questionsList.length - 1));\n\t\t\tvar questionTemplate = generateQuestionTemplate(questionsList[index], isLastQuestion);\n\t\t\t\n\t\t\t//add question title to generic Form\n\t\t\tvar e = document.getElementById('questions');\n\t \te.innerHTML += questionTemplate;\n\n\t \t//#3 - add options to questions\n\t \tvar optionsTemplate = generateOptionsTemplate(questionsList[index], questionsList[index].options);\n\t \tvar questionElement = document.getElementById('Options-' + questionsList[index].id);\n\t \tquestionElement.innerHTML = optionsTemplate;\n\n\t\t}\n\n\t\tresetApp();//reset defaults\n\t});\n\n\n\n}", "title": "" }, { "docid": "c17606c47ccb098b757c2b07b5282547", "score": "0.6095627", "text": "function prepareChoicesSlides_() {\n\n choicesSlides = [];\n\n var choicesSl = document.getElementsByClassName('slide-choices');\n\n for (var i = 0; i < choicesSl.length; i++) {\n\n var slide = [],\n answers = choicesSl[i].getElementsByClassName('slide-choices__option-wrapper'),\n answer = null,\n answersArr = [],\n maxScore = getMaxScore(answers),\n score, image, bar;\n\n for (var j = 0; j < answers.length; j++) {\n\n score = answers[j].getElementsByClassName('slide-choices__option-score')[0];\n image = answers[j].getElementsByClassName('slide-choices__option-image')[0];\n bar = answers[j].getElementsByClassName('slide-choices__option-bar')[0];\n\n answer = {\n wrapper: answers[j],\n score: {\n wrapper: score,\n score: parseInt(score.innerHTML),\n bottom: parseInt(0)\n },\n img: {\n wrapper: image,\n height: image ? parseFloat(image.clientWidth) : 0,\n bottom: 0\n },\n bar: {\n wrapper: bar,\n height: parseFloat(bar.clientHeight)\n }\n };\n\n score.addEventListener('change', updateChoicesSlideScore_);\n\n answersArr.push(answer);\n\n }\n\n slide = {\n wrapper: choicesSl[i],\n maxScore: maxScore,\n answers: answersArr,\n inPercents: parseInt(choicesSl[i].getElementsByClassName('results-in-percents')[0].value)\n };\n\n choicesSlides.push(slide);\n updateChoicesSlideView_(slide);\n\n window.matchMedia('(max-width: 992px)').addListener(function () {\n\n updateChoicesSlideView_(slide);\n\n });\n\n }\n\n }", "title": "" }, { "docid": "a334efe266813b7a350ce8ee9ded51fd", "score": "0.6094798", "text": "function main() {\n render();\n quizStartPageStartButton();\n questionSubmitButton();\n resultsResetButton();\n nextQuestionButton();\n}", "title": "" }, { "docid": "70b3d3938290c9c775e4d7c9c3cdf2d2", "score": "0.60933465", "text": "function displayQuestion () {\n hideResults();\n $(\"#answer-holder\").hide();\n $(\"#image-holder\").hide();\n $(\"#time-holder\").show();\n showHolders();\n $(\"#question-holder\").html(question[count]);\n $(\"#question-holder\").fadeToggle(1000).fadeToggle(1000);\n $(\"#question-holder\").css(\"color\",\"red\");\n $(\"#choice-holder-1\").html(firstChoice[count]);\n $(\"#choice-holder-2\").html(secondChoice[count]);\n $(\"#choice-holder-3\").html(thirdChoice[count]);\n $(\"#choice-holder-4\").html(fourthChoice[count]);\n \n // Hover over choices\n $(\"#choice-holder-1\").hover(function() {\n $(this).css(\"color\", \"gray\");\n },\n function(){\n $(this).css(\"color\", \"black\");\n });\n $(\"#choice-holder-2\").hover(function() {\n $(this).css(\"color\", \"gray\");\n },\n function(){\n $(this).css(\"color\", \"black\");\n });\n $(\"#choice-holder-3\").hover(function() {\n $(this).css(\"color\", \"gray\");\n },\n function(){\n $(this).css(\"color\", \"black\");\n });\n $(\"#choice-holder-4\").hover(function() {\n $(this).css(\"color\", \"gray\");\n },\n function(){\n $(this).css(\"color\", \"black\");\n });\n }", "title": "" }, { "docid": "6f1d40854f338ecfd39cefc63e6fc40e", "score": "0.60924757", "text": "function setupQuestionAndOptions() {\n $(\"#question\").html(allQuestions[currentquestion].question);\n var options = allQuestions[currentquestion].options;\n switch (allQuestions[currentquestion].type) {\n case \"rating\":\n $(\"#form\").html(appendRatingHtmlContent(options));\n break;\n case \"boolean\":\n $(\"#form\").html(appendBooleanContent(options));\n $(\".options:eq(0)\").prop(\"checked\", true);\n break;\n case \"text\":\n $(\"#form\").html(appendTextContent());\n break;\n case defualt:\n //$(\"#form\").html(getBooleanOptions(options));\n break;\n }\n }", "title": "" }, { "docid": "0a33d99056c4d53514b18f140c8f7fd3", "score": "0.6092042", "text": "function startQuestions() {\n addQuestion('dragarea', 'fa'); \n addQuestion('dragarea', 'sa');\n addQuestion('dragarea', 'tf');\n addQuestion('dragarea', 'fb');\n addQuestion('dragarea', 'mc');\n addQuestion('dragarea', 'img');\n addQuestion('dragarea', 'txt');\n}", "title": "" }, { "docid": "f209f1980f2034212574f8e38a8a225d", "score": "0.60910636", "text": "function initQ() {\n document.querySelectorAll(\".main\").forEach(main => { main.style.display = \"none\" })\n document.querySelectorAll(\".quiz\").forEach(quiz => { quiz.style.display = \"initial\" })\n quiz(qNum);\n}", "title": "" }, { "docid": "51ad223e16739ccf865736f2723e06ca", "score": "0.6087911", "text": "function layoutHTML5QuizPlayer() {\n\t$j('head').append(\"<link href='/shared/css/Chewy.css' rel='stylesheet' type='text/css'>\");\n\t$j('head').append(\"<link href='/shared/css/base/_icons.css' rel='stylesheet' type='text/css'>\")\n\t$j('body').addClass(\"quiz\");\n\t\n\t$j(\"#contentArea\").append('<div class=\"quizWrapper forceFitNav\" id=\"quizContent\" position:relative;\"></div>');\n\t$j(\"#quizContent\").append('<div class=\"quizHeader\"></div>');\n\t$j(\"#quizContent\").append('<div class=\"quizContent\"></div>')\n\t\n\t$j(\".quizContent\").append('<div class=\"question\"></div>');\n\t$j(\".quizContent\").append('<div class=\"answers\"><ul></ul></div>');\n\t$j(\".quizContent\").append('<div id=\"results\" style=\"display:none;\"></div>');\n\t$j(\".quizContent\").append('<div class=\"pageArrowBack\" id=\"back-page\">Back</div>');\n\t$j(\".quizContent\").append('<div class=\"pageArrowForward\" id=\"forward-page\">Next</div>');\n\t\n\t$j(\".quizHeader\").append('<ul class=\"quizNav\"></ul>');\n\n\tif(!isPreview) {\n\t\t$j(\".quizHeader\").append('<div class=\"bookReference\"></div>');\n\t\tif (!fromAssessment) {\n\t\t\tif ($j('#html5QuizPlayerEnabled').val() == true) {\n\t\t\t\tif ($j('#readResourceDeploymentId').val()) {\n\t\t\t\t var readAgainHref = \"/main/Activity/id/\" + $j('#readResourceDeploymentId').val() + \"/ReadFromQuiz/\" + $j('#quizResourceDeploymentId').val();\n if (activityInfo.studentAssignmentId != \"false\" && $j.isNumeric(activityInfo.studentAssignmentId)) {\n readAgainHref += '/student-assignment-id/' + activityInfo.studentAssignmentId;\n }\n\t\t\t\t\t$j(\".bookReference\").append('<a class=\"returnToBook\" href=\"'+readAgainHref+'\"><span class=\"readAgain\">Read Again</span></a>');\n\t\t\t\t\t$j(\".bookReference\").append('<a class=\"returnToBook\" href=\"'+readAgainHref+'\"><img class=\"bookCover\" id=\"coverImg\" border=\"0\"></img></a>');\n\t\t\t\t} else if ($j('#listenResourceDeploymentId').val()) {\n\t\t\t\t var listenAgainHref = \"/main/Activity/id/\" + $j('#listenResourceDeploymentId').val() + '/ReadFromQuiz/' + $j('#quizResourceDeploymentId').val();\n if (activityInfo.studentAssignmentId != \"false\" && $j.isNumeric(activityInfo.studentAssignmentId)) {\n listenAgainHref += '/student-assignment-id/' + activityInfo.studentAssignmentId;\n }\n\t\t\t\t\t$j(\".bookReference\").append('<a class=\"returnToBook\" href=\"'+listenAgainHref+'\"><span class=\"readAgain\">Read Again</span></a>');\n\t\t\t\t\t$j(\".bookReference\").append('<a class=\"returnToBook\" href=\"'+listenAgainHref+'\"><img class=\"bookCover\" id=\"coverImg\" border=\"0\"></img></a>');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$j(\".bookReference\").attr(\"onclick\", \"toggleQuizContent();\");\n\t\t\t\t$j(\".bookReference\").append('<span class=\"readAgain\">Read Again</span>');\n\t\t\t\t$j(\".bookReference\").append('<img class=\"bookCover\" id=\"coverImg\" border=\"0\"></img>');\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$j(\"#flashVersion\").hide();\n\t\n\t// Make contentArea unhighlightable\n\t$j(\"#contentArea\").css(\"-webkit-user-select\",\"none\");\n\t$j(\"#contentArea\").css(\"-webkit-touch-callout\",\"none\");\n\t$j(\"#contentArea\").css(\"-khtml-user-select\",\"none\");\n\t$j(\"#contentArea\").css(\"-moz-user-select\",\"none\");\n\t$j(\"#contentArea\").css(\"-ms-user-select\",\"none\");\n\t$j(\"#contentArea\").css(\"user-select\",\"none\");\n}", "title": "" }, { "docid": "9f4aff4a8d82217c4d59eee3125b42d2", "score": "0.6084758", "text": "function renderAQuestion() {\n$('.question-and-score').removeClass('hidden');\n$('.js-start-button').hide();\n$('.js-quiz').show();\n$('.js-quiz').html(questionHtml);\n}", "title": "" }, { "docid": "e2f0d2c7e005f8fc96d8a737aecf1983", "score": "0.60764235", "text": "function render() {\r\n let html = '';\r\n //Display quiz description page before quiz starts\r\n if(!store.quizStarted) {\r\n html += generateStartView();\r\n }\r\n //End of quiz\r\n else if(store.questionNumber === store.questions.length) {\r\n html += generateEndView();\r\n }\r\n //Question results\r\n else if(store.submittedAnswer !== '') {\r\n html += generateQuestionReviewView();\r\n }\r\n //Display question\r\n else {\r\n html += generateQuestionView();\r\n }\r\n $('main').html(html);\r\n}", "title": "" }, { "docid": "83f3c8012db7bf9ec4950a2702955d8b", "score": "0.6073585", "text": "function initDisplay() {\n // Initialize feedback questions\n feedbackQuestionList = [];\n Utils.removeDomChildren(questionListNode.node);\n\n // Question 1\n var question_1 = new FeedbackQuestion(\n templateStore,\n questionListNode.node,\n 'What is one thing that MVS did especially well? Why?'\n );\n question_1.init();\n\n feedbackQuestionList.push(question_1);\n\n // Question 2\n var question_2 = new FeedbackQuestion(\n templateStore,\n questionListNode.node,\n 'What is one thing that you would like to see MVS change going forward? Why?'\n );\n question_2.init();\n feedbackQuestionList.push(question_2);\n \n // Question 3\n var question_3 = new FeedbackQuestion(\n templateStore,\n questionListNode.node,\n 'Any other comments/suggestions?'\n );\n question_3.init();\n\n feedbackQuestionList.push(question_3);\n }", "title": "" }, { "docid": "83f3c8012db7bf9ec4950a2702955d8b", "score": "0.6073585", "text": "function initDisplay() {\n // Initialize feedback questions\n feedbackQuestionList = [];\n Utils.removeDomChildren(questionListNode.node);\n\n // Question 1\n var question_1 = new FeedbackQuestion(\n templateStore,\n questionListNode.node,\n 'What is one thing that MVS did especially well? Why?'\n );\n question_1.init();\n\n feedbackQuestionList.push(question_1);\n\n // Question 2\n var question_2 = new FeedbackQuestion(\n templateStore,\n questionListNode.node,\n 'What is one thing that you would like to see MVS change going forward? Why?'\n );\n question_2.init();\n feedbackQuestionList.push(question_2);\n \n // Question 3\n var question_3 = new FeedbackQuestion(\n templateStore,\n questionListNode.node,\n 'Any other comments/suggestions?'\n );\n question_3.init();\n\n feedbackQuestionList.push(question_3);\n }", "title": "" }, { "docid": "41935a6cb839a67d1b087a89495c8f67", "score": "0.6058963", "text": "function clearAndDisplayNextQuestions(results) {\r\n let gamePage = 'game-page-container';\r\n clearPage(gamePage);\r\n if (checkQuestionsAvaibale(results)) {\r\n createGamePageTemplate(results)\r\n } else {\r\n createResultsPageTemplate();\r\n }\r\n}", "title": "" }, { "docid": "2bfe8b455e15b4fdbb36c96f8e2c105a", "score": "0.60574275", "text": "function render() {\n clearTemplate();\n quizInfo();\n question();\n}", "title": "" }, { "docid": "4c2005e2b396b6b0dc790fe8018bc1c0", "score": "0.6055781", "text": "function firstQuestion() {\n //add question text and write to screen\n questionText = \"JavaScript is a type of \";\n questionWrite();\n // write to list items that will show possible answers\n answerStore = [\"Object Oriented Programming\", \"Functional Programming\"];\n correctIndex = 0;\n answerRender();\n}", "title": "" }, { "docid": "bb874840eb6c32544d91e2746c248c2f", "score": "0.6050778", "text": "function makeQuestions(res, index) {\n for (let i = 0; i < res.results.length; i++) {\n questionsArray.push(new CreateAQuestion(res, i));\n }\n UI.paintUI(questionsArray, index, currentUserScore)\n}", "title": "" }, { "docid": "69680f1231f0ab03b2fcdee437c88e92", "score": "0.60427034", "text": "function render(){\r\n let html = '';\r\n if (store.quizStarted === false){\r\n html = generateTitle();\r\n\r\n } else if (store.quizStarted === true && store.activateFeedback === false && store.questionNumber < store.questions.length){\r\n html = generateQuestion();\r\n\r\n } else if (store.activateFeedback === true){\r\n html = generateFeedback();\r\n \r\n } else if (store.quizStarted === true && store.questionNumber === store.questions.length){\r\n html = generateResults();\r\n }\r\n \r\n $('main').html(html);\r\n}", "title": "" }, { "docid": "d2d482cd82ff01ae45241206d8f11fe7", "score": "0.60382223", "text": "function generateResearchPage() {\n\n var contentNodes = new Array();\n\n //research interests\n contentNodes.push(getResearchInterestsList());\n\n //ongoing research!\n var ongoing = createNiceTitledDiv(\"Ongoing Projects\");\n contentNodes.push(ongoing);\n ongoing.appendChild(getHtmlOngoingResearchList());\n\n //student projects\n var students = createNiceTitledDiv(\"Student Research\");\n contentNodes.push(students);\n students.appendChild(document.createElement(\"p\"));\n students.lastChild.appendChild(document.createTextNode(\"I have had students work on awesome \"));\n students.lastChild.appendChild(createTextLink(\"independent projects\", HOME + \"independentProjects.php\"));\n students.lastChild.appendChild(document.createTextNode(\".\"));\n\n //preprints\n var preprints = createNiceTitledDiv(\"Not-Yet Published\");\n contentNodes.push(preprints);\n preprints.appendChild(getHtmlPreprintList());\n\n //publications\n var publications = createNiceTitledDiv(\"Publications\");\n contentNodes.push(publications);\n publications.appendChild(getHtmlPublicationList());\n\n //presentations\n var presentations = createNiceTitledDiv(\"Presentations\");\n contentNodes.push(presentations);\n presentations.appendChild(getHtmlPresentationList());\n\n\n generateMainPage(\"Kyle's Research\", contentNodes);\n\n}", "title": "" }, { "docid": "c9e9c09200a517791989bf69bf0ea9d6", "score": "0.6037251", "text": "function buildQuiz() {\n // We need to go through each of our question objects and use them to build out the HTML to show a question.\n for (var i = 0; i < myQuestions.length; i++) {\n // Create a display for the question text\n\n //Create a new div called questionDiv that will hold information about a single question.\n var questionDiv = document.createElement(\"div\");\n\n // Get the quetion text from the question we are looking at with this iteration or the loop.\n questionDiv.innerText = myQuestions[i].question;\n\n // Create a div to hold the answers\n var answersDiv = document.createElement(\"div\");\n answersDiv.classList.add(\"answers\");\n\n // For each property in the current question's answers object\n for (letter in myQuestions[i].answers) {\n // ^ A for-in loop is used to go through the properties of the object.\n\n var label = document.createElement(\"label\");\n\n // Create a radio button for each answer for this question\n var input = document.createElement(\"input\");\n\n // Configure the input element\n input.type = \"radio\";\n input.name = \"question\" + i;\n input.value = letter;\n\n // Add Element input to label\n label.appendChild(input); \n\n // Create some text from the current letter we're looking at and the corresponding answer for that letter\n var labelText = document.createTextNode(`${letter} : ${myQuestions[i].answers[letter]}`);\n\n // Add the text to the label\n label.appendChild(labelText);\n\n // Add the label to the answerDiv\n answersDiv.appendChild(label);\n }\n // Once all the answers have been added to a \n questionDiv.appendChild(answersDiv);\n\n // Add the questionDiv to the QuizContainer.\n quizContainer.appendChild(questionDiv);\n }\n }", "title": "" }, { "docid": "9f6eab82326b10c03917ee49e64963c2", "score": "0.60347736", "text": "function setUpFinalResultPage() {\n $('.results-page').show();\n $('.nav-items').hide();\n $('.question-result').hide();\n}", "title": "" }, { "docid": "e15656450fe3c9b7b29ca8056482f09e", "score": "0.6031269", "text": "function generateQuestion () {\n if (questionNumber < QUESTION.length) {\n return `<div class=\"content-${questionNumber}\">\n <h2>${QUESTION[questionNumber].questionText}</h2>\n <form id = \"formContent\">\n <fieldset><legend>Pick one:</legend>\n <label class=\"answerOption\">\n <input type=\"radio\" value=\"${QUESTION[questionNumber].answers[0]}\" name=\"answer\" required>\n <span>${QUESTION[questionNumber].answers[0]}</span>\n </label>\n <label class=\"answerOption\">\n <input type=\"radio\" value=\"${QUESTION[questionNumber].answers[1]}\" name=\"answer\">\n <span>${QUESTION[questionNumber].answers[1]}</span>\n </label>\n <label class=\"answerOption\">\n <input type=\"radio\" value=\"${QUESTION[questionNumber].answers[2]}\" name=\"answer\">\n <span>${QUESTION[questionNumber].answers[2]}</span>\n </label>\n <label class=\"answerOption\">\n <input type=\"radio\" value=\"${QUESTION[questionNumber].answers[3]}\" name=\"answer\">\n <span>${QUESTION[questionNumber].answers[3]}</span>\n </label><br>\n <button type=\"submit\" class=\"submitButton\">Submit</button>\n </fieldset></form>\n </div>`;\n} else {\n renderResults();\n }\n}", "title": "" }, { "docid": "8257d0cbe732162fec43ef556f18d0ca", "score": "0.6030411", "text": "function generateQuiz(questions, quizContainer, resultsContainer, submitButton){\n\n\t\t// +++++++++ displaying questions with inline radio buttons ++++++++++++++\n\n\t\tfunction showQuestions(questions, quizContainer){\n\t\t\t// we'll need a place to store the output and the answer choices\n\t\t\tvar output = [];\n\t\t\tvar answers;\n\n\t\t\t// for each question...\n\t\t\tfor(var i=0; i<questions.length; i++){\n\n\t\t\t\t// first reset the list of answers\n\t\t\t\tanswers = [];\n\n\t\t\t\t// for each available answer to this question...\n\t\t\t\t\tfor(letter in questions[i].answers){\n\n\t\t\t\t\t// ...add an html radio button\n\t\t\t\t\t\tanswers.push(\n\t\t\t\t\t\t\t'<label class=\"radio-inline\">'+ '<input type=\"radio\" name=\"question'+i+'\" value=\"'+letter+'\">'+ letter + ': '+ questions[i].answers[letter]+ '</label>'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t// add this question and its answers to the output\n\t\t\t\toutput.push(\n\t\t\t\t\t'<div class=\"question\">' + questions[i].question + '</div>'+ '<div class=\"answers\">' + answers.join('') + '</div>'\n\t\t\t\t);\n\t\t\t//END iteration of answers array members\t\n\t\t\t}\n\n\t\t\t// finally combine our output list into one string of html and put it on the page\n\t\t\tquizContainer.innerHTML = output.join('');\n\t\t}\n\n\t\t\t\n\n\n\t\tfunction showResults(questions, quizContainer, resultsContainer){\n\t\t\t// gather answer containers from our quiz\n\t\t\tvar answerContainers = quizContainer.querySelectorAll('.answers');\n\t\t\t\n\t\t\t// keep track of user's answers\n\t\t\tvar userAnswer = '';\n\t\t\tvar numCorrect = 0;\n\t\t\t\n\t\t\t// for each question...\n\t\t\tfor(var i=0; i<questions.length; i++){\n\n\t\t\t\t// find selected answer\n\t\t\t\tuserAnswer = (answerContainers[i].querySelector('input[name=question'+i+']:checked')||{}).value;\n\t\t\t\t\n\t\t\t\t// if answer is CORRECT\n\t\t\t\tif(userAnswer===questions[i].correctAnswer){\n\t\t\t\t\t// add to the number of correct answers\n\t\t\t\t\tnumCorrect++;\n\t\t\t\t\t\n\t\t\t\t\t// color the answers green\n\t\t\t\t\tanswerContainers[i].style.color = 'lightgreen';\n\t\t\t\t}\n\n\t\t\t\t// if answer is WRONG (or BLANK in the case of input text)\n\t\t\t\telse{\n\t\t\t\t\t// color the answers red\n\t\t\t\t\tanswerContainers[i].style.color = 'red';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// show number of correct answers out of total\n\t\t\tresultsContainer.innerHTML = numCorrect + ' out of ' + questions.length;\n\t\t}\n\n\t\t// show the questions\n\t\tshowQuestions(questions, quizContainer);\n\n\t\t// when user clicks submit, show results\n\t\tsubmitButton.onclick = function(){\n\t\t\tshowResults(questions, quizContainer, resultsContainer);\n\t\t}\n\t\t\n\n\t// END generateQuiz\n\t}", "title": "" }, { "docid": "ad248e493e3e8e32d250830b9e98696e", "score": "0.60298586", "text": "function setup(option) {\n document.getElementById(\"resources\").style.display=\"none\"; //hides referall resources section\n document.getElementById(\"extra_questions\").style.display=\"none\"; //hides demographic questions section \n\n // Set up back button\n setupBackButton(option);\n\n // Set up explanation icon\n setupExplanation(option);\n\n // Update progress bar\n setupProgressBar(option);\n\n // Change question\n const q = document.getElementById(\"question\");\n q.innerHTML = option.question;\n\n // Set up initial info pages if and only if it's the first question\n if(option.text==\"Begin Survey\"){\n setupInfoPages(option);\n } else{\n document.getElementById(\"icons\").style.display =\"none\";\n }\n\n // Remove old buttons and create new buttons\n replaceButtons(option);\n\n // Show resources if the survey is over, hides question area if it is\n const end = toggleResources(option);\n if(end==1){\n document.getElementById(\"question_area\").style.display = \"none\";\n } else{\n document.getElementById(\"question_area\").style.display = \"initial\";\n }\n}", "title": "" }, { "docid": "e8d80cce83417a5339523f5fe335d69a", "score": "0.60260504", "text": "function render() {\n console.log(store.questionNumber, store.continue, store.correct)\n \n\n let html = \"\";\n if (!store.quizStarted) {\n html = generateMainPage()\n } else if (store.questionNumber < store.questions.length && store.continue === 0) {\n html = generateQuestionPage();\n } else if (store.questionNumber <= store.questions.length && store.correct === 1) {\n html = generateCorrectPage();\n } else if (store.questionNumber <= store.questions.length && store.continue === 1) {\n html = generateIncorrectPage();\n }\n else {\n html = generateFinalPage();\n }\n $('main').html(html)\n}", "title": "" }, { "docid": "dce25fa8c75c0fef667f57f9a9423a1a", "score": "0.6025297", "text": "function render() { \n if (store.quizStarted === false) {\n $('main').html(beginQuiz());\n return;\n }\n else if (store.questionNumber >= 0 && store.questionNumber < store.questions.length) {\n html = questionPage();\n $('main').html(html);\n $('#next-question').hide(true);\n }\n else {\n $('main').html(quizFinished());\n }\n }", "title": "" }, { "docid": "2d65179dd28e3249ff7198a27619f37c", "score": "0.602177", "text": "function displayQuestion(){\n currentQdict = questionObj[getCurrentQIndex()];\n var QuestionDiv = $(\"<div></div>\");\n var currentQNum = parseInt(getCurrentQIndex())+1;\n var QuestionText = $(\"<div class = 'questionText'></div>\").append(\n (currentQNum), \". \", //displays question number\n currentQdict.questionText); //displays question text\n QuestionDiv.append(QuestionText);\n \n //display answer options\n var options = $(\"<div></div>\", {class: \"options\"});\n for (var i =0; i < currentQdict.options.length; i++){\n var option = $(\"<div></div>\", {class: \"option\"});\n var radio = $(\"<input>\", {type: \"radio\",\n name: \"choice\" + getCurrentQIndex(),\n value: currentQdict.options[i]\n });\n //apend options to options\n option.append(radio, \" \", currentQdict.options[i]);\n options.append(option);\n \n }\n \n //add check answer button\n var checkButton = $(\"<button id = checkButton>Check Answer</buton>\");\n var buttonDiv = $(\"<div id= 'buttonDiv'></div>\").append(checkButton);\n checkButton.on('click', getAnswer);\n var ansDiv = $('<div class = \"answerDiv'+getCurrentQIndex()+'\"></div>');\n \n $('.quiz').append(QuestionDiv, options, buttonDiv, ansDiv);\n //console.log(\"Question displayed\");\n }", "title": "" }, { "docid": "0ddca51e231a9387cba84543357f5eb4", "score": "0.6015887", "text": "function generateQuestion(){\r\n // set html for header\r\n $(\"header\").append(`<h2>Question ${questionData[questionArrayIndex].questionNumber}/10</h2>`);\r\n // set html for main \r\n \r\n $(\"main\").append(`<section class=\"question-container\" role=\"region\">\r\n <h3>${questionData[questionArrayIndex].question}</h3>\r\n <form id=\"questions\">\r\n <fieldset>\r\n <legend class=\"question\">${questionData[questionArrayIndex].question}</legend>\r\n <input type=\"radio\" name=\"answer\" id=\"answer-one\" value=\"0\">\r\n <label for=\"answer-one\">${questionData[questionArrayIndex].answers[0]}</label>\r\n <br>\r\n <input type=\"radio\" name=\"answer\" id=\"answer-two\" value=\"1\">\r\n <label for=\"answer-two\">${questionData[questionArrayIndex].answers[1]}</label>\r\n <br>\r\n <input type=\"radio\" name=\"answer\" id=\"answer-three\" value=\"2\">\r\n <label for=\"answer-three\">${questionData[questionArrayIndex].answers[2]}</label>\r\n <br>\r\n <input type=\"radio\" name=\"answer\" id=\"answer-four\" value=\"3\">\r\n <label for=\"answer-four\">${questionData[questionArrayIndex].answers[3]}</label>\r\n </fieldset>\r\n <button type=\"button\" id=\"submit\">Submit</button>\r\n <h3>Score</h3>\r\n <p id=\"correct-p\">Correct ${score}</p>\r\n <p id=\"incorrect-p\">Incorrect ${incorrect}</p>\r\n </form>\r\n </section>`\r\n \r\n );\r\n}", "title": "" }, { "docid": "b5d58aa763676c5ca74ba4774039765c", "score": "0.6014109", "text": "function resultsTemplate(question) {\n var htmlBlock = '<div>'\n htmlBlock = htmlBlock + question.question + ': ' + isChecked;\n return htmlBlock + \"</div>\";\n }", "title": "" }, { "docid": "15c2d383277010e32798ae41d2725937", "score": "0.60120934", "text": "function generateQuestion(){\r\n let question = store.questions[store.questionNumber];\r\n\r\n let answers = question.answers.map((answer, idx) => {\r\n if(idx === 0){\r\n return `<input type='radio' id=${answer} name='answer' value=${answer} required>\r\n <label for='answer${idx}'>${answer}</label>\r\n <br>`}\r\n return `<input type='radio' id='${answer}' name='answer' value=${answer}>\r\n <label for='answer${idx}'>${answer}</label>\r\n <br>`\r\n });\r\n\r\n return `<section id='questionPage'>\r\n <div id= 'progressAndScore'>Question: ${store.questionNumber + 1} of ${store.questions.length}</div\r\n <div id= 'score'>Current Score: ${store.score}</div>\r\n <h2>${question.question}</h2>\r\n <form id='question'>\r\n ${answers.join('')}\r\n <button id= 'submitAnswer'>Answer</button>\r\n </form>\r\n </section>`\r\n}", "title": "" }, { "docid": "b6dc86e0f54de5688098e38526283060", "score": "0.60119516", "text": "function questionFormat0 (questionNumber, options) {\n console.log(\"questionFormat0\");\n\n var temp = window.mainData[currentDomain][currentLevel];\n correctAnswer = temp[questionNumber].tool_name;\n\n var mainContainer = createDiv();\n mainContainer.classList.add(\"questionScreen\");\n mainContainer.innerHTML = \"Select the correct name of the item in the image\";\n\n var questionContainer = createDiv();\n questionContainer.classList.add(\"qf0_question\");\n\n var questionImg = createImage(temp[questionNumber].tool_imgsource);\n questionImg.classList.add(\"questionImage\");\n questionContainer.appendChild(questionImg);\n\n mainContainer.appendChild(questionContainer);\n var optionContainer = createDiv();\n optionContainer.classList.add(\"textOptionContainer\");\n\n var optionDiv;\n //create different divs for options\n for (var i =0; i < options.length; i++) {\n optionDiv = createDiv();\n var t = options[i];\n var tn = document.createTextNode(temp[t].tool_name);\n optionDiv.appendChild(tn);\n optionDiv.classList.add(\"textOption\" + i);\n optionDiv.setAttribute(\"id\", temp[t].tool_name);\n addUserOptionSelection(optionDiv);\n optionContainer.appendChild(optionDiv);\n }\n\n mainContainer.appendChild(optionContainer);\n return mainContainer;\n}", "title": "" }, { "docid": "f144be6227cb530cbbf6d84b66a18a6c", "score": "0.6007794", "text": "function questionFormat1 (questionNumber, options) {\n console.log(\"questionFormat1\");\n\n var temp = window.mainData[currentDomain][currentLevel];\n correctAnswer = temp[questionNumber].tool_name;\n\n var mainContainer = createDiv();\n mainContainer.classList.add(\"questionScreen\");\n mainContainer.innerHTML = \"Select the correct image for the given item name\";\n\n var questionContainer = createDiv();\n questionContainer.classList.add(\"qf1_question\");\n\n var questionText = document.createTextNode(temp[questionNumber].tool_name);\n questionContainer.appendChild(questionText);\n\n mainContainer.appendChild(questionContainer);\n var optionContainer = createDiv();\n optionContainer.classList.add(\"ImageOptionContainer\");\n\n var optionDiv;\n //create different divs for options\n for (var i =0; i < options.length; i++) {\n var t = options[i];\n optionDiv = createImage(temp[t].tool_imgsource);\n optionDiv.classList.add(\"imgOption\"+i);\n optionDiv.setAttribute(\"id\", temp[t].tool_name);\n addUserOptionSelection(optionDiv);\n optionContainer.appendChild(optionDiv);\n }\n\n mainContainer.appendChild(optionContainer);\n return mainContainer;\n}", "title": "" }, { "docid": "3af21228ef12dc350ef5f6dda80dd167", "score": "0.60042506", "text": "function questionTemplate(question, optionA, optionB, optionC, optionD, num) {\n return `\n <div class=\"question-display\">\n <div class=\"question-top\">\n <h2>Question ${QuestionNum}<span>/${numberofQuestions}</span></h2>\n <figure class=\"clock\">\n <div class=\"mins \">0</div>\n <div>:</div>\n <div class=\"secs \">0${numberOfSeconds}</div>\n <!-- <audio src=\"http://soundbible.com/mp3/service-bell_daniel_simion.mp3\"></audio> -->\n <svg class=\"progress-ring\" height=\"60\" width=\"60\">\n <circle class=\"progress-ring__circle\" stroke-width=\"8\" fill=\"transparent\" r=\"29\" cx=\"30\" cy=\"30\"/>\n </svg>\n </figure>\n </div>\n <div class=\"question-body\"> \n <div class=\"question\">\n <h3>\n ${question}\n </h3>\n </div>\n <div class=\"options\">\n <button id=\"option-a\" class=\"option\" name=\"A\">${optionA}</button>\n <button id=\"option-b\" class=\"option\" name=\"B\">${optionB}</button>\n <button id=\"option-c\" class=\"option\" name=\"C\">${optionC}</button>\n <button id=\"option-d\" class=\"option\" name=\"D\">${optionD}</button>\n </div>\n </div>\n `\n}", "title": "" }, { "docid": "641eae3b656d83c7ff4c59707c25f6f9", "score": "0.6000597", "text": "function questions() {\n\t\t$(\"#Ans\").hide();\n\t\t$(\"#Qs\").show();\n\t\tanswered = true;\n\t\t// Prints Question from Array\n\t\t$(\".question\").html(triviaQuestions[currentQ].question);\n\n\t\t// -----------------------------------------\n\t\t//Loops through possible choices and appends\n\t\t// -----------------------------------------\n\t\tfor (var i = 0; i <= 5; i++) {\n\t\t\tvar list = $(\"<div>\");\n\t\t\tlist.text(triviaQuestions[currentQ].choices[i]);\n\t\t\tlist.attr({\"data-index\": i });\n\t\t\tlist.addClass(\"thisChoice\");\n\t\t\t$(\".choices\").append(list);\n\t\t}\n\n\t\t//Calls Timer\n\t\tcountdown();\n\n\t\t// USERCLICK\n\t\t$(\".thisChoice\").on(\"click\",function(){\n\t\t\tuserChoice = $(this).data(\"index\");\n\t\t\tclearInterval(time);\n\t\t\tshoAnswer();\n\t\t});\n\t}", "title": "" }, { "docid": "798dcd5ac7ac5e1d64df546762734fec", "score": "0.6000221", "text": "function createQuiz(){\n startQuiz();\n renderQuestion();\n handleSubmit();\n handleRestart();\n handleResults();\n handleNextQ();\n}", "title": "" }, { "docid": "8c57db08f992cf47ab5650b295114180", "score": "0.5999294", "text": "function generate_slides(markdown_file: string) {\n\n new MultipleInputQuestions(\n [\n {\n type: \"input\",\n name: \"separator\",\n message: \"What is the (Regex style) markdown horizontal separator (default is ^---)\",\n default: \"^---\"\n },\n {\n type: \"input\",\n name: \"vseparator\",\n message: \"What is the (Regex style) markdown vertical separator (default is ^:::)\",\n default: \"^:::\"\n },\n {\n type: \"input\",\n name: \"noteseparator\",\n message: \"What is the (Regex style) markdown note separator (default is ^%%%)\",\n default: \"^%%%\"\n },\n {\n type: \"input\",\n name: \"charset\",\n message: \"What is the markdown charset (default is iso-8859-15)\",\n default: \"iso-8859-15\"\n }\n ]\n ).create_question((a) => {\n let title = markdown_file.replace(/\\.md/, \"\")\n let markdown = fs.readFileSync(markdown_file).toString()\n\n let director = new Director(cache_dir, new GenericBuilder())\n let result = director.make(\n [\n title,\n \"reset.css\",\n \"reveal.css\",\n \"reveal.js\"\n ],\n user_config.theme,\n user_config.plugins,\n [markdown, a.separator, a.vseparator, a.noteseparator, a.charset],\n user_config.highlight_theme\n ).get_result()\n\n fs.writeFileSync(title + \".html\", result)\n\n log(chalk.yellow(\"Slides generated at \" + title + \".html\"))\n })\n}", "title": "" }, { "docid": "59b47fc10d9c55ac22cb0db4c6e07c36", "score": "0.5999222", "text": "function generateQuestions(q) {\n for (var i = 0; i < q_number; i++) {\n var question = document.createElement('div');\n question.classList.add('question');\n question.id = 'question';\n\n var title = document.createElement('h2');\n title.textContent = q[i].question;\n\n question.appendChild(title);\n\n var list = document.createElement('ul');\n\n for (var j = 0, len = q[i].choices.length; j < len; j++) {\n var choice = document.createElement('li');\n\n var check = document.createElement('input');\n check.setAttribute('type', 'radio');\n check.setAttribute('name', 'question');\n\n var choice_text = document.createElement('label');\n choice_text.setAttribute('for', check.name);\n choice_text.textContent = q[i].choices[j];\n\n choice.appendChild(check);\n choice.appendChild(choice_text);\n\n list.appendChild(choice);\n }\n\n var prev_button = document.createElement('button');\n prev_button.textContent = 'Previous Question';\n prev_button.addEventListener('click', prevQuestion);\n\n var next_button = document.createElement('button');\n\n if (i === q_number - 1) {\n next_button.textContent = 'Finish Him';\n next_button.addEventListener('click', finishQuiz);\n } else {\n next_button.textContent = 'Next Question';\n next_button.addEventListener('click', nextQuestion);\n }\n\n question.appendChild(list);\n\n if (i > 0) question.appendChild(prev_button);\n question.appendChild(next_button);\n\n questions.push(question);\n }\n }", "title": "" }, { "docid": "1cf022edfb0520d6fcd799a976aa301f", "score": "0.5995763", "text": "function resultsTemplate(question){\n var htmlBlock = '<div>'\n htmlBlock = htmlBlock + question.question + ': ' + isChecked;\n return htmlBlock + \"</div>\";\n }", "title": "" }, { "docid": "b9cae76da777e83994eb4486dec9923a", "score": "0.59932363", "text": "setup() {\n var ec = elementCreator;\n\n // Create the div to actually contain the questions.\n this.container = ec(\"div\", 'questionsdiv', 'leftbar', { className: \"questions-scroll\"});\n this.title = ec(\"h3\", 'questionTitle', 'questionsdiv', { content: this.header })\n\n var questionsText = \"Calculate the equilibrium potential for Na and K using the Nernst equation for the following conditions\";\n this.question_text = ec(\"p\", 'q1', 'questionsdiv', { className: 'questions questions-scroll', content: questionsText });\n\n this.control_grp = ec(\"div\", 'questionControl', 'questionsdiv', { className: 'container'} );\n this.prev_btn = ec(\"button\", 'questionPrev', 'questionControl', { content: 'Previous' });\n this.prev_btn.mouseClicked(this.prev.bind(this));\n this.prev_btn.attribute(\"disabled\", ''); //We are already in first question, so disabled prev btn at default\n\n this.jump_div = ec(\"div\", 'questionJumpDiv', 'questionControl', { className: 'container'} );\n\n this.refresh(0)\n this.focus(0)\n\n this.next_btn = ec(\"button\", 'questionNext', 'questionControl', { content: 'Next' });\n this.next_btn.mouseClicked(this.next.bind(this));\n }", "title": "" }, { "docid": "23aeebf8f37132d327ada7600d35f81b", "score": "0.5984912", "text": "function renderQuestion() {\n \n questionBox.style.display = 'block';\n next.style.display ='block';\n\n let q = questions[runningQuestionIndex];\n\n questDiv.innerHTML += `<h4 class=\"question-box__question\"> ${q.question} </h4>`;\n questDiv.innerHTML += `<label><input class=\"input-btn\" type=\"radio\" name=\"answer-btn\" id=\"A\" value=\"start\">${q.choiceA}</label></br>`\n questDiv.innerHTML += `<label><input class=\"input-btn\" type=\"radio\" name=\"answer-btn\" id=\"B\" value=\"middle\">${q.choiceB}</label><br>`\n questDiv.innerHTML += `<label><input class=\"input-btn\" type=\"radio\" name=\"answer-btn\" id=\"C\" value=\"end\">${q.choiceC}</label><br>` \n}", "title": "" }, { "docid": "84f0866f71f6693695b25a3d25c64d4a", "score": "0.59822905", "text": "function buildQuestions(){\n\n for (var i = 0; i < 5; i++) {\n\n //generate the index to look into the array of objects\n runningQuestionIndex = Math.floor(Math.random() * 9) + 0;\n console.log(\"index is \" + runningQuestionIndex);\n \n var q = triviaQuestions[runningQuestionIndex];\n console.log(\"q is \" + q);\n console.log(triviaQuestions[i]);\n \n var qBox = $(\"<div>\");\n qBox.attr({\"class\": 'question'});\n $('<p id = \"question\">' +q.question+ '</p>').appendTo('.trivia');\n\n var aBox = $(\"<div>\");\n //same name for input type radio groups all options and only one can be checked\n aBox.attr({\"class\": 'choiceA'});\n $('<input type=\"radio\" name=\"radioBtn' + i + ' \" id=\"radioBtnA\">' +q.choiceA +'</input>').appendTo('.trivia');\n \n var bBox = $(\"<div>\");\n bBox.attr({\"class\": 'choiceB'});\n $('<input type=\"radio\" name=\"radioBtn' + i + ' \" id=\"radioBtnB\">' +q.choiceB+ '</input>').appendTo('.trivia');\n \n var cBox = $(\"<div>\");\n cBox.attr({\"class\": 'choiceC'});\n $('<input type=\"radio\" name=\"radioBtn' + i + ' \" id=\"radioBtnC\">' +q.choiceC+ '</input>').appendTo('.trivia');\n \n var dBox = $(\"<div>\");\n dBox.attr({\"class\": 'choiceD'});\n $('<input type=\"radio\" name=\"radioBtn' + i + ' \" id=\"radioBtnD\">' +q.choiceD+ '</input>').appendTo('.trivia');\n \n selectedQuestions =+ q; \n \n } \n\n console.log(\"selectedQuestions is \" + selectedQuestions);\n \n $('<input type=\"button\" id=\"doneBtn\" value=\"DONE\"/>').appendTo('.trivia'); \n }", "title": "" }, { "docid": "31dccd0a827b903c23ded5b3990d8860", "score": "0.5978085", "text": "function displayQuestion() {\r\n \r\n let question = STORE.questions[STORE.currentQuestion];\r\n displayStatus();\r\n const questionHtml = `\r\n <div>\r\n <form id=\"js-questions\" class=\"question-form\">\r\n\r\n <fieldset>\r\n <div class=\"row question\">\r\n <div class=\"col-12\">\r\n <legend> ${question.question}</legend>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row options\">\r\n <div class=\"col-12\">\r\n <div class=\"js-options\"> \r\n ${displayChoices()}\r\n </div> <!-- -----.js-options added here ------ -->\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <button type=\"submit\" id=\"answer\" tabindex=\"5\">Submit</button>\r\n </div>\r\n </div>\r\n </fieldset>\r\n </form>\r\n </div>\r\n `;\r\n return questionHtml;\r\n\r\n}", "title": "" }, { "docid": "53040d60d2af94020c9a185c3ce95434", "score": "0.5977718", "text": "function populateQuestions(questionsDiv, subject) {\n questionsDiv.innerHTML += \n `<div class=\"start_btn\">\n </div>\n <div class=\"info_box activeInfo\">\n <div class=\"info-title\"><span>Rules of the ${subject} Quiz</span></div>\n <div class=\"info-list\">\n <div class=\"info\">You will have only <span>25 seconds</span> per each question.</div>\n <div class=\"info\">Once you select your answer, it cannot be changed.</div>\n <div class=\"info\">You cannot select any option once the time is up.</div>\n <div class=\"info\">You will get points on the basis of your correct answers.</div>\n </div>\n <div class=\"buttons\">\n <button class=\"quit\" onclick=\"exitQuiz()\">Exit Quiz</button>\n <button class=\"restart\" onclick=\"continueQuiz()\">Start Quiz</button>\n </div>\n </div>\n <!-- Quiz Box -->\n <div class=\"quiz_box\">\n <header>\n <div class=\"title\">${subject} Quiz</div>\n <div class=\"timer\">\n <div class=\"time_left_txt\">Time Left</div>\n <div class=\"timer_sec\">25</div>\n </div>\n <div class=\"time_line\"></div>\n </header>\n <section>\n <div class=\"question_text\">\n <!-- Inserted question from JavaScript -->\n </div>\n <div class=\"option_list\">\n <!-- Inserted options from JavaScript -->\n </div>\n </section>\n <!-- footer section of Quiz Box -->\n <section class=\"footer\">\n <div class=\"total_question\">\n <!-- Inserted Question Count Number from JavaScript -->\n </div>\n <button class=\"next_btn\">Next Question</button>\n </section>\n </div>\n <!-- Result Box -->\n <div class=\"result_box\">\n <div class=\"icon\">\n <i class=\"fas fa-medal\"></i>\n </div>\n <div class=\"complete_text\">You have completed the Quiz!</div>\n <div class=\"score_text\">\n <!-- Inserted Score Result from JavaScript -->\n </div>\n <div class=\"buttons\">\n <button class=\"restart\">Replay Quiz</button>\n <button class=\"quit\">Quit Quiz</button>\n </div>\n </div>\n </div>`;\n}", "title": "" }, { "docid": "082a630f89dae94f29ecbbba90046b1d", "score": "0.5977447", "text": "function quizSetup() {\r\n\t// Loop for however many questions have been included.\r\n for(i=0;i<questions.length;i++) {\r\n\t // Write the questions to the document.\r\n document.writeln('<p class=\"question\">' + questions[i] + ' <span id=\"result_' + i + '\"></span></p>');\r\n\t// Loop for however many answer choices there are for the current question, \r\n for(j=0;j<choices[i].length;j++) {\r\n\t\t// Write the answers to the document with radio buttons. \r\n document.writeln('<input type=\"radio\" name=\"answer_' + i + '\" value=\"' + choices[i][j] + '\" id=\"answer_' + i + '_' + j + '\" class=\"question_' + i + '\" onclick=\"submitAnswer(' + i + ', this, \\'question_' + i + '\\', \\'label_' + i + '_' + j + '\\')\" /><label id=\"label_' + i + '_' + j + '\" for=\"answer_' + i + '_' + j + '\"> ' + choices[i][j] + '</label><br />');\r\n }\r\n }\r\n // Write the buttons for submitting answers and resetting the quiz into the document. \r\n document.writeln('<p><input type=\"submit\" value=\"Show Score\" onclick=\"showScore()\" /> <input type=\"submit\" value=\"Reset Quiz\" onclick=\"resetQuiz(true)\" /></p><p style=\"display:none\"></p>');\r\n \r\n}", "title": "" } ]
b3d2f22ff0127091ccff30025c42c42c
TODO use shared logic among cart pages and FormLayout, possibly with an HOC
[ { "docid": "ced45f6a13a352af9b0900cacd7dfa95", "score": "0.0", "text": "setModuleCartState(){\n\t\tconst ModuleCartUIState = cartsService.cartsStateModel.attributes.ModuleCartUIState;\n\t\tconst sortKey = ModuleCartUIState.sortKey;\n\t\tconst sortOrder = ModuleCartUIState.sortOrder;\n\t\tlet cartItems = getModuleCartCollectionPojo(cartsService.moduleCartCollection);\n\t\tif(sortKey && sortOrder !== 'desc'){\n\t\t\tcartItems = _.sortBy(cartItems, sortKey);\n\t\t}\n\t\telse if(sortKey && sortOrder === 'desc'){\n\t\t\tcartItems = _.sortBy(cartItems, sortKey).reverse();\n\t\t}\n\t\tthis.setState({moduleCartCollection: cartItems});\n\t}", "title": "" } ]
[ { "docid": "635bd8f47b4bc112b996c35a615b720c", "score": "0.6018493", "text": "function updateCartPreview() {\n // TODO: Get the item and quantity from the form\n // TODO: Add a new element to the cartContents div with that information\n}", "title": "" }, { "docid": "52192595768fded32ea84ac7fc0c4d63", "score": "0.5993749", "text": "function updateCartPreview() {//idid that \n // TODO: Get the item and quantity from the form\n \n \n // TODO: Add a new element to the cartContents div with that information\n \n}", "title": "" }, { "docid": "9c25a26b1b0960caa9459d62845ac5d9", "score": "0.56930363", "text": "function ajaxCartInitCartView() {\n\n // Hide update cart button if needed.\n jQuery('.hidden-update-bt').hide();\n\n ajaxCartCartPageBehaviors(jQuery('#cart-form-pane'));\n}", "title": "" }, { "docid": "a312702b281038a717b04ef80a351b30", "score": "0.5655591", "text": "render() {\n\n const {\n loggedInUser,\n deliveryTypeSelection,\n states,\n addressform_visibility,\n checkoutItemsDetail,\n deliverySelectionPayLoad,\n editAddress,\n user,\n errors,\n focused,\n storeEventDetails,\n alert_message,\n alert_status,\n alert_Type,\n labels,\n pickup_userSelection,\n homeDelivery_userSelection,\n previousSelection,\n manualClick,\n addressRecords,\n cartHaveAtLeasetOneDigitalItem,\n cartHaveNormalItem,\n defaultShippingAddressId,\n cartHaveOnlyDigitalItems,\n editButtonVisibility,\n deleteAddressIndex,\n removeAddressAlertModal,\n address_records,\n disableButtonFields,\n isMobile,\n guest_hide_telephone_lada,\n carryAddress,\n toTop,\n pdpSelection,\n enableEditAddress\n } = this.state;\n const { showModal } = this.props;\n\n const terms = {\n bType: 'anchor',\n pText: labels['pwa.checkout.termsandconditions.agreeText'],\n pClass: 'a-checkout__termsAndConditions ' + (!isMobile && \"mb-4\"),\n bText: labels['pwa.checkout.termsandconditions.tcText'],\n bClass: 'a-checkout__termsLink',\n bUrl: labels['pwa.checkout.termsandconditions.linkUrl'],\n targetType: '_blank'\n };\n\n let handleContinueMethod = () => { };\n if (addressform_visibility === false) {\n handleContinueMethod = this.handleContinueFromShippingPage;\n } else if (!loggedInUser && addressform_visibility) {\n handleContinueMethod = this.guestUserContinueFromShippingPage;\n } else if (loggedInUser && addressform_visibility) {\n handleContinueMethod = this.loggedInUserContinueFromShippingPage;\n }\n var mobileControlStyle = {};\n if (isMobile) {\n mobileControlStyle = { 'paddingBottom': '5px' };\n }\n return (\n <main>\n <Alert {...this.props}\n alertTopClass={toTop + \" shipping-alert m-alert__container mdc-snackbar -alertCheckout -step1 -\" + alert_Type}\n iconType={\"a-alert__icon icon-\" + alert_Type}\n text={alert_message}\n alert_status={alert_status}\n dismiss_alert={this.dismiss_alert}\n airTimeStyle=\"68px\"\n />\n <div className=\"container\">\n\n <div className={removeAddressAlertModal ? 'modal-backdrop show' : ''}></div>\n {removeAddressAlertModal === true ?\n <RemoveAddressAlertModal labels={labels} onClick={() => { this.setState({ removeAddressAlertModal: false }) }} showModalpopUp={\"removeAddressAlertModal\"} ModalpopUp={\"removeAddressAlertModal\"} confirmRemoveAddress={this.confirmRemoveAddress} />\n : null\n }\n\n\n <div className=\"row\">\n <div className=\"col-12\">\n <H4 headLineClass=\"a-checkout__heading -headingMargin\" headLineText={addressform_visibility === true ? (editAddress.country ? (labels[\"pwa.checkoutShippingPage.editShippingAddress.label\"] || \"Editar dirección de envío\") : (labels[\"pwa.checkoutShippingPage.newShippingAddress.label\"] || \"Ingresa una nueva dirección de envío\")) : (labels[\"pwa.checkoutShippingPage.deliveryPreference.label\"] || \"Selecciona el tipo de entrega de tu preferencia\")} />\n </div>\n </div>\n\n <div className=\"row checkoutPage_\">\n <div className=\"col-lg-8 col-12 order-1\">\n <div id=\"leftParentPanel\">\n {!loggedInUser && !addressform_visibility &&\n <div className=\"m-box mb-4\">\n <form autoComplete=\"off\">\n <GuestUserPersonalDetailsForm\n cartHaveAtLeasetOneDigitalItem={cartHaveAtLeasetOneDigitalItem}\n handleOnChange={this.handleOnChange}\n handleOnFocus={this.handleOnFocus}\n handleBlur={this.handleBlur}\n previousSelection={previousSelection}\n user={user}\n errors={errors}\n focused={focused}\n labels={labels}\n guest_hide_telephone_lada={guest_hide_telephone_lada}\n />\n </form>\n </div>\n }\n {addressform_visibility === false &&\n <React.Fragment>\n {((!loggedInUser && cartHaveOnlyDigitalItems === false && cartHaveNormalItem) || loggedInUser) &&\n <div className=\"m-box mb-4\" id=\"store-section\">\n <div className=\"row no-gutters align-items-center justify-content-between\">\n <Link className={\"m-box__accordionHeading \"+(deliveryTypeSelection.pickUpInStore===false ? 'collapsed' : '')} aria-expanded={deliveryTypeSelection.pickUpInStore} onClick={() => this.toggleDeliveryTypeSelection('pickUpInStore','shipToStore')}>\n <div className=\"m-box_accordionText\" style={{transition: '0.4s'}}>\n <H5 headLineClass=\"a-box__heading\" headLineText={labels[\"pwa.checkoutShippingPage.pickupinstore.label\"] || \"Recoge en tienda\"} />\n <Label className=\"a-box__subHeading\">{labels[\"pwa.checkoutShippingPage.selectienda.text\"]}</Label>\n {/*{ loggedInUser && storeEventDetails.eventCount>0 &&\n <div className=\"m-flag\">\n <div className=\"m-flag-item -primaryFlag -mesa\">\n <Span>{labels[\"pwa.checkoutShippingPage.selectGiftTableMessage.text\"]} {storeEventDetails.eventCount}</Span>\n <Icons className=\"icon-gift\" />\n </div>\n </div>\n }*/}\n </div>\n <div className=\"a-box__accordionIcon\">\n <Icons className={\"icon-arrow_down\"} />\n </div>\n </Link>\n {/*(deliveryTypeSelection.pickUpInStore===true ? '' : '')*/}\n <div className={\"w-100 collapse show\"} id=\"shipToStore\" style={{'maxHeight': '0px', overflow: 'hidden',transition: 'max-height 0.4s ease-out'}}>\n {deliveryTypeSelection.pickUpInStore===true && <HrTag hrClass=\"a-box__horizontalSeparator\" />}\n {deliveryTypeSelection.pickUpInStore===true && \n <PickUpInStore\n states={states}\n storeEventDetails={storeEventDetails}\n loggedInUser={loggedInUser}\n ref=\"pickUpInStoreRef\"\n userDeliveryTypeSelection={this.userDeliveryTypeSelection}\n labels={labels}\n deliverySelectionPayLoad={deliverySelectionPayLoad}\n pickup_userSelection={pickup_userSelection}\n set_pickup_userSelection={this.set_pickup_userSelection}\n check_estimateddeliverydate={this.check_estimateddeliverydate}\n show_alert={this.show_alert}\n error_scenario={this.error_scenario}\n CncDriveEnableFlag={this.state.CncDriveEnableFlag}\n enableclickandcollect={this.state.enableclickandcollect}\n userSelectPickpuInStore={this.userSelectPickpuInStore}\n handleContinueMethod={handleContinueMethod}\n pdpSelection={pdpSelection}\n setMaxHeightForAnimation={this.setMaxHeightForAnimation}\n setZeroHeightForAnimation={this.setZeroHeightForAnimation}\n />\n }\n </div>\n </div>\n </div>\n }\n {((!loggedInUser && cartHaveOnlyDigitalItems === false && cartHaveNormalItem) || loggedInUser) &&\n <div className=\"m-box\" id=\"delivery-section\">\n <div className=\"row no-gutters align-items-center justify-content-between\">\n <Link className={\"m-box__accordionHeading \"+(deliveryTypeSelection.homeDelivery===false ? 'collapsed' : '')} aria-expanded={deliveryTypeSelection.homeDelivery} onClick={() => this.toggleDeliveryTypeSelection('homeDelivery','shipToAddress')}>\n <div className=\"m-box_accordionText\" style={{transition: '0.4s'}}>\n <H5 headLineClass=\"a-box__heading\" headLineText={loggedInUser ? (labels[\"pwa.checkoutShippingPage.deliveryatyourhome.label\"] || \"Entrega en tu domicilio\") : (labels[\"pwa.checkoutShippingPage.entershippingaddress.label\"] || \"Ingresa una dirección de envío\")} />\n {/*labels[\"pwa.checkoutShippingPage.selectanaddress.label\"]*/}\n <Label className=\"a-box__subHeading\">{labels[\"pwa.checkoutShippingPage.selectanaddress.label\"] || \"Selecciona una dirección\"}</Label>\n </div>\n <div className=\"a-box__accordionIcon\">\n <Icons className={\"icon-arrow_down\"} />\n </div>\n </Link>\n {/*(deliveryTypeSelection.homeDelivery===true ? '' : '')*/}\n <div className={\"w-100 collapse show \"} id=\"shipToAddress\" style={{'max-height': '0px', overflow: 'hidden',transition: 'max-height 0.4s ease-out'}}>\n\n {/*HOME DELIVERY FOR LOGGED IN USER*/}\n {/*deliveryTypeSelection.homeDelivery===true &&*/}\n { deliveryTypeSelection.homeDelivery===true && loggedInUser &&\n <HomeDelivery\n ref=\"homeDeliveryRef\"\n userDeliveryTypeSelection={this.userDeliveryTypeSelection}\n saveUpdatedAddressForLoggedInUser={this.saveUpdatedAddressForLoggedInUser}\n updateAddress={this.updateAddress}\n labels={labels}\n deliverySelectionPayLoad={deliverySelectionPayLoad}\n homeDelivery_userSelection={homeDelivery_userSelection}\n show_alert={this.show_alert}\n removeAddress={this.removeAddress}\n deleteAddressIndex={deleteAddressIndex}\n check_estimateddeliverydate={this.check_estimateddeliverydate}\n storeEventDetails={storeEventDetails}\n address_records={address_records}\n saveAddresses={this.saveAddresses}\n error_scenario={this.error_scenario}\n shipping_address_events_items={this.props.shipping_address_events_items}\n isMobile={isMobile}\n pdpSelection={pdpSelection}\n enableEditAddress={enableEditAddress}\n setMaxHeightForAnimation={this.setMaxHeightForAnimation}\n setZeroHeightForAnimation={this.setZeroHeightForAnimation}\n />\n }\n {deliveryTypeSelection.homeDelivery===true &&\n <div className=\"row align-items-center mt-3\">\n \n {!editButtonVisibility &&\n <div className=\"col-lg-4 col-12 col-xl-3\">\n <Button className=\"a-btn a-btn--tertiary -ml-45 -btnCheckout mb-lg-4\" ripple=\"\" handleClick={this.addNewAddress}>{labels[\"pwa.checkoutShippingPage.AddAddress.text\"]}\n <Icons className=\"icon-arrow_right d-lg-none d-block\" />\n </Button>\n </div>\n }\n {editButtonVisibility &&\n <div className=\"col-12\">\n <Button className=\"a-btn a-btn--tertiary -ml-45 -btnCheckout mb-lg-4\" ripple=\"\" handleClick={this.editGuestAddress}>{labels[\"pwa.addressFormPage.editShippingAddress.text\"]}\n <Icons className=\"icon-arrow_right d-lg-none d-block\" />\n </Button>\n </div>\n }\n \n </div>\n }\n </div>\n </div>\n </div>\n }\n <TermsAndConditions\n labels={labels}\n Regresar={labels[\"pwa.checkoutShippingPage.backButton.label\"]}\n Continuar={labels[\"pwa.addressFormPage.continueButton.label\"] || \"Continuar\"}\n onReturn={() => { Router.push('/tienda/cart', '/tienda/cart') }}\n onContinue={this.handleContinueFromShippingPage}\n termsAndConditionsLinkUrl={labels['pwa.checkout.termsandconditions.linkUrl']}\n termsAndConditionsTCText={labels['pwa.checkout.termsandconditions.tcText']}\n termsAndConditionsAgreeText={labels['pwa.checkout.termsandconditions.agreeText']}\n disabled={disableButtonFields}\n />\n </React.Fragment>\n }\n\n {/*HOME DELIVERY FOR GUEST USER*/}\n {!loggedInUser && addressform_visibility &&\n <React.Fragment>\n <div className=\"m-box\">\n <form autoComplete=\"off\">\n {/*<GuestUserPersonalDetailsForm\n handleOnChange={this.handleOnChange}\n handleOnFocus={this.handleOnFocus}\n handleBlur={this.handleBlur}\n user={user}\n errors={errors}\n focused={focused}\n labels={labels}\n previousSelection={previousSelection}\n />*/}\n <div className=\"row no-gutters align-items-center justify-content-between mb-3\">\n <div className=\"col-lg-4 col-7\">\n <H5 headLineClass=\"a-box__heading\" headLineText=\"Dirección de envío\" />\n </div>\n <div className=\"col-lg-4 col-5 text-right\">\n <Paragraph className=\"a-box__requiredMessage\">{labels[\"pwa.checkoutShippingPage.requiredfields.text\"] || \"*Campos obligatorios\"}</Paragraph>\n </div>\n </div>\n <ShippingAddressForm\n ref=\"shippingAddressFormRef\"\n loggedInUser={loggedInUser}\n previousSelection={previousSelection}\n manualClick={manualClick}\n labels={labels}\n show_alert={this.show_alert}\n states={states}\n check_estimateddeliverydate={this.check_estimateddeliverydate}\n error_scenario={this.error_scenario}\n GuatemalaEnableFlag={this.state.GuatemalaEnableFlag}\n handleOnCountryChange={this.handleOnCountryChange}\n guest_hide_telephone_lada={guest_hide_telephone_lada}\n carryAddress={carryAddress}\n />\n </form>\n </div>\n <TermsAndConditions\n Regresar={labels[\"pwa.checkoutShippingPage.backButton.label\"]}\n Continuar={labels[\"pwa.addressFormPage.continueButton.label\"] || \"Continuar\"}\n onReturn={this.addressFormVisibilityFalse}\n onContinue={this.guestUserContinueFromShippingPage}\n termsAndConditionsLinkUrl={labels['pwa.checkout.termsandconditions.linkUrl']}\n termsAndConditionsTCText={labels['pwa.checkout.termsandconditions.tcText']}\n termsAndConditionsAgreeText={labels['pwa.checkout.termsandconditions.agreeText']}\n disabled={disableButtonFields}\n labels={labels}\n />\n </React.Fragment>\n\n }\n\n {loggedInUser && addressform_visibility &&\n <React.Fragment>\n <div className=\"m-box\">\n <AddNewShippingAddress\n ref=\"addNewShippingAddressRef\"\n editAddress={editAddress}\n loggedInUser={loggedInUser}\n labels={labels}\n addressRecords={addressRecords}\n defaultShippingAddressId={defaultShippingAddressId}\n show_alert={this.show_alert}\n states={states}\n check_estimateddeliverydate={this.check_estimateddeliverydate}\n error_scenario={this.error_scenario}\n GuatemalaEnableFlag={this.state.GuatemalaEnableFlag}\n handleOnCountryChange={this.handleOnCountryChange}\n />\n </div>\n <TermsAndConditions\n Regresar={labels[\"pwa.checkoutShippingPage.backButton.label\"]}\n Continuar={labels[\"pwa.addressFormPage.continueButton.label\"] || \"Continuar\"}\n onReturn={this.addressFormVisibilityFalse}\n onContinue={this.loggedInUserContinueFromShippingPage}\n termsAndConditionsLinkUrl={labels['pwa.checkout.termsandconditions.linkUrl']}\n termsAndConditionsTCText={labels['pwa.checkout.termsandconditions.tcText']}\n termsAndConditionsAgreeText={labels['pwa.checkout.termsandconditions.agreeText']}\n labels={labels}\n disabled={disableButtonFields}\n />\n </React.Fragment>\n }\n\n <div className=\"d-lg-none\">\n {/*<div className=\"row align-items-center justify-content-end\">\n <div className=\"col-lg-auto col-12 pt-3 pb-3\">\n <ParagraphWithBlockNew options={terms} />\n </div>\n </div>*/}\n <div className=\"row align-items-center justify-content-end checkout_shipping_buttons pt-3 pb-3\">\n <div className=\"col-lg-3 col-12\">\n {addressform_visibility === false &&\n <Button className=\"a-btn a-btn--primary\" disabled={disableButtonFields} handleClick={(e) => { window.scrollTo(0, 0); this.handleContinueFromShippingPage(e); }}>{labels[\"pwa.addressFormPage.continueButton.label\"] || \"Continuar\"}</Button>\n }\n {!loggedInUser && addressform_visibility &&\n <Button className=\"a-btn a-btn--primary\" disabled={disableButtonFields} handleClick={(e) => { window.scrollTo(0, 0); this.guestUserContinueFromShippingPage(e); }}>{labels[\"pwa.addressFormPage.continueButton.label\"] || \"Continuar\"}</Button>\n }\n {loggedInUser && addressform_visibility &&\n <Button className=\"a-btn a-btn--primary\" disabled={disableButtonFields} handleClick={(e) => { window.scrollTo(0, 0); this.loggedInUserContinueFromShippingPage(e); }}>{labels[\"pwa.addressFormPage.continueButton.label\"] || \"Continuar\"}</Button>\n }\n </div>\n <div className=\"col-lg-3 col-12 mt-3 mt-lg-0\">\n <Button className=\"a-btn a-btn--secondary\" ripple=\"\" disabled={disableButtonFields} handleClick={(e) => {\n if (addressform_visibility) {\n window.scrollTo(0, 0);\n this.setState({ addressform_visibility: false },()=>{\n this.setMaxHeightForAnimation('shipToAddress');\n });\n } else {\n Router.push('/tienda/cart', '/tienda/cart');\n }\n }}>{labels[\"pwa.checkoutShippingPage.backButton.label\"]}</Button>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div className=\"col-lg-4 col-12 order-2 d-none d-lg-block\">\n <div id=\"scroll-right-pane\">\n <SummeryMyProducts\n {...this.props}\n checkoutItemsDetail={checkoutItemsDetail}\n labels={labels}\n />\n </div>\n </div>\n\n </div>\n </div>\n\n\n\n </main>\n );\n }", "title": "" }, { "docid": "25c5e26869a01c825030543fa756008f", "score": "0.56508976", "text": "onFormSubmit(evt) {\n evt.preventDefault();\n const form = evt.currentTarget;\n const addToCart = form.querySelector(this.options.addToCartSelector);\n\n this.state.cartIsUpdating = true;\n addToCart.classList.add(cssClases.isAdding);\n\n // Small timeout to allow variant id input change in form\n setTimeout(() => {\n this.addItemFromForm(form, addToCart);\n }, 100);\n }", "title": "" }, { "docid": "98d6230885ecf870ed47a7457a30f175", "score": "0.5640524", "text": "function pageDisplay(){\n if(cart.length <= 0){\n return(\n showEmptyCart()\n )\n }\n else{\n return(\n <React.Fragment>\n <Box className = \"right\" id=\"orderSummary\" >\n {showSummary()}\n {showButton()}\n </Box>\n <Box className = \"left\" id=\"itemSummary\">\n <CartSummary />\n </Box>\n </React.Fragment>\n )\n }\n }", "title": "" }, { "docid": "e580b790e9c5c322850e6043ed05d2dc", "score": "0.563909", "text": "cartinfo(currentPackageObj) {\r\n let self = this;\r\n this.submitted = true;\r\n this.errors = {};\r\n\r\n // new addition: disable billing info address fields\r\n this.cart.disable_billing_fields = (this.currentstate == 'changeplan' && this.cart.purchase_type == 'company' && !this.cart.is_trial) ? true : false;\r\n\r\n // Selected package custom data\r\n currentPackageObj = currentPackageObj;\r\n\r\n // Filter\r\n var emptyaddons = currentPackageObj.Metrics.filter(function (i) {\r\n return (i.is_selected && i.quantity > 0);\r\n });\r\n\r\n // Cart data\r\n this.cart = this.cart;\r\n\r\n // apply changes immediately or on renewal based on upgrade or downgrade\r\n if (this.currentstate == \"changeplan\") {\r\n // this.cart.has_scheduled_changes = (this.cart.packageprice < this.cart.old_packageprice) ? true : false;\r\n // this.cart.end_of_term = (this.cart.packageprice < this.cart.old_packageprice) ? true : false;\r\n this.cart.has_scheduled_changes = false;\r\n this.cart.end_of_term = false;\r\n }\r\n\r\n if (!this.cart.is_trial && typeof this.currentsubscription.subscription != \"undefined\" && this.currentsubscription.subscription.status != \"cancelled\" && this.currentstate == \"changeplan\" && this.currentUser && (this.currentUser.tenant_license.plan_id == 'plan' + this.cart.package_id && emptyaddons.length == 0)) {\r\n this.toastr.error(\"Modify plan and/or choose add-on(s) before continuing.\");\r\n } else if (this.currentstate == \"changeplan\" && this.cart.is_trial && currentPackageObj.is_trial) {\r\n this.toastr.error(\"Please modify your current plan.\");\r\n } else {\r\n // new addition: filter current selected addons by recurring and non recurring type\r\n this.filterAddons(currentPackageObj);\r\n\r\n // Prepare chargebee addons obj\r\n this.getAddons(currentPackageObj);\r\n\r\n // Next step: Account information\r\n this.accountToggle = true;\r\n this.step1Flag = false;\r\n this.step2Flag = (self.currentstate == \"changeplan\") ? false : true;\r\n this.step3Flag = (self.currentstate == \"changeplan\") ? true : false;\r\n this.step4Flag = false;\r\n this.step5Flag = false;\r\n\r\n // self.$timeout(function () {\r\n // $('form[name=\"step2form\"] input').first().focus();\r\n // });\r\n\r\n // Next step: Billing information\r\n if (self.currentstate != \"signup\") {\r\n this.billingToggle = true;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "d6c8df419da9b2c2dd6407653783bb11", "score": "0.5619389", "text": "function submitAddProduct(){\n // Submission processing method here \n event.preventDefault();\n \n const { title, brand, parentCat, childCat, sizesAndQtiesPrev} = collectInput.outputCollectInput()\n \n if (!title || !brand || !parentCat || !childCat || !sizesAndQtiesPrev){\n return alert(\"Please fill in all asterisked* input box\");\n }\n \n addProductToDb()\n\n apiProductData(); \n document.querySelector(\"#products-list-table\").classList.remove(\"hide\"); \n document.querySelector(\"#add-product\").classList.add(\"hide\"); \n var path={\n linkpage:\"admin/products\"\n } \n navigatePage.call(path);\n\n}", "title": "" }, { "docid": "d6c8df419da9b2c2dd6407653783bb11", "score": "0.5619389", "text": "function submitAddProduct(){\n // Submission processing method here \n event.preventDefault();\n \n const { title, brand, parentCat, childCat, sizesAndQtiesPrev} = collectInput.outputCollectInput()\n \n if (!title || !brand || !parentCat || !childCat || !sizesAndQtiesPrev){\n return alert(\"Please fill in all asterisked* input box\");\n }\n \n addProductToDb()\n\n apiProductData(); \n document.querySelector(\"#products-list-table\").classList.remove(\"hide\"); \n document.querySelector(\"#add-product\").classList.add(\"hide\"); \n var path={\n linkpage:\"admin/products\"\n } \n navigatePage.call(path);\n\n}", "title": "" }, { "docid": "5b3fe7ceaabe081840f6b62b008b9402", "score": "0.55876064", "text": "function renderCart() {\n\trefreshCart();\n}", "title": "" }, { "docid": "8260f861c536237bc2f875b7528bba97", "score": "0.5582978", "text": "getCartSection() {\n const cartSize = Object.keys(this.state.cart).reduce(\n (prev, itemId) => prev + this.state.cart[itemId],\n 0\n );\n const cartItemRows = this.getCartItemRows(this.getCartItemsJson());\n return (\n <Card classes={{ root: \"summary-card\" }}>\n <CardHeader\n avatar={\n <Avatar\n aria-label=\"Cart\"\n style={{\n backgroundColor: \"transparent\",\n color: \"black\",\n padding: 8,\n overflow: \"initial\",\n }}\n >\n <Badge badgeContent={cartSize} color=\"primary\">\n <ShoppingCartIcon />\n </Badge>\n </Avatar>\n }\n title={<b>My Cart</b>}\n titleTypographyProps={{ variant: \"h6\" }}\n style={{ paddingLeft: 0, paddingRight: 0 }}\n />\n <CardContent style={{ paddingLeft: 0, paddingRight: 0 }}>\n <ul className=\"cart-item-list\">{cartItemRows}</ul>\n <ul className=\"cart-summary-list\">\n <li className=\"cart-item-list-item\">\n <div className=\"cart-item-blk\">\n <Typography variant=\"h6\" gutterBottom style={{fontWeight: 'bold'}}>\n TOTAL AMOUNT\n </Typography>\n </div>\n <div className=\"cart-item-blk price\">\n <Typography variant=\"h6\" gutterBottom style={{fontWeight: 'bold'}}>\n <i className=\"fa fa-inr\" aria-hidden=\"true\"></i>\n {bill}\n </Typography>\n </div>\n </li>\n </ul>\n </CardContent>\n <CardActions>\n <Button\n variant=\"contained\"\n color=\"primary\"\n fullWidth={true}\n onClick={this.handleOrder}\n >\n CHECKOUT\n </Button>\n </CardActions>\n </Card>\n );\n }", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.5572532", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "0500c98f88d413bb6c578299cc222501", "score": "0.5535932", "text": "function ajaxCartFormSubmitted(e) {\n // Enable input elements from cart from cart page.\n jQuery('form.ajax-cart-submit-form input').attr('disabled', false);\n\n // Update cart block.\n ajaxCartUpdateBlockCart();\n\n\n ajaxCartBlockUI(Drupal.settings.uc_ajax_cart.CART_OPERATION, e);\n ajaxCartReloadCartView();\n}", "title": "" }, { "docid": "9a3bd52caba983c08d2621dd5f43530e", "score": "0.5535127", "text": "renderLayout() {\n let {\n intl: { formatMessage },\n actionMenuType,\n form: { getFieldDecorator },\n bayInfo,\n bayState: { commonTypeVoltageLevel, commonBayType },\n } = this.props;\n let children = [],\n bayTypeList = [];\n if (commonTypeVoltageLevel && commonTypeVoltageLevel.length > 0) {\n commonTypeVoltageLevel.forEach((element) => {\n children.push(<Option key={element.value}>{element.name}</Option>);\n });\n }\n if (commonBayType && commonBayType.length > 0) {\n commonBayType.forEach((element) => {\n bayTypeList.push(\n <Option key={element.typeCode}>{Enum.getBayTypeName(element.typeCode)}</Option>\n );\n });\n }\n let {\n bayName,\n voltageLevel,\n voltageLevelName,\n bayType,\n officialSerial,\n id,\n substationId,\n substationName,\n remark,\n } = 2 == actionMenuType && bayInfo ? bayInfo : {};\n return (\n <StandardForm vertical primary={[0, 1, 2, 3]}>\n <FormItem label={formatMessage(locale.BayName)}>\n {formItemTips(\n getFieldDecorator,\n 'bayName',\n 0,\n 100,\n formatMessage,\n locale,\n { required: true, emptyHint: 'BayNameReq' },\n bayName\n )(<Input placeholder={formatMessage(locale.BayNameReq)} />)}\n </FormItem>\n <FormItem label={formatMessage(locale.BayType)}>\n {getFieldDecorator('bayType', {\n initialValue: isEmpty(bayType) ? undefined : `${bayType}`,\n rules: [{ required: true, message: formatMessage(locale.BayTypeReq) }],\n })(\n <Select\n onChange={this.bayTypeChange}\n placeholder={formatMessage(locale.BayTypeReq)}>\n {bayTypeList}\n </Select>\n )}\n </FormItem>\n <FormItem label={formatMessage(locale.BayManagerSubstation)}>\n {getFieldDecorator('hiddenbay', {\n rules: [\n {\n required: true,\n message: formatMessage(locale.BayManagerSubstationReq),\n },\n ],\n })(<Input type='hidden' />)}\n {getFieldDecorator('substation', {\n initialValue: '',\n rules: [\n {\n required: false,\n message: formatMessage(locale.BayManagerSubstationReq),\n },\n ],\n })(\n <ArchiveTree\n moduleId={'bayCompany'}\n moduleType={ARCHIVE_TREE_TYPE.SELECT_TREE}\n rootParentNodeType={ARCHIVE_NODE_TYPE.COMPANY}\n leafNodeType={ARCHIVE_NODE_TYPE.SUBSTATION}\n onTreeSelect={this.onSubstationSelect}\n disabledType={[ARCHIVE_NODE_TYPE.COMPANY]}\n placeholder={formatMessage(locale.BayManagerSubstationReq)}\n defValue={{\n key: id,\n value: substationName,\n }}\n onDefValueSet={this.onSubstatiionDefValueSet.bind(\n this,\n substationId,\n substationName,\n voltageLevel,\n voltageLevelName\n )}\n />\n )}\n </FormItem>\n <FormItem label={formatMessage(locale.VoltageClass)}>\n {getFieldDecorator('voltageLevel', {\n initialValue: isEmpty(voltageLevel) ? undefined : `${voltageLevel}`,\n rules: [{ required: true, message: formatMessage(locale.VoltageClassTip) }],\n })(\n <Select\n onChange={this.onVoltageChange}\n placeholder={formatMessage(locale.VoltageClassTip)}>\n {children}\n </Select>\n )}\n </FormItem>\n <FormItem label={formatMessage(locale.OfficialSerial)}>\n {formItemTips(\n getFieldDecorator,\n 'officialSerial',\n 0,\n 100,\n formatMessage,\n locale,\n {\n required: false,\n emptyHint: 'SubstationInputSerial',\n specialSymbolPattern: 'illegalWithOutComma',\n },\n officialSerial\n )(<Input placeholder={formatMessage(locale.SubstationInputSerial)} />)}\n </FormItem>\n <FormItem label={formatMessage(locale.Remark)}>\n {formItemTips(\n getFieldDecorator,\n 'remark',\n 0,\n 200,\n formatMessage,\n locale,\n false,\n remark\n )(<TextArea placeholder={formatMessage(locale.RemarkTips)} />)}\n </FormItem>\n </StandardForm>\n );\n }", "title": "" }, { "docid": "3bd9780b1c4d65ef5f7e67044fbd94a5", "score": "0.55342275", "text": "renderItem() {\n return (\n <AddItem back={this.switchCart} add={this.addItem} />\n );\n }", "title": "" }, { "docid": "49835e79ff430969e9256b24093d1fe7", "score": "0.55313087", "text": "function addToCart() {\n setToggle(!isToggled);\n props.handleVisibility();\n //\n //\n //\n }", "title": "" }, { "docid": "d7fd430a09d56c6492a6b2a35ab0b6b2", "score": "0.5530997", "text": "render() {\n return (\n <React.Fragment>\n <Container id=\"Logo_Header\" fluid style={{padding: \"30px 12px 50px 12px\"}}>\n <Row>\n <p style={{color: \"#E9BD43\", fontFamily: \"Brush Script MT\", fontSize: \"100px\"}}>Passerelle</p>\n </Row>\n <Row>\n <form style={{color: \"#E9BD43\"}} onSubmit={this.handleProductSubmit}>\n <Row>\n <Col sm={6}>\n <input type=\"number\" name=\"productIndex\" placeholder=\"product list\" value={this.state.term} onChange={this.inputHandler}/>\n <Button id='customButton' type=\"submit\"> Get Product</Button>\n </Col>\n </Row>\n </form>\n </Row>\n </Container>\n <Overview product={this.state.currentProduct} />\n <QandA currentId={this.state.currentProduct.id}/>\n <RatingsReviews productId={this.state.currentProduct.id} productName={this.state.currentProduct.name} />\n </React.Fragment>\n );\n }", "title": "" }, { "docid": "fa34c62718547f25cb12fe1396121b82", "score": "0.5530969", "text": "render() {\n\t\tconst { Order } = this.props.location.state;\n\n\t\treturn (\n\t\t\t<div className='container'>\n\t\t\t\t<h2>Your Orders</h2>\n\t\t\t\t<Link to='/customer/menus'>\n\t\t\t\t\t<FiEdit size={16} color='#0c71c3' />\n\t\t\t\t\tAdd more to your cart\n\t\t\t\t</Link>\n\t\t\t\t<br />\n\n\t\t\t\t<h2 className='extras-heading'>Order Detail</h2>\n\t\t\t\t<table className='order-table'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th style={{ width: '80px' }}>Name</th>\n\t\t\t\t\t\t<th style={{ width: '60px' }}>Quantity</th>\n\t\t\t\t\t\t<th style={{ width: '60px' }}>Price</th>\n\t\t\t\t\t\t<th style={{ width: '46px' }}>Total</th>\n\t\t\t\t\t</tr>\n\n\t\t\t\t\t{Order.map((Item, index) => (\n\t\t\t\t\t\t<tr key={index}>\n\t\t\t\t\t\t\t<td>{Item.Name}</td>\n\t\t\t\t\t\t\t<td>{Item.Quantity}</td>\n\t\t\t\t\t\t\t<td>{Item.Price}</td>\n\t\t\t\t\t\t\t<td>{Item.Total}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t))}\n\t\t\t\t</table>\n\n\t\t\t\t<Total data={this.props.location.state.Order} />\n\n\t\t\t\t<div className='col s6 center-align'>\n\t\t\t\t\t<Link\n\t\t\t\t\t\tto=''\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\twidth: '140px',\n\t\t\t\t\t\t\tborderRadius: '3px',\n\t\t\t\t\t\t\tletterSpacing: '1.5px',\n\t\t\t\t\t\t\tmarginTop: '3rem',\n\t\t\t\t\t\t\ttextSize: '12px',\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonClick={this.onSaveForm}\n\t\t\t\t\t\tclassName='btn small waves-effect waves-light hoverable navy accent-3'>\n\t\t\t\t\t\tSubmit\n\t\t\t\t\t</Link>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "626fbc5f347e3690fb5a5ffff1957846", "score": "0.5527136", "text": "getOrderingSection() {\n const menuCard = this.getMenuCard();\n const cartComponent = this.getCartSection();\n return (\n <div className=\"ordering-section\">\n <Grid container spacing={10}>\n <Grid item xs={12} sm={6} style={{ padding: 50 }}>\n {menuCard}\n </Grid>\n <Grid item xs={12} sm={6} style={{ padding: 50 }}>\n {cartComponent}\n </Grid>\n </Grid>\n </div>\n );\n }", "title": "" }, { "docid": "91df43fe19d9827d70596dcfe319e4a0", "score": "0.5524363", "text": "function renderCart() {\n loadCart();\n clearCart();\n \n showCart();\n}", "title": "" }, { "docid": "b2615aee0d602471e51a3d79211fe33a", "score": "0.5517306", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "e2fc00975a0f55343c2f0176af750c2b", "score": "0.55006725", "text": "render() {\n\n let page = this.props.order ? (\n <div>\n <Backdrop show={this.props.show} clicked={this.modalClose.bind(this)}/>\n <div \n className='ShowOrderModal'\n style={{\n transform: this.props.show ? 'translateY(0)' : 'translateY(-100vh)',\n opacity: this.props.show ? '1' : '0'\n }}>\n <center>\n <h3>{this.props.order.userName}</h3>\n <h4>{this.props.order.userEmail}</h4>\n {this.props.order.cart.map((good) => {\n return <div key={good._id}>{good.name} x{good.quantity} - ${good.price.toFixed(2)}</div>\n })}\n <br />\n <p>Subtotal: ${this.props.order.subtotal.toFixed(2)}</p>\n <Button className=\"vendor-page-button\" variant=\"success\" onClick={_ => this.props.completeOrder(this.props.order._id)}>Complete Order</Button>\n <Button className=\"vendor-page-button\" variant=\"danger\" onClick={() => this.props.cancelOrder(this.props.order._id)}>Cancel Order</Button>\n </center>\n </div>\n </div>\n ) : null;\n return page;\n }", "title": "" }, { "docid": "d36e51f5f6da564ee4bf7614743e978b", "score": "0.54983556", "text": "render() {\n return this.props.children({\n addToBasket: this.addToBasket,\n myItems: this.state.basket,\n calculateTotalBeforeDiscount: this.calculateTotalBeforeDiscount,\n calculateDiscount: this.calculateDiscount,\n calculateTotalPrice: this.calculateTotalPrice,\n deliveryFee: this.deliveryFee,\n clearBasket: this.clearBasket,\n calculateTotalWithoutDelivery: this.calculateTotalWithoutDelivery,\n });\n }", "title": "" }, { "docid": "e50d5135d3c804b2d00f940cab425baf", "score": "0.54919106", "text": "cartItemFormId(){\n\t\treturn Template.instance().formId\n\t}", "title": "" }, { "docid": "2511f20e5625005207b5b4175526f26e", "score": "0.5462575", "text": "render()\n {\n if (this.state.redirectCart) return <Redirect to='/Cart'/>\n // if user success add to cart, then move to cart page\n if (this.state.redirectLogin) return <Redirect to='/Login'/>\n // if user not login yet, when user hit add to cart, they will\n // redirect to login\n\n const detproduk = this.state.detprod.map((item, index) =>\n {\n let prodID = item.id;\n let photo = item.prod_img;\n let prodname = item.prod_name;\n let prodprice = item.prod_price;\n let prodcat = this.state.categoryname;\n let proddesc = item.prod_desc\n return <div key={index}>\n <div className=\"col-md-5 col-md-offset-1\">\n <div className=\"card bg-light mb-3\">\n <div className=\"card-body\">\n <img id=\"stylegambar1\" src={'http://localhost:3001/images/' + photo} alt=\"\"/>\n </div>\n </div>\n </div>\n\n <div className=\"col-md-5\">\n <div className=\"card mb-3\">\n <div className=\"card-header\" id=\"Lobster\"><h3>{prodname}</h3></div>\n <div className=\"card-body\">\n <p className=\"price defaultmarg\">IDR {prodprice}</p>\n <div>\n <label className=\"padding10\">Quantity :</label>\n <div className=\"form-group\">\n <center>\n <button className=\"btn btn-danger width90\" onClick={() => this.decrement()}><i className=\"fa fa-minus\"></i></button>&nbsp;\n <input className=\"text-center styleproddet\" ref=\"qty\" type=\"number\" value={this.state.nums} onChange={this.Qty}/>&nbsp;\n <input className=\"text-center styleproddet\" ref=\"prodID\" type=\"hidden\" value={prodID}/>&nbsp;\n <input className=\"text-center styleproddet\" ref=\"prodName\" type=\"hidden\" value={prodname}/>&nbsp;\n <input className=\"text-center styleproddet\" ref=\"prodPrice\" type=\"hidden\" value={prodprice}/>&nbsp;\n <button className=\"btn btn-success width90\" onClick={() => this.increment()}><i className=\"fa fa-plus\"></i></button><br/><br/>\n <button type=\"button\" className=\"btn btn-success\" onClick={() => this.order(this.refs)}>\n <i className=\"fa fa-shopping-cart\"></i> Add To Cart\n </button>\n </center>\n </div>\n </div> \n </div>\n </div>\n <div className=\"card mb-3\">\n <div className=\"card-header\"><i className=\"fa fa-info-circle\"></i> Description</div>\n <div className=\"card-body padding10\">\n <ul className=\"defaultmarg\">\n <li>Category: {prodcat}</li>\n <li>{proddesc}</li>\n </ul>\n <Link to=\"/Productlist\">\n <button className=\"btn btn-primary pull-left\"><span className=\"fa fa-arrow-left\">&nbsp;&nbsp;</span>to Product List</button> \n </Link>\n </div>\n </div>\n </div>\n </div>\n })\n\n return (\n <div id=\"homeback\">\n <div className=\"container-fluid padbot padtop\">\n <div className=\"row\">\n {detproduk}\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "3cffc6c7a95754907a71046d9fac74ea", "score": "0.54587424", "text": "purchasereview(form) {\r\n let self = this;\r\n this.submitted = true;\r\n this.previewToggle = true;\r\n this.errors = {};\r\n this.isverified = false;\r\n\r\n // Filter addons\r\n this.cart.chargebeeaddons = this.cart.addons.filter(function (i) {\r\n return i.quantity > 0;\r\n });\r\n\r\n // Current package metrics info\r\n var packageSelected = this.packageoptions[this.cart.packageindex];\r\n\r\n var selectedMetricsObj = packageSelected.Metrics;\r\n this.extra_addons = [];\r\n self.cart.selectedpackagejson = [];\r\n // cancelled state handling\r\n if (typeof this.currentUser.tenant_license != \"undefined\" && !this.currentUser.tenant_license.is_active) {\r\n this.recalculateAddonMetrics(selectedMetricsObj);\r\n } else {\r\n angular.forEach(selectedMetricsObj, function (value, index) {\r\n // only addons with checkbox checked\r\n if (value.addon && value.is_selected) {\r\n self.extra_addons.push({\r\n name: value.name,\r\n label_name: (typeof value.addon.label_name != \"undefined\" && value.addon.label_name != \"\") ? value.addon.label_name : value.name,\r\n key: value.key,\r\n quantity: value.quantity,\r\n price: self.filter('currency')(value.addon.price, '', 2),\r\n subtotal: self.filter('currency')(value.addon.subtotal, '', 2)\r\n });\r\n }\r\n self.cart.selectedpackagejson.push({\r\n 'id': value._id,\r\n 'key': value.key,\r\n 'name': value.name,\r\n 'default_value': value.package_metric.default_value,\r\n 'checkby': value.checkby\r\n });\r\n });\r\n }\r\n // filter by quantity\r\n self.extra_addons = self.extra_addons.filter(function (i) {\r\n return i.quantity > 0;\r\n });\r\n\r\n // Prepare tenant license details i.e. selected package metrics info with addons\r\n this.cart.license_detail.package_json.packagemetrics = this.cart.selectedpackagejson;\r\n this.cart.license_detail.package_json.plan_name = (this.cart.package_name) ? this.cart.package_name : this.currentUser.tenant_license.license_detail.package_json.plan_name;\r\n this.cart.license_detail.package_json.plan_interval = (this.cart.planduration) ? this.cart.planduration : this.currentUser.tenant_license.license_detail.package_json.plan_interval;\r\n\r\n // Filter\r\n var emptyaddons = this.packageoptions[this.cart.packageindex].Metrics.filter(function (i) {\r\n return (i.is_selected && i.quantity > 0);\r\n });\r\n\r\n // db addons metrics json values\r\n if (typeof this.currentUser.tenant_license != \"undefined\" && !this.currentUser.tenant_license.is_active) {\r\n // cancelled state handling\r\n this.cart.license_detail.package_json.addonmetrics = this.cart.total_addonmetrics;\r\n } else if (this.cart.planduration == this.cart.old_package_interval && emptyaddons.length >= 0 && typeof this.currentUser.tenant_license != \"undefined\" && this.currentUser.tenant_license.is_active) {\r\n // sum existing and newly added addons\r\n this.cart.license_detail.package_json.addonmetrics = this.cart.total_addonmetrics;\r\n } else {\r\n // override existing addons\r\n this.cart.license_detail.package_json.addonmetrics = this.cart.chargebeeaddons;\r\n }\r\n\r\n // current package features\r\n self.features = jQuery.map(packageSelected.Features, function (feature, i) {\r\n return feature.key;\r\n });\r\n\r\n // total counts of email metric\r\n this.totalMetricsCount();\r\n\r\n // Get current user subdomain\r\n var domain = angular.lowercase(self.user.subdomain) + '.' + self.gamma_ui;\r\n\r\n // set dubdomain url\r\n var userSubdomain = (self.gamma_ui_env == \"local\" || self.gamma_ui_env == \"test\") ? \"http://\" + domain : \"https://\" + domain;\r\n\r\n // set expected vat number to pass to chargebee api\r\n this.billing.vat_number_cb = \"\";\r\n if (this.cart.purchase_type == \"company\" && typeof this.billing.vat_number != \"undefined\" && this.billing.vat_number != \"\") {\r\n // trim unwanted chars like country code, hyphen, spaces etc\r\n var trim_vat_number = this.billing.vat_number;\r\n trim_vat_number = trim_vat_number.trim();\r\n trim_vat_number = trim_vat_number.replace(this.cart.default_country, \"\");\r\n trim_vat_number = trim_vat_number.replace(\"-\", \"\");\r\n trim_vat_number = trim_vat_number.replace(/ /g, \"\");\r\n // expected vat number to pass to chargebee api\r\n this.billing.vat_number_cb = trim_vat_number;\r\n }\r\n\r\n // prepare email template content\r\n var parameters = {\r\n email_to: self.user.email,\r\n body_content: {\r\n base_url: self.baseUrl,\r\n gamma_os_postfix: self.gamma_os_postfix,\r\n gamma_ui_base_url: userSubdomain,\r\n gamma_ui_env: self.gamma_ui_env,\r\n username: self.billing.first_name,\r\n subdomain: userSubdomain,\r\n package_info: {\r\n plan_name: self.cart.package_name,\r\n plan_quantity: 1,\r\n plan_unit_price: self.filter('currency')(self.cart.packageprice, '', 2),\r\n extra_addons: self.extra_addons,\r\n total: self.filter('currency')(self.cart.packagetotal, '', 2),\r\n credits_applied: self.filter('currency')(self.cart.credits_applied, '', 2),\r\n amount_due: self.filter('currency')(self.cart.amount_due, '', 2)\r\n },\r\n billing_info: {\r\n company: self.billing.company,\r\n first_name: self.billing.first_name,\r\n last_name: self.billing.last_name,\r\n street_address: self.billing.street_address,\r\n street_address_line2: self.billing.street_address_line2,\r\n city: self.billing.city,\r\n zip: self.billing.zip,\r\n country_code: self.billing.country,\r\n country: self.cart.default_country_name,\r\n vat_number: self.billing.vat_number,\r\n vat_number_cb: self.billing.vat_number_cb,\r\n tax_rate: self.cart.vat_rate,\r\n tax_name: self.cart.tax_name,\r\n purchase_type: self.cart.purchase_type\r\n },\r\n card_info: {\r\n card_type: self.payment.cardtype,\r\n last4: self.payment.lasttwo\r\n }\r\n }\r\n };\r\n\r\n // Create new subscription\r\n if (this.currentstate == \"signup\" || this.currentstate == \"dualaccount\") {\r\n self.emailContent = {};\r\n // Email format validation\r\n var validFlag = self.validemailcheck(this.user.email);\r\n // Server side validation\r\n if (!validFlag) {\r\n // self.errors.validemailflag = true;\r\n self.toastr.error(\"Doesn't look like a valid email.\");\r\n } else {\r\n if (self.isLoggedIn) {\r\n // dualaccount case\r\n self.processTransaction(parameters);\r\n } else {\r\n // Email unique validation\r\n this.Auth.emailcheck(this.user.email, false, \"signup\")\r\n .then((res) => {\r\n if (res.flag) {\r\n if (res.info.type == 'different') {\r\n self.toastr.error(\"This email already exists, please sign in or use a different email.\");\r\n } else {\r\n self.toastr.error(\"Email already exists.\");\r\n }\r\n } else {\r\n // Subdomain unique validation\r\n this.Auth.subdomaincheck(angular.lowercase(this.user.subdomain), angular.lowercase(this.user.email), \"signup\")\r\n .then((res) => {\r\n if (res.flag) {\r\n self.toastr.error(\"Site name already exists.\");\r\n } else {\r\n self.processTransaction(parameters);\r\n }\r\n });\r\n }\r\n });\r\n }\r\n }\r\n } else {\r\n // Update a subscription\r\n self.emailContent = {};\r\n // Payment gateway code\r\n var nonce = (typeof this.payment.nonce != 'undefined') ? this.payment.nonce : '';\r\n if (this.isCurrentPlanFlag && emptyaddons.length > 0 && this.currentUser.tenant_license.is_active) {\r\n // add extras case\r\n var planId = \"\";\r\n } else {\r\n // modify plan case\r\n var planId = \"plan\" + this.cart.package_id;\r\n }\r\n\r\n var subdomainName = angular.lowercase(this.user.subdomain);\r\n var company = this.billing.company;\r\n var vat_number = this.billing.vat_number_cb; // trimmed vat number\r\n var customerEmail = this.user.email;\r\n var password = this.user.password;\r\n var firstName = this.billing.first_name;\r\n var lastName = this.billing.last_name;\r\n var streetAddress = this.billing.street_address;\r\n var streetAddressLine2 = this.billing.street_address_line2;\r\n var customerCity = this.billing.city;\r\n var customerZip = this.billing.zip;\r\n var customerCountry = this.billing.country;\r\n var currentDt = new Date().getTime();\r\n\r\n // Prepare subscription params\r\n this.checkout = {\r\n billing_address: {\r\n first_name: firstName,\r\n last_name: lastName,\r\n line1: streetAddress,\r\n line2: streetAddressLine2,\r\n city: customerCity,\r\n state: \"\",\r\n zip: customerZip,\r\n country: customerCountry,\r\n company: this.billing.company\r\n }\r\n };\r\n\r\n // add job title\r\n this.checkout.job_title = (this.cart.purchase_type == \"company\") ? this.billing.job_title : \"\";\r\n\r\n // if previous plan trial and type company then pass vat number otherwise not\r\n if (this.cart.purchase_type == \"company\") {\r\n this.checkout.customer = {\r\n vat_number: vat_number\r\n };\r\n }\r\n\r\n // chargebee addons json values i.e. total addons\r\n if (!this.currentUser.tenant_license.is_active) {\r\n // cancelled state handling\r\n this.checkout.plan_id = planId;\r\n this.checkout.addons = this.cart.totaladdons;\r\n } else if (this.isCurrentPlanFlag && emptyaddons.length > 0 && this.currentUser.tenant_license.is_active) {\r\n // add extras case\r\n this.checkout.addons = this.cart.totaladdons;\r\n } else {\r\n // modify plan case\r\n this.checkout.plan_id = planId;\r\n this.checkout.addons = this.cart.totaladdons;\r\n }\r\n\r\n // set replace addon param based on plan interval\r\n this.checkout.replace_addon_list = (this.cart.planduration == this.cart.old_package_interval) ? false : true;\r\n\r\n // downgrade case: apply changes on renewal\r\n if (this.cart.end_of_term) {\r\n this.checkout.end_of_term = this.cart.end_of_term;\r\n }\r\n\r\n if (nonce != \"\") {\r\n var TokenDetails = {\r\n tmp_token: nonce\r\n };\r\n this.checkout.card = TokenDetails;\r\n }\r\n // apply only in trial to paid plan case\r\n this.checkout.is_trial_to_paid = false;\r\n if (this.cart.is_trial) {\r\n this.checkout.prorate = false;\r\n this.checkout.is_trial_to_paid = true;\r\n }\r\n\r\n // append purchase type\r\n this.checkout.purchase_type = this.cart.purchase_type;\r\n\r\n // license agent reset metric param\r\n this.cart.package_type = \"\";\r\n if (!this.isCurrentPlanFlag) {\r\n this.cart.package_type = \"new\";\r\n }\r\n\r\n // reactivate param\r\n if (this.currentsubscription.subscription.status == \"cancelled\") {\r\n this.checkout.reactivate = true;\r\n // license agent reset metric param\r\n this.cart.package_type = \"new\";\r\n }\r\n\r\n //Update current subscription\r\n self.showSpinner = true;\r\n self.$http({\r\n method: 'POST',\r\n url: self.baseUrl + '/api/v1/updatesubscription',\r\n data: {\r\n subscription_params: self.checkout\r\n }\r\n }).success(function (data) {\r\n\r\n // Chargebee generic error handling\r\n if (data.error) {\r\n self.showSpinner = false;\r\n self.toastr.error(data.error.error_msg);\r\n } else {\r\n var cbResponse = data.result;\r\n\r\n // Taxes VAT\r\n var is_taxed = false;\r\n var tax_rate = \"\";\r\n var line_items = (typeof cbResponse.invoice != \"undefined\") ? cbResponse.invoice.line_items : [];\r\n if (line_items.length > 0) {\r\n is_taxed = (typeof line_items[0].is_taxed != \"undefined\") ? line_items[0].is_taxed : false;\r\n tax_rate = (typeof line_items[0].tax_rate != \"undefined\") ? line_items[0].tax_rate : \"\";\r\n }\r\n // email template params\r\n parameters.body_content.is_taxed = is_taxed;\r\n parameters.body_content.tax_rate = tax_rate;\r\n\r\n // license data\r\n self.licenceDetail.machine_info = '';\r\n self.licenceDetail.start_date = self.currentUser.tenant_license.created_dt;\r\n if (self.isCurrentPlanFlag && emptyaddons.length > 0) {\r\n // add extras case\r\n var expiredDt = self.currentUser.tenant_license.expired_dt;\r\n } else {\r\n // modify plan case\r\n var nextBilling = new Date(cbResponse.subscription.next_billing_at * 1000);\r\n var expiredDt = nextBilling.getTime();\r\n }\r\n self.licenceDetail.expiry_date = expiredDt;\r\n self.licenceDetail.name = self.cart.package_name;\r\n self.licenceDetail.features = self.features;\r\n self.licenceDetail.metrics = self.selectedMetrics;\r\n self.licenceDetail.tenant = {\r\n 'tenant_uid': \"\",\r\n 'email': self.user.email\r\n };\r\n self.licenseData.license_detail = self.licenceDetail;\r\n // tenant uid of current user\r\n self.licenseData.tenant_uid = \"\";\r\n // license agent reset metric param\r\n self.licenseData.package_type = self.cart.package_type;\r\n\r\n // event log\r\n\r\n self.logdata.tenant_uid = \"\";\r\n self.logdata.current_value = '';\r\n self.logdata.previous_value = self.cart.old_license_data;\r\n self.logdata.user_type = 'user';\r\n self.logdata.updated_by = self.user.tenant_id;\r\n\r\n // prepare tenant license columns obj values\r\n if (self.currentsubscription.subscription.status == \"cancelled\") {\r\n // reactivate out-term case\r\n self.logdata.event_type = 'SUBSCRIPTION_REACTIVATED';\r\n parameters.subject = \"Your account has been reactivated\";\r\n parameters.body_content.email_type = \"reactivate\";\r\n parameters.body_content.term_type = \"out-term\";\r\n var columnvalues = { '_id': self.currentUser.tenant_license._id, 'plan_id': planId, 'license_detail': self.cart.license_detail, 'license_data': self.licenseData, 'expired_dt': expiredDt, 'is_active': true, 'canceled_dt': null, 'logdata': self.logdata };\r\n self.$gammaAnalytics.setAnalytics('Subscription Reactivated', self.currentUser.mixpanel_id);\r\n } else {\r\n if (self.isCurrentPlanFlag && emptyaddons.length > 0) {\r\n // change subscription with only addons case\r\n self.logdata.event_type = 'SUBSCRIPTION_ADDON_ADDED';\r\n parameters.subject = \"Gamma account modified\";\r\n parameters.body_content.email_type = \"extras\";\r\n var columnvalues = { '_id': self.currentUser.tenant_license._id, 'license_detail': self.cart.license_detail, 'license_data': self.licenseData, 'logdata': self.logdata };\r\n self.$gammaAnalytics.setAnalytics('Subscription addon added', self.currentUser.mixpanel_id);\r\n } else {\r\n // change subscription with different plan and addons case\r\n self.logdata.event_type = 'SUBSCRIPTION_UPDATED';\r\n parameters.subject = (self.cart.has_scheduled_changes) ? \"Your account has been downgraded\" : ((self.cart.is_trial) ? \"Thank you for purchasing Gamma\" : \"Your account has been upgraded\");\r\n parameters.body_content.email_type = (self.cart.has_scheduled_changes) ? \"downgrade\" : ((self.cart.is_trial) ? \"trial-to-paid\" : \"upgrade\");\r\n var columnvalues = { '_id': self.currentUser.tenant_license._id, 'plan_id': planId, 'license_detail': self.cart.license_detail, 'license_data': self.licenseData, 'expired_dt': expiredDt, 'logdata': self.logdata };\r\n self.$gammaAnalytics.setAnalytics('Subscription Updated', self.currentUser.mixpanel_id, { 'plan': self.cart.package_name, 'company': self.billing.company });\r\n\r\n // Update intercom\r\n var intercomUser = {\r\n user_id: self.currentUser.intercom_id,\r\n 'company': self.billing.company\r\n };\r\n self.$intercom.update(intercomUser);\r\n }\r\n }\r\n\r\n // date conversion\r\n var currentTermStart = self.filter('date')((cbResponse.subscription.current_term_start * 1000), 'dd.MM.yyyy');\r\n var currentTermEnd = self.filter('date')((cbResponse.subscription.current_term_end * 1000), 'dd.MM.yyyy');\r\n var nextBillingAt = self.filter('date')((cbResponse.subscription.next_billing_at * 1000), 'dd.MM.yyyy');\r\n // request body params\r\n parameters.body_content.package_info.billing_period = cbResponse.subscription.billing_period;\r\n parameters.body_content.package_info.billing_period_unit = cbResponse.subscription.billing_period_unit;\r\n parameters.body_content.package_info.current_term_start = currentTermStart;\r\n parameters.body_content.package_info.current_term_end = currentTermEnd;\r\n parameters.body_content.package_info.next_billing_at = nextBillingAt;\r\n // parameters.body_content.verify_link = self.currentUser.hash;\r\n\r\n // invoice details attached\r\n if (cbResponse.invoice != undefined && cbResponse.invoice != \"\") {\r\n parameters.body_content.invoice_id = cbResponse.invoice.id;\r\n parameters.body_content.invoice_name = cbResponse.invoice.id;\r\n }\r\n\r\n // additional\r\n parameters.shoot_mail = true;\r\n columnvalues.template_data = parameters;\r\n\r\n // downgrade case: apply changes on renewal : not in use\r\n if (self.cart.has_scheduled_changes) {\r\n // do not update tenant license data\r\n // send mail\r\n // self.$http({\r\n // method: 'POST',\r\n // url: self.baseUrl + '/shootmail',\r\n // data: parameters\r\n // }).success(function (data) {\r\n // // callback\r\n // self.showSpinner = false;\r\n // window.location.href = \"account\";\r\n // });\r\n } else {\r\n // upgrade case: apply changes immediately\r\n // do update tenant license data\r\n self.TenantLicenseResource.save(columnvalues).$promise.then(data => {\r\n // redirect\r\n self.showSpinner = false;\r\n window.location.href = \"account\";\r\n });\r\n }\r\n }\r\n\r\n }).catch((err) => {\r\n // Error\r\n self.state.go('changeplan');\r\n });\r\n }\r\n }", "title": "" }, { "docid": "ab7a5ed4c0c182827c2afec9e1d414a3", "score": "0.5456031", "text": "function Main({plans,setBuyPlanModal}) {\n return (\n <Layout>\n <Head>\n <title>Hellol</title>\n </Head>\n <PlanForm setBuyPlanModal={setBuyPlanModal} \n plan={plans}/>\n <Carousel/> \n <PlansSection plans={plans}/>\n </Layout>\n );\n}", "title": "" }, { "docid": "dbf338be23c9d6a52fb2f44399bbd487", "score": "0.54402035", "text": "function handleSubmit(event) {\n\n event.preventDefault();\n // TODO: Prevent the page from reloading\n const {items, quantity} = event.target;\n console.log(items.value);\n\n // Do all the things ...\n addSelectedItemToCart(items.value, quantity.value);\n cart.saveToLocalStorage();\n updateCounter(items.value, quantity.value);\n updateCartPreview(items.value, quantity.value);\n let comfirmation = document.createElement('div');\n comfirmation.innerText = 'Added To Cart';\n comfirmation.setAttribute('id','order');\n let parentEl = document.getElementById('cartContents');\n parentEl.appendChild(comfirmation);\n\n}", "title": "" }, { "docid": "595dc9826963d44a69713eb79a80bd4d", "score": "0.5432794", "text": "function handleNewItemSubmit(){\n //Have an event listener listen to when user adds and submits form \n $('.js-submit-button').click(event=>{\n //prevent the default (this is a submit button)\n event.preventDefault();\n //Get the name of the new item \n const itemName = $('.js-shopping-list-entry').val();\n //Clear the text area for next potential input\n $('.js-shopping-list-entry').val('');\n //Call a function that creates a new object representing the added item and adds it to STORE\n addItemToShoppingList(itemName);\n //Render the page again \n renderShoppingList();\n });\n}", "title": "" }, { "docid": "6cf418ab6ffd615c8d1128fe226511aa", "score": "0.54236776", "text": "render() {\n return (\n this.state.cart ? this.renderCart() : this.renderItem()\n );\n }", "title": "" }, { "docid": "f3f41606a58fcb5f3b43b882c3f0b7a5", "score": "0.5421158", "text": "function display_shopping_cart() {\n subtotal = 0;\n str = '';\n if (`${session.username}` != 'undefined') {\n str += `<p>${session.username}'s Shopping Cart</p>`\n } else {\n str += `<p>Your Shopping Cart</p>\n <input id=\"purchaseCart\" type=\"submit\" value=\"Continue to Checkout\">`\n }\n for (i = 0; i < products.length; i++) {\n POST = store_quantities; //Gets the POST requests stored from store.html\n p = POST[`quantity${i}`];\n /* Based on order_page.html of Lab 12 completed by me*/\n if (p > 0) {\n extended_price = p * products[i].price\n subtotal += extended_price;\n str += (`\n <tr>\n <td width=\"43%\">${products[i].name}</td>\n <td width=\"13%\">\\$${products[i].price.toFixed(2)}</td>\n <td align=\"center\" width=\"11%\"><input type=\"number\" min=\"1\" name=\"cartquantity${i}\" value=\"${p}\"></td>\n </tr>\n \n `);\n }\n }\n return str;\n}", "title": "" }, { "docid": "efc48509a11e64ab7415d0ee84dcd8f6", "score": "0.5417754", "text": "_content_view() {\n let is_my_bajoo = this.storage && this.storage.name === 'MyBajoo';\n let allow_edit = this.storage && this.storage.rights.admin && !is_my_bajoo;\n\n return m('form', {onsubmit: () => {this.submit(); return false;}}, [\n m('.checkbox', m('label', [\n m('input[type=checkbox][readonly][disabled]', {\n checked: this.storage && this.storage.is_encrypted\n }),\n this.storage ? (this.storage.is_encrypted ?\n _('This share is encrypted') :\n _('This share is not encrypted')) : ''\n ])),\n StatusAlert.make(this.status),\n m('fieldset', {disabled: this.is_loading}, [\n m('.form-group', [\n m('label', _('Name')),\n allow_edit ? m('input.form-control[required]', {\n placeholder: _('Eg: \\\"Pictures Holidays 2017\\\"'),\n oninput: event => this.storage.name = event.target.value,\n value: this.storage ? this.storage.name : ''\n }) : m('', this.storage ? this.storage.name : '')\n ]),\n m('.form-group', [\n m('label', _('Description')),\n allow_edit ? m('textarea.form-control', {\n oninput: event => this.storage.description = event.target.value,\n value: this.storage ? this.storage.description : ''\n }) : m('', this.storage ? this.storage.description : '')\n ]),\n m('.form-group', [\n m('label', _('Member list')),\n this.diff_list ?\n StorageMemberList.make(this.diff_list, app.user, allow_edit) :\n m('', _('Loading ...'))\n ]),\n this._control_btn_view(is_my_bajoo, allow_edit)\n ]),\n ]);\n }", "title": "" }, { "docid": "88eda68dc2259f82b349ddbeaf1bf2ca", "score": "0.5416361", "text": "resolveOrderFormVisibility () {\n const page = this.page\n const feePaid = !this.hasFeePending()\n const assetsAreSupported = this.assetsAreSupported()\n const base = this.market.base\n const quote = this.market.quote\n const hasWallets = base && app.assets[base.id].wallet && quote && app.assets[quote.id].wallet\n\n if (feePaid && assetsAreSupported && hasWallets) {\n Doc.show(page.orderForm)\n return\n }\n\n Doc.hide(page.orderForm)\n }", "title": "" }, { "docid": "e41d90e003771d7b1205e4276029a30b", "score": "0.5410645", "text": "function Cart () {\n return (\n <div className='Cart'>\n <NewNavbar />\n <Header />\n <MyCart />\n <RelatedProducts />\n <Subscribe />\n <Footer />\n <Scripts />\n </div> \n )\n \n}", "title": "" }, { "docid": "2cdcea4f183f65c36418cac946f2e950", "score": "0.5408678", "text": "function bundleOrderAddtoCart(id, pressedButton, sku){\n var formId = 'product-add-to-cart-form_' + id;\n bundleOrderProductAddToCartForm = new VarienForm('product-add-to-cart-form_' + id);\n bundleOrderProductAddToCartForm.submit = function(button) {\n if (this.validator.validate()) {\n if($('attribute142_'+id).value){\n if (button && button != 'undefined') {\n $(button).disabled = true;\n }\n var submitButton = button;\n new Ajax.Request(cartAjaxUrl, {\n method: 'post',\n parameters: Form.serialize(formId),\n onSuccess: function(transport) {\n data = transport.responseText.evalJSON();\n $('message-'+sku).update(data.message).show();\n new Effect.Highlight('message-'+sku, {\n startcolor: '#ffffff',\n endcolor: '#eeeeee'\n });\n $('top-cart').replace(data.topcart);\n Enterprise.TopCart.initialize('topCartContent');\n //Enterprise.TopCart.showCart(3);\n $(button).disabled = false;\n }\n });\n } else {\n jQuery('#product-add-to-cart-form_'+id).find('.size-trigger').css('color','#D91A00');\n jQuery('#product-add-to-cart-form_'+id).find('.size-trigger').css('border-color','#D91A00');\n }\n }\n };\n\n bundleOrderProductAddToCartForm.submit(pressedButton);\n}", "title": "" }, { "docid": "4358dc7a91c4c515066baf2c6ae9ee51", "score": "0.5408492", "text": "render() {\n return (\n <div className=\"row\">\n <div className=\"col-sm-9 col-md-8 col-lg-8\">\n <div className='orders-container'>\n <div className='orders-title-container'>\n Orders\n </div>\n <div className='orders-detail-container'>\n {this.orderDetail()}\n </div>\n </div>\n </div>\n <div className=\"col-sm-3 col-md-4 col-lg-4\">\n <div className=\"form-main-container\">\n <Forms userId={this.props.routeParams._id} />\n </div>\n </div>\n <Link to=\"/\" className=\"signout_button\">Sign out</Link>\n </div>\n );\n }", "title": "" }, { "docid": "add406a7c247140aa01430005c6ce90a", "score": "0.5405653", "text": "render(){\n\n const {product, loading}=this.state;\n return (\n <div className=\"App\">\n <Navbar\n count={this.getCartCount()}\n />\n <button onClick={this.addProduct} style={{padding: 20, fontSize:20}}>Add a Poduct</button>\n <Cart\n products={product} \n key={product.id}\n onIncrease={this.increaseQty}\n onDecrease={this.decreaseQty}\n onDelete={this.deleteProduct} \n />\n {loading && <h1>Loading Products .....</h1>}\n <div><h3 style={{padding: 20, fontSize:20}}>Total : {this.getCartTotal()}</h3></div>\n </div>\n );\n }", "title": "" }, { "docid": "69f208bfeed9b175940557115f499d7f", "score": "0.5402821", "text": "mounted(product, index) {\n\t\t\t\t\tView.getRef(\"name\", this).href = `/?productId=${product.id}`;\n\n\t\t\t\t\t// update product image\n\t\t\t\t\tthis.querySelector(\n\t\t\t\t\t\t\".img\"\n\t\t\t\t\t).style.backgroundImage = `url(${product.image})`;\n\n\t\t\t\t\tthis.querySelector(\".actions .del\").addEventListener(\"click\", (e) => {\n\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\tconst sure = confirm(\n\t\t\t\t\t\t\t\"Are you sure you want to remove this item from cart ?\"\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// if sure remove from cart\n\t\t\t\t\t\tsure && Cart.removeItem(index);\n\t\t\t\t\t});\n\n\t\t\t\t\t// Initialize quantity controls\n\t\t\t\t\tconst quantityField = this.querySelector(\".quantity-field\");\n\n\t\t\t\t\tthis.querySelectorAll(\".quantity-selector .ctrl\").forEach((ctrl) => {\n\t\t\t\t\t\tctrl.addEventListener(\"click\", () => {\n\t\t\t\t\t\t\tlet value = parseInt(quantityField.value);\n\n\t\t\t\t\t\t\tswitch (ctrl.dataset.function) {\n\t\t\t\t\t\t\t\tcase \"add\":\n\t\t\t\t\t\t\t\t\tquantityField.value = ++value;\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"sub\":\n\t\t\t\t\t\t\t\t\tif (value > 1) quantityField.value = --value;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Update item in storage\n\t\t\t\t\t\t\tCart.updateItem(index, {\n\t\t\t\t\t\t\t\tquantity: quantityField.value,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tif (Cart.appliedPromoCode) {\n\t\t\t\t\t\t\t\tUtils.wait(800).then(() => {\n\t\t\t\t\t\t\t\t\t// Update discount value\n\t\t\t\t\t\t\t\t\tView.update(\n\t\t\t\t\t\t\t\t\t\t\"discount\",\n\t\t\t\t\t\t\t\t\t\tView.getVar(\"sub-total\") / 2,\n\t\t\t\t\t\t\t\t\t\torderSummary\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t// Reapply discount\n\t\t\t\t\t\t\t\t\tView.update(\n\t\t\t\t\t\t\t\t\t\t\"total-checkout\",\n\t\t\t\t\t\t\t\t\t\tView.getVar(\"sub-total\") / 2,\n\t\t\t\t\t\t\t\t\t\torderSummary\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}", "title": "" }, { "docid": "3bcdb90937d01c3c05dc78f768e7dabe", "score": "0.54022956", "text": "function handleSubmit(event) {\n\n // Prevent the page from reloading\n event.preventDefault();\n\n // Do all the things ...\n addSelectedItemToCart();\n saveCartToLocalStorage();\n updateCounter();\n updateCartPreview();\n\n}", "title": "" }, { "docid": "6e1cf00d67a45099cfc6f496ca6137a2", "score": "0.53935045", "text": "render() {\n var subtotal = this.getSubtotal()\n var tax = this.getTax(subtotal)\n var total = this.getTotal(subtotal, tax)\n\n if (this.props.onCheckout == \"True\") { // if on the checkout page, exclude quantity-change functionality\n return (\n <span>\n {this.renderCartItems()}\n <h3>subtotal: ${subtotal.toFixed(2)}</h3>\n <h4>tax ({this.props.constants.TAX_PERCENT}%): ${tax.toFixed(2)}</h4>\n <h4>shipping: ${this.props.constants.SHIPPING_COST.toFixed(2)}</h4>\n <h2><span className=\"yellow-highlight\">total: ${total.toFixed(2)}</span></h2>\n </span>\n );\n } else {\n return (\n <div id=\"shopping-cart\">\n <span className=\"align-text-svg\"><h1>shopping bag</h1><svg height=\"35\" viewBox=\"0 0 21 21\" width=\"35\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m2.42575356.50254623 8.09559774-.00228582c.5209891-.0001471.9548019.39973171.9969972.91900928l.8938128 10.99973961c.0447299.5504704-.3652538 1.0329756-.9157242 1.0777056-.0269414.0021892-.0539605.0032851-.0809907.0032851h-9.83555122c-.55228475 0-1-.4477152-1-1 0-.0255993.00098299-.0511891.00294679-.076713l.84614072-10.99745378c.0400765-.52088193.4743495-.92313949.99677087-.92328699zm7.07424644 3.64272599v1c0 1.10456949-1.8954305 1.35472778-3 1.35472778s-3-.3954305-3-1.5v-1\" fill=\"none\" stroke=\"#2a2e3b\" strokeLinecap=\"round\" strokeLinejoin=\"round\" transform=\"translate(4 4)\"/></svg>\n </span>\n {this.renderCartItems()}\n <h3>subtotal: ${subtotal.toFixed(2)}</h3>\n <h4>tax ({this.props.constants.TAX_PERCENT}%): ${tax.toFixed(2)}</h4>\n <h4>shipping: ${this.props.constants.SHIPPING_COST.toFixed(2)}</h4>\n <h2>total: ${total.toFixed(2)}</h2>\n <Link to=\"/checkout\" className=\"button unstyled-link\">checkout</Link>\n </div>\n );\n }\n }", "title": "" }, { "docid": "385c06e82594ed8bf6c0ecc2064929b5", "score": "0.5391155", "text": "function handleSubmit(event) {\n\n // TODO: Prevent the page from reloading\n event.preventDefault();\n\n // Do all the things ...\n addSelectedItemToCart();\n cart.saveToLocalStorage();\n updateCounter();\n updateCartPreview();\n\n}", "title": "" }, { "docid": "ecc580107cf4ee9f423cead9fbc7eb8b", "score": "0.5389952", "text": "function _checkoutCart() {\n var $form = $('form.cart-wrap');\n for(var i = 0; i < cart.length; ++i) {\n $(\"<input type='hidden' name='quantity_\" + (i+1) + \"' value='\" + cart[i].quantity + \"'>\" +\n \"<input type='hidden' name='item_name_\" + (i+1) + \"' value='\" + cart[i].title + \"'>\" +\n \"<input type='hidden' name='item_number_\" + (i+1) + \"' value='nb-\" + cart[i].id + \"'>\" +\n \"<input type='hidden' name='amount_\" + (i+1) + \"' value='\" + cart[i].price + \"'>\")\n .appendTo($form);\n }\n // PayPal so goddamn slow\n $('.cart').addClass('loading');\n setTimeout(function() {\n $form.submit();\n }, 150);\n }", "title": "" }, { "docid": "d8ce78b140819bd085bca8ac04c3a2c0", "score": "0.5378539", "text": "function Checkout() {\n const [{ cart }, dispatch] = useStateValue();\n\n return (\n <div className=\"checkout\">\n\n <div className=\"checkout_cart\">\n <img className=\"checkout_ad\" src=\"https://images-na.ssl-images-amazon.com/images/G/01/credit/img16/CCMP/newstorefront/YACC-desktop-prime-banner2.jpg\" alt=\"amazon ad\" />\n\n <div className=\"checkout_title\">\n <h2>Your Shopping Cart</h2>\n\n {/* render shopping items here */}\n {cart.map(item => (\n <CheckoutProduct \n id={item.id}\n title={item.title}\n image={item.image}\n price={item.price}\n rating={item.rating}\n />\n ))}\n </div>\n </div>\n\n <div className=\"checkout_continue\">\n <Subtotal/>\n </div>\n\n </div>\n );\n}", "title": "" }, { "docid": "450626fe7ff63081ce966795d8c2f03c", "score": "0.5374344", "text": "cartLogic() {\n clearCartBtn.addEventListener('click', () => {\n this.clearCart();\n });\n cartContent.addEventListener('click', event => {\n if(event.target.classList.contains('remove-item')) {\n cartContent.removeChild(event.target.parentElement.parentElement);\n this.removeItem(event.target.dataset.id);\n } else if (event.target.classList.contains(\"fa-chevron-up\")) {\n let tempItem = cart.find(item => item.id == event.target.dataset.id);\n tempItem.amount = tempItem.amount + 1;\n Storage.saveCart(cart);\n this.setCartValues(cart);\n event.target.nextElementSibling.innerText = tempItem.amount;\n } else if (event.target.classList.contains(\"fa-chevron-down\")) {\n let tempItem = cart.find(item => item.id === event.target.dataset.id);\n tempItem.amount = tempItem.amount - 1;\n if(tempItem.amount > 0) {\n Storage.saveCart(cart);\n this.setCartValues(cart);\n event.target.previousElementSibling.innerText = tempItem.amount;\n } else {\n cartContent.removeChild(event.target.parentElement.parentElement);\n this.removeItem(event.target.dataset.id);\n }\n }\n });\n }", "title": "" }, { "docid": "c479bc37ae1a9ded7c5e427f31c62229", "score": "0.53719485", "text": "function initCart() {\n id(\"shopping-cart\").addEventListener(\"click\", () => switchToView(\"cart\"));\n id(\"submit-order\").addEventListener(\"click\", submitOrder);\n }", "title": "" }, { "docid": "f0c7ff37f21f9092f6f65dcec45d98c1", "score": "0.53591883", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n updateCounter();\n}", "title": "" }, { "docid": "b790ff7570e845608c8636686327595b", "score": "0.53558725", "text": "function bindCartForm(selector) {\n $(selector).find('#add_to_cart form, .cart_form form').submit(function() {\n showLightBox();\n var form = $(this);\n $.post(this.action, form.serializeArray(),\n function(data) {\n intoLightBox(data);\n },\n \"text\");\n\n return false;\n });\n }", "title": "" }, { "docid": "3e050e829429229ab451474ba209f46e", "score": "0.5331452", "text": "render() {\n return (\n <div>\n <div className=\"page-header\">\n <div className=\"content-container\">\n <h1 className=\"page-header__title\">Add Expense</h1>\n </div>\n </div>\n <div className=\"content-container\">\n <ExpenseForm onSubmit={this.onSubmit} />\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "459f4c94ad7cbf636bbfa1e971a807ca", "score": "0.5327182", "text": "renderQuestionForm() {\n if (this.state.addNew || this.state.editViewEnabled) {\n if (this.state.addNew && this.state.editViewEnabled) {\n throw \"Error in renderQuestionForm: both addNew and editViewEnabled are true\";\n }\n\n let type = this.state.addNew ? newFormType : editFormType;\n let form = (type === newFormType) ? this.state.newForm\n : this.state.editViewItem;\n\n \treturn <QuestionForm type={type}\n form={form}\n updateFormTitle={this.updateFormTitle}\n updateQuestion={this.updateQuestionText}\n navbar={this.renderQuestionFormNavbar(type)}\n upDownArrows={this.upDownArrows()}\n deleteQuestion={this.deleteQuestion}\n markActiveQuestion={this.markActiveQuestion}\n clearActiveQuestion={this.clearActiveQuestion}\n activeIdx={this.state.activeIdx}/>;\n }\n }", "title": "" }, { "docid": "1c386ca1896487df58455c1783ed724b", "score": "0.53251415", "text": "constructor(props) {\n super(props);\n this.state = {\n productsToAddToCart: [], // _.get(this.props, 'currentUser.wishListItems', []), // [], // _.get(props, 'currentUser.wishListItems', []),\n isQuantitySet: false,\n selectedItems: [],\n isAllSelectItemsSelected: false,\n isHidden: 'hidden',\n modalActive: false,\n isFetching: true,\n isInventoryFetching: true,\n currentSuburb: _.get(props, 'currentUser.suburb.id', '')\n };\n this.handleSelectProduct = this.handleSelectProduct.bind(this);\n this.handleSelectAllProduct = this.handleSelectAllProduct.bind(this);\n this.changeProductSize = this.changeProductSize.bind(this);\n this.renderProductsTabel = this.renderProductsTabel.bind(this);\n this.renderAddItemToCartElm = this.renderAddItemToCartElm.bind(this);\n this.renderDeliveryModal = this.renderDeliveryModal.bind(this);\n this.renderEmptyListDetail = this.renderEmptyListDetail.bind(this);\n\n this.trackAddRemoveAnalytics = this.trackAddRemoveAnalytics.bind(this);\n }", "title": "" }, { "docid": "e3bb7c1af4e01ef1022da58bfec1c248", "score": "0.5323815", "text": "render() {\n return (\n <div className=\"shop\">\n\t\t\t\t{/*Include functional components of products that will house the product image in its name and price*/}\n\t\t\t\t<div id=\"products\">\n\t\t\t\t\t<Calculator cart={this.state.cart} isLoggedIn={this.isLoggedIn_} captureQty={this.captureQty.bind(this)} addRemoveProduct={this.addRemoveProduct.bind(this)} setProduct={this.setProduct.bind(this)} />\n\t\t\t\t\t<Weather cart={this.state.cart} isLoggedIn={this.isLoggedIn_} captureQty={this.captureQty.bind(this)} addRemoveProduct={this.addRemoveProduct.bind(this)} setProduct={this.setProduct.bind(this)} />\n\t\t\t\t\t<Search cart={this.state.cart} isLoggedIn={this.isLoggedIn_} captureQty={this.captureQty.bind(this)} addRemoveProduct={this.addRemoveProduct.bind(this)} setProduct={this.setProduct.bind(this)} />\n\t\t\t\t</div>\n\t\t\t\t<div id=\"controls\">\n\t\t\t\t\t<button id=\"checkout\" onClick={() => {this.checkOut()}}>Checkout</button>\n\t\t\t\t\t<label id=\"forLogin\" htmlFor=\"login\">email: <input id=\"login\" readOnly={this.isLoggedIn_} onChange={(event) => {this.handleInput(event.target.value)}}></input><button id=\"loginBtn\" onClick={() => {this.login(this.userLoggedIn_, this.state.logAction)}}>{this.state.logAction}</button></label>\n\t\t\t\t\t<label id=\"forTotal\" htmlFor=\"total\">Session hour(s): {this.state.total}</label>\n\t\t\t\t\t<button id=\"showCart\" onClick={() => {this.showCart()}}>Cart</button>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"stageDescription\">\n\t\t\t\t\t{(Object.keys(this.state.data).length !== 0) ? <RenderApplicationDetails data={this.state.data}/> : (this.state.checkout === true) ? <Request captureInput={this.captureInput.bind(this)} processOrder={this.processOrder.bind(this)}/> : <h1>Click on product to show its properties.</h1>}\n\t\t\t\t</div>\n\t\t\t</div>\n );\n }", "title": "" }, { "docid": "1174eb42f01651967938fa273dca0a68", "score": "0.532095", "text": "function handleShoppingList(){\n\nhandleDeleteitemClicked();\nhandleItemCheckClicked();\nhandleNewItemSubmit();\nrenderShoppingList();\n\n}", "title": "" }, { "docid": "8ce30dae895057d74dec2aafb7bfd4b5", "score": "0.53066754", "text": "function addToCart(e) {\n e.preventDefault();\n let parent = e.currentTarget.parentNode.parentNode;\n let productEl = e.currentTarget.parentNode;\n let itemId = productEl.id;\n parent.removeChild(productEl);\n\n //attr object for the many attributes of qty input field\n let attr = {\n type: \"number\",\n value: \"1\",\n min: \"1\",\n max: \"20\"\n };\n\n //change text in cart when items added\n let prodCartText = document.querySelector(\".prod-cart-text\");\n if (prodCartText.textContent !== \"Products in your shopping cart\") {\n prodCartText.textContent = \"Products in your shopping cart\";\n unhide(\".cart-details\", \".total\", \".continue\");\n }\n\n //get matching id details from list, for the item being added\n let [productItem] = list.filter(el => el.id == itemId);\n\n //create elements to be added in cart\n let cartDetails = document.querySelector(\".cart-details\");\n let itemDetails = createProduct(\"div\", cartDetails, \"item-details\", null);\n itemDetails.id = itemId;\n let prodName = createProduct(\n \"div\",\n itemDetails,\n \"prod-detail\",\n productItem.name\n );\n let description = document.createElement(\"i\");\n description.classList.add(\"fas\", \"fa-info-circle\");\n prodName.appendChild(description);\n prodName.setAttribute(\n \"title\",\n productItem.description || \"no description available\"\n );\n\n let qty = createProduct(\"input\", itemDetails, \"quantity-detail\", null);\n setInputAttributes(attr, qty);\n qty.oninput = updatePrice;\n\n let prodPrice = createProduct(\"div\", itemDetails, \"price-div\", null);\n let prodVal = createProduct(\n \"span\",\n prodPrice,\n \"value-detail\",\n fx(productItem.price)\n .from(fx.base)\n .to(currTarget)\n .toFixed(2)\n );\n\n let prodCurrency = document.createElement(\"span\");\n prodCurrency.setAttribute(\"data-curr\", currSym);\n prodCurrency.textContent = prodCurrency.getAttribute(\"data-curr\");\n prodVal.classList.add(\"value\");\n prodPrice.insertBefore(prodCurrency, prodVal);\n\n //if qty field was created, start calculating total\n if (qty) {\n calculateTotal();\n }\n\n //delete button\n let deleteIcon = createProduct(\"i\", itemDetails, \"delete-icon\", null);\n deleteIcon.classList.add(\"far\", \"fa-trash-alt\");\n deleteIcon.onclick = removeCartItem;\n }", "title": "" }, { "docid": "18cda83de4020fe8196b611dde78ffa4", "score": "0.5304454", "text": "static init() {\n const shop = new Shop();\n //shop.render(); // run render before this.cart because the \n this.cart = shop.cart;\n \n }", "title": "" }, { "docid": "0051301099000e4b8f004929f795317a", "score": "0.53013384", "text": "function Calculator(props) {\n let trackList = [\"Version: 1.0.1\", \"Private: true\", \"Distribution: Prohibited\", \"Dependancies: mathjs, react, react-scripts\", \"Live link: https://heroku.com.tigervalley.io\"];\n let info = {\n name: \"Calculator\",\n language: \"JavaScript, html, css\",\n addOn: \"React library, math.js library\",\n defficulty: \"beginner\",\n description: \"A browser rendered calculator thats able to evaluate basic operations. The calculculator uses components and states as well,\",\n trackList: trackList,\n addRemove: function() {\n let action = \"Add to cart\";\n console.log(\"clicked\")\n if(props.isLoggedIn)\n {\n for(let i = 0; i < props.cart.length; i++)\n {\n if(props.cart[i].name === info.name)\n {\n action = \"Remove from cart\";\n } \n }\n }\n\n return (\n <div id=\"productAction\">\n <button id=\"vacation\" onClick={(event) => props.addRemoveProduct(info, action)}>{action}</button>\n <select id=\"selectQty\" onChange={() => props.captureQty(this)}>\n <option value=\"1\">1 hour session</option>\n <option value=\"2\">2 hour session</option>\n <option value=\"3\">3 hour session</option>\n </select>\n </div>\n );\n }\n };\n\n return (\n <article className=\"item vacation\">\n\t\t\t<img type=\"button\" src={Calculator_Image} alt=\"Calculator\" onClick={() => props.setProduct(info)} roundedcircle=\"true\" />\n\t\t\t<h2>Calculator - free for request.</h2>\n\t\t</article>\n );\n}", "title": "" }, { "docid": "d0d502b29fc761ba2610324d2a95d3d8", "score": "0.52996117", "text": "render() {\n let listItemsDom = this.state.marketItems.map((item, index) => {\n return <Item key={index.toString()} name={item.name} amount={item.amount} price={item.price}/>;\n });\n return (\n <div id='main'>\n <ul class=\"list\">\n <li class=\"ulTitle\">\n <span>Product:</span>\n <span>Price:</span>\n <span>Amount:</span>\n </li>\n {listItemsDom}\n <li class=\"liTotalPrice\">Total price: {this.sumPrices()}$</li>\n </ul>\n \n <InputForm submit={this.addItem}/>\n </div>\n )\n }", "title": "" }, { "docid": "1efd4714c3d3e72edafb0d2faa6e828a", "score": "0.5297993", "text": "renderOptionsContainer() {\n return <Form className={\"question-options\"}>{this.renderOptions()}</Form>;\n }", "title": "" }, { "docid": "cfeacb8730725d87a136f455166b6926", "score": "0.5295077", "text": "render() {\r\n const { getFieldDecorator } = this.props.form;\r\n return (\r\n <Form onSubmit={this.handleSubmit} align=\"center\" className=\"login-form\">\r\n <FormItem>\r\n {getFieldDecorator('email', {\r\n rules: [{ required: true, message: 'Please input your email!' }],\r\n })(\r\n <Input\r\n className=\"input\"\r\n prefix={<Icon type=\"user\" />}\r\n size=\"large\"\r\n name=\"email\" \r\n placeholder=\"Email\" /> \r\n )}\r\n </FormItem>\r\n <FormItem>\r\n {getFieldDecorator('password', {\r\n rules: [{ required: true, message: 'Please input your Password!' }],\r\n })(\r\n <Input\r\n className=\"input\"\r\n prefix={<Icon type=\"lock\" />}\r\n size=\"large\"\r\n name=\"password\" \r\n type=\"password\" \r\n placeholder=\"Password\" /> \r\n )}\r\n </FormItem>\r\n <FormItem>\r\n <Button\r\n style={{ borderColor:\"#597ef7\"}}\r\n htmlType=\"submit\" size=\"large\" className=\"login-form-button\">Login</Button>\r\n </FormItem>\r\n </Form>\r\n );//end return\r\n }", "title": "" }, { "docid": "26acf2e05775b83b240708f1f0126b9f", "score": "0.5293644", "text": "addToCart() {\n if (this.hasSizes && !this.size) {\n Toast.create('Morate izabrati veličinu');\n return;\n }\n\n this._dispatch('product:add:cart');\n }", "title": "" }, { "docid": "27af043fea3b04f88d24971429731215", "score": "0.5293076", "text": "function updateCartPreview() {\n // TODO: Get the item and quantity from the form\n // TODO: Add a new element to the cartContents div with that information)\n // var item = document.getElementById('items').value;\n // var li = document.createElement('li');\n // li.textContent = `${item}: ${txtQuantity.value}`;\n // ul.appendChild(li);\n \n}", "title": "" }, { "docid": "e48f4b93a03bd7d1aef8a064badb728e", "score": "0.5292835", "text": "function ShowCart() {\n return (\n <div>\n {cartItems.map((item) => (\n <>\n <CartItem key={item.name} item={item} />\n <Divider />\n </>\n ))}\n <Subtotal />\n </div>\n );\n }", "title": "" }, { "docid": "937dccb17915749ac260d4bbb2f60aad", "score": "0.5287459", "text": "render() {\r\n return (\r\n <div>\r\n <AppBar position=\"static\">\r\n <Toolbar>\r\n <h3>Checkout Calculator</h3>\r\n </Toolbar>\r\n </AppBar>\r\n {/*Grid Level for Two main columns*/}\r\n <Grid\r\n container\r\n spacing={2}\r\n direction=\"row\"\r\n alignItems=\"stretch\"\r\n justify=\"space-evenly\"\r\n >\r\n <Grid item>\r\n <h3 justify=\"left\">Catalog</h3>\r\n <form noValidate autoComplete=\"off\">\r\n <TextField\r\n style={{ marginRight: \"0.8rem\" }}\r\n label=\"Enter Item Name\"\r\n name=\"new_item_name\"\r\n value={this.state.new_item_name}\r\n onChange={this.handleNameChange}\r\n />\r\n <TextField\r\n style={{ marginRight: \"0.8rem\" }}\r\n label=\"Enter Item Price\"\r\n type=\"float\"\r\n name=\"new_item_price\"\r\n value={this.state.new_item_price}\r\n onChange={this.handlePriceChange}\r\n />\r\n <Button\r\n color=\"primary\"\r\n variant=\"outlined\"\r\n style={{ marginTop: \"0.8rem\" }}\r\n onClick={this.createNewItem}\r\n >\r\n Create New Item\r\n </Button>\r\n </form>\r\n\r\n {/*Catalog*/}\r\n <Box\r\n style={{ marginTop: \"0.8rem\" }}\r\n Topwidth={600}\r\n height={370}\r\n border={1}\r\n >\r\n <List component=\"nav\">\r\n {this.state.catalog.map((item) => (\r\n <ListItem\r\n button\r\n onClick={(e) => this.addToCart(item.name, item.price)}\r\n >\r\n {\" \"}\r\n {item.name}\r\n <text style={{ marginLeft: \"auto\" }}>${item.price}</text>\r\n </ListItem>\r\n ))}\r\n </List>\r\n </Box>\r\n </Grid>\r\n\r\n {/*Grid Level for right side of page*/}\r\n <Grid item>\r\n <Grid container spacing={2} direction=\"column\" alignItems=\"center\">\r\n <Grid item>\r\n <h3>Shopping Cart (6 Item Limit)</h3>\r\n </Grid>\r\n\r\n {/*Shopping Cart*/}\r\n <Grid item xs={12} height=\"20rem\">\r\n <Box width={390} height={250} border={1}>\r\n <List component=\"nav\">\r\n {this.state.cart.map((item) => (\r\n <ListItem>\r\n {\" \"}\r\n {item.name}\r\n <text\r\n style={{ marginLeft: \"auto\", marginRight: \"1.2rem\" }}\r\n >\r\n ${item.price} x{item.quantity}\r\n </text>\r\n <ListItemSecondaryAction>\r\n <IconButton\r\n edge=\"end\"\r\n onClick={(e) =>\r\n this.itemIncrement(this.getItemIndex(item.name))\r\n }\r\n >\r\n +\r\n </IconButton>\r\n <IconButton\r\n edge=\"end\"\r\n onClick={(e) =>\r\n this.itemDecrement(this.getItemIndex(item.name))\r\n }\r\n >\r\n -\r\n </IconButton>\r\n </ListItemSecondaryAction>\r\n </ListItem>\r\n ))}\r\n </List>\r\n </Box>\r\n </Grid>\r\n\r\n {/*Add Bags*/}\r\n <Grid item>\r\n <text style={{ fontWeight: \"bold\" }}>\r\n Number of Bags Used:{\" \"}\r\n </text>\r\n {this.state.bags_used}\r\n <Button\r\n variant=\"contained\"\r\n size=\"small\"\r\n onClick={this.bagIncrement}\r\n style={{ marginLeft: \"0.8rem\" }}\r\n >\r\n +\r\n </Button>\r\n <Button\r\n variant=\"contained\"\r\n size=\"small\"\r\n onClick={this.bagDecrement}\r\n >\r\n -\r\n </Button>\r\n </Grid>\r\n\r\n {/*Display Subtotal and Total*/}\r\n <Grid item>\r\n <Box style={{ textAlign: \"center\" }}>\r\n <text style={{ fontWeight: \"bold\" }}>Subotal: </text>$\r\n {parseFloat(this.state.subtotal).toFixed(2)}\r\n <text style={{ fontWeight: \"bold\", marginLeft: \"0.8rem\" }}>\r\n Total:{\" \"}\r\n </text>\r\n ${parseFloat(this.state.subtotal * 1.13).toFixed(2)}\r\n </Box>\r\n\r\n {/*Discount*/}\r\n <form noValidate autoComplete=\"off\">\r\n <TextField\r\n style={{ marginRight: \"1rem\" }}\r\n label=\"Enter Discount Code\"\r\n onChange={this.handleCodeChange}\r\n value={this.state.discount_code}\r\n type=\"text\"\r\n />\r\n <Button\r\n size=\"small\"\r\n color=\"secondary\"\r\n variant=\"outlined\"\r\n style={{ marginTop: \"0.8rem\" }}\r\n onClick={this.applyDiscount}\r\n >\r\n Apply Discount Code\r\n </Button>\r\n </form>\r\n </Grid>\r\n\r\n {/*Checkout and Past Transaction*/}\r\n <Grid item>\r\n <Button\r\n variant=\"contained\"\r\n color=\"secondary\"\r\n onClick={this.checkout}\r\n style={{ marginRight: \"1rem\" }}\r\n >\r\n Checkout\r\n </Button>\r\n <Button\r\n variant=\"contained\"\r\n color=\"primary\"\r\n onClick={this.viewPastTransaction}\r\n >\r\n Past Transaction\r\n </Button>\r\n </Grid>\r\n </Grid>\r\n </Grid>\r\n </Grid>\r\n </div>\r\n );\r\n }", "title": "" }, { "docid": "5815fc3a0c4f17f336df36173871c134", "score": "0.5285741", "text": "postContainerScrub() {\n if (this.required) {\n this.container.classList.add('required');\n this.input.setAttribute('required', 'required');\n }\n if (this.mute) { this.container.classList.add('mute'); }\n if (this.vigilant) { this.container.classList.add('vigilant'); }\n if (this.disabled) { this.container.classList.add('disabled'); }\n\n if (this.hidden) {\n this.container.style.display = 'none';\n this.container.setAttribute('aria-hidden', 'true');\n }\n if ((this.config.value) && (this.config.value.length > 0)) {\n this.container.classList.add('filled');\n }\n if (this.passive) {\n this.pacify();\n } else {\n this.activate();\n }\n if (this.help) {\n this.input.setAttribute('aria-describedby', `${this.id}-help-tt`);\n this.input.setAttribute('aria-labelledby', `${this.id}-label`);\n }\n this.validate(true);\n }", "title": "" }, { "docid": "72ad2b616a705eb401e94c3529d330fb", "score": "0.5274277", "text": "displayProductInCart(item) {\n return (\n <div className=\"item-info\">\n <img className='img' src={item.img} alt=\"Image\" width=\"150\" />\n <div className='text'><b>{item.name}</b></div>\n <div className='text'>{item.gender} | {item.type} </div>\n <div className='text'><b> ${item.price.toFixed(2)}</b></div>\n <div className='text'><b>Quantity: </b>{item.count}</div>\n <IconButton size=\"small\" aria-label=\"subtract\" onClick={() => { this.props.subtractQuantity(item) }}>\n {<ArrowDropDownIcon />}\n </IconButton>\n <IconButton size=\"small\" aria-label=\"add\" onClick={() => { this.props.addQuantity(item) }}>\n {<ArrowDropUpIcon />}\n </IconButton>\n <br />\n <Button variant=\"contained\" color=\"secondary\" startIcon={<DeleteIcon />} onClick={() => this.props.removeFromCart(item)}> Remove </Button>\n </div>\n );\n }", "title": "" }, { "docid": "34098f3a06f0dc6979ac8ec72b2ca72d", "score": "0.5269614", "text": "renderCart() {\n\n if (this.context.cart.length >= 1) {\n return (\n\n <div>\n has something in cart\n </div>\n )\n\n } else {\n return (\n <div>empty</div>\n )\n }\n }", "title": "" }, { "docid": "591c6d98e30a9e6c4ad21629724ecf89", "score": "0.5262052", "text": "function addToCartButtonHandler() {\n\n Cart.addItemToCart(this.itemId,displayCart);\n}", "title": "" }, { "docid": "0744e934fa5e03d456880f39f499ed53", "score": "0.52602595", "text": "render() {\n const { handleCancel, noEdition, itemId, menu } = this.props;\n const { event } = this.state;\n\n return (\n <Segment>\n <Form onSubmit={this.onFornmSubmit}>\n <Form.Field>\n <label>Calories</label>\n <input\n name=\"calories\"\n onChange={this.onInputChange}\n value={event.calories}\n placeHolder=\"Calories\"\n />\n </Form.Field>\n <Form.Field>\n <label>Category</label>\n <input\n name=\"category\"\n onChange={this.onInputChange}\n value={event.category}\n placeholder=\"Category\"\n />\n </Form.Field>\n <Form.Field>\n <label>Description</label>\n <input\n name=\"description\"\n onChange={this.onInputChange}\n value={event.description}\n placeholder=\"Description\"\n />\n </Form.Field>\n <Form.Field>\n <label>Image</label>\n <input\n name=\"image\"\n onChange={this.onInputChange}\n value={event.image}\n placeholder=\"Image\"\n />\n </Form.Field>\n <Form.Field>\n <label>Name</label>\n <input\n name=\"name\"\n onChange={this.onInputChange}\n value={event.name}\n placeholder=\"Name\"\n />\n </Form.Field>\n <Form.Field>\n <label>Price</label>\n <input\n name=\"price\"\n onChange={this.onInputChange}\n value={event.price}\n placeholder=\"Price\"\n />\n </Form.Field>\n <Button positive type=\"submit\">\n Submit\n </Button>\n <Button type=\"button\" onClick={() => noEdition()}>\n Cancel\n </Button>\n </Form>\n </Segment>\n );\n }", "title": "" }, { "docid": "c1dbd51ff460460890fb68857a86cb4d", "score": "0.5259888", "text": "function updateCartPreview() {\n let aTag = document.getElementById('name-link');\n if (aTag !== null) {\n aTag.parentNode.removeChild(aTag);\n }\n // TODO: Get the item and quantity from the form\n // TODO: Add a new element to the cartContents div with that information\n var cartContents = document.getElementById('cartContents');\n var lastItem = cart.items[cart.items.length - 1];\n var p = document.createElement('p');\n p.textContent = 'You added ' + lastItem.quantity + ' ' + lastItem.product;\n cartContents.appendChild(p);\n\n let pLink = document.createElement('p');\n let link = document.createElement('a');\n link.setAttribute('id','name-link');\n link.textContent = 'Good Choice. Click to see your cart!';\n link.href = 'cart.html';\n\n cartContents.appendChild(pLink);\n pLink.appendChild(link);\n document.getElementById('catalog').reset();\n}", "title": "" }, { "docid": "3c9d5974a0df75d0e136f4ce7419868d", "score": "0.5249919", "text": "function init() {\n formElement = $('#cq-commerce-products-bindproducttree-form');\n catalogIdentifierCoralSelectComponent = $('#cq-commerce-products-bindproducttree-catalog-select').get(0);\n catalogIdentifierDataCoralSelectComponent = $('#cq-commerce-products-bindproducttree-catalog-select-data').get(\n 0\n );\n commerceProviderCoralSelectComponent = $('#cq-commerce-products-bindproducttree-provider-select').get(0);\n graphQlClient = $('#cq-commerce-graphql-client').get(0);\n storeView = $('input[name=\"./magentoStore\"]').get(0);\n graphQlProxyPath = $('input[name=\"./magentoGraphqlEndpoint\"]').get(0);\n magentoRootCategoryId = $('input[name=\"./magentoRootCategoryId\"]').get(0);\n language = $('coral-select[name=\"./jcr:language\"]').get(0);\n nameCoralTextfieldComponent = $('#cq-commerce-products-bindproducttree-name').get(0);\n redirectLocation = $('#cq-commerce-products-bindproducttree-form')\n .find('[data-foundation-wizard-control-action=cancel]')\n .attr('href');\n catalogIdentifierHidden = $('#cq-commerce-products-bindproducttree-catalog-hidden').get(0);\n\n propertiesMap = {\n 'cq:catalogDataResourceProviderFactory': {\n element: commerceProviderCoralSelectComponent,\n locked: false\n },\n 'cq:catalogIdentifier': {\n element: catalogIdentifierCoralSelectComponent,\n locked: false\n },\n 'cq:graphqlClient': {\n element: graphQlClient,\n locked: false\n },\n magentoStore: {\n element: storeView,\n locked: false\n },\n magentoGraphqlEndpoint: {\n element: graphQlProxyPath,\n locked: false\n },\n magentoRootCategoryId: {\n element: magentoRootCategoryId,\n locked: false\n },\n 'jcr:language': {\n element: language,\n locked: false\n }\n };\n }", "title": "" }, { "docid": "d39c4357d3b52c3df3b165c8c99cd2d6", "score": "0.5244408", "text": "setupCart() {\r\n cart = Storage.getCart(); \r\n this.setCartValues(cart);\r\n this.fillCart(cart);\r\n cartBtn.addEventListener('click', this.showCart);\r\n closeCartBtn.addEventListener('click', this.hideCart);\r\n }", "title": "" }, { "docid": "a32bf9ecc44aa696fd2904e0311f0e8a", "score": "0.5244304", "text": "beforePage(next) {\n // Should not submit child forms if we are going to the previous page\n if (!next) {\n return super.beforePage(next);\n }\n return this.submitSubForm(true).then(() => super.beforePage(next));\n }", "title": "" }, { "docid": "0a491ea18d9da3073a8e13103c4f910a", "score": "0.52404004", "text": "function handleSubmit(event) {\n // TODO: Prevent the page from reloading\n event.preventDefault();\n // Do all the things ...\n addSelectedItemToCart();\n saveCartToLocalStorage();\n updateCounter();\n updateCartPreview();\n}", "title": "" }, { "docid": "53db8c07b591aef909176c98047c9363", "score": "0.52379507", "text": "function ajaxCartReloadCartView() {\n if (jQuery('#cart-form-pane').length) {\n jQuery('#cart-form-pane').parent().load(Drupal.settings.uc_ajax_cart.SHOW_VIEW_CALLBACK, ajaxCartInitCartView);\n }\n}", "title": "" }, { "docid": "4d10b54fd8f6c232c9ce84d845cfd5bf", "score": "0.5236708", "text": "cartLogic(){\n // this is referencing the function as we want to do something on clicking it, expample line 154 is referencing the button, here ther's no functionality just hide and show to access DOM elements\n clearCartBtn.addEventListener('click', () =>{\n this.clearCart()\n });\n\n // cart functionality\n cartContent.addEventListener('click', event =>{\n\n // if user clicks on remove button then we are going to do one function.\n if(event.target.classList.contains('remove-item')){\n let removeItem = event.target;\n let id = removeItem.dataset.id;\n this.removeItem(id); // removed functionally not from the DOM\n \n // to remove it from DOM we need to traverse to it's parent \n cartContent.removeChild(removeItem.parentElement.parentElement);\n } else if (event.target.classList.contains('fa-chevron-up')) {\n let addAmount = event.target;\n let id = addAmount.dataset.id;\n let tempItem = cart.find(item => item.id === id);\n tempItem.amount = tempItem.amount + 1;\n\n //after updating the amount we need to update the locale storage as well \n Storage.saveCart(cart);\n // update the total as well for the new cart values\n this.setCartValues(cart);\n\n // update the DOM element with the new number \n addAmount.nextElementSibling.innerText = tempItem.amount;\n } else if (event.target.classList.contains('fa-chevron-down')){\n let lowerAmount = event.target;\n let id = lowerAmount.dataset.id;\n let tempItem = cart.find(item => item.id === id);\n tempItem.amount = tempItem.amount - 1;\n if(tempItem.amount > 0){\n Storage.saveCart(cart);\n this.setCartValues(cart); \n lowerAmount.previousElementSibling.innerText = tempItem.amount;\n } else {\n cartContent.removeChild(lowerAmount.parentElement.parentElement);\n this.removeItem(id);\n } \n }\n });\n }", "title": "" }, { "docid": "5fb6ed51151d51005343028f14d68cf9", "score": "0.5227631", "text": "renderForm() {\n const step = this.props.activeStep\n if (!step) {\n return <div>No more steps</div>\n }\n\n const form = (\n <form onSubmit={this.onSubmit}>\n <div id=\"formBody\">\n {step.questions.default.map((input) => <Field onValue={this.onValue} key={input.id} input={input} />)}\n </div>\n { this.renderNavButtons() }\n </form>\n )\n return form\n }", "title": "" }, { "docid": "0f1b181a1f76aa0bbe5a25e2552090e8", "score": "0.52200574", "text": "function handleShoppingList() {\n renderShoppingList();\n handleNewItemSubmit();\n handleItemCheckClicked();\n handleDeleteItemClicked();\n\n}", "title": "" }, { "docid": "7a740aa5492617b3e00822f4dfae2901", "score": "0.52181095", "text": "billinginfo(form) {\r\n let self = this;\r\n this.submitted = true;\r\n this.errors = {};\r\n\r\n if (form.$valid) {\r\n // persist billing info\r\n this.UserService.billing = this.billing;\r\n // for reviewinfo display\r\n this.cart.tax_flag = (this.cart.purchase_type == \"company\" && typeof this.billing.vat_number != \"undefined\" && this.billing.vat_number != \"\") ? true : false;\r\n // new addition: set locals\r\n localStorage.setItem('default_country_code', this.billing.country);\r\n\r\n if (this.currentstate == \"signup\" || this.currentstate == \"dualaccount\") {\r\n // call create estimate api\r\n this.showSpinnerPrice = true;\r\n this.getCreateEstimates();\r\n } else {\r\n // change plan case\r\n if (typeof self.currentUser.tenant_license != \"undefined\" && !self.currentUser.tenant_license.is_active) {\r\n // cancel state case\r\n self.getReactivateEstimates(self.cart.package_id, self.user.subscription_id);\r\n } else if (!self.isCurrentPlanFlag) {\r\n // modify plan case\r\n self.showSpinnerPrice = true;\r\n self.getPackageEstimates(self.cart.package_id, self.user.subscription_id);\r\n } else if (self.isCurrentPlanFlag) {\r\n // add extras case\r\n self.getAddonEstimates(self.cart.old_package_id, self.user.subscription_id);\r\n }\r\n }\r\n\r\n this.step1Flag = false;\r\n this.step2Flag = false;\r\n this.step3Flag = false;\r\n self.billing.country_name = $(\"[name=country] option:selected\").text();\r\n if (self.currentstate != \"signup\") {\r\n // Next step: Payment method\r\n this.paymentToggle = true;\r\n this.step4Flag = true;\r\n this.step5Flag = false;\r\n\r\n self.$timeout(function () {\r\n $('form[name=\"step4form\"] input').first().focus();\r\n });\r\n\r\n } else {\r\n // Next step: Preview method\r\n if (this.packageoptions[this.cart.packageindex].is_trial) {\r\n this.previewToggle = true;\r\n } else {\r\n this.paymentToggle = true;\r\n }\r\n this.step4Flag = (this.packageoptions[this.cart.packageindex].is_trial) ? false : true;\r\n this.step5Flag = (this.packageoptions[this.cart.packageindex].is_trial) ? true : false;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "ae2ed9c9d2bd171bfdacff2d86e575c9", "score": "0.5216543", "text": "function tc_cart_listeners() {\n $( \"input.tc_button_addcart\" ).click( function() {\n var input = $( this );\n var formElm = $( input ).parents( 'form.tc_buy_form' );\n var tempHtml = formElm.html();\n var serializedForm = formElm.serialize();\n formElm.html( '<img src=\"' + tc_ajax.imgUrl + '\" alt=\"' + tc_ajax.addingMsg + '\" />' );\n $.post( tc_ajax.ajaxUrl, serializedForm, function( data ) {\n var result = data.split( '||', 2 );\n if ( result[0] == 'error' ) {\n alert( result[1] );\n formElm.html( tempHtml );\n tc_cart_listeners();\n } else {\n formElm.html( '<span class=\"tc_adding_to_cart\">' + tc_ajax.successMsg + '</span>' );\n $( \"div.tc_cart_widget_content\" ).html( result[1] );\n if ( result[0] > 0 ) {\n formElm.fadeOut( 2000, function() {\n formElm.html( tempHtml ).fadeIn( 'fast' );\n tc_cart_listeners();\n } );\n } else {\n formElm.fadeOut( 2000, function() {\n formElm.html( '<span class=\"tc_no_stock\">' + tc_ajax.outMsg + '</span>' ).fadeIn( 'fast' );\n tc_cart_listeners();\n } );\n }\n tc_empty_cart(); //re-init empty script as the widget was reloaded\n }\n } );\n return false;\n } );\n }", "title": "" }, { "docid": "8441386e723d0630cc343d154d8c0c6e", "score": "0.521495", "text": "addProductField(){\n this.props.p['n'] = 'a';\n //console.log(this.props.p);\n if(this.state.dispField){\n this.state.dispSign = '+';\n return(\n <form onSubmit={this.handleNewItemOnClick}>\n <input\n type=\"text\"\n placeholder={'Enter Product Name'}\n value={this.state.newItem.name}\n id=\"name\"\n onChange={this.handleChange}\n />\n <input\n type=\"text\"\n placeholder={'Enter Product Price'}\n value={this.state.newItem.price}\n id=\"price\"\n onChange={this.handleChange}\n />\n <br/>\n <input\n type=\"text\"\n placeholder={'Enter Product Amount'}\n id=\"amount\"\n onChange={this.handleChange}\n />\n <br/>\n <label>\n Select Category\n <select id=\"category\" value={this.state.newItem.category} onChange={this.handleChange}>\n <option value=\"\" default> Select Category</option>\n <option value=\"Television\">Television</option>\n <option value=\"Monitor\">Monitor</option>\n <option value=\"TabletComputer\">TabletComputer</option>\n <option value=\"DesktopComputer\">DesktopComputer</option>\n <option value=\"LaptopComputer\">LaptopComputer</option>\n\n </select>\n </label>\n\n <br/>\n {this.showDescriptionForm()}\n <br/>\n <input type=\"submit\" value=\"Submit\" />\n </form>\n );\n }\n else{\n this.state.dispSign = '-';\n this.state.newItem = {name:'',category:'', description:'', price:'', amount: null};\n return;\n }\n }", "title": "" }, { "docid": "bbf876a7786b7d96685120849f811368", "score": "0.52106667", "text": "function ProductInfo(props) {\n return (\n <section id={`${props.prodId}-info-container`} className=\"product-info\">\n <h1 id={`${props.prodId}-title`} className=\"titles\">{props.prodName}</h1>\n <figure id={`${props.prodId}-thumbnails`} className=\"thumbnail-container\">\n <button\n type=\"button\"\n id=\"main-thumbnail\"\n aria-label=\"enlarge image\"\n tabIndex={props.modal ? -1 : null}\n onClick={(e) => props.handleModal({img: props.thumb}, e)}\n >\n <img src={props.thumb} alt={`${props.prodName} main preview`} id={`${props.prodId}-main-image`} className=\"main-image\" />\n </button>\n <Thumbnails\n modal={props.modal}\n prodName={props.prodName}\n prodId={props.prodId}\n mainThumb={props.thumb}\n subthumbs={props.subthumbs}\n handleButton={props.handleButton}\n />\n </figure>\n <form>\n {props.rating ? (\n <Rating\n modal={props.modal}\n prodId={props.prodId}\n user={props.userId}\n kind=\"user\"\n section=\"info\"\n reviewer={false}\n rating={props.rating}\n handleButton={props.handleButton}\n />\n ) : (\n <Rating\n modal={props.modal}\n prodId={props.prodId}\n kind='avg'\n section=\"info\"\n whole={props.whole}\n half={props.half}\n empty={props.empty}\n handleButton={props.handleButton}\n />\n )}\n </form>\n <ReviewsLink modal={props.modal} prodId={props.prodId} reviewCount={props.reviewCount} />\n <Description prodId={props.prodId} />\n <Price prodId={props.prodId} price={props.price} />\n <ProductForm\n modal={props.modal}\n itemsInCart={props.itemsInCart}\n id={`${props.prodId}-product`}\n prodId={props.prodId}\n qty={props.qty}\n opt={props.opt}\n checkIfInCart={props.checkIfInCart}\n handleInput={props.handleInput}\n handleFocus={props.handleFocus}\n handleSubmit={props.handleSubmit}\n />\n </section>\n );\n }", "title": "" }, { "docid": "b237b52f02093dd998a7b4b205799be3", "score": "0.5205612", "text": "_addProductToCart(event) {\n const form = this.$el.find('[data-product-form]')[0];\n const $form = $(form);\n\n // Do not do AJAX if browser doesn't support FormData OR\n if (window.FormData === undefined || !(this.$el.has(form))) {\n return;\n }\n\n event.preventDefault();\n\n this.callbacks.willUpdate($form);\n\n // Add item to cart\n utils.api.cart.itemAdd(new FormData(form), (err, response) => {\n let isError = false;\n\n if (err || response.data.error) {\n isError = true;\n response = err || response.data.error;\n } else {\n $('body').trigger('cart-quantity-update');\n }\n\n preventSubmit = false;\n this._updateMessage(isError, response);\n this.callbacks.didUpdate(isError, response, $form);\n });\n }", "title": "" }, { "docid": "1a4332a14a14d738f2109b870cf96983", "score": "0.520539", "text": "sellForm() {\n if (this.state.selected) {\n return (\n <form\n id='sellForm'\n onSubmit={this.handleSubmit.bind(this)}\n autoComplete='off'\n >\n <h3>Sell {this.state.selected.stock['companyName']} Shares</h3>\n <p>\n Opening Price: $\n {this.state.selected.stock['open'] ||\n this.state.selected.stock['previousClose']}{' '}\n | Current Share Price: ${this.state.selected.stock['latestPrice']}\n </p>\n <p> Current Shares: {this.state.selected['quantity']}</p>\n <label>How many shares do you want to sell?</label>\n <input id='sellInput' type='number' />\n <button type='submit' id='sellButton'>\n Sell\n </button>\n </form>\n );\n }\n }", "title": "" }, { "docid": "ede4aaf0bd43bd8a2c78c1d99f250480", "score": "0.5197478", "text": "render(){\n\n\treturn (\n\t\t\t<div>\n\t\t\t <Navigation />\n\t\t\t <h3 className = 'headers'>Create Order</h3>\n\t\t\t <div className = 'myform'>\n\n\t\t\t\t<div>\n\t\t\t \n\t\t\t \t <FormGroup row>\n\t\t\t <Label for=\"exampleSelect\" sm={2}>Product Name</Label>\n\t\t\t <Col sm={3}>\n\t\t\t <Input type=\"select\" name=\"select\" id=\"exampleSelect\" onChange = {this.onPNChange} size =\"5\"> \n\t\t\t\t {this.state.options.map((option, i) => <option key = {i}>{option}</option>)}\n\t \t\t\t</Input>\n\t\t\t </Col>\n\t\t\t </FormGroup>\n\n\t\t\t <FormGroup row>\n\t\t\t <Label for=\"exampleEmail\" sm={2}>Number of Units</Label>\n\t\t\t <Col sm={1}>\n\t\t\t <Input type=\"text\" name=\"number_of_units\" id=\"number_of_units\" placeholder=\"1/2/3\" onChange = {this.onUnitsChange} />\n\t\t\t </Col>\n\t\t\t </FormGroup>\n\n\t\t\t <FormGroup row>\n\t\t\t <Label for=\"examplePassword\" sm={2}>Total Price</Label>\n\t\t\t <Col sm={1}>\n\t\t\t <Input type=\"text\" name=\"total_price\" id=\"total_price\" placeholder=\"Price\" onChange = {this.onPriceChange} />\n\t\t\t </Col>\n\t\t\t </FormGroup>\n\n\t\t\t\t\t<FormGroup row>\n\t\t\t <Label for=\"exampleText\" sm={2}>Notes</Label>\n\t\t\t <Col sm={3}>\n\t\t\t <Input type=\"textarea\" name=\"text\" id=\"notes\" onChange = {this.onNotesChange} />\n\t\t\t </Col>\n\t\t\t </FormGroup>\n\n\n\t\t\t \n\t\t\t <FormGroup check row>\n\t\t\t <Col sm={{ size: 3, offset: 2 }}>\n\t\t\t <Button type=\"submit\" color=\"primary\" onClick = {this.onButtonSubmit}>Submit</Button>\n\t\t\t <Button className = 'mymargin' type=\"submit\" color=\"primary\" onClick = {this.productList}>Load Product List</Button>\n\t\t\t \n\t\t\t </Col>\n\t\t\t </FormGroup>\n\n\n\n\t\t\t </div>\n\t\t </div>\n\t\t \t\t\t <Alert className = 'alert' color=\"info\" isOpen={this.state.visible} toggle={this.onDismiss}>\n\t\t\t\t\t Order successfully created\n\t\t\t\t\t </Alert> \n\t\t\t </div>\n\t\t);\n\n\t}", "title": "" }, { "docid": "ebaffd86dff9c240cd62549dea9c2101", "score": "0.5193706", "text": "renderCartItems() {\n if (this.props.cart.length == 0) {\n return <h3><strong>your shopping bag is empty?!🤨</strong></h3>\n }\n const items = this.props.cart.map(item => {\n var index = this.props.cart.indexOf(item)\n return <CartItem key={item.name}\n item={item}\n onCheckout={this.props.onCheckout}\n quantity={this.props.quantities[index]}\n removeAllCB={this.removeAll.bind(this)}\n addToCartCB={this.addToCart.bind(this)}\n removeOneCB={this.removeOne.bind(this)}\n sale={this.props.constants.SALE_PERCENT}/>\n });\n return items\n }", "title": "" }, { "docid": "4f1f78eb8101f3d9f551fe09846a647f", "score": "0.5192303", "text": "function handleSubmit(event) {\n\n event.preventDefault();\n // TODO: Prevent the page from reloading\n // console.log(selectElement.options[selectElement.selectedIndex].value, txtQuantity.value);\n // Do all the things ...\n addSelectedItemToCart(event);\n cart.saveToLocalStorage();\n updateCounter();\n updateCartPreview();\n\n}", "title": "" }, { "docid": "2e9f94c1e8854244b9c84866b404bac8", "score": "0.5185819", "text": "function Page() {\n const { addItem } = useCart();\n\n return (\n <div>\n {services.map((s) => (\n <div key={s.id}>\n <Button className=\"btn btn-primary addItem\" variant=\"light\" onClick={() => addItem(s, 1)}>{s.label} {' $'} {s.price}</Button>\n </div>\n ))}\n </div>\n );\n }", "title": "" }, { "docid": "36150ecd3ed98e8bf54ebb96447ef5fe", "score": "0.5183855", "text": "render() {\n return (\n <div className=\"col-sm-12\">\n <div className=\"review-block\">\n <div className=\"row\">\n <div className=\"col-sm-12\">\n <Error/>\n </div>\n </div>\n <div className=\"form-group\">\n <form onSubmit={this.handleSubmit}>\n <div className=\"form-group\">\n <label htmlFor=\"stitle\">Service Category</label>\n <input className=\"form-control\" type=\"text\" name=\"serviceCategory\" ref=\"serviceCategory\"\n value={this.state.serviceCategory} maxLength={50}\n placeholder=\"Service Title\" onChange={this.onChangeServiceCategory}/>\n </div>\n <div className=\"row\">\n <div className=\"col-sm-12\">\n <div className=\"form-group\">\n {this.renderAddAUpdateView()}\n </div>\n </div>\n </div>\n </form>\n </div>\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "ebbd367ff93dbc9817ff1794af97821b", "score": "0.5181481", "text": "function ItemsContainer({ displayedItems = [], buttonText, handleClick, selectUser, performDelete, performAdd } ){\n\n\n // the below will help us get the pathname so we can conditionally render according to our route\n const location = useLocation();\n\n return(\n <div className=\"cards-container\">\n\n {location.pathname === \"/sell\" ? <NewItemCard selectUser={selectUser} performAdd={performAdd}/> : null}\n {displayedItems.map(item => { \n return (<ItemCard \n key={item.id} \n item={item} \n selectUser={selectUser} \n buttonText={buttonText} \n buttonValue={location.pathname === \"/sell\" ? \"edit\" : \"addToCart\"} \n handleClick={handleClick} \n performDelete={performDelete}\n />\n )})\n }\n </div>\n )\n}", "title": "" }, { "docid": "317926e5cf977f03cd44454f1a50e2c7", "score": "0.5180808", "text": "_onChange() {\r\n this.logger.startEmpty();\r\n\r\n this.cart.total = 0;\r\n this.cart.items.forEach( ( item ) => {\r\n this.cart.total += item.amount * item.price;\r\n } );\r\n\r\n const { totalPrice } = this.elements;\r\n\r\n // remove empty item slots from cart\r\n this.cart.items = this.cart.items.filter( function( el ) {\r\n return el != null;\r\n } );\r\n\r\n this.efficientEmptyState( Boolean( this.cart.items.length ) );\r\n\r\n // set the price\r\n totalPrice.innerHTML = this.cart.total.toFixed( 2 );\r\n\r\n // set amount of products type\r\n this.events.onAmountChange( this.cart.items.length );\r\n }", "title": "" }, { "docid": "6d56a92dbfb96afb549b75df5f456740", "score": "0.51789063", "text": "function handleSubmit(event) {\n event.preventDefault();\n // TODO: Prevent the page from reloading\n\n // Do all the things ...\n\n var selectedProduct = document.getElementById('items').value;\n var selectedQuantity = document.getElementById('quantity').value;\n\n addSelectedItemToCart(selectedProduct, selectedQuantity);\n cart.saveToLocalStorage();\n updateCounter();\n updateCartPreview();\n\n}", "title": "" }, { "docid": "0245b108bd1ebbb138f1de6043c936b5", "score": "0.51778954", "text": "render() {\n const {classes} = this.props;\n\n return (\n <form className={classes.form} onSubmit={this.handleSubmit} required gutterBottom>\n <FormControl margin=\"normal\" required className={classes.itemspacing}>\n <InputLabel>Name of Food Item</InputLabel>\n <Input \n id=\"name\" \n name=\"name\" \n type=\"text\"\n value={this.state.name}\n onChange={this.handleChange} />\n </FormControl>\n <FormControl margin=\"normal\" required className={classes.itemspacing}>\n <InputLabel>Bought (MM/DD/YY)</InputLabel>\n <Input \n id=\"boughtOn\" \n name=\"boughtOn\"\n type=\"text\"\n value={this.state.boughtOn}\n onChange={this.handleChange}/>\n </FormControl>\n <FormControl margin=\"normal\" required className={classes.itemspacing}>\n <InputLabel>Expires (MM/DD/YY)</InputLabel>\n <Input \n id=\"expiresOn\" \n name=\"expiresOn\"\n type=\"text\"\n value={this.state.expiresOn}\n onChange={this.handleChange}/>\n </FormControl>\n\n <Button \n className={classes.submit}\n type=\"submit\"\n variant=\"contained\"\n color=\"default\"\n >\n Add to inventory\n </Button>\n </form>\n );\n }", "title": "" } ]
49613e71a5ec30ff4bfb99d160a716f2
`isValidCSSUnit` Take in a single string / number and check to see if it looks like a CSS unit (see `matchers` above for definition).
[ { "docid": "920ec165d46513008e05fc2dc6315628", "score": "0.81372786", "text": "function isValidCSSUnit(color) {\n\t return !!matchers.CSS_UNIT.exec(color);\n\t}", "title": "" } ]
[ { "docid": "253bccd74c535e028d4627c4e01c9361", "score": "0.8280027", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}", "title": "" }, { "docid": "253bccd74c535e028d4627c4e01c9361", "score": "0.8280027", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4d24f9634bf148acbf6e9def4b186cad", "score": "0.82759875", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}", "title": "" }, { "docid": "4634e19c0edade690407b4989da1cf7e", "score": "0.8275142", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n}", "title": "" }, { "docid": "11e95869cb583c2e7580f98e03b7a541", "score": "0.8256693", "text": "function isValidCSSUnit(color) {\n return Boolean(matchers.CSS_UNIT.exec(String(color)));\n }", "title": "" }, { "docid": "9c486552d01852b92e92c408af063f82", "score": "0.82281303", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }", "title": "" }, { "docid": "9c486552d01852b92e92c408af063f82", "score": "0.82281303", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }", "title": "" }, { "docid": "c61c7c4480709298a081e256de541976", "score": "0.822282", "text": "function isValidCSSUnit(color){return!!matchers.CSS_UNIT.exec(color);}// `stringInputToObject`", "title": "" }, { "docid": "b2a9783c19c597096665f681647a21bc", "score": "0.81601113", "text": "function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }", "title": "" }, { "docid": "0039374f3e8a3cb243571387b56ed1fb", "score": "0.6362511", "text": "function I(t){return!!D.CSS_UNIT.exec(t)}", "title": "" }, { "docid": "45d3f11470b83b9a39feffc2dfd59c2f", "score": "0.6268928", "text": "function X(t){return!!O.CSS_UNIT.exec(t)}", "title": "" }, { "docid": "fd799d88d253a26f21210e5f40046acb", "score": "0.584845", "text": "function ensureUnit(val){return val+(Object(min_dash__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(val)?'px':'');}", "title": "" }, { "docid": "f7547d8baeb0d4fafd4e41880a06807c", "score": "0.58139634", "text": "function is_unit(t) {\n return (kind(t) == KIND_IDENT) && (t == 'unit');\n}", "title": "" }, { "docid": "b294db1769936b04a7b30258bc656b07", "score": "0.572326", "text": "function validateUnit(unit) {\n if (typeof unit === 'undefined') {\n throw Error('You have to pass unit type!');\n } else if (supportedUnits.indexOf(unit) == -1) {\n throw Error('Unsupported unit type! Supported types:\\n' + supportedUnits + '.');\n }\n }", "title": "" }, { "docid": "022d794e849007156f202de4a8476b86", "score": "0.5659637", "text": "function ensureUnit(val) {\n return val + (__isNumber_2(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.546886", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "77b549048f9379340d570a42ee866363", "score": "0.546886", "text": "function ensureUnit(val) {\n return val + (isNumber(val) ? 'px' : '');\n}", "title": "" }, { "docid": "b45cccbf193f708ad9952089021155d5", "score": "0.5463443", "text": "function validate(value, unit) {\n if (typeof value === 'undefined' || typeof unit === 'undefined') {\n throw Error('You have to pass value and unit type!');\n } else if (typeof value !== 'number') {\n throw Error('Value must be a number!');\n } else if (supportedUnits.indexOf(unit) == -1) {\n throw Error('Unsupported unit type! Supported types:\\n' + supportedUnits + '.');\n }\n }", "title": "" }, { "docid": "4ed87d61405efe998ff993f000a50ff5", "score": "0.54000103", "text": "function unit(value) {\n return check.number(value) &&\n value >= 0.0 && value <= 1.0;\n }", "title": "" }, { "docid": "477919bfba5ad013a9f7da7062c1e23d", "score": "0.53491914", "text": "function unit(property1, property2, validator) {\n // The idea here is that 'more understandable' values override 'less understandable' values, but not vice versa\n // Understandability: (unit without functions) > (same functions | standard functions) > anything else\n // NOTE: there is no point in having different vendor-specific functions override each other or standard functions,\n // or having standard functions override vendor-specific functions, but standard functions can override each other\n // NOTE: vendor-specific property values are not taken into consideration here at the moment\n var value1 = property1.value[0][0];\n var value2 = property2.value[0][0];\n\n if (validator.isValidAndCompatibleUnitWithoutFunction(value1) && !validator.isValidAndCompatibleUnitWithoutFunction(value2))\n return false;\n\n if (validator.isValidUnitWithoutFunction(value2))\n return true;\n if (validator.isValidUnitWithoutFunction(value1))\n return false;\n\n // Standard non-vendor-prefixed functions can override each other\n if (validator.isValidFunctionWithoutVendorPrefix(value2) && validator.isValidFunctionWithoutVendorPrefix(value1)) {\n return true;\n }\n\n // Functions with the same name can override each other; same values can override each other\n return sameFunctionOrValue(property1, property2, validator);\n}", "title": "" }, { "docid": "477919bfba5ad013a9f7da7062c1e23d", "score": "0.53491914", "text": "function unit(property1, property2, validator) {\n // The idea here is that 'more understandable' values override 'less understandable' values, but not vice versa\n // Understandability: (unit without functions) > (same functions | standard functions) > anything else\n // NOTE: there is no point in having different vendor-specific functions override each other or standard functions,\n // or having standard functions override vendor-specific functions, but standard functions can override each other\n // NOTE: vendor-specific property values are not taken into consideration here at the moment\n var value1 = property1.value[0][0];\n var value2 = property2.value[0][0];\n\n if (validator.isValidAndCompatibleUnitWithoutFunction(value1) && !validator.isValidAndCompatibleUnitWithoutFunction(value2))\n return false;\n\n if (validator.isValidUnitWithoutFunction(value2))\n return true;\n if (validator.isValidUnitWithoutFunction(value1))\n return false;\n\n // Standard non-vendor-prefixed functions can override each other\n if (validator.isValidFunctionWithoutVendorPrefix(value2) && validator.isValidFunctionWithoutVendorPrefix(value1)) {\n return true;\n }\n\n // Functions with the same name can override each other; same values can override each other\n return sameFunctionOrValue(property1, property2, validator);\n}", "title": "" }, { "docid": "0d8c3fcaf8f1f678e14cef88f5749e39", "score": "0.53406763", "text": "function checkUnit(unitToCheck) {\n\tvar validUnitTypes = new Map();\n\tvalidUnitTypes.set(\"METERS\", [\"M\", \"METER\", \"METERS\"]);\n\tvalidUnitTypes.set(\"MILLIMETERS\", [\"MM\", \"MILLIMETER\", \"MILLIMETERS\"]);\n\tvalidUnitTypes.set(\"CENTIMETERS\", [\"CM\", \"CENTIMETER\", \"CENTIMETERS\"]);\n\tvalidUnitTypes.set(\"KILOMETERS\", [\"KM\", \"KILOMETER\", \"KILOMETERS\"]);\n\tvalidUnitTypes.set(\"LITERS\", [\"L\", \"LITER\", \"LITERS\"]);\n\tvalidUnitTypes.set(\"MILLILITERS\", [\"ML\", \"MILLILITER\", \"MILLILITERS\"]);\n\tvalidUnitTypes.set(\"INCHES\", [\"IN\", \"INCH\", \"INCHES\"]);\n\tvalidUnitTypes.set(\"FEET\", [\"FT\", \"FOOT\", \"FEET\"]);\n\tvalidUnitTypes.set(\"MILES\", [\"MI\", \"MILE\", \"MILES\"]);\n\tvalidUnitTypes.set(\"GALLONS\", [\"GL\", \"GALLON\", \"GALLONS\"]);\n\tvalidUnitTypes.set(\"LITERS\", [\"L\", \"LITER\", \"LITERS\", \"LITRE\", \"LITRES\"]);\n\tvalidUnitTypes.set(\"FAHRENHEIT\", [\"F\", \"FAHRENHEIT\"]);\n\tvalidUnitTypes.set(\"CELSIUS\", [\"C\", \"CELSIUS\", \"CENTIGRADE\"]);\n\tvalidUnitTypes.set(\"KELVIN\", [\"K\", \"KELVIN\"]);\n\tvalidUnitTypes.set(\"KILOGRAMS\", [\"KG\", \"KILOGRAM\", \"KILOGRAMS\"]);\n\tvalidUnitTypes.set(\"GRAMS\", [\"G\", \"GRAM\", \"GRAMS\"]);\n\tvalidUnitTypes.set(\"POUNDS\", [\"LB\", \"LBS\", \"POUND\", \"POUNDS\"]);\n\tvalidUnitTypes.set(\"KILOMETERS PER HOUR\", [\"KM/H\", \"KMPH\", \"KILOMETER PER HOUR\", \"KILOMETERS PER HOUR\"]);\n\tvalidUnitTypes.set(\"MILES PER HOUR\", [\"MI/H\", \"MPH\", \"MIPH\", \"MILE PER HOUR\", \"MILES PER HOUR\"]);\n\tvalidUnitTypes.set(\"KNOTS\", [\"KN\", \"KNOT\", \"KNOTS\"]);\n\t\n\tvar valid = false;\n\tfor (var unitType of validUnitTypes.values()) {\n\t\tfor (const unit of unitType) {\n\t\t\tif (unitToCheck === unit) {\n\t\t\t\tvalid = true;\n\t\t\t\treturn getKeyByValue(validUnitTypes, unitType);\n\t\t\t}\n\t\t}\n\t}\n\tif (valid = false) {\n\t\treturn \"Unit not recognized\";\n\t}\n}", "title": "" }, { "docid": "a5ac8a9358394bbab364938cc6a1ddca", "score": "0.5166437", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var fullTimeUnitStr = fullTimeUnit.toString();\n var timeUnitStr = timeUnit.toString();\n var index = fullTimeUnitStr.indexOf(timeUnitStr);\n return index > -1 &&\n (timeUnit !== TimeUnit.SECONDS ||\n index === 0 ||\n fullTimeUnitStr.charAt(index - 1) !== 'i' // exclude milliseconds\n );\n}", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "c29775a2c93c79e9c3fb5e08156d49b4", "score": "0.51593995", "text": "function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n} // Emulate the sass function \"unitless\"", "title": "" }, { "docid": "69df15b4ede46e7ead3df8ab524140a7", "score": "0.5118046", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n\n if (index < 0) {\n return false;\n } // exclude milliseconds\n\n\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n } // exclude dayofyear\n\n\n if (fullTimeUnit.length > index + 3 && timeUnit === 'day' && fullTimeUnit.charAt(index + 3) === 'o') {\n return false;\n }\n\n if (index > 0 && timeUnit === 'year' && fullTimeUnit.charAt(index - 1) === 'f') {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "765261e36e31aabc6df800822c34af9d", "score": "0.5113995", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n return index > -1 &&\n (timeUnit !== TimeUnit.SECONDS ||\n index === 0 ||\n fullTimeUnit.charAt(index - 1) !== 'i' // exclude milliseconds\n );\n}", "title": "" }, { "docid": "765261e36e31aabc6df800822c34af9d", "score": "0.5113995", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n return index > -1 &&\n (timeUnit !== TimeUnit.SECONDS ||\n index === 0 ||\n fullTimeUnit.charAt(index - 1) !== 'i' // exclude milliseconds\n );\n}", "title": "" }, { "docid": "13a58c8fe2981d91ca1a5a6df43661c3", "score": "0.50918406", "text": "function coerceCssPixelValue(value) {\n if (value == null) {\n return '';\n }\n return cssUnitsPattern.test(value) ? value : value + \"px\";\n}", "title": "" }, { "docid": "7c1ca1e765c0d8a0f44e2b7026a3da42", "score": "0.5084655", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n\n if (index < 0) {\n return false;\n } // exclude milliseconds\n\n\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n } // exclude dayofyear\n\n\n if (fullTimeUnit.length > index + 3 && timeUnit === 'day' && fullTimeUnit.charAt(index + 3) === 'o') {\n return false;\n }\n\n if (index > 0 && timeUnit === 'year' && fullTimeUnit.charAt(index - 1) === 'f') {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "a5dfdab38fc69b5fdc4bdec1f1d466a7", "score": "0.5083719", "text": "function convertUnits(property, value, fromUnit, toUnit){\n if (value !== parseFloat(value)) {\n throw TypeError(\n `Invalid value for conversion. Expected Number, got ${value}`\n );\n }\n\n const shouldReturn = () => {\n // Early return if:\n // - conversion is not required\n // - property is `line-height`\n // - `fromUnit` is `em` and `toUnit` is unitless\n const conversionNotRequired = fromUnit === toUnit || value === 0;\n const forLineHeight =\n property === \"line-height\" && fromUnit === \"\" && toUnit === \"em\";\n const isEmToUnitlessConversion = fromUnit === \"em\" && toUnit === \"\";\n return conversionNotRequired || forLineHeight || isEmToUnitlessConversion;\n };\n\n if (shouldReturn()) {\n return value;\n }\n\n // If neither unit is in pixels, first convert the value to pixels.\n // Reassign input value and source CSS unit.\n if (toUnit !== \"px\" && fromUnit !== \"px\") {\n value = this.convertUnits(property, value, fromUnit, \"px\");\n fromUnit = \"px\";\n }\n \n // Whether the conversion is done from pixels.\n const fromPx = fromUnit === \"px\";\n // Determine the target CSS unit for conversion.\n const unit = toUnit === \"px\" ? fromUnit : toUnit;\n // Default output value to input value for a 1-to-1 conversion as a guard against\n // unrecognized CSS units. It will not be correct, but it will also not break.\n let out = value;\n\n const converters = {\n in: () => (fromPx ? value / 96 : value * 96),\n cm: () => (fromPx ? value * 0.02645833333 : value / 0.02645833333),\n mm: () => (fromPx ? value * 0.26458333333 : value / 0.26458333333),\n pt: () => (fromPx ? value * 0.75 : value / 0.75),\n pc: () => (fromPx ? value * 0.0625 : value / 0.0625),\n }\n\n if (converters.hasOwnProperty(unit)) {\n const converter = converters[unit];\n out = converter();\n }\n\n // Special handling for unitless line-height.\n if (unit === \"em\" || (unit === \"\" && property === \"line-height\")) {\n const fontSize = rootFontVal;\n out = fromPx\n ? value / parseFloat(fontSize)\n : value * parseFloat(fontSize);\n }\n \n // Catch any NaN or Infinity as result of dividing by zero in any\n // of the relative unit conversions which rely on external values.\n if (isNaN(out) || Math.abs(out) === Infinity) {\n out = 0;\n }\n \n // Return values limited to 3 decimals when:\n // - the unit is converted from pixels to something else\n // - the value is for letter spacing, regardless of unit (allow sub-pixel precision)\n if (fromPx || property === \"letter-spacing\") {\n // Round values like 1.000 to 1\n return out === Math.round(out) ? Math.round(out) : out.toFixed(3);\n }\n \n // Round pixel values.\n return Math.round(out);\n}", "title": "" }, { "docid": "2cf292cf9109e69b1ed1a18c8074223d", "score": "0.50784993", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n if (index < 0) {\n return false;\n }\n // exclude milliseconds\n if (index > 0 && timeUnit === 'seconds' && fullTimeUnit.charAt(index - 1) === 'i') {\n return false;\n }\n // exclude dayofyear\n if (fullTimeUnit.length > index + 3 && timeUnit === 'day' && fullTimeUnit.charAt(index + 3) === 'o') {\n return false;\n }\n if (index > 0 && timeUnit === 'year' && fullTimeUnit.charAt(index - 1) === 'f') {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "2f9266183e6de4994b647f89f99c20e0", "score": "0.5044081", "text": "function isLength(unit) {\n var ch1 = unit.charAt(0).toLowerCase(),\n ch2 = unit.charAt(1).toLowerCase(),\n ch3 = unit.charAt(2).toLowerCase(),\n ch4 = unit.charAt(3).toLowerCase();\n\n if (ch1 === 'p') {\n return (ch2 === 'x' || ch2 === 't' || ch2 === 'c');\n }\n if (ch2 === 'm') {\n if (ch1 === 'c' || ch1 === 'm' || ch1 === 'e'){\n return 2;\n }\n }\n if (ch2 === 'x') {\n return ch1 === 'e';\n }\n if (ch3 === 'm') {\n if (ch1 === 'r' && ch2 === 'e') {\n // return the length of the unit\n return 3;\n }\n }\n if (ch1 === 'x' && isHexDigit(ch2)) {\n var len = 1;\n while (isHexDigit(unit[len])) {\n len++;\n }\n return len;\n }\n if (ch1 === 'v') {\n if (ch2 === 'w' || ch2 === 'h') {\n return 2;\n }\n if (ch2 === 'm') {\n if (ch3 === 'i' && ch4 === 'n') {\n return 4;\n }\n if (ch3 === 'a' && ch4 === 'x') {\n return 4;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "a009ce8302611b52a3388dac82ef3f3f", "score": "0.5017516", "text": "function testInvalidType(type, target, attribute, expected, whitespace, invalid, validunits, assert_valid_custom, assert_invalid_custom) {\n whitespace.forEach(function(leading) {\n whitespace.forEach(function(trailing) {\n // test invalid values\n invalid.forEach(function(value) {\n validunits.forEach(function(unit) {\n var valueStr = leading + value + unit + trailing;\n var escapedValueStr = valueStr.replace(/(\\r)/g, '\\\\r').replace(/(\\n)/g, '\\\\n').replace(/(\\t)/g, '\\\\t').replace(/(\\f)/g, '\\\\f');\n test(function() {\n try {\n target.setAttribute(attribute, valueStr);\n assert_equals(target.getAttribute(attribute), valueStr);\n assert_invalid_custom(target, expected);\n }\n finally {\n target.removeAttribute(attribute);\n }\n }, \"Test \" + type + \" invalid value: \" + escapedValueStr);\n });\n });\n });\n });\n}", "title": "" }, { "docid": "69110306f3feb780686f0b11f286cf05", "score": "0.50136536", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n return (index > -1 && (timeUnit !== TimeUnit.SECONDS || index === 0 || fullTimeUnit.charAt(index - 1) !== 'i') // exclude milliseconds\n );\n}", "title": "" }, { "docid": "69110306f3feb780686f0b11f286cf05", "score": "0.50136536", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n return (index > -1 && (timeUnit !== TimeUnit.SECONDS || index === 0 || fullTimeUnit.charAt(index - 1) !== 'i') // exclude milliseconds\n );\n}", "title": "" }, { "docid": "d396e6c7c97843beaef697bee7729e95", "score": "0.50044626", "text": "_checkCss(target) {\n if (this.cssFilter === '' || typeof target !== 'object' || typeof target.nodeType !== 'number') {\n return true\n }\n\n // For text nodes we check css on the parent node\n if (target.nodeType === 3) {\n return this._checkCss(target.parentNode)\n } else if (typeof target.matches === 'function') {\n return target.matches(this.cssFilter)\n }\n return false\n }", "title": "" }, { "docid": "3b41c99d9dd8aa6a14c9a2e4f344e845", "score": "0.49839142", "text": "function isUnitTime(time, limit) {\n // time ==== hour, sec or min\n // limit ==== can be 24 or 60 which tell what to check hour or min/sec\n // it will check the input is valid or not. as hour,min or sec\n try {\n if (time.constructor === String) {\n time = Number(time);\n }\n if (\n time.constructor === Number &&\n time < limit &&\n time >= 0 &&\n !(time % 1)\n ) {\n return time;\n }\n } catch (error) {\n return false;\n }\n return false;\n }", "title": "" }, { "docid": "74313dcbc230a7c96d61ea36151216de", "score": "0.49479088", "text": "function containsTimeUnit(fullTimeUnit, timeUnit) {\n const index = fullTimeUnit.indexOf(timeUnit);\n return (index > -1 && (timeUnit !== TimeUnit.SECONDS || index === 0 || fullTimeUnit.charAt(index - 1) !== 'i') // exclude milliseconds\n );\n }", "title": "" }, { "docid": "d7cc69718069070e74d5e18a9b6c0cba", "score": "0.4946732", "text": "function unitConvert(value, fromUnit, toUnit) {\n\tvar valid = true;\n\tvar converted = parseFloat(value);\n\tswitch(fromUnit) {\n\t\tcase \"METERS\":\n\t\t\tswitch (toUnit) {\n\t\t\t\tcase \"MILLIMETERS\":\n\t\t\t\t\tconverted *= 1000;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CENTIMETERS\":\n\t\t\t\t\tconverted *= 100;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KILOMETERS\":\n\t\t\t\t\tconverted *= .001;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INCHES\":\n\t\t\t\t\tconverted *= 39.37007874;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"FEET\":\n\t\t\t\t\tconverted *= 3.2808;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILES\":\n\t\t\t\t\tconverted *= 0.000621371;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"MILLIMETERS\":\n\t\t\tswitch (toUnit) {\n\t\t\t\tcase \"METERS\":\n\t\t\t\t\tconverted *= 0.001;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CENTIMETERS\":\n\t\t\t\t\tconverted *= 0.01;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KILOMETERS\":\n\t\t\t\t\tconverted *= 0.000001;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INCHES\":\n\t\t\t\t\tconverted *= 0.03937007874;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"FEET\":\n\t\t\t\t\tconverted *= 0.0032808;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILES\":\n\t\t\t\t\tconverted *= 0.0000000621371;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"CENTIMETERS\":\n\t\t\tswitch (toUnit) {\n\t\t\t\tcase \"METERS\":\n\t\t\t\t\tconverted *= 0.01;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILLIMETERS\":\n\t\t\t\t\tconverted *= 10;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KILOMETERS\":\n\t\t\t\t\tconverted *= 0.00001;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INCHES\":\n\t\t\t\t\tconverted *= 0.393701;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"FEET\":\n\t\t\t\t\tconverted *= 0.032808;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILES\":\n\t\t\t\t\tconverted *= 0.000000621371;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"KILOMETERS\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"METERS\":\n\t\t\t\t\tconverted *= 1000;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILLIMETERS\":\n\t\t\t\t\tconverted *= 1000000;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INCHES\":\n\t\t\t\t\tconverted *= 37370.1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"FEET\":\n\t\t\t\t\tconverted *= 3280.84;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILES\":\n\t\t\t\t\tconverted *= 0.621371;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"INCHES\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"METERS\":\n\t\t\t\t\tconverted *= 0.0254;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILLIMETERS\":\n\t\t\t\t\tconverted *= 25.4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CENTIMETERS\":\n\t\t\t\t\tconverted *= 2.54;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KILOMETERS\":\n\t\t\t\t\tconverted *= 0.0000254;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"FEET\":\n\t\t\t\t\tconverted *= 0.0833333;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILES\":\n\t\t\t\t\tconverted *= 0.0000157828;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"FEET\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"METERS\":\n\t\t\t\t\tconverted *= 0.3048;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILLIMETERS\":\n\t\t\t\t\tconverted *= 304.8;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CENTIMETERS\":\n\t\t\t\t\tconverted *= 30.48;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KILOMETERS\":\n\t\t\t\t\tconverted *= 0.0003048;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INCHES\":\n\t\t\t\t\tconverted *= 12;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILES\":\n\t\t\t\t\tconverted *= 0.000189394;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"MILES\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"METERS\":\n\t\t\t\t\tconverted *= 1609.34;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILLIMETERS\":\n\t\t\t\t\tconverted *= 1609340;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CENTIMETERS\":\n\t\t\t\t\tconverted *= 160934\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KILOMETERS\":\n\t\t\t\t\tconverted *= 1.60934;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INCHES\":\n\t\t\t\t\tconverted *= 63360;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"FEET\":\n\t\t\t\t\tconverted *= 5280;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"GALLONS\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"LITERS\":\n\t\t\t\t\tconverted *= 3.78541;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"LITERS\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"GALLONS\":\n\t\t\t\t\tconverted *= 0.264172;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"FAHRENHEIT\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"CELSIUS\":\n\t\t\t\t\tif ((converted - 32) != 0) {\n\t\t\t\t\t\tconverted = (converted - 32)*(5/9);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tconverted = 0;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KELVIN\":\n\t\t\t\t\tconverted += 459.67;\n\t\t\t\t\tconverted *= 0.5555555555;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"CELSIUS\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"FAHRENHEIT\":\n\t\t\t\t\tconverted = (converted * 1.8) + 32;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KELVIN\":\n\t\t\t\t\tconverted += 273.15;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"KELVIN\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"FAHRENHEIT\":\n\t\t\t\t\tconverted = (converted * (5/9)) - 459.67;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"CELSIUS\":\n\t\t\t\t\tconverted -= 273.15;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"KILOGRAMS\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"GRAMS\":\n\t\t\t\t\tconverted *= 1000;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"POUNDS\":\n\t\t\t\t\tconverted *= 2.20462;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"GRAMS\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"KILOGRAMS\":\n\t\t\t\t\tconverted *= 0.001;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"POUNDS\":\n\t\t\t\t\tconverted *= 0.00220462;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"POUNDS\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"GRAMS\":\n\t\t\t\t\tconverted *= 453.592;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KILOGRAMS\":\n\t\t\t\t\tconverted *= 0.453592;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"KILOMETERS PER HOUR\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"MILES PER HOUR\":\n\t\t\t\t\tconverted *= 0.621371;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KNOTS\":\n\t\t\t\t\tconverted *= 0.539957;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"MILES PER HOUR\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"KILOMETERS PER HOUR\":\n\t\t\t\t\tconverted *= 1.60934;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"KNOTS\":\n\t\t\t\t\tconverted *= 0.868976;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"KNOTS\":\n\t\t\tswitch(toUnit) {\n\t\t\t\tcase \"KILOMETERS PER HOUR\":\n\t\t\t\t\tconverted *= 1.852;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"MILES PER HOUR\":\n\t\t\t\t\tconverted *= 1.15078;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalid = false;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\tif (!valid) {\n\t\treturn false;\n\t}\n\telse { \n\t\treturn converted;\n\t}\n}", "title": "" }, { "docid": "27dc59acaa59f06a850972662b27eeed", "score": "0.4924432", "text": "function isColorValid(color) {\n if (color === \"blue\" || color === \"green\") {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "9f93466538e7e57a8ef21acd1a3cf1b6", "score": "0.49095455", "text": "parseCSS(value) {\n\t\tconst { stopIndex, stop, setStopColor } = this.props;\n\t\t// Catch color parsing errors\n\t\ttry {\n\t\t\tconst color = chroma(value)[stop.colorSpace]();\n\t\t\tsetStopColor(stopIndex, color);\n\t\t\treturn true;\n\t\t}\n\t\tcatch(error) {\n\t\t\tconsole.error(error);\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "db661a223afdf0ff26bd01605a0b1243", "score": "0.4908161", "text": "function isColorValid(color) {\n\n if(!isStringHarmless(color)) {\n throw \"Color value is potential dangerous.\";\n }\n\n switch (color) {\n case \"green\":\n case \"red\":\n case \"blue\":\n case \"yellow\":\n return true;\n default:\n return false;\n }\n}", "title": "" }, { "docid": "ae3d4d112bc4e26a0e5c0e8811f3ade3", "score": "0.4907915", "text": "function stringValidation(stringValue) {\n stringValue = stringValue.trim();\n if(typeof stringValue === 'string' || stringValue instanceof String) {\n for(let i=0 ; i<stringValue.length ; i++) {\n let asciiValue = stringValue.charCodeAt(i);\n if((asciiValue>=32 && asciiValue<=42) || (asciiValue>=43 && asciiValue<=63) || (asciiValue>=65 && asciiValue<=126)) {\n }else {\n //Caractère non valide\n console.error(\"Caractère non valide\");\n return false;\n }\n }\n return true;\n } else {\n //Ce n'est pas une chaine de caractères\n return false;\n }\n}", "title": "" }, { "docid": "b9c1ac59a711f87c9ba5664442a75bd7", "score": "0.48513025", "text": "function isUnitSpec(spec) {\n return 'mark' in spec;\n }", "title": "" }, { "docid": "b9c1ac59a711f87c9ba5664442a75bd7", "score": "0.48513025", "text": "function isUnitSpec(spec) {\n return 'mark' in spec;\n }", "title": "" }, { "docid": "c1b728cca69aac906569cf3a32471085", "score": "0.48442724", "text": "function verifyElement(part, expectedUnit) {\n assertEquals(true, part.type == 'literal' || part.type == 'integer');\n assertEquals('string', typeof part.value);\n if (part.type == 'integer') {\n assertEquals('string', typeof part.unit);\n assertEquals(expectedUnit, part.unit);\n }\n}", "title": "" }, { "docid": "bf517a320b6c5eb7f26f0e54d131cbdc", "score": "0.48367295", "text": "function isColorValid(color) {\n return color === 'blue' || color === 'green';\n}", "title": "" }, { "docid": "126228d89e4feac42b32b6ff3d384e16", "score": "0.48162013", "text": "function isValidInput(inputstr) {//works for both mm:ss and seconds input\r\n var i, letter,\r\n coloncounter = 0;\r\n\r\n if (!inputstr) {\r\n return false;\r\n }\r\n\r\n for (i = 0; i < inputstr.length; i) {//for each character in string\r\n letter = inputstr.charAt(i);\r\n if (letter === ':') {\r\n coloncounter++;\r\n }\r\n if (coloncounter > 1 || (isNaN(parseFloat(letter)) && letter != \".\" && letter != ':')) {//if too many colons, or any \r\n return false;//if too many colons or any character invalid\r\n }\r\n i = i + 1;\r\n }\r\n return true;//no problems!!\r\n }", "title": "" }, { "docid": "b87f76354d877bb0c5463f7c4f4d6a07", "score": "0.4767715", "text": "function isValidColor(color) {\n return isColorStringHexRGB(color) || isColorStringWebRGB(color);\n}", "title": "" }, { "docid": "a060215cd01582292e47804d52976ff0", "score": "0.47379214", "text": "function isNumber(node) {\n\treturn Object(node).type === 'number' && node.unit === '';\n}", "title": "" }, { "docid": "d933a01ee1e3260d8a998b824047ef3e", "score": "0.4730545", "text": "function validColor(command){\n\tvar valid = true;\n\t//check that the command is only 2 words\n\tif (command.length > 2){\n\t\tvalid = false;\n\t}\n\treturn valid;\n}", "title": "" }, { "docid": "a19cf37a2d805571445cb76e1e9aa896", "score": "0.47087964", "text": "function checkCss (css) {\n\n try {\n if (/http.?:\\/\\//.test(css)) {\n return 'url';\n } else {\n if (fs.existsSync(opt.css)) {\n if (fs.lstatSync(opt.css).isDirectory()) {\n return 'dir';\n } else if (fs.lstatSync(opt.css).isFile()) {\n return 'file';\n } else {\n log('[e] The css %s couldn\\'t be recognized as a dir or file.', css);\n process.exit(255);\n }\n } else {\n log('[e] %s is not a valid URL, dir or file... Fix it or try an absolute path.', opt.css);\n process.exit(255);\n }\n } \n } catch (e) {\n return false;\n }\n}", "title": "" } ]
cc2c7206b9827f53549418a322857144
Add document or section to sitemap
[ { "docid": "0dcce7252074cb594ec74baa4cf86897", "score": "0.6793669", "text": "function addSection (docid, section, site) {\n var item = site.begin(linkto.section(docid, section.id),\n section.id, `${section.number} ${section.title}`, section);\n section.contents.forEach(subsection => addSection(docid, subsection, site));\n site.end();\n return item;\n}", "title": "" } ]
[ { "docid": "137d6ae6810065fec2cc5f7dbc123c5e", "score": "0.56290424", "text": "function addSite(g, a, x) {\n var xid = g.sites.length;\n g.sitetype.push(x);\n g.sites.push(x);\n g.sitesOf[a].push(xid);\n g.sitemap[xid] = a;\n return xid;\n}", "title": "" }, { "docid": "d0590e800137a792b621bcf78176b42d", "score": "0.5416438", "text": "function add_section(link, nested_model_name, content) {\n // get the right new_id which should be in a div with class \"last_id\" at the bottom of\n // the nearest section\n var last_id = parseInt($j(link).parent().siblings('.last_id').last().html());\n var new_id = last_id + 1;\n var regexp = new RegExp(\"new_\" + nested_model_name, \"g\");\n content = content.replace(regexp, new_id);\n // kludgy: show the hidden remove_section link (we don't want it showing for non-js users)\n content = content.replace('class=\"hidden showme\"', '');\n $j(link).parent().before(content);\n}", "title": "" }, { "docid": "6598d7658bf7b1936c0abd55f3804336", "score": "0.5393045", "text": "function addMeta(document, key, value) {\n var transform = {\n title: function () {\n document.title = value;\n },\n tags: function () { \n document.tags = value.split(',');\n\n document.tags.forEach(function (tag) {\n tag = utils.trimLeadingSpaces(tag); \n indexTree.tags[tag] = indexTree.tags[tag] || [];\n indexTree.tags[tag].push(document.title);\n });\n },\n categories: function () {\n document.categories = value.split(',');\n\n document.categories.forEach(function (tag) {\n tag = utils.trimLeadingSpaces(tag); \n indexTree.categories[tag] = indexTree.categories[tag] || [];\n indexTree.categories[tag].push(document.title);\n });\n },\n author: function () { \n document.authors = value.split(',');\n\n document.authors.forEach(function (author) {\n indexTree.authors[author] = indexTree.authors[author] || [];\n indexTree.authors[author].push(author);\n });\n },\n type: function () {\n document.type = value;\n }\n };\n\n //Trim leading spaces\n value = utils.trimLeadingSpaces(value); \n if (typeof transform[key] != undefined && utils.isFn(transform[key])) {\n transform[key]();\n } else {\n //This is not a built-in meta entry, so add it to the document meta.\n document.meta[key] = value; \n }\n}", "title": "" }, { "docid": "d03b28848bbb102df53a0926ca872e51", "score": "0.5371431", "text": "function addIndexEntry(href, page) {\n indexEntries[href] = page;\n return page;\n}", "title": "" }, { "docid": "f83f1ec1958f769617f34f8ed04c7f8c", "score": "0.5269117", "text": "function AppendParentSection(elemLink, nSID) {\n if (arguments.length == 1) // if nSID isn't supplied\n {\n var elemInput = GetInputElement(document, 'PAGE'); // only do this for product pages or search results for product pages\n if (!elemInput || elemInput.value != 'PRODUCT') {\n return;\n }\n //\n // Need to make sure that the correct section ID is used for dynamic breadcrumb trail\n //\n var elemSID = GetInputElement(elemInput.form, 'SID');\n if (elemSID) {\n nSID = elemSID.value;\n }\n if (elemLink.href.indexOf('?') > -1) // needs reviewing\n {\n elemLink.href += '&SID=' + nSID;\n }\n return;\n }\n elemLink.href += '#SID=' + nSID; // add an SID anchor to the link\n}", "title": "" }, { "docid": "8111bd355824b17f5b966667a5b83274", "score": "0.51269114", "text": "function associateNodeWithSection(node, section) {\n\t\tsection.associatedNodes.push(node);\n\t\tnode.associatedSection = section;\n\t}", "title": "" }, { "docid": "f21130ca284573d17af3ed3a1a6d6ec3", "score": "0.50808054", "text": "function addOneStoryToPage(story, $location) {\n const markup = generateStoryMarkup(story);\n $location.prepend(markup);\n}", "title": "" }, { "docid": "42163a2864f019860463e0efb17476bb", "score": "0.5034597", "text": "addDocument(document)\n {\n if (!isObject(document)) {\n return this;\n }\n\n var primaryResourceKey = this.getPrimaryResourceKey(document),\n primaryResource = document[primaryResourceKey];\n\n // Map the main resource(s)\n this.mapper.addResources(primaryResourceKey, ...(primaryResource || {}));\n\n // Map the linked resources\n for (let {key: resourceType, value: resources} of each(document.linked || [])) {\n this.mapper.addResources(resourceType, ...resources);\n }\n\n // Map the URL templates\n for (let {key: resourcePath, value: urlTemplate} of each(document.links || [])) {\n this.mapper.addUrlTemplate(resourcePath, urlTemplate);\n }\n\n return this;\n }", "title": "" }, { "docid": "a02267662ab9b06e214549895047de7c", "score": "0.49846786", "text": "function insertAddLink() {\n insertLink(\"Add\", \"addLink\", addBookmark);\n}", "title": "" }, { "docid": "0433bb7070f7cb407eb39c02059e0f83", "score": "0.49772075", "text": "function addPage(url, title) {\r\n\t\tpages = getPages();\r\n\t\tpages[url] = title;\r\n\t\tsavePages();\r\n\t\trebuildPageSelect();\r\n\t}", "title": "" }, { "docid": "5d31881bc40867ee3cd100d62e36d29f", "score": "0.49639744", "text": "function switchToAddNewSection() {\n sectionOn(createNewSection)\n}", "title": "" }, { "docid": "e98c0ef4d51533a251585d647e3ed0f4", "score": "0.49539214", "text": "function getMainLinks(sitemap) {\n\tlet deferred = Q.defer();\n\tlet pages = [\n\t\t{collectionName : 'Categories', pageType : 'category', findQuery : { isActive:true, type: \"article\" } },\n\t\t{collectionName : 'Cities', pageType : 'city', findQuery : { }}, \n\t\t{collectionName : 'Magazines', pageType : '', findQuery : { }}\n\t];\n\tvar db = mongoClient.getDb();\n\tasync.forEachLimit(pages, 1, function (page, callback) {\n\t\tlet findQuery = page.findQuery;\n\t\tlet returnFields = { _id:1, slug: 1};\n\t\tdb.collection(page.collectionName).find(findQuery, returnFields).toArray(function (err, documents) {\n\t\t\tif (err) console.log(err);\n\t\t\tif (documents !== undefined && documents.length > 0) {\n\t\t\t\tif(page.collectionName == 'Categories') {\n\t\t\t\t\t// Create dynamic URL of category list page\n\t\t\t\t\tdocuments.forEach(function(doc){\n\t\t\t\t\t\tsitemap.add({url: '/category/'+ doc.slug +'/1'});\n\t\t\t\t\t\tsitemap.add({url: '/category/'+ doc.slug +'/1/sitemap.xml'});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif(page.collectionName == 'Cities') {\n\t\t\t\t\t// Create dynamic URL of category list page\n\t\t\t\t\tdocuments.forEach(function(doc){\n\t\t\t\t\t\tsitemap.add({url: '/city/'+ doc.slug +'/1'});\n\t\t\t\t\t\tsitemap.add({url: '/city/'+ doc.slug +'/1/sitemap.xml'});\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif(page.collectionName == 'Magazines') {\n\n\t\t\t\t\tdocuments.forEach(function(doc){\n\t\t\t\t\t\tsitemap.add({url: '/magazine/'+doc.slug+'/1'});\n\t\t\t\t\t\tsitemap.add({url: '/magazine/'+doc.slug+'/1'+'/sitemap.xml'});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tcallback();\n\t\t\t} else {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t});\n\t}, function (err) {\n\t\tif (err) console.error(err);\n\t\tdeferred.resolve(true);\n\t});\n\treturn deferred.promise;\n}", "title": "" }, { "docid": "52b3f35184a41fe999c63f221a30ff8e", "score": "0.49368975", "text": "function middleware (sitemap) {\n return function (req, res, next) {\n res.locals.navinfo = sitemap.navinfo(req.path);\n next();\n };\n}", "title": "" }, { "docid": "ffad71002d20ab46d7132ae35e8fb4f0", "score": "0.49303812", "text": "function spiTools_addLink(pageTitle) {\n mw.loader.using('mediawiki.util').then(function () {\n const parts = pageTitle.split('/');\n const last = parts.length - 1;\n const caseName = parts[last] == 'Archive' ? parts[last - 1] : parts[last];\n mw.util.addPortletLink('p-cactions',\n 'javascript:spiTools_init(\"' + caseName + '\")',\n 'SPI Tools',\n 'ca-spiTools',\n 'Open SPI Tools');\n });\n}", "title": "" }, { "docid": "ba949f082c1048b6070f88eae3b24fc6", "score": "0.49297243", "text": "function addToCrawledSite(parent, item) {\n if (parent)\n parent.children.push(item);\n else {\n storage.crawledSite.push(item);\n }\n}", "title": "" }, { "docid": "5979d7002641affe57930219a5cd484d", "score": "0.49215162", "text": "function getMainSitemapXml(req, res) {\n\tvar sitemap = sm.createSitemap ({\n\t\thostname: 'https://' + req.headers.host,\n\t\tcacheTime: 600000,// 600 sec - cache purge period\n\t});\n\tsitemap.add({url: '/photo/1'});\n\tsitemap.add({url: '/photo/1/sitemap.xml'});\n\tsitemap.add({url: '/photo-gallery'});\n\tsitemap.add({url: '/sitemap'});\n\tsitemap.add({url: '/static-page/about-us'});\n\tsitemap.add({url: '/static-page/contact-us'});\n\tsitemap.add({url: '/static-page/terms-condition-with-us'});\n\tsitemap.add({url: '/static-page/advertise-with-us'});\n\tsitemap.add({url: '/static-page/feed-back'});\n\tgetMainLinks(sitemap).then(function(){\n\t\tsitemap.toXML( function (err, xml) {\n\t\t\tif (err) {\n\t\t\t\treturn res.status(500).end();\n\t\t\t}\n\t\t\tres.header('Content-Type', 'application/xml');\n\t\t\tres.send( xml );\n\t\t});\n\t});\n}", "title": "" }, { "docid": "dba041e44852d66ee161e0330aa2c9d9", "score": "0.4918761", "text": "addRoute(id, pageObject, defaultRoute = false) {\n this.titleBar.addLink(id, '');\n // takes the id and pageObject and add to routeMap object as key:value pair\n this.routeMap[id] = pageObject;\n // if default route is set to true, set state for default route to the id\n // of the route passing in true.\n if(defaultRoute) {\n this.defaultRoute = id;\n }\n }", "title": "" }, { "docid": "4e020b9e553a6c91cb6dc036e0601bcb", "score": "0.4917565", "text": "function addNodeToSearchResult(node)\n\t\t{\n\t\t\tvar matches = sNode.getChildren();\n\t\t\tvar addNode = true;\n\t\t\tfor(var i = 0;i < matches.length;i++)\n\t\t\t{\n\t\t\t\tif(matches[i].getPath() == node.getPath())\n\t\t\t\t{\n\t\t\t\t\taddNode = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(addNode)\n\t\t\t{\n\t\t\t\tsNode.addNode(node);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5acc0229dfbe0fda9df2609767973be1", "score": "0.49048296", "text": "function Sitemap(element, options) {\n this.element = element;\n this.containerWidth = $(this.element).width();\n this.containerHeight = $(this.element).height();\n\n this.options = $.extend({}, defaults, options);\n\n this.windows = {};\n\n this.data = options.data;\n this.inited = false;\n this.resize_timeout = -1;\n\n this.init();\n }", "title": "" }, { "docid": "5acc0229dfbe0fda9df2609767973be1", "score": "0.49048296", "text": "function Sitemap(element, options) {\n this.element = element;\n this.containerWidth = $(this.element).width();\n this.containerHeight = $(this.element).height();\n\n this.options = $.extend({}, defaults, options);\n\n this.windows = {};\n\n this.data = options.data;\n this.inited = false;\n this.resize_timeout = -1;\n\n this.init();\n }", "title": "" }, { "docid": "6a4980b35d7fa548e62e2ff532789b92", "score": "0.4901676", "text": "function addPageBook(aURI, aTitle, aBook, aTags, aKey, aTransitionType, aNoVisit)\n{\n gNextTestSetupTasks.push([task_addPageBook, arguments]);\n}", "title": "" }, { "docid": "f02713528652dd01203f838bc125cefe", "score": "0.4897916", "text": "add(section) {\n if (typeof section === 'undefined') {\n let section = new PdfSection(this.pdfDocument);\n this.add(section);\n return section;\n }\n else {\n // if (section === null) {\n // throw new Error('ArgumentNullException : section');\n // }\n let r = this.checkSection(section);\n this.sections.push(section);\n section.parent = this;\n this.sectionCollection.add(r);\n return this.sections.indexOf(section);\n }\n }", "title": "" }, { "docid": "ad4d002c85959aedd6b060b301b204be", "score": "0.48779348", "text": "function addSectionConfigToTieItem(tieItem, section){\n \n console.log(\"addSectionConfigToTieItem\");\n let arrTieContentConfig = tieItem.content.configuration;\n\n let ti_section = {\n ti_secid : section.attr(\"ti_secid\"), //section id \n ti_secnm : section.attr(\"ti_secnm\"), //section name\n ti_elems:[] //section elements\n }\n\n //add to Tie Item Content Config array\n arrTieContentConfig.push(ti_section);\n\n //add to UI of Dashboard Configuration - section dropdown list \n /*\n let ddl_select_section = d3.select(\"#ddl_select_section\"); //sections dropdown\n \n ddl_select_section.append(\"option\")\n .attr(\"value\",ti_section.ti_secid)\n .text(ti_section.ti_secnm);\n */\n initUIConfigSection(); \n}", "title": "" }, { "docid": "4cc1b9e87306a012b4e82122afe3ef06", "score": "0.4847293", "text": "function addItem() {\n //looping over all sections\n for (let section of sections) {\n //creating new li element\n let li = document.createElement('li');\n\n //getting anchor values\n let anchor = document.createElement('a');\n let link = section.getAttribute('id');\n let name = section.getAttribute('data-nav');\n anchor.innerHTML = `<a href='#${link}'>${name}</a>`;\n anchor.classList.add('menu__link');\n anchor.classList.add('navbar__menu');\n\n\n //appending children\n li.appendChild(anchor);\n frag.appendChild(li);\n\n\n\n }\n\n list.appendChild(frag);\n\n}", "title": "" }, { "docid": "0fe5c264717384f5d6c593e333375b59", "score": "0.48399335", "text": "function addSection(elem, data, add_content, is_cover) {\n\t\tvar s = document.createElement(\"section\")\n\t\tif(is_cover) {\n\t\t\ts.classList.add(\"cover\")\n\t\t}\n\t\telem.appendChild(s)\n\t\t_slideTitles[_slide_h] = _slideTitles[_slide_h] || []\n\t\tvar slideTitles = _slideTitles[_slide_h]\n\t\tif(data) { // always adds background and class if present\n\t\t\tvar first = Array.isArray(data) ? data[0] : data;\n\t\t\tif(first.background) {\n\t\t\t\ts.setAttribute(\"data-background\", first.background)\n\t\t\t}\n\t\t\tif(first.class) {\n\t\t\t\tfirst.class.split(\" \").forEach(function (c) {\n\t\t\t\t\ts.classList.add(c)\n\t\t\t\t})\n\t\t\t}\n\t\t\tvar title = getTitle(data)\n\t\t\tslideTitles[_slide_v] = title\n\t\t\tif(add_content) {\n\t\t\t\taddContent(s, data)\n\t\t\t\tif(_navigation) { // if slide has no content, it has no nav (it probably is a container for other slides)\n\t\t\t\t\tvar li = document.createElement(\"li\")\n\t\t\t\t\tli.setAttribute(\"title\", title)\n\t\t\t\t\tli.setAttribute(\"data-slide-h\", _slide_h)\n\t\t\t\t\tli.setAttribute(\"data-slide-v\", _slide_v)\n\n\t\t\t\t\tli.addEventListener(\"click\", navigate)\n\n\t\t\t\t\t_navigation.appendChild(li)\n\t\t\t\t\t//console.log(\"Storyrevealer::addSection:title\", _slide_v, title, data)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn s\n\t}", "title": "" }, { "docid": "c8e06605a97974ea40f2d9bf5119a78b", "score": "0.48325568", "text": "function addSection(section) {\n let sectionIndex = _sections.length; //isnt it :p\n \n //its a row section to need to uni(quei)fy\n section = SectionComputer.unifySection(section);\n _sections.push(section);\n \n syncService.updateSection(_sections, sectionIndex);\n\n setActiveSection(sectionIndex);\n}", "title": "" }, { "docid": "28dd1848f1f57ef370aff50db6f52318", "score": "0.4830283", "text": "function add_doc() {\n var tbl, row;\n tbl = document.evaluate( doc_items, document, null,\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null )\n .snapshotItem(0);\n if (!tbl)\n return;\n row = tbl.insertRow(3);\n row.innerHTML=\"<th>L</th><td>Opens the next results page.</td>\";\n row = tbl.insertRow(1);\n row.innerHTML=\"<th>H</th><td>Opens the previous results page.</td>\";\n}", "title": "" }, { "docid": "7ad638be9633aa66b84e15b6beb5b17a", "score": "0.482483", "text": "function insertMapData(doc) {\r\n\ttry {\r\n\t\tflag ( \"insertMapData():: Started!\" );\r\n\t\tif ( doc != null && doc != \"\" && doc ) {\r\n\t\t\t// verify the coords have not changed recently\r\n\t\t\txOld = xCoord;\r\n\t\t\tyOld = yCoord;\r\n\t\t\tfindXYCoordinates();\r\n\t\t\tif ( xOld != xCoord || yOld != yCoord ) {\r\n\t\t\t\tgetMapData();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\r\n\t\t\tvar mapHeading = document.getElementById(\"info_map_heading\");\r\n\t\t\tif ( mapHeading ) {\r\n\t\t\t\tvar radius = GM_getValue ( myTravianHost + \"_\" + myuid + \"_map_radius\", \"0\" );\r\n\t\t\t\tif ( radius == \"0\" )\r\n\t\t\t\t\tradius = \"5\";\r\n\t\t\t\tmapHeading.innerHTML = \"(\" + xCoord + \"|\" + yCoord + \") from \";\r\n\t\t\t\tif ( infoServer == \"1\" ) // www.travian.ws\r\n\t\t\t\t\tmapHeading.innerHTML += \"<a href='http://www.travian.ws/analyser.pl?s=\" \r\n\t\t\t\t\t\t+ myTravianServer + \"&q=\" + xCoord + \",\" + yCoord + \",\" + radius\r\n\t\t\t\t\t\t+ \"' target='_blank'>www.travian.ws</a></span> ☠</b>\";\r\n\t\t\t\telse // travian-utils.com\r\n\t\t\t\t\tmapHeading.innerHTML += \"<a href='http://travian-utils.com/?s=\" \r\n\t\t\t\t\t\t+ myTravianServer + \"&act\" + \"&x=\" + xCoord + \"&y=\" + yCoord + \"&r=\" + radius\r\n\t\t\t\t\t\t+ \"' target='_blank'>travian-utils.com</a>\";\r\n\t\t\t}\r\n\t\r\n\t\t\t// just get the required stuff and discard the rest\r\n\t\t\tvar line = doc.split('\\n').join(\" \");\r\n\t\t\tvar line = line.split('\\r').join(\"\");\r\n\t\t\tif ( infoServer == \"1\" ) {\r\n\t\t\t\tvar temp = line.match(/<table class=\\\"coltable\\\">(.|\\n)*\\/table>/);\r\n\t\t\t\tif ( temp != null )\r\n\t\t\t\t\tdoc = temp[0];\r\n\t\t\t\telse\r\n\t\t\t\t\tdoc = \"\";\r\n\t\t\t}\r\n\t\t\telse if ( infoServer == \"2\" ) {\r\n\t\t\t\tvar temp = line.match(/<table class=\\\"tsu_list brd_a x09 sm1\\\">.*\\/table>/);\r\n\t\t\t\tif ( temp != null )\r\n\t\t\t\t\tdoc = temp[0];\r\n\t\t\t\telse\r\n\t\t\t\t\tdoc = \"\";\r\n\t\t\t}\r\n\t\t\t//flag ( \"insertMapData():: doc: \" + doc );\r\n\t\r\n\t\t\tvar divElement = document.createElement('div');\r\n\t\t\tdivElement.innerHTML = doc;\r\n\r\n\t\t\tif ( infoServer == \"2\" ) {\r\n\t\t\t\t// delete scripts from travian utils as they break our script\r\n\t\t\t\tif ( true ) {\r\n\t\t\t\t\tvar tt = document.evaluate(\"//table[@class='tsu_list brd_a x09 sm1']/tbody/tr[1]/td[1]\", divElement, null, 9, null).singleNodeValue;\r\n\t\t\t\t\tif ( tt )\r\n\t\t\t\t\t\ttt.innerHTML = \"\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\t// find relevant map data in doc...\r\n\t\t\tvar table = null;\r\n\t\t\tif ( infoServer == \"1\" ) {\r\n\t\t\t\ttable = document.evaluate(\"//table[@class='coltable']/tbody/tr\", divElement, null, 6, null);\r\n\t\t\t}\r\n\t\t\telse if ( infoServer == \"2\" ) {\r\n\t\t\t\ttable = document.evaluate(\"//table[@class='tsu_list brd_a x09 sm1']/tbody/tr\", divElement, null, 6, null);\r\n\t\t\t}\r\n\t\r\n\t\t\t// insert relevant data into page...\r\n\t\t\tvar tabMapInnerDiv = document.getElementById(\"info_map_div\");\r\n\t\t\tif ( tabMapInnerDiv != null && table.snapshotLength > 0 ) {\r\n\t\t\t\tvar tableDataElement = document.createElement('table');\r\n\t\t\t\tif ( infoServer == \"1\" ) {\r\n\t\t\t\t\ttableDataElement.style.width = \"750px\";\r\n\t\t\t\t\t//tableDataElement.style.padding = \"0px 10px 0px 10px\";\r\n\t\t\t\t}\r\n\t\t\t\telse if ( infoServer == \"2\" )\r\n\t\t\t\t\ttableDataElement.setAttribute(\"class\", \"tsu_list brd_a x09 sm1\");\r\n\t\t\t\tvar tableBodyElement = document.createElement('tbody');\r\n\t\t\t\ttableDataElement.appendChild(tableBodyElement);\r\n\t\r\n\t\t\t\tvar radius = GM_getValue ( myTravianHost + \"_\" + myuid + \"_map_radius\", \"0\" );\r\n\t\t\t\tvar allowedDiff = -1;\r\n\t\t\t\tif ( myTravianVersion == \"4.0\" )\r\n\t\t\t\t\tallowedDiff = 4;\r\n\t\t\t\telse if ( myTravianVersion == \"3.6\" )\r\n\t\t\t\t\tallowedDiff = 3;\r\n\t\t\t\tif ( radius == \"0\" ) {\r\n\t\t\t\t\tvar itr = 1;\r\n\t\t\t\t\tif ( table.snapshotLength > 1 ) {\r\n\t\t\t\t\t\ttableBodyElement.appendChild(table.snapshotItem(0)); // heading or 'There are no villages'\r\n\t\t\t\t\t\tfor ( var ctr = 1 ; ctr < table.snapshotLength ; ctr++ ) {\r\n\t\t\t\t\t\t\t//flag ( \"insertMapData():: ctr: \" + ctr );\r\n\t\t\t\t\t\t\tvar xy = table.snapshotItem(ctr).textContent.match(/\\([-0-9 ]{1,}\\|[-0-9 ]{1,}\\)/)[0].match(/[-0-9]{1,}\\b/g);\r\n\t\t\t\t\t\t\t//flag ( \"insertMapData():: xy: \" + xy + \", allowedDiff: \" + allowedDiff );\r\n\t\t\t\t\t\t\t//flag ( \"insertMapData():: diffx: \" + ( Math.abs ( xy[0] - xCoord ) )\r\n\t\t\t\t\t\t\t//\t\t+ \", diffy: \" + ( Math.abs ( xy[1] - yCoord ) ) );\r\n\t\t\t\t\t\t\tif ( ( Math.abs ( xy[0] - xCoord ) <= allowedDiff ) && ( Math.abs ( xy[1] - yCoord ) <= allowedDiff ) ) {\r\n\t\t\t\t\t\t\t\tif ( infoServer == \"2\" )\r\n\t\t\t\t\t\t\t\t\ttable.snapshotItem(ctr).childNodes[1].innerHTML = itr;\r\n\t\t\t\t\t\t\t\ttableBodyElement.appendChild(table.snapshotItem(ctr));\r\n\t\t\t\t\t\t\t\titr++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( itr == 1 ) { // when no villages are added\r\n\t\t\t\t\t\ttableBodyElement.innerHTML = \"\"; // removed already added 'There are no villages' or the heading\r\n\t\t\t\t\t\tvar thNoVilla = document.createElement('th');\r\n\t\t\t\t\t\tthNoVilla.colspan = 2;\r\n\t\t\t\t\t\tthNoVilla.innerHTML = \"There are no villages in db!\";\r\n\t\t\t\t\t\ttableDataElement.appendChild(thNoVilla);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tfor ( var ctr = 0 ; ctr < table.snapshotLength ; ctr++ ) {\r\n\t\t\t\t\t\ttableBodyElement.appendChild(table.snapshotItem(ctr));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\ttabMapInnerDiv.innerHTML = \"\";\r\n\t\t\t\ttabMapInnerDiv.style.paddingLeft = \"20px\";\r\n\t\t\t\ttabMapInnerDiv.style.clear = \"both\";\r\n\t\t\t\ttabMapInnerDiv.appendChild(tableDataElement); // + footer;\r\n\t\r\n\t\t\t\t// convert all anchors in tabMapInnerDiv to lead to info server ...\r\n\t\t\t\tvar anchors = tabMapInnerDiv.getElementsByTagName(\"a\");\r\n\t\t\t\tfor ( var ctr = 0 ; ctr < anchors.length ; ctr++ ) {\r\n\t\t\t\t\tvar anchor = anchors[ctr].getAttribute(\"href\");\r\n\t\t\t\t\tvar temp = \"\";\r\n\t\t\t\t\tif ( infoServer == \"1\" ) {\r\n\t\t\t\t\t\t//flag ( \"insertMapData():: anchor: \" + anchor );\r\n\t\t\t\t\t\tif ( anchor.indexOf ( myTravianHost ) == -1 && anchor.indexOf ( \"http:\" ) == -1 )\r\n\t\t\t\t\t\t\ttemp = \"http://www.travian.ws/analyser.pl?\" + anchor.split(\"?\")[1];\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\ttemp = anchor;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( infoServer == \"2\" ) {\r\n\t\t\t\t\t\ttemp = \"http://travian-utils.com/?\" + anchor.split(\"?\")[1];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( myTravianVersion == \"4.0\" && temp.match( /\\bkarte\\.php\\b.*\\bz=[0-9]{1,}/ ) != null ) {\r\n\t\t\t\t\t\tvar coord = temp.match ( /\\bz=[0-9]{1,}/ )[0].match ( /[0-9]{1,}/ );\r\n\t\t\t\t\t\tvar xcoord = getXfromCoord ( coord );\r\n\t\t\t\t\t\tvar ycoord = getYfromCoord ( coord );\r\n\t\t\t\t\t\t//temp = temp.replace ( /\\bz=[0-9]{1,}/ , \"x=\"+xcoord+\"&y=\"+ycoord );\r\n\t\t\t\t\t\ttemp = \"http://\"+myTravianHost+\"/position_details.php?x=\"+xcoord+\"&y=\"+ycoord;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tanchors[ctr].href = temp;\r\n\t\t\t\t\tanchors[ctr].target = \"_blank\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// convert all image hrefs\r\n\t\t\t\tif ( infoServer == \"1\" ) {\r\n\t\t\t\t\tvar allImgs = tabMapInnerDiv.getElementsByTagName(\"img\");\r\n\t\t\t\t\tfor ( var ctr = 0 ; ctr < allImgs.length ; ctr++ ) {\r\n\t\t\t\t\t\tvar imgSrc = allImgs[ctr].getAttribute(\"src\");\r\n\t\t\t\t\t\tif ( imgSrc.indexOf ( \"www.travian.ws\" ) == -1 && imgSrc.indexOf ( \"http:\" ) == -1 ) {\r\n\t\t\t\t\t\t\timgSrc = \"http://www.travian.ws/\" + imgSrc;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tallImgs[ctr].src = imgSrc;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( infoServer == \"2\" ) {\t\r\n\t\t\t\t\t// do some formatting...\r\n\t\t\t\t\tvar datesInTable = document.getElementsByClassName(\"sdv\");\r\n\t\t\t\t\tfor ( var ctr in datesInTable ) {\r\n\t\t\t\t\t\tdatesInTable[ctr].setAttribute(\"style\",\"text-align: center\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar villagesInTable = document.getElementsByClassName(\"l\");\r\n\t\t\t\t\tfor ( var ctr in villagesInTable ) {\r\n\t\t\t\t\t\tvillagesInTable[ctr].setAttribute(\"style\",\"padding: 0px 10px 0px 10px\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ( tabMapInnerDiv != null ) {\r\n\t\t\t\ttabMapInnerDiv.style.paddingLeft = \"20px\";\r\n\t\t\t\ttabMapInnerDiv.style.clear = \"both\";\r\n\t\t\t\ttabMapInnerDiv.innerHTML = \"No Data available, probably new player or server down, check later!\";\r\n\t\t\t}\r\n\t\t\tgetShishNetMap();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar tabMapInnerDiv = document.getElementById(\"info_map_div\");\r\n\t\t\ttabMapInnerDiv.style.paddingLeft = \"20px\";\r\n\t\t\ttabMapInnerDiv.style.clear = \"both\";\r\n\t\t\ttabMapInnerDiv.innerHTML = \"No Data available, probably new player or server down, check later!\";\r\n\t\t}\r\n\t}\r\n\tcatch ( err ) {\r\n\t\tprintStackTrace();\r\n\t\tvar msg = \"insertMapData():: Something went wrong, error: \" + err.name + \", Error Message: \" + err.message;\r\n\t\tflag ( msg );\r\n\t\tthrow err;\r\n\t}\r\n}", "title": "" }, { "docid": "6d7080232a1dd6ae769ff7b170712b39", "score": "0.48210225", "text": "function insDoc(parentFolder, document)\r\n{\r\n theChild = parentFolder.addChild(document)\r\n checkDetectedAnnotation(theChild)\r\n checkPossibleAnnotation(theChild)\r\n return theChild\r\n}", "title": "" }, { "docid": "e0ab6ed95be68e54a399dc0ba2e37758", "score": "0.48079148", "text": "function sitemap()\r\n{\r\n\t// grab all h2 elements\r\n\tvar h = document.getElementsByTagName('h2');\r\n\t// grab all unordered lists\r\n\tvar u = document.getElementsByTagName('ul');\r\n\r\n\tfor(i=0;i<u.length;i++)\r\n\t{\r\n\t\t// hide all unordered lists with 'sitemap' class\r\n\t\tif(u[i].className == 'sitemap')\r\n\t\t{\r\n\t\t\tu[i].style.display = 'none';\r\n\t\t}\r\n\r\n\t\t// get all links\r\n\t\tvar a = u[i].getElementsByTagName('a');\r\n\t\tfor(z = 0; z < a.length; z++)\r\n\t\t{\r\n\t\t\t// checks if link has a class of 'parent'\r\n\t\t\tif(a[z].className == 'parent')\r\n\t\t\t{\r\n\t\t\t\tvar li = a[z].parentNode;\r\n\t\t\t\t// creates maximise.gif element\r\n\t\t\t\tvar img = document.createElement('img');\r\n\t\t\t\t\timg.className = 'icon';\r\n\t\t\t\t\timg.src = 'templates/common/images/maximise.gif';\r\n\t\t\t\t\timg.style.verticalAlign = 'middle';\r\n\r\n\t\t\t\tli.insertBefore(img, a[z]);\r\n\t\t\t\t// set style\r\n\t\t\t\tli.className = 'parent';\r\n\r\n\t\t\t\t//hide child unordered list\r\n\t\t\t\tul = a[z].nextSibling;\r\n\t\t\t\twhile (ul.nodeType != 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tul = ul.nextSibling;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tul.style.display = 'none';\r\n\r\n\t\t\t\t// make clicking new image hide/show child unordered list\r\n\t\t\t\timg.onclick = function()\r\n\t\t\t\t{\r\n\t\t\t\t\tli = this.parentNode;\r\n\t\t\t\t\tul = li.getElementsByTagName('ul')[0];\r\n\t\t\t\t\tvar ulStatus = (ul.style.display == 'none') ? 'block' : 'none';\r\n\t\t\t\t\tul.style.display = ulStatus;\r\n\r\n\t\t\t\t\t// toggle between maximise.gif and minimise.gif\r\n\t\t\t\t\timgStatus = (ulStatus == 'block') ? 'minimise' : 'maximise';\r\n\t\t\t\t\tthis.src = 'templates/common/images/' + imgStatus + '.gif';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfor(x = 0; x < h.length; x++)\r\n\t{\r\n\t\t// assign unique IDS to each h2 element\r\n\t\th[x].id = 'h2' + x;\r\n\t\th[x].className = 'maximise';\r\n\r\n\t\t// make h2 element show/hide unordered list when clicked\r\n\t\th[x].onclick = function()\r\n\t\t{\r\n\t\t\tvar ul = this.nextSibling;\r\n\r\n\t\t\twhile (ul.nodeType != 1)\r\n\t\t\t{\r\n\t\t\t\tul = ul.nextSibling;\r\n\t\t\t}\r\n\r\n\t\t\tvar ulStatus = (ul.style.display == 'none') ? 'block' : 'none';\r\n\r\n\t\t\tul.style.display = ulStatus;\r\n\t\t\tvar hStatus = (ulStatus == 'block') ? 'minimise' : 'maximise';\r\n\t\t\tthis.className = hStatus;\r\n\r\n\t\t\t// set cookie\r\n\t\t\treturn writePrefs(this.id,ulStatus);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "6b71f9112ec592ca7187761a4f3fc831", "score": "0.47913688", "text": "function addNewSection(htmlText){\n allSections[allSections.length-1].insertAdjacentHTML('afterend',htmlText);\n navigationBar.appendChild(initializeNavItem(allSections[allSections.length-1],allSections.length-1));\n ShowHideNavBarScrollBar();\n navigationBar.scrollTo({\n left: navigationBar.scrollWidth ,\n behavior: 'smooth'});\n \n changeActiveClass(allSections[allSections.length-1])\n}", "title": "" }, { "docid": "76b023d8f112434bb86b9a8d036d6bf4", "score": "0.47901493", "text": "function renovateAdd(sectionId) {\n let section = {}; // blank section object\n closet.push(section);\n // When using strings, bracket notation\n // Prevent logic errors when assigning undeclared properties\n index[sectionId] = index.size;\n index.size++;\n return \"Added \" + sectionId + \" to closet.\"\n}", "title": "" }, { "docid": "6e4034b5d7601309140afbacb76dab89", "score": "0.47871363", "text": "function applyIdToMap(inst, map, node, nodeInfo) {\n if (nodeInfo.id) {\n map[nodeInfo.id] = node;\n }\n }", "title": "" }, { "docid": "09d008ba53729c1a33ee6c9fcf121186", "score": "0.47833177", "text": "addToDataset(node, location) {\n let elem;\n\n if (node.parent) {\n elem = this.findById(node.parent);\n }\n\n if (location === 'bottom' && !node.parent && !elem) {\n this.settings.dataset.push(node);\n }\n\n if (location === 'top' && !node.parent && !elem) {\n this.settings.dataset.unshift(node);\n }\n\n if (node.parent && elem) {\n if (!elem.children) {\n elem.children = [];\n }\n\n if (location === 'bottom') {\n elem.children.push(node);\n } else {\n elem.children.unshift(node);\n }\n }\n\n return !(node.parent && !elem);\n }", "title": "" }, { "docid": "19b0a4f6396c8122756b08067f3cf5c4", "score": "0.47702053", "text": "function sectionify (doc) {\n var body = doc.get('body')\n var sibling = body.child(0)\n var node\n var section = new libxml.Element(doc, 'section')\n\n while (sibling) {\n node = sibling\n sibling = sibling.nextSibling()\n\n // FIXME: We should guess at the rank of the heading to chunk the document\n // on.\n if (node.type() === 'element' && node.name() === 'h2') {\n // Does the current section have content?\n if (section.child(0) !== null) {\n node.addPrevSibling(section)\n\n section = new libxml.Element(doc, 'section')\n }\n }\n\n node.remove()\n section.addChild(node)\n }\n\n body.addChild(section)\n}", "title": "" }, { "docid": "d594510e1cb406b16ae673bc3c287243", "score": "0.47547045", "text": "addPage() {\n this.doc.addPage({\n layout: this.layout,\n margins: this.margins,\n });\n this.resetPosition();\n }", "title": "" }, { "docid": "6df87985ca1a30f2fe0353dbbe5e0d69", "score": "0.47539017", "text": "function applyIdToMap(inst, map, node, nodeInfo) {\n if (nodeInfo.id) {\n map[nodeInfo.id] = node;\n }\n}", "title": "" }, { "docid": "5116456001b022d83e8875e8edbb5322", "score": "0.47415075", "text": "function new_sec() {\n section.new();\n menu.men_build();\n}", "title": "" }, { "docid": "8cdeb4f6e72c78fa8fbb7d378635130d", "score": "0.4729196", "text": "function write(site) {\n function prep(root, p) {\n var dir = path.join(root, path.dirname(p))\n\n if (!sh.test(\"-e\", dir))\n sh.mkdir(\"-p\", dir)\n\n return path.join(root, p)\n }\n\n function wrt(list, root) {\n list.forEach(function (item) {\n var ap = prep(root, item.meta.path)\n\n if (item.meta.binary)\n fs.writeFileSync(ap, item.data, { encoding: \"binary\" })\n else\n item.data.to(ap)\n\n if (item.meta.altPath)\n (\"<html><meta http-equiv=refresh content='0;\" + item.meta.url + \"'></html>\").to(prep(root, item.meta.altPath))\n })\n }\n\n wrt(site.pages, path.resolve(path.join(site.src, \"site\")))\n wrt(site.resources, path.resolve(path.join(site.src, \"site\", \"res\")))\n\n return site\n}", "title": "" }, { "docid": "409c86c3df2cdb61dfc2c93c15af25b2", "score": "0.47044498", "text": "function addPOI(poiJson){\n bernApp.AgendaDatabase.addEntry(poiJson).done(function(){\n global.location = \"../agenda/agenda.html\";\n });\n }", "title": "" }, { "docid": "c343b9eccac4a493a0e1fafdfa5d9c10", "score": "0.46932828", "text": "function addDocToLibraries (doc) {\n //AppController.sharedInstance().librariesController().addAssetLibraryAtURL(doc.fileURL())\n\tdoc.saveAndAddLibrary()\n}", "title": "" }, { "docid": "6515c4820dc70f0dd564754e8a2935f1", "score": "0.46907708", "text": "function addPages (db, site) {\n site.begin(appurl('pages'), 'Pages').topmost = true;\n var pgq = db.pages.chain()\n .groupBy(page => page.relative.split('/').slice(0,-1).join('/'))\n .value()\n ;\n var addPage = (page =>\n site.add(appurl.page(page), page.stem, page.data.title));\n\n if (pgq['']) {\n pgq[''].forEach(addPage);\n delete pgq[''];\n }\n for (var subdir of _.keys(pgq).sort()) {\n site.begin(appurl.pagedir(subdir), '/' + subdir + '/');\n pgq[subdir].forEach(addPage);\n site.end();\n }\n\n site.end();\n}", "title": "" }, { "docid": "dcc3a26505464283705c0564916612d1", "score": "0.46755454", "text": "function createSection(sectionItem){\n // create section\n var section = document.createElement('section');\n section.setAttribute(\"id\", sectionItem.section);\n section.setAttribute(\"data-nav\" , sectionItem.section);\n // create section content\n var div = document.createElement('div');\n div.className = \"landing__container\";\n var h2 = document.createElement('h2');\n h2.textContent = sectionItem.section;\n var p = document.createElement('p');\n p.textContent = sectionItem.description;\n div.appendChild(h2)\n div.appendChild(p)\n // add the content to section tag\n section.appendChild(div)\n let mainBody = document.getElementById('main-body')\n // add section in main \n mainBody.appendChild(section)\n}", "title": "" }, { "docid": "34b11e5a863d5cab6d80d8da86b57074", "score": "0.4659283", "text": "function addSection() {\n \n let Sections = document.querySelectorAll('main > section');\n let temp = document.createElement('section');\n\n const mainBody = document.querySelector('main');\n \n temp.id=\"section\"+(Sections.length+1);//id convention similar to the one in HTML\n temp.setAttribute(\"data-nav\", \"Section \"+(Sections.length+1)); //setting the data-nav which will be the text content of the navigation\n \n let tempDiv = document.createElement('div');\n tempDiv.setAttribute(\"class\", \"landing__container\");\n temp.appendChild(tempDiv);\n \n let tempH2 = document.createElement('h2');\n tempH2.textContent = \"Section \"+(Sections.length+1);\n tempDiv.appendChild(tempH2);\n \n \n let tempP = document.createElement('p');\n tempP.textContent = `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fermentum metus faucibus lectus pharetra\n dapibus. Suspendisse potenti. Aenean aliquam elementum mi, ac euismod augue. Donec eget lacinia ex. Phasellus\n imperdiet porta orci eget mollis. Sed convallis sollicitudin mauris ac tincidunt. Donec bibendum, nulla eget\n bibendum consectetur, sem nisi aliquam leo, ut pulvinar quam nunc eu augue. Pellentesque maximus imperdiet\n elit a pharetra. Duis lectus mi, aliquam in mi quis, aliquam porttitor lacus. Morbi a tincidunt felis. Sed leo\n nunc, pharetra et elementum non, faucibus vitae elit. Integer nec libero venenatis libero ultricies molestie\n semper in tellus. Sed congue et odio sed euismod.`;\n tempDiv.appendChild(tempP);\n \n let tempP2 = document.createElement('p');\n tempP2.textContent = `Aliquam a convallis justo. Vivamus venenatis, erat eget pulvinar gravida, ipsum lacus aliquet velit, vel\n luctus diam ipsum a diam. Cras eu tincidunt arcu, vitae rhoncus purus. Vestibulum fermentum consectetur\n porttitor. Suspendisse imperdiet porttitor tortor, eget elementum tortor mollis non.`;\n \n tempDiv.appendChild(tempP2); \n mainBody.appendChild(temp);\n}", "title": "" }, { "docid": "d0c646ed812aa5090434b4cf0dddf51f", "score": "0.46570602", "text": "function loadInfoPage() {\n $('#info > article > ul').html(setInfoPage());\n}", "title": "" }, { "docid": "d0c646ed812aa5090434b4cf0dddf51f", "score": "0.46570602", "text": "function loadInfoPage() {\n $('#info > article > ul').html(setInfoPage());\n}", "title": "" }, { "docid": "5cf3f4e71fad9637fefbd43e0b080083", "score": "0.46517983", "text": "function addPage(page) {\n // const newPage = new Note(page);\n if (page.page_type == 'checklist') {\n pagesList.push(new Checklist(page));\n } else {\n pagesList.push(new Note(page));\n }\n \n}", "title": "" }, { "docid": "9f4d24aa12b5797a76424d71008a5536", "score": "0.46502557", "text": "function insertRssLink() {\n\tif ( $(\"#rss-list-link\").length > 0 ) {\n\t\t$(\"#rss-list-link\").attr(\"href\", rssUrl(expectedListPageParams));\n\t}\n\n\tif ( $(\"#rss-calendar-link\").length > 0) {\n\t\t$(\"#rss-calendar-link\").attr(\"href\", rssUrl(expectedReleaseCalPageParams));\n\t}\n}", "title": "" }, { "docid": "f10d26f3175224835c3238262231bdd0", "score": "0.46494657", "text": "function addNav (nav, content, index) {\n let foundLevel1 = false;\n if (!content) {\n return foundLevel1;\n }\n const topics = content.match(/<h(1|2).*?>(.+?)<\\/h(1|2)>/gi);\n if (topics) {\n topics.forEach(function (entry) {\n const level = entry.substring(2, 3);\n const title = entry.replace(/<.+?>/g, ''); // Remove all HTML tags for the title\n const entryTags = entry.match(/id=\"api-([^-]+)(?:-(.+))?\"/); // Find the group and name in the id property\n const group = entryTags ? entryTags[1] : null;\n const name = entryTags ? entryTags[2] : null;\n if (level === '1' && title && group) {\n nav.splice(index, 0, {\n group: group,\n isHeader: true,\n title: title,\n isFixed: true,\n });\n index++;\n foundLevel1 = true;\n }\n if (level === '2' && title && group && name) {\n nav.splice(index, 0, {\n group: group,\n name: name,\n isHeader: false,\n title: title,\n isFixed: false,\n version: '1.0',\n });\n index++;\n }\n });\n }\n return foundLevel1;\n }", "title": "" }, { "docid": "b75fdbf03fe23be46d995af486c2a9c4", "score": "0.46466494", "text": "function addToOutput(name, doc) {\n let arr = output[name];\n if (arr && arr != null) {\n if(!doc.__index) { doc.__index = arr.length; }\n arr.push(doc);\n }\n else {\n arr = [];\n if(!doc.__index) { doc.__index = 0; }\n arr.push(doc);\n output[name] = arr;\n }\n}", "title": "" }, { "docid": "ff8338fe95eb6051787ba31684b55ac9", "score": "0.46341702", "text": "function addShortCut (sBaseUrl, oParent, sTag) {\r\n oA = document.createElement('a');\r\n\t\t\toA.href=sBaseUrl+this.sIslandId;\r\n\t\t\toA.innerHTML = sTag;\r\n\t\t\toParent.appendChild(oA);\t\t\r\n}", "title": "" }, { "docid": "ff8338fe95eb6051787ba31684b55ac9", "score": "0.46341702", "text": "function addShortCut (sBaseUrl, oParent, sTag) {\r\n oA = document.createElement('a');\r\n\t\t\toA.href=sBaseUrl+this.sIslandId;\r\n\t\t\toA.innerHTML = sTag;\r\n\t\t\toParent.appendChild(oA);\t\t\r\n}", "title": "" }, { "docid": "b40f64966008d12bd6aa2a815ab1d3cf", "score": "0.4629628", "text": "function addToNav(id, name, navFragment) {\n let navItem = document.createElement(\"li\");\n let navItemLink = document.createElement(\"a\");\n navItemLink.innerHTML = name;\n navItemLink.setAttribute(\"class\", \"menu__link\");\n navItemLink.setAttribute(\"href\", \"./index.html#\".concat(id));\n navItemLink.setAttribute(\"data-section-id\", id);\n addClickEventListener(navItemLink);\n navItem.appendChild(navItemLink);\n navFragment.appendChild(navItem);\n}", "title": "" }, { "docid": "323927f735482fc1cdddff2a9fd978aa", "score": "0.46267423", "text": "function addEditIntro(name) {\n // Top link\n if (skin == 'oasis') {\n $('a[data-id=\"edit\"]').attr('href', $('a[data-id=\"edit\"]').attr('href') + '&editintro=' + name);\n $('span.editsection > a').each(function () {\n $(this).attr('href', $(this).attr('href') + '&editintro=' + name);\n });\n } else {\n var el = document.getElementById('ca-edit');\n \n if (typeof (el.href) == 'undefined') {\n el = el.getElementsByTagName('a')[0];\n }\n \n if (el) el.href += '&editintro=' + name;\n \n // Section links\n var spans = document.getElementsByTagName('span');\n for (var i = 0; i < spans.length; i++) {\n el = null;\n \n if (spans[i].className == 'editsection') {\n el = spans[i].getElementsByTagName('a')[0];\n if (el) el.href += '&editintro=' + name;\n } else if (spans[i].className == 'editsection-upper') {\n el = spans[i].getElementsByTagName('a')[0];\n if (el) el.href += '&editintro=' + name;\n }\n }\n }\n}", "title": "" }, { "docid": "2cdeaa31ae346e4f0364dcba8f69e2d6", "score": "0.46200794", "text": "function addPermalinkHeadings(opt_inDoc) {\n var doc = opt_inDoc || document;\n\n var permalinkEl = doc.querySelector('.show-permalinks');\n if (permalinkEl) {\n ['h2','h3','h4'].forEach(function(h, i) {\n [].forEach.call(permalinkEl.querySelectorAll(h), addPermalink);\n });\n }\n}", "title": "" }, { "docid": "a03da8b9368462e3f1977f4349b126d7", "score": "0.46077868", "text": "function addToCrawl(place) {\n //Check to see if it is already on the route\n for(var i = 0; i < crawlRoute.length; i++) {\n if(place.place_id == crawlRoute[i].place_id) {\n document.getElementById('markerAddButton').innerHTML = \"Already Added!\";\n return;\n }\n }\n \n //Add to the route variable\n crawlRoute.push(place);\n \n //Calculate the route\n calculateRoute(crawlRoute, false);\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.46069804", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.46069804", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.46069804", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.46069804", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.46069804", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "38db81cadfd8a1f146852269daf66c93", "score": "0.46069804", "text": "function appendBuiltContent( ancestorBranches, key, node ){\n \n nodeOf( head( ancestorBranches))[key] = node;\n }", "title": "" }, { "docid": "6e408af3706e1619a440fcf302677825", "score": "0.46052122", "text": "function insertSongItem(doc, request, songInfo) {\n // Construct filename/info\n var url = request.url;\n var filename = songInfo.artist + ' - ' + songInfo.title + '.mp3';\n\n // Add link to the list\n var a = doc.createElement('a');\n a.style.color = 'black';\n a.download = filename;\n a.href = url;\n\n a.innerText = songInfo.artist + ' - ' + songInfo.title;\n if (a.innerText == lastSongText) {\n return;\n }\n lastSongText = a.innerText;\n\n var br = doc.createElement('br');\n list.insertBefore(br, list.firstChild);\n list.insertBefore(a, list.firstChild);\n }", "title": "" }, { "docid": "2c75472629880fbaded74506a68287b8", "score": "0.45902762", "text": "function addPermalinks() {\n document.querySelectorAll(\"h2, h3, h4, h5, h6\")\n .forEach(applyPermalink);\n}", "title": "" }, { "docid": "578ce5fd5b53451bfdb2034aca12ebe4", "score": "0.4590224", "text": "function parse(options, document, callback) {\n xml2js.parseString(document, {\n trim: true,\n normalizeTags: true,\n normalize: true\n }, function(err, result) {\n if (!err) {\n\n // Process the url input, but break if base.input returns false.\n // In other words, _.find is looking for a non-falsy err.\n // For now, this can only happen if no outputDir is defined,\n // which is a fatal bad option problem and will happen immediately.\n _.find(\n // if the sitemap is malformed, just blow up\n result.urlset.url,\n function(urlNode) {\n // optionally ignore current urls by sitemap policy\n var url, process = !options.sitemapPolicy || !stillCurrent(urlNode, options);\n\n if (process) {\n // if sitemap is malformed, just blow up\n url = urlm.parse(urlNode.loc[0]);\n if (!base.input(_.extend({}, options, {\n protocol: url.protocol,\n auth: url.auth,\n hostname: url.hostname,\n port: url.port\n }),\n urlNode.loc[0])\n ) {\n err = \"error creating input for '\"+urlNode.loc[0]+\"'\";\n }\n }\n\n return err;\n }\n );\n }\n\n callback(err);\n });\n}", "title": "" }, { "docid": "3a6f63be64c503495a3f1e14b6967672", "score": "0.45853037", "text": "createNewSection ({sec_id, templateType}) {\n let newSection\n // LOCATIONS\n if (templateType === 'LOCATIONS') {\n newSection = {\n _id: objectId(),\n section_id: sec_id,\n section_title: 'NEW SECTION',\n number_of_images: 3,\n map_image_filename: '',\n ref_1_image_filename: '',\n ref_2_image_filename: '',\n raw_html_text: '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer quis aliquet sapien, vitae sollicitudin mi. In porta dapibus felis, eu lobortis diam vehicula id. Suspendisse luctus faucibus sapien sed mollis. Suspendisse consectetur, urna quis convallis gravida, nisl ligula vehicula eros, quis imperdiet eros massa vel arcu. Sed aliquam, urna vitae pretium sollicitudin, arcu ligula elementum tortor, at gravida lectus ipsum quis tortor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse venenatis dui tempor imperdiet imperdiet. Ut eu tristique turpis. Etiam at turpis in ipsum tristique vulputate. Nunc porttitor purus vitae sem porttitor, id rhoncus massa auctor. Curabitur at augue hendrerit, mattis lacus sed, auctor tellus. Sed scelerisque, ipsum at dictum pharetra, mauris eros molestie tortor, in imperdiet nibh ex vitae sem.</p>'\n }\n }\n // if the given template type doesn't match\n else {\n console.error('Could not create a new section because the given template type name is not valid.')\n }\n\n return newSection\n }", "title": "" }, { "docid": "317b34f6652ff4e5f99caebe72fa816d", "score": "0.4584901", "text": "function seo() {\n if( currentMod != jqueryMap.$seo )\n currentMod.hide();\n currentMod = jqueryMap.$seo;\n spa.seo.postSection();\n }", "title": "" }, { "docid": "0ed10235298e87b9d147a9c3a4fe43a6", "score": "0.4583164", "text": "appendIntoPart(e){e._insert(this.startNode=createMarker()),e._insert(this.endNode=createMarker())}", "title": "" }, { "docid": "eb67fb8376843afaf10380dcc548a457", "score": "0.45827192", "text": "function sectionRoutes (req, res, next) {\n let section = res.locals.navinfo && res.locals.navinfo.item.data\n , db = req.app.get('db')\n , doc = db.documents[req.params.docid]\n ;\n if (section) {\n res.locals.docid = req.params.docid;\n res.locals.sectionid = req.params.sectionid;\n res.locals.linkto = new DocumentLinks(doc);\n return res.render(section.template, section.locals);\n }\n next();\n}", "title": "" }, { "docid": "fead2c033317a126d6bdac04c66976af", "score": "0.45705408", "text": "function scrape(doc, url) {\n\tif (!ZU) ZU = Zotero.Utilities;\n\n\tvar namespace = doc.documentElement.namespaceURI;\n\tvar nsResolver = namespace ? function(prefix) {\n\t\tif (prefix == 'x') return namespace; else return null;\n\t} : null;\t\n\t\n\tvar newItem = new Zotero.Item(\"newspaperArticle\");\n\t\n\tvar date = doc.evaluate('//span[@class=\"ts-label_published\"]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();\n\tif(date) {\n\t\tnewItem.date = date.textContent.replace(/Published On/,'');\n\t}\n\t\n\tvar abstractNote = doc.evaluate('//meta[@property=\"og:description\"]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();\n\tif(abstractNote) newItem.abstractNote = abstractNote.content;\n\t\n\tvar authorNode = doc.evaluate('//div[@class=\"td-author\"]/span[@class=\"ts-label\"]', doc, nsResolver, XPathResult.ANY_TYPE, null);\n\tvar author;\n\twhile (author = authorNode.iterateNext()) {\n\t\tauthor = author.textContent;\n\t\tif (author.toUpperCase() == author) author = ZU.capitalizeTitle(author.toLowerCase(),true);\n\t\tnewItem.creators.push(ZU.cleanAuthor(author.replace(/^By\\s*/,'')));\n\t}\n\n\tvar xPathTitle = '//h1[@class=\"ts-article_header\"]';\n\tnewItem.title = doc.evaluate(xPathTitle, doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext().textContent;\t\n\n\t// The section is the first listed keyword\n\tvar keywords = doc.evaluate('//meta[@name=\"Keywords\"][@content]', doc, nsResolver, XPathResult.ANY_TYPE, null).iterateNext();\n\tif (keywords) newItem.section = keywords.content.split(',').shift();\n\n\tnewItem.attachments.push({document:doc, title:\"Toronto Star Snapshot\"});\n\n\tnewItem.url = doc.location.href;\n\tnewItem.publicationTitle = \"The Toronto Star\";\n\tnewItem.ISSN = \"0319-0781\";\n\n\tnewItem.complete();\n}", "title": "" }, { "docid": "863685aa2cea801470003fb3dfa494d7", "score": "0.45643857", "text": "function addContentToIndex() {\n for (var page in search_blob) {\n lunrIndex.add({\n url: page,\n title: search_blob[page].title,\n content: search_blob[page].content\n });\n }\n }", "title": "" }, { "docid": "b804b8afc5cbf508c64126d8e68316fa", "score": "0.45633608", "text": "function addMapping(jsonMapping, integrationNode, projectName, p, d) {\r\n var ul = document.createElement(\"ul\");\r\n $(integrationNode).append(ul);\r\n var li = document.createElement(\"li\");\r\n $(li).attr(\"id\", 'mapping_' + p + '_' + d)\r\n $(ul).append(li);\r\n\r\n var span = document.createElement(\"span\");\r\n $(span).addClass('mapping')\r\n .text('Mapping_' + d );\r\n $(li).append(span);\r\n\r\n var actions = document.createElement(\"div\");\r\n $(actions).addClass('actions');\r\n $(span).append(actions);\r\n addAction('edit', 'Edit', \"Edit mapping\", \"editMapping('\"+ jsonMapping +\"',\" + d + \")\", actions, projectName, true);\r\n}", "title": "" }, { "docid": "a7f11abb08e50d73837575fede6ac020", "score": "0.45570815", "text": "function add_item(name, url)\r\n{\r\n\tvar menu_link = document.createElement('a');\r\n\tmenu_link.innerHTML = name;\r\n\t// Replace {ID} with their ID in the URL\r\n\tmenu_link.href = url.replace('{ID}', unsafeWindow.MySpace.ClientContext.DisplayFriendId);\r\n\t\r\n\tvar menu_item = document.createElement('li');\r\n\tmenu_item.appendChild(menu_link);\r\n\t// Add it before the original first item\r\n\tsubmenu.insertBefore(menu_item, first_item);\r\n}", "title": "" }, { "docid": "23a92833762a118161fb099e6ebd3eee", "score": "0.45537418", "text": "addConfiguration(cfg) {\n this.content.configurations.push(cfg);\n }", "title": "" }, { "docid": "e9eaff39108a1e0630103855a76b1f41", "score": "0.45505562", "text": "function iterateThroughSectionsInMainAndCreateNav() {\n var fragment = document.createDocumentFragment();\n for (section of sectionList) {\n if(section.parentElement.tagName === 'MAIN') {\n // var itemToBeAdded = populateNav(section);\n let sectionName = section.getAttribute('data-nav');\n let listItem = document.createElement('li');\n let anchorItem = document.createElement('a');\n\n anchorItem.innerText = sectionName;\n anchorItem.classList.add('menu__link');\n anchorItem.setAttribute('href',`#${section.getAttribute('id')}`);\n\n listItem.appendChild(anchorItem);\n fragment.appendChild(listItem);\n } \n } \n navList.appendChild(fragment);\n}", "title": "" }, { "docid": "708fe2d40bb6808a6ae25ca36b052995", "score": "0.45432517", "text": "function create(){\n sections.forEach((Item)=>{\n //creating Links and setting them titles\n let newNavelementText= Item.getAttribute(\"data-nav\");\n let newNavelement= document.createElement(\"a\");\n let text=document.createTextNode(newNavelementText);\n \n //creating Li \n let newli=document.createElement(\"li\");\n newNavelement.appendChild(text);\n newli.appendChild(newNavelement);\n newNavelement.addEventListener(\"click\",(event)=>{\n Item.scrollIntoView({behavior:\"smooth\"});\n })\n documentFragment.appendChild(newli);\n }\n );\n \n ul_element.appendChild(documentFragment);\n\n\n}", "title": "" }, { "docid": "b15725c39d50f7baec13b13f5f66ab81", "score": "0.4543022", "text": "function addNewSection() {\n counter++;\n mainSection.insertAdjacentHTML(\n \"beforeend\",\n `<section id=\"section${counter}\" data-nav=\"section ${counter}\">\n <div class=\"landing__container\">\n <h2>Section ${counter}</h2>\n <p>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi\n fermentum metus faucibus lectus pharetra dapibus. Suspendisse\n potenti. Aenean aliquam elementum mi, ac euismod augue. Donec eget\n lacinia ex. Phasellus imperdiet porta orci eget mollis. Sed\n convallis sollicitudin mauris ac tincidunt. Donec bibendum, nulla\n eget bibendum consectetur, sem nisi aliquam leo, ut pulvinar quam\n nunc eu augue. Pellentesque maximus imperdiet elit a pharetra. Duis\n lectus mi, aliquam in mi quis, aliquam porttitor lacus. Morbi a\n tincidunt felis. Sed leo nunc, pharetra et elementum non, faucibus\n vitae elit. Integer nec libero venenatis libero ultricies molestie\n semper in tellus. Sed congue et odio sed euismod.\n </p>\n \n <p>\n Aliquam a convallis justo. Vivamus venenatis, erat eget pulvinar\n gravida, ipsum lacus aliquet velit, vel luctus diam ipsum a diam.\n Cras eu tincidunt arcu, vitae rhoncus purus. Vestibulum fermentum\n consectetur porttitor. Suspendisse imperdiet porttitor tortor, eget\n elementum tortor mollis non.\n </p>\n </div>\n </section>`\n );\n currentParagraph.textContent = `Number of sections currently: ${counter}`;\n sectionsNumber = document.querySelectorAll(\"section\");\n}", "title": "" }, { "docid": "8dbf48ccd0537c86c2daf1691a9ff9e8", "score": "0.45395592", "text": "appendIntoPart(part){part._insert(this.startNode=(0,_template.createMarker)());part._insert(this.endNode=(0,_template.createMarker)())}", "title": "" }, { "docid": "dd18b5e36e318582d2b78cab05d024a9", "score": "0.45394865", "text": "function mapAddRoute(route){\n let source = route.start;\n let target = route.destination;\n let label = undefined;\n let name = route.id;\n map.setEdge(source, target, label, name);\n map.setEdge(target, source, label, name);\n}", "title": "" }, { "docid": "c470541a10f847a6ef7260dd549dc1ae", "score": "0.4538534", "text": "function getCategorySitemapXml(req, res){\n\tlet sitemap = sm.createSitemap ({\n\t\thostname: 'https://' + req.headers.host,\n\t\tcacheTime: 600000,// 600 sec - cache purge period\n\t});\n\tgetCategoryOrCityArticleLinks(sitemap, req.params.slug, req.params.Id, req.params.pageIndex, 'category').then(function(){\n\t\tsitemap.toXML( function (err, xml) {\n\t\t\tif (err) {\n\t\t\t\treturn res.status(500).end();\n\t\t\t}\n\t\t\tres.header('Content-Type', 'application/xml');\n\t\t\tres.send( xml );\n\t\t});\n\t})\n}", "title": "" }, { "docid": "a104cd7b8e6a658e083a0c92e2b191ca", "score": "0.45340434", "text": "function addPage(page) {\n document.querySelector(\"#pages\").innerHTML += `\n <section id=\"${page.slug}\" class=\"page\">\n <header class=\"topbar\">\n<a href=\"/index.html\"><img class=\"logo\" src=\"${page.acf.logo}\"></a>\n\n </header>\n ${page.content.rendered}\n\n<div id=\"headerbox\">\n\n<img src=\"${page.acf.header_image}\">\n</div>\n\n<header>\n\n<h1>${page.acf.header_text}</h1>\n<h2>${page.acf.header_subtext}</h2>\n</header>\n\n<section id=\"front\">\n<h2>${page.acf.description_heading}</h2>\n<p>${page.acf.description_text}</p>\n</section>\n\n<div id=\"bestil-box\">\n<div id=\"bestil\">\n${page.acf.link}\n</div></div>\n\n<div id=\"udvalgte\">\n<h2>${page.acf.udvalgte}</h2>\n<img src=\"${page.acf.billede1}\">\n<img src=\"${page.acf.billede2}\">\n<img src=\"${page.acf.billede3}\">\n<img src=\"${page.acf.billede4}\">\n</div>\n\n<div class=\"row2\">\n\t<div class=\"column\">\n<h4>${page.acf.footer1}</h4>\n<p>${page.acf.footer1_content}</p>\n</div>\n<div class=\"column\">\n<h4>${page.acf.footer2}</h4>\n<p>${page.acf.footer2_content}</p>\n</div>\n<div class=\"column\">\n<h4>${page.acf.footer3}</h4>\n<p>${page.acf.footer3_content}</p>\n</div>\n</div>\n\n<div class=\"row\">\n<h4>${page.acf.menu_titel}</h4>\n<pre>${page.acf.ingredienser}</pre>\n<h5>${page.acf.pris}</h5>\n</div></section>\n\n `;\n}", "title": "" }, { "docid": "1d25871f833b749f8ccd12e98a477a92", "score": "0.4531814", "text": "function append_map(params) {\n \n }", "title": "" }, { "docid": "0935b9651da31d875bcc516ef9f72eea", "score": "0.45228258", "text": "function sendIndex(res) {\n res.setHeader('Content-Type', 'application/xml');\n res.write(`<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<sitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n`);\n for (let i = 1; i <= pages; i++) {\n res.write(`<sitemap>\n <loc>${origin}/sitemap/${i}</loc>\n</sitemap>`);\n }\n res.write(`</sitemapindex>`);\n res.end();\n}", "title": "" }, { "docid": "9338d69d4b65b82d6ec1cd0c63c880d7", "score": "0.4521195", "text": "function addPermaLinks(content) {\n var nl = content.querySelectorAll('section h3.signature'),\n a = document.createElement('a'),\n docPath = aDOMNext.pathname;\n\n a.className = 'permalink';\n a.textContent = 'permalink';\n\n for (var i = 0, el, aa, href; el = nl[i]; i++) {\n aa = a.cloneNode(true);\n href = el.parentElement.id;\n if ( /-class_method$/.test(href) )\n href = '.' + href.replace(/-class_method$/, '');\n else\n href = ':' + href.replace(/-[a-z_]+$/, '');\n href = href.replace(/\\?$/, '%3F');\n aa.setAttribute('href', docPath + href);\n// el.appendChild(aa);\n el.insertBefore(aa, el.firstChild);\n }\n}", "title": "" }, { "docid": "cc3e09f9ae292ead974ad4c1ef6afd46", "score": "0.451486", "text": "function newSidebarSection(idName, title, content) { //creates sidebar and returns element control\n var topSS = getFirstSidebarElement();\n if (!topSS) return;\n var sSec = document.createElement(\"section\");\n sSec.id = idName;\n sSec.className = idName + \" module\";\n sSec.innerHTML = '<h1 class=\"activity-heading\">' + title + '</h1>\\n' + (content.tagName ? \"\" : content);\n if (content.tagName) sSec.appendChild(content);\n topSS.parentNode.insertBefore(sSec, topSS);\n return document.getElementById(\"idName\");\n}", "title": "" }, { "docid": "8813784f266210e69ab3911b89f7880a", "score": "0.45078343", "text": "addPage(data) {\n this.pages.set(this.currentPage, { ids: data.map((entity) => entity[this.getStore().idKey]) });\n this.getStore().upsertMany(data);\n }", "title": "" }, { "docid": "1abc895042f715e0182b675138f7492e", "score": "0.450694", "text": "function insertAttachmentMappings(docInfo, seq, callback) {\n\t\n\t var attsAdded = 0;\n\t var attsToAdd = Object.keys(docInfo.data._attachments || {});\n\t\n\t if (!attsToAdd.length) {\n\t return callback();\n\t }\n\t\n\t function checkDone() {\n\t if (++attsAdded === attsToAdd.length) {\n\t callback();\n\t }\n\t }\n\t\n\t function add(att) {\n\t var digest = docInfo.data._attachments[att].digest;\n\t var req = attachAndSeqStore.put({\n\t seq: seq,\n\t digestSeq: digest + '::' + seq\n\t });\n\t\n\t req.onsuccess = checkDone;\n\t req.onerror = function (e) {\n\t // this callback is for a constaint error, which we ignore\n\t // because this docid/rev has already been associated with\n\t // the digest (e.g. when new_edits == false)\n\t e.preventDefault(); // avoid transaction abort\n\t e.stopPropagation(); // avoid transaction onerror\n\t checkDone();\n\t };\n\t }\n\t for (var i = 0; i < attsToAdd.length; i++) {\n\t add(attsToAdd[i]); // do in parallel\n\t }\n\t }", "title": "" }, { "docid": "af19bd9c18096cedbef4d87b2bda1df0", "score": "0.45054376", "text": "function insertHitsAndFixups(inContainer) {\n\n // Get the information we need to insert\n var theHits = getHits();\n var theFixups = getFixups();\n\n // If there is content, create it\n if ((theHits.length > 0) || (theFixups.length > 0)) {\n\n // Insert all errors, then warnings, then informational items\n for (var theErrorIndex = 0; theErrorIndex < theHits.length; theErrorIndex++) {\n var theError = theHits[theErrorIndex];\n if (theError.severity == \"error\") {\n insertHit(inContainer, \"img/hit_error.pdf\", theError.rule_name, theError.matches, theError.on_pages, \"error\");\n }\n }\n for (var theWarningIndex = 0; theWarningIndex < theHits.length; theWarningIndex++) {\n var theWarning = theHits[theWarningIndex];\n if (theWarning.severity == \"warning\") {\n insertHit(inContainer, \"img/hit_warning.pdf\", theWarning.rule_name, theWarning.matches, theWarning.on_pages, \"warning\");\n }\n }\n for (var theInfoIndex = 0; theInfoIndex < theHits.length; theInfoIndex++) {\n var theInfo = theHits[theInfoIndex];\n if (theInfo.severity == \"info\") {\n insertHit(inContainer, \"img/hit_info.pdf\", theInfo.rule_name, theInfo.matches, theInfo.on_pages, \"info\");\n }\n }\n\n // Insert all fixups\n for (var theFixupIndex = 0; theFixupIndex < theFixups.length; theFixupIndex++) {\n var theFixup = theFixups[theFixupIndex];\n insertFixup(inContainer, \"img/hit_fixup.pdf\", theFixup.fixup_name, theFixup.succeeded, theFixup.failed);\n }\n\n } else {\n\n // Nothing to do, hide this section\n $(inContainer).hide();\n }\n}", "title": "" }, { "docid": "e86a585ec1ed09740ac5b7ac1edbbb20", "score": "0.45022568", "text": "function newArticle(page1) {\n if (findLocation() === page1) {\n var newHeader = document.createElement('h1');\n var newHead = document.createTextNode('Water. Earth. Fire. Air.');\n newHeader.appendChild(newHead);\n\n var newPar = document.createElement('p');\n var newText = document.createTextNode('Long ago, the four nations lived together in harmony. Then, everything changed when the Fire Nation attacked. Only the Avatar, master of all four elements, could stop them, but when the world needed him most, he vanished. A hundred years passed and my brother and I discovered the new Avatar, an airbender named Aang, and although his airbending skills are great, he has a lot to learn before he\\'s ready to save anyone. But I believe Aang can save the world.');\n newPar.appendChild(newText);\n\n var newArticle = document.createElement('article');\n newArticle.appendChild(newHeader);\n newArticle.appendChild(newPar);\n\n var position = document.getElementsByClassName('col-md-12')[0];\n position.appendChild(newArticle);\n }\n}", "title": "" }, { "docid": "bc6c25cee4b581ad0704f297bff4f00b", "score": "0.4490803", "text": "function pageMap (cb) {\n iterate.each(globby.sync(opts.get('modules')), function (val, key, done) {\n page.set(readFile(val, true))\n done(null, key)\n }, function (err, res) {\n assert.ifError(err)\n config.set('_', page.get())\n cb(null, 'pageMap')\n })\n }", "title": "" }, { "docid": "42471aec9e91138382a49668b73cb713", "score": "0.44898495", "text": "activateRoute(route) {\n let content = this.titleBar.element.find('.page-content');\n content.empty();\n// get the route passed in to activateRoute, find it in the routeMap key:value\n// store, and append it to the dom at .page-content. Our mdl template code\n// has a page-content class on it, so that is what we are targeting.\n this.routeMap[route].appendToElement(content);\n}", "title": "" }, { "docid": "c3a6482e00e6bbb36ea00620c55f147f", "score": "0.448962", "text": "function Section(ToC, categoryIndex, docIndex, s) {\n let anchor = ToC[categoryIndex].docs[docIndex].sections[s].anchor\n let name = ToC[categoryIndex].docs[docIndex].sections[s].name\n return `\n <li class=\"pb-1 lh0\">\n <a\n class=\"fw-book c-p20 c-h0 c-a0 section-link\"\n href=\"${anchor}\"\n id=\"nav-section\"\n >\n ${name}\n </a>\n </li>\n `\n }", "title": "" }, { "docid": "1289f8cd63f97be8b98e2ea40f12802a", "score": "0.4483764", "text": "add() {\n return this.section.add();\n }", "title": "" }, { "docid": "b1a4385d14d7e277d8924946bf404600", "score": "0.44755813", "text": "function createNavBarItem() {\n document.querySelectorAll(\"section\").forEach(function (item) {\n let sectionTitle = item.getAttribute('data-nav');\n let sectionId = item.getAttribute('id');\n let tag = `<li><a href=#${sectionId} data-nav=\"${sectionId}\"class=\"menu__link\"> ${sectionTitle}</a></li>`\n document.getElementById(\"navbar__list\").insertAdjacentHTML('beforeend', tag);\n });\n}", "title": "" }, { "docid": "891f0865d16643f4a129b3eb6c556c05", "score": "0.44713405", "text": "function addBookmark() {\n let bmsvc = Cc[\"@mozilla.org/browser/nav-bookmarks-service;1\"]\n .getService(Ci.nsINavBookmarksService);\n let ios = Cc[\"@mozilla.org/network/io-service;1\"]\n .getService(Ci.nsIIOService);\n let bid = bmsvc.insertBookmark(bmsvc.unfiledBookmarksFolder, \n ios.newURI(self.data.url(\"dashboard.html?s=%s\"), null, null),\n bmsvc.DEFAULT_INDEX,\n \"RecallMonkey Search\"\n );\n bmsvc.setKeywordForBookmark(bid, \"r\");\n ss.storage.bookmarkId = bid;\n}", "title": "" }, { "docid": "4cdd171034353fdb7f010b9ae0482350", "score": "0.44635022", "text": "_registerDoc(id, collectionAlias, collectionName, registryContext) {\n let currRegistry;\n // registry already exists\n if (currRegistry = this.docRegistry[collectionName][id]) {\n // check if context is already present\n if(!currRegistry.contexts.includes(registryContext)) {\n // set yet another context to keep up to date\n currRegistry.contexts.push(registryContext)\n }\n }\n else {\n this.docRegistry[collectionName][id] = {collectionAlias: collectionAlias, collectionName: collectionName, contexts: [registryContext]};\n }\n }", "title": "" }, { "docid": "8978e9faee5d2ec9da26f346db2001fe", "score": "0.4458567", "text": "function addLayoutToRoute( route, parentLayout = \"default\" )\n{\n route.meta = route.meta || {} ;\n route.meta.layout = route.layout || parentLayout ;\n\n if( route.children )\n {\n route.children = route.children.map( ( childRoute ) => addLayoutToRoute( childRoute, route.meta.layout ) ) ;\n }\n return route ;\n}", "title": "" }, { "docid": "ff3b41e07037a9416108666a2b0745cd", "score": "0.44565505", "text": "function AddSource (map, source){\n\tmap.addSource(source.name, {\n 'type': source.type,\n 'url': source.url\n\t});\n}", "title": "" }, { "docid": "13bcb4e73fb722e321591b25604326a4", "score": "0.44556487", "text": "function getMagazineSitemapXml(req, res){\n\tlet sitemap = sm.createSitemap ({\n\t\thostname: 'https://' + req.headers.host,\n\t\tcacheTime: 600000,// 600 sec - cache purge period\n\t});\n\tgetMagazineArticleLinks(sitemap, req.params.slug, req.params.pageIndex).then(function(){\n\t\tsitemap.toXML( function (err, xml) {\n\t\t\tif (err) {\n\t\t\t\treturn res.status(500).end();\n\t\t\t}\n\t\t\tres.header('Content-Type', 'application/xml');\n\t\t\tres.send( xml );\n\t\t});\n\t})\n}", "title": "" }, { "docid": "5dc6718f6828128929a9436fcfa001d1", "score": "0.4450047", "text": "function addSection() {\n lastId++;\n let sectionHtml = ` <section id=\"section${lastId}\" data-nav=\"Section ${lastId}\">\n<div class=\"landing__container\">\n <h2>Section ${lastId}</h2>\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fermentum metus faucibus lectus pharetra dapibus. Suspendisse potenti. Aenean aliquam elementum mi, ac euismod augue. Donec eget lacinia ex. Phasellus imperdiet porta orci\n eget mollis. Sed convallis sollicitudin mauris ac tincidunt. Donec bibendum, nulla eget bibendum consectetur, sem nisi aliquam leo, ut pulvinar quam nunc eu augue. Pellentesque maximus imperdiet elit a pharetra. Duis lectus mi, aliquam\n in mi quis, aliquam porttitor lacus. Morbi a tincidunt felis. Sed leo nunc, pharetra et elementum non, faucibus vitae elit. Integer nec libero venenatis libero ultricies molestie semper in tellus. Sed congue et odio sed euismod.</p>\n\n <p>Aliquam a convallis justo. Vivamus venenatis, erat eget pulvinar gravida, ipsum lacus aliquet velit, vel luctus diam ipsum a diam. Cras eu tincidunt arcu, vitae rhoncus purus. Vestibulum fermentum consectetur porttitor. Suspendisse imperdiet\n porttitor tortor, eget elementum tortor mollis non.</p>\n</div>\n</section>`\n\n document.getElementById('main').insertAdjacentHTML('beforeend', sectionHtml);\n addSectionMenu();\n onTheMove();\n}", "title": "" } ]
8746b413abb97d598921644eff7621f1
checks for fam member with missing category
[ { "docid": "33e0415a96f4997c46cce8405c2e1525", "score": "0.68712455", "text": "function checkMissingCat(famObj){\n let missingCat = false;\n for (let key in famObj){\n if(famObj[key][\"ABCDE\"]==\"None\"){\n missingCat = true;\n }\n }\n return missingCat;\n}", "title": "" } ]
[ { "docid": "6c9ddff6c07bc75f5668f96f91bb141c", "score": "0.5977287", "text": "function ifCatEmpty() {\n var empty = false;\n for(var i = 0; i < zadania.length; i++){\n if(zadania[i] && zadania[i].category && zadania[i].category == cat){\n empty = true;\n }\n }\n if(!empty){\n cat = undefined;\n }\n }", "title": "" }, { "docid": "f43c1107dd77715e0595240207c760b9", "score": "0.5645131", "text": "isValidMember(member) {\r\n return this.getInvalidFieldsForMember(member).length === 0;\r\n }", "title": "" }, { "docid": "a45cd6b4a4165b33863c12b439adfb74", "score": "0.54349244", "text": "containsData(...category)\n {\n if(category)\n {\n let accessor = this.data;\n\n for(let i = 0; i < category.length; i++)\n {\n accessor = accessor[category[i]];\n if(!accessor)\n return false;\n }\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "5d5e6c5f5ace26fd3d99ac8d7aac647b", "score": "0.538796", "text": "function validCat(parent) {\n var cat = parent.find('select.catInp').val();\n if (!cat) {\n parent.find('div.cat.warn').css('display', 'block');\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "9cb2771dbe6c27ae9a7c50c334dab770", "score": "0.538609", "text": "function general(feature){\n for(var j = 0; j < hospitalnames.length; j++){\n \n\n if (feature.properties.category==\"General Hospital\"){return true;}\n }\n return false; \n}", "title": "" }, { "docid": "71fd234e936758cbf2f01f9cf9123c34", "score": "0.5367662", "text": "function isCategoryUsed(cat_ID, feat_ID) {\n\tvar white_list_index = jQuery.inArray(cat_ID, white_list_main);\n\tvar i = white_list_index +1;\n\tfor (var i = white_list_index; white_list_main[i] < 1000; i++) {\n\t\tif (jQuery.inArray(white_list_main[i], white_list) !== -1 && white_list_main[i] !== feat_ID) {\n\t\t\treturn false;\n\t\t};\n\t};\n\treturn true;\n}", "title": "" }, { "docid": "4204b46b67d81ef88097c0e6de28bf5f", "score": "0.5333639", "text": "function validCatAdd(cat, type, parent) {\n if (cat.length === 0) {\n parent.find('div#' + type + 'AddWarn1').css('display', 'block');\n return false;\n }\n groupData = catData;\n if (type === 'col') {\n groupData = colData;\n }\n for (group in groupData) {\n if (groupData[group]['name'] === cat) {\n parent.find('div#' + type + 'AddWarn2').css('display', 'block');\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "689a74a5707f97f12def15443680eed6", "score": "0.53120685", "text": "function out_sample(feature){\n for(var j = 0; j < hospitalnames.length; j++){\n if (feature.properties.name==hospitalnames[j][\"Name\"] ){return false;}\n\n else if (feature.properties.category==\"Unknown\" || feature.properties.category==\"Teaching Hospital\" || feature.properties.category==\"General Hospital\" || feature.properties.category==\"Private Clinic\" || feature.properties.category==\"Federal Hospital\" || feature.properties.category==\"Federal Staff Clinic\" || feature.properties.category==\"Military and Paramilitary Clinic\"){return false;}\n }\n return true; \n}", "title": "" }, { "docid": "08049277402a82c0c9e1b9870da243ce", "score": "0.52528167", "text": "function CategoryNameNotExist(name, array) {\n exist = true\n for (let i = 0; i < array.length; i++) {\n\n if (name == array[i].name) {\n exist = false;\n break;\n\n }\n }\n return exist;\n}", "title": "" }, { "docid": "00f5a8ff6f5916a884690d8b28f9f424", "score": "0.51907974", "text": "function teaching(feature){\n for(var j = 0; j < hospitalnames.length; j++){\n \n\n if (feature.properties.category==\"Teaching Hospital\"){return true;}\n }\n return false; \n}", "title": "" }, { "docid": "03855a8736dc434464ab1039b6b3ba8e", "score": "0.51679987", "text": "membership(member) {\n var membership = $('#input-membership-type').val();\n if ( membership == \"\") {\n $('#error10').show();\n return false;\n }\n \n else {\n $('#error10').hide();\n return true;\n }\n }", "title": "" }, { "docid": "42beadd1c49ff8f62d4f8894cea73621", "score": "0.51097786", "text": "function missingCaseType(){\n return !Boolean($scope.caze.caseTypesKeys.length);\n }", "title": "" }, { "docid": "803df42e811fbafe64595f1e196dc378", "score": "0.5062796", "text": "function validateGender(gender){ \n if(gender != \"none\") \n return true;\n else\n return false;\n }", "title": "" }, { "docid": "9fe8de6cc32858fd0a0f71088169d099", "score": "0.5057957", "text": "filterOnCategory(dataset) {\n\t\tlet fc = this.focused.category;\n\t\treturn (fc != \"NA\" && !this.isNullOrZero(fc)) ? \n\t\t\tdataset.filter(x => (x.category != null) ? x.category.includes(fc) : false) : dataset;\n\t}", "title": "" }, { "docid": "52a3df48839e8acef106002755bb303c", "score": "0.50555295", "text": "function removeBadColumns(group){\n\tlet hasHawaii= false;\n\tlet hasPortland= false;\n\t\n\tfor(member of group.members){\n\t\tif(member.reception){\n\t\t\thasHawaii= true;\n\t\t}\n\t\tif(member.ceremony){\n\t\t\thasPortland= true;\n\t\t}\n\t}\n\t\n\tif(!hasHawaii){\n\t\tdocument.getElementById('hawaii_header').style.display= 'none';\n\t}\n}", "title": "" }, { "docid": "63f0244e1cbdbaef7d8479c090383e6b", "score": "0.5041304", "text": "function categoryExists(categoryName) {\n var category = document.getElementById(categoryName);\n if (category) {\n alert(\"A category with that name already exists!\");\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "12a0f068b6ce25952605cbae04150e8f", "score": "0.50235736", "text": "noValidOptions() {\n let studArray = this.state.StudentsArray;\n return (studArray.length === 1 &&\n (studArray[0].first_name === 'No Students Here' || studArray[0].first_name === 'Loading...' ));\n }", "title": "" }, { "docid": "1f95c8afce84a038636b764fa49d04d5", "score": "0.50227404", "text": "function getUnusedFemaleName() {\n var ntry = 0;\n var str = \"\";\n var nok;\n var usedNames = [...player.women];\n if(player!==leader){\n \tusedNames = usedNames.concat(leader.women);\n \tusedNames.push(player);\n }\n while (ntry < 5) { // try 5 times\n\t\tnok = true;\n str = randomFemaleName();\n\t\tfor (var i = 0; i < usedNames.length; i += 1 ) {\n if (usedNames[i].name == str) {\n\t\t\t\tnok = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n if (nok === true) break;\n ntry += 1;\n }\n return str;\n}", "title": "" }, { "docid": "45af8bbdae13d094a810568464674c7f", "score": "0.5011659", "text": "hasMember( name ) {\n for( let member of this.members ){\n if( member.name === name ){\n return true\n }\n }\n return false\n }", "title": "" }, { "docid": "79cd7dbb3cff98faae9a56369e8355a4", "score": "0.5006743", "text": "function addInMissingFacilityFields(facilityList) {\n\tif (!_.isEmpty(facilityList)) {\n\t\t_.each(facilityList, function(facility){\n\t\t\t// EHMP code had this - but - it was not what was actually storing\n\t\t\t// facility.summary = recEnrichXformerUtil.getSummary('PatientFacility', facility);\n\t\t\tif (_.isString(facility.name)) {\n\t\t\t\tfacility.summary = facility.name;\n\t\t\t} else {\n\t\t\t\tfacility.summary = undefined;\n\t\t\t}\n\n\t\t\t// homeSite\n\t\t\t//---------\n\t\t\tif ((facility.homeSite === null) || (facility.homeSite === undefined)) {\n\t\t\t\tfacility.homeSite = false;\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "c700766be7845b71933eff2eec25d60f", "score": "0.49796808", "text": "function filterMembersShown(membersToDisplay) {\n // Loop through all members and decide if they will be shown or not.\n for (var i=0; i < allMembers.length; i++) {\n var show = false;\n if (filterValue == \"all\" && filterIndex == 0) {\n show = true;\n } else if (membersToDisplay[allMembers[i]]) {\n show = true;\n }\n\n showElement(\"member_\" + allMembers[i], show);\n }\n}", "title": "" }, { "docid": "f2f547c8d373f244e458e8e136e5227b", "score": "0.49732843", "text": "function checkUserNameValidity(memberNew, data) {\n groupingsService.checkMember(memberNew.name, data, function (attributes) {\n data.push(new Member(memberNew.name,\n (memberNew.status === \"\") ? \"Valid\" : memberNew.status,\n (memberNew.status === $scope.listName) ? \"No\" : \" Yes\",\n attributes.uhUuid, attributes.uid));\n\n $scope.VALID_UNAME_COUNT += (memberNew.status !== $scope.listName);\n\n }, function (res) {\n if (res.statusCode === undefined || res.statusCode === 404)\n data.push(new Member(memberNew.name, \"Invalid\", \"No\", \"\", \"\"));\n });\n\n }", "title": "" }, { "docid": "f57e3c03f21cb41e4d8744b45576bec6", "score": "0.49595022", "text": "function checkFamous(event) {\n var comment = $(event.target);\n if(!comment.hasClass(\"comment\"))\n return false;\n comment = comment.find(\"> .caption > .usertext > .author\");\n var username = comment.children().first().attr('href');\n if(!username)\n return;\n username = username.substr(username.lastIndexOf('/')+1);\n if(options['famous-imgurians']) {\n\tfor(var i = 0; i < staffFamousData['famousImgurians'].length; i++) {\n\t if(staffFamousData['famousImgurians'][i].username == username) {\n\t\tif(comment.children(':nth-child(2)').text() == \"OP\")\n\t\t var appendie = comment.children(':nth-child(2)');\n\t\telse\n\t\t var appendie = comment.children().first();\n\t\tappendie.after(\" <span class='green'>Known for</span> \"+staffFamousData['famousImgurians'][i].famousFor + \" :\");\n\t\tbreak;\n }\n\t}\n }\n if(options['staff-highlight']) {\n\tfor(var i = 0; i < staffFamousData['staffMembers'].length; i++) {\n\t if(staffFamousData['staffMembers'][i] == username) {\n\t\tif(comment.children(':nth-child(2)').text() == \"OP\")\n\t\t var appendie = comment.children(':nth-child(2)');\n\t\telse\n\t\t var appendie = comment.children().first();\n\t\tappendie.after(\" <span class='green'>Staff</span>\");\n\t\tbreak;\n }\n\t}\n }\n\n}", "title": "" }, { "docid": "69a38c42f8d538046f9b4b348d98fba1", "score": "0.4937974", "text": "function validateCategory(category){\r\n\t\r\n\tif(category==\"\"){\r\n\t\toppSkillsStatus=false;\r\n\t\t$(\"#categoryWarn\").html(\"Please enter category\");\r\n\t}else if(category!=\"\" && category.length>=45){\r\n\t\toppSkillsStatus=false;\r\n\t\t$(\"#categoryWarn\").html(\"Should have less than 45 characters\");\r\n\t}else{\r\n\t\t$(\"#categoryWarn\").html(\"\");\r\n\t}\r\n}", "title": "" }, { "docid": "588c25642ff601f9c7b5e25a144a15ea", "score": "0.49302942", "text": "function validateCatagory(catagory){\n\n if(catagory != \"--Select Category--\"){\n return true;\n }else{\n return false;\n }\n \n }", "title": "" }, { "docid": "bef80c201941dff3780fa45721d32b68", "score": "0.49275345", "text": "function passesNominal(data, prop)\n{\n if (currentFilter[prop].values.length == 0)\n return true;\n\n if (!data[prop]) return passWithoutInfo;\n var vals = currentFilter[prop].values;\n \n if (filterVariables[filterMap[prop]].multiple) {\n for (var i = 0; i < data[prop].length; i++) {\n if (vals.indexOf(data[prop][i]) != -1) return true;\n }\n return false;\n } else {\n if (vals.indexOf(data[prop]) != -1) return true;\n else return false;\n }\n}", "title": "" }, { "docid": "80d119ef61b251f587408865c94866ab", "score": "0.49136758", "text": "function neitherPerson() {\n $.each($('.item'), function() {\n if($(this).children('.noAchievementDetail').size() !== 2) {\n $(this).addClass('radio-level-hide');\n } else {\n $(this).removeClass('radio-level-hide');\n }\n });\n}", "title": "" }, { "docid": "cff86e44af4b4881c2621f8c79b53c65", "score": "0.4910695", "text": "function fn_chkFacility()\n{\n\tif (nGCV('ChkAdmMedFacility', 3))\n\t{\n\t\tnEnable('cddAdmMedFacility',8);\n\t}\n\telse\n\t{\n\t nSCV('cddAdmMedFacility', '', 8);\n\t\tnDisable('cddAdmMedFacility',8);\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "e511b6cb911a930f0ee4c65a031cba64", "score": "0.49033806", "text": "detectType(type) {\n if ( type == '' ) {\n vm.errorMessage( '#typeOfMembership', 'Membership_type_must_be_F, S, T or B' );\n }\n else {\n vm.addTrue();\n }\n }", "title": "" }, { "docid": "f483c9ccb51b29b47b3b2700d230771e", "score": "0.48948184", "text": "function checkMembersOnly() {\n\t\n\t// Members Only Sticker and Link Sample Source\n\t// <div class=\"memberOnlyContainer\">\n\t// <div class=\"member_only_sticker\">\n\t// <img src=\"//cdn.ghstatic.com/gamehouse/images/members_only.png?20160229.131.2\"></div>\n\t// <div class=\"member_only_info\">This is a member-only game. <a href=\"/memberships/funpass/freetrial\" style=\"color:#fff;\">Subscribe to FunPass</a> to become a member and get to enjoy all our games.</div>\n\t// <div style=\"display: none;\" class=\"member_only_tooltip\">This title will be released for everyone in two weeks or less! Sign up for FunPass to play it today! <a href=\"/memberships/funpass/freetrial\">Click here</a> to learn more.</div></div>\n\t\n}", "title": "" }, { "docid": "c68e8f77d1b33b7e274c7705018dd4ea", "score": "0.4888449", "text": "function categorizeMemberships(memberInfo) {\n return memberInfo.map(([age, handicap]) => (age => 55 && handicap > 7) ? \"Senior\" : \"Open\");\n}", "title": "" }, { "docid": "4d3d5a17149e5a56918c4a2d18c8ddef", "score": "0.48845115", "text": "function checkCategories() {\n const fixtureChannels = fixture.availableChannels.concat(fixture.matrixChannels.map(matrixCh => matrixCh.wrappedChannel));\n\n const hasMultiColorChannel = fixtureChannels.some(channel => channel.type === `Multi-Color`);\n const hasMultipleSingleColorChannels = fixtureChannels.filter(channel => channel.type === `Single Color`).length > 1;\n const hasColorChangerCategory = fixture.categories.includes(`Color Changer`);\n if (!hasColorChangerCategory && hasMultiColorChannel) {\n result.warnings.push(`Category 'Color Changer' suggested since there is a 'Multi-Color' channel.`);\n }\n else if (!hasColorChangerCategory && hasMultipleSingleColorChannels) {\n result.warnings.push(`Category 'Color Changer' suggested since there are multiple 'Single Color' channels.`);\n }\n else if (hasColorChangerCategory && !hasMultiColorChannel && !hasMultipleSingleColorChannels) {\n result.warnings.push(`Category 'Color Changer' invalid since there is no 'Multi-Color' and less than 2 'Single Color' channels.`);\n }\n\n const hasFocusTypeHead = fixture.physical !== null && fixture.physical.focusType === `Head`;\n const hasMovingHeadCategory = fixture.categories.includes(`Moving Head`);\n if (!hasMovingHeadCategory && hasFocusTypeHead) {\n result.warnings.push(`Category 'Moving Head' suggested since focus.type is 'Head'.`);\n }\n else if (hasMovingHeadCategory && !hasFocusTypeHead) {\n result.warnings.push(`Category 'Moving Head' invalid since focus.type is not 'Head'.`);\n }\n\n const hasFogChannel = fixtureChannels.some(channel => channel.type === `Fog`);\n const hasSmokeCategory = fixture.categories.includes(`Smoke`);\n const hasHazerCategory = fixture.categories.includes(`Hazer`);\n if (!(hasSmokeCategory || hasHazerCategory) && hasFogChannel) {\n result.warnings.push(`Categories 'Smoke' and/or 'Hazer' suggested since there is a 'Fog' channel.`);\n }\n else if (hasSmokeCategory && !hasFogChannel) {\n result.warnings.push(`Category 'Smoke' invalid since there is no 'Fog' channel.`);\n }\n else if (hasHazerCategory && !hasFogChannel) {\n result.warnings.push(`Category 'Hazer' invalid since there is no 'Fog' channel.`);\n }\n}", "title": "" }, { "docid": "834b39a8e4c209cd509252e6547e182c", "score": "0.48648643", "text": "function validateName (category) {\n res = false;\n var error;\n\n if (category.name === '') {\n error = \"Name is empty\";\n category.errors.push(error);\n }\n if (category.name === undefined) {\n error = \"Name is undefined\";\n category.errors.push(error);\n }\n if (category.errors.length === 0) {\n res = true;\n }\n\n return res;\n}", "title": "" }, { "docid": "638d3bae920cf66c242e2e2f54b50ace", "score": "0.48626322", "text": "function nonspecial(item) {\n // For filtering out non-relevant MFL properties\n return (['geometry', 'onMFL'].indexOf(item) < 0);\n }", "title": "" }, { "docid": "f5835af8f9e0bb21157232800804fe88", "score": "0.48578796", "text": "function isValid (category) {\n var res = true;\n if (!validateName(category)){\n res = false;\n }\n return res;\n}", "title": "" }, { "docid": "3ee1c2ba3ef4e39c63124f2d7e30b6c6", "score": "0.48432127", "text": "function checkIFCategoryalreadyExists( katName )\n{\n for ( i = 0; i < Categories_Name_Array.length; i++ )\n {\n if ( Categories_Name_Array[i] === katName )\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "47413a1fcd10831d6ee2b7acaf407955", "score": "0.48387182", "text": "function validate_cat(){\r\n var flag = false;\r\n if (document.getElementById(\"cat\").value==\"0\") {\r\n swal(\"Empty Field!\", \"You Need to Select the Category!\", \"warning\");\r\n }\r\n else if (document.getElementById(\"sub_catergory\").value==\"\") {\r\n swal(\"Empty Field!\", \"You Need to enter the New Sub category!\", \"warning\");\r\n }\r\n else\r\n {\r\n flag = true;\r\n }\r\n return flag;\r\n }", "title": "" }, { "docid": "69f756132a8327c0773c4ef34cf8c8dc", "score": "0.48369175", "text": "function is_meta(category_str){\r\n return !CATEGORY_ICONS[slug(category_str)];\r\n}", "title": "" }, { "docid": "60f09e97e547d813c7c0268c2a93a7d8", "score": "0.48298007", "text": "function checkAcc(memberObj){\n if(getShopUser(memberObj) != null){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "812a2e5ede2fdb13ccd88560da43388d", "score": "0.48208085", "text": "function isValidFilm(film) {\n if (film.title != undefined) {\n if (film.runTime != undefined) {\n if (film.release != undefined) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "62b1c79a4f22ca7a2578ef56fa676101", "score": "0.48164028", "text": "function isInherited(member) { return inherit[member]; }", "title": "" }, { "docid": "4c3af344579653ed0c199b57b8c7a09e", "score": "0.48135415", "text": "checkDept(thing) {\n var wanted = directory[thing].dept;\n return wanted.includes(this.props.dept) || wanted.includes('any');\n }", "title": "" }, { "docid": "f73ba60cee4953fda0528b283aaa4ded", "score": "0.48047936", "text": "function relation_singleton(rel) {\n return false; // ((rel.groups.length === 0) /*&&*/ );\n }", "title": "" }, { "docid": "1a950d5808654b0029f32cfc03178dd7", "score": "0.4798599", "text": "function isItem(entry) {\n return entry.itemCategoryHashes !== undefined;\n}", "title": "" }, { "docid": "0ca934931bd0f5531957ca6719671de5", "score": "0.4795001", "text": "reportGroupStatus() {\n let members = this.props.cardData.members;\n let creator = this.props.cardData.creator;\n if (creator.userID === this.props.user.id) {\n return LEADER\n } else if (members.includes(this.props.user.id)){\n return MEMBER\n } else {\n return NOT_JOINED;\n }\n }", "title": "" }, { "docid": "e22bef2ca3a9b83a07feb79466e3c1f2", "score": "0.47894642", "text": "function checkCategoryExistsByNameNType(callback) {\n Category.checkCategoryExistsByNameNType(req.body.name, req.body.type, function(err, results) {\n if (err) {\n callback(err);\n } else if (results.length) {\n return res.status(Boom.ALREADY_EXIST.statusCode).json(Boom.ALREADY_EXIST);\n } else {\n callback(null);\n }\n });\n }", "title": "" }, { "docid": "aa488c6345af6750f3bbe51976dfbf58", "score": "0.47733516", "text": "function hasUsefulData(mf) {\n if (!mf) {\n return false;\n }\n let hasUsefulHObjects = false;\n let hasUsefulRels = false;\n\n const hObjects = getValueOr(mf, 'items');\n if (hObjects) {\n for (let i = 0; i < hObjects.length; i++) {\n const item = hObjects[i];\n const type = getValueOr(item, 'type');\n if (type) {\n if (type.indexOf('h-card') >= 0 || type.indexOf('h-entry') >= 0) {\n hasUsefulHObjects = true;\n break;\n }\n }\n }\n }\n\n let rels = mf['rels'];\n if (rels) {\n if (getValueOr(rels, 'pgpkey')) {\n console.log('has pgpkey');\n hasUsefulRels = true;\n }\n if (getValueOr(rels, 'me')) {\n console.log('has relme');\n hasUsefulRels = true;\n }\n if (getValueOr(rels, 'friend')) {\n console.log('has xfn friend');\n hasUsefulRels = true;\n }\n }\n\n return hasUsefulHObjects || hasUsefulRels;\n}", "title": "" }, { "docid": "5a5b9dc13d7c521ae7190a100e6f83d9", "score": "0.47631317", "text": "function __mCheckAffiliate()\n{\n var affCk = GetCkVal(\"affID\");\n if(affCk != null && affCk.length > 0 && affCk != \"undefined\")\n affiliateId = affCk;\n else\n affiliateId = \"-1\";\n}", "title": "" }, { "docid": "5591b3ad13b8c9daf975782d20eac395", "score": "0.47605014", "text": "function check_not_forbbiden($this) {\n if (!is_deleted($this) && reserved_types.indexOf($this.val()) !== -1) {\n $this.addClass('forbidden_name');\n add_error_message($this, \"err_forbidden\");\n } else {\n $this.removeClass('forbidden_name');\n remove_error_message($this, \"err_forbidden\");\n }\n }", "title": "" }, { "docid": "6828d620c37a9ee1f40a509db5a9e132", "score": "0.47510228", "text": "getBMICategory(member) {\n const bmi = this.calculateBMI(member);\n if (bmi < 15) {\n return 'VERY SEVERELY UNDERWEIGHT';\n } else if (bmi >= 15 && bmi < 16) {\n return 'SEVERELY UNDERWEIGHT';\n } else if (bmi >= 16 && bmi < 18.5) {\n return 'UNDERWEIGHT';\n } else if (bmi >= 18.5 && bmi < 25) {\n return 'NORMAL';\n } else if (bmi >= 25 && bmi < 30) {\n return 'OVERWEIGHT';\n } else if (bmi >= 30 && bmi < 35) {\n return 'MODERATELY OBESE';\n } else if (bmi >= 35 && bmi < 40) {\n return 'SEVERELY OBESE';\n } else if (bmi >= 40) {\n return 'VERY SEVERELY OBESE';\n }\n\n return 'Error in BMI Calculation';\n }", "title": "" }, { "docid": "f5f4a54f017fcc2639b44ae743683c9c", "score": "0.4750925", "text": "sex(member) {\n var sex = $('#sex').val();\n if ( sex == \"\") {\n $('#error12').show();\n return false;\n }\n \n else {\n $('#error12').hide();\n return true;\n }\n }", "title": "" }, { "docid": "e2a3056e990d64ca448366411cefa6f3", "score": "0.47320992", "text": "function nameOkay(name) {\n return !userlist.hasOwnProperty(name);\n}", "title": "" }, { "docid": "c5612935db51964ec8ed2da18e1d10aa", "score": "0.47159016", "text": "function needToPromptForUsageData(groupName) {\n return !groupNameExists(groupName);\n}", "title": "" }, { "docid": "af69185c9b2ea8d239e7ea2228278c07", "score": "0.47091767", "text": "isAssignedMed(medication) {\r\n return this.assignedMeds.some(function(m) {\r\n return m.id === medication.id \r\n })\r\n }", "title": "" }, { "docid": "d3ca64d861da586902f97e18a2291cb8", "score": "0.46909058", "text": "function nothing_to_scrape(){\n\treturn categories.length==0 &&\n\t\t searchViews.length==0 &&\n\t\t productPages.length==0;\n}", "title": "" }, { "docid": "1b1de330e17ef435c315714d759310af", "score": "0.46874905", "text": "function noNutsNoMushrooms(input) {\n var nutsFree = input.filter(function (pizza) {\n return pizza.containsNuts === false;\n });\n nutsFree.forEach(function (pizza) {\n if (!_(pizza.ingredients).any(hasMushrooms)) { productsICanEat.push(pizza); }\n })\n }", "title": "" }, { "docid": "a9107e908b593c02f89f55c38c90d25d", "score": "0.46872494", "text": "function properF(cat1){\n if (cat1==\"All Categories\") {\n return \"All\";\n }else if (cat1==\"Flooding\") {\n return \"flooding\";\n }else if (cat1==\"Road Repairs\") {\n return \"road_repair\";\n }else if (cat1==\"Garbage Collection\") {\n return \"garbage_collection\";\n }\n}", "title": "" }, { "docid": "3dd37ba835130ecb31521b56d0c62007", "score": "0.4686549", "text": "exists(name) {\n return this.names[name] !== undefined\n }", "title": "" }, { "docid": "b065be6cc97996d502a28c333862cb2c", "score": "0.4673859", "text": "filterByAssingned(owner) {\n //check su ogni esame\n let arrayOfExam = this.filter(function (singleExam) {\n let exist = false;\n\n //se esame ha uno gruppo e tale gruppo non ���� vuoto\n if (singleExam.group !== undefined && singleExam.group.members !== undefined) {\n for (let j = 0; j < singleExam.group.members.length; j++) {\n //se utente attuale appartiene a gruppo di quella esame\n if (singleExam.group.members[j].id === owner.id) {\n exist = true;\n }\n }\n }\n return exist;\n });\n return arrayOfExam;\n }", "title": "" }, { "docid": "23a6c255bad498fc967b822d66c7d549", "score": "0.46700287", "text": "isEmpty() {\n return Object.keys(this.multiLevels).length == 0;\n }", "title": "" }, { "docid": "af71430bdc10d50f2f3627a18419f70a", "score": "0.46661815", "text": "function addFamilyMembersForm(e) {\n e.preventDefault();\n // only run if the additional family member has a valid email\n if (!!additionalFamilyMember.email.match(/.+@.+/)) {\n //clear error state if there were previous errors\n setFamilyMemberErrors([]);\n setFamilyMembers((prevState) => [...prevState, additionalFamilyMember]);\n setAdditionalFamilyMember({\n firstName: \"\",\n lastName: \"\",\n email: \"\",\n phone: \"\",\n });\n } else {\n setFamilyMemberErrors([\"Must be a valid email\"]);\n }\n }", "title": "" }, { "docid": "c5fb08854375933314f956354fc305eb", "score": "0.46629786", "text": "function ae(t) {\n return null !== t.collectionGroup;\n}", "title": "" }, { "docid": "2610a5b6b7dc4655740f67a031d7fc7a", "score": "0.46586835", "text": "isValidItem(item) {\n if (!item.thumb) {\n log.debug(`candidateItem ${item.qid} has no thumb`);\n return false;\n }\n\n if (!item.label) {\n log.debug(`candidateItem ${item.qid} has no label in the given language`);\n return false;\n }\n\n const claims = item._item.claims;\n\n if (!(\"P373\" in claims)) {\n log.debug(`candidateItem ${item.qid} has no category`);\n return false;\n }\n\n if (\"P31\" in claims) {\n for (const claim of claims.P31) {\n // Item should not be a category!\n if (claim.mainsnak.datavalue.value.id === \"Q4167836\") {\n log.debug(`candidateItem ${item.qid} is a category`);\n return false;\n }\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "29c24cd43d6a94ce4fd83eb163c62d71", "score": "0.4657136", "text": "isInfoComplete() {\n const user = this.state.userInfo;\n const userInfoProps = ['firstName', 'lastName', 'age', 'sex'];\n return userInfoProps.every(prop => user[prop] != null && user[prop] !== '');\n }", "title": "" }, { "docid": "b2da93326891dc5a1432e7050fa99d2e", "score": "0.46548077", "text": "function validateMbfeeding(){\n\t\t//if it's NOT valid\n\t\tif(mbfeeding.val().length < 1){\n\t\t\tmbfeeding.addClass(\"error\");\n\t\t\tmbfeedingInfo.text(\"Please Select Feeding !\");\n\t\t\tmbfeedingInfo.addClass(\"error\");\n\t\t\treturn false;\n\t\t}\n\t\t//if it's valid\n\t\telse{\n\t\t\tmbfeeding.removeClass(\"error\");\n\t\t\tmbfeedingInfo.text(\"\");\n\t\t\tmbfeedingInfo.removeClass(\"error\");\n\t\t\treturn true;\n\t\t}\n\t}", "title": "" }, { "docid": "dc3b4dc5812c3a29e3ca81cfd9b7d14a", "score": "0.46531722", "text": "isDisponibleEtage(){\n var found = 0;\n const chambers =this.chambers ;\n if(chambers === []){\n return false ;\n }\n\n chambers.forEach(chombre =>{\n if(chombre.isDisponible()){\n found++ ;\n }\n })\n if(found > 0){\n return true\n }else{\n return false\n }\n }", "title": "" }, { "docid": "dc3b4dc5812c3a29e3ca81cfd9b7d14a", "score": "0.46531722", "text": "isDisponibleEtage(){\n var found = 0;\n const chambers =this.chambers ;\n if(chambers === []){\n return false ;\n }\n\n chambers.forEach(chombre =>{\n if(chombre.isDisponible()){\n found++ ;\n }\n })\n if(found > 0){\n return true\n }else{\n return false\n }\n }", "title": "" }, { "docid": "d641de3e10a83c3e23153fb829cac344", "score": "0.46491712", "text": "hasKategorie(kategorie) {\n return this.kategorie === kategorie;\n }", "title": "" }, { "docid": "d6e56feb5519a0e1dcbcc58637e86cff", "score": "0.4645454", "text": "function getUncleorAunt(name, gender, x) {\t\n\tlet found = false;\t\n\tconst personA = familyJ.family.find(x => x.name == name);\n\tif(personA){\n\t\tlet parentt;\n\t\tif(x == \"Paternal\"){\n\t\t\tparentt = familyJ.family.find(x => x.id == personA.fatherId);\n\t\t}else if(x == \"Maternal\"){\t\t\t\n\t\t\tparentt = familyJ.family.find(x => x.id == personA.motherId);\n\t\t}\n\t\t//console.log(parentt)\n\t\tif (parentt && parentt.fatherId != null && parentt.motherId != null){\n\t\t\tfor (let j = 0; j < familyJ.family.length; j++) {\n\t\t\t\tlet person = familyJ.family[j];\n\t\t\t\tif(person.fatherId == parentt.fatherId && person.motherId == parentt.motherId && person.gender == gender \n\t\t\t\t&& person.id != personA.fatherId && person.id != personA.motherId){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tprocess.stdout.write(person.name+\" \");\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\tfound = true;\n\t\t\tprocess.stdout.write(\"PERSON_NOT_FOUND\")\n\t\t}\n\t} else {\n\t\tfound = true;\n\t\tprocess.stdout.write(\"PERSON_NOT_FOUND\")\n\t}\n\tif(!found){\n\t\tprocess.stdout.write(\"NONE\"+ '\\n')\n\t}else{\n\t\tprocess.stdout.write('\\n')\n\t}\n}", "title": "" }, { "docid": "2eca58d0bdedc7bfc008191a3274e631", "score": "0.46444145", "text": "function isInSet(member, arr) {\n\tfor(var i = 0, length = arr.length ; i < length ; i++ ) {\n\t\tif(arr[i] === member) {\n\t\t\treturn true;\n\t\t}\n\t}\n\tconsole.log('member: ', member + ' is not in set: ' + arr.toString());\n\treturn false;\n}", "title": "" }, { "docid": "35c8fbb609a4b3e26e05d61c2fcb330b", "score": "0.4641915", "text": "function check_member(param) {\n var res = true;\n $('.hc-loginid-error').html('');\n $('.hc-email-error').html('');\n $('.hc-password-error').html('');\n\n // check if loginid is empty\n if (typeof param.loginid !== 'undefined' && param.loginid.length < 1) {\n $('.hc-loginid-error').html(hc_msgs.ERR_01);\n res = false;\n }\n\n // check if email is empty\n if (typeof param.email !== 'undefined' && param.email.length < 1) {\n $('.hc-email-error').html(hc_msgs.ERR_02);\n res = false;\n } else if (!is_email(param.email)) {\n $('.hc-email-error').html(hc_msgs.ERR_03);\n res = false;\n }\n\n // check if password is empty\n if (typeof param.password !== 'undefined' && param.password.length < 1) {\n $('.hc-password-error').html(hc_msgs.ERR_04);\n res = false;\n } else if (param.password.length < 8) {\n $('.hc-password-error').html(hc_msgs.ERR_05);\n res = false;\n } else if (!is_alphanumeric(param.password)) {\n $('.hc-password-error').html(hc_msgs.ERR_06);\n res = false;\n }\n\n return res;\n }", "title": "" }, { "docid": "1ed945fd9a9690c938252c8e78a6d1d2", "score": "0.46333748", "text": "function filterAttract(feature) {\n if (feature.properties.category == \"Singapore Attractions\") return true\n}", "title": "" }, { "docid": "0e0ba709a2d819d240a08e32ba1db4f1", "score": "0.46300706", "text": "function check(cell){\n var memberOf = cell.id.split(/\\s+/);\n for (var i = 0; i < memberOf.length; i++) {\n score[turn][memberOf[i]] += 1;\n if (score[turn][memberOf[i]] == 3) {\n return true;\n }\n }\n return false\n}", "title": "" }, { "docid": "89c2e2dd9b8a3861f9a9d879d1c96b21", "score": "0.46292034", "text": "function checkForEmptyFirstName(f_name){\n if (f_name == ''){\n return true;\n }\n else{\n return false;\n }\n }", "title": "" }, { "docid": "042533019abbce559d326760613c812a", "score": "0.46257162", "text": "checkInformationFilters(node) {\n let required = this.props.filters.information\n\n if (required && required.length > 0) { //check if all checked are included \n\n for (let i = 0; i < required.length; i++) {\n\n if ([\"capacity\", \"minimumHeightInMeters\"].indexOf(required[i]) > -1) {// special treatment\n // if empty return true\n }\n }\n\n //everthing is included\n return false\n\n }\n return false // nothing is required or all required fields are included\n\n }", "title": "" }, { "docid": "c5d5f34a5700126890ae0bdb863f361b", "score": "0.46235022", "text": "function getFemaleFamilyMembers(family) {\n let female = family.filter(member => member.gender === 'female');\n return female.map(n => n.name);\n\n }", "title": "" }, { "docid": "2d0d2cd5059c850c9bafa145c1608270", "score": "0.4602243", "text": "function ExisteCampo( Campo )\n{\n return ( Campo == null ) ? false : true;\n}", "title": "" }, { "docid": "9c70d8be2277cba5fcbe69c3c7499ea4", "score": "0.45996618", "text": "function validate(val) {\n\n if(!val) return;\n\n var reachedLevel = false; //default value if none of lavels is riched\n\n // console.log('%c '+val+' ','background: #222; color: #bada55');\n\n for(level in classifier) {\n\n for (index in classifier[level])\n\n if (!microTest(val, classifier[level][index], index)) return reachedLevel;\n\n reachedLevel = level;\n }\n\n return reachedLevel;\n\n }", "title": "" }, { "docid": "d20bfdcd6dc08a7026d2e552b57665ab", "score": "0.45962167", "text": "function aMemberNameEmpty() {\n var result = false;\n $('.pu-member-select2').each(function () {\n if ($(this).val() === \"\") {\n result = true;\n return false;\n }\n });\n return result;\n}", "title": "" }, { "docid": "e9ee31814df9f52210c6ee6fe83f0687", "score": "0.45934156", "text": "function test_feed_name( feed ) {\n it( 'name exists', function() {\n expect( feed.name ).toBeDefined();\n expect( feed.name.length ).not.toBe( 0 );\n } );\n }", "title": "" }, { "docid": "a5f812f35eb6e74825f5874c525ad4f7", "score": "0.45889786", "text": "hasAvatar() {\n return this.avatar !== '' && this.avatar !== null;\n }", "title": "" }, { "docid": "34609cfb74483b58d8d48222c011d183", "score": "0.45723897", "text": "static IsTidesOfChaosSpent(actor, wmToCFeatureName) {\n const tocItem = actor.items.getName(wmToCFeatureName);\n\n if (tocItem) {\n return (tocItem.data.data.uses.value === 0);\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "7be7629802f9a8bb763b6f1ca9414bcd", "score": "0.4569754", "text": "function hasFeature(customer, feature){\r\n\t\r\n\tvar featureGroup = customer.assignedFeatureGroup;\r\n\tif (featureGroup == null){\r\n\t\treturn false;\r\n\t}\r\n\telse{\r\n\t\tfor (var i=0; i<featureGroup.features.length; i++){\r\n\t\t\tif (featureGroup.features[i] == feature){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}\t\r\n}", "title": "" }, { "docid": "51aa54c8172b92b438a764627ae90b4a", "score": "0.45691612", "text": "static hasFriends(num) {\n\t\treturn num != 1;\n\t}", "title": "" }, { "docid": "66fe81b24c8317c0dd38b340c2c7a1db", "score": "0.45640728", "text": "function verifyLabelsAreInProjectValidLabels(t, proj) {\n\n var valid_labels = new Set(proj.category_hierarchy);\n //valid_labels.add(\"O\");\n\n //var valid_abbreviations = new Set(proj.valid_labels.map(value => value.abbreviation));\n //valid_abbreviations.add(\"O\"); // Add the outside category\n\n\n\n\n // var merged_labels = Array.from(new Set([].concat.apply(Array.from(new Set([].concat.apply([], t.labels))))));\n\n var merged_labels = new Set();\n\n for(var i = 0; i < t.labels.length; i++) {\n for(var j = 0; j < t.labels[i].length; j++) {\n if(t.labels[i][j][1] !== undefined) {\n for(var k = 0; k < t.labels[i][j][1].length; k++) {\n merged_labels.add(t.labels[i][j][1][k])\n } \n }\n }\n }\n \n merged_labels = Array.from(merged_labels);\n for(var i = 0; i < merged_labels.length; i++) {\n var label = merged_labels[i];\n if (!valid_labels.has(label)) {\n return new Error(\"Label \\\"\" + merged_labels[i] + \"\\\" is not a valid label for the project.\" )\n }\n }\n return null; // no error \n }", "title": "" }, { "docid": "958ddb12b5fd192a66ceb70bf415321c", "score": "0.45588884", "text": "function getCasualitiesByGender(data, gender) {\n\treturn data\n\t.filter(p => p.fields.sex == gender && p.fields.survived == 'No').length\n}", "title": "" }, { "docid": "ed29d906b3a8ecde0514b66ede9f0bfc", "score": "0.45588028", "text": "function missingEmptyLayer (){\n\n\tif ( $( \".descriptionEventParameterDiv div.elementDescriptionLayer\" ).length ) {\n \n \treturn true;\n \n\t}else{\n\t\n\t\treturn false;\n\t\t\n\t}\n \n}", "title": "" }, { "docid": "ad727b6b0823d5adbf2a600a2a3af04b", "score": "0.45527765", "text": "nothingFound() {\n\t\treturn Template.instance().foundRoles().length == 0;\n\t}", "title": "" }, { "docid": "44178f7da89331a5f8c4f9a62cf46878", "score": "0.4550914", "text": "function member(lang,list){\n\treturn list.indexOf(lang) !== -1;\n}", "title": "" }, { "docid": "f2116bfccd4ccaa4d09a0928417dddb4", "score": "0.4550037", "text": "function validateMembership() {\n if (!that.isJoined()) {\n throw new Error(\"Not a member of this group anymore.\");\n }\n }", "title": "" }, { "docid": "4f40775d56b006217c0bda4377e88f14", "score": "0.45495218", "text": "function assocValid(a, c) {\n return a && c && c.filter(cp => a.tiploc === cp.tpl).length\n}", "title": "" }, { "docid": "018d3fff2b96a9a9a66ff9701c85e657", "score": "0.45473063", "text": "function isMemberDouble(array,entry){\nif (array.length==0) {return true;}\nfor (i=0;i<array.length;i++){\nif (array[i]==entry){ return false;} \n}\nreturn true;\n}", "title": "" }, { "docid": "7402bb11d168ab30bca2734db8f7ece3", "score": "0.45453247", "text": "function groupNameExists(groupName) {\n if (fs.existsSync(defaults.usageDataJsonFilePath) &&\n fs.readFileSync(defaults.usageDataJsonFilePath, \"utf8\") !== \"\" &&\n fs.readFileSync(defaults.usageDataJsonFilePath, \"utf8\") !== \"undefined\") {\n const jsonData = readUsageDataJsonData();\n return Object.getOwnPropertyNames(jsonData.usageDataInstances).includes(groupName);\n }\n return false;\n}", "title": "" }, { "docid": "5bb548b1e1df20e3aedb74e89a8a3c61", "score": "0.45453247", "text": "function checkOverlap() {\n let d = dist(user.x, user.y, cat.x, cat.y);\n let result = d < user.size / 2 + cat.size / 2;\n return result;\n}", "title": "" }, { "docid": "e4472670b665784d7bb42759c4757e99", "score": "0.45401284", "text": "function _filterFrInner() {\n return $(this).find('fr-inner').length === 0;\n }", "title": "" }, { "docid": "84d68035ae6a4733d3ea9de007dbcf78", "score": "0.45395434", "text": "function noKatzAllowed(noCats) {\n \n let otherAnimals = [];\n \n for (let i=0; i < noCats.length; i++){\n \n if (noCats[i].animal !== \"cat\") {\n \n otherAnimals.push(noCats[i])\n }\n \n }\n return otherAnimals\n \n}", "title": "" }, { "docid": "fd1985a46340432ad947ad61055969b9", "score": "0.45389462", "text": "check(decl) {\n return decl.value.split(/\\s+/).some(i => !BASIC.includes(i))\n }", "title": "" }, { "docid": "ee1870be93ef7976319e6b89f96cebb1", "score": "0.45372805", "text": "isValidMFI(input) {\n return this.state.partner_names.indexOf(input) !== -1\n }", "title": "" }, { "docid": "bc1e3b902013fffe8a9f5647db50270a", "score": "0.45338818", "text": "function checkDedicatedNumberClass(memberId, axClass, carNumber){\r\n for (var i = 0; i < members.length; i++) {\r\n // ignore the members own record\r\n if (memberId != members[i]._id.toString()){\r\n\r\n if (uniqueNumberPerClass && carNumber.toLowerCase() == members[i].dedicatedNumber.toLowerCase()\r\n && axClass != null && axClass.name.toLowerCase() == members[i].dedicatedClass.toLowerCase()){\r\n return true;\r\n }\r\n else if (!uniqueNumberPerClass && carNumber.toLowerCase() == members[i].dedicatedNumber.toLowerCase())\r\n return true;\r\n\r\n }\r\n };\r\n return false;\r\n }", "title": "" }, { "docid": "b51db54f3864438238a04182218f9b09", "score": "0.453361", "text": "function doesFriendExist(text,age){\n if(isNaN(text))\n return text;\n else\n return age;\n \n}", "title": "" } ]
60443b1a4c9b4ef8e40368869dc5d557
Status : Ok Private methode Send message to server.
[ { "docid": "07897dd0dd8cbd163c87dc67167c552f", "score": "0.0", "text": "function sendMessage(typeAction, acquittementSocle, message, event){\n\t\tvar socleConn = null;\n\t\tevent = event || '';\n\t\tif(messagePending) {\n\t\t\treturn false;\n\t\t}\n\t\tacquittementSocle = parseInt(acquittementSocle, 10);\n\t\tif(acquittementSocle) {\n\t\t\tmessagePending = typeAction;\n\t\t\tmessagePendingTimer = setInterval(function(){\n\t\t\t\treleaseWaitMessagePending();\n\t\t\t}, messagePendingInterval);\n\t\t\t$(conn).trigger($.socleBureau.Events.waitForPendingMessage, true);\n\t\t}\n\t\ttry {\n\t\t\tsocleConn = conn;\n\t\t\t// ajout d'une fonction de callBack pour l'acquittement\n\t\t\tsocleConn.onAck = function(callBack) {\n\t\t\t\tif (callBack) {\n\t\t\t\tajoutCallBack(typeAction, ActionEnum.acquittement, callBack);\n\t\t\t\t}\n\t\t\t\treturn socleConn;\n\t\t\t};\n\t\t\t// ajout d'une fonction done pour la reception de message dans le cas d'abonnement\n\t\t\tif (typeAction === ActionEnum.abonnementEvt) {\n\t\t\t\tsocleConn.onReceiveEvent = function(callBack) {\n\t\t\t\t\tif (callBack) {\n\t\t\t\t\tajoutCallBack(event, ActionEnum.appelEvt, callBack);\n\t\t\t\t\t}\n\t\t\t\t\treturn socleConn;\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn socleConn.send(message);\n\t\t} catch (error){\n\t\t\t$(conn).trigger($.socleBureau.Events.errors, error);\n\t\t\treturn null;\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "aa37ff24d80e12379032c3de7c95a367", "score": "0.6996648", "text": "function ok(obj){\n logger.simple(\"res OK: \", obj);\n this.send(obj);\n}", "title": "" }, { "docid": "b15e582f9e010d29dde0bed2218604ce", "score": "0.666027", "text": "function sendMessage() {\n\t//Pebble.sendAppMessage({\"status\": 0});\n //testRequest();\n //testRequestTime();\n\t\n\t// PRO TIP: If you are sending more than one message, or a complex set of messages, \n\t// it is important that you setup an ackHandler and a nackHandler and call \n\t// Pebble.sendAppMessage({ /* Message here */ }, ackHandler, nackHandler), which \n\t// will designate the ackHandler and nackHandler that will be called upon the Pebble \n\t// ack-ing or nack-ing the message you just sent. The specified nackHandler will \n\t// also be called if your message send attempt times out.\n}", "title": "" }, { "docid": "980d146379226d2c84d80d99e0d5501c", "score": "0.6604071", "text": "success(message) {\n return this.sendMessage(MessageType.Success, message);\n }", "title": "" }, { "docid": "00482f813ec27b4dd1e1c75fa31b9b34", "score": "0.6530183", "text": "static sendResponse(response, status, msgCode, message, data) {\n if (message && message instanceof Error && message.constructor) {\n message.type = message.constructor.name;\n }\n if (status !== 200) {\n Log.warning(message);\n }\n Http.response(response, status, msgCode, message, data);\n }", "title": "" }, { "docid": "8cf97af6c1896ee0f865cc8a78e8594e", "score": "0.6505228", "text": "function send_message(status, msg) {\n\tPebble.sendAppMessage({'status': status, 'message': msg});\n}", "title": "" }, { "docid": "12b08fb5719f82c6ab5cb81b037ea8ed", "score": "0.64817244", "text": "function sendResponse(status, message) {\n\t\t\t\tvar jsonMessage = JSON.stringify(message);\n\t\t\t\t//utils.info('sending response! ' + jsonMessage);\n\t\t\t\tresponse.writeHead(status,\n\t\t\t\t\t{\n\t\t\t\t\t\t'Content-Length': Buffer.byteLength(jsonMessage),\n\t\t\t\t\t\t'Content-Type': 'text/plain'\n\t\t\t\t\t});\n\t\t\t\tresponse.end(jsonMessage);\n\t\t\t}", "title": "" }, { "docid": "9f35f1fd32835d09417a8bf76f135fc0", "score": "0.64362663", "text": "function sendMessage(message){\n let idUser = localStorage.getItem('idUser');\n let token = localStorage.getItem('token');\n let _tempUrl = server_url+\"say/\"+token+\"/\"+idUser+\"/\"+message;\n $.ajax({\n url: _tempUrl,\n dataType: \"jsonp\",\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n success: function (result, status, xhr) {\n let _status = getResultKwick(result, 'say', 'status');\n if(_status==\"done\"){\n //Envoi de message OK\n }else if(_status==\"failure\"){\n //Modal\n Swal.fire({\n icon: 'error',\n title: 'Oooops...',\n text: `Le message n'a pas pu être envoyé.`,\n });\n }\n },\n error: function (xhr, status, error) {\n console.log(\"Error\");\n }\n });\n }", "title": "" }, { "docid": "51ee09a4e8f3e52a7e62dce74698f5db", "score": "0.6425127", "text": "send(data) {\n var self = this;\n if (self.currentStatus.connected) {\n self.client.send(data);\n }\n }", "title": "" }, { "docid": "6d7d83c2afef53ceabc115a9e1e442dd", "score": "0.6417975", "text": "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 }", "title": "" }, { "docid": "13b0b1e5f9d6e961798b03cc57c532e6", "score": "0.63819605", "text": "function sendMsg(){\n\tvar msg = document.getElementById(\"chatmsg\").value;\n\n\tif (trim(msg) != \"\"){\n\t\tappendMyMessage();\n\t\txmlHttp6 = GetXmlHttpObject();\n\n\t\tif (xmlHttp6 == null){\n\t\t\talert(\"Browser does not support HTTP Request\");\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.getElementById(\"chatmsg\").value = \"\";\n\t\tvar url = base_url+\"kirimPesan/?userId=\" + userId + \"&baturId=\" + strangerId + \"&pesan=\" + msg;\n\t\txmlHttp6.open(\"POST\", url, true);\n\t\txmlHttp6.onreadystatechange = stateChanged6;\n\t\txmlHttp6.send(null);\n\t}\n}", "title": "" }, { "docid": "de67166466d4bc3da4cdc460619af3f4", "score": "0.6377571", "text": "sending () {\n }", "title": "" }, { "docid": "324c436a259115b5e47a506d6ef7fdc4", "score": "0.6374644", "text": "send(data) {\n if (this.currentStatus.connected) {\n this.socket.send(data);\n }\n }", "title": "" }, { "docid": "98cc367af927757df353ca243d2fd6fe", "score": "0.6330578", "text": "function SendStatus() {\n message = {\n intended: \"popup\",\n action: \"status\",\n artista: artistName,\n cancion: songName,\n album: albumName,\n cover: coverImage,\n estado: isPlaying,\n volumen: player.getVolume(),\n videoLenght: player.getDuration(),\n videoProgress: player.getCurrentTime(),\n muteado: player.isMuted()\n };\n SendMessage(message);\n}", "title": "" }, { "docid": "364f6bdf8a15f793772056069275a595", "score": "0.6319186", "text": "static postReponse() {\n const reqMessage = JSON.parse(this.req.chunks[0]);\n\n this.res.writeHead(200);\n this.res.end();\n Bot.Functions.load(reqMessage.group_id);\n function send() {\n //ACTUAL BOT\n const resMessage = Bot.Bot.checkMessage(reqMessage);\n if (resMessage) {\n\n //STARTS SEND\n Bot.Bot.sendMessage(resMessage);\n }\n }\n setTimeout(send, 200);\n }", "title": "" }, { "docid": "a9c4508bf59ae299d1569d154de24eda", "score": "0.63119894", "text": "send (message) {\n $.ajax({\n url: this.server,\n type: 'POST',\n contentType: 'application/json',\n data: JSON.stringify(message),\n success: (data) => {\n console.log('chatterbox: Message sent', data);\n },\n error: (data) => {\n console.error('chatterbox: Failed to send message', data);\n }\n }); \n }", "title": "" }, { "docid": "0230bea19d4c29b4e917390069557ed0", "score": "0.6307186", "text": "function sendMessage() {\n \t\tvar message = data.value;\n\t\tdata.value = \"\";\n\t\t// tell server to execute 'sendchat' and send along one parameter\n\t\tsocket.emit('sendchat', message);\n\t}", "title": "" }, { "docid": "36662ccabb884ee00c3ac9ecb8035b8d", "score": "0.6286774", "text": "sendMessage() {\n\n // get the message from the messaging input\n const message = App.elements.input.val();\n\n // make sure the message is not empty or just spaces.\n if (message.trim().length > 0) {\n\n // do a POST request with the message\n App.requests.sendMessage(message).done(() => {\n\n // clear the message box.\n App.dom.clearMessageBox();\n });\n }\n }", "title": "" }, { "docid": "d32ccdacb694404d1b941050de6b15bf", "score": "0.6278532", "text": "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 }", "title": "" }, { "docid": "7ea216267819f162ae8fee6465b9d41f", "score": "0.6274364", "text": "function sendMessage() {\n // Construct a msg object containing the data the server needs to process the message from the chat client.\n var msg = {\n type: \"message\",\n text: jq(\"#ATOMspyPopUpDiv\").attr('obj-prop'),\n id: \"objInfo\",\n date: Date.now()\n };\n\t\n //connection.send(JSON.stringify(msg));\n connection.send(jq(\"#ATOMspyPopUpDiv\").attr('obj-prop'))\n\n connection.onmessage = function(msg){\n \tvar uiRsp=JSON.parse(msg.data).data.text\n if (uiRsp.substring(0, 6)=='UIResp'){\n var msgToShow=uiRsp.split('::')[1];\n var msgtoShowtype\n if (msgToShow.search(\"Already\")>0) {\n \tmsgtoShowtype=\"Error!!!\"\n } else {\n \tmsgtoShowtype=\"Message\"\n }\n \n showAlert(msgtoShowtype,msgToShow);\n }\n \n }\n\t\t\n }", "title": "" }, { "docid": "08313acf4996a51e95f5bd9ecd73a6f9", "score": "0.6254434", "text": "sendSendVersionMessageToServer() {\n var message = {};\n this.sendMessageToServer('sendVersion', message);\n }", "title": "" }, { "docid": "1ae5085aa90e6eeacafa08a27d31191d", "score": "0.625122", "text": "onSend() {\n this.sendMSG(this.state.message)\n }", "title": "" }, { "docid": "8b5b53caa21ec7aedcd41396bc79e3e7", "score": "0.62298054", "text": "function sendMessage(){}", "title": "" }, { "docid": "31fb4d6c44ef6403ebe4db283b583f3f", "score": "0.62145466", "text": "send_message(message) {\n this.socket.send(message)\n }", "title": "" }, { "docid": "423c72a70b18887875be14b2cbb0f517", "score": "0.6188467", "text": "function sendToServer(msg) {\n ws.send(msg);\n }", "title": "" }, { "docid": "8cf8560bacee074f045320f6778ebcfc", "score": "0.6183599", "text": "function send(){\n\tvar message = messageBox.value;\n\tmessageBox.value = '';\n\tvar idChannel = $('#which').attr('channel');\n\t$.post(\"TchatServlet?action=sendMessage&content=\" + message + \"&channel=\" + idChannel);\n\tconsole.log('new message just sent !')\n}", "title": "" }, { "docid": "a9b6e4c8788ad3c002da79fead79dae8", "score": "0.6168193", "text": "sendMessage() {\n // This function is called before sending a method (including resending on\n // reconnect). We should only (re)send methods where we don't already have a\n // result!\n if (this.gotResult())\n throw new Error(\n \"sendingMethod is called on method with result\"\n ); // If we're re-sending it, it doesn't matter if data was written the first\n // time.\n\n this._dataVisible = false;\n this.sentMessage = true; // If this is a wait method, make all data messages be buffered until it is\n // done.\n\n if (this._wait)\n this._connection._methodsBlockingQuiescence[\n this.methodId\n ] = true; // Actually send the message.\n\n this._connection._send(this._message);\n }", "title": "" }, { "docid": "32d0db50636ac52d8334021482ec7b44", "score": "0.61673975", "text": "static succeded() {\n return MediaServerResponse.response('success', '');\n }", "title": "" }, { "docid": "84f9573726ae07f109624da999279c4c", "score": "0.6156511", "text": "function messageSuccessHandler() {\n console.log(\"Message send succeeded.\"); \n}", "title": "" }, { "docid": "84f9573726ae07f109624da999279c4c", "score": "0.6156511", "text": "function messageSuccessHandler() {\n console.log(\"Message send succeeded.\"); \n}", "title": "" }, { "docid": "84f9573726ae07f109624da999279c4c", "score": "0.6156511", "text": "function messageSuccessHandler() {\n console.log(\"Message send succeeded.\"); \n}", "title": "" }, { "docid": "8ef8495d6b4bc0069f382abc30ebc978", "score": "0.61299735", "text": "function send(msg) { ltSck.write(JSON.stringify(msg) + \"\\n\"); }", "title": "" }, { "docid": "29045cc3fc7de19210663a9bb1f751b1", "score": "0.6127779", "text": "function send() {\r\n\tcheckName();\r\n\tcheckMessage();\r\n\tcheckEmail();\r\n\t//when all are right, show the successful message in the div which id is sendsuccessfully and return true\r\n\tif(checkName()==true && checkMessage()==true && checkEmail()==true) {\r\n\t\tdocument.getElementById(\"sendsuccessfully\").innerHTML=\"Message successfully sent\";\r\n\t\treturn true;\r\n\t}\r\n\t//if one of name, message and email is not right, return false\r\n\treturn false;\r\n}", "title": "" }, { "docid": "e1813e604ad9b104513e06f5cc26c947", "score": "0.6120378", "text": "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)) return this.okPressed = false;\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 return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n $('#confirmation').modal({\n show: 'true'\n }); \n }", "title": "" }, { "docid": "fede61935806c34d3c7a5b66f30de195", "score": "0.6100009", "text": "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "title": "" }, { "docid": "fede61935806c34d3c7a5b66f30de195", "score": "0.6100009", "text": "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "title": "" }, { "docid": "8eceb4df90644f440ea3717e1378d39c", "score": "0.6097893", "text": "function sendMessage() {\n if(data.value === \"\")\n return;\n var message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit('sendchat', message);\n }", "title": "" }, { "docid": "86ee6d60dfdfcd63c70b393d07a3a85e", "score": "0.60949266", "text": "send(data) {\n try {\n this._send(data);\n } catch (e){\n console.log(e);\n }\n }", "title": "" }, { "docid": "5a6fc2ebd1d8ae009ee6a2665540353f", "score": "0.6090829", "text": "function handleSendButton() {\n var msg = {\n text: document.getElementById(\"text\").value,\n type: \"message\",\n id: clientID,\n date: Date.now()\n };\n sendToServer(msg);\n document.getElementById(\"text\").value = \"\";\n}", "title": "" }, { "docid": "57e59cf27ca1704de20e25e81db54944", "score": "0.60870373", "text": "function ok(obj) {\n response({ status: 'ok', response: obj });\n }", "title": "" }, { "docid": "2c3a84f276d54ba12765d2733d7ca53b", "score": "0.606964", "text": "sendMessage(type, data) {\n const message = { type: type, data: data };\n this.connection.send(JSON.stringify(message)); //La méthode JSON.stringify() convertit une valeur JavaScript en chaîne JSON\n }", "title": "" }, { "docid": "be672bcdcebed4c00ea93fc67609f753", "score": "0.60587126", "text": "function sendAlert(){\n\t\n\t// Request\n\tvar request = require('request');\n\t\n\t// Somebody has been detected\n\tif (value['value'] == true){\n\t\t\n\t\tvar subject = 'Alerte intrusion';\n\t\tvar message = 'Une présence a été détectée';\n\n\t// Nobody's here since few minutes\n\t} else {\n\n\t\tvar subject = 'Alerte intrusion terminée';\n\t\tvar message = 'Aucune présence détectée depuis 4 minutes';\n\t}\n\t\n // Configure the request to the multipush service\n var options = {\n url: \"http://localhost:9091/multipush\",\n method: 'GET',\n qs: {'subject': subject, 'message': message, 'canal': 'mail,sms,openkarotz'}\n } \n \n // Sending the request\n request(options, function (error, response, body) {\n if (!error && response.statusCode == 201) {\n \tconsole.info('Alert sent');\n } else {\n \tconsole.error('Alert error : %s', error);\n }\n });\n}", "title": "" }, { "docid": "96517b9ee7f69d6755f70e8232f0c0a1", "score": "0.6054286", "text": "function sendMessage() {\n const message = $('#txtMessage').val();\n $.post(sendMessageUrl, {message: message})\n .done(function (response) {\n if (response.success) {\n //success\n }\n })\n .fail(function () {\n alert(\"error\");\n });\n }", "title": "" }, { "docid": "0978b5b39d8645582e8212b8d637ba4a", "score": "0.60510635", "text": "send(message) {\n this.log(\"Sending message: \"+message);\n this.ws.send(message);\n }", "title": "" }, { "docid": "dd1828d375a0c9ff0b1cb8d77baecb4c", "score": "0.6047851", "text": "function sendCode(code,response,message) {\n response.status(code);\n response.send(message);\n}", "title": "" }, { "docid": "5dc6d520ce5c040af13563c324e75c51", "score": "0.60462403", "text": "onSend(message) {\n let self = this;\n axios.post(\"http://10.0.0.230/api/v1.0/chat\"), config, JSON.stringify(message)\n .then(function (response) {\n console.log(response);\n if (response.status == 202)\n // get request id from resposne and updating state\n // self.setState({\n // requestId = response._id\n // })\n alert(\"Successful\");\n self.setState({ message: { text: 'Message Sent', styles: ToastStyles.success } });\n self.props.navigator.push({\n component: 'Chat'\n });\n }).catch(function (error) {\n console.log(error);\n self.setState({ message: { text: 'Message failed', styles: ToastStyles.error } });\n })\n }", "title": "" }, { "docid": "3fcb037d75e00ab3555c5c82c438059c", "score": "0.6044511", "text": "function sendMsg(json) {\n\t\t\tif (ws) {\n\t\t\t\ttry {\n\t\t\t\t\tws.send(JSON.stringify(json));\n\t\t\t\t}\n\t\t\t\tcatch (e) {\n\t\t\t\t\tlogger.debug('[ws error] could not send msg', e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "3fcb037d75e00ab3555c5c82c438059c", "score": "0.6044511", "text": "function sendMsg(json) {\n\t\t\tif (ws) {\n\t\t\t\ttry {\n\t\t\t\t\tws.send(JSON.stringify(json));\n\t\t\t\t}\n\t\t\t\tcatch (e) {\n\t\t\t\t\tlogger.debug('[ws error] could not send msg', e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "3fcb037d75e00ab3555c5c82c438059c", "score": "0.6044511", "text": "function sendMsg(json) {\n\t\t\tif (ws) {\n\t\t\t\ttry {\n\t\t\t\t\tws.send(JSON.stringify(json));\n\t\t\t\t}\n\t\t\t\tcatch (e) {\n\t\t\t\t\tlogger.debug('[ws error] could not send msg', e);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2934a352bccee07c381bb8fe29e01b73", "score": "0.6042032", "text": "function send(data) {\n //console.log(data);\n client.send(JSON.stringify(data))\n }", "title": "" }, { "docid": "8a482b7ddb4b92d898e823a4907e3009", "score": "0.60389507", "text": "function send() {\n\t\t// Check form for errors\n\t\tif(!transferTransaction.mosaics.length) return alert('You must attach at least one mosaic !');\n\t\tif(!$(\"#privateKey\").val() || !$(\"#recipient\").val()) return alert('Missing parameter !');\n\t\tif(undefined === $(\"#amount\").val() || !nem.utils.helpers.isTextAmountValid($(\"#amount\").val())) return alert('Invalid amount !');\n\t\tif (!nem.model.address.isValid(nem.model.address.clean($(\"#recipient\").val()))) return alert('Invalid recipent address !');\n\n\t\t// Set the private key in common object\n\t\tcommon.privateKey = $(\"#privateKey\").val();\n\n\t\t// Check private key for errors\n\t\tif (common.privateKey.length !== 64 && common.privateKey.length !== 66) return alert('Invalid private key, length must be 64 or 66 characters !');\n \tif (!nem.utils.helpers.isHexadecimal(common.privateKey)) return alert('Private key must be hexadecimal only !');\n\n\t\t// Set the cleaned amount into transfer transaction object\n\t\ttransferTransaction.amount = nem.utils.helpers.cleanTextAmount($(\"#amount\").val());\n\n\t\t// Recipient address must be clean (no hypens: \"-\")\n\t\ttransferTransaction.recipient = nem.model.address.clean($(\"#recipient\").val());\n\n\t\t// Set message\n\t\ttransferTransaction.message = $(\"#message\").val();\n\n\t\t// Prepare the updated transfer transaction object\n\t\tvar transactionEntity = nem.model.transactions.prepare(\"mosaicTransferTransaction\")(common, transferTransaction, mosaicDefinitionMetaDataPair, nem.model.network.data.testnet.id);\n\n\t\t// Serialize transfer transaction and announce\n\t\tnem.model.transactions.send(common, transactionEntity, endpoint).then(function(res){\n\t\t\t// If code >= 2, it's an error\n\t\t\tif (res.code >= 2) {\n\t\t\t\talert(res.message);\n\t\t\t} else {\n\t\t\t\talert(res.message);\n\t\t\t}\n\t\t}, function(err) {\n\t\t\talert(err);\n\t\t});\n\t}", "title": "" }, { "docid": "7e29d00efa03e9f276723d94b2f55003", "score": "0.6034477", "text": "function send(msg) {\n ws.send( msg );\n }", "title": "" }, { "docid": "ba96489ad307d4b82f2680a8820823c5", "score": "0.60273796", "text": "function OnSuccessCallMaladie(data, status, jqXHR) {\n\t\t\tnotif(\"success\", \"Brief envoyé avec <strong>succès</strong> !\");\n\t\t}", "title": "" }, { "docid": "b4285c1eaf9a4c1f19b7b000bc1d3416", "score": "0.60089636", "text": "function sendMessage() {\n var data = messageBox.value();\n var destination = addressBox.value();\n var outGoing = encodeURI(data);\n httpGet('/destination/' + destination + '/msg/' + outGoing, 'text', requestDone);\n}", "title": "" }, { "docid": "07eb95ba177f26900ddf12c495ec8457", "score": "0.60084873", "text": "send (message) {\n if (_.isObject(message))\n message = MessageMaster.stringify(message)\n\n this.socket.send(message)\n }", "title": "" }, { "docid": "b39e291494343fab55a2f611955ce41e", "score": "0.59977543", "text": "function send(msg) { // send: msg\n if (socket.readyState === READY_STATE_OPEN) { socket.send(msg); }\n\n console.log('chatService(wsBaseUrl).send('+msg+')');\n }", "title": "" }, { "docid": "0960e28706f0493b9d6397967147badf", "score": "0.5997401", "text": "sendResponse(message, text) {\n return this._postMessage(message.channel, text);\n }", "title": "" }, { "docid": "c8d9d030abd2d2dbe7c50f69a7a574c9", "score": "0.5995374", "text": "function sendMsg(json){\n\t\tif(ws){\n\t\t\ttry{\n\t\t\t\tws.send(JSON.stringify(json));\n\t\t\t}\n\t\t\tcatch(e){\n\t\t\t\tconsole.log(\"error ws\", e);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "c8d9d030abd2d2dbe7c50f69a7a574c9", "score": "0.5995374", "text": "function sendMsg(json){\n\t\tif(ws){\n\t\t\ttry{\n\t\t\t\tws.send(JSON.stringify(json));\n\t\t\t}\n\t\t\tcatch(e){\n\t\t\t\tconsole.log(\"error ws\", e);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "3f2828a2d593a90d06780b8eea883d82", "score": "0.5993784", "text": "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 }", "title": "" }, { "docid": "ea66554a9edbc0fc36a50538fef96b2f", "score": "0.59925884", "text": "function sendMsg(json){\n\t\tif(ws){\n\t\t\ttry{\n\t\t\t\tws.send(JSON.stringify(json));\n\t\t\t}\n\t\t\tcatch(e){\n\t\t\t\tconsole.log('[ws error] could not send msg', e);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "c5158aff7dc423de52d077c100ac6f50", "score": "0.59919864", "text": "function sendSay() {\n const phrase = (new FormData(say_form)).get(\"phrase\");\n const websocket = `${ws_protocol}//${window.location.host}/ws/say`;\n WebSocketConnect(websocket, phrase);\n }", "title": "" }, { "docid": "7778c4e3782a3e5db47a3c6f00f9619f", "score": "0.599111", "text": "function sendMessageText() {\n var msg = id(\"sendMessageText\").value;\n\n if (msg.length > 0) {\n var msgLength = dataWriter.measureString(msg);\n dataWriter.writeInt32(msgLength);\n dataWriter.writeString(msg);\n dataWriter.storeAsync().done(\n function (byteCount) {\n if (byteCount > 0) {\n id(\"messageDiv\").innerHTML += \"Message sent: \" + msg + \"<br />\";\n } else {\n id(\"messageDiv\").innerHTML += \"The remote peer closed the socket.\";\n closeSocket();\n }\n },\n function (err) {\n id(\"messageDiv\").innerHTML += \"Send error: \" + err.message + \"<br />\";\n closeSocket();\n });\n }\n }", "title": "" }, { "docid": "7a12fad8c1740218801ac3d84088cb96", "score": "0.5991015", "text": "function OK(res) {\n res.status(200).send(`OK`);\n}", "title": "" }, { "docid": "a0566582d02bd109c9c1b38f5ff95e86", "score": "0.598515", "text": "function sendServerMessage(message, successHandler, failureHandler) {\n log(\"Sending message to sprongle.com ...\\n\" + message, \"server_all\");\n var x = new XMLHttpRequest();\n x.open('POST', 'http://sprongle.com', true);\n x.onload = function () {\n log(\"Response from sprongle.com:\", \"server_all\");\n log(x.response, \"server_all\");\n if (x.responseText.startsWith(\"success\"))\n successHandler(x);\n else\n failureHandler(x);\n };\n try { x.send(message); }\n catch (e) {\n console.log(\"server error:\");\n console.log(e);\n }\n }", "title": "" }, { "docid": "2f5ac01fd3d47cececa32ae6dc437a7d", "score": "0.5984163", "text": "function sendMessage() {\n\t\tvar outgoingMessage = $('#outgoingMessage').val();\n\t\tvar name = $('#name').val();\n\t\t$.ajax({\n\t\t url: '/message',\n\t\t type: 'POST',\n\t\t contentType: 'application/json',\n\t\t dataType: 'json',\n\t\t data: JSON.stringify({message: outgoingMessage, name: name})\n\t\t});\n\t}", "title": "" }, { "docid": "2094b7ec748473f8a1a71ee08a9ae3a6", "score": "0.5983907", "text": "function SendUserSuccess(ws, request, successMessage) {\n ws.send({\n \"type\": \"success\",\n \"data\": {\n \"request\": request,\n \"success-message\": successMessage\n }\n });\n}", "title": "" }, { "docid": "cb2c3c2c7a027f2b3a98f52020402b57", "score": "0.59772915", "text": "function sendMsg(json){\n\t\tif(ws){\n\t\t\ttry{\n\t\t\t\tws.send(JSON.stringify(json));\n\t\t\t}\n\t\t\tcatch(e){\n\t\t\t\tconsole.log('error ws', e);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "cb2c3c2c7a027f2b3a98f52020402b57", "score": "0.59772915", "text": "function sendMsg(json){\n\t\tif(ws){\n\t\t\ttry{\n\t\t\t\tws.send(JSON.stringify(json));\n\t\t\t}\n\t\t\tcatch(e){\n\t\t\t\tconsole.log('error ws', e);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "12e8c0425eb659a2178c1ee40d58e03a", "score": "0.5969262", "text": "function sendCallback(code, message) {\n status.code = code;\n status.message = message;\n status.redirect = true;\n}", "title": "" }, { "docid": "4d7367f7fe88574cba86144d4b806672", "score": "0.5966868", "text": "function sendMessage () {\n var message = $inputMessage.val();\n console.log(message);\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n console.log(message + ' and connected');\n $inputMessage.val('');\n addChatMessage({\n name: name,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n \n if (canPlay) {\n if (message === cleanInput('start')) {\n startRound();\n }\n } else if (playing) {\n if (message === cleanInput(answer)) {\n personal_score += score; \n }\n }\n }\n }", "title": "" }, { "docid": "22d50a7dc41a9cb109ea365b309fd6fd", "score": "0.59638983", "text": "function sendMessage(wsConnect, callbackID, success, message, data) {\n\t \tvar type = 'ERROR';\n\t \tif (success) {\n\t \t\ttype = 'SUCCESS';\n\t \t}\n\t\t// @todo is it okay to always send data and message, even if they're\n\t\t// null or empty string?\n\t\twsConnect.send(JSON.stringify({\n\t\t\t'callbackID': callbackID,\n\t\t\t'data': data,\n\t\t\t'status': {\n\t\t\t\t'type': type,\n\t\t\t\t'message': message\n\t\t\t}\n\t\t}), undefined, 0);\n\t}", "title": "" }, { "docid": "d3ad82b510187deb7f25782d86b603cd", "score": "0.5960653", "text": "function sendStatus(s) {\n\tio.sockets.emit('status', s);\n}", "title": "" }, { "docid": "baa55503427fa00d578d4cf6a4ac3482", "score": "0.5956046", "text": "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 }", "title": "" }, { "docid": "20d322659c6df0bf530842539fcdbd5a", "score": "0.59503293", "text": "function message_response(message, statusNumber, res) {\n if(!statusNumber) statusNumber = 200;\n write_response({message: message}, statusNumber, res);\n}", "title": "" }, { "docid": "bdaeb11d93ce3db480d85fe4a5b1b466", "score": "0.5942584", "text": "function probando(req, res) {\n res.status(200).send({ message: 'Probando desde del controladaor Message.' });\n}", "title": "" }, { "docid": "02461127b92e9146c3429bf0a3034b7c", "score": "0.5938684", "text": "function send_in_game_message() {\n var press_game_id = $('#press_game_id').val();\n var press_msg = $('#press_msg').val();\n if (check_field_empty(press_game_id, 'Press Game Id'))\n return false;\n if (check_field_int(press_game_id, 'Press Game Id'))\n return false;\n if (check_field_empty(press_msg, 'Cannot send empty message'))\n return false;\n var dataObj = {\n \"content\" : [\n { \"session_id\" : get_cookie() },\n { \"game_id\" : press_game_id },\n { \"to\" : $('#press_to').val() },\n { \"content\" : press_msg }\n ]\n };\n if($(\"#power_msg\").prop('checked'))\n call_server('power_msg', dataObj);\n else\n call_server('game_msg', dataObj);\n}", "title": "" }, { "docid": "24da4302c3adfbf94151ee8d6f5a8a34", "score": "0.5934663", "text": "function handleSendButton() {\n var msg = {\n text: chatBox.value,\n msgType: PEER_TEXT,\n id: uniqueId,\n name: myName,\n date: Date.now()\n };\n chatBox.value = \"\";\n var time = new Date(msg.date);\n var timeStr = time.toLocaleTimeString();\n if (msg.text.length) {\n for(var peer_id in dataChannels) {\n //simply try to send for each. Its okay if any one fails\n try {\n trace('sending to ' + peer_id);\n dataChannels[peer_id].send(JSON.stringify(msg));\n }catch(e) {\n trace(peer_id + ' Error sending msg: ' + e);\n }\n }\n updateChat(msg);\n }\n}", "title": "" }, { "docid": "0ae4341420743debc0881f8fb1fa6a0c", "score": "0.5931698", "text": "function sendMsg(json) {\n if (ws) {\n try {\n ws.send(JSON.stringify(json));\n } catch (e) {\n console.log('error ws', e);\n }\n }\n }", "title": "" }, { "docid": "d192fdf8fbb84d2af67b62a1fbf4a453", "score": "0.5926848", "text": "function saludo (req, res){\n send(res, 200, {message: 'saludar microrouter'});\n}", "title": "" }, { "docid": "2995b097ebc996938aaf7b738db6ad29", "score": "0.5919572", "text": "static async sendText(sessionName, number, text) {\r\n var session = Sessions.getSession(sessionName);\r\n if (session) {\r\n let checar = Sessions.setConnection(sessionName); //Obriga a mudar para CONNECTED\r\n if (session.state == \"CONNECTED\" || session.state == \"CONFLICT\") {\r\n // Corrigir conflito\r\n var resultSendText = await session.client.then(async (client) => {\r\n if (session.state == \"CONFLICT\") {\r\n client.useHere();\r\n } // Forçar uso.\r\n const user = await client.getNumberProfile(number + \"@c.us\");\r\n console.log(user);\r\n\r\n const messages = await client.getAllUnreadMessages();\r\n console.log(\"Mensagens\", messages);\r\n\r\n return await client.sendText(number + \"@c.us\", text);\r\n });\r\n return { result: \"success\" };\r\n } else {\r\n return { result: \"error\", message: session.state };\r\n }\r\n } else {\r\n return { result: \"error\", message: \"NOTFOUND\" };\r\n }\r\n }", "title": "" }, { "docid": "21caab345e71d2e3a98cd6d14342c43d", "score": "0.5915717", "text": "send(msg: SendArg) {\n this.lastMessage = msg\n return true\n }", "title": "" }, { "docid": "47284deb44d750d5834d0bec0b114d46", "score": "0.59117085", "text": "sendResponseMessage() {\n throw new Error('Sending this version of Response Message is no longer supported');\n }", "title": "" }, { "docid": "4e80645cd744fc8100c6462b9732381e", "score": "0.5904779", "text": "function sendPostResponse() {\n\t\t\t\t\t\n\t\t\t\t\tvar delaySend = false;\n\t\t\t\t\t// build appropriate response\n\t\t\t\t\tswitch(command) {\n\t\t\t\t\t\tcase 'end':\n\t\t\t\t\t\tcase 'continue':\n\t\t\t\t\t\t\tutils.info('server : Building \"continue\" response');\n\t\t\t\t\t\tcase 'start':\n\t\t\t\t\t\t\tmessage = {Op:'ok', id:deviceId};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'device_ready':\n\t\t\t\t\t\t\tutils.info('server : Building \"device_ready\" response:');\n\t\t\t\t\t\t\tvar task = device.taskGroup.getNextTest();\n\t\t\t\t\t\t\tif(task) {\n\t\t\t\t\t\t\t\tutils.info('\\tSending next task: ' + task);\n\t\t\t\t\t\t\t\tmessage = {Op:'ok', test:task};\n\t\t\t\t\t\t\t} else { // no more tasks, report\n\n\t\t\t\t\t\t\t\tutils.info('server : Is test done: ' + clientConnection.isTestDone);\n\t\t\t\t\t\t\t\tif(!clientConnection.isTestDone) {\n\t\t\t\t\t\t\t\t\tutils.info('server : setting istestdone to true');\n\t\t\t\t\t\t\t\t\tclientConnection.isTestDone = true;\n\t\t\t\t\t\t\t\t\tclientConnection.reporter.createReport();\n\t\t\t\t\t\t\t\t\tif(File.exists(path.join(END_GAME_LOCATION, 'Code', 'Main.js'))) {\n\t\t\t\t\t\t\t\t\t\tutils.info('\\tSending EndGame');\n\t\t\t\t\t\t\t\t\t\tmessage = {Op:'ok', test:'/' + END_GAME_LOCATION};\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tutils.info('is the next test ready?',\n\t\t\t\t\t\t\t\t clientConnection.isNextTestReady);\n\t\t\t\t\t\t\t\tif(clientConnection.isNextTestReady) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tclientConnection.isTestDone = false;\n\t\t\t\t\t\t\t\t\tclientConnection.isNextTestReady = false;\n\t\t\t\t\t\t\t\t\tdevice.taskGroup.restart();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tutils.info('\\tNo more tasks.');\n\t\t\t\t\t\t\t\t\tmessage = {Op:'nada'};\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'sdk_social_test_start':\n\t\t\t\t\t\t\tutils.info('Adding US Social test set');\n\t\t\t\t\t\t\tdevice.addToTaskGroup(AUTO_SDK_SOCIAL_TEST_LOC);\n\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'social_test_start':\n\t\t\t\t\t\t\tutils.info('setting tests to social_test_start');\n\t\t\t\t\t\t\tdevice.setTaskGroup('Social_Tests', AUTO_SOCIAL_TEST_LOC);\n\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'task_finished':\n\t\t\t\t\t\tcase 'log_start':\n\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'log_end':\n\t\t\t\t\t\t\t// hold off on sending response if previous messages\n\t\t\t\t\t\t\t// have yet to be received\n\t\t\t\t\t\t\tif(clientConnection.isLogFinished()) {\n\t\t\t\t\t\t\t\tmessage = {Op:'ok'};\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// if previous message never gets resent, we need to send\n\t\t\t\t\t\t\t\t// the response after a timeout\n\t\t\t\t\t\t\t\tif(delaySend === false) {\n\t\t\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\t\t\tif(clientConnection.isDelayedResponseSet() === true) {\n\t\t\t\t\t\t\t\t\t\t\tutils.info('Did not receive all past messages in 2 minutes --> sending response (' + deviceId + ')');\n\t\t\t\t\t\t\t\t\t\t\tclientConnection.flush();\n\t\t\t\t\t\t\t\t\t\t\tclientConnection.sendDelayedResponse();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}, 120000);\n\t\t\t\t\t\t\t\t\tdelaySend = true;\n\t\t\t\t\t\t\t\t\tclientConnection.setDelayedResponse(response);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tmessage = '';\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif(!delaySend) {\n\t\t\t\t\t\tsendResponse(200, message);\n\t\t\t\t\t}\n\n\t\t\t\t}", "title": "" }, { "docid": "c5d45e06c7d982809104910b357fdad8", "score": "0.58966976", "text": "function OkResponse (data, message, moreInfo) {\n HttpResponse.call(\n this, data, message || 'OK', 200, undefined, moreInfo, true);\n}", "title": "" }, { "docid": "f1b6ffcc199d3b0c1f125bd2ff463101", "score": "0.5885974", "text": "function send ( obj ){\n ws.send( JSON.stringify( obj ) );\n }", "title": "" }, { "docid": "3ad388835e840f5fce1f308db9140dbd", "score": "0.5881388", "text": "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 }", "title": "" }, { "docid": "a1e1eae1ae3de3b8ddc1bf5439bd0232", "score": "0.58793324", "text": "function sendVal(data) {\n if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {\n messaging.peerSocket.send(data);\n } \n}", "title": "" }, { "docid": "d2021f5b34cfba97d2e0c7397ae5060c", "score": "0.587791", "text": "function sendMessage() {\n let message = $inputMessage.value;\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n addChatMessage({ username, message }, { kind: \"sent\" });\n // tell server to execute 'new message' and send along one parameter\n\n let payload = {\n username: username,\n message: message\n }\n if (!dev) {\n socket.emit('new message', payload);\n }\n }\n }", "title": "" }, { "docid": "65ebece3553a2c2d6e35a9de4887ebf1", "score": "0.5872863", "text": "function sendToServer(msg) {\n var msgJSON = JSON.stringify(msg);\n\n log(\"Sending '\" + msg.type + \"' message: \" + msgJSON);\n connection.send(msgJSON);\n}", "title": "" }, { "docid": "b65417f30203cdf12d7ee97d13943e24", "score": "0.5872467", "text": "function successCB(msg) {\r\n // Success handling\r\n success(msg);\r\n }", "title": "" }, { "docid": "4cb939f0dfbf1e8b838df8d7b85bff0c", "score": "0.58720046", "text": "function respondOK(res,obj) {\n obj = { ...obj, \"resultCode\" : 200, \"result\": \"OK\" }\n res.send(JSON.stringify(obj))\n}", "title": "" }, { "docid": "0f8187ca87cb5f43db856e62a0b48b38", "score": "0.5870969", "text": "function sendVal(data) {\n if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {\n messaging.peerSocket.send(data);\n } else {\n console.error(\"Unable to send data.\");\n }\n}", "title": "" }, { "docid": "0d400139be67dbd20143fda2a2570dec", "score": "0.585977", "text": "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)) return this.okPressed = false;\n\n // Prepare the transaction\n let entity = this.prepareTransaction();\n\n // Use wallet service to serialize and send\n this._Wallet.transact(this.common, entity).then(() => {\n this._$timeout(() => {\n // Reset all\n this.init();\n return;\n });\n }, () => {\n this._$timeout(() => {\n // Delete private key in common\n this.common.privateKey = '';\n // Enable send button\n this.okPressed = false;\n return;\n });\n });\n }", "title": "" }, { "docid": "956647bf21a38a9fd63615f386c12589", "score": "0.58537805", "text": "function sendFriendResponse(message_id, choice) {\n\n var params = { 'id':message_id, 'response':'Accepted Friend Request' };\n WHOAT.notify.topNotify('success', 'You accepted the Friend Request');\n\n WHOAT.networking.postToServerWithAjax('/inbox/'+(message_id)+choice, params, function (response) {\n\n if (response.result === 'success') {\n\n if (choice === '/accept') {\n setTimeout(function () {\n window.location = '/inbox';\n }, 4001);\n\n } else if (choice === '/deny') {\n window.location = '/';\n }\n \n } else if (response.result === 'error') {\n WHOAT.notify.topNotify('error', response.message);\n }\n });\n }", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.58486843", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.58486843", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.58486843", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.58486843", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.58486843", "text": "send() {}", "title": "" }, { "docid": "81f95d6f76d303fd12c059756e3984b5", "score": "0.58486843", "text": "send() {}", "title": "" }, { "docid": "44f647c62a53f44cb877e10bb22e16da", "score": "0.58482003", "text": "function successCB(msg) {\n // Success handling\n success(msg);\n }", "title": "" } ]
8db321b19a7f99d14b69404434017b51
Request Appoinment Validation Click without Fields filled In
[ { "docid": "3782f819d089cf85f0fdf5eb9f937ae6", "score": "0.0", "text": "function submitApptRequest() {\r\n\t\r\n\tvar $aptfirstname = $(\"#aptfirstname\");\r\n\tvar $aptlastname = $(\"#aptlastname\");\r\n\tvar $aptaddress = $(\"#aptaddress\");\r\n\tvar $aptcity = $(\"#aptcity\");\r\n\tvar $aptstate = $(\"#aptstate\");\r\n\tvar $aptzip = $(\"#aptzip\");\r\n\tvar $aptphonenumber = $(\"#aptphonenumber\");\r\n\tvar $aptpetname = $(\"#aptpetname\");\r\n\tvar $aptpettype = $(\"#aptpettype\");\r\n\tvar $aptbreed = $(\"#aptbreed\");\r\n\r\n\r\n\tvar $aptemail = $(\"#aptemail\"); // ------ this is optional \r\n\tvar $aptpetage = $(\"#aptpetage\"); // ------ this is optional \r\n\tvar $aptneutered = $(\"#aptneutered\").is(':checked'); // ------ this is optional \r\n\t\r\n\tfunction submitValidate(element) {\r\n\t\t$(element).parent().addClass(\"has-error\");\r\n\t\t$(element).next(\"span\").addClass(\"glyphicon-remove\");\r\n\t\t$(element).next(\"span\").next().html(\"Required information.\")\r\n\t};\r\n\r\n\r\n\tif (!$aptfirstname.val() || !$aptlastname.val() || !$aptaddress.val() || !$aptcity.val() || $aptstate.val() == \"select\" || !$aptzip.val() || !$aptphonenumber.val() || !$aptpetname.val() || $aptpettype.val() == \"select\" || ($aptpettype.val() == \"Dog\" && $aptbreed.val() == \"select\")) {\r\n\r\n\t\t$(\"#newrequestbutton\").disabled = true;\r\n\r\n\t\tif (!$aptfirstname.val()) {\r\n\t\t\tsubmitValidate($aptfirstname);\r\n\t\t};\r\n\r\n\t\tif (!$aptlastname.val()) {\r\n\t\t\tsubmitValidate($aptlastname);\r\n\t\t};\r\n\r\n\t\tif (!$aptaddress.val()) {\r\n\t\t\tsubmitValidate($aptaddress);\r\n\t\t};\r\n\r\n\t\tif (!$aptcity.val()) {\r\n\t\t\tsubmitValidate($aptcity);\r\n\t\t};\r\n\t\r\n\t\tif ($aptstate.val() == \"select\") {\r\n\t\t\tsubmitValidate($aptstate);\t\r\n\t\t};\r\n\t\t\r\n\t\tif (!$aptzip.val()) {\r\n\t\t\tsubmitValidate($aptzip);\r\n\t\t};\r\n\r\n\t\tif (!$aptphonenumber.val()) {\r\n\t\t\tsubmitValidate($aptphonenumber);\r\n\t\t};\r\n\r\n\t\tif (!$aptpetname.val()) {\r\n\t\t\tsubmitValidate($aptpetname);\r\n\t\t};\r\n\r\n\t\tif ($aptpettype.val() == \"select\") {\r\n\t\t\tsubmitValidate($aptpettype);\r\n\t\t};\r\n\r\n\t\tif ($aptpettype.val() == \"Dog\" && $aptbreed.val() == \"select\") {\r\n\t\t\tsubmitValidate($aptbreed);\r\n\t\t}\r\n\r\n\t} else { \r\n\t\tsendRequest();\r\n\t};\r\n}", "title": "" } ]
[ { "docid": "87fa7a460df0c72a10626f0dc732a1f9", "score": "0.6465116", "text": "function RequiredFieldHandler(eventInfo) {\n var app = UiApp.createApplication();\n var par = eventInfo.parameter;\n var submitButton = app.getElementById('Submit');\n \n var ss = SpreadsheetApp.openById(ssKey);\n var sheet = ss.getSheetByName('Fields');\n var range = sheet.getDataRange();\n var values = range.getValues();\n var lastRow = range.getLastRow();\n \n var allOK = true;\n \n for (var i = 1; i < lastRow; i++) {\n if (values[i][8] == \"X\") {\n var test = par[values[i][2]];\n var badInput = app.getElementById(values[i][2]);\n badInput.setStyleAttribute('borderColor', 'LightGray').setStyleAttribute('borderWidth', '1px');\n if (test == \"\" || undefined) { \n allOK = false;\n badInput.setStyleAttribute('borderColor', 'red').setStyleAttribute('borderWidth', '3px');\n \n }\n }\n }\n \n \n if (allOK == true) {submitButton.setEnabled(true);}\n else if (allOK == false) {submitButton.setEnabled(false);}\n \n return app;\n \n}", "title": "" }, { "docid": "57415f96e957323cb3655ac9994b67e9", "score": "0.6376703", "text": "function validation() {\r\n\t\t\r\n\t}", "title": "" }, { "docid": "b1dcfec145fa535c82245ba5078e3d8f", "score": "0.6335131", "text": "function runValidation() {\n nameVal();\n phoneVal();\n mailVal();\n}", "title": "" }, { "docid": "78fd0c649efe1cb228b01888091ff78d", "score": "0.62824965", "text": "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "title": "" }, { "docid": "c58488d419c13b0cc76124b9cfb5d8b6", "score": "0.623514", "text": "function onClick(e){\n var validateField = function(inputName){\n\n }\n }", "title": "" }, { "docid": "0fb0bf3c35b8b1efaf2d24facea7fb8e", "score": "0.62225294", "text": "preventSubmitUnlessValid() {\n }", "title": "" }, { "docid": "66bc653e2b699ed69296808a02438d7f", "score": "0.6180853", "text": "function appValidation() {\n if ($(\"#registerForm\").length > 0)\n registerFormValid();\n if ($(\"#loginForm\").length > 0)\n loginFormValid();\n if ($(\"#checkForm\").length > 0)\n checkFormValid();\n if ($('#saleForm').length > 0)\n saleFormValid();\n }", "title": "" }, { "docid": "e05017bee7f7e5cb889be1b316f401e4", "score": "0.6165842", "text": "onClick() {\n let self = this;\n self.validateInput('name', (nameStatus) => {\n if (nameStatus) {\n self.validateInput('description', (descriptionStatus) => {\n if (descriptionStatus) {\n self.validateInput('cost', (costStatus) => {\n if (costStatus) {\n self.validateInput('limit', (limitStatus) => {\n if (limitStatus) {\n this.httpRequest();\n }\n });\n }\n });\n }\n });\n }\n });\n }", "title": "" }, { "docid": "4d296c8fae9715b755339d734446e2af", "score": "0.61319953", "text": "onValidationRequest() {\n\n\t\t\t// Simple validation - check if there are any inputs with errors\n\t\t\tvar errors = $(\".sapMInputBaseContentWrapperError\").length,\n\t\t\t\tresult = errors === 0;\n\n\t\t\t// Raise the response event back to the consumer\n\t\t\tsap.ui.getCore().getEventBus().publish(\"codan.zUrgentBoard\", \"validationResult\", {\n\t\t\t\tresult: result\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "600d15e721e22dfdb39ee1b3123fc743", "score": "0.6117735", "text": "function customValidation() {\n debugger;\n \n //Loop through each tactic\n for( var i = 0; i < campaignItem.get('tactics'); i++ ) {\n \n //Switch to the tactic tab\n var tacticLabel = '#tactic-'+(i+1);\n tacticCollectionView.switchTab(tacticLabel);\n \n //Retrieve the View for the currently selected Tactic Model\n var currentTactic = Number(tacticCollectionView.activeTab.slice(-2))-1; //Calculate the View that corresponds to the currently active tactic.\n var thisTacticView = tacticViews[currentTactic];\n \n //Alert user and exit if image files have not been uploaded.\n if( thisTacticView.model.attributes.creatives == \"\" ) {\n alert('Tactic #'+ (i+1) +' is missing the creatives (images) required to run the ad. Please click the \"Upload files...\" button and upload these images.');\n return false;\n }\n \n //Alert user and exit if hyperlocal target was selected but no lat/longs are provided\n if( thisTacticView.model.attributes.geoTarget == \"hyperlocal\" ) {\n if( thisTacticView.model.attributes.hyper_local_lat.length == 0 ) {\n alert('A hyperlocal target for tactic #'+ (i+1) +' has been selected, but no Lat/Long coordinates have been provided. Please submit an address to retrieve Lat/Long coordinates.');\n return false;\n }\n \n //Alert user and exit if geographical target was selected but no zip codes were provided\n } else {\n if( thisTacticView.model.attributes.zipcodes.length == 0 ) {\n alert('A geographical target for tactic #'+ (i+1) +' has been selected, but no zip codes have been provided. Please provide zip codes.');\n return false;\n }\n }\n \n }\n \n //Return true by default.\n return true;\n }", "title": "" }, { "docid": "5f675680175f24affcfbbdcf5e8da640", "score": "0.60632354", "text": "function adminEditExam(){\n // Validate the data in the modal\n}", "title": "" }, { "docid": "ca821379bb973a87f44a68f861da38cd", "score": "0.60459566", "text": "function activerBouttonValidation(){\n\t activerChamp(ID_BOUTON_VALIDER);\n\t $(ID_BOUTON_VALIDER).removeClass(\"disabled\");\n\t $(ID_BOUTON_VALIDER).click(function(){\n\t \tactiverChargementPage();\n\t \tsubmit();\n\t });\n }", "title": "" }, { "docid": "6a90d8c70a2e8dfa168e52a1ef8e3dde", "score": "0.60318714", "text": "function validateButton() {\n\tbutton.disabled = !(!_parameters.params.origin.code === false && !_parameters.params.destination.code === false);\n}", "title": "" }, { "docid": "272125e7c3d31c5972117c47e4c4a755", "score": "0.5963195", "text": "selfValidate(){\n\n }", "title": "" }, { "docid": "43d7a9c6ccc226b088bf4322c9b73bf9", "score": "0.594276", "text": "function inputValidation() {\n let inputValidation = document.getElementById(\"validationBtn\");\n if (inputValidation) { // check si le bouton de validation est bien présent et donc ne renvoie pas null\n inputValidation.addEventListener(\"click\", () => {\n checkInput();\n if (checkMessage != \"\") {\n alert(\"Attention :\" + \"\\n\" + checkMessage);\n checkMessage = \"\";\n }\n else {\n validationBasket(contact);\n };\n });\n };\n}", "title": "" }, { "docid": "a0c3f39755119bb0c266f0cee378d260", "score": "0.59348667", "text": "function validarResaltarAlHacerClick(event) {\r\n}", "title": "" }, { "docid": "935cb808fe8013f5193edcbd9aded61e", "score": "0.5892003", "text": "onRequired()\n {\n //\n }", "title": "" }, { "docid": "4366a9ba415fc029c33f82149df3d3e2", "score": "0.5886952", "text": "runValidation() {\n try {\n var formItem = this.scope['exprForm']['literal'];\n if (formItem.$viewValue) {\n formItem.$setViewValue(formItem.$viewValue);\n formItem.$$parseAndValidate();\n }\n } catch (e) {\n }\n }", "title": "" }, { "docid": "d1c724b0e72326f8eace1b9eb8620cb0", "score": "0.58739984", "text": "function(event) {\n\t\tvar isValid = true;\n\t\t\n\t\tvar email = $(\"#email_address\").va();\n\t\tif (email == \"\") {\n\t\t\t$(\"#email_address\").next().text(\"This field is required.\");\n\t\t\tisValid = false;\n\t\t\t}\n\t\t\t\n\t\tvar full_name = $(\"#full_name_id\").val().trim();\n\t\tif (full_name == \"\") {\n\t\t $(\"#full_name_id\").next().text(\"This field is required.\");\n\t\t\tisValid = false;\n\t\t\t}\n\t \n\talert( \"Missing a field b \");\n\t\t\t\t \n//\tif (isValid == false) { \n\t\talert( \"Missing email address or full name\");\n\t\tevent.preventDefault();\n\t//\t}\t\t\t \n\t}", "title": "" }, { "docid": "0310c64b87756a5c3bf64d7bd2a369a7", "score": "0.5865946", "text": "function checkForm(){\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){\n btn.disabled = false; //enable submit btn if form filled correctly\n }else{\n btn.disabled = true;\n }\n }", "title": "" }, { "docid": "86449a1e323996a738204b4e67aafdd2", "score": "0.58639956", "text": "function checkEmptyFields(){\n \t\n \t\n\t\t\ttry {\n\t\t\t\tif (document.getElementById(\"source-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select Source\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (document.getElementById(\"destination-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select Destination\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\tif (document.getElementById(\"dropPoint-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select DropPoint\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (document.getElementById(\"timeSlot-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select TimeSlot\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\tbookARideButtonClicked();\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\talert(e.message);\n\t\t\t\tjsExceptionHandling(e);\n\t\t\t}\n }", "title": "" }, { "docid": "31e67035e3f43366753802840a236483", "score": "0.5861999", "text": "function handleRequired(field) {\n var currentValue = field.val();\n field.val(currentValue);\n if (currentValue != '') {\n AJS.$(\"#macro-browser-dialog button.ok\").prop(\"disabled\", false);\n } else {\n AJS.$(\"#macro-browser-dialog button.ok\").prop(\"disabled\", true);\n }\n }", "title": "" }, { "docid": "1f3e297c24df839058afe2a340e2c663", "score": "0.58585095", "text": "function validateCheck() {\n\n setActivityCardRules($scope.cardRules.value());\n setSpecialUsePackages($scope.specialPackages.value());\n generateCodeAuto();\n service.validate($scope.activity).success(function () {\n $scope.save();\n }).error(function (error) {\n console.log('error -> ', error);\n });\n }", "title": "" }, { "docid": "103b5250deceb159101db453f166451d", "score": "0.5856138", "text": "function enableSubmitButton() {\n show(\"validate\");\n hide(\"formIsUnvalide\");\n}", "title": "" }, { "docid": "4864b39cce8e4fefa2739fe6b668d474", "score": "0.58499736", "text": "function submitButtonPressed()\n{\n if(validateColumn())\n submit();\n \n}", "title": "" }, { "docid": "54f348ab877de4fe620d4c2677e4501f", "score": "0.58466005", "text": "function check(e) {\n if (e.val() !== '') {\n e.closest(target.options.errorElement).removeClass(target.options.errorClass);\n // if we are using aria tags to hide content from screenreaders\n if (target.options.useAria) {\n e.closest(target.options.errorElement).find(target.options.errorMessageElement).attr('aria-hidden', true);\n }\n } else {\n e.closest(target.options.errorElement).addClass(target.options.errorClass);\n // if we are using aria tags to hide content from screenreaders\n if (target.options.useAria) {\n e.closest(target.options.errorElement).find(target.options.errorMessageElement).attr('aria-hidden', false);\n }\n }\n }", "title": "" }, { "docid": "f9870586126e22a83ebcfa7a5ebd04ef", "score": "0.5831547", "text": "hideAllValidations() {\n const inputs = this.inputs();\n for (let i = 0; i < inputs.length; i++) {\n this.hideValidationFor(dev().assertElement(inputs[i]));\n }\n }", "title": "" }, { "docid": "803ad840b02483387a5da699a4cab381", "score": "0.58259267", "text": "function skipValidation() { \n unsaved = false;\n checkChange(unsaved);\n }", "title": "" }, { "docid": "11f16c033eddd43ee1e0224eac05a03b", "score": "0.5822011", "text": "function checkFields(){\n if (!first_name || !last_name || !email){\n setDisableButton('disable_btn');\n }else{\n setDisableButton('');\n }\n }", "title": "" }, { "docid": "39d162a72a1da303aeec770a5dddfd63", "score": "0.58079237", "text": "function onXareltoSubmit() {\n //first clear error element\n var t = document.getElementById(\"errorElement\");\n t.innerHTML=\"\";\n if (!validateName()) {\n displayFormErrors(\"name\");\n return false;\n } else if (!validateZipCode()){\n displayFormErrors(\"zip\");\n return false;\n } else if (!validateTelephone()){\n displayFormErrors(\"telephone\");\n return false;\n } else if (!validateEmail()) {\n displayFormErrors(\"email\");\n return false;\n } else if(!validateConsent()){\n displayFormErrors(\"consent\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "11279a1e017cb0809c442d86194ba056", "score": "0.5805923", "text": "function WhenISubmitFormWithoutFillingAnythingOut() {\n cy.get(\"button\").contains(\"Add trust\").click();\n }", "title": "" }, { "docid": "9c6bfa37adbbc87ae6439c3a0592f79a", "score": "0.5804378", "text": "function checkFields() {\n\t$('#appointmentInput > input').keyup(function() {\n\n var empty = false;\n $('#appointmentInput > input').each(function() {\n if ($(this).val() == '') {\n empty = true;\n }\n });\n \n if (!empty) {\n \t$('#saveAppointment').removeAttr('disabled'); \n }\n });\n}", "title": "" }, { "docid": "3a4363f63f670bf29f476c01d503c917", "score": "0.5799318", "text": "function validateCheckForAffil(){\n if (!checkAffilName.value) {\n atmWindow.document.getElementById(\"checkAffilNameError_atm\").style.display = \"block\";\n } else {\n atmWindow.document.getElementById(\"checkAffilNameError_atm\").style.display = \"none\";\n checkForAffiliate(checkAffilName.value);\n }\n }", "title": "" }, { "docid": "75a8824bea85950d48e28c70c1f19646", "score": "0.57974964", "text": "onClick() {\n this.validateInput('weight', (weightStatus) => {\n if (weightStatus) {\n this.validateInput('pantsSize', (pantsSizeStatus) => {\n if (pantsSizeStatus) {\n this.validateInput('chest', (chestStatus) => {\n if (chestStatus) {\n this.validateInput('waist', (waistStatus) => {\n if (waistStatus) {\n this.validateInput('biceps', (bicepsStatus) => {\n this.httpRequest();\n });\n }\n });\n }\n });\n }\n });\n }\n });\n }", "title": "" }, { "docid": "93e06a0c921cc31cc908940e3d0afb4a", "score": "0.57963216", "text": "static validateOperationNotBlank(pageClientAPI, dict) {\n\n if (!libThis.evalOperationIsEmpty(dict)) {\n return Promise.resolve(true);\n } else {\n let message = pageClientAPI.localizeText('field_is_required');\n libCom.setInlineControlError(pageClientAPI, dict.OperationLstPkr, message);\n dict.InlineErrorsExist = true;\n return Promise.reject(false);\n }\n }", "title": "" }, { "docid": "43dce10cc77df90f5564b4208ffaa251", "score": "0.5778286", "text": "function validateAffilFields_atm(event) {\n try {\n \n if (!newAffil_Name.value) {\n atmWindow.document.getElementById(\"affilNameError_atm\").style.display = \"block\";\n } else {\n atmWindow.document.getElementById(\"affilNameError_atm\").style.display = \"none\";\n }\n if (!newAffil_Email.value) {\n atmWindow.document.getElementById(\"affilEmailError_atm\").style.display = \"block\";\n } else {\n atmWindow.document.getElementById(\"affilEmailError_atm\").style.display = \"none\";\n }\n var orgIsSet = false;\n if (!newAffil_Org.value) {\n atmWindow.document.getElementById(\"affilOrgError_atm\").style.display = \"block\";\n } else if (newAffil_Org.value == \"neworg\" && !newAffil_OrgCustom.value) {\n atmWindow.document.getElementById(\"affilOrgError_atm\").style.display = \"block\";\n } else {\n atmWindow.document.getElementById(\"affilOrgError_atm\").style.display = \"none\";\n orgIsSet = true;\n }\n if (newAffil_Name.value && newAffil_Email.value && orgIsSet ) {\n let button = event.target;\n let orgValue = newAffil_OrgCustom.value ? newAffil_OrgCustom.value : newAffil_Org.value;\n let isNewOrg = newAffil_OrgCustom.value ? true : false;\n if (button.id == \"addNewAffiliate\" ){\n addNewAffilRow(newAffil_Name.value, orgValue, newAffil_Email.value, isNewOrg);\n } else {\n editAffilRow(newAffil_Name.value, orgValue, newAffil_Email.value);\n }\n }\n } catch (err) {\n atmWindow.document.getElementById(\"errorMessageForm\").innerHTML = err;\n }\n }", "title": "" }, { "docid": "363662f4723dd793ea7fb5c789ebce8f", "score": "0.57676864", "text": "function customValidation(input) { \n}", "title": "" }, { "docid": "81e14fafe72de1128630e38b7ba45c63", "score": "0.57578903", "text": "function checkFilled(){\n let input_item = document.getElementsByClassName('input-item');\n var count = 0;\n for(var i = 0; i < input_item.length; i++){\n if(input_item[i].value != \"\")\n count++;\n }\n if(count > 0){\n document.getElementById('submit__button').click();\n } else {\n triggerWarning();\n triggerModal('anything');\n }\n}", "title": "" }, { "docid": "f4e6a2346e9d5acd51499ebb3729eee3", "score": "0.57550365", "text": "function validateActionCode()\n{\n\tif (emssObjInstance.emssObj.filterSelect) \n\t{\n\t\tif (NonSpace(self.main.document.getElementById(\"actionsSelect\").value) == 0) \n\t\t{\n\t\t\tsetRequiredField(self.main.document.getElementById(\"actionsSelect\"), getSeaPhrase(\"SELECT_PERSONNEL_ACTION\",\"ESS\"));\n\t\t\treturn false;\n\t\t} \n\t\telse\n\t\t\tclearRequiredField(self.main.document.getElementById(\"actionsSelect\"));\n\t} \n\telse \n\t{\n\t\tif (self.main.document.getElementById(\"actionsSelect\").selectedIndex <= 0) \n\t\t{\n\t\t\tvar actionsSelect = self.main.document.getElementById(\"actionsSelect\") || null;\n\t\t\tsetRequiredField(self.main.document.getElementById(\"actionsCell\"), getSeaPhrase(\"SELECT_PERSONNEL_ACTION\",\"ESS\"), actionsSelect);\n\t\t\treturn false;\n\t\t} \n\t\telse\n\t\t\tclearRequiredField(self.main.document.getElementById(\"actionsCell\"));\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "aaceba936b63c10b96ed9cab059ea297", "score": "0.5745817", "text": "function WhenISubmitFormWithoutFillingAnythingOut() {\n cy.get(\"button\").contains(\"Add hospital\").click();\n }", "title": "" }, { "docid": "6fbb04683a953ec9e2dd50d5dbc6a3f4", "score": "0.57322395", "text": "function showValidityHandler(){\n\n if($('#inputIng').val().trim().length > 0){\n $('.validity').removeAttr('hidden');\n }\n\n }", "title": "" }, { "docid": "8a7d1778165aa76920c095ab42c68784", "score": "0.5718158", "text": "whenValid() {\n\n }", "title": "" }, { "docid": "a7665975e986d139200a32bb65b44c5d", "score": "0.57167274", "text": "onSubmitData() {\n if (this.state.email == '' || this.state.password == '')\n alert(\"Please fill out all fields!\");\n else if(this.state.email != '' && this.state.password != '' && this.validInput(this.state.email))\n Actions.reset('dashBoard'); // Navigate to dashBoard screen\n }", "title": "" }, { "docid": "c297d123dd05ff48f43b6d86118813d9", "score": "0.5711386", "text": "function validation(ev) {\n ev.preventDefault();\n\n if (\n inputName.value.length > 1 &&\n inputJob.value.length > 1 &&\n inputEmail.value.length > 1 &&\n inputPhone.value.length > 1 &&\n inputLinkedin.value.length > 1 &&\n inputGithub.value.length > 1\n ) {\n textShare.classList.remove('hidden');\n formButton.classList.add('disabled');\n formButton.classList.remove('share__content__button');\n // imgButton.classList.add('img-disabled');\n // imgButton.classList.remove('action__upload-btn');\n } else {\n alert('No has introducido ningún dato');\n }\n\n sendRequest(formData);\n}", "title": "" }, { "docid": "0d387f5abe23741609c1dcbd05ec130e", "score": "0.5700677", "text": "function checkValidity() {\n if (invalidWidgetIds.length > 0) {\n msgService.showInfoRight(localization.getString('emailbuilder.error.unfilledrequiredproperties'));\n } else {\n msgService.hideInfoRight();\n }\n }", "title": "" }, { "docid": "21cbea2056046043ded5d5fb89e62671", "score": "0.56810623", "text": "function handleOnClickCallback() {\n if (status.applied) {\n sg.tracker.push(\"ValidationOptionUnapply\", null, { ValidationOption: properties.validationOption });\n unapply();\n } else {\n sg.tracker.push(\"ValidationOptionApply\", null, { ValidationOption: properties.validationOption });\n apply();\n }\n\n sg.cardFilter.update();\n }", "title": "" }, { "docid": "bde2c5ce4ee53daa5eae33c07fdfcaf7", "score": "0.567753", "text": "@action\n async validate() {\n if (this.args.parent === undefined) {\n if (this.args.alone) return; // if input is alone ignore\n }\n\n let value = this.args.value || this.args.selected;\n const res = await this.parent.state.validationSchema.validationFor(this.name,value,this);\n this.parent.updateState(); \n this.error = res;\n }", "title": "" }, { "docid": "eba2791b9bfb9303a1dab9b6e3c50ffc", "score": "0.566531", "text": "validateInit() {\n this.runValidation(true);\n }", "title": "" }, { "docid": "b9b12e99683599dc65b5df7738faf7ca", "score": "0.5657355", "text": "function skipValidation() {\n elem = false;\n }", "title": "" }, { "docid": "78d254aff4782040625c4746a7cf359c", "score": "0.5642999", "text": "function AddEmail_Click() {\n var isValidItem = true;\n if ($(\"#Email\").val().trim() == '') {\n isValidItem = false;\n $(\"#Email\").siblings('span.error').css('visibility', 'visible');\n } else {\n $(\"#Email\").siblings('span.error').css('visibility', 'hidden');\n }\n\n if (isValidItem) {\n var vPrincipal;\n if ($(\"#EmailPrincipal\").is(':checked')) {\n vPrincipal = true;\n } else {\n vPrincipal = false;\n }\n\n emailItems.Agregar({\n EmailId: 0,\n Direccion: $(\"#Email\").val().trim(),\n Principal: vPrincipal,\n });\n\n $(\"#Email\").val('').focus();\n $(\"#EmailPrincipal\").attr('checked', false);\n\n }\n\n MostrarEmails(true);\n}", "title": "" }, { "docid": "2b0066b436920c813ce0b290d951b23c", "score": "0.5639634", "text": "function decisionSubmit() {\n\n // press button\n $('input[value=\"send\"]').select().click();\n\n // disable all input while sending\n $(\"input\").prop(\"disabled\", true);\n\n}", "title": "" }, { "docid": "51af9c3c5fff02e61238f6ab5db165dd", "score": "0.56373435", "text": "function validateActivities(e){\n\tif ($(\".activities input:checked\").length===0){\n\t\te.preventDefault();\n\t\t$( \"<p class='error no-activities'>Please select at least 1 activity.</p>\" ).insertAfter($(\".activities legend\"));\n\t} \n}", "title": "" }, { "docid": "6dfd43169ef54c4f5d280aadcaf53831", "score": "0.56331015", "text": "function submit(){\n if(verifyFields()){\n alert(\"Submitted\");\n } else {\n alert(\"Please fill out all fields!!\");\n }\n}", "title": "" }, { "docid": "6b4ca57e7c25e173079017445eb3515b", "score": "0.5628062", "text": "function removeValidationApproveReject() {\n var textEntered = $(\"#actionable-skilltext-area\").val();\n if (!textEntered || textEntered.trim().length < 1) {\n $(\"#lbl_ActionableCommentErrorMessage\").show();\n }\n else {\n $(\"#lbl_ActionableCommentErrorMessage\").hide();\n }\n}", "title": "" }, { "docid": "ce802a476d2306127dbcd45db4875290", "score": "0.5622524", "text": "function validateInput() {\n if (!keyCodeValid || !accountCodeValid || ($(\"#keyCodeCP\").val() == \"\" && isAcctAllEmpty()) ||\n $(\"#desc\").val() == \"\" || $(\"#instruct\").val() == \"\" || $(\"#instruct\").val().length > 65535) {\n $(\"#submitCP\").button(\"option\", \"disabled\", true);\n } else {\n $(\"#submitCP\").button(\"option\", \"disabled\", false);\n }\n }", "title": "" }, { "docid": "73479a201ba8c9391fc6ba104e9eeba0", "score": "0.56190366", "text": "validateInscription() {\n \n }", "title": "" }, { "docid": "d1d817f5e3de6c1a0a26a38c2239b7bc", "score": "0.5618701", "text": "function validate(e) {\n let id = e.attributes[\"id\"].nodeValue;\n let sb = document.getElementById(\"submitButton\");\n\n if (id == \"userName\") {\n userNameError.innerText = isValid(e.value, 0);\n //console.log(e.value);\n }\n if (id == \"password\") {\n passwordError.innerText = isValid(e.value, 1);\n //console.log(e.value);\n }\n if (uFlag && pFlag) {\n sb.disabled = false;\n } else {\n sb.disabled = true;\n }\n}", "title": "" }, { "docid": "c3e3c312e229bfbe97613db1e032eca0", "score": "0.5610609", "text": "validate() {}", "title": "" }, { "docid": "1dfdcbac04fe50771f26a82657a42e6c", "score": "0.56099445", "text": "function startInteractValidator()\n{\n interactsValidator(ig.global.data.interacts);\n}", "title": "" }, { "docid": "1e4a7404b868f5f3c850d9354112817b", "score": "0.56074125", "text": "function validateAllOptionsToAllowSubmit() {\r\n // if suitable array and criteria conditions align ...\r\n\r\n /*\r\n selectionIndexes: {\r\n ethnicities: [],\r\n ageBands: [],\r\n genders: [],\r\n nationalities: [],\r\n religions: [],\r\n health: [],\r\n qualifications: [],\r\n },\r\n */\r\n\r\n if (\r\n aleph.selectionIndexes.ethnicities &&\r\n aleph.selectionIndexes.ethnicities.length > 0 &&\r\n aleph.selectionIndexes.ageBands &&\r\n aleph.selectionIndexes.ageBands.length > 0 &&\r\n aleph.selectionIndexes.genders &&\r\n aleph.selectionIndexes.genders.length > 0 &&\r\n aleph.selectionIndexes.nationalities &&\r\n aleph.selectionIndexes.nationalities.length > 0 &&\r\n aleph.selectionIndexes.religions &&\r\n aleph.selectionIndexes.religions.length > 0 &&\r\n aleph.selectionIndexes.health &&\r\n aleph.selectionIndexes.health.length > 0 &&\r\n aleph.selectionIndexes.qualifications &&\r\n aleph.selectionIndexes.qualifications.length > 0\r\n ) {\r\n // enable reset and submit buttons\r\n document.getElementById(\"line-submit\").disabled = false;\r\n document.getElementById(\"line-clear\").disabled = false;\r\n } else {\r\n // disable reset and submit buttons\r\n document.getElementById(\"line-submit\").disabled = true;\r\n document.getElementById(\"line-clear\").disabled = true;\r\n }\r\n\r\n return;\r\n}", "title": "" }, { "docid": "b00565e140f16874b751a2e72d23c47a", "score": "0.5604385", "text": "function checkRequired() {\n let canAdvance = true;\n let curPage = document.getElementById('calendar-wizard').currentPage;\n if (curPage) {\n let eList = curPage.getElementsByAttribute('required', 'true');\n for (let i = 0; i < eList.length && canAdvance; ++i) {\n canAdvance = (eList[i].value != \"\");\n }\n\n let notificationbox = document.getElementById(\"location-notifications\");\n if (canAdvance && document.getElementById(\"calendar-uri\").value &&\n curPage.pageid == \"locationPage\") {\n let [reason,] = parseUri(document.getElementById(\"calendar-uri\").value);\n canAdvance = (reason == errorConstants.SUCCESS);\n setNotification(reason);\n } else {\n notificationbox.removeAllNotifications();\n }\n document.getElementById('calendar-wizard').canAdvance = canAdvance;\n }\n}", "title": "" }, { "docid": "03d232e206ffdec14764a4b50cd3c13b", "score": "0.560102", "text": "validateForm() {\r\n if(this.getInputVal(this.inputBill) !== \"\" && \r\n this.getInputVal(this.inputPeople) !== \"\" &&\r\n (this.getInputVal(this.inputCustom) !== \"\" || \r\n this.percentageBtns.some(btn => btn.classList.contains(\"active\")))) \r\n {\r\n this.disableReset(false);\r\n return true;\r\n }\r\n else {\r\n this.disableReset(true);\r\n this.displayResult(\"__.__\", \"__.__\");\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "6dbe9420fdd1f92a91fb45f6f9d44195", "score": "0.5599769", "text": "function WhenISubmitFormWithoutFillingAnythingOut() {\n cy.get(\"button\").contains(\"Add ward\").click();\n }", "title": "" }, { "docid": "e4bd25826f817a67479fa113d2e322b4", "score": "0.5598794", "text": "function valid_application_form(){\n\t// Verifies that the name is filled\n\tif(document.getElementById('name').value == \"\"){\n\t\talert('Veuillez saisir le nom.');\n\t\treturn false;\n\t}\n\t// Verifies that the description is filled\n\tif(document.getElementById('description').value == \"\"){\n\t\talert('Veuillez saisir la description.');\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "02ea34665c57181f80933b8d5b902ea1", "score": "0.55914044", "text": "function main()\r{\r\tif(isNeedToValidateReqDocument(capIDModel,processCode, stepNum, processID, taskStatus))\r\t{\t\r\t\tisRequiredDocument();\r\t}\r}", "title": "" }, { "docid": "46dfbd16797a4770b224c29cdc6bb6b5", "score": "0.5590008", "text": "function IsvalidForm() {\n ///Apply Bootstrap validation with Requird Controls in Input Form\n var result = jQuery('#InputForm').validationEngine('validate', { promptPosition: 'topRight: -20', validateNonVisibleFields: true, autoPositionUpdate: true });\n ///If all requird Information is Given\n if (result) {\n ///If all requird Information is Given then return true\n return true;\n }\n ///If all requird Information is Given then return false\n return false;\n}", "title": "" }, { "docid": "7bcc50100ee749b0e6770644cacb03a1", "score": "0.55871654", "text": "function validateInput(){\n\n}", "title": "" }, { "docid": "bb93fc522b8fcacbd21a8ad311f5ef72", "score": "0.55799675", "text": "function validateButton(){\n if(validateEmail() == true && validateName() == true && validateMessage() == true){\n $('.sendButton').removeAttr('disabled');\n }\n }", "title": "" }, { "docid": "13a0a43a0f1ddc94d8500f578600279e", "score": "0.55790347", "text": "function bindValidateContractLeaseInformationForm() {\n var leaseAgreementNo = $('#txtLeaseAgreementNo');\n var financeCompany = $('#txtFinanceCompany');\n var leaseStartDate = $('#txtLeaseStartDate');\n// var leaseSubsidiary = $('#txtLeaseSubsidiary');\n var leasePeriod = $('#txtLeasePeriod');\n var leaseExpiryDate = $('#txtLeaseExpiryDate');\n \n \n if(leaseAgreementNo.val() === '') {\n alert('Please Enter Contract Lease Agreement No!');\n leaseTab.click();\n scrollTo(leaseAgreementNo.attr('id'));\n leaseAgreementNo.focus();\n return false;\n }\n \n if(financeCompany.val() === '') {\n alert('Please Enter Contract Finance Company!');\n leaseTab.click();\n scrollTo(financeCompany.attr('id'));\n financeCompany.focus();\n return false;\n }\n \n// if(leaseSubsidiary.val() === '') {\n// alert('Please Enter Contract Lease Subsidiary!');\n// leaseTab.click();\n// scrollTo(leaseSubsidiary.attr('id'));\n// leaseSubsidiary.focus();\n// return false;\n// }\n \n if(leaseStartDate.val() === '') {\n alert('Please Enter Contract Lease Start Date!');\n leaseTab.click();\n scrollTo(leaseStartDate.attr('id'));\n leaseStartDate.focus();\n return false;\n }\n \n if(leaseExpiryDate.val() === '') {\n alert('Please Enter Contract Lease Expiry Date!');\n leaseTab.click();\n scrollTo(leaseExpiryDate.attr('id'));\n leaseExpiryDate.focus();\n return false;\n }\n \n if(leasePeriod.val() === '') {\n alert('Please Enter Contract Lease Period!');\n leaseTab.click();\n scrollTo(leasePeriod.attr('id'));\n leasePeriod.focus();\n return false;\n }\n \n return true;\n}", "title": "" }, { "docid": "2aa15598b329b34f4ac5585da4d4f14b", "score": "0.5578255", "text": "_validate() {\n\t}", "title": "" }, { "docid": "935d31cce63dec6e951d0cf7c18932b6", "score": "0.55749905", "text": "function onVerify($element) {\n return function () {\n return function (response) {\n if (!response || response.length == 0) {\n return;\n };\n\n $element.find(\".Form__Element__ValidationError\").hide();\n }\n }($element);\n }", "title": "" }, { "docid": "b75751a6620031aedbb7f3c069d5aebd", "score": "0.55718434", "text": "function verify_inputs(){\n if(document.getElementById(\"Split_By\").value == ''){\n return false;\n }\n if(document.getElementById(\"Strength\").value == ''){\n return false;\n }\n if(document.getElementById(\"Venue\").value == ''){\n return false;\n }\n if(document.getElementById(\"season_type\").value == ''){\n return false;\n }\n if(document.getElementById(\"adjustmentButton\").value == ''){\n return false;\n }\n\n return true\n }", "title": "" }, { "docid": "94de75ac565ab5866fa28a60376cd0ef", "score": "0.55689716", "text": "function getValidation(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "title": "" }, { "docid": "4d36a0d59423789a3809b9c5906be678", "score": "0.55679446", "text": "function CheckValidationBeforeClose(element) {\r\n if (Page_ClientValidate())\r\n CloseModalDialog(element);\r\n }", "title": "" }, { "docid": "9dd2c1744f2506c6cd16224c775dd47a", "score": "0.5567474", "text": "function checkReqFields() {\n \n}", "title": "" }, { "docid": "195cadc6407a2bf75e2330f748b7ff43", "score": "0.55648124", "text": "function checkForm(){\n //if all outcomes are true, this means all inputs have correct data\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){ //if all inputs filled correctly, allow user to send form\n btn.disabled = false; //enable submit btn\n }else{\n btn.disabled = true;\n }\n }", "title": "" }, { "docid": "9a67a81c203ba5e7f37a27fc80e463ec", "score": "0.55618334", "text": "function AttendanceRequiredFieldHandler(frm_data, action, required_class) {\n var response = true;\n if (frm_data.timetable.length == 0) {\n toastr.error('Timetable Required!');\n response = false;\n }\n if (frm_data.comment.length == 0) {\n toastr.error('Comment Required!');\n response = false;\n }\n if (action === 1) { //Actions only in Save\n\n }\n $(required_class).each(function () {\n if ($(this).val().length === 0) {\n// $(this).addClass(\"has-error\");\n } else {\n// $(this).removeClass(\"has-error\");\n }\n });\n return response;\n}", "title": "" }, { "docid": "7f40ff329cdd5a379e46ce31fbbacefe", "score": "0.5561278", "text": "function campsOk(){\n if(event.target.value != \"\"){\n event.target.classList.remove(\"invalid\");\n return true;\n }\n }", "title": "" }, { "docid": "67818645705b496cd95f5a9fa4dfdeef", "score": "0.5559302", "text": "_initValidateJs() {\n //bind custom function here\n\n }", "title": "" }, { "docid": "055bf793d89cb2abb0d2a4df2eda6fdd", "score": "0.5549618", "text": "function BtnActionRequestFST(action) {\n if (IsValidForm() == 0) {\n if (IsValidDate() == 0) {\n if (IsValidLength() == 0) {\n if (IsValidTextbox() == 0) {\n CheckDataRequestFST(action);\n }\n }\n }\n }\n}", "title": "" }, { "docid": "b63ba690bd7db9f2183b33fb851a54e0", "score": "0.5545104", "text": "validateInputs() {\n let inps = [].concat(\n this.queryAll(\"lightning-combobox\"),\n this.queryAll(\"lightning-input-field\"),\n );\n return inps.filter(inp => !inp.reportValidity()).length === 0;\n }", "title": "" }, { "docid": "3e3eddbc7c811736917ff8cefe33cd46", "score": "0.55423176", "text": "checkButton()\n {\n if(this.imeModel==\"\" || this.emailModel==\"\" || this.telefonModel==\"\")\n {\n this.butShow=false;\n }\n else\n {\n this.butShow=true;\n }\n }", "title": "" }, { "docid": "93e7c6da8d223cc081a8ed8231e08684", "score": "0.553989", "text": "function nullChkValues() {\n\n\tif (document.getElementById('checkTitle').value == '') {\n\t\tdocument.getElementById('checkTitle').focus();\n\t\treturn true;\n\t}\n\tif (document.getElementById('checkResults').value == '') {\n\t\tdocument.getElementById('checkResults').focus();\n\t\treturn true;\n\t\n\t}\n\tif (document.getElementById('checkLabel').value == '') {\n\t\tdocument.getElementById('checkLabel').focus();\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "title": "" }, { "docid": "5ccf8f527056a486be3ef0c01ec60b3a", "score": "0.55355227", "text": "doCustomValidation(attribute) {\n\t\tswitch (attribute) {\n\t\t\tdefault: return true;\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "499e27a35f1bd1f45b1443af5134605c", "score": "0.5526978", "text": "function submitData() {\r\n let valName = validateFullName();\r\n let valEmail = validateEmail();\r\n let valUsrName = validateUserName();\r\n let valPassword = validatePassword();\r\n let valCPwd = validateCPassword();\r\n let valGender = validateGender();\r\n let valQty = validateQty();\r\n let valAddress = validateAddress();\r\n let valChkAgree = validateAgreement();\r\n let allValidated = valName && valEmail && valUsrName && valPassword && valCPwd && valGender && valQty && valAddress && valChkAgree;\r\n console.log(valName);\r\n if (allValidated) {\r\n alert(\"Game bought\");\r\n document.getElementById(\"regisForm\").reset();\r\n } else {\r\n alert(\"Error detected\");\r\n }\r\n}", "title": "" }, { "docid": "29d82431dbc020b3b97eb6e9dfea9c38", "score": "0.5519908", "text": "function validateActivities(field, value) {\n const hint = document.getElementById('activities-hint');\n if (value === 0) {\n showError(field, hint);\n } else {\n hideError(field, hint);\n }\n}", "title": "" }, { "docid": "b6a7e880624a65e2521261e031e6c0b7", "score": "0.55176675", "text": "darClick(evt) {\n console.log('Valor de la entrada: ' + evt.target.value);\n\n const todoValido = [...this.template.querySelectorAll('lightning-input')].reduce((validado, entradasFaltantes) => {\n entradasFaltantes.reportValidity();\n return validado && entradasFaltantes.checkValidity();\n }, true);\n if (todoValido) {\n \n //Método de inserción de contacto\n this.insertarContacto(); \n \n //Reedirecciona a página de agradecimiento\n\n window.location.replace(\"https://donor-uady.cs41.force.com/donaciones/s/thank-you-page\");\n \n\n } else {\n alert('Reintenta de nuevo..');\n }\n}", "title": "" }, { "docid": "4f440f80576b9f735c1a614cd8ade3a0", "score": "0.55151147", "text": "function Validate(){}", "title": "" }, { "docid": "4f440f80576b9f735c1a614cd8ade3a0", "score": "0.55151147", "text": "function Validate(){}", "title": "" }, { "docid": "1a87645adf1af6a4f77d82237270da71", "score": "0.5509017", "text": "function nullValues() {\n\n\tif (document.getElementById('udAttackTitle').value == '') {\n\t\tdocument.getElementById('udAttackTitle').focus();\n\t\treturn true;\n\t}\n\tif (document.getElementById('attackCode').value == '') {\n\t\tdocument.getElementById('attackCode').focus();\n\t\treturn true;\n\t\n\t}\n\tif (document.getElementById('description').value == '') {\n\t\tdocument.getElementById('description').focus();\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "title": "" }, { "docid": "b98216823a4a10e88514a63269db7aac", "score": "0.550209", "text": "preValidate() { }", "title": "" }, { "docid": "090f7a9907099ee3a3b265209b76a108", "score": "0.54982764", "text": "function check_paper_search_form() {\n \n}", "title": "" }, { "docid": "131ae8459575a8e4c18115e6592191c8", "score": "0.54952735", "text": "function checkDefinitionFields() {\n const requiredFields = Array.from(document.querySelectorAll(\".validate\"))\n const btn = document.querySelector(\".submit-btn\");\n const dropdown = document.querySelector(\"#game_name\")\n const gameOptions = Array.from(dropdown.childNodes)\n const validInputs = requiredFields.every(field => field.classList.contains(\"valid\"))\n \n if (validInputs && gameOptions[1].selected == false) {\n btn.classList.remove(\"disabled\");\n } else {\n btn.classList.add(\"disabled\");\n }\n}", "title": "" }, { "docid": "445adf30445f14868fc8d9e5a0fc8659", "score": "0.5486231", "text": "function validateAchContentEnableButton1(){\n\t// alert(\"doone\");\n\tvar title = document.getElementById(\"ach_title\");\n\t// var photofield = document.getElementById(\"achPhotoField\");\n\t// var button = document.getElementById(\"ach_submit\");\n\n\tif(title.value.trim().length > 100){\n\t\ttitle.style.border = \"1px solid red\";\n\t\t$(\"#achTitleError\").text(\"Long title not allowed ...\");\n\t}else if(title.value.trim().length < 1){\n\t\ttitle.style.border = \"1px solid red\";\n\t\t$(\"#achTitleError\").text(\"The title can not be empty ...\");\n\t\tevent.preventDefault();\n\t}else{\n\t\ttitle.style.border = \"1px solid #ced4da\";\n\t\t$(\"#achTitleError\").text(\"\");\n\t}\n}", "title": "" }, { "docid": "c4a0cd5f821c26e6916fe5ae1a2529be", "score": "0.5481047", "text": "function validateAddOpForm() {\n // Check inputs\n return pageDialog.amount.value.length > 0 && pageDialog.desc.value.length > 0\n }", "title": "" }, { "docid": "55cab9950b752a16012a3277c11a12f6", "score": "0.5480593", "text": "beforeValidation(callback) {\n\t\tcallback();\n\t}", "title": "" }, { "docid": "179fe9ea35566c1e98f020219468e0ed", "score": "0.54771537", "text": "function checkOkActivation() {\r\n\r\n var geoForm = $('insertGeoForm');\r\n\r\n var location = $('insertGeoLocation').value;\r\n\r\n $('geoOkButton').disabled = location.length == 0;\r\n\r\n}", "title": "" }, { "docid": "cbae26619da357d28aee5acc81882569", "score": "0.54771185", "text": "function validateSearch(e) {\n\n //Get data input text \n\n e.preventDefault();//not reload page\n}", "title": "" }, { "docid": "a422de88677fb22a4c7008adb32fed9c", "score": "0.54758066", "text": "function inlineBasicsValidations() {\n var translation = $translate.instant(['campaign_basics_currency_prompt', 'campaign_basics_uploadimage_prompt', 'campaign_basics_selectcategory_prompt', 'campaign_basics_description_prompt', 'campaign_basics_selectstartdate_prompt', 'campaign_basics_select_end_date_prompt']);\n if (!$scope.campaign.currency_id) {\n $('.select-error').remove();\n $('#campaign-currency-field').append('<div class=\"select-error ui red pointing prompt label transition visible\">' + translation.campaign_basics_currency_prompt + '</div>');\n $('#campaign-currency-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if (!$scope.currency_options) {;\n $('.select-error').remove();\n $('#campaign-currency-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n if (!$('#featured-img-field .ui.image').hasClass('image-uploaded') && (typeof $scope.hideCampaignImageField == 'undefined' || !$scope.hideCampaignImageField)) {\n $('#featured-img-field .select-error').remove();\n $('#featured-img-field').append('<div class=\"select-error ui red pointing prompt label transition visible\">' + translation.campaign_basics_uploadimage_prompt + '</div>');\n $('#featured-img-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if (!$('#category-field .select2-choices li').hasClass('select2-search-choice') && (typeof $scope.hideCampaignCategoryField == 'undefined' || !$scope.hideCampaignCategoryField)) {\n $('#category-field .select-error').remove();\n $('#category-field').append('<div class=\"select-error ui red pointing prompt label transition visible\">' + translation.campaign_basics_selectcategory_prompt + '</div>');\n $('#category-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if (!$('#start-date-field .quickdate').hasClass('startdate-selected')) {\n $('#start-date-field .select-error').remove();\n $('#start-date-field').append('<div class=\"select-error ui red pointing prompt label transition visible\">' + translation.campaign_basics_selectstartdate_prompt + '</div>');\n $('#start-date-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if (!$('#end-date-field .quickdate').hasClass('enddate-selected') && $scope.run_mode) {\n $('#end-date-field .select-error').remove();\n $('#end-date-field').append('<div class=\"select-error ui red pointing prompt label transition visible\">' + translation.campaign_basics_select_end_date_prompt + '</div>');\n $('#end-date-field').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if ($scope.invalidVideo) {\n $('#campaign-video .select-error').remove();\n $('#campaign-video').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n\n if ($scope.invalidThumbnailVideo) {\n $('#campaign-thumbnail-video .select-error').remove();\n $('#campaign-thumbnail-video').addClass('error');\n $scope.valcheck = $scope.valcheck && false;\n }\n }", "title": "" }, { "docid": "a82d2398c1a3663f9163faa89084c033", "score": "0.5468262", "text": "function addBtnProcess(e) {\n\n // ADD to book when fields is not empty\n if (\n\t\t\tmovie_name.value.length != 0 &&\n\t\t\trelease_date.value.length != 0 &&\n\t\t\tmovie_banner.value.length != 0 &&\n\t\t\tdescription.value.length != 0\n\t\t) {\n\t\t\t// when not empty call this function\n\t\t\tAddToBook(type='alert-success');\n\t\t} else {\n setTimeout(ErrorAlert(type='alert-danger'), 1000);\n\t\t}\n\t\t\t\n \n e.preventDefault();\n}", "title": "" }, { "docid": "5d8504b15c6cd4a0b7acb92f2970e49f", "score": "0.5467207", "text": "function reqInputChange() {\n if (this.value === '') {\n window.showError(this.parentNode, 'required');\n } else {\n window.hideError(this.parentNode, 'required');\n }\n}", "title": "" } ]
53f51ddab11a7c82414cac87b361c28e
Runtime helper for rendering
[ { "docid": "6e65730abab11c22d746b41065ecf936", "score": "0.0", "text": "function renderSlot (\n name,\n fallback,\n props,\n bindObject\n) {\n var scopedSlotFn = this.$scopedSlots[name];\n var nodes;\n if (scopedSlotFn) { // scoped slot\n props = props || {};\n if (bindObject) {\n if (false) {\n warn(\n 'slot v-bind without argument expects an Object',\n this\n );\n }\n props = extend(extend({}, bindObject), props);\n }\n nodes = scopedSlotFn(props) || fallback;\n } else {\n var slotNodes = this.$slots[name];\n // warn duplicate slot usage\n if (slotNodes) {\n if (false) {\n warn(\n \"Duplicate presence of slot \\\"\" + name + \"\\\" found in the same render tree \" +\n \"- this will likely cause render errors.\",\n this\n );\n }\n slotNodes._rendered = true;\n }\n nodes = slotNodes || fallback;\n }\n\n var target = props && props.slot;\n if (target) {\n return this.$createElement('template', { slot: target }, nodes)\n } else {\n return nodes\n }\n}", "title": "" } ]
[ { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.81015205", "text": "function render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.797086", "text": "render() {}", "title": "" }, { "docid": "55a471b24674cd3c488584140711ea11", "score": "0.7546567", "text": "render () {}", "title": "" }, { "docid": "0d11419045d66f8bb929962575334dcd", "score": "0.7533175", "text": "render(){}", "title": "" }, { "docid": "ca32b4a929be7d39d5be725bf5c059e2", "score": "0.74123794", "text": "function render () {\n\n\t}", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.7409195", "text": "render() { }", "title": "" }, { "docid": "6bfa2715be4bc3ed814e97fc202bb936", "score": "0.7384979", "text": "render() {\n \n }", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.7256009", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "23e71342fc3fd06f8eb8cf88e5a0e5a7", "score": "0.72348", "text": "render() {return null}", "title": "" }, { "docid": "8c47bf9a7db2501fec446319c0426e3d", "score": "0.72224414", "text": "_render({}) {\n return html`\n <div>waaaaa</div>\n `;\n }", "title": "" }, { "docid": "65ded68292c0f90f0675737730c107ff", "score": "0.7206186", "text": "function render() {\n\n}", "title": "" }, { "docid": "f99d363400e1484dcc327d479047e977", "score": "0.7141005", "text": "function render()\n{\n}", "title": "" }, { "docid": "77e0dba3247a7a46f7ebe69203327b9c", "score": "0.7107315", "text": "render () {\n\n }", "title": "" }, { "docid": "27dc5213ecbc1016f1ed706505e01a1a", "score": "0.7075014", "text": "render(){return html``}", "title": "" }, { "docid": "1c4e39e8ebcd58215474d33ca848fd0b", "score": "0.705507", "text": "render()\n {\n return <div>{this.renderHelper()}</div>\n }", "title": "" }, { "docid": "534f4c3876534191a887ffbbe24360b3", "score": "0.69992477", "text": "render(value) {\n throw 'not implemented';\n }", "title": "" }, { "docid": "4be4af5034675452e0a61fc059a77686", "score": "0.68732184", "text": "render()\n {\n \n\n }", "title": "" }, { "docid": "528826733fd7d0faf0ee6d287abe8336", "score": "0.6864303", "text": "render () {\n this.log('render()')\n return this.actualRender()\n }", "title": "" }, { "docid": "2e04e5de8621b1246fc8aa5b8153cba1", "score": "0.6864068", "text": "render()\n {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6853033", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6853033", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6853033", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6853033", "text": "render() {\n\n }", "title": "" }, { "docid": "93017876117b46487e13344671f717f7", "score": "0.6853033", "text": "render() {\n\n }", "title": "" }, { "docid": "4c8c976406f8012f2db5f2ed6e795289", "score": "0.6849778", "text": "function Renderable() {}", "title": "" }, { "docid": "03aa46eadbca28480a56e225e57fe929", "score": "0.68323284", "text": "render() {\n }", "title": "" }, { "docid": "03aa46eadbca28480a56e225e57fe929", "score": "0.68323284", "text": "render() {\n }", "title": "" }, { "docid": "12a434792e443218211280a8c66ef1af", "score": "0.6688704", "text": "render(data) {\n\n }", "title": "" }, { "docid": "a73ed9f76d16d5533192777d7070f623", "score": "0.6671306", "text": "_onRender() {}", "title": "" }, { "docid": "56f139c31ec689f7c15259c4b2c9e216", "score": "0.6670186", "text": "renderToHTML() {\n return \"<div>\"+this.content+\"</div>\";\n }", "title": "" }, { "docid": "613a99fe41741c4aa233aee50ada89e9", "score": "0.6629321", "text": "render() {\n\t\treturn <div/>\n\t}", "title": "" }, { "docid": "e3b8514508a53fbe6d4a51ca1b63cda5", "score": "0.6622655", "text": "render() {\n return html``;\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.6616579", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.6616579", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "e4ab7d785d8d8d1be8ca09ab497050fc", "score": "0.6616579", "text": "render() {\n return renderNotImplemented;\n }", "title": "" }, { "docid": "a63337f2020961acfb782d811e9eb6ab", "score": "0.6606507", "text": "render() {\n return this.renderContent();\n }", "title": "" }, { "docid": "bae70cc5194b8d486d854d1704fd1cea", "score": "0.65926766", "text": "function Renderable() {\n\n }", "title": "" }, { "docid": "643584d180c74f1bf93146754c908527", "score": "0.6584306", "text": "Render(){\n\n }", "title": "" }, { "docid": "fde0be9bc771b712eb81f5826c79a2d5", "score": "0.65516686", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "9d0440fd060f1bda4a6792f1201da602", "score": "0.653987", "text": "function Renderable() {\n \n }", "title": "" }, { "docid": "6910a8b312c4c9e61905b40e03159258", "score": "0.6518277", "text": "render () {\n return ''\n }", "title": "" }, { "docid": "c877af767285994f11c8e05bbcd6630e", "score": "0.6495087", "text": "render() {\n // How will UI tree / expression be encoded?\n return (null);\n }", "title": "" }, { "docid": "24ef9364c6a734e0826b8f64d6586337", "score": "0.643293", "text": "get render() {\r\n\t\treturn this.renderFull();\r\n\t}", "title": "" }, { "docid": "ea43b72be10ab14e4950c15a297a7c0a", "score": "0.6429697", "text": "function render() {\n console.warn('Component ' + this.id() + ' must override render()');\n return '<div></div>';\n }", "title": "" }, { "docid": "11c76525d99f2d6195f928e1aeaf1a58", "score": "0.6426599", "text": "render() {\n if (!this._renderFunc) {\n if (this._companionObj) {\n throw(new Error(\"You must define a render function with .fill()\"));\n }\n else {\n throw(new Error(\"You must override render() in descendant classes\"));\n }\n }\n else {\n return this._renderFunc(this._companionObj);\n }\n }", "title": "" }, { "docid": "c95fdebe50ad09c18cc96d06a4835905", "score": "0.6409994", "text": "render() {\n return this.template;\n }", "title": "" }, { "docid": "34f0a07fd5adeff7287776c71138385b", "score": "0.64072526", "text": "renderToHTML() {\n return '<p>'+this.content+'</p>'\n }", "title": "" }, { "docid": "e4fde00acd17096d7d9b3891dde3c6f9", "score": "0.6404171", "text": "render() { return super.render(); }", "title": "" }, { "docid": "3702809eae44b435a50018d3da52f0e4", "score": "0.6395243", "text": "function render () {\n renderBody()\n}", "title": "" }, { "docid": "c851556db1c55fff39eb2bed05073b94", "score": "0.6384467", "text": "render() {\n return null\n }", "title": "" }, { "docid": "c851556db1c55fff39eb2bed05073b94", "score": "0.6384467", "text": "render() {\n return null\n }", "title": "" }, { "docid": "b8462b11a23756200af0a725ce4fecb0", "score": "0.6381128", "text": "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t{this.renderContent()}\n\t\t\t</div>\n\t\t);\n\t}", "title": "" }, { "docid": "0048f00c2fd8d156564656f895ba31ec", "score": "0.6377484", "text": "preRender() { }", "title": "" }, { "docid": "e6e9d3eb8e3b6dfa8207640af2325c0c", "score": "0.636194", "text": "render() {\n return _litElement.html``;\n }", "title": "" }, { "docid": "1b7e901b1d56d991310b41bbdeda42b5", "score": "0.63356066", "text": "render() {\n return html`<p>your ${this.adjective} template-here</p>`;\n }", "title": "" }, { "docid": "cb7f8594e8eb66f9e0c70a30315bd81b", "score": "0.63340646", "text": "_render() {\n if (this._template && this.renderer) this.renderer(this._template.apply(this, this.getTemplateArgs()), this.element);\n }", "title": "" }, { "docid": "d53dca5ea3b958b5e1d0a48126377bb7", "score": "0.63325745", "text": "preRendering() {}", "title": "" }, { "docid": "0d19d6e09b2ecb269f522b03490e51b2", "score": "0.63216627", "text": "render (h) { return h('p') }", "title": "" }, { "docid": "23f7507bf2e4c982971ac4f002d495db", "score": "0.6310696", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "23f7507bf2e4c982971ac4f002d495db", "score": "0.6310696", "text": "render() {\n return null;\n }", "title": "" }, { "docid": "a197bb9a564cded0e6656e189204d649", "score": "0.6294342", "text": "postRendering() {}", "title": "" }, { "docid": "c96de6227a7e85138e7c1057d2abf48b", "score": "0.62842155", "text": "render() {\n return `<li> ${this.text} </li>`\n }", "title": "" }, { "docid": "66a7a674ba9de6b72ef5e94f5a4f7d56", "score": "0.6257948", "text": "render() {\n this.domElement && (this.domElement.innerHTML = this.renderTemplate());\n }", "title": "" }, { "docid": "2477a8dd0d889ee21b3159fdf273dc44", "score": "0.6255817", "text": "render() {\n return super.render();\n }", "title": "" }, { "docid": "859dd7d281943c1c52a30e396e05ce32", "score": "0.62465787", "text": "renderHtml(markup) {\n return {__html: markup};\n }", "title": "" }, { "docid": "ded9a932fd5fd5d09e9395625d138b4d", "score": "0.62461007", "text": "preRender() {\n }", "title": "" }, { "docid": "d07785b0b9eedcb176376bfa78899659", "score": "0.62459105", "text": "function nullRender() { return null; }", "title": "" }, { "docid": "d07785b0b9eedcb176376bfa78899659", "score": "0.62459105", "text": "function nullRender() { return null; }", "title": "" }, { "docid": "d07785b0b9eedcb176376bfa78899659", "score": "0.62459105", "text": "function nullRender() { return null; }", "title": "" }, { "docid": "79976329f8302d6a9d7e2cf148ab2469", "score": "0.62379074", "text": "doRender( comps ) {\n }", "title": "" }, { "docid": "23b31d703ddcd3c1895cf1f479d47760", "score": "0.621893", "text": "onRender(){}", "title": "" }, { "docid": "353d149e865d19ef7a08cdac2b485513", "score": "0.61948925", "text": "willRender() {}", "title": "" }, { "docid": "353d149e865d19ef7a08cdac2b485513", "score": "0.61948925", "text": "willRender() {}", "title": "" }, { "docid": "353d149e865d19ef7a08cdac2b485513", "score": "0.61948925", "text": "willRender() {}", "title": "" }, { "docid": "0f4a93a39627acf23f006cb844fb9da3", "score": "0.61900955", "text": "render() {\n throw new Error('Extending class should implement #render');\n }", "title": "" }, { "docid": "d0a45c6f4d95e49e7d08848750addfd2", "score": "0.61844486", "text": "renderElement() {\n\t\tthis.associatedData = { id: this.id };\n\t\tconst associatedData = this.associatedData;\n\t\tassociatedData.htmlPath = this.component.htmlPath;\n\t\tassociatedData.cssPath = this.component.cssPath;\n\t\tassociatedData.jsPath = this.component.jsPath;\n\n\t\t_common_WebFormHandler__WEBPACK_IMPORTED_MODULE_2__[\"default\"].associateHandler(this, associatedData);\n\n\t\tif (this.isBuilderMode) {\n\t\t\t// add later\n\t\t}\n\n\t\tthis.delayRender();\n\n\t\tlet mainStyle = '';\n\t\tif (this.component.styles) {\n\t\t\tmainStyle = _common_StyleGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].toString(\n\t\t\t\t_common_StyleGenerator__WEBPACK_IMPORTED_MODULE_1__[\"default\"].parseStyle(this.component.styles.main),\n\t\t\t);\n\t\t}\n\t\tlet cssclass = this.component.cssClass;\n\t\tif (cssclass == null) cssclass = '';\n\n\t\tlet result = '';\n\t\tlet path = this.component.htmlPath;\n\t\tif (path == null || path === '') path = 'not defined';\n\n\t\tif (this.isBuilderMode) {\n\t\t\tif (path === 'not defined') {\n\t\t\t\tresult = Object(_templates_placeholder_ejs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])({\n\t\t\t\t\tmessage: 'Please Provide a valid custom HTML path',\n\t\t\t\t\ticon: 'html5',\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tresult = `<div class=\"outsideHTML-builder ${cssclass}\" style='${mainStyle}'>Custom HTML, path: ${path}</div>`;\n\t\t\t}\n\t\t} else {\n\t\t\tresult = `<div class=\"outsideHTML ${cssclass}\" style='${mainStyle}'></div>`;\n\t\t}\n\n\t\treturn result;\n\t}", "title": "" }, { "docid": "6e3b9d0539e54abca3dc64d612a42347", "score": "0.6165654", "text": "render() {\n return <div>{this.renderContent()}</div>;\n }", "title": "" }, { "docid": "00398f0ec7b6d8abe9c95335fbd8c038", "score": "0.6162565", "text": "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "title": "" }, { "docid": "f5e31ceb93c32a41482596c6c4a592cc", "score": "0.61460006", "text": "render(){\n return <span>Hello Priyanka<Mahima/></span>\n }", "title": "" }, { "docid": "51dee838b3cb30c64c6f0677fb231d4e", "score": "0.6142391", "text": "_firstRendered() {\n\n }", "title": "" }, { "docid": "e06a383246536a532f1629b4cdad40dd", "score": "0.6140645", "text": "render() {\n const classes = {\n 'primary': this.primary,\n 'emphasis': this.emphasis,\n 'accent': this.accent,\n 'disabled': this.disabled,\n 'error': this.error,\n 'success': this.success,\n 'advisory': this.advisory\n }\n\n return html`\n <div class=\"${classMap(classes)}\">\n <div class=\"util_displayHiddenVisually\">\n <slot></slot>\n </div>\n <slot name=\"icon\">${this.svg}</slot>\n </div>\n `;\n }", "title": "" }, { "docid": "a83aa084f483ab862609658e5efefa36", "score": "0.61322534", "text": "renderEngineer() {\n // setting data argument into a variable\n let e = this.data;\n // returning html structure using methods from data argument\n return `\n\t<!-- Engineer Template -->\n\t<div class=\"card employeeCard\" style=\"width: 18rem\">\n\t\t<div class=\"card-body bg-primary text-white\">\n\t\t\t<h3 class=\"card-title\">${e.getName()}</h3>\n\t\t\t<h5><i class=\"fas fa-mug-hot\"></i> ${e.getRole()}</h5>\n\t\t</div>\n\t\t<div class=\"mx-3 my-5\">\n\t\t\t<ul class=\"list-group\">\n\t\t\t\t<li class=\"list-group-item\">ID: ${e.getID()}</li>\n\t\t\t\t<li class=\"list-group-item\">\n\t\t\t\t\tEmail: <a href=\"mailto:${e.getEmail()}\">${e.getEmail()}</a>\n\t\t\t\t</li>\n\t\t\t\t<li class=\"list-group-item\">GitHub: <a href=\"https://github.com/${e.getGithub()}\">${e.getGithub()}</a></li>\n\t\t\t</ul>\n\t\t</div>\n\t</div>\n\t`;\n }", "title": "" }, { "docid": "cc58215aba62f4ab71be2b6e664a3906", "score": "0.61235124", "text": "function render() {\n\t\trenderResult = navTpl;\n\t\t$renderResult = $(renderResult);\n\t\t// bind data here if required \n\t\treturn navTpl;\n\t}", "title": "" }, { "docid": "c2645d83428ab9302bbc709c1e852d67", "score": "0.6102382", "text": "postRender() {\n }", "title": "" }, { "docid": "2ed8b323860f056308e3e5672f2d0777", "score": "0.6100656", "text": "preRender() {\n\n }", "title": "" }, { "docid": "624e38a287a4923f5451affdd1f8f2b5", "score": "0.6086357", "text": "render(){\n this.inheritState();\n let out = '';\n switch (this.type) {\n case 'text':\n out += this.evalExpression(this.data);\n break;\n case 'directive':\n out += '<' + this.data + '>';\n break;\n case 'comment':\n out += '<!-- ' + this.evalExpression(this.data) + '-->';\n break;\n default: {\n let isClosing = (Node.isClosingTag(this.name) && !this.children.length),\n isDeclarative = Node.isDeclarative(this.name);\n\n // Allow dynamic changing of tags\n if (this.attributes['@tag']) {\n let replaceTag = this.evalExpression(this.attributes['@tag']);\n if (replaceTag && replaceTag !== 'undefined') {\n this.name = replaceTag;\n }\n }\n\n out += '<' + this.name + this.getAttributeString() + ((isClosing && !isDeclarative) ? ' /' : '') + '>';\n if (!isClosing) {\n out += Node.renderArray(this.children);\n out += '</' + this.name + '>';\n }\n }\n break;\n }\n this.pushState();\n return out;\n }", "title": "" }, { "docid": "0e71f5c36070fa849f9e32c3d6a925d5", "score": "0.60747486", "text": "function ConsoleRender() {}", "title": "" }, { "docid": "cf93aa53432f8d54b4ae8ead8969db8e", "score": "0.60715944", "text": "postRender() {\n\n }", "title": "" }, { "docid": "f31aa9946bf992760be5ebd962512fda", "score": "0.6070796", "text": "_render() {\n var self = this;\n self.$el.html( self.template( self.data ) );\n }", "title": "" }, { "docid": "6cc2f4a0bbdcea450ea3d8f499dc1768", "score": "0.606518", "text": "function render ($$) {\n $$ = ($$ === undefined || $$ === null) ? {} : $$;\n var _ref = undefined;\n var _res = '';\n var _i = 0;\n var __extends__ = null;\n \n _res += 'var _require = function (mod) { \\n if ((typeof mod === \\\"object\\\") && (mod.render != null))\\n return mod;\\n return ';\n _res += ((_ref = $default.call($$,$$.require_exp, \"require\")) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '(mod);\\n};\\nvar __last_ctx__ = null;\\n\\nvar __indexOf = [].indexOf || function(x) {\\n for (var i = this.length - 1; i >= 0; i--)\\n if (this[i] === x) return i;\\n};\\n\\nif (!Object.keys) Object.keys = function(o){\\n if (o !== Object(o))\\n throw new TypeError(\\'Object.keys called on non-object\\');\\n var ret=[],p;\\n for(p in o) if(Object.prototype.hasOwnProperty.call(o,p)) ret.push(p);\\n return ret;\\n}\\n\\n';\n (function() {var _fref = $$.utils || [], _prev_loop = $$.loop, _prev_key = $$['fname'], _prev_value = $$['fn'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['fname'] = _fref[i]; $$['fn'] = i;\n _res += ((_ref = $$.fn) !== undefined && _ref !== null ? _ref : '').toString();}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['fname'] = x;$$['fn'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += ((_ref = $$.fn) !== undefined && _ref !== null ? _ref : '').toString();i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['fname'] = _prev_key; $$['fn'] = _prev_value;})();\n _res += '\\n';\n (function() {var _fref = $$.filters_used || [], _prev_loop = $$.loop, _prev_key = $$['fn_name'], _prev_value = $$['decl'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['fn_name'] = _fref[i]; $$['decl'] = i;\n _res += ((_ref = $$.decl) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n';}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['fn_name'] = x;$$['decl'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += ((_ref = $$.decl) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n';i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['fn_name'] = _prev_key; $$['decl'] = _prev_value;})();\n _res += '\\n';\n if ($$.blocks) {\n _res += '// Start Block Definitions\\n\\n';\n (function() {var _fref = $$.blocks || [], _prev_loop = $$.loop, _prev_key = $$['name'], _prev_value = $$['contents'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['name'] = _fref[i]; $$['contents'] = i;\n _res += '// Block declaration of \\\"';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\\"\\nfunction __block_';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += ' ($$) {\\n var require = _require;\\n var _b = ($$ ? $$.__blocks__ : {});\\n var _res = \\\"\\\";\\n var __extends__ = null;\\n ';\n _res += ((_ref = $$.contents) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n return _res;\\n}\\n';}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['name'] = x;$$['contents'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += '// Block declaration of \\\"';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\\"\\nfunction __block_';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += ' ($$) {\\n var require = _require;\\n var _b = ($$ ? $$.__blocks__ : {});\\n var _res = \\\"\\\";\\n var __extends__ = null;\\n ';\n _res += ((_ref = $$.contents) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n return _res;\\n}\\n';i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['name'] = _prev_key; $$['contents'] = _prev_value;})();\n _res += '\\n// End Block Definitions\\n';\n }\n _res += '// RENDERING FUNCTION, EVERYTHING HAPPENS HERE.\\nfunction render ($$) {\\n $$ = ($$ === undefined || $$ === null) ? {} : $$;\\n var _ref = undefined;\\n var _res = \\'\\';\\n var _i = 0;\\n var __extends__ = null;\\n var require = _require;\\n ';\n if ($$.blocks) {\n _res += ' var _b = null;\\n ($$.__blocks__ == null) && ($$.__blocks__ = {});\\n _b = $$.__blocks__;\\n var __newblocks__ = {};\\n var _block_iterator = null;\\n ';\n }\n _res += ' ';\n _res += ((_ref = $$.body) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n if (__extends__ !== undefined && __extends__ !== null) return __extends__.render($$);\\n return _res;\\n}\\nexports.render = render;\\n\\nfunction _cached_ctx () {\\n if (!__last_ctx__) {\\n __last_ctx__ = {};\\n render(__last_ctx__);\\n }\\n return __last_ctx__;\\n}\\nexports._cached_ctx = _cached_ctx;\\n';\n if (__extends__ !== undefined && __extends__ !== null) return __extends__.render($$);\n return _res;\n}", "title": "" }, { "docid": "6cc2f4a0bbdcea450ea3d8f499dc1768", "score": "0.606518", "text": "function render ($$) {\n $$ = ($$ === undefined || $$ === null) ? {} : $$;\n var _ref = undefined;\n var _res = '';\n var _i = 0;\n var __extends__ = null;\n \n _res += 'var _require = function (mod) { \\n if ((typeof mod === \\\"object\\\") && (mod.render != null))\\n return mod;\\n return ';\n _res += ((_ref = $default.call($$,$$.require_exp, \"require\")) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '(mod);\\n};\\nvar __last_ctx__ = null;\\n\\nvar __indexOf = [].indexOf || function(x) {\\n for (var i = this.length - 1; i >= 0; i--)\\n if (this[i] === x) return i;\\n};\\n\\nif (!Object.keys) Object.keys = function(o){\\n if (o !== Object(o))\\n throw new TypeError(\\'Object.keys called on non-object\\');\\n var ret=[],p;\\n for(p in o) if(Object.prototype.hasOwnProperty.call(o,p)) ret.push(p);\\n return ret;\\n}\\n\\n';\n (function() {var _fref = $$.utils || [], _prev_loop = $$.loop, _prev_key = $$['fname'], _prev_value = $$['fn'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['fname'] = _fref[i]; $$['fn'] = i;\n _res += ((_ref = $$.fn) !== undefined && _ref !== null ? _ref : '').toString();}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['fname'] = x;$$['fn'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += ((_ref = $$.fn) !== undefined && _ref !== null ? _ref : '').toString();i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['fname'] = _prev_key; $$['fn'] = _prev_value;})();\n _res += '\\n';\n (function() {var _fref = $$.filters_used || [], _prev_loop = $$.loop, _prev_key = $$['fn_name'], _prev_value = $$['decl'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['fn_name'] = _fref[i]; $$['decl'] = i;\n _res += ((_ref = $$.decl) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n';}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['fn_name'] = x;$$['decl'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += ((_ref = $$.decl) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n';i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['fn_name'] = _prev_key; $$['decl'] = _prev_value;})();\n _res += '\\n';\n if ($$.blocks) {\n _res += '// Start Block Definitions\\n\\n';\n (function() {var _fref = $$.blocks || [], _prev_loop = $$.loop, _prev_key = $$['name'], _prev_value = $$['contents'], k = null, v = null, i = 0, l = 0, x = null, last_v = null, last_k = null;$$.loop = { };\n if (_fref instanceof Array) {l = _fref.length;for (i = 0; i < l; i++) {$$.loop.last = (i == l - 1);$$.loop.first = (i == 0);$$.loop.index0 = i;$$.loop.index = i + 1;$$['name'] = _fref[i]; $$['contents'] = i;\n _res += '// Block declaration of \\\"';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\\"\\nfunction __block_';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += ' ($$) {\\n var require = _require;\\n var _b = ($$ ? $$.__blocks__ : {});\\n var _res = \\\"\\\";\\n var __extends__ = null;\\n ';\n _res += ((_ref = $$.contents) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n return _res;\\n}\\n';}\n } else {$$.loop = { first: true, last: false };l = Object.keys(_fref).length;for (x in _fref) { if (_fref.hasOwnProperty(x)) {$$.loop.last = (i == l - 1);$$['name'] = x;$$['contents'] = _fref[x];$$.loop.index0 = i;$$.loop.index = i + 1;\n _res += '// Block declaration of \\\"';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\\"\\nfunction __block_';\n _res += ((_ref = $$.name) !== undefined && _ref !== null ? _ref : '').toString();\n _res += ' ($$) {\\n var require = _require;\\n var _b = ($$ ? $$.__blocks__ : {});\\n var _res = \\\"\\\";\\n var __extends__ = null;\\n ';\n _res += ((_ref = $$.contents) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n return _res;\\n}\\n';i += 1;$$.loop.first = false;} }}\n if ($$.loop.index == undefined) {}$$.loop = _prev_loop; $$['name'] = _prev_key; $$['contents'] = _prev_value;})();\n _res += '\\n// End Block Definitions\\n';\n }\n _res += '// RENDERING FUNCTION, EVERYTHING HAPPENS HERE.\\nfunction render ($$) {\\n $$ = ($$ === undefined || $$ === null) ? {} : $$;\\n var _ref = undefined;\\n var _res = \\'\\';\\n var _i = 0;\\n var __extends__ = null;\\n var require = _require;\\n ';\n if ($$.blocks) {\n _res += ' var _b = null;\\n ($$.__blocks__ == null) && ($$.__blocks__ = {});\\n _b = $$.__blocks__;\\n var __newblocks__ = {};\\n var _block_iterator = null;\\n ';\n }\n _res += ' ';\n _res += ((_ref = $$.body) !== undefined && _ref !== null ? _ref : '').toString();\n _res += '\\n if (__extends__ !== undefined && __extends__ !== null) return __extends__.render($$);\\n return _res;\\n}\\nexports.render = render;\\n\\nfunction _cached_ctx () {\\n if (!__last_ctx__) {\\n __last_ctx__ = {};\\n render(__last_ctx__);\\n }\\n return __last_ctx__;\\n}\\nexports._cached_ctx = _cached_ctx;\\n';\n if (__extends__ !== undefined && __extends__ !== null) return __extends__.render($$);\n return _res;\n}", "title": "" }, { "docid": "05f8809dbadb1120a01384651f0d5037", "score": "0.6064222", "text": "toHtml() {\n var node = this.render();\n return node ? node.toHtml() : '';\n }", "title": "" }, { "docid": "00df6ecf882a2cea240e8c040121a60f", "score": "0.60521674", "text": "render() {\n return \"something went wrong\"\n }", "title": "" }, { "docid": "0627883e7e5e9b5d09700f08556724af", "score": "0.6052027", "text": "renderNode(node)\n {\n\n }", "title": "" }, { "docid": "b90aedbcdbaaa5915ec6d982dd3f36ec", "score": "0.6049311", "text": "function render() {\n // create a variable that is the result of what generateHTML gets and make into a string via .join\n const html = generateHTML().join(\"\");\n $ulEl.html(html);\n}", "title": "" }, { "docid": "ea65e4a210fe7f553cad51f7be5d5031", "score": "0.60362226", "text": "render() {\n throw new Error('Extend the render method to add your plugin to a DOM element');\n }", "title": "" }, { "docid": "964b8ee6dd6bff9116b3a78674625e33", "score": "0.6015821", "text": "render() {\r\n return(BodyJSX.call(this));\r\n }", "title": "" } ]
f95c0511b6eabfc67f6de6c95f2fff02
Fires when element is attached to DOM
[ { "docid": "26b4547ca12bfdd863c49f4f9c7dfad4", "score": "0.0", "text": "connectedCallback() {\n this.connected = true;\n this.init();\n }", "title": "" } ]
[ { "docid": "67d232406abfed5ed71b70faaf251640", "score": "0.67593306", "text": "didInsertElement() {}", "title": "" }, { "docid": "f95b989ee8d555cd5d473789c80c5cb9", "score": "0.6737583", "text": "didInsertElement() { }", "title": "" }, { "docid": "e767d202d0444b21d9a8b6be65a8e61b", "score": "0.6716962", "text": "onEnterDOM() {}", "title": "" }, { "docid": "ff84f1e597411c39938673ab68c6c328", "score": "0.67062515", "text": "function _onElementAdded() {\n \n\t\t\t countElements++;\n \n\t\t\t //add all elements of a view\n\t\t\t if(countElements < elements.length) {\n\t\t\t\t var element = elements[countElements];\n\t\t\t\t if(!_removeNotValidElementObj(element)) {\n\t\t\t\t\t instance.addElement( element.type, element.source, element.title, element.parameters);\n\t\t\t\t }\n \n\t\t\t }\n\t\t\t //all initial elements are added, view is created\n\t\t\t else {\n \n\t\t\t\t $this.off('elementAdd', _onElementAdded);\n\t\t\t\t if(typeof callback !== 'undefined') {\n\t\t\t\t\t callback.call(callback, instance);\n\t\t\t\t }\n \n\t\t\t }\n \n\t\t }", "title": "" }, { "docid": "9bd4e8154fb2f476f3b55204c312781c", "score": "0.66488224", "text": "attachToDOM_() {\n document.body.appendChild(this);\n }", "title": "" }, { "docid": "9a0dbfd3f93fdd27d1dc33364c05f098", "score": "0.6621084", "text": "@action\n\tdidInsert(element) {\n\t\tthis.debug(`didInsert: `, element);\n\t\tthis._element = element;\n\t}", "title": "" }, { "docid": "345e4f443d7a60c8237ab082ab9a65c1", "score": "0.6603749", "text": "didInsertElement() {\n let $aboveElement = $(this.get('aboveElementSelector'));\n Ember.assert($aboveElement.length === 1, 'above element should exist');\n let $belowElement = this.$().parent();\n let updater = bindElementTop($aboveElement, $belowElement);\n $(window).on('resize.redocIframe', updater);\n }", "title": "" }, { "docid": "641b7900edc930a6ff144908f1d225ac", "score": "0.6577429", "text": "function attached() {\n\t/* jslint validthis:true */\n\tthis._editor = create( this, this.$.editor );\n} // end FUNCTION attached()", "title": "" }, { "docid": "6f3b21693b255bbcd90d1fae859ea1eb", "score": "0.6552868", "text": "connectedCallback() {\r\n\t\t\tthis._domAttached = true;\r\n\t\t}", "title": "" }, { "docid": "090205eeea2c17747c8e4fbc1c735318", "score": "0.6551473", "text": "function onAttached() {\n\t if (!this._isAttached) {\n\t this._isAttached = true;\n\t this.$children.forEach(callAttach);\n\t }\n\t }", "title": "" }, { "docid": "090205eeea2c17747c8e4fbc1c735318", "score": "0.6551473", "text": "function onAttached() {\n\t if (!this._isAttached) {\n\t this._isAttached = true;\n\t this.$children.forEach(callAttach);\n\t }\n\t }", "title": "" }, { "docid": "090205eeea2c17747c8e4fbc1c735318", "score": "0.6551473", "text": "function onAttached() {\n\t if (!this._isAttached) {\n\t this._isAttached = true;\n\t this.$children.forEach(callAttach);\n\t }\n\t }", "title": "" }, { "docid": "090205eeea2c17747c8e4fbc1c735318", "score": "0.6551473", "text": "function onAttached() {\n\t if (!this._isAttached) {\n\t this._isAttached = true;\n\t this.$children.forEach(callAttach);\n\t }\n\t }", "title": "" }, { "docid": "090205eeea2c17747c8e4fbc1c735318", "score": "0.6551473", "text": "function onAttached() {\n\t if (!this._isAttached) {\n\t this._isAttached = true;\n\t this.$children.forEach(callAttach);\n\t }\n\t }", "title": "" }, { "docid": "090205eeea2c17747c8e4fbc1c735318", "score": "0.6551473", "text": "function onAttached() {\n\t if (!this._isAttached) {\n\t this._isAttached = true;\n\t this.$children.forEach(callAttach);\n\t }\n\t }", "title": "" }, { "docid": "090205eeea2c17747c8e4fbc1c735318", "score": "0.6551473", "text": "function onAttached() {\n\t if (!this._isAttached) {\n\t this._isAttached = true;\n\t this.$children.forEach(callAttach);\n\t }\n\t }", "title": "" }, { "docid": "7897b36974482ddfa1aa76dcb76e2d3a", "score": "0.6525815", "text": "@action\n\tdidInsert(element) {\n\t\tthis.debug(`didInsert`);\n\t\tthis._element = element;\n\n\t\trun.next(() => {\n\t\t\tif(this.isDestroying || this.isDestroyed)\n\t\t\t\treturn;\n\n\t\t\tthis._elementDidRender = true;\n\t\t});\n\t}", "title": "" }, { "docid": "6987860068e11c1234fc7cfbf494fdd6", "score": "0.649734", "text": "function onAttached () {\n\t\t if (!this._isAttached) {\n\t\t this._isAttached = true\n\t\t this.$children.forEach(callAttach)\n\t\t }\n\t\t}", "title": "" }, { "docid": "455fc74bc5c584beed6109eac464ba58", "score": "0.64884496", "text": "function onAttached () {\n\t if (!this._isAttached) {\n\t this._isAttached = true\n\t this.$children.forEach(callAttach)\n\t }\n\t}", "title": "" }, { "docid": "607699d7322faf48d1122962a3bf61ef", "score": "0.6478796", "text": "didInsertElement (...args) {\n this._super(...args)\n this.upgradeElements()\n }", "title": "" }, { "docid": "999cfc14a5ac7bbad1981c30dd9243dd", "score": "0.64532334", "text": "function onAttached() {\n if (!this._isAttached) {\n this._isAttached = true;\n this.$children.forEach(callAttach);\n }\n }", "title": "" }, { "docid": "999cfc14a5ac7bbad1981c30dd9243dd", "score": "0.64532334", "text": "function onAttached() {\n if (!this._isAttached) {\n this._isAttached = true;\n this.$children.forEach(callAttach);\n }\n }", "title": "" }, { "docid": "999cfc14a5ac7bbad1981c30dd9243dd", "score": "0.64532334", "text": "function onAttached() {\n if (!this._isAttached) {\n this._isAttached = true;\n this.$children.forEach(callAttach);\n }\n }", "title": "" }, { "docid": "999cfc14a5ac7bbad1981c30dd9243dd", "score": "0.64532334", "text": "function onAttached() {\n if (!this._isAttached) {\n this._isAttached = true;\n this.$children.forEach(callAttach);\n }\n }", "title": "" }, { "docid": "999cfc14a5ac7bbad1981c30dd9243dd", "score": "0.64532334", "text": "function onAttached() {\n if (!this._isAttached) {\n this._isAttached = true;\n this.$children.forEach(callAttach);\n }\n }", "title": "" }, { "docid": "999cfc14a5ac7bbad1981c30dd9243dd", "score": "0.64532334", "text": "function onAttached() {\n if (!this._isAttached) {\n this._isAttached = true;\n this.$children.forEach(callAttach);\n }\n }", "title": "" }, { "docid": "999cfc14a5ac7bbad1981c30dd9243dd", "score": "0.64532334", "text": "function onAttached() {\n if (!this._isAttached) {\n this._isAttached = true;\n this.$children.forEach(callAttach);\n }\n }", "title": "" }, { "docid": "d1a1e7de97b50b94403ae6e788c8a81b", "score": "0.64477044", "text": "function onAttached() {\n if (!this._isAttached) {\n this._isAttached = true;\n this.$children.forEach(callAttach);\n }\n }", "title": "" }, { "docid": "d1a1e7de97b50b94403ae6e788c8a81b", "score": "0.64477044", "text": "function onAttached() {\n if (!this._isAttached) {\n this._isAttached = true;\n this.$children.forEach(callAttach);\n }\n }", "title": "" }, { "docid": "d1a1e7de97b50b94403ae6e788c8a81b", "score": "0.64477044", "text": "function onAttached() {\n if (!this._isAttached) {\n this._isAttached = true;\n this.$children.forEach(callAttach);\n }\n }", "title": "" }, { "docid": "3217b310ec37442351c3c56b2de7ba69", "score": "0.63923717", "text": "didInsertElement(...args) {\n\t\tthis._super(...args);\n\n\t\tthis.bindHandler();\n\t}", "title": "" }, { "docid": "7f4d4ae761228155c27551e98aee21e6", "score": "0.6346994", "text": "didInsertElement() {\n this._super(...arguments);\n\n this.setFocus();\n\n this.sendAction('setEditor', this);\n\n run.scheduleOnce('afterRender', this, this.afterRenderEvent);\n }", "title": "" }, { "docid": "aae113e50b6ccc49e5193dff75bcf322", "score": "0.6322805", "text": "onAfterAttach(msg) {\n this.node.addEventListener('change', this);\n this.node.addEventListener('click', this);\n this.node.addEventListener('dblclick', this);\n }", "title": "" }, { "docid": "ee29d6706cf78b5d02238dfc22212a02", "score": "0.6265422", "text": "function elementAttached(element) {\r\n\t\t\tvar Class = element.constructor\r\n\t\t\tif (Class.create) {\r\n\t/*\t\t\tif (Class.attachedInstances) {\r\n\t\t\t\t\tClass.attachedInstances.push(element)\r\n\t\t\t\t\tif (Class.attachedInstances.length === 1 && Class.needsRestart) {\r\n\t\t\t\t\t\trestart(Class)\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tClass.attachedInstances = [element]\r\n\t\t\t\t}*/\r\n\t\t\t\tif (element.attached) {\r\n\t\t\t\t\telement.attached()\r\n\t\t\t\t}\r\n\t\t\t\tif (element.needsRestart) {\r\n\t\t\t\t\trestart(element)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "f92351a5cc6f876ab4d01d7a9dc39f09", "score": "0.6235413", "text": "bind() {\n this.hook.appendChild(this.docElement);\n }", "title": "" }, { "docid": "5a4314b0b4211bdfd2fbc3d554a304a8", "score": "0.6225644", "text": "attachToDOM_() {\n const parent = this.domSibling_.parentNode;\n parent.insertBefore(this, this.domSibling_.nextSibling);\n }", "title": "" }, { "docid": "fe90864eefc850e46b06245d4cafbb1b", "score": "0.6173341", "text": "onAfterAttach(msg) {\n super.onAfterAttach(msg);\n this.node.addEventListener('click', this);\n }", "title": "" }, { "docid": "20a5430c07d0b3fe85e0f2775e1341f4", "score": "0.61524403", "text": "attach(el) {\n if(this.attached)\n {\n this.attached.removeEventListener('mousedown', this.event);\n this.attached.removeEventListener('mouseup', this.event);\n this.attached.removeEventListener('click', this.event);\n this.attached.removeEventListener('dblclick', this.event);\n }\n \n this.attached = el;\n \n el.addEventListener('mousedown', this.event);\n el.addEventListener('mouseup', this.event);\n el.addEventListener('click', this.event);\n el.addEventListener('dblclick', this.event);\n }", "title": "" }, { "docid": "d6a729ec2cc018edd3f555965bbab974", "score": "0.6148388", "text": "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "title": "" }, { "docid": "d6a729ec2cc018edd3f555965bbab974", "score": "0.6148388", "text": "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "title": "" }, { "docid": "d6a729ec2cc018edd3f555965bbab974", "score": "0.6148388", "text": "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "title": "" }, { "docid": "63d07564bdd62ac09c5ad972abcf10ea", "score": "0.6147496", "text": "attached() {\n const that = this;\n\n super.attached();\n\n if (!that.isCompleted) {\n return;\n }\n\n if (that._defaultFooterTemplateApplied) {\n that._addCalendarFooterListeners();\n }\n\n if (that.$.timePickerDropDown) {\n that._addTimePickerListener();\n }\n\n that._positionDetection.dropDownAttached();\n }", "title": "" }, { "docid": "cc343933cae324a30ee235267db7cc38", "score": "0.6146041", "text": "didInsertElement() {\n this._super(...arguments);\n this.registerWithMenu();\n }", "title": "" }, { "docid": "86bff605e9c147ff2d1d40ac202b0737", "score": "0.6109331", "text": "elementUpdated() {\n this.model.trigger('el:change');\n }", "title": "" }, { "docid": "f8f182b2c64bf89cd847e080c21cc21d", "score": "0.6109216", "text": "attached() {\n const that = this;\n\n super.attached();\n\n if (!that.isCompleted) {\n return;\n }\n\n if (that._trackListener) {\n that._trackListener = new JQX.Utilities.InputEvents(that._track);\n that._trackListener.down(function (event) {\n that._SVGElementDownHandler(event);\n });\n }\n\n if (that._fillListener) {\n that._fillListener = new JQX.Utilities.InputEvents(that._fill);\n that._fillListener.down(function (event) {\n that._SVGElementDownHandler(event);\n });\n }\n\n if (that._lineListener) {\n that._lineListener = new JQX.Utilities.InputEvents(that._line);\n that._lineListener.down(function (event) {\n that._SVGElementDownHandler(event);\n });\n }\n }", "title": "" }, { "docid": "19e3318386a5a7394d46eb30975b4987", "score": "0.61055565", "text": "attached() {\n super.attached();\n const that = this;\n\n that._handleContainers();\n }", "title": "" }, { "docid": "8df6114f0b37f52b110708ecbdb1bbe7", "score": "0.6104682", "text": "function attach(element) {\n\t\t$(element).bind('click',toggle);\n\t}", "title": "" }, { "docid": "152cece58025b1bb766fb37bb36a522a", "score": "0.60933614", "text": "_attachDom(dom) {\n this.appendChild(dom);\n }", "title": "" }, { "docid": "7cc0e3c7af19dd686342ca12fa1a73b0", "score": "0.60838825", "text": "attach() {\n // If the DOM is not yet ready, try attaching again in a moment.\n if (!this.attachCore()) {\n setTimeout(() => this.attach(), 100);\n }\n }", "title": "" }, { "docid": "0fa1ecedb7a25235dcd90b4a959ce3e7", "score": "0.60801786", "text": "setElement(newElement) {\n this.#element = newElement;\n }", "title": "" }, { "docid": "489d1f0fe527a6ce558e6aeffa5393d4", "score": "0.60755354", "text": "connectedCallback(){\n\n //Though here DOM is inserted, but not rendered, so you can change the attribute \n //but you cannot manipulate the DOM \n\n //You can not programatically add or remove the element \n console.log(\"Child's Component's Connected Callback is Called!\");\n }", "title": "" }, { "docid": "f99dbd8497ec2cfaf9bca623c9ee9857", "score": "0.6064679", "text": "didInsertElement() {\n $('.dropdown-toggle').dropdown();\n this._hideActionMenu();\n }", "title": "" }, { "docid": "b6dc1e1f45b9df7410ac53122dc1c752", "score": "0.6060446", "text": "attachedCallback () {\n /**\n * Now that we are in the DOM we can append our container\n */\n this.appendChild(this._container);\n\n /**\n * Create our Map and MapView.\n */\n this.map = new Map({\n basemap: this.basemap\n });\n\n this.view = new MapView({\n container: this._container.id,\n zoom: this.zoom,\n map: this.map,\n center: this.center\n });\n\n /**\n * Dispatch a event, just like a click or keyboard\n * event, bubbling it up the DOM. This is useful for\n * inter-element communication or for notifiying\n * applications of things the element is doing.\n *\n * You must bubble the event or you cannot listen\n * to then event in some frameworks like Ember.\n */\n this.dispatchEvent(new CustomEvent('mapready', {\n bubbles: true\n }));\n\n /**\n * Set a flag so other elements can check if this\n * is ready.\n */\n this.ready = true;\n }", "title": "" }, { "docid": "5a2b68db76bcc59b46ca5e969eda794a", "score": "0.60552114", "text": "attachToDom(element, mouseZoneManager) {\n this._element = element;\n this._mouseZoneManager = mouseZoneManager;\n }", "title": "" }, { "docid": "48f4c39d230cde9039e26375d2fa582e", "score": "0.6036628", "text": "setElement(elem) {\n this.element = elem;\n }", "title": "" }, { "docid": "dbdfcbd2f719b5c3b133cb4bcd6049a3", "score": "0.6014648", "text": "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "title": "" }, { "docid": "dbdfcbd2f719b5c3b133cb4bcd6049a3", "score": "0.6014648", "text": "bind() {\n this.hook.appendChild(this.docElementNS);\n }", "title": "" }, { "docid": "8ea477a692f37c395717d1eefd6b5541", "score": "0.6011256", "text": "onAfterAttach(msg) {\n super.onAfterAttach(msg);\n this.inputElement.addEventListener('keyup', this);\n this.inputElement.addEventListener('click', this);\n this.inputElement.addEventListener('blur', this);\n }", "title": "" }, { "docid": "d16a477caea59e8f22884cfea01f8acc", "score": "0.60081345", "text": "registerDomEvents() {/*To be overridden in sub class as needed*/}", "title": "" }, { "docid": "6436ef9ba97159c1624b0c36c9798a4b", "score": "0.60023534", "text": "attachedCallback() {}", "title": "" }, { "docid": "6436ef9ba97159c1624b0c36c9798a4b", "score": "0.60023534", "text": "attachedCallback() {}", "title": "" }, { "docid": "ac289bb49f80a97385d7576eccec736a", "score": "0.59946996", "text": "function _manualOnContentChanged(element) {\n const dummyEventObj = {\n target: element,\n type: 'dummy'\n };\n onContentChanged(dummyEventObj);\n}", "title": "" }, { "docid": "baf717c29968da320d570a4b6d51240e", "score": "0.5989801", "text": "function addedToDom( node ) {\n if( !node.parentNode || node.parentNode.nodeType === 11 ){\n TweenMax.delayedCall(0.5, addedToDom, [node] );\n }else{\n TweenMax.killDelayedCallsTo(addedToDom);\n jQuery(objContent).trigger(\"added_to_dom\");\n Execute_function();\n }\n }", "title": "" }, { "docid": "d19f3537a74681944a4c19fb374535cb", "score": "0.59749484", "text": "onBeforeAttach(msg) {\n this.node.addEventListener('input', this);\n this.node.addEventListener('focus', this, true);\n this.node.addEventListener('blur', this, true);\n }", "title": "" }, { "docid": "d19f3537a74681944a4c19fb374535cb", "score": "0.59749484", "text": "onBeforeAttach(msg) {\n this.node.addEventListener('input', this);\n this.node.addEventListener('focus', this, true);\n this.node.addEventListener('blur', this, true);\n }", "title": "" }, { "docid": "29512e8f34387db71b4d83f8def7f8de", "score": "0.5970778", "text": "attach() {\n document.addEventListener('mousedown', this[onMouseDown], true);\n }", "title": "" }, { "docid": "29512e8f34387db71b4d83f8def7f8de", "score": "0.5970778", "text": "attach() {\n document.addEventListener('mousedown', this[onMouseDown], true);\n }", "title": "" }, { "docid": "6ddccdef9619cc338b2a395e6c3e490d", "score": "0.59702647", "text": "setElement(element) {\n this.element = element;\n }", "title": "" }, { "docid": "10a11ea9a49140f913b754a5d1e23c09", "score": "0.59625065", "text": "attached() {\n const that = this;\n\n super.attached();\n\n if (!that.isCompleted || !that.$.dropDownContainer) {\n return;\n }\n\n that._positionDetection.dropDownAttached('_setDropDownSize');\n that._positionDetection.checkBrowserBounds();\n }", "title": "" }, { "docid": "10a11ea9a49140f913b754a5d1e23c09", "score": "0.59625065", "text": "attached() {\n const that = this;\n\n super.attached();\n\n if (!that.isCompleted || !that.$.dropDownContainer) {\n return;\n }\n\n that._positionDetection.dropDownAttached('_setDropDownSize');\n that._positionDetection.checkBrowserBounds();\n }", "title": "" }, { "docid": "e1d09a8b4084b82deca66c73ef3c3f5f", "score": "0.59475636", "text": "attached() {\n const that = this;\n\n super.attached();\n\n if (that.isCompleted && that.dropDownAppendTo !== null && that._minimized) {\n that._dropDownParent.appendChild(that.$.view);\n }\n }", "title": "" }, { "docid": "19d9c9cfe3eff283174aee7062107bb9", "score": "0.5927114", "text": "element(element){\r\n element.setInnerContent(this.content);\r\n}", "title": "" }, { "docid": "4efb2ad2ea1152853b63e7031f41ad54", "score": "0.5925505", "text": "bind() {\n if (this.hook && this.docElementNS) {\n this.hook.appendChild(this.docElementNS);\n }\n }", "title": "" }, { "docid": "4efb2ad2ea1152853b63e7031f41ad54", "score": "0.5925505", "text": "bind() {\n if (this.hook && this.docElementNS) {\n this.hook.appendChild(this.docElementNS);\n }\n }", "title": "" }, { "docid": "f83fb2ae6ed4a5a1638e3cfbf7ad527d", "score": "0.59182936", "text": "didInsertElement() {\n this._super(...arguments);\n this.registerEvents();\n this.set('currentIndex', this.get('index'));\n this.triggerChildSlidesObserver();\n }", "title": "" }, { "docid": "33e590ceb185e78ad612a78c58df407d", "score": "0.5909071", "text": "didInsertElement () {\n this._super(...arguments)\n\n // Set the initial viewport and unblock CP chains reliant on DOM sizing\n run.schedule('sync', this, () => {\n this.get('_updateViewportTask').perform()\n this.set('_isInserted', true)\n })\n }", "title": "" }, { "docid": "fd849ff6ad87121b41ef39aea6311f01", "score": "0.59057", "text": "renderedCallback() {\n //this.template.querySelector(\"lightning-input\").focus();\n var event = new CustomEvent('awesome', {\n bubbles: true,\n detail: {\n hazcheeseburger: true\n }\n });\n window.dispatchEvent(event);\n }", "title": "" }, { "docid": "1c3f6e087c440a5fd155ad84ad6cd3c7", "score": "0.5843577", "text": "attached() {\n const that = this;\n\n super.attached();\n\n if (that._element === 'tree' || JQX.ListMenu && that instanceof JQX.ListMenu) {\n return;\n }\n\n if (that.isCompleted && that.dropDownAppendTo !== null) {\n if (that._minimized) {\n that._dropDownParent.appendChild(that.$.mainContainer);\n }\n else {\n for (let i = 0; i < that._containersInBody.length; i++) {\n that._dropDownParent.appendChild(that._containersInBody[i]);\n }\n }\n\n if (that.mode === 'dropDown') {\n if (that._dropDownParent === that.parentElement) {\n if (that._dynamicallyReparented) {\n delete that._dynamicallyReparented;\n }\n else {\n that._positionRelativeTo = null;\n }\n }\n else {\n that._positionRelativeTo = that.parentElement;\n that._dynamicallyReparented = true;\n setTimeout(function () {\n that._dropDownParent.appendChild(that);\n }, 0);\n }\n }\n }\n }", "title": "" }, { "docid": "8e42713cfc008106c68e05ca08426824", "score": "0.58407426", "text": "attached() {\n this.dispatchEvent(\n new CustomEvent(\"register-control\", {\n bubbles: true,\n composed: true\n })\n );\n }", "title": "" }, { "docid": "fbe0822634cdd8d2fb65e1cf1f9b13ae", "score": "0.5827572", "text": "attachedCallback () {\n this.appendChild(this._template.content);\n }", "title": "" }, { "docid": "15c6afb22d1647165551a710ae4bc83b", "score": "0.5813908", "text": "registerElement(element) {\n this._element = element;\n this.performTransition();\n }", "title": "" }, { "docid": "635108d4e5137199ff4693fca3fc82fe", "score": "0.57962537", "text": "attached(){\n\t\tlet instance = this;\n\t\t\n\t\tinstance.element.querySelector('form').addEventListener('submit', e => e.preventDefault());\n\t\t\n\t\tdocument.querySelector('body').addEventListener('click', (e)=> {\n\t\t\tif(e.target.classList.contains('get-quot')) return\n\t\t\tinstance.element.querySelector('.submit-label').classList.remove('show-message');\n\t\t});\n\t}", "title": "" }, { "docid": "5014d9b28b1e5401ed5233fe750eef72", "score": "0.5796059", "text": "function doStuffWithDOM(element) {\n alert(\"I received the following DOM content:\\n\" + element);\n var test = document.getElementById(\"testhere\");\n test.innerHTML = element;\n }", "title": "" }, { "docid": "4a8bc68680f1f337c393301c916bea56", "score": "0.57921773", "text": "didInsertElement() {\n this._super(...arguments);\n let chartsCanvas = this.$('.chart-canvas')[0];\n this.set('_chartsCanvas', chartsCanvas);\n }", "title": "" }, { "docid": "bbd5c23f3a4c08cd5a07af4f6385866d", "score": "0.5767356", "text": "onAttach() {}", "title": "" }, { "docid": "964ca3ac53833477ca7df62fae0b0cc4", "score": "0.57614046", "text": "attached() {\r\n const that = this;\r\n\r\n super.attached();\r\n\r\n if (that.isCompleted && that._dialog) {\r\n that._addDialogHandlers();\r\n that.getShadowRootOrBody().appendChild(that._dialog);\r\n }\r\n }", "title": "" }, { "docid": "0f78ecfb427998502e96caefbda23779", "score": "0.5731281", "text": "function onViewRendered(domEl) {\n setDOMElement(domEl);\n // from the ViewMixinEventDelegator\n if (this.delegateEvents) {\n this.delegateEvents();\n }\n\n if (this.viewDidMount) {\n this.viewDidMount();\n }\n }", "title": "" }, { "docid": "594465e4747955b45c9d13fc8abeaf60", "score": "0.57312346", "text": "function event_watch_content_area(ev){\n clog(\"inside event_watch_content_area\");\n var $el = $(ev.target||ev);\n clog(\"target_id=\"+target_id);\n\n if( ev.type == 'DOMNodeInserted' ){\n clog(\"DOMNodeInserted detected..\");\n if( !target_id ){\n target_id = $el.attr(\"id\");\n\n if( target_id )\n $(target_wrapper).unbind(\"DOMNodeInserted\", event_watch_content_area);\n\n // set new wrapper\n target_wrapper = $(\"#\"+target_id+\" > div\").attr(\"id\");\n clog(\"[NEW] target_wrapper=\"+target_wrapper);\n\n var $newparent = $(\"#\"+target_wrapper);\n var delay = 4; // in seconds\n $newparent.bind(\"DOMNodeInserted\", event_watch_very_parent);\n\n clog(\"Waiting \"+delay+' seconds...');\n setTimeout(function(){\n getSettings(function(){\n scan_main_container( $newparent )\n });\n }, delay * 1000);\n }\n }\n}", "title": "" }, { "docid": "cdc3ef0c2bc62ff904b20fed43e465bf", "score": "0.57303524", "text": "onDidChangeElementTree()/*: void*/ {\n if (this.elementTree) {\n for (let evt of this.DOM_EVENTS.split(\" \")) {\n this[_elementTree].addEventListener(evt, (e)=>this.emit(\"DOMEvent\", e), true);\n }\n //this[_hammer] = new Hammer(this[_elementTree], {domEvents: true});\n this[_hammer] = new Hammer.Manager(this[_elementTree], {\n recognizers: this.HAMMER_RECOGNIZERS,\n domEvents: true\n });\n this[_hammer].on(this.HAMMER_EVENTS, (e)=>this.emit(\"hammerEvent\", e));\n\n if (this.renderElement) {\n addTreeToElement.call(this);\n }\n }\n }", "title": "" }, { "docid": "f4322c79ba2b6f5912ca0497c329137b", "score": "0.57272583", "text": "attached() {\n this.notifyInstReady(this.canAddInst());\n }", "title": "" }, { "docid": "da8c5f6dffe505e5c2189d4af1ba7153", "score": "0.57234067", "text": "_initEvent() {\n this.eventManager.listen('wysiwygSetValueAfter', () => {\n this._unwrapDivOnHr();\n });\n }", "title": "" }, { "docid": "d6ffae0ffb24e523ab0ffa7e5fce3e80", "score": "0.5716612", "text": "function livelinks(func){\r\n\tdocument.addEventListener(\r\n\t\t'DOMNodeInserted',\r\n\t\tfunction(e){if(e.target.firstChild&&e.target.firstChild.className=='message-container')func(e.target);},\r\n\t\tfalse\r\n\t);\r\n\tfunc(document);\r\n}", "title": "" }, { "docid": "551c3facfeb13486fa7f55b8a7aae531", "score": "0.5710736", "text": "attachedCallback() {\n let template = this.owner.querySelector('template');\n this.root = this.createShadowRoot();\n let clone = document.importNode(template.content, true);\n this.root.appendChild(clone);\n this.registerElements();\n\n this.dom.packageBtn.addEventListener('click', event => { this.runTask(event.currentTarget.id); } );\n this.dom.discoverBtn.addEventListener('click', event => { this.runTask(event.currentTarget.id); } );\n this.dom.cleanBtn.addEventListener('click', event => { this.runTask(event.currentTarget.id); } );\n }", "title": "" }, { "docid": "818697bec7bacb5759b2d03e97e4c3f3", "score": "0.56868345", "text": "function elementCreated(element) {\n // if \"created\" hasn't been suspended: run created code\n if (!element.hasAttribute('suspend-created')) {\n \n }\n }", "title": "" }, { "docid": "42d416b6321293979c989f13e86c4a9d", "score": "0.5686219", "text": "attachedCallback() {\n this.insertBefore(this._tabsTemplate.content, this.firstChild);\n\n this._makeTabsFromPfTab();\n\n this.querySelector('ul').addEventListener('click', this);\n\n // Add the ul class if specified\n this.querySelector('ul').className = this.attributes.class\n ? this.attributes.class.value\n : 'nav nav-tabs';\n\n if (!this.mutationObserver) {\n this.mutationObserver = new MutationObserver(\n this._handleMutations.bind(this)\n );\n this.mutationObserver.observe(this, {\n childList: true,\n attributes: true\n });\n }\n }", "title": "" }, { "docid": "b577cc920b082db392ff293d57a3cbb9", "score": "0.5685288", "text": "didDestroyElement() {\n\t\tconsole.log('didDestroyElement ejecutado!');\n\t}", "title": "" }, { "docid": "2c053f6dce0b6383b49aca5ed184c303", "score": "0.56847817", "text": "@action\n setupElement(element) {\n this.componentElement = element;\n\n if (this.isLastAdded) {\n this.onOpenColumn(this.column);\n next(() => {\n this.scrollToElement();\n this.highlightElement();\n });\n }\n }", "title": "" }, { "docid": "7e76bcd3653d9e20b011e46073d14d9a", "score": "0.5674239", "text": "function insertDom(element){\n\n}", "title": "" }, { "docid": "0d131c87e6590f20603dad0046091d0c", "score": "0.5663295", "text": "connectedCallback() {\n // Do things when component is added to the DOM\n }", "title": "" }, { "docid": "366c714108ab4f217d851d4c29ded748", "score": "0.5651341", "text": "inserted(el, binding) {\n const onClick = e => directive(e, el, binding);\n\n const onMousedown = e => {\n el._clickOutside.lastMousedownWasOutside = checkEvent(e, el, binding);\n };\n\n handleShadow(el, app => {\n app.addEventListener('click', onClick, true);\n app.addEventListener('mousedown', onMousedown, true);\n });\n el._clickOutside = {\n lastMousedownWasOutside: true,\n onClick,\n onMousedown\n };\n }", "title": "" }, { "docid": "fdff50bb693108dd8893ab8149d02b05", "score": "0.56388813", "text": "componentDidLoad() {\n this.initDragAndDrop();\n this.element.addEventListener(\"keydown\", this.handleKeyDown.bind(this));\n this.element.addEventListener(\"click\", this.handleClick.bind(this));\n }", "title": "" } ]
f37cc4641455085d405447011c0faf5d
A helper function that will draw an object given it's model matrix every object has an corresponding model matrix.
[ { "docid": "3d4b13a3916f4c19ac85332672d7f9b2", "score": "0.6973132", "text": "function drawObject(model, obj){\n gl.uniformMatrix4fv (program.uModelT, false, model);\n gl.bindVertexArray(obj.VAO);\n gl.drawElements(gl.TRIANGLES, obj.indices.length, gl.UNSIGNED_SHORT, 0);\n}", "title": "" } ]
[ { "docid": "48ce603534b15d69002ff91056f1d3ce", "score": "0.6986856", "text": "function drawObj(gl, n, prog, mvpMatrix, modelMatrix, normalMatrix, obj, canvas){ \n mvpMatrix.setPerspective(30, canvas.width/canvas.height, 1, 400);\n mvpMatrix.lookAt(g_eyeX, g_eyeY, g_eyeZ, g_laX, g_laY, g_laZ, 0, 1, 0);\n modelMatrix.setTranslate(obj.posx, obj.posy, obj.posz);\n modelMatrix.translate(obj.rotox, obj.rotoy, obj.rotoz);\n modelMatrix.rotate(obj.rotx, 1,0,0);\n modelMatrix.rotate(obj.roty, 0,1,0);\n modelMatrix.rotate(obj.rotz, 0,0,1);\n modelMatrix.translate(-obj.rotox, -obj.rotoy, -obj.rotoz);\n modelMatrix.scale(obj.scalex, obj.scaley, obj.scalez);\n normalMatrix.setInverseOf(modelMatrix);\n normalMatrix.transpose();\n mvpMatrix.multiply(modelMatrix);\n gl.uniformMatrix4fv(prog.u_ModelMatrix, false, modelMatrix.elements);\n gl.uniformMatrix4fv(prog.u_MvpMatrix, false, mvpMatrix.elements);\n gl.uniformMatrix4fv(prog.u_NormalMatrix, false, normalMatrix.elements);\n gl.drawElements(gl.TRIANGLES, n, gl.UNSIGNED_SHORT, 0);\n}", "title": "" }, { "docid": "e31a9b291625c9603c784e42a17362ec", "score": "0.6954671", "text": "function drawObj(gl, u_ModelMatrix, u_NormalMatrix, n) {\r\n\r\n pushMatrix(modelMatrix);\r\n\r\n gl.uniformMatrix4fv(u_ModelMatrix, 0, modelMatrix.elements);\r\n g_normalMatrix.setInverseOf(modelMatrix);\r\n g_normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_NormalMatrix, 0, g_normalMatrix.elements);\r\n gl.drawElements(gl.TRIANGLES, n, gl.UNSIGNED_BYTE, 0);\r\n\r\n modelMatrix = popMatrix();\r\n}", "title": "" }, { "docid": "4614ea71b6e0b7cf8c7455f970a7a168", "score": "0.6446508", "text": "function Models() {\n this.set = new Array();\n this.localTrans = mat4.create();\n mat4.identity(this.localTrans);\n this.add = add;\n function add(model) {\n if (Object.prototype.toString.call(model) === '[object Array]')\n this.set = this.set.concat(model)\n else\n this.set.push(model);\n }\n\n this.render = render;\n function render() {\n Matrices.push(Matrices.model);\n mat4.multiply(Matrices.model, this.localTrans);\n for (var i = 0; i < this.set.length; ++i) {\n this.set[i].render();\n }\n Matrices.model = Matrices.pop();\n }\n\n this.create = create;\n function create(type, buffers, ind) {\n var m = model.create(type, buffers, ind);\n this.set.push(m);\n }\n\n this.setMaterialColor = setMaterialColor;\n function setMaterialColor(id) {\n for (var i = 0; i < this.set.length; ++i) {\n this.set[i].setMaterialColor(id);\n }\n }\n\n this.setMeshMaterialColor = setMeshMaterialColor;\n function setMeshMaterialColor(mesh, id) {\n\n this.set[mesh].setMaterialColor(id);\n }\n\n this.setMaterial = setMaterial;\n function setMaterial(id, mat) {\n this.set[id].setMaterial(mat);\n }\n\n Models.handleLoadedModel = function (objectData, models) {\n for (var i = 0; i < objectData.model.length; i++) {\n var m = new Model();\n var aux = new Array();\n aux.push(new Float32Array(objectData.model[i].position));\n\n if (objectData.model[i].normal != undefined)\n aux.push(new Float32Array(objectData.model[i].normal));\n else\n aux.push([]);\n\n if (objectData.model[i].texCoord != undefined)\n aux.push(new Float32Array(objectData.model[i].texCoord));\n else\n aux.push([]);\n\n m.create(gl.TRIANGLES, aux, new Uint16Array(objectData.model[i].indices));\n\n if (objectData.model[i].material != undefined) {\n\n var mat = new Material();\n if (objectData.model[i].material.diffuse != undefined)\n mat.diffuse = objectData.model[i].material.diffuse;\n if (objectData.model[i].material.specular != undefined)\n mat.specular = objectData.model[i].material.specular;\n if (objectData.model[i].material.shininess != undefined)\n mat.shininess = objectData.model[i].material.shininess;\n if (objectData.model[i].material.ambient != undefined)\n mat.ambient = objectData.model[i].material.ambient;\n if (objectData.model[i].material.texture != undefined)\n mat.setTexture(objectData.model[i].material.texture);\n m.setMaterial(mat);\n }\n\n var matrix = mat4.create();\n mat4.identity(matrix);\n var tmpX = 1 / Math.abs(objectData.boundingBox[3] - objectData.boundingBox[0]);\n var tmpY = 1 / Math.abs(objectData.boundingBox[4] - objectData.boundingBox[1]);\n var tmpZ = 1 / Math.abs(objectData.boundingBox[5] - objectData.boundingBox[2]);\n var tmp = tmpX < tmpY ? tmpY : tmpX;\n tmp = tmp < tmpZ ? tmpZ * 2 : tmp * 2;\n mat4.scale(matrix, vec3.create([tmp, tmp, tmp]));\n mat4.translate(matrix, vec3.create([-(objectData.boundingBox[3] + objectData.boundingBox[0]) * 0.5,\n -(objectData.boundingBox[4] + objectData.boundingBox[1]) * 0.5,\n -(objectData.boundingBox[5] + objectData.boundingBox[2]) * 0.5]));\n\n m.setLocalTrans(matrix);\n models.add(m);\n }\n }\n}", "title": "" }, { "docid": "79e949ef6b7992e139121600593fc79c", "score": "0.63144976", "text": "function DrawObject(data, matrixStack, pointMode, rAngle, useAngle)\n{\n\tif (!pointMode) { pointMode = false; }\n\tif (!useAngle) { useAngle = false; }\n\tdata.model.PointMode = pointMode;\n\t\n\t//Inherit matrices.\n\tmatrixStack.push();\n\t\n\tif(useAngle)\n\t{\n\t\tmatrixStack.rotate(data.baseAngle + rAngle, data.axis);\n\t} \n\telse\n\t{\n\t\tmatrixStack.rotate(data.baseAngle + (data.timeScale * time), data.axis);\n\t}\n\t\n\t//Apply transformation matrices using data.\n\tmatrixStack.translate(data.translate[0], data.translate[1], data.translate[2]);\n\tmatrixStack.scale(data.scale[0], data.scale[1], data.scale[2]);\n\t\n\t//Set the program.\n\tgl.useProgram(data.model.program);\n\t\n\t//Pass in matrix information.\n\tgl.uniformMatrix4fv(data.model.uniforms.ModelView, false, flatten(matrixStack.current()));\n\tgl.uniformMatrix4fv(data.model.uniforms.Perspective, false, flatten(Perspective));\n\tgl.uniform4fv(data.model.uniforms.color, flatten(data.color));\n\t\n\t//Actually render.\n\tdata.model.render();\n\t\n\t//Handle child objects.\n\tfor (var i = 0; i < data.children.length; i++)\n\t{\n\t\tswitch(data.children[i].type)\n\t\t{\n\t\t\tcase \"Cylinder\":\n\t\t\t\tif(data.children[i].name == \"AxisA\"){ DrawObject(Cylinders[data.children[i].name], matrixStack, pointMode, rAngle1, true); }\n\t\t\t\telse if(data.children[i].name == \"AxisB\"){ DrawObject(Cylinders[data.children[i].name], matrixStack, pointMode, rAngle2, true); }\n\t\t\t\telse if(data.children[i].name == \"AxisC\"){ DrawObject(Cylinders[data.children[i].name], matrixStack, pointMode, rAngle3, true); }\n\t\t\t\telse { DrawObject(Cylinders[data.children[i].name], matrixStack, pointMode); }\n\t\t\t\tbreak;\n\t\t\tcase \"Sphere\": DrawObject(Spheres[data.children[i].name], matrixStack, pointMode); break;\n\t\t\tcase \"Ring\": DrawObject(Rings[data.children[i].name], matrixStack, pointMode); break;\n\t\t}\n\t}\n\t\n\t//Clear the stack.\n\tmatrixStack.pop();\n}", "title": "" }, { "docid": "5645ada7ffe4af87da1d578cef63df14", "score": "0.6285019", "text": "function draw_object(matrix,positionBuffer,color)\n {\n\tsetMatrixUniforms(matrix);\n\tgl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, positionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\tgl.bindBuffer(gl.ARRAY_BUFFER, color);\n gl.vertexAttribPointer(shaderProgram.vertexColorAttribute,color.itemSize,gl.FLOAT,false, 0, 0);\n\tgl.drawArrays(gl.TRIANGLE_FAN, 0, positionBuffer.numItems);\n\n }", "title": "" }, { "docid": "efd5b5238c03a7cb2124d12f77c6a813", "score": "0.6097195", "text": "function draw() {\n gl.viewport(0, 0, c_width, c_height);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n transforms.updatePerspective();\n try {\n for (var i = 0; i < Scene.objects.length; i++) {\n var object = Scene.objects[i];\n if (object.hidden == true) continue;\n transforms.calculateModelView();\n transforms.push();\n transforms.setMatrixUniforms();\n transforms.pop(); //Setting uniforms \n gl.uniform4fv(Program.uMaterialDiffuse, object.diffuse);\n gl.uniform4fv(Program.uMaterialAmbient, object.ambient);\n gl.uniform1i(Program.uWireframe, object.wireframe); //Setting attributes \n gl.enableVertexAttribArray(Program.aVertexPosition);\n gl.disableVertexAttribArray(Program.aVertexNormal);\n gl.disableVertexAttribArray(Program.aVertexColor);\n gl.bindBuffer(gl.ARRAY_BUFFER, object.vbo);\n gl.vertexAttribPointer(Program.aVertexPosition, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(Program.aVertexPosition);\n gl.uniform1i(Program.uUseVertexColor, useVertexColors);\n if (object.scalars != null && useVertexColors) {\n gl.enableVertexAttribArray(Program.aVertexColor);\n gl.bindBuffer(gl.ARRAY_BUFFER, object.cbo);\n gl.vertexAttribPointer(Program.aVertexColor, 4, gl.FLOAT, false, 0, 0);\n }\n if (object.texture_coords) {\n gl.enableVertexAttribArray(Program.aVertexTextureCoords);\n gl.bindBuffer(gl.ARRAY_BUFFER, object.tbo);\n gl.vertexAttribPointer(Program.aVertexTextureCoords, 2, gl.FLOAT, false, 0, 0);\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, texture.tex);\n gl.uniform1i(Program.uSampler, 0);\n gl.activeTexture(gl.TEXTURE1);\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, cubeTexture);\n gl.uniform1i(Program.uCubeSampler, 1);\n }\n if (!object.wireframe) {\n gl.bindBuffer(gl.ARRAY_BUFFER, object.nbo);\n gl.vertexAttribPointer(Program.aVertexNormal, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(Program.aVertexNormal);\n }\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, object.ibo);\n if (object.wireframe) {\n gl.drawElements(gl.LINES, object.indices.length, gl.UNSIGNED_SHORT, 0);\n } else {\n gl.drawElements(gl.TRIANGLES, object.indices.length, gl.UNSIGNED_SHORT, 0);\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n }\n } catch (err) {\n alert(err);\n console.error(err.description);\n }\n}", "title": "" }, { "docid": "8b00841722009fcbb58dfd5d703e5876", "score": "0.6069205", "text": "function drawObject(gameObject) {\n // gameObject:\n\n // Set the drawing Position to the \"identity\" point, which is\n // the center of the scene.\n mat4.identity(mvMatrix);\n\n // Now move the drawing Position a bit to where we want to start\n // drawing the gameObject.\n mat4.translate(mvMatrix, gameObject.Position);\n\n // Save the current matrix, then rotate before we draw.\n mvPushMatrix();\n mat4.rotate(mvMatrix, degToRad(gameObject.Rotation[0]), [1, 0, 0]);\n mat4.rotate(mvMatrix, degToRad(gameObject.Rotation[1]), [0, 1, 0]);\n mat4.rotate(mvMatrix, degToRad(gameObject.Rotation[2]), [0, 0, 1]);\n\n // Set the vertex Positions attribute for the gameObject vertices.\n gl.bindBuffer(gl.ARRAY_BUFFER, gameObject.VertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, gameObject.VertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n // Set the normals attribute for the vertices.\n gl.bindBuffer(gl.ARRAY_BUFFER, gameObject.VertexNormalBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, gameObject.VertexNormalBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n // Set the texture coordinates attribute for the vertices.\n gl.bindBuffer(gl.ARRAY_BUFFER, gameObject.VertexTextureCoordBuffer);\n gl.vertexAttribPointer(shaderProgram.textureCoordAttribute, gameObject.VertexTextureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n // Activate textures\n gl.activeTexture(gl.TEXTURE0);\n gl.bindTexture(gl.TEXTURE_2D, gameObject.Texture);\n gl.uniform1i(shaderProgram.samplerUniform, 0);\n\n // Draw the gameObject.\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gameObject.VertexIndexBuffer);\n setMatrixUniforms();\n gl.drawElements(gl.TRIANGLES, gameObject.VertexIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n // Restore the original matrix\n mvPopMatrix();\n}", "title": "" }, { "docid": "df495877d74cc38a3936dc1b4066de12", "score": "0.60639894", "text": "function drawCarlinga(model_matrix) {\n\n mo_matrix1 = m4.copy(model_matrix);\n var scale = 0.05;\n mo_matrix1 = m4.scale(mo_matrix1, scale, scale, scale);\n mo_matrix1 = m4.yRotate(mo_matrix1, Math.PI);\n gl.uniformMatrix4fv(_Mmatrix, false, mo_matrix1);\n worldInverseTransposeMatrix = m4.transpose(m4.inverse(mo_matrix1));\n gl.uniformMatrix4fv(_worldInverseTranspose, false, worldInverseTransposeMatrix);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, color_buffer4A);\n gl.vertexAttribPointer(_ka, 4, gl.FLOAT, false,0,0) ; \n gl.enableVertexAttribArray(_ka);\n gl.bindBuffer(gl.ARRAY_BUFFER, color_buffer4D);\n gl.vertexAttribPointer(_kd, 4, gl.FLOAT, false,0,0) ; \n gl.enableVertexAttribArray(_kd);\n gl.bindBuffer(gl.ARRAY_BUFFER, color_buffer4S);\n gl.vertexAttribPointer(_ks, 4, gl.FLOAT, false,0,0) ; \n gl.enableVertexAttribArray(_ks);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, normal_buffer4);\n gl.vertexAttribPointer(_normal, 3, gl.FLOAT, false,0,0) ; \n gl.enableVertexAttribArray(_normal);\n\n gl.bindBuffer(gl.ARRAY_BUFFER, vertex_buffer4);\n gl.vertexAttribPointer(_position, 3, gl.FLOAT, false,0,0); \n gl.enableVertexAttribArray(_position);\n\n gl.drawArrays(gl.TRIANGLES, 0, vertices4.length/3);\n\n}", "title": "" }, { "docid": "81aca336ca579b5d124dbfe31e84b819", "score": "0.60522014", "text": "function drawShape(gl, model, width, height, depth, viewProjMatrix, u_MvpMatrix, u_NormalMatrix) {\n\n // Scale dimensions\n g_modelMatrix.scale(width, height, depth);\n\n // Calculate model view project matrix and pass it to u_MvpMatrix\n g_mvpMatrix.set(viewProjMatrix);\n g_mvpMatrix.multiply(g_modelMatrix);\n gl.uniformMatrix4fv(u_MvpMatrix, false, g_mvpMatrix.elements);\n\n // Calculate normal transformation matrix and pass it to u_NormalMatrix\n g_normalMatrix.setInverseOf(g_modelMatrix);\n g_normalMatrix.transpose();\n gl.uniformMatrix4fv(u_NormalMatrix, false, g_normalMatrix.elements);\n\n // Draw the shape\n gl.drawElements(gl.TRIANGLES, model, gl.UNSIGNED_BYTE, 0);\n}", "title": "" }, { "docid": "75594e802ba52206d6cd51193e9f8c53", "score": "0.60142183", "text": "function drawTeapot(){\n let modelTeapot = glMatrix.mat4.create();\n glMatrix.mat4.translate(modelTeapot, modelTeapot, [0, 0.5, 0 ]);\n drawObject(modelTeapot, myTeapot);\n}", "title": "" }, { "docid": "9aeae159a25257b8d8c6c6d2d7416879", "score": "0.59807736", "text": "draw()\n\t{\n\t\t//Sends the mvMatrix to the shader\n\t\tglContext.uniformMatrix4fv(prg.mvMatrixUniform, false, this.mvMatrix);\n\t\t//Links and sends the vertexBuffer to the shader, defining the format to send it as\n\t\tglContext.bindBuffer(glContext.ARRAY_BUFFER, this.vertexBuffer);\n\t\tglContext.vertexAttribPointer(prg.vertexPositionAttribute, 3, glContext.FLOAT, false, 0, 0);\n\t\t//Links and sends the colorBuffer to the shader, defining the format to send it as\n\t\tglContext.bindBuffer(glContext.ARRAY_BUFFER, this.colorBuffer);\n\t\tglContext.vertexAttribPointer(prg.colorAttribute, 4, glContext.FLOAT, false, 0, 0);\n\t\t//Links the indexBuffer with the shader\n\t\tglContext.bindBuffer(glContext.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n\t\t//Based on the render variable\n\t\tif(render)\n\t\t{\n\t\t\t//Renders the objet as a wireframe\n\t\t\tglContext.drawElements(glContext.LINES, this.indices.length, glContext.UNSIGNED_SHORT,0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Renders the object as triangles\n\t\t\tglContext.drawElements(glContext.TRIANGLES, this.indices.length, glContext.UNSIGNED_SHORT,0);\n\t\t}\n\t}", "title": "" }, { "docid": "2978ab1137594ebe7cacfae5e8eaa6b8", "score": "0.59135145", "text": "function drawObjects(){\r\n\r\n\t// lamp\r\n\tsetObjectModel(lampModel,color('rgb(200,200,200)'),45,0,1500,0);\r\n\tsetObjectModel(lampModel,color('rgb(200,200,200)'),45,-1500,-1500,0);\r\n\r\n\t// building modoki\r\n\tlet buildingPos = 1800;\r\n\tlet buildingSize = 950;\r\n\t//setObjectAndDetectCollision(color('rgb(50,50,50)'),0,0,buildingSize,100);\r\n\tsetObjectAndDetectCollision(color('rgb(50,50,50)'),buildingPos,buildingPos,buildingSize,100);\r\n\tsetObjectAndDetectCollision(color('rgb(70,70,70)'),-buildingPos,0,buildingSize,100);\r\n\tsetObjectAndDetectCollision(color('rgb(60,60,60)'),buildingPos,0,buildingSize,100);\r\n\tsetObjectAndDetectCollision(color('rgb(60,60,60)'),buildingPos,-buildingPos,buildingSize,100);\r\n\tsetObjectAndDetectCollision(color('rgb(90,90,90)'),-buildingPos,buildingPos,buildingSize,100);\r\n\tsetObjectAndDetectCollision(color('rgb(100,100,100)'),0,-buildingPos,buildingSize,100);\r\n\r\n}", "title": "" }, { "docid": "15990feedb179a832af6f954e4cc9816", "score": "0.5909426", "text": "function creatingObjects() {\n for (var y = 0; y < matrix.length; y++) {\n for (var x = 0; x < matrix[y].length; x++) {\n if (matrix[y][x] == 2) {\n var rabbit = new Rabbit(x, y);\n rabbits.push(rabbit);\n rabbitscount++;\n } else if (matrix[y][x] == 1) {\n var carrot = new Carrot(x, y);\n carrots.push(carrot);\n carrotscount++;\n } else if (matrix[y][x] == 3) {\n var predator = new Predator(x, y);\n predators.push(predator);\n predatorscount++;\n } else if (matrix[y][x] == 4) {\n var farmer = new Farmer(x, y);\n farmers.push(farmer);\n farmerscount++;\n } else if (matrix[y][x] == 5) {\n var hunter = new Hunter(x, y);\n hunters.push(hunter);\n hunterscount++;\n } else if (matrix[y][x] == 6) {\n var omnivorous = new Omnivorous(x, y);\n omnivorouses.push(omnivorous);\n omnivorousescount++;\n }\n }\n }\n}", "title": "" }, { "docid": "bc014409c3c864a6c8959678435e1c07", "score": "0.5902975", "text": "function drawModel(onlyDisplay) {\n\t\n\telementTitles = [];\n\tframes = [];\n\tsymbols = [];\n\t\n\tif(onlyDisplay) {\n\t\tpaper.clear(); \n\t\tcreateCanvas(); \n\t}\n\telse {\n\t\tcreateEditCanvas();\n\t}\n\t\n\t$('#logicalModelVertices v').each(function(){\n\t\t\n\t\tvar vertexId =$(this).attr(\"vertexId\");\n\t\tvar elementType = $(this).find(\"elementType\").text(); \n\t\tvar elementName = $(this).find(\"elementName\").text(); \n\t\tvar detail = $(this).find(\"detail\").text();\n\t \tvar x = $(this).find(\"x\").text();\n\t \tvar y = $(this).find(\"y\").text();\n\t \tvar usage = $(this).find(\"usage\").text();\n\t \tvar description = $(this).find(\"description\").text();\n\t \tdrawElement(elementType, onlyDisplay, Number(x), Number(y), elementName, vertexId, detail, usage, description); \t\n\t});\n\t\n\t$('#logicalModelEdges e').each(function(edge){\n\t\tvar headId = $(this).find(\"h\").text();\n\t\tvar tailId = $(this).find(\"t\").text();\n\t\tvar head = getVertexById(headId);\n\t\tvar tail = getVertexById(tailId);\n\t\tif(head && tail) {\n\t\t\tif(onlyDisplay) paper.connection(head, tail); else connections.push(editPaper.connection(head, tail));\n\t\t}\n\t}); \n}", "title": "" }, { "docid": "f8744b6d29af9c6a2dde59d30c78087d", "score": "0.5881434", "text": "function drawShapes(matrix, offset){\n matrix.forEach((row, y)=>{\n row.forEach((value, x)=>{\n if(value!==0){\n cxt.fillStyle=color[value];\n cxt.fillRect(x+offset.x,y+offset.y,1,1);\n }\n });\n });\n}", "title": "" }, { "docid": "14d1921f0ca942c31802e9450478dedc", "score": "0.58517337", "text": "function MatrixSceneObject(geometry, surface, matrix, color) {\n this.matrix = matrix;\n this.update = function (dt) {};\n\n this.render = function (sceneProperties) {\n surface.apply(new ObjectProperties(this.matrix, color), sceneProperties);\n geometry.render()\n };\n}", "title": "" }, { "docid": "eba6ee45ab4453d5a3190f90bdedb27b", "score": "0.58280176", "text": "function drawCube(modelMatrix)\n{\n\n // bind the shader\n gl.useProgram(shader);\n\n // get the index for the a_Position attribute defined in the vertex shader\n var positionIndex = gl.getAttribLocation(shader, 'a_Position');\n if (positionIndex < 0) {\n console.log('Failed to get the storage location of a_Position');\n return;\n }\n\n var colorIndex = gl.getAttribLocation(shader, 'a_Color');\n if (colorIndex < 0) {\n\t console.log('Failed to get the storage location of a_');\n\t return;\n\t }\n\n // \"enable\" the a_position attribute\n gl.enableVertexAttribArray(positionIndex);\n gl.enableVertexAttribArray(colorIndex);\n\n // bind buffers for points\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n gl.vertexAttribPointer(positionIndex, 3, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexColorBuffer);\n gl.vertexAttribPointer(colorIndex, 4, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n\n // set uniform in shader for projection * view * model transformation\n var transform = new THREE.Matrix4().multiply(projection).multiply(view).multiply(modelMatrix);\n var transformLoc = gl.getUniformLocation(shader, \"transform\");\n gl.uniformMatrix4fv(transformLoc, false, transform.elements);\n\n gl.drawArrays(gl.TRIANGLES, 0, 36);\n\n // unbind shader and \"disable\" the attribute indices\n // (not really necessary when there is only one shader)\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n gl.disableVertexAttribArray(positionIndex);\n gl.disableVertexAttribArray(colorIndex);\n gl.useProgram(null);\n\n}", "title": "" }, { "docid": "ce1689b56ea18867a198d4a8fcef84df", "score": "0.57619584", "text": "function renderModels() {\n\n // construct the model transform matrix, based on model state\n function makeModelTransform(currModel) {\n var zAxis = vec3.create(), sumRotation = mat4.create(), temp = mat4.create(), negCenter = vec3.create();\n\n vec3.normalize(zAxis, vec3.cross(zAxis, currModel.xAxis, currModel.yAxis)); // get the new model z axis\n mat4.set(sumRotation, // get the composite rotation\n currModel.xAxis[0], currModel.yAxis[0], zAxis[0], 0,\n currModel.xAxis[1], currModel.yAxis[1], zAxis[1], 0,\n currModel.xAxis[2], currModel.yAxis[2], zAxis[2], 0,\n 0, 0, 0, 1);\n vec3.negate(negCenter, currModel.center);\n mat4.multiply(sumRotation, sumRotation, mat4.fromTranslation(temp, negCenter)); // rotate * -translate\n mat4.multiply(sumRotation, mat4.fromTranslation(temp, currModel.center), sumRotation); // translate * rotate * -translate\n mat4.fromTranslation(mMatrix, currModel.translation); // translate in model matrix\n mat4.multiply(mMatrix, mMatrix, sumRotation); // rotate in model matrix\n } // end make model transform\n\n var hMatrix = mat4.create(); // handedness matrix\n var pMatrix = mat4.create(); // projection matrix\n var vMatrix = mat4.create(); // view matrix\n var mMatrix = mat4.create(); // model matrix\n var hpvMatrix = mat4.create(); // hand * proj * view matrices\n var hpvmMatrix = mat4.create(); // hand * proj * view * model matrices\n const highlightMaterial = { ambient: [0.5, 0.5, 0], diffuse: [0.5, 0.5, 0], specular: [0, 0, 0], n: 1 }; // hlht mat\n\n window.requestAnimationFrame(renderModels); // set up frame render callbacks\n\n gl.clear(/*gl.COLOR_BUFFER_BIT |*/ gl.DEPTH_BUFFER_BIT); // clear frame/depth buffers\n\n // set up handedness, projection and view\n mat4.fromScaling(hMatrix, vec3.fromValues(-1, 1, 1)); // create handedness matrix\n mat4.perspective(pMatrix, 0.5 * Math.PI, 1, 0.1, 10); // create projection matrix\n mat4.lookAt(vMatrix, Eye, Center, Up); // create view matrix\n mat4.multiply(hpvMatrix, hMatrix, pMatrix); // handedness * projection\n mat4.multiply(hpvMatrix, hpvMatrix, vMatrix); // handedness * projection * view\n\n gl.uniform1f(uTexIndexLoc, 0);\n gl.uniform1f(uTexAlphaLoc, textureAlphas[0]);\n\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n gl.depthMask(true);\n gl.enable(gl.BLEND);\n\n // render each triangle set\n var currSet, setMaterial; // the tri set and its material properties\n for (var whichTriSet = 0; whichTriSet < numTriangleSets; whichTriSet++) {\n currSet = inputTriangles[whichTriSet];\n\n // make model transform, add to view project\n makeModelTransform(currSet);\n mat4.multiply(hpvmMatrix, hpvMatrix, mMatrix); // handedness * project * view * model\n gl.uniformMatrix4fv(mMatrixULoc, false, mMatrix); // pass in the m matrix\n gl.uniformMatrix4fv(pvmMatrixULoc, false, hpvmMatrix); // pass in the hpvm matrix\n\n // reflectivity: feed to the fragment shader\n if (inputTriangles[whichTriSet].on)\n setMaterial = highlightMaterial; // highlight material\n else\n setMaterial = currSet.material; // normal material\n gl.uniform3fv(ambientULoc, setMaterial.ambient); // pass in the ambient reflectivity\n gl.uniform3fv(diffuseULoc, setMaterial.diffuse); // pass in the diffuse reflectivity\n gl.uniform3fv(specularULoc, setMaterial.specular); // pass in the specular reflectivity\n gl.uniform1f(shininessULoc, setMaterial.n); // pass in the specular exponent\n gl.uniform1f(uTexIndexLoc, whichTriSet);\n gl.uniform1f(uTexAlphaLoc, textureAlphas[whichTriSet]);\n\n // vertex buffer: activate and feed into vertex shader\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffers[whichTriSet]); // activate\n gl.vertexAttribPointer(vPosAttribLoc, 3, gl.FLOAT, false, 0, 0); // feed\n gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffers[whichTriSet]); // activate\n gl.vertexAttribPointer(vNormAttribLoc, 3, gl.FLOAT, false, 0, 0); // feed\n\n gl.bindBuffer(gl.ARRAY_BUFFER, uvBuffers[whichTriSet]);\n gl.vertexAttribPointer(vTexCoordLoc, 2, gl.FLOAT, false, 0, 0);\n\n // triangle buffer: activate and render\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[whichTriSet]); // activate\n gl.drawElements(gl.TRIANGLES, 3 * triSetSizes[whichTriSet], gl.UNSIGNED_SHORT, 0); // render\n\n } // end for each triangle set\n\n // render each sphere\n var sphere, currentMaterial, instanceTransform = mat4.create(); // the current sphere and material\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffers[vertexBuffers.length - 1]); // activate vertex buffer\n gl.vertexAttribPointer(vPosAttribLoc, 3, gl.FLOAT, false, 0, 0); // feed vertex buffer to shader\n gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffers[normalBuffers.length - 1]); // activate normal buffer\n gl.vertexAttribPointer(vNormAttribLoc, 3, gl.FLOAT, false, 0, 0); // feed normal buffer to shader\n\n gl.bindBuffer(gl.ARRAY_BUFFER, uvBuffers[uvBuffers.length - 1]);\n gl.vertexAttribPointer(vTexCoordLoc, 2, gl.FLOAT, false, 0, 0);\n\n gl.uniform1f(uTexIndexLoc, inputTriangles.length);\n gl.uniform1f(uTexAlphaLoc, textureAlphas[inputTriangles.length]);\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[triangleBuffers.length - 1]); // activate tri buffer\n\n for (var whichSphere = 0; whichSphere < numSpheres; whichSphere++) {\n sphere = inputSpheres[whichSphere];\n\n // define model transform, premult with pvmMatrix, feed to shader\n makeModelTransform(sphere);\n mat4.fromTranslation(instanceTransform, vec3.fromValues(sphere.x, sphere.y, sphere.z)); // recenter sphere\n mat4.scale(mMatrix, mMatrix, vec3.fromValues(sphere.r, sphere.r, sphere.r)); // change size\n mat4.multiply(mMatrix, instanceTransform, mMatrix); // apply recenter sphere\n hpvmMatrix = mat4.multiply(hpvmMatrix, hpvMatrix, mMatrix); // premultiply with hpv matrix\n gl.uniformMatrix4fv(mMatrixULoc, false, mMatrix); // pass in model matrix\n gl.uniformMatrix4fv(pvmMatrixULoc, false, hpvmMatrix); // pass in handed project view model matrix\n\n // reflectivity: feed to the fragment shader\n if (sphere.on)\n currentMaterial = highlightMaterial;\n else\n currentMaterial = sphere;\n gl.uniform3fv(ambientULoc, currentMaterial.ambient); // pass in the ambient reflectivity\n gl.uniform3fv(diffuseULoc, currentMaterial.diffuse); // pass in the diffuse reflectivity\n gl.uniform3fv(specularULoc, currentMaterial.specular); // pass in the specular reflectivity\n gl.uniform1f(shininessULoc, currentMaterial.n); // pass in the specular exponent\n gl.uniform1f(uTexIndexLoc, inputTriangles.length + whichSphere);\n gl.uniform1f(uTexAlphaLoc, textureAlphas[whichSphere + inputTriangles.length]);\n\n // draw a transformed instance of the sphere\n gl.drawElements(gl.TRIANGLES, triSetSizes[triSetSizes.length - 1], gl.UNSIGNED_SHORT, 0); // render\n } // end for each sphere\n} // end render model", "title": "" }, { "docid": "09d4605ee2de2c73b1d7b087e87932e8", "score": "0.5744236", "text": "function drawCube(index, matrix, trans, cubeColor) {\n matrix = mat4()\n matrix = mult(matrix, projectionMatrix) // create perspective \n matrix = mult(matrix, rotate(rotDeg, [0, 1, 0])) // set up camera rotation\n matrix = mult(matrix, translate(vec3(x,y,z)))\n matrix = mult(matrix, translate(trans)) // move 8 cubes into positions\n\n // set color of cubes and draw\n gl.uniform4fv(color, flatten(cubeColor));\n gl.uniformMatrix4fv(modelViewMatrix, false, flatten(matrix))\n gl.drawArrays(gl.TRIANGLES, 0, 36);\n\n // set color of outlines to white and draw (Req. 4)\n gl.uniform4fv(color, flatten([1.0, 1.0, 1.0, 1.0]));\n gl.drawArrays(gl.LINES, 36, 24)\n}", "title": "" }, { "docid": "4d362aae59432405013519164662356a", "score": "0.57397485", "text": "draw() {\n // clear the game board\n const ctx = this.ctx;\n ctx.fillStyle = '#000000';\n ctx.fillRect(0, 0, this.width, this.height);\n\n // ask everyone to draw themselves\n this.objects.forEach(o => o.draw && o.draw(this.ctx));\n }", "title": "" }, { "docid": "946fed0191775ee7e8de0959fa9f1acf", "score": "0.5730588", "text": "render() {\n var x, y, field, cx, cy, color, stroke;\n this.context.fillStyle = \"#000000\";\n this.context.lineWidth = 1;\n this.context.lineCap = \"square\";\n this.context.fillRect(0, 0, this.model.width * this.model.csize, this.model.height * this.model.csize);\n\n // grid\n for(x = 0; x < this.model.width; x += 1) {\n for(y = 0; y < this.model.height; y += 1) {\n cx = (x * this.model.csize) + 0.5;\n cy = (y * this.model.csize) + 0.5;\n\n this.context.strokeStyle = \"#111111\";\n this.context.beginPath();\n this.context.rect(cx, cy, this.model.csize, this.model.csize);\n this.context.stroke();\n this.context.closePath();\n }\n }\n\n // obstacles\n for(x = 0; x < this.model.width; x += 1) {\n for(y = 0; y < this.model.height; y += 1) {\n field = this.model.getField(x, y);\n cx = (x * this.model.csize) + 0.5;\n cy = (y * this.model.csize) + 0.5;\n\n color = null;\n switch(field) {\n case 1: \n color = \"#003300\";\n stroke = \"#00ff00\";\n break;\n\n case 2: \n color = \"#330000\";\n stroke = \"#ff0000\";\n break;\n }\n\n if(color) {\n this.context.strokeStyle = stroke;\n this.context.fillStyle = color;\n this.context.beginPath();\n this.context.rect(cx, cy, this.model.csize, this.model.csize);\n this.context.fill();\n this.context.stroke();\n this.context.closePath();\n }\n }\n }\n\n // food\n cx = (this.model.food.position.x * this.model.csize) + 0.5;\n cy = (this.model.food.position.y * this.model.csize) + 0.5;\n\n switch(this.model.food.type) {\n case 0: \n this.context.fillStyle = \"#00ff00\";\n break;\n\n case 1: \n this.context.fillStyle = \"#ffff00\";\n break;\n\n case 2: \n this.context.fillStyle = \"#00ffff\";\n break;\n }\n this.context.fillRect(cx, cy, this.model.csize, this.model.csize);\n }", "title": "" }, { "docid": "c2b4b25079dad730a874f1424a7e6a85", "score": "0.57296157", "text": "function drawFullMatrix(doPick, idx) {\n\tmvPushMatrix();\n\t\n\t// Translate and rotate to get a good view \n\tmvTranslate(plotTranslations[idx]);\n mvRotate(plotRotations[idx][0], plotRotations[idx][1]);\n mvRotate(180, [0, 0, 1]);\n\t\n\t// Draw the actual matrix.\n\tgl.bindBuffer(gl.ARRAY_BUFFER, verticesBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, TRI, gl.FLOAT, false, 0, 0);\n\tgl.bindBuffer(gl.ARRAY_BUFFER, normalsBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, TRI, gl.FLOAT, false, 0, 0);\n\tsetMatrixUniforms();\n\t\n\tif (doPick) {\n\t\tvar currentPickColor = colorsForPicking[idx];\n\t\tgl.uniform3f(shaderProgram.pickingColor, currentPickColor[0], currentPickColor[1], currentPickColor[2]);\n\t} else {\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, plotColorBuffers[idx]);\n\t gl.vertexAttribPointer(shaderProgram.vertexColorAttribute, 3, gl.FLOAT, false, 0, 0);\n\t gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n\t\tgl.drawElements(gl.TRIANGLES, indexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\t gl.uniform3f(shaderProgram.lineColor, 0.1, 0.1, 0.2);\n\t\tgl.uniform1i(shaderProgram.drawLines, true);\n\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, linesIndexBuffer);\n\t\tgl.drawElements(gl.LINES, linesIndexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\t\tgl.uniform1i(shaderProgram.drawLines, false);\n\t\t\n\t\t// Now draw the square outline\n\t\tif (idx == clickedMatrix) {\n\t\t\tgl.uniform3f(shaderProgram.lineColor, 0.2, 0.2, 0.8);\n\t \tgl.lineWidth(3.0);\n\t\t} else {\n\t\t\tgl.uniform3f(shaderProgram.lineColor, 0.3, 0.3, 0.3);\n\t\t\tgl.lineWidth(2.0);\n\t\t}\n\t gl.bindBuffer(gl.ARRAY_BUFFER, outlineVerticeBuffer);\n\t gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, TRI, gl.FLOAT, false, 0, 0);\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, outlineNormalsBuffer);\n\t gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, TRI, gl.FLOAT, false, 0, 0);\n\t gl.uniform1i(shaderProgram.drawLines, true);\n\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, outlineLinesBuffer);\n\t\tgl.drawElements(gl.LINES, outlineLinesBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\t\tgl.lineWidth(2.0);\n\t\tgl.uniform1i(shaderProgram.drawLines, false);\n\t}\n\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n\tgl.drawElements(gl.TRIANGLES, indexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\t\n mvPopMatrix();\n}", "title": "" }, { "docid": "9c43aea8d560ee35b2d7c621d005ae8a", "score": "0.5726862", "text": "function drawBase(){\n\n\tmvMatrixStack.push(modelViewMatrix);\n\t//r = rotate(0, 1, 0, 0.0);\n\ts = scale4(.35,.35,.35);\n\tt = translate(-.75,0,0);\n modelViewMatrix = mult(mult(modelViewMatrix, t), s);\n\tDrawSide(0.1); \n\tmodelViewMatrix = mvMatrixStack.pop();\n\n}", "title": "" }, { "docid": "90130823e9e9070e5ad9041c4b752651", "score": "0.56904155", "text": "function draw() {\n model = mat4.create();\n rotation = mat4.create();\n translation = mat4.create();\n mat4.perspective(model, fovy, aspect, near, far);\n mat4.identity(rotation);\n mat4.identity(translation);\n mat4.rotate(rotation, rotation, rx, [1, 0, 0]);\n mat4.rotate(rotation, rotation, ry, [0, 1, 0]);\n mat4.rotate(rotation, rotation, rz, [0, 0, 1]);\n mat4.translate(translation, translation, [0, 0, -1]);\n mat4.translate(translation, translation, [tx, ty, tz]);\n gl.uniformMatrix4fv(translationLoc, false, translation);\n gl.uniformMatrix4fv(rotationLoc, false, rotation);\n gl.uniformMatrix4fv(modelLoc, false, model);\n gl.drawArrays(gl.TRIANGLES, 0, points.length / 3);\n}", "title": "" }, { "docid": "9956b537226cd8a1c68197c4389b7f55", "score": "0.5651733", "text": "function drawCube() {\n setMV();\n Cube.draw();\n}", "title": "" }, { "docid": "6dd9cb759550872507045d7f7d76cf0e", "score": "0.56509405", "text": "function drawMatrix (matrix, offset)\r\n{\r\n matrix.forEach((row, y) =>\r\n {\r\n row.forEach((value, x) =>\r\n {\r\n if (value !== 0)\r\n {\r\n context.fillStyle = colors[value];\r\n context.fillRect(x+ offset.x, y+ offset.y , 1, 1)\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "e25a47465b62151ecb232e2f35e67f2c", "score": "0.563311", "text": "function drawCube() {\n setMV() ;\n Cube.draw() ;\n}", "title": "" }, { "docid": "58c1ea9409b1aa4bf3f7ee7aadcd8736", "score": "0.56261563", "text": "renderModel(model) {\n this.setModelMatrix(model.transform.getViewMatrix());\n this.gl.bindVertexArray(model.mesh.vao);\n\n if (model.mesh.noCulling) { this.gl.disable(this.gl.CULL_FACE); }\n if (model.mesh.doBlending) { this.gl.enable(this.gl.BLEND); }\n \n if (model.mesh.indexLength) {\n this.gl.drawElements(model.mesh.drawMode, model.mesh.indexLength, gl.UNSIGNED_SHORT, 0);\n }\n else {\n this.gl.drawArrays(model.mesh.drawMode, 0, model.mesh.vertexCount);\n }\n\n this.gl.bindVertexArray(null);\n if (model.mesh.noCulling) this.gl.enable(this.gl.CULL_FACE);\n if (model.mesh.doBlending) this.gl.disable(this.gl.BLEND);\n\n return this;\n }", "title": "" }, { "docid": "b95e9a6f50e9e5096c9d7064c815188c", "score": "0.56253743", "text": "function DrawDrawable(object)\n{\n for(let x = object.x; x < object.x + object.w; x++)\n {\n for(let y = object.y; y < object.y + object.h; y++)\n {\n if(x > 7)\n {\n x = 7;\n object.x = 7;\n }\n \n if(x < 0)\n {\n x = 0;\n object.x = 0;\n }\n\n if(y > 7)\n {\n y = 7;\n object.y = 7;\n }\n \n if(y < 0)\n {\n y = 0;\n object.y = 0;\n }\n\n display.grid[x][y] = 'rgb(' + object.color.r + ', ' + object.color.g + ', ' + object.color.b + ')';\n }\n }\n}", "title": "" }, { "docid": "6afa0d599be6e99dfbab3ad666190f58", "score": "0.5619954", "text": "function drawMatrix(matrix, offset, context) {\n matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if (value !== 0) {\n context.fillStyle = colors[value];\n context.fillRect(x + offset.x, y + offset.y, 1, 1);\n }\n });\n });\n}", "title": "" }, { "docid": "d46ed3ef88d4e0941cbacb7aefe917b9", "score": "0.5605845", "text": "renderInterface( matrix )\n {\n if( this.active )\n {\n for( let i = 0; i < this.activeInterTreeAry.length; ++i )\n if( this.activeInterTreeAry[i].isActive() )\n this.activeInterTreeAry[i].render( matrix );\n }\n }", "title": "" }, { "docid": "14b008a66400da61d9c2961619ad995d", "score": "0.56013525", "text": "function creatingObjects() {\n for (var y = 0; y < matrix.length; y++) {\n for (var x = 0; x < matrix[y].length; x++) {\n if (matrix[y][x] == 1) {\n var grass = new Grass(x, y);\n grassArr.push(grass);\n }\n else if (matrix[y][x] == 2) {\n var grassEater = new GrassEater(x, y);\n grassEaterArr.push(grassEater);\n }\n else if (matrix[y][x] == 3) {\n let genderArr = ['male', 'female'];\n let randomFromGenderArray1 = genderArr[Math.floor(Math.random()*genderArr.length)];\n let randomFromGenderArray2 = genderArr[Math.floor(Math.random()*genderArr.length)];\n var mard = new Mard(x, y, randomFromGenderArray1, randomFromGenderArray2);\n mardArr.push(mard);\n }\n else if (matrix[y][x] == 4) {\n var gishatich = new Gishatich(x, y);\n grassEaterArr.push(gishatich);\n }\n else if (matrix[y][x] == 5) {\n var dog = new Dog(x, y);\n grassEaterArr.push(dog);\n }\n }\n }\n}", "title": "" }, { "docid": "acbb978a4e959cc018af045036b1e589", "score": "0.55923575", "text": "function drawObjects() {\n for (let i = 0; i < trees.length; i++)\n trees[i].draw();\n for (let i = 0; i < movingObjects.length; i++)\n movingObjects[i].draw();\n snowman.draw();\n showHighscore();\n }", "title": "" }, { "docid": "4acf4e2af9dca42137d29d790c14151e", "score": "0.5552985", "text": "function multipleView() {\t\n\t\n\tgl.viewport(0,0,canvas.width/2, canvas.height/2);\n\t\n\tgl.uniformMatrix4fv(mProjLoc, false, flatten(mProj));\n\tgl.uniformMatrix4fv(mModelViewLoc, false, flatten(modelView[0]));\n\tdrawPrimitive();\n\t\n\tgl.viewport(canvas.width/2,0,canvas.width/2, canvas.height/2);\n\t\n\tgl.uniformMatrix4fv(mProjLoc, false, flatten(mPerspective));\n\tgl.uniformMatrix4fv(mModelViewLoc, false, flatten(modelView[1]));\n\tdrawPrimitive();\n\t\n\tgl.viewport(0,canvas.height/2,canvas.width/2, canvas.height/2);\n\t\n\tgl.uniformMatrix4fv(mProjLoc, false, flatten(mProj));\n\tgl.uniformMatrix4fv(mModelViewLoc, false, flatten(modelView[2]));\n\tdrawPrimitive();\n\t\n\tgl.viewport(canvas.width/2,canvas.height/2,canvas.width/2, canvas.height/2);\t\n\t\n\tgl.uniformMatrix4fv(mProjLoc, false, flatten(mProj));\n\tgl.uniformMatrix4fv(mModelViewLoc, false, flatten(modelView[3]));\n\tdrawPrimitive();\t\t\n}", "title": "" }, { "docid": "4a3cdf987c10c7b378717559a8f0ba77", "score": "0.55520225", "text": "function drawPlane(matrix, texture){\n\n vMatrix = mat4.lookAt(camera_pos, [0,0,0], [0,1,0], vMatrix); // set up the view matrix, multiply into the modelview matrix\n \n gl.uniform1i(shaderProgram.use_textureUniform, 1); \n mat4.identity(nMatrix); \n nMatrix = mat4.multiply(nMatrix, vMatrix);\n nMatrix = mat4.multiply(nMatrix, matrix); \n nMatrix = mat4.inverse(nMatrix);\n nMatrix = mat4.transpose(nMatrix); \n\n //plane position buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, squareVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, squareVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n //plane normal buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, squareVertexNormalBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexNormalAttribute, squareVertexNormalBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n //plane texture coordinate buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, squareVertexTexCoordsBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexTexCoordsAttribute, squareVertexTexCoordsBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n //plane color buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, squareVertexColorBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexColorAttribute,squareVertexColorBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n //plane index buffer\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, squareVertexIndexBuffer);\n\n setMatrixUniforms(matrix);\n\n //\n gl.activeTexture(gl.TEXTURE2); // set texture unit 0 to use \n gl.bindTexture(gl.TEXTURE_2D, texture); // bind the texture object to the texture unit \n gl.uniform1i(shaderProgram.textureUniform, 2); // pass the texture unit to the shader \n \n //\n if (draw_type ==1) gl.drawArrays(gl.LINE_LOOP, 0, squareVertexPositionBuffer.numItems); \n else if (draw_type ==0) gl.drawArrays(gl.POINTS, 0, squareVertexPositionBuffer.numItems);\n else if (draw_type==2) gl.drawElements(gl.TRIANGLES, squareVertexIndexBuffer.numItems , gl.UNSIGNED_SHORT, 0);\n }", "title": "" }, { "docid": "74dfeda3bb0acf031bc3b5ce9641800e", "score": "0.5550225", "text": "function DrawObject() {\n this.drawType = gl.LINE_LOOP;\n this.color = new Vector3([0, 0, 0]);\n this.enabled = true;\n this.drawMethod = DrawMethod.FACE; //Face\n this.SetColor = function(color) {\n this.color = color;\n };\n\n this.SetVertices = function (vertices) {\n this.vertices = vertices;\n };\n\n this.GetVertex = function (index) {\n return this.vertices.get(index);\n };\n\n this.CalculateNormal = function () {\n var p1 = new Vector3([this.GetVertex(0),\n this.GetVertex(1),\n this.GetVertex(2)]);\n var p2 = new Vector3([this.GetVertex(3),\n this.GetVertex(4),\n this.GetVertex(5)]);\n var p3 = new Vector3([this.GetVertex(6),\n this.GetVertex(7),\n this.GetVertex(8)]);\n //Calculate the center of the triangle\n var average_vector = centerOfTriangle(p1, p2, p3);\n //Calculate the other end of the normal vector\n var norm_endpoint = addVectors(average_vector, scaleVector(cross_product(\n subtractVectors(p2, p1),\n subtractVectors(p3, p1)\n ).normalize(), 0.25));\n return subtractVectors(norm_endpoint, average_vector);\n };\n\n //Currently only for a single face\n this.CenterOfObject = function () {\n return centerOfTriangle(new Vector3([this.GetVertex(0), this.GetVertex(1), this.GetVertex(2)]),\n new Vector3([this.GetVertex(3), this.GetVertex(4), this.GetVertex(5)]),\n new Vector3([this.GetVertex(6), this.GetVertex(7), this.GetVertex(8)]));\n }\n}", "title": "" }, { "docid": "695d2e7c151ec3fba018e397713c48f9", "score": "0.55465144", "text": "function drawScene() {\n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n mat4.perspective(70, gl.viewportWidth / gl.viewportHeight, 0.1, 300.0, pMatrix);\n\n mat4.identity(mvMatrix);\n mat4.translate(mvMatrix, [0.0, 0.0, -100.0]);\n\n // draw walls\n gl.bindBuffer(gl.ARRAY_BUFFER, wallVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, wallVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, wallVertexColorBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexColorAttribute, wallVertexColorBuffer.itemSize, gl.FLOAT, false, 0, 0);\n setMatrixUniforms();\n gl.drawArrays(gl.TRIANGLES, 0, wallVertexPositionBuffer.numItems);\n\n // draw boids\n gl.bindBuffer(gl.ARRAY_BUFFER, boidVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, boidVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, boidVertexColorBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexColorAttribute, boidVertexColorBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\n for (var j=0; j<boids.length; j++){ // for each flock\n for(var i=0; i < boids[j].length; i++){\n //mat4.translate(mvMatrix, [-1.5, 0.0, -8.0]);\n mvPushMatrix();\n //mat4.rotate(mvMatrix, degToRad(rPyramid), [0, 1, 0]);\n var boidTransform = boids[j][i].getTransformation();\n mat4.multiply(mvMatrix, boidTransform,mvMatrix);\n mat4.rotate(mvMatrix, degToRad(-90), [0, 0, 1]);\n setMatrixUniforms();\n gl.drawArrays(gl.TRIANGLES, 0, boidVertexPositionBuffer.numItems);\n mvPopMatrix();\n }\n }\n}", "title": "" }, { "docid": "d6512443a6587a561e414fc71f2ee4b2", "score": "0.55052793", "text": "function drawObjects() {\n\n\t\t// draw rectangles\n\t\tputRectangles([[0.0, 0.0, 1.0], [0.0, 0.0, -1.0]]);\n\n\t\t// initialize result_intersect\n\t\tresult_intersect = {tmin: 1.0e30, touch_flag: -1};\n\t\t// draw spheres\n\t\tfor (var i=0; i<g.conn_list.length ; i++) {\n\t\t\tdrawSphere(i, [g.conn_list[i][7], g.conn_list[i][8], -1.0]);\n\t\t\tdrawSphere(i, [g.conn_list[i][9], g.conn_list[i][10], 1.0]);\n\t\t}\n\n\t\t// draw flows\n\t\tgl.useProgram(prg);\n\t\tglnv.drawFlows(prg, texprg, g.drawinfo_flows, arrow_default_pos, arrow_delta);\n\n\t\t// draw labels\n\t\tgl.useProgram(texprg);\n\t\tglnv.putStr(texprg, \"0 <- Source IP Address -> 4294967295\",\n\t\t\t0.06, [ 0.05, -1.1, -1.0 ], 0.52, 'green');\n\t\tglnv.putStr(texprg, \"0 <- Destination IP Address -> 4294967295\",\n\t\t\t0.06, [ 0.05, -1.1, 1.0 ], 0.52, 'green');\n\t\tglnv.mvPushMatrix();\n\t\tm.rotate(glnv.mMatrix, glnv.degToRad(90.0), [0, 0, 1], glnv.mMatrix);\n\t\tglnv.putStr(texprg, \"0 <- Source Port -> 65535\",\n\t\t\t0.06, [ 0.05, 1.1, -1.0 ], 0.52, 'green');\n\t\tglnv.putStr(texprg, \"0 <- Destination Port -> 65535\",\n\t\t\t0.06, [ 0.05, 1.1, 1.0 ], 0.52, 'green');\n\t\tglnv.mvPopMatrix();\n\t\tgl.useProgram(prg);\n\n\t\t// show host information\n\t\tif (g.check_intersect == 1) { \n\t\t\tg.check_intersect = 0;\n\t\t\tif (result_intersect.touch_flag != -1) {\n\t\t\t\tg.selected_obj = result_intersect.touch_flag;\n\t\t\t\t$(\"#srcinfo\").text(\"src_ip=\" + g.conn_list[g.selected_obj][1]+ \", \");\n\t\t\t\t$(\"#srcinfo\").append(\"src_port=\" + g.conn_list[g.selected_obj][2]+ \", \");\n\t\t\t\t$(\"#dstinfo\").text(\"dst_ip=\" + g.conn_list[g.selected_obj][3]+ \", \");\n\t\t\t\t$(\"#dstinfo\").append(\"dst_port=\" + g.conn_list[g.selected_obj][4]+ \", \");\n\t\t\t\t$(\"#pktinfo\").text(\"proto=\" + g.conn_list[g.selected_obj][0]+ \", \");\n\t\t\t\t$(\"#pktinfo\").append(\"n_packets=\" + g.conn_list[g.selected_obj][5]+ \", \");\n\t\t\t\t$(\"#pktinfo\").append(\"n_bytes=\" + g.conn_list[g.selected_obj][6]);\n\t\t\t} \n\t\t}\n\t}", "title": "" }, { "docid": "31f3a1cd0212785dfd4d3fbe59594137", "score": "0.5498375", "text": "onDrawSurface(mat4Projection, mat4ModelView)\n {\n this.m_VBOsetMirror.onDraw(mat4Projection, mat4ModelView);\n }", "title": "" }, { "docid": "54fd2b698e95f8968866c1af14b13c64", "score": "0.5497119", "text": "function drawViewObjects() {\n let i = 0;\n\n cleanup(c, canvas);\n\n for (; i < enemies.length; i++) {\n enemies[i].draw();\n }\n\n for (i = 0; i < players.length; i++) {\n players[i].draw();\n }\n}", "title": "" }, { "docid": "02b8a27ccac89bef5c7df07bfcb68ecb", "score": "0.54969573", "text": "function drawMatrix(matrix, offset) {\n // Each Y axis value\n matrix.forEach((row, y) => {\n // Each X axis value\n row.forEach((value, x) => {\n // If it is not empty\n if (value !== 0) {\n // Determine piece colour. The colour used is determined by mapping the value in the matrix, with the colours array.\n context.fillStyle = colours[value];\n // Fill the tile\n context.fillRect(x + offset.x, y + offset.y, 1, 1);\n context.strokeStyle = \"white\";\n context.lineWidth = 0.075;\n context.strokeRect(x + offset.x, y + offset.y, 1, 1);\n }\n });\n });\n}", "title": "" }, { "docid": "364f72e73c340785f6dedc667a69693f", "score": "0.54920346", "text": "function drawCube(ctx,\n size,\n r, g, b, a)\n{\n // Set up parameters\n if (typeof r != 'number') r = 0.7;\n if (typeof g != 'number') g = 0.7;\n if (typeof b != 'number') b = 0.7;\n if (typeof a != 'number') a = 1.0;\n\n // +x face\n pushMvMatrix(ctx);\n mat4.rotate(ctx.mvMatrix, ctx.mvMatrix,\n Math.PI/180. * 90., [0., 1., 0.]);\n mat4.translate(ctx.mvMatrix, ctx.mvMatrix,\n [0., 0., size/2.]);\n drawSquare(ctx, size, r, g, b, a);\n popMvMatrix(ctx);\n\n // -x face\n pushMvMatrix(ctx);\n mat4.rotate(ctx.mvMatrix, ctx.mvMatrix,\n Math.PI/180. * -90., [0., 1., 0.]);\n mat4.translate(ctx.mvMatrix, ctx.mvMatrix,\n [0., 0., size/2.]);\n drawSquare(ctx, size, r, g, b, a);\n popMvMatrix(ctx);\n\n // +y face\n pushMvMatrix(ctx);\n mat4.rotate(ctx.mvMatrix, ctx.mvMatrix,\n Math.PI/180. * -90., [1., 0., 0.]);\n mat4.translate(ctx.mvMatrix, ctx.mvMatrix,\n [0., 0., size/2.]);\n drawSquare(ctx, size, r, g, b, a);\n popMvMatrix(ctx);\n\n // -y face\n pushMvMatrix(ctx);\n mat4.rotate(ctx.mvMatrix, ctx.mvMatrix,\n Math.PI/180. * 90., [1., 0., 0.]);\n mat4.translate(ctx.mvMatrix, ctx.mvMatrix,\n [0., 0., size/2.]);\n drawSquare(ctx, size, r, g, b, a);\n popMvMatrix(ctx);\n\n // +z face\n pushMvMatrix(ctx);\n mat4.translate(ctx.mvMatrix, ctx.mvMatrix,\n [0., 0., size/2.]);\n drawSquare(ctx, size, r, g, b, a);\n popMvMatrix(ctx);\n\n // -z face\n pushMvMatrix(ctx);\n mat4.rotate(ctx.mvMatrix, ctx.mvMatrix,\n Math.PI/180. * 180., [1., 0., 0.]);\n mat4.translate(ctx.mvMatrix, ctx.mvMatrix,\n [0., 0., size/2.]);\n drawSquare(ctx, size, r, g, b, a);\n popMvMatrix(ctx);\n}", "title": "" }, { "docid": "99eeb19eeab79230b70c916ac7c93f9f", "score": "0.54908085", "text": "function main() {\n\n // basically this function does setup that \"should\" only have to be done once,\n // while draw() does things that have to be repeated each time the canvas is\n // redrawn\n\n// get graphics context\n gl = getGraphicsContext(\"theCanvas\");\n\n // key handlers\n window.onkeypress = handleKeyPress;\n\n // create model data\n var cube = makeCube();\n\n // load and compile the shader pair\n shader = createProgram(gl, 'vertexShader', 'fragmentShader');\n\n // load the vertex data into GPU memory\n vertexBuffer = createAndLoadBuffer(cube.vertices);\n\n // buffer for vertex colors\n vertexColorBuffer = createAndLoadBuffer(cube.colors);\n\n // axes\n axisBuffer = createAndLoadBuffer(axisVertices);\n\n // buffer for axis colors\n axisColorBuffer = createAndLoadBuffer(axisColors);\n\n // specify a fill color for clearing the framebuffer\n gl.clearColor(0.9, 0.9, 0.9, 1.0);\n\n gl.enable(gl.DEPTH_TEST);\n\n // define an animation loop\n var animate = function() {\n draw(theObject);\n // request that the browser calls animate() again \"as soon as it can\"\n requestAnimationFrame(animate);\n };\n\n // start drawing!\n animate();\n\n\n}", "title": "" }, { "docid": "6e026db21ec73ece2e074ad7be09f688", "score": "0.54851115", "text": "function drawModel() {\n $('#Age').text(Age);\n for (var i = 0; i < Width * Height; i++) {\n switch (Array[i].Status) {\n case 0:\n drawCell(Array[i].X, Array[i].Y, 'Empty', null);\n break;\n case 1:\n drawCell(Array[i].X, Array[i].Y, 'Born', Array[i].Organism.Genome);\n break;\n case 2:\n drawCell(Array[i].X, Array[i].Y, 'Live', Array[i].Organism.Genome);\n break;\n case 3:\n drawCell(Array[i].X, Array[i].Y, 'Dead', null);\n break;\n case 4:\n drawCell(Array[i].X, Array[i].Y, 'Create', Array[i].Organism.Genome);\n break;\n }\n }\n}", "title": "" }, { "docid": "f6b7a0715ae6df4850da2229bc358f6b", "score": "0.5478701", "text": "function drawMatrix(){\n var canvas = document.getElementById(\"myCanvas\");\n var context = canvas.getContext(\"2d\");\n context.fillStyle = \"#000\";\n\n //clears canvas to redraw the matrix\n context.clearRect(0,0,500,500);\n\n for(var i = 0; i<size; i++){\n for(var j = 0; j < size; j++){\n \n if(currentGeneration[i][j] === 1){\n context.fillRect(j,i,1,1);\n }\n }\n }\n}", "title": "" }, { "docid": "0b7a1aab00a8c2c85fea43daa714bcd7", "score": "0.5475735", "text": "render({offset, camera}) {\n for (let obj of this.objectmanager.getObjects()) {\n obj.render({\n x: offset.x + obj.position.x,\n y: offset.y + obj.position.y,\n width: obj.dimensions.width,\n height: obj.dimensions.height,\n camera: camera,\n renderer: this.renderer\n })\n }\n }", "title": "" }, { "docid": "f16c4d15edbc5263b0d5368fe7eb0506", "score": "0.54681945", "text": "function draw(gl, vao, n, currentAngle, viewProjMatrix, loc_uMvpMatrix) {\n // Caliculate The model view projection matrix and pass it to uMvpMatrix\n g_MvpMatrix.set(viewProjMatrix);\n g_MvpMatrix.rotate(currentAngle, 1.0, 0.0, 0.0); // Rotate appropriately\n g_MvpMatrix.rotate(currentAngle, 0.0, 1.0, 0.0);\n g_MvpMatrix.rotate(currentAngle, 0.0, 0.0, 1.0);\n gl.uniformMatrix4fv(loc_uMvpMatrix, false, g_MvpMatrix.elements);\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Clear buffers (color and depth)\n gl.bindVertexArray(vao);\n gl.drawElements(gl.TRIANGLES, n, gl.UNSIGNED_BYTE, 0); // Draw\n gl.bindVertexArray(null);\n}", "title": "" }, { "docid": "2e9c005bf210d054814495c93c61b5f3", "score": "0.54631543", "text": "function draw() {\n //var rot = rotate(.5, [0, 1, 0]);\n\n //var x = dot(rot[0], vec4(cam.pos));\n //var y = dot(rot[1], vec4(cam.pos));\n //var z = dot(rot[2], vec4(cam.pos));\n\n //cam.pos = [x, y, z];\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n for (var i = 0; i < world_objects.length; ++i) {\n var currObj = world_objects[i];\n switch (currObj.type) {\n case \"cone\":\n renderFan(currObj.point, currObj.transform);\n renderFan(currObj.base, currObj.transform);\n break;\n case \"cylinder\":\n renderFan(currObj.top, currObj.transform);\n renderFan(currObj.bottom, currObj.transform);\n for (var i = 0; i < currObj.sides.length; ++i) renderStrip(currObj.sides[i], currObj.transform);\n break;\n case \"sphere\":\n renderFan(currObj.top, currObj.transform);\n renderFan(currObj.bottom, currObj.transform);\n for (var i = 0; i < currObj.sides.length; ++i) renderStrip(currObj.sides[i], currObj.transform);\n break;\n case \"tetrahedron\":\n renderTriangles(currObj, currObj.transform);\n break;\n default:\n console.log(\"Failed to render object with id: \" + world_objects[i].id);\n break;\n }\n }\n\n requestAnimationFrame(draw);\n }", "title": "" }, { "docid": "4c7182ffa62c6234d2bbe7c933b9615a", "score": "0.54610646", "text": "function draw_circle(matrix) {\n\n setMatrixUniforms(matrix);\t\n\t\t\n\t\t//binds Circle Vertex Position Buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, circleVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, circleVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\t\t//binds Circle Vertex Color Buffer\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, circleVertexColorBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexColorAttribute,circleVertexColorBuffer.itemSize,gl.FLOAT,false, 0, 0);\n\t\tgl.drawArrays(gl.TRIANGLE_FAN, 0, circleVertexPositionBuffer.numItems);\n\t\t\n\t\t//binds Smiley Face Line Vertex Position Buffer\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, lineVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, lineVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\t\t//binds Smiley Face Line Vertex Color Buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, lineVertexColorBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexColorAttribute,lineVertexColorBuffer.itemSize,gl.FLOAT,false, 0, 0);\n\t\tgl.drawArrays(gl.LINE_STRIP, 0, lineVertexPositionBuffer.numItems);\n\t\n\t\t//binds Smiley Face Point Vertex Position Buffer\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, pointVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, pointVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\t\t//binds Smiley Face Point Vertex Color Buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, pointVertexColorBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexColorAttribute,pointVertexColorBuffer.itemSize,gl.FLOAT,false, 0, 0);\n\t\tgl.drawArrays(gl.POINTS, 0, pointVertexPositionBuffer.numItems);\n\n\n }", "title": "" }, { "docid": "a3a885b2196a7fa3b7dedfce1e45f2d1", "score": "0.54600286", "text": "function drawScene() {\n // Clear the canvas before we start drawing on it.\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n // Establish the perspective with which we want to view the\n // scene. Our field of view is 45 degrees, with a width/height\n // ratio of 640:480, and we only want to see objects between 0.1 units\n // and 100 units away from the camera.\n\n perspectiveMatrix = makePerspective(45, 640.0 / 480.0, 0.1, findMaxZ() * 20);\n\n // Set the drawing position to the \"identity\" point, which is\n // the center of the scene.\n\n\n\n // Draw the square by binding the array buffer to the square's vertices\n // array, setting attributes, and pushing it to GL.\n\n ViewMatrix.elements[0][3] = camerapos[X];\n ViewMatrix.elements[1][3] = camerapos[Y];\n ViewMatrix.elements[2][3] = camerapos[Z];\n rotation();\n\n\n for (var k = 0; k < boxVertices.length; k++) {\n setMatrixUniforms(ModelMatrix[k]);\n for (var i = 0; i < vertices[k].length; i++) {\n if (!enabledCenterOfMass) {\n if (representAsTriangle[k][i]) {\n drawParallelepiped(VerticesBuffer[k][i], ColorBuffer[k][i], cubeVerticesIndexBuffer[0], gl.TRIANGLES, 36);\n } else {\n drawParallelepiped(VerticesBuffer[k][i], ColorBuffer[k][i], cubeVerticesIndexBuffer[1], gl.LINES, 24);\n }\n }\n }\n if (enabledCenterOfMass) {\n for (var i = 0; i < centerOfMass[k].length; i++) {\n drawArray(centerOfMassBuffer[k][i], ColorBuffer[k][i], gl.POINTS, 0, 1);\n\n }\n\n\n }\n if (enabledCenterOfMass && extended) {\n drawParallelepiped(innerBoxVerticesBuffer[k], cubeVerticesColor, cubeVerticesIndexBuffer[1], gl.LINES, 24);\n }\n\n\n drawParallelepiped(cubeVerticesBuffer[k], cubeVerticesColor, cubeVerticesIndexBuffer[1], gl.LINES, 24);\n\n }\n}", "title": "" }, { "docid": "ac14ee577a1e51ba5fb7e8ec0d2f8ac8", "score": "0.5458622", "text": "drawMatrix(matrix, offset, context, shadow_mode = false) {\n\t matrix.forEach((row, y) => {\n\t row.forEach((value, x) => {\n\t if (value !== 0) {\n\t context.fillStyle = this.colors[value];\n\t //separate color for the shadow pices\n\t if (shadow_mode == true) {\n\t context.fillStyle = \"rgba(114, 126, 140, 0.5)\";\n\t } \n\t context.fillRect(x + offset.x,\n\t y + offset.y,\n\t 1, 1);\n\t \n\t }\n\t });\n\t });\n\t}", "title": "" }, { "docid": "b7f192dceb97517ee2f27f1b4efcebd4", "score": "0.5455189", "text": "_drawChildren(modelMatrix, CameraMatrix, pMatrix, parentMod){\n for (var i = 0; i < this.children.length; i++){\n var child = this.children[i];\n child.draw(modelMatrix, CameraMatrix, pMatrix, parentMod);\n }\n }", "title": "" }, { "docid": "f07a705ebaa24338c61010cf57b07023", "score": "0.5431405", "text": "function draw(gl, n, currentAngle, viewProjMatrix, u_MvpMatrix) {\n // Caliculate The model view projection matrix and pass it to u_MvpMatrix\n g_MvpMatrix.set(viewProjMatrix);\n g_MvpMatrix.rotate(currentAngle, 1.0, 0.0, 0.0); // Rotate appropriately\n g_MvpMatrix.rotate(currentAngle, 0.0, 1.0, 0.0);\n g_MvpMatrix.rotate(currentAngle, 0.0, 0.0, 1.0);\n gl.uniformMatrix4fv(u_MvpMatrix, false, g_MvpMatrix.elements);\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // Clear buffers\n gl.drawElements(gl.TRIANGLES, n, gl.UNSIGNED_BYTE, 0); // Draw\n}", "title": "" }, { "docid": "2e9f233e13dfd17fdb79c2ed82c33731", "score": "0.54294604", "text": "function drawCube() {\n\tsetMV();\n\tCube.draw();\n}", "title": "" }, { "docid": "80da474472d67f3308f85e9f77e5e916", "score": "0.54228926", "text": "function drawScene() {\n\t\n\tvar pMatrix;\n\tvar mvMatrix = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];//mat4();\n\tmvMatrix.matrix = true;\n\tvar tempMV = gl.getUniformLocation(shaderProgram, \"uMVMatrix\");\n\t\n\t// Clearing the frame-buffer and the depth-buffer\n\tgl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\t\n\t// Computing the Projection Matrix\n\t//for now\n\tpMatrix = [[1.0000000000000002,0,0,0],[0,1.0000000000000002,0,0],[0,0,-1.0000133334222228,-0.00020000133334222229],[0,0,-1,0]];//perspective( 90, 1, 0.0001, 15 );\n\tpMatrix.matrix = true;\n\t\n\t// Passing the Projection Matrix to apply the current projection\n\tvar pUniform = gl.getUniformLocation(shaderProgram, \"uPMatrix\");\n\tgl.uniformMatrix4fv(pUniform, false, new Float32Array(flatten(pMatrix)));\n\tpMatrix = null;\n\tpUniform = null;\n\n\tif(topView){\n\t\tmvMatrix = rotationXXMatrix(90);\n\t\tmvMatrix = mult(mvMatrix, translationMatrix( oldTx, -3, globalTz));\n\t\t//drawModelFloor(-oldTx,0.25,-globalTz, mvMatrix);\n\t}\n\telse{\n\t\tvar tempTz = globalTz;\n\t\tvar tempTx = oldTx;\n\t\tglobalTx += rodar; \n\t\tmvMatrix = rotationYYMatrix(globalTx);\n\t\toldTx = oldTx + ((-Math.sin(radians(globalTx))) * andar);\n\t\tglobalTz = globalTz + (Math.cos(radians(globalTx)) * andar);\n\t\t//andar = 0.0;\n\t\tif(check_col(oldTx, globalTz)){\n\t\t\tglobalTz = tempTz;\n\t\t\toldTx = tempTx;\n\t\t}\n\t\tmvMatrix = mult(mvMatrix, translationMatrix( oldTx, 0, globalTz));\n\t\t//draw top\n\t\tdrawModelTop(mvMatrix, tempMV);\n\t}\n\t//draw walls\n\tdrawModelWall(mvMatrix, tempMV);\n\t//draw floor\n\tdrawModelFloor(mvMatrix, tempMV);\n\t//draw esfera\n\tdrawModelWin(mvMatrix, tempMV);\n\tmvMatrix = null;\n}", "title": "" }, { "docid": "cc7d26b4077473a1f955f7322c2b2181", "score": "0.5418367", "text": "function Object2D()\n{\t\n\t/**\n\t * UUID of the object.\n\t */\n\tthis.uuid = UUID.generate(); \n\n\t/**\n\t * List of children objects attached to the object.\n\t */\n\tthis.children = [];\n\n\t/**\n\t * Parent object, the object position is affected by its parent position.\n\t */\n\tthis.parent = null;\n\n\t/**\n\t * Depth level in the object tree, objects with higher depth are drawn on top.\n\t *\n\t * The layer value is considered first. \n\t */\n\tthis.level = 0;\n\n\t/**\n\t * Position of the object.\n\t */\n\tthis.position = new Vector2(0, 0);\n\n\t/**\n\t * Origin of the object used as point of rotation.\n\t */\n\tthis.origin = new Vector2(0, 0);\n\n\t/**\n\t * Scale of the object.\n\t */\n\tthis.scale = new Vector2(1, 1);\n\n\t/**\n\t * Rotation of the object relative to its center.\n\t */\n\tthis.rotation = 0.0;\n\n\t/**\n\t * Indicates if the object is visible.\n\t */\n\tthis.visible = true;\n\n\t/**\n\t * Layer of this object, objects are sorted by layer value.\n\t *\n\t * Lower layer value is draw first.\n\t */\n\tthis.layer = 0;\n\n\t/**\n\t * Local transformation matrix applied to the object. \n\t */\n\tthis.matrix = new Matrix();\n\n\t/**\n\t * Global transformation matrix multiplied by the parent matrix.\n\t *\n\t * Used to transform the object before projecting into screen coordinates.\n\t */\n\tthis.globalMatrix = new Matrix();\n\n\t/**\n\t * Inverse of the global matrix.\n\t *\n\t * Used to convert pointer input points into object coordinates.\n\t */\n\tthis.inverseGlobalMatrix = new Matrix();\n\n\t/**\n\t * Masks being applied to this object.\n\t *\n\t * Multiple masks can be used simultaneously.\n\t */\n\tthis.masks = [];\n\n\t/**\n\t * If true the matrix is updated before rendering the object.\n\t */\n\tthis.matrixNeedsUpdate = true;\n\n\t/**\n\t * Indicates if its possible to drag the object around.\n\t *\n\t * If true the onPointerDrag callback is used to update the state of the object.\n\t */\n\tthis.draggable = false;\n\n\t/**\n\t * Indicates if this object uses pointer events.\n\t *\n\t * Can be set false to skip the pointer interaction events.\n\t */\n\tthis.pointerEvents = true;\n\n\t/**\n\t * Flag to indicate wheter this objet ignores the viewport transformation.\n\t */\n\tthis.ignoreViewport = false;\n\n\t/**\n\t * Flag to indicate if the context of canvas should be saved before render.\n\t */\n\tthis.saveContextState = true;\n\n\t/**\n\t * Flag to indicate if the context of canvas should be restored after render.\n\t */\n\tthis.restoreContextState = true;\n\n\t/**\n\t * Flag indicating if the pointer is inside of the element.\n\t *\n\t * Used to control object event.\n\t */\n\tthis.pointerInside = false;\n\n\t/**\n\t * Flag to indicate if the object is currently being dragged.\n\t */\n\tthis.beingDragged = false;\n}", "title": "" }, { "docid": "cc7d26b4077473a1f955f7322c2b2181", "score": "0.5418367", "text": "function Object2D()\n{\t\n\t/**\n\t * UUID of the object.\n\t */\n\tthis.uuid = UUID.generate(); \n\n\t/**\n\t * List of children objects attached to the object.\n\t */\n\tthis.children = [];\n\n\t/**\n\t * Parent object, the object position is affected by its parent position.\n\t */\n\tthis.parent = null;\n\n\t/**\n\t * Depth level in the object tree, objects with higher depth are drawn on top.\n\t *\n\t * The layer value is considered first. \n\t */\n\tthis.level = 0;\n\n\t/**\n\t * Position of the object.\n\t */\n\tthis.position = new Vector2(0, 0);\n\n\t/**\n\t * Origin of the object used as point of rotation.\n\t */\n\tthis.origin = new Vector2(0, 0);\n\n\t/**\n\t * Scale of the object.\n\t */\n\tthis.scale = new Vector2(1, 1);\n\n\t/**\n\t * Rotation of the object relative to its center.\n\t */\n\tthis.rotation = 0.0;\n\n\t/**\n\t * Indicates if the object is visible.\n\t */\n\tthis.visible = true;\n\n\t/**\n\t * Layer of this object, objects are sorted by layer value.\n\t *\n\t * Lower layer value is draw first.\n\t */\n\tthis.layer = 0;\n\n\t/**\n\t * Local transformation matrix applied to the object. \n\t */\n\tthis.matrix = new Matrix();\n\n\t/**\n\t * Global transformation matrix multiplied by the parent matrix.\n\t *\n\t * Used to transform the object before projecting into screen coordinates.\n\t */\n\tthis.globalMatrix = new Matrix();\n\n\t/**\n\t * Inverse of the global matrix.\n\t *\n\t * Used to convert pointer input points into object coordinates.\n\t */\n\tthis.inverseGlobalMatrix = new Matrix();\n\n\t/**\n\t * Masks being applied to this object.\n\t *\n\t * Multiple masks can be used simultaneously.\n\t */\n\tthis.masks = [];\n\n\t/**\n\t * If true the matrix is updated before rendering the object.\n\t */\n\tthis.matrixNeedsUpdate = true;\n\n\t/**\n\t * Indicates if its possible to drag the object around.\n\t *\n\t * If true the onPointerDrag callback is used to update the state of the object.\n\t */\n\tthis.draggable = false;\n\n\t/**\n\t * Indicates if this object uses pointer events.\n\t *\n\t * Can be set false to skip the pointer interaction events.\n\t */\n\tthis.pointerEvents = true;\n\n\t/**\n\t * Flag to indicate wheter this objet ignores the viewport transformation.\n\t */\n\tthis.ignoreViewport = false;\n\n\t/**\n\t * Flag to indicate if the context of canvas should be saved before render.\n\t */\n\tthis.saveContextState = true;\n\n\t/**\n\t * Flag to indicate if the context of canvas should be restored after render.\n\t */\n\tthis.restoreContextState = true;\n\n\t/**\n\t * Flag indicating if the pointer is inside of the element.\n\t *\n\t * Used to control object event.\n\t */\n\tthis.pointerInside = false;\n\n\t/**\n\t * Flag to indicate if the object is currently being dragged.\n\t */\n\tthis.beingDragged = false;\n}", "title": "" }, { "docid": "d2ef3df54357d97765f49f5af59d307b", "score": "0.54072237", "text": "function renderModels() {\n if \t(batteries == 0) {\n \taddscore(context, 1);\n \treturn;\n }\n if (miss_remain == 0) resetgame();\n\n var pMatrix = mat4.create(); // projection matrix\n var vMatrix = mat4.create(); // view matrix\n var mMatrix = mat4.create(); // model matrix\n var pvMatrix = mat4.create(); // hand * proj * view matrices\n var pvmMatrix = mat4.create(); // hand * proj * view * model matrices\n\n window.requestAnimationFrame(renderModels); // set up frame render callback\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); // clear frame/depth buffers\n\n mat4.perspective(pMatrix, 0.5 * Math.PI, 1, 0.1, 10); // create projection matrix\n mat4.lookAt(vMatrix, defaultEye, defaultCenter, defaultUp); // create view matrix\n mat4.multiply(vMatrix, [-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], vMatrix);\n mat4.multiply(pvMatrix, pvMatrix, pMatrix); // projection\n mat4.multiply(pvMatrix, pvMatrix, vMatrix); // projection * view\n\n // render each triangle set\n var currSet; // the tri set and its material properties\n for (var whichTriSet = 0; whichTriSet < numTriangleSets; whichTriSet++) {\n currSet = inputTriangles[whichTriSet];\n if (!currSet.alive) {\n continue;\n }\n mat4.multiply(pvmMatrix, pvMatrix, mMatrix); // project * view * model\n gl.uniformMatrix4fv(mMatrixULoc, false, mMatrix); // pass in the m matrix\n gl.uniformMatrix4fv(pvmMatrixULoc, false, pvmMatrix); // pass in the hpvm matrix\n\n // reflectivity: feed to the fragment shader\n gl.uniform3fv(ambientULoc, currSet.material.ambient); // pass in the ambient reflectivity\n gl.uniform3fv(diffuseULoc, currSet.material.diffuse); // pass in the diffuse reflectivity\n gl.uniform3fv(specularULoc, currSet.material.specular); // pass in the specular reflectivity\n gl.uniform1f(shininessULoc, currSet.material.n); // pass in the specular exponent\n\n\n // vertex buffer: activate and feed into vertex shader\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffers[whichTriSet]); // activate\n gl.vertexAttribPointer(vPosAttribLoc, 3, gl.FLOAT, false, 0, 0); // feed\n gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffers[whichTriSet]); // activate\n gl.vertexAttribPointer(vNormAttribLoc, 3, gl.FLOAT, false, 0, 0); // feed\n\n // triangle buffer: activate and render\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[whichTriSet]); // activate\n gl.drawElements(gl.TRIANGLES, 3 * triSetSizes[whichTriSet], gl.UNSIGNED_SHORT, 0); // render\n\n } // end for each triangle set\n\n // render each ellipsoid\n var sphere;\n count++;\n if(count == 150){\n getran = Math.floor(Math.random()*10);\n if(getran >= 5){\n cur = cur + Math.floor(getran/4);\n }\n count = 0;\n }\n\n for(var whichSphere = 0; whichSphere < Math.min(inputSpheres.length, 18 + cur);whichSphere++){\n \tsphere = inputSpheres[whichSphere];\n if(!inputSpheres[whichSphere].alive){\n continue;\n }\n var angle;\n var distance;\n var center1 = vec4.fromValues(sphere.x, sphere.y, sphere.z, 1.0);\n pvmMatrix = mat4.multiply(pvmMatrix, pvMatrix, mMatrix); // premultiply with pv matrix\n gl.uniformMatrix4fv(mMatrixULoc, false, mMatrix); // pass in model matrix\n \n if(whichSphere < 18){\n \tmat4.multiply(center1, sphere.mMatrix, center1);\n \tfor(var whichmissile = 18; whichmissile < inputSpheres.length; whichmissile++){\n \t\tif (!inputSpheres[whichmissile].alive) \n \t\t\tcontinue;\n \t\tvar spheremissile = inputSpheres[whichmissile];\n \t\tvar spheremissilecenter = vec4.fromValues(spheremissile.x,spheremissile.y, spheremissile.z, 1.0);\n \t\tmat4.multiply(spheremissilecenter, spheremissile.mMatrix, spheremissilecenter);\n \t\t xxx = center1[0] - spheremissilecenter[0];\n \t\t yyy = center1[1] - spheremissilecenter[1];\n \t\t//getdist(center1[0] - spheremissilecenter[0], center1[1] - spheremissilecenter[1])\n \t\t dis = Math.sqrt(xxx * xxx + yyy * yyy);\n \t\tif( dis <= 0.08){\n \t\t\t console.log(\"444\");\n \t\t\t miss_remain--;\n \t\t\tsphere.alive = false;\n \t\t\tspheremissile.alive = false;\n \t\t\tscore = score + 10;\n \t\t\tcrash.play();\n \t\t\taddscore(context);\n \t\t\t\n \t\t\tbreak;\n \t\t}\n \t}\n \tif (!sphere.alive) continue;\n \t//console.log(\"distance\" + getdist(center1[0] - sphere.destination[0], center1[1] - sphere.destination[1]) );\n \txxx = center1[0] - sphere.destination[0];\n \tyyy = center1[1] - sphere.destination[1];\n \tdis = Math.sqrt(xxx * xxx + yyy * yyy);\n \t//getdist(center1[0] - sphere.destination[0], center1[1] - sphere.destination[1])\n if (dis <= 0.005) {\n \t console.log(\"555\");\n sphere.alive = false;\n continue;\n }\n mat4.translate(sphere.mMatrix, sphere.mMatrix, [antispeed * Math.cos(sphere.angle), antispeed * Math.sin(sphere.angle), 0]);\n \tpvmMatrix = mat4.multiply(pvmMatrix, pvMatrix, sphere.mMatrix);\n gl.uniformMatrix4fv(mMatrixULoc, false, sphere.mMatrix); // pass in model matrix\n }\n if(whichSphere >=18){\n console.log(\"222\");\n //var cursphere = inputSpheres[whichSphere];\n mat4.multiply(center1, sphere.mMatrix, center1);\n\n if(sphere.target == 10){\n var randomtarget = Math.floor(Math.random()*10);\n if(randomtarget == 9){\n randomtarget = randomtarget - Math.floor(Math.random()*10);\n }\n sphere.target = randomtarget;\n }\n var curtarget = sphere.target;\n //console.log(\"randomtarget:\" + randomtarget);\n\n var currentcenter = vec4.fromValues(sphere.x, sphere.y, sphere.z, 1.0);\n mat4.multiply(currentcenter, sphere.mMatrix, currentcenter);\n\n\n angle = Math.atan2(sphere.y - inputTriangles[curtarget].center[1], sphere.x - inputTriangles[curtarget].center[0]);\n xxx = currentcenter[1] - inputTriangles[curtarget].center[1];\n yyy = currentcenter[0] - inputTriangles[curtarget].center[0];\n dis = Math.sqrt(xxx * xxx, yyy * yyy);\n distance = dis;\n\n if(distance <= sphere.r){\n \tconsole.log(\"333\");\n if(inputTriangles[curtarget].alive && curtarget < 3) {\n \tbatteries--;\n }\n crash.play();\n sphere.alive = false;\n inputTriangles[curtarget].alive = false;\n miss_remain--;\n }\n mat4.translate(sphere.mMatrix, sphere.mMatrix, [-mspeed * Math.cos(angle), -mspeed * Math.sin(angle), 0]);\n pvmMatrix = mat4.multiply(pvmMatrix, pvMatrix, sphere.mMatrix);\n gl.uniformMatrix4fv(mMatrixULoc, false, sphere.mMatrix); // pass in model matrix\n }\n gl.uniformMatrix4fv(pvmMatrixULoc, false, pvmMatrix); // pass in the hpvm matrix\n\n // reflectivity: feed to the fragment shader\n gl.uniform3fv(ambientULoc, sphere.ambient); // pass in the ambient reflectivity\n\n gl.uniform3fv(diffuseULoc, sphere.diffuse); // pass in the diffuse reflectivity\n gl.uniform3fv(specularULoc, sphere.specular); // pass in the specular reflectivity\n gl.uniform1f(shininessULoc, sphere.n); // pass in the specular exponent\n\n gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffers[numTriangleSets + whichSphere]); // activate vertex buffer\n gl.vertexAttribPointer(vPosAttribLoc, 3, gl.FLOAT, false, 0, 0); // feed vertex buffer to shader\n gl.bindBuffer(gl.ARRAY_BUFFER, normalBuffers[numTriangleSets + whichSphere]); // activate normal buffer\n gl.vertexAttribPointer(vNormAttribLoc, 3, gl.FLOAT, false, 0, 0); // feed normal buffer to shader\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, triangleBuffers[numTriangleSets + whichSphere]); // activate tri buffer\n // draw a transformed instance of the ellipsoid\n gl.drawElements(gl.TRIANGLES, triSetSizes[numTriangleSets + whichSphere], gl.UNSIGNED_SHORT, 0); // render\n \n }\n}", "title": "" }, { "docid": "8b30b0a6522af8f574990648bdbb037b", "score": "0.5396615", "text": "function draw(gl, n, currentAngle, modelMatrix, u_ModelMatrix, normalMatrix, u_NormalMatrix) {\r\n//==============================================================================\r\n //torus\r\n \r\n //swimming robot\r\n pushMatrix(modelMatrix);\r\n modelMatrix.rotate(-60, 1, 1, 0);\r\n modelMatrix.rotate(currentAngle, 0, 1, 0);\r\n modelMatrix.scale(0.3, 0.3, 0.3);\r\n modelMatrix.translate(5, 0 ,0);\r\n // ViewMatrNix.rotate(Angle_sphere, 0, 0, 0);\r\n // Make it smaller:\r\n modelMatrix.rotate(0, 0, 0, 1); // Spin on XY diagonal axis\r\n modelMatrix.translate(-1, -1, -1);\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, modelMatrix.elements);\r\n // Draw just the first set of vertices: start at vertex SHAPE_0_SIZE\r\n gl.drawArrays(gl.TRIANGLES, recStart,36);\r\n\r\n pushMatrix(modelMatrix);\r\n /////////\r\n modelMatrix.translate(0.5, 0, 1);\r\n modelMatrix.rotate(180, 1, 0, 0);\r\n modelMatrix.rotate(currentAngle*0.15+20, 1, 0, 0);\r\n modelMatrix.scale(0.2, 1, 0.2);\r\n // modelMatrix.translate(-1, 0, -1);\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // Draw just the first set of vertices: start at vertex SHAPE_0_SIZE\r\n gl.drawArrays(gl.TRIANGLES, recStart/floatsPerVertex,36);\r\n //draw the first calf\r\n //the \r\n //first\r\n ///calf\r\n modelMatrix.scale(5, 1, 5);\r\n modelMatrix.translate(0, 2, 0);\r\n modelMatrix.rotate(leg_angle*0.2, 1, 0, 0);\r\n // modelMatrix.translate(0.5, 0, 0.5);\r\n modelMatrix.scale(0.1, 1, 0.1);\r\n modelMatrix.translate(1, 0, 1);\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // // Draw just the first set of vertices: start at vertex SHAPE_0_SIZE\r\n gl.drawArrays(gl.TRIANGLES, recStart/floatsPerVertex,36);\r\n\r\n // draw\r\n // a\r\n // foot\r\n modelMatrix.scale(10, 1, 10);\r\n modelMatrix.translate(0, 2, 0);\r\n \r\n modelMatrix.rotate(10, 0, 1, 0);\r\n \r\n modelMatrix.scale(0.1, 0.1, 0.3);\r\n modelMatrix.translate(0.1, 0, 0.1);\r\n \r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // // Draw just the first set of vertices: start at vertex SHAPE_0_SIZE\r\n gl.drawArrays(gl.TRIANGLES, recStart/floatsPerVertex,36);\r\n\r\n modelMatrix = popMatrix();\r\n\r\n pushMatrix(modelMatrix);\r\n modelMatrix.translate(1.5, 0, 1);\r\n modelMatrix.rotate(180, 1, 0, 0);\r\n modelMatrix.rotate(-currentAngle*0.15+20, 1, 0, 0);\r\n modelMatrix.scale(0.2, 1, 0.2);\r\n // modelMatrix.translate(-1, 0, -1);\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // Draw just the first set of vertices: start at vertex SHAPE_0_SIZE\r\n gl.drawArrays(gl.TRIANGLES, recStart/floatsPerVertex,36);\r\n //\r\n //another \r\n //calf\r\n modelMatrix.scale(5, 1, 5);\r\n modelMatrix.translate(0, 2, 0);\r\n modelMatrix.rotate(-leg_angle*0.2, 1, 0, 0);\r\n // modelMatrix.translate(0.5, 0, 0.5);\r\n modelMatrix.scale(0.1, 1, 0.1);\r\n modelMatrix.translate(1, 0, 1);\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // // Draw just the first set of vertices: start at vertex SHAPE_0_SIZE\r\n gl.drawArrays(gl.TRIANGLES, recStart/floatsPerVertex,36);\r\n\r\n //another\r\n //foot\r\n // modelMatrix = popMatrix();\r\n\r\n modelMatrix.scale(10, 1, 10);\r\n modelMatrix.translate(0, 2, 0);\r\n modelMatrix.rotate(10, 0, 1, 0);\r\n modelMatrix.scale(0.1, 0.1, 0.3);\r\n modelMatrix.translate(0.1, 0, 0.1);\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // // Draw just the first set of vertices: start at vertex SHAPE_0_SIZE\r\n gl.drawArrays(gl.TRIANGLES, recStart/floatsPerVertex,36);\r\n modelMatrix = popMatrix();\r\n modelMatrix = popMatrix();\r\n\r\n //tri\r\nfor(l = 0; l < 10; l++){\r\n pushMatrix(modelMatrix);\r\n //-------Create Spinning Tetrahedron-----------------------------------------\r\n // (Projection and View matrices, if you had them, would go here)\r\n modelMatrix.translate(-0.4+l,-0.4+l, 0.0); // 'set' means DISCARD old matrix,\t\t\t\r\n modelMatrix.scale(1,1,-1);\t\t\t\t\t\t\t// convert to left-handed csys\r\n modelMatrix.scale(0.5, 0.5, 0.5);\r\n modelMatrix.rotate(currentAngle, 0, 1, 0); // spin drawing axes on Y axis;\r\n \t//Find inverse transpose of modelMatrix:\r\n \tnormalMatrix.setInverseOf(modelMatrix);\r\n \tnormalMatrix.transpose();\r\n \t\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n \t\t// Pass our current Normal matrix to the vertex shaders:\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, modelMatrix.elements);\r\n \t\t// Draw triangles: start at vertex 0 and draw 12 vertices\r\n gl.drawArrays(gl.TRIANGLES, triStart/floatsPerVertex, 12);\r\n\r\n modelMatrix = popMatrix();\r\n}\r\nfor(l = 1; l < 10; l++){\r\n pushMatrix(modelMatrix);\r\n //-------Create Spinning Tetrahedron-----------------------------------------\r\n // (Projection and View matrices, if you had them, would go here)\r\n modelMatrix.translate(-0.4-l,+0.4-l, 0.0); // 'set' means DISCARD old matrix, \r\n modelMatrix.scale(1,1,-1); // convert to left-handed csys\r\n modelMatrix.scale(0.5, 0.5, 0.5);\r\n modelMatrix.rotate(currentAngle, 0, 1, 0); // spin drawing axes on Y axis;\r\n //Find inverse transpose of modelMatrix:\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n \r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n // Pass our current Normal matrix to the vertex shaders:\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, modelMatrix.elements);\r\n // Draw triangles: start at vertex 0 and draw 12 vertices\r\n gl.drawArrays(gl.TRIANGLES, triStart/floatsPerVertex, 12);\r\n\r\n modelMatrix = popMatrix();\r\n}\r\n\r\n\r\n\r\n \r\n////grid ground\r\n pushMatrix(modelMatrix);\r\n modelMatrix.translate( 0.4, -0.4, 0.0); \r\n modelMatrix.scale(0.1, 0.1, 0.1); // shrink by 10X:\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // Draw just the ground-plane's vertices\r\n gl.drawArrays(gl.LINES, // use this drawing primitive, and\r\n gndStart/floatsPerVertex, // start at this vertex number, and\r\n gndVerts.length/floatsPerVertex); // draw this many vertices.\r\n modelMatrix = popMatrix();\r\n\r\n // planet system\r\n pushMatrix(modelMatrix);\r\n pushMatrix(modelMatrix);\r\n modelMatrix.translate(0.4 + xNewPoint, 0 + yNewPoint, 0);\r\n modelMatrix.scale(1,1,-1); // convert to left-handed coord sys\r\n modelMatrix.scale(0.2, 0.2, 0.2);\r\n // Make it smaller:\r\n // modelMatrix.rotate(currentAngle, 1, 1, 1);\r\n modelMatrix.rotate(Angle_sphere, 0, 1, 0); // Spin on XY diagonal axis\r\n // modelMatrix.translate(2, 0, 0);\r\n\r\n // Drawing: \r\n // Pass our current matrix to the vertex shaders:\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // Draw just the sphere's vertices\r\n gl.drawArrays(gl.TRIANGLE_STRIP, // use this drawing primitive, and\r\n sphStart/floatsPerVertex, // start at this vertex number, and \r\n sphVerts.length/floatsPerVertex); // draw this many vertices.\r\n\r\n\r\n\r\n\r\n //============================\r\n //balls BALL ONE\r\n //============================\r\n modelMatrix.scale(5, 5, 5);\r\n modelMatrix.translate(0, 0, 0.0); // 'set' means DISCARD old matrix,\r\n // (drawing axes centered in CVV), and then make new\r\n // drawing axes moved to the lower-left corner of CVV.\r\n modelMatrix.scale(1,1,-1); // convert to left-handed coord sys\r\n // to match WebGL display canvas.\r\n modelMatrix.scale(0.1, 0.1, 0.1);\r\n // Make it smaller:\r\n modelMatrix.rotate(Angle_sphere, 1, 0, 0); // Spin on XY diagonal axis\r\n modelMatrix.translate(6,0,0);\r\n // modelMatrix.rotate(currentAngle, 1, 0, 1);\r\n // Drawing: \r\n // Pass our current matrix to the vertex shaders:\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // Draw just the sphere's vertices\r\n gl.drawArrays(gl.TRIANGLE_STRIP, // use this drawing primitive, and\r\n sphStart/floatsPerVertex, // start at this vertex number, and \r\n sphVerts.length/floatsPerVertex); // draw this many vertices.\r\n\r\n modelMatrix = popMatrix();\r\n\r\n //BALL Two\r\n ////////\r\n pushMatrix(modelMatrix);\r\n modelMatrix.translate(0.4 + xNewPoint, 0 + yNewPoint, 0);\r\n modelMatrix.scale(1,1,-1); // convert to left-handed coord sys\r\n modelMatrix.scale(0.075, 0.075, 0.075);\r\n // Make it smaller:\r\n // modelMatrix.rotate(currentAngle, 1, 1, 1);\r\n modelMatrix.rotate(-Angle_sphere, 1, 0, 0); // Spin on XY diagonal axis\r\n modelMatrix.translate(0, 5, 0);\r\n // modelMatrix.translate(2, 0, 0);\r\n\r\n // Drawing: \r\n // Pass our current matrix to the vertex shaders:\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // Draw just the sphere's vertices\r\n gl.drawArrays(gl.TRIANGLE_STRIP, // use this drawing primitive, and\r\n sphStart/floatsPerVertex, // start at this vertex number, and \r\n sphVerts.length/floatsPerVertex); // draw this many vertices.\r\n\r\n modelMatrix = popMatrix();\r\n //==============================\r\n //\r\n //BALL THREE\r\n //==============================\r\n\r\n pushMatrix(modelMatrix);\r\n modelMatrix.translate(0.4 + xNewPoint, 0 + yNewPoint, 0);\r\n modelMatrix.scale(1,1,-1); // convert to left-handed coord sys\r\n modelMatrix.scale(0.05, 0.05, 0.05);\r\n // Make it smaller:\r\n // modelMatrix.rotate(currentAngle, 1, 1, 1);\r\n modelMatrix.rotate(Angle_sphere, 1, 1, 0); // Spin on XY diagonal axis\r\n modelMatrix.translate(0, 0, 6);\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // Draw just the sphere's vertices\r\n gl.drawArrays(gl.TRIANGLE_STRIP, // use this drawing primitive, and\r\n sphStart/floatsPerVertex, // start at this vertex number, and \r\n sphVerts.length/floatsPerVertex); // draw this many vertices.\r\n\r\n modelMatrix = popMatrix();\r\n //====================================\r\n //=========strip to support sphere======\r\n //====================================\r\n\r\n //\r\n // BALL ONE\r\n //\r\n pushMatrix(modelMatrix);\r\n modelMatrix.translate(0.4 + xNewPoint, 0 + yNewPoint, 0); \r\n modelMatrix.scale(1,1,-1); \r\n modelMatrix.rotate(Angle_sphere, 0, 1, 0);\r\n modelMatrix.scale(0.3, 0.015, 0.015);\r\n modelMatrix.translate(0.8, 0 ,0);\r\n\r\n modelMatrix.rotate(0, 0, 0, 1); // Spin on XY diagonal axis\r\n modelMatrix.translate(-1, -1, -1);\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // Draw just the first set of vertices: start at vertex SHAPE_0_SIZE\r\n gl.drawArrays(gl.TRIANGLES, recStart,36);\r\n\r\n modelMatrix = popMatrix();\r\n //=======================================\r\n //\r\n //strip for ball two\r\n //\r\n //=======================================\r\n pushMatrix(modelMatrix);\r\n modelMatrix.translate(0.4 + xNewPoint, 0 + yNewPoint, 0);\r\n modelMatrix.scale(1,1,-1); \r\n modelMatrix.rotate(Angle_sphere - 90, -1, 0, 0);\r\n modelMatrix.scale(0.01125, 0.01125, 0.2);\r\n modelMatrix.translate(0, 0 ,-0.6);\r\n modelMatrix.rotate(0, 0, 0, 1); // Spin on XY diagonal axis\r\n modelMatrix.translate(-1, -1, -1); \r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n\r\n\r\n // Draw just the first set of vertices: start at vertex SHAPE_0_SIZE\r\n gl.drawArrays(gl.TRIANGLES, recStart,36);\r\n\r\n modelMatrix = popMatrix();\r\n\r\n //===================================\r\n //\r\n //\r\n //strip for ball three\r\n //\r\n //===================================\r\n pushMatrix(modelMatrix);\r\n modelMatrix.translate(0.4 + xNewPoint, 0 + yNewPoint, 0); // 'set' means DISCARD old matrix,\r\n // (drawing axes centered in CVV), and then make new\r\n // drawing axes moved to the lower-left corner of CVV.\r\n modelMatrix.scale(1,1,-1); \r\n modelMatrix.rotate(Angle_sphere, 1, 1, 0);\r\n modelMatrix.scale(0.0075, 0.0075, 0.15);\r\n // modelMatrix.scale(0.01125, 0.01125, 0.2);\r\n modelMatrix.translate(0, 0, 0.6);\r\n // modelMatrix.rotate(Angle_sphere, 0, 0, 0);\r\n // Make it smaller:\r\n modelMatrix.rotate(-Angle_sphere, 0, 0, 1); // Spin on XY diagonal axis\r\n modelMatrix.translate(-1, -1, -1); \r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n // Draw just the first set of vertices: start at vertex SHAPE_0_SIZE\r\n gl.drawArrays(gl.TRIANGLES, recStart,36);\r\n\r\n modelMatrix = popMatrix();\r\n modelMatrix = popMatrix();\r\n\r\n pushMatrix(modelMatrix);\r\n pushMatrix(modelMatrix);\r\n modelMatrix.translate(0.0, 0.0, 0.0);\r\n normalMatrix.setInverseOf(modelMatrix);\r\n normalMatrix.transpose();\r\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\r\n gl.uniformMatrix4fv(u_NormalMatrix, false, normalMatrix.elements);\r\n gl.drawArrays(gl.LINES, // use this drawing primitive, and\r\n axeStart/floatsPerVertex, // start at this vertex number, and\r\n 6); // draw this many vertices.\r\n\r\n modelMatrix = popMatrix();\r\n\r\n /////////////////\r\n ////////////////\r\n ////////////////\r\n pushMatrix(modelMatrix);\r\n modelMatrix.translate(10.0, 10.0, 0.0);\r\n modelMatrix = popMatrix();\r\n\r\n}", "title": "" }, { "docid": "9bd03fbd3b524d2acc407c00aa9ee795", "score": "0.5390078", "text": "function drawSphere(_ctm) {\n var temp = modelViewMatrix;\n var m = mult(modelViewMatrix, _ctm);\n if (planeDrawn == false) {\n\n gl.drawArrays(gl.TRIANGLE_FAN, 0, 4);\n planeDrawn = true;\n }\n\n planeMatrix = mat4();\n gl.uniformMatrix4fv(modelViewMatrixLoc, false, flatten(m));\n\n for (var i = 6; i < index; i += 3) {\n\n gl.drawArrays(gl.TRIANGLE_STRIP, i, 3);\n\n }\n }", "title": "" }, { "docid": "256e1b99ac31fffb47a387b53ce0d81a", "score": "0.53832525", "text": "function drawObject(gl, obj) {\n var sProgram = obj.shaderProgram;\n var vBuffer = obj.vertexBuffer;\n\n gl.useProgram(sProgram);\n gl.bindBuffer(gl.ARRAY_BUFFER, vBuffer);\n\n // SET VALUES FOR THIS FRAME FOR ALL DEFAULT UNIFORMS:\n\n gl.vertexAttribPointer( sProgram.vertexPositionAttribute,\n vBuffer.positionElementCount,\n gl.FLOAT,\n false,\n vBuffer.stride,\n vBuffer.positionOffset\n );\n gl.vertexAttribPointer( sProgram.vertexNormalAttribute,\n vBuffer.normalElementCount,\n gl.FLOAT,\n false,\n vBuffer.stride,\n vBuffer.normalOffset\n );\n gl.vertexAttribPointer( sProgram.vertexUVAttribute,\n vBuffer.uvElementCount,\n gl.FLOAT,\n false,\n vBuffer.stride,\n vBuffer.uvOffset\n );\n gl.uniformMatrix4fv(sProgram.pMatrixUniform, false, perspective(50));\n gl.uniformMatrix4fv(sProgram.oMatrixUniform, false, obj.matrix);\n gl.uniformMatrix4fv(sProgram.nMatrixUniform, false, normalMatrix(obj.matrix));\n\n // SET THE VALUES FOR THIS FRAME FOR ALL USER DEFINED UNIFORMS:\n\n for (var i = 0 ; i < obj.uniformNames.length ; i++) {\n var name = obj.uniformNames[i];\n var type = obj.uniformTypes[i];\n var val = obj.uniformValues[i];\n var loc = sProgram.uniformLocations[name];\n\n\t // FIND THE RIGHT GL FUNCTION TO SET THIS TYPE OF UNIFORM VARIABLE.\n /* what's going on???*/\n switch (type) {\n\t case \"float\" : gl.uniform1f (loc, val); break;\n case \"float[]\": gl.uniform1fv (loc, val); break;\n case \"vec2\" : gl.uniform2fv (loc, val); break;\n case \"vec3\" : gl.uniform3fv (loc, val); break;\n case \"vec4\" : gl.uniform4fv (loc, val); break;\n case \"mat4\" : gl.uniformMatrix4fv(loc, false, val); break;\n }\n }\n\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, vBuffer.numItems);\n }", "title": "" }, { "docid": "5c3d37988c718be789decb7be306f3a7", "score": "0.53775525", "text": "function draw() {\r\n _resizeCanvasToDisplaySize(gl.canvas);\r\n gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\r\n\r\n gl.clearColor(0, 0, 0, 1);\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\n\r\n /* Set the values of the projection transformation */\r\n let projection = m4.perspective(Math.PI / 10, 2, 8, 12);\r\n\r\n /* Get the view matrix from the SimpleRotator object.*/\r\n let modelView = spaceball.getViewMatrix();\r\n\r\n let rotateToPointZero = m4.axisRotation([0.707, 0.707, 0], 0.7);\r\n let translateToPointZero = m4.translation(0, 0, -10);\r\n\r\n let matAccum0 = m4.multiply(rotateToPointZero, modelView);\r\n let matAccum1 = m4.multiply(translateToPointZero, matAccum0);\r\n\r\n /* Multiply the projection matrix times the modelview matrix to give the\r\n combined transformation matrix, and send that to the shader program. */\r\n let modelViewProjection = m4.multiply(projection, matAccum1);\r\n\r\n gl.uniformMatrix4fv(iModelViewProjectionMatrix, false, modelViewProjection);\r\n\r\n gl.uniform1i(iTextureMappingUnit, 0);\r\n\r\n\r\n const vertices = []\r\n const texCoords = []\r\n const indices = []\r\n\r\n\r\n const POINTS = 70\r\n\r\n const n = parseInt(numN.value);\r\n const t = 0;\r\n\r\n for (let j = 0; j <= POINTS; j++) {\r\n const r = j * 0.6 / POINTS + 0.4;\r\n for (let i = 0; i <= POINTS; i++) {\r\n const fi = i * 2 * Math.PI / POINTS;\r\n const x = -(Math.cos(t + fi) / (2 * r)) - ((Math.pow(r, (1 + 2 * n)) * Math.cos(t - (1 + 2 * n) * fi)) / (2 + 4 * n))\r\n const y = -(Math.sin(t + fi) / (2 * r)) - ((Math.pow(r, (1 + 2 * n)) * Math.sin(t - (1 + 2 * n) * fi)) / (2 + 4 * n))\r\n const z = (Math.pow(r, n) * Math.cos(t - n * fi)) / n\r\n\r\n vertices.push(x, y, z);\r\n\r\n const sTex = j / POINTS;\r\n const tTex = i / POINTS;\r\n texCoords.push(sTex);\r\n texCoords.push(tTex);\r\n }\r\n }\r\n\r\n for (let j = 0; j < POINTS; j++) {\r\n for (let i = 0; i < POINTS; i++) {\r\n const p1 = j * (POINTS + 1) + i;\r\n const p2 = p1 + (POINTS + 1);\r\n indices.push(p1);\r\n indices.push(p2);\r\n indices.push(p1 + 1);\r\n indices.push(p1 + 1);\r\n indices.push(p2);\r\n indices.push(p2 + 1);\r\n }\r\n }\r\n\r\n gl.uniform4fv(iColor, [0.1, 0.2, 0.7, 1]);\r\n gl.uniform1f(iColorCoef, 0.0);\r\n\r\n // vertices\r\n gl.bindBuffer(gl.ARRAY_BUFFER, iVertexBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STREAM_DRAW);\r\n\r\n // indices\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iIndexBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STREAM_DRAW);\r\n\r\n // textures\r\n if (isWireframe) {\r\n gl.disableVertexAttribArray(iAttribTexture);\r\n gl.vertexAttrib2f(iAttribTexture, 0.0, 0.0);\r\n gl.uniform1f(iColorCoef, 1.0);\r\n\r\n gl.drawElements(gl.LINES, indices.length, gl.UNSIGNED_SHORT, 0);\r\n } else {\r\n gl.enableVertexAttribArray(iAttribTexture);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, iTexBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(texCoords), gl.STREAM_DRAW);\r\n gl.vertexAttribPointer(iAttribTexture, 2, gl.FLOAT, false, 0, 0);\r\n\r\n gl.drawElements(gl.TRIANGLES, indices.length, gl.UNSIGNED_SHORT, 0);\r\n }\r\n\r\n /* Draw coordinate axes as thick colored lines that extend through the cube. */\r\n gl.lineWidth(4);\r\n drawPrimitive(gl.LINES, [1, 0, 0, 1], [-2, 0, 0, 2, 0, 0]);\r\n drawPrimitive(gl.LINES, [0, 1, 0, 1], [0, -2, 0, 0, 2, 0]);\r\n drawPrimitive(gl.LINES, [0, 0, 1, 1], [0, 0, -2, 0, 0, 2]);\r\n gl.lineWidth(1);\r\n}", "title": "" }, { "docid": "2a86b6e0edca5346d57a6c427394b596", "score": "0.53764254", "text": "function initThreeObjects (imageMatrix) {\n\n // 1. Scene\n scene = new THREE.Scene();\n\n // 2. Camera\n const ratio = window.innerWidth / window.innerHeight;\n camera = new THREE.PerspectiveCamera( 90, ratio, 1, 2400);// (視野角, アスペクト比, near, far)\n camera.position.z = 500;\n\n // 3. Floor\n // floor = new THREE.GridHelper(10000, 80);\n // floor.material.color = new THREE.Color(0x999999);\n // floor.position.set(0, -300, 0);\n // scene.add(floor);\n\n // 4. Materials\n material = new THREE.MeshBasicMaterial( {color: 0x999999, wireframe: true} );\n\n // 6. Lights\n ambientLight = new THREE.AmbientLight(0xffffff, 0.2);\n scene.add(ambientLight);\n\n directionalLight = new THREE.DirectionalLight(0xffffff, 0.9);\n directionalLight.position.set( -1000, 1000, 0);\n scene.add(directionalLight);\n\n // 7. Renderer\n renderer = new THREE.WebGLRenderer();\n renderer.setSize(\n window.innerWidth,\n window.innerHeight\n );\n renderer.shadowMap.enabled = true;\n\n // 8. Append objects to DOM\n document.getElementById('wrapper').appendChild( renderer.domElement );\n\n // 9. Color\n boxes = [];\n for (let y = 0; y < imageMatrix.length; ++y) {\n boxes[y] = [];\n for (let x = 0; x < imageMatrix[y].length; ++x) {\n boxes[y][x] = [];\n boxes[y][x].layers = { r: {}, g: {}, b: {}};\n // R\n boxes[y][x].layers.r.geometry = new THREE.BoxGeometry( gridSize, gridSize, gridSize);\n boxes[y][x].layers.r.material = new THREE.MeshBasicMaterial( {\n color: new THREE.Color(imageMatrix[y][x].r/255, 0, 0),\n blending: THREE.AdditiveBlending\n });\n boxes[y][x].layers.r.mesh = new THREE.Mesh( boxes[y][x].layers.r.geometry, boxes[y][x].layers.r.material );\n scene.add( boxes[y][x].layers.r.mesh );\n // G\n boxes[y][x].layers.g.geometry = new THREE.BoxGeometry( gridSize, gridSize, gridSize);\n boxes[y][x].layers.g.material = new THREE.MeshBasicMaterial( {\n color: new THREE.Color(0, imageMatrix[y][x].g/255, 0),\n blending: THREE.AdditiveBlending\n });\n boxes[y][x].layers.g.mesh = new THREE.Mesh( boxes[y][x].layers.g.geometry, boxes[y][x].layers.g.material );\n scene.add( boxes[y][x].layers.g.mesh );\n // B\n boxes[y][x].layers.b.geometry = new THREE.BoxGeometry( gridSize, gridSize, gridSize);\n boxes[y][x].layers.b.material = new THREE.MeshBasicMaterial( {\n color: new THREE.Color(0, 0, imageMatrix[y][x].b/255),\n blending: THREE.AdditiveBlending\n });\n boxes[y][x].layers.b.mesh = new THREE.Mesh( boxes[y][x].layers.b.geometry, boxes[y][x].layers.b.material );\n scene.add( boxes[y][x].layers.b.mesh );\n }\n }\n\n // 9. Controls\n let controls = new OrbitControls(camera, renderer.domElement);\n controls.enableDamping = true;\n controls.dampingFactor = 0.25;\n controls.enableZoom = false;\n\n // 10. Run the world\n requestAnimationFrame( run );\n }", "title": "" }, { "docid": "82c2757e81705e7a2856576e4afee481", "score": "0.5375389", "text": "draw() { \n this.context.fillStyle = '#000';\n this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);\n\n this.drawMatrix(this.arena.matrix, {x: 0, y: 0});\n this.drawMatrix(this.player.matrix, this.player.pos);\n }", "title": "" }, { "docid": "5f6e22ab44702f19cdaee3b587ec31be", "score": "0.53712904", "text": "function drawScene()\n{\n\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\n\tgl.clearDepth(100.0);\n gl.enable(gl.DEPTH_TEST);\n gl.depthFunc(gl.LEQUAL);\n\n\tgl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\tgl.viewport(0, 0, app.canvas.width, app.canvas.height);\n\n\ttry{\n\t\t//Model-View matrix mode setup camera->world\n mat4.perspective(fovy, app.canvas.width / app.canvas.height, 10, 5000.0, pMatrix);\n setMatrixUniforms();\n var updateLightPosition = false;\n gl.uniform1i(prg.uUpdateLight, updateLightPosition);\n \n for (var i = 0; i < Scene.objects.length; i++){\n var object = Scene.objects[i];\n\n if (object.alias == 'lightsource'){\n var lightPos = gl.getUniform(prg, prg.uLightPosition);\n mat4.translate(mvMatrix,lightPos);\n\n \n }\n\n //Setting uniforms\n gl.uniform4fv(prg.uMaterialDiffuse, object.diffuse);\n gl.uniform4fv(prg.uMaterialAmbient, object.ambient);\n gl.uniform4fv(prg.uMaterialSpecular, object.specular);\n\n\n\n gl.uniform1i(prg.uWireframe,object.wireframe);\n gl.uniform1i(prg.uPerVertexColor, object.perVertexColor);\n \n //Setting attributes\n gl.enableVertexAttribArray(prg.aVertexPosition);\n gl.disableVertexAttribArray(prg.aVertexNormal);\n gl.disableVertexAttribArray(prg.aVertexColor);\n \n gl.bindBuffer(gl.ARRAY_BUFFER, object.vbo);\n gl.vertexAttribPointer(prg.aVertexPosition, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(prg.aVertexPosition);\n \n if(!object.wireframe){\n gl.bindBuffer(gl.ARRAY_BUFFER, object.nbo);\n gl.vertexAttribPointer(prg.aVertexNormal, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(prg.aVertexNormal);\n }\n \n if (object.perVertexColor){\n gl.bindBuffer(gl.ARRAY_BUFFER, object.cbo);\n gl.vertexAttribPointer(prg.aVertexColor,4,gl.FLOAT, false, 0,0);\n gl.enableVertexAttribArray(prg.aVertexColor);\n }\n\n\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, object.ibo);\n \n if (object.wireframe){\n gl.drawElements(gl.LINES, object.indices.length, gl.UNSIGNED_SHORT,0);\n }\n else{\n gl.drawElements(gl.TRIANGLES, object.indices.length, gl.UNSIGNED_SHORT,0);\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n \n }\n }\n catch(err){\n alert(err);\n console.error(err.description);\n }\t\n}", "title": "" }, { "docid": "194e048837bcc0f52b3552f258f947e5", "score": "0.5370211", "text": "function drawObjects(){\n image(SUN_IMAGE,CANVAS_WIDTH*3/4,CANVAS_HEIGHT/10,SUN_IMAGE.width,SUN_IMAGE.height);\n clouds.map((currentObject)=>{\n currentObject.move();\n currentObject.draw();\n })\n if(clouds[0] && clouds[0].xPosition==0){\n clouds.splice(0,1)\n }\n image(LOGO_IMAGE,0,0,LOGO_IMAGE.width/2,LOGO_IMAGE.height/2);\n fill(200);\n text(\"Date: \"+STOCK_DATA.rows[CSV_INDEX].obj.Date, CANVAS_WIDTH/2, CANVAS_HEIGHT*3/4);\n fill(200);\n text(\"Price: $\"+parseFloat(STOCK_DATA.rows[CSV_INDEX].obj.Open).toFixed(4), CANVAS_WIDTH/2, CANVAS_HEIGHT*3/4+50);\n fill(200);\n text(\"Money: $\"+points.toFixed(2), CANVAS_WIDTH/2, CANVAS_HEIGHT*3/4+100);\n objects.map(currentObject => {\n currentObject.move();\n currentObject.draw();\n });\n goombas.map(currentObject => {\n currentObject.move();\n currentObject.draw();\n });\n if(objects[0].xPosition<0-50*3){\n objects.splice(0,1)\n }\n if(goombas.length!=0 && goombas[0].xPosition<0-50){\n goombas.splice(0,1)\n }\n MARIO_OBJECT.draw()\n MARIO_OBJECT.update()\n}", "title": "" }, { "docid": "06ab5744ac3cc1cfb8be0415aa382345", "score": "0.5369817", "text": "function renderAllShapes() {\n // Check the time at the start of this function\n var startTime = performance.now();\n\n // Pass the projection matrix\n var projMat = new Matrix4();\n projMat.setPerspective(50, canvas.width/canvas.height, 1, 100);\n gl.uniformMatrix4fv(u_ProjectionMatrix, false, projMat.elements); \n \n // Pass the view matrix\n var viewMat = new Matrix4();\n viewMat.setLookAt(\n g_camera.eye.elements[0], g_camera.eye.elements[1], g_camera.eye.elements[2],\n g_camera.at.elements[0], g_camera.at.elements[1], g_camera.at.elements[2],\n g_camera.up.elements[0], g_camera.up.elements[1], g_camera.up.elements[2],\n );\n // viewMat.setLookAt(0.2,0,5, 0,0,-50, 0,9,0); // (eye, at, up)\n gl.uniformMatrix4fv(u_ViewMatrix, false, viewMat.elements);\n\n // Pass the matrix to u_ModelMatrix attribute\n var globalRotMat = new Matrix4().rotate(g_globalAngle, 0, 1, 0);\n gl.uniformMatrix4fv(u_GlobalRotateMatrix, false, globalRotMat.elements);\n\n // Clear <canvas>\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n // Draw World\n // Draw the walls\n drawMap();\n\n // pass the light position to GLSL\n gl.uniform3f(u_lightPos, g_lightPos[0], g_lightPos[1], g_lightPos[2]);\n gl.uniform3f(u_lightPos2, g_lightPos2[0], g_lightPos2[1], g_lightPos2[2]);\n\n // pass the camera position to GLSL\n gl.uniform3f(u_cameraPos, g_camera.eye.elements[0], g_camera.eye.elements[1], g_camera.eye.elements[2]);\n\n // pass light status\n gl.uniform1i(u_lightOn, g_lightOn);\n gl.uniform1i(u_spotlightOn, g_spotlightOn);\n\n // Draw light\n var light = new Cube();\n light.color = [2, 2, 0, 1];\n light.textureNum = -2;\n light.matrix.translate(g_lightPos[0], g_lightPos[1], g_lightPos[2]);\n light.matrix.scale(-1, -1, -1);\n light.matrix.translate(-.5,-20,-.5);\n light.render();\n\n // Draw spotlight\n var light2 = new Cube();\n light2.color = [2, 2, 0, 1];\n light2.textureNum = -2;\n light2.matrix.translate(g_lightPos2[0], g_lightPos2[1], g_lightPos2[2]);\n light2.matrix.scale(-.1, -.1, -.1);\n light2.matrix.translate(-0.5, -15, -3);\n light2.render();\n \n // Draw sphere\n // var sphere = new Sphere();\n // sphere.color = [1.0, 0.0, 1.0, 1.0];\n // sphere.matrix.translate(0, .2, 0);\n // if (g_normalOn) {\n // sphere.textureNum = -3;\n // } else {\n // sphere.textureNum = 0;\n // }\n // sphere.render();\n\n // // Draw a cube to test normals\n // var testcube = new Cube();\n // testcube.color = [1.0, 0.0, 0.0, 1.0];\n // testcube.matrix.translate(1, 0, 0);\n // // testcube.matrix.rotate(-20, 1, 0, 0);\n // if (g_normalOn) testcube.textureNum = -3;\n // testcube.render();\n\n // Draw the floor\n var floor = new Cube(); \n floor.color = [1.0, 0.0, 0.0, 1.0];\n floor.textureNum = 0;\n floor.matrix.translate(0.0, -.75, 1.5);\n floor.matrix.scale(32, 0, 32);\n floor.matrix.translate(-0.5, 0, 0);\n floor.render();\n\n // Draw the sky\n var sky = new Cube();\n sky.color = [0.2, 0.2, 0.5, 1.0];\n sky.textureNum = 1;\n sky.matrix.scale(60, 60, 60);\n sky.matrix.translate(-0.5, -0.1, 0.1);\n sky.render(); \n\n // Grass around elephant\n var grass1 = new Cube();\n grass1.textureNum = 0;\n grass1.matrix.translate(-9.8, -0.78, -17.3);\n grass1.matrix.scale(0.4, 0.4, 0.4);\n grass1.render();\n\n var grass2 = new Cube();\n grass2.textureNum = 0;\n grass2.matrix.translate(-9.4, -0.78, -17.4);\n grass2.matrix.scale(0.3, 0.35, 0.3);\n grass2.render();\n\n var grass3 = new Cube();\n grass3.textureNum = 0;\n grass3.matrix.translate(-10, -0.78, -17.4);\n grass3.matrix.scale(0.5, 0.28, 0.3);\n grass3.render();\n\n var grass4 = new Cube();\n grass4.textureNum = 0;\n grass4.matrix.translate(-11, -0.78, -16.1);\n grass4.matrix.scale(0.5, 0.45, 1.5);\n grass4.render();\n\n var grass4 = new Cube();\n grass4.textureNum = 0;\n grass4.matrix.translate(-10.5, -0.78, -17.2);\n grass4.matrix.scale(0.7, 0.19, 0.5);\n grass4.render();\n\n // Body of elephant\n var body = new Cube();\n body.color = [0.752941, 0.752941, 0.752941, 1.0];\n if (g_normalOn) {\n body.textureNum = -3;\n } else {\n body.textureNum = -2;\n }\n body.matrix.rotate(90, 1, 0, 0);\n body.matrix.translate(-10, -17, 0.5);\n body.matrix.scale(0.7, 0.7, 0.6);\n body.render(); \n\n var body2 = new Cube();\n body2.color = [0.5, 0.5, 0.5, 1.0];\n if (g_normalOn) {\n body2.textureNum = -3;\n } else {\n body2.textureNum = -2;\n }\n body2.matrix.translate(-9.90, -.45, -16.80);\n body2.matrix.scale(0.55, 0.63, 0.5);\n body2.render();\n\n // Head of elephant\n var head = new Cube();\n head.color = [0.6, 0.6, 0.6, 1.0];\n if (g_normalOn) {\n head.textureNum = -3;\n } else {\n head.textureNum = -2;\n }\n head.matrix.translate(-9.935, -.4, -17.2);\n head.matrix.scale(0.62, 0.62, 0.38);\n head.render();\n\n // Ears of elephant\n var ear1 = new Cube();\n ear1.color = [0.8, 0.8, 0.8, 1.0];\n if (g_normalOn) {\n ear1.textureNum = -3;\n } else {\n ear1.textureNum = -2;\n }\n ear1.matrix.translate(-9.55, -0.46, -17.3);\n ear1.matrix.scale(0.45, 0.75, 0.1);\n ear1.render();\n\n var ear2 = new Cube();\n ear2.color = [0.8, 0.8, 0.8, 1.0];\n if (g_normalOn) {\n ear2.textureNum = -3;\n } else {\n ear2.textureNum = -2;\n }\n ear2.matrix.translate(-10.2, -0.46, -17.3);\n ear2.matrix.scale(0.45, 0.75, 0.1);\n ear2.render();\n\n // Trunk of elephant\n var trunk1 = new Cube();\n trunk1.color = [0.85, 0.85, 0.85, 1.0];\n if (g_normalOn) {\n trunk1.textureNum = -3;\n } else {\n trunk1.textureNum = -2;\n }\n trunk1.matrix.rotate(g_trunkAngle, 1, 0, 0);\n var trunkCoordinates = new Matrix4(trunk1.matrix);\n trunk1.matrix.translate(-9.71, -0.23, -17.5);\n trunk1.matrix.scale(0.16 , 0.29, 0.15);\n trunk1.render();\n\n var trunk2 = new Cube();\n trunk2.matrix = trunkCoordinates;\n trunk2.color = [0.9, 0.9, 0.9, 1.0];\n if (g_normalOn) {\n trunk2.textureNum = -3;\n } else {\n trunk2.textureNum = -2;\n }\n trunk2.matrix.rotate(g_lowtrunkAngle, 1, 0, 0);\n trunk2.matrix.translate(-9.695, -0.34, -17.5);\n trunk2.matrix.scale(0.13 , 0.3, 0.13);\n trunk2.render();\n\n // Legs of elephant/platypus\n // Leg1\n var thigh1 = new Cube();\n thigh1.color = [1, 0.65, 0.0, 1.0];\n if (g_normalOn) {\n thigh1.textureNum = -3;\n } else {\n thigh1.textureNum = -2;\n }\n thigh1.matrix.rotate(g_frlegAngle, 1, 0, 0);\n var thigh1Coordinates = new Matrix4(thigh1.matrix);\n thigh1.matrix.translate(-9.4, -0.60, -16.75);\n thigh1.matrix.scale(0.2 , 0.23, 0.15);\n thigh1.render();\n\n var leg1 = new Cube();\n leg1.matrix = thigh1Coordinates;\n leg1.color = [1, 0.5, 0.0, 1.0];\n if (g_normalOn) {\n leg1.textureNum = -3;\n } else {\n leg1.textureNum = -2;\n }\n leg1.matrix.rotate(-90, 1, 0, 0);\n leg1.matrix.translate(-9.42, 16.71, -0.6);\n leg1.matrix.scale(0.24, 0.285, 0.14);\n leg1.render();\n\n // Leg2\n var thigh2 = new Cube();\n thigh2.color = [1, 0.65, 0.0, 1.0];\n if (g_normalOn) {\n thigh2.textureNum = -3;\n } else {\n thigh2.textureNum = -2;\n }\n thigh2.matrix.rotate(g_fllegAngle, 0, 0, 1);\n var thigh2Coordinates = new Matrix4(thigh2.matrix);\n thigh2.matrix.translate(-10.1, -0.60, -16.75);\n thigh2.matrix.scale(0.2 , 0.23, 0.15);\n thigh2.render();\n\n var leg2 = new Cube();\n leg2.matrix = thigh2Coordinates;\n leg2.color = [1, 0.5, 0.0, 1.0];\n if (g_normalOn) {\n leg2.textureNum = -3;\n } else {\n leg2.textureNum = -2;\n }\n leg2.matrix.rotate(-90, 1, 0, 0);\n leg2.matrix.translate(-10.12, 16.71, -0.6);\n leg2.matrix.scale(0.24, 0.285, 0.14);\n leg2.render();\n\n // Leg3\n var thigh3 = new Cube();\n thigh3.color = [1, 0.65, 0.0, 1.0];\n if (g_normalOn) {\n thigh3.textureNum = -3;\n } else {\n thigh3.textureNum = -2;\n }\n thigh3.matrix.rotate(g_brlegAngle, 1, 0, 0);\n var thigh3Coordinates = new Matrix4(thigh3.matrix);\n thigh3.matrix.translate(-9.4, -0.60, -16.35);\n thigh3.matrix.scale(0.2 , 0.23, 0.15);\n thigh3.render();\n\n var leg3 = new Cube();\n leg3.matrix = thigh3Coordinates;\n leg3.color = [1, 0.5, 0.0, 1.0];\n if (g_normalOn) {\n leg3.textureNum = -3;\n } else {\n leg3.textureNum = -2;\n }\n leg3.matrix.rotate(-90, 1, 0, 0);\n leg3.matrix.translate(-9.42, 16.3, -0.6);\n leg3.matrix.scale(0.24, 0.285, 0.14);\n leg3.render();\n\n // Leg4\n var thigh4 = new Cube();\n thigh4.color = [1, 0.65, 0.0, 1.0]; \n if (g_normalOn) {\n thigh4.textureNum = -3;\n } else {\n thigh4.textureNum = -2;\n }\n thigh4.matrix.rotate(g_bllegAngle, 0, 0, 1);\n var thigh4Coordinates = new Matrix4(thigh4.matrix);\n thigh4.matrix.translate(-10.1, -0.6, -16.35);\n thigh4.matrix.scale(0.24, 0.23, 0.15);\n thigh4.render();\n\n var leg4 = new Cube();\n leg4.matrix = thigh4Coordinates;\n leg4.color = [1, 0.5, 0.0, 1.0];\n if (g_normalOn) {\n leg4.textureNum = -3;\n } else {\n leg4.textureNum = -2;\n }\n leg4.matrix.rotate(-90, 1, 0, 0);\n leg4.matrix.translate(-10.1, 16.3, -0.6);\n leg4.matrix.scale(0.24, 0.285, 0.14);\n leg4.render();\n\n // Tail of platypus\n var tail = new Cube();\n tail.color = [1, 0.5, 0.0, 1.0];\n if (g_normalOn) {\n tail.textureNum = -3;\n } else {\n tail.textureNum = -2;\n }\n tail.matrix.rotate(g_tailAngle, 0, 1, 0);\n tail.matrix.translate(-9.885, -0.27, -16.3);\n tail.matrix.rotate(90, 1, 0, 0);\n tail.matrix.scale(0.5, 0.57, 0.18);\n tail.render();\n\n // Eyes \n var white1 = new Cube();\n white1.color = [1.0, 1.0, 1.0, 0.0];\n if (g_normalOn) {\n white1.textureNum = -3;\n } else {\n white1.textureNum = -2;\n }\n white1.matrix.translate(-9.87, 0.04, -17.5);\n white1.matrix.scale(0.12, 0.127, 0.1);\n white1.render();\n\n var eye1 = new Cube();\n eye1.color = [0.0, 0.0, 0.0, 1.0];\n if (g_normalOn) {\n eye1.textureNum = -3;\n } else {\n eye1.textureNum = -2;\n }\n eye1.matrix.translate(-9.87, 0.04, -17.5);\n eye1.matrix.scale(0.1, 0.1, 0.11);\n eye1.render();\n\n var white2 = new Cube();\n white2.color = [1.0, 1.0, 1.0, 0.0];\n if (g_normalOn) {\n white2.textureNum = -3;\n } else {\n white2.textureNum = -2;\n }\n white2.matrix.translate(-9.5, 0.04, -17.5);\n white2.matrix.scale(0.12, 0.127, 0.1);\n white2.render();\n\n var eye2 = new Cube();\n eye2.color = [0.0, 0.0, 0.0, 1.0];\n if (g_normalOn) {\n eye2.textureNum = -3;\n } else {\n eye2.textureNum = -2;\n }\n eye2.matrix.translate(-9.5, 0.04, -17.5);\n eye2.matrix.scale(0.1, 0.1, 0.11);\n eye2.render();\n \n // Check the time at the end of the function, and show on web page\n var duration = performance.now() - startTime;\n sendTextToHTML(\" ms: \" + Math.floor(duration) + \" fps: \" + Math.floor(10000/duration)/10, \"numdot\");\n}", "title": "" }, { "docid": "a13ee4cf1a2b3a670e8d040287f34b8f", "score": "0.53656393", "text": "function render(){\n gl.viewport(0, 0, 512, 512);\n //start by clearing any previous data for both color and depth\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n //we'll discuss projection matrices in a couple of days, but use this for now:\n var p = perspective(fov, (canvas.width/2) / canvas.height, 1.0, 100.0);\n gl.uniformMatrix4fv(uproj, false, flatten(p));\n\n //now set up the model view matrix and send it over as a uniform\n //the inputs to this lookAt are to move back 20 units, point at the origin, and the positive y axis is up\n var mv = lookAt(vec3(xmove, ymove, zmove), vec3(0, 0, 0), vec3(0, 1, 0));\n mv = mult(mv, translate(xoffset, yoffset, zoffset));\n\n var commonMat = mv; //so we can get back to this state later\n\n mv = mult(mv, rotateY(rotateAngle));\n\n gl.uniformMatrix4fv(umv, false, flatten(mv));\n\n //we only have one object at the moment, but just so we don't forget this step if we have multiple buffers\n gl.bindBuffer(gl.ARRAY_BUFFER, bufferId);\n gl.vertexAttribPointer(vPosition, 4, gl.FLOAT, false, 32, 0);\n gl.vertexAttribPointer(vColor, 4, gl.FLOAT, false, 32, 16);\n\n //draw the geometry we previously sent over. It's a list of 12 triangle(s),\n //we want to start at index 0, and there will be a total of 36 vertices (6 faces with 6 vertices each)\n gl.drawArrays(gl.TRIANGLES, 0, 36); // draw the cube\n\n mv = commonMat; //go back to the transforms that apply to the whole scene\n\n if (mode === 1){\n mv = mult(mv, mult(rotateY(orbit), mult(translate(3, 0, 0), rotateX(rotateAngle))));\n gl.uniformMatrix4fv(umv, false, flatten(mv));\n gl.drawArrays(gl.TRIANGLES, 0, 36); // draw the same cube but in a different location/orientation\n }\n else if (mode === 2){\n mv = mult( mv, rotmat); //see update() for how we construct this\n gl.uniformMatrix4fv(umv, false, flatten(mv));\n gl.drawArrays(gl.TRIANGLES, 0, 36); // draw the cube\n }\n\n gl.viewport(512, 0, 512, 512);\n\n var p = perspective(fov, (canvas.width/2) / canvas.height, 1.0, 100.0);\n gl.uniformMatrix4fv(uproj, false, flatten(p));\n\n //now set up the model view matrix and send it over as a uniform\n //the inputs to this lookAt are to move back 20 units, point at the origin, and the positive y axis is up\n var mv = lookAt(vec3(0, 20, zmove), vec3(0, 0, 0), vec3(1, 0, 0));\n mv = mult(mv, translate(xoffset, yoffset, zoffset));\n\n var commonMat = mv; //so we can get back to this state later\n\n mv = mult(mv, rotateY(rotateAngle));\n\n gl.uniformMatrix4fv(umv, false, flatten(mv));\n\n //we only have one object at the moment, but just so we don't forget this step if we have multiple buffers\n gl.bindBuffer(gl.ARRAY_BUFFER, bufferId);\n gl.vertexAttribPointer(vPosition, 4, gl.FLOAT, false, 32, 0);\n gl.vertexAttribPointer(vColor, 4, gl.FLOAT, false, 32, 16);\n\n //draw the geometry we previously sent over. It's a list of 12 triangle(s),\n //we want to start at index 0, and there will be a total of 36 vertices (6 faces with 6 vertices each)\n gl.drawArrays(gl.TRIANGLES, 0, 36); // draw the cube\n\n mv = commonMat; //go back to the transforms that apply to the whole scene\n\n if (mode == 1){\n mv = mult(mv, mult(rotateY(orbit), mult(translate(3, 0, 0), rotateX(rotateAngle))));\n gl.uniformMatrix4fv(umv, false, flatten(mv));\n gl.drawArrays(gl.TRIANGLES, 0, 36); // draw the same cube but in a different location/orientation\n }\n else if (mode == 2){\n mv = mult( mv, rotmat); //see update() for how we construct this\n gl.uniformMatrix4fv(umv, false, flatten(mv));\n gl.drawArrays(gl.TRIANGLES, 0, 36); // draw the cube\n }\n}", "title": "" }, { "docid": "ab6949ee67aabe4139f644152b02a822", "score": "0.5363606", "text": "function doMagic()\n{\n if(magic)\n {\n gl.uniformMatrix4fv(modelViewMatrixLoc, false, flatten(modelViewMatrix));\n gl.bindBuffer(gl.ARRAY_BUFFER, vBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(points), gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, cBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(colors), gl.STATIC_DRAW);\n numVertices = 24;\n verticesPerFace = 4; \n }\n else\n {\n gl.uniformMatrix4fv(modelViewMatrixLoc, false, flatten(magicViewMatrix));\n gl.bindBuffer(gl.ARRAY_BUFFER, vBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(magicPoints), gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, cBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, flatten(magicColors), gl.STATIC_DRAW);\n numVertices = 216;\n verticesPerFace = 36;\n }\n magic = !magic;\n render();\n}", "title": "" }, { "docid": "ffb156ac0558172a276a2296931006c3", "score": "0.535652", "text": "display() {\n this.scene.pushMatrix();\n \n this.scene.translate(0, -0.1, 0);\n this.scene.scale(10, 0.1, 10);\n this.baseTexture.bind();\n this.base.display();\n this.scene.popMatrix();\n\n this.scene.pushMatrix();\n this.scene.scale(1, 0.1, 1);\n\n this.cellTexture.bind();\n this.board.forEach(hexagon => {\n hexagon.display();\n });\n this.pieces.forEach(piece => {\n if (piece) piece.display();\n });\n this.scene.popMatrix();\n }", "title": "" }, { "docid": "0272869e3cc401586546f2794485c740", "score": "0.53537655", "text": "function draw_model_right(canvas_id,scratch_id,username,scale) {\n\t\t//Draws an isometric model of the given minecraft username\n\t\tvar model = document.getElementById(canvas_id).getContext('2d');\n\t\tvar scratch = document.getElementById(scratch_id).getContext('2d');\n\t\t\n\t\t//Resize Scratch\n\t\tdocument.getElementById(scratch_id).width = 64*scale;\n\t\tdocument.getElementById(scratch_id).height = 32*scale;\n\t\t\n\t\t//Resize Isometric Area (Found by trial and error)\n\t\tdocument.getElementById(canvas_id).width = 20*scale;\n\t\tdocument.getElementById(canvas_id).height = 44.8*scale;\n\t\t\n\t\tvar skin = new Image();\n\t\tskin.src = '/api.php?skin=' + username;\n\t\t\n\t\tskin.onload = function(){\n\t\t\t//Draw the skin on to the scratch\n\t\t\tscratch.drawImage(skin,0,0);\n\t\t\t//Scale it\n\t\t\tscale_image(scratch.getImageData(0,0,64,32), scratch, 0, 0, scale);\n\t\t\t//Left Leg\n\t\t\t//Left Leg - Front\n\t\t\tmodel.setTransform(1,-0.5,0,1.2,0,0);\n\t\t\tmodel.scale(-1,1);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 4*scale, 20*scale, 4*scale, 12*scale, -16*scale, 34.4/1.2*scale, 4*scale, 12*scale);\n\t\t\t\n\t\t\t//Right Leg\n\t\t\t//Right Leg - Right\n\t\t\tmodel.setTransform(1,0.5,0,1.2,0,0);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 0*scale, 20*scale, 4*scale, 12*scale, 4*scale, 26.4/1.2*scale, 4*scale, 12*scale);\n\t\t\t//Right Leg - Front\n\t\t\tmodel.setTransform(1,-0.5,0,1.2,0,0);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 4*scale, 20*scale, 4*scale, 12*scale, 8*scale, 34.4/1.2*scale, 4*scale, 12*scale);\n\t\t\t\n\t\t\t//Arm Left\n\t\t\t//Arm Left - Front\n\t\t\tmodel.setTransform(1,-0.5,0,1.2,0,0);\n\t\t\tmodel.scale(-1,1);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 44*scale, 20*scale, 4*scale, 12*scale, -20*scale, 20/1.2*scale, 4*scale, 12*scale);\n\t\t\t//Arm Left - Top\n\t\t\tmodel.setTransform(-1,0.5,1,0.5,0,0);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 44*scale, 16*scale, 4*scale, 4*scale, 0, 16*scale, 4*scale, 4*scale);\n\t\t\t\n\t\t\t//Body\n\t\t\t//Body - Front\n\t\t\tmodel.setTransform(1,-0.5,0,1.2,0,0);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 20*scale, 20*scale, 8*scale, 12*scale, 8*scale, 20/1.2*scale, 8*scale, 12*scale);\n\t\t\t\n\t\t\t//Arm Right\n\t\t\t//Arm Right - Right\n\t\t\tmodel.setTransform(1,0.5,0,1.2,0,0);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 40*scale, 20*scale, 4*scale, 12*scale, 0, 16/1.2*scale, 4*scale, 12*scale);\n\t\t\t//Arm Right - Front\n\t\t\tmodel.setTransform(1,-0.5,0,1.2,0,0);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 44*scale, 20*scale, 4*scale, 12*scale, 4*scale, 20/1.2*scale, 4*scale, 12*scale);\n\t\t\t//Arm Right - Top\n\t\t\tmodel.setTransform(-1,0.5,1,0.5,0,0);\n\t\t\tmodel.scale(-1,1);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 44*scale, 16*scale, 4*scale, 4*scale, -16*scale, 16*scale, 4*scale, 4*scale);\n\t\t\t\n\t\t\t//Head\n\t\t\t//Head - Front\n\t\t\tmodel.setTransform(1,-0.5,0,1.2,0,0);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 8*scale, 8*scale, 8*scale, 8*scale, 10*scale, 13/1.2*scale, 8*scale, 8*scale);\n\t\t\t//Head - Right\n\t\t\tmodel.setTransform(1,0.5,0,1.2,0,0);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 0, 8*scale, 8*scale, 8*scale, 2*scale, 3/1.2*scale, 8*scale, 8*scale);\n\t\t\t//Head - Top\n\t\t\tmodel.setTransform(-1,0.5,1,0.5,0,0);\n\t\t\tmodel.scale(-1,1);\n\t\t\tmodel.drawImage(document.getElementById(scratch_id), 8*scale, 0, 8*scale, 8*scale, -3*scale, 5*scale, 8*scale, 8*scale);\n\t\t\t\n\t\t\tif(!is_one_color(scratch.getImageData(40*scale,8*scale,8*scale,8*scale))) {\n\t\t\t\t//Hat\n\t\t\t\t//Hat - Front\n\t\t\t\tmodel.setTransform(1,-0.5,0,1.2,0,0);\n\t\t\t\tmodel.drawImage(document.getElementById(scratch_id), 40*scale, 8*scale, 8*scale, 8*scale, 10*scale, 13/1.2*scale, 8*scale, 8*scale);\n\t\t\t\t//Hat - Right\n\t\t\t\tmodel.setTransform(1,0.5,0,1.2,0,0);\n\t\t\t\tmodel.drawImage(document.getElementById(scratch_id), 32*scale, 8*scale, 8*scale, 8*scale, 2*scale, 3/1.2*scale, 8*scale, 8*scale);\n\t\t\t\t//Hat - Top\n\t\t\t\tmodel.setTransform(-1,0.5,1,0.5,0,0);\n\t\t\t\tmodel.scale(-1,1);\n\t\t\t\tmodel.drawImage(document.getElementById(scratch_id), 40*scale, 0, 8*scale, 8*scale, -3*scale, 5*scale, 8*scale, 8*scale);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "45d91b959bfde286239959791e448ad2", "score": "0.53405756", "text": "function redraw()\n{\n var connectionIDs = [];\n var modelList = localModel.getRoot().keys();\n\n modelList.forEach(function(key)\n {\n var modelItem = localModel.getRoot().get(key);\n if (modelItem != null)\n { \n //put all connections in an array to iterate through later\n if (modelItem.shape == \"connection\")\n {\n connectionIDs.push(modelItem);\n }\n else \n {\n drawIntoSVG(modelItem);\n }\n }\n });\n\n //draw the connections last! This is very important \n //becase the connections use ids to elements to connect\n //so the element with the id needs to be in there before you draw the conn\n for (var k = 0; k < connectionIDs.length; k++){\n drawIntoSVG(connectionIDs[k]);\n }\n}", "title": "" }, { "docid": "2e277bc8a06684d91208affadb50e645", "score": "0.53390455", "text": "function drawPedastal(xTranslation){\n let modelTop = glMatrix.mat4.create();\n let modelMiddle = glMatrix.mat4.create();\n\n \n glMatrix.mat4.translate(modelTop, modelTop, [xTranslation, 0, 0]);\n glMatrix.mat4.scale(modelTop, modelTop, [3,1,2]);\n drawObject(modelTop, myCube);\n\n glMatrix.mat4.translate(modelMiddle, modelMiddle, [xTranslation, -1.5, 0]);\n glMatrix.mat4.scale(modelMiddle, modelMiddle, [1.5, 2.5, 1.5]);\n drawObject(modelMiddle, myCube);\n\n glMatrix.mat4.translate(modelTop, modelTop, [0, -2.5, 0]);\n drawObject(modelTop, myCube)\n}", "title": "" }, { "docid": "337c215b4a3812b37560fa557944b4b7", "score": "0.5335373", "text": "displayObject() {\n this.scene.pushMatrix();\n this.scene.scale(this.scale, this.scale, this.scale);\n\n /* central balloon */\n this.material.setTexture(this.blimp);\n this.material.apply();\n this.scene.pushMatrix();\n this.scene.scale(0.5, 0.5, 1);\n this.balloon.display();\n this.scene.popMatrix();\n\n /* cockpit */\n this.material.setTexture(this.cockpit);\n this.material.apply();\n this.scene.pushMatrix();\n this.scene.translate(0, -0.5, 0);\n this.scene.rotate(Math.PI / 2, 1, 0, 0);\n this.scene.scale(0.1, 0.45, 0.1);\n this.scene.translate(0, -0.5, 0);\n this.mainCockpit.display();\n this.scene.popMatrix();\n\n this.material.setTexture(this.cockpitFront);\n this.material.apply();\n this.scene.pushMatrix();\n this.scene.translate(0, -0.5, 0.225);\n this.scene.scale(0.1, 0.1, 0.1);\n this.cockpitSide.display();\n this.scene.popMatrix();\n\n this.material.setTexture(this.cockpitFront);\n this.material.apply();\n this.scene.pushMatrix();\n this.scene.translate(0, -0.5, -0.225);\n this.scene.scale(0.1, 0.1, 0.1);\n this.cockpitSide.display();\n this.scene.popMatrix();\n\n /* wings */\n this.wings.display();\n\n /* turbine holders */\n // left\n this.material.setTexture(this.blimp);\n this.material.apply();\n this.scene.pushMatrix();\n this.scene.translate(0.11, -0.54, -0.25);\n this.scene.scale(0.04, 0.02, 0.07);\n this.turbineHolder.display();\n this.scene.popMatrix();\n\n // right\n this.material.setTexture(this.blimp);\n this.material.apply();\n this.scene.pushMatrix();\n this.scene.translate(-0.11, -0.54, -0.25);\n this.scene.scale(0.04, 0.02, 0.07);\n this.turbineHolder.display();\n this.scene.popMatrix();\n\n /* turbines */\n this.material.setTexture(this.cockpit);\n this.material.apply();\n // left\n this.scene.pushMatrix();\n this.scene.translate(0.11, -0.54, -0.30);\n this.scene.rotate(-Math.PI / 2, 1, 0, 0);\n this.scene.scale(0.02, 0.02, 0.01);\n this.turbine.display();\n this.scene.popMatrix();\n\n // right\n this.scene.pushMatrix();\n this.scene.translate(-0.11, -0.54, -0.3);\n this.scene.rotate(-Math.PI / 2, 1, 0, 0);\n this.scene.scale(0.02, 0.02, 0.01);\n this.turbine.display();\n this.scene.popMatrix();\n\n // flag holders\n this.scene.pushMatrix();\n this.scene.translate(0, 0, -1.75);\n this.scene.scale(0.02, 0.8, 0.02);\n this.scene.translate(0, -0.5, 0);\n this.flagHolder.display();\n this.scene.popMatrix();\n\n this.material.setTexture(this.rope);\n this.material.apply();\n this.scene.pushMatrix();\n this.scene.translate(0, 0.2, -1.35);\n this.scene.rotate(Math.PI / 2 + 0.38995733, 1, 0, 0);\n this.scene.scale(0.0075, 0.85, 0.0075);\n this.scene.translate(0, -0.5, 0);\n this.flagHolder.display();\n this.scene.popMatrix();\n\n this.scene.pushMatrix();\n this.scene.translate(0, -0.2, -1.35);\n this.scene.rotate(Math.PI / 2 - 0.38995733, 1, 0, 0);\n this.scene.scale(0.0075, 0.85, 0.0075);\n this.scene.translate(0, -0.5, 0);\n this.flagHolder.display();\n this.scene.popMatrix();\n\n this.scene.popMatrix();\n }", "title": "" }, { "docid": "1f8a96aadfee236fb45c80d8bab2a39b", "score": "0.5325128", "text": "render()\r\n {\r\n // push matrix\r\n push()\r\n\r\n // translate to entry corner\r\n translate(this.center.x - 10, this.center.y - 10)\r\n \r\n // draw curve\r\n noFill();\r\n stroke(...this.color);\r\n strokeWeight(2);\r\n beginShape();\r\n for(let element of this.points)\r\n {\r\n vertex(element.x, element.y);\r\n }\r\n endShape();\r\n\r\n // draw latest curve point\r\n fill(...this.color);\r\n ellipse(this.points[this.points.length - 1].x, this.points[this.points.length - 1].y, 8, 8);\r\n\r\n // pop matrix\r\n pop();\r\n }", "title": "" }, { "docid": "eb5bf52ed6e62e8eff348a365cca42f7", "score": "0.53247845", "text": "function main() {\n\n //Matrixes for view\n var mats = {\n modelMatrix: new Matrix4(),\n viewMatrix: new Matrix4(),\n projMatrix: new Matrix4(),\n mvpMatrix: new Matrix4(),\n normalMatrix: new Matrix4()\n };\n \n mats.modelMatrix.rotate(45,0, 1, 0);\n mats.normalMatrix.setInverseOf(mats.modelMatrix);\n mats.normalMatrix.transpose();\n\n //Models for building\n var Builds = {\n one: { \n mod: new Matrix4(),\n norm: new Matrix4()\n },\n two: {\n mod: new Matrix4(),\n norm: new Matrix4()\n },\n three: {\n mod: new Matrix4(),\n norm: new Matrix4()\n },\n six: {\n mod: new Matrix4(),\n norm: new Matrix4()\n },\n };\n \n var keys = [];\n\n //Set up the building models\n setBuilds(Builds);\n\n // get WebGL rendering context\n var canvas = document.getElementById('webgl');\n var gl = getWebGLContext(canvas);\n if (!gl) {\n console.log('Failed to get the rendering context for WebGL');\n return;\n } \n\n //set up texProgram\n var texProgram = createProgram(gl, TEX_VSHADER_SOURCE, TEX_FSHADER_SOURCE);\n texProgram.a_Position = gl.getAttribLocation(texProgram, 'a_Position');\n texProgram.a_TexCoord = gl.getAttribLocation(texProgram, 'a_TexCoord');\n texProgram.u_MvpMatrix = gl.getUniformLocation(texProgram, 'u_MvpMatrix');\n texProgram.u_Sampler = gl.getUniformLocation(texProgram, 'u_Sampler');\n \n\n //set up solidProgram\n var solidProgram = createProgram(gl, SOL_VSHADER_SOURCE, SOL_FSHADER_SOURCE);\n solidProgram.a_Position = gl.getAttribLocation(solidProgram, 'a_Position');\n solidProgram.a_Normal = gl.getAttribLocation(solidProgram, 'a_Normal');\n solidProgram.u_MvpMatrix = gl.getUniformLocation(solidProgram, 'u_MvpMatrix');\n solidProgram.a_Color = gl.getUniformLocation(solidProgram, 'a_Color');\n solidProgram.u_DiffuseLight = gl.getUniformLocation(solidProgram, 'u_DiffuseLight');\n solidProgram.u_LightDirection = gl.getUniformLocation(solidProgram, 'u_LightDirection');\n solidProgram.u_DirectOneColor = gl.getUniformLocation(solidProgram, 'u_DirectOneColor');\n solidProgram.u_DirectOnePosition = gl.getUniformLocation(solidProgram, 'u_DirectOnePosition');\n solidProgram.u_ModelMatrix = gl.getUniformLocation(solidProgram, 'u_ModelMatrix');\n solidProgram.u_NormalMatrix = gl.getUniformLocation(solidProgram, 'u_NormalMatrix'); \n solidProgram.u_AmbientLight = gl.getUniformLocation(solidProgram, 'u_AmbientLight');\n solidProgram.u_DirectTwoColor = gl.getUniformLocation(solidProgram, 'u_DirectTwoColor');\n solidProgram.u_DirectTwoPosition = gl.getUniformLocation(solidProgram, 'u_DirectTwoPosition');\n\n //Initialize the ground and cube buffers\n var Ground = initGBuffer(gl, texProgram);\n var Cube = initCBuffer(gl, solidProgram);\n var Sphere = initSphere(gl, solidProgram);\n\n //set up the vie matrixes\n mats.viewMatrix.setLookAt(g_eyeX, g_eyeY, g_eyeZ, AtX, 0, AtZ, 0, 1, 0);\n mats.projMatrix.setPerspective(90, canvas.width/canvas.height, 0.1, 200);\n // Calculate the model view projection matrix\n mats.mvpMatrix.set(mats.projMatrix).multiply(mats.viewMatrix).multiply(mats.modelMatrix);\n\n // Specify the color for clearing <canvas>\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n gl.clear(gl.COLOR_BUFFER_BIT); // Clear <canvas>\n\n // Set texture\n if (!initTextures(gl, Ground, texProgram, mats)) {\n console.log('Failed to intialize the texture.');\n return;\n }\n\n //Function to capture key presses\n document.onkeydown = function(ev){ \n keydown(ev, keys); \n };\n document.onkeyup = function(ev) {\n keyup(ev, keys);\n };\n\n //Animation loop\n var tick = function() {\n animate(Builds);\n move(keys);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n drawGround(gl, Ground, mats, texProgram);\n drawCubes(gl, Cube, mats, solidProgram, Builds);\n drawSphere(gl, Sphere, mats, solidProgram);\n requestAnimationFrame(tick);\n };\n tick();\n}", "title": "" }, { "docid": "ac260a5455c8808992aab3c435531357", "score": "0.53232867", "text": "function modelViewMatrixSet() {\n mat4.multiply(graph.cameraMatrix, graph.worldMatrix, graph.modelViewMatrix);\n}", "title": "" }, { "docid": "c11d7912230c428ad9a2b78b177269b7", "score": "0.53123194", "text": "function drawCrate(){\n\t// wall # 1\n\tlightAmbient = vec4(0.4, 0.4, 0.4, 1);\n lightDiffuse = vec4(0.2, 0.2, 0.2, 1);\n lightSpecular = vec4(0.2, 0.2, 0.2, 1);\n materialAmbient = vec4(1, 0, 0, 1);\n materialDiffuse = vec4(1, 0, 0, 1);\n materialSpecular = vec4(1, 0, 0, 1);\n materialShininess = 200;\n lighting(); \n\t\n\tmvMatrixStack.push(modelViewMatrix);\n\tr = rotate(0.0, 0.0, 0.0, 1.0);\n\ts = scale4(1,1,1);\n\tt = translate(0,0,0);\n modelViewMatrix = mult(mult(mult(modelViewMatrix, t), r), s);\n\tDrawSide(0.02); \n\tmodelViewMatrix = mvMatrixStack.pop();\n\t\n\tmvMatrixStack.push(modelViewMatrix);\n\tr = rotate(90, 0.0, 0.0, 1.0);\n\ts = scale4(.5,1,1);\n\tt = translate(.5,.25,0);\n modelViewMatrix = mult(mult(mult(modelViewMatrix, t), r), s);\n\tDrawSide(0.02); \n\tmodelViewMatrix = mvMatrixStack.pop();\n\n\tmvMatrixStack.push(modelViewMatrix);\n\tr = rotate(90, 0.0, 0.0, 1.0);\n\ts = scale4(.5,1,1);\n\tt = translate(-.5,.25,0);\n modelViewMatrix = mult(mult(mult(modelViewMatrix, t), r), s);\n\tDrawSide(0.02); \n\tmodelViewMatrix = mvMatrixStack.pop();\n\n\t\tmvMatrixStack.push(modelViewMatrix);\n\tr = rotate(90, 0.0, 1.0, 0.0);\n\tr = mult(r, rotate(90, 0.0, 0.0, 1.0));\n\ts = scale4(.5,1,1);\n\tt = translate(0,.25,.5);\n modelViewMatrix = mult(mult(mult(modelViewMatrix, t), r), s);\n\tDrawSide(0.02); \n\tmodelViewMatrix = mvMatrixStack.pop();\n\n\tmvMatrixStack.push(modelViewMatrix);\n\tr = rotate(90, 0.0, 1.0, 0.0);\n\tr = mult(r, rotate(90, 0.0, 0.0, 1.0));\n\ts = scale4(.5,1,1);\n\tt = translate(0,.25,-.5);\n modelViewMatrix = mult(mult(mult(modelViewMatrix, t), r), s);\n\tDrawSide(0.02); \n\tmodelViewMatrix = mvMatrixStack.pop();\n\n\t// draw balls in crate\n\n\n}", "title": "" }, { "docid": "b985614e87bb641925033a185ff3fa5b", "score": "0.5310823", "text": "function initMatrixes() {\n \n var mFrontView = mat4();\n\tvar mUpView = mult(mat4(), rotateX(90));\n\tvar mSideView = mult(mat4(), rotateY(90));\n\tvar mModelView = obliqueProj(0.5, 45);\n\t\n\tmodelView[0] = mUpView;\n\tmodelView[1] = mModelView;\n\tmodelView[2] = mFrontView;\n\tmodelView[3] = mSideView;\n\t\n\t\n\tcanvas.height = window.innerHeight;\n\tcanvas.width = window.innerWidth;\t\n\tvar ratio = canvas.height/canvas.width;\n\t\t\n\t\n\tvar mFix = scalem(ratio, 1.0, 1.0);\n mProj = mFix;\n mPerspective = mFix;\n}", "title": "" }, { "docid": "650f0a23f13d3416c47e9366a03e26ef", "score": "0.53051144", "text": "function traverseModel(root)\n{\n\n stack.push(modelViewMatrix);\n modelViewMatrix = mult(modelViewMatrix, root.transform);\n\n var i = root.children.length-1;\n while (root.children[i] != null && i >= root.children.length/2)\n {\n traverseModel(root.children[i]);\n i--;\n }\n if(root.draw!= null)\n root.draw();\n while (root.children[i] != null && root.children.length>0 )\n {\n traverseModel(root.children[i]);\n i--;\n } \n\n modelViewMatrix = stack.pop();\n}", "title": "" }, { "docid": "e4e6a9cb21269efd93eb3c9df730124e", "score": "0.53023183", "text": "function Models () {\n\tthis.box = [[0,0,0,'0'], [5,0,0,'0'], [5,5,0,'0'], [0,5,0,'0'],\n\t\t[0,0,5,'0'], [5,0,5,'0'], [5,5,5,'0'], [0,5,5,'0']];\n\n\tthis.container = [[0,0,100,'&'], [canvas.width,0,100,'&'], [0,canvas.height,100, '&'], \n\t\t[canvas.width,canvas.height,100,'&'], [0,0,200,'&'], [canvas.width,0,200,'&'], \n\t\t[0,canvas.height,200, '&'], [canvas.width,canvas.height,200,'&'], [0,0,300,'&'], \n\t\t[canvas.width,0,300,'&'], [0,canvas.height,300, '&'], [canvas.width,canvas.height,300,'&'], \n\t\t[0,0,400,'&'], [canvas.width,0,400,'&'], [0,canvas.height,400, '&'], \n\t\t[canvas.width,canvas.height,400,'&'], [0,0,500,'&'], [canvas.width,0,500,'&'], \n\t\t[0,canvas.height,500, '&'], [canvas.width,canvas.height,500,'&'], [0,0,600,'&'], \n\t\t[canvas.width,0,600,'&'], [0,canvas.height,600, '&'], [canvas.width,canvas.height,600,'&'], \n\t\t[0,0,700,'&'], [canvas.width,0,700,'&'], [0,canvas.height,700, '&'], \n\t\t[canvas.width,canvas.height,700,'&'], [0,0,800,'&'], [canvas.width,0,800,'&'], \n\t\t[0,canvas.height,800, '&'], [canvas.width,canvas.height,800,'&'], [0,0,900,'&'], \n\t\t[canvas.width,0,900,'&'], [0,canvas.height,900, '&'], [canvas.width,canvas.height,900,'&']];\n\n\t// 2D grid\n\tthis.grid2D = function ( width, height, asci ) {\n\t\tif(typeof asci === \"undefined\") {\n\t asci = '.';\n\t }\n\t\tvar grid = []\n\t\tfor (var i = 1; i < width; i+=1) {\n\t\t\tfor(var j = 0; j < height; j+=1) {\n\t\t\t\tgrid.append([i, j, 1, asci ])\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// 10^3\n\tthis.diamond = [ \n\t\t[5,0,5, '#'], [0,5,5, '#'], [10,5,5, '#'], [5,10,5, '#'], /* corners */\n\t\t[5,5,0, '#'], [5,5,10, '#'],\n\t\t[4,1,5, '.'], [3,2,5, '.'], [2,3,5, '.'], [1,4,5, '.'], /* sides */\n\t\t[6,1,5, '.'], [7,2,5, '.'], [8,3,5, '.'], [9,4,5, '.'],\n\t\t[4,9,5, '.'], [3,8,5, '.'], [2,7,5, '.'], [1,6,5, '.'],\n\t\t[6,9,5, '.'], [7,8,5, '.'], [8,7,5, '.'], [9,6,5, '.'],\n\t\t[5,1,4, '.'], [5,2,3, '.'], [5,3,2, '.'], [5,4,1, '.'],\n\t\t[5,1,6, '.'], [5,2,7, '.'], [5,3,8, '.'], [5,4,9, '.'],\n\t\t[5,9,4, '.'], [5,8,3, '.'], [5,7,2, '.'], [5,6,1, '.'],\n\t\t[5,9,6, '.'], [5,8,7, '.'], [5,7,8, '.'], [5,6,9, '.'],\n\t\t[4,5,1, '.'], [3,5,2, '.'], [2,5,3, '.'], [1,5,4, '.'],\n\t\t[6,5,1, '.'], [7,5,2, '.'], [8,5,3, '.'], [9,5,4, '.'],\n\t\t[4,5,9, '.'], [3,5,8, '.'], [2,5,7, '.'], [1,5,6, '.'],\n\t\t[6,5,9, '.'], [7,5,8, '.'], [8,5,7, '.'], [9,5,6, '.']\n\t\t];\n\n\t// 10^3\n\tthis.palmTree = [\n\t\t[5,10,5, 'i'], [5,9,5, 'i'], [5,8,5, 'i'], [5,7,5, 'i'], [5,6,5, 'i'], [5,6,5, 'i'], /* stalk */\n\t\t[5,5,5, 'i'], [5,4,5, 'i'], [5,3,5, 'i'], [5,2,5, 'i'],\n\t\t[5,1,5, '*'], \t/* head */\n/*\t\t[4,1,5, '-*-'], [6,1,5, '-*-'], [5,1,6, '-*-'], [5,1,4, '-*-'],*/\t\t\n\t\t[4,1,4, '*'], [3,1,3, '*'], [2,2,2, '*'], [1,3,1, '*'], /* leaves */\n\t\t[6,1,4, '*'], [7,1,3, '*'], [8,2,2, '*'], [9,3,1, '*'],\n\t\t[6,1,6, '*'], [7,1,7, '*'], [8,2,8, '*'], [9,3,9, '*'],\n\t\t[4,1,6, '*'], [3,1,7, '*'], [2,2,8, '*'], [1,3,9, '*']\n\n\t];\n\n\t// 10^3\n\tthis.sun = [\n\t\t[5,0,5, '.', '#FFCC00'], [0,5,5, '.', '#FFCC00'], [10,5,5, '.', '#FFCC00'], [5,10,5, '.', '#FFCC00'], /* corners */\n\t\t[5,5,0, '.', '#FFCC00'], [5,5,10, '.', '#FFCC00'],\n\t\t[4,1,5, '.', '#FFCC00'], [3,2,5, '.', '#FFCC00'], [2,3,5, '.', '#FFCC00'], [1,4,5, '.', '#FFCC00'], /* sides */\n\t\t[6,1,5, '.', '#FFCC00'], [7,2,5, '.', '#FFCC00'], [8,3,5, '.', '#FFCC00'], [9,4,5, '.', '#FFCC00'],\n\t\t[4,9,5, '.', '#FFCC00'], [3,8,5, '.', '#FFCC00'], [2,7,5, '.', '#FFCC00'], [1,6,5, '.', '#FFCC00'],\n\t\t[6,9,5, '.', '#FFCC00'], [7,8,5, '.', '#FFCC00'], [8,7,5, '.', '#FFCC00'], [9,6,5, '.', '#FFCC00'],\n\t\t[5,1,4, '.', '#FFCC00'], [5,2,3, '.', '#FFCC00'], [5,3,2, '.', '#FFCC00'], [5,4,1, '.', '#FFCC00'],\n\t\t[5,1,6, '.', '#FFCC00'], [5,2,7, '.', '#FFCC00'], [5,3,8, '.', '#FFCC00'], [5,4,9, '.', '#FFCC00'],\n\t\t[5,9,4, '.', '#FFCC00'], [5,8,3, '.', '#FFCC00'], [5,7,2, '.', '#FFCC00'], [5,6,1, '.', '#FFCC00'],\n\t\t[5,9,6, '.', '#FFCC00'], [5,8,7, '.', '#FFCC00'], [5,7,8, '.', '#FFCC00'], [5,6,9, '.', '#FFCC00'],\n\t\t[4,5,1, '.', '#FFCC00'], [3,5,2, '.', '#FFCC00'], [2,5,3, '.', '#FFCC00'], [1,5,4, '.', '#FFCC00'],\n\t\t[6,5,1, '.', '#FFCC00'], [7,5,2, '.', '#FFCC00'], [8,5,3, '.', '#FFCC00'], [9,5,4, '.', '#FFCC00'],\n\t\t[4,5,9, '.', '#FFCC00'], [3,5,8, '.', '#FFCC00'], [2,5,7, '.', '#FFCC00'], [1,5,6, '.', '#FFCC00'],\n\t\t[6,5,9, '.', '#FFCC00'], [7,5,8, '.', '#FFCC00'], [8,5,7, '.', '#FFCC00'], [9,5,6, '.', '#FFCC00'],\n\t\t[3,5,3, '.', '#FFCC00'], [3,5,8, '.', '#FFCC00'], [8,5,3, '.', '#FFCC00'], [8,5,8, '.', '#FFCC00']\n\n\t];\n\n\t// 5^3\n\tthis.grass = [\n\t\t[5,4,0, '. . . .', '#663300'], /* rocks */\n\t\t[0,3,0, ')', '#003300'], [4,3,0, '(', '#003300'], /* blades */\n\t\t[0,3,0, '(', '#003300'], [3,3,2, ')', '#003300'] \n\n\t];\n\n\t// 3^300\n\tthis.fly = [\n\t[2,2,2, '.'], [1,2,2, '-'], [3,2,2, '-']\n\t];\n\n\tthis.planet = [\n\t[0,0,0, '.', '#ffffff']\n\t];\n\n\tthis.planetB = [\n\t[0,0,0, '.', '#FFCC00']\n\t];\n\n\tthis.planetC = [\n\t[0,0,0, '.', '#46E3AC']\n\t]\n\n}", "title": "" }, { "docid": "196c742021c82c45d0762e7da4e09d1f", "score": "0.5301935", "text": "function drawGUI(matrix, list) {\n var i = 0, j = 0, len = matrix.length, color = null, item = null;\n for (i = 0; i < len; i++) {\n for (j = 0; j < len; j++) {\n color = generateColorByNumber(matrix[i][j]);\n item = list[i][j].children[0];\n item.textContent = matrix[i][j] === 0 ? ' ' : matrix[i][j];\n item.style.background = color.bgColor;\n item.style.color = color.color;\n item.style.fontSize = generateSizeByNumber(matrix[i][j]) + 'px';\n }\n }\n }", "title": "" }, { "docid": "4f5a1e4ec1a8b1c36d08e8b2e5129980", "score": "0.5286618", "text": "function MachineObject(glContext) {\n // Local storage variables and \"constants\"\n var gl = glContext;\n var machine;\n var machineFaceCount = 4;\n\n // Arrays that hold Object details\n var vertArray = [];\n var texCoordsArray = [];\n var textureArray = [];\n \n // Basic texture coordinates\n var textureCoords = [\n 1.0, 1.0,\n 0.0, 1.0,\n 1.0, 0.0,\n 0.0, 0.0\n ];\n\n // Simple vertex values describing rectangles of varrying shapes and at varying positions\n var topVertices = [\n vec3.fromValues(1.1, 1.1, 0.0),\n vec3.fromValues(-1.1, 1.1, 0.0),\n vec3.fromValues(1.1, 0.35, 0.0),\n vec3.fromValues(-1.1, 0.35, 0.0)\n ];\n var leftVertices = [\n vec3.fromValues(-0.75, 0.35, 0.0),\n vec3.fromValues(-1.1, 0.35, 0.0),\n vec3.fromValues(-0.75, -0.35, 0.0),\n vec3.fromValues(-1.1, -0.35, 0.0)\n ];\n var rightVertices = [\n vec3.fromValues(1.1, 0.35, 0.0),\n vec3.fromValues(0.75, 0.35, 0.0),\n vec3.fromValues(1.1, -0.35, 0.0),\n vec3.fromValues(0.75, -0.35, 0.0)\n ];\n var bottomVertices = [\n vec3.fromValues(1.1, -0.35, 0.0),\n vec3.fromValues(-1.1, -0.35, 0.0),\n vec3.fromValues(1.1, -1.1, 0.0),\n vec3.fromValues(-1.1, -1.1, 0.0)\n ];\n\n /**\n * This method creates the object's geometry and texture assignment.\n * @param textureArray An array of textures, 1 texture per rectangle.\n * @param shaderProgram The reference to the Shader Program Object to be used for rendering this object.\n */\n this.create = function (textureArray, shaderProgram) {\n // Create an array of vertices\n vertArray.push(topVertices);\n vertArray.push(bottomVertices);\n vertArray.push(leftVertices);\n vertArray.push(rightVertices);\n\n // Assign the same texture coordinates for each rectangle\n for (var i = 0; i < machineFaceCount; i++) {\n texCoordsArray.push(textureCoords);\n }\n\n // And then create the actual 3d object\n machine = new WebGL.object3d(gl);\n if (!machine.initGeometry(vertArray, texCoordsArray))\n console.log(\"Machine error. Error initializing Geometry!\");\n if (!machine.assignTextures(textureArray))\n console.log(\"Machine error. Error assigning Textures!\");\n machine.assignShaderProgram(shaderProgram);\n };\n\n /**\n * This method is used to render the object onto the canvas\n * @param movementMatrix The 4x4 matrix describing the offset from origin for this object\n */\n this.draw = function (movementMatrix) {\n // Translate the object 2 units deeper into the screen, and add that translation to the one provided as parameter\n var translation = vec3.fromValues(0, 0, -2);\n var translationMatrix = mat4.create();\n mat4.translate(translationMatrix, movementMatrix, translation);\n\n // Draw the object\n if (!machine.draw(translationMatrix))\n console.log(\"Machine Drawing error!\");\n };\n}", "title": "" }, { "docid": "37bf9797d36f39ecdb71800c3276c9f6", "score": "0.5282987", "text": "function drawMatrix(matrix) {\n for (var y = 0; y < matrix.length; y++) {\n for (var x = 0; x < matrix[y].length; x++) {\n\n if (matrix[y][x] == 0) {\n if(weatherclient == 'Summer'){\n fill(\"pink\");\n }\n else if(weatherclient == 'Spring'){\n fill(\"#8bc34a\");\n }\n else if(weatherclient == 'Winter'){\n fill(\"#1266a9\");\n }\n else if(weatherclient == 'autumn'){\n fill(\"#cca328\");\n }\n }\n else if(matrix[y][x] == 1){\n fill(\"green\");\n }\n else if (matrix[y][x] == 5) {\n fill(\"blue\");\n }\n\n else if (matrix[y][x] == 2) {\n fill(\"yellow\");\n }\n else if (matrix[y][x] == 3) {\n fill(\"black\");\n }\n else if (matrix[y][x] == 4) {\n fill(\"red\");\n }\n rect(x * side, y * side, side, side);\n\n }\n }\n\n}", "title": "" }, { "docid": "7250eab8166bd898c6843b6817117689", "score": "0.5275455", "text": "function drawCube(gl, model, normal, Cube, color, mats, program) {\n //set up view, mode, and normals and pass them to the shader\n mats.mvpMatrix.set(mats.projMatrix).multiply(mats.viewMatrix).multiply(model);\n normal.setInverseOf(model);\n normal.transpose();\n gl.uniformMatrix4fv(program.u_NormalMatrix, false, normal.elements);\n gl.uniformMatrix4fv(program.u_ModelMatrix, false, model.elements);\n gl.uniformMatrix4fv(program.u_MvpMatrix, false, mats.mvpMatrix.elements);\n\n //set the color of the cube\n if(color === 'grey') {\n gl.uniform4f(program.a_Color, 0.8, 0.8, 0.8, 1);\n } else if (color === 'red') {\n gl.uniform4f(program.a_Color, 1, 0, 0, 1);\n } else if (color === 'blue') {\n gl.uniform4f(program.a_Color, 0, 0, 1, 1);\n }\n\n gl.drawElements(gl.TRIANGLES, Cube.indices.length, gl.UNSIGNED_BYTE, 0); \n}", "title": "" }, { "docid": "3df5a40bab26cee37e39c9543e8833f4", "score": "0.52740306", "text": "function drawObject(obj){\n\tctx.drawImage(obj.img, \n\t\tobj.width*obj.anim[obj.state], 0,\n\t\tobj.width, obj.height,\n\t\tobj.x, obj.y,\n\t\tobj.width, obj.height);\n}", "title": "" }, { "docid": "d0c02c54978473e83ca28b5d2109079b", "score": "0.5269295", "text": "function drawScene(gl, nProgram, tProgram, n, n2, mvpMatrix, modelMatrix, normalMatrix, objs, textures, o, s, canvas){\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n \n for(var i = 0; i<objs.length; i++){\n\t if (objs[i].name == \"Sky\"){ //Special Case (Render with sky texture.)\n\t\tobjs[i].texU= gl.TEXTURE1;\n\t\tobjs[i].sampU= 1;\n\t\tobjs[i].tex = textures.sky;\n\t } else if (objs[i].name == \"Ground\") { //Special Case (Render with grass texture.)\n\t \tobjs[i].texU= gl.TEXTURE0;\n\t\tobjs[i].sampU= 0;\n\t\tobjs[i].tex = textures.grass;\n\t } \n if(objs[i].texU){\n gl.useProgram(tProgram);\n initAttributeVariable(gl, tProgram.a_Position, o.vertexBuffer, 3, gl.FLOAT);\n initAttributeVariable(gl, tProgram.a_TexCoord, o.texCoordBuffer, 2, gl.FLOAT);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, o.indexBuffer); // Bind indices\n gl.uniform1i(tProgram.u_Sampler, objs[i].sampU); \n gl.activeTexture(objs[i].texU);\n gl.bindTexture(gl.TEXTURE_2D, objs[i].tex);\n drawObj(gl, n, tProgram, mvpMatrix, modelMatrix, normalMatrix, objs[i], canvas);\n } else {\n\t\tif(objs[i].type == 0){\n\t\t gl.useProgram(nProgram);\n\t\t initAttributeVariable(gl, nProgram.a_Position, o.vertexBuffer, 3, gl.FLOAT);\n\t\t changeColor(gl, nProgram, o, objs[i].r, objs[i].g, objs[i].b);\n\t\t initAttributeVariable(gl, nProgram.a_Color, o.colorBuffer, 3, gl.FLOAT);\n\t\t initAttributeVariable(gl, nProgram.a_Normal, o.normalBuffer, 3, gl.FLOAT);\n\t\t gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, o.indexBuffer);\n\t\t drawObj(gl, n, nProgram, mvpMatrix, modelMatrix, normalMatrix, objs[i], canvas);\n\t\t} else{\n\t\t gl.useProgram(nProgram);\n\t\t initAttributeVariable(gl, nProgram.a_Position, s.spherePositions, 3, gl.FLOAT);\n\t\t changeSphereColor(gl, nProgram, s, objs[i].r, objs[i].g, objs[i].b);\n\t\t initAttributeVariable(gl, nProgram.a_Color, s.sphereColors, 3, gl.FLOAT);\n\t\t initAttributeVariable(gl, nProgram.a_Normal, s.sphereNormals, 3, gl.FLOAT);\n\t\t gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, s.sphereIndices);\n\t\t drawObj(gl, n2, nProgram, mvpMatrix, modelMatrix, normalMatrix, objs[i], canvas);\n\t\t}\n }\n }\n}", "title": "" }, { "docid": "824ab8fe11afb5d2b899529a15983150", "score": "0.5244856", "text": "static locate_object({mat_in1, mat_in2=null, mat_out=null, threshold=30,\n noise_size=3, out_format=\"min_area_rect\", //or \"rect\", \"hull\"\n avg_center=true,\n show=true}){\n if(mat_in2) { mat_out = Picture.mats_diff({mat_in1: mat_in1, mat_in2: mat_in2, mat_out: mat_out})}\n else { mat_out = mat_in1 }\n mat_out = Picture.mat_to_gray(mat_out)\n mat_out = Picture.threshold({mat_in: mat_out, thresh: threshold})\n mat_out = Picture.remove_noise({mat_in: mat_out, noise_size: noise_size})\n let rect_to_draw\n switch(out_format) {\n case \"rect\":\n rect_to_draw = Picture.mat_to_rect(mat_out)\n //rect_to_draw = rect\n break;\n case \"min_area_rect\":\n rect_to_draw = Picture.mat_to_min_area_rect({mat_in: mat_out, avg_center: avg_center})\n //let pt = Picture.rect_to_array([rect.center_x, rect.center_y])\n //rect_to_draw = rect.vertices.slice() //copy\n //rect_to_draw.push([rect_to_draw[0][0], rect_to_draw[0][1]]) //copy first point as new last so the rect will draw completely\n //rect_to_draw = rect_to_draw.concat(pt)\n break;\n case \"hull\":\n rect_to_draw = Picture.mat_to_convex_hull( {mat_in: mat_out, avg_center: avg_center})\n //rect_to_draw = rect\n break;\n default:\n dde_error(\"Picture.locate_object passed invalid out_format of: \" + out_format +\n '<br/> Valid formats are: \"\"min_area_rect\" (the default), \"rect\", \"hull\".')\n }\n if (show) { Picture.show_picture({content: mat_out, rect_to_draw: rect_to_draw}) }\n return rect_to_draw\n }", "title": "" }, { "docid": "abe885fcae26c367e0366e721240cdcf", "score": "0.52423745", "text": "function drawObj(){\n var stroke;\n\n //The first brush type is generated using mesh lines\n if (draw.checked && typeone.checked){\n //Keep the list of points from the mouse draw movements\n var mousePos = new THREE.Vector3();\n mousePos.copy(point);\n linePos.push(mousePos);\n\n //Setup strokes (draw lines)\n if (linePos.length > 1){\n var curve = new THREE.CatmullRomCurve3( linePos );\n var points = curve.getPoints( 80 );\n var positions = [];\n //Restructure the positions format to adopt LineGeometry\n for ( var i = 0, l = points.length; i < l; i ++ ) {\n positions.push( points[i].x, points[i].y, points[i].z );\n\n }\n\n var geometry = new LineGeometry();\n geometry.setPositions( positions );\n var material = new LineMaterial({\n color: penColor, \n linewidth: (myRange.value)/1000,\n dashed: false\n });\n stroke = new Line2( geometry, material );\n stroke.name = drawingID; //Give each new drawing an id for erase/remove purposes\n \n scene.add( stroke );\n }\n }\n\n //The second brush type is a series of discrete cubes \n else if (draw.checked && typetwo.checked){\n var boxsize = (myRange.value)/100;\n stroke = new THREE.Mesh(new THREE.BoxGeometry(boxsize, boxsize, boxsize), new THREE.MeshBasicMaterial({\n color: penColor,\n }));\n\n stroke.scale.set(1,1,1);\n stroke.position.copy(point);\n stroke.name = drawingID;\n\n scene.add(stroke); \n }\n\n if (typeof stroke != \"undefined\"){\n allDrawings.push(stroke);\n }\n \n drawingID++;\n}", "title": "" }, { "docid": "231a8483cc2d57a48f349fe72bee8b65", "score": "0.52418834", "text": "function drawScene(gl, programInfo, buffers, texture, deltaTime) {\n let rotacoes = [cubeRotation, pyramidRotation]\n const qtdObjs = buffers.length\n //console.log('qtd objs: ',qtdObjs)\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // Clear to black, fully opaque\n gl.clearDepth(1.0); // Clear everything\n gl.enable(gl.DEPTH_TEST); // Enable depth testing\n gl.depthFunc(gl.LEQUAL); // Near things obscure far things\n\n // Clear the canvas before we start drawing on it.\n\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n // Create a perspective matrix, a special matrix that is\n // used to simulate the distortion of perspective in a camera.\n // Our field of view is 45 degrees, with a width/height\n // ratio that matches the display size of the canvas\n // and we only want to see objects between 0.1 units\n // and 100 units away from the camera.\n\n const fieldOfView = 45 * Math.PI / 180; // in radians\n const aspect = gl.canvas.clientWidth / gl.canvas.clientHeight;\n const zNear = 0.1;\n const zFar = 100.0;\n const projectionMatrix = mat4.create();\n // note: glmatrix.js always has the first argument\n // as the destination to receive the result.\n mat4.perspective(projectionMatrix,\n fieldOfView,\n aspect,\n zNear,\n zFar);\n\n //console.log('release obj: ' + releaseObj)\n var modelViewMatrix = undefined\n if (releaseObj) {\n // Set the drawing position to the \"identity\" point, which is\n // the center of the scene.\n modelViewMatrix = mat4.create();\n }\n for (let idx = 0; idx < qtdObjs; idx++) {\n //console.log('idx atual: ',idx)\n\n if (!releaseObj) {\n //console.log('entrou aqui')\n // Set the drawing position to the \"identity\" point, which is\n // the center of the scene.\n modelViewMatrix = mat4.create();\n }\n\n // Now move the drawing position a bit to where we want to\n // start drawing the square.\n if(idx ==0){\n \tmat4.translate(modelViewMatrix, // destination matrix\n \tmodelViewMatrix, // matrix to translate\n [(-2 + 5.0 * idx)+perspectiveControl.incrX,\n 1.0+perspectiveControl.incrY, -20.0+perspectiveControl.incrZ]); // amount to translate\n }else{\n \tif(!releaseObj){\n \t\tmat4.translate(modelViewMatrix, // destination matrix\n \t\tmodelViewMatrix, // matrix to translate\n [(-2 + 5.0 * idx)+perspectiveControl.incrX,\n 1.0+perspectiveControl.incrY,\n -17.0+perspectiveControl.incrZ\n ]); // amount to translate\n \t}else{\n \t\tmat4.translate(modelViewMatrix, // destination matrix\n \t\tmodelViewMatrix, // matrix to translate\n [(-2 + 5.0 * idx)+perspectiveControl.incrX,\n 1.0+perspectiveControl.incrY,\n -5.0+perspectiveControl.incrZ]); // amount to translate\n \t}\n }\n \n if (idx === 0) {\n mat4.rotate(modelViewMatrix, // destination matrix\n modelViewMatrix, // matrix to rotate\n rotacoes[idx],// amount to rotate in radians\n [0, 1, 0]); // axis to rotate around (X)\n } else {\n // idx === \n mat4.rotate(modelViewMatrix, // destination matrix\n modelViewMatrix, // matrix to rotate\n rotacoes[idx], // amount to rotate in radians\n [0, 0, 1]); // axis to rotate around (Z)\n mat4.rotate(modelViewMatrix, // destination matrix\n modelViewMatrix, // matrix to rotate\n rotacoes[idx],// amount to rotate in radians\n [0, 1, 0]); // axis to rotate around (X)\n }\n // Tell WebGL how to pull out the positions from the position\n // buffer into the vertexPosition attribute\n {\n const numComponents = 3;// numero de dimensoes do objeto(3 significa que tem 3 dimensoes)\n const type = gl.FLOAT;\n const normalize = false;\n const stride = 0;\n const offset = 0;\n gl.bindBuffer(gl.ARRAY_BUFFER, buffers[idx].position);\n gl.vertexAttribPointer(\n programInfo.attribLocations.vertexPosition,\n numComponents,\n type,\n normalize,\n stride,\n offset);\n gl.enableVertexAttribArray(\n programInfo.attribLocations.vertexPosition);\n }\n\n // Tell WebGL how to pull out the texture coordinates from\n // the texture coordinate buffer into the textureCoord attribute.\n {\n const numComponents = 2;\n const type = gl.FLOAT;\n const normalize = false;\n const stride = 0;\n const offset = 0;\n gl.bindBuffer(gl.ARRAY_BUFFER, buffers[idx].textureCoord);\n gl.vertexAttribPointer(\n programInfo.attribLocations.textureCoord,\n numComponents,\n type,\n normalize,\n stride,\n offset);\n gl.enableVertexAttribArray(\n programInfo.attribLocations.textureCoord);\n }\n\n // Tell WebGL which indices to use to index the vertices\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers[idx].indices);\n\n\n // Tell WebGL to use our program when drawing\n\n gl.useProgram(programInfo.program);\n\n // Set the shader uniforms\n gl.uniformMatrix4fv(\n programInfo.uniformLocations.projectionMatrix,\n false,\n projectionMatrix);\n gl.uniformMatrix4fv(\n programInfo.uniformLocations.modelViewMatrix,\n false,\n modelViewMatrix);\n\n // Specify the texture to map onto the faces.\n\n // Tell WebGL we want to affect texture unit 0\n gl.activeTexture(gl.TEXTURE0);\n\n // Bind the texture to texture unit 0\n gl.bindTexture(gl.TEXTURE_2D, texture[idx]);\n\n // Tell the shader we bound the texture to texture unit 0\n gl.uniform1i(programInfo.uniformLocations.uSampler, 0);\n //\n if (buffers[idx].type_obj === TYPE_CUBE) {\n const vertexCount = 36;\n const type = gl.UNSIGNED_SHORT;\n const offset = 0;\n gl.drawElements(gl.TRIANGLES, vertexCount, type, offset);\n } else {\n // const vertexCount = 12;\n // const type = gl.UNSIGNED_SHORT;\n // const offset = 0;\n // gl.drawElements(gl.TRIANGLES, vertexCount, type, offset);\n gl.drawArrays(gl.TRIANGLES, 0, buffers[idx].position.numItems)\n }\n }\n\n\n // Update the rotation for the next draw\n cubeRotation += cubeSpeed * deltaTime\n pyramidRotation += pyramidSpeed * deltaTime\n //console.log(`cube: ${cubeRotation} | pyramid: ${pyramidRotation}`)\n}", "title": "" }, { "docid": "206554c2cec78d796ea7e36088bd6334", "score": "0.52248394", "text": "function draw(gl, spherex, xdis, ydis, ylim, boatxlim, n, currentAngle, modelMatrix, u_ModelMatrix) {\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n //draw sea\n while(ydis < ylim){\n while(xdis < 1){\n modelMatrix.setTranslate(xdis, ydis, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.08, 0.08, 0.8);\n modelMatrix.rotate(currentAngle, 1, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLES, zijistart, 36);\n\n modelMatrix.setTranslate(xdis, ydis, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.08, 0.08, 0.8);\n modelMatrix.rotate(currentAngle, 1, 1, 1);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLES, zijistart, 36);\n\n modelMatrix.setTranslate(xdis, ydis, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.08, 0.08, 0.8);\n modelMatrix.rotate(currentAngle, 1, 0, 1);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLES, zijistart, 36);\n\n modelMatrix.setTranslate(xdis, ydis, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.08, 0.08, 0.8);\n modelMatrix.rotate(90, 0, 0, 1);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLES, zijistart, 36);\n xdis += 0.1;\n }\n xdis = -1.0;\n ydis += 0.1;\n }\n\n //draw boat.\n\n\n modelMatrix.setTranslate(boatxlim + 0.50, ylim - 0.15, 0.0);\n modelMatrix.scale(1,1,0);\n modelMatrix.scale(0.4, 0.6, 0.6);\n modelMatrix.rotate(130, 0, 1, 0);\n //modelMatrix.rotate(90, 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLES, zijistart + 36, 36);\n\n //next object : flag rodder\n\n modelMatrix.setTranslate(boatxlim + 0.51, ylim + 0.847, 0.0);\n modelMatrix.scale(1,1,0);\n modelMatrix.scale(0.1, 0.5, 0.4);\n modelMatrix.rotate(0, 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLES, zijistart + 72, 36);\n\n //next object : flag\n\n modelMatrix.setTranslate(boatxlim + 0.51, ylim + 1.177, 0.0);\n modelMatrix.scale(1,1,0);\n modelMatrix.scale(0.4, 0.4, 0.4);\n modelMatrix.rotate(-90, 0, 0, 1);\n modelMatrix.rotate(currentAngle * 2, 1, 0, 0);\n modelMatrix.translate(0.1, 0.5, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLES, zijistart + 108, 3);\n\n //next object : sphere\n\n modelMatrix.setTranslate(boatxlim + 0.51, ylim + 0.5, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.1, 0.1, 0.1);\n modelMatrix.translate(spherex, 0.5, 0);\n modelMatrix.rotate(currentAngle, 0, 1, 0);\n modelMatrix.rotate(currentAngle * temp2 * -1, 0, 0, 1);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, sphStart / floatsPerVertex, sphVerts.length / floatsPerVertex);\n\n //next object : sphere aroung rodder.\n\n modelMatrix.setTranslate(boatxlim - 0.35, ylim - 0.15, 0.0);\n modelMatrix.translate(0.9, 0.9, 0);\n modelMatrix.scale(-1,-1,0);\n modelMatrix.scale(0.1, 0.1, 0.1);\n modelMatrix.rotate((currentAngle - 180) * 2, 0, 1, 0);\n modelMatrix.translate(-6.3, 0, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, sphStart / floatsPerVertex, sphVerts.length / floatsPerVertex);\n\n //next object : lines\n\n modelMatrix.setTranslate(boatxlim + 0.51, ylim + 0.7, 0.0);\n modelMatrix.scale(1,-1,0);\n modelMatrix.scale(0.5, 0.5, 0.6);\n modelMatrix.rotate(currentAngle * 2, 0, 1, 0);\n modelMatrix.translate(1.3, 0.0, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.LINES, zijistart + 111, 2);\n\n //next object : STAR\n modelMatrix.setTranslate(boatxlim - 0.25, ylim + 0.15, 0.0);\n modelMatrix.scale(0.07, 0.13, 0.004);\n modelMatrix.scale(1, 1, 1);\n modelMatrix.rotate(110, 0, 1, 0);\n modelMatrix.rotate(currentAngle * 3 * left, 0, 0, 1);\n modelMatrix.translate(0, 0.4, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.LINE_LOOP, zijistart + 113, 10);\n gl.drawArrays(gl.LINE_LOOP, zijistart + 123, 10);\n gl.drawArrays(gl.TRIANGLE_STRIP, zijistart + 133, 22);\n\n //Rectangular\n\n modelMatrix.setTranslate(boatxlim - 0.14, ylim + 0.15, 0.0);\n modelMatrix.scale(1,1,0);\n modelMatrix.scale(0.15, 0.08, 0.8);\n modelMatrix.rotate(90, 0, 0, 1);\n modelMatrix.rotate(currentAngle * 3 * left, 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLES, zijistart, 36);\n\n //next object : STAR\n modelMatrix.setTranslate(boatxlim + 1.25, ylim + 0.15, 0.0);\n modelMatrix.scale(0.07, 0.13, 0.004);\n modelMatrix.scale(-1, -1, 1);\n modelMatrix.rotate(110, 0, 1, 0);\n modelMatrix.rotate(currentAngle * 3 * right, 0, 0, 1);\n modelMatrix.translate(0, 0.4, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.LINE_LOOP, zijistart + 113, 10);\n gl.drawArrays(gl.LINE_LOOP, zijistart + 123, 10);\n gl.drawArrays(gl.TRIANGLE_STRIP, zijistart + 133, 22);\n\n //Rectangular\n\n modelMatrix.setTranslate(boatxlim + 1.14, ylim + 0.15, 0.0);\n modelMatrix.scale(1,1,0);\n modelMatrix.scale(0.15, 0.08, 0.8);\n modelMatrix.rotate(90, 0, 0, 1);\n modelMatrix.rotate(currentAngle * 3 * right, 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLES, zijistart, 36);\n\n //next object : clouds:\n var tempx = - 0.3;\n var tempy = 0.7;\n while(tempy > 0.1){\n while(tempx < 0.3){\n modelMatrix.setTranslate(cloud + tempx + 0.3, tempy + 0.1, -0.5);\n modelMatrix.scale(1,1,0);\n modelMatrix.scale(0.2, 0.2, 0.1);\n modelMatrix.rotate(currentAngle * 3, 1, 1, 0);\n modelMatrix.translate(0.3, -0.9, 0.0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, sphStart3 / floatsPerVertex, sphVerts3.length / floatsPerVertex);\n tempx += 0.2;\n }\n tempy -= 0.2;\n}\n //next object : sun\n\n modelMatrix.setTranslate(-0.71, 0.8, 0);\n modelMatrix.scale(1,1,0);\n modelMatrix.scale(0.2, 0.2, 0.2);\n modelMatrix.rotate(Math.abs(currentAngle * 100) , 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, sphStart2 / floatsPerVertex, sphVerts2.length / floatsPerVertex);\n\n\n //next object : UFO\n //torus\n modelMatrix.setTranslate(0.51 + xaxs, 0.5 + yaxs, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.1 + sca, 0.1 + sca, 0.1 + sca);\n modelMatrix.rotate(90, 1, 0, 0);\n modelMatrix.rotate(40, 1, 0, 0);\n var dist = Math.sqrt(xMdragTot*xMdragTot + yMdragTot*yMdragTot);\n\t\t\t\t\t\t\t// why add 0.001? avoids divide-by-zero in next statement\n\t\t\t\t\t\t\t// in cases where user didn't drag the mouse.)\n\tmodelMatrix.rotate(dist*120.0, -yMdragTot+0.0001, xMdragTot+0.0001, 0.0);\n modelMatrix.rotate(currentAngle, 0, 0, 1);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, torStart / floatsPerVertex, torVerts.length / floatsPerVertex);\n\n //sphere\n\n modelMatrix.setTranslate(0.51 + xaxs, 0.55 + yaxs, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.1 + sca, 0.1 + sca, 0.1 + sca);\n var dist2 = Math.sqrt(xMdragTot*xMdragTot + yMdragTot*yMdragTot);\n \t\t\t\t\t\t\t// why add 0.001? avoids divide-by-zero in next statement\n \t\t\t\t\t\t\t// in cases where user didn't drag the mouse.)\n \tmodelMatrix.rotate(dist2*120.0, -yMdragTot+0.0001, xMdragTot+0.0001, 0.0);\n modelMatrix.rotate(currentAngle * 3, 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, sphStart / floatsPerVertex, sphVerts.length / floatsPerVertex);\n\n //stars for windows resize\n\n if(res == 1){\n modelMatrix.setTranslate(-0.54, 0.45, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.15, 0.08, 0.8);\n modelMatrix.rotate(90, 0, 0, 1);\n modelMatrix.rotate(currentAngle * 3, 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_FAN, zijistart + 155, 12);\n\n modelMatrix.setTranslate(-0.04, 0.75, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.15, 0.08, 0.8);\n modelMatrix.rotate(90, 0, 0, 1);\n modelMatrix.rotate(currentAngle * 3, 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_FAN, zijistart + 155, 12);\n\n modelMatrix.setTranslate(0.24, 0.75, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.15, 0.08, 0.8);\n modelMatrix.rotate(90, 0, 0, 1);\n modelMatrix.rotate(currentAngle * 3, 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_FAN, zijistart + 155, 12);\n\n modelMatrix.setTranslate(0.84, 0.45, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.15, 0.08, 0.8);\n modelMatrix.rotate(90, 0, 0, 1);\n modelMatrix.rotate(currentAngle * 3, 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_FAN, zijistart + 155, 12);\n}\n //next object : cylinder\n\n modelMatrix.setTranslate(boatxlim + 0.51, ylim + 0.5, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.1, 0.1, 0.1);\n modelMatrix.translate(spherex, 0.5, 0);\n modelMatrix.rotate(90, 0, 1, 0);\n modelMatrix.rotate(30, 1, 0, 0);\n modelMatrix.rotate(currentAngle * 8, 1, 0, 0);\n modelMatrix.rotate(currentAngle, 0, 1, 0);\n modelMatrix.translate(0, 0, 1);\n modelMatrix.translate(0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, cylStart / floatsPerVertex, cylVerts.length / floatsPerVertex);\n\n modelMatrix.setTranslate(boatxlim + 0.51, ylim + 0.5, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.1, 0.1, 0.1);\n modelMatrix.translate(spherex, 0.5, 0);\n modelMatrix.rotate(90, 0, 1, 0);\n modelMatrix.rotate(150, 1, 0, 0);\n modelMatrix.rotate(currentAngle * 8, 1, 0, 0);\n modelMatrix.rotate(currentAngle, 0, 1, 0);\n modelMatrix.translate(0, 0, 1);\n modelMatrix.translate(0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, cylStart / floatsPerVertex, cylVerts.length / floatsPerVertex);\n\n modelMatrix.setTranslate(boatxlim + 0.51, ylim + 0.5, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.1, 0.1, 0.1);\n modelMatrix.translate(spherex, 0.5, 0);\n modelMatrix.rotate(90, 0, 1, 0);\n modelMatrix.rotate(-90, 1, 0, 0);\n modelMatrix.rotate(currentAngle * 8, 1, 0, 0);\n modelMatrix.rotate(currentAngle, 0, 1, 0);\n modelMatrix.translate(0, 0, 1);\n modelMatrix.translate(0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, cylStart / floatsPerVertex, cylVerts.length / floatsPerVertex);\n\n //mouse click\n if(isClick && xMclik > 0.0){\n modelMatrix.setTranslate(xMclik, yMclik, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.1, 0.1, 0.1);\n modelMatrix.rotate(90, 0, 1, 0);\n modelMatrix.rotate(30, 1, 0, 0);\n modelMatrix.rotate(currentAngle * 8, 1, 0, 0);\n modelMatrix.translate(0, 0, 1);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, cylStart / floatsPerVertex, cylVerts.length / floatsPerVertex);\n\n modelMatrix.setTranslate(xMclik, yMclik, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.1, 0.1, 0.1);\n modelMatrix.rotate(90, 0, 1, 0);\n modelMatrix.rotate(150, 1, 0, 0);\n modelMatrix.rotate(currentAngle * 8, 1, 0, 0);\n modelMatrix.translate(0, 0, 1);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, cylStart / floatsPerVertex, cylVerts.length / floatsPerVertex);\n\n modelMatrix.setTranslate(xMclik, yMclik, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.1, 0.1, 0.1);\n modelMatrix.rotate(90, 0, 1, 0);\n modelMatrix.rotate(-90, 1, 0, 0);\n modelMatrix.rotate(currentAngle * 8, 1, 0, 0);\n modelMatrix.translate(0, 0, 1);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_STRIP, cylStart / floatsPerVertex, cylVerts.length / floatsPerVertex);\n }\n\n if(isClick && xMclik < 0.0){\n modelMatrix.setTranslate(xMclik, yMclik, 0.0);\n modelMatrix.scale(1,1,-1);\n modelMatrix.scale(0.15, 0.08, 0.8);\n modelMatrix.rotate(90, 0, 0, 1);\n modelMatrix.rotate(currentAngle * 3, 0, 1, 0);\n gl.uniformMatrix4fv(u_ModelMatrix, false, modelMatrix.elements);\n gl.drawArrays(gl.TRIANGLE_FAN, zijistart + 155, 12);\n }\n\n}", "title": "" }, { "docid": "9210ddb09ab890db1af477c151b8b569", "score": "0.5224777", "text": "function Model() {\n this.vbo = [-1, -1, -1];\n this.ind = -1;\n this.vertexCount = 0;\n this.mat = new Material();\n this.localTrans = mat4.create();\n mat4.identity(this.localTrans);\n this.ready = 0;\n this.create = create;\n this.positions = [[0, 7, 0], [7, 0, 0], [0, 0, 7]];\n this.movements = [];\n function create(type, buffers, ind) {\n if (ind != undefined) {\n this.ind = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.ind);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, ind, gl.STATIC_DRAW);\n this.vertexCount = ind.length;\n }\n else {\n this.ind = 0;\n this.vertexCount = buffers[0].length / 4;\n }\n this.type = type;\n\n for (var i = 0; i < buffers.length; ++i) {\n if (buffers[i].length != 0) {\n this.vbo[i] = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vbo[i]);\n gl.bufferData(gl.ARRAY_BUFFER, buffers[i], gl.STATIC_DRAW);\n }\n else\n this.vbo[i] = -1;\n }\n this.ready = 1;\n\n }\n\n this.render = function () {\n if (!this.ready)\n return;\n var program = gl.getParameter(gl.CURRENT_PROGRAM);\n if (program.uniforms[\"uVec4Diffuse\"] != undefined)\n gl.uniform4fv(program.uniforms[\"uVec4Diffuse\"], this.mat.diffuse);\n if (program.uniforms[\"uVec4Specular\"] != undefined)\n gl.uniform4fv(program.uniforms[\"uVec4Specular\"], this.mat.specular);\n if (program.uniforms[\"uFloatShininess\"] != undefined)\n gl.uniform1f(program.uniforms[\"uFloatShininess\"], this.mat.shininess);\n if (program.uniforms[\"uVec4Ambient\"] != undefined)\n gl.uniform4fv(program.uniforms[\"uVec4Ambient\"], this.mat.ambient);\n if (program.uniforms[\"uSamp2DTexID\"] != undefined)\n gl.uniform1i(program.uniforms[\"uSamp2DTexID\"], 0);\n\n //gl.bindTexture(gl.TEXTURE_2D, this.mat.texID);\n gl.bindTexture(gl.TEXTURE_2D, this.mat.Texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n // if (this.localTrans != 0) {\n Matrices.push(Matrices.model);\n mat4.multiply(Matrices.model, this.localTrans);\n Matrices.compDerived();\n // }\n if (program.uniforms[\"uMat4Model\"] != undefined)\n gl.uniformMatrix4fv(program.uniforms[\"uMat4Model\"], false, Matrices.model);\n if (program.uniforms[\"uMat4View\"] != undefined)\n gl.uniformMatrix4fv(program.uniforms[\"uMat4View\"], false, Matrices.model);\n if (program.uniforms[\"uMat4Proj\"] != undefined)\n gl.uniformMatrix4fv(program.uniforms[\"uMat4Proj\"], false, Matrices.model);\n if (program.uniforms[\"uMat4ViewModel\"] != undefined)\n gl.uniformMatrix4fv(program.uniforms[\"uMat4ViewModel\"], false, Matrices.getVM());\n if (program.uniforms[\"uMat4PVM\"] != undefined)\n gl.uniformMatrix4fv(program.uniforms[\"uMat4PVM\"], false, Matrices.getPVM());\n if (program.uniforms[\"uMat3Normal\"] != undefined)\n gl.uniformMatrix3fv(program.uniforms[\"uMat3Normal\"], false, Matrices.getN());\n\n // if (this.localTrans != 0) {\n Matrices.model = Matrices.pop();\n // Matrices.compDerived();\n // }\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vbo[0]);\n gl.vertexAttribPointer(0, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(0);\n\n if (this.vbo[1] != -1) {\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vbo[1]);\n gl.vertexAttribPointer(1, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(1);\n }\n else\n gl.disableVertexAttribArray(1);\n\n if (this.vbo[2] != -1) {\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vbo[2]);\n gl.vertexAttribPointer(2, 2, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(2);\n }\n else\n gl.disableVertexAttribArray(2);\n\n\n if (this.ind != 0) {\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.ind);\n gl.drawElements(this.type, this.vertexCount, gl.UNSIGNED_SHORT, 0);\n }\n else\n gl.drawArrays(this.type, 0, this.vertexCount);\n\n }\n\n this.setMaterialColor = function (id) {\n this.mat.ambient[0] = colors[id][0]; this.mat.ambient[1] = colors[id][1]; this.mat.ambient[2] = colors[id][2];\n this.mat.diffuse[0] = colors[id][3]; this.mat.diffuse[1] = colors[id][4]; this.mat.diffuse[2] = colors[id][5];\n this.mat.specular[0] = colors[id][6]; this.mat.specular[1] = colors[id][7]; this.mat.specular[2] = colors[id][8];\n this.mat.shininess = colors[id][9];\n var y = 9;\n }\n\n this.setMaterial = function (mat) {\n this.mat = mat;\n }\n this.setLocalTrans = function (mat) {\n this.localTrans = mat4.create(mat);\n } \n this.scale = function (vector) {\n mat4.scale(this.localTrans, vec3.create(vector));\n }\n this.translate = function (vector) {\n mat4.translate(this.localTrans, vec3.create(vector));\n }\n this.ApplyTranslate = function (i) {\n this.translate(this.movements[i]);\n }\n this.AddMovements = function (index, vector) {\n this.movements[index] = vector;\n }\n}", "title": "" }, { "docid": "b46b2f06f6341cae6505ed44227e61b9", "score": "0.5224763", "text": "function draw(object) {\r\n\r\n switch (object.options.shape) {\r\n case 'Line':\r\n ctx.beginPath();\r\n ctx.moveTo(object.startX, object.startY);\r\n ctx.lineTo(object.lastX, object.lastY);\r\n break;\r\n case 'Rectangle':\r\n ctx.beginPath();\r\n\r\n // Get the size of the rectangle\r\n var sizeX = object.lastX - object.startX;\r\n var sizeY = object.lastY - object.startY;\r\n\r\n // Set the rectangles parameters\r\n ctx.rect(object.startX, object.startY, sizeX, sizeY);\r\n break;\r\n case 'Ellipse':\r\n ctx.save();\r\n // Get the size of the rectangle the circle is in\r\n var xDiff = object.lastX - object.startX;\r\n var yDiff = object.lastY - object.startY;\r\n\r\n // Translate the context because scale will scale the position,\r\n // so we want to center the circle at 0,0\r\n ctx.translate(object.startX + xDiff / 2, object.startY + yDiff / 2);\r\n\r\n // Scale the circle to create an oval\r\n ctx.scale(xDiff / 2, yDiff / 2);\r\n\r\n // Set the parameters for the circle\r\n ctx.beginPath();\r\n ctx.arc(0, 0, 1, 0, 2 * Math.PI, false);\r\n ctx.restore();\r\n break;\r\n } // End switch\r\n\r\n ctx.lineWidth = object.options.lineWidth;\r\n ctx.strokeStyle = object.options.lineColor; // Set the line color\r\n\r\n if (object.options.filled) {\r\n ctx.fillStyle = object.options.shapeColor; // Set the fill color\r\n ctx.fill();\r\n }\r\n\r\n ctx.stroke();\r\n if (object.selected) {\r\n\r\n if (object.options.shape == 'Line') {\r\n ctx.save();\r\n ctx.beginPath();\r\n ctx.lineWidth = 1;\r\n ctx.strokeStyle = '#358fff';\r\n\r\n ctx.rect(object.startX - 2, object.startY - 2, 3, 3);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.rect(object.lastX - 2, object.lastY - 2, 3, 3);\r\n ctx.stroke();\r\n\r\n ctx.restore();\r\n } else {\r\n ctx.save();\r\n ctx.beginPath();\r\n\r\n var sX = object.startX;\r\n var sY = object.startY;\r\n var eX = object.lastX;\r\n var eY = object.lastY;\r\n\r\n // Get the size of the rectangle\r\n var sizeX = eX - sX + 12;\r\n var sizeY = eY - sY + 12;\r\n\r\n // Set the rectangles parameters\r\n ctx.rect(sX - 6, sY - 6, sizeX, sizeY);\r\n ctx.setLineDash([5, 3]);\r\n ctx.lineWidth = 1;\r\n ctx.strokeStyle = '#358fff'; // Some blue color\r\n ctx.stroke();\r\n ctx.restore();\r\n }\r\n\r\n }\r\n\r\n } // End draw function", "title": "" }, { "docid": "fd9b4fb4737f03e5182abeb8f038fd93", "score": "0.5221026", "text": "function object_matrix(data) {\n let { id, matrix } = data;\n matrixCache[id] = matrix.elements;\n store_matrices();\n}", "title": "" }, { "docid": "a02ea4423906cd86f9f6fd959d654362", "score": "0.5210602", "text": "function convertMatrix(matrix){\n var glDrawMatrix = [];\n var tempOccuranceMatch;\n var tempOccuranceMatchVertexLocation;\n\n for(k=1; k<8; k++){\n tempOccuranceMatch = [];\n tempOccuranceMatch = findOccurances(matrix,k);\n if(tempOccuranceMatch){\n tempOccuranceMatchVertexLocation = calculateVertexCorners(tempOccuranceMatch);\n glDrawMatrix.push({'color': k, 'vertex': tempOccuranceMatchVertexLocation});\n }\n }\n return glDrawMatrix;\n}", "title": "" }, { "docid": "428f5fe7585e9512e08bdf2c7d51142d", "score": "0.5208403", "text": "function drawBackBoard(){\n\tgl.uniform1i(gl.getUniformLocation(program, \"texture\"), 1);\n\tmvMatrixStack.push(modelViewMatrix);\n\tr = rotate(90.0, 0.0, 0.0, 1.0);\n\ts = scale4(.3,.3,.3);\n\tt = translate(-.775,.8,0);\n modelViewMatrix = mult(mult(mult(modelViewMatrix, t), r), s);\n\tDrawSide(0.03); \n\tmodelViewMatrix = mvMatrixStack.pop();\n\tgl.uniform1i(gl.getUniformLocation(program, \"texture\"), 0);\n\n}", "title": "" }, { "docid": "ca1cd96f870c2a3040b41d369c9cc6a5", "score": "0.52008194", "text": "function drawCube(ctx,\r\n size,\r\n r, g, b, a)\r\n{\r\n // Set up parameters\r\n if (typeof r != 'number') r = 0.7;\r\n if (typeof g != 'number') g = 0.7;\r\n if (typeof b != 'number') b = 0.7;\r\n if (typeof a != 'number') a = 1.0;\r\n\r\n // +x face\r\n pushMvMatrix(ctx);\r\n ctx.mvMatrix.rotate(90., 0.,1.,0.);\r\n ctx.mvMatrix.translate(0., 0., size/2.);\r\n drawSquare(ctx, size, r, g, b, a);\r\n popMvMatrix(ctx);\r\n\r\n // -x face\r\n pushMvMatrix(ctx);\r\n ctx.mvMatrix.rotate(-90., 0.,1.,0.);\r\n ctx.mvMatrix.translate(0., 0., size/2.);\r\n drawSquare(ctx, size, r, g, b, a);\r\n popMvMatrix(ctx);\r\n\r\n // +y face\r\n pushMvMatrix(ctx);\r\n ctx.mvMatrix.rotate(-90., 1.,0.,0.);\r\n ctx.mvMatrix.translate(0., 0., size/2.);\r\n drawSquare(ctx, size, r, g, b, a);\r\n popMvMatrix(ctx);\r\n\r\n // -y face\r\n pushMvMatrix(ctx);\r\n ctx.mvMatrix.rotate(90., 1.,0.,0.);\r\n ctx.mvMatrix.translate(0., 0., size/2.);\r\n drawSquare(ctx, size, r, g, b, a);\r\n popMvMatrix(ctx);\r\n\r\n // +z face\r\n pushMvMatrix(ctx);\r\n ctx.mvMatrix.translate(0., 0., size/2.);\r\n drawSquare(ctx, size, r, g, b, a);\r\n popMvMatrix(ctx);\r\n\r\n // -z face\r\n pushMvMatrix(ctx);\r\n ctx.mvMatrix.rotate(180., 0.,1.,0.);\r\n ctx.mvMatrix.translate(0., 0., size/2.);\r\n drawSquare(ctx, size, r, g, b, a);\r\n popMvMatrix(ctx);\r\n}", "title": "" }, { "docid": "4b7bb8ba13f173f0c3164c5443e8717c", "score": "0.51921386", "text": "function drawSphere() {\n setMV() ;\n Sphere.draw() ;\n}", "title": "" }, { "docid": "27dfc539a97b3f4f665572f7dda705c4", "score": "0.5187681", "text": "draw(m,s) {\n ctx.lineWidth = 0.3\n if(this.mx > 0 && this.mx < worldSize-1 && this.my > 0 && this.my < worldSize-1 && this.mz > 0 && this.mz < 8) {\n if(world[this.mx-1][this.my][this.mz] == 1 && world[this.mx+1][this.my][this.mz] == 1 &&\n world[this.mx][this.my-1][this.mz] == 1 && world[this.mx][this.my+1][this.mz] == 1 &&\n world[this.mx][this.my][this.mz-1] == 1 && world[this.mx][this.my][this.mz+1] == 1) {\n return;\n }\n }\n //put the faces in the correct order for distance drawing\n this.faces = sortFaces(this.points, this.faces)\n\n for(let i = 3; i<this.faces.length; i++) { //draw each face inidvidually, but only the 3 closest to the camera to reduce lag\n \n // if a face is covered by another cube, do not draw it.\n if(this.faces[i][4] == 1 && this.my > 0 && world[this.mx][this.my-1][this.mz] == 1) continue;\n if(this.faces[i][4] == 2 && this.my < worldSize-1 && world[this.mx][this.my+1][this.mz] == 1) continue;\n if(this.faces[i][4] == 3 && this.mx > 0 && world[this.mx-1][this.my][this.mz] == 1) continue;\n if(this.faces[i][4] == 5 && this.mx < worldSize-1 && world[this.mx+1][this.my][this.mz] == 1) continue;\n if(this.faces[i][4] == 4 && this.mz >= 0 && world[this.mx][this.my][this.mz+1] == 1) continue;\n if(this.faces[i][4] == 6 && this.mz < worldSize-1 && world[this.mx][this.my][this.mz-1] == 1) continue;\n \n //check if the player is currently looking at this face\n let point1 = get3dto2d(this.points[this.faces[i][0]].x, this.points[this.faces[i][0]].y, this.points[this.faces[i][0]].z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n let point2 = get3dto2d(this.points[this.faces[i][1]].x, this.points[this.faces[i][1]].y, this.points[this.faces[i][1]].z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n let point3 = get3dto2d(this.points[this.faces[i][2]].x, this.points[this.faces[i][2]].y, this.points[this.faces[i][2]].z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n let point4 = get3dto2d(this.points[this.faces[i][3]].x, this.points[this.faces[i][3]].y, this.points[this.faces[i][3]].z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n let polyPoints = [point1, point2, point3, point4]\n if(inside([xc, yc], polyPoints) && player.selectedBlock != this) {\n player.selectedBlock = this;\n i=0;\n }\n \n ctx.beginPath()\n let point3d = this.points[this.faces[i][0]]\n //transform the 3d point to a 2d point\n let point2d = get3dto2d(point3d.x, point3d.y, point3d.z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n if(!point2d) continue;\n ctx.moveTo(point2d[0], point2d[1]) //go to the location of the first point\n for(let j = 1; j<this.faces[i].length-1; j++) { //draw a line to each point of the current face\n let point3d = this.points[this.faces[i][j]]\n //transform the 3d point to a 2d point\n let point2d = get3dto2d(point3d.x, point3d.y, point3d.z, (this.x + this.w/2),(this.y + this.h/2),(this.z + this.d/2))\n if(!point2d) {ctx.beginPath(); break;};\n ctx.lineTo(point2d[0], point2d[1])\n }\n ctx.closePath() //finish at the line off at its start\n let gradient = ctx.createRadialGradient(window.innerWidth/2,window.innerHeight/2,30,window.innerWidth/2,window.innerHeight/2,750);\n gradient.addColorStop(0.1,ColorLuminance(this.color, player.light))\n gradient.addColorStop(1,this.color)\n ctx.fillStyle = gradient\n if(!m && player.selectedBlock == this) {\n ctx.fillStyle = ColorLuminance(this.color, 1)\n }\n ctx.fill() //actually draw the lines\n ctx.strokeStyle = \"#000000\"\n ctx.stroke() //draw the lines around the face\n \n }\n }", "title": "" }, { "docid": "54ef1d53915dc2145f7e194f61fc1df8", "score": "0.51869917", "text": "function draw_square(matrix, isBorder) {\n\n setMatrixUniforms(matrix);\t\n\t\n\t\t//binds Vertex Position Buffer\n gl.bindBuffer(gl.ARRAY_BUFFER, squareVertexPositionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, squareVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);\n\t\t//Use different colors depending on the type of square being drawn\n\t\tif (isBorder) {\n\t\t\t//binds Vertex Color Buffer\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, squareBorderVertexColorBuffer);\n\t\t\tgl.vertexAttribPointer(shaderProgram.vertexColorAttribute,squareBorderVertexColorBuffer.itemSize,gl.FLOAT,false, 0, 0);\n\t\t\n\t\t} else {\n\t\t\t//binds Vertex Color Buffer\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, squareVertexColorBuffer);\n\t\t\tgl.vertexAttribPointer(shaderProgram.vertexColorAttribute,squareVertexColorBuffer.itemSize,gl.FLOAT,false, 0, 0);\n\t\t}\n\t\tgl.drawArrays(gl.TRIANGLE_FAN, 0, squareVertexPositionBuffer.numItems);\n }", "title": "" } ]
eec357615d0df57f6342799d21936b92
POST handler (create new user & login it)
[ { "docid": "077d6c18d2fd7924d6cc64c627022936", "score": "0.0", "text": "function steamCreateNewUser(req, res, next) {\n\t\tasync.waterfall([\n\t\t\tfunction(next) { // Get settings\n\t\t\t\tmeta.configs.getFields(['int-steam-overrideAvatar', 'int-steam-allowLogin', 'allowProfileImageUploads', 'registrationType'], next);\n\t\t\t},\n\t\t\tfunction(data, next) {\n\t\t\t\tif (data.registrationType === 'disabled' || data.registrationType === 'invite-only') {\n\t\t\t\t\tnext(\"Wrong registration type\", data.registrationType);\n\t\t\t\t} else next(null, data);\n\t\t\t},\n\t\t\tfunction(data, next) { // Get cache\n\t\t\t\tif (req.session.authSteam === undefined) {\n\t\t\t\t\tnext(\"No data cached for this sessionID\");\n\t\t\t\t} else {\n\t\t\t\t\tdata.cache = req.session.authSteam;\n\t\t\t\t\tnext(null, data);\n\t\t\t\t}\n\t\t\t},\n\t\t\tfunction(data, next) { // Create user\n\t\t\t\tif (req.body['reg-email'] && req.body['reg-username']) {\n\t\t\t\t\tuser.create({\n\t\t\t\t\t\tusername: req.body['reg-username'],\n\t\t\t\t\t\temail: req.body['reg-email']\n\t\t\t\t\t}, function(err, uid) {\n\t\t\t\t\t\tdata.uid = uid;\n\t\t\t\t\t\tnext(err, data);\n\t\t\t\t\t});\n\t\t\t\t} else next(\"Parameters are not valid\");\n\t\t\t},\n\t\t\tfunction(data, next) { // Steam linking\n\t\t\t\t// Steam linking\n\t\t\t\tuser.setUserField(data.uid, 'int-steam-id', data.cache.profile.id);\n\t user.setUserField(data.uid, 'int-steam-url', data.cache.profile._json.profileurl);\n\t // Not sure if there is no other way, but we need double-link between steam id and user id\n\t db.setObjectField('int-steamid:uid', data.cache.profile.id, data.uid);\n \tdb.setObjectField('int-uid:steamid', data.uid, data.cache.profile.id);\n\n \tnext(null, data);\n\t\t\t},\n\t\t\tfunction(data, next) { // Override allowProfileImageUploads setting if needed\n\t\t\t\tif (data.allowProfileImageUploads !== '1' && data['int-steam-overrideAvatar'] === '1') {\n\t\t\t\t\tdata.allowProfileImageUploadsOld = data.allowProfileImageUploads;\n\t\t\t\t\tmeta.configs.set('allowProfileImageUploads', '1', function(err) {\n\t\t\t\t\t\tnext(err, data);\n\t\t\t\t\t})\n\t\t\t\t} else next(null, data);\n\t\t\t},\n\t\t\tfunction(data, next) { // Upload avatar from steam\n\t\t\t\tuser.uploadFromUrl(data.uid, data.cache.profile._json.avatarfull, function(err, image) {\n\t\t \t\tif (err !== null) { // This error is not critical\n\t\t \t\t\twinston.warn(\"Cannot load avatar for uid \" + data.uid, err);\n\t\t \t\t}\n\t\t \t\tnext(null, data);\n\t\t \t});\n\t\t\t},\n\t\t\tfunction(data, next) { // Restore allowProfileImageUploads setting\n\t\t\t\tif (data.allowProfileImageUploadsOld !== undefined) {\n\t\t\t\t\tmeta.configs.set('allowProfileImageUploads', data.allowProfileImageUploadsOld, function(err) {\n\t\t\t\t\t\tnext(err, data);\n\t\t\t\t\t});\n\t\t\t\t} else next(null, data);\n\t\t\t},\n\t\t\t//Handler for admin approval hack\n\t\t\tfunction(data,next) {\n\t\t\t\tif (data.registrationType === 'admin-approval') {\n\t\t\t\t\tuser.ban(data.uid, function() {\n\t\t\t\t\t\tnext(null,data);\n\t\t\t\t\t});\n\t\t\t\t} else next(null,data);\n\t\t\t},\n\t\t\tfunction(data, next) { // Login\n\t\t\t\tif (data['int-steam-allowLogin'] === '1') {\n\t\t\t\t\treq.login({ uid: data.uid }, function() {\n\t\t \t\t\tnext(null, data);\n\t\t \t\t});\n\t\t\t\t} else next(null, data);\n\t\t\t},\n\t\t\tfunction(data, next) { // Cleanup\n\t\t\t\tdelete req.session.authSteam;\n\t\t\t\tnext(null, data);\n\t\t\t}\n\t\t], function(err, data) { // Render\n\t\t\tif (err !== null) {\n\t\t\t\twinston.error(\"[SteamCreateNewUser]\", err);\n\t\t\t\treturn res.status(400).send('[[steamint:register_error]]')\n\t\t\t} else {\n\t\t\t\treturn res.json({ referrer: nconf.get('url') + '/' });\n\t\t\t}\n\t\t});\n\t}", "title": "" } ]
[ { "docid": "ff0b2b6c0ad91773d0a10ba25cdb2581", "score": "0.7450708", "text": "function userPostCreate (req, res, next) {\n next()\n}", "title": "" }, { "docid": "729ade2db274a92296e180b3bfa3127b", "score": "0.73588806", "text": "function createUser(){\n\tvar email = getUserEmailToCreate();\n\tvar pwd = $('#new-user-pwd').val();\n\tif (!email || !pwd){\n\t\talert('You have to enter a new user email-address and desired password first!');\n\t\treturn;\n\t}\n\tvar reqBody = {\n\t\tservice: \"users\",\n\t\taction: \"create\",\n\t\tdata: {\n\t\t\temail: email,\n\t\t\tpwd: pwd\n\t\t}\n\t}\n\tuserServicesPostRequest(reqBody, function(data){\n\t\tshowMessage(JSON.stringify(data, null, 2));\n\t}, function(data){\n\t\tshowMessage(JSON.stringify(data, null, 2));\n\t});\n}", "title": "" }, { "docid": "90eb1b70869baed7fafcc28e17d69579", "score": "0.7350444", "text": "function newUser(req, res, next){\n const { username, password } = req.body\n if(!username) {\n return next ({ status: 400, message: 'The user was not created. Bad username!, ctrl-users 4'})\n }\n if(!password) {\n return next ({ status: 400, message: 'The user was not created. Needs a password!, ctrl-users 5'})\n }\n modelsUsers.newUser(username,password)\n .then(function(result){\n return res.status(201).send(result)\n })\n .catch(next)\n}", "title": "" }, { "docid": "4c40f365d9b5569ebcd59e509795659a", "score": "0.7304334", "text": "postNewUser({ body }, res) {\n User.create(body)\n .then(dbUserData => res.json(dbUserData))\n .catch(err => res.status(400).json({ message: err }));\n }", "title": "" }, { "docid": "555c5c5fad208ce0b094bdba06e53492", "score": "0.72711307", "text": "function createUser() {\n const username = $usernameFld.val();\n const password = $passwordFld.val();\n const firstName = $firstNameFld.val();\n const lastName = $lastNameFld.val();\n const role = $roleFld.val();\n const user = {\n username: username,\n password: password,\n firstName: firstName,\n lastName: lastName,\n role: role\n };\n\n // Checks for empty form values and throws an alert. Does not create user if true\n if (username === \"\" || password === \"\" || firstName === \"\" || lastName === \"\") {\n alert(\"Cannot add user with empty values\");\n return;\n }\n\n // Sends a request to the server to add new user\n userService.createUser(user).then(renderUsers);\n }", "title": "" }, { "docid": "7468d5258ddb3fc93d36357fa1d6eae2", "score": "0.7270933", "text": "function postuser(req, res) {\n //Creates a new user\n var newuser = new user(req.body);\n //Save it into the DB.\n newuser.save((err, user) => {\n if (err) {\n res.send(err);\n } else {\n //If no errors, send it back to the client\n res.json({ message: \"user successfully added!\", user });\n }\n });\n}", "title": "" }, { "docid": "df1a3a5f55df41b6112e56972ce5841f", "score": "0.72181934", "text": "function create(req, res){\n /* object used to create our token! */\n console.log(req.body.user);\n var userObject = new User(req.body.user);\n\n userObject.save((err, user) => {\n if(err){\n return res.status(401).send({message: err.errmsg});\n } else {\n return res.status(200).send(user);\n }\n });\n}", "title": "" }, { "docid": "865381eecc26a9d1c5140aa8b9b1aec2", "score": "0.7173984", "text": "function create(req, res) {\n\n\t// Comprueba que tiene lo necesario para crear el usuario\n\tif(!req.body.password || !req.body.email) {\n\t\tres.status(401).send(\"Faltan parametros\");\n\t\treturn;\n\t}\n\n\t// LLama al servicio para crear el usuario y lo envia\n\tUserService.createUser(req.body)\n\t\t.then((newUser) => {\n\t\t\tres.status(200).send(newUser);\n\t\t})\n\t\t.catch((err) => {\n\t\t\tres.status(409).send(err);\n\t\t});\n}", "title": "" }, { "docid": "d6a770688c515dc6c48486fe2eb3201c", "score": "0.7160892", "text": "function create (req, res, next) {\n\tvar newUser = new User(req.body);\n\tnewUser.provider = 'local';\n\tnewUser.role = 'user';\n\tnewUser.save(function(err, user) {\n\t\tif (err) return validationError(res, err);\n\t\tvar token = jwt.sign({_id: user._id }, config.secrets.session, { expiresInMinutes: 60*5 });\n\t\tres.json({ token: token });\n\t});\n}", "title": "" }, { "docid": "d2c7bebf0961229d1174f5117c71f84b", "score": "0.70817614", "text": "async function create(req, res) {\n let { email, username, name, age, sex, password } = req.body;\n let doc = compressDoc({ email, username, name, age, sex, password });\n let payload = null;\n\n if (req.session.user) {\n // already logged in\n payload = new Res.BadReq({ details: 'You cannot create user while login.' });\n\n } else {\n let user = await userService.create(doc);\n\n // update session data\n req.session.user = user;\n // set cookie\n res.cookie('user', JSON.stringify(user), { maxAge: env.maxAge });\n\n payload = new Res.Ok({ data: user });\n }\n\n res.status(payload.status).json(payload);\n}", "title": "" }, { "docid": "4683f2de5b3e9e1854cacd58aa52904e", "score": "0.70800924", "text": "function serviceCreateUser(req, resp) {\n\t\tlogger.info(\"<Service> CreateUser.\");\n\t\tvar reqData = parseRequest(req, ['username', 'password', 'email', 'openId', 'facebookId', 'googleId']);\n\t\t\n\t\twriteHeaders(resp);\n\t\thasPermissionUser(false, req.user, null, function(permOk) {\n\t\t\tif (permOk) {\n\t\t\t\tcreateUser(reqData.username, reqData.password, reqData.email, reqData.openId, reqData.facebookId, reqData.googleId, function(err, status) {\n\t\t\t\t\tif (err) error(2, resp);\n\t\t\t\t\telse resp.end(JSON.stringify({ status: status }));\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\terror(3, resp);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "34b44833406b58f3ac3cf868af3f9a1b", "score": "0.70560056", "text": "function createUser() {\n const newUser = {\n username: $usernameFld.val(),\n password: $passwordFld.val(),\n firstName: $firstNameFld.val(),\n lastName: $lastNameFld.val(),\n role: $roleFld.val()\n }\n userService.createUser(newUser).then(res => {\n users.push(res)\n renderUsers(users)\n })\n\n }", "title": "" }, { "docid": "0e87e174bd3f9b8f87c6572d8e3e50cc", "score": "0.7052727", "text": "function createUser(req, res){\n var user = req.body;\n var newUser = userModel.createUser(user);\n res.json(newUser);\n }", "title": "" }, { "docid": "2ccb52bf0269f55a49dc8fdf8ed370a1", "score": "0.69962955", "text": "function create(req, res, next){\n console.log(req.body)\n const {error, value} = validator.validateUser(req.body)\n if (error) return res.status(400).json({\n error: true,\n message:error.details\n })\n const user = new User(value);\n user.save()\n .then(saveUser => res.status(200).json({\n error:false,\n create_up: saveUser.create_up\n // token: service.createToken(user)\n }))\n .catch(error => res.status(500).json({\n error: true,\n message: error.info\n }));\n}", "title": "" }, { "docid": "af7b27f1dd21c22c5e586fe24721e33a", "score": "0.69841546", "text": "function postUser(req, res) {\n const originalUser = { \n id: req.body.id, \n firstName: req.body.firstName,\n lastName: req.body.lastName, \n contactEmail: req.body.contactEmail \n };\n const user = new db.User(originalUser);\n user.save(err => {\n if (checkServerError(res, err)) return;\n res.status(201).json(user);\n console.log(\"User created successfully!\");\n });\n }", "title": "" }, { "docid": "ade6abc2af632e2677ce2fba675918e5", "score": "0.69828373", "text": "create(req, res, next) {\r\n req.session.reset();\r\n var form = new formidable.IncomingForm();\r\n form.parse(req, (err, fields, files) => {\r\n if(err) return res.sendStatus(500);\r\n db.get(\"SELECT * FROM users WHERE username = ?\", fields.username, (err, user) => {\r\n if(err) return res.render('session/new', {message: \"Username/Password not found. Please try again.\"});\r\n if(!user) return res.render('session/new', {message: \"Username/Password not found. Please try again.\"});\r\n if(user.password != fields.password) return res.render('session/new', {message: \"Username/Password not found. Please try again.\"});\r\n req.session.user_id = user.userID;\r\n req.user = user;\r\n return res.redirect('/');\r\n });\r\n });\r\n }", "title": "" }, { "docid": "b4c10cfb6b0afb2bab5b0f1ff04ab51d", "score": "0.69734246", "text": "function create(req, res) {\n console.log(req.body);\n var newUser = new _user2.default(req.body);\n newUser.provider = 'local';\n if (req.body.role) newUser.role = 'manager';\n newUser.save().then(function (user) {\n /**\n * Creates send welcome email\n */\n if (user.role === 'user') {\n mailer.send(_environment2.default.mailOptions.signUpAdvertiser(res.req.body));\n } else if (user.role === 'manager') {\n mailer.send(_environment2.default.mailOptions.signUpPublisher(res.req.body));\n } else {\n mailer.send(_environment2.default.mailOptions.signUpAdvertiser(res.req.body));\n }\n var token = _jsonwebtoken2.default.sign({ _id: user._id }, _environment2.default.secrets.session, {\n expiresIn: 60 * 60 * 5\n });\n res.json({ token: token });\n }).catch(validationError(res));\n}", "title": "" }, { "docid": "0fe83c1358fc2b02fbd247bd168dddf7", "score": "0.6969681", "text": "function createUser(req, res) {\n var newUser = req.body.user;\n\n if(newUser.roles && newUser.roles.length > 1) {\n newUser.roles = newUser.roles.split(\",\");\n } else {\n newUser.roles = [\"visitor\"];\n }\n\n userModel\n .findUserByUsername(newUser.username)\n .then(\n function(user){\n if(user) {\n res.json(null);\n } else {\n return userModel.createUser(newUser);\n }\n },\n function(err){\n res.status(400).send(err);\n }\n )\n .then(\n function(user){\n if(user){\n req.login(user, function(err) {\n if(err) {\n res.status(400).send(err);\n } else {\n return userModel.findAllUsers();\n }\n });\n }\n }\n ).then(\n function(users){\n res.json(users);\n }\n\n )\n }", "title": "" }, { "docid": "3bf985b61cbebbf862c3cd106791f5ea", "score": "0.6968317", "text": "function postUser(req, res) {\n var newUser = new User(req.body);\n\n newUser.save()\n .then(user => res.json({message: \"User successfully added!\", user:user}))\n .catch(err => res.send(err))\n}", "title": "" }, { "docid": "f5210b26330347fb5f382ee963452b3c", "score": "0.6966852", "text": "function saveNewUser(req, res) {\n let name = req.body.name;\n let password = req.body.password;\n\n let myUser = new User({\n name: name,\n password: password\n });\n\n myUser.save((err) => {\n if(err) {\n res.status(401).send({ SUCCESS: false, MESSAGE: 'User not saved' });\n return;\n } else {\n res.json({\n SUCCESS: true,\n MESSAGE: 'User saved successfully',\n name: name,\n password: password\n });\n }\n });\n}", "title": "" }, { "docid": "d71c569a6f639e064a8f5b6741dd5244", "score": "0.69644195", "text": "async createUser(req, res) {\n\t\tconst { username, email, provider, name, lastname } = req.body;\n\t\tconst user = new User({ username, email, provider, name, lastname });\n\t\ttry {\n\t\t\tawait user.save(function (err) {\n\t\t\t\tif (err) return res.status(400).json({ error: `Error en los datos del usuario` });\n\t\t\t\tres.status(200).json({ message: `Usuario ${username} creado exitosamente` });\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}", "title": "" }, { "docid": "857e1823483afb53e8d8b09d7e30f29a", "score": "0.69639283", "text": "function createUser(req,res) {\n models.Users.create(req.body)\n .then(data=>res.json(data))\n .catch(errs=>res.json(errs));\n}", "title": "" }, { "docid": "3c0e3606a3df2d87d4dbb98af616fcc4", "score": "0.6954174", "text": "function postNewUser(client, userName, password, callback){\n\t$.ajax({\n\t\tmethod: \"POST\",\n\t\turl: 'http://'+location.host+'/users/register/'+client.id + '/' + userName + '/' + password,\n\t}).done(function(errorCode){\n\t\tconsole.log(\"Code: \"+errorCode)\n\t\tcallback(errorCode)\n\t})\n}", "title": "" }, { "docid": "487f045cc4a05b2aa774ac2b5b7eb6b3", "score": "0.6951027", "text": "newUser ({ body }, res) {\n User.create(body)\n .then(dbUserData => res.json(dbUserData))\n .catch(err => res.status(400).json(err))\n }", "title": "" }, { "docid": "03a2faa27105bd1dfed946d24ef9816e", "score": "0.6934815", "text": "function createNewUser (req, res, next) {\n if (!req.body.email || !req.body.password || !req.body.firstName || !req.body.lastName) { \n return res.json({success: false, msg: 'Please enter username and password.'});\n } else {\n const newUser = new User({\n firstName: req.body.firstName,\n lastName: req.body.lastName,\n email: req.body.email,\n password: req.body.password,\n mobileNumber: req.body.mobileNumber\n }); \n // save the user\n newUser.save(function (err) {\n if (err) { \n \n return res.json({success: false, msg: 'Email address already exists'});\n } \n User.findOne({\n email: req.body.email \n }, \n { password: 0 },\n function (err, user) {\n if (err) return next(err);\n else {\n const token = jwt.sign(user.toJSON(), secret);\n return res.json({success: true, msg: 'Created new user', token: 'JWT ' + token, data: user});\n }\n });\n }); \n }\n}", "title": "" }, { "docid": "610121a99d883ca6f9a4574b836c7a52", "score": "0.69298095", "text": "function postUser(req, res){\n let user = new User();\n user.id = req.body.id;\n user.login = req.body.login;\n user.password = req.body.password;\n user.role = req.body.role;\n\n console.log(\"POST user reçu :\");\n console.log(user)\n\n user.save( (err) => {\n if(err){\n res.send('cant post user ', err);\n }\n res.json({ message: `${user.login} saved!`})\n })\n}", "title": "" }, { "docid": "0135637857b664f660e8dfe04b51df95", "score": "0.6927188", "text": "createUser(data) {\n return Api().post(\"/users\", data);\n }", "title": "" }, { "docid": "8c37309bae4c084506fea16a0b0220d0", "score": "0.6916907", "text": "function createUser(req, res, next) {\n //if (validate(req, res)) {\n req.body.type_id = parseInt(req.body.type_id);\n req.body.password = bcrypt.hashSync(req.body.password, 8);\n db.none('insert into users(name, mail, password, challenges_completed, points, zombies_killed, run_aways, type_id)' +\n 'values(${name}, ${mail}, ${password}, 0, 0, 0, 0, ${type_id})',\n req.body)\n .then(function() {\n res.status(200)\n .json({\n status: 'success',\n message: 'Inserted one user'\n });\n })\n .catch(function(err) {\n res.status(500)\n .json({\n status: 'error',\n err: err\n });\n });\n //}\n}", "title": "" }, { "docid": "0554c2ef6347e78d742ee42e937a1457", "score": "0.6882918", "text": "function createUser(req, res) {\n const salt = bcrypt.genSaltSync();\n const hash = bcrypt.hashSync(req.body.password, salt);\n\n return models.User.create({\n username: req.body.username,\n password: hash,\n firstName: req.body.firstName,\n lastName: req.body.lastName,\n email: req.body.email,\n dob: req.body.dob\n })\n .then(() => {\n res.redirect('/');\n });\n}", "title": "" }, { "docid": "8896752e537f5f0158133c69a544ce7d", "score": "0.6873354", "text": "function createRoute(req, res, next){\n User.create(req.body)\n .then(() => res.redirect('/login'))\n .catch(next);\n}", "title": "" }, { "docid": "bc6e418deb6b5adf919344a0672e3466", "score": "0.68683565", "text": "static create (req, res, next) {\n const userFormData = req.body;\n\n if (userFormData && userFormData.email && userFormData.password) {\n // TODO dates creation / update\n const newUser = new User(userFormData);\n\n User.register(newUser, userFormData.password, function(err, newRegistredUser) {\n if (err) return next(err);\n // TODO envoyer email de confirmation d'inscription\n\n req.body = userFormData;\n\n res.send({\n\n });\n });\n }\n else {\n next(Error.newError(\"MISSING_DATA\", 400));\n }\n }", "title": "" }, { "docid": "f20ba6c0b897f912d166aac377d1fbf6", "score": "0.68664724", "text": "function createUser() {\n\n if ($usernameFld.val() === '') {\n $noUsername.modal('show')\n } else if ($passwordFld.val() === '') {\n $noPassword.modal('show')\n } else {\n userService.validUsername($usernameFld.val()).then(function (isValid) {\n if (!isValid) {\n $usernameTaken.modal('show')\n } else {\n\n var user = new User(\n $usernameFld.val(),\n $passwordFld.val(),\n $firstNameFld.val(),\n $lastNameFld.val(),\n $emailFld.val(),\n $phoneFld.val(),\n $dobFld.val(),\n $roleFld.val()\n )\n\n userService.createUser(user, resetFields()).then(function () {\n findAllUsers()\n $createSuccess.show()\n $deleteSuccess.hide()\n $updateSuccess.hide()\n hideAlert($createSuccess)\n })\n\n }\n })\n }\n }", "title": "" }, { "docid": "b98f4d9273eca542e5184eb3641a0592", "score": "0.6863986", "text": "function createUser(req, res) {\r\n\r\n\t/*Request Trace*/\r\n\tlogger.debug(\"Req UUID: \" + req.uuid);\r\n\tlogger.debug(\"Device Type\" + JSON.stringify(req.device));\r\n\tlogger.debug(\"Cookies: \" + util.inspect(req.cookies));\r\n\tlogger.debug(\"Body: \" + util.inspect(req.body));\r\n\r\n\t/*Validate required field*/\r\n\tvar userObject = req.body;\r\n\tuserService.createUser(userObject, function(err, user){\r\n\t\tif(err){\r\n\t\t\tlogger.error(\"Error while creating user\", err);\r\n\t\t\tres.send(\"Failed\");\r\n\t\t\tresHandler.sendServerError(res, Failed);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlogger.info(\"User created successfully. User Id :\", user);\r\n//\t\tres.send(\"Success\");\r\n\t\tresHandler.sendSuccess(res, \"Success\");\r\n\t});\r\n}", "title": "" }, { "docid": "e525af4828fbbc0be7174212c6b8bea5", "score": "0.6832457", "text": "function createUser(newUser) {\n // console.log(newUser);\n\n fetch(endpoint + \"/users\", {\n method: \"post\",\n body: JSON.stringify(newUser),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\"\n }\n })\n .then(res => res.json())\n .then(d => {\n console.log(d);\n signInModal.style.display = \"none\";\n setTimeout(() => {\n logInNewUser(newUser);\n }, 1000);\n });\n}", "title": "" }, { "docid": "46ac766127b50d744281af630fe31ec5", "score": "0.6825676", "text": "createUser() {\n var userName = $(\"#formControlsUsername\").val()\n var password = $(\"#formControlsPassword\").val()\n var email = $(\"#formControlsEmail\").val()\n User.createUser(userName, password, email)\n const path = '/'\n browserHistory.push(path)\n }", "title": "" }, { "docid": "3325fe74aa332e19deb6f151da5642ae", "score": "0.681558", "text": "async function create (req, res) {\n res.json(await service.create(req.body, req.authUser))\n }", "title": "" }, { "docid": "1dc489d640020f1c4cd5f836db87d30f", "score": "0.68064225", "text": "function registrationCreate(req, res, next){\n User\n .create(req.body)\n .then((user) => {\n req.flash('success', `Thanks for registering, ${user.username}!`);\n req.session.userId = user._id;\n res.redirect('/login');\n })\n .catch((err) => {\n if(err.name === 'ValidationError') {\n req.flash('danger', 'Passwords do not match');\n res.redirect('/register');\n }\n next(err);\n });\n}", "title": "" }, { "docid": "95afe848c82c851c5002a23499f51847", "score": "0.6803741", "text": "function signup(username, password, email, dob, city) {\n //create new user\n}", "title": "" }, { "docid": "9e67f12ce5fbe5cd767c361abba7681c", "score": "0.6799832", "text": "function addNewUser(request, response) {\n // sets username variable\n var username = request.body.username;\n // sets password variable\n var password = request.body.password;\n // if username string is empty or undefined, return 422 error\n if (!('username' in request.body)) {\n return response.status(422).json({\n message: 'Missing field: username'\n });\n }\n // if username is not a string then return incorrect type error\n if (typeof username !== 'string') {\n return response.status(422).json({\n message: 'Incorrect field type: username'\n });\n }\n // removes whitespace from either side of username string\n username = username.trim();\n // checks that username is not an empty string\n if (username === '') {\n return response.status(422).json({\n message: 'Incorrect field length: username'\n });\n }\n // checks that the password is a string\n if (typeof password !== 'string') {\n return response.status(422).json({\n message: 'Incorrect field type: password'\n });\n }\n // removes whitespace from either side of the password string\n password = password.trim();\n // checks that password is not an empty string\n if (password === '') {\n return response.status(422).json({\n message: 'Incorrect field length: password'\n });\n }\n // generates salt for hash (the '10' indicates how many rounds of the salting algorithm should be used -- the higher the number, the more computationally difficult it is to compare two passwords. 10-12 provides a nice balance between taking long enough so brute-force cracking is difficult, and being quick enough that your app is responsive to your users). \n bcrypt.genSalt(10, function(error, salt) {\n if (error) {\n return response.status(500).json({\n message: 'Internal server error'\n });\n }\n // generates a salted SHA-1 hash\n bcrypt.hash(password, salt, function(error, hash) {\n if (error) {\n return response.status(500).json({\n message: 'Internal server error'\n });\n }\n // creates new user from the constructor\n var user = new User({\n username: username,\n password: hash\n });\n // saves new user to database\n user.save(function(error) {\n if (error) {\n return response.status(500).json({\n message: 'Internal server error'\n });\n } \n response.status(201).header('Location', '/users/' + user._id).json({});\n });\n });\n });\n}", "title": "" }, { "docid": "4c4f4451e468d8749e19c4b21c82dbb5", "score": "0.6798715", "text": "function createUser(req, res, next) {\n // get data\n const first = req.body.firstName;\n const last = req.body.lastName;\n const email = req.body.email.toLowerCase();\n const password = bcrypt.hashSync(req.body.password, SALTROUNDS);\n\n // validate data\n if (!(first || last || email || password)) next(new Error('Please check that all fields were filled out properly.'));\n if (!isValidEmail(email)) next(new Error('Please submit a valid email address.'));\n\n // build query\n const query = `INSERT INTO \"user\" (fname, lname, email, password) VALUES ($1, $2, $3, $4) RETURNING user_id, fname, lname, email;`;\n // prepare values array\n const values = [\n first,\n last,\n email,\n password,\n ];\n\n // execute query with the data...\n db.one(query, values)\n .then((data) => {\n // ...then get a token for the user and send it back to the caller\n auth.getUserToken(data)\n .then((token) => res.token = token)\n .then(() => next())\n .catch(err => next(err));\n })\n /* end of db then; catch db errors now */\n .catch(err => next(err));\n}", "title": "" }, { "docid": "b6128c7851381f8a61b9ea6fc3e8b334", "score": "0.6793992", "text": "function signup(req, res) {\n let body = req.body;\n\n if (!body.username || !body.password) {\n return res.status(403).json({\n success: false,\n message: \"Please provide a name and password.\"\n });\n }\n\n utils.checkUniquenessOfUser(body, (error) => {\n if (error) {\n return res.status(403).json({\n success: false,\n message: error\n });\n }\n\n let hash = bcrypt.hashSync(body.password.trim(), 10);\n\n let user = new User({\n username: body.username.trim(),\n password: hash,\n admin: false\n });\n\n user.save((error, user) => {\n if (error) {\n throw error;\n }\n\n let token = utils.generateToken(user);\n user = utils.getCleanUser(user);\n\n res.json({\n user,\n token\n });\n });\n });\n}", "title": "" }, { "docid": "dd649a2c0a9d96e700f1a56297f7fff9", "score": "0.67886186", "text": "create(req, res, next) {\r\n req.session.reset();\r\n var form = new formidable.IncomingForm();\r\n form.parse(req, (err, fields, files) => {\r\n if(err) return res.sendStatus(500);\r\n db.get(\"SELECT * FROM users WHERE username = ?\", fields.username, (err, user) => {\r\n if(err) return res.render('session/new', {message: \"Username/Password not found. Please try again.\", user: req.user});\r\n if(!user) return res.render('session/new', {message: \"Username/Password not found. Please try again.\", user: req.user});\r\n if(user.password_digest != encryption.digest(fields.password)) return res.render('session/new', {message: \"Username/Password not found. Please try again.\", user: req.user});\r\n req.session.user_id = user.id;\r\n return res.redirect('/wiki');\r\n });\r\n });\r\n }", "title": "" }, { "docid": "5bd526184bd1b3d082448c25254261d4", "score": "0.67761785", "text": "function createUser(req, res, next) {\n const SALTROUNDS = 10;\n console.log(req.body);\n const userObject = {\n username: req.body.username,\n password: bcrypt.hashSync(req.body.password, SALTROUNDS)\n };\n psql.none(`INSERT INTO users ( username, password )\n VALUES ('${userObject.username}', '${userObject.password}');`)\n .catch(error => console.log(error));\n // then gets the newly created id from the db\n psql.one(`SELECT id\n FROM users\n WHERE username = $/username/\n AND password = $/password/;`, userObject)\n .then((result) => {\n console.log('this is result--->' +result.id);\n res.token = createToken(result);\n res.id = result.id;\n next();\n })\n .catch(error => next(error));\n }", "title": "" }, { "docid": "20e08276e13495c437e41b4ec11468f6", "score": "0.6758275", "text": "create(request, response){\n console.log(`posting to the 'new' user route`)\n console.log('request.body', request.body)\n User.create(request.body)\n .then(userInfo => {\n // assign session variables\n request.session.user_id = userInfo._id;\n request.session.email = userInfo.email;\n request.session.name = userInfo.first_name;\n request.session.isLoggedIn = true;\n // render dashboard\n response.redirect(`/user/${user._id}`)\n })\n .catch(error => {\n for(let key in error.errors){\n console.log(error.errors[key].message)\n request.flash('user_registration_error', error.errors[key].message)\n }\n response.render('new', {error, title: 'New User Registration' });\n });\n }", "title": "" }, { "docid": "251465dd5468ec5b88839661d6ec8c82", "score": "0.6757332", "text": "static signUp(req, res) {\n database.user.create(req.body)\n .then((createdUser) => {\n const user = {\n fullName: createdUser.fullName,\n email: createdUser.email,\n id: createdUser.id,\n isAdmin: createdUser.isAdmin,\n token: userController.generateToken(createdUser),\n };\n return res.status(201).json(user);\n })\n .catch(err => res.status(400).json({ err: err.errors[0].none || 'a user already exits with this email' }));\n }", "title": "" }, { "docid": "f83d7370f85bf75114215de571ac5665", "score": "0.67432237", "text": "onSubmit() {\n if (this.state.isCreate) {\n this.createUser()\n } else {\n this.login()\n }\n }", "title": "" }, { "docid": "84ea5ba9b9f5f8d6238f3c76697db791", "score": "0.67334366", "text": "function loginPost(req, res, next) {\n var username = req.body.username,\n password = req.body.password;\n \n //if this is a logIn post request\n if(req.body.postId === 'logIn') {\n \n //look up user in database\n User.find({username: username}, function(error, userData) {\n //does the user exist\n if(userData.length === 0) {\n console.log('user not found');\n res.send('invalid login');\n }\n else {\n user = userData[0]; \n //check the password \n bcrypt.compare(password, user.passHash, function(err, hashRes) {\n if(hashRes === true) { \n req.session.userStatus = 'loggedIn'; \n req.session.user = username; \n res.send('user validated'); \n } \n else {\n console.log('invalid password');\n res.send('invalid login'); \n }\n });\n }\n }); \n }\n\n //if this is a registration post request\n if(req.body.postId === 'register') {\n \n //check if username exist\n User.find({username: username}, function(error, userData){\n \n //if it doesn't exist then add it \n if(userData.length === 0) {\n user = new User(); \n user.username = username;\n \n //generate a salt\n bcrypt.genSalt(10, function(err, salt) {\n\n //when salt is done hash the password\n bcrypt.hash(password, salt, function(err, hash) {\n \n //when hash is done store new credentials in db\n user.passHash = hash; \n user.save(function (err) {\n if(!err) {\n res.send('user added');\n return; \n }\n });\n });\n });\n }\n //otherwise user already exist\n else {\n res.send('user taken');\n return; \n }\n\n });\n\n }\n\n}", "title": "" }, { "docid": "30b23ffd6828a01dc4ed54593e75b0f8", "score": "0.67327905", "text": "function create(req, res) {\n return _UserServices2.default.create(req.body).then(respondWithResult(res, 201)).catch(handleError(res));\n}", "title": "" }, { "docid": "b840dedda208c486068f80467cb2d78b", "score": "0.6731266", "text": "function signup(username, password, email, dateOfBirth, city) {\n // create new user\n}", "title": "" }, { "docid": "2e6bea9f24cae063ab70f87252644098", "score": "0.67261755", "text": "function createUser(user) {\n return $http({\n url: APISERVICE.userUrl,\n method: 'POST',\n dataType: 'json',\n data: user,\n headers: APISERVICE.headers\n }).then(handleSuccess, handleError);\n }", "title": "" }, { "docid": "d4957f367aee9025565f86faf537111f", "score": "0.672445", "text": "function createUser(name, email, username, password) {\n const url = baseUrl_API + '/api/v1/users';\n\n return $.ajax({\n url: url,\n method: 'POST',\n dataType: 'json',\n data: {name: name, email: email, username: username, password: password}\n });\n}", "title": "" }, { "docid": "b536e38a10c75e84f3525b97e00d7d42", "score": "0.6724185", "text": "function doCreateAccount() {\n\t// Parse necessary data\n\tconst formData = new FormData(document.getElementById(\"create-form\"));\n\tconst userData = formToJSON(formData);\n\n\t// Send request\n\tcreateUser(userData).then(() => {\n displayNotification(\"Success!\", \"Returning you back to login...\", \"success\");\n\n const login = userData.Login;\n const url = \"index.html?loginPlaceholder=\" + login;\n\t\t// Migrate to login after 2 seconds.\n\t\tsetTimeout(() => window.location.href = url, 2000);\n\t}).catch(displayError);\n}", "title": "" }, { "docid": "0266298878676ac3407302f3c6325ed4", "score": "0.67218256", "text": "async create({ request }){\n\n /*We look up the username, email and password fields \n from the body of our request and store them in an object called data*/\n const data = request.only([\"username\", \"email\", \"password\"])\n\n /*We create a new user by passing the parameters coming from the request \n and save this new user in a user variable;*/\n const user = await User.create(data)\n\n /*We return the new user as a result of the request, as we selected, \n in our case the return will be a JSON.*/\n return user\n }", "title": "" }, { "docid": "1d4ca2248544018c590b016a0dc26ab2", "score": "0.67157954", "text": "function createUser(req,res){\n user=req.body;\n // console.log(req.body);\n res.send('data has been added succesfully');\n}", "title": "" }, { "docid": "88bb3eb0a8a86039dc9e645e53bf3b95", "score": "0.67056453", "text": "function createUser(req, res, callback) {\n db.get(\"SELECT id FROM user WHERE username = ?\", req.body.username, function(err, row) {\n if (row) {\n res.sendStatus(400);\n } else {\n db.run(\"INSERT INTO user (username,passwd) VALUES (?,?)\", [req.body.username, req.body.password], function(err) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"added user\");\n res.sendStatus(200);\n }\n });\n }\n });\n}", "title": "" }, { "docid": "349334c42688ccb04ea89c60dde0a103", "score": "0.67016", "text": "function register () {\n var userData = {\n \"username\": vm.username, \"password\": vm.pass, \"email\": vm.email,\n \"first_name\": vm.firstName, \"last_name\": vm.lastName\n };\n $http.post('/users/register', userData).then(function (response) {\n if (response) {\n $scope.indexCtrl.login(userData);\n }\n })\n }", "title": "" }, { "docid": "c374e8c1349f0ae369c2442f79f71f8b", "score": "0.669697", "text": "function signUpUser(req, res) {\r\n\r\n let newUser = req.body.NewUser;\r\n\r\n database.storeNewUser(newUser);\r\n res.send({ Message: \"stored\" })\r\n\r\n\r\n}", "title": "" }, { "docid": "3bbd6d752fcb47b4e372675e5dbe9142", "score": "0.6695059", "text": "static post(req, res)\n {\n let user = new User(req.body);\n let promise = user.save();\n promise.then(user =>\n {\n res.status(HttpStatus.CREATED).json(user);\n })\n .catch(err =>\n {\n res.status(HttpStatus.UNPROCESSABLE_ENTITY).json(err);\n });\n }", "title": "" }, { "docid": "3d72da6315a2c2747c77f351180e2b23", "score": "0.66929686", "text": "async create({ body }, res) {\n\t\tconst user = new User(body);\n\t\ttry {\n\t\t\tconst savedUser = await user.save()\n\t\t\tres.status(200).json(savedUser);\n\t\t}\n\t\tcatch (err) {\n\t\t\tres.status(500).json(err);\n\t\t}\n\t}", "title": "" }, { "docid": "a2789b9371d27849bbf41c550090b39c", "score": "0.6687939", "text": "function loginUser () {\n const username = document.getElementById(\"email\").value\n const password = document.getElementById(\"password\").value\n const userUrl = baseUrl + 'user/' + username\n console.log(userUrl)\n const user = {\n 'username': username,\n 'password': password,\n }\n loginUrl = baseUrl + 'user/login'\n generalPost(loginUrl, user)\n \n \n}", "title": "" }, { "docid": "71a9af3e3a3ceb5e015708d5c11d7686", "score": "0.6683308", "text": "function signUp({username, password, email, dob, city}) {\n // create new user\n}", "title": "" }, { "docid": "5c9e7f516544505ad8d54208f4094362", "score": "0.6681989", "text": "function handleSignUpForm(req, res, next) {\n let user = new User(req.body.username, req.body.password);\n user.email = req.body.email;\n userMapper.get(user._id, function(err, userJson) {\n if (err) {\n return next(err);\n }\n\n if (userJson) {\n //already present in the DB\n res.status(409).redirect('/account/signup');\n } else {\n userMapper.insert(user, (err, result) => {\n if (err) {\n return next(err);\n }\n console.log(`User created with the id: ${result.id}`);\n res.redirect(303, '/account/login');\n });\n }\n });\n}", "title": "" }, { "docid": "96180b838f097d143152d5a882a8d000", "score": "0.6678521", "text": "async createUser(req, res) {\n console.log(req.body)\n const user = await User.create(req.body.userData);\n\n if (!user) {\n return res.status(400).json({ message: 'Something is wrong!' });\n }\n const token = signToken(user);\n res.json({ token, user });\n }", "title": "" }, { "docid": "bada2b634426f80b33d1aa58e1183eb5", "score": "0.66730833", "text": "async createUser(req, res, next) {\n try {\n const {email, password} = req.body;\n\n const addUser = new User({\n email,\n password,\n });\n\n await addUser.encryptPassword();\n await addUser.save();\n\n const token = jwt.sign({id: addUser._id}, process.env.JWT_SECRET, {\n expiresIn: 60 * 60 * 24, //Time seconds\n });\n\n res.json({auth: true, token});\n } catch (error) {\n next(error);\n }\n }", "title": "" }, { "docid": "3afb46928c33b9b1510002df13a251b8", "score": "0.6672883", "text": "function createUser(req, res, next) {\n // encrypt password before storage\n bcrypt.hash(req.body.password, 10)\n .then((hash) => {\n const body = {\n name: req.body.name,\n email: req.body.email,\n password: hash,\n };\n // redundant email validation\n if (!isEmail(req.body.email)) {\n throw new BadRequestError(badEmailMessage);\n }\n // mongoose call to create the record\n User.create(body)\n .then((result) => {\n // check if any storage/validation errors occurred inside Mongo.\n // Mongo errors are handled by the central error system.\n if (!result) {\n throw new BadRequestError(badRequestMessage);\n }\n // assigning a registration token\n const token = jwt.sign(\n { _id: result._id },\n process.env.NODE_ENV === 'production' ? process.env.JWT_SECRET : 'dev-secret', { expiresIn: '7d' },\n );\n\n const newObj = { name: result.name, email: result.email, token: `Bearer ${token}` };\n\n res.cookie('token', `Bearer ${token}`, { expires: new Date(Date.now() + 24 * 3600000), sameSite: 'none', secure: true });\n\n res.status(200).send(newObj);\n })\n .catch(next);\n })\n .catch(next);\n}", "title": "" }, { "docid": "ef62bf00797d9a33141ad4e6d5b7bbdb", "score": "0.66664255", "text": "function newUser(loginDetails) {\n return $http({\n method: 'POST',\n url: localHost,\n data: {\n username: loginDetails.username,\n first_name: loginDetails.first_name,\n last_name: loginDetails.last_name,\n city: loginDetails.city,\n email: loginDetails.email,\n password: loginDetails.password,\n password_confirmation:loginDetails.password_confirmation\n\n }\n })\n }", "title": "" }, { "docid": "a31545ec96651d060f622dfb0f1a68cf", "score": "0.6664109", "text": "function createUser() {\r\n return new Promise((resolve, reject) => {\r\n postRequest(HOST + '/' + USER_URL, prepareHeaderForUserOrConnection(), prepareBodyForCreateUser())\r\n .then(res => {\r\n console.log('createUser success')\r\n resolve(res)\r\n })\r\n .catch((error) => {\r\n console.log('createUser error' + error)\r\n reject(error)\r\n })\r\n })\r\n}", "title": "" }, { "docid": "d46d2f5d608ec529ad68873c933feeeb", "score": "0.66393906", "text": "async createUser(req, res, next) {\n const userProps = req.body;\n const user = new User(userProps);\n\n await user.save();\n res.send(user);\n }", "title": "" }, { "docid": "0f0886689aefdb7b7434e737adf00d8d", "score": "0.663198", "text": "function createUser(user) {\n \treturn fetch(self.url, {\n\t\t\tmethod: 'post',\n\t\t\tbody: JSON.stringify(user),\n\t\t\theaders: {\n\t\t\t\t'content-type' : 'application/json'\n\t\t\t}\n\t\t})\n }", "title": "" }, { "docid": "8b3deacbb84cb33a91b0f22d36b8c5c3", "score": "0.66295743", "text": "async create(req, res){\n let username = req.body.username;\n let fullname = req.body.fullname;\n let password = req.body.password;\n let email = req.body.email;\n \n console.log(req.body)\n \n if (username && password) {\n User.create({\n username : username,\n fullname: fullname,\n email : email,\n password : password,\n admin: false\n },\n function (err, user) {\n if (err) \n return res.status(500).send({\"error\":err, \"message\":\"There was a problem registering the user.\"})\n // create a token\n /*\n var token = jwt.sign({ id: user._id }, process.env.JWT_WORD, {\n expiresIn: 86400 // expires in 24 hours\n });\n */\n res.status(200).send({ auth: true, token: token });\n });\n }else{\n res.status(400).send({ \"message\": \"campos obrigatorios\" });\n }\n }", "title": "" }, { "docid": "3abc0db645a82c81278d99bbae237ad5", "score": "0.66255236", "text": "async createUser(req, res) {\n const user = await User.create({\n email: req.body.email,\n firstname: req.body.firstname,\n password: req.body.password\n })\n setResponse(res, 'OK', user)\n }", "title": "" }, { "docid": "5e2ebd92ef499e533d7610ae51ca27a8", "score": "0.66246116", "text": "onSubmit() {\n\t\tconst username = this.state.formControls.username.value;\n\t\tconst email = this.state.formControls.email.value;\n\t\tconst password = this.state.formControls.password.value;\n\t\tthis.props.closeModal();\n\n\t\t//STRETCH GOAL\n\t\t// AXIOS call to the api using sequelize\n\t\t//if user is in database, don't do anything right now\n\t\t//if user is not in the database, create new user \n\n\t\tconst data = {\n\t\t\tname: username,\n\t\t\temail: email,\n\t\t\tpassword: password\n\t\t};\n\n\t\tfetch(\"/api/users\", {\n\t\t\tmethod: \"POST\",\n\t\t\tmode: \"cors\",\n\t\t\tcache: \"no-cache\",\n\t\t\tcredentials: \"same-origin\",\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tredirect: \"follow\",\n\t\t\treferrer: \"no-referrer\",\n\t\t\tbody: JSON.stringify(data)\n\t\t})\n\t\t\t.then(function(response) {\n\t\t\t\treturn response.text();\n\t\t\t}, function(error) {\n\t\t\t\tthrow (error); //=> String\n\t\t\t});\n\n\t}", "title": "" }, { "docid": "9618d4f6fd7f15c6be4de849e68f5ee4", "score": "0.66199416", "text": "async function createUser(evt) {\n evt.preventDefault();\n\n let data = JSON.stringify({\n username: document.getElementById('inpUserName').value,\n email: document.getElementById('inpEmail').value,\n password: document.getElementById('inpPsw').value,\n role: USER_ROLE\n });\n\n // request for creating user\n fetch(CREATE_USER_URL, {\n method: 'POST',\n body: data,\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\"\n }\n }).then(response => {\n if (response.status < 400) { // user is created\n handleLogin(response);\n } else if (response.status === 403) { // username is already taken\n document.getElementById('signupMessage').innerHTML = 'This username is already taken, choose another one.';\n } else { // something else is wrong (server)\n showErrorMessage('Something went wrong with creating this user, please try again later.');\n }\n })\n .catch(err => console.error(err));\n}", "title": "" }, { "docid": "582b3389fd71ad0eb41d67ee8b2181d0", "score": "0.661884", "text": "static async create(username, password, name) {\n console.debug(\"create\")\n const response = await axios.post(`${BASE_URL}/signup`, {\n user: {\n username,\n password,\n name\n }\n });\n // build a new User instance from the API response\n const newUser = new User(response.data.user)\n // attach the token to the newUser instance for convenience\n newUser.loginToken = response.data.token;\n return newUser;\n }", "title": "" }, { "docid": "4798d9f43323ab995afe535fa04daf77", "score": "0.6618722", "text": "function signup({email,password,dateOfBirth,city,username}){\n // Create new user\n}", "title": "" }, { "docid": "656a68a14720bf75b1fc59d2b5d05847", "score": "0.66138786", "text": "function postUser(userData) {\n $.post(\"/api/user\", userData)\n .then(function(error, result){\n // console.log(\"User has been created succesfully ! \");\n // console.log(result);\n window.location.href=\"/\";\n });\n }", "title": "" }, { "docid": "3921cd86ba1efe597988bfeec0bb22e6", "score": "0.6611626", "text": "function createUser (req, res, password, salt) {\n Users.create({\n name: req.body.firstname + ' ' + req.body.lastname,\n emailID: req.body.emailAddress,\n password: password,\n salt: salt\n }, (err, response) => {\n if (err) {\n console.log(err)\n return res.send({err})\n } else {\n return res.redirect('/signin')\n }\n })\n}", "title": "" }, { "docid": "314ee66e77d841fbd4f2e51f3dca3c1e", "score": "0.66072685", "text": "function onSubmit(evt) {\n evt.preventDefault();\n email = document.getElementById('signupEmail').value;\n password = Math.random().toString(36).slice(2);\n db.createUser({\n email: email,\n password: password\n }, function(err, userData) {\n if (err) {\n throw err;\n }\n saveUserProfileInfo();\n console.log('Created user:', arguments);\n });\n }", "title": "" }, { "docid": "a3f11862ab1e1c044efef1da48402c6a", "score": "0.6605563", "text": "function post_user(req, full_name, department, start_date, email){\n\tvar key = datastore.key(USER);\n var new_user = { \"full_name\": full_name,\n \"department\": department,\n \"start_date\": start_date,\n \"email\": email,\n \"owner_of_courses\": [] };\n return datastore.save({ \"key\": key, \"data\": new_user })\n .then( () => {\n new_user = ds.addIDandSelfUserLink(req, new_user, key.id);\n return new_user;\n });\n}", "title": "" }, { "docid": "41ca0cac4d56f5d86cc433b92d3f3ee9", "score": "0.66037863", "text": "function createUser(user, route) {\n fetch(rootURL + route, {\n method: 'POST',\n body: JSON.stringify(user),\n headers: { 'Content-Type': 'application/json' }\n }).then(response => response.json())\n // .then(response => send)\n}", "title": "" }, { "docid": "c302b823a9b843dd5293f7dd6f5fc7bb", "score": "0.6602567", "text": "function createNewUser(userData) {\n $.ajax({\n url: '/users',\n type: 'POST',\n dataType: 'json',\n data: userData,\n success: function success(res) {\n // Successfully signed user up, now log them in\n resetSignupForm();\n openLoginSignupModal('login');\n displayWelcomeMessage(res.username);\n },\n error: function error(err) {\n var message = err.responseJSON.message;\n var location = err.responseJSON.location;\n console.log(location + ': ' + message);\n show(LOGIN_SIGNUP_PAGE);\n displaySignupError(location, message);\n }\n });\n}", "title": "" }, { "docid": "759c8f335df7ee57958cd628a5a2c13d", "score": "0.66025484", "text": "function createNewUser(userData) {\n $.ajax({\n url: '/users',\n type: 'POST',\n dataType: 'json',\n data: userData,\n success: (res) => {\n // Successfully signed user up, now log them in\n resetSignupForm();\n openLoginSignupModal('login');\n displayWelcomeMessage(res.username);\n },\n error: (err) => {\n let message = err.responseJSON.message;\n let location = err.responseJSON.location;\n console.log(`${location}: ${message}`);\n show(LOGIN_SIGNUP_PAGE);\n displaySignupError(location, message);\n }\n });\n}", "title": "" }, { "docid": "709b8a699977cabd9b6f4d0a0c4ee8ed", "score": "0.6602332", "text": "function createUser(req, res) {\n var user = req.body;\n user.password = bcrypt.hashSync(user.password);\n userModel.createUser(user)\n .then(function (user) {\n console.log(user);\n res.json(user);\n })\n\n }", "title": "" }, { "docid": "e45eb0f68c3a28379a490bce476bf43b", "score": "0.65990895", "text": "async createUser({ body }, res) {\n\n const user = await User.create(body);\n\n if (!user) {\n return res.status(400).json({ message: 'User not created' });\n }\n const token = signToken(user);\n res.json({ token, user });\n }", "title": "" }, { "docid": "fd6ce32ced328e3032b6b2c2ceae3541", "score": "0.6596895", "text": "static async createAdminUser(req, res) {\r\n try {\r\n const userFromBody = req.body;\r\n let errors = {};\r\n if (userFromBody && userFromBody.password.length < 8) {\r\n errors.password = \"Your password must be at least 8 characters.\";\r\n }\r\n if (userFromBody && userFromBody.name.length < 3) {\r\n errors.name = \"You must specify a name of at least 3 characters.\";\r\n }\r\n\r\n if (Object.keys(errors).length > 0) {\r\n res.status(400).json(errors);\r\n return;\r\n }\r\n\r\n const userInfo = {\r\n ...userFromBody,\r\n password: await hashPassword(userFromBody.password)\r\n };\r\n\r\n const insertResult = await UsersDAO.addUser(userInfo);\r\n if (!insertResult.success) {\r\n errors.email = insertResult.error;\r\n }\r\n\r\n if (Object.keys(errors).length > 0) {\r\n res.status(400).json(errors);\r\n return;\r\n }\r\n\r\n // const makeAdminResponse = await UsersDAO.makeAdmin(userFromBody.email);\r\n\r\n const userFromDB = await UsersDAO.getUser(userFromBody.email);\r\n if (!userFromDB) {\r\n errors.general = \"Internal error, please try again later\";\r\n }\r\n\r\n if (Object.keys(errors).length > 0) {\r\n res.status(400).json(errors);\r\n return;\r\n }\r\n\r\n const user = new UserModel(userFromDB);\r\n const jwt = user.encoded();\r\n const loginResponse = await UsersDAO.loginUser(user.email, jwt);\r\n\r\n res.json({\r\n auth_token: jwt,\r\n info: user.toJson()\r\n });\r\n } catch (e) {\r\n res.status(500).json(e);\r\n }\r\n }", "title": "" }, { "docid": "299b1e6e6b06096aaa65bec62f651eb4", "score": "0.6594756", "text": "async register(e) {\n\t\te.preventDefault();\n\n\t\ttry {\n\t\t\t// Validate inputs\n\t\t\tlet username = this.state.username.trim().toLowerCase();\n\t\t\tlet password = this.state.password.trim();\n\t\t\tlet firstname = this.state.firstname.trim().toLowerCase();\n\t\t\tlet lastname = this.state.lastname.trim().toLowerCase();\n\n\t\t\tfirstname = firstname.charAt(0).toUpperCase() + firstname.slice(1);\n\t\t\tlastname = lastname.charAt(0).toUpperCase() + lastname.slice(1);\n\n\t\t\tif (username.length === 0 || password.length === 0 || firstname.length === 0 || lastname.length === 0) throw new Error();\n\n\t\t\t// Prepare data and url\n\t\t\tconst data = JSON.stringify({\n\t\t\t\t\"username\": username,\n\t\t\t\t\"password\": password,\n\t\t\t\t\"firstname\": firstname,\n\t\t\t\t\"lastname\": lastname\n\t\t\t});\n\t\t\tconst url = `${process.env.REACT_APP_post_register_url}`;\n\n\t\t\t// Fire POST request\n\t\t\tconst resp = await post(url, data);\n\n\t\t\t// On 200 status\n\t\t\tif (resp.status === 200) {\n\t\t\t\tconst id = await resp.json();\n\n\t\t\t\t// Instantiate User\n\t\t\t\tconst user = new User(\n\t\t\t\t\tid,\n\t\t\t\t\tusername,\n\t\t\t\t\tfirstname,\n\t\t\t\t\tlastname,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[]\n\t\t\t\t);\n\n\t\t\t\t// Set user session\n\t\t\t\tsetSession(user);\n\n\t\t\t\t// Redirect to home\n\t\t\t\tthis.props.history.push(\"/\");\n\t\t\t}\n\n\t\t\t// On 500 status\n\t\t\tif (resp.status === 500) throw new Error();\n\t\t} catch (err) {\n\t\t\tthis.setState({ error: true });\n\t\t}\n\t}", "title": "" }, { "docid": "a69fb45d7963fd05a0a435d11da8c446", "score": "0.65936553", "text": "function newUserSuccess(user){\n console.log(\"Account Suceffully Created! You were automatically logged in.\")\n console.log(user);\n}", "title": "" }, { "docid": "ed8f43a427ddeec00869857200665556", "score": "0.65852916", "text": "create(request, response) {\n let user = new User(request.body)\n user.save()\n .then(result => response.json(result))\n .catch(error => response.json(error))\n }", "title": "" }, { "docid": "1dff5174246f2548b781063e50efc46d", "score": "0.65846676", "text": "createUser(username, password, confirmation, callbacks) {\n this.request({\n url: Users.ROOT,\n method: 'POST',\n data: {\n username: username,\n password: password,\n password_confirmation: confirmation\n },\n callbacks: callbacks\n });\n }", "title": "" }, { "docid": "ed3a70af185bb4e2ba61932005434404", "score": "0.6584019", "text": "function userCreate(firstName, lastName, userName, password) {\n var userDetail = { firstName, lastName, userName, password };\n var user = new User(userDetail);\n return user.save();\n}", "title": "" }, { "docid": "996c9027f69213184f915088eecd443a", "score": "0.65807766", "text": "function register(req, res, next) {\n console.log(\"WE'RE TELLING THE DATABASE TO SAVE A USER\");\n userService.addUser(req.body)\n .then(() => res.json({}))\n .catch(err => next(err));\n}", "title": "" }, { "docid": "d9a7bcb99076ba1b5f48081c52d43c4b", "score": "0.65774125", "text": "function createUser(req, res, next) {\n if (!req.body.password) {\n return res.status(422).send('Missing required fields')\n }\n User\n .create(req.body)\n .then(function(user) {\n res.json({\n success: true,\n message: 'Successfully created user.',\n data: {\n email: user.email,\n id: user._id\n }\n })\n }).catch(function(err) {\n if (err.message.match(/E11000/)) {\n err.status = 409\n } else {\n err.status = 422\n }\n next(err)\n })\n}", "title": "" }, { "docid": "60d53cafd2a80aa999d52d21db098de7", "score": "0.6577218", "text": "static create(req, res) {\n // To do : validation First\n const { firstname, lastname, othername, email, phoneNumber, passportUrl, password } = req.body;\n\n const user = new UserModel(\n firstname,\n lastname,\n othername,\n email,\n phoneNumber,\n passportUrl,\n password\n );\n\n const data = UserModel.Save(user);\n if (data) {\n return res.status(201).json({\n status: 201,\n data: [data]\n });\n }\n\n return res.status(500).json({\n status: 500,\n message: 'something went wrong while trying to save your data'\n });\n }", "title": "" }, { "docid": "69e9954e1794d138f691d80a91f86364", "score": "0.6575559", "text": "createUser() {\n\n }", "title": "" }, { "docid": "a0319970eb9f4f1b69ce2975da039c47", "score": "0.6566588", "text": "function createUser(req, res, next) {\n\tnew Promise(function(resolve, reject) {\n\t\t// pop off user vars\n\t\tresolve(req.body)\n\t})\n\t.then(ensureUniqueLogin)\n\t.then(hashUserPassword)\n\t.then(generateUpi)\n\t.then(function(user) {\n\t\t// Load mongoose model\n\t\t// Takes in a req body user request (pojo)\n\t\t// outputs mongoose model with populated data\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\tvar User = models.user.model;\n\t\t\tu = new User(user);\n\t\t\tu.save(function(error, object, numAffected) {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t} else {\n\t\t\t\t\tresolve(object);\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}).then(function(user) {\n\t\t//get baked user vars\n\t\tlib.sanitizeReturn(user, function(err, safeVals) {\n\t\t\tres.locals.user = safeVals;\n\t\t\tnext();\n\t\t});\n\t}).catch(function(err) {\n\t\tnext(err);\n\t})\n}", "title": "" }, { "docid": "34d0417f9e0606efb99b1b1785c0ebe7", "score": "0.6563855", "text": "function createNewUser() {\n ctl.newUser.username = ctl.username;\n if (ctl.newUser.save()) {\n ProfileService.setCurrentUser(ctl.username);\n } else {\n Notifications.show({\n text: 'There was a problem saving this profile. Make sure the username is unique.'\n });\n }\n }", "title": "" }, { "docid": "dcc2befc6f5f4e34598318e8bf6c3677", "score": "0.6561508", "text": "function signUp(username, password, email, dob, city) {\n // create new user\n}", "title": "" }, { "docid": "de7bfa4ada1dc2da535d8f24555f3f67", "score": "0.6558549", "text": "create(req, res) {\n\t\tUser.sync({ force: false, logging: false })\n\t\t\t.then(function () {\n\t\t\t\tbcrypt.hash(req.body.password, 10, function (error, hash) {\n\t\t\t\t\tUser.create({\n\t\t\t\t\t\ttype: req.body.type,\n\t\t\t\t\t\tname: req.body.name,\n\t\t\t\t\t\temail: req.body.email,\n\t\t\t\t\t\ttel: req.body.tel,\n\t\t\t\t\t\tpassword: hash\n\t\t\t\t\t})\n\t\t\t\t\t.then(function (user) {\n\t\t\t\t\t\tres.status(200).json({ message: \"Användare skapades\" })\n\t\t\t\t\t})\n\t\t\t\t\t.catch(function (error) {\n\t\t\t\t\t\tres.status(500).json({ error: error })\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t})\n\t\t\t.catch(function (error) {\n\t\t\t\tres.status(500).json({ error: error })\n\t\t\t})\n\t}", "title": "" }, { "docid": "8921e7ae66980e51c336ccd5f448c6ff", "score": "0.65513045", "text": "async createUser(req, reply) {\n\t\tconsole.log(\"createUser\", req.params);\n\t\treturn { key: \"value\" };\n\t}", "title": "" }, { "docid": "39d778671f6f20ac5f55707c5fa707e5", "score": "0.6547926", "text": "function createUser(req, res) {\n//this creates a variable that will be used to encrypt the user's entered password\n const salt = bcrypt.genSaltSync();\n//this generates the hash that will be a combination of the user's entered password and the freshly\n//generated salt\n const hash = bcrypt.hashSync(req.body.password, salt);\n//this is the database method that creates a user\n return models.User.create({\n//these are the columns in the table\n username: req.body.username,\n password: hash,\n firstName: req.body.firstName,\n lastName: req.body.lastName,\n email: req.body.email,\n dob: req.body.dob\n//then the user is redirected to the homepage\n }).then(() => {\n res.redirect('/');\n });\n}", "title": "" }, { "docid": "714e02a0eb98a57381ccf8283ff5fbfe", "score": "0.65467626", "text": "function createUser(req, res, context) {\n\n // context = \"registration\" || \"admin\"\n if (context == \"admin\") {\n checkUser(req, res);\n }\n\n var passwordHash = \"\";\n\n // generate password hash\n if (req.body.password) {\n var salt = bcrypt.genSaltSync(10);\n passwordHash = bcrypt.hashSync(req.body.password, salt);\n }\n\n // Create a User\n const user = {\n email: req.body.email,\n passwordHash: passwordHash\n };\n\n // Save Tutorial in the database\n User.create(user)\n .then(data => {\n res.status(200).send(data);\n })\n .catch(err => {\n //res.statusCode = 500;\n res.status(500).send({\n message:\n err.message || \"Some error occurred while creating the User.\"\n });\n });\n}", "title": "" } ]
9bc50d334268d95b7cb36f6ec0fa2e6c
Use For Chat Box
[ { "docid": "30be368ba17669f59cb3403dab19ca3b", "score": "0.0", "text": "function UserChatOpen(id, name, status) {\n let chatModule = [...chats]\n\n for (let k = 0; k < 6; k++) {\n chatModule[k].isActive = false\n } // Enable All Option First\n chatModule[id - 1].isActive = true\n\n let msg = [\n { id: '39', isRight: true, name: 'Henry Wells', message: 'How are you ?', time: '10:07' },\n { id: '40', isRight: false, name: name, message: 'I am fine, What about you ?', time: '10:09' },\n ]\n setChat_Box_Username(name)\n setChat_Box_User_Status(status)\n setmessages(msg)\n setchats(chatModule)\n }", "title": "" } ]
[ { "docid": "6ab3d88cd8f0ca4465b77954749d7848", "score": "0.74511945", "text": "function chat()\n{ \n var textfield = $(\"#textfield\");\n var element = $(\"#chattext\");\n \n if(textfield.val()!=\"\"){\n var message = $('<div id=\"chatbubble\" name=\"bubble\"></div>');\t\n message.attr(\"class\", \"chatMessage playerbubble fade-in-element\");\t\t\n message.append(getPlayerName());\n message.append(\" \");\n\n var msgBody = textfield.val();\n //msgBody = replaceEmotes(msgBody);\n\t\tmsgBody = replaceEmoticons(msgBody);\t\t\n\t\tvar msgBodyDiv = $('<div class=\"playertext\">' + msgBody +'</div>');\n\t\tmessage.append(msgBodyDiv);\n \n textfield.val(\"\");\n \n element.append(message);\n\t\tplReply = msgBody;\n\t\tif (chatTarget == \"demon\"){\n\t\t\tdForceSpam();\n\t\t\t//dKeepSpamming();\n\t\t}\n\t\t\n\t\tif (chatTarget == \"webcam\"){\n\t\t\tstrToArray(msgBody);\n\t\t}\n\t\t\n\t\t//msgCommand = \"the \" + msgBody;\n\t\t//searchCommandWords(msgCommand);\n\t\t\n\t\tscrollToBottom();\n\t\tcutTopOfChat();\n }\n}", "title": "" }, { "docid": "e439b677b2c6c3fae5153d49212ea82c", "score": "0.72427064", "text": "function initChat() {}", "title": "" }, { "docid": "f435236f5f38f35720d0a696d9fe8057", "score": "0.7167268", "text": "function createChatBox() {\n var chatBox = ui.chatBox = {\n incoming: gebi(\"ecchat-incoming\"),\n outgoing: gebi(\"ecchat-outgoing\")\n };\n var outgoing = chatBox.outgoing;\n\n // Make outgoing work\n function handleOutgoing() {\n // Send this message\n sendChat(outgoing.value);\n recvChat(\"You: \" + outgoing.value);\n outgoing.value = \"\";\n }\n gebi(\"ecchat-outgoing-b\").onclick = handleOutgoing;\n}", "title": "" }, { "docid": "a9a7e9681e8a06137d3a7b196a6f436a", "score": "0.71237636", "text": "function recvChat(text) {\n togglePanel(\"chat\", true);\n var line = dce(\"div\");\n line.innerText = text;\n ui.chatBox.incoming.appendChild(line);\n ui.chatBox.incoming.scroll(0, 1000000);\n}", "title": "" }, { "docid": "01a4505bc618dbe21056d7c77c90fdc7", "score": "0.71091694", "text": "function SendChatMessage() {\n\t\n\t\tvar chat_input_msg = $('.livechatMsg').val();\n\t\t\n\t\tif( chat_input_msg == \"\" ) {\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\toutput_window.append( \"<li><span class='name' style='color: red;'>\" + default_user + \"</span>: <span class='message'>\" + chat_input_msg +\"</span></li>\" );\n\t\t\t$(\".livechatListArea\").stop().animate({ scrollTop: $( \".livechatListArea\" )[ 0 ].scrollHeight }, 1000 );\n\t\t\t$('.livechatMsg').val( '' );\n\t\t}\n\t\t\n\t\tsetTimeout( function(){ CheckChatMessage( chat_input_msg ); }, 6500 );\n\t\t\t\n\t}", "title": "" }, { "docid": "1dc0e126bb6ec37d4b6a40f1f3f971aa", "score": "0.7094252", "text": "function chat(){\n \n}", "title": "" }, { "docid": "6787424306feee39778b0407084658c6", "score": "0.70583624", "text": "function textChatOffline() {\n let chatText = document.getElementById('chat_input').value\n let message = '<b>' + 'Me' + ':</b> ' + chatText\n writeMessage(message);\n dataStruct.addMessage(message)\n}", "title": "" }, { "docid": "03c1f8cfa688c1275645155b5915dfe1", "score": "0.70179063", "text": "function userChat() {\n\n // Find where the user is inputing text.\n compose_area = document.getElementById('composer');\n\n // Set the user as the sender of the next message.\n nextMessage.sender = \"user\";\n\n // Get the user's input in the compose_area and clear the compose_area.\n nextMessage.message = compose_area.value;\n compose_area.value = \"\";\n\n // Send user's message.\n send(nextMessage.sender, nextMessage.message);\n\n // Count 1 more chat that the user has sent.\n userCount += 1;\n\n // Ask the bot for another chat.\n lookForChat();\n}", "title": "" }, { "docid": "c6321e45d9deb36ed2d7021c052ca858", "score": "0.70033884", "text": "function newMessage(snap) {\n var $console = $('#console');\n var $chat = $('#chat');\n var txt = snap;\n var prefix = txt.substring(17, 18);\n var prefix2 = txt.substring(17, 25)\n var time = txt.substring(2, 9);\n if (prefix == \"<\") {\n var msg = txt.substring(16);\n var name = txt.substring(txt.lastIndexOf(\"<\")+1,txt.lastIndexOf(\">\"));\n $('<li class=\"collection-item flow-text\" /> ').html(\"<span class='badge'>[\" + time + \"]</span>\" + \" <strong>\" + name + \"</strong>: \" + msg).appendTo($chat);\n } else if (prefix2 == \"[Server]\") {\n msg = txt.substring(26);\n $('<li class=\"collection-item flow-text\" /> ').html(\"<span class='badge'>[\" + time + \"]</span>\" + \" <strong class='server-chat'>Server</strong>: \" + msg).appendTo($chat);\n } else {\n $('<li class=\"collection-item flow-text\" /> ').text(txt).appendTo($console);\n }\n $console.scrollTop($console[0].scrollHeight);\n $chat.scrollTop($chat[0].scrollHeight);\n }", "title": "" }, { "docid": "a2bc98b693e21feb91be0cf293357f5e", "score": "0.6973164", "text": "function sendChatText() {\n scrollBottom(50);\n let chatText = document.getElementById('chat_input').value;\n //send the chat message\n chat.emit('chat', roomNo, name, chatText);\n}", "title": "" }, { "docid": "94dcf35a9f24e6c35b1342338bf77035", "score": "0.6894894", "text": "function sendMessage() {\n if ($(\".chat-input__input\").val() != \"\") {\n var templateSend = $(\"ul.template .chat__li--send\").clone();\n var msg = $(\".chat-input__input\").val();\n clock = getTime();\n\n $(\".chat-input__input\").val(\"\");\n $(\".chat-input__send\").addClass(\"d_none\");\n $(\".chat-input__microphone\").removeClass(\"d_none\");\n\n if (isLonger(msg, 35)) {\n templateSend.addClass(\"word-brake\");\n }\n\n templateSend.prepend(msg);\n templateSend.children(\"span.time\").text(clock);\n templateSend.appendTo(\"ul.chat.active\");\n\n var index = $(\"ul.chat.active\").attr(\"data-chat\");\n\n $(\".chat-prew__li[data-prew=\" + index + \"] .chat-prew__li__name h6\").text(msg);\n $(\".header-right__name[data-chat=\" + index + \"] h6\").text(\"sta scrivendo...\");\n\n scrollToBottom(900);\n\n var delay = randomNumber(800, 3000);\n recMessage(\"ok\", delay, index);\n }\n}", "title": "" }, { "docid": "7b94a89838e69544cd9c7b74a54f59bc", "score": "0.68727314", "text": "function addChatMessage (data, options) {\n // Don't fade the message in if there is an 'X was typing'\n\t var return_command;\n var $typingMessages = getTypingMessages(data);\n options = options || {};\n if ($typingMessages.length !== 0) {\n options.fade = false;\n $typingMessages.remove();\n }\n var $iconeDiv = $('<span class=\"icon\"/>');\n //console.log(data.rang);\n if(data.username != \"<Server>\"){\n if (data.rang>=0) {\n if (data.rang>=1) {\n $iconeDiv.html('<img src=\"images/rang/lvl-'+data.rang+'.png\" />');\n }\n } else {\n if (lvl>=1) {\n $iconeDiv.html('<img src=\"images/rang/lvl-'+lvl+'.png\" />');\n }\n }}\n \n var $usernameDiv = $('<span class=\"username\"/>')\n .text(data.username+\" :\")\n .css('color', getUsernameColor(data.username));\n\n\t data.message = addSmiley(data.message);\n\n\t var $messageBodyDiv = $('<span class=\"messageBody\">')\n\t\t .html(data.message);\n\n\t var $adminDiv;\n\t if(lvl>=2){\n\t \t$adminDiv = $('<span class=\"adminDiv\">').html(\"Delete\");\n\t } else {\n\t \t$adminDiv = \"\";\n\t }\n //return_command = {post: true};\n //console.log($messageBodyDiv);\n\n var typingClass = data.typing ? 'typing' : '';\n var CDate = new Date();\n CDate = CDate.getHours()+\":\"+CDate.getMinutes()+\":\"+CDate.getSeconds();\n var $dateDiv = $('<span class=\"dateDiv\">').html(CDate);\n\n if(data.mention){\n if (data.id) {\n data.id = \"-\"+data.id;\n var $messageDiv = $('<li class=\"message'+data.id+' mention\"/>')\n .data('username', data.username)\n .addClass(typingClass)\n .append($iconeDiv,$usernameDiv, $messageBodyDiv, $dateDiv, $adminDiv);\n playsound(\"mention\");\n }\n } else {\n if(data.id){\n data.id = \"-\"+data.id;\n var $messageDiv = $('<li class=\"message'+data.id+'\"/>')\n .data('username', data.username)\n .addClass(typingClass)\n .append($iconeDiv,$usernameDiv, $messageBodyDiv, $dateDiv, $adminDiv);\n } else {\n var $messageDiv = $('<li class=\"message\"/>')\n .data('username', data.username)\n .addClass(typingClass)\n .append($iconeDiv,$usernameDiv, $messageBodyDiv, $dateDiv, $adminDiv);\n }\n }\n addMessageElement($messageDiv, options);\n }", "title": "" }, { "docid": "6cd37a869bc300c02581a52ca6cec809", "score": "0.68713504", "text": "function displayChatMessage(name, text) {\n $('<div/>').text(text).prepend($('<strong/>').text(name+': ')).appendTo($('.chat'));\n $('.chat')[0].scrollTop = $('.chat')[0].scrollHeight;\n }", "title": "" }, { "docid": "9f376729e7d722f49eea0cb1b4460bde", "score": "0.6857643", "text": "function displayChatMessage(name, text) {\n var obj = document.getElementById(\"chatroom\");\n var txt = document.createTextNode(name + \" : \" + text + \"\\n\");\n obj.appendChild(txt);\n obj.scrollTop = obj.scrollHeight;\n }", "title": "" }, { "docid": "361c080e4c7dabcc6630e9032165aefd", "score": "0.6843011", "text": "initializeChat () {\n const msg = {\n username: 'Chatterize',\n data: 'Welcome to chatterize!'\n }\n const msg2 = {\n username: 'Chatterize',\n data: 'Connecting to server..'\n }\n this.displayMessage(msg)\n this.displayMessage(msg2)\n\n // If no active user, show settings for username / channel input\n if (!this.checkActiveUser()) {\n this.displaySettings()\n // Otherwise show latest used channel with latest used username\n } else {\n this.displayMessageInput()\n this.shadowRoot.getElementById('username').value = this._username\n this.shadowRoot.getElementById('channel').value = this._channel\n }\n }", "title": "" }, { "docid": "9cdd5204e7ee3177b4afe15aee34f1af", "score": "0.6826007", "text": "function receivedMsg(sender, msg) {\n var newmsg = document.createElement(\"p\")\n var msgcolor = ''\n\n if (sender.includes(\"Player\"))\n msgcolor = 'text-primary'\n else\n msgcolor ='text-info'\n\n newmsg.className = \"border mb-0 \" + msgcolor\n newmsg.innerHTML = sender + \": \" + msg;\n msgcontainer.append(newmsg)\n msgcontainer.scrollTop = msgcontainer.scrollHeight;\n}", "title": "" }, { "docid": "d8ca42a6906df34c9614bfa0b1761ccb", "score": "0.6799283", "text": "function renderNewMessage(chat, msg){\n\tchat.find(\".chatBox\").append(msg);\n\tchat.find(\".chatBox\").attr({ scrollTop: chat.find(\".chatBox\").attr(\"scrollHeight\") });\n }", "title": "" }, { "docid": "d6515c46000178a387bd6f6b458aa557", "score": "0.6798329", "text": "function showMessageReceiver(message) {\n //display user message in given html format\n messages.innerHTML +=\n \"<div class='space'>\" +\n \"<div class='message-container receiver notranslate'>\" +\n `<p>${message}</p>` +\n \"</div>\" +\n \"</div>\"\n}", "title": "" }, { "docid": "7cc9665094a4be70d9784287be5a3a90", "score": "0.67957485", "text": "function post(e) {\n var\n user = $chatuser.val().replace(/[^\\w]/g,''),\n text = $messagebox.val();\n if (text) {\n if (user) {\n tilde.send('chat-stream', {\n user: $chatuser.val().substr(0, 26),\n text: text.substr(0, 140)\n });\n $messagebox.val('');\n } else {\n \n }\n }\n }", "title": "" }, { "docid": "a52f2582e56ecab166cf81f6a1b06ce3", "score": "0.67752135", "text": "function openchat(){setTimeout(function(){\n var chatbox = document.getElementById(\"chatbox_support\");\n if (chatbox.style.display === \"none\" || chatbox.style.display === '')\n {chatbox.style.display=\"block\";} else{\n chatbox.style.display=\"none\";}\n }, 100);}", "title": "" }, { "docid": "2d42d23ef19aad3d9072e562c3250cba", "score": "0.6773017", "text": "function renderMessage( message, sender ) {\n var chatMessage = '<blockquote class=\"blockquote-message\"><p>'+ message +'</p><footer>'+ sender +'</footer></blockquote>';\n $('#chat').append( chatMessage );\n }", "title": "" }, { "docid": "3c26eb2265b926f63d2133b7c76c8c28", "score": "0.67647594", "text": "function sendMessage() {\n //create div bubble with current user's input\n let chatcontainer = document.getElementById(\"chat-container\");\n let chatbox = document.getElementsByClassName(\"chatbox\");\n let chatinput = document.getElementById(\"chat-input\");\n let chatbubble = document.createElement(\"div\");\n\n //Create chatbubble div that will house the user's input\n chatbubble.className = \"container darker\";\n let image = document.createElement(\"img\");\n image.src = \"avatarstock.png\";\n image.alt = \"Avatar\";\n image.className = \"right\";\n\n let text = document.createElement(\"p\");\n let textnode = document.createTextNode(chatinput.value);\n text.appendChild(textnode);\n\n let time = document.createElement(\"span\");\n time.className = \"time-left\";\n let d = new Date();\n let e = formatDate(d);\n let timenode = document.createTextNode(e);\n time.appendChild(timenode);\n\n //put components of chat bubble together\n chatbubble.appendChild(image);\n chatbubble.appendChild(text);\n chatbubble.appendChild(time);\n\n //Insert message into stream\n chatcontainer.insertBefore(chatbubble, chatbox[0]);\n\n //Clear message from chatbox on submit\n document.getElementById(\"chat-input\").value = \"\";\n}", "title": "" }, { "docid": "f19eefe58a16930709c618e205060b63", "score": "0.675392", "text": "function addChatMessage (data, options) {\n // Don't fade the message in if there is an 'X was typing'\n var $typingMessages = getTypingMessages(data);\n options = options || {};\n if ($typingMessages.length !== 0) {\n options.fade = false;\n $typingMessages.forEach(function(i){\n i.parentNode.removeChild(i);\n })\n }\n\n var $usernameDiv = document.createElement(\"span\");\n $usernameDiv.classList.add(\"username\");\n $usernameDiv.style.color = getUsernameColor(data.username);\n $usernameDiv.innerText = data.username;\n var $messageBodyDiv = document.createElement(\"span\");\n $messageBodyDiv.classList.add(\"messageBody\");\n if(data.message.match(\"^https?://.*\")){\n $messageBodyDiv.innerHTML = \"<a target='_blank' href='\"+data.message+\"'>\"+data.message+\"</a>\"\n }else if(data.message.match(\"^audio:https?://.*\")){\n var src = data.message.substring(6);\n $messageBodyDiv.innerHTML = '<audio controls=\"\" autoplay=\"autoplay\"><source src=\"'+src+'\"></audio>'\n }else if(data.message.match(\"^video:https?://.*\")){\n var src = data.message.substring(6);\n $messageBodyDiv.innerHTML = '<video controls=\"\" autoplay=\"autoplay\" width=\"320\"><source src=\"'+src+'\" type=\"video/mp4\"></video>';\n }else if(data.message.match(\"^image:https?://.*\")){\n var src = data.message.substring(6);\n $messageBodyDiv.innerHTML = '<image src=\"'+src+'\" width=\"320\"/>';\n }else{\n // Use `innerText` Prevents input from having injected markup\n $messageBodyDiv.innerText = data.message;\n }\n\n var typingClass = data.typing ? 'typing' : '';\n var $messageDiv = document.createElement(\"div\");\n $messageDiv.setAttribute(\"data-username\",data.username);\n $messageDiv.classList.add(\"message\");\n if(typingClass){\n $messageDiv.classList.add(typingClass);\n }\n $messageDiv.append($usernameDiv, $messageBodyDiv);\n addMessageElement($messageDiv, options);\n }", "title": "" }, { "docid": "fdbde30d4495f5e74e0907ea6595e67c", "score": "0.674737", "text": "function setup_chatbox_demo() {\n\t\t\n\t\t/* message id */\n\t\tvar id = 0;\n\t\t\n\t\t$.istying.focus(function() {\n\t\t\t$('.type-effect').show();\n\t\t});\n\t\n\t\t$.istying.blur(function() {\n\t\t\t$('.type-effect').hide();\n\t\t});\n\t\n\t\t/* on button press */\n\t\t$('#send-msg-js').click(function() {\n\t\t\tvar msg_input = $.istying.val();\n\t\t\tif (msg_input.length) {\n\t\t\t\tvar msg_input = $.istying.val();\n\t\t\t\tid++;\n\t\t\t\t$('.tab-pane.active > div > .chat-messages').prepend('<p id=\"message-dynamic-' + id + '\" class=\"message-box you\"><img src=\"img/avatar/avatar_0.jpg\" alt=\"\"><span class=\"message\"><strong>Me</strong><span class=\"message-time\">by Victoria at 14:25pm, 4th Jan 2013</span><span class=\"message-text\">' + msg_input + '</span></span></p>')\n\t\t\t\t$('.tab-pane.active > div > .chat-messages #message-dynamic-' + id).hide().fadeIn(750);\n\t\t\t\tconsole.log(msg_input.trim() + id);\n\t\t\t\t$.istying.val('');\n\t\t\t}\n\t\t\treturn false; \n\t\n\t\t});\n\t\n\t\t/* on key press enter */\n\t\t$.istying.on('keyup', function(e) {\n\t\t\t\n\t\t\tif (e.keyCode == 13) {\n\t\t\t\tvar msg_input = $.istying.val();\n\t\t\t\tif (msg_input.length) {\n\t\t\t\t\tvar msg_input = $.istying.val();\n\t\t\t\t\tid++;\n\t\t\t\t\t$('.tab-pane.active > div > .chat-messages').prepend('<p id=\"message-dynamic-' + id + '\" class=\"message-box you\"><img src=\"img/avatar/avatar_0.jpg\" alt=\"\"><span class=\"message\"><strong>Me</strong><span class=\"message-time\">by Victoria at 14:25pm, 4th Jan 2013</span><span class=\"message-text\">' + msg_input + '</span></span></p>')\n\t\t\t\t\t$('.tab-pane.active > div > .chat-messages #message-dynamic-' + id).hide().fadeIn(750);\n\t\t\t\t\tconsole.log(msg_input.trim() + id);\n\t\t\t\t\t$.istying.val('');\n\t\t\t\t}\n\t\t\t}// end if\n\t\t});\n\t\n\t}", "title": "" }, { "docid": "62748738b5f912831d20e012ab601241", "score": "0.6745196", "text": "function chat_received(data) {\n var username = \"<p class=\\\"chat_name\\\"><font color=\" + data.color + \">\" + data.username + \"</font></p>\";\n var time = \"<p class=\\\"chat_time\\\">\" + data.time + \"</p>\";\n var content = \"<p class=\\\"chat_content\\\">\" + data.content + \"</p>\";\n var chat_entry = \"<div class=\\\"chat_entry\\\">\" + username + time + content + \"</div>\";\n\n $(\"#message_box\").append(chat_entry);\n $(\"#message_box\").get(0).scrollTop = $(\"#message_box\").get(0).scrollHeight; // scroll the chat box\n}", "title": "" }, { "docid": "d784c5f8dfebeb2443261543d96c1029", "score": "0.6745181", "text": "function send_text(){\n\tif(document.getElementById(\"input_message\").value){\n\t\tsocket.emit(\"chat\",{\n\t\t\tmessage: document.getElementById(\"input_message\").value,\n\t\t\tsender: id,\n\t\t\ttype: \"text\",\n\t\t\tsend_count: send_count\n\t\t});\n\t\t// template for sender message || right\n\t\tvar tmp = document.getElementById(\"right-template\");\n\t\tvar box = document.getElementById(\"chat-box\");\n\t\t// insert new right message into chatbox \n\t\tbox.insertBefore(tmp.content.cloneNode(true),box.getElementsByClassName(\"null\")[0]);\n\t\tvar right= box.getElementsByClassName(\"null\")[0].previousElementSibling;\n\t\tright.getElementsByClassName(\"right-text-span\")[0].innerHTML=document.getElementById(\"input_message\").value+'<br/><span class=\"right-text-time\">00:00</span>';\n\t\t// change class name of chat-bubble- element || initially nothing || to identify by send_count\n\t\ty=right.getElementsByClassName(\"chat-bubble- material-icons\")[0];\n\t\ty.classList.remove('chat-bubble-');\n\t\ty.classList.add('chat-bubble-'+send_count);\n\t\tundo_text();\n\t\tgotoBottom(\"chat-box\");\n\t\tsend_count++;\n\t}\n}", "title": "" }, { "docid": "d37066fded346a1de1b005ef1f420c79", "score": "0.67304635", "text": "function appendChat(msg){\n\tvar chatmsgSpan = document.createElement(\"SPAN\");\n\tchatmsgSpan.innerHTML = \"<b>Server: </b>\" + msg.toString() + \"<br/>\";\n\tchatWindow.appendChild(chatmsgSpan);\n\tchatmsgSpan.focus();\n}", "title": "" }, { "docid": "33232b609592b6224768696db7a92598", "score": "0.6720681", "text": "function ChatRoomSendChat() {\n\tvar msg = DialogGarble(Player, ElementValue(\"InputChat\").trim());\n\tif (msg != \"\") ServerSend(\"ChatRoomChat\", { Content: msg, Type: \"Chat\" } );\n\tElementValue(\"InputChat\", \"\");\n}", "title": "" }, { "docid": "31e8ae02d8d69b5213d75fbc7a2a6bb8", "score": "0.671886", "text": "function receiveMsg(data)\n{\n msg = data[\"msg\"];\n var chatBox = document.getElementById('chatBox');\n \n chatBox.value += msg + \"\\n\";\n chatBox.scrollTop = chatBox.scrollHeight; //set to bottom of chatbox\n}", "title": "" }, { "docid": "634be1211928531a36939b8f523c5d76", "score": "0.6707977", "text": "function displayMessage(message)\n{\n let alert_sound = document.getElementById(\"chat-alert-sound\");\n if($(\"#current_user\").val() == message.from_user_id) {\n let messageLine = getMessageSenderHtml(message);\n $(\"#chat_box_\" + message.to_user_id).find(\".chat-area\").append(messageLine);\n } else if($(\"#current_user\").val() == message.to_user_id) {\n alert_sound.play();\n // for the receiver user check if the chat box is already opened otherwise open it\n cloneChatBox(message.from_user_id, message.fromUserName, function () {\n let chatBox = $(\"#chat_box_\" + message.from_user_id);\n if(!chatBox.hasClass(\"chat-opened\")) {\n chatBox.addClass(\"chat-opened\").slideDown(\"fast\");\n loadLatestMessages(chatBox, message.from_user_id);\n chatBox.find(\".chat-area\").animate({scrollTop: chatBox.find(\".chat-area\").offset().top + chatBox.find(\".chat-area\").outerHeight(true)}, 800, 'swing');\n } else {\n let messageLine = getMessageReceiverHtml(message);\n // append the message for the receiver user\n $(\"#chat_box_\" + message.from_user_id).find(\".chat-area\").append(messageLine);\n }\n });\n }\n}", "title": "" }, { "docid": "d98b9adb0dd0ed4e7431cca12fe51b4c", "score": "0.6689352", "text": "function chat()\n {\n dispatch(setWindowState(CHAT)); \n dispatch(setClass(false)); \n }", "title": "" }, { "docid": "1090741e62646d30b8e504f8a0c4c31d", "score": "0.6688186", "text": "function mostraChat() {\n var indice = $(this).data(\"conv\");\n var imgCliccata, nomeCliccato, ultimoAccesso;\n listaContatti.removeClass(\"active\");\n $(this).addClass(\"active\");\n // salvo un riferimento alle info dell'utente cliccato\n imgCliccata = $(this).find(\".user-img\").html();\n nomeCliccato = $(this).find(\".preview-left h2\").text();\n ultimoAccesso = $(this).find(\".preview-right span\").text();\n conversazioni.removeClass(\"active\");\n $(\".chat-box[data-conv='\" + indice + \"']\").addClass(\"active\");\n // inserisco le info dell'utente cliccato nell'header della chat\n headerChat.find(\".user-img\").html(imgCliccata);\n headerChat.find(\".active-chat-info h2\").text(nomeCliccato);\n headerChat.find(\".active-chat-info h5\").text(\"Ultimo accesso oggi alle \" + ultimoAccesso);\n\n // scrolla all'ultimo msg\n scrollToEnd(chatContainer, $(\".chat-box.active\"));\n }", "title": "" }, { "docid": "87fccd48f884c3c33c325ee373f8dd65", "score": "0.66865236", "text": "function insertChat(who, text, time){\n if (time === undefined){\n time = 0;\n }\n var control = \"\";\n var date = formatAMPM(new Date());\n if (who == \"me\"){\n control = '<li style=\"width:100%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"avatar\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+ me.avatar +'\" /></div>' +\n '<div class=\"text text-l\">' +\n '<p>'+ text +'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</div>' +\n '</li>'; \n }else{\n control = '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>'+text+'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+you.avatar+'\" /></div>' + \n '</li>';\n }\n setTimeout(\n function(){ \n $(\".box-message\").append(control).scrollTop($(\".box-message\").prop('scrollHeight'));\n }, time);\n \n}", "title": "" }, { "docid": "87fccd48f884c3c33c325ee373f8dd65", "score": "0.66865236", "text": "function insertChat(who, text, time){\n if (time === undefined){\n time = 0;\n }\n var control = \"\";\n var date = formatAMPM(new Date());\n if (who == \"me\"){\n control = '<li style=\"width:100%\">' +\n '<div class=\"msj macro\">' +\n '<div class=\"avatar\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+ me.avatar +'\" /></div>' +\n '<div class=\"text text-l\">' +\n '<p>'+ text +'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '</div>' +\n '</li>'; \n }else{\n control = '<li style=\"width:100%;\">' +\n '<div class=\"msj-rta macro\">' +\n '<div class=\"text text-r\">' +\n '<p>'+text+'</p>' +\n '<p><small>'+date+'</small></p>' +\n '</div>' +\n '<div class=\"avatar\" style=\"padding:0px 0px 0px 10px !important\"><img class=\"img-circle\" style=\"width:100%;\" src=\"'+you.avatar+'\" /></div>' + \n '</li>';\n }\n setTimeout(\n function(){ \n $(\".box-message\").append(control).scrollTop($(\".box-message\").prop('scrollHeight'));\n }, time);\n \n}", "title": "" }, { "docid": "a193e91b08eeb8e2e13b35e0eb56250c", "score": "0.6674943", "text": "function displayMessage(msg, nick, timestamp){\n $('#roomMessages').append($('<p>').text(msg).append($('<div>').css({\n 'text-align': 'right',\n 'opacity': 0.4\n }).text('Sent by '+ nick + ' @ ' + timestamp)));\n }", "title": "" }, { "docid": "c73212cb20576c6b75628efa7cfe7ec4", "score": "0.6674507", "text": "function writeChat(chatArea, name, msg){\n\t\tif (chatArea.is(\":visible\") == false){\t\t// Checks for display:[none|block]\n\t\t\tchatArea.val(\"\");\n\t\t\tchatArea.show();\n\t\t}\n\t\t\n\t\tvar curText = chatArea.val();\n \tchatArea.val(curText + \"\\n\" + name + \": \" + msg);\t\t\t// Output to Chat\n \ttimeLastShown_Chat = new Date().valueOf();\n chatArea.scrollTop(99999);\n\t}", "title": "" }, { "docid": "f2db62035b63ba2155254f629da766a6", "score": "0.66598785", "text": "function handle_message(message){\n var from = $(message).attr(\"from\");\n var body = $(message).children(\"body\").text();\n $(\"#chat_area\").prepend(\"<p>(\"+from+\"): \"+body+\"</p>\");\n //$(\"#chat-area\").prepend(\"<p>\"+body+\"</p>\");\n return true;\n}", "title": "" }, { "docid": "85d56fffee2b7d73343f3a12663623ac", "score": "0.664675", "text": "function sendChat (msg){\r\n $(document.querySelector(\"#mod_comm_input\")).val(msg);\r\n uW.Chat.sendChat ();\r\n}", "title": "" }, { "docid": "85d56fffee2b7d73343f3a12663623ac", "score": "0.664675", "text": "function sendChat (msg){\r\n $(document.querySelector(\"#mod_comm_input\")).val(msg);\r\n uW.Chat.sendChat ();\r\n}", "title": "" }, { "docid": "630799dc35a7a5b8179ff5b218a9bb08", "score": "0.6644991", "text": "function sendMsg() {\n\tvar msg = $('.group-enter').val();\n\t$('.group-enter').val('');\n\tif(msg!=''){\n\t\t\tvar username = 'John Snow';\n\t\t\tvar time = '3:00 PM';\n\t\t\tvar _htmlMsg = '<div class=\"chat-a-user chat-user\">You | <small>' + time + '</small></div><div class=\"chat-msg chat-a\">'+ msg +'</div>';\n\n\t\t\t$(_htmlMsg).insertBefore('.grp_msg_push');\n\t\t\t$('.grp-chat-box').scrollTop($('.grp-chat-box')[0].scrollHeight);\n\t}\n}", "title": "" }, { "docid": "eb493c50f13a279e9bd795f442d0795b", "score": "0.6637736", "text": "function sentMessage(){\r\n var inputText = $(\"#sent\").val();\r\n\r\n if(inputText != \"\"){\r\n var templateMessage = $(\".template .inside-chat\").clone();\r\n\r\n// cloud verde\r\n templateMessage.find(\".messaggio\").text(inputText);\r\n templateMessage.find(\".orario\").text(time);\r\n\r\n templateMessage.addClass(\"inviato\");\r\n\r\n $(\".container-chat.active\").append(templateMessage);\r\n\r\n // scrollbar\r\n var element = document.querySelector(\".container-chat.active .inside-chat:last-child\");\r\n\r\n element.scrollIntoView();\r\n // scrollbar\r\n\r\n// cloud risposta ogni secondo\r\n setTimeout(function(){\r\n var bot = [\"Ciao\", \"bene\", \"E tu?\", \"Che mi dici?\", \"Son content* per te!\", \"Gni\",\" Uffa\", \"Bleehh\", \"Seeee...ciaooo!\", \"Buongiorno\", \"Buonasera\", \"Eilàà\", \"Daaaiii???\", \"Anche secondo me!\", \"Non so quello... che preferisci\", \"OK!!!\", \"Mangiamo???\"];\r\n var ricevuto = $(\".template .inside-chat\").clone();\r\n\r\n $(\"#sent\").val(\"\");\r\n\r\n ricevuto.find(\".messaggio\").text(bot[random(0, 16)]);\r\n ricevuto.find(\".orario\").text(time);\r\n\r\n $(\".container-chat.active\").append(ricevuto);\r\n\r\n// scrollbar\r\n var element = document.querySelector(\".container-chat.active .inside-chat:last-child\");\r\n\r\n element.scrollIntoView();\r\n// /scrollbar\r\n\r\n }, 1000);\r\n\r\n }\r\n}", "title": "" }, { "docid": "1aacadbd18058d2f7e8989e3964188eb", "score": "0.66374904", "text": "function showonlychat(){\n activetab();\n mostrarChats();\n ocultarLlamadas();\n ocultarEstados();\n}", "title": "" }, { "docid": "c76e2a4a8a3b8957cc819107feef1f3d", "score": "0.6635532", "text": "function chat(msg) {\n $('<div/>').text(msg).appendTo('#log');\n }", "title": "" }, { "docid": "c6e9295a0c1c91c64e442f37363f456c", "score": "0.66347194", "text": "function loadChat(box){\n chat.innerHTML = \"\";\n \n for(let i = 0; i < box.length; i++){\n let className = username === box[i][0] ? \"myMess\" : \"messageItem\";\n chat.innerHTML += `\n <div class=\"${className} message-container\">\n <span>${box[i][0]}</span>\n <div>\n <p>${box[i][1]}</p>\n </div>\n </div>\n `;\n }\n chat.scrollTop = chat.scrollHeight;\n}", "title": "" }, { "docid": "efbef239c2bc76e532b2bce22c3dd0a8", "score": "0.6626702", "text": "function showUserMessage(msg){\n console.log('showUserMessage');\n $messages = $('.messages');\n message = new Message({\n text: msg,\n message_side: 'right'\n });\n message.draw();\n $messages.animate({ scrollTop: $messages.prop('scrollHeight') }, 300);\n $('#msg_input').val('');\n}", "title": "" }, { "docid": "5528fadfc0832da3cd7268d000ef498a", "score": "0.6626436", "text": "function enter_chat(source) {\nsource;\nvar message = $(\".message\").val();\nif (message != \"\") {\n var html =\n '<div class=\"chat-content\">' + \"<p>\" + message + \"</p>\" + \"</div>\";\n $(\".chat:last-child .chat-body\").append(html);\n $(\".message\").val(\"\");\n $(\".user-chats\").scrollTop($(\".user-chats > .chats\").height());\n}\n}", "title": "" }, { "docid": "755f971e917e7433e1451648907dfa73", "score": "0.66206944", "text": "function sendMessage() {\n\t \tvar msg = chatinput.val();\n\n\t \tif (!msg) {\n\t \t\treturn;\n\t \t}\n\n\t \tif (msg == 'clear') {\n\t \t\tchatcontent.text('');\n\t \t\tchatinput.val('');\n\t \t\treturn;\n\t \t}\n\n\t \tif (name != chatuser.val()) {\n\t \t\tnameChange();\n\t \t}\n\n\t \tsocket.emit('message', { text: msg, points: points });\n\t \tchatinput.val('');\n\t }", "title": "" }, { "docid": "ff066a31e2974449b59da99337a963af", "score": "0.66195047", "text": "function chatShow(boolish) {\n chatShush();\n CUI.show_id('chatWindow', boolish); // large screen panel\n if (CUI.is_visible('chatWindow')) {\n document.getElementById(\"cptext\").focus();\n }\n}", "title": "" }, { "docid": "1fc74eebe03c33b3a65b228bb3ac6cbc", "score": "0.66184247", "text": "function addChatMessage (data, options) {\n // Don't fade the message in if there is an 'X was typing'\n let $typingMessages = getTypingMessages(data);\n options = options || {};\n if ($typingMessages.length !== 0) {\n options.fade = false;\n $typingMessages.remove();\n }\n\n let $usernameDiv = $('<h6 class=\"media-heading\"/>')\n .text(data.username)\n .css('color', getUsernameColor(data.username));\n\n let $messageBodyContent = $('<small class=\"col-lg-10\">')\n .text(data.message);\n\n let $profileImage= $('<img class=\"media-object\" style=\"width: 32px; height: 32px;\" src=\"/assets/img/profile_1.jpg\">');\n let $profileBody = $('<a class=\"pull-left\" href=\"#\">')\n .append($profileImage);\n\n /**\n <a class=\"pull-left\" href=\"#\">\n <img class=\"media-object\" data-src=\"holder.js/64x64\" alt=\"64x64\" style=\"width: 32px; height: 32px;\" src=\"/assets/img/profile_1.jpg\">\n </a>\n **/\n\n let $messageBodyDiv = $('<div class=\"media-body message\">')\n .append($usernameDiv,$messageBodyContent);\n\n let typingClass = data.typing ? 'typing' : '';\n //let $layout = $('<div class=\"media msg\"/>')\n // .append($messageBodyContent);\n\n let $messageDiv = $('<div class=\"media msg message msg-linebreak\"/>')\n .data('username', data.username)\n .addClass(typingClass)\n .append($profileBody,$messageBodyDiv);\n\n\n/**\n <div class=\"media msg\">\n <a class=\"pull-left\" href=\"#\">\n <img class=\"media-object\" data-src=\"holder.js/64x64\" alt=\"64x64\" style=\"width: 32px; height: 32px;\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAACqUlEQVR4Xu2Y60tiURTFl48STFJMwkQjUTDtixq+Av93P6iBJFTgg1JL8QWBGT4QfDX7gDIyNE3nEBO6D0Rh9+5z9rprr19dTa/XW2KHl4YFYAfwCHAG7HAGgkOQKcAUYAowBZgCO6wAY5AxyBhkDDIGdxgC/M8QY5AxyBhkDDIGGYM7rIAyBgeDAYrFIkajEYxGIwKBAA4PDzckpd+322243W54PJ5P5f6Omh9tqiTAfD5HNpuFVqvFyckJms0m9vf3EY/H1/u9vb0hn89jsVj8kwDfUfNviisJ8PLygru7O4TDYVgsFtDh9Xo9NBrNes9cLgeTybThgKenJ1SrVXGf1WoVDup2u4jFYhiPx1I1P7XVBxcoCVCr1UBfTqcTrVYLe3t7OD8/x/HxsdiOPqNGo9Eo0un02gHkBhJmuVzC7/fj5uYGXq8XZ2dnop5Mzf8iwMPDAxqNBmw2GxwOBx4fHzGdTpFMJkVzNB7UGAmSSqU2RoDmnETQ6XQiOyKRiHCOSk0ZEZQcUKlU8Pz8LA5vNptRr9eFCJQBFHq//szG5eWlGA1ywOnpqQhBapoWPfl+vw+fzweXyyU+U635VRGUBOh0OigUCggGg8IFK/teXV3h/v4ew+Hwj/OQU4gUq/w4ODgQrkkkEmKEVGp+tXm6XkkAOngmk4HBYBAjQA6gEKRmyOL05GnR99vbW9jtdjEGdP319bUIR8oA+pnG5OLiQoghU5OElFlKAtCGr6+vKJfLmEwm64aosd/XbDbbyIBSqSSeNKU+HXzlnFAohKOjI6maMs0rO0B20590n7IDflIzMmdhAfiNEL8R4jdC/EZIJj235R6mAFOAKcAUYApsS6LL9MEUYAowBZgCTAGZ9NyWe5gCTAGmAFOAKbAtiS7TB1Ng1ynwDkxRe58vH3FfAAAAAElFTkSuQmCC\">\n </a>\n <div class=\"media-body\">\n <small class=\"pull-right time\"><i class=\"fa fa-clock-o\"></i> 12:10am</small>\n <h6 class=\"media-heading\">Naimish Sakhpara</h6>\n\n <small class=\"col-lg-10\">Arnab Goswami: \"Some people close to Congress Party and close to the government had a #secret #meeting in a farmhouse in Maharashtra in which Anna Hazare send some representatives and they had a meeting in the discussed how to go about this all fast and how eventually this will end.\"</small>\n </div>\n </div>\n**/\n\n addMessageElement($messageDiv, options);\n }", "title": "" }, { "docid": "cc74be0d469e203e90c8e4ac89fea55f", "score": "0.6612718", "text": "function mensajesChat(_mensajesIn,_name,_horas)\n{\n\tvar divchat= document.getElementById(\"chat\");\n\tvar htmlMensajeIn = '<div class=\"w-message w-message-out\">' +\n\t\t'<div class=\"w-message-text\">' +\n\t\t'<p>'+_mensajesIn+'</p>' +\n\t\t'<div class=\"time\">'+_horas+'</div>' +\n\t\t'</div>' +\n\t\t'</div>';\n\t\tdivchat.innerHTML += htmlMensajeIn;\n}", "title": "" }, { "docid": "3e772bbe4d23f216dadb5c35c06c3174", "score": "0.65952426", "text": "function openChat(\n/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\n /**\n * The event object. */\n event\n)\n/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\n{\n if (!event) {\n return false;\n }\n event.preventDefault();\n var cTarget, cX, cY;\n var jqWin = $(\"#boxes > div#chatInp\");\n /*\n * Get target. */\n cTarget = event.currentTarget;\n if ($(cTarget).hasClass(\"group\")) {\n $('span', jqWin).attr(\"id\", \"group\").text(\"Message to Group:\");\n }\n else if ($(cTarget).hasClass(\"feedback\")) {\n $('span', jqWin).attr(\"id\", \"feedback\").text(\"Feedback message:\");\n }\n else {\n var recipientId = $(cTarget).attr(\"id\");\n var recipient = $(cTarget).attr(\"title\");\n var ename = $(cTarget).attr(\"encname\");\n if (recipientId) {\n $('span', jqWin).attr(\"id\", recipientId).attr(\"ename\", ename)\n .text(\"Message to \" + recipient + \":\");\n }\n else {\n return false;\n }\n }\n /*\n * Click position. */\n cX = event.clientX;\n cY = event.clientY;\n /*\n * Transition effect. */\n var jqMask = $('#mask');\n jqMask.fadeIn(500, activateWindow(\"chatInp\"));\n jqMask.fadeTo(\"fast\", 0.3);\t\n /*\n * Position chat Inp. */\n var winW = $(window).width();\n var winH = $(window).height();\n var wcW = jqWin.outerWidth();\n var wcH = jqWin.outerHeight();\n if ((cY + wcH) > winH) {\n jqWin.css(\"top\", winH - wcH);\n }\n else {\n jqWin.css(\"top\", cY);\n }\n if ((cX + wcW) > winW) {\n jqWin.css(\"left\", winW - wcW);\n }\n else {\n jqWin.css(\"left\", cX);\n }\n /*\n * Activate window. */\n activateWindow(\"#chatInp\");\n /*\n * Transition effect for Chat Input Window.*/\n jqWin.fadeIn(700);\n /*\n * Add class active. */\n jqWin.addClass(\"active\");\n /*\n * Add focus to input text. */\n $(\"input.chatTo\", jqWin).focus();\n return false;\n}", "title": "" }, { "docid": "f0a977532ef860e2b7d6d3c47ecd5387", "score": "0.6579452", "text": "function sendMsg(){ \n ws.send(JSON.stringify({type: 'chat', msg: input.value, name: \"Player\" + id}))\n var newmsg = document.createElement(\"p\")\n newmsg.className = \"border mb-0 text-secondary\"\n newmsg.innerHTML = \"Player\" + id + \": \" + input.value;\n msgcontainer.append(newmsg)\n input.value = \"\";\n sendbtn.disabled = true\n msgcontainer.scrollTop = msgcontainer.scrollHeight;\n}", "title": "" }, { "docid": "5f18b1c92a009038ac1471142909dbb9", "score": "0.6565725", "text": "function startBot(){\n chatArea.innerHTML = '';\n document.getElementById('compose-area').style.display = 'block';\n}", "title": "" }, { "docid": "5da390a5972ebffd4ac81e6865da62de", "score": "0.65637577", "text": "function sendMessage(event){\n\n event.preventDefault();\n //get the current msg \n let chat_msg = inputRef.current.value\n console.log(chat_msg);\n //empting the chat bar\n inputRef.current.value = \"\"\n let chatMessages = document.querySelector('.chat-messages');\n\n //scroll to the top to the bar height \n chatMessages.scrollTop = chatMessages.scrollHeight;\n\n //emitting to server\n socket.emit('sendMsg',{message:chat_msg,myid:myid , fid:fid});\n // outputMessage(chat_msg)\n }", "title": "" }, { "docid": "c819d3c56780925a60ed084b281774a7", "score": "0.656245", "text": "function sendChatMessage(message) {\n dataStream.sendData({id:'chat',text:message, user:nameOfUser});\n $('#chatMessage').val(\"\");\n appendChatMessage(nameOfUser, message);\n $(\"#myTextBox\").focus();\n}", "title": "" }, { "docid": "08808a6e4d75ba1e74a54bef4a4f5566", "score": "0.6560625", "text": "function addMessage(from, target, text, img ,time) {\n\tvar name = (target == '*' ? 'all' : target);\n\tif(text === null) return;\n\tif(time == null) {\n\t\t// if the time is null or undefined, use the current time.\n\t\ttime = new Date();\n\t} else if((time instanceof Date) === false) {\n\t\t// if it's a timestamp, interpret it\n\t\ttime = new Date(time);\n\t}\n\n\t//var messageElement = $(document.createElement(\"div\"));\n\t//messageElement.addClass(\"row chat-row\");\n\t// sanitize\n\tif(from == LiveName){\n\t\ttext = util.toStaticHTML(text);\n\t\tvar content = '<div class=\"container-fluid chat-container\"><div class=\"row chat-container-head\"><div class=\"col-xs-4 col-sm-4 col-md-4 col-lg-4\">' + util.toStaticHTML(from) + '</div>' \n\t\t+ '<div class=\"col-xs-4 col-sm-4 col-md-4 col-lg-4\">'+util.timeStr(time)+'</div>' \n\t\t+ '<div class=\"col-xs-4 col-sm-4 col-md-4 col-lg-4\">'+util.timeString(time)+'</div>' \n\t\t+ '</div><div class=\"row chat-content\"><div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">' + text + '</div></div></div>';\n\t\t//the log is the stream that we view\n\t\t$(\"#chatOffHistory\").append(content);\n\t\t$('#chatOffHistory').scrollTop(chatOffHistory.scrollHeight);\n\t}else{\n\t\ttext = util.toStaticHTML(text);\n\t\tvar content = '<div class=\"container-fluid chat-container\"><div class=\"row chat-container-head\"><div class=\"col-xs-4 col-sm-4 col-md-4 col-lg-4\">' + util.toStaticHTML(from) + '</div>' \n\t\t+ '<div class=\"col-xs-4 col-sm-4 col-md-4 col-lg-4\">'+util.timeStr(time)+'</div>' \n\t\t+ '<div class=\"col-xs-4 col-sm-4 col-md-4 col-lg-4\">'+util.timeString(time)+'</div>' \n\t\t+ '</div><div class=\"row chat-content\"><div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">' + text + '</div></div></div>';\n\t\t//the log is the stream that we view\n\t\t$(\"#chatHistory\").append(content);\n\t\t$('#chatHistory').scrollTop(chatHistory.scrollHeight);\n\t}\n\tbase += increase;\n\tscrollDown(base);\n}", "title": "" }, { "docid": "42796ea98af360cc572bb981f02df481", "score": "0.655158", "text": "function toogleStreamChatRoom() {\n\t$(\"#stream-room\").attr({\n\t\t'class': 'channel ' + chat_channel_id,\n\t\ttitle: 'канал ' + chat_channel_id,\n\t\tstyle: 'color: #BBB !important'\n\t}).text( 'stream' );\n}", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.65475404", "text": "SendMessage() {}", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.65475404", "text": "SendMessage() {}", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.65475404", "text": "SendMessage() {}", "title": "" }, { "docid": "be2ca226b3cffb606dc331082ef258a1", "score": "0.65394264", "text": "chatDisp(cmd, msg) {\n var ele = document.createElement(\"p\");\n ele.innerText = msg;\n if (cmd == 'res') {\n ele.style.fontStyle = \"italic\";\n }\n this.chat.appendChild(ele);\n this.chat.scrollTop = this.chat.scrollHeight;\n }", "title": "" }, { "docid": "537a773448f57f58886eccf23521b7ca", "score": "0.65394187", "text": "function createChat() {\n // Рендеринг чата\n const app = document.getElementById('app');\n app.innerHTML = \"\";\n\n const appMessageWindow = document.createElement('div');\n appMessageWindow.setAttribute('id', 'app-message-window');\n\n const appInputWindow = document.createElement('div');\n appInputWindow.setAttribute('id', 'app-input-window');\n\n const textarea = document.createElement('textarea');\n textarea.setAttribute('id', 'textarea');\n textarea.setAttribute('placeholder', 'Отправить...');\n textarea.onkeypress = (event) => {\n if (!(!event.shiftKey && event.key == 'Enter')) return;\n if (!textarea.value.trim() == '') {\n event.preventDefault();\n const message = createMessageObject();\n sendMessageToServer(message);\n }\n textarea.value = '';\n }\n\n const button = document.createElement('button');\n button.setAttribute('id', 'send');\n button.innerText = 'Send';\n button.onclick = () => {\n if (textarea.value.trim() == '') return;\n const message = createMessageObject();\n textarea.value = '';\n sendMessageToServer(message);\n }\n appInputWindow.appendChild(textarea);\n appInputWindow.appendChild(button);\n\n app.appendChild(appMessageWindow);\n app.appendChild(appInputWindow);\n}", "title": "" }, { "docid": "2474b63f6db0dbfd10517c157c3a920b", "score": "0.6538798", "text": "function message_receive(args) {\n\tif (typeof args.user !== 'undefined') {\n\t\t$(\"#msg\").prepend(args.user + \": \" + args.msg + \"<br>\");\n\t}\n}", "title": "" }, { "docid": "22c44f1961ae60c927fd25ee876f5dc2", "score": "0.65323627", "text": "function cunyj_live_meebochat() {\n\tif ( typeof(cunyj_live_meebo_chat) == 'undefined' || cunyj_live_meebo_chat == '' ) {\n\t\treturn false;\n\t}\t\n\t//var chat_embed = '<div style=\"width:225px\"><style>.mcrmeebo { display: block; background:url(\"http://widget.meebo.com/r.gif\") no-repeat top right; } .mcrmeebo:hover { background:url(\"http://widget.meebo.com/ro.gif\") no-repeat top right; } </style><object width=\"225\" height=\"275\"><param name=\"movie\" value=\"http://widget.meebo.com/mcr.swf?id=GDwcDLPmRM\"></param><embed src=\"http://widget.meebo.com/mcr.swf?id=GDwcDLPmRM\" type=\"application/x-shockwave-flash\" width=\"225\" height=\"275\" /></object><a target=\"_blank\" href=\"http://www.meebo.com/rooms/\" class=\"mcrmeebo\"><img alt=\"Create a Meebo Chat Room\" src=\"http://widget.meebo.com/b.gif\" width=\"225\" height=\"45\" style=\"border:0px\"/></a></div>';\n\tjQuery('ul.switcher li#meebo').addClass('active');\n\tjQuery('#meebo-chat').show();\n\tcunyj_live_meebo_chat = stripslashes( cunyj_live_meebo_chat );\n\tjQuery('#meebo-chat').append(cunyj_live_meebo_chat);\n}", "title": "" }, { "docid": "317b69310f11c4de85fd61dd40d3a962", "score": "0.65254796", "text": "handleChat(text) {\n this.room.broadcast({\n username: this.username,\n type: 'chat',\n text: text\n });\n }", "title": "" }, { "docid": "aa6e75495d808a39ebec58bf67421639", "score": "0.6521166", "text": "function SendMSG(){\n // Récupérer l'input et sa valeur\n var VMessage = document.getElementById('ChatArea').value;\n\n if(VMessage === ''){\n window.alert('Vous ne pouvez pas envoyer un message vide.');\n }\n else{\n // Envoyer la valeur\n socket.send(\"MESSAGE :: Pseudo :: \" + User_Pseudo + \" :: Message : \" + VMessage);\n console.log(\"MESSAGE :: Pseudo :: \" + User_Pseudo + \" :: Message : \" + VMessage)\n // Écrire la valeur\n $('div .Chatbox').append(\n \"<p class='ChatTexte'><span class='Time'>[\" + HeureDynamique + \"]</span> | <span class='MePseudo'>\" + User_Pseudo + \"</span> : \" + VMessage + \"</p>\"\n )\n // ScrollBare Bottom\n const scrollbarre = document.querySelector(\"div.Chatbox\");\n scrollbarre.scroll(scrollbarre.scrollTopMax, scrollbarre.scrollTopMax);\n // Vider Champs texte\n $('#ChatArea').val('');\n }\n }", "title": "" }, { "docid": "81a8692a4b70a5d17d5ed266ceb5e4b1", "score": "0.651243", "text": "function sendMessage() {\r\n\tvar value = msgInput.value;\r\n\tif (value) {\r\n\t\tvar message = {\r\n\t\t\ttext: msgInput.value,\r\n\t\t\tsentAt: new Date().toLocaleTimeString()\r\n\t\t};\r\n\r\n\t\tmySession.publish('chat', null, message);\r\n\t\tshow(message, true);\r\n\t\tmsgInput.value = '';\r\n\t}\r\n}", "title": "" }, { "docid": "d667a5bf8c43f5f0da6429ecbe05eac0", "score": "0.6501564", "text": "function addChatMessage(data, options) {\n\t\t\t// Don't fade the message in if there is an \"X was typing\"\n\t\t\tvar $typingMessages = getTypingMessages(data);\n\n\t\t\tvar m = moment(data.time);\n\t\t\tvar displayDate = \"\";\n\t\t\tdisplayDate = m.fromNow();\n\n\t\t\toptions = options || {};\n\t\t\tif ($typingMessages.length !== 0) {\n\t\t\t\toptions.fade = false;\n\t\t\t\t$typingMessages.remove();\n\t\t\t}\n\n\t\t\t/*\n\t\t\t var $usernameDiv = $(\"<span class='username'/>\")\n\t\t\t .text(data.username)\n\t\t\t .css(\"color\", getUsernameColor(data.username));\n\t\t\t */\n\t\t\tvar $usernameDiv = $(\"<span class='black-text'/>\")\n\t\t\t\t.html(\"<b>\" + data.username + \"</b> \");\n\n\t\t\tvar $messageTs = $(\"<small class='black-text'>\").text(displayDate);\n\n\t\t\tvar newmsg = data.msg.replace(/\\n/g, \"<br>\");\n\t\t\tvar $messageBodyDiv = $(\"<span class='messageBody black-text'/>\")\n\t\t\t\t.html(newmsg);\n\n\t\t\tvar $likeDiv = \"\";\n\t\t\tif (data.likes) {\n\t\t\t\t$likeDiv = $(\"<span style='float:right' class='likesDiv'/>\");\n\t\t\t\tvar totalLikes = Object.keys(data.likes).length;\n\t\t\t\tvar likeDone = data.likes.indexOf(userId) != -1;\n\t\t\t\tmakeLikeDiv($likeDiv, data._id, totalLikes, likeDone);\n\t\t\t}\n\n\t\t\tvar typingClass = data.typing ? \"typing\" : \"\";\n\n\t\t\tvar numMessage = $(\".messages div\").length;\n\t\t\tvar $messageDiv = \"\";\n\n\t\t\tif (numMessage % 2)\n\t\t\t\t$messageDiv = $(\"<div align='left' class='message panel-body grey'/>\")\n\t\t\t\t\t.data(\"username\", data.username)\n\t\t\t\t\t.addClass(typingClass)\n\t\t\t\t\t.append($usernameDiv, $messageTs, $likeDiv, \"<br>\", $messageBodyDiv);\n\t\t\telse\n\t\t\t\t$messageDiv = $(\"<div align='left' style='border:1px solid lightgrey' class='message panel-body white'/>\")\n\t\t\t\t\t.data(\"username\", data.username)\n\t\t\t\t\t.addClass(typingClass)\n\t\t\t\t\t.append($usernameDiv, $messageTs, $likeDiv, \"<br>\", $messageBodyDiv);\n\n\n\t\t\taddMessageElement($messageDiv, options);\n\t\t}", "title": "" }, { "docid": "57f4a5435c80d420f6b7762028841270", "score": "0.650061", "text": "function outputMessage(message){\nconst div = document.createElement('div');\ndiv.classList.add('message');\ndiv.innerHTML = `\n<p class=\"meta\">${message.username}<span>${message.time}</span></p>\n<p class=\"text\">\n ${message.text}\n</p>\n`\ndocument.querySelector('.chat-messages').appendChild(div);\n\n\n}", "title": "" }, { "docid": "9cf4db6d015d8ac1f9eea3582e42611d", "score": "0.64988047", "text": "function afficheBox(id) {\n var $username = id;\n var pseudo = ($(\"#pseudo\").data(\"pseudo\"));\n var $container = $(\"#chat_div\");\n var $divexiste = false;\n //---\n var $nbBox = $('div.chatbox').length;\n var $marge = $nbBox * (300 + $espaceEntreBox) + $margeDroiteDesBox;\n // ----------\n // Affichage\n // ----------\n //\n // on teste si un div ayant un id du même nom que le username_box existe déjà\n $('div').each(function() {\n if ($(this).attr('id') == $username + '_box') {\n $divexiste = true;\n }\n });\n // ---\n // si il n'existe pas, je le créer (id=username)\n // ---\n if (!$divexiste) {\n $container.append('<div id=\"' + $username + '\"></div>');\n // je crée une box\n box = $('#' + $username).chatbox({id: $username,\n title: \"woozeostage chat : \" + $username,\n offset: $marge,\n user: {key: \"value\"},\n messageSent: function(id, user, msg) {\n $(\"#log\").append(id + \" said: \" + msg + \"<br/>\");\n $('#' + $username).chatbox(\"option\", \"boxManager\").addMsgBase(id, pseudo, msg);\n }});\n }\n}", "title": "" }, { "docid": "b03f82a5b424a2f92c968786339caf13", "score": "0.6497605", "text": "function insertChat(who, text, time ){\r\n\t var meControl \r\n\t var date = formatAMPM(new Date());\r\n\t if (who == \"me\"){\r\n\t \t meControl = '<li class=\"left clearfix\"><span class=\"chat-img pull-left\">'+\r\n\t '<img src=\"img/ME.png\" alt=\"User Avatar\" class=\"img-circle\" />'+\r\n\t\t\t '</span>'+\r\n\t\t\t '<div class=\"chat-body clearfix\">'+\r\n\t\t\t '<div class=\"header\">'+\r\n\t\t\t //' <small class=\"pull-right text-muted\">'+\r\n\t\t\t ' <small class=\"pull-right text-muted\">'+\r\n\t\t\t // '<span class=\"glyphicon glyphicon-time\"></span>'+date+'</small>'+\r\n\t\t\t '<span class=\"glyphicon glyphicon-time\"></span>'+date+'</small>'+\r\n\t\t\t '</div>'+\r\n\t\t\t '<p style=\"width: 100%; overflow: hidden; text-overflow: ellipsis;\">'+\r\n\t\t\t \ttext\r\n\t\t\t '</p>'+\r\n\t\t\t '</div>'+\r\n\t\t\t '</li>';\r\n\t }else{\r\n\t meControl = '<li class=\"right clearfix\"><span class=\"chat-img pull-right\">'+\r\n '<img src=\"img/BOT.png\" alt=\"User Avatar\" class=\"img-circle\" />'+\r\n\t\t '</span>'+\r\n\t\t '<div class=\"chat-body clearfix\">'+\r\n\t\t '<div class=\"header\">'+\r\n\t\t //'<small class=\" text-muted\"><span class=\"glyphicon glyphicon-time\"></span>'+date+'</small>'+\r\n\t\t '<small class=\" text-muted\"><span class=\"glyphicon glyphicon-time\"></span>'+date+'</small>'+\r\n\t\t \r\n\t\t '</div>'+\r\n\t\t '<p style=\"width: 100%; overflow: hidden; text-overflow: ellipsis;\">'+\r\n\t\t \ttext\r\n\t\t '</p>'+\r\n\t\t '</div>'+\r\n\t\t '</li>';\r\n\t }\r\n\t \r\n\t \r\n\t setTimeout(\r\n\t function(){ \r\n\t $(\"ul\").append(meControl);\r\n\t $(\"#chat-div\").scrollTop($(\"#chat-div\")[0].scrollHeight);\r\n\t }, time);\r\n\t \r\n\t}", "title": "" }, { "docid": "1e22c117aa32e0079542507632f9f1e5", "score": "0.64919627", "text": "function displayChatMessage(name, message) {\n if (name == SessionUser.name){\n var nameUl = $('<ul class=\"list-unstyled text-right\"></ul>').append($('<li class=\"text-success\"></li>').text(name)).append($('<li class=\"small\"></li>').text(message))\n }else{\n var nameUl = $('<ul class=\"list-unstyled\"></ul>').append($('<li class=\"text-primary\"></li>').text(name)).append($('<li class=\"small\"></li>').text(message))\n }\n $('#messagesDiv').append(nameUl);\n $('#messagesDiv')[0].scrollTop = $('#messagesDiv')[0].scrollHeight;\n \n}", "title": "" }, { "docid": "2f29447e9f551bb3c5a233ce45078341", "score": "0.64918417", "text": "function user_msg(msg){\n\t\n\tlet face;\n\tlet element;\n\t\n\tface = document.createElement('div');\n\tface.className = \"user-face\";\n\tface.innerHTML = 'you';\n\n\n\telement = document.createElement('div');\n\telement.className = \"user-chat\";\n\telement.innerHTML = msg;\n\n\t//console.log(document.getElementsByClassName(\"user-chat\")[0]);\n\t\n\tdocument.getElementsByClassName('chatbot-screen')[0].appendChild(face);\n\tdocument.getElementsByClassName('chatbot-screen')[0].appendChild(element);\n}", "title": "" }, { "docid": "335d1c3cd8aec2e47219040a5cfb2a82", "score": "0.64892185", "text": "function insContent(senderClass, chatInput){\r\n var chatbody = document.getElementById(\"chatbody\");\r\n var content = document.getElementById(\"chat_content\");\r\n var str = \"<div class = \"+senderClass+\"><span>\"+chatInput+\"</span></div>\";\r\n content.innerHTML = content.innerHTML + str;\r\n chatbody.scrollTop = chatbody.scrollHeight; //scroll down to the latest content automatically\r\n}", "title": "" }, { "docid": "b7aebd3f48b1698cec6301008a3f5904", "score": "0.64883155", "text": "function createMessage(msg, newMessage, newCardName){\n //console.log(socket)\n newMessage.innerText = msg.body;\n // newCardName.innerText = 'Insert Username';\n\n }", "title": "" }, { "docid": "346a211cac08fcbede837f3d02cbec91", "score": "0.64805067", "text": "handleChat(text) {\n this.room.broadcast({\n name: this.name,\n type: 'chat',\n text: text\n });\n }", "title": "" }, { "docid": "ee90e4007172635c27eb7ad9ceaacbaa", "score": "0.64802295", "text": "function outputMessage(msg){\n const div = document.createElement('div');\n // div.classList.add('message');\n div.innerHTML=`<p>${msg.username}<span>${msg.time}</span></p>\n <p>${msg.text}</p>`\n document.querySelector('.chat-message').appendChild(div);\n}", "title": "" }, { "docid": "0daf10718c4473d67763bc8ec64053a4", "score": "0.6479254", "text": "function ChatRoomMessage(data) {\n\tif ((data != null) && (typeof data === \"string\") && (data != \"\")) {\n\t\tChatRoomLog = ChatRoomLog + data + '\\r\\n';\n\t\tif (document.getElementById(\"TextAreaChatLog\") != null) {\n\t\t\tElementValue(\"TextAreaChatLog\", ChatRoomLog);\n\t\t\tsetTimeout(function(){ \n\t\t\t\tvar element = document.getElementById(\"TextAreaChatLog\");\n\t\t\t\telement.focus();\n\t\t\t\telement.selectionStart = element.selectionEnd = element.value.length;\n\t\t\t\tdocument.getElementById(\"InputChat\").focus();\n\t\t\t}, 0);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "34011342c7219f8820fa6dc9459d6e56", "score": "0.647812", "text": "function chatSend (str) {\n\t\t\td20.textchat.doChatInput(str);\n\t\t}", "title": "" }, { "docid": "7a1f41b331dfbb796a6e2b9b237012d2", "score": "0.647706", "text": "function sendMessage() {\n // vado a inserire in una variabile quello che utente scrive in input text_area (ovvero il .val di input)\n var messageText = $(\"#send_message_bar\").val();\n // se input text_area non è vuoto proseguo appendendo il messaggio inviato\n if (messageText != \"\") {\n // indico una variabile che definisce il contenitore (square_speech) del testo scritto da utente\n //ovvero .square_speech che è appunto il div contenitore del tag span contenete il message_text\n var newMessageSquare = $(\".templates .square_speech\").clone();\n //scrivo il testo che è il val di input, ovvero ciò che utente ha scritto nel div span message_text\n newMessageSquare.children(\".message_text\").text(messageText);\n //scrivo l'orario corrente sotto al messaggio\n newMessageSquare.children(\".message_time\").text(time());\n //scrivo data ora mese anno ogni volta che invio un mess nel contatto con classe selected\n $(\".contact_item.selected .user_date\").text(\"Last mess sent: \" + time() + \" - \" + month() + \" - \" + year())\n //scrivo data ora mese anno ogni volta che invio un mess nella user face currebt_contact con classe selected\n $(\".user_interface .user_date\").text(\"Last mess sent: \" + time() + \" - \" + month() + \" - \" + year())\n //resetto il valore di input in modo che utente possa scrivere un nuovo messaggio\n $(\".texting_bar input\").val(\"\");\n //aggiungo al contenitore del testo la classe sent per dargli gli stili dei messaggi inviati\n newMessageSquare.addClass(\"sent\");\n //appendo il div nel message_box ovvero dove utente potrà leggere i messaggi inviati e ricevuti\n //appendo il messaggio nella finestra di conversazione relativa al contatto corrente (ovvero quella con classe.active)\n $(\".messages_box.active\").append(newMessageSquare);\n //Genero messaggio di riasposta tramite funzione sendMessageReply\n //Invio messaggio di risposta dopo x secondi dal messaggio inviato da utente\n setTimeout(sendMessageReply, 1000);\n //scrollo la message_box fino alla fine ovvero altezza totale del div contenitore texting_area per mostrare a utente i messaggi piu recenti\n var messageBoxHigh = $(\".texting_area\").prop(\"scrollHeigth\");\n $(\".texting_area\").scrollTop(messageBoxHigh)\n\n }\n}", "title": "" }, { "docid": "8a98b548f5f2c0f7b00e79a5ed62c02f", "score": "0.6474602", "text": "function chSendMessage() {\r\n var chMessage = document.getElementById(\"chatbarText\");\r\n if(chMessage.value == \"\" || chMessage.value == chMessage.defaultValue)\r\n \treturn alert(lang[local]['msg']);\r\n postChatData(chMessage.value);\r\n}", "title": "" }, { "docid": "301c7640e52ff5584e4f288542a799dd", "score": "0.6472402", "text": "function sendMessage(message, type) {\n //function used to send users messages\n\n var messageBar = new MessageBar(message, type);\n messagesArray.push(messageBar);\n messageBar.show();\n}//messageBar api", "title": "" }, { "docid": "8b58d4c0f56a0b8e96e06f37866cc6a7", "score": "0.64678836", "text": "function openTextSocketConnection(){\n\t\n\t \n\t// When the socket recieves a message\n\tsocket.on('output-from-chatserver', function(data){\n\t\t\t displayIncomingMessage(data.data);\n\t\t\t\n\t\t\t //$(\"#typingMessage\").html('');\n\t\t\t $(\"#record_button\").css(\"visibility\",\"visible\");\n\t\t\t $(\"#demo\").attr(\"placeholder\",\"Say Something ...\");\n\t});\n\t\n}", "title": "" }, { "docid": "d16da61e96d650c125ffa24014bd442d", "score": "0.6467139", "text": "function sendChatMessage() {\n\n // Check if message is empty.\n if ($('#m').val() == '') {\n return;\n }\n\n // Append your value instead.\n var html = '<div class=\"bubble right\"><div class=\"content\">' + $('#m').val() + '</div></div>';\n\n // Add chat message to chat area.\n $('#chat-area').append(html);\n\n // Emits the chat message to the server.\n socket.emit('chat message', $('#m').val());\n\n // Scroll to new message.\n $('.chat').scrollTop($('.chat')[0].scrollHeight);\n\n // Resets the value.\n $('#m').val('');\n}", "title": "" }, { "docid": "6f4f94bfdc19b21b72aca02b8ce61622", "score": "0.6465354", "text": "function instaChat(container) {\n var socket = null;\n var config = {\n adress: \"ws://vhost3.lnu.se:20080/socket/\",\n key: \"eDBE76deU7L0H9mEBgxUKVR0VCnq0XBd\",\n channel: \"\"\n };\n\n login().then(function() {\n connect().then(function() {\n printOperationsScreen();\n container.querySelector(\".textArea\").addEventListener(\"keypress\", function(event) {\n if (event.keyCode === 13) {\n send(event.target.value);\n event.target.value = \"\";\n event.preventDefault();\n }\n });\n });\n });\n\n /**\n * Loads the template and prints the login screen in the container.\n */\n function printLoginScreen() {\n var template;\n var node;\n\n template = document.querySelector(\"#instaChatLoginTemplate\");\n node = document.importNode(template.content, true);\n container.appendChild(node);\n }\n\n /**\n * Loads the template for operations. So the charBox and textarea is created. The select element with the channel\n * options is also added together with an event listener listening for change in the select. When there is a change\n * the new channel is used to both listen on and write to. A notification is also printed.\n */\n function printOperationsScreen() {\n var template;\n var node;\n var options;\n\n template = document.querySelector(\"#instaChatTemplate\");\n node = document.importNode(template.content, true);\n container.appendChild(node);\n\n template = document.querySelector(\"#channelSelectTempalte\");\n node = document.importNode(template.content.firstElementChild, true);\n\n container.querySelector(\".topbar\").appendChild(node);\n\n node.addEventListener(\"change\", function() {\n var selected;\n options = node.children;\n\n selected = node.options[node.selectedIndex];\n\n config.channel = selected.value;\n printNotification(\"Switched to \" + selected.firstChild.data + \" channel\", false);\n });\n }\n\n /**\n * Prints a message to the chat box. Also ads a timestamp to each message so we know when we got it. The username of\n * the person who sent it is also displayed. If the message was sent by this user then the message will have\n * a different class to look different and instead of the username it will say \"you\".\n * @param message An objects from the server containing a message and other information.\n */\n function printMessage(message) {\n var template;\n var fragment;\n var messageElement;\n var usernameElement;\n var chatBox = container.querySelector(\".chatBox\");\n var date = new Date();\n var time = date.getHours() + \":\";\n if (date.getMinutes() < 10) {\n time += 0;\n }\n\n time += date.getMinutes();\n\n template = document.querySelector(\"#messageTemplate\");\n fragment = document.importNode(template.content, true);\n\n usernameElement = fragment.querySelector(\".username\");\n messageElement = fragment.querySelector(\".message\");\n\n if (message.username === sessionStorage.username) {\n message.username = \"You\";\n usernameElement.className += \" usernameSent\";\n messageElement.className += \" messageSent\";\n }\n\n usernameElement.appendChild(document.createTextNode(message.username + \" \" + time));\n messageElement.appendChild(document.createTextNode(message.data));\n\n chatBox.appendChild(fragment);\n }\n\n /**\n * Prints a notification in the chatBox. If temporary is true then the message will disapear after 5 seconds.\n * @param message A message we want in the notification.\n * @param temporary True if we want the message to disappear after 5 seconds. If not the false.\n */\n function printNotification(message, temporary) {\n var template = document.querySelector(\"#notificationTemplate\");\n var notification = document.importNode(template.content.firstElementChild, true);\n var text;\n\n text = document.createTextNode(message);\n\n notification.appendChild(text);\n\n container.querySelector(\".chatBox\").appendChild(notification);\n\n if (temporary) {\n setTimeout(function() {\n notification.remove();\n }, 5000);\n }\n }\n\n /**\n * Creates the login functionality. Returns a promise containing an if statement and an event listener. The if\n * statement checks if a username already exists in this session. If so we use that name and remove the loginDiv\n * and call resolve. The event listener is created if we can't find a username. It will listen to a press of the\n * enter key on the loginDiv. If there is nothing in the text input then a text is shows to the user. But if there\n * is a text then we save the name in session and move on.\n * @returns {Promise} A promise of a username.\n */\n function login() {\n printLoginScreen();\n var loginDiv = container.querySelector(\".instaChatLogin\");\n\n return new Promise(function(resolve) {\n\n if (sessionStorage.username) {\n loginDiv.remove();\n resolve();\n return;\n }\n\n loginDiv.addEventListener(\"keypress\", function(event) {\n if (event.keyCode === 13) {\n if (event.target.value) {\n sessionStorage.username = event.target.value;\n loginDiv.remove();\n resolve();\n } else {\n container.querySelector(\".alertText\").appendChild(document.createTextNode(\"Please enter a username!\"));\n }\n }\n });\n });\n }\n\n /**\n * This functions is called to connect to the server. It returns a Promise. In this Promise we create a web socket\n * connection to the server. We then listen for the event open from the server. We also listen for an error so we\n * know if something when wrong. An event listener for messages is also added. The type of the message is checked\n * and depending on what type it is then it will be printed as a message, a notification or not printed at all.\n * @returns {Promise}\n */\n function connect() {\n return new Promise(function(resolve, reject) {\n socket = new WebSocket(config.adress);\n socket.addEventListener(\"open\", function() {\n container.querySelector(\".closeWindowButton\").addEventListener(\"click\", function() {\n socket.close();\n });\n\n resolve();\n });\n\n socket.addEventListener(\"error\", function() {\n reject(\"An error has occured\");\n });\n\n socket.addEventListener(\"message\", function(event) {\n var message = JSON.parse(event.data);\n\n if (message.type === \"message\") {\n if (message.channel === config.channel) {\n printMessage(message);\n }\n } else if (message.type === \"notification\") {\n printNotification(message.data + \" Welcome \" + sessionStorage.getItem(\"username\"), true);\n }\n\n container.scrollTo(0, 100);\n });\n });\n }\n\n /**\n * This function is used to send messages to the server. We create an object and fill it with the information it\n * needs and then use send method.\n * @param text Text we want to send to the server and in turn the other users.\n */\n function send(text) {\n var data = {\n type: \"message\",\n data: text,\n username: sessionStorage.username,\n channel: config.channel,\n key: config.key\n };\n socket.send(JSON.stringify(data));\n }\n}", "title": "" }, { "docid": "faad3a2ff146695c2a77cb2b72ed80a8", "score": "0.6463512", "text": "function aggiungi(){\n var messaggio = $('#message').val();\n // Condizione per messaggio non vuoto\n if (messaggio != '') {\n // clono template e appendo testo messaggio\n var chat = $('.template .chat-text-ctr').clone();\n chat.find('.chat-text').addClass('green');\n chat.find('.chat-text p').append(messaggio);\n // ora attuale\n chat.find('.chat-time small').append(ora());\n $('#message').val('');\n $('.main-chat.active').append(chat);\n // scroll messaggio\n $('.main-chat').scrollTop($('.main-chat')[0].scrollHeight);\n // Messaggio in attesa della risposta\n $('.main-cnt-details p').text('sta scrivendo...');\n // risposta casuale\n randomAnswer();\n }\n}", "title": "" }, { "docid": "c7a2aca27c47e3b37b7edbfd9dbbca8b", "score": "0.6462305", "text": "function appendChatMessage(username, message) {\n var message = username + \": \" + message;\n var scrollbot = false;\n if($('#chatArea').val() !== \"\") {\n message = \"\\n\"+message;\n }\n $('#chatArea').append(message);\n $('#chatArea').scrollTop($('#chatArea')[0].scrollHeight);\n}", "title": "" }, { "docid": "2a3b312e6b04881fcd6c4983d727e938", "score": "0.64620364", "text": "function displayMsg(data){\n $chat.append('<span class=\"msg\"><b>' + data.nick + ': </b>' + data.msg + \"</span><br/>\");\n }", "title": "" }, { "docid": "70e1a71ae8fccb69fafaa7ddd89b33d6", "score": "0.64585114", "text": "function _sendMessage() {\n\t var value = messageInputTextArea.getValue();\n\t if (!value || (value === '')) {\n\t return;\n\t }\n\t messageInputTextArea.setValue('');\n\t fbMessages.push({\n\t author: nameBar.getValue(),\n\t userId: _getUserId(),\n\t message: value,\n\t timeStamp: new Date().getTime()\n\t });\n\t messageInputTextArea.focus();\n\t }", "title": "" }, { "docid": "0488939fad0110f0b8490eced916c4a5", "score": "0.64567506", "text": "function appendMessageToChat(messageObj) {\n let chatType;\n\n if (messageObj.sender !== $('#yourName').text()) {\n chatType = \"usermessage\";\n } else {\n chatType = \"yourmessage\";\n }\n let messages = $('#messages');\n\n selectTypeOfMessage(messageObj, chatType);\n messages.scrollTop(messages[0].scrollHeight);\n }", "title": "" }, { "docid": "0050252bd4044216388289c682ff9782", "score": "0.6453878", "text": "async _chat () {\n this.shadowRoot.innerHTML = ''\n this.shadowRoot.append(templMain.content.cloneNode(true))\n const usernameOnNav = this.shadowRoot.querySelector('#userOnNav')\n let user = this.localStorage.getItem(this.storageIdentifier)\n user = JSON.parse(user)\n user = user.name\n usernameOnNav.textContent = user\n await this._connect()\n if (this.connected === true) {\n this._sendMessage()\n }\n this._listenForevents()\n }", "title": "" }, { "docid": "208d78daa31671937a32495addf8a8b4", "score": "0.6452405", "text": "function onMessageReceived(payload) {\n var message = JSON.parse(payload.body);\n\n var messageElement = document.createElement('li');\n\n if(message.type === 'JOIN') {\n messageElement.classList.add('event-message');\n message.content = message.sender + ' joined!';\n } else if (message.type === 'LEAVE') {\n messageElement.classList.add('event-message');\n message.content = message.sender + ' left!';\n } else {\n messageElement.classList.add('chat-message');\n messageElement.setAttribute('id' , 'cm' + message.id);\n\n var avatarElement = document.createElement('i');\n var avatarText = document.createTextNode(message.sender[0]);\n avatarElement.appendChild(avatarText);\n avatarElement.style['background-color'] = getAvatarColor(message.sender);\n\n messageElement.appendChild(avatarElement);\n\n var usernameElement = document.createElement('span');\n var usernameText = document.createTextNode(message.sender);\n usernameElement.appendChild(usernameText);\n messageElement.appendChild(usernameElement);\n\n if(message.sender === username && message.type === 'CHAT'){\n var editButton = document.createElement('button');\n editButton.classList.add('btn', 'btn-default', 'btn-xs', 'editbutton');\n editButton.setAttribute('type' , 'button');\n editButton.setAttribute('id' , 'e' + message.id);\n var editButtonText = document.createTextNode('Edit');\n editButton.append(editButtonText);\n messageElement.append(editButton);\n\n var deleteButton = document.createElement('button');\n deleteButton.classList.add('btn', 'btn-default', 'btn-xs', 'deletebutton');\n deleteButton.setAttribute('type' , 'button');\n deleteButton.setAttribute('id' , 'd' + message.id);\n var deleteButtonText = document.createTextNode('Delete');\n deleteButton.append(deleteButtonText);\n messageElement.append(deleteButton);\n\n\n }\n\n if(message.sender === username && message.type === 'PICT'){\n var deleteButton = document.createElement('button');\n deleteButton.classList.add('btn', 'btn-default', 'btn-xs', 'deletebutton');\n deleteButton.setAttribute('type' , 'button');\n deleteButton.setAttribute('id' , 'd' + message.id);\n var deleteButtonText = document.createTextNode('Delete');\n deleteButton.append(deleteButtonText);\n messageElement.append(deleteButton);\n }\n\n }\n var textElement = document.createElement('p');\n textElement.setAttribute('id' , 'm' + message.id);\n if(message.type === 'PICT'){\n var textElement = document.createElement('img');\n textElement.setAttribute('id' , 'm' + message.id);\n textElement.setAttribute('src' , message.content);\n }else{\n var messageText = document.createTextNode(message.content);\n textElement.appendChild(messageText);\n }\n messageElement.appendChild(textElement);\n messageArea.appendChild(messageElement);\n messageArea.scrollTop = messageArea.scrollHeight;\n}", "title": "" }, { "docid": "ad328432b8864749673764afadf8b793", "score": "0.6447858", "text": "function displayMessage(message){\n chat = document.querySelector('.chat')\n newMessage = document.createElement('div')\n newMessage.classList.add('message')\n color = '#37e79e'\n if(message.name === \"Roomers Bot\"){\n color = '#74dcfc'\n }\n newMessage.innerHTML = `<p class=\"msgInfo\" style='background-color: ${color};'>${message.name}<span style=\"float: right;\">${message.time}</span></p>\n <p class=\"content\">${message.text}</p>`\n chat.appendChild(newMessage)\n}", "title": "" }, { "docid": "ff83b3aabab7a3d782da0000f3b489b9", "score": "0.64432317", "text": "function sendMessage() {\n var chatArea = document.querySelector(\".message\");\n if (chatArea.style.display === \"none\") {\n chatArea.style.display = \"block\";\n }\n var message = document.getElementById(\"textbox\").value;\n messages.push(message); //storing the messages in the list\n document.querySelector(\".chat-text\").textContent = message;\n for (index = 0; index < messages.length; index++) {\n console.log(messages[index]);\n }\n // messages\n // // .map((item) => createMessage(item))\n // .forEach((el) => document.getElementById(\"chat-area\").appendChild(el));\n document\n .getElementById(\"chat-section\")\n .appendChild(createMessage(messages[messages.length - 1]));\n}", "title": "" }, { "docid": "4b35e45a4c69e1f5a1b53c5cf7659a9d", "score": "0.64400434", "text": "function outputUserMessage(text) {\n const div = document.createElement('div');\n div.classList.add('message');\n div.innerHTML = `\n <img class=\"avatar-md\" src=\"img/avatars/user.png\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"${text.username}\" alt=\"avatar\">\n <div class=\"text-main\">\n\t\t<div class=\"text-group\">\n <span>${text.username}</span>\n\t\t\t<div class=\"text\">\n\t\t\t\t<p>${text.text}</p>\n\t\t\t</div>\n\t\t</div>\n\t\t\t<span style=\"color:gray;font-size:12px;\">${text.time}</span>\n\t</div>`;\n document.getElementById(\"chatContainer\").appendChild(div);\n}", "title": "" }, { "docid": "759b95a6da839da3e4c80eca72521afa", "score": "0.6440002", "text": "function fieldscreatechat() {\r\n var sb='';\r\n sb='chat|no,13|memo,m';\r\n sb=fs.dcreate(sip,sb); \r\n document.getElementById(\"iddisp\").innerHTML = sb;\r\n}", "title": "" }, { "docid": "b7c102e3414f0adcf99553c4a11ea723", "score": "0.6438937", "text": "function addToChat(msg, color) {\n var messages = document.getElementById('messages');\n msg = sanitize(msg);\n if(color) {\n msg = '<span style=\"color: ' + color + '; padding-left: 15px\">' + msg + '</span>';\n } else {\n msg = '<strong style=\"padding-left: 15px\">' + msg + '</strong>';\n }\n messages.innerHTML = messages.innerHTML + msg + '<br>';\n messages.scrollTop = 10000;\n}", "title": "" }, { "docid": "3f7f5cc78a810302476e7911b108b4dc", "score": "0.6436209", "text": "function outputMessage(message){\n\n\n if(message.username == username){\n const div = document.createElement('div');\n div.classList.add('message');\n div.setAttribute(\"style\", \"max-width: 160px;position:relative;right: -200px;font-size:.95em;\");\n div.innerHTML = `<p class=\"meta\">${message.username}<span> ${message.time}</span></p>\n <p class=\"text\"> ${message.text} </p>`;\n document.querySelector('.chat-messages').appendChild(div);\n\n }else if(message.username == \"Admin\"){\n const div = document.createElement('div');\n div.setAttribute(\"style\", \"max-width: 500px;text-align: center;background-color:#af684c; font-size:.95em;position:relative;right: -20px;\");\n div.classList.add('message');\n div.innerHTML = `<p class=\"meta\">${message.username}<span> ${message.time}</span></p>\n <p class=\"text\"> ${message.text} </p>`;\n document.querySelector('.chat-messages').appendChild(div);\n\n }else {\n const div = document.createElement('div');\n div.classList.add('message');\n div.setAttribute(\"style\", \"max-width: 160px;relative;left: 2px;background-color:orange\");\n div.innerHTML = `<p class=\"meta\">${message.username}<span> ${message.time}</span></p>\n <p class=\"text\"> ${message.text} </p>`;\n document.querySelector('.chat-messages').appendChild(div);\n }\n\n}", "title": "" }, { "docid": "0249153e25662a6c87a79064fc5bd075", "score": "0.64343107", "text": "function sendChat(text) {\n\t\t\tif(self.gamePlay.chatBox !== null) {\n\t\t\t\tif(self.gamePlay.chatBox === 'clearScore') {\n\t\t\t\t\tself.gamePlay.scoreO = 0;\n\t\t\t\t\tself.gamePlay.scoreX = 0;\n\t\t\t\t\tself.gamePlay.chatBox = null;\n\t\t\t\t} else if (self.gamePlay.chatBox === 'clearChat') {\n\t\t\t\t\tself.gamePlay.chatDisplay = '';\n\t\t\t\t\tself.gamePlay.chatBox = '';\n\t\t\t\t} else {\n\t\t\t\t\t// self.gamePlay.chatDisplay = text + '\\n' + self.gamePlay.chatDisplay;\n\t\t\t\t\tself.gamePlay.chatEntry.push({entry: text, player: self.localPlayer});\n\t\t\t\t\tself.gamePlay.chatBox = '';\n\t\t\t\t\tself.gamePlay.chatNotify = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tself.gamePlay.$save();\n\t\t}", "title": "" }, { "docid": "bb9ce9d3d5426fa490da5f3bf9cac9bf", "score": "0.64328086", "text": "function ui_message(text) {\n $actionsPanel.hide();\n $loginToVkPanel.hide();\n $songListPanel.hide();\n $message.text(text);\n $messagePanel.show();\n}", "title": "" }, { "docid": "3f5bbb65493babb58df4c35fad1fc53d", "score": "0.6429588", "text": "function newChatMessage(from,message){\n // displayName and message have already been escaped\n var cl = (from === 'local') ? 'chatMsgSelf':'chatMsgOthers';\n var newmsg = $('<div class=\"chatMsg ' + cl + '\">' + getTime() + ' ' + peers[from].displayName + '<p>' + linkify(message) + '</p></div>').css('background-color', peers[from].color);\n $('<div class=\"row chatMsgContainer\"></div>').append(newmsg).appendTo('#chatHistory');\n $('#chatHistory').scrollTop($('#chatHistory').prop('scrollHeight'));\n }", "title": "" } ]
cc35147e3b762e8a42b5860102191abb
Copyright (c) 2013present, Facebook, Inc. All rights reserved. This source code is licensed under the BSDstyle license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory.
[ { "docid": "22875ed418645e635e1e384fce19a369", "score": "0.0", "text": "function insertIntoList(targetList, toInsert, offset) {\n if (offset === targetList.count()) {\n toInsert.forEach(function (c) {\n targetList = targetList.push(c);\n });\n } else if (offset === 0) {\n toInsert.reverse().forEach(function (c) {\n targetList = targetList.unshift(c);\n });\n } else {\n var head = targetList.slice(0, offset);\n var tail = targetList.slice(offset);\n targetList = head.concat(toInsert, tail).toList();\n }\n return targetList;\n}", "title": "" } ]
[ { "docid": "d393c02975106990a0ad939a9cf32aa8", "score": "0.56107205", "text": "captureNative(){\n\t\t\n\t}", "title": "" }, { "docid": "f198611f92a9c24393928e0a2ebe7dd7", "score": "0.5231463", "text": "function initForNonBrowserApp() {\n // Tinode requirement in native mode because react native doesn't provide Base64 method\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n if (typeof btoa == 'undefined') {\n global.btoa = function(input = '') {\n let str = input;\n let output = '';\n\n for (let block = 0, charCode, i = 0, map = chars; str.charAt(i | 0) || (map = '=', i % 1); output += map.charAt(63 & block >> 8 - i % 1 * 8)) {\n\n charCode = str.charCodeAt(i += 3 / 4);\n\n if (charCode > 0xFF) {\n throw new Error(\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");\n }\n block = block << 8 | charCode;\n }\n\n return output;\n };\n }\n\n if (typeof atob == 'undefined') {\n global.atob = function(input = '') {\n let str = input.replace(/=+$/, '');\n let output = '';\n\n if (str.length % 4 == 1) {\n throw new Error(\"'atob' failed: The string to be decoded is not correctly encoded.\");\n }\n for (let bc = 0, bs = 0, buffer, i = 0; buffer = str.charAt(i++);\n\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0\n ) {\n buffer = chars.indexOf(buffer);\n }\n\n return output;\n };\n }\n\n if (typeof window == 'undefined') {\n global.window = {\n WebSocket: WebSocketProvider,\n XMLHttpRequest: XHRProvider,\n indexedDB: IndexedDBProvider,\n URL: {\n createObjectURL: function() {\n throw new Error(\"Unable to use URL.createObjectURL in a non-browser application\");\n }\n }\n }\n }\n\n Connection.setNetworkProviders(WebSocketProvider, XHRProvider);\n LargeFileHelper.setNetworkProvider(XHRProvider);\n DBCache.setDatabaseProvider(IndexedDBProvider);\n}", "title": "" }, { "docid": "c202857c5f93e5d192b418683095b0a2", "score": "0.52048576", "text": "onFrameStart() { }", "title": "" }, { "docid": "8cf59176b8888a3dd7314cfc1ac809e8", "score": "0.5143679", "text": "function RCTFH4iOS() {}", "title": "" }, { "docid": "5586f757e12f65008d7a1245e0628ee7", "score": "0.50890476", "text": "loadFbLoginApi() {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '287435505152197',\n cookie : true, // enable cookies to allow the server to access\n // the session\n xfbml : true, // parse social plugins on this page\n version : 'v2.5' // use version 2.1\n });\n };\n\n console.log(\"Loading fb api\");\n // Load the SDK asynchronously\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));\n }", "title": "" }, { "docid": "29ded9b1c2efb82c4b05c6b64858c369", "score": "0.5078682", "text": "function _0x3d3d(){const _0x243e1a=['./lib/mediafire.js','751440XgeGsB','./lib/afk','45Hgxuls','./lib/fetch','format','1291YFkVrb','./lib/y2mate','15965730SrNZQT','9746410QEdLvU','./lib/badword','./lib/limit','HH:mm:ss','690iizODL','./lib/uploadimage','readFileSync','Asia/Jakarta','265852TUobgF','./lib/totalcmd.js','382NZBcXq','3885070kYhQts','./lib/atm','./lib/Toxic.js','./lib/myfunc','7572ziwkLX','./message/mess','27Zbtuzl','Asia/Makassar','./lib/ytdl','./lib/otakudesu.js','./lib/premium','./lib/functionss','6282277669861'];_0x3d3d=function(){return _0x243e1a;};return _0x3d3d();}", "title": "" }, { "docid": "9f365f92c0e44c3cf66ceb744c4f3227", "score": "0.50748765", "text": "if (\n process.env.NODE_ENV !== 'production' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative'\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n '`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.'\n );\n }", "title": "" }, { "docid": "6b33a26b426ae7538bdcc78e47b9cc45", "score": "0.5058639", "text": "constructor(native) {this.native = native;}", "title": "" }, { "docid": "3eb3aa10a3cd8d8f4b62862d0718fd33", "score": "0.5039043", "text": "onShareAppMessage() {\n\n }", "title": "" }, { "docid": "eb694b8daa4d2af11018de80991348b5", "score": "0.50315785", "text": "componentDidMount() {\n firebase.auth().onAuthStateChanged((user) => {\n if(user !=null) {\n console.log('Facebook Login:', user);\n }\n })\n }", "title": "" }, { "docid": "a22e8948b4669a0cefcb56b9caa35529", "score": "0.50212705", "text": "function facebookLogin()\r\n{\r\n alert(\"facebook\");\r\n var fb = FBConnect.install();\r\n fb.connect(client_id,redir_url,\"touch\");\r\n fb.onConnect = onFBConnected;\r\n \r\n}", "title": "" }, { "docid": "9d8a78965e7afc54285a7ebdab5c0687", "score": "0.49920887", "text": "testAPI() {\n const { token } = this.state\n const { dispatch } = this.props\n window.FB.api('/me?fields=id,name,email,picture', function(response) {\n const oauth = {\n token,\n name: response.name,\n email: response.email,\n picture: response.picture.data.url,\n provider_user_id: response.id,\n }\n dispatch(handleLoginOAuth(oauth, 'facebook'))\n });\n }", "title": "" }, { "docid": "f5deb53230acd61d6be80be13f8b3894", "score": "0.49468753", "text": "componentDidMount() {\n this.getAsyncData(LocalStoreKey.FACE_ID)\n this.getAsyncData(LocalStoreKey.TOUCH_ID)\n this.getAsyncData(LocalStoreKey.PASSCODE)\n this.checkLocalAuthendicationIsEnabled()\n this.props.getSecurityMethods(this.enableSwitchBasedOnMethods)\n // add listener for app lifecycle changes\n AppState.addEventListener('change', this._handleAppStateChange)\n }", "title": "" }, { "docid": "277a94a8db32fd58e9d89ec6ae9bbf72", "score": "0.49223167", "text": "function MyNativeExtension() {}", "title": "" }, { "docid": "e9c53429ecd38c19c80cd2d8811b429b", "score": "0.49145663", "text": "getUserInfo() {\n console.log('Welcome! Fetching your information.... ')\n FB.api('/me', {fields: 'first_name, last_name, email, name, age_range, birthday, cover, gender, hometown, location, significant_other'}, (response) => this.handleUserResponse(response, this.props.actions.loginWithFacebook)) // eslint-disable-line\n }", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49089772", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49089772", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49089772", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49089772", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49089772", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49089772", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49089772", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "3c283d98b8eca72fc32eb5ab802664a2", "score": "0.49089772", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "title": "" }, { "docid": "68fde050a3b1ba3cbe6795913a4e7f24", "score": "0.4904416", "text": "function getLocalFB() {\n return localFB;\n}", "title": "" }, { "docid": "f38f601b36177f810621ca53545ef6af", "score": "0.488094", "text": "_FBPReady(){super._FBPReady();// this._FBPTraceWires()\n}", "title": "" }, { "docid": "22ffa5256b6395427332f95ac135f305", "score": "0.48765942", "text": "function yogaFactory() {\r\n\t \r\n\tvar Yoga = (function () {\r\n\r\n\t /**\r\n\t * Copyright (c) 2014-present, Facebook, Inc.\r\n\t * All rights reserved.\r\n\t *\r\n\t * This source code is licensed under the BSD-style license found in the\r\n\t * LICENSE file in the root directory of this source tree. An additional grant\r\n\t * of patent rights can be found in the PATENTS file in the same directory.\r\n\t *\r\n\t * \r\n\t * @format\r\n\t */\r\n\r\n\t var CONSTANTS = {\r\n\t ALIGN_COUNT: 8,\r\n\t ALIGN_AUTO: 0,\r\n\t ALIGN_FLEX_START: 1,\r\n\t ALIGN_CENTER: 2,\r\n\t ALIGN_FLEX_END: 3,\r\n\t ALIGN_STRETCH: 4,\r\n\t ALIGN_BASELINE: 5,\r\n\t ALIGN_SPACE_BETWEEN: 6,\r\n\t ALIGN_SPACE_AROUND: 7,\r\n\r\n\t DIMENSION_COUNT: 2,\r\n\t DIMENSION_WIDTH: 0,\r\n\t DIMENSION_HEIGHT: 1,\r\n\r\n\t DIRECTION_COUNT: 3,\r\n\t DIRECTION_INHERIT: 0,\r\n\t DIRECTION_LTR: 1,\r\n\t DIRECTION_RTL: 2,\r\n\r\n\t DISPLAY_COUNT: 2,\r\n\t DISPLAY_FLEX: 0,\r\n\t DISPLAY_NONE: 1,\r\n\r\n\t EDGE_COUNT: 9,\r\n\t EDGE_LEFT: 0,\r\n\t EDGE_TOP: 1,\r\n\t EDGE_RIGHT: 2,\r\n\t EDGE_BOTTOM: 3,\r\n\t EDGE_START: 4,\r\n\t EDGE_END: 5,\r\n\t EDGE_HORIZONTAL: 6,\r\n\t EDGE_VERTICAL: 7,\r\n\t EDGE_ALL: 8,\r\n\r\n\t EXPERIMENTAL_FEATURE_COUNT: 1,\r\n\t EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: 0,\r\n\r\n\t FLEX_DIRECTION_COUNT: 4,\r\n\t FLEX_DIRECTION_COLUMN: 0,\r\n\t FLEX_DIRECTION_COLUMN_REVERSE: 1,\r\n\t FLEX_DIRECTION_ROW: 2,\r\n\t FLEX_DIRECTION_ROW_REVERSE: 3,\r\n\r\n\t JUSTIFY_COUNT: 6,\r\n\t JUSTIFY_FLEX_START: 0,\r\n\t JUSTIFY_CENTER: 1,\r\n\t JUSTIFY_FLEX_END: 2,\r\n\t JUSTIFY_SPACE_BETWEEN: 3,\r\n\t JUSTIFY_SPACE_AROUND: 4,\r\n\t JUSTIFY_SPACE_EVENLY: 5,\r\n\r\n\t LOG_LEVEL_COUNT: 6,\r\n\t LOG_LEVEL_ERROR: 0,\r\n\t LOG_LEVEL_WARN: 1,\r\n\t LOG_LEVEL_INFO: 2,\r\n\t LOG_LEVEL_DEBUG: 3,\r\n\t LOG_LEVEL_VERBOSE: 4,\r\n\t LOG_LEVEL_FATAL: 5,\r\n\r\n\t MEASURE_MODE_COUNT: 3,\r\n\t MEASURE_MODE_UNDEFINED: 0,\r\n\t MEASURE_MODE_EXACTLY: 1,\r\n\t MEASURE_MODE_AT_MOST: 2,\r\n\r\n\t NODE_TYPE_COUNT: 2,\r\n\t NODE_TYPE_DEFAULT: 0,\r\n\t NODE_TYPE_TEXT: 1,\r\n\r\n\t OVERFLOW_COUNT: 3,\r\n\t OVERFLOW_VISIBLE: 0,\r\n\t OVERFLOW_HIDDEN: 1,\r\n\t OVERFLOW_SCROLL: 2,\r\n\r\n\t POSITION_TYPE_COUNT: 2,\r\n\t POSITION_TYPE_RELATIVE: 0,\r\n\t POSITION_TYPE_ABSOLUTE: 1,\r\n\r\n\t PRINT_OPTIONS_COUNT: 3,\r\n\t PRINT_OPTIONS_LAYOUT: 1,\r\n\t PRINT_OPTIONS_STYLE: 2,\r\n\t PRINT_OPTIONS_CHILDREN: 4,\r\n\r\n\t UNIT_COUNT: 4,\r\n\t UNIT_UNDEFINED: 0,\r\n\t UNIT_POINT: 1,\r\n\t UNIT_PERCENT: 2,\r\n\t UNIT_AUTO: 3,\r\n\r\n\t WRAP_COUNT: 3,\r\n\t WRAP_NO_WRAP: 0,\r\n\t WRAP_WRAP: 1,\r\n\t WRAP_WRAP_REVERSE: 2\r\n\t };\r\n\r\n\t var YGEnums = CONSTANTS;\r\n\r\n\t var _extends = Object.assign || function (target) {\n\t var arguments$1 = arguments;\n\t for (var i = 1; i < arguments.length; i++) { var source = arguments$1[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\r\n\r\n\t var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) { descriptor.writable = true; } Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }();\r\n\r\n\t function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\r\n\r\n\t function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\r\n\r\n\t /**\r\n\t * Copyright (c) 2014-present, Facebook, Inc.\r\n\t * All rights reserved.\r\n\t *\r\n\t * This source code is licensed under the BSD-style license found in the\r\n\t * LICENSE file in the root directory of this source tree. An additional grant\r\n\t * of patent rights can be found in the PATENTS file in the same directory.\r\n\t *\r\n\t * \r\n\t * @format\r\n\t */\r\n\r\n\r\n\r\n\t var Layout = function () {\r\n\t function Layout(left, right, top, bottom, width, height) {\r\n\t _classCallCheck(this, Layout);\r\n\r\n\t this.left = left;\r\n\t this.right = right;\r\n\t this.top = top;\r\n\t this.bottom = bottom;\r\n\t this.width = width;\r\n\t this.height = height;\r\n\t }\r\n\r\n\t _createClass(Layout, [{\r\n\t key: 'fromJS',\r\n\t value: function fromJS(expose) {\r\n\t expose(this.left, this.right, this.top, this.bottom, this.width, this.height);\r\n\t }\r\n\t }, {\r\n\t key: 'toString',\r\n\t value: function toString() {\r\n\t return '<Layout#' + this.left + ':' + this.right + ';' + this.top + ':' + this.bottom + ';' + this.width + ':' + this.height + '>';\r\n\t }\r\n\t }]);\r\n\r\n\t return Layout;\r\n\t }();\r\n\r\n\t var Size = function () {\r\n\t _createClass(Size, null, [{\r\n\t key: 'fromJS',\r\n\t value: function fromJS(_ref) {\r\n\t var width = _ref.width,\r\n\t height = _ref.height;\r\n\r\n\t return new Size(width, height);\r\n\t }\r\n\t }]);\r\n\r\n\t function Size(width, height) {\r\n\t _classCallCheck(this, Size);\r\n\r\n\t this.width = width;\r\n\t this.height = height;\r\n\t }\r\n\r\n\t _createClass(Size, [{\r\n\t key: 'fromJS',\r\n\t value: function fromJS(expose) {\r\n\t expose(this.width, this.height);\r\n\t }\r\n\t }, {\r\n\t key: 'toString',\r\n\t value: function toString() {\r\n\t return '<Size#' + this.width + 'x' + this.height + '>';\r\n\t }\r\n\t }]);\r\n\r\n\t return Size;\r\n\t }();\r\n\r\n\t var Value = function () {\r\n\t function Value(unit, value) {\r\n\t _classCallCheck(this, Value);\r\n\r\n\t this.unit = unit;\r\n\t this.value = value;\r\n\t }\r\n\r\n\t _createClass(Value, [{\r\n\t key: 'fromJS',\r\n\t value: function fromJS(expose) {\r\n\t expose(this.unit, this.value);\r\n\t }\r\n\t }, {\r\n\t key: 'toString',\r\n\t value: function toString() {\r\n\t switch (this.unit) {\r\n\t case YGEnums.UNIT_POINT:\r\n\t return String(this.value);\r\n\t case YGEnums.UNIT_PERCENT:\r\n\t return this.value + '%';\r\n\t case YGEnums.UNIT_AUTO:\r\n\t return 'auto';\r\n\t default:\r\n\t {\r\n\t return this.value + '?';\r\n\t }\r\n\t }\r\n\t }\r\n\t }, {\r\n\t key: 'valueOf',\r\n\t value: function valueOf() {\r\n\t return this.value;\r\n\t }\r\n\t }]);\r\n\r\n\t return Value;\r\n\t }();\r\n\r\n\t var entryCommon = function (bind, lib) {\r\n\t function patch(prototype, name, fn) {\r\n\t var original = prototype[name];\r\n\r\n\t prototype[name] = function () {\n\t var arguments$1 = arguments;\n\r\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\r\n\t args[_key] = arguments$1[_key];\r\n\t }\r\n\r\n\t return fn.call.apply(fn, [this, original].concat(args));\r\n\t };\r\n\t }\r\n\r\n\t var _arr = ['setPosition', 'setMargin', 'setFlexBasis', 'setWidth', 'setHeight', 'setMinWidth', 'setMinHeight', 'setMaxWidth', 'setMaxHeight', 'setPadding'];\r\n\r\n\t var _loop = function _loop() {\r\n\t var _methods;\r\n\r\n\t var fnName = _arr[_i];\r\n\t var methods = (_methods = {}, _defineProperty(_methods, YGEnums.UNIT_POINT, lib.Node.prototype[fnName]), _defineProperty(_methods, YGEnums.UNIT_PERCENT, lib.Node.prototype[fnName + 'Percent']), _defineProperty(_methods, YGEnums.UNIT_AUTO, lib.Node.prototype[fnName + 'Auto']), _methods);\r\n\r\n\t patch(lib.Node.prototype, fnName, function (original) {\n\t var arguments$1 = arguments;\n\r\n\t for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\r\n\t args[_key2 - 1] = arguments$1[_key2];\r\n\t }\r\n\r\n\t // We patch all these functions to add support for the following calls:\r\n\t // .setWidth(100) / .setWidth(\"100%\") / .setWidth(.getWidth()) / .setWidth(\"auto\")\r\n\r\n\t var value = args.pop();\r\n\t var unit = void 0,\r\n\t asNumber = void 0;\r\n\r\n\t if (value === 'auto') {\r\n\t unit = YGEnums.UNIT_AUTO;\r\n\t asNumber = undefined;\r\n\t } else if (value instanceof Value) {\r\n\t unit = value.unit;\r\n\t asNumber = value.valueOf();\r\n\t } else {\r\n\t unit = typeof value === 'string' && value.endsWith('%') ? YGEnums.UNIT_PERCENT : YGEnums.UNIT_POINT;\r\n\t asNumber = parseFloat(value);\r\n\t if (!Number.isNaN(value) && Number.isNaN(asNumber)) {\r\n\t throw new Error('Invalid value ' + value + ' for ' + fnName);\r\n\t }\r\n\t }\r\n\r\n\t if (!methods[unit]) { throw new Error('Failed to execute \"' + fnName + '\": Unsupported unit \\'' + value + '\\''); }\r\n\r\n\t if (asNumber !== undefined) {\r\n\t var _methods$unit;\r\n\r\n\t return (_methods$unit = methods[unit]).call.apply(_methods$unit, [this].concat(args, [asNumber]));\r\n\t } else {\r\n\t var _methods$unit2;\r\n\r\n\t return (_methods$unit2 = methods[unit]).call.apply(_methods$unit2, [this].concat(args));\r\n\t }\r\n\t });\r\n\t };\r\n\r\n\t for (var _i = 0; _i < _arr.length; _i++) {\r\n\t _loop();\r\n\t }\r\n\r\n\t patch(lib.Config.prototype, 'free', function () {\r\n\t // Since we handle the memory allocation ourselves (via lib.Config.create),\r\n\t // we also need to handle the deallocation\r\n\t lib.Config.destroy(this);\r\n\t });\r\n\r\n\t patch(lib.Node, 'create', function (_, config) {\r\n\t // We decide the constructor we want to call depending on the parameters\r\n\t return config ? lib.Node.createWithConfig(config) : lib.Node.createDefault();\r\n\t });\r\n\r\n\t patch(lib.Node.prototype, 'free', function () {\r\n\t // Since we handle the memory allocation ourselves (via lib.Node.create),\r\n\t // we also need to handle the deallocation\r\n\t lib.Node.destroy(this);\r\n\t });\r\n\r\n\t patch(lib.Node.prototype, 'freeRecursive', function () {\r\n\t for (var t = 0, T = this.getChildCount(); t < T; ++t) {\r\n\t this.getChild(0).freeRecursive();\r\n\t }\r\n\t this.free();\r\n\t });\r\n\r\n\t patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) {\r\n\t // This patch is just a convenience patch, since it helps write more\r\n\t // idiomatic source code (such as .setMeasureFunc(null))\r\n\t // We also automatically convert the return value of the measureFunc\r\n\t // to a Size object, so that we can return anything that has .width and\r\n\t // .height properties\r\n\t if (measureFunc) {\r\n\t return original.call(this, function () {\r\n\t return Size.fromJS(measureFunc.apply(undefined, arguments));\r\n\t });\r\n\t } else {\r\n\t return this.unsetMeasureFunc();\r\n\t }\r\n\t });\r\n\r\n\t patch(lib.Node.prototype, 'calculateLayout', function (original) {\r\n\t var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NaN;\r\n\t var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : NaN;\r\n\t var direction = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : YGEnums.DIRECTION_LTR;\r\n\r\n\t // Just a small patch to add support for the function default parameters\r\n\t return original.call(this, width, height, direction);\r\n\t });\r\n\r\n\t return _extends({\r\n\t Config: lib.Config,\r\n\t Node: lib.Node,\r\n\t Layout: bind('Layout', Layout),\r\n\t Size: bind('Size', Size),\r\n\t Value: bind('Value', Value),\r\n\t getInstanceCount: function getInstanceCount() {\r\n\t return lib.getInstanceCount.apply(lib, arguments);\r\n\t }\r\n\t }, YGEnums);\r\n\t };\r\n\r\n\t var $module={exports:{}};\r\n\t (new Function('module', \"!function(n,e){\\\"function\\\"==typeof define&&define.amd?define([],(function(){return e})):\\\"object\\\"==typeof module&&module.exports?module.exports=e:(n.nbind=n.nbind||{}).init=e}(this,(function(Module,cb){var Module;\\\"function\\\"==typeof Module&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(n,e){return function(){n&&n.apply(this,arguments);try{Module.ccall(\\\"nbind_init\\\")}catch(n){return void e(n)}e(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb),Module||(Module=(void 0!==Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1,nodeFS,nodePath;if(Module.ENVIRONMENT)if(\\\"WEB\\\"===Module.ENVIRONMENT)ENVIRONMENT_IS_WEB=!0;else if(\\\"WORKER\\\"===Module.ENVIRONMENT)ENVIRONMENT_IS_WORKER=!0;else if(\\\"NODE\\\"===Module.ENVIRONMENT)ENVIRONMENT_IS_NODE=!0;else{if(\\\"SHELL\\\"!==Module.ENVIRONMENT)throw new Error(\\\"The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.\\\");ENVIRONMENT_IS_SHELL=!0}else ENVIRONMENT_IS_WEB=\\\"object\\\"==typeof window,ENVIRONMENT_IS_WORKER=\\\"function\\\"==typeof importScripts,ENVIRONMENT_IS_NODE=\\\"object\\\"==typeof process&&\\\"function\\\"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE)Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn),Module.read=function(n,e){nodeFS||(nodeFS={}(\\\"\\\")),nodePath||(nodePath={}(\\\"\\\")),n=nodePath.normalize(n);var r=nodeFS.readFileSync(n);return e?r:r.toString()},Module.readBinary=function(n){var e=Module.read(n,!0);return e.buffer||(e=new Uint8Array(e)),assert(e.buffer),e},Module.load=function(n){globalEval(read(n))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\\\\\\\/g,\\\"/\\\"):Module.thisProgram=\\\"unknown-program\\\"),Module.arguments=process.argv.slice(2),\\\"undefined\\\"!=typeof module&&(module.exports=Module),process.on(\\\"uncaughtException\\\",(function(n){if(!(n instanceof ExitStatus))throw n})),Module.inspect=function(){return\\\"[Emscripten Module object]\\\"};else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),\\\"undefined\\\"!=typeof printErr&&(Module.printErr=printErr),\\\"undefined\\\"!=typeof read?Module.read=read:Module.read=function(){throw\\\"no read() available\\\"},Module.readBinary=function(n){if(\\\"function\\\"==typeof readbuffer)return new Uint8Array(readbuffer(n));var e=read(n,\\\"binary\\\");return assert(\\\"object\\\"==typeof e),e},\\\"undefined\\\"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),\\\"function\\\"==typeof quit&&(Module.quit=function(n,e){quit(n)});else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw\\\"Unknown runtime environment. Where are we?\\\";if(Module.read=function(n){var e=new XMLHttpRequest;return e.open(\\\"GET\\\",n,!1),e.send(null),e.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(n){var e=new XMLHttpRequest;return e.open(\\\"GET\\\",n,!1),e.responseType=\\\"arraybuffer\\\",e.send(null),new Uint8Array(e.response)}),Module.readAsync=function(n,e,r){var t=new XMLHttpRequest;t.open(\\\"GET\\\",n,!0),t.responseType=\\\"arraybuffer\\\",t.onload=function(){200==t.status||0==t.status&&t.response?e(t.response):r()},t.onerror=r,t.send(null)},void 0!==arguments&&(Module.arguments=arguments),\\\"undefined\\\"!=typeof console)Module.print||(Module.print=function(n){console.log(n)}),Module.printErr||(Module.printErr=function(n){console.warn(n)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&\\\"undefined\\\"!=typeof dump?function(n){dump(n)}:function(n){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(n){document.title=n})}function globalEval(n){eval.call(null,n)}for(var key in!Module.load&&Module.read&&(Module.load=function(n){globalEval(Module.read(n))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram=\\\"./this.program\\\"),Module.quit||(Module.quit=function(n,e){throw e}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(n){return tempRet0=n,n},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(n){STACKTOP=n},getNativeTypeSize:function(n){switch(n){case\\\"i1\\\":case\\\"i8\\\":return 1;case\\\"i16\\\":return 2;case\\\"i32\\\":return 4;case\\\"i64\\\":return 8;case\\\"float\\\":return 4;case\\\"double\\\":return 8;default:if(\\\"*\\\"===n[n.length-1])return Runtime.QUANTUM_SIZE;if(\\\"i\\\"===n[0]){var e=parseInt(n.substr(1));return assert(e%8==0),e/8}return 0}},getNativeFieldSize:function(n){return Math.max(Runtime.getNativeTypeSize(n),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(n,e){return\\\"double\\\"===e||\\\"i64\\\"===e?7&n&&(assert(4==(7&n)),n+=4):assert(0==(3&n)),n},getAlignSize:function(n,e,r){return r||\\\"i64\\\"!=n&&\\\"double\\\"!=n?n?Math.min(e||(n?Runtime.getNativeFieldSize(n):0),Runtime.QUANTUM_SIZE):Math.min(e,8):8},dynCall:function(n,e,r){return r&&r.length?Module[\\\"dynCall_\\\"+n].apply(null,[e].concat(r)):Module[\\\"dynCall_\\\"+n].call(null,e)},functionPointers:[],addFunction:function(n){for(var e=0;e<Runtime.functionPointers.length;e++)if(!Runtime.functionPointers[e])return Runtime.functionPointers[e]=n,2*(1+e);throw\\\"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.\\\"},removeFunction:function(n){Runtime.functionPointers[(n-2)/2]=null},warnOnce:function(n){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[n]||(Runtime.warnOnce.shown[n]=1,Module.printErr(n))},funcWrappers:{},getFuncWrapper:function(n,e){if(n){assert(e),Runtime.funcWrappers[e]||(Runtime.funcWrappers[e]={});var r=Runtime.funcWrappers[e];return r[n]||(1===e.length?r[n]=function(){return Runtime.dynCall(e,n)}:2===e.length?r[n]=function(r){return Runtime.dynCall(e,n,[r])}:r[n]=function(){return Runtime.dynCall(e,n,Array.prototype.slice.call(arguments))}),r[n]}},getCompilerSetting:function(n){throw\\\"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work\\\"},stackAlloc:function(n){var e=STACKTOP;return STACKTOP=(STACKTOP=STACKTOP+n|0)+15&-16,e},staticAlloc:function(n){var e=STATICTOP;return STATICTOP=(STATICTOP=STATICTOP+n|0)+15&-16,e},dynamicAlloc:function(n){var e=HEAP32[DYNAMICTOP_PTR>>2],r=-16&(e+n+15|0);if((HEAP32[DYNAMICTOP_PTR>>2]=r,r>=TOTAL_MEMORY)&&!enlargeMemory())return HEAP32[DYNAMICTOP_PTR>>2]=e,0;return e},alignMemory:function(n,e){return n=Math.ceil(n/(e||16))*(e||16)},makeBigInt:function(n,e,r){return r?+(n>>>0)+4294967296*+(e>>>0):+(n>>>0)+4294967296*+(0|e)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0,cwrap,ccall;function assert(n,e){n||abort(\\\"Assertion failed: \\\"+e)}function getCFunc(ident){var func=Module[\\\"_\\\"+ident];if(!func)try{func=eval(\\\"_\\\"+ident)}catch(n){}return assert(func,\\\"Cannot call unknown function \\\"+ident+\\\" (perhaps LLVM optimizations or closure removed it?)\\\"),func}function setValue(n,e,r,t){switch(\\\"*\\\"===(r=r||\\\"i8\\\").charAt(r.length-1)&&(r=\\\"i32\\\"),r){case\\\"i1\\\":case\\\"i8\\\":HEAP8[n>>0]=e;break;case\\\"i16\\\":HEAP16[n>>1]=e;break;case\\\"i32\\\":HEAP32[n>>2]=e;break;case\\\"i64\\\":tempI64=[e>>>0,(tempDouble=e,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[n>>2]=tempI64[0],HEAP32[n+4>>2]=tempI64[1];break;case\\\"float\\\":HEAPF32[n>>2]=e;break;case\\\"double\\\":HEAPF64[n>>3]=e;break;default:abort(\\\"invalid type for setValue: \\\"+r)}}function getValue(n,e,r){switch(\\\"*\\\"===(e=e||\\\"i8\\\").charAt(e.length-1)&&(e=\\\"i32\\\"),e){case\\\"i1\\\":case\\\"i8\\\":return HEAP8[n>>0];case\\\"i16\\\":return HEAP16[n>>1];case\\\"i32\\\":case\\\"i64\\\":return HEAP32[n>>2];case\\\"float\\\":return HEAPF32[n>>2];case\\\"double\\\":return HEAPF64[n>>3];default:abort(\\\"invalid type for setValue: \\\"+e)}return null}!function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(n){var e=Runtime.stackAlloc(n.length);return writeArrayToMemory(n,e),e},stringToC:function(n){var e=0;if(null!=n&&0!==n){var r=1+(n.length<<2);stringToUTF8(n,e=Runtime.stackAlloc(r),r)}return e}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(n,e,r,t,i){var u=getCFunc(n),o=[],a=0;if(t)for(var f=0;f<t.length;f++){var c=toC[r[f]];c?(0===a&&(a=Runtime.stackSave()),o[f]=c(t[f])):o[f]=t[f]}var l=u.apply(null,o);if(\\\"string\\\"===e&&(l=Pointer_stringify(l)),0!==a){if(i&&i.async)return void EmterpreterAsync.asyncFinalizers.push((function(){Runtime.stackRestore(a)}));Runtime.stackRestore(a)}return l};var sourceRegex=/^function\\\\s*[a-zA-Z$_0-9]*\\\\s*\\\\(([^)]*)\\\\)\\\\s*{\\\\s*([^*]*?)[\\\\s;]*(?:return\\\\s*(.*?)[;\\\\s]*)?}$/;function parseJSFunc(n){var e=n.toString().match(sourceRegex).slice(1);return{arguments:e[0],body:e[1],returnValue:e[2]}}var JSsource=null;function ensureJSsource(){if(!JSsource)for(var n in JSsource={},JSfuncs)JSfuncs.hasOwnProperty(n)&&(JSsource[n]=parseJSFunc(JSfuncs[n]))}cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every((function(n){return\\\"number\\\"===n})),numericRet=\\\"string\\\"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map((function(n,e){return\\\"$\\\"+e})),funcstr=\\\"(function(\\\"+argNames.join(\\\",\\\")+\\\") {\\\",nargs=argTypes.length;if(!numericArgs){ensureJSsource(),funcstr+=\\\"var stack = \\\"+JSsource.stackSave.body+\\\";\\\";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if(\\\"number\\\"!==type){var convertCode=JSsource[type+\\\"ToC\\\"];funcstr+=\\\"var \\\"+convertCode.arguments+\\\" = \\\"+arg+\\\";\\\",funcstr+=convertCode.body+\\\";\\\",funcstr+=arg+\\\"=(\\\"+convertCode.returnValue+\\\");\\\"}}}var cfuncname=parseJSFunc((function(){return cfunc})).returnValue;if(funcstr+=\\\"var ret = \\\"+cfuncname+\\\"(\\\"+argNames.join(\\\",\\\")+\\\");\\\",!numericRet){var strgfy=parseJSFunc((function(){return Pointer_stringify})).returnValue;funcstr+=\\\"ret = \\\"+strgfy+\\\"(ret);\\\"}return numericArgs||(ensureJSsource(),funcstr+=JSsource.stackRestore.body.replace(\\\"()\\\",\\\"(stack)\\\")+\\\";\\\"),funcstr+=\\\"return ret})\\\",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;function allocate(n,e,r,t){var i,u;\\\"number\\\"==typeof n?(i=!0,u=n):(i=!1,u=n.length);var o,a=\\\"string\\\"==typeof e?e:null;if(o=r==ALLOC_NONE?t:[\\\"function\\\"==typeof _malloc?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===r?ALLOC_STATIC:r](Math.max(u,a?1:e.length)),i){var f;t=o;for(assert(0==(3&o)),f=o+(-4&u);t<f;t+=4)HEAP32[t>>2]=0;for(f=o+u;t<f;)HEAP8[t++>>0]=0;return o}if(\\\"i8\\\"===a)return n.subarray||n.slice?HEAPU8.set(n,o):HEAPU8.set(new Uint8Array(n),o),o;for(var c,l,s,d=0;d<u;){var _=n[d];\\\"function\\\"==typeof _&&(_=Runtime.getFunctionIndex(_)),0!==(c=a||e[d])?(\\\"i64\\\"==c&&(c=\\\"i32\\\"),setValue(o+d,_,c),s!==c&&(l=Runtime.getNativeTypeSize(c),s=c),d+=l):d++}return o}function getMemory(n){return staticSealed?runtimeInitialized?_malloc(n):Runtime.dynamicAlloc(n):Runtime.staticAlloc(n)}function Pointer_stringify(n,e){if(0===e||!n)return\\\"\\\";for(var r,t=0,i=0;t|=r=HEAPU8[n+i>>0],(0!=r||e)&&(i++,!e||i!=e););e||(e=i);var u=\\\"\\\";if(t<128){for(var o;e>0;)o=String.fromCharCode.apply(String,HEAPU8.subarray(n,n+Math.min(e,1024))),u=u?u+o:o,n+=1024,e-=1024;return u}return Module.UTF8ToString(n)}function AsciiToString(n){for(var e=\\\"\\\";;){var r=HEAP8[n++>>0];if(!r)return e;e+=String.fromCharCode(r)}}function stringToAscii(n,e){return writeAsciiToMemory(n,e,!1)}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii;var UTF8Decoder=\\\"undefined\\\"!=typeof TextDecoder?new TextDecoder(\\\"utf8\\\"):void 0;function UTF8ArrayToString(n,e){for(var r=e;n[r];)++r;if(r-e>16&&n.subarray&&UTF8Decoder)return UTF8Decoder.decode(n.subarray(e,r));for(var t,i,u,o,a,f=\\\"\\\";;){if(!(t=n[e++]))return f;if(128&t)if(i=63&n[e++],192!=(224&t))if(u=63&n[e++],224==(240&t)?t=(15&t)<<12|i<<6|u:(o=63&n[e++],240==(248&t)?t=(7&t)<<18|i<<12|u<<6|o:(a=63&n[e++],t=248==(252&t)?(3&t)<<24|i<<18|u<<12|o<<6|a:(1&t)<<30|i<<24|u<<18|o<<12|a<<6|63&n[e++])),t<65536)f+=String.fromCharCode(t);else{var c=t-65536;f+=String.fromCharCode(55296|c>>10,56320|1023&c)}else f+=String.fromCharCode((31&t)<<6|i);else f+=String.fromCharCode(t)}}function UTF8ToString(n){return UTF8ArrayToString(HEAPU8,n)}function stringToUTF8Array(n,e,r,t){if(!(t>0))return 0;for(var i=r,u=r+t-1,o=0;o<n.length;++o){var a=n.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&n.charCodeAt(++o)),a<=127){if(r>=u)break;e[r++]=a}else if(a<=2047){if(r+1>=u)break;e[r++]=192|a>>6,e[r++]=128|63&a}else if(a<=65535){if(r+2>=u)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a}else if(a<=2097151){if(r+3>=u)break;e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}else if(a<=67108863){if(r+4>=u)break;e[r++]=248|a>>24,e[r++]=128|a>>18&63,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}else{if(r+5>=u)break;e[r++]=252|a>>30,e[r++]=128|a>>24&63,e[r++]=128|a>>18&63,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}}return e[r]=0,r-i}function stringToUTF8(n,e,r){return stringToUTF8Array(n,HEAPU8,e,r)}function lengthBytesUTF8(n){for(var e=0,r=0;r<n.length;++r){var t=n.charCodeAt(r);t>=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&n.charCodeAt(++r)),t<=127?++e:e+=t<=2047?2:t<=65535?3:t<=2097151?4:t<=67108863?5:6}return e}Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder=\\\"undefined\\\"!=typeof TextDecoder?new TextDecoder(\\\"utf-16le\\\"):void 0,HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;function demangle(n){var e=Module.___cxa_demangle||Module.__cxa_demangle;if(e){try{var r=n.substr(1),t=lengthBytesUTF8(r)+1,i=_malloc(t);stringToUTF8(r,i,t);var u=_malloc(4),o=e(i,0,0,u);if(0===getValue(u,\\\"i32\\\")&&o)return Pointer_stringify(o)}catch(n){}finally{i&&_free(i),u&&_free(u),o&&_free(o)}return n}return Runtime.warnOnce(\\\"warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling\\\"),n}function demangleAll(n){return n.replace(/__Z[\\\\w\\\\d_]+/g,(function(n){var e=demangle(n);return n===e?n:n+\\\" [\\\"+e+\\\"]\\\"}))}function jsStackTrace(){var n=new Error;if(!n.stack){try{throw new Error(0)}catch(e){n=e}if(!n.stack)return\\\"(no stack trace available)\\\"}return n.stack.toString()}function stackTrace(){var n=jsStackTrace();return Module.extraStackTrace&&(n+=\\\"\\\\n\\\"+Module.extraStackTrace()),demangleAll(n)}function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}function abortOnCannotGrowMemory(){abort(\\\"Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value \\\"+TOTAL_MEMORY+\\\", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 \\\")}function enlargeMemory(){abortOnCannotGrowMemory()}Module.stackTrace=stackTrace,STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;function getTotalMemory(){return TOTAL_MEMORY}if(TOTAL_MEMORY<TOTAL_STACK&&Module.printErr(\\\"TOTAL_MEMORY should be larger than TOTAL_STACK, was \\\"+TOTAL_MEMORY+\\\"! (TOTAL_STACK=\\\"+TOTAL_STACK+\\\")\\\"),buffer=Module.buffer?Module.buffer:new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews(),HEAP32[0]=1668509029,HEAP16[1]=25459,115!==HEAPU8[2]||99!==HEAPU8[3])throw\\\"Runtime error: expected the system to be little-endian!\\\";function callRuntimeCallbacks(n){for(;n.length>0;){var e=n.shift();if(\\\"function\\\"!=typeof e){var r=e.func;\\\"number\\\"==typeof r?void 0===e.arg?Module.dynCall_v(r):Module.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(\\\"function\\\"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(\\\"function\\\"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(n){__ATPRERUN__.unshift(n)}function addOnInit(n){__ATINIT__.unshift(n)}function addOnPreMain(n){__ATMAIN__.unshift(n)}function addOnExit(n){__ATEXIT__.unshift(n)}function addOnPostRun(n){__ATPOSTRUN__.unshift(n)}function intArrayFromString(n,e,r){var t=r>0?r:lengthBytesUTF8(n)+1,i=new Array(t),u=stringToUTF8Array(n,i,0,i.length);return e&&(i.length=u),i}function intArrayToString(n){for(var e=[],r=0;r<n.length;r++){var t=n[r];t>255&&(t&=255),e.push(String.fromCharCode(t))}return e.join(\\\"\\\")}function writeStringToMemory(n,e,r){var t,i;Runtime.warnOnce(\\\"writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!\\\"),r&&(i=e+lengthBytesUTF8(n),t=HEAP8[i]),stringToUTF8(n,e,1/0),r&&(HEAP8[i]=t)}function writeArrayToMemory(n,e){HEAP8.set(n,e)}function writeAsciiToMemory(n,e,r){for(var t=0;t<n.length;++t)HEAP8[e++>>0]=n.charCodeAt(t);r||(HEAP8[e>>0]=0)}if(Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(n,e){var r=65535&n,t=65535&e;return r*t+((n>>>16)*t+r*(e>>>16)<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(n){return froundBuffer[0]=n,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(n){n>>>=0;for(var e=0;e<32;e++)if(n&1<<31-e)return e;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(n){return n}function addRunDependency(n){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(n){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(n,e,r,t,i,u,o,a){return _nbind.callbackSignatureList[n].apply(this,arguments)}];function _emscripten_asm_const_iiiiiiii(n,e,r,t,i,u,o,a){return ASM_CONSTS[n](e,r,t,i,u,o,a)}function _emscripten_asm_const_iiiii(n,e,r,t,i){return ASM_CONSTS[n](e,r,t,i)}function _emscripten_asm_const_iiidddddd(n,e,r,t,i,u,o,a,f){return ASM_CONSTS[n](e,r,t,i,u,o,a,f)}function _emscripten_asm_const_iiididi(n,e,r,t,i,u,o){return ASM_CONSTS[n](e,r,t,i,u,o)}function _emscripten_asm_const_iiii(n,e,r,t){return ASM_CONSTS[n](e,r,t)}function _emscripten_asm_const_iiiid(n,e,r,t,i){return ASM_CONSTS[n](e,r,t,i)}function _emscripten_asm_const_iiiiii(n,e,r,t,i,u){return ASM_CONSTS[n](e,r,t,i,u)}STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+12800,__ATINIT__.push({func:function(){__GLOBAL__sub_I_Yoga_cpp()}},{func:function(){__GLOBAL__sub_I_nbind_cc()}},{func:function(){__GLOBAL__sub_I_common_cc()}},{func:function(){__GLOBAL__sub_I_Binding_cc()}}),allocate([0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,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,192,127,0,0,192,127,0,0,192,127,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,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,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,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,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,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,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,192,127,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,128,191,0,0,128,191,0,0,192,127,0,0,0,0,0,0,0,0,0,0,128,63,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,190,12,0,0,200,12,0,0,208,12,0,0,216,12,0,0,230,12,0,0,242,12,0,0,1,0,0,0,3,0,0,0,0,0,0,0,2,0,0,0,0,0,192,127,3,0,0,0,180,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,182,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,1,0,0,0,4,0,0,0,183,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,184,45,0,0,185,45,0,0,181,45,0,0,181,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,148,4,0,0,3,0,0,0,187,45,0,0,164,4,0,0,188,45,0,0,2,0,0,0,189,45,0,0,164,4,0,0,188,45,0,0,185,45,0,0,164,4,0,0,185,45,0,0,164,4,0,0,188,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,7,0,0,0,183,45,0,0,182,45,0,0,181,45,0,0,190,45,0,0,190,45,0,0,182,45,0,0,182,45,0,0,185,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,185,45,0,0,48,5,0,0,3,0,0,0,56,5,0,0,1,0,0,0,189,45,0,0,185,45,0,0,164,4,0,0,76,5,0,0,2,0,0,0,191,45,0,0,186,45,0,0,182,45,0,0,185,45,0,0,192,45,0,0,185,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,76,5,0,0,76,5,0,0,136,5,0,0,182,45,0,0,181,45,0,0,2,0,0,0,190,45,0,0,136,5,0,0,56,19,0,0,156,5,0,0,2,0,0,0,184,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,9,0,0,0,1,0,0,0,10,0,0,0,204,5,0,0,181,45,0,0,181,45,0,0,2,0,0,0,180,45,0,0,204,5,0,0,2,0,0,0,195,45,0,0,236,5,0,0,97,19,0,0,198,45,0,0,211,45,0,0,212,45,0,0,213,45,0,0,214,45,0,0,215,45,0,0,188,45,0,0,182,45,0,0,216,45,0,0,217,45,0,0,218,45,0,0,219,45,0,0,192,45,0,0,181,45,0,0,0,0,0,0,185,45,0,0,110,19,0,0,186,45,0,0,115,19,0,0,221,45,0,0,120,19,0,0,148,4,0,0,132,19,0,0,96,6,0,0,145,19,0,0,222,45,0,0,164,19,0,0,223,45,0,0,173,19,0,0,0,0,0,0,3,0,0,0,104,6,0,0,1,0,0,0,187,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,12,0,0,0,1,0,0,0,13,0,0,0,185,45,0,0,224,45,0,0,164,6,0,0,188,45,0,0,172,6,0,0,180,6,0,0,2,0,0,0,188,6,0,0,7,0,0,0,224,45,0,0,7,0,0,0,164,6,0,0,1,0,0,0,213,45,0,0,185,45,0,0,224,45,0,0,172,6,0,0,185,45,0,0,224,45,0,0,164,6,0,0,185,45,0,0,224,45,0,0,211,45,0,0,211,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,172,6,0,0,222,45,0,0,211,45,0,0,224,45,0,0,188,45,0,0,222,45,0,0,211,45,0,0,40,7,0,0,188,45,0,0,2,0,0,0,224,45,0,0,185,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,222,45,0,0,224,45,0,0,148,4,0,0,185,45,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,185,45,0,0,164,6,0,0,148,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,14,0,0,0,15,0,0,0,1,0,0,0,16,0,0,0,148,7,0,0,2,0,0,0,225,45,0,0,183,45,0,0,188,45,0,0,168,7,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,234,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,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,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,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,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,148,45,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,28,9,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,242,45,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,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,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,110,111,100,101,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,119,104,105,99,104,32,115,116,105,108,108,32,104,97,115,32,99,104,105,108,100,114,101,110,32,97,116,116,97,99,104,101,100,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,115,116,105,108,108,32,97,116,116,97,99,104,101,100,32,116,111,32,97,32,112,97,114,101,110,116,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,99,111,110,102,105,103,0,67,97,110,110,111,116,32,115,101,116,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,67,104,105,108,100,32,97,108,114,101,97,100,121,32,104,97,115,32,97,32,112,97,114,101,110,116,44,32,105,116,32,109,117,115,116,32,98,101,32,114,101,109,111,118,101,100,32,102,105,114,115,116,46,0,67,97,110,110,111,116,32,97,100,100,32,99,104,105,108,100,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,79,110,108,121,32,108,101,97,102,32,110,111,100,101,115,32,119,105,116,104,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,115,104,111,117,108,100,32,109,97,110,117,97,108,108,121,32,109,97,114,107,32,116,104,101,109,115,101,108,118,101,115,32,97,115,32,100,105,114,116,121,0,67,97,110,110,111,116,32,103,101,116,32,108,97,121,111,117,116,32,112,114,111,112,101,114,116,105,101,115,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,37,115,37,100,46,123,91,115,107,105,112,112,101,100,93,32,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,61,62,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,37,115,37,100,46,123,37,115,0,42,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,37,115,10,0,37,115,37,100,46,125,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,79,117,116,32,111,102,32,99,97,99,104,101,32,101,110,116,114,105,101,115,33,10,0,83,99,97,108,101,32,102,97,99,116,111,114,32,115,104,111,117,108,100,32,110,111,116,32,98,101,32,108,101,115,115,32,116,104,97,110,32,122,101,114,111,0,105,110,105,116,105,97,108,0,37,115,10,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,85,78,68,69,70,73,78,69,68,0,69,88,65,67,84,76,89,0,65,84,95,77,79,83,84,0,76,65,89,95,85,78,68,69,70,73,78,69,68,0,76,65,89,95,69,88,65,67,84,76,89,0,76,65,89,95,65,84,95,77,79,83,84,0,97,118,97,105,108,97,98,108,101,87,105,100,116,104,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,119,105,100,116,104,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,97,118,97,105,108,97,98,108,101,72,101,105,103,104,116,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,104,101,105,103,104,116,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,102,108,101,120,0,115,116,114,101,116,99,104,0,109,117,108,116,105,108,105,110,101,45,115,116,114,101,116,99,104,0,69,120,112,101,99,116,101,100,32,110,111,100,101,32,116,111,32,104,97,118,101,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,0,109,101,97,115,117,114,101,0,69,120,112,101,99,116,32,99,117,115,116,111,109,32,98,97,115,101,108,105,110,101,32,102,117,110,99,116,105,111,110,32,116,111,32,110,111,116,32,114,101,116,117,114,110,32,78,97,78,0,97,98,115,45,109,101,97,115,117,114,101,0,97,98,115,45,108,97,121,111,117,116,0,78,111,100,101,0,99,114,101,97,116,101,68,101,102,97,117,108,116,0,99,114,101,97,116,101,87,105,116,104,67,111,110,102,105,103,0,100,101,115,116,114,111,121,0,114,101,115,101,116,0,99,111,112,121,83,116,121,108,101,0,115,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,115,101,116,80,111,115,105,116,105,111,110,0,115,101,116,80,111,115,105,116,105,111,110,80,101,114,99,101,110,116,0,115,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,115,101,116,65,108,105,103,110,73,116,101,109,115,0,115,101,116,65,108,105,103,110,83,101,108,102,0,115,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,115,101,116,70,108,101,120,87,114,97,112,0,115,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,115,101,116,77,97,114,103,105,110,0,115,101,116,77,97,114,103,105,110,80,101,114,99,101,110,116,0,115,101,116,77,97,114,103,105,110,65,117,116,111,0,115,101,116,79,118,101,114,102,108,111,119,0,115,101,116,68,105,115,112,108,97,121,0,115,101,116,70,108,101,120,0,115,101,116,70,108,101,120,66,97,115,105,115,0,115,101,116,70,108,101,120,66,97,115,105,115,80,101,114,99,101,110,116,0,115,101,116,70,108,101,120,71,114,111,119,0,115,101,116,70,108,101,120,83,104,114,105,110,107,0,115,101,116,87,105,100,116,104,0,115,101,116,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,87,105,100,116,104,65,117,116,111,0,115,101,116,72,101,105,103,104,116,0,115,101,116,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,72,101,105,103,104,116,65,117,116,111,0,115,101,116,77,105,110,87,105,100,116,104,0,115,101,116,77,105,110,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,105,110,72,101,105,103,104,116,0,115,101,116,77,105,110,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,77,97,120,87,105,100,116,104,0,115,101,116,77,97,120,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,97,120,72,101,105,103,104,116,0,115,101,116,77,97,120,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,65,115,112,101,99,116,82,97,116,105,111,0,115,101,116,66,111,114,100,101,114,0,115,101,116,80,97,100,100,105,110,103,0,115,101,116,80,97,100,100,105,110,103,80,101,114,99,101,110,116,0,103,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,103,101,116,80,111,115,105,116,105,111,110,0,103,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,103,101,116,65,108,105,103,110,73,116,101,109,115,0,103,101,116,65,108,105,103,110,83,101,108,102,0,103,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,103,101,116,70,108,101,120,87,114,97,112,0,103,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,103,101,116,77,97,114,103,105,110,0,103,101,116,70,108,101,120,66,97,115,105,115,0,103,101,116,70,108,101,120,71,114,111,119,0,103,101,116,70,108,101,120,83,104,114,105,110,107,0,103,101,116,87,105,100,116,104,0,103,101,116,72,101,105,103,104,116,0,103,101,116,77,105,110,87,105,100,116,104,0,103,101,116,77,105,110,72,101,105,103,104,116,0,103,101,116,77,97,120,87,105,100,116,104,0,103,101,116,77,97,120,72,101,105,103,104,116,0,103,101,116,65,115,112,101,99,116,82,97,116,105,111,0,103,101,116,66,111,114,100,101,114,0,103,101,116,79,118,101,114,102,108,111,119,0,103,101,116,68,105,115,112,108,97,121,0,103,101,116,80,97,100,100,105,110,103,0,105,110,115,101,114,116,67,104,105,108,100,0,114,101,109,111,118,101,67,104,105,108,100,0,103,101,116,67,104,105,108,100,67,111,117,110,116,0,103,101,116,80,97,114,101,110,116,0,103,101,116,67,104,105,108,100,0,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,117,110,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,109,97,114,107,68,105,114,116,121,0,105,115,68,105,114,116,121,0,99,97,108,99,117,108,97,116,101,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,76,101,102,116,0,103,101,116,67,111,109,112,117,116,101,100,82,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,84,111,112,0,103,101,116,67,111,109,112,117,116,101,100,66,111,116,116,111,109,0,103,101,116,67,111,109,112,117,116,101,100,87,105,100,116,104,0,103,101,116,67,111,109,112,117,116,101,100,72,101,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,77,97,114,103,105,110,0,103,101,116,67,111,109,112,117,116,101,100,66,111,114,100,101,114,0,103,101,116,67,111,109,112,117,116,101,100,80,97,100,100,105,110,103,0,67,111,110,102,105,103,0,99,114,101,97,116,101,0,115,101,116,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,115,101,116,80,111,105,110,116,83,99,97,108,101,70,97,99,116,111,114,0,105,115,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,86,97,108,117,101,0,76,97,121,111,117,116,0,83,105,122,101,0,103,101,116,73,110,115,116,97,110,99,101,67,111,117,110,116,0,73,110,116,54,52,0,1,1,1,2,2,4,4,4,4,8,8,4,8,118,111,105,100,0,98,111,111,108,0,115,116,100,58,58,115,116,114,105,110,103,0,99,98,70,117,110,99,116,105,111,110,32,38,0,99,111,110,115,116,32,99,98,70,117,110,99,116,105,111,110,32,38,0,69,120,116,101,114,110,97,108,0,66,117,102,102,101,114,0,78,66,105,110,100,73,68,0,78,66,105,110,100,0,98,105,110,100,95,118,97,108,117,101,0,114,101,102,108,101,99,116,0,113,117,101,114,121,84,121,112,101,0,108,97,108,108,111,99,0,108,114,101,115,101,116,0,123,114,101,116,117,114,110,40,95,110,98,105,110,100,46,99,97,108,108,98,97,99,107,83,105,103,110,97,116,117,114,101,76,105,115,116,91,36,48,93,46,97,112,112,108,121,40,116,104,105,115,44,97,114,103,117,109,101,110,116,115,41,41,59,125,0,95,110,98,105,110,100,95,110,101,119,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,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,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,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,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,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,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,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,18,0,0,0,18,18,18,0,0,0,0,0,0,9,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,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,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,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0],\\\"i8\\\",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;function _atexit(n,e){__ATEXIT__.unshift({func:n,arg:e})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function _abort(){Module.abort()}function __ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj(){Module.printErr(\\\"missing function: _ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj\\\"),abort(-1)}function __decorate(n,e,r,t){var i,u=arguments.length,o=u<3?e:null===t?t=Object.getOwnPropertyDescriptor(e,r):t;if(\\\"object\\\"==typeof Reflect&&\\\"function\\\"==typeof Reflect.decorate)o=Reflect.decorate(n,e,r,t);else for(var a=n.length-1;a>=0;a--)(i=n[a])&&(o=(u<3?i(o):u>3?i(e,r,o):i(e,r))||o);return u>3&&o&&Object.defineProperty(e,r,o),o}function _defineHidden(n){return function(e,r){Object.defineProperty(e,r,{configurable:!1,enumerable:!1,value:n,writable:!0})}}STATICTOP+=16;var _nbind={};function __nbind_free_external(n){_nbind.externalList[n].dereference(n)}function __nbind_reference_external(n){_nbind.externalList[n].reference()}function _llvm_stackrestore(n){var e=_llvm_stacksave,r=e.LLVM_SAVEDSTACKS[n];e.LLVM_SAVEDSTACKS.splice(n,1),Runtime.stackRestore(r)}function __nbind_register_pool(n,e,r,t){_nbind.Pool.pageSize=n,_nbind.Pool.usedPtr=e/4,_nbind.Pool.rootPtr=r,_nbind.Pool.pagePtr=t/4,HEAP32[e/4]=16909060,1==HEAP8[e]&&(_nbind.bigEndian=!0),HEAP32[e/4]=0,_nbind.makeTypeKindTbl=((i={})[1024]=_nbind.PrimitiveType,i[64]=_nbind.Int64Type,i[2048]=_nbind.BindClass,i[3072]=_nbind.BindClassPtr,i[4096]=_nbind.SharedClassPtr,i[5120]=_nbind.ArrayType,i[6144]=_nbind.ArrayType,i[7168]=_nbind.CStringType,i[9216]=_nbind.CallbackType,i[10240]=_nbind.BindType,i),_nbind.makeTypeNameTbl={Buffer:_nbind.BufferType,External:_nbind.ExternalType,Int64:_nbind.Int64Type,_nbind_new:_nbind.CreateValueType,bool:_nbind.BooleanType,\\\"cbFunction &\\\":_nbind.CallbackType,\\\"const cbFunction &\\\":_nbind.CallbackType,\\\"const std::string &\\\":_nbind.StringType,\\\"std::string\\\":_nbind.StringType},Module.toggleLightGC=_nbind.toggleLightGC,_nbind.callUpcast=Module.dynCall_ii;var i,u=_nbind.makeType(_nbind.constructType,{flags:2048,id:0,name:\\\"\\\"});u.proto=Module,_nbind.BindClass.list.push(u)}function _emscripten_set_main_loop_timing(n,e){if(Browser.mainLoop.timingMode=n,Browser.mainLoop.timingValue=e,!Browser.mainLoop.func)return 1;if(0==n)Browser.mainLoop.scheduler=function(){var n=0|Math.max(0,Browser.mainLoop.tickStartTime+e-_emscripten_get_now());setTimeout(Browser.mainLoop.runner,n)},Browser.mainLoop.method=\\\"timeout\\\";else if(1==n)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method=\\\"rAF\\\";else if(2==n){if(!window.setImmediate){var r=[];window.addEventListener(\\\"message\\\",(function(n){n.source===window&&\\\"setimmediate\\\"===n.data&&(n.stopPropagation(),r.shift()())}),!0),window.setImmediate=function(n){r.push(n),ENVIRONMENT_IS_WORKER?(void 0===Module.setImmediates&&(Module.setImmediates=[]),Module.setImmediates.push(n),window.postMessage({target:\\\"setimmediate\\\"})):window.postMessage(\\\"setimmediate\\\",\\\"*\\\")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method=\\\"immediate\\\"}return 0}function _emscripten_get_now(){abort()}function _emscripten_set_main_loop(n,e,r,t,i){var u;Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,\\\"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.\\\"),Browser.mainLoop.func=n,Browser.mainLoop.arg=t,u=void 0!==t?function(){Module.dynCall_vi(n,t)}:function(){Module.dynCall_v(n)};var o=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT)if(Browser.mainLoop.queue.length>0){var n=Date.now(),e=Browser.mainLoop.queue.shift();if(e.func(e.arg),Browser.mainLoop.remainingBlockers){var r=Browser.mainLoop.remainingBlockers,t=r%1==0?r-1:Math.floor(r);e.counted?Browser.mainLoop.remainingBlockers=t:(t+=.5,Browser.mainLoop.remainingBlockers=(8*r+t)/9)}if(console.log('main loop blocker \\\"'+e.name+'\\\" took '+(Date.now()-n)+\\\" ms\\\"),Browser.mainLoop.updateStatus(),o<Browser.mainLoop.currentlyRunningMainloop)return;setTimeout(Browser.mainLoop.runner,0)}else o<Browser.mainLoop.currentlyRunningMainloop||(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,1==Browser.mainLoop.timingMode&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0?Browser.mainLoop.scheduler():(0==Browser.mainLoop.timingMode&&(Browser.mainLoop.tickStartTime=_emscripten_get_now()),\\\"timeout\\\"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr(\\\"Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!\\\"),Browser.mainLoop.method=\\\"\\\"),Browser.mainLoop.runIter(u),o<Browser.mainLoop.currentlyRunningMainloop||(\\\"object\\\"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())))},i||(e&&e>0?_emscripten_set_main_loop_timing(0,1e3/e):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),r)throw\\\"SimulateInfiniteLoop\\\"}var Browser={mainLoop:{scheduler:null,method:\\\"\\\",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var n=Browser.mainLoop.timingMode,e=Browser.mainLoop.timingValue,r=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(r,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(n,e),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var n=Module.statusMessage||\\\"Please wait...\\\",e=Browser.mainLoop.remainingBlockers,r=Browser.mainLoop.expectedBlockers;e?e<r?Module.setStatus(n+\\\" (\\\"+(r-e)+\\\"/\\\"+r+\\\")\\\"):Module.setStatus(n):Module.setStatus(\\\"\\\")}},runIter:function(n){if(!ABORT){if(Module.preMainLoop)if(!1===Module.preMainLoop())return;try{n()}catch(n){if(n instanceof ExitStatus)return;throw n&&\\\"object\\\"==typeof n&&n.stack&&Module.printErr(\\\"exception thrown: \\\"+[n,n.stack]),n}Module.postMainLoop&&Module.postMainLoop()}}},isFullscreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(n){Browser.hasBlobConstructor=!1,console.log(\\\"warning: no blob constructor, cannot create blobs with mimetypes\\\")}Browser.BlobBuilder=\\\"undefined\\\"!=typeof MozBlobBuilder?MozBlobBuilder:\\\"undefined\\\"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log(\\\"warning: no BlobBuilder\\\"),Browser.URLObject=\\\"undefined\\\"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||void 0!==Browser.URLObject||(console.log(\\\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\\\"),Module.noImageDecoding=!0);var n={canHandle:function(n){return!Module.noImageDecoding&&/\\\\.(jpg|jpeg|png|bmp)$/i.test(n)},handle:function(n,e,r,t){var i=null;if(Browser.hasBlobConstructor)try{(i=new Blob([n],{type:Browser.getMimetype(e)})).size!==n.length&&(i=new Blob([new Uint8Array(n).buffer],{type:Browser.getMimetype(e)}))}catch(n){Runtime.warnOnce(\\\"Blob constructor present but fails: \\\"+n+\\\"; falling back to blob builder\\\")}if(!i){var u=new Browser.BlobBuilder;u.append(new Uint8Array(n).buffer),i=u.getBlob()}var o=Browser.URLObject.createObjectURL(i),a=new Image;a.onload=function(){assert(a.complete,\\\"Image \\\"+e+\\\" could not be decoded\\\");var t=document.createElement(\\\"canvas\\\");t.width=a.width,t.height=a.height,t.getContext(\\\"2d\\\").drawImage(a,0,0),Module.preloadedImages[e]=t,Browser.URLObject.revokeObjectURL(o),r&&r(n)},a.onerror=function(n){console.log(\\\"Image \\\"+o+\\\" could not be decoded\\\"),t&&t()},a.src=o}};Module.preloadPlugins.push(n);var e={canHandle:function(n){return!Module.noAudioDecoding&&n.substr(-4)in{\\\".ogg\\\":1,\\\".wav\\\":1,\\\".mp3\\\":1}},handle:function(n,e,r,t){var i=!1;function u(t){i||(i=!0,Module.preloadedAudios[e]=t,r&&r(n))}function o(){i||(i=!0,Module.preloadedAudios[e]=new Audio,t&&t())}if(!Browser.hasBlobConstructor)return o();try{var a=new Blob([n],{type:Browser.getMimetype(e)})}catch(n){return o()}var f=Browser.URLObject.createObjectURL(a),c=new Audio;c.addEventListener(\\\"canplaythrough\\\",(function(){u(c)}),!1),c.onerror=function(r){i||(console.log(\\\"warning: browser could not fully decode audio \\\"+e+\\\", trying slower base64 approach\\\"),c.src=\\\"data:audio/x-\\\"+e.substr(-3)+\\\";base64,\\\"+function(n){for(var e=\\\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\\\",r=\\\"\\\",t=0,i=0,u=0;u<n.length;u++)for(t=t<<8|n[u],i+=8;i>=6;){var o=t>>i-6&63;i-=6,r+=e[o]}return 2==i?(r+=e[(3&t)<<4],r+=\\\"==\\\"):4==i&&(r+=e[(15&t)<<2],r+=\\\"=\\\"),r}(n),u(c))},c.src=f,Browser.safeSetTimeout((function(){u(c)}),1e4)}};Module.preloadPlugins.push(e);var r=Module.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener(\\\"pointerlockchange\\\",t,!1),document.addEventListener(\\\"mozpointerlockchange\\\",t,!1),document.addEventListener(\\\"webkitpointerlockchange\\\",t,!1),document.addEventListener(\\\"mspointerlockchange\\\",t,!1),Module.elementPointerLock&&r.addEventListener(\\\"click\\\",(function(n){!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),n.preventDefault())}),!1))}function t(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}},createContext:function(n,e,r,t){if(e&&Module.ctx&&n==Module.canvas)return Module.ctx;var i,u;if(e){var o={antialias:!1,alpha:!1};if(t)for(var a in t)o[a]=t[a];(u=GL.createContext(n,o))&&(i=GL.getContext(u).GLctx)}else i=n.getContext(\\\"2d\\\");return i?(r&&(e||assert(\\\"undefined\\\"==typeof GLctx,\\\"cannot set in module if GLctx is used, but we are a non-GL context that would replace it\\\"),Module.ctx=i,e&&GL.makeContextCurrent(u),Module.useWebGL=e,Browser.moduleContextCreatedCallbacks.forEach((function(n){n()})),Browser.init()),i):null},destroyContext:function(n,e,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(n,e,r){Browser.lockPointer=n,Browser.resizeCanvas=e,Browser.vrDevice=r,void 0===Browser.lockPointer&&(Browser.lockPointer=!0),void 0===Browser.resizeCanvas&&(Browser.resizeCanvas=!1),void 0===Browser.vrDevice&&(Browser.vrDevice=null);var t=Module.canvas;function i(){Browser.isFullscreen=!1;var n=t.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===n?(t.exitFullscreen=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){},t.exitFullscreen=t.exitFullscreen.bind(document),Browser.lockPointer&&t.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas&&Browser.setFullscreenCanvasSize()):(n.parentNode.insertBefore(t,n),n.parentNode.removeChild(n),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullscreen),Module.onFullscreen&&Module.onFullscreen(Browser.isFullscreen),Browser.updateCanvasDimensions(t)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener(\\\"fullscreenchange\\\",i,!1),document.addEventListener(\\\"mozfullscreenchange\\\",i,!1),document.addEventListener(\\\"webkitfullscreenchange\\\",i,!1),document.addEventListener(\\\"MSFullscreenChange\\\",i,!1));var u=document.createElement(\\\"div\\\");t.parentNode.insertBefore(u,t),u.appendChild(t),u.requestFullscreen=u.requestFullscreen||u.mozRequestFullScreen||u.msRequestFullscreen||(u.webkitRequestFullscreen?function(){u.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(u.webkitRequestFullScreen?function(){u.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?u.requestFullscreen({vrDisplay:r}):u.requestFullscreen()},requestFullScreen:function(n,e,r){return Module.printErr(\\\"Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.\\\"),Browser.requestFullScreen=function(n,e,r){return Browser.requestFullscreen(n,e,r)},Browser.requestFullscreen(n,e,r)},nextRAF:0,fakeRequestAnimationFrame:function(n){var e=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=e+1e3/60;else for(;e+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var r=Math.max(Browser.nextRAF-e,0);setTimeout(n,r)},requestAnimationFrame:function(n){\\\"undefined\\\"==typeof window?Browser.fakeRequestAnimationFrame(n):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(n))},safeCallback:function(n){return function(){if(!ABORT)return n.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var n=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],n.forEach((function(n){n()}))}},safeRequestAnimationFrame:function(n){return Browser.requestAnimationFrame((function(){ABORT||(Browser.allowAsyncCallbacks?n():Browser.queuedAsyncCallbacks.push(n))}))},safeSetTimeout:function(n,e){return Module.noExitRuntime=!0,setTimeout((function(){ABORT||(Browser.allowAsyncCallbacks?n():Browser.queuedAsyncCallbacks.push(n))}),e)},safeSetInterval:function(n,e){return Module.noExitRuntime=!0,setInterval((function(){ABORT||Browser.allowAsyncCallbacks&&n()}),e)},getMimetype:function(n){return{jpg:\\\"image/jpeg\\\",jpeg:\\\"image/jpeg\\\",png:\\\"image/png\\\",bmp:\\\"image/bmp\\\",ogg:\\\"audio/ogg\\\",wav:\\\"audio/wav\\\",mp3:\\\"audio/mpeg\\\"}[n.substr(n.lastIndexOf(\\\".\\\")+1)]},getUserMedia:function(n){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(n)},getMovementX:function(n){return n.movementX||n.mozMovementX||n.webkitMovementX||0},getMovementY:function(n){return n.movementY||n.mozMovementY||n.webkitMovementY||0},getMouseWheelDelta:function(n){var e=0;switch(n.type){case\\\"DOMMouseScroll\\\":e=n.detail;break;case\\\"mousewheel\\\":e=n.wheelDelta;break;case\\\"wheel\\\":e=n.deltaY;break;default:throw\\\"unrecognized mouse wheel event: \\\"+n.type}return e},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(n){if(Browser.pointerLock)\\\"mousemove\\\"!=n.type&&\\\"mozMovementX\\\"in n?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(n),Browser.mouseMovementY=Browser.getMovementY(n)),\\\"undefined\\\"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var e=Module.canvas.getBoundingClientRect(),r=Module.canvas.width,t=Module.canvas.height,i=void 0!==window.scrollX?window.scrollX:window.pageXOffset,u=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(\\\"touchstart\\\"===n.type||\\\"touchend\\\"===n.type||\\\"touchmove\\\"===n.type){var o=n.touch;if(void 0===o)return;var a=o.pageX-(i+e.left),f=o.pageY-(u+e.top),c={x:a*=r/e.width,y:f*=t/e.height};if(\\\"touchstart\\\"===n.type)Browser.lastTouches[o.identifier]=c,Browser.touches[o.identifier]=c;else if(\\\"touchend\\\"===n.type||\\\"touchmove\\\"===n.type){var l=Browser.touches[o.identifier];l||(l=c),Browser.lastTouches[o.identifier]=l,Browser.touches[o.identifier]=c}return}var s=n.pageX-(i+e.left),d=n.pageY-(u+e.top);s*=r/e.width,d*=t/e.height,Browser.mouseMovementX=s-Browser.mouseX,Browser.mouseMovementY=d-Browser.mouseY,Browser.mouseX=s,Browser.mouseY=d}},asyncLoad:function(n,e,r,t){var i=t?\\\"\\\":getUniqueRunDependency(\\\"al \\\"+n);Module.readAsync(n,(function(r){assert(r,'Loading data file \\\"'+n+'\\\" failed (no arrayBuffer).'),e(new Uint8Array(r)),i&&removeRunDependency(i)}),(function(e){if(!r)throw'Loading data file \\\"'+n+'\\\" failed.';r()})),i&&addRunDependency(i)},resizeListeners:[],updateResizeListeners:function(){var n=Module.canvas;Browser.resizeListeners.forEach((function(e){e(n.width,n.height)}))},setCanvasSize:function(n,e,r){var t=Module.canvas;Browser.updateCanvasDimensions(t,n,e),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(\\\"undefined\\\"!=typeof SDL){var n=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];n|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=n}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(\\\"undefined\\\"!=typeof SDL){var n=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];n&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=n}Browser.updateResizeListeners()},updateCanvasDimensions:function(n,e,r){e&&r?(n.widthNative=e,n.heightNative=r):(e=n.widthNative,r=n.heightNative);var t=e,i=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(t/i<Module.forcedAspectRatio?t=Math.round(i*Module.forcedAspectRatio):i=Math.round(t/Module.forcedAspectRatio)),(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===n.parentNode&&\\\"undefined\\\"!=typeof screen){var u=Math.min(screen.width/t,screen.height/i);t=Math.round(t*u),i=Math.round(i*u)}Browser.resizeCanvas?(n.width!=t&&(n.width=t),n.height!=i&&(n.height=i),void 0!==n.style&&(n.style.removeProperty(\\\"width\\\"),n.style.removeProperty(\\\"height\\\"))):(n.width!=e&&(n.width=e),n.height!=r&&(n.height=r),void 0!==n.style&&(t!=e||i!=r?(n.style.setProperty(\\\"width\\\",t+\\\"px\\\",\\\"important\\\"),n.style.setProperty(\\\"height\\\",i+\\\"px\\\",\\\"important\\\")):(n.style.removeProperty(\\\"width\\\"),n.style.removeProperty(\\\"height\\\"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var n=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,n}},SYSCALLS={varargs:0,get:function(n){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(){return Pointer_stringify(SYSCALLS.get())},get64:function(){var n=SYSCALLS.get(),e=SYSCALLS.get();return assert(n>=0?0===e:-1===e),n},getZero:function(){assert(0===SYSCALLS.get())}};function ___syscall6(n,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.getStreamFromFD();return FS.close(r),0}catch(n){return\\\"undefined\\\"!=typeof FS&&n instanceof FS.ErrnoError||abort(n),-n.errno}}function ___syscall54(n,e){SYSCALLS.varargs=e;try{return 0}catch(n){return\\\"undefined\\\"!=typeof FS&&n instanceof FS.ErrnoError||abort(n),-n.errno}}function _typeModule(n){var e=[[0,1,\\\"X\\\"],[1,1,\\\"const X\\\"],[128,1,\\\"X *\\\"],[256,1,\\\"X &\\\"],[384,1,\\\"X &&\\\"],[512,1,\\\"std::shared_ptr<X>\\\"],[640,1,\\\"std::unique_ptr<X>\\\"],[5120,1,\\\"std::vector<X>\\\"],[6144,2,\\\"std::array<X, Y>\\\"],[9216,-1,\\\"std::function<X (Y)>\\\"]];function r(n,e,r,t,i,u){if(1==e){var o=896&t;128!=o&&256!=o&&384!=o||(n=\\\"X const\\\")}return(u?r.replace(\\\"X\\\",n).replace(\\\"Y\\\",i):n.replace(\\\"X\\\",r).replace(\\\"Y\\\",i)).replace(/([*&]) (?=[*&])/g,\\\"$1\\\")}function t(n,e){var r=e.flags,t=896&r,i=15360&r;return e.name||1024!=i||(1==e.ptrSize?e.name=(16&r?\\\"\\\":(8&r?\\\"un\\\":\\\"\\\")+\\\"signed \\\")+\\\"char\\\":e.name=(8&r?\\\"u\\\":\\\"\\\")+(32&r?\\\"float\\\":\\\"int\\\")+8*e.ptrSize+\\\"_t\\\"),8!=e.ptrSize||32&r||(i=64),2048==i&&(512==t||640==t?i=4096:t&&(i=3072)),n(i,e)}var i={Type:function(){function n(n){this.id=n.id,this.name=n.name,this.flags=n.flags,this.spec=n}return n.prototype.toString=function(){return this.name},n}(),getComplexType:function n(i,u,o,a,f,c,l,s){void 0===c&&(c=\\\"X\\\"),void 0===s&&(s=1);var d=o(i);if(d)return d;var _,v=a(i),p=v.placeholderFlag,m=e[p];l&&m&&(c=r(l[2],l[0],c,m[0],\\\"?\\\",!0)),0==p&&(_=\\\"Unbound\\\"),p>=10&&(_=\\\"Corrupt\\\"),s>20&&(_=\\\"Deeply nested\\\"),_&&function(n,e,r,t,i){throw new Error(n+\\\" type \\\"+r.replace(\\\"X\\\",e+\\\"?\\\")+(t?\\\" with flag \\\"+t:\\\"\\\")+\\\" in \\\"+i)}(_,i,c,p,f||\\\"?\\\");var b,h=n(v.paramList[0],u,o,a,f,c,m,s+1),y={flags:m[0],id:i,name:\\\"\\\",paramList:[h]},w=[],M=\\\"?\\\";switch(v.placeholderFlag){case 1:b=h.spec;break;case 2:if(1024==(15360&h.flags)&&1==h.spec.ptrSize){y.flags=7168;break}case 3:case 6:case 5:b=h.spec,h.flags;break;case 8:M=\\\"\\\"+v.paramList[1],y.paramList.push(v.paramList[1]);break;case 9:for(var k=0,g=v.paramList[1];k<g.length;k++){var T=n(g[k],u,o,a,f,c,m,s+1);w.push(T.name),y.paramList.push(T)}M=w.join(\\\", \\\")}if(y.name=r(m[2],m[0],h.name,h.flags,M),b){for(var A=0,S=Object.keys(b);A<S.length;A++){var E=S[A];y[E]=y[E]||b[E]}y.flags|=b.flags}return t(u,y)},makeType:t,structureList:e};return n.output=i,n.output||i}function __nbind_register_type(n,e){var r={flags:10240,id:n,name:_nbind.readAsciiString(e)};_nbind.makeType(_nbind.constructType,r)}function __nbind_register_callback_signature(n,e){var r=_nbind.readTypeIdList(n,e),t=_nbind.callbackSignatureList.length;return _nbind.callbackSignatureList[t]=_nbind.makeJSCaller(r),t}function __extends(n,e){for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);function t(){this.constructor=n}t.prototype=e.prototype,n.prototype=new t}function __nbind_register_class(n,e,r,t,i,u,o){var a=_nbind.readAsciiString(o),f=_nbind.readPolicyList(e),c=HEAPU32.subarray(n/4,n/4+2),l={flags:2048|(f.Value?2:0),id:c[0],name:a},s=_nbind.makeType(_nbind.constructType,l);s.ptrType=_nbind.getComplexType(c[1],_nbind.constructType,_nbind.getType,_nbind.queryType),s.destroy=_nbind.makeMethodCaller(s.ptrType,{boundID:l.id,flags:0,name:\\\"destroy\\\",num:0,ptr:u,title:s.name+\\\".free\\\",typeList:[\\\"void\\\",\\\"uint32_t\\\",\\\"uint32_t\\\"]}),i&&(s.superIdList=Array.prototype.slice.call(HEAPU32.subarray(r/4,r/4+i)),s.upcastList=Array.prototype.slice.call(HEAPU32.subarray(t/4,t/4+i))),Module[s.name]=s.makeBound(f),_nbind.BindClass.list.push(s)}function _removeAccessorPrefix(n){return n.replace(/^[Gg]et_?([A-Z]?([A-Z]?))/,(function(n,e,r){return r?e:e.toLowerCase()}))}function __nbind_register_function(n,e,r,t,i,u,o,a,f,c){var l,s=_nbind.getType(n),d=_nbind.readPolicyList(e),_=_nbind.readTypeIdList(r,t);if(5==o)l=[{direct:i,name:\\\"__nbindConstructor\\\",ptr:0,title:s.name+\\\" constructor\\\",typeList:[\\\"uint32_t\\\"].concat(_.slice(1))},{direct:u,name:\\\"__nbindValueConstructor\\\",ptr:0,title:s.name+\\\" value constructor\\\",typeList:[\\\"void\\\",\\\"uint32_t\\\"].concat(_.slice(1))}];else{var v=_nbind.readAsciiString(a),p=(s.name&&s.name+\\\".\\\")+v;3!=o&&4!=o||(v=_removeAccessorPrefix(v)),l=[{boundID:n,direct:u,name:v,ptr:i,title:p,typeList:_}]}for(var m=0,b=l;m<b.length;m++){var h=b[m];h.signatureType=o,h.policyTbl=d,h.num=f,h.flags=c,s.addMethod(h)}}function _nbind_value(n,e){_nbind.typeNameTbl[n]||_nbind.throwError(\\\"Unknown value type \\\"+n),Module.NBind.bind_value(n,e),_defineHidden(_nbind.typeNameTbl[n].proto.prototype.__nbindValueConstructor)(e.prototype,\\\"__nbindValueConstructor\\\")}function __nbind_get_value_object(n,e){var r=_nbind.popValue(n);if(!r.fromJS)throw new Error(\\\"Object \\\"+r+\\\" has no fromJS function\\\");r.fromJS((function(){r.__nbindValueConstructor.apply(this,Array.prototype.concat.apply([e],arguments))}))}function _emscripten_memcpy_big(n,e,r){return HEAPU8.set(HEAPU8.subarray(e,e+r),n),n}function __nbind_register_primitive(n,e,r){var t={flags:1024|r,id:n,ptrSize:e};_nbind.makeType(_nbind.constructType,t)}Module._nbind_value=_nbind_value;var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],\\\"i8\\\",ALLOC_STATIC);function ___setErrNo(n){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=n),n}function _llvm_stacksave(){var n=_llvm_stacksave;return n.LLVM_SAVEDSTACKS||(n.LLVM_SAVEDSTACKS=[]),n.LLVM_SAVEDSTACKS.push(Runtime.stackSave()),n.LLVM_SAVEDSTACKS.length-1}function ___syscall140(n,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.getStreamFromFD(),t=(SYSCALLS.get(),SYSCALLS.get()),i=SYSCALLS.get(),u=SYSCALLS.get(),o=t;return FS.llseek(r,o,u),HEAP32[i>>2]=r.position,r.getdents&&0===o&&0===u&&(r.getdents=null),0}catch(n){return\\\"undefined\\\"!=typeof FS&&n instanceof FS.ErrnoError||abort(n),-n.errno}}function ___syscall146(n,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.get(),t=SYSCALLS.get(),i=SYSCALLS.get(),u=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(n,e){var r=___syscall146.buffers[n];assert(r),0===e||10===e?((1===n?Module.print:Module.printErr)(UTF8ArrayToString(r,0)),r.length=0):r.push(e)});for(var o=0;o<i;o++){for(var a=HEAP32[t+8*o>>2],f=HEAP32[t+(8*o+4)>>2],c=0;c<f;c++)___syscall146.printChar(r,HEAPU8[a+c]);u+=f}return u}catch(n){return\\\"undefined\\\"!=typeof FS&&n instanceof FS.ErrnoError||abort(n),-n.errno}}function __nbind_finish(){for(var n=0,e=_nbind.BindClass.list;n<e.length;n++){e[n].finish()}}var ___dso_handle=STATICTOP;function invoke_viiiii(n,e,r,t,i,u){try{Module.dynCall_viiiii(n,e,r,t,i,u)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_vif(n,e,r){try{Module.dynCall_vif(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_vid(n,e,r){try{Module.dynCall_vid(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_fiff(n,e,r,t){try{return Module.dynCall_fiff(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_vi(n,e){try{Module.dynCall_vi(n,e)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_vii(n,e,r){try{Module.dynCall_vii(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_ii(n,e){try{return Module.dynCall_ii(n,e)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viddi(n,e,r,t,i){try{Module.dynCall_viddi(n,e,r,t,i)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_vidd(n,e,r,t){try{Module.dynCall_vidd(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_iiii(n,e,r,t){try{return Module.dynCall_iiii(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_diii(n,e,r,t){try{return Module.dynCall_diii(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_di(n,e){try{return Module.dynCall_di(n,e)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_iid(n,e,r){try{return Module.dynCall_iid(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_iii(n,e,r){try{return Module.dynCall_iii(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viiddi(n,e,r,t,i,u){try{Module.dynCall_viiddi(n,e,r,t,i,u)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viiiiii(n,e,r,t,i,u,o){try{Module.dynCall_viiiiii(n,e,r,t,i,u,o)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_dii(n,e,r){try{return Module.dynCall_dii(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_i(n){try{return Module.dynCall_i(n)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_iiiiii(n,e,r,t,i,u){try{return Module.dynCall_iiiiii(n,e,r,t,i,u)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viiid(n,e,r,t,i){try{Module.dynCall_viiid(n,e,r,t,i)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viififi(n,e,r,t,i,u,o){try{Module.dynCall_viififi(n,e,r,t,i,u,o)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viii(n,e,r,t){try{Module.dynCall_viii(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_v(n){try{Module.dynCall_v(n)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viid(n,e,r,t){try{Module.dynCall_viid(n,e,r,t)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_idd(n,e,r){try{return Module.dynCall_idd(n,e,r)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}function invoke_viiii(n,e,r,t,i){try{Module.dynCall_viiii(n,e,r,t,i)}catch(n){if(\\\"number\\\"!=typeof n&&\\\"longjmp\\\"!==n)throw n;Module.setThrew(1,0)}}STATICTOP+=16,function(_nbind){var typeIdTbl={};_nbind.typeNameTbl={};var Pool=function(){function n(){}return n.lalloc=function(e){e=e+7&-8;var r=HEAPU32[n.usedPtr];return e>n.pageSize/2||e>n.pageSize-r?_nbind.typeNameTbl.NBind.proto.lalloc(e):(HEAPU32[n.usedPtr]=r+e,n.rootPtr+r)},n.lreset=function(e,r){HEAPU32[n.pagePtr]?_nbind.typeNameTbl.NBind.proto.lreset(e,r):HEAPU32[n.usedPtr]=e},n}();function constructType(n,e){var r=new(10240==n?_nbind.makeTypeNameTbl[e.name]||_nbind.BindType:_nbind.makeTypeKindTbl[n])(e);return typeIdTbl[e.id]=r,_nbind.typeNameTbl[e.name]=r,r}function getType(n){return typeIdTbl[n]}function queryType(n){var e=HEAPU8[n],r=_nbind.structureList[e][1];n/=4,r<0&&(++n,r=HEAPU32[n]+1);var t=Array.prototype.slice.call(HEAPU32.subarray(n+1,n+1+r));return 9==e&&(t=[t[0],t.slice(1)]),{paramList:t,placeholderFlag:e}}function getTypes(n,e){return n.map((function(n){return\\\"number\\\"==typeof n?_nbind.getComplexType(n,constructType,getType,queryType,e):_nbind.typeNameTbl[n]}))}function readTypeIdList(n,e){return Array.prototype.slice.call(HEAPU32,n/4,n/4+e)}function readAsciiString(n){for(var e=n;HEAPU8[e++];);return String.fromCharCode.apply(\\\"\\\",HEAPU8.subarray(n,e-1))}function readPolicyList(n){var e={};if(n)for(;;){var r=HEAPU32[n/4];if(!r)break;e[readAsciiString(r)]=!0,n+=4}return e}function getDynCall(n,e){var r={float32_t:\\\"d\\\",float64_t:\\\"d\\\",int64_t:\\\"d\\\",uint64_t:\\\"d\\\",void:\\\"v\\\"},t=n.map((function(n){return r[n.name]||\\\"i\\\"})).join(\\\"\\\"),i=Module[\\\"dynCall_\\\"+t];if(!i)throw new Error(\\\"dynCall_\\\"+t+\\\" not found for \\\"+e+\\\"(\\\"+n.map((function(n){return n.name})).join(\\\", \\\")+\\\")\\\");return i}function addMethod(n,e,r,t){var i=n[e];n.hasOwnProperty(e)&&i?((i.arity||0===i.arity)&&(i=_nbind.makeOverloader(i,i.arity),n[e]=i),i.addMethod(r,t)):(r.arity=t,n[e]=r)}function throwError(n){throw new Error(n)}_nbind.Pool=Pool,_nbind.constructType=constructType,_nbind.getType=getType,_nbind.queryType=queryType,_nbind.getTypes=getTypes,_nbind.readTypeIdList=readTypeIdList,_nbind.readAsciiString=readAsciiString,_nbind.readPolicyList=readPolicyList,_nbind.getDynCall=getDynCall,_nbind.addMethod=addMethod,_nbind.throwError=throwError,_nbind.bigEndian=!1;var _a=_typeModule(_typeModule);_nbind.Type=_a.Type,_nbind.makeType=_a.makeType,_nbind.getComplexType=_a.getComplexType,_nbind.structureList=_a.structureList;var BindType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.heap=HEAPU32,e.ptrSize=4,e}return __extends(e,n),e.prototype.needsWireRead=function(n){return!!this.wireRead||!!this.makeWireRead},e.prototype.needsWireWrite=function(n){return!!this.wireWrite||!!this.makeWireWrite},e}(_nbind.Type);_nbind.BindType=BindType;var PrimitiveType=function(n){function e(e){var r=n.call(this,e)||this,t=32&e.flags?{32:HEAPF32,64:HEAPF64}:8&e.flags?{8:HEAPU8,16:HEAPU16,32:HEAPU32}:{8:HEAP8,16:HEAP16,32:HEAP32};return r.heap=t[8*e.ptrSize],r.ptrSize=e.ptrSize,r}return __extends(e,n),e.prototype.needsWireWrite=function(n){return!!n&&!!n.Strict},e.prototype.makeWireWrite=function(n,e){return e&&e.Strict&&function(n){if(\\\"number\\\"==typeof n)return n;throw new Error(\\\"Type mismatch\\\")}},e}(BindType);function pushCString(n,e){if(null==n){if(e&&e.Nullable)return 0;throw new Error(\\\"Type mismatch\\\")}if(e&&e.Strict){if(\\\"string\\\"!=typeof n)throw new Error(\\\"Type mismatch\\\")}else n=n.toString();var r=Module.lengthBytesUTF8(n)+1,t=_nbind.Pool.lalloc(r);return Module.stringToUTF8Array(n,HEAPU8,t,r),t}function popCString(n){return 0===n?null:Module.Pointer_stringify(n)}_nbind.PrimitiveType=PrimitiveType,_nbind.pushCString=pushCString,_nbind.popCString=popCString;var CStringType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireRead=popCString,e.wireWrite=pushCString,e.readResources=[_nbind.resources.pool],e.writeResources=[_nbind.resources.pool],e}return __extends(e,n),e.prototype.makeWireWrite=function(n,e){return function(n){return pushCString(n,e)}},e}(BindType);_nbind.CStringType=CStringType;var BooleanType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireRead=function(n){return!!n},e}return __extends(e,n),e.prototype.needsWireWrite=function(n){return!!n&&!!n.Strict},e.prototype.makeWireRead=function(n){return\\\"!!(\\\"+n+\\\")\\\"},e.prototype.makeWireWrite=function(n,e){return e&&e.Strict&&function(n){if(\\\"boolean\\\"==typeof n)return n;throw new Error(\\\"Type mismatch\\\")}||n},e}(BindType);_nbind.BooleanType=BooleanType;var Wrapper=function(){function n(){}return n.prototype.persist=function(){this.__nbindState|=1},n}();function makeBound(n,e){var r=function(n){function r(e,t,i,u){var o=n.call(this)||this;if(!(o instanceof r))return new(Function.prototype.bind.apply(r,Array.prototype.concat.apply([null],arguments)));var a=t,f=i,c=u;if(e!==_nbind.ptrMarker){var l=o.__nbindConstructor.apply(o,arguments);a=4608,c=HEAPU32[l/4],f=HEAPU32[l/4+1]}var s={configurable:!0,enumerable:!1,value:null,writable:!1},d={__nbindFlags:a,__nbindPtr:f};c&&(d.__nbindShared=c,_nbind.mark(o));for(var _=0,v=Object.keys(d);_<v.length;_++){var p=v[_];s.value=d[p],Object.defineProperty(o,p,s)}return _defineHidden(0)(o,\\\"__nbindState\\\"),o}return __extends(r,n),r.prototype.free=function(){e.destroy.call(this,this.__nbindShared,this.__nbindFlags),this.__nbindState|=2,disableMember(this,\\\"__nbindShared\\\"),disableMember(this,\\\"__nbindPtr\\\")},r}(Wrapper);return __decorate([_defineHidden()],r.prototype,\\\"__nbindConstructor\\\",void 0),__decorate([_defineHidden()],r.prototype,\\\"__nbindValueConstructor\\\",void 0),__decorate([_defineHidden(n)],r.prototype,\\\"__nbindPolicies\\\",void 0),r}function disableMember(n,e){function r(){throw new Error(\\\"Accessing deleted object\\\")}Object.defineProperty(n,e,{configurable:!1,enumerable:!1,get:r,set:r})}_nbind.Wrapper=Wrapper,_nbind.makeBound=makeBound,_nbind.ptrMarker={};var BindClass=function(n){function e(e){var r=n.call(this,e)||this;return r.wireRead=function(n){return _nbind.popValue(n,r.ptrType)},r.wireWrite=function(n){return pushPointer(n,r.ptrType,!0)},r.pendingSuperCount=0,r.ready=!1,r.methodTbl={},e.paramList?(r.classType=e.paramList[0].classType,r.proto=r.classType.proto):r.classType=r,r}return __extends(e,n),e.prototype.makeBound=function(n){var e=_nbind.makeBound(n,this);return this.proto=e,this.ptrType.proto=e,e},e.prototype.addMethod=function(n){var e=this.methodTbl[n.name]||[];e.push(n),this.methodTbl[n.name]=e},e.prototype.registerMethods=function(n,e){for(var r,t=0,i=Object.keys(n.methodTbl);t<i.length;t++)for(var u=i[t],o=0,a=n.methodTbl[u];o<a.length;o++){var f=a[o],c=void 0,l=void 0;if(c=this.proto.prototype,!e||1==f.signatureType)switch(f.signatureType){case 1:c=this.proto;case 5:l=_nbind.makeCaller(f),_nbind.addMethod(c,f.name,l,f.typeList.length-1);break;case 4:r=_nbind.makeMethodCaller(n.ptrType,f);break;case 3:Object.defineProperty(c,f.name,{configurable:!0,enumerable:!1,get:_nbind.makeMethodCaller(n.ptrType,f),set:r});break;case 2:l=_nbind.makeMethodCaller(n.ptrType,f),_nbind.addMethod(c,f.name,l,f.typeList.length-1)}}},e.prototype.registerSuperMethods=function(n,e,r){if(!r[n.name]){r[n.name]=!0;for(var t,i=0,u=0,o=n.superIdList||[];u<o.length;u++){var a=o[u],f=_nbind.getType(a);t=i++<e||e<0?-1:0,this.registerSuperMethods(f,t,r)}this.registerMethods(n,e<0)}},e.prototype.finish=function(){if(this.ready)return this;this.ready=!0,this.superList=(this.superIdList||[]).map((function(n){return _nbind.getType(n).finish()}));var n=this.proto;if(this.superList.length){var e=function(){this.constructor=n};e.prototype=this.superList[0].proto.prototype,n.prototype=new e}return n!=Module&&(n.prototype.__nbindType=this),this.registerSuperMethods(this,1,{}),this},e.prototype.upcastStep=function(n,e){if(n==this)return e;for(var r=0;r<this.superList.length;++r){var t=this.superList[r].upcastStep(n,_nbind.callUpcast(this.upcastList[r],e));if(t)return t}return 0},e}(_nbind.BindType);function popPointer(n,e){return n?new e.proto(_nbind.ptrMarker,e.flags,n):null}function pushPointer(n,e,r){if(!(n instanceof _nbind.Wrapper)){if(r)return _nbind.pushValue(n);throw new Error(\\\"Type mismatch\\\")}var t=n.__nbindPtr,i=n.__nbindType.classType,u=e.classType;if(n instanceof e.proto)for(;i!=u;)t=_nbind.callUpcast(i.upcastList[0],t),i=i.superList[0];else if(!(t=i.upcastStep(u,t)))throw new Error(\\\"Type mismatch\\\");return t}function pushMutablePointer(n,e){var r=pushPointer(n,e);if(1&n.__nbindFlags)throw new Error(\\\"Passing a const value as a non-const argument\\\");return r}BindClass.list=[],_nbind.BindClass=BindClass,_nbind.popPointer=popPointer,_nbind.pushPointer=pushPointer;var BindClassPtr=function(n){function e(e){var r=n.call(this,e)||this;r.classType=e.paramList[0].classType,r.proto=r.classType.proto;var t=1&e.flags,i=256==(896&r.flags)&&2&e.flags,u=t?pushPointer:pushMutablePointer,o=i?_nbind.popValue:popPointer;return r.makeWireWrite=function(n,e){return e.Nullable?function(n){return n?u(n,r):0}:function(n){return u(n,r)}},r.wireRead=function(n){return o(n,r)},r.wireWrite=function(n){return u(n,r)},r}return __extends(e,n),e}(_nbind.BindType);function popShared(n,e){var r=HEAPU32[n/4],t=HEAPU32[n/4+1];return t?new e.proto(_nbind.ptrMarker,e.flags,t,r):null}function pushShared(n,e){if(!(n instanceof e.proto))throw new Error(\\\"Type mismatch\\\");return n.__nbindShared}function pushMutableShared(n,e){if(!(n instanceof e.proto))throw new Error(\\\"Type mismatch\\\");if(1&n.__nbindFlags)throw new Error(\\\"Passing a const value as a non-const argument\\\");return n.__nbindShared}_nbind.BindClassPtr=BindClassPtr,_nbind.popShared=popShared;var SharedClassPtr=function(n){function e(e){var r=n.call(this,e)||this;r.readResources=[_nbind.resources.pool],r.classType=e.paramList[0].classType,r.proto=r.classType.proto;var t=1&e.flags?pushShared:pushMutableShared;return r.wireRead=function(n){return popShared(n,r)},r.wireWrite=function(n){return t(n,r)},r}return __extends(e,n),e}(_nbind.BindType);_nbind.SharedClassPtr=SharedClassPtr,_nbind.externalList=[0];var firstFreeExternal=0,External=function(){function n(n){this.refCount=1,this.data=n}return n.prototype.register=function(){var n=firstFreeExternal;return n?firstFreeExternal=_nbind.externalList[n]:n=_nbind.externalList.length,_nbind.externalList[n]=this,n},n.prototype.reference=function(){++this.refCount},n.prototype.dereference=function(n){0==--this.refCount&&(this.free&&this.free(),_nbind.externalList[n]=firstFreeExternal,firstFreeExternal=n)},n}();function popExternal(n){var e=_nbind.externalList[n];return e.dereference(n),e.data}function pushExternal(n){var e=new External(n);return e.reference(),e.register()}_nbind.External=External;var ExternalType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireRead=popExternal,e.wireWrite=pushExternal,e}return __extends(e,n),e}(_nbind.BindType);_nbind.ExternalType=ExternalType,_nbind.callbackSignatureList=[];var CallbackType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireWrite=function(n){return\\\"function\\\"!=typeof n&&_nbind.throwError(\\\"Type mismatch\\\"),new _nbind.External(n).register()},e}return __extends(e,n),e}(_nbind.BindType);_nbind.CallbackType=CallbackType,_nbind.valueList=[0];var firstFreeValue=0;function pushValue(n){var e=firstFreeValue;return e?firstFreeValue=_nbind.valueList[e]:e=_nbind.valueList.length,_nbind.valueList[e]=n,2*e+1}function popValue(n,e){if(n||_nbind.throwError(\\\"Value type JavaScript class is missing or not registered\\\"),1&n){n>>=1;var r=_nbind.valueList[n];return _nbind.valueList[n]=firstFreeValue,firstFreeValue=n,r}if(e)return _nbind.popShared(n,e);throw new Error(\\\"Invalid value slot \\\"+n)}_nbind.pushValue=pushValue,_nbind.popValue=popValue;var valueBase=0x10000000000000000;function push64(n){return\\\"number\\\"==typeof n?n:4096*pushValue(n)+valueBase}function pop64(n){return n<valueBase?n:popValue((n-valueBase)/4096)}var CreateValueType=function(n){function e(){return null!==n&&n.apply(this,arguments)||this}return __extends(e,n),e.prototype.makeWireWrite=function(n){return\\\"(_nbind.pushValue(new \\\"+n+\\\"))\\\"},e}(_nbind.BindType);_nbind.CreateValueType=CreateValueType;var Int64Type=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireWrite=push64,e.wireRead=pop64,e}return __extends(e,n),e}(_nbind.BindType);function pushArray(n,e){if(!n)return 0;var r=n.length;if((e.size||0===e.size)&&r<e.size)throw new Error(\\\"Type mismatch\\\");var t=e.memberType.ptrSize,i=_nbind.Pool.lalloc(4+r*t);HEAPU32[i/4]=r;var u=e.memberType.heap,o=(i+4)/t,a=e.memberType.wireWrite,f=0;if(a)for(;f<r;)u[o++]=a(n[f++]);else for(;f<r;)u[o++]=n[f++];return i}function popArray(n,e){if(0===n)return null;var r=HEAPU32[n/4],t=new Array(r),i=e.memberType.heap;n=(n+4)/e.memberType.ptrSize;var u=e.memberType.wireRead,o=0;if(u)for(;o<r;)t[o++]=u(i[n++]);else for(;o<r;)t[o++]=i[n++];return t}_nbind.Int64Type=Int64Type,_nbind.pushArray=pushArray,_nbind.popArray=popArray;var ArrayType=function(n){function e(e){var r=n.call(this,e)||this;return r.wireRead=function(n){return popArray(n,r)},r.wireWrite=function(n){return pushArray(n,r)},r.readResources=[_nbind.resources.pool],r.writeResources=[_nbind.resources.pool],r.memberType=e.paramList[0],e.paramList[1]&&(r.size=e.paramList[1]),r}return __extends(e,n),e}(_nbind.BindType);function pushString(n,e){if(null==n){if(!e||!e.Nullable)throw new Error(\\\"Type mismatch\\\");n=\\\"\\\"}if(e&&e.Strict){if(\\\"string\\\"!=typeof n)throw new Error(\\\"Type mismatch\\\")}else n=n.toString();var r=Module.lengthBytesUTF8(n),t=_nbind.Pool.lalloc(4+r+1);return HEAPU32[t/4]=r,Module.stringToUTF8Array(n,HEAPU8,t+4,r+1),t}function popString(n){if(0===n)return null;var e=HEAPU32[n/4];return Module.Pointer_stringify(n+4,e)}_nbind.ArrayType=ArrayType,_nbind.pushString=pushString,_nbind.popString=popString;var StringType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireRead=popString,e.wireWrite=pushString,e.readResources=[_nbind.resources.pool],e.writeResources=[_nbind.resources.pool],e}return __extends(e,n),e.prototype.makeWireWrite=function(n,e){return function(n){return pushString(n,e)}},e}(_nbind.BindType);function makeArgList(n){return Array.apply(null,Array(n)).map((function(n,e){return\\\"a\\\"+(e+1)}))}function anyNeedsWireWrite(n,e){return n.reduce((function(n,r){return n||r.needsWireWrite(e)}),!1)}function anyNeedsWireRead(n,e){return n.reduce((function(n,r){return n||!!r.needsWireRead(e)}),!1)}function makeWireRead(n,e,r,t){var i=n.length;return r.makeWireRead?r.makeWireRead(t,n,i):r.wireRead?(n[i]=r.wireRead,\\\"(convertParamList[\\\"+i+\\\"](\\\"+t+\\\"))\\\"):t}function makeWireWrite(n,e,r,t){var i,u=n.length;return(i=r.makeWireWrite?r.makeWireWrite(t,e,n,u):r.wireWrite)?\\\"string\\\"==typeof i?i:(n[u]=i,\\\"(convertParamList[\\\"+u+\\\"](\\\"+t+\\\"))\\\"):t}function buildCallerFunction(dynCall,ptrType,ptr,num,policyTbl,needsWireWrite,prefix,returnType,argTypeList,mask,err){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireRead(convertParamList,policyTbl,returnType,\\\"dynCall(\\\"+[prefix].concat(argList.map((function(n,e){return makeWireWrite(convertParamList,policyTbl,argTypeList[e],n)}))).join(\\\",\\\")+\\\")\\\"),resourceSet=_nbind.listResources([returnType],argTypeList),sourceCode=\\\"function(\\\"+argList.join(\\\",\\\")+\\\"){\\\"+(mask?\\\"this.__nbindFlags&mask&&err();\\\":\\\"\\\")+resourceSet.makeOpen()+\\\"var r=\\\"+callExpression+\\\";\\\"+resourceSet.makeClose()+\\\"return r;}\\\";return eval(\\\"(\\\"+sourceCode+\\\")\\\")}function buildJSCallerFunction(returnType,argTypeList){var argList=makeArgList(argTypeList.length),convertParamList=[],callExpression=makeWireWrite(convertParamList,null,returnType,\\\"_nbind.externalList[num].data(\\\"+argList.map((function(n,e){return makeWireRead(convertParamList,null,argTypeList[e],n)})).join(\\\",\\\")+\\\")\\\"),resourceSet=_nbind.listResources(argTypeList,[returnType]);resourceSet.remove(_nbind.resources.pool);var sourceCode=\\\"function(\\\"+[\\\"dummy\\\",\\\"num\\\"].concat(argList).join(\\\",\\\")+\\\"){\\\"+resourceSet.makeOpen()+\\\"var r=\\\"+callExpression+\\\";\\\"+resourceSet.makeClose()+\\\"return r;}\\\";return eval(\\\"(\\\"+sourceCode+\\\")\\\")}function makeJSCaller(n){var e=n.length-1,r=_nbind.getTypes(n,\\\"callback\\\"),t=r[0],i=r.slice(1),u=anyNeedsWireRead(i,null);if(!t.needsWireWrite(null)&&!u)switch(e){case 0:return function(n,e){return _nbind.externalList[e].data()};case 1:return function(n,e,r){return _nbind.externalList[e].data(r)};case 2:return function(n,e,r,t){return _nbind.externalList[e].data(r,t)};case 3:return function(n,e,r,t,i){return _nbind.externalList[e].data(r,t,i)}}return buildJSCallerFunction(t,i)}function makeMethodCaller(n,e){var r=e.typeList.length-1,t=e.typeList.slice(0);t.splice(1,0,\\\"uint32_t\\\",e.boundID);var i=_nbind.getTypes(t,e.title),u=i[0],o=i.slice(3),a=u.needsWireRead(e.policyTbl),f=anyNeedsWireWrite(o,e.policyTbl),c=e.ptr,l=e.num,s=_nbind.getDynCall(i,e.title),d=1&~e.flags;function _(){throw new Error(\\\"Calling a non-const method on a const object\\\")}if(!a&&!f)switch(r){case 0:return function(){return this.__nbindFlags&d?_():s(c,l,_nbind.pushPointer(this,n))};case 1:return function(e){return this.__nbindFlags&d?_():s(c,l,_nbind.pushPointer(this,n),e)};case 2:return function(e,r){return this.__nbindFlags&d?_():s(c,l,_nbind.pushPointer(this,n),e,r)};case 3:return function(e,r,t){return this.__nbindFlags&d?_():s(c,l,_nbind.pushPointer(this,n),e,r,t)}}return buildCallerFunction(s,n,c,l,e.policyTbl,f,\\\"ptr,num,pushPointer(this,ptrType)\\\",u,o,d,_)}function makeCaller(n){var e,r=n.typeList.length-1,t=_nbind.getTypes(n.typeList,n.title),i=t[0],u=t.slice(1),o=i.needsWireRead(n.policyTbl),a=anyNeedsWireWrite(u,n.policyTbl),f=n.direct,c=n.ptr;if(n.direct&&!o&&!a){var l=_nbind.getDynCall(t,n.title);switch(r){case 0:return function(){return l(f)};case 1:return function(n){return l(f,n)};case 2:return function(n,e){return l(f,n,e)};case 3:return function(n,e,r){return l(f,n,e,r)}}c=0}if(c){var s=n.typeList.slice(0);s.splice(1,0,\\\"uint32_t\\\"),t=_nbind.getTypes(s,n.title),e=\\\"ptr,num\\\"}else c=f,e=\\\"ptr\\\";return buildCallerFunction(_nbind.getDynCall(t,n.title),null,c,n.num,n.policyTbl,a,e,i,u)}function makeOverloader(n,e){var r=[];function t(){return r[arguments.length].apply(this,arguments)}return t.addMethod=function(n,e){r[e]=n},t.addMethod(n,e),t}_nbind.StringType=StringType,_nbind.buildJSCallerFunction=buildJSCallerFunction,_nbind.makeJSCaller=makeJSCaller,_nbind.makeMethodCaller=makeMethodCaller,_nbind.makeCaller=makeCaller,_nbind.makeOverloader=makeOverloader;var Resource=function(){function n(n,e){var r=this;this.makeOpen=function(){return Object.keys(r.openTbl).join(\\\"\\\")},this.makeClose=function(){return Object.keys(r.closeTbl).join(\\\"\\\")},this.openTbl={},this.closeTbl={},n&&(this.openTbl[n]=!0),e&&(this.closeTbl[e]=!0)}return n.prototype.add=function(n){for(var e=0,r=Object.keys(n.openTbl);e<r.length;e++){var t=r[e];this.openTbl[t]=!0}for(var i=0,u=Object.keys(n.closeTbl);i<u.length;i++){t=u[i];this.closeTbl[t]=!0}},n.prototype.remove=function(n){for(var e=0,r=Object.keys(n.openTbl);e<r.length;e++){var t=r[e];delete this.openTbl[t]}for(var i=0,u=Object.keys(n.closeTbl);i<u.length;i++){t=u[i];delete this.closeTbl[t]}},n}();function listResources(n,e){for(var r=new Resource,t=0,i=n;t<i.length;t++)for(var u=0,o=i[t].readResources||[];u<o.length;u++){var a=o[u];r.add(a)}for(var f=0,c=e;f<c.length;f++)for(var l=0,s=c[f].writeResources||[];l<s.length;l++){a=s[l];r.add(a)}return r}_nbind.Resource=Resource,_nbind.listResources=listResources,_nbind.resources={pool:new Resource(\\\"var used=HEAPU32[_nbind.Pool.usedPtr],page=HEAPU32[_nbind.Pool.pagePtr];\\\",\\\"_nbind.Pool.lreset(used,page);\\\")};var ExternalBuffer=function(n){function e(e,r){var t=n.call(this,e)||this;return t.ptr=r,t}return __extends(e,n),e.prototype.free=function(){_free(this.ptr)},e}(_nbind.External);function getBuffer(n){return n instanceof ArrayBuffer?new Uint8Array(n):n instanceof DataView?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):n}function pushBuffer(n,e){if(null==n&&e&&e.Nullable&&(n=[]),\\\"object\\\"!=typeof n)throw new Error(\\\"Type mismatch\\\");var r=n,t=r.byteLength||r.length;if(!t&&0!==t&&0!==r.byteLength)throw new Error(\\\"Type mismatch\\\");var i=_nbind.Pool.lalloc(8),u=_malloc(t),o=i/4;return HEAPU32[o++]=t,HEAPU32[o++]=u,HEAPU32[o++]=new ExternalBuffer(n,u).register(),HEAPU8.set(getBuffer(n),u),i}var BufferType=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.wireWrite=pushBuffer,e.readResources=[_nbind.resources.pool],e.writeResources=[_nbind.resources.pool],e}return __extends(e,n),e.prototype.makeWireWrite=function(n,e){return function(n){return pushBuffer(n,e)}},e}(_nbind.BindType);function commitBuffer(n,e,r){var t=_nbind.externalList[n].data,i=Buffer;if(\\\"function\\\"!=typeof Buffer&&(i=function(){}),t instanceof Array);else{var u=HEAPU8.subarray(e,e+r);if(t instanceof i){(\\\"function\\\"==typeof Buffer.from&&Buffer.from.length>=3?Buffer.from(u):new Buffer(u)).copy(t)}else getBuffer(t).set(u)}}_nbind.BufferType=BufferType,_nbind.commitBuffer=commitBuffer;var dirtyList=[],gcTimer=0;function sweep(){for(var n=0,e=dirtyList;n<e.length;n++){var r=e[n];3&r.__nbindState||r.free()}dirtyList=[],gcTimer=0}function toggleLightGC(n){_nbind.mark=n?function(n){dirtyList.push(n),gcTimer||(gcTimer=setTimeout(sweep,0))}:function(n){}}_nbind.mark=function(n){},_nbind.toggleLightGC=toggleLightGC}(_nbind),Module.requestFullScreen=function(n,e,r){Module.printErr(\\\"Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead.\\\"),Module.requestFullScreen=Module.requestFullscreen,Browser.requestFullScreen(n,e,r)},Module.requestFullscreen=function(n,e,r){Browser.requestFullscreen(n,e,r)},Module.requestAnimationFrame=function(n){Browser.requestAnimationFrame(n)},Module.setCanvasSize=function(n,e,r){Browser.setCanvasSize(n,e,r)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},Module.createContext=function(n,e,r,t){return Browser.createContext(n,e,r,t)},_emscripten_get_now=ENVIRONMENT_IS_NODE?function(){var n=process.hrtime();return 1e3*n[0]+n[1]/1e6}:\\\"undefined\\\"!=typeof dateNow?dateNow:\\\"object\\\"==typeof self&&self.performance&&\\\"function\\\"==typeof self.performance.now?function(){return self.performance.now()}:\\\"object\\\"==typeof performance&&\\\"function\\\"==typeof performance.now?function(){return performance.now()}:Date.now,__ATEXIT__.push((function(){var n=Module._fflush;n&&n(0);var e=___syscall146.printChar;if(e){var r=___syscall146.buffers;r[1].length&&e(1,10),r[2].length&&e(2,10)}})),DYNAMICTOP_PTR=allocate(1,\\\"i32\\\",ALLOC_STATIC),STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX),HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE,staticSealed=!0,Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0},Module.asmLibraryArg={abort:abort,assert:assert,enlargeMemory:enlargeMemory,getTotalMemory:getTotalMemory,abortOnCannotGrowMemory:abortOnCannotGrowMemory,invoke_viiiii:invoke_viiiii,invoke_vif:invoke_vif,invoke_vid:invoke_vid,invoke_fiff:invoke_fiff,invoke_vi:invoke_vi,invoke_vii:invoke_vii,invoke_ii:invoke_ii,invoke_viddi:invoke_viddi,invoke_vidd:invoke_vidd,invoke_iiii:invoke_iiii,invoke_diii:invoke_diii,invoke_di:invoke_di,invoke_iid:invoke_iid,invoke_iii:invoke_iii,invoke_viiddi:invoke_viiddi,invoke_viiiiii:invoke_viiiiii,invoke_dii:invoke_dii,invoke_i:invoke_i,invoke_iiiiii:invoke_iiiiii,invoke_viiid:invoke_viiid,invoke_viififi:invoke_viififi,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viid:invoke_viid,invoke_idd:invoke_idd,invoke_viiii:invoke_viiii,_emscripten_asm_const_iiiii:_emscripten_asm_const_iiiii,_emscripten_asm_const_iiidddddd:_emscripten_asm_const_iiidddddd,_emscripten_asm_const_iiiid:_emscripten_asm_const_iiiid,__nbind_reference_external:__nbind_reference_external,_emscripten_asm_const_iiiiiiii:_emscripten_asm_const_iiiiiiii,_removeAccessorPrefix:_removeAccessorPrefix,_typeModule:_typeModule,__nbind_register_pool:__nbind_register_pool,__decorate:__decorate,_llvm_stackrestore:_llvm_stackrestore,___cxa_atexit:___cxa_atexit,__extends:__extends,__nbind_get_value_object:__nbind_get_value_object,__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj:__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,_emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,__nbind_register_primitive:__nbind_register_primitive,__nbind_register_type:__nbind_register_type,_emscripten_memcpy_big:_emscripten_memcpy_big,__nbind_register_function:__nbind_register_function,___setErrNo:___setErrNo,__nbind_register_class:__nbind_register_class,__nbind_finish:__nbind_finish,_abort:_abort,_nbind_value:_nbind_value,_llvm_stacksave:_llvm_stacksave,___syscall54:___syscall54,_defineHidden:_defineHidden,_emscripten_set_main_loop:_emscripten_set_main_loop,_emscripten_get_now:_emscripten_get_now,__nbind_register_callback_signature:__nbind_register_callback_signature,_emscripten_asm_const_iiiiii:_emscripten_asm_const_iiiiii,__nbind_free_external:__nbind_free_external,_emscripten_asm_const_iiii:_emscripten_asm_const_iiii,_emscripten_asm_const_iiididi:_emscripten_asm_const_iiididi,___syscall6:___syscall6,_atexit:_atexit,___syscall140:___syscall140,___syscall146:___syscall146,DYNAMICTOP_PTR:DYNAMICTOP_PTR,tempDoublePtr:tempDoublePtr,ABORT:ABORT,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,cttz_i8:cttz_i8,___dso_handle:___dso_handle};var asm=function(n,e,r){\\\"use asm\\\";var t=new n.Int8Array(r);var i=new n.Int16Array(r);var u=new n.Int32Array(r);var o=new n.Uint8Array(r);var a=new n.Uint16Array(r);var f=new n.Uint32Array(r);var c=new n.Float32Array(r);var l=new n.Float64Array(r);var s=e.DYNAMICTOP_PTR|0;var d=e.tempDoublePtr|0;var _=e.ABORT|0;var v=e.STACKTOP|0;var p=e.STACK_MAX|0;var m=e.cttz_i8|0;var b=e.___dso_handle|0;var h=0;var y=0;var w=0;var M=0;var k=n.NaN,g=n.Infinity;var T=0,A=0,S=0,E=0,C=0.0;var L=0;var R=n.Math.floor;var P=n.Math.abs;var B=n.Math.sqrt;var O=n.Math.pow;var N=n.Math.cos;var I=n.Math.sin;var F=n.Math.tan;var x=n.Math.acos;var U=n.Math.asin;var H=n.Math.atan;var D=n.Math.atan2;var W=n.Math.exp;var Y=n.Math.log;var V=n.Math.ceil;var j=n.Math.imul;var q=n.Math.min;var z=n.Math.max;var G=n.Math.clz32;var K=n.Math.fround;var X=e.abort;var J=e.assert;var Z=e.enlargeMemory;var Q=e.getTotalMemory;var $=e.abortOnCannotGrowMemory;var nn=e.invoke_viiiii;var en=e.invoke_vif;var rn=e.invoke_vid;var tn=e.invoke_fiff;var un=e.invoke_vi;var on=e.invoke_vii;var an=e.invoke_ii;var fn=e.invoke_viddi;var cn=e.invoke_vidd;var ln=e.invoke_iiii;var sn=e.invoke_diii;var dn=e.invoke_di;var _n=e.invoke_iid;var vn=e.invoke_iii;var pn=e.invoke_viiddi;var mn=e.invoke_viiiiii;var bn=e.invoke_dii;var hn=e.invoke_i;var yn=e.invoke_iiiiii;var wn=e.invoke_viiid;var Mn=e.invoke_viififi;var kn=e.invoke_viii;var gn=e.invoke_v;var Tn=e.invoke_viid;var An=e.invoke_idd;var Sn=e.invoke_viiii;var En=e._emscripten_asm_const_iiiii;var Cn=e._emscripten_asm_const_iiidddddd;var Ln=e._emscripten_asm_const_iiiid;var Rn=e.__nbind_reference_external;var Pn=e._emscripten_asm_const_iiiiiiii;var Bn=e._removeAccessorPrefix;var On=e._typeModule;var Nn=e.__nbind_register_pool;var In=e.__decorate;var Fn=e._llvm_stackrestore;var xn=e.___cxa_atexit;var Un=e.__extends;var Hn=e.__nbind_get_value_object;var Dn=e.__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj;var Wn=e._emscripten_set_main_loop_timing;var Yn=e.__nbind_register_primitive;var Vn=e.__nbind_register_type;var jn=e._emscripten_memcpy_big;var qn=e.__nbind_register_function;var zn=e.___setErrNo;var Gn=e.__nbind_register_class;var Kn=e.__nbind_finish;var Xn=e._abort;var Jn=e._nbind_value;var Zn=e._llvm_stacksave;var Qn=e.___syscall54;var $n=e._defineHidden;var ne=e._emscripten_set_main_loop;var ee=e._emscripten_get_now;var re=e.__nbind_register_callback_signature;var te=e._emscripten_asm_const_iiiiii;var ie=e.__nbind_free_external;var ue=e._emscripten_asm_const_iiii;var oe=e._emscripten_asm_const_iiididi;var ae=e.___syscall6;var fe=e._atexit;var ce=e.___syscall140;var le=e.___syscall146;var se=K(0);const de=K(0);function _e(n){n=n|0;var e=0;e=v;v=v+n|0;v=v+15&-16;return e|0}function ve(){return v|0}function pe(n){n=n|0;v=n}function me(n,e){n=n|0;e=e|0;v=n;p=e}function be(n,e){n=n|0;e=e|0;if(!h){h=n;y=e}}function he(n){n=n|0;L=n}function ye(){return L|0}function we(){var n=0,e=0;iC(8104,8,400)|0;iC(8504,408,540)|0;n=9044;e=n+44|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));t[9088]=0;t[9089]=1;u[2273]=0;u[2274]=948;u[2275]=948;xn(17,8104,b|0)|0;return}function Me(n){n=n|0;ze(n+948|0);return}function ke(n){n=K(n);return((Bi(n)|0)&2147483647)>>>0>2139095040|0}function ge(n,e,r){n=n|0;e=e|0;r=r|0;n:do{if(!(u[n+(e<<3)+4>>2]|0)){if((e|2|0)==3?u[n+60>>2]|0:0){n=n+56|0;break}switch(e|0){case 0:case 2:case 4:case 5:{if(u[n+52>>2]|0){n=n+48|0;break n}break}default:{}}if(!(u[n+68>>2]|0)){n=(e|1|0)==5?948:r;break}else{n=n+64|0;break}}else n=n+(e<<3)|0}while(0);return n|0}function Te(n){n=n|0;var e=0;e=qS(1e3)|0;Ae(n,(e|0)!=0,2456);u[2276]=(u[2276]|0)+1;iC(e|0,8104,1e3)|0;if(t[n+2>>0]|0){u[e+4>>2]=2;u[e+12>>2]=4}u[e+976>>2]=n;return e|0}function Ae(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;i=v;v=v+16|0;t=i;if(!e){u[t>>2]=r;xt(n,5,3197,t)}v=i;return}function Se(){return Te(956)|0}function Ee(n){n=n|0;var e=0;e=GE(1e3)|0;Ce(e,n);Ae(u[n+976>>2]|0,1,2456);u[2276]=(u[2276]|0)+1;u[e+944>>2]=0;return e|0}function Ce(n,e){n=n|0;e=e|0;var r=0;iC(n|0,e|0,948)|0;Dt(n+948|0,e+948|0);r=n+960|0;n=e+960|0;e=r+40|0;do{u[r>>2]=u[n>>2];r=r+4|0;n=n+4|0}while((r|0)<(e|0));return}function Le(n){n=n|0;var e=0,r=0,t=0,i=0;e=n+944|0;r=u[e>>2]|0;if(r|0){Re(r+948|0,n)|0;u[e>>2]=0}r=Pe(n)|0;if(r|0){e=0;do{u[(Be(n,e)|0)+944>>2]=0;e=e+1|0}while((e|0)!=(r|0))}r=n+948|0;t=u[r>>2]|0;i=n+952|0;e=u[i>>2]|0;if((e|0)!=(t|0))u[i>>2]=e+(~((e+-4-t|0)>>>2)<<2);Oe(r);zS(n);u[2276]=(u[2276]|0)+-1;return}function Re(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0;t=u[n>>2]|0;f=n+4|0;r=u[f>>2]|0;o=r;n:do{if((t|0)==(r|0)){i=t;a=4}else{n=t;while(1){if((u[n>>2]|0)==(e|0)){i=n;a=4;break n}n=n+4|0;if((n|0)==(r|0)){n=0;break}}}}while(0);if((a|0)==4)if((i|0)!=(r|0)){t=i+4|0;n=o-t|0;e=n>>2;if(e){cC(i|0,t|0,n|0)|0;r=u[f>>2]|0}n=i+(e<<2)|0;if((r|0)==(n|0))n=1;else{u[f>>2]=r+(~((r+-4-n|0)>>>2)<<2);n=1}}else n=0;return n|0}function Pe(n){n=n|0;return(u[n+952>>2]|0)-(u[n+948>>2]|0)>>2|0}function Be(n,e){n=n|0;e=e|0;var r=0;r=u[n+948>>2]|0;if((u[n+952>>2]|0)-r>>2>>>0>e>>>0)n=u[r+(e<<2)>>2]|0;else n=0;return n|0}function Oe(n){n=n|0;var e=0,r=0,t=0,i=0;t=v;v=v+32|0;e=t;i=u[n>>2]|0;r=(u[n+4>>2]|0)-i|0;if(((u[n+8>>2]|0)-i|0)>>>0>r>>>0){i=r>>2;Oi(e,i,i,n+8|0);Ni(n,e);Ii(e)}v=t;return}function Ne(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0;l=Pe(n)|0;do{if(l|0){if((u[(Be(n,0)|0)+944>>2]|0)==(n|0)){if(!(Re(n+948|0,e)|0))break;iC(e+400|0,8504,540)|0;u[e+944>>2]=0;qe(n);break}a=u[(u[n+976>>2]|0)+12>>2]|0;f=n+948|0;c=(a|0)==0;r=0;o=0;do{t=u[(u[f>>2]|0)+(o<<2)>>2]|0;if((t|0)==(e|0))qe(n);else{i=Ee(t)|0;u[(u[f>>2]|0)+(r<<2)>>2]=i;u[i+944>>2]=n;if(!c)IL[a&15](t,i,n,r);r=r+1|0}o=o+1|0}while((o|0)!=(l|0));if(r>>>0<l>>>0){c=n+948|0;f=n+952|0;a=r;r=u[f>>2]|0;do{o=(u[c>>2]|0)+(a<<2)|0;t=o+4|0;i=r-t|0;e=i>>2;if(!e)i=r;else{cC(o|0,t|0,i|0)|0;r=u[f>>2]|0;i=r}t=o+(e<<2)|0;if((i|0)!=(t|0)){r=i+(~((i+-4-t|0)>>>2)<<2)|0;u[f>>2]=r}a=a+1|0}while((a|0)!=(l|0))}}}while(0);return}function Ie(n){n=n|0;var e=0,r=0,i=0,o=0;Fe(n,(Pe(n)|0)==0,2491);Fe(n,(u[n+944>>2]|0)==0,2545);e=n+948|0;r=u[e>>2]|0;i=n+952|0;o=u[i>>2]|0;if((o|0)!=(r|0))u[i>>2]=o+(~((o+-4-r|0)>>>2)<<2);Oe(e);e=n+976|0;r=u[e>>2]|0;iC(n|0,8104,1e3)|0;if(t[r+2>>0]|0){u[n+4>>2]=2;u[n+12>>2]=4}u[e>>2]=r;return}function Fe(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;i=v;v=v+16|0;t=i;if(!e){u[t>>2]=r;At(n,5,3197,t)}v=i;return}function xe(){return u[2276]|0}function Ue(){var n=0;n=qS(20)|0;He((n|0)!=0,2592);u[2277]=(u[2277]|0)+1;u[n>>2]=u[239];u[n+4>>2]=u[240];u[n+8>>2]=u[241];u[n+12>>2]=u[242];u[n+16>>2]=u[243];return n|0}function He(n,e){n=n|0;e=e|0;var r=0,t=0;t=v;v=v+16|0;r=t;if(!n){u[r>>2]=e;At(0,5,3197,r)}v=t;return}function De(n){n=n|0;zS(n);u[2277]=(u[2277]|0)+-1;return}function We(n,e){n=n|0;e=e|0;var r=0;if(!e){r=0;e=0}else{Fe(n,(Pe(n)|0)==0,2629);r=1}u[n+964>>2]=e;u[n+988>>2]=r;return}function Ye(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;o=t+8|0;i=t+4|0;a=t;u[i>>2]=e;Fe(n,(u[e+944>>2]|0)==0,2709);Fe(n,(u[n+964>>2]|0)==0,2763);Ve(n);e=n+948|0;u[a>>2]=(u[e>>2]|0)+(r<<2);u[o>>2]=u[a>>2];je(e,o,i)|0;u[(u[i>>2]|0)+944>>2]=n;qe(n);v=t;return}function Ve(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0;r=Pe(n)|0;if(r|0?(u[(Be(n,0)|0)+944>>2]|0)!=(n|0):0){t=u[(u[n+976>>2]|0)+12>>2]|0;i=n+948|0;o=(t|0)==0;e=0;do{a=u[(u[i>>2]|0)+(e<<2)>>2]|0;f=Ee(a)|0;u[(u[i>>2]|0)+(e<<2)>>2]=f;u[f+944>>2]=n;if(!o)IL[t&15](a,f,n,e);e=e+1|0}while((e|0)!=(r|0))}return}function je(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0;h=v;v=v+64|0;d=h+52|0;f=h+48|0;_=h+28|0;p=h+24|0;m=h+20|0;b=h;t=u[n>>2]|0;o=t;e=t+((u[e>>2]|0)-o>>2<<2)|0;t=n+4|0;i=u[t>>2]|0;a=n+8|0;do{if(i>>>0<(u[a>>2]|0)>>>0){if((e|0)==(i|0)){u[e>>2]=u[r>>2];u[t>>2]=(u[t>>2]|0)+4;break}Fi(n,e,i,e+4|0);if(e>>>0<=r>>>0)r=(u[t>>2]|0)>>>0>r>>>0?r+4|0:r;u[e>>2]=u[r>>2]}else{t=(i-o>>2)+1|0;i=Vt(n)|0;if(i>>>0<t>>>0)DE(n);s=u[n>>2]|0;l=(u[a>>2]|0)-s|0;o=l>>1;Oi(b,l>>2>>>0<i>>>1>>>0?o>>>0<t>>>0?t:o:i,e-s>>2,n+8|0);s=b+8|0;t=u[s>>2]|0;o=b+12|0;l=u[o>>2]|0;a=l;c=t;do{if((t|0)==(l|0)){l=b+4|0;t=u[l>>2]|0;y=u[b>>2]|0;i=y;if(t>>>0<=y>>>0){t=a-i>>1;t=(t|0)==0?1:t;Oi(_,t,t>>>2,u[b+16>>2]|0);u[p>>2]=u[l>>2];u[m>>2]=u[s>>2];u[f>>2]=u[p>>2];u[d>>2]=u[m>>2];Ui(_,f,d);t=u[b>>2]|0;u[b>>2]=u[_>>2];u[_>>2]=t;t=_+4|0;y=u[l>>2]|0;u[l>>2]=u[t>>2];u[t>>2]=y;t=_+8|0;y=u[s>>2]|0;u[s>>2]=u[t>>2];u[t>>2]=y;t=_+12|0;y=u[o>>2]|0;u[o>>2]=u[t>>2];u[t>>2]=y;Ii(_);t=u[s>>2]|0;break}o=t;a=((o-i>>2)+1|0)/-2|0;f=t+(a<<2)|0;i=c-o|0;o=i>>2;if(o){cC(f|0,t|0,i|0)|0;t=u[l>>2]|0}y=f+(o<<2)|0;u[s>>2]=y;u[l>>2]=t+(a<<2);t=y}}while(0);u[t>>2]=u[r>>2];u[s>>2]=(u[s>>2]|0)+4;e=xi(n,b,e)|0;Ii(b)}}while(0);v=h;return e|0}function qe(n){n=n|0;var e=0;do{e=n+984|0;if(t[e>>0]|0)break;t[e>>0]=1;c[n+504>>2]=K(k);n=u[n+944>>2]|0}while((n|0)!=0);return}function ze(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-4-t|0)>>>2)<<2);XE(r)}return}function Ge(n){n=n|0;return u[n+944>>2]|0}function Ke(n){n=n|0;Fe(n,(u[n+964>>2]|0)!=0,2832);qe(n);return}function Xe(n){n=n|0;return(t[n+984>>0]|0)!=0|0}function Je(n,e){n=n|0;e=e|0;if(iE(n,e,400)|0){iC(n|0,e|0,400)|0;qe(n)}return}function Ze(n){n=n|0;var e=de;e=K(c[n+44>>2]);n=ke(e)|0;return K(n?K(0.0):e)}function Qe(n){n=n|0;var e=de;e=K(c[n+48>>2]);if(ke(e)|0)e=t[(u[n+976>>2]|0)+2>>0]|0?K(1.0):K(0.0);return K(e)}function $e(n,e){n=n|0;e=e|0;u[n+980>>2]=e;return}function nr(n){n=n|0;return u[n+980>>2]|0}function er(n,e){n=n|0;e=e|0;var r=0;r=n+4|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function rr(n){n=n|0;return u[n+4>>2]|0}function tr(n,e){n=n|0;e=e|0;var r=0;r=n+8|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function ir(n){n=n|0;return u[n+8>>2]|0}function ur(n,e){n=n|0;e=e|0;var r=0;r=n+12|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function or(n){n=n|0;return u[n+12>>2]|0}function ar(n,e){n=n|0;e=e|0;var r=0;r=n+16|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function fr(n){n=n|0;return u[n+16>>2]|0}function cr(n,e){n=n|0;e=e|0;var r=0;r=n+20|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function lr(n){n=n|0;return u[n+20>>2]|0}function sr(n,e){n=n|0;e=e|0;var r=0;r=n+24|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function dr(n){n=n|0;return u[n+24>>2]|0}function _r(n,e){n=n|0;e=e|0;var r=0;r=n+28|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function vr(n){n=n|0;return u[n+28>>2]|0}function pr(n,e){n=n|0;e=e|0;var r=0;r=n+32|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function mr(n){n=n|0;return u[n+32>>2]|0}function br(n,e){n=n|0;e=e|0;var r=0;r=n+36|0;if((u[r>>2]|0)!=(e|0)){u[r>>2]=e;qe(n)}return}function hr(n){n=n|0;return u[n+36>>2]|0}function yr(n,e){n=n|0;e=K(e);var r=0;r=n+40|0;if(K(c[r>>2])!=e){c[r>>2]=e;qe(n)}return}function wr(n,e){n=n|0;e=K(e);var r=0;r=n+44|0;if(K(c[r>>2])!=e){c[r>>2]=e;qe(n)}return}function Mr(n,e){n=n|0;e=K(e);var r=0;r=n+48|0;if(K(c[r>>2])!=e){c[r>>2]=e;qe(n)}return}function kr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+52|0;i=n+56|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function gr(n,e){n=n|0;e=K(e);var r=0,t=0;t=n+52|0;r=n+56|0;if(!(!(K(c[t>>2])!=e)?(u[r>>2]|0)==2:0)){c[t>>2]=e;t=ke(e)|0;u[r>>2]=t?3:2;qe(n)}return}function Tr(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+52|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function Ar(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=(o^1)&1;i=n+132+(e<<3)|0;e=n+132+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Sr(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=o?0:2;i=n+132+(e<<3)|0;e=n+132+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Er(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=e+132+(r<<3)|0;e=u[t+4>>2]|0;r=n;u[r>>2]=u[t>>2];u[r+4>>2]=e;return}function Cr(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=(o^1)&1;i=n+60+(e<<3)|0;e=n+60+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Lr(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=o?0:2;i=n+60+(e<<3)|0;e=n+60+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Rr(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=e+60+(r<<3)|0;e=u[t+4>>2]|0;r=n;u[r>>2]=u[t>>2];u[r+4>>2]=e;return}function Pr(n,e){n=n|0;e=e|0;var r=0;r=n+60+(e<<3)+4|0;if((u[r>>2]|0)!=3){c[n+60+(e<<3)>>2]=K(k);u[r>>2]=3;qe(n)}return}function Br(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=(o^1)&1;i=n+204+(e<<3)|0;e=n+204+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Or(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=o?0:2;i=n+204+(e<<3)|0;e=n+204+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Nr(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=e+204+(r<<3)|0;e=u[t+4>>2]|0;r=n;u[r>>2]=u[t>>2];u[r+4>>2]=e;return}function Ir(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0,o=0;o=ke(r)|0;t=(o^1)&1;i=n+276+(e<<3)|0;e=n+276+(e<<3)+4|0;if(!(o|K(c[i>>2])==r?(u[e>>2]|0)==(t|0):0)){c[i>>2]=r;u[e>>2]=t;qe(n)}return}function Fr(n,e){n=n|0;e=e|0;return K(c[n+276+(e<<3)>>2])}function xr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+348|0;i=n+352|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Ur(n,e){n=n|0;e=K(e);var r=0,t=0;t=n+348|0;r=n+352|0;if(!(!(K(c[t>>2])!=e)?(u[r>>2]|0)==2:0)){c[t>>2]=e;t=ke(e)|0;u[r>>2]=t?3:2;qe(n)}return}function Hr(n){n=n|0;var e=0;e=n+352|0;if((u[e>>2]|0)!=3){c[n+348>>2]=K(k);u[e>>2]=3;qe(n)}return}function Dr(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+348|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function Wr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+356|0;i=n+360|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Yr(n,e){n=n|0;e=K(e);var r=0,t=0;t=n+356|0;r=n+360|0;if(!(!(K(c[t>>2])!=e)?(u[r>>2]|0)==2:0)){c[t>>2]=e;t=ke(e)|0;u[r>>2]=t?3:2;qe(n)}return}function Vr(n){n=n|0;var e=0;e=n+360|0;if((u[e>>2]|0)!=3){c[n+356>>2]=K(k);u[e>>2]=3;qe(n)}return}function jr(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+356|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function qr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+364|0;i=n+368|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function zr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=o?0:2;t=n+364|0;i=n+368|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Gr(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+364|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function Kr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+372|0;i=n+376|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Xr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=o?0:2;t=n+372|0;i=n+376|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Jr(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+372|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function Zr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+380|0;i=n+384|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function Qr(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=o?0:2;t=n+380|0;i=n+384|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function $r(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+380|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function nt(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=(o^1)&1;t=n+388|0;i=n+392|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function et(n,e){n=n|0;e=K(e);var r=0,t=0,i=0,o=0;o=ke(e)|0;r=o?0:2;t=n+388|0;i=n+392|0;if(!(o|K(c[t>>2])==e?(u[i>>2]|0)==(r|0):0)){c[t>>2]=e;u[i>>2]=r;qe(n)}return}function rt(n,e){n=n|0;e=e|0;var r=0,t=0;t=e+388|0;r=u[t+4>>2]|0;e=n;u[e>>2]=u[t>>2];u[e+4>>2]=r;return}function tt(n,e){n=n|0;e=K(e);var r=0;r=n+396|0;if(K(c[r>>2])!=e){c[r>>2]=e;qe(n)}return}function it(n){n=n|0;return K(c[n+396>>2])}function ut(n){n=n|0;return K(c[n+400>>2])}function ot(n){n=n|0;return K(c[n+404>>2])}function at(n){n=n|0;return K(c[n+408>>2])}function ft(n){n=n|0;return K(c[n+412>>2])}function ct(n){n=n|0;return K(c[n+416>>2])}function lt(n){n=n|0;return K(c[n+420>>2])}function st(n,e){n=n|0;e=e|0;Fe(n,(e|0)<6,2918);switch(e|0){case 0:{e=(u[n+496>>2]|0)==2?5:4;break}case 2:{e=(u[n+496>>2]|0)==2?4:5;break}default:{}}return K(c[n+424+(e<<2)>>2])}function dt(n,e){n=n|0;e=e|0;Fe(n,(e|0)<6,2918);switch(e|0){case 0:{e=(u[n+496>>2]|0)==2?5:4;break}case 2:{e=(u[n+496>>2]|0)==2?4:5;break}default:{}}return K(c[n+448+(e<<2)>>2])}function _t(n,e){n=n|0;e=e|0;Fe(n,(e|0)<6,2918);switch(e|0){case 0:{e=(u[n+496>>2]|0)==2?5:4;break}case 2:{e=(u[n+496>>2]|0)==2?4:5;break}default:{}}return K(c[n+472+(e<<2)>>2])}function vt(n,e){n=n|0;e=e|0;var r=0,t=de;r=u[n+4>>2]|0;if((r|0)==(u[e+4>>2]|0)){if(!r)n=1;else{t=K(c[n>>2]);n=K(P(K(t-K(c[e>>2]))))<K(.0000999999974)}}else n=0;return n|0}function pt(n,e){n=K(n);e=K(e);var r=0;if(ke(n)|0)r=ke(e)|0;else r=K(P(K(n-e)))<K(.0000999999974);return r|0}function mt(n,e){n=n|0;e=e|0;bt(n,e);return}function bt(n,e){n=n|0;e=e|0;var r=0,i=0;r=v;v=v+16|0;i=r+4|0;u[i>>2]=0;u[i+4>>2]=0;u[i+8>>2]=0;Dn(i|0,n|0,e|0,0);At(n,3,(t[i+11>>0]|0)<0?u[i>>2]|0:i,r);JE(i);v=r;return}function ht(n,e,r,t){n=K(n);e=K(e);r=r|0;t=t|0;var i=de;n=K(n*e);i=K(xE(n,K(1.0)));do{if(!(pt(i,K(0.0))|0)){n=K(n-i);if(pt(i,K(1.0))|0){n=K(n+K(1.0));break}if(r){n=K(n+K(1.0));break}if(!t){if(i>K(.5))i=K(1.0);else{t=pt(i,K(.5))|0;i=t?K(1.0):K(0.0)}n=K(n+i)}}else n=K(n-i)}while(0);return K(n/e)}function yt(n,e,r,t,i,u,o,a,f,l,s,d,_){n=n|0;e=K(e);r=r|0;t=K(t);i=i|0;u=K(u);o=o|0;a=K(a);f=K(f);l=K(l);s=K(s);d=K(d);_=_|0;var v=0,p=de,m=de,b=de,h=de,y=de,w=de;if(f<K(0.0)|l<K(0.0))_=0;else{if((_|0)!=0?(p=K(c[_+4>>2]),p!=K(0.0)):0){b=K(ht(e,p,0,0));h=K(ht(t,p,0,0));m=K(ht(u,p,0,0));p=K(ht(a,p,0,0))}else{m=u;b=e;p=a;h=t}if((i|0)==(n|0))v=pt(m,b)|0;else v=0;if((o|0)==(r|0))_=pt(p,h)|0;else _=0;if((!v?(y=K(e-s),!(wt(n,y,f)|0)):0)?!(Mt(n,y,i,f)|0):0)v=kt(n,y,i,u,f)|0;else v=1;if((!_?(w=K(t-d),!(wt(r,w,l)|0)):0)?!(Mt(r,w,o,l)|0):0)_=kt(r,w,o,a,l)|0;else _=1;_=v&_}return _|0}function wt(n,e,r){n=n|0;e=K(e);r=K(r);if((n|0)==1)n=pt(e,r)|0;else n=0;return n|0}function Mt(n,e,r,t){n=n|0;e=K(e);r=r|0;t=K(t);if((n|0)==2&(r|0)==0){if(!(e>=t))n=pt(e,t)|0;else n=1}else n=0;return n|0}function kt(n,e,r,t,i){n=n|0;e=K(e);r=r|0;t=K(t);i=K(i);if((n|0)==2&(r|0)==2&t>e){if(!(i<=e))n=pt(e,i)|0;else n=1}else n=0;return n|0}function gt(n,e,r,i,o,a,f,s,d,_,p){n=n|0;e=K(e);r=K(r);i=i|0;o=o|0;a=a|0;f=K(f);s=K(s);d=d|0;_=_|0;p=p|0;var m=0,b=0,h=0,y=0,w=de,M=de,k=0,g=0,T=0,A=0,S=0,E=0,C=0,L=0,R=0,P=0,B=0,O=de,N=de,I=de,F=0.0,x=0.0;B=v;v=v+160|0;L=B+152|0;C=B+120|0;E=B+104|0;T=B+72|0;y=B+56|0;S=B+8|0;g=B;A=(u[2279]|0)+1|0;u[2279]=A;R=n+984|0;if((t[R>>0]|0)!=0?(u[n+512>>2]|0)!=(u[2278]|0):0)k=4;else if((u[n+516>>2]|0)==(i|0))P=0;else k=4;if((k|0)==4){u[n+520>>2]=0;u[n+924>>2]=-1;u[n+928>>2]=-1;c[n+932>>2]=K(-1.0);c[n+936>>2]=K(-1.0);P=1}n:do{if(!(u[n+964>>2]|0)){if(d){m=n+916|0;if(!(pt(K(c[m>>2]),e)|0)){k=21;break}if(!(pt(K(c[n+920>>2]),r)|0)){k=21;break}if((u[n+924>>2]|0)!=(o|0)){k=21;break}m=(u[n+928>>2]|0)==(a|0)?m:0;k=22;break}h=u[n+520>>2]|0;if(!h)k=21;else{b=0;while(1){m=n+524+(b*24|0)|0;if(((pt(K(c[m>>2]),e)|0?pt(K(c[n+524+(b*24|0)+4>>2]),r)|0:0)?(u[n+524+(b*24|0)+8>>2]|0)==(o|0):0)?(u[n+524+(b*24|0)+12>>2]|0)==(a|0):0){k=22;break n}b=b+1|0;if(b>>>0>=h>>>0){k=21;break}}}}else{w=K(Tt(n,2,f));M=K(Tt(n,0,f));m=n+916|0;I=K(c[m>>2]);N=K(c[n+920>>2]);O=K(c[n+932>>2]);if(!(yt(o,e,a,r,u[n+924>>2]|0,I,u[n+928>>2]|0,N,O,K(c[n+936>>2]),w,M,p)|0)){h=u[n+520>>2]|0;if(!h)k=21;else{b=0;while(1){m=n+524+(b*24|0)|0;O=K(c[m>>2]);N=K(c[n+524+(b*24|0)+4>>2]);I=K(c[n+524+(b*24|0)+16>>2]);if(yt(o,e,a,r,u[n+524+(b*24|0)+8>>2]|0,O,u[n+524+(b*24|0)+12>>2]|0,N,I,K(c[n+524+(b*24|0)+20>>2]),w,M,p)|0){k=22;break n}b=b+1|0;if(b>>>0>=h>>>0){k=21;break}}}}else k=22}}while(0);do{if((k|0)==21){if(!(t[11697]|0)){m=0;k=31}else{m=0;k=28}}else if((k|0)==22){b=(t[11697]|0)!=0;if(!((m|0)!=0&(P^1)))if(b){k=28;break}else{k=31;break}y=m+16|0;u[n+908>>2]=u[y>>2];h=m+20|0;u[n+912>>2]=u[h>>2];if(!((t[11698]|0)==0|b^1)){u[g>>2]=St(A)|0;u[g+4>>2]=A;At(n,4,2972,g);b=u[n+972>>2]|0;if(b|0)vL[b&127](n);o=Et(o,d)|0;a=Et(a,d)|0;x=+K(c[y>>2]);F=+K(c[h>>2]);u[S>>2]=o;u[S+4>>2]=a;l[S+8>>3]=+e;l[S+16>>3]=+r;l[S+24>>3]=x;l[S+32>>3]=F;u[S+40>>2]=_;At(n,4,2989,S)}}}while(0);if((k|0)==28){b=St(A)|0;u[y>>2]=b;u[y+4>>2]=A;u[y+8>>2]=P?3047:11699;At(n,4,3038,y);b=u[n+972>>2]|0;if(b|0)vL[b&127](n);S=Et(o,d)|0;k=Et(a,d)|0;u[T>>2]=S;u[T+4>>2]=k;l[T+8>>3]=+e;l[T+16>>3]=+r;u[T+24>>2]=_;At(n,4,3049,T);k=31}if((k|0)==31){Ct(n,e,r,i,o,a,f,s,d,p);if(t[11697]|0){b=u[2279]|0;S=St(b)|0;u[E>>2]=S;u[E+4>>2]=b;u[E+8>>2]=P?3047:11699;At(n,4,3083,E);b=u[n+972>>2]|0;if(b|0)vL[b&127](n);S=Et(o,d)|0;E=Et(a,d)|0;F=+K(c[n+908>>2]);x=+K(c[n+912>>2]);u[C>>2]=S;u[C+4>>2]=E;l[C+8>>3]=F;l[C+16>>3]=x;u[C+24>>2]=_;At(n,4,3092,C)}u[n+516>>2]=i;if(!m){b=n+520|0;m=u[b>>2]|0;if((m|0)==16){if(t[11697]|0)At(n,4,3124,L);u[b>>2]=0;m=0}if(d)m=n+916|0;else{u[b>>2]=m+1;m=n+524+(m*24|0)|0}c[m>>2]=e;c[m+4>>2]=r;u[m+8>>2]=o;u[m+12>>2]=a;u[m+16>>2]=u[n+908>>2];u[m+20>>2]=u[n+912>>2];m=0}}if(d){u[n+416>>2]=u[n+908>>2];u[n+420>>2]=u[n+912>>2];t[n+985>>0]=1;t[R>>0]=0}u[2279]=(u[2279]|0)+-1;u[n+512>>2]=u[2278];v=B;return P|(m|0)==0|0}function Tt(n,e,r){n=n|0;e=e|0;r=K(r);var t=de;t=K(jt(n,e,r));return K(t+K(qt(n,e,r)))}function At(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=v;v=v+16|0;i=o;u[i>>2]=t;if(!n)t=0;else t=u[n+976>>2]|0;Ut(t,n,e,r,i);v=o;return}function St(n){n=n|0;return(n>>>0>60?3201:3201+(60-n)|0)|0}function Et(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+32|0;r=i+12|0;t=i;u[r>>2]=u[254];u[r+4>>2]=u[255];u[r+8>>2]=u[256];u[t>>2]=u[257];u[t+4>>2]=u[258];u[t+8>>2]=u[259];if((n|0)>2)n=11699;else n=u[(e?t:r)+(n<<2)>>2]|0;v=i;return n|0}function Ct(n,e,r,i,a,f,l,s,_,p){n=n|0;e=K(e);r=K(r);i=i|0;a=a|0;f=f|0;l=K(l);s=K(s);_=_|0;p=p|0;var m=0,b=0,h=0,y=0,w=de,M=de,k=de,g=de,T=de,A=de,S=de,E=0,C=0,L=0,R=de,P=de,B=0,O=de,N=0,I=0,F=0,x=0,U=0,H=0,D=0,W=0,Y=0,V=0,j=0,q=0,z=0,G=0,X=0,J=0,Z=0,Q=0,$=de,nn=de,en=de,rn=de,tn=de,un=0,on=0,an=0,fn=0,cn=0,ln=de,sn=de,dn=de,_n=de,vn=de,pn=de,mn=0,bn=de,hn=de,yn=de,wn=de,Mn=de,kn=de,gn=0,Tn=0,An=de,Sn=de,En=0,Cn=0,Ln=0,Rn=0,Pn=de,Bn=0,On=0,Nn=0,In=0,Fn=0,xn=0,Un=0,Hn=de,Dn=0,Wn=0;Un=v;v=v+16|0;un=Un+12|0;on=Un+8|0;an=Un+4|0;fn=Un;Fe(n,(a|0)==0|(ke(e)|0)^1,3326);Fe(n,(f|0)==0|(ke(r)|0)^1,3406);On=Kt(n,i)|0;u[n+496>>2]=On;Fn=Xt(2,On)|0;xn=Xt(0,On)|0;c[n+440>>2]=K(jt(n,Fn,l));c[n+444>>2]=K(qt(n,Fn,l));c[n+428>>2]=K(jt(n,xn,l));c[n+436>>2]=K(qt(n,xn,l));c[n+464>>2]=K(Jt(n,Fn));c[n+468>>2]=K(Zt(n,Fn));c[n+452>>2]=K(Jt(n,xn));c[n+460>>2]=K(Zt(n,xn));c[n+488>>2]=K(Qt(n,Fn,l));c[n+492>>2]=K($t(n,Fn,l));c[n+476>>2]=K(Qt(n,xn,l));c[n+484>>2]=K($t(n,xn,l));do{if(!(u[n+964>>2]|0)){Nn=n+948|0;In=(u[n+952>>2]|0)-(u[Nn>>2]|0)>>2;if(!In){ei(n,e,r,a,f,l,s);break}if(!_?ri(n,e,r,a,f,l,s)|0:0)break;Ve(n);J=n+508|0;t[J>>0]=0;Fn=Xt(u[n+4>>2]|0,On)|0;xn=ti(Fn,On)|0;Bn=zt(Fn)|0;Z=u[n+8>>2]|0;Cn=n+28|0;Q=(u[Cn>>2]|0)!=0;Mn=Bn?l:s;An=Bn?s:l;$=K(ii(n,Fn,l));nn=K(ui(n,Fn,l));w=K(ii(n,xn,l));kn=K(oi(n,Fn,l));Sn=K(oi(n,xn,l));L=Bn?a:f;En=Bn?f:a;Pn=Bn?kn:Sn;T=Bn?Sn:kn;wn=K(Tt(n,2,l));g=K(Tt(n,0,l));M=K(K(Ot(n+364|0,l))-Pn);k=K(K(Ot(n+380|0,l))-Pn);A=K(K(Ot(n+372|0,s))-T);S=K(K(Ot(n+388|0,s))-T);en=Bn?M:A;rn=Bn?k:S;wn=K(e-wn);e=K(wn-Pn);if(ke(e)|0)Pn=e;else Pn=K(OE(K(IE(e,k)),M));hn=K(r-g);e=K(hn-T);if(ke(e)|0)yn=e;else yn=K(OE(K(IE(e,S)),A));M=Bn?Pn:yn;bn=Bn?yn:Pn;n:do{if((L|0)==1){i=0;b=0;while(1){m=Be(n,b)|0;if(!i){if(K(fi(m))>K(0.0)?K(ci(m))>K(0.0):0)i=m;else i=0}else if(ai(m)|0){y=0;break n}b=b+1|0;if(b>>>0>=In>>>0){y=i;break}}}else y=0}while(0);E=y+500|0;C=y+504|0;i=0;m=0;e=K(0.0);h=0;do{b=u[(u[Nn>>2]|0)+(h<<2)>>2]|0;if((u[b+36>>2]|0)==1){li(b);t[b+985>>0]=1;t[b+984>>0]=0}else{Pt(b);if(_)Nt(b,Kt(b,On)|0,M,bn,Pn);do{if((u[b+24>>2]|0)!=1){if((b|0)==(y|0)){u[E>>2]=u[2278];c[C>>2]=K(0.0);break}else{si(n,b,Pn,a,yn,Pn,yn,f,On,p);break}}else{if(m|0)u[m+960>>2]=b;u[b+960>>2]=0;m=b;i=(i|0)==0?b:i}}while(0);pn=K(c[b+504>>2]);e=K(e+K(pn+K(Tt(b,Fn,Pn))))}h=h+1|0}while((h|0)!=(In|0));F=e>M;mn=Q&((L|0)==2&F)?1:L;N=(En|0)==1;U=N&(_^1);H=(mn|0)==1;D=(mn|0)==2;W=976+(Fn<<2)|0;Y=(En|2|0)==2;G=N&(Q^1);V=1040+(xn<<2)|0;j=1040+(Fn<<2)|0;q=976+(xn<<2)|0;z=(En|0)!=1;F=Q&((L|0)!=0&F);I=n+976|0;N=N^1;e=M;B=0;x=0;pn=K(0.0);tn=K(0.0);while(1){n:do{if(B>>>0<In>>>0){C=u[Nn>>2]|0;h=0;S=K(0.0);A=K(0.0);k=K(0.0);M=K(0.0);b=0;m=0;y=B;while(1){E=u[C+(y<<2)>>2]|0;if((u[E+36>>2]|0)!=1?(u[E+940>>2]=x,(u[E+24>>2]|0)!=1):0){g=K(Tt(E,Fn,Pn));X=u[W>>2]|0;r=K(Ot(E+380+(X<<3)|0,Mn));T=K(c[E+504>>2]);r=K(IE(r,T));r=K(OE(K(Ot(E+364+(X<<3)|0,Mn)),r));if(Q&(h|0)!=0&K(g+K(A+r))>e){f=h;g=S;L=y;break n}g=K(g+r);r=K(A+g);g=K(S+g);if(ai(E)|0){k=K(k+K(fi(E)));M=K(M-K(T*K(ci(E))))}if(m|0)u[m+960>>2]=E;u[E+960>>2]=0;h=h+1|0;m=E;b=(b|0)==0?E:b}else{g=S;r=A}y=y+1|0;if(y>>>0<In>>>0){S=g;A=r}else{f=h;L=y;break}}}else{f=0;g=K(0.0);k=K(0.0);M=K(0.0);b=0;L=B}}while(0);X=k>K(0.0)&k<K(1.0);R=X?K(1.0):k;X=M>K(0.0)&M<K(1.0);S=X?K(1.0):M;do{if(!H){if(!(g<en&((ke(en)|0)^1))){if(!(g>rn&((ke(rn)|0)^1))){if(!(t[(u[I>>2]|0)+3>>0]|0)){if(!(R==K(0.0))?!(K(fi(n))==K(0.0)):0){X=53;break}e=g;X=53}else X=51}else{e=rn;X=51}}else{e=en;X=51}}else X=51}while(0);if((X|0)==51){X=0;if(ke(e)|0)X=53;else{P=K(e-g);O=e}}if((X|0)==53){X=0;if(g<K(0.0)){P=K(-g);O=e}else{P=K(0.0);O=e}}if(!U?(cn=(b|0)==0,!cn):0){h=u[W>>2]|0;y=P<K(0.0);T=K(P/S);E=P>K(0.0);A=K(P/R);k=K(0.0);g=K(0.0);e=K(0.0);m=b;do{r=K(Ot(m+380+(h<<3)|0,Mn));M=K(Ot(m+364+(h<<3)|0,Mn));M=K(IE(r,K(OE(M,K(c[m+504>>2])))));if(y){r=K(M*K(ci(m)));if(r!=K(-0.0)?(Hn=K(M-K(T*r)),ln=K(di(m,Fn,Hn,O,Pn)),Hn!=ln):0){k=K(k-K(ln-M));e=K(e+r)}}else if((E?(sn=K(fi(m)),sn!=K(0.0)):0)?(Hn=K(M+K(A*sn)),dn=K(di(m,Fn,Hn,O,Pn)),Hn!=dn):0){k=K(k-K(dn-M));g=K(g-sn)}m=u[m+960>>2]|0}while((m|0)!=0);e=K(S+e);M=K(P+k);if(!cn){T=K(R+g);y=u[W>>2]|0;E=M<K(0.0);C=e==K(0.0);A=K(M/e);h=M>K(0.0);T=K(M/T);e=K(0.0);do{Hn=K(Ot(b+380+(y<<3)|0,Mn));k=K(Ot(b+364+(y<<3)|0,Mn));k=K(IE(Hn,K(OE(k,K(c[b+504>>2])))));if(E){Hn=K(k*K(ci(b)));M=K(-Hn);if(Hn!=K(-0.0)){Hn=K(A*M);M=K(di(b,Fn,K(k+(C?M:Hn)),O,Pn))}else M=k}else if(h?(_n=K(fi(b)),_n!=K(0.0)):0)M=K(di(b,Fn,K(k+K(T*_n)),O,Pn));else M=k;e=K(e-K(M-k));g=K(Tt(b,Fn,Pn));r=K(Tt(b,xn,Pn));M=K(M+g);c[on>>2]=M;u[fn>>2]=1;k=K(c[b+396>>2]);n:do{if(ke(k)|0){m=ke(bn)|0;do{if(!m){if(F|(Bt(b,xn,bn)|0|N))break;if((_i(n,b)|0)!=4)break;if((u[(vi(b,xn)|0)+4>>2]|0)==3)break;if((u[(pi(b,xn)|0)+4>>2]|0)==3)break;c[un>>2]=bn;u[an>>2]=1;break n}}while(0);if(Bt(b,xn,bn)|0){m=u[b+992+(u[q>>2]<<2)>>2]|0;Hn=K(r+K(Ot(m,bn)));c[un>>2]=Hn;m=z&(u[m+4>>2]|0)==2;u[an>>2]=((ke(Hn)|0|m)^1)&1;break}else{c[un>>2]=bn;u[an>>2]=m?0:2;break}}else{Hn=K(M-g);R=K(Hn/k);Hn=K(k*Hn);u[an>>2]=1;c[un>>2]=K(r+(Bn?R:Hn))}}while(0);mi(b,Fn,O,Pn,fn,on);mi(b,xn,bn,Pn,an,un);do{if(!(Bt(b,xn,bn)|0)?(_i(n,b)|0)==4:0){if((u[(vi(b,xn)|0)+4>>2]|0)==3){m=0;break}m=(u[(pi(b,xn)|0)+4>>2]|0)!=3}else m=0}while(0);Hn=K(c[on>>2]);R=K(c[un>>2]);Dn=u[fn>>2]|0;Wn=u[an>>2]|0;gt(b,Bn?Hn:R,Bn?R:Hn,On,Bn?Dn:Wn,Bn?Wn:Dn,Pn,yn,_&(m^1),3488,p)|0;t[J>>0]=t[J>>0]|t[b+508>>0];b=u[b+960>>2]|0}while((b|0)!=0)}else e=K(0.0)}else e=K(0.0);e=K(P+e);Wn=e<K(0.0)&1;t[J>>0]=Wn|o[J>>0];if(D&e>K(0.0)){m=u[W>>2]|0;if((u[n+364+(m<<3)+4>>2]|0)!=0?(vn=K(Ot(n+364+(m<<3)|0,Mn)),vn>=K(0.0)):0)M=K(OE(K(0.0),K(vn-K(O-e))));else M=K(0.0)}else M=e;E=B>>>0<L>>>0;if(E){y=u[Nn>>2]|0;h=B;m=0;do{b=u[y+(h<<2)>>2]|0;if(!(u[b+24>>2]|0)){m=((u[(vi(b,Fn)|0)+4>>2]|0)==3&1)+m|0;m=m+((u[(pi(b,Fn)|0)+4>>2]|0)==3&1)|0}h=h+1|0}while((h|0)!=(L|0));if(m){g=K(0.0);r=K(0.0)}else X=101}else X=101;n:do{if((X|0)==101){X=0;switch(Z|0){case 1:{m=0;g=K(M*K(.5));r=K(0.0);break n}case 2:{m=0;g=M;r=K(0.0);break n}case 3:{if(f>>>0<=1){m=0;g=K(0.0);r=K(0.0);break n}r=K((f+-1|0)>>>0);m=0;g=K(0.0);r=K(K(OE(M,K(0.0)))/r);break n}case 5:{r=K(M/K((f+1|0)>>>0));m=0;g=r;break n}case 4:{r=K(M/K(f>>>0));m=0;g=K(r*K(.5));break n}default:{m=0;g=K(0.0);r=K(0.0);break n}}}}while(0);e=K($+g);if(E){k=K(M/K(m|0));h=u[Nn>>2]|0;b=B;M=K(0.0);do{m=u[h+(b<<2)>>2]|0;n:do{if((u[m+36>>2]|0)!=1){switch(u[m+24>>2]|0){case 1:{if(bi(m,Fn)|0){if(!_)break n;Hn=K(hi(m,Fn,O));Hn=K(Hn+K(Jt(n,Fn)));Hn=K(Hn+K(jt(m,Fn,Pn)));c[m+400+(u[j>>2]<<2)>>2]=Hn;break n}break}case 0:{Wn=(u[(vi(m,Fn)|0)+4>>2]|0)==3;Hn=K(k+e);e=Wn?Hn:e;if(_){Wn=m+400+(u[j>>2]<<2)|0;c[Wn>>2]=K(e+K(c[Wn>>2]))}Wn=(u[(pi(m,Fn)|0)+4>>2]|0)==3;Hn=K(k+e);e=Wn?Hn:e;if(U){Hn=K(r+K(Tt(m,Fn,Pn)));M=bn;e=K(e+K(Hn+K(c[m+504>>2])));break n}else{e=K(e+K(r+K(yi(m,Fn,Pn))));M=K(OE(M,K(yi(m,xn,Pn))));break n}}default:{}}if(_){Hn=K(g+K(Jt(n,Fn)));Wn=m+400+(u[j>>2]<<2)|0;c[Wn>>2]=K(Hn+K(c[Wn>>2]))}}}while(0);b=b+1|0}while((b|0)!=(L|0))}else M=K(0.0);r=K(nn+e);if(Y)g=K(K(di(n,xn,K(Sn+M),An,l))-Sn);else g=bn;k=K(K(di(n,xn,K(Sn+(G?bn:M)),An,l))-Sn);if(E&_){b=B;do{h=u[(u[Nn>>2]|0)+(b<<2)>>2]|0;do{if((u[h+36>>2]|0)!=1){if((u[h+24>>2]|0)==1){if(bi(h,xn)|0){Hn=K(hi(h,xn,bn));Hn=K(Hn+K(Jt(n,xn)));Hn=K(Hn+K(jt(h,xn,Pn)));m=u[V>>2]|0;c[h+400+(m<<2)>>2]=Hn;if(!(ke(Hn)|0))break}else m=u[V>>2]|0;Hn=K(Jt(n,xn));c[h+400+(m<<2)>>2]=K(Hn+K(jt(h,xn,Pn)));break}m=_i(n,h)|0;do{if((m|0)==4){if((u[(vi(h,xn)|0)+4>>2]|0)==3){X=139;break}if((u[(pi(h,xn)|0)+4>>2]|0)==3){X=139;break}if(Bt(h,xn,bn)|0){e=w;break}Dn=u[h+908+(u[W>>2]<<2)>>2]|0;u[un>>2]=Dn;e=K(c[h+396>>2]);Wn=ke(e)|0;M=(u[d>>2]=Dn,K(c[d>>2]));if(Wn)e=k;else{P=K(Tt(h,xn,Pn));Hn=K(M/e);e=K(e*M);e=K(P+(Bn?Hn:e))}c[on>>2]=e;c[un>>2]=K(K(Tt(h,Fn,Pn))+M);u[an>>2]=1;u[fn>>2]=1;mi(h,Fn,O,Pn,an,un);mi(h,xn,bn,Pn,fn,on);e=K(c[un>>2]);P=K(c[on>>2]);Hn=Bn?e:P;e=Bn?P:e;Wn=((ke(Hn)|0)^1)&1;gt(h,Hn,e,On,Wn,((ke(e)|0)^1)&1,Pn,yn,1,3493,p)|0;e=w}else X=139}while(0);n:do{if((X|0)==139){X=0;e=K(g-K(yi(h,xn,Pn)));do{if((u[(vi(h,xn)|0)+4>>2]|0)==3){if((u[(pi(h,xn)|0)+4>>2]|0)!=3)break;e=K(w+K(OE(K(0.0),K(e*K(.5)))));break n}}while(0);if((u[(pi(h,xn)|0)+4>>2]|0)==3){e=w;break}if((u[(vi(h,xn)|0)+4>>2]|0)==3){e=K(w+K(OE(K(0.0),e)));break}switch(m|0){case 1:{e=w;break n}case 2:{e=K(w+K(e*K(.5)));break n}default:{e=K(w+e);break n}}}}while(0);Hn=K(pn+e);Wn=h+400+(u[V>>2]<<2)|0;c[Wn>>2]=K(Hn+K(c[Wn>>2]))}}while(0);b=b+1|0}while((b|0)!=(L|0))}pn=K(pn+k);tn=K(OE(tn,r));f=x+1|0;if(L>>>0>=In>>>0)break;else{e=O;B=L;x=f}}do{if(_){m=f>>>0>1;if(!m?!(wi(n)|0):0)break;if(!(ke(bn)|0)){e=K(bn-pn);n:do{switch(u[n+12>>2]|0){case 3:{w=K(w+e);A=K(0.0);break}case 2:{w=K(w+K(e*K(.5)));A=K(0.0);break}case 4:{if(bn>pn)A=K(e/K(f>>>0));else A=K(0.0);break}case 7:if(bn>pn){w=K(w+K(e/K(f<<1>>>0)));A=K(e/K(f>>>0));A=m?A:K(0.0);break n}else{w=K(w+K(e*K(.5)));A=K(0.0);break n}case 6:{A=K(e/K(x>>>0));A=bn>pn&m?A:K(0.0);break}default:A=K(0.0)}}while(0);if(f|0){E=1040+(xn<<2)|0;C=976+(xn<<2)|0;y=0;b=0;while(1){n:do{if(b>>>0<In>>>0){M=K(0.0);k=K(0.0);e=K(0.0);h=b;while(1){m=u[(u[Nn>>2]|0)+(h<<2)>>2]|0;do{if((u[m+36>>2]|0)!=1?(u[m+24>>2]|0)==0:0){if((u[m+940>>2]|0)!=(y|0))break n;if(Mi(m,xn)|0){Hn=K(c[m+908+(u[C>>2]<<2)>>2]);e=K(OE(e,K(Hn+K(Tt(m,xn,Pn)))))}if((_i(n,m)|0)!=5)break;vn=K(ki(m));vn=K(vn+K(jt(m,0,Pn)));Hn=K(c[m+912>>2]);Hn=K(K(Hn+K(Tt(m,0,Pn)))-vn);vn=K(OE(k,vn));Hn=K(OE(M,Hn));M=Hn;k=vn;e=K(OE(e,K(vn+Hn)))}}while(0);m=h+1|0;if(m>>>0<In>>>0)h=m;else{h=m;break}}}else{k=K(0.0);e=K(0.0);h=b}}while(0);T=K(A+e);r=w;w=K(w+T);if(b>>>0<h>>>0){g=K(r+k);m=b;do{b=u[(u[Nn>>2]|0)+(m<<2)>>2]|0;n:do{if((u[b+36>>2]|0)!=1?(u[b+24>>2]|0)==0:0)switch(_i(n,b)|0){case 1:{Hn=K(r+K(jt(b,xn,Pn)));c[b+400+(u[E>>2]<<2)>>2]=Hn;break n}case 3:{Hn=K(K(w-K(qt(b,xn,Pn)))-K(c[b+908+(u[C>>2]<<2)>>2]));c[b+400+(u[E>>2]<<2)>>2]=Hn;break n}case 2:{Hn=K(r+K(K(T-K(c[b+908+(u[C>>2]<<2)>>2]))*K(.5)));c[b+400+(u[E>>2]<<2)>>2]=Hn;break n}case 4:{Hn=K(r+K(jt(b,xn,Pn)));c[b+400+(u[E>>2]<<2)>>2]=Hn;if(Bt(b,xn,bn)|0)break n;if(Bn){M=K(c[b+908>>2]);e=K(M+K(Tt(b,Fn,Pn)));k=T}else{k=K(c[b+912>>2]);k=K(k+K(Tt(b,xn,Pn)));e=T;M=K(c[b+908>>2])}if(pt(e,M)|0?pt(k,K(c[b+912>>2]))|0:0)break n;gt(b,e,k,On,1,1,Pn,yn,1,3501,p)|0;break n}case 5:{c[b+404>>2]=K(K(g-K(ki(b)))+K(hi(b,0,bn)));break n}default:break n}}while(0);m=m+1|0}while((m|0)!=(h|0))}y=y+1|0;if((y|0)==(f|0))break;else b=h}}}}}while(0);c[n+908>>2]=K(di(n,2,wn,l,l));c[n+912>>2]=K(di(n,0,hn,s,l));if((mn|0)!=0?(gn=u[n+32>>2]|0,Tn=(mn|0)==2,!(Tn&(gn|0)!=2)):0){if(Tn&(gn|0)==2){e=K(kn+O);e=K(OE(K(IE(e,K(gi(n,Fn,tn,Mn)))),kn));X=198}}else{e=K(di(n,Fn,tn,Mn,l));X=198}if((X|0)==198)c[n+908+(u[976+(Fn<<2)>>2]<<2)>>2]=e;if((En|0)!=0?(Ln=u[n+32>>2]|0,Rn=(En|0)==2,!(Rn&(Ln|0)!=2)):0){if(Rn&(Ln|0)==2){e=K(Sn+bn);e=K(OE(K(IE(e,K(gi(n,xn,K(Sn+pn),An)))),Sn));X=204}}else{e=K(di(n,xn,K(Sn+pn),An,l));X=204}if((X|0)==204)c[n+908+(u[976+(xn<<2)>>2]<<2)>>2]=e;if(_){if((u[Cn>>2]|0)==2){b=976+(xn<<2)|0;h=1040+(xn<<2)|0;m=0;do{y=Be(n,m)|0;if(!(u[y+24>>2]|0)){Dn=u[b>>2]|0;Hn=K(c[n+908+(Dn<<2)>>2]);Wn=y+400+(u[h>>2]<<2)|0;Hn=K(Hn-K(c[Wn>>2]));c[Wn>>2]=K(Hn-K(c[y+908+(Dn<<2)>>2]))}m=m+1|0}while((m|0)!=(In|0))}if(i|0){m=Bn?mn:a;do{Ti(n,i,Pn,m,yn,On,p);i=u[i+960>>2]|0}while((i|0)!=0)}m=(Fn|2|0)==3;b=(xn|2|0)==3;if(m|b){i=0;do{h=u[(u[Nn>>2]|0)+(i<<2)>>2]|0;if((u[h+36>>2]|0)!=1){if(m)Ai(n,h,Fn);if(b)Ai(n,h,xn)}i=i+1|0}while((i|0)!=(In|0))}}}else ni(n,e,r,a,f,l,s)}while(0);v=Un;return}function Lt(n,e){n=n|0;e=K(e);var r=0;Ae(n,e>=K(0.0),3147);r=e==K(0.0);c[n+4>>2]=r?K(0.0):e;return}function Rt(n,e,r,i){n=n|0;e=K(e);r=K(r);i=i|0;var o=de,a=de,f=0,l=0,s=0;u[2278]=(u[2278]|0)+1;Pt(n);if(!(Bt(n,2,e)|0)){o=K(Ot(n+380|0,e));if(!(o>=K(0.0))){s=((ke(e)|0)^1)&1;o=e}else s=2}else{o=K(Ot(u[n+992>>2]|0,e));s=1;o=K(o+K(Tt(n,2,e)))}if(!(Bt(n,0,r)|0)){a=K(Ot(n+388|0,r));if(!(a>=K(0.0))){l=((ke(r)|0)^1)&1;a=r}else l=2}else{a=K(Ot(u[n+996>>2]|0,r));l=1;a=K(a+K(Tt(n,0,e)))}f=n+976|0;if(gt(n,o,a,i,s,l,e,r,1,3189,u[f>>2]|0)|0?(Nt(n,u[n+496>>2]|0,e,r,e),It(n,K(c[(u[f>>2]|0)+4>>2]),K(0.0),K(0.0)),t[11696]|0):0)mt(n,7);return}function Pt(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;a=f+24|0;o=f+16|0;t=f+8|0;i=f;r=0;do{e=n+380+(r<<3)|0;if(!((u[n+380+(r<<3)+4>>2]|0)!=0?(c=e,l=u[c+4>>2]|0,s=t,u[s>>2]=u[c>>2],u[s+4>>2]=l,s=n+364+(r<<3)|0,l=u[s+4>>2]|0,c=i,u[c>>2]=u[s>>2],u[c+4>>2]=l,u[o>>2]=u[t>>2],u[o+4>>2]=u[t+4>>2],u[a>>2]=u[i>>2],u[a+4>>2]=u[i+4>>2],vt(o,a)|0):0))e=n+348+(r<<3)|0;u[n+992+(r<<2)>>2]=e;r=r+1|0}while((r|0)!=2);v=f;return}function Bt(n,e,r){n=n|0;e=e|0;r=K(r);var t=0;n=u[n+992+(u[976+(e<<2)>>2]<<2)>>2]|0;switch(u[n+4>>2]|0){case 0:case 3:{n=0;break}case 1:{if(K(c[n>>2])<K(0.0))n=0;else t=5;break}case 2:{if(K(c[n>>2])<K(0.0))n=0;else n=(ke(r)|0)^1;break}default:t=5}if((t|0)==5)n=1;return n|0}function Ot(n,e){n=n|0;e=K(e);switch(u[n+4>>2]|0){case 2:{e=K(K(K(c[n>>2])*e)/K(100.0));break}case 1:{e=K(c[n>>2]);break}default:e=K(k)}return K(e)}function Nt(n,e,r,t,i){n=n|0;e=e|0;r=K(r);t=K(t);i=K(i);var o=0,a=de;e=u[n+944>>2]|0?e:1;o=Xt(u[n+4>>2]|0,e)|0;e=ti(o,e)|0;r=K(Pi(n,o,r));t=K(Pi(n,e,t));a=K(r+K(jt(n,o,i)));c[n+400+(u[1040+(o<<2)>>2]<<2)>>2]=a;r=K(r+K(qt(n,o,i)));c[n+400+(u[1e3+(o<<2)>>2]<<2)>>2]=r;r=K(t+K(jt(n,e,i)));c[n+400+(u[1040+(e<<2)>>2]<<2)>>2]=r;i=K(t+K(qt(n,e,i)));c[n+400+(u[1e3+(e<<2)>>2]<<2)>>2]=i;return}function It(n,e,r,t){n=n|0;e=K(e);r=K(r);t=K(t);var i=0,o=0,a=de,f=de,l=0,s=0,d=de,_=0,v=de,p=de,m=de,b=de;if(!(e==K(0.0))){i=n+400|0;b=K(c[i>>2]);o=n+404|0;m=K(c[o>>2]);_=n+416|0;p=K(c[_>>2]);s=n+420|0;a=K(c[s>>2]);v=K(b+r);d=K(m+t);t=K(v+p);f=K(d+a);l=(u[n+988>>2]|0)==1;c[i>>2]=K(ht(b,e,0,l));c[o>>2]=K(ht(m,e,0,l));r=K(xE(K(p*e),K(1.0)));if(pt(r,K(0.0))|0)o=0;else o=(pt(r,K(1.0))|0)^1;r=K(xE(K(a*e),K(1.0)));if(pt(r,K(0.0))|0)i=0;else i=(pt(r,K(1.0))|0)^1;b=K(ht(t,e,l&o,l&(o^1)));c[_>>2]=K(b-K(ht(v,e,0,l)));b=K(ht(f,e,l&i,l&(i^1)));c[s>>2]=K(b-K(ht(d,e,0,l)));o=(u[n+952>>2]|0)-(u[n+948>>2]|0)>>2;if(o|0){i=0;do{It(Be(n,i)|0,e,v,d);i=i+1|0}while((i|0)!=(o|0))}}return}function Ft(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;switch(r|0){case 5:case 0:{n=uE(u[489]|0,t,i)|0;break}default:n=HE(t,i)|0}return n|0}function xt(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;i=v;v=v+16|0;o=i;u[o>>2]=t;Ut(n,0,e,r,o);v=i;return}function Ut(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;n=n|0?n:956;CL[u[n+8>>2]&1](n,e,r,t,i)|0;if((r|0)==5)Xn();else return}function Ht(n,e,r){n=n|0;e=e|0;r=r|0;t[n+e>>0]=r&1;return}function Dt(n,e){n=n|0;e=e|0;var r=0,t=0;u[n>>2]=0;u[n+4>>2]=0;u[n+8>>2]=0;r=e+4|0;t=(u[r>>2]|0)-(u[e>>2]|0)>>2;if(t|0){Wt(n,t);Yt(n,u[e>>2]|0,u[r>>2]|0,t)}return}function Wt(n,e){n=n|0;e=e|0;var r=0;if((Vt(n)|0)>>>0<e>>>0)DE(n);if(e>>>0>1073741823)Xn();else{r=GE(e<<2)|0;u[n+4>>2]=r;u[n>>2]=r;u[n+8>>2]=r+(e<<2);return}}function Yt(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;t=n+4|0;n=r-e|0;if((n|0)>0){iC(u[t>>2]|0,e|0,n|0)|0;u[t>>2]=(u[t>>2]|0)+(n>>>2<<2)}return}function Vt(n){n=n|0;return 1073741823}function jt(n,e,r){n=n|0;e=e|0;r=K(r);if(zt(e)|0?(u[n+96>>2]|0)!=0:0)n=n+92|0;else n=ge(n+60|0,u[1040+(e<<2)>>2]|0,992)|0;return K(Gt(n,r))}function qt(n,e,r){n=n|0;e=e|0;r=K(r);if(zt(e)|0?(u[n+104>>2]|0)!=0:0)n=n+100|0;else n=ge(n+60|0,u[1e3+(e<<2)>>2]|0,992)|0;return K(Gt(n,r))}function zt(n){n=n|0;return(n|1|0)==3|0}function Gt(n,e){n=n|0;e=K(e);if((u[n+4>>2]|0)==3)e=K(0.0);else e=K(Ot(n,e));return K(e)}function Kt(n,e){n=n|0;e=e|0;n=u[n>>2]|0;return((n|0)==0?(e|0)>1?e:1:n)|0}function Xt(n,e){n=n|0;e=e|0;var r=0;n:do{if((e|0)==2){switch(n|0){case 2:{n=3;break n}case 3:break;default:{r=4;break n}}n=2}else r=4}while(0);return n|0}function Jt(n,e){n=n|0;e=e|0;var r=de;if(!((zt(e)|0?(u[n+312>>2]|0)!=0:0)?(r=K(c[n+308>>2]),r>=K(0.0)):0))r=K(OE(K(c[(ge(n+276|0,u[1040+(e<<2)>>2]|0,992)|0)>>2]),K(0.0)));return K(r)}function Zt(n,e){n=n|0;e=e|0;var r=de;if(!((zt(e)|0?(u[n+320>>2]|0)!=0:0)?(r=K(c[n+316>>2]),r>=K(0.0)):0))r=K(OE(K(c[(ge(n+276|0,u[1e3+(e<<2)>>2]|0,992)|0)>>2]),K(0.0)));return K(r)}function Qt(n,e,r){n=n|0;e=e|0;r=K(r);var t=de;if(!((zt(e)|0?(u[n+240>>2]|0)!=0:0)?(t=K(Ot(n+236|0,r)),t>=K(0.0)):0))t=K(OE(K(Ot(ge(n+204|0,u[1040+(e<<2)>>2]|0,992)|0,r)),K(0.0)));return K(t)}function $t(n,e,r){n=n|0;e=e|0;r=K(r);var t=de;if(!((zt(e)|0?(u[n+248>>2]|0)!=0:0)?(t=K(Ot(n+244|0,r)),t>=K(0.0)):0))t=K(OE(K(Ot(ge(n+204|0,u[1e3+(e<<2)>>2]|0,992)|0,r)),K(0.0)));return K(t)}function ni(n,e,r,t,i,o,a){n=n|0;e=K(e);r=K(r);t=t|0;i=i|0;o=K(o);a=K(a);var f=de,l=de,s=de,d=de,_=de,p=de,m=0,b=0,h=0;h=v;v=v+16|0;m=h;b=n+964|0;Fe(n,(u[b>>2]|0)!=0,3519);f=K(oi(n,2,e));l=K(oi(n,0,e));s=K(Tt(n,2,e));d=K(Tt(n,0,e));if(ke(e)|0)_=e;else _=K(OE(K(0.0),K(K(e-s)-f)));if(ke(r)|0)p=r;else p=K(OE(K(0.0),K(K(r-d)-l)));if((t|0)==1&(i|0)==1){c[n+908>>2]=K(di(n,2,K(e-s),o,o));e=K(di(n,0,K(r-d),a,o))}else{RL[u[b>>2]&1](m,n,_,t,p,i);_=K(f+K(c[m>>2]));p=K(e-s);c[n+908>>2]=K(di(n,2,(t|2|0)==2?_:p,o,o));p=K(l+K(c[m+4>>2]));e=K(r-d);e=K(di(n,0,(i|2|0)==2?p:e,a,o))}c[n+912>>2]=e;v=h;return}function ei(n,e,r,t,i,u,o){n=n|0;e=K(e);r=K(r);t=t|0;i=i|0;u=K(u);o=K(o);var a=de,f=de,l=de,s=de;l=K(oi(n,2,u));a=K(oi(n,0,u));s=K(Tt(n,2,u));f=K(Tt(n,0,u));e=K(e-s);c[n+908>>2]=K(di(n,2,(t|2|0)==2?l:e,u,u));r=K(r-f);c[n+912>>2]=K(di(n,0,(i|2|0)==2?a:r,o,u));return}function ri(n,e,r,t,i,u,o){n=n|0;e=K(e);r=K(r);t=t|0;i=i|0;u=K(u);o=K(o);var a=0,f=de,l=de;a=(t|0)==2;if((!(e<=K(0.0)&a)?!(r<=K(0.0)&(i|0)==2):0)?!((t|0)==1&(i|0)==1):0)n=0;else{f=K(Tt(n,0,u));l=K(Tt(n,2,u));a=e<K(0.0)&a|(ke(e)|0);e=K(e-l);c[n+908>>2]=K(di(n,2,a?K(0.0):e,u,u));e=K(r-f);a=r<K(0.0)&(i|0)==2|(ke(r)|0);c[n+912>>2]=K(di(n,0,a?K(0.0):e,o,u));n=1}return n|0}function ti(n,e){n=n|0;e=e|0;if(Si(n)|0)n=Xt(2,e)|0;else n=0;return n|0}function ii(n,e,r){n=n|0;e=e|0;r=K(r);r=K(Qt(n,e,r));return K(r+K(Jt(n,e)))}function ui(n,e,r){n=n|0;e=e|0;r=K(r);r=K($t(n,e,r));return K(r+K(Zt(n,e)))}function oi(n,e,r){n=n|0;e=e|0;r=K(r);var t=de;t=K(ii(n,e,r));return K(t+K(ui(n,e,r)))}function ai(n){n=n|0;if(!(u[n+24>>2]|0)){if(K(fi(n))!=K(0.0))n=1;else n=K(ci(n))!=K(0.0)}else n=0;return n|0}function fi(n){n=n|0;var e=de;if(u[n+944>>2]|0){e=K(c[n+44>>2]);if(ke(e)|0){e=K(c[n+40>>2]);n=e>K(0.0)&((ke(e)|0)^1);return K(n?e:K(0.0))}}else e=K(0.0);return K(e)}function ci(n){n=n|0;var e=de,r=0,i=de;do{if(u[n+944>>2]|0){e=K(c[n+48>>2]);if(ke(e)|0){r=t[(u[n+976>>2]|0)+2>>0]|0;if(r<<24>>24==0?(i=K(c[n+40>>2]),i<K(0.0)&((ke(i)|0)^1)):0){e=K(-i);break}e=r<<24>>24?K(1.0):K(0.0)}}else e=K(0.0)}while(0);return K(e)}function li(n){n=n|0;var e=0,r=0;eC(n+400|0,0,540)|0;t[n+985>>0]=1;Ve(n);r=Pe(n)|0;if(r|0){e=n+948|0;n=0;do{li(u[(u[e>>2]|0)+(n<<2)>>2]|0);n=n+1|0}while((n|0)!=(r|0))}return}function si(n,e,r,t,i,o,a,f,l,s){n=n|0;e=e|0;r=K(r);t=t|0;i=K(i);o=K(o);a=K(a);f=f|0;l=l|0;s=s|0;var d=0,_=de,p=0,m=0,b=de,h=de,y=0,w=de,M=0,g=de,T=0,A=0,S=0,E=0,C=0,L=0,R=0,P=0,B=0,O=0;B=v;v=v+16|0;S=B+12|0;E=B+8|0;C=B+4|0;L=B;P=Xt(u[n+4>>2]|0,l)|0;T=zt(P)|0;_=K(Ot(Ei(e)|0,T?o:a));A=Bt(e,2,o)|0;R=Bt(e,0,a)|0;do{if(!(ke(_)|0)?!(ke(T?r:i)|0):0){d=e+504|0;if(!(ke(K(c[d>>2]))|0)){if(!(Ci(u[e+976>>2]|0,0)|0))break;if((u[e+500>>2]|0)==(u[2278]|0))break}c[d>>2]=K(OE(_,K(oi(e,P,o))))}else p=7}while(0);do{if((p|0)==7){M=T^1;if(!(M|A^1)){a=K(Ot(u[e+992>>2]|0,o));c[e+504>>2]=K(OE(a,K(oi(e,2,o))));break}if(!(T|R^1)){a=K(Ot(u[e+996>>2]|0,a));c[e+504>>2]=K(OE(a,K(oi(e,0,o))));break}c[S>>2]=K(k);c[E>>2]=K(k);u[C>>2]=0;u[L>>2]=0;w=K(Tt(e,2,o));g=K(Tt(e,0,o));if(A){b=K(w+K(Ot(u[e+992>>2]|0,o)));c[S>>2]=b;u[C>>2]=1;m=1}else{m=0;b=K(k)}if(R){_=K(g+K(Ot(u[e+996>>2]|0,a)));c[E>>2]=_;u[L>>2]=1;d=1}else{d=0;_=K(k)}p=u[n+32>>2]|0;if(!(T&(p|0)==2)){if(ke(b)|0?!(ke(r)|0):0){c[S>>2]=r;u[C>>2]=2;m=2;b=r}}else p=2;if((!((p|0)==2&M)?ke(_)|0:0)?!(ke(i)|0):0){c[E>>2]=i;u[L>>2]=2;d=2;_=i}h=K(c[e+396>>2]);y=ke(h)|0;do{if(!y){if((m|0)==1&M){c[E>>2]=K(K(b-w)/h);u[L>>2]=1;d=1;p=1;break}if(T&(d|0)==1){c[S>>2]=K(h*K(_-g));u[C>>2]=1;d=1;p=1}else p=m}else p=m}while(0);O=ke(r)|0;m=(_i(n,e)|0)!=4;if(!(T|A|((t|0)!=1|O)|(m|(p|0)==1))?(c[S>>2]=r,u[C>>2]=1,!y):0){c[E>>2]=K(K(r-w)/h);u[L>>2]=1;d=1}if(!(R|M|((f|0)!=1|(ke(i)|0))|(m|(d|0)==1))?(c[E>>2]=i,u[L>>2]=1,!y):0){c[S>>2]=K(h*K(i-g));u[C>>2]=1}mi(e,2,o,o,C,S);mi(e,0,a,o,L,E);r=K(c[S>>2]);i=K(c[E>>2]);gt(e,r,i,l,u[C>>2]|0,u[L>>2]|0,o,a,0,3565,s)|0;a=K(c[e+908+(u[976+(P<<2)>>2]<<2)>>2]);c[e+504>>2]=K(OE(a,K(oi(e,P,o))))}}while(0);u[e+500>>2]=u[2278];v=B;return}function di(n,e,r,t,i){n=n|0;e=e|0;r=K(r);t=K(t);i=K(i);t=K(gi(n,e,r,t));return K(OE(t,K(oi(n,e,i))))}function _i(n,e){n=n|0;e=e|0;e=e+20|0;e=u[((u[e>>2]|0)==0?n+16|0:e)>>2]|0;if((e|0)==5?Si(u[n+4>>2]|0)|0:0)e=1;return e|0}function vi(n,e){n=n|0;e=e|0;if(zt(e)|0?(u[n+96>>2]|0)!=0:0)e=4;else e=u[1040+(e<<2)>>2]|0;return n+60+(e<<3)|0}function pi(n,e){n=n|0;e=e|0;if(zt(e)|0?(u[n+104>>2]|0)!=0:0)e=5;else e=u[1e3+(e<<2)>>2]|0;return n+60+(e<<3)|0}function mi(n,e,r,t,i,o){n=n|0;e=e|0;r=K(r);t=K(t);i=i|0;o=o|0;r=K(Ot(n+380+(u[976+(e<<2)>>2]<<3)|0,r));r=K(r+K(Tt(n,e,t)));switch(u[i>>2]|0){case 2:case 1:{i=ke(r)|0;t=K(c[o>>2]);c[o>>2]=i|t<r?t:r;break}case 0:{if(!(ke(r)|0)){u[i>>2]=2;c[o>>2]=r}break}default:{}}return}function bi(n,e){n=n|0;e=e|0;n=n+132|0;if(zt(e)|0?(u[(ge(n,4,948)|0)+4>>2]|0)!=0:0)n=1;else n=(u[(ge(n,u[1040+(e<<2)>>2]|0,948)|0)+4>>2]|0)!=0;return n|0}function hi(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0;n=n+132|0;if(zt(e)|0?(t=ge(n,4,948)|0,(u[t+4>>2]|0)!=0):0)i=4;else{t=ge(n,u[1040+(e<<2)>>2]|0,948)|0;if(!(u[t+4>>2]|0))r=K(0.0);else i=4}if((i|0)==4)r=K(Ot(t,r));return K(r)}function yi(n,e,r){n=n|0;e=e|0;r=K(r);var t=de;t=K(c[n+908+(u[976+(e<<2)>>2]<<2)>>2]);t=K(t+K(jt(n,e,r)));return K(t+K(qt(n,e,r)))}function wi(n){n=n|0;var e=0,r=0,t=0;n:do{if(!(Si(u[n+4>>2]|0)|0)){if((u[n+16>>2]|0)!=5){r=Pe(n)|0;if(!r)e=0;else{e=0;while(1){t=Be(n,e)|0;if((u[t+24>>2]|0)==0?(u[t+20>>2]|0)==5:0){e=1;break n}e=e+1|0;if(e>>>0>=r>>>0){e=0;break}}}}else e=1}else e=0}while(0);return e|0}function Mi(n,e){n=n|0;e=e|0;var r=de;r=K(c[n+908+(u[976+(e<<2)>>2]<<2)>>2]);return r>=K(0.0)&((ke(r)|0)^1)|0}function ki(n){n=n|0;var e=de,r=0,t=0,i=0,o=0,a=0,f=0,l=de;r=u[n+968>>2]|0;if(!r){o=Pe(n)|0;do{if(o|0){r=0;i=0;while(1){t=Be(n,i)|0;if(u[t+940>>2]|0){a=8;break}if((u[t+24>>2]|0)!=1){f=(_i(n,t)|0)==5;if(f){r=t;break}else r=(r|0)==0?t:r}i=i+1|0;if(i>>>0>=o>>>0){a=8;break}}if((a|0)==8)if(!r)break;e=K(ki(r));return K(e+K(c[r+404>>2]))}}while(0);e=K(c[n+912>>2])}else{l=K(c[n+908>>2]);e=K(c[n+912>>2]);e=K(_L[r&0](n,l,e));Fe(n,(ke(e)|0)^1,3573)}return K(e)}function gi(n,e,r,t){n=n|0;e=e|0;r=K(r);t=K(t);var i=de,u=0;if(!(Si(e)|0)){if(zt(e)|0){e=0;u=3}else{t=K(k);i=K(k)}}else{e=1;u=3}if((u|0)==3){i=K(Ot(n+364+(e<<3)|0,t));t=K(Ot(n+380+(e<<3)|0,t))}u=t<r&(t>=K(0.0)&((ke(t)|0)^1));r=u?t:r;u=i>=K(0.0)&((ke(i)|0)^1)&r<i;return K(u?i:r)}function Ti(n,e,r,t,i,o,a){n=n|0;e=e|0;r=K(r);t=t|0;i=K(i);o=o|0;a=a|0;var f=de,l=de,s=0,d=0,_=de,v=de,p=de,m=0,b=0,h=0,y=0,w=de,M=0;h=Xt(u[n+4>>2]|0,o)|0;m=ti(h,o)|0;b=zt(h)|0;_=K(Tt(e,2,r));v=K(Tt(e,0,r));if(!(Bt(e,2,r)|0)){if(bi(e,2)|0?Li(e,2)|0:0){f=K(c[n+908>>2]);l=K(Jt(n,2));l=K(f-K(l+K(Zt(n,2))));f=K(hi(e,2,r));f=K(di(e,2,K(l-K(f+K(Ri(e,2,r)))),r,r))}else f=K(k)}else f=K(_+K(Ot(u[e+992>>2]|0,r)));if(!(Bt(e,0,i)|0)){if(bi(e,0)|0?Li(e,0)|0:0){l=K(c[n+912>>2]);w=K(Jt(n,0));w=K(l-K(w+K(Zt(n,0))));l=K(hi(e,0,i));l=K(di(e,0,K(w-K(l+K(Ri(e,0,i)))),i,r))}else l=K(k)}else l=K(v+K(Ot(u[e+996>>2]|0,i)));s=ke(f)|0;d=ke(l)|0;do{if(s^d?(p=K(c[e+396>>2]),!(ke(p)|0)):0)if(s){f=K(_+K(K(l-v)*p));break}else{w=K(v+K(K(f-_)/p));l=d?w:l;break}}while(0);d=ke(f)|0;s=ke(l)|0;if(d|s){M=(d^1)&1;t=r>K(0.0)&((t|0)!=0&d);f=b?f:t?r:f;gt(e,f,l,o,b?M:t?2:M,d&(s^1)&1,f,l,0,3623,a)|0;f=K(c[e+908>>2]);f=K(f+K(Tt(e,2,r)));l=K(c[e+912>>2]);l=K(l+K(Tt(e,0,r)))}gt(e,f,l,o,1,1,f,l,1,3635,a)|0;if(Li(e,h)|0?!(bi(e,h)|0):0){M=u[976+(h<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(w-K(c[e+908+(M<<2)>>2]));w=K(w-K(Zt(n,h)));w=K(w-K(qt(e,h,r)));w=K(w-K(Ri(e,h,b?r:i)));c[e+400+(u[1040+(h<<2)>>2]<<2)>>2]=w}else y=21;do{if((y|0)==21){if(!(bi(e,h)|0)?(u[n+8>>2]|0)==1:0){M=u[976+(h<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(K(w-K(c[e+908+(M<<2)>>2]))*K(.5));c[e+400+(u[1040+(h<<2)>>2]<<2)>>2]=w;break}if(!(bi(e,h)|0)?(u[n+8>>2]|0)==2:0){M=u[976+(h<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(w-K(c[e+908+(M<<2)>>2]));c[e+400+(u[1040+(h<<2)>>2]<<2)>>2]=w}}}while(0);if(Li(e,m)|0?!(bi(e,m)|0):0){M=u[976+(m<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(w-K(c[e+908+(M<<2)>>2]));w=K(w-K(Zt(n,m)));w=K(w-K(qt(e,m,r)));w=K(w-K(Ri(e,m,b?i:r)));c[e+400+(u[1040+(m<<2)>>2]<<2)>>2]=w}else y=30;do{if((y|0)==30?!(bi(e,m)|0):0){if((_i(n,e)|0)==2){M=u[976+(m<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(K(w-K(c[e+908+(M<<2)>>2]))*K(.5));c[e+400+(u[1040+(m<<2)>>2]<<2)>>2]=w;break}M=(_i(n,e)|0)==3;if(M^(u[n+28>>2]|0)==2){M=u[976+(m<<2)>>2]|0;w=K(c[n+908+(M<<2)>>2]);w=K(w-K(c[e+908+(M<<2)>>2]));c[e+400+(u[1040+(m<<2)>>2]<<2)>>2]=w}}}while(0);return}function Ai(n,e,r){n=n|0;e=e|0;r=r|0;var t=de,i=0;i=u[976+(r<<2)>>2]|0;t=K(c[e+908+(i<<2)>>2]);t=K(K(c[n+908+(i<<2)>>2])-t);t=K(t-K(c[e+400+(u[1040+(r<<2)>>2]<<2)>>2]));c[e+400+(u[1e3+(r<<2)>>2]<<2)>>2]=t;return}function Si(n){n=n|0;return(n|1|0)==1|0}function Ei(n){n=n|0;var e=de;switch(u[n+56>>2]|0){case 0:case 3:{e=K(c[n+40>>2]);if(e>K(0.0)&((ke(e)|0)^1))n=t[(u[n+976>>2]|0)+2>>0]|0?1056:992;else n=1056;break}default:n=n+52|0}return n|0}function Ci(n,e){n=n|0;e=e|0;return(t[n+e>>0]|0)!=0|0}function Li(n,e){n=n|0;e=e|0;n=n+132|0;if(zt(e)|0?(u[(ge(n,5,948)|0)+4>>2]|0)!=0:0)n=1;else n=(u[(ge(n,u[1e3+(e<<2)>>2]|0,948)|0)+4>>2]|0)!=0;return n|0}function Ri(n,e,r){n=n|0;e=e|0;r=K(r);var t=0,i=0;n=n+132|0;if(zt(e)|0?(t=ge(n,5,948)|0,(u[t+4>>2]|0)!=0):0)i=4;else{t=ge(n,u[1e3+(e<<2)>>2]|0,948)|0;if(!(u[t+4>>2]|0))r=K(0.0);else i=4}if((i|0)==4)r=K(Ot(t,r));return K(r)}function Pi(n,e,r){n=n|0;e=e|0;r=K(r);if(bi(n,e)|0)r=K(hi(n,e,r));else r=K(-K(Ri(n,e,r)));return K(r)}function Bi(n){n=K(n);return(c[d>>2]=n,u[d>>2]|0)|0}function Oi(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>1073741823)Xn();else{i=GE(e<<2)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<2)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<2);return}function Ni(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Ii(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-4-e|0)>>>2)<<2);n=u[n>>2]|0;if(n|0)XE(n);return}function Fi(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;a=n+4|0;f=u[a>>2]|0;i=f-t|0;o=i>>2;n=e+(o<<2)|0;if(n>>>0<r>>>0){t=f;do{u[t>>2]=u[n>>2];n=n+4|0;t=(u[a>>2]|0)+4|0;u[a>>2]=t}while(n>>>0<r>>>0)}if(o|0)cC(f+(0-o<<2)|0,e|0,i|0)|0;return}function xi(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0;f=e+4|0;c=u[f>>2]|0;i=u[n>>2]|0;a=r;o=a-i|0;t=c+(0-(o>>2)<<2)|0;u[f>>2]=t;if((o|0)>0)iC(t|0,i|0,o|0)|0;i=n+4|0;o=e+8|0;t=(u[i>>2]|0)-a|0;if((t|0)>0){iC(u[o>>2]|0,r|0,t|0)|0;u[o>>2]=(u[o>>2]|0)+(t>>>2<<2)}a=u[n>>2]|0;u[n>>2]=u[f>>2];u[f>>2]=a;a=u[i>>2]|0;u[i>>2]=u[o>>2];u[o>>2]=a;a=n+8|0;r=e+12|0;n=u[a>>2]|0;u[a>>2]=u[r>>2];u[r>>2]=n;u[e>>2]=u[f>>2];return c|0}function Ui(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;a=u[e>>2]|0;o=u[r>>2]|0;if((a|0)!=(o|0)){i=n+8|0;r=((o+-4-a|0)>>>2)+1|0;n=a;t=u[i>>2]|0;do{u[t>>2]=u[n>>2];t=(u[i>>2]|0)+4|0;u[i>>2]=t;n=n+4|0}while((n|0)!=(o|0));u[e>>2]=a+(r<<2)}return}function Hi(){we();return}function Di(){var n=0;n=GE(4)|0;Wi(n);return n|0}function Wi(n){n=n|0;u[n>>2]=Ue()|0;return}function Yi(n){n=n|0;if(n|0){Vi(n);XE(n)}return}function Vi(n){n=n|0;De(u[n>>2]|0);return}function ji(n,e,r){n=n|0;e=e|0;r=r|0;Ht(u[n>>2]|0,e,r);return}function qi(n,e){n=n|0;e=K(e);Lt(u[n>>2]|0,e);return}function zi(n,e){n=n|0;e=e|0;return Ci(u[n>>2]|0,e)|0}function Gi(){var n=0;n=GE(8)|0;Ki(n,0);return n|0}function Ki(n,e){n=n|0;e=e|0;if(!e)e=Se()|0;else e=Te(u[e>>2]|0)|0;u[n>>2]=e;u[n+4>>2]=0;$e(e,n);return}function Xi(n){n=n|0;var e=0;e=GE(8)|0;Ki(e,n);return e|0}function Ji(n){n=n|0;if(n|0){Zi(n);XE(n)}return}function Zi(n){n=n|0;var e=0;Le(u[n>>2]|0);e=n+4|0;n=u[e>>2]|0;u[e>>2]=0;if(n|0){Qi(n);XE(n)}return}function Qi(n){n=n|0;$i(n);return}function $i(n){n=n|0;n=u[n>>2]|0;if(n|0)ie(n|0);return}function nu(n){n=n|0;return nr(n)|0}function eu(n){n=n|0;var e=0,r=0;r=n+4|0;e=u[r>>2]|0;u[r>>2]=0;if(e|0){Qi(e);XE(e)}Ie(u[n>>2]|0);return}function ru(n,e){n=n|0;e=e|0;Je(u[n>>2]|0,u[e>>2]|0);return}function tu(n,e){n=n|0;e=e|0;sr(u[n>>2]|0,e);return}function iu(n,e,r){n=n|0;e=e|0;r=+r;Ar(u[n>>2]|0,e,K(r));return}function uu(n,e,r){n=n|0;e=e|0;r=+r;Sr(u[n>>2]|0,e,K(r));return}function ou(n,e){n=n|0;e=e|0;ur(u[n>>2]|0,e);return}function au(n,e){n=n|0;e=e|0;ar(u[n>>2]|0,e);return}function fu(n,e){n=n|0;e=e|0;cr(u[n>>2]|0,e);return}function cu(n,e){n=n|0;e=e|0;er(u[n>>2]|0,e);return}function lu(n,e){n=n|0;e=e|0;_r(u[n>>2]|0,e);return}function su(n,e){n=n|0;e=e|0;tr(u[n>>2]|0,e);return}function du(n,e,r){n=n|0;e=e|0;r=+r;Cr(u[n>>2]|0,e,K(r));return}function _u(n,e,r){n=n|0;e=e|0;r=+r;Lr(u[n>>2]|0,e,K(r));return}function vu(n,e){n=n|0;e=e|0;Pr(u[n>>2]|0,e);return}function pu(n,e){n=n|0;e=e|0;pr(u[n>>2]|0,e);return}function mu(n,e){n=n|0;e=e|0;br(u[n>>2]|0,e);return}function bu(n,e){n=n|0;e=+e;yr(u[n>>2]|0,K(e));return}function hu(n,e){n=n|0;e=+e;kr(u[n>>2]|0,K(e));return}function yu(n,e){n=n|0;e=+e;gr(u[n>>2]|0,K(e));return}function wu(n,e){n=n|0;e=+e;wr(u[n>>2]|0,K(e));return}function Mu(n,e){n=n|0;e=+e;Mr(u[n>>2]|0,K(e));return}function ku(n,e){n=n|0;e=+e;xr(u[n>>2]|0,K(e));return}function gu(n,e){n=n|0;e=+e;Ur(u[n>>2]|0,K(e));return}function Tu(n){n=n|0;Hr(u[n>>2]|0);return}function Au(n,e){n=n|0;e=+e;Wr(u[n>>2]|0,K(e));return}function Su(n,e){n=n|0;e=+e;Yr(u[n>>2]|0,K(e));return}function Eu(n){n=n|0;Vr(u[n>>2]|0);return}function Cu(n,e){n=n|0;e=+e;qr(u[n>>2]|0,K(e));return}function Lu(n,e){n=n|0;e=+e;zr(u[n>>2]|0,K(e));return}function Ru(n,e){n=n|0;e=+e;Kr(u[n>>2]|0,K(e));return}function Pu(n,e){n=n|0;e=+e;Xr(u[n>>2]|0,K(e));return}function Bu(n,e){n=n|0;e=+e;Zr(u[n>>2]|0,K(e));return}function Ou(n,e){n=n|0;e=+e;Qr(u[n>>2]|0,K(e));return}function Nu(n,e){n=n|0;e=+e;nt(u[n>>2]|0,K(e));return}function Iu(n,e){n=n|0;e=+e;et(u[n>>2]|0,K(e));return}function Fu(n,e){n=n|0;e=+e;tt(u[n>>2]|0,K(e));return}function xu(n,e,r){n=n|0;e=e|0;r=+r;Ir(u[n>>2]|0,e,K(r));return}function Uu(n,e,r){n=n|0;e=e|0;r=+r;Br(u[n>>2]|0,e,K(r));return}function Hu(n,e,r){n=n|0;e=e|0;r=+r;Or(u[n>>2]|0,e,K(r));return}function Du(n){n=n|0;return dr(u[n>>2]|0)|0}function Wu(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;Er(i,u[e>>2]|0,r);Yu(n,i);v=t;return}function Yu(n,e){n=n|0;e=e|0;Vu(n,u[e+4>>2]|0,+K(c[e>>2]));return}function Vu(n,e,r){n=n|0;e=e|0;r=+r;u[n>>2]=e;l[n+8>>3]=r;return}function ju(n){n=n|0;return or(u[n>>2]|0)|0}function qu(n){n=n|0;return fr(u[n>>2]|0)|0}function zu(n){n=n|0;return lr(u[n>>2]|0)|0}function Gu(n){n=n|0;return rr(u[n>>2]|0)|0}function Ku(n){n=n|0;return vr(u[n>>2]|0)|0}function Xu(n){n=n|0;return ir(u[n>>2]|0)|0}function Ju(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;Rr(i,u[e>>2]|0,r);Yu(n,i);v=t;return}function Zu(n){n=n|0;return mr(u[n>>2]|0)|0}function Qu(n){n=n|0;return hr(u[n>>2]|0)|0}function $u(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;Tr(t,u[e>>2]|0);Yu(n,t);v=r;return}function no(n){n=n|0;return+ +K(Ze(u[n>>2]|0))}function eo(n){n=n|0;return+ +K(Qe(u[n>>2]|0))}function ro(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;Dr(t,u[e>>2]|0);Yu(n,t);v=r;return}function to(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;jr(t,u[e>>2]|0);Yu(n,t);v=r;return}function io(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;Gr(t,u[e>>2]|0);Yu(n,t);v=r;return}function uo(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;Jr(t,u[e>>2]|0);Yu(n,t);v=r;return}function oo(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;$r(t,u[e>>2]|0);Yu(n,t);v=r;return}function ao(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;rt(t,u[e>>2]|0);Yu(n,t);v=r;return}function fo(n){n=n|0;return+ +K(it(u[n>>2]|0))}function co(n,e){n=n|0;e=e|0;return+ +K(Fr(u[n>>2]|0,e))}function lo(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;Nr(i,u[e>>2]|0,r);Yu(n,i);v=t;return}function so(n,e,r){n=n|0;e=e|0;r=r|0;Ye(u[n>>2]|0,u[e>>2]|0,r);return}function _o(n,e){n=n|0;e=e|0;Ne(u[n>>2]|0,u[e>>2]|0);return}function vo(n){n=n|0;return Pe(u[n>>2]|0)|0}function po(n){n=n|0;n=Ge(u[n>>2]|0)|0;if(!n)n=0;else n=nu(n)|0;return n|0}function mo(n,e){n=n|0;e=e|0;n=Be(u[n>>2]|0,e)|0;if(!n)n=0;else n=nu(n)|0;return n|0}function bo(n,e){n=n|0;e=e|0;var r=0,t=0;t=GE(4)|0;ho(t,e);r=n+4|0;e=u[r>>2]|0;u[r>>2]=t;if(e|0){Qi(e);XE(e)}We(u[n>>2]|0,1);return}function ho(n,e){n=n|0;e=e|0;Uo(n,e);return}function yo(n,e,r,t,i,u){n=n|0;e=e|0;r=K(r);t=t|0;i=K(i);u=u|0;var o=0,a=0;o=v;v=v+16|0;a=o;wo(a,nr(e)|0,+r,t,+i,u);c[n>>2]=K(+l[a>>3]);c[n+4>>2]=K(+l[a+8>>3]);v=o;return}function wo(n,e,r,t,i,o){n=n|0;e=e|0;r=+r;t=t|0;i=+i;o=o|0;var a=0,f=0,c=0,s=0,d=0;a=v;v=v+32|0;d=a+8|0;s=a+20|0;c=a;f=a+16|0;l[d>>3]=r;u[s>>2]=t;l[c>>3]=i;u[f>>2]=o;Mo(n,u[e+4>>2]|0,d,s,c,f);v=a;return}function Mo(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0;a=v;v=v+16|0;f=a;gS(f);e=ko(e)|0;go(n,e,+l[r>>3],u[t>>2]|0,+l[i>>3],u[o>>2]|0);AS(f);v=a;return}function ko(n){n=n|0;return u[n>>2]|0}function go(n,e,r,t,i,u){n=n|0;e=e|0;r=+r;t=t|0;i=+i;u=u|0;var o=0;o=Ao(To()|0)|0;r=+So(r);t=Eo(t)|0;i=+So(i);Co(n,oe(0,o|0,e|0,+r,t|0,+i,Eo(u)|0)|0);return}function To(){var n=0;if(!(t[7608]|0)){Io(9120);n=7608;u[n>>2]=1;u[n+4>>2]=0}return 9120}function Ao(n){n=n|0;return u[n+8>>2]|0}function So(n){n=+n;return+ +No(n)}function Eo(n){n=n|0;return Oo(n)|0}function Co(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+32|0;r=i;t=e;if(!(t&1)){u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[n+8>>2]=u[e+8>>2];u[n+12>>2]=u[e+12>>2]}else{Lo(r,0);Hn(t|0,r|0)|0;Ro(n,r);Po(r)}v=i;return}function Lo(n,e){n=n|0;e=e|0;Bo(n,e);u[n+8>>2]=0;t[n+24>>0]=0;return}function Ro(n,e){n=n|0;e=e|0;e=e+8|0;u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[n+8>>2]=u[e+8>>2];u[n+12>>2]=u[e+12>>2];return}function Po(n){n=n|0;t[n+24>>0]=0;return}function Bo(n,e){n=n|0;e=e|0;u[n>>2]=e;return}function Oo(n){n=n|0;return n|0}function No(n){n=+n;return+n}function Io(n){n=n|0;xo(n,Fo()|0,4);return}function Fo(){return 1064}function xo(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;u[n+8>>2]=re(e|0,r+1|0)|0;return}function Uo(n,e){n=n|0;e=e|0;e=u[e>>2]|0;u[n>>2]=e;Rn(e|0);return}function Ho(n){n=n|0;var e=0,r=0;r=n+4|0;e=u[r>>2]|0;u[r>>2]=0;if(e|0){Qi(e);XE(e)}We(u[n>>2]|0,0);return}function Do(n){n=n|0;Ke(u[n>>2]|0);return}function Wo(n){n=n|0;return Xe(u[n>>2]|0)|0}function Yo(n,e,r,t){n=n|0;e=+e;r=+r;t=t|0;Rt(u[n>>2]|0,K(e),K(r),t);return}function Vo(n){n=n|0;return+ +K(ut(u[n>>2]|0))}function jo(n){n=n|0;return+ +K(at(u[n>>2]|0))}function qo(n){n=n|0;return+ +K(ot(u[n>>2]|0))}function zo(n){n=n|0;return+ +K(ft(u[n>>2]|0))}function Go(n){n=n|0;return+ +K(ct(u[n>>2]|0))}function Ko(n){n=n|0;return+ +K(lt(u[n>>2]|0))}function Xo(n,e){n=n|0;e=e|0;l[n>>3]=+K(ut(u[e>>2]|0));l[n+8>>3]=+K(at(u[e>>2]|0));l[n+16>>3]=+K(ot(u[e>>2]|0));l[n+24>>3]=+K(ft(u[e>>2]|0));l[n+32>>3]=+K(ct(u[e>>2]|0));l[n+40>>3]=+K(lt(u[e>>2]|0));return}function Jo(n,e){n=n|0;e=e|0;return+ +K(st(u[n>>2]|0,e))}function Zo(n,e){n=n|0;e=e|0;return+ +K(dt(u[n>>2]|0,e))}function Qo(n,e){n=n|0;e=e|0;return+ +K(_t(u[n>>2]|0,e))}function $o(){return xe()|0}function na(){ea();ra();ta();ia();ua();oa();return}function ea(){Ww(11713,4938,1);return}function ra(){ew(10448);return}function ta(){Iy(10408);return}function ia(){Qh(10324);return}function ua(){qm(10096);return}function oa(){aa(9132);return}function aa(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0,w=0,M=0,k=0,g=0,T=0,A=0,S=0,E=0,C=0,L=0,R=0,P=0,B=0,O=0,N=0,I=0,F=0,x=0,U=0,H=0,D=0,W=0,Y=0,V=0,j=0,q=0,z=0,G=0,K=0,X=0,J=0,Z=0,Q=0,$=0,nn=0,en=0,rn=0,tn=0,un=0,on=0,an=0,fn=0,cn=0,ln=0,sn=0,dn=0,_n=0,vn=0,pn=0,mn=0,bn=0,hn=0,yn=0,wn=0,Mn=0,kn=0,gn=0,Tn=0,An=0,Sn=0,En=0,Cn=0,Ln=0,Rn=0,Pn=0,Bn=0,On=0;e=v;v=v+672|0;r=e+656|0;On=e+648|0;Bn=e+640|0;Pn=e+632|0;Rn=e+624|0;Ln=e+616|0;Cn=e+608|0;En=e+600|0;Sn=e+592|0;An=e+584|0;Tn=e+576|0;gn=e+568|0;kn=e+560|0;Mn=e+552|0;wn=e+544|0;yn=e+536|0;hn=e+528|0;bn=e+520|0;mn=e+512|0;pn=e+504|0;vn=e+496|0;_n=e+488|0;dn=e+480|0;sn=e+472|0;ln=e+464|0;cn=e+456|0;fn=e+448|0;an=e+440|0;on=e+432|0;un=e+424|0;tn=e+416|0;rn=e+408|0;en=e+400|0;nn=e+392|0;$=e+384|0;Q=e+376|0;Z=e+368|0;J=e+360|0;X=e+352|0;K=e+344|0;G=e+336|0;z=e+328|0;q=e+320|0;j=e+312|0;V=e+304|0;Y=e+296|0;W=e+288|0;D=e+280|0;H=e+272|0;U=e+264|0;x=e+256|0;F=e+248|0;I=e+240|0;N=e+232|0;O=e+224|0;B=e+216|0;P=e+208|0;R=e+200|0;L=e+192|0;C=e+184|0;E=e+176|0;S=e+168|0;A=e+160|0;T=e+152|0;g=e+144|0;k=e+136|0;M=e+128|0;w=e+120|0;y=e+112|0;h=e+104|0;b=e+96|0;m=e+88|0;p=e+80|0;_=e+72|0;d=e+64|0;s=e+56|0;l=e+48|0;c=e+40|0;f=e+32|0;a=e+24|0;o=e+16|0;i=e+8|0;t=e;fa(n,3646);ca(n,3651,2)|0;la(n,3665,2)|0;sa(n,3682,18)|0;u[On>>2]=19;u[On+4>>2]=0;u[r>>2]=u[On>>2];u[r+4>>2]=u[On+4>>2];da(n,3690,r)|0;u[Bn>>2]=1;u[Bn+4>>2]=0;u[r>>2]=u[Bn>>2];u[r+4>>2]=u[Bn+4>>2];_a(n,3696,r)|0;u[Pn>>2]=2;u[Pn+4>>2]=0;u[r>>2]=u[Pn>>2];u[r+4>>2]=u[Pn+4>>2];va(n,3706,r)|0;u[Rn>>2]=1;u[Rn+4>>2]=0;u[r>>2]=u[Rn>>2];u[r+4>>2]=u[Rn+4>>2];pa(n,3722,r)|0;u[Ln>>2]=2;u[Ln+4>>2]=0;u[r>>2]=u[Ln>>2];u[r+4>>2]=u[Ln+4>>2];pa(n,3734,r)|0;u[Cn>>2]=3;u[Cn+4>>2]=0;u[r>>2]=u[Cn>>2];u[r+4>>2]=u[Cn+4>>2];va(n,3753,r)|0;u[En>>2]=4;u[En+4>>2]=0;u[r>>2]=u[En>>2];u[r+4>>2]=u[En+4>>2];va(n,3769,r)|0;u[Sn>>2]=5;u[Sn+4>>2]=0;u[r>>2]=u[Sn>>2];u[r+4>>2]=u[Sn+4>>2];va(n,3783,r)|0;u[An>>2]=6;u[An+4>>2]=0;u[r>>2]=u[An>>2];u[r+4>>2]=u[An+4>>2];va(n,3796,r)|0;u[Tn>>2]=7;u[Tn+4>>2]=0;u[r>>2]=u[Tn>>2];u[r+4>>2]=u[Tn+4>>2];va(n,3813,r)|0;u[gn>>2]=8;u[gn+4>>2]=0;u[r>>2]=u[gn>>2];u[r+4>>2]=u[gn+4>>2];va(n,3825,r)|0;u[kn>>2]=3;u[kn+4>>2]=0;u[r>>2]=u[kn>>2];u[r+4>>2]=u[kn+4>>2];pa(n,3843,r)|0;u[Mn>>2]=4;u[Mn+4>>2]=0;u[r>>2]=u[Mn>>2];u[r+4>>2]=u[Mn+4>>2];pa(n,3853,r)|0;u[wn>>2]=9;u[wn+4>>2]=0;u[r>>2]=u[wn>>2];u[r+4>>2]=u[wn+4>>2];va(n,3870,r)|0;u[yn>>2]=10;u[yn+4>>2]=0;u[r>>2]=u[yn>>2];u[r+4>>2]=u[yn+4>>2];va(n,3884,r)|0;u[hn>>2]=11;u[hn+4>>2]=0;u[r>>2]=u[hn>>2];u[r+4>>2]=u[hn+4>>2];va(n,3896,r)|0;u[bn>>2]=1;u[bn+4>>2]=0;u[r>>2]=u[bn>>2];u[r+4>>2]=u[bn+4>>2];ma(n,3907,r)|0;u[mn>>2]=2;u[mn+4>>2]=0;u[r>>2]=u[mn>>2];u[r+4>>2]=u[mn+4>>2];ma(n,3915,r)|0;u[pn>>2]=3;u[pn+4>>2]=0;u[r>>2]=u[pn>>2];u[r+4>>2]=u[pn+4>>2];ma(n,3928,r)|0;u[vn>>2]=4;u[vn+4>>2]=0;u[r>>2]=u[vn>>2];u[r+4>>2]=u[vn+4>>2];ma(n,3948,r)|0;u[_n>>2]=5;u[_n+4>>2]=0;u[r>>2]=u[_n>>2];u[r+4>>2]=u[_n+4>>2];ma(n,3960,r)|0;u[dn>>2]=6;u[dn+4>>2]=0;u[r>>2]=u[dn>>2];u[r+4>>2]=u[dn+4>>2];ma(n,3974,r)|0;u[sn>>2]=7;u[sn+4>>2]=0;u[r>>2]=u[sn>>2];u[r+4>>2]=u[sn+4>>2];ma(n,3983,r)|0;u[ln>>2]=20;u[ln+4>>2]=0;u[r>>2]=u[ln>>2];u[r+4>>2]=u[ln+4>>2];da(n,3999,r)|0;u[cn>>2]=8;u[cn+4>>2]=0;u[r>>2]=u[cn>>2];u[r+4>>2]=u[cn+4>>2];ma(n,4012,r)|0;u[fn>>2]=9;u[fn+4>>2]=0;u[r>>2]=u[fn>>2];u[r+4>>2]=u[fn+4>>2];ma(n,4022,r)|0;u[an>>2]=21;u[an+4>>2]=0;u[r>>2]=u[an>>2];u[r+4>>2]=u[an+4>>2];da(n,4039,r)|0;u[on>>2]=10;u[on+4>>2]=0;u[r>>2]=u[on>>2];u[r+4>>2]=u[on+4>>2];ma(n,4053,r)|0;u[un>>2]=11;u[un+4>>2]=0;u[r>>2]=u[un>>2];u[r+4>>2]=u[un+4>>2];ma(n,4065,r)|0;u[tn>>2]=12;u[tn+4>>2]=0;u[r>>2]=u[tn>>2];u[r+4>>2]=u[tn+4>>2];ma(n,4084,r)|0;u[rn>>2]=13;u[rn+4>>2]=0;u[r>>2]=u[rn>>2];u[r+4>>2]=u[rn+4>>2];ma(n,4097,r)|0;u[en>>2]=14;u[en+4>>2]=0;u[r>>2]=u[en>>2];u[r+4>>2]=u[en+4>>2];ma(n,4117,r)|0;u[nn>>2]=15;u[nn+4>>2]=0;u[r>>2]=u[nn>>2];u[r+4>>2]=u[nn+4>>2];ma(n,4129,r)|0;u[$>>2]=16;u[$+4>>2]=0;u[r>>2]=u[$>>2];u[r+4>>2]=u[$+4>>2];ma(n,4148,r)|0;u[Q>>2]=17;u[Q+4>>2]=0;u[r>>2]=u[Q>>2];u[r+4>>2]=u[Q+4>>2];ma(n,4161,r)|0;u[Z>>2]=18;u[Z+4>>2]=0;u[r>>2]=u[Z>>2];u[r+4>>2]=u[Z+4>>2];ma(n,4181,r)|0;u[J>>2]=5;u[J+4>>2]=0;u[r>>2]=u[J>>2];u[r+4>>2]=u[J+4>>2];pa(n,4196,r)|0;u[X>>2]=6;u[X+4>>2]=0;u[r>>2]=u[X>>2];u[r+4>>2]=u[X+4>>2];pa(n,4206,r)|0;u[K>>2]=7;u[K+4>>2]=0;u[r>>2]=u[K>>2];u[r+4>>2]=u[K+4>>2];pa(n,4217,r)|0;u[G>>2]=3;u[G+4>>2]=0;u[r>>2]=u[G>>2];u[r+4>>2]=u[G+4>>2];ba(n,4235,r)|0;u[z>>2]=1;u[z+4>>2]=0;u[r>>2]=u[z>>2];u[r+4>>2]=u[z+4>>2];ha(n,4251,r)|0;u[q>>2]=4;u[q+4>>2]=0;u[r>>2]=u[q>>2];u[r+4>>2]=u[q+4>>2];ba(n,4263,r)|0;u[j>>2]=5;u[j+4>>2]=0;u[r>>2]=u[j>>2];u[r+4>>2]=u[j+4>>2];ba(n,4279,r)|0;u[V>>2]=6;u[V+4>>2]=0;u[r>>2]=u[V>>2];u[r+4>>2]=u[V+4>>2];ba(n,4293,r)|0;u[Y>>2]=7;u[Y+4>>2]=0;u[r>>2]=u[Y>>2];u[r+4>>2]=u[Y+4>>2];ba(n,4306,r)|0;u[W>>2]=8;u[W+4>>2]=0;u[r>>2]=u[W>>2];u[r+4>>2]=u[W+4>>2];ba(n,4323,r)|0;u[D>>2]=9;u[D+4>>2]=0;u[r>>2]=u[D>>2];u[r+4>>2]=u[D+4>>2];ba(n,4335,r)|0;u[H>>2]=2;u[H+4>>2]=0;u[r>>2]=u[H>>2];u[r+4>>2]=u[H+4>>2];ha(n,4353,r)|0;u[U>>2]=12;u[U+4>>2]=0;u[r>>2]=u[U>>2];u[r+4>>2]=u[U+4>>2];ya(n,4363,r)|0;u[x>>2]=1;u[x+4>>2]=0;u[r>>2]=u[x>>2];u[r+4>>2]=u[x+4>>2];wa(n,4376,r)|0;u[F>>2]=2;u[F+4>>2]=0;u[r>>2]=u[F>>2];u[r+4>>2]=u[F+4>>2];wa(n,4388,r)|0;u[I>>2]=13;u[I+4>>2]=0;u[r>>2]=u[I>>2];u[r+4>>2]=u[I+4>>2];ya(n,4402,r)|0;u[N>>2]=14;u[N+4>>2]=0;u[r>>2]=u[N>>2];u[r+4>>2]=u[N+4>>2];ya(n,4411,r)|0;u[O>>2]=15;u[O+4>>2]=0;u[r>>2]=u[O>>2];u[r+4>>2]=u[O+4>>2];ya(n,4421,r)|0;u[B>>2]=16;u[B+4>>2]=0;u[r>>2]=u[B>>2];u[r+4>>2]=u[B+4>>2];ya(n,4433,r)|0;u[P>>2]=17;u[P+4>>2]=0;u[r>>2]=u[P>>2];u[r+4>>2]=u[P+4>>2];ya(n,4446,r)|0;u[R>>2]=18;u[R+4>>2]=0;u[r>>2]=u[R>>2];u[r+4>>2]=u[R+4>>2];ya(n,4458,r)|0;u[L>>2]=3;u[L+4>>2]=0;u[r>>2]=u[L>>2];u[r+4>>2]=u[L+4>>2];wa(n,4471,r)|0;u[C>>2]=1;u[C+4>>2]=0;u[r>>2]=u[C>>2];u[r+4>>2]=u[C+4>>2];Ma(n,4486,r)|0;u[E>>2]=10;u[E+4>>2]=0;u[r>>2]=u[E>>2];u[r+4>>2]=u[E+4>>2];ba(n,4496,r)|0;u[S>>2]=11;u[S+4>>2]=0;u[r>>2]=u[S>>2];u[r+4>>2]=u[S+4>>2];ba(n,4508,r)|0;u[A>>2]=3;u[A+4>>2]=0;u[r>>2]=u[A>>2];u[r+4>>2]=u[A+4>>2];ha(n,4519,r)|0;u[T>>2]=4;u[T+4>>2]=0;u[r>>2]=u[T>>2];u[r+4>>2]=u[T+4>>2];ka(n,4530,r)|0;u[g>>2]=19;u[g+4>>2]=0;u[r>>2]=u[g>>2];u[r+4>>2]=u[g+4>>2];ga(n,4542,r)|0;u[k>>2]=12;u[k+4>>2]=0;u[r>>2]=u[k>>2];u[r+4>>2]=u[k+4>>2];Ta(n,4554,r)|0;u[M>>2]=13;u[M+4>>2]=0;u[r>>2]=u[M>>2];u[r+4>>2]=u[M+4>>2];Aa(n,4568,r)|0;u[w>>2]=2;u[w+4>>2]=0;u[r>>2]=u[w>>2];u[r+4>>2]=u[w+4>>2];Sa(n,4578,r)|0;u[y>>2]=20;u[y+4>>2]=0;u[r>>2]=u[y>>2];u[r+4>>2]=u[y+4>>2];Ea(n,4587,r)|0;u[h>>2]=22;u[h+4>>2]=0;u[r>>2]=u[h>>2];u[r+4>>2]=u[h+4>>2];da(n,4602,r)|0;u[b>>2]=23;u[b+4>>2]=0;u[r>>2]=u[b>>2];u[r+4>>2]=u[b+4>>2];da(n,4619,r)|0;u[m>>2]=14;u[m+4>>2]=0;u[r>>2]=u[m>>2];u[r+4>>2]=u[m+4>>2];Ca(n,4629,r)|0;u[p>>2]=1;u[p+4>>2]=0;u[r>>2]=u[p>>2];u[r+4>>2]=u[p+4>>2];La(n,4637,r)|0;u[_>>2]=4;u[_+4>>2]=0;u[r>>2]=u[_>>2];u[r+4>>2]=u[_+4>>2];wa(n,4653,r)|0;u[d>>2]=5;u[d+4>>2]=0;u[r>>2]=u[d>>2];u[r+4>>2]=u[d+4>>2];wa(n,4669,r)|0;u[s>>2]=6;u[s+4>>2]=0;u[r>>2]=u[s>>2];u[r+4>>2]=u[s+4>>2];wa(n,4686,r)|0;u[l>>2]=7;u[l+4>>2]=0;u[r>>2]=u[l>>2];u[r+4>>2]=u[l+4>>2];wa(n,4701,r)|0;u[c>>2]=8;u[c+4>>2]=0;u[r>>2]=u[c>>2];u[r+4>>2]=u[c+4>>2];wa(n,4719,r)|0;u[f>>2]=9;u[f+4>>2]=0;u[r>>2]=u[f>>2];u[r+4>>2]=u[f+4>>2];wa(n,4736,r)|0;u[a>>2]=21;u[a+4>>2]=0;u[r>>2]=u[a>>2];u[r+4>>2]=u[a+4>>2];Ra(n,4754,r)|0;u[o>>2]=2;u[o+4>>2]=0;u[r>>2]=u[o>>2];u[r+4>>2]=u[o+4>>2];Ma(n,4772,r)|0;u[i>>2]=3;u[i+4>>2]=0;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];Ma(n,4790,r)|0;u[t>>2]=4;u[t+4>>2]=0;u[r>>2]=u[t>>2];u[r+4>>2]=u[t+4>>2];Ma(n,4808,r)|0;v=e;return}function fa(n,e){n=n|0;e=e|0;var r=0;r=Nm()|0;u[n>>2]=r;Im(r,e);lM(u[n>>2]|0);return}function ca(n,e,r){n=n|0;e=e|0;r=r|0;bm(n,Ba(e)|0,r,0);return n|0}function la(n,e,r){n=n|0;e=e|0;r=r|0;Jp(n,Ba(e)|0,r,0);return n|0}function sa(n,e,r){n=n|0;e=e|0;r=r|0;Op(n,Ba(e)|0,r,0);return n|0}function da(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];vp(n,e,i);v=t;return n|0}function _a(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];zv(n,e,i);v=t;return n|0}function va(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ev(n,e,i);v=t;return n|0}function pa(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];fv(n,e,i);v=t;return n|0}function ma(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];V_(n,e,i);v=t;return n|0}function ba(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];T_(n,e,i);v=t;return n|0}function ha(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];u_(n,e,i);v=t;return n|0}function ya(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ad(n,e,i);v=t;return n|0}function wa(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];od(n,e,i);v=t;return n|0}function Ma(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ws(n,e,i);v=t;return n|0}function ka(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ks(n,e,i);v=t;return n|0}function ga(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ns(n,e,i);v=t;return n|0}function Ta(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Nl(n,e,i);v=t;return n|0}function Aa(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];pl(n,e,i);v=t;return n|0}function Sa(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];zc(n,e,i);v=t;return n|0}function Ea(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];kc(n,e,i);v=t;return n|0}function Ca(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];rc(n,e,i);v=t;return n|0}function La(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Pf(n,e,i);v=t;return n|0}function Ra(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Pa(n,e,i);v=t;return n|0}function Pa(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Oa(n,r,i,1);v=t;return}function Ba(n){n=n|0;return n|0}function Oa(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Na()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Ia(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Fa(o,t)|0,t);v=i;return}function Na(){var n=0,e=0;if(!(t[7616]|0)){Ka(9136);xn(24,9136,b|0)|0;e=7616;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9136)|0)){n=9136;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Ka(9136)}return 9136}function Ia(n){n=n|0;return 0}function Fa(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Na()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Ya(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Va(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function xa(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0;a=v;v=v+32|0;_=a+24|0;d=a+20|0;c=a+16|0;s=a+12|0;l=a+8|0;f=a+4|0;p=a;u[d>>2]=e;u[c>>2]=r;u[s>>2]=t;u[l>>2]=i;u[f>>2]=o;o=n+28|0;u[p>>2]=u[o>>2];u[_>>2]=u[p>>2];Ua(n+24|0,_,d,s,l,c,f)|0;u[o>>2]=u[u[o>>2]>>2];v=a;return}function Ua(n,e,r,t,i,o,a){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;a=a|0;n=Ha(e)|0;e=GE(24)|0;Da(e+4|0,u[r>>2]|0,u[t>>2]|0,u[i>>2]|0,u[o>>2]|0,u[a>>2]|0);u[e>>2]=u[n>>2];u[n>>2]=e;return e|0}function Ha(n){n=n|0;return u[n>>2]|0}function Da(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;u[n>>2]=e;u[n+4>>2]=r;u[n+8>>2]=t;u[n+12>>2]=i;u[n+16>>2]=o;return}function Wa(n,e){n=n|0;e=e|0;return e|n|0}function Ya(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Va(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=ja(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;qa(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Ya(o,t,r);u[c>>2]=(u[c>>2]|0)+12;za(n,f);Ga(f);v=l;return}}function ja(n){n=n|0;return 357913941}function qa(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function za(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Ga(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Ka(n){n=n|0;Qa(n);return}function Xa(n){n=n|0;Za(n+24|0);return}function Ja(n){n=n|0;return u[n>>2]|0}function Za(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Qa(n){n=n|0;var e=0;e=$a()|0;rf(n,2,3,e,nf()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function $a(){return 9228}function nf(){return 1140}function ef(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=tf(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=uf(e,t)|0;v=r;return e|0}function rf(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;u[n>>2]=e;u[n+4>>2]=r;u[n+8>>2]=t;u[n+12>>2]=i;u[n+16>>2]=o;return}function tf(n){n=n|0;return(u[(Na()|0)+24>>2]|0)+(n*12|0)|0}function uf(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+48|0;t=i;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;pL[r&31](t,n);t=of(t)|0;v=i;return t|0}function of(n){n=n|0;var e=0,r=0,t=0,i=0;i=v;v=v+32|0;e=i+12|0;r=i;t=ff(af()|0)|0;if(!t)n=_f(n)|0;else{cf(e,t);lf(r,e);sf(n,r);n=df(e)|0}v=i;return n|0}function af(){var n=0;if(!(t[7632]|0)){Tf(9184);xn(25,9184,b|0)|0;n=7632;u[n>>2]=1;u[n+4>>2]=0}return 9184}function ff(n){n=n|0;return u[n+36>>2]|0}function cf(n,e){n=n|0;e=e|0;u[n>>2]=e;u[n+4>>2]=n;u[n+8>>2]=0;return}function lf(n,e){n=n|0;e=e|0;u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[n+8>>2]=0;return}function sf(n,e){n=n|0;e=e|0;hf(e,n,n+8|0,n+16|0,n+24|0,n+32|0,n+40|0)|0;return}function df(n){n=n|0;return u[(u[n+4>>2]|0)+8>>2]|0}function _f(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0;c=v;v=v+16|0;r=c+4|0;t=c;i=Dg(8)|0;o=i;a=GE(48)|0;f=a;e=f+48|0;do{u[f>>2]=u[n>>2];f=f+4|0;n=n+4|0}while((f|0)<(e|0));e=o+4|0;u[e>>2]=a;f=GE(8)|0;a=u[e>>2]|0;u[t>>2]=0;u[r>>2]=u[t>>2];vf(f,a,r);u[i>>2]=f;v=c;return o|0}function vf(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;r=GE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1092;u[r+12>>2]=e;u[n+4>>2]=r;return}function pf(n){n=n|0;WE(n);XE(n);return}function mf(n){n=n|0;n=u[n+12>>2]|0;if(n|0)XE(n);return}function bf(n){n=n|0;XE(n);return}function hf(n,e,r,t,i,o,a){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;a=a|0;o=yf(u[n>>2]|0,e,r,t,i,o,a)|0;a=n+4|0;u[(u[a>>2]|0)+8>>2]=o;return u[(u[a>>2]|0)+8>>2]|0}function yf(n,e,r,t,i,u,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;o=o|0;var a=0,f=0;a=v;v=v+16|0;f=a;gS(f);n=ko(n)|0;o=wf(n,+l[e>>3],+l[r>>3],+l[t>>3],+l[i>>3],+l[u>>3],+l[o>>3])|0;AS(f);v=a;return o|0}function wf(n,e,r,t,i,u,o){n=n|0;e=+e;r=+r;t=+t;i=+i;u=+u;o=+o;var a=0;a=Ao(Mf()|0)|0;e=+So(e);r=+So(r);t=+So(t);i=+So(i);u=+So(u);return Cn(0,a|0,n|0,+e,+r,+t,+i,+u,+ +So(o))|0}function Mf(){var n=0;if(!(t[7624]|0)){kf(9172);n=7624;u[n>>2]=1;u[n+4>>2]=0}return 9172}function kf(n){n=n|0;xo(n,gf()|0,6);return}function gf(){return 1112}function Tf(n){n=n|0;Rf(n);return}function Af(n){n=n|0;Sf(n+24|0);Ef(n+16|0);return}function Sf(n){n=n|0;Lf(n);return}function Ef(n){n=n|0;Cf(n);return}function Cf(n){n=n|0;var e=0,r=0;e=u[n>>2]|0;if(e|0)do{r=e;e=u[e>>2]|0;XE(r)}while((e|0)!=0);u[n>>2]=0;return}function Lf(n){n=n|0;var e=0,r=0;e=u[n>>2]|0;if(e|0)do{r=e;e=u[e>>2]|0;XE(r)}while((e|0)!=0);u[n>>2]=0;return}function Rf(n){n=n|0;var e=0;u[n+16>>2]=0;u[n+20>>2]=0;e=n+24|0;u[e>>2]=0;u[n+28>>2]=e;u[n+36>>2]=0;t[n+40>>0]=0;t[n+41>>0]=0;return}function Pf(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Bf(n,r,i,0);v=t;return}function Bf(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Of()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Nf(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,If(o,t)|0,t);v=i;return}function Of(){var n=0,e=0;if(!(t[7640]|0)){Yf(9232);xn(26,9232,b|0)|0;e=7640;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9232)|0)){n=9232;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Yf(9232)}return 9232}function Nf(n){n=n|0;return 0}function If(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Of()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Ff(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{xf(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Ff(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function xf(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Uf(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Hf(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Ff(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Df(n,f);Wf(f);v=l;return}}function Uf(n){n=n|0;return 357913941}function Hf(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Df(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Wf(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Yf(n){n=n|0;qf(n);return}function Vf(n){n=n|0;jf(n+24|0);return}function jf(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function qf(n){n=n|0;var e=0;e=$a()|0;rf(n,2,1,e,zf()|0,3);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function zf(){return 1144}function Gf(n,e,r,t,i){n=n|0;e=e|0;r=+r;t=+t;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+16|0;a=o+8|0;f=o;c=Kf(n)|0;n=u[c+4>>2]|0;u[f>>2]=u[c>>2];u[f+4>>2]=n;u[a>>2]=u[f>>2];u[a+4>>2]=u[f+4>>2];Xf(e,a,r,t,i);v=o;return}function Kf(n){n=n|0;return(u[(Of()|0)+24>>2]|0)+(n*12|0)|0}function Xf(n,e,r,t,i){n=n|0;e=e|0;r=+r;t=+t;i=i|0;var o=0,a=0,f=0,c=0,l=0;l=v;v=v+16|0;a=l+2|0;f=l+1|0;c=l;o=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)o=u[(u[n>>2]|0)+o>>2]|0;Jf(a,r);r=+Zf(a,r);Jf(f,t);t=+Zf(f,t);Qf(c,i);c=$f(c,i)|0;bL[o&1](n,r,t,c);v=l;return}function Jf(n,e){n=n|0;e=+e;return}function Zf(n,e){n=n|0;e=+e;return+ +ec(e)}function Qf(n,e){n=n|0;e=e|0;return}function $f(n,e){n=n|0;e=e|0;return nc(e)|0}function nc(n){n=n|0;return n|0}function ec(n){n=+n;return+n}function rc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];tc(n,r,i,1);v=t;return}function tc(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=ic()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=uc(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,oc(o,t)|0,t);v=i;return}function ic(){var n=0,e=0;if(!(t[7648]|0)){_c(9268);xn(27,9268,b|0)|0;e=7648;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9268)|0)){n=9268;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));_c(9268)}return 9268}function uc(n){n=n|0;return 0}function oc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=ic()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];ac(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{fc(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function ac(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function fc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=cc(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;lc(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];ac(o,t,r);u[c>>2]=(u[c>>2]|0)+12;sc(n,f);dc(f);v=l;return}}function cc(n){n=n|0;return 357913941}function lc(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function sc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function dc(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function _c(n){n=n|0;mc(n);return}function vc(n){n=n|0;pc(n+24|0);return}function pc(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function mc(n){n=n|0;var e=0;e=$a()|0;rf(n,2,4,e,bc()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function bc(){return 1160}function hc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=yc(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=wc(e,t)|0;v=r;return e|0}function yc(n){n=n|0;return(u[(ic()|0)+24>>2]|0)+(n*12|0)|0}function wc(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;return Mc(mL[r&31](n)|0)|0}function Mc(n){n=n|0;return n&1|0}function kc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];gc(n,r,i,0);v=t;return}function gc(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Tc()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Ac(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Sc(o,t)|0,t);v=i;return}function Tc(){var n=0,e=0;if(!(t[7656]|0)){Oc(9304);xn(28,9304,b|0)|0;e=7656;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9304)|0)){n=9304;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Oc(9304)}return 9304}function Ac(n){n=n|0;return 0}function Sc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Tc()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Ec(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Cc(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Ec(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Cc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Lc(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Rc(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Ec(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Pc(n,f);Bc(f);v=l;return}}function Lc(n){n=n|0;return 357913941}function Rc(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Pc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Bc(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Oc(n){n=n|0;Fc(n);return}function Nc(n){n=n|0;Ic(n+24|0);return}function Ic(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Fc(n){n=n|0;var e=0;e=$a()|0;rf(n,2,5,e,xc()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function xc(){return 1164}function Uc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=Hc(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Dc(e,i,r);v=t;return}function Hc(n){n=n|0;return(u[(Tc()|0)+24>>2]|0)+(n*12|0)|0}function Dc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Wc(i,r);r=Yc(i,r)|0;pL[t&31](n,r);Vc(i);v=o;return}function Wc(n,e){n=n|0;e=e|0;jc(n,e);return}function Yc(n,e){n=n|0;e=e|0;return n|0}function Vc(n){n=n|0;Qi(n);return}function jc(n,e){n=n|0;e=e|0;qc(n,e);return}function qc(n,e){n=n|0;e=e|0;u[n>>2]=e;return}function zc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Gc(n,r,i,0);v=t;return}function Gc(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Kc()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Xc(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Jc(o,t)|0,t);v=i;return}function Kc(){var n=0,e=0;if(!(t[7664]|0)){tl(9340);xn(29,9340,b|0)|0;e=7664;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9340)|0)){n=9340;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));tl(9340)}return 9340}function Xc(n){n=n|0;return 0}function Jc(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Kc()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Zc(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Qc(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Zc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Qc(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=$c(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;nl(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Zc(o,t,r);u[c>>2]=(u[c>>2]|0)+12;el(n,f);rl(f);v=l;return}}function $c(n){n=n|0;return 357913941}function nl(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function el(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function rl(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function tl(n){n=n|0;ol(n);return}function il(n){n=n|0;ul(n+24|0);return}function ul(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function ol(n){n=n|0;var e=0;e=$a()|0;rf(n,2,4,e,al()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function al(){return 1180}function fl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=cl(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=ll(e,i,r)|0;v=t;return r|0}function cl(n){n=n|0;return(u[(Kc()|0)+24>>2]|0)+(n*12|0)|0}function ll(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;sl(i,r);i=dl(i,r)|0;i=_l(gL[t&15](n,i)|0)|0;v=o;return i|0}function sl(n,e){n=n|0;e=e|0;return}function dl(n,e){n=n|0;e=e|0;return vl(e)|0}function _l(n){n=n|0;return n|0}function vl(n){n=n|0;return n|0}function pl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ml(n,r,i,0);v=t;return}function ml(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=bl()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=hl(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,yl(o,t)|0,t);v=i;return}function bl(){var n=0,e=0;if(!(t[7672]|0)){Sl(9376);xn(30,9376,b|0)|0;e=7672;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9376)|0)){n=9376;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Sl(9376)}return 9376}function hl(n){n=n|0;return 0}function yl(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=bl()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];wl(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Ml(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function wl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Ml(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=kl(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;gl(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];wl(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Tl(n,f);Al(f);v=l;return}}function kl(n){n=n|0;return 357913941}function gl(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Tl(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Al(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Sl(n){n=n|0;Ll(n);return}function El(n){n=n|0;Cl(n+24|0);return}function Cl(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Ll(n){n=n|0;var e=0;e=$a()|0;rf(n,2,5,e,Rl()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Rl(){return 1196}function Pl(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Bl(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=Ol(e,t)|0;v=r;return e|0}function Bl(n){n=n|0;return(u[(bl()|0)+24>>2]|0)+(n*12|0)|0}function Ol(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;return _l(mL[r&31](n)|0)|0}function Nl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Il(n,r,i,1);v=t;return}function Il(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Fl()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=xl(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Ul(o,t)|0,t);v=i;return}function Fl(){var n=0,e=0;if(!(t[7680]|0)){ql(9412);xn(31,9412,b|0)|0;e=7680;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9412)|0)){n=9412;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));ql(9412)}return 9412}function xl(n){n=n|0;return 0}function Ul(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Fl()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Hl(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Dl(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Hl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Dl(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Wl(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Yl(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Hl(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Vl(n,f);jl(f);v=l;return}}function Wl(n){n=n|0;return 357913941}function Yl(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Vl(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function jl(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function ql(n){n=n|0;Kl(n);return}function zl(n){n=n|0;Gl(n+24|0);return}function Gl(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Kl(n){n=n|0;var e=0;e=$a()|0;rf(n,2,6,e,Xl()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Xl(){return 1200}function Jl(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Zl(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=Ql(e,t)|0;v=r;return e|0}function Zl(n){n=n|0;return(u[(Fl()|0)+24>>2]|0)+(n*12|0)|0}function Ql(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;return $l(mL[r&31](n)|0)|0}function $l(n){n=n|0;return n|0}function ns(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];es(n,r,i,0);v=t;return}function es(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=rs()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=ts(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,is(o,t)|0,t);v=i;return}function rs(){var n=0,e=0;if(!(t[7688]|0)){ss(9448);xn(32,9448,b|0)|0;e=7688;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9448)|0)){n=9448;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));ss(9448)}return 9448}function ts(n){n=n|0;return 0}function is(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=rs()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];us(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{os(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function us(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function os(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=as(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;fs(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];us(o,t,r);u[c>>2]=(u[c>>2]|0)+12;cs(n,f);ls(f);v=l;return}}function as(n){n=n|0;return 357913941}function fs(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function cs(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function ls(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function ss(n){n=n|0;vs(n);return}function ds(n){n=n|0;_s(n+24|0);return}function _s(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function vs(n){n=n|0;var e=0;e=$a()|0;rf(n,2,6,e,ps()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function ps(){return 1204}function ms(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=bs(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];hs(e,i,r);v=t;return}function bs(n){n=n|0;return(u[(rs()|0)+24>>2]|0)+(n*12|0)|0}function hs(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;ys(i,r);i=ws(i,r)|0;pL[t&31](n,i);v=o;return}function ys(n,e){n=n|0;e=e|0;return}function ws(n,e){n=n|0;e=e|0;return Ms(e)|0}function Ms(n){n=n|0;return n|0}function ks(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];gs(n,r,i,0);v=t;return}function gs(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Ts()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=As(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Ss(o,t)|0,t);v=i;return}function Ts(){var n=0,e=0;if(!(t[7696]|0)){Os(9484);xn(33,9484,b|0)|0;e=7696;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9484)|0)){n=9484;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Os(9484)}return 9484}function As(n){n=n|0;return 0}function Ss(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Ts()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Es(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Cs(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Es(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Cs(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Ls(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Rs(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Es(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Ps(n,f);Bs(f);v=l;return}}function Ls(n){n=n|0;return 357913941}function Rs(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Ps(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Bs(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Os(n){n=n|0;Fs(n);return}function Ns(n){n=n|0;Is(n+24|0);return}function Is(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Fs(n){n=n|0;var e=0;e=$a()|0;rf(n,2,1,e,xs()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function xs(){return 1212}function Us(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=Hs(n)|0;n=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=n;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];Ds(e,o,r,t);v=i;return}function Hs(n){n=n|0;return(u[(Ts()|0)+24>>2]|0)+(n*12|0)|0}function Ds(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;f=v;v=v+16|0;o=f+1|0;a=f;i=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)i=u[(u[n>>2]|0)+i>>2]|0;ys(o,r);o=ws(o,r)|0;sl(a,t);a=dl(a,t)|0;PL[i&15](n,o,a);v=f;return}function Ws(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ys(n,r,i,1);v=t;return}function Ys(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Vs()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=js(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,qs(o,t)|0,t);v=i;return}function Vs(){var n=0,e=0;if(!(t[7704]|0)){Qs(9520);xn(34,9520,b|0)|0;e=7704;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9520)|0)){n=9520;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Qs(9520)}return 9520}function js(n){n=n|0;return 0}function qs(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Vs()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];zs(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Gs(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function zs(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Gs(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Ks(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Xs(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];zs(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Js(n,f);Zs(f);v=l;return}}function Ks(n){n=n|0;return 357913941}function Xs(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Js(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Zs(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Qs(n){n=n|0;ed(n);return}function $s(n){n=n|0;nd(n+24|0);return}function nd(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function ed(n){n=n|0;var e=0;e=$a()|0;rf(n,2,1,e,rd()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function rd(){return 1224}function td(n,e,r){n=n|0;e=e|0;r=r|0;var t=0.0,i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=id(n)|0;n=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=n;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];t=+ud(e,o,r);v=i;return+t}function id(n){n=n|0;return(u[(Vs()|0)+24>>2]|0)+(n*12|0)|0}function ud(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0.0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Qf(i,r);i=$f(i,r)|0;a=+No(+SL[t&7](n,i));v=o;return+a}function od(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];ad(n,r,i,1);v=t;return}function ad(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=fd()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=cd(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,ld(o,t)|0,t);v=i;return}function fd(){var n=0,e=0;if(!(t[7712]|0)){bd(9556);xn(35,9556,b|0)|0;e=7712;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9556)|0)){n=9556;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));bd(9556)}return 9556}function cd(n){n=n|0;return 0}function ld(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=fd()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];sd(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{dd(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function sd(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function dd(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=_d(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;vd(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];sd(o,t,r);u[c>>2]=(u[c>>2]|0)+12;pd(n,f);md(f);v=l;return}}function _d(n){n=n|0;return 357913941}function vd(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function pd(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function md(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function bd(n){n=n|0;wd(n);return}function hd(n){n=n|0;yd(n+24|0);return}function yd(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function wd(n){n=n|0;var e=0;e=$a()|0;rf(n,2,5,e,Md()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Md(){return 1232}function kd(n,e){n=n|0;e=e|0;var r=0.0,t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=gd(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=+Td(e,i);v=t;return+r}function gd(n){n=n|0;return(u[(fd()|0)+24>>2]|0)+(n*12|0)|0}function Td(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;return+ +No(+ML[r&15](n))}function Ad(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Sd(n,r,i,1);v=t;return}function Sd(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Ed()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Cd(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Ld(o,t)|0,t);v=i;return}function Ed(){var n=0,e=0;if(!(t[7720]|0)){Fd(9592);xn(36,9592,b|0)|0;e=7720;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9592)|0)){n=9592;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Fd(9592)}return 9592}function Cd(n){n=n|0;return 0}function Ld(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Ed()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Rd(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Pd(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Rd(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Pd(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Bd(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Od(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Rd(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Nd(n,f);Id(f);v=l;return}}function Bd(n){n=n|0;return 357913941}function Od(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Nd(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Id(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Fd(n){n=n|0;Hd(n);return}function xd(n){n=n|0;Ud(n+24|0);return}function Ud(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Hd(n){n=n|0;var e=0;e=$a()|0;rf(n,2,7,e,Dd()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Dd(){return 1276}function Wd(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Yd(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=Vd(e,t)|0;v=r;return e|0}function Yd(n){n=n|0;return(u[(Ed()|0)+24>>2]|0)+(n*12|0)|0}function Vd(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+16|0;t=i;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;pL[r&31](t,n);t=jd(t)|0;v=i;return t|0}function jd(n){n=n|0;var e=0,r=0,t=0,i=0;i=v;v=v+32|0;e=i+12|0;r=i;t=ff(qd()|0)|0;if(!t)n=Gd(n)|0;else{cf(e,t);lf(r,e);zd(n,r);n=df(e)|0}v=i;return n|0}function qd(){var n=0;if(!(t[7736]|0)){i_(9640);xn(25,9640,b|0)|0;n=7736;u[n>>2]=1;u[n+4>>2]=0}return 9640}function zd(n,e){n=n|0;e=e|0;Qd(e,n,n+8|0)|0;return}function Gd(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0;r=v;v=v+16|0;i=r+4|0;a=r;t=Dg(8)|0;e=t;f=GE(16)|0;u[f>>2]=u[n>>2];u[f+4>>2]=u[n+4>>2];u[f+8>>2]=u[n+8>>2];u[f+12>>2]=u[n+12>>2];o=e+4|0;u[o>>2]=f;n=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];Kd(n,o,i);u[t>>2]=n;v=r;return e|0}function Kd(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;r=GE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1244;u[r+12>>2]=e;u[n+4>>2]=r;return}function Xd(n){n=n|0;WE(n);XE(n);return}function Jd(n){n=n|0;n=u[n+12>>2]|0;if(n|0)XE(n);return}function Zd(n){n=n|0;XE(n);return}function Qd(n,e,r){n=n|0;e=e|0;r=r|0;e=$d(u[n>>2]|0,e,r)|0;r=n+4|0;u[(u[r>>2]|0)+8>>2]=e;return u[(u[r>>2]|0)+8>>2]|0}function $d(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0;t=v;v=v+16|0;i=t;gS(i);n=ko(n)|0;r=n_(n,u[e>>2]|0,+l[r>>3])|0;AS(i);v=t;return r|0}function n_(n,e,r){n=n|0;e=e|0;r=+r;var t=0;t=Ao(e_()|0)|0;e=Eo(e)|0;return Ln(0,t|0,n|0,e|0,+ +So(r))|0}function e_(){var n=0;if(!(t[7728]|0)){r_(9628);n=7728;u[n>>2]=1;u[n+4>>2]=0}return 9628}function r_(n){n=n|0;xo(n,t_()|0,2);return}function t_(){return 1264}function i_(n){n=n|0;Rf(n);return}function u_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];o_(n,r,i,1);v=t;return}function o_(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=a_()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=f_(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,c_(o,t)|0,t);v=i;return}function a_(){var n=0,e=0;if(!(t[7744]|0)){m_(9684);xn(37,9684,b|0)|0;e=7744;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9684)|0)){n=9684;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));m_(9684)}return 9684}function f_(n){n=n|0;return 0}function c_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=a_()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];l_(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{s_(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function l_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function s_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=d_(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;__(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];l_(o,t,r);u[c>>2]=(u[c>>2]|0)+12;v_(n,f);p_(f);v=l;return}}function d_(n){n=n|0;return 357913941}function __(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function v_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function p_(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function m_(n){n=n|0;y_(n);return}function b_(n){n=n|0;h_(n+24|0);return}function h_(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function y_(n){n=n|0;var e=0;e=$a()|0;rf(n,2,5,e,w_()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function w_(){return 1280}function M_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=k_(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=g_(e,i,r)|0;v=t;return r|0}function k_(n){n=n|0;return(u[(a_()|0)+24>>2]|0)+(n*12|0)|0}function g_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;a=v;v=v+32|0;i=a;o=a+16|0;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Qf(o,r);o=$f(o,r)|0;PL[t&15](i,n,o);o=jd(i)|0;v=a;return o|0}function T_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];A_(n,r,i,1);v=t;return}function A_(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=S_()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=E_(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,C_(o,t)|0,t);v=i;return}function S_(){var n=0,e=0;if(!(t[7752]|0)){I_(9720);xn(38,9720,b|0)|0;e=7752;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9720)|0)){n=9720;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));I_(9720)}return 9720}function E_(n){n=n|0;return 0}function C_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=S_()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];L_(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{R_(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function L_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function R_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=P_(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;B_(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];L_(o,t,r);u[c>>2]=(u[c>>2]|0)+12;O_(n,f);N_(f);v=l;return}}function P_(n){n=n|0;return 357913941}function B_(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function O_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function N_(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function I_(n){n=n|0;U_(n);return}function F_(n){n=n|0;x_(n+24|0);return}function x_(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function U_(n){n=n|0;var e=0;e=$a()|0;rf(n,2,8,e,H_()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function H_(){return 1288}function D_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=W_(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];e=Y_(e,t)|0;v=r;return e|0}function W_(n){n=n|0;return(u[(S_()|0)+24>>2]|0)+(n*12|0)|0}function Y_(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;return Oo(mL[r&31](n)|0)|0}function V_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];j_(n,r,i,0);v=t;return}function j_(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=q_()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=z_(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,G_(o,t)|0,t);v=i;return}function q_(){var n=0,e=0;if(!(t[7760]|0)){nv(9756);xn(39,9756,b|0)|0;e=7760;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9756)|0)){n=9756;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));nv(9756)}return 9756}function z_(n){n=n|0;return 0}function G_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=q_()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];K_(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{X_(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function K_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function X_(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=J_(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Z_(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];K_(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Q_(n,f);$_(f);v=l;return}}function J_(n){n=n|0;return 357913941}function Z_(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Q_(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function $_(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function nv(n){n=n|0;tv(n);return}function ev(n){n=n|0;rv(n+24|0);return}function rv(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function tv(n){n=n|0;var e=0;e=$a()|0;rf(n,2,8,e,iv()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function iv(){return 1292}function uv(n,e,r){n=n|0;e=e|0;r=+r;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=ov(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];av(e,i,r);v=t;return}function ov(n){n=n|0;return(u[(q_()|0)+24>>2]|0)+(n*12|0)|0}function av(n,e,r){n=n|0;e=e|0;r=+r;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Jf(i,r);r=+Zf(i,r);dL[t&31](n,r);v=o;return}function fv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];cv(n,r,i,0);v=t;return}function cv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=lv()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=sv(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,dv(o,t)|0,t);v=i;return}function lv(){var n=0,e=0;if(!(t[7768]|0)){yv(9792);xn(40,9792,b|0)|0;e=7768;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9792)|0)){n=9792;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));yv(9792)}return 9792}function sv(n){n=n|0;return 0}function dv(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=lv()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];_v(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{vv(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function _v(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function vv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=pv(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;mv(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];_v(o,t,r);u[c>>2]=(u[c>>2]|0)+12;bv(n,f);hv(f);v=l;return}}function pv(n){n=n|0;return 357913941}function mv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function bv(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function hv(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function yv(n){n=n|0;kv(n);return}function wv(n){n=n|0;Mv(n+24|0);return}function Mv(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function kv(n){n=n|0;var e=0;e=$a()|0;rf(n,2,1,e,gv()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function gv(){return 1300}function Tv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=+t;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=Av(n)|0;n=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=n;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];Sv(e,o,r,t);v=i;return}function Av(n){n=n|0;return(u[(lv()|0)+24>>2]|0)+(n*12|0)|0}function Sv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=+t;var i=0,o=0,a=0,f=0;f=v;v=v+16|0;o=f+1|0;a=f;i=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)i=u[(u[n>>2]|0)+i>>2]|0;Qf(o,r);o=$f(o,r)|0;Jf(a,t);t=+Zf(a,t);OL[i&15](n,o,t);v=f;return}function Ev(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Cv(n,r,i,0);v=t;return}function Cv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Lv()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Rv(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Pv(o,t)|0,t);v=i;return}function Lv(){var n=0,e=0;if(!(t[7776]|0)){Uv(9828);xn(41,9828,b|0)|0;e=7776;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9828)|0)){n=9828;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Uv(9828)}return 9828}function Rv(n){n=n|0;return 0}function Pv(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Lv()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Bv(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Ov(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Bv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Ov(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Nv(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Iv(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Bv(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Fv(n,f);xv(f);v=l;return}}function Nv(n){n=n|0;return 357913941}function Iv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Fv(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function xv(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Uv(n){n=n|0;Wv(n);return}function Hv(n){n=n|0;Dv(n+24|0);return}function Dv(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Wv(n){n=n|0;var e=0;e=$a()|0;rf(n,2,7,e,Yv()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Yv(){return 1312}function Vv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=jv(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];qv(e,i,r);v=t;return}function jv(n){n=n|0;return(u[(Lv()|0)+24>>2]|0)+(n*12|0)|0}function qv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Qf(i,r);i=$f(i,r)|0;pL[t&31](n,i);v=o;return}function zv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Gv(n,r,i,0);v=t;return}function Gv(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Kv()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Xv(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Jv(o,t)|0,t);v=i;return}function Kv(){var n=0,e=0;if(!(t[7784]|0)){tp(9864);xn(42,9864,b|0)|0;e=7784;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9864)|0)){n=9864;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));tp(9864)}return 9864}function Xv(n){n=n|0;return 0}function Jv(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Kv()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];Zv(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{Qv(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function Zv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function Qv(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=$v(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;np(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];Zv(o,t,r);u[c>>2]=(u[c>>2]|0)+12;ep(n,f);rp(f);v=l;return}}function $v(n){n=n|0;return 357913941}function np(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function ep(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function rp(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function tp(n){n=n|0;op(n);return}function ip(n){n=n|0;up(n+24|0);return}function up(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function op(n){n=n|0;var e=0;e=$a()|0;rf(n,2,8,e,ap()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function ap(){return 1320}function fp(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=cp(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];lp(e,i,r);v=t;return}function cp(n){n=n|0;return(u[(Kv()|0)+24>>2]|0)+(n*12|0)|0}function lp(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;sp(i,r);i=dp(i,r)|0;pL[t&31](n,i);v=o;return}function sp(n,e){n=n|0;e=e|0;return}function dp(n,e){n=n|0;e=e|0;return _p(e)|0}function _p(n){n=n|0;return n|0}function vp(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];pp(n,r,i,0);v=t;return}function pp(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=mp()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=bp(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,hp(o,t)|0,t);v=i;return}function mp(){var n=0,e=0;if(!(t[7792]|0)){Ap(9900);xn(43,9900,b|0)|0;e=7792;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9900)|0)){n=9900;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Ap(9900)}return 9900}function bp(n){n=n|0;return 0}function hp(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=mp()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];yp(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{wp(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function yp(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function wp(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Mp(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;kp(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];yp(o,t,r);u[c>>2]=(u[c>>2]|0)+12;gp(n,f);Tp(f);v=l;return}}function Mp(n){n=n|0;return 357913941}function kp(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function gp(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Tp(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Ap(n){n=n|0;Cp(n);return}function Sp(n){n=n|0;Ep(n+24|0);return}function Ep(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Cp(n){n=n|0;var e=0;e=$a()|0;rf(n,2,22,e,Lp()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Lp(){return 1344}function Rp(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0;r=v;v=v+16|0;t=r+8|0;i=r;o=Pp(n)|0;n=u[o+4>>2]|0;u[i>>2]=u[o>>2];u[i+4>>2]=n;u[t>>2]=u[i>>2];u[t+4>>2]=u[i+4>>2];Bp(e,t);v=r;return}function Pp(n){n=n|0;return(u[(mp()|0)+24>>2]|0)+(n*12|0)|0}function Bp(n,e){n=n|0;e=e|0;var r=0;r=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)r=u[(u[n>>2]|0)+r>>2]|0;vL[r&127](n);return}function Op(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=Np()|0;n=Ip(r)|0;xa(o,e,i,n,Fp(r,t)|0,t);return}function Np(){var n=0,e=0;if(!(t[7800]|0)){Vp(9936);xn(44,9936,b|0)|0;e=7800;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9936)|0)){n=9936;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Vp(9936)}return 9936}function Ip(n){n=n|0;return n|0}function Fp(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=Np()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){xp(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{Up(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function xp(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function Up(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=Hp(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;Dp(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;xp(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Wp(n,i);Yp(i);v=f;return}}function Hp(n){n=n|0;return 536870911}function Dp(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function Wp(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Yp(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function Vp(n){n=n|0;zp(n);return}function jp(n){n=n|0;qp(n+24|0);return}function qp(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function zp(n){n=n|0;var e=0;e=$a()|0;rf(n,1,23,e,ps()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Gp(n,e){n=n|0;e=e|0;Xp(u[(Kp(n)|0)>>2]|0,e);return}function Kp(n){n=n|0;return(u[(Np()|0)+24>>2]|0)+(n<<3)|0}function Xp(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;ys(t,e);e=ws(t,e)|0;vL[n&127](e);v=r;return}function Jp(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=Zp()|0;n=Qp(r)|0;xa(o,e,i,n,$p(r,t)|0,t);return}function Zp(){var n=0,e=0;if(!(t[7808]|0)){om(9972);xn(45,9972,b|0)|0;e=7808;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(9972)|0)){n=9972;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));om(9972)}return 9972}function Qp(n){n=n|0;return n|0}function $p(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=Zp()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){nm(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{em(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function nm(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function em(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=rm(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;tm(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;nm(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;im(n,i);um(i);v=f;return}}function rm(n){n=n|0;return 536870911}function tm(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function im(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function um(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function om(n){n=n|0;cm(n);return}function am(n){n=n|0;fm(n+24|0);return}function fm(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function cm(n){n=n|0;var e=0;e=$a()|0;rf(n,1,9,e,lm()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function lm(){return 1348}function sm(n,e){n=n|0;e=e|0;return _m(u[(dm(n)|0)>>2]|0,e)|0}function dm(n){n=n|0;return(u[(Zp()|0)+24>>2]|0)+(n<<3)|0}function _m(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;vm(t,e);e=pm(t,e)|0;e=_l(mL[n&31](e)|0)|0;v=r;return e|0}function vm(n,e){n=n|0;e=e|0;return}function pm(n,e){n=n|0;e=e|0;return mm(e)|0}function mm(n){n=n|0;return n|0}function bm(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=hm()|0;n=ym(r)|0;xa(o,e,i,n,wm(r,t)|0,t);return}function hm(){var n=0,e=0;if(!(t[7816]|0)){Em(10008);xn(46,10008,b|0)|0;e=7816;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10008)|0)){n=10008;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Em(10008)}return 10008}function ym(n){n=n|0;return n|0}function wm(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=hm()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){Mm(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{km(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function Mm(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function km(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=gm(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;Tm(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;Mm(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Am(n,i);Sm(i);v=f;return}}function gm(n){n=n|0;return 536870911}function Tm(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function Am(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Sm(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function Em(n){n=n|0;Rm(n);return}function Cm(n){n=n|0;Lm(n+24|0);return}function Lm(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Rm(n){n=n|0;var e=0;e=$a()|0;rf(n,1,15,e,Rl()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Pm(n){n=n|0;return Om(u[(Bm(n)|0)>>2]|0)|0}function Bm(n){n=n|0;return(u[(hm()|0)+24>>2]|0)+(n<<3)|0}function Om(n){n=n|0;return _l(EL[n&7]()|0)|0}function Nm(){var n=0;if(!(t[7832]|0)){jm(10052);xn(25,10052,b|0)|0;n=7832;u[n>>2]=1;u[n+4>>2]=0}return 10052}function Im(n,e){n=n|0;e=e|0;u[n>>2]=Fm()|0;u[n+4>>2]=xm()|0;u[n+12>>2]=e;u[n+8>>2]=Um()|0;u[n+32>>2]=2;return}function Fm(){return 11709}function xm(){return 1188}function Um(){return Ym()|0}function Hm(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){Wm(r);XE(r)}}else if(e|0){Zi(e);XE(e)}return}function Dm(n,e){n=n|0;e=e|0;return e&n|0}function Wm(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function Ym(){var n=0;if(!(t[7824]|0)){u[2511]=Vm()|0;u[2512]=0;n=7824;u[n>>2]=1;u[n+4>>2]=0}return 10044}function Vm(){return 0}function jm(n){n=n|0;Rf(n);return}function qm(n){n=n|0;var e=0,r=0,t=0,i=0,o=0;e=v;v=v+32|0;r=e+24|0;o=e+16|0;i=e+8|0;t=e;zm(n,4827);Gm(n,4834,3)|0;Km(n,3682,47)|0;u[o>>2]=9;u[o+4>>2]=0;u[r>>2]=u[o>>2];u[r+4>>2]=u[o+4>>2];Xm(n,4841,r)|0;u[i>>2]=1;u[i+4>>2]=0;u[r>>2]=u[i>>2];u[r+4>>2]=u[i+4>>2];Jm(n,4871,r)|0;u[t>>2]=10;u[t+4>>2]=0;u[r>>2]=u[t>>2];u[r+4>>2]=u[t+4>>2];Zm(n,4891,r)|0;v=e;return}function zm(n,e){n=n|0;e=e|0;var r=0;r=jh()|0;u[n>>2]=r;qh(r,e);lM(u[n>>2]|0);return}function Gm(n,e,r){n=n|0;e=e|0;r=r|0;Ah(n,Ba(e)|0,r,0);return n|0}function Km(n,e,r){n=n|0;e=e|0;r=r|0;ah(n,Ba(e)|0,r,0);return n|0}function Xm(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Hb(n,e,i);v=t;return n|0}function Jm(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];bb(n,e,i);v=t;return n|0}function Zm(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=u[r+4>>2]|0;u[o>>2]=u[r>>2];u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Qm(n,e,i);v=t;return n|0}function Qm(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];$m(n,r,i,1);v=t;return}function $m(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=nb()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=eb(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,rb(o,t)|0,t);v=i;return}function nb(){var n=0,e=0;if(!(t[7840]|0)){cb(10100);xn(48,10100,b|0)|0;e=7840;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10100)|0)){n=10100;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));cb(10100)}return 10100}function eb(n){n=n|0;return 0}function rb(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=nb()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];tb(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{ib(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function tb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function ib(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=ub(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;ob(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];tb(o,t,r);u[c>>2]=(u[c>>2]|0)+12;ab(n,f);fb(f);v=l;return}}function ub(n){n=n|0;return 357913941}function ob(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function ab(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function fb(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function cb(n){n=n|0;db(n);return}function lb(n){n=n|0;sb(n+24|0);return}function sb(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function db(n){n=n|0;var e=0;e=$a()|0;rf(n,2,6,e,_b()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function _b(){return 1364}function vb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=pb(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];r=mb(e,i,r)|0;v=t;return r|0}function pb(n){n=n|0;return(u[(nb()|0)+24>>2]|0)+(n*12|0)|0}function mb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Qf(i,r);i=$f(i,r)|0;i=Mc(gL[t&15](n,i)|0)|0;v=o;return i|0}function bb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];hb(n,r,i,0);v=t;return}function hb(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=yb()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=wb(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Mb(o,t)|0,t);v=i;return}function yb(){var n=0,e=0;if(!(t[7848]|0)){Cb(10136);xn(49,10136,b|0)|0;e=7848;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10136)|0)){n=10136;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Cb(10136)}return 10136}function wb(n){n=n|0;return 0}function Mb(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=yb()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];kb(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{gb(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function kb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function gb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=Tb(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Ab(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];kb(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Sb(n,f);Eb(f);v=l;return}}function Tb(n){n=n|0;return 357913941}function Ab(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Sb(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Eb(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Cb(n){n=n|0;Pb(n);return}function Lb(n){n=n|0;Rb(n+24|0);return}function Rb(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function Pb(n){n=n|0;var e=0;e=$a()|0;rf(n,2,9,e,Bb()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Bb(){return 1372}function Ob(n,e,r){n=n|0;e=e|0;r=+r;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;i=t+8|0;o=t;a=Nb(n)|0;n=u[a+4>>2]|0;u[o>>2]=u[a>>2];u[o+4>>2]=n;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Ib(e,i,r);v=t;return}function Nb(n){n=n|0;return(u[(yb()|0)+24>>2]|0)+(n*12|0)|0}function Ib(n,e,r){n=n|0;e=e|0;r=+r;var t=0,i=0,o=0,a=de;o=v;v=v+16|0;i=o;t=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)t=u[(u[n>>2]|0)+t>>2]|0;Fb(i,r);a=K(xb(i,r));sL[t&1](n,a);v=o;return}function Fb(n,e){n=n|0;e=+e;return}function xb(n,e){n=n|0;e=+e;return K(Ub(e))}function Ub(n){n=+n;return K(n)}function Hb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;i=t+8|0;o=t;f=u[r>>2]|0;a=u[r+4>>2]|0;r=Ba(e)|0;u[o>>2]=f;u[o+4>>2]=a;u[i>>2]=u[o>>2];u[i+4>>2]=u[o+4>>2];Db(n,r,i,0);v=t;return}function Db(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0;i=v;v=v+32|0;o=i+16|0;s=i+8|0;f=i;l=u[r>>2]|0;c=u[r+4>>2]|0;a=u[n>>2]|0;n=Wb()|0;u[s>>2]=l;u[s+4>>2]=c;u[o>>2]=u[s>>2];u[o+4>>2]=u[s+4>>2];r=Yb(o)|0;u[f>>2]=l;u[f+4>>2]=c;u[o>>2]=u[f>>2];u[o+4>>2]=u[f+4>>2];xa(a,e,n,r,Vb(o,t)|0,t);v=i;return}function Wb(){var n=0,e=0;if(!(t[7856]|0)){Jb(10172);xn(50,10172,b|0)|0;e=7856;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10172)|0)){n=10172;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Jb(10172)}return 10172}function Yb(n){n=n|0;return 0}function Vb(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0;s=v;v=v+32|0;i=s+24|0;a=s+16|0;f=s;c=s+8|0;o=u[n>>2]|0;t=u[n+4>>2]|0;u[f>>2]=o;u[f+4>>2]=t;d=Wb()|0;l=d+24|0;n=Wa(e,4)|0;u[c>>2]=n;e=d+28|0;r=u[e>>2]|0;if(r>>>0<(u[d+32>>2]|0)>>>0){u[a>>2]=o;u[a+4>>2]=t;u[i>>2]=u[a>>2];u[i+4>>2]=u[a+4>>2];jb(r,i,n);n=(u[e>>2]|0)+12|0;u[e>>2]=n}else{qb(l,f,c);n=u[e>>2]|0}v=s;return((n-(u[l>>2]|0)|0)/12|0)+-1|0}function jb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=u[e+4>>2]|0;u[n>>2]=u[e>>2];u[n+4>>2]=t;u[n+8>>2]=r;return}function qb(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0;l=v;v=v+48|0;t=l+32|0;a=l+24|0;f=l;c=n+4|0;i=(((u[c>>2]|0)-(u[n>>2]|0)|0)/12|0)+1|0;o=zb(n)|0;if(o>>>0<i>>>0)DE(n);else{s=u[n>>2]|0;_=((u[n+8>>2]|0)-s|0)/12|0;d=_<<1;Gb(f,_>>>0<o>>>1>>>0?d>>>0<i>>>0?i:d:o,((u[c>>2]|0)-s|0)/12|0,n+8|0);c=f+8|0;o=u[c>>2]|0;i=u[e+4>>2]|0;r=u[r>>2]|0;u[a>>2]=u[e>>2];u[a+4>>2]=i;u[t>>2]=u[a>>2];u[t+4>>2]=u[a+4>>2];jb(o,t,r);u[c>>2]=(u[c>>2]|0)+12;Kb(n,f);Xb(f);v=l;return}}function zb(n){n=n|0;return 357913941}function Gb(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>357913941)Xn();else{i=GE(e*12|0)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r*12|0)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e*12|0);return}function Kb(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(((i|0)/-12|0)*12|0)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Xb(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~(((t+-12-e|0)>>>0)/12|0)*12|0);n=u[n>>2]|0;if(n|0)XE(n);return}function Jb(n){n=n|0;$b(n);return}function Zb(n){n=n|0;Qb(n+24|0);return}function Qb(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~(((e+-12-t|0)>>>0)/12|0)*12|0);XE(r)}return}function $b(n){n=n|0;var e=0;e=$a()|0;rf(n,2,3,e,nh()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function nh(){return 1380}function eh(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+8|0;a=i;f=rh(n)|0;n=u[f+4>>2]|0;u[a>>2]=u[f>>2];u[a+4>>2]=n;u[o>>2]=u[a>>2];u[o+4>>2]=u[a+4>>2];th(e,o,r,t);v=i;return}function rh(n){n=n|0;return(u[(Wb()|0)+24>>2]|0)+(n*12|0)|0}function th(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;f=v;v=v+16|0;o=f+1|0;a=f;i=u[e>>2]|0;e=u[e+4>>2]|0;n=n+(e>>1)|0;if(e&1)i=u[(u[n>>2]|0)+i>>2]|0;Qf(o,r);o=$f(o,r)|0;ih(a,t);a=uh(a,t)|0;PL[i&15](n,o,a);v=f;return}function ih(n,e){n=n|0;e=e|0;return}function uh(n,e){n=n|0;e=e|0;return oh(e)|0}function oh(n){n=n|0;return(n|0)!=0|0}function ah(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=fh()|0;n=ch(r)|0;xa(o,e,i,n,lh(r,t)|0,t);return}function fh(){var n=0,e=0;if(!(t[7864]|0)){bh(10208);xn(51,10208,b|0)|0;e=7864;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10208)|0)){n=10208;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));bh(10208)}return 10208}function ch(n){n=n|0;return n|0}function lh(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=fh()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){sh(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{dh(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function sh(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function dh(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=_h(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;vh(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;sh(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;ph(n,i);mh(i);v=f;return}}function _h(n){n=n|0;return 536870911}function vh(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function ph(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function mh(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function bh(n){n=n|0;wh(n);return}function hh(n){n=n|0;yh(n+24|0);return}function yh(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function wh(n){n=n|0;var e=0;e=$a()|0;rf(n,1,24,e,Mh()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Mh(){return 1392}function kh(n,e){n=n|0;e=e|0;Th(u[(gh(n)|0)>>2]|0,e);return}function gh(n){n=n|0;return(u[(fh()|0)+24>>2]|0)+(n<<3)|0}function Th(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;vm(t,e);e=pm(t,e)|0;vL[n&127](e);v=r;return}function Ah(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=Sh()|0;n=Eh(r)|0;xa(o,e,i,n,Ch(r,t)|0,t);return}function Sh(){var n=0,e=0;if(!(t[7872]|0)){Ih(10244);xn(52,10244,b|0)|0;e=7872;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10244)|0)){n=10244;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));Ih(10244)}return 10244}function Eh(n){n=n|0;return n|0}function Ch(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=Sh()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){Lh(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{Rh(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function Lh(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function Rh(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=Ph(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;Bh(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;Lh(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;Oh(n,i);Nh(i);v=f;return}}function Ph(n){n=n|0;return 536870911}function Bh(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function Oh(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function Nh(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function Ih(n){n=n|0;Uh(n);return}function Fh(n){n=n|0;xh(n+24|0);return}function xh(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Uh(n){n=n|0;var e=0;e=$a()|0;rf(n,1,16,e,Hh()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Hh(){return 1400}function Dh(n){n=n|0;return Yh(u[(Wh(n)|0)>>2]|0)|0}function Wh(n){n=n|0;return(u[(Sh()|0)+24>>2]|0)+(n<<3)|0}function Yh(n){n=n|0;return Vh(EL[n&7]()|0)|0}function Vh(n){n=n|0;return n|0}function jh(){var n=0;if(!(t[7880]|0)){Zh(10280);xn(25,10280,b|0)|0;n=7880;u[n>>2]=1;u[n+4>>2]=0}return 10280}function qh(n,e){n=n|0;e=e|0;u[n>>2]=zh()|0;u[n+4>>2]=Gh()|0;u[n+12>>2]=e;u[n+8>>2]=Kh()|0;u[n+32>>2]=4;return}function zh(){return 11711}function Gh(){return 1356}function Kh(){return Ym()|0}function Xh(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){Jh(r);XE(r)}}else if(e|0){Vi(e);XE(e)}return}function Jh(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function Zh(n){n=n|0;Rf(n);return}function Qh(n){n=n|0;$h(n,4920);ny(n)|0;ey(n)|0;return}function $h(n,e){n=n|0;e=e|0;var r=0;r=qd()|0;u[n>>2]=r;Ey(r,e);lM(u[n>>2]|0);return}function ny(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,py()|0);return n|0}function ey(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,ry()|0);return n|0}function ry(){var n=0;if(!(t[7888]|0)){iy(10328);xn(53,10328,b|0)|0;n=7888;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10328)|0))iy(10328);return 10328}function ty(n,e){n=n|0;e=e|0;xa(n,0,e,0,0,0);return}function iy(n){n=n|0;ay(n);cy(n,10);return}function uy(n){n=n|0;oy(n+24|0);return}function oy(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function ay(n){n=n|0;var e=0;e=$a()|0;rf(n,5,1,e,dy()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function fy(n,e,r){n=n|0;e=e|0;r=+r;ly(n,e,r);return}function cy(n,e){n=n|0;e=e|0;u[n+20>>2]=e;return}function ly(n,e,r){n=n|0;e=e|0;r=+r;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+16|0;o=t+8|0;f=t+13|0;i=t;a=t+12|0;Qf(f,e);u[o>>2]=$f(f,e)|0;Jf(a,r);l[i>>3]=+Zf(a,r);sy(n,o,i);v=t;return}function sy(n,e,r){n=n|0;e=e|0;r=r|0;Vu(n+8|0,u[e>>2]|0,+l[r>>3]);t[n+24>>0]=1;return}function dy(){return 1404}function _y(n,e){n=n|0;e=+e;return vy(n,e)|0}function vy(n,e){n=n|0;e=+e;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;t=v;v=v+16|0;o=t+4|0;a=t+8|0;f=t;i=Dg(8)|0;r=i;c=GE(16)|0;Qf(o,n);n=$f(o,n)|0;Jf(a,e);Vu(c,n,+Zf(a,e));a=r+4|0;u[a>>2]=c;n=GE(8)|0;a=u[a>>2]|0;u[f>>2]=0;u[o>>2]=u[f>>2];Kd(n,a,o);u[i>>2]=n;v=t;return r|0}function py(){var n=0;if(!(t[7896]|0)){my(10364);xn(54,10364,b|0)|0;n=7896;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10364)|0))my(10364);return 10364}function my(n){n=n|0;yy(n);cy(n,55);return}function by(n){n=n|0;hy(n+24|0);return}function hy(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function yy(n){n=n|0;var e=0;e=$a()|0;rf(n,5,4,e,Ty()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function wy(n){n=n|0;My(n);return}function My(n){n=n|0;ky(n);return}function ky(n){n=n|0;gy(n+8|0);t[n+24>>0]=1;return}function gy(n){n=n|0;u[n>>2]=0;l[n+8>>3]=0.0;return}function Ty(){return 1424}function Ay(){return Sy()|0}function Sy(){var n=0,e=0,r=0,t=0,i=0,o=0,a=0;e=v;v=v+16|0;i=e+4|0;a=e;r=Dg(8)|0;n=r;t=GE(16)|0;gy(t);o=n+4|0;u[o>>2]=t;t=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];Kd(t,o,i);u[r>>2]=t;v=e;return n|0}function Ey(n,e){n=n|0;e=e|0;u[n>>2]=Cy()|0;u[n+4>>2]=Ly()|0;u[n+12>>2]=e;u[n+8>>2]=Ry()|0;u[n+32>>2]=5;return}function Cy(){return 11710}function Ly(){return 1416}function Ry(){return Oy()|0}function Py(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){By(r);XE(r)}}else if(e|0)XE(e);return}function By(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function Oy(){var n=0;if(!(t[7904]|0)){u[2600]=Ny()|0;u[2601]=0;n=7904;u[n>>2]=1;u[n+4>>2]=0}return 10400}function Ny(){return u[357]|0}function Iy(n){n=n|0;Fy(n,4926);xy(n)|0;return}function Fy(n,e){n=n|0;e=e|0;var r=0;r=af()|0;u[n>>2]=r;Xy(r,e);lM(u[n>>2]|0);return}function xy(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,Uy()|0);return n|0}function Uy(){var n=0;if(!(t[7912]|0)){Hy(10412);xn(56,10412,b|0)|0;n=7912;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10412)|0))Hy(10412);return 10412}function Hy(n){n=n|0;Yy(n);cy(n,57);return}function Dy(n){n=n|0;Wy(n+24|0);return}function Wy(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Yy(n){n=n|0;var e=0;e=$a()|0;rf(n,5,5,e,zy()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Vy(n){n=n|0;jy(n);return}function jy(n){n=n|0;qy(n);return}function qy(n){n=n|0;var e=0,r=0;e=n+8|0;r=e+48|0;do{u[e>>2]=0;e=e+4|0}while((e|0)<(r|0));t[n+56>>0]=1;return}function zy(){return 1432}function Gy(){return Ky()|0}function Ky(){var n=0,e=0,r=0,t=0,i=0,o=0,a=0,f=0;a=v;v=v+16|0;n=a+4|0;e=a;r=Dg(8)|0;t=r;i=GE(48)|0;o=i;f=o+48|0;do{u[o>>2]=0;o=o+4|0}while((o|0)<(f|0));o=t+4|0;u[o>>2]=i;f=GE(8)|0;o=u[o>>2]|0;u[e>>2]=0;u[n>>2]=u[e>>2];vf(f,o,n);u[r>>2]=f;v=a;return t|0}function Xy(n,e){n=n|0;e=e|0;u[n>>2]=Jy()|0;u[n+4>>2]=Zy()|0;u[n+12>>2]=e;u[n+8>>2]=Qy()|0;u[n+32>>2]=6;return}function Jy(){return 11704}function Zy(){return 1436}function Qy(){return Oy()|0}function $y(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){nw(r);XE(r)}}else if(e|0)XE(e);return}function nw(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function ew(n){n=n|0;rw(n,4933);tw(n)|0;iw(n)|0;return}function rw(n,e){n=n|0;e=e|0;var r=0;r=Ow()|0;u[n>>2]=r;Nw(r,e);lM(u[n>>2]|0);return}function tw(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,Mw()|0);return n|0}function iw(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,uw()|0);return n|0}function uw(){var n=0;if(!(t[7920]|0)){ow(10452);xn(58,10452,b|0)|0;n=7920;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10452)|0))ow(10452);return 10452}function ow(n){n=n|0;cw(n);cy(n,1);return}function aw(n){n=n|0;fw(n+24|0);return}function fw(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function cw(n){n=n|0;var e=0;e=$a()|0;rf(n,5,1,e,vw()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function lw(n,e,r){n=n|0;e=+e;r=+r;sw(n,e,r);return}function sw(n,e,r){n=n|0;e=+e;r=+r;var t=0,i=0,u=0,o=0,a=0;t=v;v=v+32|0;u=t+8|0;a=t+17|0;i=t;o=t+16|0;Jf(a,e);l[u>>3]=+Zf(a,e);Jf(o,r);l[i>>3]=+Zf(o,r);dw(n,u,i);v=t;return}function dw(n,e,r){n=n|0;e=e|0;r=r|0;_w(n+8|0,+l[e>>3],+l[r>>3]);t[n+24>>0]=1;return}function _w(n,e,r){n=n|0;e=+e;r=+r;l[n>>3]=e;l[n+8>>3]=r;return}function vw(){return 1472}function pw(n,e){n=+n;e=+e;return mw(n,e)|0}function mw(n,e){n=+n;e=+e;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;t=v;v=v+16|0;a=t+4|0;f=t+8|0;c=t;i=Dg(8)|0;r=i;o=GE(16)|0;Jf(a,n);n=+Zf(a,n);Jf(f,e);_w(o,n,+Zf(f,e));f=r+4|0;u[f>>2]=o;o=GE(8)|0;f=u[f>>2]|0;u[c>>2]=0;u[a>>2]=u[c>>2];bw(o,f,a);u[i>>2]=o;v=t;return r|0}function bw(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;r=GE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1452;u[r+12>>2]=e;u[n+4>>2]=r;return}function hw(n){n=n|0;WE(n);XE(n);return}function yw(n){n=n|0;n=u[n+12>>2]|0;if(n|0)XE(n);return}function ww(n){n=n|0;XE(n);return}function Mw(){var n=0;if(!(t[7928]|0)){kw(10488);xn(59,10488,b|0)|0;n=7928;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10488)|0))kw(10488);return 10488}function kw(n){n=n|0;Aw(n);cy(n,60);return}function gw(n){n=n|0;Tw(n+24|0);return}function Tw(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Aw(n){n=n|0;var e=0;e=$a()|0;rf(n,5,6,e,Rw()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Sw(n){n=n|0;Ew(n);return}function Ew(n){n=n|0;Cw(n);return}function Cw(n){n=n|0;Lw(n+8|0);t[n+24>>0]=1;return}function Lw(n){n=n|0;u[n>>2]=0;u[n+4>>2]=0;u[n+8>>2]=0;u[n+12>>2]=0;return}function Rw(){return 1492}function Pw(){return Bw()|0}function Bw(){var n=0,e=0,r=0,t=0,i=0,o=0,a=0;e=v;v=v+16|0;i=e+4|0;a=e;r=Dg(8)|0;n=r;t=GE(16)|0;Lw(t);o=n+4|0;u[o>>2]=t;t=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];bw(t,o,i);u[r>>2]=t;v=e;return n|0}function Ow(){var n=0;if(!(t[7936]|0)){Dw(10524);xn(25,10524,b|0)|0;n=7936;u[n>>2]=1;u[n+4>>2]=0}return 10524}function Nw(n,e){n=n|0;e=e|0;u[n>>2]=Iw()|0;u[n+4>>2]=Fw()|0;u[n+12>>2]=e;u[n+8>>2]=xw()|0;u[n+32>>2]=7;return}function Iw(){return 11700}function Fw(){return 1484}function xw(){return Oy()|0}function Uw(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){Hw(r);XE(r)}}else if(e|0)XE(e);return}function Hw(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function Dw(n){n=n|0;Rf(n);return}function Ww(n,e,r){n=n|0;e=e|0;r=r|0;n=Ba(e)|0;e=Yw(r)|0;r=Vw(r,0)|0;CM(n,e,r,jw()|0,0);return}function Yw(n){n=n|0;return n|0}function Vw(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=jw()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){Qw(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{$w(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function jw(){var n=0,e=0;if(!(t[7944]|0)){qw(10568);xn(61,10568,b|0)|0;e=7944;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10568)|0)){n=10568;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));qw(10568)}return 10568}function qw(n){n=n|0;Kw(n);return}function zw(n){n=n|0;Gw(n+24|0);return}function Gw(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Kw(n){n=n|0;var e=0;e=$a()|0;rf(n,1,17,e,Xl()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Xw(n){n=n|0;return Zw(u[(Jw(n)|0)>>2]|0)|0}function Jw(n){n=n|0;return(u[(jw()|0)+24>>2]|0)+(n<<3)|0}function Zw(n){n=n|0;return $l(EL[n&7]()|0)|0}function Qw(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function $w(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=nM(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;eM(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;Qw(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;rM(n,i);tM(i);v=f;return}}function nM(n){n=n|0;return 536870911}function eM(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function rM(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function tM(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function iM(){uM();return}function uM(){oM(10604);return}function oM(n){n=n|0;aM(n,4955);return}function aM(n,e){n=n|0;e=e|0;var r=0;r=fM()|0;u[n>>2]=r;cM(r,e);lM(u[n>>2]|0);return}function fM(){var n=0;if(!(t[7952]|0)){wM(10612);xn(25,10612,b|0)|0;n=7952;u[n>>2]=1;u[n+4>>2]=0}return 10612}function cM(n,e){n=n|0;e=e|0;u[n>>2]=pM()|0;u[n+4>>2]=mM()|0;u[n+12>>2]=e;u[n+8>>2]=bM()|0;u[n+32>>2]=8;return}function lM(n){n=n|0;var e=0,r=0;e=v;v=v+16|0;r=e;sM()|0;u[r>>2]=n;dM(10608,r);v=e;return}function sM(){if(!(t[11714]|0)){u[2652]=0;xn(62,10608,b|0)|0;t[11714]=1}return 10608}function dM(n,e){n=n|0;e=e|0;var r=0;r=GE(8)|0;u[r+4>>2]=u[e>>2];u[r>>2]=u[n>>2];u[n>>2]=r;return}function _M(n){n=n|0;vM(n);return}function vM(n){n=n|0;var e=0,r=0;e=u[n>>2]|0;if(e|0)do{r=e;e=u[e>>2]|0;XE(r)}while((e|0)!=0);u[n>>2]=0;return}function pM(){return 11715}function mM(){return 1496}function bM(){return Ym()|0}function hM(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){yM(r);XE(r)}}else if(e|0)XE(e);return}function yM(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function wM(n){n=n|0;Rf(n);return}function MM(n,e){n=n|0;e=e|0;var r=0,t=0;sM()|0;r=u[2652]|0;n:do{if(r|0){while(1){t=u[r+4>>2]|0;if(t|0?(tE(kM(t)|0,n)|0)==0:0)break;r=u[r>>2]|0;if(!r)break n}gM(t,e)}}while(0);return}function kM(n){n=n|0;return u[n+12>>2]|0}function gM(n,e){n=n|0;e=e|0;var r=0;n=n+36|0;r=u[n>>2]|0;if(r|0){Qi(r);XE(r)}r=GE(4)|0;ho(r,e);u[n>>2]=r;return}function TM(){if(!(t[11716]|0)){u[2664]=0;xn(63,10656,b|0)|0;t[11716]=1}return 10656}function AM(){var n=0;if(!(t[11717]|0)){SM();u[2665]=1504;t[11717]=1;n=1504}else n=u[2665]|0;return n|0}function SM(){if(!(t[11740]|0)){t[11718]=Wa(Wa(8,0)|0,0)|0;t[11719]=Wa(Wa(0,0)|0,0)|0;t[11720]=Wa(Wa(0,16)|0,0)|0;t[11721]=Wa(Wa(8,0)|0,0)|0;t[11722]=Wa(Wa(0,0)|0,0)|0;t[11723]=Wa(Wa(8,0)|0,0)|0;t[11724]=Wa(Wa(0,0)|0,0)|0;t[11725]=Wa(Wa(8,0)|0,0)|0;t[11726]=Wa(Wa(0,0)|0,0)|0;t[11727]=Wa(Wa(8,0)|0,0)|0;t[11728]=Wa(Wa(0,0)|0,0)|0;t[11729]=Wa(Wa(0,0)|0,32)|0;t[11730]=Wa(Wa(0,0)|0,32)|0;t[11740]=1}return}function EM(){return 1572}function CM(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0,s=0;o=v;v=v+32|0;s=o+16|0;l=o+12|0;c=o+8|0;f=o+4|0;a=o;u[s>>2]=n;u[l>>2]=e;u[c>>2]=r;u[f>>2]=t;u[a>>2]=i;TM()|0;LM(10656,s,l,c,f,a);v=o;return}function LM(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0;a=GE(24)|0;Da(a+4|0,u[e>>2]|0,u[r>>2]|0,u[t>>2]|0,u[i>>2]|0,u[o>>2]|0);u[a>>2]=u[n>>2];u[n>>2]=a;return}function RM(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0,w=0;w=v;v=v+32|0;m=w+20|0;b=w+8|0;h=w+4|0;y=w;e=u[e>>2]|0;if(e|0){p=m+4|0;c=m+8|0;l=b+4|0;s=b+8|0;d=b+8|0;_=m+8|0;do{a=e+4|0;f=PM(a)|0;if(f|0){i=BM(f)|0;u[m>>2]=0;u[p>>2]=0;u[c>>2]=0;t=(OM(f)|0)+1|0;NM(m,t);if(t|0)while(1){t=t+-1|0;bS(b,u[i>>2]|0);o=u[p>>2]|0;if(o>>>0<(u[_>>2]|0)>>>0){u[o>>2]=u[b>>2];u[p>>2]=(u[p>>2]|0)+4}else IM(m,b);if(!t)break;else i=i+4|0}t=FM(f)|0;u[b>>2]=0;u[l>>2]=0;u[s>>2]=0;n:do{if(u[t>>2]|0){i=0;o=0;while(1){if((i|0)==(o|0))xM(b,t);else{u[i>>2]=u[t>>2];u[l>>2]=(u[l>>2]|0)+4}t=t+4|0;if(!(u[t>>2]|0))break n;i=u[l>>2]|0;o=u[d>>2]|0}}}while(0);u[h>>2]=UM(a)|0;u[y>>2]=Ja(f)|0;HM(r,n,h,y,m,b);DM(b);WM(m)}e=u[e>>2]|0}while((e|0)!=0)}v=w;return}function PM(n){n=n|0;return u[n+12>>2]|0}function BM(n){n=n|0;return u[n+12>>2]|0}function OM(n){n=n|0;return u[n+16>>2]|0}function NM(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+32|0;r=i;t=u[n>>2]|0;if((u[n+8>>2]|0)-t>>2>>>0<e>>>0){wk(r,e,(u[n+4>>2]|0)-t>>2,n+8|0);Mk(n,r);kk(r)}v=i;return}function IM(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0;a=v;v=v+32|0;r=a;t=n+4|0;i=((u[t>>2]|0)-(u[n>>2]|0)>>2)+1|0;o=mk(n)|0;if(o>>>0<i>>>0)DE(n);else{f=u[n>>2]|0;l=(u[n+8>>2]|0)-f|0;c=l>>1;wk(r,l>>2>>>0<o>>>1>>>0?c>>>0<i>>>0?i:c:o,(u[t>>2]|0)-f>>2,n+8|0);o=r+8|0;u[u[o>>2]>>2]=u[e>>2];u[o>>2]=(u[o>>2]|0)+4;Mk(n,r);kk(r);v=a;return}}function FM(n){n=n|0;return u[n+8>>2]|0}function xM(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0;a=v;v=v+32|0;r=a;t=n+4|0;i=((u[t>>2]|0)-(u[n>>2]|0)>>2)+1|0;o=_k(n)|0;if(o>>>0<i>>>0)DE(n);else{f=u[n>>2]|0;l=(u[n+8>>2]|0)-f|0;c=l>>1;bk(r,l>>2>>>0<o>>>1>>>0?c>>>0<i>>>0?i:c:o,(u[t>>2]|0)-f>>2,n+8|0);o=r+8|0;u[u[o>>2]>>2]=u[e>>2];u[o>>2]=(u[o>>2]|0)+4;hk(n,r);yk(r);v=a;return}}function UM(n){n=n|0;return u[n>>2]|0}function HM(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;YM(n,e,r,t,i,u);return}function DM(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-4-t|0)>>>2)<<2);XE(r)}return}function WM(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-4-t|0)>>>2)<<2);XE(r)}return}function YM(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0,d=0;a=v;v=v+48|0;s=a+40|0;f=a+32|0;d=a+24|0;c=a+12|0;l=a;gS(f);n=ko(n)|0;u[d>>2]=u[e>>2];r=u[r>>2]|0;t=u[t>>2]|0;VM(c,i);jM(l,o);u[s>>2]=u[d>>2];qM(n,s,r,t,c,l);DM(l);WM(c);AS(f);v=a;return}function VM(n,e){n=n|0;e=e|0;var r=0,t=0;u[n>>2]=0;u[n+4>>2]=0;u[n+8>>2]=0;r=e+4|0;t=(u[r>>2]|0)-(u[e>>2]|0)>>2;if(t|0){vk(n,t);pk(n,u[e>>2]|0,u[r>>2]|0,t)}return}function jM(n,e){n=n|0;e=e|0;var r=0,t=0;u[n>>2]=0;u[n+4>>2]=0;u[n+8>>2]=0;r=e+4|0;t=(u[r>>2]|0)-(u[e>>2]|0)>>2;if(t|0){sk(n,t);dk(n,u[e>>2]|0,u[r>>2]|0,t)}return}function qM(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0,d=0;a=v;v=v+32|0;s=a+28|0;d=a+24|0;f=a+12|0;c=a;l=Ao(zM()|0)|0;u[d>>2]=u[e>>2];u[s>>2]=u[d>>2];e=GM(s)|0;r=KM(r)|0;t=XM(t)|0;u[f>>2]=u[i>>2];s=i+4|0;u[f+4>>2]=u[s>>2];d=i+8|0;u[f+8>>2]=u[d>>2];u[d>>2]=0;u[s>>2]=0;u[i>>2]=0;i=JM(f)|0;u[c>>2]=u[o>>2];s=o+4|0;u[c+4>>2]=u[s>>2];d=o+8|0;u[c+8>>2]=u[d>>2];u[d>>2]=0;u[s>>2]=0;u[o>>2]=0;Pn(0,l|0,n|0,e|0,r|0,t|0,i|0,ZM(c)|0)|0;DM(c);WM(f);v=a;return}function zM(){var n=0;if(!(t[7968]|0)){ck(10708);n=7968;u[n>>2]=1;u[n+4>>2]=0}return 10708}function GM(n){n=n|0;return ek(n)|0}function KM(n){n=n|0;return $M(n)|0}function XM(n){n=n|0;return $l(n)|0}function JM(n){n=n|0;return nk(n)|0}function ZM(n){n=n|0;return QM(n)|0}function QM(n){n=n|0;var e=0,r=0,t=0;t=(u[n+4>>2]|0)-(u[n>>2]|0)|0;r=t>>2;t=Dg(t+4|0)|0;u[t>>2]=r;if(r|0){e=0;do{u[t+4+(e<<2)>>2]=$M(u[(u[n>>2]|0)+(e<<2)>>2]|0)|0;e=e+1|0}while((e|0)!=(r|0))}return t|0}function $M(n){n=n|0;return n|0}function nk(n){n=n|0;var e=0,r=0,t=0;t=(u[n+4>>2]|0)-(u[n>>2]|0)|0;r=t>>2;t=Dg(t+4|0)|0;u[t>>2]=r;if(r|0){e=0;do{u[t+4+(e<<2)>>2]=ek((u[n>>2]|0)+(e<<2)|0)|0;e=e+1|0}while((e|0)!=(r|0))}return t|0}function ek(n){n=n|0;var e=0,r=0,t=0,i=0;i=v;v=v+32|0;e=i+12|0;r=i;t=ff(rk()|0)|0;if(!t)n=tk(n)|0;else{cf(e,t);lf(r,e);wS(n,r);n=df(e)|0}v=i;return n|0}function rk(){var n=0;if(!(t[7960]|0)){fk(10664);xn(25,10664,b|0)|0;n=7960;u[n>>2]=1;u[n+4>>2]=0}return 10664}function tk(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0;r=v;v=v+16|0;i=r+4|0;a=r;t=Dg(8)|0;e=t;f=GE(4)|0;u[f>>2]=u[n>>2];o=e+4|0;u[o>>2]=f;n=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];ik(n,o,i);u[t>>2]=n;v=r;return e|0}function ik(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;r=GE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1656;u[r+12>>2]=e;u[n+4>>2]=r;return}function uk(n){n=n|0;WE(n);XE(n);return}function ok(n){n=n|0;n=u[n+12>>2]|0;if(n|0)XE(n);return}function ak(n){n=n|0;XE(n);return}function fk(n){n=n|0;Rf(n);return}function ck(n){n=n|0;xo(n,lk()|0,5);return}function lk(){return 1676}function sk(n,e){n=n|0;e=e|0;var r=0;if((_k(n)|0)>>>0<e>>>0)DE(n);if(e>>>0>1073741823)Xn();else{r=GE(e<<2)|0;u[n+4>>2]=r;u[n>>2]=r;u[n+8>>2]=r+(e<<2);return}}function dk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;t=n+4|0;n=r-e|0;if((n|0)>0){iC(u[t>>2]|0,e|0,n|0)|0;u[t>>2]=(u[t>>2]|0)+(n>>>2<<2)}return}function _k(n){n=n|0;return 1073741823}function vk(n,e){n=n|0;e=e|0;var r=0;if((mk(n)|0)>>>0<e>>>0)DE(n);if(e>>>0>1073741823)Xn();else{r=GE(e<<2)|0;u[n+4>>2]=r;u[n>>2]=r;u[n+8>>2]=r+(e<<2);return}}function pk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;t=n+4|0;n=r-e|0;if((n|0)>0){iC(u[t>>2]|0,e|0,n|0)|0;u[t>>2]=(u[t>>2]|0)+(n>>>2<<2)}return}function mk(n){n=n|0;return 1073741823}function bk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>1073741823)Xn();else{i=GE(e<<2)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<2)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<2);return}function hk(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function yk(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-4-e|0)>>>2)<<2);n=u[n>>2]|0;if(n|0)XE(n);return}function wk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>1073741823)Xn();else{i=GE(e<<2)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<2)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<2);return}function Mk(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>2)<<2)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function kk(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-4-e|0)>>>2)<<2);n=u[n>>2]|0;if(n|0)XE(n);return}function gk(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0;b=v;v=v+32|0;s=b+20|0;d=b+12|0;l=b+16|0;_=b+4|0;p=b;m=b+8|0;f=AM()|0;o=u[f>>2]|0;a=u[o>>2]|0;if(a|0){c=u[f+8>>2]|0;f=u[f+4>>2]|0;while(1){bS(s,a);Tk(n,s,f,c);o=o+4|0;a=u[o>>2]|0;if(!a)break;else{c=c+1|0;f=f+1|0}}}o=EM()|0;a=u[o>>2]|0;if(a|0)do{bS(s,a);u[d>>2]=u[o+4>>2];Ak(e,s,d);o=o+8|0;a=u[o>>2]|0}while((a|0)!=0);o=u[(sM()|0)>>2]|0;if(o|0)do{e=u[o+4>>2]|0;bS(s,u[(Sk(e)|0)>>2]|0);u[d>>2]=kM(e)|0;Ek(r,s,d);o=u[o>>2]|0}while((o|0)!=0);bS(l,0);o=TM()|0;u[s>>2]=u[l>>2];RM(s,o,i);o=u[(sM()|0)>>2]|0;if(o|0){n=s+4|0;e=s+8|0;r=s+8|0;do{c=u[o+4>>2]|0;bS(d,u[(Sk(c)|0)>>2]|0);Lk(_,Ck(c)|0);a=u[_>>2]|0;if(a|0){u[s>>2]=0;u[n>>2]=0;u[e>>2]=0;do{bS(p,u[(Sk(u[a+4>>2]|0)|0)>>2]|0);f=u[n>>2]|0;if(f>>>0<(u[r>>2]|0)>>>0){u[f>>2]=u[p>>2];u[n>>2]=(u[n>>2]|0)+4}else IM(s,p);a=u[a>>2]|0}while((a|0)!=0);Rk(t,d,s);WM(s)}u[m>>2]=u[d>>2];l=Pk(c)|0;u[s>>2]=u[m>>2];RM(s,l,i);Ef(_);o=u[o>>2]|0}while((o|0)!=0)}v=b;return}function Tk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;qk(n,e,r,t);return}function Ak(n,e,r){n=n|0;e=e|0;r=r|0;jk(n,e,r);return}function Sk(n){n=n|0;return n|0}function Ek(n,e,r){n=n|0;e=e|0;r=r|0;Hk(n,e,r);return}function Ck(n){n=n|0;return n+16|0}function Lk(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;o=v;v=v+16|0;i=o+8|0;r=o;u[n>>2]=0;t=u[e>>2]|0;u[i>>2]=t;u[r>>2]=n;r=xk(r)|0;if(t|0){t=GE(12)|0;a=(Uk(i)|0)+4|0;n=u[a+4>>2]|0;e=t+4|0;u[e>>2]=u[a>>2];u[e+4>>2]=n;e=u[u[i>>2]>>2]|0;u[i>>2]=e;if(!e)n=t;else{e=t;while(1){n=GE(12)|0;c=(Uk(i)|0)+4|0;f=u[c+4>>2]|0;a=n+4|0;u[a>>2]=u[c>>2];u[a+4>>2]=f;u[e>>2]=n;a=u[u[i>>2]>>2]|0;u[i>>2]=a;if(!a)break;else e=n}}u[n>>2]=u[r>>2];u[r>>2]=t}v=o;return}function Rk(n,e,r){n=n|0;e=e|0;r=r|0;Bk(n,e,r);return}function Pk(n){n=n|0;return n+24|0}function Bk(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+32|0;a=t+24|0;i=t+16|0;f=t+12|0;o=t;gS(i);n=ko(n)|0;u[f>>2]=u[e>>2];VM(o,r);u[a>>2]=u[f>>2];Ok(n,a,o);WM(o);AS(i);v=t;return}function Ok(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0;t=v;v=v+32|0;a=t+16|0;f=t+12|0;i=t;o=Ao(Nk()|0)|0;u[f>>2]=u[e>>2];u[a>>2]=u[f>>2];e=GM(a)|0;u[i>>2]=u[r>>2];a=r+4|0;u[i+4>>2]=u[a>>2];f=r+8|0;u[i+8>>2]=u[f>>2];u[f>>2]=0;u[a>>2]=0;u[r>>2]=0;En(0,o|0,n|0,e|0,JM(i)|0)|0;WM(i);v=t;return}function Nk(){var n=0;if(!(t[7976]|0)){Ik(10720);n=7976;u[n>>2]=1;u[n+4>>2]=0}return 10720}function Ik(n){n=n|0;xo(n,Fk()|0,2);return}function Fk(){return 1732}function xk(n){n=n|0;return u[n>>2]|0}function Uk(n){n=n|0;return u[n>>2]|0}function Hk(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+32|0;o=t+16|0;i=t+8|0;a=t;gS(i);n=ko(n)|0;u[a>>2]=u[e>>2];r=u[r>>2]|0;u[o>>2]=u[a>>2];Dk(n,o,r);AS(i);v=t;return}function Dk(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+16|0;o=t+4|0;a=t;i=Ao(Wk()|0)|0;u[a>>2]=u[e>>2];u[o>>2]=u[a>>2];e=GM(o)|0;En(0,i|0,n|0,e|0,KM(r)|0)|0;v=t;return}function Wk(){var n=0;if(!(t[7984]|0)){Yk(10732);n=7984;u[n>>2]=1;u[n+4>>2]=0}return 10732}function Yk(n){n=n|0;xo(n,Vk()|0,2);return}function Vk(){return 1744}function jk(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0;t=v;v=v+32|0;o=t+16|0;i=t+8|0;a=t;gS(i);n=ko(n)|0;u[a>>2]=u[e>>2];r=u[r>>2]|0;u[o>>2]=u[a>>2];Dk(n,o,r);AS(i);v=t;return}function qk(n,e,r,i){n=n|0;e=e|0;r=r|0;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+32|0;f=o+16|0;a=o+8|0;c=o;gS(a);n=ko(n)|0;u[c>>2]=u[e>>2];r=t[r>>0]|0;i=t[i>>0]|0;u[f>>2]=u[c>>2];zk(n,f,r,i);AS(a);v=o;return}function zk(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;a=i+4|0;f=i;o=Ao(Gk()|0)|0;u[f>>2]=u[e>>2];u[a>>2]=u[f>>2];e=GM(a)|0;r=Kk(r)|0;te(0,o|0,n|0,e|0,r|0,Kk(t)|0)|0;v=i;return}function Gk(){var n=0;if(!(t[7992]|0)){Jk(10744);n=7992;u[n>>2]=1;u[n+4>>2]=0}return 10744}function Kk(n){n=n|0;return Xk(n)|0}function Xk(n){n=n|0;return n&255|0}function Jk(n){n=n|0;xo(n,Zk()|0,3);return}function Zk(){return 1756}function Qk(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0;p=v;v=v+32|0;c=p+8|0;l=p+4|0;s=p+20|0;d=p;qc(n,0);i=yS(e)|0;u[c>>2]=0;_=c+4|0;u[_>>2]=0;u[c+8>>2]=0;switch(i<<24>>24){case 0:{t[s>>0]=0;$k(l,r,s);ng(n,l)|0;$i(l);break}case 8:{_=hS(e)|0;t[s>>0]=8;bS(d,u[_+4>>2]|0);eg(l,r,s,d,_+8|0);ng(n,l)|0;$i(l);break}case 9:{a=hS(e)|0;e=u[a+4>>2]|0;if(e|0){f=c+8|0;o=a+12|0;while(1){e=e+-1|0;bS(l,u[o>>2]|0);i=u[_>>2]|0;if(i>>>0<(u[f>>2]|0)>>>0){u[i>>2]=u[l>>2];u[_>>2]=(u[_>>2]|0)+4}else IM(c,l);if(!e)break;else o=o+4|0}}t[s>>0]=9;bS(d,u[a+8>>2]|0);rg(l,r,s,d,c);ng(n,l)|0;$i(l);break}default:{_=hS(e)|0;t[s>>0]=i;bS(d,u[_+4>>2]|0);tg(l,r,s,d);ng(n,l)|0;$i(l)}}WM(c);v=p;return}function $k(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,u=0;i=v;v=v+16|0;u=i;gS(u);e=ko(e)|0;bg(n,e,t[r>>0]|0);AS(u);v=i;return}function ng(n,e){n=n|0;e=e|0;var r=0;r=u[n>>2]|0;if(r|0)ie(r|0);u[n>>2]=u[e>>2];u[e>>2]=0;return n|0}function eg(n,e,r,i,o){n=n|0;e=e|0;r=r|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0;a=v;v=v+32|0;c=a+16|0;f=a+8|0;l=a;gS(f);e=ko(e)|0;r=t[r>>0]|0;u[l>>2]=u[i>>2];o=u[o>>2]|0;u[c>>2]=u[l>>2];_g(n,e,r,c,o);AS(f);v=a;return}function rg(n,e,r,i,o){n=n|0;e=e|0;r=r|0;i=i|0;o=o|0;var a=0,f=0,c=0,l=0,s=0;a=v;v=v+32|0;l=a+24|0;f=a+16|0;s=a+12|0;c=a;gS(f);e=ko(e)|0;r=t[r>>0]|0;u[s>>2]=u[i>>2];VM(c,o);u[l>>2]=u[s>>2];cg(n,e,r,l,c);WM(c);AS(f);v=a;return}function tg(n,e,r,i){n=n|0;e=e|0;r=r|0;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+32|0;f=o+16|0;a=o+8|0;c=o;gS(a);e=ko(e)|0;r=t[r>>0]|0;u[c>>2]=u[i>>2];u[f>>2]=u[c>>2];ig(n,e,r,f);AS(a);v=o;return}function ig(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0,a=0,f=0;i=v;v=v+16|0;o=i+4|0;f=i;a=Ao(ug()|0)|0;r=Kk(r)|0;u[f>>2]=u[t>>2];u[o>>2]=u[f>>2];og(n,En(0,a|0,e|0,r|0,GM(o)|0)|0);v=i;return}function ug(){var n=0;if(!(t[8e3]|0)){ag(10756);n=8e3;u[n>>2]=1;u[n+4>>2]=0}return 10756}function og(n,e){n=n|0;e=e|0;qc(n,e);return}function ag(n){n=n|0;xo(n,fg()|0,2);return}function fg(){return 1772}function cg(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0;o=v;v=v+32|0;c=o+16|0;l=o+12|0;a=o;f=Ao(lg()|0)|0;r=Kk(r)|0;u[l>>2]=u[t>>2];u[c>>2]=u[l>>2];t=GM(c)|0;u[a>>2]=u[i>>2];c=i+4|0;u[a+4>>2]=u[c>>2];l=i+8|0;u[a+8>>2]=u[l>>2];u[l>>2]=0;u[c>>2]=0;u[i>>2]=0;og(n,te(0,f|0,e|0,r|0,t|0,JM(a)|0)|0);WM(a);v=o;return}function lg(){var n=0;if(!(t[8008]|0)){sg(10768);n=8008;u[n>>2]=1;u[n+4>>2]=0}return 10768}function sg(n){n=n|0;xo(n,dg()|0,3);return}function dg(){return 1784}function _g(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0;o=v;v=v+16|0;f=o+4|0;c=o;a=Ao(vg()|0)|0;r=Kk(r)|0;u[c>>2]=u[t>>2];u[f>>2]=u[c>>2];t=GM(f)|0;og(n,te(0,a|0,e|0,r|0,t|0,XM(i)|0)|0);v=o;return}function vg(){var n=0;if(!(t[8016]|0)){pg(10780);n=8016;u[n>>2]=1;u[n+4>>2]=0}return 10780}function pg(n){n=n|0;xo(n,mg()|0,3);return}function mg(){return 1800}function bg(n,e,r){n=n|0;e=e|0;r=r|0;var t=0;t=Ao(hg()|0)|0;og(n,ue(0,t|0,e|0,Kk(r)|0)|0);return}function hg(){var n=0;if(!(t[8024]|0)){yg(10792);n=8024;u[n>>2]=1;u[n+4>>2]=0}return 10792}function yg(n){n=n|0;xo(n,wg()|0,1);return}function wg(){return 1816}function Mg(){kg();gg();Tg();return}function kg(){u[2702]=KE(65536)|0;return}function gg(){Gg(10856);return}function Tg(){Ag(10816);return}function Ag(n){n=n|0;Sg(n,5044);Eg(n)|0;return}function Sg(n,e){n=n|0;e=e|0;var r=0;r=rk()|0;u[n>>2]=r;Wg(r,e);lM(u[n>>2]|0);return}function Eg(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,Cg()|0);return n|0}function Cg(){var n=0;if(!(t[8032]|0)){Lg(10820);xn(64,10820,b|0)|0;n=8032;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(10820)|0))Lg(10820);return 10820}function Lg(n){n=n|0;Bg(n);cy(n,25);return}function Rg(n){n=n|0;Pg(n+24|0);return}function Pg(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function Bg(n){n=n|0;var e=0;e=$a()|0;rf(n,5,18,e,xg()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function Og(n,e){n=n|0;e=e|0;Ng(n,e);return}function Ng(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;r=v;v=v+16|0;t=r;i=r+4|0;sl(i,e);u[t>>2]=dl(i,e)|0;Ig(n,t);v=r;return}function Ig(n,e){n=n|0;e=e|0;Fg(n+4|0,u[e>>2]|0);t[n+8>>0]=1;return}function Fg(n,e){n=n|0;e=e|0;u[n>>2]=e;return}function xg(){return 1824}function Ug(n){n=n|0;return Hg(n)|0}function Hg(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0;r=v;v=v+16|0;i=r+4|0;a=r;t=Dg(8)|0;e=t;f=GE(4)|0;sl(i,n);Fg(f,dl(i,n)|0);o=e+4|0;u[o>>2]=f;n=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];ik(n,o,i);u[t>>2]=n;v=r;return e|0}function Dg(n){n=n|0;var e=0,r=0;n=n+7&-8;if(n>>>0<=32768?(e=u[2701]|0,n>>>0<=(65536-e|0)>>>0):0){r=(u[2702]|0)+e|0;u[2701]=e+n;n=r}else{n=KE(n+8|0)|0;u[n>>2]=u[2703];u[2703]=n;n=n+8|0}return n|0}function Wg(n,e){n=n|0;e=e|0;u[n>>2]=Yg()|0;u[n+4>>2]=Vg()|0;u[n+12>>2]=e;u[n+8>>2]=jg()|0;u[n+32>>2]=9;return}function Yg(){return 11744}function Vg(){return 1832}function jg(){return Oy()|0}function qg(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){zg(r);XE(r)}}else if(e|0)XE(e);return}function zg(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function Gg(n){n=n|0;Kg(n,5052);Xg(n)|0;Jg(n,5058,26)|0;Zg(n,5069,1)|0;Qg(n,5077,10)|0;$g(n,5087,19)|0;eT(n,5094,27)|0;return}function Kg(n,e){n=n|0;e=e|0;var r=0;r=cS()|0;u[n>>2]=r;lS(r,e);lM(u[n>>2]|0);return}function Xg(n){n=n|0;var e=0;e=u[n>>2]|0;ty(e,KA()|0);return n|0}function Jg(n,e,r){n=n|0;e=e|0;r=r|0;EA(n,Ba(e)|0,r,0);return n|0}function Zg(n,e,r){n=n|0;e=e|0;r=r|0;cA(n,Ba(e)|0,r,0);return n|0}function Qg(n,e,r){n=n|0;e=e|0;r=r|0;UT(n,Ba(e)|0,r,0);return n|0}function $g(n,e,r){n=n|0;e=e|0;r=r|0;wT(n,Ba(e)|0,r,0);return n|0}function nT(n,e){n=n|0;e=e|0;var r=0,t=0;n:while(1){r=u[2703]|0;while(1){if((r|0)==(e|0))break n;t=u[r>>2]|0;u[2703]=t;if(!r)r=t;else break}XE(r)}u[2701]=n;return}function eT(n,e,r){n=n|0;e=e|0;r=r|0;rT(n,Ba(e)|0,r,0);return n|0}function rT(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=tT()|0;n=iT(r)|0;xa(o,e,i,n,uT(r,t)|0,t);return}function tT(){var n=0,e=0;if(!(t[8040]|0)){dT(10860);xn(65,10860,b|0)|0;e=8040;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10860)|0)){n=10860;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));dT(10860)}return 10860}function iT(n){n=n|0;return n|0}function uT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=tT()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){oT(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{aT(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function oT(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function aT(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=fT(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;cT(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;oT(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;lT(n,i);sT(i);v=f;return}}function fT(n){n=n|0;return 536870911}function cT(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function lT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function sT(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function dT(n){n=n|0;pT(n);return}function _T(n){n=n|0;vT(n+24|0);return}function vT(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function pT(n){n=n|0;var e=0;e=$a()|0;rf(n,1,11,e,mT()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function mT(){return 1840}function bT(n,e,r){n=n|0;e=e|0;r=r|0;yT(u[(hT(n)|0)>>2]|0,e,r);return}function hT(n){n=n|0;return(u[(tT()|0)+24>>2]|0)+(n<<3)|0}function yT(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,u=0;t=v;v=v+16|0;u=t+1|0;i=t;sl(u,e);e=dl(u,e)|0;sl(i,r);r=dl(i,r)|0;pL[n&31](e,r);v=t;return}function wT(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=MT()|0;n=kT(r)|0;xa(o,e,i,n,gT(r,t)|0,t);return}function MT(){var n=0,e=0;if(!(t[8048]|0)){RT(10896);xn(66,10896,b|0)|0;e=8048;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10896)|0)){n=10896;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));RT(10896)}return 10896}function kT(n){n=n|0;return n|0}function gT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=MT()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){TT(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{AT(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function TT(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function AT(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=ST(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;ET(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;TT(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;CT(n,i);LT(i);v=f;return}}function ST(n){n=n|0;return 536870911}function ET(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function CT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function LT(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function RT(n){n=n|0;OT(n);return}function PT(n){n=n|0;BT(n+24|0);return}function BT(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function OT(n){n=n|0;var e=0;e=$a()|0;rf(n,1,11,e,NT()|0,1);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function NT(){return 1852}function IT(n,e){n=n|0;e=e|0;return xT(u[(FT(n)|0)>>2]|0,e)|0}function FT(n){n=n|0;return(u[(MT()|0)+24>>2]|0)+(n<<3)|0}function xT(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;sl(t,e);e=dl(t,e)|0;e=$l(mL[n&31](e)|0)|0;v=r;return e|0}function UT(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=HT()|0;n=DT(r)|0;xa(o,e,i,n,WT(r,t)|0,t);return}function HT(){var n=0,e=0;if(!(t[8056]|0)){KT(10932);xn(67,10932,b|0)|0;e=8056;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10932)|0)){n=10932;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));KT(10932)}return 10932}function DT(n){n=n|0;return n|0}function WT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=HT()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){YT(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{VT(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function YT(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function VT(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=jT(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;qT(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;YT(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;zT(n,i);GT(i);v=f;return}}function jT(n){n=n|0;return 536870911}function qT(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function zT(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function GT(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function KT(n){n=n|0;ZT(n);return}function XT(n){n=n|0;JT(n+24|0);return}function JT(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function ZT(n){n=n|0;var e=0;e=$a()|0;rf(n,1,7,e,QT()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function QT(){return 1860}function $T(n,e,r){n=n|0;e=e|0;r=r|0;return eA(u[(nA(n)|0)>>2]|0,e,r)|0}function nA(n){n=n|0;return(u[(HT()|0)+24>>2]|0)+(n<<3)|0}function eA(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0;t=v;v=v+32|0;a=t+12|0;o=t+8|0;f=t;c=t+16|0;i=t+4|0;rA(c,e);tA(f,c,e);Wc(i,r);r=Yc(i,r)|0;u[a>>2]=u[f>>2];PL[n&15](o,a,r);r=iA(o)|0;$i(o);Vc(i);v=t;return r|0}function rA(n,e){n=n|0;e=e|0;return}function tA(n,e,r){n=n|0;e=e|0;r=r|0;uA(n,r);return}function iA(n){n=n|0;return ko(n)|0}function uA(n,e){n=n|0;e=e|0;var r=0,t=0,i=0;i=v;v=v+16|0;r=i;t=e;if(!(t&1))u[n>>2]=u[e>>2];else{oA(r,0);Hn(t|0,r|0)|0;aA(n,r);fA(r)}v=i;return}function oA(n,e){n=n|0;e=e|0;Bo(n,e);u[n+4>>2]=0;t[n+8>>0]=0;return}function aA(n,e){n=n|0;e=e|0;u[n>>2]=u[e+4>>2];return}function fA(n){n=n|0;t[n+8>>0]=0;return}function cA(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=lA()|0;n=sA(r)|0;xa(o,e,i,n,dA(r,t)|0,t);return}function lA(){var n=0,e=0;if(!(t[8064]|0)){yA(10968);xn(68,10968,b|0)|0;e=8064;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(10968)|0)){n=10968;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));yA(10968)}return 10968}function sA(n){n=n|0;return n|0}function dA(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=lA()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){_A(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{vA(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function _A(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function vA(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=pA(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;mA(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;_A(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;bA(n,i);hA(i);v=f;return}}function pA(n){n=n|0;return 536870911}function mA(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function bA(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function hA(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function yA(n){n=n|0;kA(n);return}function wA(n){n=n|0;MA(n+24|0);return}function MA(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function kA(n){n=n|0;var e=0;e=$a()|0;rf(n,1,1,e,gA()|0,5);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function gA(){return 1872}function TA(n,e,r,t,i,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;o=o|0;SA(u[(AA(n)|0)>>2]|0,e,r,t,i,o);return}function AA(n){n=n|0;return(u[(lA()|0)+24>>2]|0)+(n<<3)|0}function SA(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;var o=0,a=0,f=0,c=0,l=0,s=0;o=v;v=v+32|0;a=o+16|0;f=o+12|0;c=o+8|0;l=o+4|0;s=o;Wc(a,e);e=Yc(a,e)|0;Wc(f,r);r=Yc(f,r)|0;Wc(c,t);t=Yc(c,t)|0;Wc(l,i);i=Yc(l,i)|0;Wc(s,u);u=Yc(s,u)|0;lL[n&1](e,r,t,i,u);Vc(s);Vc(l);Vc(c);Vc(f);Vc(a);v=o;return}function EA(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=u[n>>2]|0;i=CA()|0;n=LA(r)|0;xa(o,e,i,n,RA(r,t)|0,t);return}function CA(){var n=0,e=0;if(!(t[8072]|0)){xA(11004);xn(69,11004,b|0)|0;e=8072;u[e>>2]=1;u[e+4>>2]=0}if(!(Ja(11004)|0)){n=11004;e=n+36|0;do{u[n>>2]=0;n=n+4|0}while((n|0)<(e|0));xA(11004)}return 11004}function LA(n){n=n|0;return n|0}function RA(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0,f=0,c=0;f=v;v=v+16|0;i=f;o=f+4|0;u[i>>2]=n;c=CA()|0;a=c+24|0;e=Wa(e,4)|0;u[o>>2]=e;r=c+28|0;t=u[r>>2]|0;if(t>>>0<(u[c+32>>2]|0)>>>0){PA(t,n,e);e=(u[r>>2]|0)+8|0;u[r>>2]=e}else{BA(a,i,o);e=u[r>>2]|0}v=f;return(e-(u[a>>2]|0)>>3)+-1|0}function PA(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;u[n+4>>2]=r;return}function BA(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0;f=v;v=v+32|0;i=f;o=n+4|0;a=((u[o>>2]|0)-(u[n>>2]|0)>>3)+1|0;t=OA(n)|0;if(t>>>0<a>>>0)DE(n);else{c=u[n>>2]|0;s=(u[n+8>>2]|0)-c|0;l=s>>2;NA(i,s>>3>>>0<t>>>1>>>0?l>>>0<a>>>0?a:l:t,(u[o>>2]|0)-c>>3,n+8|0);a=i+8|0;PA(u[a>>2]|0,u[e>>2]|0,u[r>>2]|0);u[a>>2]=(u[a>>2]|0)+8;IA(n,i);FA(i);v=f;return}}function OA(n){n=n|0;return 536870911}function NA(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0;u[n+12>>2]=0;u[n+16>>2]=t;do{if(e){if(e>>>0>536870911)Xn();else{i=GE(e<<3)|0;break}}else i=0}while(0);u[n>>2]=i;t=i+(r<<3)|0;u[n+8>>2]=t;u[n+4>>2]=t;u[n+12>>2]=i+(e<<3);return}function IA(n,e){n=n|0;e=e|0;var r=0,t=0,i=0,o=0,a=0;t=u[n>>2]|0;a=n+4|0;o=e+4|0;i=(u[a>>2]|0)-t|0;r=(u[o>>2]|0)+(0-(i>>3)<<3)|0;u[o>>2]=r;if((i|0)>0){iC(r|0,t|0,i|0)|0;t=o;r=u[o>>2]|0}else t=o;o=u[n>>2]|0;u[n>>2]=r;u[t>>2]=o;o=e+8|0;i=u[a>>2]|0;u[a>>2]=u[o>>2];u[o>>2]=i;o=n+8|0;a=e+12|0;n=u[o>>2]|0;u[o>>2]=u[a>>2];u[a>>2]=n;u[e>>2]=u[t>>2];return}function FA(n){n=n|0;var e=0,r=0,t=0;e=u[n+4>>2]|0;r=n+8|0;t=u[r>>2]|0;if((t|0)!=(e|0))u[r>>2]=t+(~((t+-8-e|0)>>>3)<<3);n=u[n>>2]|0;if(n|0)XE(n);return}function xA(n){n=n|0;DA(n);return}function UA(n){n=n|0;HA(n+24|0);return}function HA(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function DA(n){n=n|0;var e=0;e=$a()|0;rf(n,1,12,e,WA()|0,2);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function WA(){return 1896}function YA(n,e,r){n=n|0;e=e|0;r=r|0;jA(u[(VA(n)|0)>>2]|0,e,r);return}function VA(n){n=n|0;return(u[(CA()|0)+24>>2]|0)+(n<<3)|0}function jA(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,u=0;t=v;v=v+16|0;u=t+4|0;i=t;qA(u,e);e=zA(u,e)|0;Wc(i,r);r=Yc(i,r)|0;pL[n&31](e,r);Vc(i);v=t;return}function qA(n,e){n=n|0;e=e|0;return}function zA(n,e){n=n|0;e=e|0;return GA(e)|0}function GA(n){n=n|0;return n|0}function KA(){var n=0;if(!(t[8080]|0)){XA(11040);xn(70,11040,b|0)|0;n=8080;u[n>>2]=1;u[n+4>>2]=0}if(!(Ja(11040)|0))XA(11040);return 11040}function XA(n){n=n|0;QA(n);cy(n,71);return}function JA(n){n=n|0;ZA(n+24|0);return}function ZA(n){n=n|0;var e=0,r=0,t=0;r=u[n>>2]|0;t=r;if(r|0){n=n+4|0;e=u[n>>2]|0;if((e|0)!=(r|0))u[n>>2]=e+(~((e+-8-t|0)>>>3)<<3);XE(r)}return}function QA(n){n=n|0;var e=0;e=$a()|0;rf(n,5,7,e,rS()|0,0);u[n+24>>2]=0;u[n+28>>2]=0;u[n+32>>2]=0;return}function $A(n){n=n|0;nS(n);return}function nS(n){n=n|0;eS(n);return}function eS(n){n=n|0;t[n+8>>0]=1;return}function rS(){return 1936}function tS(){return iS()|0}function iS(){var n=0,e=0,r=0,t=0,i=0,o=0,a=0;e=v;v=v+16|0;i=e+4|0;a=e;r=Dg(8)|0;n=r;o=n+4|0;u[o>>2]=GE(1)|0;t=GE(8)|0;o=u[o>>2]|0;u[a>>2]=0;u[i>>2]=u[a>>2];uS(t,o,i);u[r>>2]=t;v=e;return n|0}function uS(n,e,r){n=n|0;e=e|0;r=r|0;u[n>>2]=e;r=GE(16)|0;u[r+4>>2]=0;u[r+8>>2]=0;u[r>>2]=1916;u[r+12>>2]=e;u[n+4>>2]=r;return}function oS(n){n=n|0;WE(n);XE(n);return}function aS(n){n=n|0;n=u[n+12>>2]|0;if(n|0)XE(n);return}function fS(n){n=n|0;XE(n);return}function cS(){var n=0;if(!(t[8088]|0)){mS(11076);xn(25,11076,b|0)|0;n=8088;u[n>>2]=1;u[n+4>>2]=0}return 11076}function lS(n,e){n=n|0;e=e|0;u[n>>2]=sS()|0;u[n+4>>2]=dS()|0;u[n+12>>2]=e;u[n+8>>2]=_S()|0;u[n+32>>2]=10;return}function sS(){return 11745}function dS(){return 1940}function _S(){return Ym()|0}function vS(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;if((Dm(t,896)|0)==512){if(r|0){pS(r);XE(r)}}else if(e|0)XE(e);return}function pS(n){n=n|0;n=u[n+4>>2]|0;if(n|0)qE(n);return}function mS(n){n=n|0;Rf(n);return}function bS(n,e){n=n|0;e=e|0;u[n>>2]=e;return}function hS(n){n=n|0;return u[n>>2]|0}function yS(n){n=n|0;return t[u[n>>2]>>0]|0}function wS(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;u[t>>2]=u[n>>2];MS(e,t)|0;v=r;return}function MS(n,e){n=n|0;e=e|0;var r=0;r=kS(u[n>>2]|0,e)|0;e=n+4|0;u[(u[e>>2]|0)+8>>2]=r;return u[(u[e>>2]|0)+8>>2]|0}function kS(n,e){n=n|0;e=e|0;var r=0,t=0;r=v;v=v+16|0;t=r;gS(t);n=ko(n)|0;e=TS(n,u[e>>2]|0)|0;AS(t);v=r;return e|0}function gS(n){n=n|0;u[n>>2]=u[2701];u[n+4>>2]=u[2703];return}function TS(n,e){n=n|0;e=e|0;var r=0;r=Ao(SS()|0)|0;return ue(0,r|0,n|0,XM(e)|0)|0}function AS(n){n=n|0;nT(u[n>>2]|0,u[n+4>>2]|0);return}function SS(){var n=0;if(!(t[8096]|0)){ES(11120);n=8096;u[n>>2]=1;u[n+4>>2]=0}return 11120}function ES(n){n=n|0;xo(n,CS()|0,1);return}function CS(){return 1948}function LS(){RS();return}function RS(){var n=0,e=0,r=0,i=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0;h=v;v=v+16|0;_=h+4|0;p=h;Nn(65536,10804,u[2702]|0,10812);r=AM()|0;e=u[r>>2]|0;n=u[e>>2]|0;if(n|0){i=u[r+8>>2]|0;r=u[r+4>>2]|0;while(1){Yn(n|0,o[r>>0]|0|0,t[i>>0]|0);e=e+4|0;n=u[e>>2]|0;if(!n)break;else{i=i+1|0;r=r+1|0}}}n=EM()|0;e=u[n>>2]|0;if(e|0)do{Vn(e|0,u[n+4>>2]|0);n=n+8|0;e=u[n>>2]|0}while((e|0)!=0);Vn(PS()|0,5167);d=sM()|0;n=u[d>>2]|0;n:do{if(n|0){do{BS(u[n+4>>2]|0);n=u[n>>2]|0}while((n|0)!=0);n=u[d>>2]|0;if(n|0){s=d;do{while(1){a=n;n=u[n>>2]|0;a=u[a+4>>2]|0;if(!(OS(a)|0))break;u[p>>2]=s;u[_>>2]=u[p>>2];NS(d,_)|0;if(!n)break n}IS(a);s=u[s>>2]|0;e=FS(a)|0;f=Zn()|0;c=v;v=v+((1*(e<<2)|0)+15&-16)|0;l=v;v=v+((1*(e<<2)|0)+15&-16)|0;e=u[(Ck(a)|0)>>2]|0;if(e|0){r=c;i=l;while(1){u[r>>2]=u[(Sk(u[e+4>>2]|0)|0)>>2];u[i>>2]=u[e+8>>2];e=u[e>>2]|0;if(!e)break;else{r=r+4|0;i=i+4|0}}}y=Sk(a)|0;e=xS(a)|0;r=FS(a)|0;i=US(a)|0;Gn(y|0,e|0,c|0,l|0,r|0,i|0,kM(a)|0);Fn(f|0)}while((n|0)!=0)}}}while(0);n=u[(TM()|0)>>2]|0;if(n|0)do{y=n+4|0;d=PM(y)|0;a=FM(d)|0;f=BM(d)|0;c=(OM(d)|0)+1|0;l=HS(d)|0;s=DS(y)|0;d=Ja(d)|0;_=UM(y)|0;p=WS(y)|0;qn(0,a|0,f|0,c|0,l|0,s|0,d|0,_|0,p|0,YS(y)|0);n=u[n>>2]|0}while((n|0)!=0);n=u[(sM()|0)>>2]|0;n:do{if(n|0){e:while(1){e=u[n+4>>2]|0;if(e|0?(m=u[(Sk(e)|0)>>2]|0,b=u[(Pk(e)|0)>>2]|0,b|0):0){r=b;do{e=r+4|0;i=PM(e)|0;r:do{if(i|0)switch(Ja(i)|0){case 0:break e;case 4:case 3:case 2:{l=FM(i)|0;s=BM(i)|0;d=(OM(i)|0)+1|0;_=HS(i)|0;p=Ja(i)|0;y=UM(e)|0;qn(m|0,l|0,s|0,d|0,_|0,0,p|0,y|0,WS(e)|0,YS(e)|0);break r}case 1:{c=FM(i)|0;l=BM(i)|0;s=(OM(i)|0)+1|0;d=HS(i)|0;_=DS(e)|0;p=Ja(i)|0;y=UM(e)|0;qn(m|0,c|0,l|0,s|0,d|0,_|0,p|0,y|0,WS(e)|0,YS(e)|0);break r}case 5:{d=FM(i)|0;_=BM(i)|0;p=(OM(i)|0)+1|0;y=HS(i)|0;qn(m|0,d|0,_|0,p|0,y|0,VS(i)|0,Ja(i)|0,0,0,0);break r}default:break r}}while(0);r=u[r>>2]|0}while((r|0)!=0)}n=u[n>>2]|0;if(!n)break n}Xn()}}while(0);Kn();v=h;return}function PS(){return 11703}function BS(n){n=n|0;t[n+40>>0]=0;return}function OS(n){n=n|0;return(t[n+40>>0]|0)!=0|0}function NS(n,e){n=n|0;e=e|0;e=jS(e)|0;n=u[e>>2]|0;u[e>>2]=u[n>>2];XE(n);return u[e>>2]|0}function IS(n){n=n|0;t[n+40>>0]=1;return}function FS(n){n=n|0;return u[n+20>>2]|0}function xS(n){n=n|0;return u[n+8>>2]|0}function US(n){n=n|0;return u[n+32>>2]|0}function HS(n){n=n|0;return u[n+4>>2]|0}function DS(n){n=n|0;return u[n+4>>2]|0}function WS(n){n=n|0;return u[n+8>>2]|0}function YS(n){n=n|0;return u[n+16>>2]|0}function VS(n){n=n|0;return u[n+20>>2]|0}function jS(n){n=n|0;return u[n>>2]|0}function qS(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0,w=0,M=0,k=0,g=0;g=v;v=v+16|0;_=g;do{if(n>>>0<245){l=n>>>0<11?16:n+11&-8;n=l>>>3;d=u[2783]|0;r=d>>>n;if(r&3|0){e=(r&1^1)+n|0;n=11172+(e<<1<<2)|0;r=n+8|0;t=u[r>>2]|0;i=t+8|0;o=u[i>>2]|0;if((n|0)==(o|0))u[2783]=d&~(1<<e);else{u[o+12>>2]=n;u[r>>2]=o}k=e<<3;u[t+4>>2]=k|3;k=t+k+4|0;u[k>>2]=u[k>>2]|1;k=i;v=g;return k|0}s=u[2785]|0;if(l>>>0>s>>>0){if(r|0){e=2<<n;e=r<<n&(e|0-e);e=(e&0-e)+-1|0;a=e>>>12&16;e=e>>>a;r=e>>>5&8;e=e>>>r;i=e>>>2&4;e=e>>>i;n=e>>>1&2;e=e>>>n;t=e>>>1&1;t=(r|a|i|n|t)+(e>>>t)|0;e=11172+(t<<1<<2)|0;n=e+8|0;i=u[n>>2]|0;a=i+8|0;r=u[a>>2]|0;if((e|0)==(r|0)){n=d&~(1<<t);u[2783]=n}else{u[r+12>>2]=e;u[n>>2]=r;n=d}o=(t<<3)-l|0;u[i+4>>2]=l|3;t=i+l|0;u[t+4>>2]=o|1;u[t+o>>2]=o;if(s|0){i=u[2788]|0;e=s>>>3;r=11172+(e<<1<<2)|0;e=1<<e;if(!(n&e)){u[2783]=n|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=i;u[e+12>>2]=i;u[i+8>>2]=e;u[i+12>>2]=r}u[2785]=o;u[2788]=t;k=a;v=g;return k|0}f=u[2784]|0;if(f){r=(f&0-f)+-1|0;a=r>>>12&16;r=r>>>a;o=r>>>5&8;r=r>>>o;c=r>>>2&4;r=r>>>c;t=r>>>1&2;r=r>>>t;n=r>>>1&1;n=u[11436+((o|a|c|t|n)+(r>>>n)<<2)>>2]|0;r=(u[n+4>>2]&-8)-l|0;t=u[n+16+(((u[n+16>>2]|0)==0&1)<<2)>>2]|0;if(!t){c=n;o=r}else{do{a=(u[t+4>>2]&-8)-l|0;c=a>>>0<r>>>0;r=c?a:r;n=c?t:n;t=u[t+16+(((u[t+16>>2]|0)==0&1)<<2)>>2]|0}while((t|0)!=0);c=n;o=r}a=c+l|0;if(c>>>0<a>>>0){i=u[c+24>>2]|0;e=u[c+12>>2]|0;do{if((e|0)==(c|0)){n=c+20|0;e=u[n>>2]|0;if(!e){n=c+16|0;e=u[n>>2]|0;if(!e){r=0;break}}while(1){r=e+20|0;t=u[r>>2]|0;if(t|0){e=t;n=r;continue}r=e+16|0;t=u[r>>2]|0;if(!t)break;else{e=t;n=r}}u[n>>2]=0;r=e}else{r=u[c+8>>2]|0;u[r+12>>2]=e;u[e+8>>2]=r;r=e}}while(0);do{if(i|0){e=u[c+28>>2]|0;n=11436+(e<<2)|0;if((c|0)==(u[n>>2]|0)){u[n>>2]=r;if(!r){u[2784]=f&~(1<<e);break}}else{u[i+16+(((u[i+16>>2]|0)!=(c|0)&1)<<2)>>2]=r;if(!r)break}u[r+24>>2]=i;e=u[c+16>>2]|0;if(e|0){u[r+16>>2]=e;u[e+24>>2]=r}e=u[c+20>>2]|0;if(e|0){u[r+20>>2]=e;u[e+24>>2]=r}}}while(0);if(o>>>0<16){k=o+l|0;u[c+4>>2]=k|3;k=c+k+4|0;u[k>>2]=u[k>>2]|1}else{u[c+4>>2]=l|3;u[a+4>>2]=o|1;u[a+o>>2]=o;if(s|0){t=u[2788]|0;e=s>>>3;r=11172+(e<<1<<2)|0;e=1<<e;if(!(d&e)){u[2783]=d|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=t;u[e+12>>2]=t;u[t+8>>2]=e;u[t+12>>2]=r}u[2785]=o;u[2788]=a}k=c+8|0;v=g;return k|0}else d=l}else d=l}else d=l}else if(n>>>0<=4294967231){n=n+11|0;l=n&-8;c=u[2784]|0;if(c){t=0-l|0;n=n>>>8;if(n){if(l>>>0>16777215)f=31;else{d=(n+1048320|0)>>>16&8;M=n<<d;s=(M+520192|0)>>>16&4;M=M<<s;f=(M+245760|0)>>>16&2;f=14-(s|d|f)+(M<<f>>>15)|0;f=l>>>(f+7|0)&1|f<<1}}else f=0;r=u[11436+(f<<2)>>2]|0;n:do{if(!r){r=0;n=0;M=57}else{n=0;a=l<<((f|0)==31?0:25-(f>>>1)|0);o=0;while(1){i=(u[r+4>>2]&-8)-l|0;if(i>>>0<t>>>0)if(!i){n=r;t=0;i=r;M=61;break n}else{n=r;t=i}i=u[r+20>>2]|0;r=u[r+16+(a>>>31<<2)>>2]|0;o=(i|0)==0|(i|0)==(r|0)?o:i;i=(r|0)==0;if(i){r=o;M=57;break}else a=a<<((i^1)&1)}}}while(0);if((M|0)==57){if((r|0)==0&(n|0)==0){n=2<<f;n=c&(n|0-n);if(!n){d=l;break}d=(n&0-n)+-1|0;a=d>>>12&16;d=d>>>a;o=d>>>5&8;d=d>>>o;f=d>>>2&4;d=d>>>f;s=d>>>1&2;d=d>>>s;r=d>>>1&1;n=0;r=u[11436+((o|a|f|s|r)+(d>>>r)<<2)>>2]|0}if(!r){f=n;a=t}else{i=r;M=61}}if((M|0)==61)while(1){M=0;r=(u[i+4>>2]&-8)-l|0;d=r>>>0<t>>>0;r=d?r:t;n=d?i:n;i=u[i+16+(((u[i+16>>2]|0)==0&1)<<2)>>2]|0;if(!i){f=n;a=r;break}else{t=r;M=61}}if((f|0)!=0?a>>>0<((u[2785]|0)-l|0)>>>0:0){o=f+l|0;if(f>>>0>=o>>>0){k=0;v=g;return k|0}i=u[f+24>>2]|0;e=u[f+12>>2]|0;do{if((e|0)==(f|0)){n=f+20|0;e=u[n>>2]|0;if(!e){n=f+16|0;e=u[n>>2]|0;if(!e){e=0;break}}while(1){r=e+20|0;t=u[r>>2]|0;if(t|0){e=t;n=r;continue}r=e+16|0;t=u[r>>2]|0;if(!t)break;else{e=t;n=r}}u[n>>2]=0}else{k=u[f+8>>2]|0;u[k+12>>2]=e;u[e+8>>2]=k}}while(0);do{if(i){n=u[f+28>>2]|0;r=11436+(n<<2)|0;if((f|0)==(u[r>>2]|0)){u[r>>2]=e;if(!e){t=c&~(1<<n);u[2784]=t;break}}else{u[i+16+(((u[i+16>>2]|0)!=(f|0)&1)<<2)>>2]=e;if(!e){t=c;break}}u[e+24>>2]=i;n=u[f+16>>2]|0;if(n|0){u[e+16>>2]=n;u[n+24>>2]=e}n=u[f+20>>2]|0;if(n){u[e+20>>2]=n;u[n+24>>2]=e;t=c}else t=c}else t=c}while(0);do{if(a>>>0>=16){u[f+4>>2]=l|3;u[o+4>>2]=a|1;u[o+a>>2]=a;e=a>>>3;if(a>>>0<256){r=11172+(e<<1<<2)|0;n=u[2783]|0;e=1<<e;if(!(n&e)){u[2783]=n|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=o;u[e+12>>2]=o;u[o+8>>2]=e;u[o+12>>2]=r;break}e=a>>>8;if(e){if(a>>>0>16777215)e=31;else{M=(e+1048320|0)>>>16&8;k=e<<M;w=(k+520192|0)>>>16&4;k=k<<w;e=(k+245760|0)>>>16&2;e=14-(w|M|e)+(k<<e>>>15)|0;e=a>>>(e+7|0)&1|e<<1}}else e=0;r=11436+(e<<2)|0;u[o+28>>2]=e;n=o+16|0;u[n+4>>2]=0;u[n>>2]=0;n=1<<e;if(!(t&n)){u[2784]=t|n;u[r>>2]=o;u[o+24>>2]=r;u[o+12>>2]=o;u[o+8>>2]=o;break}n=a<<((e|0)==31?0:25-(e>>>1)|0);r=u[r>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(a|0)){M=97;break}t=r+16+(n>>>31<<2)|0;e=u[t>>2]|0;if(!e){M=96;break}else{n=n<<1;r=e}}if((M|0)==96){u[t>>2]=o;u[o+24>>2]=r;u[o+12>>2]=o;u[o+8>>2]=o;break}else if((M|0)==97){M=r+8|0;k=u[M>>2]|0;u[k+12>>2]=o;u[M>>2]=o;u[o+8>>2]=k;u[o+12>>2]=r;u[o+24>>2]=0;break}}else{k=a+l|0;u[f+4>>2]=k|3;k=f+k+4|0;u[k>>2]=u[k>>2]|1}}while(0);k=f+8|0;v=g;return k|0}else d=l}else d=l}else d=-1}while(0);r=u[2785]|0;if(r>>>0>=d>>>0){e=r-d|0;n=u[2788]|0;if(e>>>0>15){k=n+d|0;u[2788]=k;u[2785]=e;u[k+4>>2]=e|1;u[k+e>>2]=e;u[n+4>>2]=d|3}else{u[2785]=0;u[2788]=0;u[n+4>>2]=r|3;k=n+r+4|0;u[k>>2]=u[k>>2]|1}k=n+8|0;v=g;return k|0}a=u[2786]|0;if(a>>>0>d>>>0){w=a-d|0;u[2786]=w;k=u[2789]|0;M=k+d|0;u[2789]=M;u[M+4>>2]=w|1;u[k+4>>2]=d|3;k=k+8|0;v=g;return k|0}if(!(u[2901]|0)){u[2903]=4096;u[2902]=4096;u[2904]=-1;u[2905]=-1;u[2906]=0;u[2894]=0;n=_&-16^1431655768;u[_>>2]=n;u[2901]=n;n=4096}else n=u[2903]|0;f=d+48|0;c=d+47|0;o=n+c|0;i=0-n|0;l=o&i;if(l>>>0<=d>>>0){k=0;v=g;return k|0}n=u[2893]|0;if(n|0?(s=u[2891]|0,_=s+l|0,_>>>0<=s>>>0|_>>>0>n>>>0):0){k=0;v=g;return k|0}n:do{if(!(u[2894]&4)){r=u[2789]|0;e:do{if(r){t=11580;while(1){n=u[t>>2]|0;if(n>>>0<=r>>>0?(b=t+4|0,(n+(u[b>>2]|0)|0)>>>0>r>>>0):0)break;n=u[t+8>>2]|0;if(!n){M=118;break e}else t=n}e=o-a&i;if(e>>>0<2147483647){n=fC(e|0)|0;if((n|0)==((u[t>>2]|0)+(u[b>>2]|0)|0)){if((n|0)!=(-1|0)){a=e;o=n;M=135;break n}}else{t=n;M=126}}else e=0}else M=118}while(0);do{if((M|0)==118){r=fC(0)|0;if((r|0)!=(-1|0)?(e=r,p=u[2902]|0,m=p+-1|0,e=((m&e|0)==0?0:(m+e&0-p)-e|0)+l|0,p=u[2891]|0,m=e+p|0,e>>>0>d>>>0&e>>>0<2147483647):0){b=u[2893]|0;if(b|0?m>>>0<=p>>>0|m>>>0>b>>>0:0){e=0;break}n=fC(e|0)|0;if((n|0)==(r|0)){a=e;o=r;M=135;break n}else{t=n;M=126}}else e=0}}while(0);do{if((M|0)==126){r=0-e|0;if(!(f>>>0>e>>>0&(e>>>0<2147483647&(t|0)!=(-1|0))))if((t|0)==(-1|0)){e=0;break}else{a=e;o=t;M=135;break n}n=u[2903]|0;n=c-e+n&0-n;if(n>>>0>=2147483647){a=e;o=t;M=135;break n}if((fC(n|0)|0)==(-1|0)){fC(r|0)|0;e=0;break}else{a=n+e|0;o=t;M=135;break n}}}while(0);u[2894]=u[2894]|4;M=133}else{e=0;M=133}}while(0);if(((M|0)==133?l>>>0<2147483647:0)?(w=fC(l|0)|0,b=fC(0)|0,h=b-w|0,y=h>>>0>(d+40|0)>>>0,!((w|0)==(-1|0)|y^1|w>>>0<b>>>0&((w|0)!=(-1|0)&(b|0)!=(-1|0))^1)):0){a=y?h:e;o=w;M=135}if((M|0)==135){e=(u[2891]|0)+a|0;u[2891]=e;if(e>>>0>(u[2892]|0)>>>0)u[2892]=e;c=u[2789]|0;do{if(c){e=11580;while(1){n=u[e>>2]|0;r=e+4|0;t=u[r>>2]|0;if((o|0)==(n+t|0)){M=145;break}i=u[e+8>>2]|0;if(!i)break;else e=i}if(((M|0)==145?(u[e+12>>2]&8|0)==0:0)?c>>>0<o>>>0&c>>>0>=n>>>0:0){u[r>>2]=t+a;k=c+8|0;k=(k&7|0)==0?0:0-k&7;M=c+k|0;k=(u[2786]|0)+(a-k)|0;u[2789]=M;u[2786]=k;u[M+4>>2]=k|1;u[M+k+4>>2]=40;u[2790]=u[2905];break}if(o>>>0<(u[2787]|0)>>>0)u[2787]=o;r=o+a|0;e=11580;while(1){if((u[e>>2]|0)==(r|0)){M=153;break}n=u[e+8>>2]|0;if(!n)break;else e=n}if((M|0)==153?(u[e+12>>2]&8|0)==0:0){u[e>>2]=o;s=e+4|0;u[s>>2]=(u[s>>2]|0)+a;s=o+8|0;s=o+((s&7|0)==0?0:0-s&7)|0;e=r+8|0;e=r+((e&7|0)==0?0:0-e&7)|0;l=s+d|0;f=e-s-d|0;u[s+4>>2]=d|3;do{if((e|0)!=(c|0)){if((e|0)==(u[2788]|0)){k=(u[2785]|0)+f|0;u[2785]=k;u[2788]=l;u[l+4>>2]=k|1;u[l+k>>2]=k;break}n=u[e+4>>2]|0;if((n&3|0)==1){a=n&-8;t=n>>>3;n:do{if(n>>>0<256){n=u[e+8>>2]|0;r=u[e+12>>2]|0;if((r|0)==(n|0)){u[2783]=u[2783]&~(1<<t);break}else{u[n+12>>2]=r;u[r+8>>2]=n;break}}else{o=u[e+24>>2]|0;n=u[e+12>>2]|0;do{if((n|0)==(e|0)){t=e+16|0;r=t+4|0;n=u[r>>2]|0;if(!n){n=u[t>>2]|0;if(!n){n=0;break}else r=t}while(1){t=n+20|0;i=u[t>>2]|0;if(i|0){n=i;r=t;continue}t=n+16|0;i=u[t>>2]|0;if(!i)break;else{n=i;r=t}}u[r>>2]=0}else{k=u[e+8>>2]|0;u[k+12>>2]=n;u[n+8>>2]=k}}while(0);if(!o)break;r=u[e+28>>2]|0;t=11436+(r<<2)|0;do{if((e|0)!=(u[t>>2]|0)){u[o+16+(((u[o+16>>2]|0)!=(e|0)&1)<<2)>>2]=n;if(!n)break n}else{u[t>>2]=n;if(n|0)break;u[2784]=u[2784]&~(1<<r);break n}}while(0);u[n+24>>2]=o;r=e+16|0;t=u[r>>2]|0;if(t|0){u[n+16>>2]=t;u[t+24>>2]=n}r=u[r+4>>2]|0;if(!r)break;u[n+20>>2]=r;u[r+24>>2]=n}}while(0);e=e+a|0;i=a+f|0}else i=f;e=e+4|0;u[e>>2]=u[e>>2]&-2;u[l+4>>2]=i|1;u[l+i>>2]=i;e=i>>>3;if(i>>>0<256){r=11172+(e<<1<<2)|0;n=u[2783]|0;e=1<<e;if(!(n&e)){u[2783]=n|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=l;u[e+12>>2]=l;u[l+8>>2]=e;u[l+12>>2]=r;break}e=i>>>8;do{if(!e)e=0;else{if(i>>>0>16777215){e=31;break}M=(e+1048320|0)>>>16&8;k=e<<M;w=(k+520192|0)>>>16&4;k=k<<w;e=(k+245760|0)>>>16&2;e=14-(w|M|e)+(k<<e>>>15)|0;e=i>>>(e+7|0)&1|e<<1}}while(0);t=11436+(e<<2)|0;u[l+28>>2]=e;n=l+16|0;u[n+4>>2]=0;u[n>>2]=0;n=u[2784]|0;r=1<<e;if(!(n&r)){u[2784]=n|r;u[t>>2]=l;u[l+24>>2]=t;u[l+12>>2]=l;u[l+8>>2]=l;break}n=i<<((e|0)==31?0:25-(e>>>1)|0);r=u[t>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(i|0)){M=194;break}t=r+16+(n>>>31<<2)|0;e=u[t>>2]|0;if(!e){M=193;break}else{n=n<<1;r=e}}if((M|0)==193){u[t>>2]=l;u[l+24>>2]=r;u[l+12>>2]=l;u[l+8>>2]=l;break}else if((M|0)==194){M=r+8|0;k=u[M>>2]|0;u[k+12>>2]=l;u[M>>2]=l;u[l+8>>2]=k;u[l+12>>2]=r;u[l+24>>2]=0;break}}else{k=(u[2786]|0)+f|0;u[2786]=k;u[2789]=l;u[l+4>>2]=k|1}}while(0);k=s+8|0;v=g;return k|0}e=11580;while(1){n=u[e>>2]|0;if(n>>>0<=c>>>0?(k=n+(u[e+4>>2]|0)|0,k>>>0>c>>>0):0)break;e=u[e+8>>2]|0}i=k+-47|0;n=i+8|0;n=i+((n&7|0)==0?0:0-n&7)|0;i=c+16|0;n=n>>>0<i>>>0?c:n;e=n+8|0;r=o+8|0;r=(r&7|0)==0?0:0-r&7;M=o+r|0;r=a+-40-r|0;u[2789]=M;u[2786]=r;u[M+4>>2]=r|1;u[M+r+4>>2]=40;u[2790]=u[2905];r=n+4|0;u[r>>2]=27;u[e>>2]=u[2895];u[e+4>>2]=u[2896];u[e+8>>2]=u[2897];u[e+12>>2]=u[2898];u[2895]=o;u[2896]=a;u[2898]=0;u[2897]=e;e=n+24|0;do{M=e;e=e+4|0;u[e>>2]=7}while((M+8|0)>>>0<k>>>0);if((n|0)!=(c|0)){o=n-c|0;u[r>>2]=u[r>>2]&-2;u[c+4>>2]=o|1;u[n>>2]=o;e=o>>>3;if(o>>>0<256){r=11172+(e<<1<<2)|0;n=u[2783]|0;e=1<<e;if(!(n&e)){u[2783]=n|e;e=r;n=r+8|0}else{n=r+8|0;e=u[n>>2]|0}u[n>>2]=c;u[e+12>>2]=c;u[c+8>>2]=e;u[c+12>>2]=r;break}e=o>>>8;if(e){if(o>>>0>16777215)r=31;else{M=(e+1048320|0)>>>16&8;k=e<<M;w=(k+520192|0)>>>16&4;k=k<<w;r=(k+245760|0)>>>16&2;r=14-(w|M|r)+(k<<r>>>15)|0;r=o>>>(r+7|0)&1|r<<1}}else r=0;t=11436+(r<<2)|0;u[c+28>>2]=r;u[c+20>>2]=0;u[i>>2]=0;e=u[2784]|0;n=1<<r;if(!(e&n)){u[2784]=e|n;u[t>>2]=c;u[c+24>>2]=t;u[c+12>>2]=c;u[c+8>>2]=c;break}n=o<<((r|0)==31?0:25-(r>>>1)|0);r=u[t>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(o|0)){M=216;break}t=r+16+(n>>>31<<2)|0;e=u[t>>2]|0;if(!e){M=215;break}else{n=n<<1;r=e}}if((M|0)==215){u[t>>2]=c;u[c+24>>2]=r;u[c+12>>2]=c;u[c+8>>2]=c;break}else if((M|0)==216){M=r+8|0;k=u[M>>2]|0;u[k+12>>2]=c;u[M>>2]=c;u[c+8>>2]=k;u[c+12>>2]=r;u[c+24>>2]=0;break}}}else{k=u[2787]|0;if((k|0)==0|o>>>0<k>>>0)u[2787]=o;u[2895]=o;u[2896]=a;u[2898]=0;u[2792]=u[2901];u[2791]=-1;e=0;do{k=11172+(e<<1<<2)|0;u[k+12>>2]=k;u[k+8>>2]=k;e=e+1|0}while((e|0)!=32);k=o+8|0;k=(k&7|0)==0?0:0-k&7;M=o+k|0;k=a+-40-k|0;u[2789]=M;u[2786]=k;u[M+4>>2]=k|1;u[M+k+4>>2]=40;u[2790]=u[2905]}}while(0);e=u[2786]|0;if(e>>>0>d>>>0){w=e-d|0;u[2786]=w;k=u[2789]|0;M=k+d|0;u[2789]=M;u[M+4>>2]=w|1;u[k+4>>2]=d|3;k=k+8|0;v=g;return k|0}}u[(QS()|0)>>2]=12;k=0;v=g;return k|0}function zS(n){n=n|0;var e=0,r=0,t=0,i=0,o=0,a=0,f=0,c=0;if(!n)return;r=n+-8|0;i=u[2787]|0;n=u[n+-4>>2]|0;e=n&-8;c=r+e|0;do{if(!(n&1)){t=u[r>>2]|0;if(!(n&3))return;a=r+(0-t)|0;o=t+e|0;if(a>>>0<i>>>0)return;if((a|0)==(u[2788]|0)){n=c+4|0;e=u[n>>2]|0;if((e&3|0)!=3){f=a;e=o;break}u[2785]=o;u[n>>2]=e&-2;u[a+4>>2]=o|1;u[a+o>>2]=o;return}r=t>>>3;if(t>>>0<256){n=u[a+8>>2]|0;e=u[a+12>>2]|0;if((e|0)==(n|0)){u[2783]=u[2783]&~(1<<r);f=a;e=o;break}else{u[n+12>>2]=e;u[e+8>>2]=n;f=a;e=o;break}}i=u[a+24>>2]|0;n=u[a+12>>2]|0;do{if((n|0)==(a|0)){r=a+16|0;e=r+4|0;n=u[e>>2]|0;if(!n){n=u[r>>2]|0;if(!n){n=0;break}else e=r}while(1){r=n+20|0;t=u[r>>2]|0;if(t|0){n=t;e=r;continue}r=n+16|0;t=u[r>>2]|0;if(!t)break;else{n=t;e=r}}u[e>>2]=0}else{f=u[a+8>>2]|0;u[f+12>>2]=n;u[n+8>>2]=f}}while(0);if(i){e=u[a+28>>2]|0;r=11436+(e<<2)|0;if((a|0)==(u[r>>2]|0)){u[r>>2]=n;if(!n){u[2784]=u[2784]&~(1<<e);f=a;e=o;break}}else{u[i+16+(((u[i+16>>2]|0)!=(a|0)&1)<<2)>>2]=n;if(!n){f=a;e=o;break}}u[n+24>>2]=i;e=a+16|0;r=u[e>>2]|0;if(r|0){u[n+16>>2]=r;u[r+24>>2]=n}e=u[e+4>>2]|0;if(e){u[n+20>>2]=e;u[e+24>>2]=n;f=a;e=o}else{f=a;e=o}}else{f=a;e=o}}else{f=r;a=r}}while(0);if(a>>>0>=c>>>0)return;n=c+4|0;t=u[n>>2]|0;if(!(t&1))return;if(!(t&2)){n=u[2788]|0;if((c|0)==(u[2789]|0)){c=(u[2786]|0)+e|0;u[2786]=c;u[2789]=f;u[f+4>>2]=c|1;if((f|0)!=(n|0))return;u[2788]=0;u[2785]=0;return}if((c|0)==(n|0)){c=(u[2785]|0)+e|0;u[2785]=c;u[2788]=a;u[f+4>>2]=c|1;u[a+c>>2]=c;return}i=(t&-8)+e|0;r=t>>>3;do{if(t>>>0<256){e=u[c+8>>2]|0;n=u[c+12>>2]|0;if((n|0)==(e|0)){u[2783]=u[2783]&~(1<<r);break}else{u[e+12>>2]=n;u[n+8>>2]=e;break}}else{o=u[c+24>>2]|0;n=u[c+12>>2]|0;do{if((n|0)==(c|0)){r=c+16|0;e=r+4|0;n=u[e>>2]|0;if(!n){n=u[r>>2]|0;if(!n){r=0;break}else e=r}while(1){r=n+20|0;t=u[r>>2]|0;if(t|0){n=t;e=r;continue}r=n+16|0;t=u[r>>2]|0;if(!t)break;else{n=t;e=r}}u[e>>2]=0;r=n}else{r=u[c+8>>2]|0;u[r+12>>2]=n;u[n+8>>2]=r;r=n}}while(0);if(o|0){n=u[c+28>>2]|0;e=11436+(n<<2)|0;if((c|0)==(u[e>>2]|0)){u[e>>2]=r;if(!r){u[2784]=u[2784]&~(1<<n);break}}else{u[o+16+(((u[o+16>>2]|0)!=(c|0)&1)<<2)>>2]=r;if(!r)break}u[r+24>>2]=o;n=c+16|0;e=u[n>>2]|0;if(e|0){u[r+16>>2]=e;u[e+24>>2]=r}n=u[n+4>>2]|0;if(n|0){u[r+20>>2]=n;u[n+24>>2]=r}}}}while(0);u[f+4>>2]=i|1;u[a+i>>2]=i;if((f|0)==(u[2788]|0)){u[2785]=i;return}}else{u[n>>2]=t&-2;u[f+4>>2]=e|1;u[a+e>>2]=e;i=e}n=i>>>3;if(i>>>0<256){r=11172+(n<<1<<2)|0;e=u[2783]|0;n=1<<n;if(!(e&n)){u[2783]=e|n;n=r;e=r+8|0}else{e=r+8|0;n=u[e>>2]|0}u[e>>2]=f;u[n+12>>2]=f;u[f+8>>2]=n;u[f+12>>2]=r;return}n=i>>>8;if(n){if(i>>>0>16777215)n=31;else{a=(n+1048320|0)>>>16&8;c=n<<a;o=(c+520192|0)>>>16&4;c=c<<o;n=(c+245760|0)>>>16&2;n=14-(o|a|n)+(c<<n>>>15)|0;n=i>>>(n+7|0)&1|n<<1}}else n=0;t=11436+(n<<2)|0;u[f+28>>2]=n;u[f+20>>2]=0;u[f+16>>2]=0;e=u[2784]|0;r=1<<n;do{if(e&r){e=i<<((n|0)==31?0:25-(n>>>1)|0);r=u[t>>2]|0;while(1){if((u[r+4>>2]&-8|0)==(i|0)){n=73;break}t=r+16+(e>>>31<<2)|0;n=u[t>>2]|0;if(!n){n=72;break}else{e=e<<1;r=n}}if((n|0)==72){u[t>>2]=f;u[f+24>>2]=r;u[f+12>>2]=f;u[f+8>>2]=f;break}else if((n|0)==73){a=r+8|0;c=u[a>>2]|0;u[c+12>>2]=f;u[a>>2]=f;u[f+8>>2]=c;u[f+12>>2]=r;u[f+24>>2]=0;break}}else{u[2784]=e|r;u[t>>2]=f;u[f+24>>2]=t;u[f+12>>2]=f;u[f+8>>2]=f}}while(0);c=(u[2791]|0)+-1|0;u[2791]=c;if(!c)n=11588;else return;while(1){n=u[n>>2]|0;if(!n)break;else n=n+8|0}u[2791]=-1;return}function GS(){return 11628}function KS(n){n=n|0;var e=0,r=0;e=v;v=v+16|0;r=e;u[r>>2]=eE(u[n+60>>2]|0)|0;n=ZS(ae(6,r|0)|0)|0;v=e;return n|0}function XS(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0;d=v;v=v+48|0;l=d+16|0;o=d;i=d+32|0;f=n+28|0;t=u[f>>2]|0;u[i>>2]=t;c=n+20|0;t=(u[c>>2]|0)-t|0;u[i+4>>2]=t;u[i+8>>2]=e;u[i+12>>2]=r;t=t+r|0;a=n+60|0;u[o>>2]=u[a>>2];u[o+4>>2]=i;u[o+8>>2]=2;o=ZS(le(146,o|0)|0)|0;n:do{if((t|0)!=(o|0)){e=2;while(1){if((o|0)<0)break;t=t-o|0;p=u[i+4>>2]|0;_=o>>>0>p>>>0;i=_?i+8|0:i;e=(_<<31>>31)+e|0;p=o-(_?p:0)|0;u[i>>2]=(u[i>>2]|0)+p;_=i+4|0;u[_>>2]=(u[_>>2]|0)-p;u[l>>2]=u[a>>2];u[l+4>>2]=i;u[l+8>>2]=e;o=ZS(le(146,l|0)|0)|0;if((t|0)==(o|0)){s=3;break n}}u[n+16>>2]=0;u[f>>2]=0;u[c>>2]=0;u[n>>2]=u[n>>2]|32;if((e|0)==2)r=0;else r=r-(u[i+4>>2]|0)|0}else s=3}while(0);if((s|0)==3){p=u[n+44>>2]|0;u[n+16>>2]=p+(u[n+48>>2]|0);u[f>>2]=p;u[c>>2]=p}v=d;return r|0}function JS(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0;i=v;v=v+32|0;o=i;t=i+20|0;u[o>>2]=u[n+60>>2];u[o+4>>2]=0;u[o+8>>2]=e;u[o+12>>2]=t;u[o+16>>2]=r;if((ZS(ce(140,o|0)|0)|0)<0){u[t>>2]=-1;n=-1}else n=u[t>>2]|0;v=i;return n|0}function ZS(n){n=n|0;if(n>>>0>4294963200){u[(QS()|0)>>2]=0-n;n=-1}return n|0}function QS(){return($S()|0)+64|0}function $S(){return nE()|0}function nE(){return 2084}function eE(n){n=n|0;return n|0}function rE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0;o=v;v=v+32|0;i=o;u[n+36>>2]=1;if((u[n>>2]&64|0)==0?(u[i>>2]=u[n+60>>2],u[i+4>>2]=21523,u[i+8>>2]=o+16,Qn(54,i|0)|0):0)t[n+75>>0]=-1;i=XS(n,e,r)|0;v=o;return i|0}function tE(n,e){n=n|0;e=e|0;var r=0,i=0;r=t[n>>0]|0;i=t[e>>0]|0;if(r<<24>>24==0?1:r<<24>>24!=i<<24>>24)n=i;else{do{n=n+1|0;e=e+1|0;r=t[n>>0]|0;i=t[e>>0]|0}while(!(r<<24>>24==0?1:r<<24>>24!=i<<24>>24));n=i}return(r&255)-(n&255)|0}function iE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,u=0;n:do{if(!r)n=0;else{while(1){i=t[n>>0]|0;u=t[e>>0]|0;if(i<<24>>24!=u<<24>>24)break;r=r+-1|0;if(!r){n=0;break n}else{n=n+1|0;e=e+1|0}}n=(i&255)-(u&255)|0}}while(0);return n|0}function uE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0;h=v;v=v+224|0;d=h+120|0;_=h+80|0;m=h;b=h+136|0;i=_;o=i+40|0;do{u[i>>2]=0;i=i+4|0}while((i|0)<(o|0));u[d>>2]=u[r>>2];if((oE(0,e,d,m,_)|0)<0)r=-1;else{if((u[n+76>>2]|0)>-1)p=aE(n)|0;else p=0;r=u[n>>2]|0;s=r&32;if((t[n+74>>0]|0)<1)u[n>>2]=r&-33;i=n+48|0;if(!(u[i>>2]|0)){o=n+44|0;a=u[o>>2]|0;u[o>>2]=b;f=n+28|0;u[f>>2]=b;c=n+20|0;u[c>>2]=b;u[i>>2]=80;l=n+16|0;u[l>>2]=b+80;r=oE(n,e,d,m,_)|0;if(a){yL[u[n+36>>2]&7](n,0,0)|0;r=(u[c>>2]|0)==0?-1:r;u[o>>2]=a;u[i>>2]=0;u[l>>2]=0;u[f>>2]=0;u[c>>2]=0}}else r=oE(n,e,d,m,_)|0;i=u[n>>2]|0;u[n>>2]=i|s;if(p|0)fE(n);r=(i&32|0)==0?r:-1}v=h;return r|0}function oE(n,e,r,o,a){n=n|0;e=e|0;r=r|0;o=o|0;a=a|0;var f=0,c=0,s=0,d=0,_=0,p=0,m=0,b=0,h=0,y=0,w=0,M=0,k=0,g=0,T=0,A=0,S=0,E=0,C=0,R=0,P=0,B=0,O=0;O=v;v=v+64|0;C=O+16|0;R=O;S=O+24|0;P=O+8|0;B=O+20|0;u[C>>2]=e;g=(n|0)!=0;T=S+40|0;A=T;S=S+39|0;E=P+4|0;c=0;f=0;p=0;n:while(1){do{if((f|0)>-1)if((c|0)>(2147483647-f|0)){u[(QS()|0)>>2]=75;f=-1;break}else{f=c+f|0;break}}while(0);c=t[e>>0]|0;if(!(c<<24>>24)){k=87;break}else s=e;e:while(1){switch(c<<24>>24){case 37:{c=s;k=9;break e}case 0:{c=s;break e}default:{}}M=s+1|0;u[C>>2]=M;c=t[M>>0]|0;s=M}e:do{if((k|0)==9)while(1){k=0;if((t[s+1>>0]|0)!=37)break e;c=c+1|0;s=s+2|0;u[C>>2]=s;if((t[s>>0]|0)==37)k=9;else break}}while(0);c=c-e|0;if(g)cE(n,e,c);if(c|0){e=s;continue}d=s+1|0;c=(t[d>>0]|0)+-48|0;if(c>>>0<10){M=(t[s+2>>0]|0)==36;w=M?c:-1;p=M?1:p;d=M?s+3|0:d}else w=-1;u[C>>2]=d;c=t[d>>0]|0;s=(c<<24>>24)+-32|0;e:do{if(s>>>0<32){_=0;m=c;while(1){c=1<<s;if(!(c&75913)){c=m;break e}_=c|_;d=d+1|0;u[C>>2]=d;c=t[d>>0]|0;s=(c<<24>>24)+-32|0;if(s>>>0>=32)break;else m=c}}else _=0}while(0);if(c<<24>>24==42){s=d+1|0;c=(t[s>>0]|0)+-48|0;if(c>>>0<10?(t[d+2>>0]|0)==36:0){u[a+(c<<2)>>2]=10;c=u[o+((t[s>>0]|0)+-48<<3)>>2]|0;p=1;d=d+3|0}else{if(p|0){f=-1;break}if(g){p=(u[r>>2]|0)+(4-1)&~(4-1);c=u[p>>2]|0;u[r>>2]=p+4;p=0;d=s}else{c=0;p=0;d=s}}u[C>>2]=d;M=(c|0)<0;c=M?0-c|0:c;_=M?_|8192:_}else{c=lE(C)|0;if((c|0)<0){f=-1;break}d=u[C>>2]|0}do{if((t[d>>0]|0)==46){if((t[d+1>>0]|0)!=42){u[C>>2]=d+1;s=lE(C)|0;d=u[C>>2]|0;break}m=d+2|0;s=(t[m>>0]|0)+-48|0;if(s>>>0<10?(t[d+3>>0]|0)==36:0){u[a+(s<<2)>>2]=10;s=u[o+((t[m>>0]|0)+-48<<3)>>2]|0;d=d+4|0;u[C>>2]=d;break}if(p|0){f=-1;break n}if(g){M=(u[r>>2]|0)+(4-1)&~(4-1);s=u[M>>2]|0;u[r>>2]=M+4}else s=0;u[C>>2]=m;d=m}else s=-1}while(0);y=0;while(1){if(((t[d>>0]|0)+-65|0)>>>0>57){f=-1;break n}M=d+1|0;u[C>>2]=M;m=t[(t[d>>0]|0)+-65+(5178+(y*58|0))>>0]|0;b=m&255;if((b+-1|0)>>>0<8){y=b;d=M}else break}if(!(m<<24>>24)){f=-1;break}h=(w|0)>-1;do{if(m<<24>>24==19){if(h){f=-1;break n}else k=49}else{if(h){u[a+(w<<2)>>2]=b;h=o+(w<<3)|0;w=u[h+4>>2]|0;k=R;u[k>>2]=u[h>>2];u[k+4>>2]=w;k=49;break}if(!g){f=0;break n}sE(R,b,r)}}while(0);if((k|0)==49?(k=0,!g):0){c=0;e=M;continue}d=t[d>>0]|0;d=(y|0)!=0&(d&15|0)==3?d&-33:d;h=_&-65537;w=(_&8192|0)==0?_:h;e:do{switch(d|0){case 110:switch((y&255)<<24>>24){case 0:{u[u[R>>2]>>2]=f;c=0;e=M;continue n}case 1:{u[u[R>>2]>>2]=f;c=0;e=M;continue n}case 2:{c=u[R>>2]|0;u[c>>2]=f;u[c+4>>2]=((f|0)<0)<<31>>31;c=0;e=M;continue n}case 3:{i[u[R>>2]>>1]=f;c=0;e=M;continue n}case 4:{t[u[R>>2]>>0]=f;c=0;e=M;continue n}case 6:{u[u[R>>2]>>2]=f;c=0;e=M;continue n}case 7:{c=u[R>>2]|0;u[c>>2]=f;u[c+4>>2]=((f|0)<0)<<31>>31;c=0;e=M;continue n}default:{c=0;e=M;continue n}}case 112:{d=120;s=s>>>0>8?s:8;e=w|8;k=61;break}case 88:case 120:{e=w;k=61;break}case 111:{d=R;e=u[d>>2]|0;d=u[d+4>>2]|0;b=_E(e,d,T)|0;h=A-b|0;_=0;m=5642;s=(w&8|0)==0|(s|0)>(h|0)?s:h+1|0;h=w;k=67;break}case 105:case 100:{d=R;e=u[d>>2]|0;d=u[d+4>>2]|0;if((d|0)<0){e=$E(0,0,e|0,d|0)|0;d=L;_=R;u[_>>2]=e;u[_+4>>2]=d;_=1;m=5642;k=66;break e}else{_=(w&2049|0)!=0&1;m=(w&2048|0)==0?(w&1|0)==0?5642:5644:5643;k=66;break e}}case 117:{d=R;_=0;m=5642;e=u[d>>2]|0;d=u[d+4>>2]|0;k=66;break}case 99:{t[S>>0]=u[R>>2];e=S;_=0;m=5642;b=T;d=1;s=h;break}case 109:{d=pE(u[(QS()|0)>>2]|0)|0;k=71;break}case 115:{d=u[R>>2]|0;d=d|0?d:5652;k=71;break}case 67:{u[P>>2]=u[R>>2];u[E>>2]=0;u[R>>2]=P;b=-1;d=P;k=75;break}case 83:{e=u[R>>2]|0;if(!s){bE(n,32,c,0,w);e=0;k=84}else{b=s;d=e;k=75}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=yE(n,+l[R>>3],c,s,w,d)|0;e=M;continue n}default:{_=0;m=5642;b=T;d=s;s=w}}}while(0);e:do{if((k|0)==61){w=R;y=u[w>>2]|0;w=u[w+4>>2]|0;b=dE(y,w,T,d&32)|0;m=(e&8|0)==0|(y|0)==0&(w|0)==0;_=m?0:2;m=m?5642:5642+(d>>4)|0;h=e;e=y;d=w;k=67}else if((k|0)==66){b=vE(e,d,T)|0;h=w;k=67}else if((k|0)==71){k=0;w=mE(d,0,s)|0;y=(w|0)==0;e=d;_=0;m=5642;b=y?d+s|0:w;d=y?s:w-d|0;s=h}else if((k|0)==75){k=0;m=d;e=0;s=0;while(1){_=u[m>>2]|0;if(!_)break;s=hE(B,_)|0;if((s|0)<0|s>>>0>(b-e|0)>>>0)break;e=s+e|0;if(b>>>0>e>>>0)m=m+4|0;else break}if((s|0)<0){f=-1;break n}bE(n,32,c,e,w);if(!e){e=0;k=84}else{_=0;while(1){s=u[d>>2]|0;if(!s){k=84;break e}s=hE(B,s)|0;_=s+_|0;if((_|0)>(e|0)){k=84;break e}cE(n,B,s);if(_>>>0>=e>>>0){k=84;break}else d=d+4|0}}}}while(0);if((k|0)==67){k=0;d=(e|0)!=0|(d|0)!=0;w=(s|0)!=0|d;d=((d^1)&1)+(A-b)|0;e=w?b:T;b=T;d=w?(s|0)>(d|0)?s:d:s;s=(s|0)>-1?h&-65537:h}else if((k|0)==84){k=0;bE(n,32,c,e,w^8192);c=(c|0)>(e|0)?c:e;e=M;continue}y=b-e|0;h=(d|0)<(y|0)?y:d;w=h+_|0;c=(c|0)<(w|0)?w:c;bE(n,32,c,w,s);cE(n,m,_);bE(n,48,c,w,s^65536);bE(n,48,h,y,0);cE(n,e,y);bE(n,32,c,w,s^8192);e=M}n:do{if((k|0)==87)if(!n)if(!p)f=0;else{f=1;while(1){e=u[a+(f<<2)>>2]|0;if(!e)break;sE(o+(f<<3)|0,e,r);f=f+1|0;if((f|0)>=10){f=1;break n}}while(1){if(u[a+(f<<2)>>2]|0){f=-1;break n}f=f+1|0;if((f|0)>=10){f=1;break}}}}while(0);v=O;return f|0}function aE(n){n=n|0;return 0}function fE(n){n=n|0;return}function cE(n,e,r){n=n|0;e=e|0;r=r|0;if(!(u[n>>2]&32))PE(e,r,n)|0;return}function lE(n){n=n|0;var e=0,r=0,i=0;r=u[n>>2]|0;i=(t[r>>0]|0)+-48|0;if(i>>>0<10){e=0;do{e=i+(e*10|0)|0;r=r+1|0;u[n>>2]=r;i=(t[r>>0]|0)+-48|0}while(i>>>0<10)}else e=0;return e|0}function sE(n,e,r){n=n|0;e=e|0;r=r|0;var t=0,i=0,o=0.0;n:do{if(e>>>0<=20)do{switch(e|0){case 9:{t=(u[r>>2]|0)+(4-1)&~(4-1);e=u[t>>2]|0;u[r>>2]=t+4;u[n>>2]=e;break n}case 10:{t=(u[r>>2]|0)+(4-1)&~(4-1);e=u[t>>2]|0;u[r>>2]=t+4;t=n;u[t>>2]=e;u[t+4>>2]=((e|0)<0)<<31>>31;break n}case 11:{t=(u[r>>2]|0)+(4-1)&~(4-1);e=u[t>>2]|0;u[r>>2]=t+4;t=n;u[t>>2]=e;u[t+4>>2]=0;break n}case 12:{t=(u[r>>2]|0)+(8-1)&~(8-1);e=t;i=u[e>>2]|0;e=u[e+4>>2]|0;u[r>>2]=t+8;t=n;u[t>>2]=i;u[t+4>>2]=e;break n}case 13:{i=(u[r>>2]|0)+(4-1)&~(4-1);t=u[i>>2]|0;u[r>>2]=i+4;t=(t&65535)<<16>>16;i=n;u[i>>2]=t;u[i+4>>2]=((t|0)<0)<<31>>31;break n}case 14:{i=(u[r>>2]|0)+(4-1)&~(4-1);t=u[i>>2]|0;u[r>>2]=i+4;i=n;u[i>>2]=t&65535;u[i+4>>2]=0;break n}case 15:{i=(u[r>>2]|0)+(4-1)&~(4-1);t=u[i>>2]|0;u[r>>2]=i+4;t=(t&255)<<24>>24;i=n;u[i>>2]=t;u[i+4>>2]=((t|0)<0)<<31>>31;break n}case 16:{i=(u[r>>2]|0)+(4-1)&~(4-1);t=u[i>>2]|0;u[r>>2]=i+4;i=n;u[i>>2]=t&255;u[i+4>>2]=0;break n}case 17:{i=(u[r>>2]|0)+(8-1)&~(8-1);o=+l[i>>3];u[r>>2]=i+8;l[n>>3]=o;break n}case 18:{i=(u[r>>2]|0)+(8-1)&~(8-1);o=+l[i>>3];u[r>>2]=i+8;l[n>>3]=o;break n}default:break n}}while(0)}while(0);return}function dE(n,e,r,i){n=n|0;e=e|0;r=r|0;i=i|0;if(!((n|0)==0&(e|0)==0))do{r=r+-1|0;t[r>>0]=o[5694+(n&15)>>0]|0|i;n=tC(n|0,e|0,4)|0;e=L}while(!((n|0)==0&(e|0)==0));return r|0}function _E(n,e,r){n=n|0;e=e|0;r=r|0;if(!((n|0)==0&(e|0)==0))do{r=r+-1|0;t[r>>0]=n&7|48;n=tC(n|0,e|0,3)|0;e=L}while(!((n|0)==0&(e|0)==0));return r|0}function vE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0;if(e>>>0>0|(e|0)==0&n>>>0>4294967295){while(1){i=lC(n|0,e|0,10,0)|0;r=r+-1|0;t[r>>0]=i&255|48;i=n;n=aC(n|0,e|0,10,0)|0;if(!(e>>>0>9|(e|0)==9&i>>>0>4294967295))break;else e=L}e=n}else e=n;if(e)while(1){r=r+-1|0;t[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function pE(n){n=n|0;return SE(n,u[(AE()|0)+188>>2]|0)|0}function mE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0;a=e&255;i=(r|0)!=0;n:do{if(i&(n&3|0)!=0){o=e&255;while(1){if((t[n>>0]|0)==o<<24>>24){f=6;break n}n=n+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(n&3|0)!=0)){f=5;break}}}else f=5}while(0);if((f|0)==5)if(i)f=6;else r=0;n:do{if((f|0)==6){o=e&255;if((t[n>>0]|0)!=o<<24>>24){i=j(a,16843009)|0;e:do{if(r>>>0>3)while(1){a=u[n>>2]^i;if((a&-2139062144^-2139062144)&a+-16843009|0)break;n=n+4|0;r=r+-4|0;if(r>>>0<=3){f=11;break e}}else f=11}while(0);if((f|0)==11)if(!r){r=0;break}while(1){if((t[n>>0]|0)==o<<24>>24)break n;n=n+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return(r|0?n:0)|0}function bE(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var u=0,o=0;o=v;v=v+256|0;u=o;if((r|0)>(t|0)&(i&73728|0)==0){i=r-t|0;eC(u|0,e|0,(i>>>0<256?i:256)|0)|0;if(i>>>0>255){e=r-t|0;do{cE(n,u,256);i=i+-256|0}while(i>>>0>255);i=e&255}cE(n,u,i)}v=o;return}function hE(n,e){n=n|0;e=e|0;if(!n)n=0;else n=gE(n,e,0)|0;return n|0}function yE(n,e,r,i,a,f){n=n|0;e=+e;r=r|0;i=i|0;a=a|0;f=f|0;var c=0,l=0,s=0,d=0,_=0,p=0,m=0,b=0.0,h=0,y=0,w=0,M=0,k=0,g=0,T=0,A=0,S=0,E=0,C=0,R=0,P=0,B=0,O=0;O=v;v=v+560|0;s=O+8|0;w=O;B=O+524|0;P=B;d=O+512|0;u[w>>2]=0;R=d+12|0;wE(e)|0;if((L|0)<0){e=-e;E=1;S=5659}else{E=(a&2049|0)!=0&1;S=(a&2048|0)==0?(a&1|0)==0?5660:5665:5662}wE(e)|0;C=L&2146435072;do{if(C>>>0<2146435072|(C|0)==2146435072&0<0){b=+ME(e,w)*2.0;c=b!=0.0;if(c)u[w>>2]=(u[w>>2]|0)+-1;k=f|32;if((k|0)==97){h=f&32;m=(h|0)==0?S:S+9|0;p=E|2;c=12-i|0;do{if(!(i>>>0>11|(c|0)==0)){e=8.0;do{c=c+-1|0;e=e*16.0}while((c|0)!=0);if((t[m>>0]|0)==45){e=-(e+(-b-e));break}else{e=b+e-e;break}}else e=b}while(0);l=u[w>>2]|0;c=(l|0)<0?0-l|0:l;c=vE(c,((c|0)<0)<<31>>31,R)|0;if((c|0)==(R|0)){c=d+11|0;t[c>>0]=48}t[c+-1>>0]=(l>>31&2)+43;_=c+-2|0;t[_>>0]=f+15;d=(i|0)<1;s=(a&8|0)==0;c=B;do{C=~~e;l=c+1|0;t[c>>0]=o[5694+C>>0]|h;e=(e-+(C|0))*16.0;if((l-P|0)==1?!(s&(d&e==0.0)):0){t[l>>0]=46;c=c+2|0}else c=l}while(e!=0.0);C=c-P|0;P=R-_|0;R=(i|0)!=0&(C+-2|0)<(i|0)?i+2|0:C;c=P+p+R|0;bE(n,32,r,c,a);cE(n,m,p);bE(n,48,r,c,a^65536);cE(n,B,C);bE(n,48,R-C|0,0,0);cE(n,_,P);bE(n,32,r,c,a^8192);break}l=(i|0)<0?6:i;if(c){c=(u[w>>2]|0)+-28|0;u[w>>2]=c;e=b*268435456.0}else{e=b;c=u[w>>2]|0}C=(c|0)<0?s:s+288|0;s=C;do{T=~~e>>>0;u[s>>2]=T;s=s+4|0;e=(e-+(T>>>0))*1.0e9}while(e!=0.0);if((c|0)>0){d=C;p=s;while(1){_=(c|0)<29?c:29;c=p+-4|0;if(c>>>0>=d>>>0){s=0;do{g=rC(u[c>>2]|0,0,_|0)|0;g=nC(g|0,L|0,s|0,0)|0;T=L;M=lC(g|0,T|0,1e9,0)|0;u[c>>2]=M;s=aC(g|0,T|0,1e9,0)|0;c=c+-4|0}while(c>>>0>=d>>>0);if(s){d=d+-4|0;u[d>>2]=s}}s=p;while(1){if(s>>>0<=d>>>0)break;c=s+-4|0;if(!(u[c>>2]|0))s=c;else break}c=(u[w>>2]|0)-_|0;u[w>>2]=c;if((c|0)>0)p=s;else break}}else d=C;if((c|0)<0){i=((l+25|0)/9|0)+1|0;y=(k|0)==102;do{h=0-c|0;h=(h|0)<9?h:9;if(d>>>0<s>>>0){_=(1<<h)+-1|0;p=1e9>>>h;m=0;c=d;do{T=u[c>>2]|0;u[c>>2]=(T>>>h)+m;m=j(T&_,p)|0;c=c+4|0}while(c>>>0<s>>>0);c=(u[d>>2]|0)==0?d+4|0:d;if(!m){d=c;c=s}else{u[s>>2]=m;d=c;c=s+4|0}}else{d=(u[d>>2]|0)==0?d+4|0:d;c=s}s=y?C:d;s=(c-s>>2|0)>(i|0)?s+(i<<2)|0:c;c=(u[w>>2]|0)+h|0;u[w>>2]=c}while((c|0)<0);c=d;i=s}else{c=d;i=s}T=C;if(c>>>0<i>>>0){s=(T-c>>2)*9|0;_=u[c>>2]|0;if(_>>>0>=10){d=10;do{d=d*10|0;s=s+1|0}while(_>>>0>=d>>>0)}}else s=0;y=(k|0)==103;M=(l|0)!=0;d=l-((k|0)!=102?s:0)+((M&y)<<31>>31)|0;if((d|0)<(((i-T>>2)*9|0)+-9|0)){d=d+9216|0;h=C+4+(((d|0)/9|0)+-1024<<2)|0;d=((d|0)%9|0)+1|0;if((d|0)<9){_=10;do{_=_*10|0;d=d+1|0}while((d|0)!=9)}else _=10;p=u[h>>2]|0;m=(p>>>0)%(_>>>0)|0;d=(h+4|0)==(i|0);if(!(d&(m|0)==0)){b=(((p>>>0)/(_>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;g=(_|0)/2|0;e=m>>>0<g>>>0?.5:d&(m|0)==(g|0)?1.0:1.5;if(E){g=(t[S>>0]|0)==45;e=g?-e:e;b=g?-b:b}d=p-m|0;u[h>>2]=d;if(b+e!=b){g=d+_|0;u[h>>2]=g;if(g>>>0>999999999){s=h;while(1){d=s+-4|0;u[s>>2]=0;if(d>>>0<c>>>0){c=c+-4|0;u[c>>2]=0}g=(u[d>>2]|0)+1|0;u[d>>2]=g;if(g>>>0>999999999)s=d;else break}}else d=h;s=(T-c>>2)*9|0;p=u[c>>2]|0;if(p>>>0>=10){_=10;do{_=_*10|0;s=s+1|0}while(p>>>0>=_>>>0)}}else d=h}else d=h;d=d+4|0;d=i>>>0>d>>>0?d:i;g=c}else{d=i;g=c}k=d;while(1){if(k>>>0<=g>>>0){w=0;break}c=k+-4|0;if(!(u[c>>2]|0))k=c;else{w=1;break}}i=0-s|0;do{if(y){c=((M^1)&1)+l|0;if((c|0)>(s|0)&(s|0)>-5){_=f+-1|0;l=c+-1-s|0}else{_=f+-2|0;l=c+-1|0}c=a&8;if(!c){if(w?(A=u[k+-4>>2]|0,(A|0)!=0):0){if(!((A>>>0)%10|0)){d=0;c=10;do{c=c*10|0;d=d+1|0}while(!((A>>>0)%(c>>>0)|0|0))}else d=0}else d=9;c=((k-T>>2)*9|0)+-9|0;if((_|32|0)==102){h=c-d|0;h=(h|0)>0?h:0;l=(l|0)<(h|0)?l:h;h=0;break}else{h=c+s-d|0;h=(h|0)>0?h:0;l=(l|0)<(h|0)?l:h;h=0;break}}else h=c}else{_=f;h=a&8}}while(0);y=l|h;p=(y|0)!=0&1;m=(_|32|0)==102;if(m){M=0;c=(s|0)>0?s:0}else{c=(s|0)<0?i:s;c=vE(c,((c|0)<0)<<31>>31,R)|0;d=R;if((d-c|0)<2)do{c=c+-1|0;t[c>>0]=48}while((d-c|0)<2);t[c+-1>>0]=(s>>31&2)+43;c=c+-2|0;t[c>>0]=_;M=c;c=d-c|0}c=E+1+l+p+c|0;bE(n,32,r,c,a);cE(n,S,E);bE(n,48,r,c,a^65536);if(m){_=g>>>0>C>>>0?C:g;h=B+9|0;p=h;m=B+8|0;d=_;do{s=vE(u[d>>2]|0,0,h)|0;if((d|0)==(_|0)){if((s|0)==(h|0)){t[m>>0]=48;s=m}}else if(s>>>0>B>>>0){eC(B|0,48,s-P|0)|0;do{s=s+-1|0}while(s>>>0>B>>>0)}cE(n,s,p-s|0);d=d+4|0}while(d>>>0<=C>>>0);if(y|0)cE(n,5710,1);if(d>>>0<k>>>0&(l|0)>0)while(1){s=vE(u[d>>2]|0,0,h)|0;if(s>>>0>B>>>0){eC(B|0,48,s-P|0)|0;do{s=s+-1|0}while(s>>>0>B>>>0)}cE(n,s,(l|0)<9?l:9);d=d+4|0;s=l+-9|0;if(!(d>>>0<k>>>0&(l|0)>9)){l=s;break}else l=s}bE(n,48,l+9|0,9,0)}else{y=w?k:g+4|0;if((l|0)>-1){w=B+9|0;h=(h|0)==0;i=w;p=0-P|0;m=B+8|0;_=g;do{s=vE(u[_>>2]|0,0,w)|0;if((s|0)==(w|0)){t[m>>0]=48;s=m}do{if((_|0)==(g|0)){d=s+1|0;cE(n,s,1);if(h&(l|0)<1){s=d;break}cE(n,5710,1);s=d}else{if(s>>>0<=B>>>0)break;eC(B|0,48,s+p|0)|0;do{s=s+-1|0}while(s>>>0>B>>>0)}}while(0);P=i-s|0;cE(n,s,(l|0)>(P|0)?P:l);l=l-P|0;_=_+4|0}while(_>>>0<y>>>0&(l|0)>-1)}bE(n,48,l+18|0,18,0);cE(n,M,R-M|0)}bE(n,32,r,c,a^8192)}else{B=(f&32|0)!=0;c=E+3|0;bE(n,32,r,c,a&-65537);cE(n,S,E);cE(n,e!=e|0.0!=0.0?B?5686:5690:B?5678:5682,3);bE(n,32,r,c,a^8192)}}while(0);v=O;return((c|0)<(r|0)?r:c)|0}function wE(n){n=+n;var e=0;l[d>>3]=n;e=u[d>>2]|0;L=u[d+4>>2]|0;return e|0}function ME(n,e){n=+n;e=e|0;return+ +kE(n,e)}function kE(n,e){n=+n;e=e|0;var r=0,t=0,i=0;l[d>>3]=n;r=u[d>>2]|0;t=u[d+4>>2]|0;i=tC(r|0,t|0,52)|0;switch(i&2047){case 0:{if(n!=0.0){n=+kE(n*18446744073709551616.0,e);r=(u[e>>2]|0)+-64|0}else r=0;u[e>>2]=r;break}case 2047:break;default:{u[e>>2]=(i&2047)+-1022;u[d>>2]=r;u[d+4>>2]=t&-2146435073|1071644672;n=+l[d>>3]}}return+n}function gE(n,e,r){n=n|0;e=e|0;r=r|0;do{if(n){if(e>>>0<128){t[n>>0]=e;n=1;break}if(!(u[u[(TE()|0)+188>>2]>>2]|0))if((e&-128|0)==57216){t[n>>0]=e;n=1;break}else{u[(QS()|0)>>2]=84;n=-1;break}if(e>>>0<2048){t[n>>0]=e>>>6|192;t[n+1>>0]=e&63|128;n=2;break}if(e>>>0<55296|(e&-8192|0)==57344){t[n>>0]=e>>>12|224;t[n+1>>0]=e>>>6&63|128;t[n+2>>0]=e&63|128;n=3;break}if((e+-65536|0)>>>0<1048576){t[n>>0]=e>>>18|240;t[n+1>>0]=e>>>12&63|128;t[n+2>>0]=e>>>6&63|128;t[n+3>>0]=e&63|128;n=4;break}else{u[(QS()|0)>>2]=84;n=-1;break}}else n=1}while(0);return n|0}function TE(){return nE()|0}function AE(){return nE()|0}function SE(n,e){n=n|0;e=e|0;var r=0,i=0;i=0;while(1){if((o[5712+i>>0]|0)==(n|0)){n=2;break}r=i+1|0;if((r|0)==87){r=5800;i=87;n=5;break}else i=r}if((n|0)==2)if(!i)r=5800;else{r=5800;n=5}if((n|0)==5)while(1){do{n=r;r=r+1|0}while((t[n>>0]|0)!=0);i=i+-1|0;if(!i)break;else n=5}return EE(r,u[e+20>>2]|0)|0}function EE(n,e){n=n|0;e=e|0;return CE(n,e)|0}function CE(n,e){n=n|0;e=e|0;if(!e)e=0;else e=LE(u[e>>2]|0,u[e+4>>2]|0,n)|0;return(e|0?e:n)|0}function LE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,v=0;v=(u[n>>2]|0)+1794895138|0;a=RE(u[n+8>>2]|0,v)|0;i=RE(u[n+12>>2]|0,v)|0;o=RE(u[n+16>>2]|0,v)|0;n:do{if((a>>>0<e>>>2>>>0?(_=e-(a<<2)|0,i>>>0<_>>>0&o>>>0<_>>>0):0)?((o|i)&3|0)==0:0){_=i>>>2;d=o>>>2;s=0;while(1){c=a>>>1;l=s+c|0;f=l<<1;o=f+_|0;i=RE(u[n+(o<<2)>>2]|0,v)|0;o=RE(u[n+(o+1<<2)>>2]|0,v)|0;if(!(o>>>0<e>>>0&i>>>0<(e-o|0)>>>0)){i=0;break n}if(t[n+(o+i)>>0]|0){i=0;break n}i=tE(r,n+o|0)|0;if(!i)break;i=(i|0)<0;if((a|0)==1){i=0;break n}else{s=i?s:l;a=i?c:a-c|0}}i=f+d|0;o=RE(u[n+(i<<2)>>2]|0,v)|0;i=RE(u[n+(i+1<<2)>>2]|0,v)|0;if(i>>>0<e>>>0&o>>>0<(e-i|0)>>>0)i=(t[n+(i+o)>>0]|0)==0?n+i|0:0;else i=0}else i=0}while(0);return i|0}function RE(n,e){n=n|0;e=e|0;var r=0;r=sC(n|0)|0;return((e|0)==0?n:r)|0}function PE(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0,c=0;i=r+16|0;o=u[i>>2]|0;if(!o){if(!(BE(r)|0)){o=u[i>>2]|0;a=5}else i=0}else a=5;n:do{if((a|0)==5){c=r+20|0;f=u[c>>2]|0;i=f;if((o-f|0)>>>0<e>>>0){i=yL[u[r+36>>2]&7](r,n,e)|0;break}e:do{if((t[r+75>>0]|0)>-1){f=e;while(1){if(!f){a=0;o=n;break e}o=f+-1|0;if((t[n+o>>0]|0)==10)break;else f=o}i=yL[u[r+36>>2]&7](r,n,f)|0;if(i>>>0<f>>>0)break n;a=f;o=n+f|0;e=e-f|0;i=u[c>>2]|0}else{a=0;o=n}}while(0);iC(i|0,o|0,e|0)|0;u[c>>2]=(u[c>>2]|0)+e;i=a+e|0}}while(0);return i|0}function BE(n){n=n|0;var e=0,r=0;e=n+74|0;r=t[e>>0]|0;t[e>>0]=r+255|r;e=u[n>>2]|0;if(!(e&8)){u[n+8>>2]=0;u[n+4>>2]=0;r=u[n+44>>2]|0;u[n+28>>2]=r;u[n+20>>2]=r;u[n+16>>2]=r+(u[n+48>>2]|0);n=0}else{u[n>>2]=e|32;n=-1}return n|0}function OE(n,e){n=K(n);e=K(e);var r=0,t=0;r=NE(n)|0;do{if((r&2147483647)>>>0<=2139095040){t=NE(e)|0;if((t&2147483647)>>>0<=2139095040)if((t^r|0)<0){n=(r|0)<0?e:n;break}else{n=n<e?e:n;break}}else n=e}while(0);return K(n)}function NE(n){n=K(n);return(c[d>>2]=n,u[d>>2]|0)|0}function IE(n,e){n=K(n);e=K(e);var r=0,t=0;r=FE(n)|0;do{if((r&2147483647)>>>0<=2139095040){t=FE(e)|0;if((t&2147483647)>>>0<=2139095040)if((t^r|0)<0){n=(r|0)<0?n:e;break}else{n=n<e?n:e;break}}else n=e}while(0);return K(n)}function FE(n){n=K(n);return(c[d>>2]=n,u[d>>2]|0)|0}function xE(n,e){n=K(n);e=K(e);var r=0,t=0,i=0,o=0,a=0,f=0,l=0,s=0;o=(c[d>>2]=n,u[d>>2]|0);f=(c[d>>2]=e,u[d>>2]|0);r=o>>>23&255;a=f>>>23&255;l=o&-2147483648;i=f<<1;n:do{if((i|0)!=0?!((r|0)==255|((UE(e)|0)&2147483647)>>>0>2139095040):0){t=o<<1;if(t>>>0<=i>>>0){e=K(n*K(0.0));return K((t|0)==(i|0)?e:n)}if(!r){r=o<<9;if((r|0)>-1){t=r;r=0;do{r=r+-1|0;t=t<<1}while((t|0)>-1)}else r=0;t=o<<1-r}else t=o&8388607|8388608;if(!a){o=f<<9;if((o|0)>-1){i=0;do{i=i+-1|0;o=o<<1}while((o|0)>-1)}else i=0;a=i;f=f<<1-i}else f=f&8388607|8388608;i=t-f|0;o=(i|0)>-1;e:do{if((r|0)>(a|0)){while(1){if(o)if(!i)break;else t=i;t=t<<1;r=r+-1|0;i=t-f|0;o=(i|0)>-1;if((r|0)<=(a|0))break e}e=K(n*K(0.0));break n}}while(0);if(o)if(!i){e=K(n*K(0.0));break}else t=i;if(t>>>0<8388608)do{t=t<<1;r=r+-1|0}while(t>>>0<8388608);if((r|0)>0)r=t+-8388608|r<<23;else r=t>>>(1-r|0);e=(u[d>>2]=r|l,K(c[d>>2]))}else s=3}while(0);if((s|0)==3){e=K(n*e);e=K(e/e)}return K(e)}function UE(n){n=K(n);return(c[d>>2]=n,u[d>>2]|0)|0}function HE(n,e){n=n|0;e=e|0;return uE(u[582]|0,n,e)|0}function DE(n){n=n|0;Xn()}function WE(n){n=n|0;return}function YE(n,e){n=n|0;e=e|0;return 0}function VE(n){n=n|0;if((jE(n+4|0)|0)==-1){vL[u[(u[n>>2]|0)+8>>2]&127](n);n=1}else n=0;return n|0}function jE(n){n=n|0;var e=0;e=u[n>>2]|0;u[n>>2]=e+-1;return e+-1|0}function qE(n){n=n|0;if(VE(n)|0)zE(n);return}function zE(n){n=n|0;var e=0;e=n+8|0;if(!((u[e>>2]|0)!=0?(jE(e)|0)!=-1:0))vL[u[(u[n>>2]|0)+16>>2]&127](n);return}function GE(n){n=n|0;var e=0;e=(n|0)==0?1:n;while(1){n=qS(e)|0;if(n|0)break;n=ZE()|0;if(!n){n=0;break}BL[n&0]()}return n|0}function KE(n){n=n|0;return GE(n)|0}function XE(n){n=n|0;zS(n);return}function JE(n){n=n|0;if((t[n+11>>0]|0)<0)XE(u[n>>2]|0);return}function ZE(){var n=0;n=u[2923]|0;u[2923]=n+0;return n|0}function QE(){}function $E(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;t=e-t-(r>>>0>n>>>0|0)>>>0;return(L=t,n-r>>>0|0)|0}function nC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;r=n+r>>>0;return(L=e+t+(r>>>0<n>>>0|0)>>>0,r|0)|0}function eC(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0,f=0;a=n+r|0;e=e&255;if((r|0)>=67){while(n&3){t[n>>0]=e;n=n+1|0}i=a&-4|0;o=i-64|0;f=e|e<<8|e<<16|e<<24;while((n|0)<=(o|0)){u[n>>2]=f;u[n+4>>2]=f;u[n+8>>2]=f;u[n+12>>2]=f;u[n+16>>2]=f;u[n+20>>2]=f;u[n+24>>2]=f;u[n+28>>2]=f;u[n+32>>2]=f;u[n+36>>2]=f;u[n+40>>2]=f;u[n+44>>2]=f;u[n+48>>2]=f;u[n+52>>2]=f;u[n+56>>2]=f;u[n+60>>2]=f;n=n+64|0}while((n|0)<(i|0)){u[n>>2]=f;n=n+4|0}}while((n|0)<(a|0)){t[n>>0]=e;n=n+1|0}return a-r|0}function rC(n,e,r){n=n|0;e=e|0;r=r|0;if((r|0)<32){L=e<<r|(n&(1<<r)-1<<32-r)>>>32-r;return n<<r}L=n<<r-32;return 0}function tC(n,e,r){n=n|0;e=e|0;r=r|0;if((r|0)<32){L=e>>>r;return n>>>r|(e&(1<<r)-1)<<32-r}L=0;return e>>>r-32|0}function iC(n,e,r){n=n|0;e=e|0;r=r|0;var i=0,o=0,a=0;if((r|0)>=8192)return jn(n|0,e|0,r|0)|0;a=n|0;o=n+r|0;if((n&3)==(e&3)){while(n&3){if(!r)return a|0;t[n>>0]=t[e>>0]|0;n=n+1|0;e=e+1|0;r=r-1|0}r=o&-4|0;i=r-64|0;while((n|0)<=(i|0)){u[n>>2]=u[e>>2];u[n+4>>2]=u[e+4>>2];u[n+8>>2]=u[e+8>>2];u[n+12>>2]=u[e+12>>2];u[n+16>>2]=u[e+16>>2];u[n+20>>2]=u[e+20>>2];u[n+24>>2]=u[e+24>>2];u[n+28>>2]=u[e+28>>2];u[n+32>>2]=u[e+32>>2];u[n+36>>2]=u[e+36>>2];u[n+40>>2]=u[e+40>>2];u[n+44>>2]=u[e+44>>2];u[n+48>>2]=u[e+48>>2];u[n+52>>2]=u[e+52>>2];u[n+56>>2]=u[e+56>>2];u[n+60>>2]=u[e+60>>2];n=n+64|0;e=e+64|0}while((n|0)<(r|0)){u[n>>2]=u[e>>2];n=n+4|0;e=e+4|0}}else{r=o-4|0;while((n|0)<(r|0)){t[n>>0]=t[e>>0]|0;t[n+1>>0]=t[e+1>>0]|0;t[n+2>>0]=t[e+2>>0]|0;t[n+3>>0]=t[e+3>>0]|0;n=n+4|0;e=e+4|0}}while((n|0)<(o|0)){t[n>>0]=t[e>>0]|0;n=n+1|0;e=e+1|0}return a|0}function uC(n){n=n|0;var e=0;e=t[m+(n&255)>>0]|0;if((e|0)<8)return e|0;e=t[m+(n>>8&255)>>0]|0;if((e|0)<8)return e+8|0;e=t[m+(n>>16&255)>>0]|0;if((e|0)<8)return e+16|0;return(t[m+(n>>>24)>>0]|0)+24|0}function oC(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;var o=0,a=0,f=0,c=0,l=0,s=0,d=0,_=0,v=0,p=0;s=n;c=e;l=c;a=r;_=t;f=_;if(!l){o=(i|0)!=0;if(!f){if(o){u[i>>2]=(s>>>0)%(a>>>0);u[i+4>>2]=0}_=0;i=(s>>>0)/(a>>>0)>>>0;return(L=_,i)|0}else{if(!o){_=0;i=0;return(L=_,i)|0}u[i>>2]=n|0;u[i+4>>2]=e&0;_=0;i=0;return(L=_,i)|0}}o=(f|0)==0;do{if(a){if(!o){o=(G(f|0)|0)-(G(l|0)|0)|0;if(o>>>0<=31){d=o+1|0;f=31-o|0;e=o-31>>31;a=d;n=s>>>(d>>>0)&e|l<<f;e=l>>>(d>>>0)&e;o=0;f=s<<f;break}if(!i){_=0;i=0;return(L=_,i)|0}u[i>>2]=n|0;u[i+4>>2]=c|e&0;_=0;i=0;return(L=_,i)|0}o=a-1|0;if(o&a|0){f=(G(a|0)|0)+33-(G(l|0)|0)|0;p=64-f|0;d=32-f|0;c=d>>31;v=f-32|0;e=v>>31;a=f;n=d-1>>31&l>>>(v>>>0)|(l<<d|s>>>(f>>>0))&e;e=e&l>>>(f>>>0);o=s<<p&c;f=(l<<p|s>>>(v>>>0))&c|s<<d&f-33>>31;break}if(i|0){u[i>>2]=o&s;u[i+4>>2]=0}if((a|0)==1){v=c|e&0;p=n|0|0;return(L=v,p)|0}else{p=uC(a|0)|0;v=l>>>(p>>>0)|0;p=l<<32-p|s>>>(p>>>0)|0;return(L=v,p)|0}}else{if(o){if(i|0){u[i>>2]=(l>>>0)%(a>>>0);u[i+4>>2]=0}v=0;p=(l>>>0)/(a>>>0)>>>0;return(L=v,p)|0}if(!s){if(i|0){u[i>>2]=0;u[i+4>>2]=(l>>>0)%(f>>>0)}v=0;p=(l>>>0)/(f>>>0)>>>0;return(L=v,p)|0}o=f-1|0;if(!(o&f)){if(i|0){u[i>>2]=n|0;u[i+4>>2]=o&l|e&0}v=0;p=l>>>((uC(f|0)|0)>>>0);return(L=v,p)|0}o=(G(f|0)|0)-(G(l|0)|0)|0;if(o>>>0<=30){e=o+1|0;f=31-o|0;a=e;n=l<<f|s>>>(e>>>0);e=l>>>(e>>>0);o=0;f=s<<f;break}if(!i){v=0;p=0;return(L=v,p)|0}u[i>>2]=n|0;u[i+4>>2]=c|e&0;v=0;p=0;return(L=v,p)|0}}while(0);if(!a){l=f;c=0;f=0}else{d=r|0|0;s=_|t&0;l=nC(d|0,s|0,-1,-1)|0;r=L;c=f;f=0;do{t=c;c=o>>>31|c<<1;o=f|o<<1;t=n<<1|t>>>31|0;_=n>>>31|e<<1|0;$E(l|0,r|0,t|0,_|0)|0;p=L;v=p>>31|((p|0)<0?-1:0)<<1;f=v&1;n=$E(t|0,_|0,v&d|0,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&s|0)|0;e=L;a=a-1|0}while((a|0)!=0);l=c;c=0}a=0;if(i|0){u[i>>2]=n;u[i+4>>2]=e}v=(o|0)>>>31|(l|a)<<1|(a<<1|o>>>31)&0|c;p=(o<<1|0>>>31)&-2|f;return(L=v,p)|0}function aC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;return oC(n,e,r,t,0)|0}function fC(n){n=n|0;var e=0,r=0;r=n+15&-16|0;e=u[s>>2]|0;n=e+r|0;if((r|0)>0&(n|0)<(e|0)|(n|0)<0){$()|0;zn(12);return-1}u[s>>2]=n;if((n|0)>(Q()|0)?(Z()|0)==0:0){u[s>>2]=e;zn(12);return-1}return e|0}function cC(n,e,r){n=n|0;e=e|0;r=r|0;var i=0;if((e|0)<(n|0)&(n|0)<(e+r|0)){i=n;e=e+r|0;n=n+r|0;while((r|0)>0){n=n-1|0;e=e-1|0;r=r-1|0;t[n>>0]=t[e>>0]|0}n=i}else iC(n,e,r)|0;return n|0}function lC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;var i=0,o=0;o=v;v=v+16|0;i=o|0;oC(n,e,r,t,i)|0;v=o;return(L=u[i+4>>2]|0,u[i>>2]|0)|0}function sC(n){n=n|0;return(n&255)<<24|(n>>8&255)<<16|(n>>16&255)<<8|n>>>24|0}function dC(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;lL[n&1](e|0,r|0,t|0,i|0,u|0)}function _C(n,e,r){n=n|0;e=e|0;r=K(r);sL[n&1](e|0,K(r))}function vC(n,e,r){n=n|0;e=e|0;r=+r;dL[n&31](e|0,+r)}function pC(n,e,r,t){n=n|0;e=e|0;r=K(r);t=K(t);return K(_L[n&0](e|0,K(r),K(t)))}function mC(n,e){n=n|0;e=e|0;vL[n&127](e|0)}function bC(n,e,r){n=n|0;e=e|0;r=r|0;pL[n&31](e|0,r|0)}function hC(n,e){n=n|0;e=e|0;return mL[n&31](e|0)|0}function yC(n,e,r,t,i){n=n|0;e=e|0;r=+r;t=+t;i=i|0;bL[n&1](e|0,+r,+t,i|0)}function wC(n,e,r,t){n=n|0;e=e|0;r=+r;t=+t;hL[n&1](e|0,+r,+t)}function MC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;return yL[n&7](e|0,r|0,t|0)|0}function kC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;return+wL[n&1](e|0,r|0,t|0)}function gC(n,e){n=n|0;e=e|0;return+ML[n&15](e|0)}function TC(n,e,r){n=n|0;e=e|0;r=+r;return kL[n&1](e|0,+r)|0}function AC(n,e,r){n=n|0;e=e|0;r=r|0;return gL[n&15](e|0,r|0)|0}function SC(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=+t;i=+i;u=u|0;TL[n&1](e|0,r|0,+t,+i,u|0)}function EC(n,e,r,t,i,u,o){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;o=o|0;AL[n&1](e|0,r|0,t|0,i|0,u|0,o|0)}function CC(n,e,r){n=n|0;e=e|0;r=r|0;return+SL[n&7](e|0,r|0)}function LC(n){n=n|0;return EL[n&7]()|0}function RC(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;return CL[n&1](e|0,r|0,t|0,i|0,u|0)|0}function PC(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=+i;LL[n&1](e|0,r|0,t|0,+i)}function BC(n,e,r,t,i,u,o){n=n|0;e=e|0;r=r|0;t=K(t);i=i|0;u=K(u);o=o|0;RL[n&1](e|0,r|0,K(t),i|0,K(u),o|0)}function OC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;PL[n&15](e|0,r|0,t|0)}function NC(n){n=n|0;BL[n&0]()}function IC(n,e,r,t){n=n|0;e=e|0;r=r|0;t=+t;OL[n&15](e|0,r|0,+t)}function FC(n,e,r){n=n|0;e=+e;r=+r;return NL[n&1](+e,+r)|0}function xC(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;IL[n&15](e|0,r|0,t|0,i|0)}function UC(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;X(0)}function HC(n,e){n=n|0;e=K(e);X(1)}function DC(n,e){n=n|0;e=+e;X(2)}function WC(n,e,r){n=n|0;e=K(e);r=K(r);X(3);return de}function YC(n){n=n|0;X(4)}function VC(n,e){n=n|0;e=e|0;X(5)}function jC(n){n=n|0;X(6);return 0}function qC(n,e,r,t){n=n|0;e=+e;r=+r;t=t|0;X(7)}function zC(n,e,r){n=n|0;e=+e;r=+r;X(8)}function GC(n,e,r){n=n|0;e=e|0;r=r|0;X(9);return 0}function KC(n,e,r){n=n|0;e=e|0;r=r|0;X(10);return 0.0}function XC(n){n=n|0;X(11);return 0.0}function JC(n,e){n=n|0;e=+e;X(12);return 0}function ZC(n,e){n=n|0;e=e|0;X(13);return 0}function QC(n,e,r,t,i){n=n|0;e=e|0;r=+r;t=+t;i=i|0;X(14)}function $C(n,e,r,t,i,u){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;u=u|0;X(15)}function nL(n,e){n=n|0;e=e|0;X(16);return 0.0}function eL(){X(17);return 0}function rL(n,e,r,t,i){n=n|0;e=e|0;r=r|0;t=t|0;i=i|0;X(18);return 0}function tL(n,e,r,t){n=n|0;e=e|0;r=r|0;t=+t;X(19)}function iL(n,e,r,t,i,u){n=n|0;e=e|0;r=K(r);t=t|0;i=K(i);u=u|0;X(20)}function uL(n,e,r){n=n|0;e=e|0;r=r|0;X(21)}function oL(){X(22)}function aL(n,e,r){n=n|0;e=e|0;r=+r;X(23)}function fL(n,e){n=+n;e=+e;X(24);return 0}function cL(n,e,r,t){n=n|0;e=e|0;r=r|0;t=t|0;X(25)}var lL=[UC,gk];var sL=[HC,qi];var dL=[DC,bu,hu,yu,wu,Mu,ku,gu,Au,Su,Cu,Lu,Ru,Pu,Bu,Ou,Nu,Iu,Fu,DC,DC,DC,DC,DC,DC,DC,DC,DC,DC,DC,DC,DC];var _L=[WC];var vL=[YC,WE,pf,mf,bf,Xd,Jd,Zd,hw,yw,ww,uk,ok,ak,oS,aS,fS,Me,Ji,eu,Tu,Eu,Ho,Do,Xa,Af,Vf,vc,Nc,il,El,zl,ds,Ns,$s,hd,xd,b_,F_,ev,wv,Hv,ip,Sp,jp,am,Cm,Yi,lb,Lb,Zb,hh,Fh,uy,by,wy,Dy,Vy,aw,gw,Sw,zw,_M,Sf,Rg,_T,PT,XT,wA,UA,JA,$A,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC,YC];var pL=[VC,ru,tu,ou,au,fu,cu,lu,su,vu,pu,mu,$u,ro,to,io,uo,oo,ao,_o,bo,Xo,Rp,Gp,kh,Og,MM,nT,VC,VC,VC,VC];var mL=[jC,KS,Xi,Du,ju,qu,zu,Gu,Ku,Xu,Zu,Qu,vo,po,Wo,Pm,Dh,Xw,Ug,Dg,jC,jC,jC,jC,jC,jC,jC,jC,jC,jC,jC,jC];var bL=[qC,Yo];var hL=[zC,lw];var yL=[GC,XS,JS,rE,fl,M_,vb,$T];var wL=[KC,td];var ML=[XC,no,eo,fo,Vo,jo,qo,zo,Go,Ko,XC,XC,XC,XC,XC,XC];var kL=[JC,_y];var gL=[ZC,YE,mo,ef,hc,Pl,Jl,Wd,D_,sm,zi,IT,ZC,ZC,ZC,ZC];var TL=[QC,Gf];var AL=[$C,TA];var SL=[nL,co,Jo,Zo,Qo,kd,nL,nL];var EL=[eL,$o,Gi,Di,Ay,Gy,Pw,tS];var CL=[rL,Ft];var LL=[tL,Tv];var RL=[iL,yo];var PL=[uL,Wu,Ju,lo,so,Uc,ms,Vv,fp,ji,Qk,bT,YA,uL,uL,uL];var BL=[oL];var OL=[aL,iu,uu,du,_u,xu,Uu,Hu,uv,Ob,fy,aL,aL,aL,aL,aL];var NL=[fL,pw];var IL=[cL,Us,Hm,eh,Xh,Py,$y,Uw,hM,qg,vS,cL,cL,cL,cL,cL];return{_llvm_bswap_i32:sC,dynCall_idd:FC,dynCall_i:LC,_i64Subtract:$E,___udivdi3:aC,dynCall_vif:_C,setThrew:be,dynCall_viii:OC,_bitshift64Lshr:tC,_bitshift64Shl:rC,dynCall_vi:mC,dynCall_viiddi:SC,dynCall_diii:kC,dynCall_iii:AC,_memset:eC,_sbrk:fC,_memcpy:iC,__GLOBAL__sub_I_Yoga_cpp:Hi,dynCall_vii:bC,___uremdi3:lC,dynCall_vid:vC,stackAlloc:_e,_nbind_init:LS,getTempRet0:ye,dynCall_di:gC,dynCall_iid:TC,setTempRet0:he,_i64Add:nC,dynCall_fiff:pC,dynCall_iiii:MC,_emscripten_get_global_libc:GS,dynCall_viid:IC,dynCall_viiid:PC,dynCall_viififi:BC,dynCall_ii:hC,__GLOBAL__sub_I_Binding_cc:Mg,dynCall_viiii:xC,dynCall_iiiiii:RC,stackSave:ve,dynCall_viiiii:dC,__GLOBAL__sub_I_nbind_cc:na,dynCall_vidd:wC,_free:zS,runPostSets:QE,dynCall_viiiiii:EC,establishStackSpace:me,_memmove:cC,stackRestore:pe,_malloc:qS,__GLOBAL__sub_I_common_cc:iM,dynCall_viddi:yC,dynCall_dii:CC,dynCall_v:NC}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,getTempRet0=Module.getTempRet0=asm.getTempRet0,___udivdi3=Module.___udivdi3=asm.___udivdi3,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,_memset=Module._memset=asm._memset,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,___uremdi3=Module.___uremdi3=asm.___uremdi3,_nbind_init=Module._nbind_init=asm._nbind_init,_i64Subtract=Module._i64Subtract=asm._i64Subtract,setTempRet0=Module.setTempRet0=asm.setTempRet0,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,__GLOBAL__sub_I_Yoga_cpp=Module.__GLOBAL__sub_I_Yoga_cpp=asm.__GLOBAL__sub_I_Yoga_cpp,__GLOBAL__sub_I_Binding_cc=Module.__GLOBAL__sub_I_Binding_cc=asm.__GLOBAL__sub_I_Binding_cc,stackSave=Module.stackSave=asm.stackSave,__GLOBAL__sub_I_nbind_cc=Module.__GLOBAL__sub_I_nbind_cc=asm.__GLOBAL__sub_I_nbind_cc,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,_memmove=Module._memmove=asm._memmove,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,__GLOBAL__sub_I_common_cc=Module.__GLOBAL__sub_I_common_cc=asm.__GLOBAL__sub_I_common_cc,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vif=Module.dynCall_vif=asm.dynCall_vif,dynCall_vid=Module.dynCall_vid=asm.dynCall_vid,dynCall_fiff=Module.dynCall_fiff=asm.dynCall_fiff,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_vii=Module.dynCall_vii=asm.dynCall_vii,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viddi=Module.dynCall_viddi=asm.dynCall_viddi,dynCall_vidd=Module.dynCall_vidd=asm.dynCall_vidd,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_diii=Module.dynCall_diii=asm.dynCall_diii,dynCall_di=Module.dynCall_di=asm.dynCall_di,dynCall_iid=Module.dynCall_iid=asm.dynCall_iid,dynCall_iii=Module.dynCall_iii=asm.dynCall_iii,dynCall_viiddi=Module.dynCall_viiddi=asm.dynCall_viiddi,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_dii=Module.dynCall_dii=asm.dynCall_dii,dynCall_i=Module.dynCall_i=asm.dynCall_i,dynCall_iiiiii=Module.dynCall_iiiiii=asm.dynCall_iiiiii,dynCall_viiid=Module.dynCall_viiid=asm.dynCall_viiid,dynCall_viififi=Module.dynCall_viififi=asm.dynCall_viififi,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viid=Module.dynCall_viid=asm.dynCall_viid,dynCall_idd=Module.dynCall_idd=asm.dynCall_idd,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii,initialStackTop;function ExitStatus(n){this.name=\\\"ExitStatus\\\",this.message=\\\"Program terminated with exit(\\\"+n+\\\")\\\",this.status=n}Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var preloadStartTime=null,calledMain=!1;function run(n){function e(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(n),postRun()))}n=n||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus(\\\"Running...\\\"),setTimeout((function(){setTimeout((function(){Module.setStatus(\\\"\\\")}),1),e()}),1)):e()))}function exit(n,e){e&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=n,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(n)),ENVIRONMENT_IS_NODE&&process.exit(n),Module.quit(n,new ExitStatus(n)))}dependenciesFulfilled=function n(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=n)},Module.callMain=Module.callMain=function(n){n=n||[],ensureInitRuntime();var e=n.length+1;function r(){for(var n=0;n<3;n++)t.push(0)}var t=[allocate(intArrayFromString(Module.thisProgram),\\\"i8\\\",ALLOC_NORMAL)];r();for(var i=0;i<e-1;i+=1)t.push(allocate(intArrayFromString(n[i]),\\\"i8\\\",ALLOC_NORMAL)),r();t.push(0),t=allocate(t,\\\"i32\\\",ALLOC_NORMAL);try{exit(Module._main(e,t,0),!0)}catch(n){if(n instanceof ExitStatus)return;if(\\\"SimulateInfiniteLoop\\\"==n)return void(Module.noExitRuntime=!0);var u=n;n&&\\\"object\\\"==typeof n&&n.stack&&(u=[n,n.stack]),Module.printErr(\\\"exception thrown: \\\"+u),Module.quit(1,n)}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];function abort(n){Module.onAbort&&Module.onAbort(n),void 0!==n?(Module.print(n),Module.printErr(n),n=JSON.stringify(n)):n=\\\"\\\",ABORT=!0,EXITSTATUS=1;var e=\\\"abort(\\\"+n+\\\") at \\\"+stackTrace()+\\\"\\\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.\\\";throw abortDecorators&&abortDecorators.forEach((function(r){e=r(e,n)})),e}if(Module.abort=Module.abort=abort,Module.preInit)for(\\\"function\\\"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()}));\"))($module);\r\n\t var nbind = $module.exports;\r\n\r\n\t /**\r\n\t * Copyright (c) 2014-present, Facebook, Inc.\r\n\t * All rights reserved.\r\n\t *\r\n\t * This source code is licensed under the BSD-style license found in the\r\n\t * LICENSE file in the root directory of this source tree. An additional grant\r\n\t * of patent rights can be found in the PATENTS file in the same directory.\r\n\t *\r\n\t * \r\n\t * @format\r\n\t */\r\n\r\n\r\n\r\n\r\n\t var ran = false;\r\n\t var ret = null;\r\n\r\n\t nbind({}, function (err, result) {\r\n\t if (ran) {\r\n\t return;\r\n\t }\r\n\r\n\t ran = true;\r\n\r\n\t if (err) {\r\n\t throw err;\r\n\t }\r\n\r\n\t ret = result;\r\n\t });\r\n\r\n\t if (!ran) {\r\n\t throw new Error(\"Failed to load the yoga module - it needed to be loaded synchronously, but didn't\");\r\n\t }\r\n\r\n\t // $FlowFixMe ret will not be null here\r\n\t var entryBrowser = entryCommon(ret.bind, ret.lib);\r\n\r\n\t return entryBrowser;\r\n\r\n\t}());\r\n\r\n\r\n\t return Yoga\r\n\t}", "title": "" }, { "docid": "9ec3d64ee0905040797186b45c4287e8", "score": "0.48715788", "text": "_receiveVideoProgress({nativeEvent}){\n// console.log(\"VIDEO PROGRESS : \"+nativeEvent.videoProgress)\n if(typeof this.props.getVideoProgress === 'function'){\n this.props.getVideoProgress({videoProgress : nativeEvent.videoProgress})\n }\n }", "title": "" }, { "docid": "fbb12e9ecd66762d6133a8aed18a2cb7", "score": "0.48631212", "text": "waitForBridge() {\n //the react native postMessage has only 1 parameter\n //while the default one has 2, so check the signature\n //of the function\n\n if (window.postMessage.length !== 1) {\n setTimeout(\n function () {\n this.waitForBridge();\n }.bind(this),\n 200\n );\n } else {\n let tmp = localStorage.getItem(\"smart-app-id-login\");\n let needLogin = false;\n // let tmp2 = localStorage.getItem('smart-app-id-binding');\n // let needBinding = false;\n\n if (\n tmp === undefined ||\n tmp === null ||\n tmp === \"null\" ||\n tmp === \"\" ||\n tmp === \"undefined\"\n )\n needLogin = true;\n // else if(tmp2 == undefined || tmp2 == null || tmp2 == 'null' || tmp2 == '' ||tmp2 == 'undefined' ) needBinding = true;\n else {\n tmp = JSON.parse(tmp);\n this.setState({\n phoneno: tmp.phonenumber,\n });\n }\n\n let param =\n '{\"title\":\"' +\n \"Merchant\" +\n '\",\"canGoBack\":false, \"showCommunityName\":true, \"hideTopbar\":true, \"hideFooterMenu\":true, \"needLogin\":' +\n (needLogin ? \"true\" : \"false\") +\n \"}\";\n window.postMessage(param, \"*\");\n }\n }", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.48516566", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.48516566", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.48516566", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "708fd7405c611039f6227b6168857330", "score": "0.48516566", "text": "_FBPReady(){super._FBPReady();//this._FBPTraceWires();\n}", "title": "" }, { "docid": "8602b836c0e5aec7ec55729319a437a3", "score": "0.48326528", "text": "function We(e){return e._reactInternalFiber}", "title": "" }, { "docid": "84b2d9d07cdd26eea4b7b290514f6487", "score": "0.4825162", "text": "_fbGetdata () { // fetches user details to display - name and picture. also gets short term token\n window.FB.getLoginStatus(function(response) {\n const user = response.authResponse.userID;\n\n window.FB.api(user, {fields:'first_name,last_name,picture'}, function(response) {\n console.log(response);\n this.setState({user: {firstname: response.first_name, lastname: response.last_name, id: response.id, picture: response.picture.data.url,}});\n this._phpFetch('http://localhost:8888/post.php', 'POST');\n }.bind(this));\n }.bind(this));\n\n\n }", "title": "" }, { "docid": "81befaf3bc796f38f3a8d3e5faaabf79", "score": "0.48207346", "text": "waitForBridge() {\n //the react native postMessage has only 1 parameter\n //while the default one has 2, so check the signature\n //of the function\n\n if (window.postMessage.length !== 1) {\n setTimeout(\n function () {\n this.waitForBridge();\n }.bind(this),\n 200\n );\n } else {\n let tmp = localStorage.getItem(\"smart-app-id-login\");\n let needLogin = false;\n // let tmp2 = localStorage.getItem('smart-app-id-binding');\n // let needBinding = false;\n\n if (\n tmp === undefined ||\n tmp === null ||\n tmp === \"null\" ||\n tmp === \"\" ||\n tmp === \"undefined\"\n )\n needLogin = true;\n // else if(tmp2 == undefined || tmp2 == null || tmp2 == 'null' || tmp2 == '' ||tmp2 == 'undefined' ) needBinding = true;\n else {\n tmp = JSON.parse(tmp);\n this.setState({\n phoneno: tmp.phonenumber,\n });\n }\n\n let param =\n '{\"title\":\"' +\n \"Service Center\" +\n '\",\"canGoBack\":false, \"showCommunityName\":true, \"hideTopbar\":true, \"hideFooterMenu\":true, \"needLogin\":' +\n (needLogin ? \"true\" : \"false\") +\n \"}\";\n window.postMessage(param, \"*\");\n }\n }", "title": "" }, { "docid": "a1c1e656961dab1a2a5cc4b920f9acb9", "score": "0.4818861", "text": "componentDidMount () {\n this.props.actions.queryChromeTab()\n }", "title": "" }, { "docid": "516855dabcd2354327e0e37a58028c60", "score": "0.48149174", "text": "on_message(message) {\r\n }", "title": "" }, { "docid": "64a19fd53f7707765aa4ceb452603717", "score": "0.48088413", "text": "_fbGetdata () { // fetches user details to display - name and picture. also gets short term token\n window.FB.getLoginStatus(function(response) {\n const user = response.authResponse.userID;\n\n window.FB.api(user, {fields:'first_name,last_name,picture'}, function(response) {\n console.log(response);\n this.setState({user: {firstname: response.first_name, lastname: response.last_name, id: response.id, picture: response.picture.data.url,}});\n this._phpFetch('http://localhost:8888/post.php', 'POST', this.state.user);\n }.bind(this));\n }.bind(this));\n\n\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.47933042", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.47933042", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.47933042", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "ba5934421e3bc3923ca6d12123da5030", "score": "0.47933042", "text": "connectedCallback() {\n super.connectedCallback();\n }", "title": "" }, { "docid": "81257cc93fa8b06c9914f3302d3024be", "score": "0.4790794", "text": "function componentDidMount ()\n {\n }", "title": "" }, { "docid": "1e6b142bac1b28d6d56ec9e9fc419754", "score": "0.47902715", "text": "authWithFacebook() {\n // creates an instance of the Facebook provider object\n let provider = new firebase.auth.FacebookAuthProvider();\n provider.addScope('public_profile');\n // popup as opposed to redirecting\n firebase.auth().signInWithRedirect(provider).then(result => {\n // updates state\n this.setState(prevState => Object.assign({}, prevState, {redirect: true, authenticated: true, modalActive: false}));\n // gives you a Facebook access token to access their API\n let token = result.credential.accessToken;\n // the signed-in user info\n let user = result.user;\n let userName = user.displayName;\n // handles errors\n }).catch(error => {\n let errorCode = error.code;\n let errorMessage = error.message;\n let email = error.email;\n let credential = error.credential;\n });\n this.closeModal();\n }", "title": "" }, { "docid": "6a198f813f1f6d077a876135ea87c298", "score": "0.4787798", "text": "function isFacebook() {\n\treturn (robot.adapterName && robot.adapterName.toLowerCase() === 'fb');\n}", "title": "" }, { "docid": "250f7eaffe81a856b9ae704981b93fa1", "score": "0.47860056", "text": "_receiveVideoComplete({nativeEvent}){\n// console.log(\"VIDEO COMPLETE\")\n if(typeof this.props.getVideoCompleted === 'function'){\n this.props.getVideoCompleted({videoCompleted : nativeEvent.videoCompleted})\n }\n }", "title": "" }, { "docid": "b3562788825610190e13d4e95166c908", "score": "0.47757953", "text": "function _0x40df2e(_0x503d61,_0x1e0723){0x0;}", "title": "" }, { "docid": "91ab3ef6888d3fda14491c2ca26587a3", "score": "0.4772256", "text": "_requestVideoFrame() {\n\t}", "title": "" }, { "docid": "3c867604cb7e63691879e45395b7c855", "score": "0.47704232", "text": "componentDidMount() {\n if(!hasGetUserMedia) {\n alert(\"Your browser cannot stream from your webcam. Please switch to Chrome or Firefox.\");\n return;\n }\n this.requestUserMedia();\n }", "title": "" }, { "docid": "0f1e12201240380f7a2cb852aefb46e8", "score": "0.47701755", "text": "_FBPReady(){super._FBPReady()}", "title": "" }, { "docid": "0f1e12201240380f7a2cb852aefb46e8", "score": "0.47701755", "text": "_FBPReady(){super._FBPReady()}", "title": "" }, { "docid": "0f1e12201240380f7a2cb852aefb46e8", "score": "0.47701755", "text": "_FBPReady(){super._FBPReady()}", "title": "" }, { "docid": "802c62fa1c22f41b65ae157313325aa5", "score": "0.4768626", "text": "async facebookSignIn() {\r\n try {\r\n await signInWithFacebook();\r\n } catch (error) {\r\n this.setState({ error: error.message });\r\n }\r\n }", "title": "" }, { "docid": "a81cf2b02b23788eceb0c3c3ab31da96", "score": "0.47684017", "text": "function componentDidMount ()\n {\n\n }", "title": "" }, { "docid": "a81cf2b02b23788eceb0c3c3ab31da96", "score": "0.47684017", "text": "function componentDidMount ()\n {\n\n }", "title": "" }, { "docid": "c36f138cb5f34b75f63786dc095cc04c", "score": "0.4764979", "text": "componentDidMount() {\n //컴포넌트 마운트된 직후 호출\n const context = this.refs.canvas.getContext(\"2d\"); //드로잉 컨텍스트에 액세스\n // this.drawText(\"Game over!\");\n this.setState({ context: context });\n\n // 회원 정보 얻어오기\n let token = sessionStorage.getItem('token')\n axios.get(\"http://localhost:5000/user/me\",{\n headers: {\n Authorization: `Bearer ${token}`\n }\n }).then((result)=>{\n this.setState({ email: result.data.data[0].email})\n this.setState({ myName: result.data.data[0].name})\n })\n .catch((error) => {\n // 로그인 안되어 있을 시 로그인창으로 되돌리기\n console.log(error)\n alert('로그인이 필요한 페이지입니다.')\n document.location.href=\"/login\"\n })\n\n this.initialize();\n requestAnimationFrame(() => {\n this.update();\n }); //애니메이션 구동 == 부드럽게 표현하기 위해서\n }", "title": "" }, { "docid": "540595a4c630602abb284c6bf6a5f3f5", "score": "0.47625425", "text": "_receiveVideoReady({nativeEvent}){\n// console.log(\"VIDEO READY\")\n if(typeof this.props.getVideoReady === 'function'){\n this.props.getVideoReady({videoReady : nativeEvent.videoReady})\n }\n }", "title": "" }, { "docid": "c166525b651230ca219b0722aef0d240", "score": "0.47551656", "text": "function ChildBrowserIOS() {\n // Does nothing\n}", "title": "" }, { "docid": "9be7566734442cce5eaf387ab039fd22", "score": "0.4740807", "text": "onFrameEnd() { }", "title": "" }, { "docid": "0fcaa2637ea8545d7e6116ae65d7d865", "score": "0.4725565", "text": "componentDidMount() { }", "title": "" }, { "docid": "cd910079241b04b766ba8a10f5abffe5", "score": "0.47228104", "text": "function AndroidSdk() {\n\n}", "title": "" }, { "docid": "adbede3f5d8b9a4e5ea2d69880cd947c", "score": "0.4719262", "text": "componentWillUnmount() {\n \n }", "title": "" }, { "docid": "98016b30bec0accc4ce074e28176028c", "score": "0.47167677", "text": "function WindowNative() {\n \n this.__proto__.getWindow = function () {\n //return window;\n }\n\n}", "title": "" }, { "docid": "647eafacb91f4e9eb6bbcbac09cd29ab", "score": "0.4714399", "text": "function onConnect () {\n\n}", "title": "" }, { "docid": "b6055341c279e984749d73546d6a572b", "score": "0.47139186", "text": "function y(){function q(){}function n(a,b,c,d,e,f,g){return{$$typeof:J,type:a,key:b,ref:c,props:g,_owner:f}}function z(a){for(var b=arguments.length-1,c=\"Minified React error #\"+a+\"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant\\x3d\"+a,d=0;d<b;d++)c+=\"\\x26args[]\\x3d\"+encodeURIComponent(arguments[d+1]);b=Error(c+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\");b.name=\"Invariant Violation\";b.framesToPop=\n1;throw b;}function r(a,b,c){this.props=a;this.context=b;this.refs=A;this.updater=c||B}function C(a,b,c){this.props=a;this.context=b;this.refs=A;this.updater=c||B}function D(){}function E(a,b,c){this.props=a;this.context=b;this.refs=A;this.updater=c||B}function v(a){return function(){return a}}function R(a){var b={\"\\x3d\":\"\\x3d0\",\":\":\"\\x3d2\"};return\"$\"+(\"\"+a).replace(/[=:]/g,function(a){return b[a]})}function K(a,b,c,d){if(w.length){var e=w.pop();e.result=a;e.keyPrefix=b;e.func=c;e.context=d;e.count=\n0;return e}return{result:a,keyPrefix:b,func:c,context:d,count:0}}function L(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>w.length&&w.push(a)}function u(a,b,c,d){var e=typeof a;if(\"undefined\"===e||\"boolean\"===e)a=null;if(null===a||\"string\"===e||\"number\"===e||\"object\"===e&&a.$$typeof===S)return c(d,a,\"\"===b?\".\"+F(a,0):b),1;var f=0;b=\"\"===b?\".\":b+\":\";if(Array.isArray(a))for(var g=0;g<a.length;g++){e=a[g];var h=b+F(e,g);f+=u(e,h,c,d)}else if(h=M&&a[M]||a[\"@@iterator\"],\"function\"===\ntypeof h)for(a=h.call(a),g=0;!(e=a.next()).done;)e=e.value,h=b+F(e,g++),f+=u(e,h,c,d);else\"object\"===e&&(c=\"\"+a,z(\"31\",\"[object Object]\"===c?\"object with keys {\"+Object.keys(a).join(\", \")+\"}\":c,\"\"));return f}function F(a,b){return\"object\"===typeof a&&null!==a&&null!=a.key?R(a.key):b.toString(36)}function T(a,b){a.func.call(a.context,b,a.count++)}function U(a,b,c){var d=a.result,e=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?G(a,d,c,H.thatReturnsArgument):null!=a&&(t.isValidElement(a)&&\n(a=t.cloneAndReplaceKey(a,e+(!a.key||b&&b.key===a.key?\"\":(\"\"+a.key).replace(N,\"$\\x26/\")+\"/\")+c)),d.push(a))}function G(a,b,c,d,e){var f=\"\";null!=c&&(f=(\"\"+c).replace(N,\"$\\x26/\")+\"/\");b=K(b,f,d,e);null==a||u(a,\"\",U,b);L(b)}var O=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable,x=function(){try{if(!Object.assign)return!1;var a=new String(\"abc\");a[5]=\"de\";if(\"5\"===Object.getOwnPropertyNames(a)[0])return!1;var b={};for(a=0;10>a;a++)b[\"_\"+String.fromCharCode(a)]=\na;if(\"0123456789\"!==Object.getOwnPropertyNames(b).map(function(a){return b[a]}).join(\"\"))return!1;var c={};\"abcdefghijklmnopqrst\".split(\"\").forEach(function(a){c[a]=a});return\"abcdefghijklmnopqrst\"!==Object.keys(Object.assign({},c)).join(\"\")?!1:!0}catch(d){return!1}}()?Object.assign:function(a,b){if(null===a||void 0===a)throw new TypeError(\"Object.assign cannot be called with null or undefined\");var c=Object(a);for(var d,e=1;e<arguments.length;e++){var f=Object(arguments[e]);for(var g in f)V.call(f,\ng)&&(c[g]=f[g]);if(O){d=O(f);for(var h=0;h<d.length;h++)W.call(f,d[h])&&(c[d[h]]=f[d[h]])}}return c},B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A={};r.prototype.isReactComponent={};r.prototype.setState=function(a,b){\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a?z(\"85\"):void 0;this.updater.enqueueSetState(this,a,b,\"setState\")};r.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};\nD.prototype=r.prototype;var k=C.prototype=new D;k.constructor=C;x(k,r.prototype);k.isPureReactComponent=!0;k=E.prototype=new D;k.constructor=E;x(k,r.prototype);k.unstable_isAsyncReactComponent=!0;k.render=function(){return this.props.children};var I={current:null},P=Object.prototype.hasOwnProperty,J=\"function\"===typeof Symbol&&Symbol[\"for\"]&&Symbol[\"for\"](\"react.element\")||60103,Q={key:!0,ref:!0,__self:!0,__source:!0};n.createElement=function(a,b,c){var d,e={},f=null,g=null,h=null,k=null;if(null!=\nb)for(d in void 0!==b.ref&&(g=b.ref),void 0!==b.key&&(f=\"\"+b.key),h=void 0===b.__self?null:b.__self,k=void 0===b.__source?null:b.__source,b)P.call(b,d)&&!Q.hasOwnProperty(d)&&(e[d]=b[d]);var m=arguments.length-2;if(1===m)e.children=c;else if(1<m){for(var l=Array(m),p=0;p<m;p++)l[p]=arguments[p+2];e.children=l}if(a&&a.defaultProps)for(d in m=a.defaultProps,m)void 0===e[d]&&(e[d]=m[d]);return n(a,f,g,h,k,I.current,e)};n.createFactory=function(a){var b=n.createElement.bind(null,a);b.type=a;return b};\nn.cloneAndReplaceKey=function(a,b){return n(a.type,b,a.ref,a._self,a._source,a._owner,a.props)};n.cloneElement=function(a,b,c){var d=x({},a.props),e=a.key,f=a.ref,g=a._self,h=a._source,k=a._owner;if(null!=b){void 0!==b.ref&&(f=b.ref,k=I.current);void 0!==b.key&&(e=\"\"+b.key);if(a.type&&a.type.defaultProps)var m=a.type.defaultProps;for(l in b)P.call(b,l)&&!Q.hasOwnProperty(l)&&(d[l]=void 0===b[l]&&void 0!==m?m[l]:b[l])}var l=arguments.length-2;if(1===l)d.children=c;else if(1<l){m=Array(l);for(var p=\n0;p<l;p++)m[p]=arguments[p+2];d.children=m}return n(a.type,e,f,g,h,k,d)};n.isValidElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===J};var t=n;q.thatReturns=v;q.thatReturnsFalse=v(!1);q.thatReturnsTrue=v(!0);q.thatReturnsNull=v(null);q.thatReturnsThis=function(){return this};q.thatReturnsArgument=function(a){return a};var H=q,M=\"function\"===typeof Symbol&&Symbol.iterator,S=\"function\"===typeof Symbol&&Symbol[\"for\"]&&Symbol[\"for\"](\"react.element\")||60103,N=/\\/+/g,w=[];return{Children:{map:function(a,\nb,c){if(null==a)return a;var d=[];G(a,d,null,b,c);return d},forEach:function(a,b,c){if(null==a)return a;b=K(null,null,b,c);null==a||u(a,\"\",T,b);L(b)},count:function(a){return null==a?0:u(a,\"\",H.thatReturnsNull,null)},toArray:function(a){var b=[];G(a,b,null,H.thatReturnsArgument);return b},only:function(a){t.isValidElement(a)?void 0:z(\"143\");return a}},Component:r,PureComponent:C,unstable_AsyncComponent:E,createElement:t.createElement,cloneElement:t.cloneElement,isValidElement:t.isValidElement,createFactory:t.createFactory,\nversion:\"16.0.0\",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:I,assign:x}}}", "title": "" }, { "docid": "9067e77434049f1f58ecfb5e9692b130", "score": "0.47124988", "text": "function FBConnect()\n{\n\tif(window.plugins.childBrowser == null)\n\t{\n\t\twindow.plugins.childBrowser = ChildBrowser.install();\n\t}\n}", "title": "" }, { "docid": "d976f4f50960e5b360f9c58f41d18c2a", "score": "0.4706206", "text": "onConnect() { }", "title": "" }, { "docid": "2545171837c528e1b3792e672b136208", "score": "0.4699929", "text": "render() {\n return (\n <div className={styles.login}>\n <div className={styles.heading}>\n Login.\n </div>\n\n <div className={styles.actionContainer}>\n\n <FacebookLogin\n appId=\"2536100859948701\"\n autoLoad\n fields=\"name,email,picture\"\n callback={this.responseFacebook}\n />\n\n\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "b252741c450b239abe3abac468daba18", "score": "0.4699094", "text": "statusChangeCallback(response) {\n // app know the current login status of the person.\n console.log(\"statuschange\");\n if (response.authResponse) {\n const userId = response.authResponse.userID,\n accessToken = response.authResponse.accessToken;\n\n console.log(\"connected!\");\n console.log(userId, accessToken);\n\n this.setState({\n loggedIn: true,\n userId,\n accessToken\n });\n } else {\n console.log(\"User cancelled login or did not fully authorize.\");\n }\n // The response object is returned with a status field that lets the\n // Full docs on the response object can be found in the documentation\n // for FB.getLoginStatus().\n // if (response.status === \"connected\") {\n // // Logged into your app and Facebook.\n // const userId = response.authResponse.userID,\n // accessToken = response.authResponse.accessToken;\n //\n // console.log(\"connected!\");\n // console.log(userId, accessToken);\n //\n // this.setState({\n // loggedIn: true,\n // userId,\n // accessToken\n // });\n // } else if (response.status === \"not_authorized\") {\n // // The person is logged into Facebook, but not your app.\n // document.getElementById(\"status\").innerHTML =\n // \"Please log \" + \"into this app.\";\n // } else {\n // // The person is not logged into Facebook, so we're not sure if\n // // they are logged into this app or not.\n // document.getElementById(\"status\").innerHTML =\n // \"Please log \" + \"into Facebook.\";\n // }\n }", "title": "" }, { "docid": "6bb13b479de3d5e9b736165598df10a5", "score": "0.46799448", "text": "getNativeNode() {}", "title": "" }, { "docid": "193c9b334e4355612d7930f2073a16c4", "score": "0.46735778", "text": "function _0x6f1b(){const _0x971857=['21570nuHNIJ','2132523bIQVgk','10454220wRZivw','4622816qzqCLL','1ncOIlP','9485037JDhDau','1791938bhxnpp','357exLwEq','8RNTcrB','370510ZeagTa','ephemeralMessage','message'];_0x6f1b=function(){return _0x971857;};return _0x6f1b();}", "title": "" }, { "docid": "329842afa582a7563bcf6e7549ea9708", "score": "0.46694076", "text": "function loginToFaceBook(){\n\n var js, id = 'facebook-jssdk', ref = document.getElementsByTagName('script')[0];\n if (document.getElementById(id)) {return;}\n js = document.createElement('script'); js.id = id; js.async = true;\n js.src = \"//connect.facebook.net/en_US/all.js\";\n ref.parentNode.insertBefore(js, ref);\n }", "title": "" }, { "docid": "3c2f619b220c058b146a428b741a9e92", "score": "0.46612126", "text": "async loginFacebook() {\n try {\n let result = await LoginManager.logInWithReadPermissions([\n \"public_profile\"\n ]);\n if (result.isCancelled) {\n alert(\"Lgin was cancelled\");\n } else {\n alert(\n \"Login was successful with permissions:\" +\n result.grantedPermissions.toString()\n );\n }\n } catch (error) {\n alert(\"Login failed with error\" + error);\n }\n }", "title": "" }, { "docid": "dd8afe424525ca9017af16d58ba71050", "score": "0.46607453", "text": "renderNativeIOS() {\n const {\n children,\n style: { shadowOffset = { width: 0, height: 0 }, ...otherStyle },\n ...otherProps\n } = this.props;\n return (\n <View style={{ shadowOffset, ...otherStyle }} {...otherProps}>\n {children}\n </View>\n );\n }", "title": "" }, { "docid": "ac6568d09f221aa43c0ad988ba2313b5", "score": "0.4657822", "text": "_onMediaStreamError(e) {\n\t\tconsole.error(e);\n\t}", "title": "" }, { "docid": "0ac6c152f822ac9d6a0159b2c6c9cc1c", "score": "0.46574673", "text": "onUnmount() {\n \n }", "title": "" }, { "docid": "56624345a2dde4d95eaf14febe38f007", "score": "0.4650726", "text": "componentDidMount () {\n }", "title": "" }, { "docid": "da8b4437f295ad271d7a92101377626f", "score": "0.4650425", "text": "connectedCallback () {\n\n }", "title": "" }, { "docid": "b9d8022e77cd3b92b739a4dd4aae67fb", "score": "0.4648069", "text": "function loadFB() {\n (function (d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) { return; }\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/sdk.js\";\n fjs.parentNode.insertBefore(js, fjs);\n } (document, 'script', 'facebook-jssdk'));\n}", "title": "" }, { "docid": "8d862d1be3343c570892618c3602822e", "score": "0.46472496", "text": "componentWillUnmount() {\n //\n }", "title": "" }, { "docid": "0453b16d4cacfdb0531a0886c9c14ab0", "score": "0.46466598", "text": "connectedCallback() {\n \n }", "title": "" }, { "docid": "0ab78ae5b04e3d30dbe8011fcf654ece", "score": "0.46461657", "text": "componentWillUnmount() {\n \n }", "title": "" }, { "docid": "dd7e2ac33528da7b9e87c5b9c89c5fd3", "score": "0.46460593", "text": "componentWillUnmount() {\n }", "title": "" }, { "docid": "dd7e2ac33528da7b9e87c5b9c89c5fd3", "score": "0.46460593", "text": "componentWillUnmount() {\n }", "title": "" }, { "docid": "2a31bc520dd218b67f046bf71b9ee196", "score": "0.46455806", "text": "function fbSignIn() {\n handleFbSignIn()\n .then(res => {\n handleResponse(res,true)\n })\n }", "title": "" }, { "docid": "ef579e5e5f9cf92e910ddee5c844b3d3", "score": "0.46453762", "text": "static createFactory() {\n return () => new ReactNative();\n }", "title": "" }, { "docid": "532d1b90cf9e62eed228b53bab074362", "score": "0.46443215", "text": "getInitialState() {\n return {\n fbToken: ''\n }\n }", "title": "" }, { "docid": "9fcad19b3bba4b288731a1ef096a473e", "score": "0.46316904", "text": "function everyframe(fn) {return Maestro.on('preframe', ()=> {fn(); return 0;} )}", "title": "" }, { "docid": "c868d2dce54883921027d0bbc2bdaba4", "score": "0.46207595", "text": "function initFB() {\n window.fbAsyncInit = function () {\n FB.init({\n appId: '263540411744939',\n cookie: true,\n xfbml: true,\n version: 'v8.0',\n })\n FB.AppEvents.logPageView()\n if (window.location.pathname.includes('/profile')) {\n checkLoginState()\n }\n }\n ;(function (d, s, id) {\n var js,\n fjs = d.getElementsByTagName(s)[0]\n if (d.getElementById(id)) {\n return\n }\n js = d.createElement(s)\n js.id = id\n js.src = 'https://connect.facebook.net/zh_TW/sdk.js'\n fjs.parentNode.insertBefore(js, fjs)\n })(document, 'script', 'facebook-jssdk')\n}", "title": "" }, { "docid": "d8b229f06141d158781819f66eb9ac67", "score": "0.46201426", "text": "function toFacebook(){\n window.open(\"https://www.facebook.com/profile.php?id=100011103131492\");\n}", "title": "" }, { "docid": "0ac879117f01703f674dc2a6cbc5b73b", "score": "0.46179876", "text": "onMessage() {}", "title": "" }, { "docid": "8b1073ac04c192bd62c30cc31f28132b", "score": "0.4616856", "text": "componentDidMount() {\n \n }", "title": "" }, { "docid": "451687c36a14e4a0becbd8fb7f796ce4", "score": "0.46132442", "text": "componentDidMount() {\n\n }", "title": "" }, { "docid": "451687c36a14e4a0becbd8fb7f796ce4", "score": "0.46132442", "text": "componentDidMount() {\n\n }", "title": "" }, { "docid": "451687c36a14e4a0becbd8fb7f796ce4", "score": "0.46132442", "text": "componentDidMount() {\n\n }", "title": "" }, { "docid": "451687c36a14e4a0becbd8fb7f796ce4", "score": "0.46132442", "text": "componentDidMount() {\n\n }", "title": "" }, { "docid": "451687c36a14e4a0becbd8fb7f796ce4", "score": "0.46132442", "text": "componentDidMount() {\n\n }", "title": "" }, { "docid": "451687c36a14e4a0becbd8fb7f796ce4", "score": "0.46132442", "text": "componentDidMount() {\n\n }", "title": "" }, { "docid": "451687c36a14e4a0becbd8fb7f796ce4", "score": "0.46132442", "text": "componentDidMount() {\n\n }", "title": "" }, { "docid": "c03d1877c2a89bc9cfbd4ae2d529166c", "score": "0.4611002", "text": "function connectToNativeHost(msg)\n{\n var nativeHostName = \"com.leo.test\";\n console.log(nativeHostName);\n port = chrome.runtime.connectNative(nativeHostName);\n port.onMessage.addListener(onNativeMessage);\n port.onDisconnect.addListener(onDisconnected);\n port.postMessage( msg);\n }", "title": "" }, { "docid": "cdc5dd9f86beeec653ef984387611bf7", "score": "0.46082908", "text": "function g(e){return function(){var t=arguments.length>0?arguments[arguments.length-1]:null,n=\"function\"==typeof t?Array.prototype.slice.call(arguments,0,arguments.length-1):Array.prototype.slice.call(arguments);return h.promiseOrCallback(t,t=>{this.readyState!==a.connected?this.on(\"open\",function(){e.apply(this,n.concat([function(e){t(e)}]))}):e.apply(this,n.concat([function(e){t(e)}]))})}}", "title": "" } ]
a2060efeb8b9dc0e58fd877711b9afd2
Markup a single file by plaing only feedback Items from a specific tool into the file
[ { "docid": "81b15ee0414db1aa7ae737b86bf0ecfd", "score": "0.71748054", "text": "function markupFile( file, selectedTool, feedbackItems )\n{\n var content = file.content;\n var offset = 0;\n\n var nextItem = null;\n var idArr = [];\n var matchClasses = \"\";\n\n for( var i = 0; i < feedbackItems.length; i++ )\n {\n var feedbackItem = feedbackItems[i];\n // Check for a specific tool and specific filename or all\n if( filesMatch(file.originalname, feedbackItem.filename) && toolsMatch(feedbackItem.toolName,selectedTool ) )\n {\n // Most have line number and character position.\n // Interestingly, calculating this value can give different answers...\n // I think it depends on line-breaks.\n // Momementarily setting this to always run.\n\n if( !feedbackItem.filename || !feedbackItem.target ) {\n // TODO: This should be handed a generic or global error system.\n continue;\n }\n else if( feedbackItem.lineNum == undefined || feedbackItem.charNum == undefined ){\n // Previously tried to setup positional information and failed.\n continue;\n }\n\n // Assumption should probably change\n var nextMatches = checkErrorOverlap(feedbackItems, i );\n if( nextMatches ) {\n // We have multiple errors on this word.\n matchClasses = \" multiError\";\n }\n\n idArr.push(i)\n if(!nextMatches)\n {\n // Assign either the multiError or the specific error type.\n // Also an array for the feedback Items array that match this error\n matchClasses = matchClasses == \"\" ? feedbackItems[i].type : matchClasses;\n\n //TODO JF: This helps fixes an issue, but keeping i vs idarr as it potentially reduces functionality but that functionality\n // Might be deprecated soon too. Essentially old method allows moving between errors on the readMore. This\n // fix remove that capability.\n //OLD var options = { 'classes': matchClasses, 'data': idArr , 'id': idArr, 'feedbackId':feedbackItems[i].id};\n var options = { 'classes': matchClasses, 'data': idArr , 'id': i, 'feedbackId':feedbackItems[i].id};\n\n // Create a popover button at position to highlight text and count the offset.\n // woops wont work with html sucks to suck\n var newStr = buttonMaker.createTextButton(feedbackItem, options);\n\n newStr.mid = newStr.mid.replace(/(<([^>]+)>)/ig,\"\");\n var str = newStr.start + newStr.mid + newStr.end;\n\n var contentObj = replaceText( content, {'needle':feedbackItem.target, 'newText':str, 'flags':\"gm\", 'targetPos': feedbackItem.charNum+offset, toolType: feedbackItem.runType } );\n\n content = contentObj.content;\n offset += ( (str.length - newStr.mid.length ) + contentObj.offset);\n idArr = [];\n\n // Reset data\n matchClasses = \"\";\n }\n }\n }\n return content;\n}", "title": "" } ]
[ { "docid": "61f1fba2ce282f005665aa0944ca8b1e", "score": "0.55193317", "text": "function makeMarkup () {\n\n\tcharList = document.getElementById('in').value\n\tcharList = charList.replace(/ /g,'')\n\tchars = [...charList]\n type = index[chars[0]].status\n\tout = '<figure class=\"'+type+'Box auto noindex indexline\" data-cols=\"\" data-links=\"'\n\tfor (i=0;i<chars.length;i++) {\n\t\tout += index[chars[i]].section+','\n\t\t}\n\t//out +='\" data-notes=\"'\n \t//for (i=0;i<chars.length;i++) {\n\t//\tout += index[chars[i]].sectionName+','\n\t//\t}\n out += '\">'+chars.join('␣')+'</figure>'\n\tdocument.getElementById('out').value = out\n\tdocument.getElementById('out').select()\n\t}", "title": "" }, { "docid": "61f1fba2ce282f005665aa0944ca8b1e", "score": "0.55193317", "text": "function makeMarkup () {\n\n\tcharList = document.getElementById('in').value\n\tcharList = charList.replace(/ /g,'')\n\tchars = [...charList]\n type = index[chars[0]].status\n\tout = '<figure class=\"'+type+'Box auto noindex indexline\" data-cols=\"\" data-links=\"'\n\tfor (i=0;i<chars.length;i++) {\n\t\tout += index[chars[i]].section+','\n\t\t}\n\t//out +='\" data-notes=\"'\n \t//for (i=0;i<chars.length;i++) {\n\t//\tout += index[chars[i]].sectionName+','\n\t//\t}\n out += '\">'+chars.join('␣')+'</figure>'\n\tdocument.getElementById('out').value = out\n\tdocument.getElementById('out').select()\n\t}", "title": "" }, { "docid": "a7a1adba5f9a484289b00b09deed1b02", "score": "0.5369052", "text": "function FileTemplateAdder() {\n\tvar tempOptions = {\n\t\t'{{Jpeg}}': '.JPG',\n\t\t'{{Trans}}': 'Needs trans',\n\t\t'{{Imagequality}}': 'Poor quality'\n\t};\n if (wgUserGroups.indexOf(\"sysop\") != -1) {\n tempOptions['{{SDS}}'] = \"SDS\";\n }\n\tvar tempOptStr = '';\n\tfor(i in tempOptions) {\n\t\ttempOptStr += '<option value=\"' + i + '\" style=\"text-align:center;\">' + tempOptions[i] + '</option>';\n\t}\n \tvar html = '<p style=\"text-align:center;\" class=\"TemplateAdder\"><select id=\"FileTemplateAdder\">' + tempOptStr + '</select>&nbsp;<a class=\"wikia-button\" style=\"margin:0 1em; cursor:pointer;\" id=\"templateSubmit\">Add template</a>';\n\t$('#filetoc').append(html);\n\t$('#templateSubmit').click(function(event) {\n\t\tthis.innerHTML = '<img src=\"https://images.wikia.nocookie.net/dev/images/8/82/Facebook_throbber.gif\" style=\"vertical-align: baseline;\" border=\"0\" />';\n\t\t$.getJSON(\"/api.php\", {action: \"query\", prop: \"info\", titles: wgPageName, intoken: \"edit\", format: \"json\", indexpageids: 1}, function(json) {\n\t\t\tvar pageIdentification = json.query.pageids[0];\n\t\t\tvar pageToken = json.query.pages[pageIdentification].edittoken;\n\t\t\t$.post(\"/api.php\", {action: \"edit\", title: wgPageName, token: pageToken, bot: true, prependtext: $('#FileTemplateAdder').val() + \"\\n\"}, function (result) {$(\".TemplateAdder\").remove();});\n\t\t});\n\t});\n}", "title": "" }, { "docid": "b970b6e82fa29d6aef49bd702ec2bfd7", "score": "0.53354996", "text": "_generateMarkup()\n {\n\n }", "title": "" }, { "docid": "11c550491d95e08e97fc875b7c5dd85f", "score": "0.5307891", "text": "function runActiveMarkup(e, el) {\n markupTools[activeTool][0](e, el);\n }", "title": "" }, { "docid": "47ff236cf3ec4249300d1d7ff508327a", "score": "0.52614814", "text": "function superTextile(s, tiddlerTitle) {\r\nstart_timer(\"superTextile\");\r\n\r\n function regex_quote(str)\r\n {\r\n \treturn str.replace(/([\\*\\?\\+\\^\\?])/g, \"\\\\$1\");\r\n }\r\n\r\n\t\r\n\tvar class_id='(?:\\\\(([^#]*)(?:#(.*))?\\\\))?';\r\n\tvar style=\"(?:\\\\{([^}]*)})?\";\r\n\tvar attributes=class_id+style;\r\n\t\r\n\t/* things we will match later \r\n\t put them up top to save execution time later */\r\n\tvar footnote = '^fn([\\\\d]*)' + attributes + '\\\\.(.+)';\r\n\t \r\n var text = s;\r\n\r\n\tA_HLGN = /(?:(?:<>|<|>|\\=|[()]+)+)/;\r\n\tA_VLGN = /[\\-^~]/;\r\n\tC_CLAS = '(?:\\\\([^)]+\\\\))';\r\n//\tC_LNGE = '(?:\\[[^\\]]+\\])';\r\n\tC_LNGE = '(?:\\\\[[^\\\\]]+\\\\])';\r\n\tC_STYL = '(?:\\{[^}]+\\})';\r\n// S_CSPN = '(?:\\\\\\\\\\d+)'\r\n// S_RSPN = '(?:/\\d+)'\r\n A = \"(?:\" + A_HLGN +\"?\" + A_VLGN + \"?|\" + A_VLGN + \"?\" + A_HLGN + \"?)\";\r\n \r\n A = \"\";\r\n// S = \"(?:#{S_CSPN}?#{S_RSPN}|#{S_RSPN}?#{S_CSPN}?)\"\r\n C = '(?:' +C_CLAS+'?'+C_STYL+'?'+C_LNGE+'?|' + C_STYL+'?'+C_LNGE+'?'+C_CLAS+'?|' +C_LNGE+'?'+C_STYL+'?'+C_CLAS +'?)';\r\n//\tC=\"(?:\" +C_LNGE+ '?)';\r\n\r\n GLYPHS =[\r\n [ /([^\\s\\[{(>])\"/, '$1&#8221;' ], \t\t// double closing\r\n\t [ /\"(?=\\s|[#{PUNCT}])/, '&#8221;' ], \t// double closing\t\r\n\t\t\t\t[ /\"/, '&#8220;' ], \t\t\t\t\t\t\t// double opening\r\n//\t\t\t\t[ /\\b( )?\\.{3}/g, '$1&#8230;' ], \t\t// ellipsis\r\n\t\t\t\t[ /\\b([A-Z][A-Z0-9]{2,})\\b(?:[(]([^)]*)[)])/, \r\n\t\t\t\t'<acronym title=\"$2\">$1</acronym>' ], // 3+ uppercase acronym\r\n\t\t\t\t[ /(\\.\\s)?\\s?--\\s?/g, '$1&#8212;' ], \t// em dash\r\n \t\t[ /\\s->\\s/g, ' &rarr; ' ], \t\t\t\t// right arrow\r\n\t\t [ /\\s-\\s/g, ' &#8211; ' ], \t\t\t\t// en dash\r\n//\t \t\t[ /(\\d+) ?x ?(\\d+)/g, '$1&#215;$2' ], \t// dimension sign\r\n\t \t\t\t[ /\\b ?[(\\[]TM[\\])]/ig, '&#8482;' ], \t// trademark\r\n\t\t\t\t[ /\\b ?[(\\[]R[\\])]/ig, '&#174;' ], \t\t// registered\r\n\t\t\t\t[ /\\b ?[(\\[]C[\\])]/ig, '&#169;' ] \t\t// copyright\r\n//\t\t\t\t[ /\\b ?[(\\[](?:C|R|TM)[\\])]/ig, '&#169;' ] \t// special symbols\r\n \t\t];\r\n \t\t\r\n QTAGS = [\r\n//\t\t\t\t['**', 'b'],\r\n\t\t\t\t['*', 'strong'],\r\n\t\t\t\t['??', 'cite', \"limit\"],\r\n\t\t\t\t['-', 'del', \"limit\"],\r\n//\t\t\t\t['__', 'i'],\r\n\t\t\t\t['_', 'em', \"limit\"],\r\n\t\t\t\t['%', 'span', \"limit\"],\r\n\t\t\t\t['+', 'ins', \"limit\"],\r\n\t\t\t\t['^', 'sup'],\r\n\t\t\t\t['~', 'sub']\r\n//\t\t\t\t['**|*|__|^|~','strong']\r\n ];\r\n SIMPLE_HTML_TAGS = [\r\n \t'tt', 'b', 'i', 'big', 'small', 'em', 'strong', 'dfn', 'code',\r\n 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'a', 'img', 'br',\r\n 'br', 'map', 'q', 'sub', 'sup', 'span', 'bdo', \"hr\"];\r\n\t\r\n\tCODE_RE = /(\\W)@(?:\\|(\\w+?)\\|)?(.+?)@(?=\\W)/;\r\n\t\r\n\tfunction inline_textile_code(text)\r\n\t{\r\n\tstart_timer();\r\n\tmatch=CODE_RE.exec(text);\r\n\twhile (match!=null)\r\n \t{\r\n \t\tif (match[2]!=undefined)\r\n \t\t\tlang=\" lang=\\\"\" + match[2] + \"\\\"\";\r\n \t\telse\r\n \t\t\tlang=\"\";\r\n \t\tout=match[1] + \"<code\" + lang + \">\" + match[3] + \"</code>\";\r\n\t\t\ttext=text.replace(match[0],out);\r\n \t\tmatch=CODE_RE.exec(text);\r\n \t}\r\n stop_timer(\"inline_textile_code\");\r\n\treturn text;\r\n\t}\r\n\t\r\n\tfunction inline_textile_glyphs(text)\r\n\t{\r\n start_timer();\r\n for (i=0; i<GLYPHS.length; i++)\r\n \ttext=text.replace(GLYPHS[i][0],GLYPHS[i][1]);\r\n stop_timer(\"glyphs\");\r\n return text;\r\n }\r\n \r\n start_timer();\r\n for (i=0; i<QTAGS.length; i++)\r\n {\r\n \tqtag=regex_quote(QTAGS[i][0]);\r\n \tif (QTAGS[i][2]==\"limit\")\r\n \t{\r\n//\t \tqtag_re=\"(\\\\W)\"+ \"(\"+qtag+\")\" + \"(?::(\\S+?))?\"+\"(.+?)\"+\"(\"+qtag +\")\"+\"(?=\\\\W)\";\r\n//\t \tqtag_re=\"(\\\\W)\"+ \"(\"+qtag+\")\" + \"(.+?)\"+\"(\"+qtag +\")\"+\"(?=\\\\W)\";\r\n\t\tqtag_re=\"(\\\\W)\"+ \"(\"+qtag+\")(\" + C + \")\" + \"(?::(\\S+?))?\"+\"(.+?)\"+\"(\"+qtag +\")\"+\"(?=\\\\W)\";\r\n\t\t\tQTAGS[i][4]=new RegExp(qtag_re,\"g\");\r\n \t}\r\n \telse\r\n \t{\r\n// \t \tqtag_re=\"(\"+qtag+\")\"+\"(?::(\\\\S+?))?\"+\"(.+?)\"+\"(\"+qtag+\")\";\r\n\t\t\tqtag_re=\"(\"+qtag+\")(\" + C + \")\"+\"(?::(\\\\S+?))?\"+\"(.+?)\"+\"(\"+qtag+\")\";\r\n//\t\t\tqtag_re=\"(\"+qtag+\")\"+\"(.+?)\"+\"(\"+qtag+\")\";\r\n//\t\t\tqtag_re=\"[^*-^~](\"+qtag+\")\"+\"(.+?)\"+\"(\"+qtag+\")\";\r\n//\t\t\tqtag_re=\"(\"+qtag+\")\"+\"([^\" + qtag + \"]+)\"+\"(\"+qtag+\")\";\t\t\t\r\n\t \tQTAGS[i][4]=new RegExp(qtag_re,\"g\");\r\n \t}\r\n }\r\n\r\n\tfunction inline_textile_span(text)\r\n\t{\r\n\tstart_timer();\r\n for (i=0; i<QTAGS.length; i++)\r\n {\r\n \thtag=QTAGS[i][1];\r\n\t\tqtag_re=QTAGS[i][4];\r\n\t\t\r\n/*\r\n\t\t// fast replaces maybe?\r\n\t\treplace all without any special attributes with one fast regex\r\n\t\treplace all WITH ONLY special regex (so we don't hit anything twice) next\r\n\t\t\r\n\t\tpositve lookahead for { or (\r\n\t\t(?=[{(])\r\n*/\r\n\r\n\t\tif (QTAGS[i][2]==\"limit\")\r\n\t\t{\r\n\t\t\ttext=text.replace(qtag_re, function(str, sta, qtag, atts, cite, content) {\r\n\t\t\t\tatts=pba(atts);\r\n\t\t\t\tif (atts!=\"\")\r\n\t\t\t\t\tshelve(atts);\r\n \t\t\treturn sta + \"<\" +htag + atts + \">\" + content + \"</\" + htag + \">\";\t}\r\n\t\t\t\t);\r\n\t\t}\r\n\t\telse\r\n\t\t\ttext=text.replace(qtag_re, function(str, qtag, atts, cite, content) {\r\n\t\t\t\tatts=pba(atts);\r\n\t\t\t\tif (atts!=\"\")\r\n\t\t\t\t\tshelve(atts);\r\n \t\t\treturn \"<\" +htag + atts + \">\" + content + \"</\" + htag + \">\";\t}\r\n\t\t\t\t);\r\n\t\tcontinue;\r\n\t }\r\n stop_timer(\"QTAGS\");\r\n return text;\r\n }\r\n \t\t\r\n // links\r\n PUNCT=\"\";\r\n\tLINK_RE = new RegExp(\r\n//\t\t\t\t'([\\s\\\\[{(]|[' + PUNCT + '])?' + // $pre\r\n '\"' + // start\r\n '(' + C +')' + // $atts\r\n '([^\"]+?)' + // $text\r\n '\\\\s?' +\r\n// '(?:\\(([^)]+?)\\)(?=\"))?' + // $title\r\n\t\t\t\t'(?:\\\\(([^)]+?)\\\\))?' +\r\n '\":' + \r\n '(\\\\S+?)' + // $url\r\n '(\\/)?' + // $slash\r\n '([^\\\\w\\/;]*?)' + // $post\r\n '(?=<|\\\\s|$)' \r\n ,\"g\");\r\n\t\r\n\tfunction define(s)\r\n\t{\r\n\t\tif (s==undefined)\r\n\t\t\treturn \"\";\r\n\t\telse\r\n\t\t\treturn s;\r\n\t}\r\n\r\n function inline_textile_link(text)\r\n {\r\n\t start_timer();\r\n\t \r\n\t text=text.replace(LINK_RE,function (str, atts, content, title, url, slash, post)\r\n\t \t{\r\n\t\t\tatts=pba(atts);\r\n\t\t\tatts+=\" href=\\\"\" + url + slash + \"\\\"\";\r\n\t\t\tif (define(title)!=\"\")\r\n\t\t\t\tatts+=\" title=\\\"\" + title + \"\\\"\";\r\n\t\t\tatts=shelve(atts);\r\n\t \treturn \"<a\" +atts + \">\" + content + \"</a>\" + post ;\r\n\t \t}\r\n\t );\r\n \r\n stop_timer(\"textile links\");\r\n return text;\r\n }\r\n\r\n // images\r\n // TODO - replace with RedCloth\r\n function inline_textile_image(text)\r\n {\r\n start_timer();\r\n re = new RegExp('!\\\\b(.+?)\\\\(\\\\b(.+?)\\\\b\\\\)!','g');\r\n text = text.replace(re,'<img src=\"$1\" alt=\"$2\">');\r\n re = new RegExp('!\\\\b(.+?)\\\\b!','g');\r\n text = text.replace(re,'<img src=\"$1\">');\r\n stop_timer(\"texttile images\");\r\n return text;\r\n }\r\n\r\n\tfunction lT(text)\r\n\t{\r\n\t\treturn (text.charAt(0)==\"*\") ? \"ul\" : \"ol\" ;\r\n\t}\r\n\r\n//\t LISTS_RE = /^([#*]+?#{C} .*?)$(?![^#*])/m\r\n//\tLISTS_RE = /^([#*]+? (.|\\n)*?)$(?![^#*])/m\r\n//\tLISTS_RE = /^([#*]+? (.|\\n)*?)$(?=^[^#*])/m\r\n\r\n\r\n//\tLISTS_RE = /(?:^([#*]+? .*?)$)*(?=^[^#*])/m\r\n\tLISTS_RE = /(^([#*]+? .*?)(?:\\n|$))+/m\r\n// LISTS_CONTENT_RE = /^([#*]+)(#{A}#{C}) (.*)$/m\r\n\tLISTS_CONTENT_RE = /^([#*]+) (.*)$/m\r\n\r\n\tfunction block_textile_lists(text)\r\n\t{\r\n\tstart_timer(\"block_textile_lists\");\r\n\t\r\n/*\r\n// lambda does not appear faster here for some reason\r\n\ttext=text.replace(LISTS_RE, function(str)\r\n\t{\r\n*/\r\n\ti=0;\r\n\tmatch=LISTS_RE.exec(text);\r\n\twhile (match!=null)\r\n \t{\r\n \t\tif (i>100)\r\n \t\t\t{\r\n \t\t\talert(\"killing loops\");\r\n \t\t\tbreak;\r\n \t\t\t}\r\n \t\ti++;\r\n\t\tlines = match[0].split('\\n');\r\n\r\n//\t\tlines=str.split('\\n');\r\n last_line = -1\r\n depth = new Array();\r\n line_id=0;\r\n block_applied++;\r\n for (line_id=0; line_id<lines.length; line_id++)\r\n {\r\n \tline=lines[line_id];\r\n\t\t\tif (mat=LISTS_CONTENT_RE.exec(line))\r\n\t\t\t{\r\n\t\t\t\t//tl,atts,content = $~[1..3]\r\n\t\t\t\ttl=mat[1]\r\n content=mat[2]\r\n if (depth.last())\r\n {\r\n \twhile (depth.last().length > tl.length)\r\n \t{\r\n \t\tlines[line_id-1]+=\"</li>\\n\\t</\"+ lT (depth[depth.length-1])+ \">\";\r\n \t\tdepth.pop();\r\n \t}\r\n \tif (depth.last().length==tl.length)\r\n \t\tlines[line_id-1]+=\"</li>\";\r\n \t\r\n }\r\n if (depth.last()!=tl)\r\n {\r\n \tdepth.push(tl);\r\n \t// attrs stuff\r\n \tlines[line_id] = \"\\t<\" + lT(tl) + \">\\n\\t<li>\" + content;\r\n }\r\n else\r\n \tlines[line_id] = \"\\t\\t<li>\" + content;\r\n last_line=line_id\r\n }\r\n else\r\n {\r\n last_line=line_id\r\n\t\t\t}\r\n\t\t\tif (((line_id - last_line) >1) || (line_id==(lines.length-1)))\r\n\t\t\t{\r\n\t\t\t\twhile (depth.last())\r\n\t\t\t\t{\r\n\t\t\t\t\tlines[last_line]+=\"</li>\\n\\t</\"+ lT (depth[depth.length-1])+ \">\";\r\n \t\tdepth.pop();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n out=lines.join( \"\\n\" );\r\n\t\ttext=text.replace(match[0],out);\r\n \t\tmatch=LISTS_RE.exec(text);\r\n//\t\treturn lines.join (\"\\n\");\r\n \t}//);\r\n\r\n\tadd_timer(\"block_textile_lists\");\r\n//\talert(text);\r\n\treturn text;\t\r\n\t}\r\n\t\r\n\tfunction clean_white_space(text)\r\n\t{\r\n\tstart_timer();\r\n\ttext=text.replace( /\\r\\n/g, \"\\n\");\r\n\ttext=text.replace( /\\r/g, \"\\n\" );\r\n text=text.replace( /\\t/g, ' ' );\r\n text=text.replace( /^ +$/g, '' );\r\n text=text.replace( /\\n{3,}/g, \"\\n\\n\" );\r\n text=text.replace( /\"$/g, \"\\\" \" );\r\n\t\r\n\t// text=flush_left(text);\r\n\tstop_timer(\"clean_white_space\");\r\n\treturn text;\r\n\t}\r\n\r\n\t// footnote references\r\n\t// FIX FIX FIX\r\n\t re = new RegExp('([^\\\\s])\\\\[(\\\\d*)\\\\]','g');\r\n\t text=text.replace(re, '$1<sup><a href=\"#fn$2\">$2</a></sup>');\r\n\r\nfunction textile_p(tag, atts, cite, content)\r\n{\r\n\tif (atts!=\"\")\r\n\t\tatts=shelve(atts);\r\n\treturn \"\\t<\" + tag + atts +\">\" + content + \"</\" + tag + \">\";\r\n}\r\n\r\nfunction textile_fn_( tag, num, atts, cite, content )\r\n{\r\n \tatts += \" id=\\\"fn\" + num + \"\\\"\"\r\n\tif (atts!=\"\")\r\n\t\tatts=shelve(atts);\r\n\tcontent = \"<sup>\" + num + \"</sup>\" + content;\r\n\treturn \"<p\" + atts + \">\" + content + \"</p>\";\r\n}\r\n\r\nfunction textile_bq( tag, atts, cite, content )\r\n{\r\n//\tcite, cite_title = check_refs( cite )\r\n\tif (cite==undefined)\r\n\t\tcite=\"\";\r\n\telse\r\n\t\tcite = \" cite=\\\"\" + cite + \"\\\"\";\r\n\tif (atts!=\"\")\r\n\t\tatts=shelve(atts);\r\n\treturn \"\\t<blockquote\" + cite + \">\\n\\t\\t<p\" + atts +\">\" + content + \"</p>\\n\\t</blockquote>\"\r\n}\r\n\r\n\r\nfunction pba(text, element)\r\n{\r\n\tif (text==undefined)\treturn;\r\n\tid=\"\"; cls=\"\"; style=\"\"; lang=\"\";\r\n\t\r\n\tif (mat=/\\{([^}]*)\\}/.exec(text))\r\n\t\tstyle+=mat[1];\r\n\tif (mat= /\\[([^)]+?)\\]/.exec(text))\r\n\t\tlang=mat[1];\r\n\tif (mat= /\\(([^()]+?)\\)/.exec(text))\r\n\t\tcls=mat[1];\r\n\t\r\n\tif (cls!=\"\")\r\n\t\tif (mat= /^(.*?)#(.*)$/.exec(cls))\r\n\t\t{\r\n\t\tcls=mat[1];\r\n\t\tid=mat[2];\r\n\t\t}\r\n\t\r\n\tatts=\"\";\r\n\tif (style!=\"\") atts += \" style=\\\"\" + style + \"\\\"\";\r\n\tif (lang!=\"\") atts += \" lang=\\\"\" + lang + \"\\\"\";\r\n\tif (cls!=\"\") atts += \" class=\\\"\" + cls + \"\\\"\";\r\n\tif (id!=\"\") atts += \" id=\\\"\" + id + \"\\\"\";\r\n\treturn atts;\r\n}\r\n\r\n//BLOCK_RE = /^(([a-z]+)(\\d*))(#{A}#{C})\\.(?::(\\S+))? (.*)$/m\r\n//BLOCK_RE = /^(([a-z]+)(\\d*))\\.(?::(\\S+))? (.*)$/m\r\nBLOCK_RE = new RegExp('^(([a-z]+)(\\\\d*))(' + A + C + ')\\.(?::(\\S+))? (.*)$','m');\r\n\r\nfunction block_textile_prefix(text)\r\n{\r\n\tvar out=\"\";\r\n\tstart_timer(\"block_textile_prefix\");\r\n\t\r\n\ttext=text=text.replace(BLOCK_RE,\r\n\t\tfunction(str,tag,tagpre,num,atts,cite,content)\r\n\t\t{\r\n\t\t\tatts=pba(atts);\r\n\t\t\tblock_applied++;\r\n\t\t\tif (tag.charAt(0)==\"p\" || tag.charAt(0)==\"h\")\r\n\t\t\t \tout=textile_p(tag,atts,cite,content);\r\n\t\t\tif (tag.charAt(0)==\"f\")\r\n\t\t\t\tout=textile_fn_(tag,num,atts,cite,content);\r\n\t\t\tif (tag.charAt(0)==\"b\")\r\n\t\t\t\tout=textile_bq (tag, atts, cite, content);\r\n\t\t\treturn out;\r\n\t\t}\r\n\t);\r\n\r\n\tadd_timer(\"block_textile_prefix\");\r\n\treturn text;\r\n\r\n}\r\n\r\nfunction block_textile_table(text)\r\n{\r\nstart_timer(\"block_textile_table\");\r\nadd_timer(\"block_textile_table\");\r\nreturn text;\r\n}\r\n\r\nfunction hard_break(text)\r\n{\r\nstart_timer();\r\ntext=text.replace( /(.)\\n(?! *[#*\\s|]|$)/g, \"$1<br />\");\r\nstop_timer(\"hard_break\");\r\nreturn text;\r\n}\r\n\r\nfunction incoming_entities(text)\r\n{\r\nstart_timer();\r\ntext=text.replace( /&(?![#a-z0-9]+;)/i, \"x%x%\" )\r\nstop_timer(\"incoming_entities\");\r\nreturn text;\r\n}\r\n\r\nfunction no_textile(text)\r\n{\r\nstart_timer();\r\ntext.replace( /(^|\\s)==([^=]+.*?)==(\\s|$)?/,\r\n '$1<notextile>$2</notextile>$3' );\r\ntext.replace( /^ *==([^=]+.*?)==/m,\r\n '$1<notextile>$2</notextile>$3' );\r\nstop_timer(\"no_texttile\");\r\nreturn text;\r\n}\r\n\r\nBLOCKS_GROUP_RE = /\\n{2,}(?! )/m\r\n\r\n\r\nvar block_applied=0;\r\nfunction blocks(text, deep_code)\r\n{\r\n\tstart_timer(\"blocks\");\r\n\tblks=text.split(BLOCKS_GROUP_RE);\r\n\tfor (var k=0; k<blks.length; k++)\r\n\t{\r\n\t\tblk=blks[k];\r\n\t\t//alert(blk);\r\n\t\tplain = ! /\\A[#*> ]/.test(blk);\r\n\t\tmatch=/^<\\/?(\\w+).*>/.exec(blk)\r\n\t\tif (match && ! SIMPLE_HTML_TAGS.find(match[1]) )\r\n\t\t\tbreak;\r\n\t\telse\r\n\t\t{\r\n//\t\tblk.strip!\r\n// if blk.empty?\r\n// blk\r\n// else\r\n \t\tcode_blk=\"\";\r\n//\t\tblk.gsub!( /((?:\\n(?:\\n^ +[^\\n]*)+)+)/m ) do |iblk|\r\n//\t\t\tflush_left iblk\r\n//\t\t\tblocks iblk, plain\r\n//\t\t\tiblk.gsub( /^(\\S)/, \"\\t\\\\1\" )\r\n//\t\t\tif plain\r\n//\t\t\t\tcode_blk = iblk; \"\"\r\n//\t\t\telse\r\n//\t\t\t\tiblk\r\n//\t\t\tend\r\n//\t\tend\r\n\t\tblock_applied=0;\r\n//\t\tif (/^| /.test(blk)) // save speed\r\n//\t\t\tblk=block_textile_table(blk);\t\t// RedCloth\r\n\t\tif (/^[#*] /m.test(blk)) // save speed\r\n\t\t\tblk=block_textile_lists(blk);\t\t// RedCloth\r\n//\t\tif (/^.+?\\. /.test(blk)) // save speed\r\n\t\t\tblk=block_textile_prefix(blk);\t// RedCloth\t\r\n\t\tif (block_applied==0)\r\n\t\t\tif (deep_code)\r\n\t\t\t\tblk=\"\\t<pre><code>\" + blk + \"</code></pre>\";\r\n\t\t\telse\r\n\t\t\t\tblk=\"\\t<p>\" + blk + \"</p>\";\r\n\t\tblk+=\"\\n\" + code_blk;\r\n\t\t}\r\n\t\tblks[k]=blk;\r\n\t}\r\n\r\n\ttext=blks.join(\"\\n\\n\");\r\n\tstop_timer(\"blocks\", blks.length + \" items\");\r\n\treturn text;\r\n}\r\n\r\nfunction shelve(text)\r\n{\r\nshelf.push(text);\r\nreturn \" <\" + shelf.length + \">\";\r\n}\r\n\r\nSHELVED_RE= / <(\\d+)>/g;\r\n\r\nfunction retrieve_text(text)\r\n{\r\n\tstart_timer();\r\n\tlen=shelf.length;\r\n\r\n\ttext=text.replace(SHELVED_RE,function(str, i) {\r\n\t\treturn shelf[i-1]; }\r\n\t\t);\r\n\tstop_timer(\"retrieve_text\",len + \" items\");\r\n\treturn text;\r\n\t\t\r\n/* Original RedCloth, SLOW\r\n\twhile (shelf.last())\r\n\t\ttext=text.replace(\" <\" + shelf.length + \">\", shelf.pop());\r\n*/\r\n}\r\n\r\nWIKI_RE=new RegExp(wikiNamePattern,\"g\");\r\nBRACKET_RE=new RegExp(bracketNamePattern,\"g\");\r\n\r\nfunction inline_textile_tiddlylinks(text)\r\n{\r\n\tstart_timer();\r\n\t\r\n\ttext=text.replace(WIKI_RE, function(str) {\r\n\t\treturn createTiddlyLink(\"html\",str,true);\t}\r\n\t\t);\r\n\ttext=text.replace(BRACKET_RE, function(str,title) {\r\n\t\treturn createTiddlyLink(\"html\",title,true);\t}\r\n\t\t);\r\n\t\r\n\tstop_timer(\"inline_textile_tiddlywiki\");\r\n\treturn text;\r\n}\r\n\r\n\r\nMACRO_RE= new RegExp(\"<<([^>\\\\s]+)(?:\\\\s*)([^>]*)>>\",\"g\");\r\n\r\nfunction rip_macros(text)\r\n{\r\n\tstart_timer();\r\n\ttext=text.replace(MACRO_RE, function(str,macroName,macroParams)\r\n\t{ return shelve(str); }\r\n\t);\r\n\treturn text;\r\n}\r\n\r\n\r\nfunction inline_textile_macro(text)\r\n{\r\n\tstart_timer();\r\n\ttext=text.replace(MACRO_RE, function(str,macroName,macroParams) \r\n\t\t{\r\n\t\tvar params = macroParams.readMacroParams();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tvar macro = config.macros[macroName];\r\n\t\t\tif(macro && macro.handler)\r\n\t\t\t{\r\n\t\t\t\tplace=document.createElement(\"div\");\r\n\t\t\t\tplace.id=\"xxxxxx\" + tiddlerTitle;\r\n\t\t\t\tmacro.handler(place,macroName,params);\r\n\t\t\t\treturn place.innerHTML;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t//createTiddlyElement(place,\"span\",null,\"errorNoSuchMacro\",\"<<\" + macroName + \">>\");\r\n\t\t\t\treturn \"no such macro: \" + macro;\r\n\t\t}\r\n\t\tcatch(e)\r\n\t\t{\r\n\t\t\tdisplayMessage(config.messages.macroError.format([macroName]));\r\n\t\t\tdisplayMessage(e.toString());\r\n\t\t}\r\n\t\t}\r\n\t\t);\r\n\t\r\n\tstop_timer(\"inline_textile_macro\");\r\n\treturn text;\r\n}\r\n\r\n\tvar shelf=[];\r\n\r\n\ttext=incoming_entities(text);\t\t\t// RedCloth\r\n text=clean_white_space(text);\t\t\t// RedCloth\r\n text=no_textile(text);\t\t\t\t\t// RedCloth\r\n\r\n//\ttext=rip_offtags(text)\r\n\ttext=hard_break(text);\t\t\t\t\t// RedCloth\r\n//\ttext=refs_textile(text);\t\t\t\t// RedCloth\r\n\r\n\t// blocks\r\n\ttext=blocks(text);\r\n\ttotal_timer(\"block_textile_table\")\r\n\ttotal_timer(\"block_textile_lists\")\r\n\ttotal_timer(\"block_textile_prefix\");\r\n\r\n\t// inline processing\r\n\ttext=inline_textile_image(text); \r\n\ttext=inline_textile_link(text);\t\t// RedCloth\r\n\ttext=inline_textile_code(text);\t\t// RedCloth\r\n\ttext=inline_textile_glyphs(text);\t// RedCloth\r\n\ttext=inline_textile_span(text);\t\t// RedCloth\r\n\t\r\n\t// as long as we're called last we don't have to protect\r\n\t// attributes using the shelf which is good because\r\n\t// then I'd have to modify the createTiddlyLink function\r\n\t// even more, and that'd be bad\r\n\t\r\n\t// rip out macros so tiddlylinks doesn't eat them\r\n\ttext=rip_macros(text);\r\n\ttext=inline_textile_tiddlylinks(text);\t// TiddlyWiki\r\n\r\n// text=smooth_offtags(text);\r\n\t\r\n\ttext=retrieve_text(text);\r\n\ttext=inline_textile_macro(text);\t\t\t// TiddlyWiki\r\n\r\n\tstart_timer(\"final cleanup\");\r\n\ttext=text.replace( /<\\/?notextile>/, '' );\r\n\ttext=text.replace( \"x%x%\", '&#38;' );\r\n\tstop_timer(\"final cleanup\");\r\n\t\r\n\t\r\n//\talert(text);\r\n\tstop_timer(\"superTextile\");\r\n\treturn text;\r\n}", "title": "" }, { "docid": "281157533c614c45f0ea14520d06c71c", "score": "0.5208969", "text": "function main() {\r\t// set out unit style to pixels\r\tpreferences.rulerUnits = Units.PIXELS;\r\t//get current directory, modify or set for output\r var destination = Folder(app.activeDocument.fullName.parent).fsName; // destination folder\r \r // get the filename of whatever we dropped onto the droplet\r var droppedFile = app.activeDocument.fullName.name;\r var droppedFileName = decodeURI(droppedFile.substring(0, (droppedFile.indexOf(\".\") - 1))); // filename body part\r\r\t// check the dimensions of our current doc, error if it's not 7400x1575\r\tapp.activeDocument = originalDoc;\r\tvar originalWidth = originalDoc.width;\r\t//if we end up needing to fix this on the fly, here it is\r\t//originalDoc.resizeCanvas(7400, originalDoc.height, AnchorPosition.MIDDLELEFT);\r\t// set canvas size to 1575 top left\r\t//make fHR layer\r\t//gutter = 950 \r\tapp.activeDocument = originalDoc;\r\tnewLayer = originalDoc.paste();\r\tnewLayer.name = \"extendedLines\"\r\tvar curX = newLayer.bounds[0];\r\tvar curY = newLayer.bounds[1];\r\tnewLayer.translate(originalWidth - curX);\r\t\r\t// move to end of layer list\r\tvar numLayers = originalDoc.layers.length;\r\tvar lastLayer = originalDoc.layers[numLayers -1];\r\tnewLayer.move(lastLayer, ElementPlacement.PLACEAFTER);\r\t\r\tvar saveFile = new File((destination + \"/\" + droppedFileName + \"COMBINED.psd\"));\r originalDoc.saveAs(saveFile);\r originalDoc.close(SaveOptions.DONOTSAVECHANGES);\r additionalDoc.close(SaveOptions.DONOTSAVECHANGES);\r\r\tvar newRef = File(destination + \"/\" + droppedFileName + \"COMBINED.psd\");\r\tvar combinedDoc = app.open(newRef);\r}", "title": "" }, { "docid": "fa22b848f6e63e76f05299258b9be6df", "score": "0.51272506", "text": "function get_file_template(file)\n{\n\tvar l = 0;\n\tvar mm = file.org_caption.match(/(https?:\\/\\/[^\\s]+)/g);\n\tif(mm != null)l = 1;\n\tvar s = (10*100)/max_file_per_row;\n\thtml = '';\n\t\n\thtml += '<div class=\"col-lg-'+(12/max_file_per_row)+' file-holder file-'+file.fileId+'\" rel=\"'+file.fileId+'\" rel-type=\"'+file.file_type+'\">'+\n\t\t\t\t'<div class=\"file-holder-row-parent\">'+\n\t\t\t\t\t'<div class=\"row file-holder-row box effect7\">'+\n\t\t\t\t\t\t'<div class=\"row\">'+\n\t\t\t\t\t\t\t'<div class=\"col-lg-12 file-orig-label\" style=\"max-width:'+s+'px\"><input type=\"checkbox\" class=\"file-checkbox\"/>&nbsp;&nbsp;'+\n\t\t\t\t\t\t\t(file.orgName == '' ? '<br/>' : file.orgName)+'</div>'+\n\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t'<div class=\"row\" style=\"margin-left:15px\">'+\n\t\t\t\t\t\t\t'<div class=\"col-lg-12\">'+\n\t\t\t\t\t\t\t\t\t'<div class=\"pull-right\">'+\n\t\t\t\t\t\t\t\t\t\t'<span class=\"label label-'+(file.file_type == 'image' ? 'success' : 'danger')+'\">'+file.file_type+'</span>&nbsp;&nbsp;'+\n\t\t\t\t\t\t\t\t\t\t'<span class=\"post_now pointer\">'+\n\t\t\t\t\t\t\t\t\t\t\t'<i class=\"glyphicon glyphicon-share\" title=\"'+lang.post_now+'\"></i>'+\n\t\t\t\t\t\t\t\t\t\t'</span>&nbsp;&nbsp;'+\n\t\t\t\t\t\t\t\t\t\t'<span class=\"'+(file.file_type == 'video' ? 'edit_meta' : ( file.file_type == 'text' ? 'edit_link' : 'editor_open'))+' pointer\">'+\n\t\t\t\t\t\t\t\t\t\t\t'<i class=\"glyphicon glyphicon-cog\" title=\"'+lang.edit+'\"></i>'+\n\t\t\t\t\t\t\t\t\t\t'</span>&nbsp;&nbsp;'+\n\t\t\t\t\t\t\t\t\t\t'<span class=\"dwnload_file pointer\">'+\n\t\t\t\t\t\t\t\t\t\t\t'<a href=\"'+file.file_link+'\" target=\"_blank\" '+(file.file_type == 'text' ? 'download=\"status.txt\"' : '')+' class=\"dlink\"><i class=\"glyphicon glyphicon-download-alt\" title=\"'+lang.dw_file+'\"></i></a>'+\n\t\t\t\t\t\t\t\t\t\t'</span>&nbsp;&nbsp;'+\n\t\t\t\t\t\t\t\t\t\t'<span class=\"delete_file pointer\">'+\n\t\t\t\t\t\t\t\t\t\t\t'<i class=\"glyphicon glyphicon-trash\" title=\"'+lang.del_file+'\"></i>'+\n\t\t\t\t\t\t\t\t\t\t'</span>&nbsp;&nbsp;'+\n\t\t\t\t\t\t\t\t\t'</div>'+\t\t\n\t\t\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t'</div><br/>'+\n\t\t\t\t\t'<div class=\"row\">'+\n\t\t\t\t\t\t'<div class=\"col-lg-12 file-thumb-preview\" style=\"background:url(\\''+file.thumb+'\\')\">'+\n\t\t\t\t\t\t\t'<div class=\"bottom-right\">'+(file.duration != null ? '<span class=\"label label-info\">'+file.duration+'</span>' : (l == 0 ? '' : '<span class=\"label label-info\">Link</span>'))+'</div>'+\n\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t'</div><br/>'+\n\t\t\t\t\t'<div class=\"row\">'+\n\t\t\t\t\t\t'<div class=\"col-lg-12 file-caption-preview\">'+\n\t\t\t\t\t\t\t'<textarea class=\"form-control editor_text\" placeholder=\"'+lang.type_caption+'\">'+file.org_caption+'</textarea>'+\n\t\t\t\t\t\t'</div>'+\n\t\t\t\t\t'</div>'+\n\t\t\t\t'</div>'+\n\t\t\t '</div>';\n\treturn html;\n}", "title": "" }, { "docid": "b9d1c6624fd0f43522f2f82eb05cf6da", "score": "0.51237893", "text": "function processFile (fileURL) {\n if (!isHTMLType(fileURL))\n return;\n\n var curDOM = dw.getDocumentDOM(fileURL);\n\n // Library items don't have TITLE tags, and it's perfectly normal for a Template file\n // to be Unititled, so don't bother reporting on .lbi and .dwt files.\n if (curDOM.getIsLibraryDocument() || curDOM.getIsTemplateDocument())\n return;\n \n var frameList = curDOM.getElementsByTagName('title');\n \n if (frameList.length > 1) {\n reportItem(REP_ITEM_WARNING, fileURL, REPORT_TITLE_MULTIPLE, curDOM.nodeToSourceViewOffsets(frameList[1]));\n }\n // Report the redundant tag.\n //??? Might be helpful to have a list of errors so that other commands would\n //??? not report the same errors that had already been reported for a file.\n\n\n // The first title is the title that will be used. There should only be one, \n // so determine which is possibly a good title if there is one and recommend deleting the rest.\n //??? Where is the dw default? Localization.\n if (frameList.length < 1) {\n reportItem(REP_ITEM_WARNING, fileURL, REPORT_TITLE_NONE, null);\n } else if (isAllWhite(frameList[0].innerHTML)) { // We have at least one title\n reportItem(REP_ITEM_WARNING, fileURL, REPORT_TITLE_EMPTY, \n curDOM.nodeToSourceViewOffsets(frameList[0]));\n } else if (isDefaultName(frameList[0].innerHTML)) {\n reportItem(REP_ITEM_WARNING, fileURL, \n printString(REPORT_TITLE_DEFAULT, frameList[0].innerHTML),\n curDOM.nodeToSourceViewOffsets(frameList[0]));\n }\n}", "title": "" }, { "docid": "4b081e5a3113573a445f03be324a9e70", "score": "0.51166856", "text": "function toolbar() {\n\t\t\t\t\tvar tb = $(\"\\\n\t\t\t\t\t\t<div class='gre-toolbar' id='toolbar-\"+ element_id +\"'>\\\n\t\t\t\t\t\t\t<select>\\\n\t\t\t\t\t\t\t\t<option value=''>Block style</option>\\\n\t\t\t\t\t\t\t\t<option value='p'>Paragraph</option>\\\n\t\t\t\t\t\t\t\t<option value='h3'>Title</option>\\\n\t\t\t\t\t\t\t\t<option value='address'>Address</option>\\\n\t\t\t\t\t\t\t</select>\\\n\t\t\t\t\t\t\t<a href='#' class='bold'><i class='fa fa-bold'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='italic'><i class='fa fa-italic'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='underline'><i class='fa fa-underline'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='strikeThrough'><i class='fa fa-strikethrough'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='superscript'><i class='fa fa-superscript'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='subscript'><i class='fa fa-subscript'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='unorderedlist'><i class='fa fa-list-ul'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='orderedlist'><i class='fa fa-list-ol'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='justifyLeft'><i class='fa fa-align-left'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='justifyCenter'><i class='fa fa-align-center'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='justifyRight'><i class='fa fa-align-right'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='justifyFull'><i class='fa fa-align-justify'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='insertHorizontalRule'><i class='fa fa-minus'></i></a>\\\n\t\t\t\t\t\t\t<a href='#' class='disable'><i class='fas fa-times'></i></a>\\\n\t\t\t\t\t\t</div>\\\n\t\t\t\t\t\");\n\n\t\t\t\t\t$('select', tb).change(function () {\n\t\t\t\t\t\tvar index = this.selectedIndex;\n\t\t\t\t\t\tif (index !== 0) {\n\t\t\t\t\t\t\tvar selected = this.options[index].value;\n\t\t\t\t\t\t\tformatText('formatblock', '<' + selected + '>');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t$('.bold', tb).click(function () { formatText('bold');return false; });\n\t\t\t\t\t$('.italic', tb).click(function () { formatText('italic');return false; });\n\t\t\t\t\t$('.underline', tb).click(function () { formatText('underline');return false; });\n\t\t\t\t\t$('.strikeThrough', tb).click(function () { formatText('strikeThrough');return false; });\n\n\t\t\t\t\t$('.superscript', tb).click(function () { formatText('superscript');return false; });\n\t\t\t\t\t$('.subscript', tb).click(function () { formatText('subscript');return false; });\n\n\t\t\t\t\t$('.unorderedlist', tb).click(function () { formatText('insertunorderedlist');return false; });\n\t\t\t\t\t$('.orderedlist', tb).click(function () { formatText('insertorderedlist');return false; });\n\n\t\t\t\t\t$('.justifyLeft', tb).click(function () { formatText('justifyLeft');return false; });\n\t\t\t\t\t$('.justifyCenter', tb).click(function () { formatText('justifyCenter');return false; });\n\t\t\t\t\t$('.justifyRight', tb).click(function () { formatText('justifyRight');return false; });\n\t\t\t\t\t$('.justifyFull', tb).click(function () { formatText('justifyFull');return false; });\n\n\t\t\t\t\t$('.insertHorizontalRule', tb).click(function () { formatText('insertHorizontalRule');return false; });\n\n\t\t\t\t\t$('.disable', tb).click(function(){\n\t\t\t\t\t\tdisableDesignMode();\n\t\t\t\t\t\tvar edm = $('<small><a class=\"gre-minilink\" href=\"#\"><i class=\"fa fa-bars\"></i></a></small>');\n\t\t\t\t\t\ttb.empty().append(edm);\n\t\t\t\t\t\tedm.click(function(e){\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tenableDesignMode();\n\t\t\t\t\t\t\t$(this).remove();\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\n\t\t\t\t\t$(iframe).parents('form').submit(function(){\n\t\t\t\t\t\tdisableDesignMode(true);\n\t\t\t\t\t});\n\n\t\t\t\t\tvar iframeDoc = $(iframe.contentWindow.document);\n\n\t\t\t\t\tvar select = $('select', tb)[0];\n\t\t\t\t\tiframeDoc.mouseup(function(){\n\t\t\t\t\t\tsetSelectedType(getSelectionElement(), select);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t});\n\n\t\t\t\t\treturn tb;\n\t\t\t\t}", "title": "" }, { "docid": "5463778b04781b9d865cc1191fd8a44e", "score": "0.51021785", "text": "generate(items = null) {\n if (items != null) {this.items = items}\n this.generated = \"\"\n let editLink = this.editLinks ? '' : 'style=\"display: none;\"'\n for (let item in this.items) {\n item = this.items[item]\n let grade = (item.grade != \"\") ? `${item.grade}%` : 'Pending'\n let string = `\n <div class=\"item\" data-module-item-id=\"${item['id']}\">\n <div class=\"type\">?</div>\n <div class=\"details\">\n <h4>${item.name}</h4>\n <div class=\"weighting\">Weighting: ${item.weighting}%</div>\n </div>\n <div class=\"grade ${grade}\">${grade}</div>\n <div class=\"actions\" ${editLink}>Edit</div>\n </div>`\n\n this.generated += string.trim()\n }\n }", "title": "" }, { "docid": "9e893c9150a136720d47a0ff9c7f4ee4", "score": "0.5068815", "text": "function buildTemplate () {\n fs.writeFile(outputPath, render(teamArray), function(err) {\n if (err) {\n return console.log(err);\n }\n})}", "title": "" }, { "docid": "7bdc68ccb43b259ec8773ce5497bc11a", "score": "0.5064877", "text": "help() {\n return \"Edit a file's content<br/>usage: edit file\";\n }", "title": "" }, { "docid": "68412461e6728ad37862dd809916c130", "score": "0.50624484", "text": "function markup() {\n return gulp\n .src(paths.markups.src)\n // // //-> tag-include-html\n // .pipe(include())\n // .pipe(include({\n // begin:'<%',\n // end:'%>'\n // }))\n // // //-> end-tag-include-html\n // .pipe(data(function(file) {\n // return JSON.parse(fs.readFileSync(paths.data + path.basename(file.path) + '.json'));\n // }))\n .pipe(twig({\n data: {\n title: 'Gulp and Twig',\n benefits: [\n 'Fast',\n 'Flexible',\n 'Secure'\n ]\n }\n }))\n .pipe(gulp.dest(paths.markups.dest))\n .pipe(notify('listening markups...'))\n // Add browsersync stream pipe after compilation\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "bf64882cf69612e281b5f71371c064b1", "score": "0.5040998", "text": "function mijnUserInterface() {\r // Een functie die de interface elementen aanmaakt\r res = \"group{orientation:'column', alignment:['fill','fill'], alignChildren:['fill','fill'],\\\rmyImportPanel: Panel{text:'DC ABC_Import', orienttaion:'column',alignment:['fill','top'],alignChildren:['left','top'],\\\rmyPanelButton1: Button{text:'Import text from a txt file into group A, B and C'},\\\r},\\\r}\";\r}", "title": "" }, { "docid": "341a5ee3d952dcce7a2b358dafd68ad3", "score": "0.50407076", "text": "function attachToolbar(pre) {\n const copyButton = document.createElement(\"BUTTON\");\n copyButton.title = buttonCopy;\n copyButton.className = \"copy\";\n copyButton.innerHTML = \"<svg><use xlink:href='\" + iconFile + \"#copy'/></svg>\";\n copyButton.setAttribute(\"aria-label\", \"Copy to clipboard\");\n copyButton.addEventListener(\"mouseenter\", (e) => e.currentTarget.classList.add(\"toolbar-show\"));\n copyButton.addEventListener(\"mouseleave\", (e) => e.currentTarget.classList.remove(\"toolbar-show\"));\n\n const downloadButton = document.createElement(\"BUTTON\");\n downloadButton.title = buttonDownload;\n downloadButton.className = \"download\";\n downloadButton.innerHTML = \"<svg><use xlink:href='\" + iconFile + \"#download'/></svg>\";\n downloadButton.setAttribute(\"aria-label\", downloadButton.title);\n downloadButton.addEventListener(\"mouseenter\", (e) => e.currentTarget.classList.add(\"toolbar-show\"));\n downloadButton.addEventListener(\"mouseleave\", (e) => e.currentTarget.classList.remove(\"toolbar-show\"));\n\n downloadButton.addEventListener(\"click\", (e) => {\n const div = e.currentTarget.parentElement;\n const codes = div.getElementsByTagName(\"CODE\");\n if ((codes !== null) && (codes.length > 0)) {\n const code = codes[0];\n const text = getToolbarDivText(div);\n let downloadas = code.getAttribute(\"data-downloadas\");\n if (downloadas === null || downloadas === \"\") {\n let lang = \"\";\n for (let j = 0; j < code.classList.length; j++) {\n if (code.classList.item(j).startsWith(\"language-\")) {\n lang = code.classList.item(j).substr(9);\n break;\n }\n }\n\n if (lang.startsWith(\"command\")) {\n lang = \"bash\";\n } else if (lang === \"markdown\") {\n lang = \"md\";\n } else if (lang === \"\") {\n lang = \"txt\";\n }\n\n downloadas = docTitle + \".\" + lang;\n }\n saveFile(downloadas, text);\n }\n return true;\n });\n\n const printButton = document.createElement(\"BUTTON\");\n printButton.title = buttonPrint;\n printButton.className = \"print\";\n printButton.innerHTML = \"<svg><use xlink:href='\" + iconFile + \"#printer'/></svg>\";\n printButton.setAttribute(\"aria-label\", printButton.title);\n printButton.addEventListener(\"mouseenter\", (e) => e.currentTarget.classList.add(\"toolbar-show\"));\n printButton.addEventListener(\"mouseleave\", (e) => e.currentTarget.classList.remove(\"toolbar-show\"));\n\n printButton.addEventListener(\"click\", (e) => {\n const div = e.currentTarget.parentElement;\n const text = getToolbarDivText(div);\n printText(text);\n return true;\n });\n\n // wrap the PRE block in a DIV so we have a place to attach the toolbar buttons\n const div = document.createElement(\"DIV\");\n div.className = \"toolbar\";\n pre.parentElement.insertBefore(div, pre);\n div.appendChild(pre);\n div.appendChild(printButton);\n div.appendChild(downloadButton);\n div.appendChild(copyButton);\n\n pre.addEventListener(\"mouseenter\", (e) => {\n e.currentTarget.nextSibling.classList.add(\"toolbar-show\");\n e.currentTarget.nextSibling.nextSibling.classList.add(\"toolbar-show\");\n e.currentTarget.nextSibling.nextSibling.nextSibling.classList.add(\"toolbar-show\");\n });\n\n pre.addEventListener(\"mouseleave\", (e) => {\n e.currentTarget.nextSibling.classList.remove(\"toolbar-show\");\n e.currentTarget.nextSibling.nextSibling.classList.remove(\"toolbar-show\");\n e.currentTarget.nextSibling.nextSibling.nextSibling.classList.remove(\"toolbar-show\");\n });\n }", "title": "" }, { "docid": "fb5efd1812fbb6c32525a3b9ada5c6d5", "score": "0.5018758", "text": "function generatePreview(file,id) {\n return \"<div class='preview'>\" +\n \"<span class='text-danger deleteOption text-right' id=\"+id+\">X</span>\"+\n \"<img src='document.png' id=\"+id+\"/>\"+\n \"<div class='text-center'>\"+file.name+\"</div>\"+\n \"</div>\"\n }", "title": "" }, { "docid": "5ef0266f91351918050ff09d98278fea", "score": "0.5008118", "text": "function writeOutputType(id)\r\n{\r\n\tvar str='';\r\n\tvar out1 = showMenuItem('quickbooks');\r\n\tvar out2 = showMenuItem('quicken');\r\n\tvar out3 = showMenuItem('msmoney');\r\n\r\n\tif (id == 'tranrpt'){\r\n\t\tstr+='<input id=\"screen\" type=\"radio\" name=\"output\" checked /> &nbsp;<b>Screen<\\/b> (HTML)<br>';\r\n\t\tstr+='<input id=\"bai2\" type=\"radio\" name=\"output\" \\/> &nbsp;<b>BAI2<\\/b> file (Creates a file that ';\r\n\t\tstr+='can be imported into an account processing application)<br>';\r\n\t\tstr+='<input id=\"csv\" type=\"radio\" name=\"output\" \\/> &nbsp;<b>CSV<\\/b> file (Can be used by a spreadsheet program)<br>';\r\n\t\tif (out3 == '1'){\r\n\t\t\tstr+='<input id=\"msmoney\" type=\"radio\" name=\"output\" \\/> &nbsp;<b>Microsoft Money®<\\/b> file (Creates a file ';\r\n\t\t\tstr+='that can be imported into MS Money 2000 or more recent versions)<br>';\r\n\t\t}\r\n\t\tif (out1 == '1'){\r\n\t\t\tstr+='<input id=\"quickbook\" type=\"radio\" name=\"output\" \\/> &nbsp;<b>QuickBooks®<\\/b> file (Creates a file ';\r\n\t\t\tstr+='that can be imported into Quickbooks)<br>';\r\n\t\t}\r\n\t\thelpwriteContent(id,str);\r\n\t}//end if tranrpt\r\n\r\n\tif (id == 'tranrpt_down'){\r\n\t\tstr+='Download this report as:&nbsp;';\r\n\t\tstr+='<select><option selected=\"selected\">BAI2 file<\\/option><option>CSV file<\\/option>';\r\n\t\tif (out3 == '1'){\r\n\t\t\tstr+='<option>Microsoft Money® file<\\/option>';\r\n\t\t}\r\n\t\tif (out1 == '1'){\r\n\t\t\tstr+='<option>QuickBooks® file<\\/option>';\r\n\t\t}\r\n\t\tstr+='<\\/select>&nbsp;<input type=\"button\" value=\"Go\" title=\"Download Report\" id=\"cell_button_area2\" \\/>&nbsp;';\r\n\t\thelpwriteContent(id,str);\r\n\t}//end if tranrpt_down\r\n\r\n\tif (id == 'acctrpt'){\r\n\t\tstr+='<input id=\"screen\" type=\"radio\" name=\"output\" checked /> &nbsp;<b>Screen<\\/b> (HTML)<br>';\r\n\t\tstr+='<input id=\"bai2\" type=\"radio\" name=\"output\" \\/> &nbsp;<b>BAI2<\\/b> file (Creates a file that ';\r\n\t\tstr+='can be imported into an account processing application)<br>';\r\n\t\tstr+='<input id=\"csv\" type=\"radio\" name=\"output\" \\/> &nbsp;<b>CSV<\\/b> file (Can be used by a spreadsheet program)<br>';\r\n\t\tif (out3 == '1'){\r\n\t\t\tstr+='<input id=\"msmoney\" type=\"radio\" name=\"output\" \\/> &nbsp;<b>Microsoft Money®<\\/b> file (Creates a file ';\r\n\t\t\tstr+='that can be imported into MS Money 2000 or more recent versions)<br>';\r\n\t\t}\r\n\t\tstr+='<input id=\"qif\" type=\"radio\" name=\"output\" \\/> &nbsp;<b>QIF<\\/b> file (Creates a file that can be imported ';\r\n\t\tstr+='into any application that can import a Quicken Interchange Formatted file)<br>';\r\n\t\tif (out1 == '1'){\r\n\t\t\tstr+='<input id=\"quickbook\" type=\"radio\" name=\"output\" \\/> &nbsp;<b>QuickBooks®<\\/b> file (Creates a file ';\r\n\t\t\tstr+='that can be imported into Quickbooks)<br>';\r\n\t\t}\r\n\t\tif (out2 == '1'){\r\n\t\t\tstr+='<input id=\"quicken\" type=\"radio\" name=\"output\" \\/> &nbsp;<b>Quicken®<\\/b> file (Creates a file ';\r\n\t\t\tstr+='that can be imported into Quicken 98 or more recent versions<br>';\r\n\t\t}\r\n\t\thelpwriteContent(id,str);\r\n\t}//end if acctrpt\r\n\r\n\tif (id == 'acctrpt_down'){\r\n\t\tstr+='Download this report as:&nbsp;';\r\n\t\tstr+='<select><option selected=\"selected\">BAI2 file<\\/option><option>CSV file<\\/option>';\r\n\t\tif (out3 == '1'){\r\n\t\t\tstr+='<option>Microsoft Money® file<\\/option>';\r\n\t\t}\r\n\t\tstr+='<option value=\"QIF\">QIF file<\\/option>';\r\n\t\tif (out1 == '1'){\r\n\t\t\tstr+='<option>QuickBooks® file<\\/option>';\r\n\t\t}\r\n\t\tif (out2 == '1'){\r\n\t\t\tstr+='<option>Quicken® file<\\/option>';\r\n\t\t}\r\n\t\tstr+='<\\/select>&nbsp;<input type=\"button\" value=\"Go\" title=\"Download Report\" \\/>&nbsp;';\r\n\t\thelpwriteContent(id,str);\r\n\t}//end if acctrpt_down\r\n}//end writeOutputType", "title": "" }, { "docid": "82d75a023b0e84fa5d67f59aac5317f4", "score": "0.49988452", "text": "inspectOrModify(filename){\n // i think it'll be cool to do a live edit on the style tag internal to the current node, but then save to the template\n // at that point if you reinitialize anything that uses it, it'll update from new template\n let filepath = `gui-blocks/${this.tagName.toLowerCase().split('-')[0]}/${filename}`\n // TextBlock.from(filepath)\n // eventually CodeMirrorBlock\n // set 'target' of codemirror as selector of a node\n // maybe use DirectoryBlocks function to open the appropriate block\n // open TextBlock from the source code, might be class.js\n }", "title": "" }, { "docid": "5246eb8edd0815a5be11cd9e42357cca", "score": "0.49937868", "text": "function tool1() // Tool-1\n{\n window.location.assign('./tools/img2pdf.html');\n}", "title": "" }, { "docid": "ffe9782fd6fe4603382371ff5b19acb0", "score": "0.49928963", "text": "function FairUseRationale() {\n if((wgPageName == 'Special:Upload' || wgPageName == 'Special:MultipleUpload') && document.getElementById('wpDestFile').value == '') {\n document.getElementById('wpUploadDescription').value = '== Source ==\\n\\n== Licensing ==\\n\\n[[Category:';\n }\n}", "title": "" }, { "docid": "7be10c6f84da7c057942cea3682337fd", "score": "0.49918583", "text": "onBeforeSave( info ) {\n if (info.outputFile.endsWith('.css')) {\n return info.mk;\n }\n if (this.opts.prettify) {\n return HTML.prettyPrint(info.mk, this.opts.prettify);\n } else { return info.mk; }\n }", "title": "" }, { "docid": "9690a8ac15b00177cd0e842b8f7c192f", "score": "0.49894282", "text": "function generateEmailHTML(email) {\n var sender = senderDictionary[email.senderID];\n var t = email.text;\n t = t.replace('<i>','<span style=\"font-style: italic;\">');\n t = t.replace('</i>','</span>');\n t = t.replace('<sh>','<span style=\"font-style: italic; opacity: 90%\">');\n t = t.replace('</sh>','</span>');\n t = t.replace('<s>','<span style=\"font-style: italic;\">');\n t = t.replace('</s>','</span>');\n t = t.replace('<playlist>','<a href=\"https://open.spotify.com/playlist/4U39LZliqZ8ISzBuhQG0n3?si=v8wyJZzVQqiOkiSW3XDtbg\" target=\"_blank\">Look at this one!</a>');\n t = t.replace('<zine>','<a href=\"https://twitter.com/smileformezine\" target=\"_blank\">The Smile For Me Zine</a>');\n t = t.replace('<letsplay>','<a href=\"https://www.youtube.com/watch?v=zTATKZUtKSw\" target=\"_blank\">SnapCube - Smile For Me</a>');\n t = t.replace('<platitudes>','<a onclick=\"openMusicWindow()\">Platitudes_final_FINAL2.mus</a>');\n\n var emailHTML = fillTemplate(\n name=sender.name,\n subject=sender.email,\n profilesrc=sender.profPicSource,\n profileimgdata=generateImagePopupData(sender.profPicName, sender.profPicAuthor, sender.profPicLink, sender.profPicAuthorLink, 'images/profiles/Expanded/'+sender.profPicSource),\n hasProfilePic=sender.profPicName!='',\n text=t,\n attachmentHTML= generateAttachmentHTML(randomSelection(email.attachments, email.randomselection))\n );\n return emailHTML;\n}", "title": "" }, { "docid": "92487de27ca564ccfb584afb6265f1b6", "score": "0.49893916", "text": "function generate_document_tooltip(id)\n{\n var data = document_text[id];\n var result = \"<div>\";\n result += conditional_clip(data[\"title\"], 30) + \"<br/>\";\n result += \"Excerpt: </br>\";\n result += clip(data[\"text\"], 350);\n\n result += \"</div>\";\n\n return result;\n}", "title": "" }, { "docid": "0bca6a96c7ade86b2fe97c461be60354", "score": "0.49773055", "text": "renderBag() {\n\t\t<div>\n\t\t\t//TODO\n\t\t</div>\n\t}", "title": "" }, { "docid": "f0ecb5d4eeced8a36a984e4d341fd31d", "score": "0.49739474", "text": "function codifyElement(element, file, isModule) {\n element.html($(\"#code-template\").tmpl({\n file: file,\n isModule: isModule\n }));\n \n ajaxrequest('get', element.find(\".codeHeader a\").html(), '', 'text').done(function (result) {\n element.find(\"div\").toggle();\n element.find(\".codeBody pre\").html(result.replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\"));\n });\n }", "title": "" }, { "docid": "dcb9b34c059224ded6041b263bbf2b43", "score": "0.49714836", "text": "function topic_tree_markup_item(item_id, do_markup)\n{\n var curr_item = document.getElementById(item_id+\"_div\");\n // selection\n if (do_markup==true)\n {\n curr_item.style.backgroundColor = '#C0C0F0'; //rgb(115, 115, 185, 0.3)'; \n }\n // deselection\n else\n {\n curr_item.style.backgroundColor = 'transparent'; //'rgba(255, 255, 255, 0)';\n }\n\n // monitor created HTML code in content Panel\n// topic_tree_gui_context.innerHTML = '<textarea COLS=80 ROWS=30 disabled=\"true\" style=\"border: none;background-color:white;\">' + document.getElementById(\"topic_tree_col\").innerHTML + '</textarea>'; \n}", "title": "" }, { "docid": "4e903076b2fd02bf1d3d3c42bf44ccac", "score": "0.49712566", "text": "function mineTools(toolsLink, course, other, name, index) {\n var req = new XMLHttpRequest();\n req.open(\"GET\", toolsLink, true);\n req.onreadystatechange = function () {\n if (req.readyState == 4 && req.status == 200) {\n XMLdecrement();\n\n var tools = new Array();\n\n var startFirst = req.responseText.indexOf(\"<div class=\\\"landingPageColumn\");\n var endFirst = req.responseText.indexOf(\"</div>\", startFirst);\n var endSecond = req.responseText.indexOf(\"</div>\", endFirst + 1); 5\n var bit = req.responseText.slice(startFirst, endSecond);\n\n var smooth = bit.replace(/\\s+/g, \" \");\n var a = smooth.split(\"</li>\");\n for (var i = 0; i < a.length; i++) {\n // Grab <h3>...</h3>\n var hStart = a[i].indexOf(\"<h3\");\n var hEnd = a[i].indexOf(\"</h3>\", hStart);\n var impBit = a[i].slice(hStart, hEnd + 5); // Includes </h3>\n\n // Remove pesky &\n impBit = cleanLink(impBit);\n\n // Remove pesky <img> tags\n var imgStart = impBit.indexOf(\"<img\");\n var imgEnd = impBit.indexOf(\">\", imgStart);\n impBit = impBit.slice(0, imgStart) + impBit.slice(imgEnd + 1);\n\n // Parse into document\n var miniDoc = parser.parseFromString(impBit, \"text/xml\");\n \n var t = new Tool();\n try {\n t.name = strip(miniDoc.getElementsByTagName(\"a\")[0].textContent);\n t.link = miniDoc.getElementsByTagName(\"a\")[0].getAttribute(\"href\");\n tools.push(t);\n } catch (e) { // Some bits from split aren't good documents\n // The last bit is always bad, but want to detect others\n if (i < a.length - 1) {\n console.warn(\"DEBUG:\");\n console.warn(e);\n console.warn(impBit);\n console.warn(miniDoc);\n }\n }\n }\n\n if (other == \"other\") {\n tools.unshift(name);\n course.otherLinks[index] = tools;\n }\n else\n course.tools = tools;\n }\n else if (req.readyState == 4 && req.status != 200) {\n console.warn(course.key + \": ERROR, status is \" + req.status);\n XMLdecrement();\n }\n }\n req.send();\n XMLincrement();\n}", "title": "" }, { "docid": "f8d9e9633cb49e111c20d3a086a5ca07", "score": "0.49686012", "text": "function open(app, toolbar) {\n const file = new FilePresenter({label: 'open', accept: '.puz'})\n file.$el.addClass('toolbar-tool')\n file.on('file', (name, data) => {\n const [type] = name.match(/[^.]+$/) || ['']\n console.log('got file!', type, name, data)\n app.loadPuzzle({type, data})\n })\n return file\n}", "title": "" }, { "docid": "9318465bf7e4006f46945fe36e8f8e8c", "score": "0.4952152", "text": "function createeditor(){\n\t\n\t\t/**\n\t\t * Add Tools\n\t\t */\n\t\tvar attr = {\n\t\t\tbold \t\t: {css:{'fontWeight':'bold'}, tag:'B|STRONG'},\n\t\t\titalic\t\t: {css:{'fontStyle':'italic'},tag:'I|EM'},\n\t\t\tunderline\t: {css:{'textDecoration':'underline'},tag:'U'},\n\t\t\tstrikethrough : {css:{'textDecoration':'line-through'},tag:'STRIKE'},\n\t\t\tjustifyright : {css:{'textAlign':'right'},attr:{'align':'right'}},\n\t\t\tjustifycenter : {css:{'textAlign':'center'}},attr:{'align':'center'},\n\t\t\tjustifyfull : {css:{'textAlign':'justify'}},\n\t\t\tjustifyleft : {css:{'textAlign':'left'},attr:{'align':'left'}},\n\t\t\tinsertorderedlist : {tag:'OL'},\n\t\t\tcreatelink : {tag:'A'},\n\t\t\tinsertimage : {tag:'IMG'},\n\t\t\tinsertunorderedlist : {tag:'UL'},\n\t\t\tfontname\t: {css:{'fontFamily':null}, attr:{'face':null}},// null: accepts a variety of values\n\t\t\tformatblock : {tag:'ADDRESS|P|PRE|H[0-9]|BLOCKQUOTE'}\n\t\t};\n\t\n\t\tvar tools = [\n\t\t\t' ',\n\t\t\t{cmd:'bold', desc:'Make the Selected text bold', label:'<b>B</b>'},\n\t\t\t{cmd:'italic', desc:'Make the Selected text Italic', label:'<i>I</i>'},\n\t\t\t{cmd:'underline', desc:'Underline the selected text', label:'<u>U</u>'},\n\t\t\t{cmd:'strikethrough',desc:'Strike through the selected text', label:'<strike>S</strike>'},\n\t\t\t' ',\n\t\t\t{cmd:'createlink', desc:'Create Link', label:'<u>URL</u>',prompt:'URL of a Link?', promptValue:'http://'},\n\t\t\t{cmd:'insertimage', desc:'Insert image', label:'<u>IMG</u>',prompt:'URL of an image?'}, // &#9660;\n\t\t\t' ',\n\t\t\t{cmd:'insertorderedlist', desc:'Insert Numbered list', label:'<b>1</b> List'},\n\t\t\t{cmd:'insertunorderedlist', desc:'Insert Bullet list', label:'&#9679; List'},\t\t\n\t\t\t' Align',\n\t\t\t{cmd:'justifyleft', desc:'Align Left', label:'<b>|</b>&#9668;'},\n\t\t\t{cmd:'outdent', desc:'Outdent', label:'&#9668;'},\n\t\t\t{cmd:'justifycenter', desc:'Align center', label:'&#9679;'},\n\t\t\t{cmd:'indent', desc:'Indent', label:'&#9658;'},\n\t\t\t{cmd:'justifyright', desc:'Align right', label:'&#9658;<b>|</b>'},\n\t\t\t{cmd:'justifyfull', desc:'Jusitfy', label:'&#9776;'},//8801\n\t\t\t' ',\n\t\t\t{label:' Format', cmd:'formatblock', desc:'Format selected text', cmds:[\n\t\t\t\t{value:'p', desc:'Normal', label:'Normal'},\n\t\t\t\t{value:'h1', desc:'Heading 1', label:'<h1>Heading 1</h1>'},\n\t\t\t\t{value:'h2', desc:'Heading 2', label:'<h2>Heading 2</h2>'},\n\t\t\t\t{value:'h3', desc:'Heading 3', label:'<h3>Heading 3</h3>'},\n\t\t\t\t{value:'h4', desc:'Heading 4', label:'<h4>Heading 4</h4>'},\n\t\t\t\t{value:'pre', desc:'Formatted', label:'<pre>Formatted</pre>'},\n\t\t\t\t{value:'address', desc:'Address', label:'<address>Address</address>'},\n\t\t\t\t{value:'blockquote', desc:'Blockquote', label:'<blockquote>Blockquote</blockquote>'},\n\t\t\t\t{value:'div', desc:'Normal Div', label:'Normal (Div)'}\n\t//\t\t\t{value:'acronym', desc:'Acronym', cmd:'inserthtml', prompt:'What is the ', label:'<acronym>Acronym</acronym>'}\n\t\t\t]},\n\t\t\t' ', \n\t\t\t{cmd:'inserthtml', desc:'Insert Special Character or Symbol', label:' Symbol', cmds : [\n\t\t\t\t// CURRENCY\n\t\t\t\t'$','&pound;','&euro;','&yen;',\n\t\t\t\t// COPY\n\t\t\t\t'&copy;', '&trade;', '&reg;', \n\t\t\t\t// LATIN LOWERCASE\n\t\t\t\t'&aacute;', '&acirc;', '&aelig;', '&agrave;','&aring;', '&atilde;', '&auml;', \n\t\t\t\t'&eacute;', '&ecirc;', '&egrave;', '&eth;', '&euml;', \n\t\t\t\t'&iacute;', '&icirc;', '&iexcl;', '&igrave;', '&iuml;', \n\t\t\t\t'&ntilde;', \n\t\t\t\t'&oacute;', '&ocirc;', '&oelig;', '&ograve;', '&otilde;', '&ouml;', \n\t\t\t\t'&szlig;',\n\t\t\t\t'&uacute;', '&ucirc;', '&ugrave;','&uuml;', \n\t\t\t\t'&yacute;', '&yuml;', \n\t\t\t\t// MATHS\n\t\t\t\t'&frac12;', '&frac14;', '&frac34;', '&times;', '&divide;', '&lt;', '&gt;', '&deg;', \n\t\t\t\t'&circ;', '&plusmn;', '&sum;', '&radic;', '&infin;', '&ne;', '&le;', '&ge;','&asymp;',\n\t\t\t\t// Punctuation\n\t\t\t\t'&hellip;', '&iquest;'\n\t\t\t]},\n\t\t\t' ',\n\t\t\t{label:' Font', cmd:'fontname', desc:'Apply font to selected text', cmds:[\n\t\t\t\t{value:'Times', label:'<span style=\"font-family:times\">Times</span>'},\n\t\t\t\t{value:'Helvetica', label:'<span style=\"font-family:Helvetica\">Helvetica</span>'},\n\t\t\t\t{value:'Arial', label:'<span style=\"font-family:Arial\">Arial</span>'},\n\t\t\t\t{value:'Tahoma', label:'<span style=\"font-family:Tahoma\">Tahoma</span>'},\n\t\t\t\t{value:'Courier', label:'<span style=\"font-family:Courier\">Courier</span>'},\n\t\t\t\t{value:'Western', label:'<span style=\"font-family:Western\">Western</span>'},\n\t\t\t\t{value:'serif', label:'<span style=\"font-family:serif\">Serif</span>'},\n\t\t\t\t{value:'sans-serif', label:'<span style=\"font-family:sans-serif\">sans-serif</span>'},\n\t\t\t\t{value:'fantasy', label:'<span style=\"font-family:fantasy\">fantasy</span>'},\n\t\t\t\t{value:'monospace', label:'<span style=\"font-family:monospace\">monospace</span>'},\n\t\t\t\t{value:'Verdana', label:'<span style=\"font-family:Verdana\">Verdana</span>'},\n\t\t\t]},\n\t\t\t{cmd:'removeformat', desc:'Remove Formatting', label:'<b style=\"color:red;\">X</b>'}\n\t\t];\n\t\n\n\t\t// Unbind the click event\n\t\t// We dont want this script running twice for the same textarea\n\t\t// This is only useful if the textarea click event was set, i.e. see how this current lambda function was triggered\n//\t\t$(this).unbind('click');\n\n\t\tvar $textarea = $(this);\n\n\t\t// If the iframe is not present, then we need to create it.\n\t\t// Set this as the controller for deciding whether to just set events\n\t\t// This is used in the dynamic form, where a editt area can be copied several times.\n\n\t\tif($textarea.siblings('div.editor').length){\n\t\t\t/**\n\t\t\t * Delete iframe and toolbar if already exists.\n\t\t\t */\n\t\t\t$textarea.siblings('div.editor').remove();\n\t\t\t$textarea.siblings('div.toolbar').remove();\n\t\t\t/**/\n\t\t}\n\n\t\t// Add EDITOR\n\t\t// Set editor events\n\t\tvar $editor = $(\"<div class='editor' contentEditable='true'>\").insertAfter($textarea).html($textarea.val()).bind('click keyup blur', function(e){\n\n\t\t\t$textarea.val(this.innerHTML);\n\t\t\t\n\t\n\t\t\tif(e.type==='blur')\n\t\t\t\treturn;\n\t\n\t\t\tvar obj;\n\t\n\t\t\tif(!(obj = $().selectedText(window).obj))\n\t\t\t\treturn;\n\t\n\t\n\t\n\t\t\t// loop through each parent of the currently selected\n\t\t\t// Capture styles and tagNames to imply formatting\n\t\t\t// Formatting of some tags, i.e b,i,u, can be overridden by styles\n\t\t\t// And can also be inferred by tagNames.\n\t\n\t\t\tvar c = {}; // commands, these are \n\t\t\tvar getattr = function(){\n\t\t\t\tif(!this.tagName)\n\t\t\t\t\treturn;\n\t\t\t\tvar t = this.tagName.toUpperCase(),\n\t\t\t\t\tx,y,m;\n\t\t\t\n\t\n\t\t\t\tif(t==='BODY'||t==='HTML')\n\t\t\t\t\treturn;\n\n\t\t\t\tfor(x in attr){\n\t\t\t\t\tif(c[x]) continue;\n\t\t\t\t\tfor( y in attr[x].css ){\n\t\t\t\t\t\tif( this.style[y] \n\t\t\t\t\t\t\t&& ( this.style[y].match( attr[x].css[y], 'i' ) \n\t\t\t\t\t\t\t\t|| ( attr[x].css[y] === null && this.style[y].length > 0 ) ) ){\n\t\t\t\t\t\t\tc[x] = this.style[y];\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($.browser.msie)\n\t\t\t\t\t\tfor( y in attr[x].attr ){\n\t\t\t\t\t\t\tif( this.getAttribute \n\t\t\t\t\t\t\t\t&& ( this.getAttribute(y) === attr[x].attr[y] \n\t\t\t\t\t\t\t\t\t|| ( attr[x].attr[y] === null && this.getAttribute(y).length > 0 ) ) ){\n\t\t\t\t\t\t\t\tc[x] = this.getAttribute(y);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\tif(c[x]) continue;\n\t\t\t\t\tif((m=t.match( '^('+attr[x].tag+')$' ))!==null){\n\t\t\t\t\t\tc[x] = m[0].toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\n\t\t\t$(obj).each(getattr).parents().each(getattr);\n\t\n\t\t\tconsole.log([\"selected\",obj,c,$(this).siblings('div.toolbar').find(':input[cmd]')]);\n\t\n\t\t\t$(this).siblings('div.toolbar').find(':input[cmd]').each(function(){\n\t\t\t\tvar cmd = $(this).attr('cmd');\n\t\t\t\tvar bool = !(typeof c[cmd] === 'undefined');\n\t\n\t\t\t\tif(this.tagName === 'BUTTON'){\n\t\t\t\t\tif(bool)\n\t\t\t\t\t\t$(this).addClass('selected');\n\t\t\t\t\telse\n\t\t\t\t\t\t$(this).removeClass('selected');\n\t\t\t\t};\n\t\t\t\tif(this.tagName === 'SELECT'){\n\t\t\t\t\tif(bool)\n\t\t\t\t\t\tthis.value = c[cmd];\n\t\t\t\t\telse \n\t\t\t\t\t\tthis.selectedIndex = -1;\n\t\t\t\t};\n\t\t\t\t\n\t\t\t});\n\t\n\t\t\t//console.log(c,obj,$(obj).parents());\n\t\t\t\t\n\t\t\t// Record the last selected position in the Iframe\n\t\t\ttry{\n\t\t\t\tvar s = document.selection.createRange().duplicate().getBoundingClientRect();\n\t\t\t\twindow.posx = s.left; \n\t\t\t\twindow.posy = s.top; \n\t\t\t}\n\t\t\tcatch(e){}\n\t\t});\n\n\t\t// ADD toolbar.\n\t\tvar $toolbar = $('<div class=\"toolbar\">').insertBefore($textarea);\n\t\t\n\t\t$textarea.hide();\n\t\t// Store the height of the iframe\n\t\tvar height = $textarea.height();\n\n\t\t$editor.attr('style', $textarea.attr('style'));\n\t\t// just in case the textarea is hidden\n\t\t$editor.show();\n\n\t\t// ADD BUTTONS\n\t\t// Add controls above the contentEditable(DIV)\n\t\t$(\"<button>\").html('<code>Source</code>').css({width:'50px'}).click(function(){\n\n\t\t\t// Toggle display DIV vs TEXTAREA\n\t\t\t// Copy the content from the div to the textarea\n\t\t\t// Show the Textarea\n\t\t\tif($textarea.css('display')=='none'){\n\t\t\t\t// DIV => TEXT\n\t\t\t\t// Copy the div content to the text and show text\n\t\t\t\t$textarea.val($editor.html()).show();\n\t\t\t\t// Hide the DIV\n\t\t\t\t\n\t\t\t\t$editor.hide();\n\t\t\t\t\n\t\t\t\t//Disable tools\n\t\t\t\t$(this).html(\"<b>Editor</b>\").parent().find(\".tool\").attr(\"disabled\", true);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// TEXT => DIV\n\t\t\t\t// Copy the text content to the div and show\n\t\t\t\t$editor[0].innerHTML = $textarea.val();\n\n\t\t\t\t$editor.show();\n\n\t\t\t\t// Hide the TEXT\n\t\t\t\t// Show DIV\n\t\t\t\t$textarea.hide();\n\t\t\t\t// Change Text\n\t\t\t\t//Enable tools\n\t\t\t\t$(this).html(\"<code>Source</code>\").parent().find(\".tool\").removeAttr(\"disabled\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}).appendTo($toolbar);\n\n\t\t/**\n\t\t * Insert cmd\n\t\t */\n\t\tvar insert = function(cmd,value,tool){\n\t\t\t/**\n\t\t\t * Get the selected Text if there is any. \n\t\t\t * This function returns {obj:element,text:string}\n\t\t\t */\n\t\t\tvar sel = $().selectedText(window);\n\n\t\t\t/**\n\t\t\t * If this is the createLink or insert image\n\t\t\t * Get the href|src value of the selected element\n\t\t\t * set this as the value\n\t\t\t */\n\t\t\tif( (cmd==='insertimage'||cmd==='createlink') && ( typeof tool.prompt !== 'undefined' )){\n\t\t\t\tif(sel.obj.tagName==='A'){\n\t\t\t\t\ttool.promptValue = sel.obj.href;\n\t\t\t\t}\n\t\t\t\tif(sel.obj.tagName==='IMG'){\n\t\t\t\t\ttool.promptValue = sel.obj.src;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * User prompted to put in a value\n\t\t\t */\n\t\t\tif(tool&&tool.prompt){\n\t\t\t\t/**\n\t\t\t\t * Is text selected?\n\t\t\t\t * Is selected text a URL? Then prepopulate the content of the prompt\n\t\t\t\t */\n\t\t\t\tvalue = prompt(tool.prompt, (cmd==='createlink'&&sel.text.match('^https?://')?sel.text:(tool.promptValue || '')));\n\t\t\t}\n\t\t\t\n\t\t\t//If the command is for a Link there must be text\n\t\t\t//Otherwise we need to insertHTML instead\n\t\t\tif(cmd==='createlink'&&(!sel.text.length)){\n\t\t\t\t// Get the text\n\t\t\t\tif(!(sel.text = prompt(\"Text\")))\n\t\t\t\t\tsel.text = value;\n\t\t\t\t\t\n\t\t\t\tif(sel.text===null)\n\t\t\t\t\treturn false;\n\t\t\t\t// We are going to insert the element manually\n\t\t\t\t// Using pasteHTML IE and execCommand insertHTML if the browser supports it.\n\t\t\t\tvalue = \"<a href='\"+value+\"'>\"+sel.text+\"</a>\";\n\t\t\t\tcmd = 'inserthtml';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * IE requires format block tags (e.g. h1, p, pre) to be wrapped with <> syntax\n\t\t\t */\n\t\t\tif(cmd=='formatblock'&&$.browser.msie)\n\t\t\t\tvalue = '<'+value+'>';\n\n\t\t\t\n\t\t\t// Send the action to the frame\n\t\t\t// update the text area with this new value\n\n\t\t\ttry{\n\t\t\t\tconsole.log([window, cmd, value]);\n\t\t\t\tdocument.execCommand(cmd, false, value);\n\t\t\t}\n\t\t\tcatch(e){\n\t\t\t\t//IE WAY to insert at the current point\n\t\t\t\tif(document.selection){\n\t\t\t\t\tvar s = document.selection.createRange();\n\t\t\t\t\tif(s.pasteHTML){\n\t\t\t\t\t\ts.pasteHTML(value);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\talert(\"Could not execute \"+cmd);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Loop through tools object and create buttons for each\n\t\t */\n\t\tfor(var x in tools){\n\t\t\t\n\t\t\t/**\n\t\t\t * Seperator?\n\t\t\t * If the current tool is a string then insert as just a string\n\t\t\t */\n\t\t\tif(typeof tools[x] == 'string'){\n\t\t\t\tif(tools[x].match('[a-z]', 'ig'))\n\t\t\t\t\ttools[x] = \"<span class='tool'>\"+tools[x].replace(' ', '&nbsp;')+\"</span>\";\n\t\t\t\t$toolbar.append(tools[x]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t/**\n\t\t\t * Create a drop down list (currently a select->option).\n\t\t\t * Add values from the tool to the select\n\t\t\t * Add change event to the list\n\t\t\t * @todo Change this to a drop down div with buttons and attach events to each of the option. \n\t\t\t \t\tTwo reasons: \n\t\t\t\t\t1. Style (selects dont allow us flexibility to style option labels).\n\t\t\t \t\t2. Only trigger onchange event. We might want to select the same item twice, the change event wont get fired the second time... i.e. the user has to navigate away. Using other triggers get fired when selecting anywhere, even the select scrollbar. Deselecting the option after use would be a workaround.\n\t\t\t * \n\t\t\t */\n\t\t\tif(tools[x].cmds){\n\t\t\t\t/**\n\t\t\t\t * Create select in memory\n\t\t\t\t * Attach event to insert into the current iframe\n\t\t\t\t */\n\t\t\t\tvar $select = $(\"<select>\").attr({'class':'tool', 'xtool':x, 'cmd':tools[x].cmd, 'title':tools[x].desc}).change(function(){\n\t\t\t\t\t// Make sure the focus is on the window\n\t\t\t\t\tif($.browser.msie){\n\t\t\t\t\t\t// $('#iframe_'+$(this).parents(\"div.toolbar\")[0].id.match('[0-9]+')[0])\n\t\t\t\t\t\tvar win = window;\n\t\t\t\t\t\tvar doc = win.document;\n\t\t\t\t\t\t$editor[0].focus();\n\t\t\t\t\t\tcursorPos = doc.body.createTextRange();\n\t\t\t\t\t\tcursorPos.moveToPoint( win.posx, win.posy);\n\t\t\t\t\t\tcursorPos.select();\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Add insert event\n\t\t\t\t\t */\n\t\t\t\t\tinsert(tools[$(this).attr('xtool')].cmd, this.options[this.selectedIndex].value);\n\t\t\t\t});\n\n\t\t\t\t/** \n\t\t\t\t * Create the select OPTIONs\n\t\t\t\t */\n\t\t\t\tfor(var y in tools[x].cmds){\n\t\t\t\t\tif(typeof tools[x].cmds[y] == 'string')\n\t\t\t\t\t\ttools[x].cmds[y] = {value:tools[x].cmds[y],label:tools[x].cmds[y]};\n\t\t\t\t\t$select.append('<option value=\"'+tools[x].cmds[y].value+'\">'+tools[x].cmds[y].label+'</option>');\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Wrap the select in a div. \n\t\t\t\t * Append the DIV into the toolbar\n\t\t\t\t */\n\t\t\t\t$(\"<span class='tool'>\"+tools[x].label.replace(' ', '&nbsp;')+\"</span>\").append($select).appendTo($toolbar);\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Create a button \n\t\t\t * This is the last option for what a tool can be. \n\t\t\t */\n\t\t\t$(\"<button>\").attr({'class':'tool', 'xtool':x, 'cmd':tools[x].cmd, 'title':tools[x].desc}).html(tools[x].label).click( function(){\n\t\t\t\t\n\t\t\t\t// make sure this is not going to insert outside the contentEditable iframe\n\t\t\t\tif($.browser.msie){\n\t\t\t\t\ttry{\n\t\t\t\t\t//$('#iframe_'+$(this).parents(\"div.toolbar\")[0].id.match('[0-9]+')[0])\n\t\t\t\t\t$editor[0].focus();\n\t\t\t\t\tvar win = window;\n\t\t\t\t\tvar doc = win.document;\n\t\t\t\t\t// have we lost cursor positions?\n\t\t\t\t\t// excpetions occur selecting images\n\t\t\t\t\tvar s = doc.selection.createRange().duplicate().getBoundingClientRect();\n\t\t\t\t\tif(!(s.left>=0&&s.top>=0)){\n\t\t\t\t\t\t// restore the cursor position\n\t\t\t\t\t\tdoc.body.createTextRange().moveToPoint( win.posx, win.posy).select();\n\t\t\t\t\t}}\n\t\t\t\t\tcatch(e){}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Which tool is this\n\t\t\t\t */\n\t\t\t\tvar tool = tools[$(this).attr('xtool')];\n\t\t\t\t\n\t\t\t\t$(this).hasClass('selected')\n\t\t\t\t\t? $(this).removeClass('selected')\n\t\t\t\t\t: $(this).addClass('selected');\n\n\t\t\t\t/**\n\t\t\t\t * Trigger edit command\n\t\t\t\t */\n\t\t\t\tinsert(tool.cmd, null,tool);\n\t\t\t\treturn false;\n\t\t\t}).appendTo($toolbar);\n\t\t}\n\t}", "title": "" }, { "docid": "c47ca8b94c98b46af380c6b2d3d3deff", "score": "0.49499252", "text": "function goTextExport2(el, fileOut, path) \r\n {\r\n // Get the layers\r\n var layers = el.layers;\r\n // Loop 'm\r\n for (var layerIndex = layers.length; layerIndex > 0; layerIndex--)\r\n {\r\n // curentLayer ref\r\n var currentLayer = layers[layerIndex-1];\r\n // currentLayer is a LayerSet\r\n if (currentLayer.typename == \"LayerSet\") {\r\n goTextExport2(currentLayer, fileOut, path + currentLayer.name + '/');\r\n // currentLayer is not a LayerSet\r\n } else {\r\n // Layer is visible and Text --> we can haz copy paste!\r\n if ( (currentLayer.visible) && (currentLayer.kind == LayerKind.TEXT) )\r\n {\r\n //fileOut.writeln(separator);\r\n fileOut.writeln('');\r\n fileOut.writeln('LayerPath: ' + path);\r\n fileOut.writeln('LayerName: ' + currentLayer.name);\r\n fileOut.writeln('');\r\n fileOut.writeln('LayerContent:');\r\n fileOut.writeln(currentLayer.textItem.contents);\r\n fileOut.writeln('');\r\n // additional exports added by Max Glenister for font styles \r\n if(currentLayer.textItem.contents){\r\n fileOut.writeln('LayerStyles:');\r\n fileOut.writeln('* capitalization: '+(currentLayer.textItem.capitalization==\"TextCase.NORMAL\"?\"normal\":\"uppercase\"));\r\n fileOut.writeln('* color: #'+(currentLayer.textItem.color.rgb.hexValue?currentLayer.textItem.color.rgb.hexValue:''));\r\n fileOut.writeln('* fauxBold: '+(currentLayer.textItem.fauxBold?currentLayer.textItem.fauxBold:''));\r\n fileOut.writeln('* fauxItalic: '+(currentLayer.textItem.fauxItalic?currentLayer.textItem.fauxItalic:''));\r\n fileOut.writeln('* font: '+currentLayer.textItem.font);\r\n //fileOut.writeln('leading: '+(currentLayer.textItem.leading=='auto-leading'?'auto':currentLayer.textItem.leading));\r\n fileOut.writeln('* size: '+currentLayer.textItem.size);\r\n fileOut.writeln('* tracking: '+(currentLayer.textItem.fauxItalic?currentLayer.textItem.fauxItalic:''));\r\n fileOut.writeln('');\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "affe8f42c1f67c1fa9dcc2d5c990a9e6", "score": "0.49467206", "text": "drawRecipeTools() {\n const recipe = this.currentRecipe;\n const tools = recipe.tools;\n const ox = 430;\n const lh = this.lineHeight();\n this.drawTextEx(`\\\\C[1]Tools Required\\\\C[0]`, ox, lh*2, 300);\n tools.forEach((tool, index) => {\n const rpgItem = J.Base.Helpers.translateItem(tool.id, tool.type);\n const x = ox+40;\n const y = lh*(3+(index));\n const available = $gameParty.numItems(rpgItem);\n this.drawRecipeToolAvailability(available, x-40, y);\n this.drawRecipeItemName(rpgItem, x, y);\n });\n }", "title": "" }, { "docid": "ac2b99ccdba436e7c0d8d977999efdec", "score": "0.49449664", "text": "function toolbox(item,use, on){\r\n //console.log(item);\r\n if(use==\"yes\"){\r\n item(on);\r\n }else{\r\n console.log(\"Thanks for the item!\");\r\n }\r\n\r\n}", "title": "" }, { "docid": "82c02aff003f6a2d43bf320b324c40d2", "score": "0.49280673", "text": "function SingleTool() {}", "title": "" }, { "docid": "00bc105b1f7152a53c543c258ec6028d", "score": "0.49152204", "text": "function createItemHtml(response, item, key, unused, fileObj, subDirs)\n{\t\n\tvar image = fileObjToHtml(fileObj);\n\t\n\tvar res1 = fileObj.fileSystem.match(/.*fuse.hidden.*/gi);\n\tif (res1 !=null) {\n\t\treturn;\n\t}\n\tvar res2 = fileObj.fileSystem.match(/.*aufs/gi);\n\tif (res2 != null) {\n\t\treturn;\n\t}\n\tvar width = WIDTH_250 + \"px\";\n\t\n\tvar localLink = \"<a href=\\\"file://\" + fileObj.fileSystem.toString() +\"\\\">\" + \"Local Link\" + \"</a>\";\n\n\tvar idstringUnescaped = \"card-\" + fileObj.fileSystem;\t\n\tvar idstring = idstringUnescaped.replace(/'/g, \"&apos;\");\n\tid += 1;\n\tvar toBeAppended =\t \"<tr id='\" +idstring+\"'><td><table><tr><td>\"\n\t\t+ image + \"<td><td>\"\n\t\t+ createButtonsPanel(item, subDirs, key, idstring)\n\t\t+ \"</td>\"\n\t\t+ \"</tr>\"\n\t\t+ \"<tr>\"\n\t\t+ \"<td colspan=2>\"\n\t\t+ prettyDate(new Date(fileObj.created)) + '<br>' \n\t\t+ \"<textarea rows=4 style='width:\" + width+\"; word-wrap:break-word;'>\" \n\t\t+ decodeURIComponent(item) + '\\n\\n' \n//\t\t+ fileObj.created\n\t\t+ \"</textarea></td>\"\n\t\t+ \"<td><a href='\" +fileObj.httpUrl+\"'>\" + fileObj.httpUrl + \"</a><br>\" +localLink\n\t\t+ \"<br><br>\"+fileObj.thumbnailUrl + \"</td>\"\n\t\t+ \"</tr>\"\n\t\t+ \"</table></td></tr>\";\n\n\treturn toBeAppended;\n}", "title": "" }, { "docid": "6e2f05f9d500475e752ff32450f70d25", "score": "0.49119073", "text": "writing() {\n this.fs.copyTpl(\n this.templatePath(this.filenames.readMe),\n this.destinationPath(this.filenames.readMe),\n this.options.byuiOptions.fillTemplateObject\n );\n }", "title": "" }, { "docid": "3e5d53b13fb77c52a911f1112ccf2950", "score": "0.4906263", "text": "function initGoFmt() {\n var icon = $(\"<a href='#' id='gofmt-icon'> </a>\");\n icon.attr(\"title\", Strings.FORMAT_THIS_FILE);\n icon.on(\"click\", handleIconClick);\n icon.appendTo($(\"#main-toolbar\").find(\".buttons\"));\n }", "title": "" }, { "docid": "62d95798b335d0161ced14890c4ee708", "score": "0.4895999", "text": "function fileToMarkup(file) {\n\treturn readFile(file).then(function(result) {\n\t\tvar fileNode = $('<div></div>').addClass('file'),\n\n\t\t\tfileImg = $('<div></div>').addClass('file-img').css('background-image', 'url(' + result.src + ')'),\n\n\t\t\tfileControls = $('<div></div>').addClass('file-controls').click(toggleFileSelect),\n\t\t\tcheckmark = $('<div></div>').addClass('checkmark').click(toggleFileSelect),\n\t\t\tclose = $('<div></div>').addClass('close').click(deleteFile),\n\t\t\tedit = $('<button>Edit</button>').addClass('button whiteOutline').click(editFile),\n\n\t\t\tfileTitle = $('<div></div>').addClass('file__title'),\n\t\t\tfileTypeIcon = $('<i class=\"fa fa-camera\"></i>').css('margin-right', '2px'),\n\t\t\tfileTitleInput = $('<input type=\"text\" />').val(result.name),\n\n\t\t\tfileCaption = $('<div></div>').addClass('file-caption').text(result.name).click(editFileCaption),\n\t\t\tfileInfo = $('<div></div>').addClass('file-info').text(result.info),\n\n\t\t\tfilePurpose = $('<div></div>').addClass('file-purpose'),\n\t\t\tfilePurposeSelect = $('<div></div>').addClass('select').click(openSelect),\n\t\t\tselectSpan = $('<span>Select use</span>'),\n\t\t\tselectUl = $('<ul></ul>'),\n\t\t\tselectLi1 = $('<li>Cover</li>').click(setSelect),\n\t\t\tselectLi2 = $('<li>Primary</li>').click(setSelect),\n\t\t\tselectLi3 = $('<li>Secondary</li>').click(setSelect);\n\n\t\tfileTitle.append(fileTypeIcon, fileTitleInput);\n\t\tselectUl.append(selectLi1, selectLi2, selectLi3);\n\t\tfilePurposeSelect.append(selectSpan, selectUl);\n\n\t\tfilePurpose.append(filePurposeSelect);\n\t\tfileControls.append(checkmark, close, edit);\n\t\tfileImg.append(fileControls);\n\n\t\tfileNode.append(fileImg, fileTitle, fileCaption, fileInfo, filePurpose);\n\n\t\treturn fileNode;\n\t});\n}", "title": "" }, { "docid": "cd182e645738a2553fae481b6684f190", "score": "0.488257", "text": "generateExtendedToolTip() {\n //Order the data array\n let data = formatArray.collectionToBottom(this.data, ['Database IDs', 'Comment']);\n if (!(data)) data = [];\n\n //Ensure name is not blank\n this.validateName();\n\n if (!(this.data)) { this.data = []; }\n return h('div.tooltip-image', [\n h('div.tooltip-heading', this.name),\n h('div.tooltip-internal', h('div', (data).map(item => generate.parseMetadata(item, false), this))),\n h('div.tooltip-buttons',\n [\n h('div.tooltip-button-container',\n [\n h('div.tooltip-button', { onclick: this.displayLess() }, [\n h('i', { className: classNames('material-icons', 'tooltip-button-show') }, 'fullscreen_exit'),\n h('div.describe-button', 'Less Info')\n ]),\n ])\n ])\n ]\n );\n }", "title": "" }, { "docid": "3f75a58d39aee4116e2676b9a5883352", "score": "0.48819605", "text": "function formatFile(filter, file) {\n let message = {\n content: file.name + ' - ' + file.links.details,\n ephemeral: true,\n };\n var embed = {\n \"color\": 4215449,\n \"fields\": [\n { name: 'Description', value: file.description },\n { name: 'Intended effect', value: file.intended },\n { name: 'Length', value: secondsToTime(file.length), inline: true }\n ]\n }\n applyFilterTags(filter.category, ['Category', 'Categories'], file.tags, embed);\n applyFilterTags(filter.feature, ['Feature', 'Features'], file.tags, embed);\n message.embeds = [embed];\n return message;\n}", "title": "" }, { "docid": "1e67bc14000d84ba91f478b73001ad46", "score": "0.48812354", "text": "function main() {\n var allData = getDataAsArrayOfArrays();\n var headers = allData[0];\n var allDataForDocument = allData[allData.length-1];\n\n // Create the target file, with whatever name you want\n var newTargetFileName = \"FrameBust - Offer Letter - \" + allDataForDocument[2] + \" \" + allDataForDocument[3];\n var newTargetFile = createDuplicateDocument(templateFileId, newTargetFileName);\n var newTargetFileId = newTargetFile.getId();\n\n for(var i=0; i<headers.length; i++) {\n var dataForDocument = allDataForDocument[i].toString();\n\n // For any numbers you may have to use something like this to ensure a comma goes in\n if ((headers[i] == \"#SALARY WITH COMMA BUT WITHOUT DOLLAR SIGN#\") || (headers[i] == \"#OPTIONS#\")) {\n dataForDocument = dataForDocument.replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }\n replaceText(newTargetFileId, headers[i], dataForDocument);\n }\n}", "title": "" }, { "docid": "b6ac29536cd764e7957114fe4cd97301", "score": "0.48752332", "text": "function generateFileTemplate(fileName) {\n let file = document.createElement(\"li\");\n file.className = \"file\";\n file.innerHTML = `<label for=\"${fileName}\">Name:<br />${fileName}</label>\n <input id=\"${fileName}\" type=\"checkbox\" />`;\n return file;\n}", "title": "" }, { "docid": "b24da942423865b9dcc08be11275ee26", "score": "0.4868104", "text": "function Build_File(FileName,Detail){\r\n\r\n doc.addSection({\r\n properties: {},\r\n children: [\r\n new docx.Paragraph({\r\n alignment: docx.AlignmentType.CENTER,\r\n children: [\r\n new docx.TextRun({\r\n text: \"รายละเอียดโครงการ/กิจกรรม ปีงบประมาณ \" + Detail.data.year_project,\r\n bold: true, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n alignment: docx.AlignmentType.CENTER,\r\n children: [\r\n new docx.TextRun({\r\n text: \"โรงเรียนสตรีสิริเกศ\",\r\n bold: true, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n alignment: docx.AlignmentType.CENTER,\r\n children: [\r\n new docx.TextRun({\r\n text: \"(งานพัฒนาตามกลยุทธ์)\",\r\n bold: true, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n alignment: docx.AlignmentType.CENTER,\r\n children: [\r\n new docx.TextRun({\r\n text: \"…………………………………………………………………\",\r\n bold: true, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n children: [\r\n new docx.TextRun({\r\n text: \"1. ความสอดคล้อง\",\r\n bold: true, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n children: [\r\n new docx.TextRun({\r\n text: \" ยุทธศาสตร์ประเทศ ยุทธศาสตร์ที่\t\"+Detail.data.strategyInfo.country_strategy +\"\t\tยุทธศาสตร์ สพฐ.ยุทธศาสตร์ที่ \" +Detail.data.strategyInfo.spt_strategy,\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n children: [\r\n new docx.TextRun({\r\n text: \"มาตรฐานการศึกษาโรงเรียน มาตรฐานที่ \"+Detail.data.strategyInfo.school_standard+ \"\t ตัวบ่งชี้ที่ \"+Detail.data.strategyInfo.indicator+\" ตัวชี้วัดที่ \"+Detail.data.strategyInfo.Metric\t,\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n children: [\r\n new docx.TextRun({\r\n text: \"กลยุทธ์ของโรงเรียน กลยุทธ์ที่ \" +Detail.data.strategyInfo.School_strategy+ \"\tโครงการหลักที่\t\"+Detail.data.strategyInfo.Main_project+\" \tกิจกรรมหลักที่\t\"+Detail.data.strategyInfo.Main_activities,\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n children: [\r\n new docx.TextRun({\r\n text: \"2. ลักษณะของโครงการ \"+Detail.data.property_project,\r\n bold: true, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n children: [\r\n new docx.TextRun({\r\n text: \"3. ชื่อโครงการ / กิจกรรม \"+Detail.name_project,\r\n bold: true, \r\n })\r\n ],\r\n \r\n }),\r\n \r\n \r\n \r\n\r\n new docx.Table({\r\n rows: [\r\n new docx.TableRow({\r\n children: [\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(\"สาระสำคัญ\")],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(\"ตัวชี้วัดความสำเร็จ/เป้าหมาย\")],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(\"เงื่อนไขความสำเร็จ\")],\r\n }),\r\n ],\r\n }),\r\n \r\n new docx.TableRow({\r\n children: [\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(\"จุดมุ่งหมาย (Goal)\") , new docx.Paragraph(Detail.data_detail.goal.body)],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(Detail.data_detail.goal.Success_Indicators)],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(Detail.data_detail.goal.Success_conditions)],\r\n }),\r\n ]\r\n }),\r\n new docx.TableRow({\r\n children: [\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(\"วัตถุประสงค์(Purpose)\") , new docx.Paragraph(Detail.data_detail.purpose.body)],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(Detail.data_detail.purpose.Success_Indicators)],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(Detail.data_detail.purpose.Success_conditions)],\r\n }),\r\n \r\n ],\r\n }),\r\n new docx.TableRow({\r\n children: [\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(\"ผลผลิต/ผลงาน (Output)\") , new docx.Paragraph(Detail.data_detail.output.body)],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(Detail.data_detail.output.Success_Indicators)],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(Detail.data_detail.output.Success_conditions)],\r\n }),\r\n \r\n ],\r\n }),\r\n new docx.TableRow({\r\n children: [\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(\"กิจกรรม (Activities)\") , new docx.Paragraph(Detail.data_detail.activities.body)],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(Detail.data_detail.activities.Success_Indicators)],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(Detail.data_detail.activities.Success_conditions)],\r\n }),\r\n \r\n ],\r\n }),\r\n new docx.TableRow({\r\n children: [\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(\"ปัจจัย (Input)\") , new docx.Paragraph(Detail.data_detail.input.body)],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(Detail.data_detail.input.Success_Indicators)],\r\n }),\r\n new docx.TableCell({\r\n children: [new docx.Paragraph(Detail.data_detail.input.Success_conditions)],\r\n }), \r\n ]\r\n })\r\n ]}),\r\n\r\n\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: \"หลักฐานแหล่งพิสูจน์\",\r\n bold: true, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: \"แหล่งข้อมูล\",\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text:\"--แหล่งข้อมูล--\",\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: \"วิธีการประเมิน\",\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: Detail.data_detail_2.Proof_of_evidence.Assessment_method,\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: \"เครื่องมือ\",\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: Detail.data_detail_2.Proof_of_evidence.tools,\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: \"งบประมาณ (ระบุที่มางบประมาณ เช่น เงินอุดหนุน)\",\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: Detail.data_detail_2.Proof_of_evidence.Budget,\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: \"ระยะเวลาดำเนินการ\",\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: \"เริ่มต้น :\"+Detail.data_detail_2.Proof_of_evidence.Processing_time.Start+\" \"+\"สิ้นสุด\"+Detail.data_detail_2.Proof_of_evidence.Processing_time.End,\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: \"ผู้รับผิดชอบ\",\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n new docx.Paragraph({\r\n \r\n children: [\r\n new docx.TextRun({\r\n text: Detail.data_detail_2.Proof_of_evidence.Responsible_person,\r\n bold: false, \r\n })\r\n ],\r\n }),\r\n \r\n ]\r\n });\r\n\r\n\r\n\r\n docx.Packer.toBuffer(doc).then((buffer) => {\r\n fs.writeFileSync(\"./views/storeFile/\"+FileName+\".docx\", buffer);\r\n });\r\n\r\n \r\n}", "title": "" }, { "docid": "9085c2dbe3b1d7bc78f9d01892870f05", "score": "0.48598757", "text": "function processFile (file) {\n var doc = app.open(file);\n var textGroup = doc.layerSets.getByName('Text');\n var layers = textGroup.layers;\n\n each(layers, processLayer);\n\n exportPathsForIllustrator(doc);\n }", "title": "" }, { "docid": "ceb8c02bc7d37f7543afdf15f7572540", "score": "0.48425874", "text": "function showFiles(container, samplePath, filesGlob) {\n // get current container\n var $ = cheerio.load(container);\n var filesCollection = filesGlob.split(','),\n sampleFiles = [];\n for (var i = 0; i < filesCollection.length; i++) {\n sampleFiles.push(samplePath + '/' + filesCollection[i]);\n }\n var patterString = sampleFiles.toString();\n // get the glob pattern from file arguments\n var globPattern = sampleFiles.length > 1 ? '{' + patterString + '}' : patterString;\n var files = glob.sync(globPattern);\n // append the ul for source tab\n $('.source').html('');\n $('.source').append('<div class=\"ej2-source-tab\"><ul class=\"nav nav-tabs\"></ul></div>');\n var active = 'active',\n hidden = '';\n // create source content for code snippets\n for (var i = 0; i < files.length; i++) {\n var fileName = path.basename(files[i]);\n var fileAttr = fileName.split('.').join('-');\n var fileType = types[path.extname(files[i])]\n var type = fileType ? fileType : 'javascript';\n var hlContent = renderCodeSnippets('```' + type + '\\n' + fs.readFileSync(files[i], 'utf8') + '\\n```');\n if (i > 0) {\n active = '';\n hidden = 'ej2-hidden';\n }\n // append the li to ul element\n var li = '<li class=\"' + active + ' ej2-source-li\" for=\"' + fileAttr + '\"><a data-toggle=\"tab\">' + fileName + '</a></li>';\n $('.ej2-source-tab .nav-tabs').append(li);\n // append the source content with highlight.js format in the container\n $('.ej2-source-tab').append('<div class=\"ej2-source-content ' + hidden + ' ' + fileAttr + '\">' + hlContent + '</div>');\n }\n return $.html();\n}", "title": "" }, { "docid": "4db3408411e578c68031a075a5265303", "score": "0.4839641", "text": "function addToolbox () {\n return `\n<category name=\"%{BKY_DS18B20_CATEGORY}\" id=\"DS18B20_CATEGORY\" colour=\"#009393\" secondaryColour=\"#007979\">\n <block type=\"ds18b20_init\" id=\"ds18b20_init\">\n <field name=\"PIN\">2</field>\n <value name=\"QUANTITY\">\n <shadow type=\"math_whole_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n </block>\n <block type=\"ds18b20_readAllTemperatures\" id=\"ds18b20_readAllTemperatures\">\n </block>\n <block type=\"ds18b20_temperature\" id=\"ds18b20_temperature\">\n <value name=\"NO\">\n <shadow type=\"math_whole_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n </block>\n</category>`;\n}", "title": "" }, { "docid": "4c830b6097db69bcf38c822949a9ca0b", "score": "0.48202348", "text": "function ThumbnailBuildTools( item, lastThumbnail ) {\r\n \r\n // toolbars\r\n var tb = ThumbnailBuildToolbarOne(item, 'topLeft');\r\n tb += ThumbnailBuildToolbarOne(item, 'topRight');\r\n tb += ThumbnailBuildToolbarOne(item, 'bottomLeft');\r\n tb += ThumbnailBuildToolbarOne(item, 'bottomRight');\r\n \r\n // counter of not displayed images\r\n tb += '<div class=\"nGY2GThumbnailIconsFullThumbnail\"></div>';\r\n\r\n return tb;\r\n \r\n }", "title": "" }, { "docid": "19b51b0008f570015d74ed71e9e5a4b7", "score": "0.48019502", "text": "function renderLearnFiles() {\n return learnFiles.filter(file => file.fileName.includes(filterredName));\n }", "title": "" }, { "docid": "9f7bc7ef0f49069d4e1f264d1e867af2", "score": "0.4799399", "text": "function ToolboxManager() {\n this.toolboxHTML = document.createElement(\"xml\");\n this.BlocksInformations = new Array();\n this.CreateCategories(BLOCKS);\n }", "title": "" }, { "docid": "31253f27b755346bf42eb98b9730fff9", "score": "0.4794534", "text": "getToolDescription(){ \n let outputText = document.getElementById(\"testOutput\"); \n outputText.innerHTML = \"\";\n outputText.innerHTML += \"<li>NMAP</li>\"\n + \"<li>This tool returns the IP addresses of network components</li>\"\n + \"<li>Cost: 1 Action Point</li>\"\n + \"<li>Strengths: Low cost tool to retrieve all IP addresses on network</li>\"\n + \"<li>Weaknesses: Chance to fail if the network has more than 1 Firewall</li>\"\n + \"<li>Tip: Once nmap has retrieved the ip address list.</li>\"\n + \"<li>To get more details of each discovered component:</li>\"\n + \"<li>nmap ip</li>\";\n }", "title": "" }, { "docid": "a91f5d1d20d182c38d549a9cd3be30f9", "score": "0.47851408", "text": "function showEditTools(elem) {\n if ($('#edit_tools_' + elem.id).length) { //edit tools already shown\n return;\n }\n $('.editTools').remove();\n var editTools = '<div id=\"edit_tools_' + elem.id + '\" class=\"editTools\">';\n var status = getElemStatus(elem);\n if (status === '0000') { //save\n editTools += '<div id=\"elem_save_' + elem.id + '\"'\n + ' onclick=\"saveElem(' + elem.id + ')\"'\n + ' class=\"edit-tool-item\">Saglabāt'\n + ' </div>';\n } else if (status === '0001') { //edit\n editTools += '<div id=\"elem_save_' + elem.id + '\"'\n + ' onclick=\"editElem(' + elem.id + ')\"'\n + ' class=\"edit-tool-item\">Labot'\n + ' </div>';\n }\n editTools += '<div onclick=\"openPopUp(' + elem.id + ')\" class=\"edit-tool-item\">Formatēt</div>';\n editTools += '<div onclick=\"deleteElem(' + elem.id + ')\" class=\"edit-tool-item\">Dzēst</div>';\n editTools += '</div>';\n $(elem).children().first().before(editTools);\n}", "title": "" }, { "docid": "4a4ebfd0e8d9b75d29d05b4f07328dc4", "score": "0.476473", "text": "callout({ block, writeLine, isLast, getConfig }) {\n const { rich_text } = getConfig(block);\n\n writeLine('');\n writeLine('{% aside %}');\n writeLine(formatRichText(rich_text));\n writeLine('{% endaside %}');\n isLast && writeLine('');\n }", "title": "" }, { "docid": "5df967b4169c1194364b298668465842", "score": "0.47614902", "text": "function scanFiles(files, i, j) {\n //var output = [];//buffer array for reading file (array of lines)\n var f;\n for (; i < j; i++) { //read every file\n f = files[i]; //currently reading this file\n if (!txtExtension(f.name)) continue;\n var reader = new FileReader();\n var result;\n reader.onload = function(e) { //done loading\n var lines = e.target.result.split(\"\\n\");\n var thisPoem = new Poem(lines); //make a new poem with the file contents\n var item = selectBar.text(buffer, listY, lines[0]); //this is the poem name in the select bar\n item.attr({\n font: \"12px Fontin-Sans, Helvetica\",\n fill: deselectColor,\n \"text-anchor\": \"start\"\n });\n listY += lineSpacing + 2;\n item.data(\"poem\", thisPoem); //link actual Poem object to clickable raphael object\n poemList.push(item); //add it to the list\n item.click(function() { //click function for poem name\n if (selected != null) { //if other poem was selected before this\n if (selected.data('poem').contains()) { //currently selected word is in the poem\n selected.attr(\"fill\", containsColor)\n } else selected.attr(\"fill\", deselectColor);\n }\n selected = this; //now this one is selected\n this.attr(\"fill\", selectColor); //change the color of this item\n this.data('poem').showPoem(); //and show its poem\n });\n };\n reader.readAsText(f, \"UTF-8\");\n reader.onloadend = function(e) {\n adjustSizes();\n };\n }\n}", "title": "" }, { "docid": "d1a122c6fa5d3784b645b7e9b6d57455", "score": "0.47598732", "text": "function getPicBlockSuppHTML (pb, idx, pre) {\n var html = \"\";\n var src;\n //dynamic or static caption text:\n if(mode === \"dynamic\") { //txt file may be provided later..\n html += \" <div class=\\\"textblockdiv\\\" id=\\\"pbt\" + idx + \"\\\">\" +\n pb.base + \"</div>\\n\"; }\n else if(pb.txt) { //include static text if given\n src = pb.path;\n if(pb.img) {\n src = src.slice(0, -1 * pb.img.length) + pb.txt; }\n else if(pb.aud) {\n src = src.slice(0, -1 * pb.aud.length) + pb.txt; }\n else if(pb.vid) {\n src = src.slice(0, -1 * pb.vid.length) + pb.txt; }\n else if(pb.link) {\n src = src.slice(0, -1 * pb.link.length) + pb.txt; }\n //logObject(\"pb with text:\", pb);\n //console.log(\"src: \" + src);\n html += \" <div class=\\\"textblockdiv\\\" id=\\\"pbt\" + idx + \"\\\">\\n\" +\n getFileContents(src, (src.indexOf(\".html\")? \"\" : \"txt2html\")) + \n \"</div>\\n\"; }\n //audio or video or external link:\n if(pb.aud) {\n html += getMediaPlayLink(pb.path, \"audiodiv\", \n enc(pre + pb.base + \".\" + pb.aud),\n pb.base); }\n else if(pb.vid) {\n html += getMediaPlayLink(pb.path, \"videodiv\",\n enc(pre + pb.base + \".\" + pb.vid),\n pb.base); }\n else if(pb.link) {\n html += getLinkContentHTML(pb); }\n return html;\n }", "title": "" }, { "docid": "98ddae15c10059aef950dd2667d94b2a", "score": "0.4758324", "text": "function mySnippet(){\n\t//The local-independent name (aka \"key string\") for the \n\t//Layout context menu is \"$ID/RtMouseLayout\".\n\tvar myLayoutContextMenu = app.menus.item(\"$ID/RtMouseLayout\");\n\t//Create the event handler for the \"beforeDisplay\" event of the Layout context menu.\n\tvar myBeforeDisplayListener = myLayoutContextMenu.addEventListener(\"beforeDisplay\", myBeforeDisplayHandler, false);\n\t//This event handler checks the type of the selection.\n\t//If a graphic is selected, the event handler adds the script menu action to the menu.\n\tfunction myBeforeDisplayHandler(myEvent){\n\t\t//Check for open documents is a basic sanity check--\n\t\t//it should never be needed, as this menu won't be\n\t\t//displayed unless an item is selected. But it's best\n\t\t//to err on the side of safety.\n\t\tif(app.documents.length != 0){\n\t\t\tif(app.selection.length > 0){\n\t\t\t\tvar myObjectList = new Array;\n\t\t\t\t//Does the selection contain any graphics?\n\t\t\t\tfor(var myCounter = 0; myCounter < app.selection.length; myCounter ++){\n\t\t\t\t\tswitch(app.selection[myCounter].constructor.name){\n\t\t\t\t\t\tcase \"PDF\":\n\t\t\t\t\t\tcase \"EPS\":\n\t\t\t\t\t\tcase \"Image\":\n\t\t\t\t\t\t\tmyObjectList.push(app.selection[myCounter]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"Rectangle\":\n\t\t\t\t\t\tcase \"Oval\":\n\t\t\t\t\t\tcase \"Polygon\":\n\t\t\t\t\t\t\tif(app.selection[myCounter].graphics.length != 0){\n\t\t\t\t\t\t\t\tmyObjectList.push(app.selection[myCounter].graphics.item(0));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(myObjectList.length > 0){\n\t\t\t\t\t//Add the menu item if it does not already exist.\n\t\t\t\t\tif(myCheckForMenuItem(myLayoutContextMenu, \"Create Graphic Label\") == false){\n\t\t\t\t\t\tmyMakeLabelGraphicMenuItem();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//Remove the menu item, if it exists.\n\t\t\t\t\tif(myCheckForMenuItem(myLayoutContextMenu, \"Create Graphic Label\") == true){\n\t\t\t\t\t\tmyLayoutContextMenu.menuItems.item(\"Create Graphic Label\").remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfunction myCheckForMenuItem(myMenu, myString){\n\t\t\tvar myResult = false;\n\t\t\ttry{\n\t\t\t\tvar myMenuItem = myMenu.menuItems.item(myString);\n\t\t\t\tmyMenuItem.name;\n\t\t\t\tmyResult = true\n\t\t\t}\n\t\t\tcatch(myError){}\n\t\t\treturn myResult;\n\t\t}\n\t\tfunction myCheckForScriptMenuItem(myString){\n\t\t\tvar myResult = false;\n\t\t\ttry{\n\t\t\t\tvar myScriptMenuAction = app.scriptMenuActions.item(myString);\n\t\t\t\tmyScriptMenuAction.name;\n\t\t\t\tmyResult = true\n\t\t\t}\n\t\t\tcatch(myError){}\n\t\t\treturn myResult;\t\t\t\n\t\t}\n\t\tfunction myMakeLabelGraphicMenuItem(){\n\t\t\tif(myCheckForScriptMenuItem(\"Create Graphic Label\") == false){\n\t\t\t\tvar myLabelGraphicMenuAction = app.scriptMenuActions.add(\"Create Graphic Label\");\n\t\t\t\tvar myLabelGraphicEventListener = myLabelGraphicMenuAction.eventListeners.add(\"onInvoke\", myLabelGraphicEventHandler, false);\n\t\t\t}\n\t\t\tvar myLabelGraphicMenuItem = app.menus.item(\"$ID/RtMouseLayout\").menuItems.add(app.scriptMenuActions.item(\"Create Graphic Label\"));\n\t\t\tfunction myLabelGraphicEventHandler(myEvent){\n\t\t\t\tif(app.selection.length > 0){\n\t\t\t\t\tvar myObjectList = new Array;\n\t\t\t\t\t//Does the selection contain any graphics?\n\t\t\t\t\tfor(var myCounter = 0; myCounter < app.selection.length; myCounter ++){\n\t\t\t\t\t\tswitch(app.selection[myCounter].constructor.name){\n\t\t\t\t\t\t\tcase \"PDF\":\n\t\t\t\t\t\t\tcase \"EPS\":\n\t\t\t\t\t\t\tcase \"Image\":\n\t\t\t\t\t\t\t\t\tmyObjectList.push(app.selection[myCounter]);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"Rectangle\":\n\t\t\t\t\t\t\tcase \"Oval\":\n\t\t\t\t\t\t\tcase \"Polygon\":\n\t\t\t\t\t\t\t\tif(app.selection[myCounter].graphics.length != 0){\n\t\t\t\t\t\t\t\t\tmyObjectList.push(app.selection[myCounter].graphics.item(0));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(myObjectList.length > 0){\n\t\t\t\t\t\tmyDisplayDialog(myObjectList);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Function that adds the label.\n\t\t\t\tfunction myAddLabel(myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyleName, myLayerName){\n\t\t\t\t\tvar myLabelLayer;\n\t\t\t\t\tvar myDocument = app.documents.item(0);\n\t\t\t\t\tvar myLabel;\n\t\t\t\t\tmyLabelStyle = myDocument.paragraphStyles.item(myLabelStyleName);\n\t\t\t\t\tvar myLink = myGraphic.itemLink;\n\t\t\t\t\ttry{\n\t\t\t\t\t\tmyLabelLayer = myDocument.layers.item(myLayerName);\n\t\t\t\t\t\t//If the layer does not exist, trying to get the layer name will cause an error.\n\t\t\t\t\t\tmyLabelLayer.name;\n\t\t\t\t\t}\n\t\t\t\t\tcatch (myError){\n\t\t\t\t\t\tmyLabelLayer = myDocument.layers.add(myLayerName); \n\t\t\t\t\t} \n\t\t\t\t\t//Label type defines the text that goes in the label.\n\t\t\t\t\tswitch(myLabelType){\n\t\t\t\t\t\t//File name\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tmyLabel = myLink.name;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//File path\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tmyLabel = myLink.filePath;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//XMP description\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\tmyLabel = myLink.linkXmp.description;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch(myError){\n\t\t\t\t\t\t\t\tmyLabel = \"No description available.\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t//XMP author\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\tmyLabel = myLink.linkXmp.author\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch(myError){\n\t\t\t\t\t\t\t\tmyLabel = \"No author available.\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tvar myFrame = myGraphic.parent;\n\t\t\t\t\tvar myX1 = myFrame.geometricBounds[1]; \n\t\t\t\t\tvar myY1 = myFrame.geometricBounds[2] + myLabelOffset; \n\t\t\t\t\tvar myX2 = myFrame.geometricBounds[3]; \n\t\t\t\t\tvar myY2 = myY1 + myLabelHeight;\n\t\t\t\t\tvar myTextFrame = myFrame.parent.textFrames.add(myLabelLayer, undefined, undefined,{geometricBounds:[myY1, myX1, myY2, myX2], contents:myLabel}); \n\t\t\t\t\tmyTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.leadingOffset; \n\t\t\t\t\tmyTextFrame.paragraphs.item(0).appliedParagraphStyle = myLabelStyle;\t\t\t\t\n\t\t\t\t}\n\t\t\t\tfunction myDisplayDialog(myObjectList){\n\t\t\t\t\tvar myLabelWidth = 100;\n\t\t\t\t\tvar myStyleNames = myGetParagraphStyleNames(app.documents.item(0));\n\t\t\t\t\tvar myLayerNames = myGetLayerNames(app.documents.item(0));\n\t\t\t\t\tvar myDialog = app.dialogs.add({name:\"LabelGraphics\"});\n\t\t\t\t\twith(myDialog.dialogColumns.add()){\n\t\t\t\t\t\t//Label type\n\t\t\t\t\t\twith(dialogRows.add()){\n\t\t\t\t\t\t\twith(dialogColumns.add()){\n\t\t\t\t\t\t\t\tstaticTexts.add({staticLabel:\"Label Type\", minWidth:myLabelWidth});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twith(dialogColumns.add()){\n\t\t\t\t\t\t\t\tvar myLabelTypeDropdown = dropdowns.add({stringList:[\"File name\", \"File path\", \"XMP description\", \"XMP author\"], selectedIndex:0});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Text frame height\n\t\t\t\t\t\twith(dialogRows.add()){\n\t\t\t\t\t\t\twith(dialogColumns.add()){\n\t\t\t\t\t\t\t\tstaticTexts.add({staticLabel:\"Label Height\", minWidth:myLabelWidth});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twith(dialogColumns.add()){\n\t\t\t\t\t\t\t\tvar myLabelHeightField = measurementEditboxes.add({editValue:24, editUnits:MeasurementUnits.points});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Text frame offset\n\t\t\t\t\t\twith(dialogRows.add()){\n\t\t\t\t\t\t\twith(dialogColumns.add()){\n\t\t\t\t\t\t\t\tstaticTexts.add({staticLabel:\"Label Offset\", minWidth:myLabelWidth});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twith(dialogColumns.add()){\n\t\t\t\t\t\t\t\tvar myLabelOffsetField = measurementEditboxes.add({editValue:0, editUnits:MeasurementUnits.points});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Style to apply\n\t\t\t\t\t\twith(dialogRows.add()){\n\t\t\t\t\t\t\twith(dialogColumns.add()){\n\t\t\t\t\t\t\t\tstaticTexts.add({staticLabel:\"Label Style\", minWidth:myLabelWidth});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twith(dialogColumns.add()){\n\t\t\t\t\t\t\t\tvar myLabelStyleDropdown = dropdowns.add({stringList:myStyleNames, selectedIndex:0});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Layer\n\t\t\t\t\t\twith(dialogRows.add()){\n\t\t\t\t\t\t\twith(dialogColumns.add()){\n\t\t\t\t\t\t\t\tstaticTexts.add({staticLabel:\"Layer:\", minWidth:myLabelWidth});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\twith(dialogColumns.add()){\n\t\t\t\t\t\t\t\tvar myLayerDropdown = dropdowns.add({stringList:myLayerNames, selectedIndex:0});\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\tvar myResult = myDialog.show();\n\t\t\t\t\tif(myResult == true){\n\t\t\t\t\t\tvar myLabelType = myLabelTypeDropdown.selectedIndex;\n\t\t\t\t\t\tvar myLabelHeight = myLabelHeightField.editValue;\n\t\t\t\t\t\tvar myLabelOffset = myLabelOffsetField.editValue;\n\t\t\t\t\t\tvar myLabelStyle = myStyleNames[myLabelStyleDropdown.selectedIndex];\n\t\t\t\t\t\tvar myLayerName = myLayerNames[myLayerDropdown.selectedIndex];\n\t\t\t\t\t\tmyDialog.destroy();\n\t\t\t\t\t\tvar myOldXUnits = app.documents.item(0).viewPreferences.horizontalMeasurementUnits;\n\t\t\t\t\t\tvar myOldYUnits = app.documents.item(0).viewPreferences.verticalMeasurementUnits;\n\t\t\t\t\t\tapp.documents.item(0).viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;\n\t\t\t\t\t\tapp.documents.item(0).viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;\n\t\t\t\t\t\tfor(var myCounter = 0; myCounter < myObjectList.length; myCounter++){\n\t\t\t\t\t\t\tvar myGraphic = myObjectList[myCounter];\n\t\t\t\t\t\t\tmyAddLabel(myGraphic, myLabelType, myLabelHeight, myLabelOffset, myLabelStyle, myLayerName);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tapp.documents.item(0).viewPreferences.horizontalMeasurementUnits = myOldXUnits;\n\t\t\t\t\t\tapp.documents.item(0).viewPreferences.verticalMeasurementUnits = myOldYUnits;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tmyDialog.destroy();\n\t\t\t\t\t}\n\t\t\t\t\tfunction myGetParagraphStyleNames(myDocument){\n\t\t\t\t\t\tvar myStyleNames = myDocument.paragraphStyles.everyItem().name;\n\t\t\t\t\t\treturn myStyleNames;\n\t\t\t\t\t}\n\t\t\t\t\tfunction myGetLayerNames(myDocument){\n\t\t\t\t\t\tvar myLayerNames = new Array;\n\t\t\t\t\t\tvar myAddLabelLayer = true;\n\t\t\t\t\t\tfor(var myCounter = 0; myCounter<myDocument.layers.length; myCounter++){\n\t\t\t\t\t\t\tmyLayerNames.push(myDocument.layers.item(myCounter).name);\n\t\t\t\t\t\t\tif (myDocument.layers.item(myCounter).name == \"Labels\"){\n\t\t\t\t\t\t\t\tmyAddLabelLayer = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(myAddLabelLayer == true){\n\t\t\t\t\t\t\tmyLayerNames.push(\"Labels\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn myLayerNames;\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "78bcda15c10b707d7f907d6ca2fe2b62", "score": "0.4752295", "text": "function makeTemplate() {\n page_name = xml_path.path(\"filename\");\n dirname = xml_path.path(\"dirname\");\n if(jQuery.type(dirname) == \"string\" && dirname != \"\") {\n page_folder = dirname.split(\"/\").pop();\n }\n else {\n page_folder = false;\n };\n \n //alert(\"page_folder = \" + page_folder);\n \n // Delete multi articles\n memo_tag = false;\n $(\"main article\").each(function() {\n tag = $(this).find(\"input.article_tag\").first().val();\n if(tag == memo_tag) { $(this).remove(); }\n memo_tag = tag;\n });\n \n // Clear content\n $(\"main article section\").each(function() {\n clearSectionContent($(this));\n \n // Change media folder byName\n type = $(this).children(\".section_tag\").find(\".type\").text();\n if(type == \"media\") {\n $(this).find(\"form div.media li input\").each(function() {\n val = $(this).val().split(\"/\");\n \n if(val.length > 1 && val[val.length - 1] == page_name) {\n val[val.length - 1] = \"@filename\";\n if(page_folder && val[val.length - 2] == page_folder) {\n val[val.length - 2] = \"@folder\";\n }\n $(this).val(val.join(\"/\"));\n }\n })\n }\n \n // Change category path byName\n section_tag = $(this).find(\"input.section_tag\").first().val();\n if(section_tag == \"_category\") {\n $path = $(this).find(\"input.description\");\n val = $path.val();\n filename = val.split(\":\").pop().trim().path(\"filename\");\n if(filename == page_name) {\n val = val.replace(\"/\" + filename + \".\", \"/@filename.\", val);\n $path.val(val);\n }\n }\n if(section_tag == \"_categories_list\") {\n memo_row_lang = false;\n $(this).find(\"div.table\").find(\"textarea\").each(function() {\n row_lang = $(this).attr(\"class\");\n if(row_lang == memo_row_lang) { $(this).remove(); };\n memo_row_lang = row_lang;\n })\n }\n });\n \n // Delete file manager data\n $file_manager = $(\"main article\").first();\n if($file_manager.length && $file_manager.children(\".article_tag\").val() == \"_file_manager\") {\n $file_manager.find(\"form div.media li input.path\").each(function() {\n $(this).val(\"\");\n })\n };\n \n // Resize layout\n setTimeout(function() { resizeCode(); }, 500);\n }", "title": "" }, { "docid": "d93fe77affd4514bf4c41b9c7b8cbf3e", "score": "0.47482696", "text": "function runTool(sample, ref, th, lim){\n // Show that the tool is loading.\n showAlert('loadAlert');\n\n // Load textContent from refInputText + sampleInputText\n var refText = document.getElementById(ref).textContent;\n var sampleText = document.getElementById(sample).textContent;\n var threshold = parseInt(document.getElementById(th).value);\n var limit = parseInt(document.getElementById(lim).value);\n\n // Check if there are any parameters missing\n // Check if one or more inputs are missing:\n if ((refText == \"\") || (sampleText == \"\")){\n hideAlert('loadAlert');\n showAlert('errorAlert');\n return null;\n }\n\n // Check if read threshold value is valid:\n if (Number.isNaN(threshold)){\n hideAlert('loadAlert');\n alert(\"Please enter a valid threshold number!\");\n clearInput('threshold');\n return null;\n }\n\n // Check if limit value is valid:\n if (Number.isNaN(limit)){\n limit = Infinity;\n }\n\n var sampleArray = sampleText.split('\\n');\n var refArray = refText.split('\\n');\n\n var sampleDescs = nthElements(sampleArray, 0, 2);\n var sampleSeqs = nthElements(sampleArray, 1, 2);\n\n var refDescs = nthElements(refArray, 0, 2);\n var refSeqs = nthElements(refArray, 1, 2);\n\n // Filter for ref sequences with > #threshold\n var relevantRefSeqs = filterThreshold(refSeqs, refDescs, threshold)\n\n // Sort the relevantRefSeqs for binary search\n relevantRefSeqs.sort();\n\n // Iterate through the samples and search for them in the reference\n // Return the ones that do not appear in the reference\n var output = findClean(sampleSeqs, sampleDescs, relevantRefSeqs, limit);\n\n document.getElementById('fastaOutput').value = output;\n\n enableButton('download');\n\n hideAllAlerts();\n showAlert(\"successAlert\");\n\n return null;\n}", "title": "" }, { "docid": "7b8f4c7201ca29904cbd32d29eff8140", "score": "0.4745003", "text": "function renderFile(){\n fs.writeFileSync(outputPath, render(team),\"utf-8\");\n}", "title": "" }, { "docid": "b70f19df05b7d5d7e8d1f83429ba575e", "score": "0.474172", "text": "function markedTask (){\n\tvar paths = {\n\t\tsrc : path.resolve(config.src, config.md.src, '*.md'),\n\t\tdist: path.resolve(curPath, config.dist, config.md.dist)\n\t};\n\topt = {\n\t\t\ttpl: path.resolve(curPath, config.src, config.md.tplSrc),\n\t}\n\treturn gulp.src(paths.src)\n\t.pipe(marked())\n\t.pipe(parse2Html(opt))\n\t.pipe(gulp.dest(paths.dist));\n\n\tfunction parse2Html(opt) {\n\t\treturn through2.obj(function(file, enc , cb){\n\t\t\tvar contentStr = file.contents.toString();\n\t\t\tvar tpl = fs.readFileSync(opt.tpl);\n\t\t\tvar tplStr = tpl.toString();\n\t\t\ttplStr = tplStr.replace('@@content', contentStr)\n\t\t\t\t.replace('@@title', file.relative.replace('.html', ''));\n\n\t\t\tfile.contents = new Buffer(tplStr);\n\t\t\tthis.push(file);\n\t\t\tcb();\t\n\t\t})\n\t\t\n\t}\n}", "title": "" }, { "docid": "6316ad9f258b66ff0ceac3868f38d73c", "score": "0.4741228", "text": "function Main() {\r\n\tvar docPath = gDoc.filePath.absoluteURI + \"/\";\r\n\tvar baseName = GetFileName(gDoc.name) + \" - \" + gActPage.name;\r\n\tgTempFolderPath = docPath + \"Temp - \" + baseName + \"/\";\r\n\tgTempFolder = new Folder(gTempFolderPath);\r\n\tif (!gTempFolder.exists) gTempFolder.create();\r\n\tvar pdfPresetName = \"ExportToPS_bleedmarks\";\r\n\tvar pdfPreset = app.pdfExportPresets.itemByName(pdfPresetName);\r\n\tif (!pdfPreset.isValid) ErrorExit(\"Pdf-preset \\\"\" + pdfPresetName + \"\\\" doesn't exist.\", true);\r\n\t\r\n\t// Save open file as temp.indd file\r\n\tgDoc.save(new File(docPath + baseName + \".indd\"));\r\n\tgDoc = app.activeDocument;\r\n\tgDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS;\r\n\tgDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS;\r\n\r\nfor (var p = gDoc.pages.length-1; p >= 0; p--) {\r\n\tif (gDoc.pages[p] != gActPage) gDoc.pages[p].remove();\r\n}\r\n\tvar includeMaster = true; // TEMP false true\r\n\t\r\n\tUnlockLayers();\r\n\tRemovePasteboardItems(gDoc);\r\n\tif (includeMaster) { // If \"Include master\" is chose, override all master page items for the first page.\r\n\t\tvar masterSpreads = gDoc.masterSpreads;\r\n\t\tfor (var i = 0; i < masterSpreads.length; i++) {\r\n\t\t\tOverrideMasterItems(masterSpreads[i].pages[0]);\r\n\t\t}\r\n\t\tOverrideMasterItems(gDoc.pages[0]);\r\n\t}\r\n\tUnlockAllObjects();\r\n\tReleaseMultistateObjects();\r\n\tConvertButtonsToObjects(); \r\n\tMoveToLayer();\r\n\tLabelStackOrder();\r\n\tCreateLayersFromObjects();\r\n\tgDoc.layers.itemByName(\"Merged\").remove();\r\n\t\r\n\tvar obj = {}\r\n\tvar backgroundPdfFile = new File(gTempFolderPath + gDoc.name.replace(/\\.indd$/i, \"_background.pdf\"));\r\n\tobj.backgroundPdfFile = backgroundPdfFile;\r\n\tobj.psdFilePath = gDoc.fullName.fsName.replace(/\\.indd$/i, \"_Test.psd\");\r\n\t\r\n\tgDoc.exportFile(ExportFormat.PDF_TYPE, backgroundPdfFile, false, pdfPreset); // \"[High Quality Print]\" \"ExportToPS_bleedmarks\" Kas1 ExportToPS_bleedmarks ExportToPS_useDocumentBleedSettings\r\n\tCreateBridgeTalkMessage2(obj.toSource());\r\n\t\r\n\tExportPdfs(pdfPreset);\r\n\t\r\n\tCreateBridgeTalkMessage4();\r\n\tgDoc.save();\r\n\t\r\n\talert(\"Finished\", gScriptName + \" - \" + gScriptVersion);\r\n}", "title": "" }, { "docid": "5a14cd063d52dd93f4e620539055e16a", "score": "0.47408384", "text": "function formatToutesPhrases() {\n $(\"#arbre\").empty();\n for (e = 0; e < lastdata.length; ++e) {\n formatPhrase(lastdata[e]);\n }\n // install svg download button\n downloadSVG(\"a2\");\n $('.onlyWithTree').show();\n}", "title": "" }, { "docid": "d76b3c2881c58db75d69f5958f5c95bc", "score": "0.47364503", "text": "function markPacked(event){\n // Get the element that triggered a specific event\n var selectedItem = event.target;\n // Get element by id - where to place target item\n var targetList = document.getElementById('packedItems');\n // Create new item if selected \n var newItem = ' <li class=\"list-group-item\"> ' + selectedItem.getAttribute(\"data-itemname\") + ' </li>';\n // Where new item should be created\n var currentPackedList = targetList.innerHTML;\n targetList.innerHTML = currentPackedList + newItem;\n // Hide item if selected\n selectedItem.parentElement.parentElement.classList.add('hideItem');\n saveItem('packed', selectedItem.getAttribute(\"data-itemname\"));\n removeItem('bought', selectedItem.getAttribute(\"data-itemname\"));\n }", "title": "" }, { "docid": "06f1e2271f5f7c3e7f328ce00d7d73da", "score": "0.473545", "text": "function makeShowHelp(el, i)\n{\n el.addEventListener(\"click\", function() {\n\t document.getElementById(\"previewdiv\" + i).innerHTML = \"<table style='border-collapse: collapse;' border='1' bordercolor='lightgray' cellpadding='4px'>\" +\n\t\t\"<tr style='background-color: #ffff99; text-align: center'><td><em>you type:</em></td><td><em>you see:</em></td></tr>\" +\n\t\t\"<tr><td>*italics*</td><td><em>italics</em></td></tr>\" +\n\t\t\"<tr><td>**bold**</td><td><b>bold</b></td></tr>\" +\n\t\t\"<tr><td>[reddit!](http://reddit.com)</td><td><a href='http://reddit.com'>reddit!</a></td></tr>\" +\n\t\t\"<tr><td>* item1<br/>* item2<br/>* item3</td><td><ul><li>item 1</li><li>item 2</li><li>item 3</li></ul></td></tr>\" +\n\t\t\"<tr><td>&gt; quoted text</td><td><blockquote>quoted text</blockquote></td></tr>\" +\n\t\t\"</table>\";\n\n\t}, false);\n}", "title": "" }, { "docid": "2a20b22beec35e3b7d91c928032500a2", "score": "0.47318983", "text": "function generateChecklistContent(checklists, index) {\n var checklist = checklists[index];\n var checklistBody = \"\";\n\n const generatorsByKind = {\n note: generateNoteItem,\n todo: generateTodoItem\n }\n\n // TODO move items around\n // TODO delete checklists\n for (var i = 0; i < checklist.items.length; i++) {\n var item = checklist.items[i];\n var itemBody = generatorsByKind[item.kind](item, index, i);\n checklistBody += itemBody;\n }\n\n return `\n <div class=\"email-content\">\n <div class=\"email-content-header pure-g\">\n <div class=\"pure-u-4-5\">\n <input type=\"text\" class=\"editable-title somehow-big email-content-title\" value=\"${decodeURIComponent(checklist.title)}\">\n </div>\n\n <div class=\"email-content-controls pure-u-1-5\">\n <button class=\"secondary-button pure-button\" onclick=\"saveCallback(${index})\">Save</button>\n </div>\n </div>\n\n <div class=\"email-content-body\">\n\t ${checklistBody}\n <p>\n <button class=\"secondary-button pure-button\" onclick=\"addItemCallback(${index})\">New note</button>\n <button class=\"secondary-button pure-button\" onclick=\"addTaskCallback(${index})\">New task</button>\n </p>\n </div>\n </div>`;\n}", "title": "" }, { "docid": "8d39b69df603413c1790b3c5fd257d93", "score": "0.4724445", "text": "addToolBarItems() {\n // Ignore if the buttons are already there\n if (document.getElementsByClassName('rvt-tools').length !== 0) {\n return;\n }\n\n let btnGroup = `<div class=\"BtnGroup rvt-tools\">\n <a id=\"${Constants.SHOW_ALL_BUTTON_ID}\" class=\"${Constants.TOOL_BUTTON_CLASS}\" href=\"#\" aria-label=\"Show All\">Show All Files</a>\n <a id=\"${Constants.COLLAPSE_ALL_BUTTON_ID}\" class=\"${Constants.TOOL_BUTTON_CLASS}\" href=\"#\" aria-label=\"Collapse All\">Collapse All Files</a>\n </div>`;\n\n document.querySelector(Constants.DIFF_BAR_SELECTOR).insertAdjacentHTML('afterBegin', btnGroup);\n\n document.getElementById(Constants.COLLAPSE_ALL_BUTTON_ID).addEventListener('click', this.hideAllBodies);\n document.getElementById(Constants.SHOW_ALL_BUTTON_ID).addEventListener('click', this.showAllBodies);\n }", "title": "" }, { "docid": "a3ab4153c045b9f27bd9cde351744869", "score": "0.47226152", "text": "function HtmlWriter() {}", "title": "" }, { "docid": "bda0daf6be5d089370adb5c06aa2130e", "score": "0.4722224", "text": "function passAttributes(file_object){\r\n\t\tvar path = file_object.path;\r\n\t\tvar id = file_object.id;\r\n\t\t// TODO id => 3xxx\r\n\t\t//var id = temp_id.slice(6);\r\n\t\t//var resource_class = $(this).attr('class');\r\n\r\n\t\tvar type = path.substring(path.lastIndexOf(\".\") + 1, path.length);\r\n\r\n\t\tconsole.log(\"[passAttributes] path = \" + path + \", id = \" + id + \", type = \" + type);\r\n\r\n\t\t// var link = \"tag-tool.html\";\r\n\t\tclearTagtoolpopup();\r\n\t\tif (type === \"pdf\"){\r\n\t\t\t\r\n\t\t\t//link = \"tag-tool.html\";\r\n\t\t\tcreatePDFpopup(id, dragdropMode);\r\n\t\t} else if ($.inArray(type, videoType) !== -1){\r\n\t\t\tconsole.log(\"[passAttributes] type == videoType\");\r\n\t\t\t//link = \"tag-tool-video.html\";\r\n\t\t\tcreateVideopopup(id, dragdropMode);\r\n\t\t} else if ($.inArray(type, audioType) !== -1){\r\n\t\t\tconsole.log(\"[passAttributes] type == audioType\");\r\n\t\t\t//link = \"tag-tool-audio.html\";\r\n\t\t\tcreateAudiopopup(id, dragdropMode);\r\n\t\t}\r\n\t\tCookies.set('selected_asset_id', id, { expires: 1 });\r\n\t\tCookies.set('selected_asset_path', path, { expires: 1 });\r\n\t\t// OFF first, otherwise will fire multiple times!!!\r\n\t\t$(\".add-new-asset\").off('click').on('click', addNewAsset);\r\n\r\n\t\t// window.location.assign(link);\r\n\t\t//clearPDFpopup();\r\n\t\t//createPDFpopup(id, dragdropMode);\r\n\t\t//createVideopopup(id, dragdropMode);\r\n\r\n\t}", "title": "" }, { "docid": "80839b61a277aeb505907791809b18c4", "score": "0.4720879", "text": "function newQuizInfoTemplate() {\n return `<h1>3D Printing Facts</h1>`;\n}", "title": "" }, { "docid": "ca103ec1809fbade7cb350258ef8a503", "score": "0.4716845", "text": "function createFormattingToolBar() {\n ClassicEditor.create( document.querySelector( '#article_body' ), {\n toolbar: [ 'heading', '|', 'bold', 'italic', 'bulletedList', 'numberedList', 'link', 'blockQuote' ]\n });\n}", "title": "" }, { "docid": "ac0263c2b64c29e59fbc1a1051b35fbc", "score": "0.4714405", "text": "function copyrightedInfo (data) {\n var res = ''\n $.each(data.filename, function (idx, filename) {\n res += '<p>' + filename + '<br />'\n res += (data.source[idx]) ? '<a href=\"/urls/' + data.source[idx] + '\">http://godesigner.ru/urls/' + data.source[idx] + '</a><br />' : ''\n res += (data.needtobuy[idx] == 'on') ? '<span class=\"alert\">нужно покупать</span>' : 'не нужно покупать'\n res += '</p>'\n })\n res = '<div class=\"solution-info solution-copyrighted chapter\"> \\\n <h2>ДОП. МАТЕРИАЛЫ</h2>'\n + res +\n '<div class=\"separator\"></div> \\\n </div>'\n return res\n}", "title": "" }, { "docid": "561f195d1c502a275098a2930ebaf013", "score": "0.471321", "text": "function drawEnhancements() {\n let template = '<div class=\"col-12\"><h3>Enhancements</h3></div>'\n for (let i = 0; i < enhancements.length; i++) {\n let item = enhancements[i]\n let itemCost = shortNum(item.cost)\n\n template += `<div class=\"col-12 my-1\">\n <button id=\"btn-${item.id}\"\n class=\"btn btn-primary btn-enhance d-${item.visibility}\"\n type=\"submit\"\n onclick=\"purchaseEnhancement('${item.id}')\"\n ${item.disabled}\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n title=\"${item.description}\"> ${item.name} - ${itemCost} <span id=\"${item.id}\"></span>\n </button>\n </div>`\n }\n document.getElementById(\"enhancement-container\").innerHTML = template\n for (let i = 0; i < enhancements.length; i++) {\n let item = enhancements[i]\n // @ts-ignore\n $(`#btn-${item.id}`).tooltip({ delay: { \"show\": 100, \"hide\": 200 } })\n // @ts-ignore\n $(`#btn-${item.id}`).on('click', function () {\n // @ts-ignore\n $(this).tooltip('hide')\n })\n }\n}", "title": "" }, { "docid": "1f5ef612016390c5cbfc9f42fa25bc66", "score": "0.4707431", "text": "function characterStylemapping(){\r\n var myDoc = app.activeDocument;\r\n //==================For Creating Log Report========================\r\n var myPath = myDoc.fullName + \"\";\r\n myPath = myPath.replace(\".indd\",\".txt\");\r\n var myxml =[], id=0, label=0, styleName=[];\r\n var searchNames = \"bold|sup|sub|uline|sc|italic\";\r\n try{\r\n ProcessMainParent (\"italic\");} catch (e){\r\n displayMSG(\"Character formatting failed ...\\tfailed\\t\"+ percentSplit); \r\n debuggerMSG(\"Character style mapping - failed for italic\"); \r\n app.activeDocument.close(SaveOptions.NO); \r\n writeTxtFile(\"failed\");//a txt file is being created in the log file path for jobmanager to know the current status of proof (dt: 02-Jun-2017)\r\n exit();\r\n }\r\n try{\r\n ProcessMainParent (\"bold\");} catch (e){\r\n displayMSG(\"Character formatting failed ...\\tfailed\\t\"+ percentSplit); \r\n debuggerMSG(\"Character style mapping - failed for bold\"); app.activeDocument.close(SaveOptions.NO); \r\n writeTxtFile(\"failed\");//a txt file is being created in the log file path for jobmanager to know the current status of proof (dt: 02-Jun-2017)\r\n exit();\r\n }\r\n try{\r\n ProcessMainParent (\"sup\");} catch (e){\r\n displayMSG(\"Character formatting failed ...\\tfailed\\t\"+ percentSplit); \r\n debuggerMSG(\"Character style mapping - failed for supscript\"); app.activeDocument.close(SaveOptions.NO); \r\n writeTxtFile(\"failed\");//a txt file is being created in the log file path for jobmanager to know the current status of proof (dt: 02-Jun-2017)\r\n exit();\r\n }\r\n try{\r\n ProcessMainParent (\"sub\");} catch (e){\r\n displayMSG(\"Character formatting failed ...\\tfailed\\t\"+ percentSplit); \r\n debuggerMSG(\"Character style mapping - failed for subscript\"); app.activeDocument.close(SaveOptions.NO); \r\n writeTxtFile(\"failed\");//a txt file is being created in the log file path for jobmanager to know the current status of proof (dt: 02-Jun-2017)\r\n exit();\r\n }\r\n try{\r\n ProcessMainParent (\"uline\");} catch (e){\r\n displayMSG(\"Character formatting failed ...\\tfailed\\t\"+ percentSplit); \r\n debuggerMSG(\"Character style mapping - failed for underline\"); app.activeDocument.close(SaveOptions.NO); \r\n writeTxtFile(\"failed\");//a txt file is being created in the log file path for jobmanager to know the current status of proof (dt: 02-Jun-2017)\r\n exit(); \r\n }\r\n try{\r\n ProcessMainParent (\"sc\");} catch (e){\r\n displayMSG(\"Character formatting failed ...\\tfailed\\t\"+ percentSplit); \r\n debuggerMSG(\"Character style mapping - failed for smallcaps\"); app.activeDocument.close(SaveOptions.NO); \r\n writeTxtFile(\"failed\");//a txt file is being created in the log file path for jobmanager to know the current status of proof (dt: 02-Jun-2017)\r\n exit();\r\n }\r\n //alert(\"Character Style Processing completed\");\r\n //myFile.execute();\r\n //--------------------Functions\r\n function ProcessMainParent(parentTagName){\r\n myxml = []; label=0;\r\n passValueToMap(\"//\"+parentTagName);\r\n for (var i=0; i<myxml.length; i++){\r\n id=0; styleName=[];\r\n var myParent = myxml[i].parent.markupTag.name;\r\n if (myParent.search(searchNames)==-1){//Retuns -1 if search fails\r\n myxml[i].applyCharacterStyle(\"EXP-\"+parentTagName);\r\n var childElements = myxml[i].xmlElements;\r\n styleName[id++] = parentTagName;\r\n if (childElements.length>0){\r\n processChildNodes(childElements);\r\n }//End of if childElements.length>0 styleName[id++] = parentTagName;\r\n }//End of if myParent.search\r\n }//End of For i\r\n }\r\n function processChildNodes(xmlObj){\r\n \r\n for (var j=0; j<xmlObj.length; j++){\r\n if (xmlObj[j].markupTag.name.search(searchNames)!=-1){//Retuns postive values it search is true\r\n styleName[id++] = xmlObj[j].markupTag.name;\r\n }\r\n var CurrentTagName = xmlObj[j].markupTag.name;\r\n if (CurrentTagName.search(searchNames)!=-1){//Retuns postive values it search is true\r\n var tempName = styleName.slice();\r\n tempName.sort()\r\n var myCharStyleName = \"EXP-\"+tempName.join(\"-\");\r\n try{\r\n xmlObj[j].applyCharacterStyle(myCharStyleName);\r\n }\r\n catch (err){\r\n debuggerMSG(xmlObj[j].texts[0].words[0].contents)\r\n debuggerMSG(xmlObj[j].texts[0].paragraphs[0].contents)\r\n //app.select(xmlObj[j].texts[0].contents);\r\n }\r\n if (xmlObj[j].xmlElements.length>0){\r\n processChildNodes(xmlObj[j].xmlElements);//Recursive call of this function \r\n }\r\n styleName.pop();\r\n id--;\r\n }//End of if CurrentTagName.search\r\n }//End j for loop\r\n }//End of Function Process chile Nodes\r\n //--------------\r\n function MapCharStyle(myXPath){\r\n this.name = \"MapCharStyle\";\r\n this.xpath = myXPath;\r\n this.apply = function(myElement, myRuleProcessor){\r\n var myText = myElement.texts[0]\r\n myxml[label++] = myElement;\r\n }\r\n return true;\r\n }\r\n\r\n function passValueToMap(XPATH){\r\n var myRuleSet = new Array (new MapCharStyle(XPATH));\r\n with(myDoc)\r\n {\r\n var elements = xmlElements;\r\n __processRuleSet(elements.item(0), myRuleSet);\r\n }//end with\r\n }//End of function\r\n\r\n function ruleProcessorObject(ruleSet, ruleProcessor) {\r\n this.ruleSet = ruleSet;\r\n this.ruleProcessor = ruleProcessor;\r\n }\r\n\r\n function __makeRuleProcessor(ruleSet, prefixMappingTable){\r\n // Get the condition paths of all the rules.\r\n var pathArray = new Array();\r\n for (i=0; i<ruleSet.length; i++)\r\n {\r\n pathArray.push(ruleSet[i].xpath);\r\n }\r\n\r\n // the following call can throw an exception, in which case \r\n // no rules are processed \r\n try{\r\n var ruleProcessor = app.xmlRuleProcessors.add(pathArray, prefixMappingTable);\r\n }\r\n catch(e){\r\n throw e;\r\n }\r\n var rProcessor = new ruleProcessorObject(ruleSet, ruleProcessor);\r\n return rProcessor;\r\n }\r\n\r\n function __deleteRuleProcessor(rProcessor) {\r\n // remove the XMLRuleProcessor object\r\n rProcessor.ruleProcessor.remove();\r\n \r\n // delete the object properties\r\n delete rProcessor.ruleProcessor;\r\n delete rProcessor.ruleSet;\r\n \r\n // delete the object itself\r\n delete\trProcessor;\r\n }\r\n\r\n function __processRuleSet (root, ruleSet, prefixMappingTable)\r\n {\r\n var mainRProcessor = __makeRuleProcessor(ruleSet, prefixMappingTable);\r\n\r\n // if __processTree() fails with an exception, \r\n // delete ruleProcessor and throw e\r\n try {\r\n __processTree(root, mainRProcessor);\r\n __deleteRuleProcessor(mainRProcessor);\r\n } catch (e) {\r\n __deleteRuleProcessor(mainRProcessor);\r\n throw e;\r\n }\r\n }\r\n\r\n function __processTree (root, rProcessor)\r\n {\r\n var ruleProcessor = rProcessor.ruleProcessor; \r\n try\r\n {\r\n var matchData = ruleProcessor.startProcessingRuleSet(root);\r\n __processMatchData(matchData, rProcessor);\r\n \r\n ruleProcessor.endProcessingRuleSet();\r\n }\r\n catch (e)\r\n {\r\n // no longer deleting ruleProcessor within __processTree\r\n // deletion occurs either in __processRuleSet, or external\r\n // to glue code.\r\n ruleProcessor.endProcessingRuleSet();\r\n throw e;\r\n }\r\n }\r\n\r\n function __processChildren(rProcessor)\r\n {\r\n var ruleProcessor = rProcessor.ruleProcessor; \r\n try\r\n {\r\n var matchData = ruleProcessor.startProcessingSubtree();\r\n __processMatchData(matchData, rProcessor);\r\n }\r\n catch (e)\r\n {\r\n ruleProcessor.halt();\r\n throw e;\r\n }\r\n }\r\n\r\n function __processMatchData(matchData, rProcessor)\r\n {\r\n var ruleProcessor = rProcessor.ruleProcessor; \r\n var ruleSet = rProcessor.ruleSet;\r\n while (matchData != undefined)\r\n {\r\n var element = matchData.element;\r\n var matchRules = matchData.matchRules;\r\n var applyMatchedRules = true;\r\n\r\n // apply the action of the rule. \r\n // Continue applying rules as long as the apply function returns false.\r\n for (var i=0; i<matchRules.length && applyMatchedRules && !ruleProcessor.halted; i++)\r\n {\r\n applyMatchedRules = (false == ruleSet[matchRules[i]].apply(element, rProcessor));\r\n }\r\n matchData = ruleProcessor.findNextMatch();\r\n }\r\n }\r\n\r\n function __skipChildren(rProcessor)\r\n {\r\n rProcessor.ruleProcessor.skipChildren();\r\n }\r\n \r\n }", "title": "" }, { "docid": "5eacafc1574bd57bd0a7a8fcdc863823", "score": "0.47048405", "text": "function btnTextileMediaCallback (h) {\n\t\tvar mediapool = openMediaPool('markitup_media');\n\t\t$(mediapool).on('rex:selectMedia', function (event, filename) {\n\t\t\tevent.preventDefault();\n\t\t\tmediapool.close();\n\n\t\t\t$.markItUp({\n\t\t\t\topenWith: '!index.php?rex_media_type=markitupImage&rex_media_file='+filename+'('+filename+')!'\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "1bc64e7e19bb7c65034999069e593cef", "score": "0.4700426", "text": "function writeMarkup(opts, markup, callback) {\n var s3 = new aws.S3();\n async.parallelLimit(\n markup.map(item => cb => s3.putObject({\n Body: item.markup,\n Bucket: opts.packageConfig.s3BucketName,\n Key: item.path === '/' ? 'index.html' : item.path.substr(1),\n ACL: 'public-read',\n ContentType: 'text/html'\n }, cb)),\n 3,\n callback\n );\n}", "title": "" }, { "docid": "a61275f636acfcf768e0813ed913e39a", "score": "0.46959266", "text": "function wysIwyg() {\n $('.editor').trumbowyg({\n removeformatPasted: true,\n btns: [\n ['viewHTML'],\n ['undo', 'redo'], // Only supported in Blink browsers\n ['formatting'],\n ['strong', 'em', 'del'],\n ['superscript', 'subscript'],\n ['link'],\n ['insertImage'],\n ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],\n ['unorderedList', 'orderedList'],\n ['horizontalRule'],\n ['removeformat'],\n ['fullscreen'],\n ]\n });\n}", "title": "" }, { "docid": "94c73f79baeb623b83dd5208dbf7f3df", "score": "0.4695284", "text": "function CreateWidgetQuestion2Help() {\n var $fareType = $('.septa-question-2').val();\n $('.septa-question-2-help').text(data.info[$fareType]);\n }", "title": "" }, { "docid": "296095dcc87056dacbc80535ffc074c5", "score": "0.46910405", "text": "function save() {\n// if this is the current source, or it has no title (occurs with click event), stop\nif ( $.tooltip.blocked || this == current || (!this.tooltipText && !settings(this).bodyHandler) )\nreturn;\n\n// save current\ncurrent = this;\ntitle = this.tooltipText;\n\nif ( settings(this).bodyHandler ) {\nhelper.title.hide();\nvar bodyContent = settings(this).bodyHandler.call(this);\nif (bodyContent.nodeType || bodyContent.jquery) {\nhelper.body.empty().append(bodyContent)\n} else {\nhelper.body.html( bodyContent );\n}\nhelper.body.show();\n} else if ( settings(this).showBody ) {\nvar parts = title.split(settings(this).showBody);\nhelper.title.html(parts.shift()).show();\nhelper.body.empty();\nfor(var i = 0, part; (part = parts[i]); i++) {\nif(i > 0)\nhelper.body.append(\"<br/>\");\nhelper.body.append(part);\n}\nhelper.body.hideWhenEmpty();\n} else {\nhelper.title.html(title).show();\nhelper.body.hide();\n}\n\n// if element has href or src, add and show it, otherwise hide it\nif( settings(this).showURL && $(this).url() )\nhelper.url.html( $(this).url().replace('http://', '') ).show();\nelse \nhelper.url.hide();\n\n// fix PNG background for IE\nif (settings(this).fixPNG )\nhelper.parent.fixPNG();\n\nhandle.apply(this, arguments);\n}", "title": "" }, { "docid": "98eb95b5da055e310384eb0a5dab587c", "score": "0.46904314", "text": "function generate(title, docs, filename) {\n const docData = {\n env: env,\n title: title,\n docs: docs,\n fileName: filename,\n };\n const outpath = path.join(outdir, filename);\n const html = pipeline.render(\"container.tmpl\", docData);\n\n // We don't except to write on this file again (or do we?)\n fse.outputFile(outpath, html, \"utf8\", (error) => {\n if (error) {\n console.error(\"Couldn't save \" + outpath + \" because \" + error);\n }\n });\n}", "title": "" }, { "docid": "3b0e1601da52d090ea5a351d484b5713", "score": "0.46810448", "text": "function createToolKit(action)\n{\n\tif(document.getElementById(\"toolKit\") === null)\n\t{\n\t\ttoolKitName = document.createElement(\"div\");\n\t\ttoolKitName.id=\"toolKit\";\n\t toolKitStyle = toolKitName.style;\n\t toolKitStyle.backgroundColor=\"greenyellow\";\n\t toolKitStyle.width=\"200px\";\n\t toolKitStyle.height=\"50px\";\n\t toolKitStyle.align=\"center\";\n\t toolKitStyle.marginLeft=\"150px\";\n\t \t \n\t toolKitName.innerHTML=toolKitNames[action];\n\t myDiv.appendChild(toolKitName);\t\t\n\t}\t\n}", "title": "" }, { "docid": "1d4ec35a67b1a196845909c2a9ad092f", "score": "0.46808955", "text": "writing() {\n // Clone the template actions.ts file\n this.fs.copyTpl(\n this.templatePath('template.actions.ts'),\n this.destinationPath(`client/redux/actions/${this.fname}/${this.fname}.actions.ts`),\n { \n fname: this.fname,\n namelower: this.namelower,\n actionsname: this.actionsname\n }\n );\n // Clone the template actions.spec.ts file\n this.fs.copyTpl(\n this.templatePath('template.actions.spec.ts'),\n this.destinationPath(`client/redux/actions/${this.fname}/${this.fname}.actions.spec.ts`),\n { \n fname: this.fname,\n namelower: this.namelower,\n actionsname: this.actionsname\n }\n );\n }", "title": "" }, { "docid": "4d17b63ec1ed48bea99ccea237b31d91", "score": "0.46738467", "text": "function start_wdfEditor(tag) { \n\tvar filename = katana.$activeTab.find(tag).attr(\"fullpath\");\n\tdd = { 'path' : filename}; \n\tkatana.templateAPI.postTabRequest(\"WDF\", \"/katana/wdf/index\", dd);\n}", "title": "" }, { "docid": "fe6201a69a3dbd613e05fdef0db37eaa", "score": "0.4671212", "text": "buildExtraSamplesCode(){\n\n\t\treturn \t\"# Conditionals\\nif someVar==true:\\n\\t# ...\\nelif otherVar>10):\\n\\t# ...\\nelse:\\n\\t# ...\\n\\n\"+\n\t\t\t\t\"# For loop\\nfor i in range(1, 10):\\n\\t# ...\\n\\n# For Each loop\\nitems = [1, 2, 3, 4, 5\"+\n\t\t\t\t\"]\\nfor itm in items:\\n\\t# ...\\n\\n# While loop\\nwhile true:\\n\\t# ...\"+\n\t\t\t\t\"\";\n\t}", "title": "" }, { "docid": "65d2ffbac442964d2df7ce74ee9aeb57", "score": "0.46667573", "text": "function showBadGuy() {\n reusableTemplate('templates-display-character', '#bad-guy', badGuy);\n}", "title": "" }, { "docid": "05d14f54f73c74a275577b42d5dbf6ef", "score": "0.4662232", "text": "function renderDetailsHTML(fileId) {\n var details = fileDetails[fileId];\n\n var html = \"\";\n\n // Preview image\n if (details['preview-image'] == null) {\n html += '<div class=\"detail-preview\">No preview available.</div>';\n } else {\n html += '<img class=\"detail-preview-img\" src=\"' + details['preview-image'] + '\">';\n }\n\n html += '<div class=\"container\">';\n\n // Filename\n html += '<h3 class=\"detail-filename\">' + details['filename'] + '</h3>';\n \n // Metadata Block\n html += '<div class=\"detail-block\">';\n // Tags\n html += '<div class=\"detail-tag-container\">';\n details['tags'].forEach(tag => {\n html += '<div class=\"tag tag-' + tagDetails[tag].colour + '\"> ' + tagDetails[tag].name + ' <i class=\"fa fa-times\" aria-hidden=\"true\"></i></div>'\n });\n html += '<div class=\"tag tag-add\"><i class=\"fa fa-plus\" aria-hidden=\"true\"></i> Add tag... </div>';\n html += '</div>';\n // Type\n html += '<div class=\"detail-attribute\">';\n html += '<div class=\"detail-attr-label\">Type</div>';\n html += '<div class=\"detail-attr-data\">' + details['type'] + '</div>';\n html += '</div>';\n // Size\n html += '<div class=\"detail-attribute\">';\n html += '<div class=\"detail-attr-label\">Size</div>';\n html += '<div class=\"detail-attr-data\">' + details['size'] + '</div>';\n html += '</div>';\n // Date modified\n html += '<div class=\"detail-attribute\">';\n html += '<div class=\"detail-attr-label\">Date modified</div>';\n html += '<div class=\"detail-attr-data\">' + details['date-modified'] + '</div>';\n html += '</div>';\n // Date created\n html += '<div class=\"detail-attribute\">';\n html += '<div class=\"detail-attr-label\">Date created</div>';\n html += '<div class=\"detail-attr-data\">' + details['date-created'] + '</div>';\n html += '</div>';\n // Word count\n html += '<div class=\"detail-attribute\">';\n html += '<div class=\"detail-attr-label\">Word count</div>';\n html += '<div class=\"detail-attr-data\">' + details['word-count'] + '</div>';\n html += '</div>';\n html += '</div>';\n\n // Sharing block\n html += '<div class=\"detail-block\">';\n html += '<h5 class=\"detail-subheading\">SHARING</h5>';\n html += '<div class=\"persons-container\">';\n var sharing = details.sharing;\n for (let i = 0; i < sharing.length; i++) {\n for (let j = 0; j < sharing[i].length; j++) {\n let role = sharing[i][j];\n let needsSeperator = (j == sharing[i].length - 1) && (i != sharing.length - 1);\n\n html += needsSeperator ? '<div class=\"person-separator\">' : '';\n html += '<div class=\"person person-large\" title=\"' + role.description + '\">' + role.initial + '</div>';\n html += needsSeperator ? '</div>' : '';\n }\n }\n html += '</div>';\n html += '</div>';\n\n // Progress block\n if (details.progress != null) {\n html += '<div class=\"detail-block\">';\n html += '<h5 class=\"detail-subheading\">PROGRESS</h5>';\n html += '<div class=\"progress-container\">';\n html += '<i class=\"fa fa-line-chart progress-icon\" aria-hidden=\"true\"></i>';\n html += '<div class=\"progress-bar\">';\n html += '<span class=\"progress-bar-fill\" style=\"width: ' + details.progress.percentage + '\"></span>';\n html += '</div>';\n html += details.progress.percentage;\n html += '</div>';\n details.progress.tasks.forEach(task => {\n html += '<div class=\"detail-task\">';\n html += '<input type=\"checkbox\"' + (task.completed ? ' checked=\"checked\"' : '') + '>';\n html += task.name;\n html += '</div>';\n })\n html += ' <div class=\"detail-task detail-task-edit\">';\n html += '<i class=\"fa fa-pencil\" aria-hidden=\"true\"></i>';\n html += 'Edit tasks...';\n html += '</div>';\n html += '</div>';\n }\n\n // Versions block\n html += '<div class=\"detail-block detail-block-last\">';\n html += '<h5 class=\"detail-subheading\">VERSION HISTORY</h5>';\n details['version-history'].versions.forEach(version => {\n html += '<div class=\"detail-history\">';\n html += '<div class=\"detail-history-icon\">';\n html += '<i class=\"fa fa-history\" aria-hidden=\"true\"></i>';\n html += '</div>';\n html += '<div class=\"detail-history-time\">';\n html += version.date;\n html += '</div>';\n if (details['version-history'].type == 'text') {\n html += '<div class=\"detail-history-diff\">';\n html += '<span class=\"detail-history-add\">+' + version.additions + '</span> ';\n html += '<span class=\"detail-history-del\">-' + version.deletions + '</span>';\n html += '</div>';\n }\n html += '</div>';\n });\n html += '</div>';\n\n html += '</div>';\n\n document.getElementsByClassName(\"col-details\")[0].innerHTML = html;\n}", "title": "" }, { "docid": "d77cdeb12dbe649e8ff31593aa2daeb9", "score": "0.46597347", "text": "function processTemplate(item, index) {\n // Index guards against edge case of a blog having more \n // than one template. Don't think it actually happens.\n var templateFile = `${dirs.data}/template-${index}.xml`;\n fs.writeFileSync(templateFile, item.content[\"$t\"]);\n log.message(`Template saved: ${templateFile}`); \n blogDetails.contentTypes.templates++;\n}", "title": "" }, { "docid": "af3652bc56d6a2fed53c0145feaad28f", "score": "0.46577018", "text": "function toolText(data, flag, index){\n\tvar toReturn = \"\";\n\tif(flag==0){\n\t\tif(index>2){\n\t\t\tvar i = seriesIndexFromName(data.name);\n\t\t\ttoReturn+=titleArray[i] +\" <br /> \";\n\t\t\ttoReturn+= data.children.length + \" Seasons\";\n\t\t\treturn toReturn;\n\t\t}\n\t\treturn data.name;\n\t}\n\telse if(flag==1){\n\t\tif(index!=0){\n\t\t\ttoReturn+=data.name+\" <br /> \";\n\t\t\ttoReturn+= data.children.length + \" Episodes\";\n\t\t\treturn toReturn;\n\t\t}\n\t\tif(index == 0){\n\t\t\treturn \"Go back a level\";\n\t\t}\n\t\treturn toolText(data,0,3);\n\t}\n\telse if(flag==2 || flag==4 || flag==5){\n\t\tif(index!=0){\n\t\t\tvar epiData = csvData[data.exact-1];\n\t\t\ttoReturn+= \"Episode: \"+ epiData.episode + \" <br /> \";\n\t\t\ttoReturn+= epiData.title + \" <br /> \";\n\t\t\ttoReturn+= \"Rating: \" + epiData.rating + \" <br /> \";\n\t\t\ttoReturn+= \"Director: \" + epiData.director + \" <br /> \";\n\t\t\ttoReturn+= \"Writer: \" + epiData.writer;\n\t\t\tif(flag==4 || flag==5){\n\t\t\t\tvar i = seriesIndexFromName(epiData.series);\n\t\t\t\ttoReturn+=\" <br /> \";\n\t\t\t\ttoReturn+= \"Series: \"+ titleArray[i] + \" <br /> \";\n\t\t\t\ttoReturn+= \"Season: \"+ epiData.season;\n\t\t\t}\n\t\t\treturn toReturn;\n\t\t}\n\t}\n\tif(flag!=3){\n\t\tif(index==0){\n\t\t\treturn \"Go back a level\";\n\t\t}\t\n\t}\n\treturn data.name;\n}", "title": "" }, { "docid": "246793f2269ffaceb7c4594c05efd4ac", "score": "0.46565816", "text": "function createHTMLFIle() {\n const htmlContent = render( employeeList );\n\n fs.writeFile(\"./output/team.html\", htmlContent, (err) => {\n if (err) console.log(\"Failed to write file\");\n else console.log(\"Wrote file.\");\n })\n}", "title": "" }, { "docid": "c39f128efcb601fab3b2e52d9634b216", "score": "0.46528456", "text": "function addToolbox () {\n return `\n<category name=\"%{BKY_SHIFTDIGITDISPLAY_CATEGORY}\" id=\"SHIFTDIGITDISPLAY_CATEGORY\" colour=\"#0072E3\" secondaryColour=\"#005AB5\">\n <block type=\"shiftDigitDisplay_init\" id=\"shiftDigitDisplay_init\">\n <value name=\"LEN\">\n <shadow type=\"math_whole_number\">\n <field name=\"NUM\">4</field>\n </shadow>\n </value>\n <field name=\"SCLK\">2</field>\n <field name=\"RCLK\">3</field>\n <field name=\"DIO\">4</field>\n </block>\n <block type=\"shiftDigitDisplay_displayNumber\" id=\"shiftDigitDisplay_displayNumber\">\n <value name=\"NUM\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">16</field>\n </shadow>\n </value>\n <value name=\"DECIMAL\">\n <shadow type=\"math_whole_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n </block>\n <block type=\"shiftDigitDisplay_displayString\" id=\"shiftDigitDisplay_displayString\">\n <value name=\"DATA\">\n <shadow type=\"text\">\n <field name=\"TEXT\">Open</field>\n </shadow>\n </value>\n </block>\n <block type=\"shiftDigitDisplay_show\" id=\"shiftDigitDisplay_show\">\n <value name=\"TIME\">\n <shadow type=\"math_integer\">\n <field name=\"NUM\">1000</field>\n </shadow>\n </value>\n </block>\n</category>`;\n}", "title": "" }, { "docid": "17ea9529a174dd04947ebdeb7d0fbc42", "score": "0.46441227", "text": "function T1_MakeHTML (blocks) {\n\n var code = \"\"; // Code will be appended to this through the process\n var head_count = 0; // Will keep count of headers found\n var foot_count = 0; // Will keep count of footers found\n\n // Scan for Headers and Footers, we will not allow duplicates by force.\n for(var i = 0; i < blocks.length; i++){\n if(blocks[i] == 'label_1') {head_count++;}\n if(blocks[i] == 'label_2') {foot_count++;}\n }\n \n // Initalizes HTML\n code += T1_init ();\n \n // Header Exclusive, this forces a header to always be placed on top regardless\n // of the location it was found\n if(head_count > 0){code += T1_Header(); head_count--;}\n\n // Container Open (Used only for the basic Template)\n code += T1_ContainerTop();\n\n // Loop through blocks and output code as necessary \n for(var i = 0; i < blocks.length; i++){\n\n if (blocks[i] == 'label_1') { // Special conditions for headers\n if(head_count > 0) { // ONLY pushes alternate code if header was used\n code += T1_Title();\n head_count--;\n }} \n\n if (blocks[i] == 'label_2') { // Special conditions for footers\n if(foot_count > 1) { // ONLY pushed alternate code if footer was detected\n code += T1_Title();\n foot_count--;\n }}\n\n // All Other Labels\n if (blocks[i] == 'label_3') {code += T1_Para();}\n if (blocks[i] == 'label_4') {code += T1_Title();}\n if (blocks[i] == 'label_5') {code += T1_SingleImage();}\n if (blocks[i] == 'label_6') {code += T1_ImagePara();}\n if (blocks[i] == 'label_7') {code += T1_ImagePrev();}\n if (blocks[i] == 'label_8') {code += T1_ImageSimple();}\n if (blocks[i] == 'label_9') {code += T1_ImgLeft_TxtRight();}\n if (blocks[i] == 'label_10') {code += T1_ImgRight_TxtLeft();}\n if (blocks[i] == 'label_11') {code += T1_ImgTop_TxtBottom();}\n if (blocks[i] == 'label_12') {code += T1_Img_TxtTop();}\n if (blocks[i] == 'label_13') {code += T1_People();}\n }\n\n // Container Close (Used only for the basic Template)\n code += T1_ContainerBot ();\n \n // Footer Exclusive, forces a detected footer to always place on the bottom \n // regardless of the location it was found\n if(foot_count > 0){code += T1_Footer();}\n\n // Closes initalized HTML\n code += T1_init_End();\n \n code = formatFactory(code);\n return code;\n}", "title": "" }, { "docid": "111227d6ab288590bae78d942d99cb15", "score": "0.4636999", "text": "function generatePostScripts() {\n const droptHeader = [\n '// This file generated by a tool',\n 'import crafttweaker.item.IItemStack;',\n 'import mods.dropt.Dropt;',\n '',\n 'var clumps = Dropt.list(\"gtce_clumps\").priority(1);',\n ''\n ];\n\n /**\n * Write out the normal oregen files\n */\n _.each(oreCache, (ore) => {\n const oreName = util.gregOreToOreDict(ore.Ore);\n const material = contentTweaker.getGregtechMaterialName(oreName);\n const smelterOutput = ore.Smelter && oreDictionary.resolveOredict(ore.Smelter);\n const materialPart = contentTweaker.getMaterialPartMapping(`${material}_clump`);\n\n const blocks = _\n .chain({'stone': null, 'gravel': 'gravel', 'sand': 'sand'})\n .map((variety, dict) => {\n return _.map(worldgen.stoneClasses, (types, stone) => {\n return _.map(types, (subtype, idx) => {\n const mapping = contentTweaker.getGregtechOreMapping(oreName, subtype, variety);\n\n if (!mapping) {\n console.warn(`Missing Content Tweaker mapping for ${oreName} in ${subtype}${variety}.`);\n return;\n }\n\n return {\n name: `${_.startCase(subtype)} ${_.startCase(stone)} ${_.startCase(dict)}`,\n blockstate: `contenttweaker:sub_block_holder_${mapping.block}:${mapping.sub}`,\n baseBlock: `<undergroundbiomes:${stone}_${dict}:${idx}>`\n };\n });\n });\n })\n .flattenDeep()\n .filter((o) => o !== undefined)\n .value();\n\n _.each(worldgen.additionalReplacements, (add) => {\n const [mod,variant] = add.variant.split(':');\n const mapping = contentTweaker.getGregtechOreMapping(oreName, variant, '', mod);\n\n blocks.push({\n name: `${_.startCase(mod)} ${_.startCase(variant)}`,\n blockstate: `contenttweaker:sub_block_holder_${mapping.block}:${mapping.sub}`,\n baseBlock: `<${add.predicate.startsWith('ore_dict') ? oreDictionary.resolveOredict(add.predicate.substr(9)) : add.predicate.substr(6)}>`\n });\n });\n\n // TODO: make this more generic\n if(oreName !== 'Amber') {\n _.each({\n 'minecraft:cobblestone:0': 0,\n 'minecraft:stone:1': 1,\n 'minecraft:stone:3': 2,\n 'minecraft:stone:5': 3,\n 'minecraft:gravel': 4,\n 'minecraft:netherrack': 6,\n 'minecraft:end_stone': 7,\n 'minecraft:sand:0': 8,\n 'minecraft:sand:1': 9\n }, (idx, base) => {\n blocks.push({\n name: _.startCase(base.split(':')[1]),\n blockstate: `gregtech:ore_${_.snakeCase(ore.Ore).replace('_235','235')}_0:${idx}`,\n baseBlock: `<${base}>`\n });\n });\n }\n\n\n fs.writeFileSync(`../scripts/drops/Ore${util.pascalCase(oreName)}.zs`, _.flattenDeep([\n droptHeader,\n `var clump = <${materialPart}> as IItemStack;`,\n `<ore:ore${util.pascalCase(oreName)}>.add(clump);`,\n smelterOutput && `furnace.addRecipe(<${smelterOutput}>, clump);` || '// No smelter output',\n '',\n '',\n '',\n _.map(blocks, (block) => {\n const blockMatch = ` .matchBlocks([\"${block.blockstate}\"])`;\n \n return [\n '/*',\n ` * ${block.name}`,\n ' */',\n 'clumps.add(Dropt.rule()',\n blockMatch,\n ' .dropStrategy(\"UNIQUE\")',\n ' .dropCount(Dropt.range(5))',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"EXCLUDED\", 0)',\n ` .items([clump], Dropt.range(1))`,\n ' )',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"EXCLUDED\", 1)',\n ` .items([clump], Dropt.range(0,1))`,\n ' )',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"EXCLUDED\", 2)',\n ` .items([clump], Dropt.range(0,1))`,\n ' )',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"EXCLUDED\", 3)',\n ` .items([clump], Dropt.range(0,1))`,\n ' )',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"EXCLUDED\", 0)',\n ` .items([${block.baseBlock}])`,\n ' )',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"REQUIRED\")',\n ` .items([<${block.blockstate}>])`,\n ' )',\n ');',\n '',\n ''\n ];\n })\n ]).join('\\n'));\n });\n\n /**\n * Additional ores\n */\n _.each(worldgen.additionalOres, (ore) => {\n fs.writeFileSync(`../scripts/drops/Ore${util.pascalCase(ore.name)}.zs`, _.flattenDeep([\n droptHeader,\n `var drop = <${ore.drops.drop}> as IItemStack;`,\n '',\n _\n .chain(ore.drops.blocks)\n .map((block) => {\n const mapping = contentTweaker.getGregtechOreMapping(ore.name, block.subtype, block.variety);\n\n if (!mapping) {\n console.warn(`Missing Content Tweaker mapping for ${ore.name} in ${block.subtype}${block.variety}.`);\n return;\n }\n\n const blockstate = `contenttweaker:sub_block_holder_${mapping.block}:${mapping.sub}`;\n\n return [\n '/*',\n ` * ${_.startCase(block.subtype)} ${_.startCase(block.variety)}`,\n ' */',\n 'clumps.add(Dropt.rule()',\n ` .matchBlocks([\"${blockstate}\"])`,\n ' .dropStrategy(\"UNIQUE\")',\n ' .dropCount(Dropt.range(5))',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"EXCLUDED\", 0)',\n ` .items([drop], Dropt.range(1))`,\n ' )',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"EXCLUDED\", 1)',\n ` .items([drop], Dropt.range(0,1))`,\n ' )',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"EXCLUDED\", 2)',\n ` .items([drop], Dropt.range(0,1))`,\n ' )',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"EXCLUDED\", 3)',\n ` .items([drop], Dropt.range(0,1))`,\n ' )',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"EXCLUDED\", 0)',\n ` .items([<${block.base}>])`,\n ' )',\n ' .addDrop(Dropt.drop()',\n ' .selector(Dropt.weight(1), \"REQUIRED\")',\n ` .items([<${blockstate}>])`,\n ' )',\n ');',\n '',\n ''\n ]\n })\n .filter((o) => o)\n .value()\n ]).join('\\n'));\n })\n}", "title": "" }, { "docid": "46d9686cd8f6ed576ef6c086af956c63", "score": "0.46358013", "text": "function FileChecking(file,filePath,OEBPSFolder){\n\ti++;\n\t\n\t//File Path Defining\n\tif(filePath.toString().replace(OEBPSFolder + '\\\\','').replace(/\\\\/g,'/') == file){\n\t\thref = filePath.toString().replace(OEBPSFolder + '\\\\','').replace(/\\\\/g,'/');\n\t}\n\telse{\n\t\thref = filePath.toString().replace(OEBPSFolder + '\\\\','').replace(/\\\\/g,'/');\n\t}\n\t\n\t//If File name has the extension of \".ncx\"\n\tif(file.toString().indexOf('.ncx')>0){\n\t\titemTag('ncx-' + i,href,'application/x-dtbncx+xml','',false,false);\n\t}\n\t\n\t//If File name has the extension of \".css\"\n\telse if(file.toString().indexOf('.css')>0){\n\t\titemTag('css-' + i,href,'text/css','',false,false);\n\t}\n\t\n\t//If File name has the extension of \".mp3\"\n\telse if(file.toString().indexOf('.mp3')>0){\n\t\titemTag('audio-' + i,href,'audio/mpeg','',false,false);\n\t}\n\t\n\t//If File name has the extension of \".otf\"\n\telse if(file.toString().indexOf('.otf')>0){\n\t\titemTag('font-' + i,href,'application/opentype','',false,false);\n\t}\n\t\n\t//If File name has the extension of \".ttf\"\n\telse if(file.toString().indexOf('.ttf')>0){\n\t\titemTag('font-' + i,href,'application/truetype','',false,false);\n\t}\n\t\n\t//If File name has the extension of \".jpg\"\n\telse if(file.toString().indexOf('.jpg')>0){\n\t\t\n\t\t//If File name has the extension of \"cover.jpg\"\n\t\tif((file == 'cover.jpg' || file == 'frontcover.jpg') && (filePath.toString().match('images') || filePath.toString().match('image'))){\n\t\t\titemTag('cover-image',href,'image/jpeg','',false,false);\n\t\t}\n\t\telse {\n\t\t\titemTag('image' + i,href,'image/jpeg','',false,false);\n\t\t}\n\t}\n\t\n\t//If File name has the extension of \".png\"\n\telse if(file.toString().indexOf('.png')>0){\n\t\t\n\t\t//If File name has the extension of \"cover.png\"\n\t\tif((file == 'cover.png' || file == 'frontcover.png') && (filePath.toString().match('images') || filePath.toString().match('image'))){\n\t\t\titemTag('cover-image',href,'image/png','',false,false);\n\t\t}\n\t\telse {\n\t\t\titemTag('image-' + i,href,'image/png','',false,false);\n\t\t}\n\t}\n\t\n\t//If File name has the extension of \".html\"\n\telse if((file.toString().indexOf('.html')>0)){\n\t\t\n\t\t//Find the nav.html file and update in the manifest\n\t\tif(file == 'nav.html'){\n\t\t\titemTag('nav-1',href,'application/html+xml','',false,true)\n\t\t}\n\t\t\n\t\t//Find the cover.html file and update in the manifest\n\t\telse if(file == 'cover.html' || file == 'frontcover.html'){\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\tcoverfileFound = true;\n\t\t\tif(smilFileFound){\n\t\t\t\titemTag('cover-html',href,'application/xhtml+xml','cover-smil',true,false);\n\t\t\t}\n\t\t\telse{\n\t\t\t\titemTag('cover-html',href,'application/xhtml+xml','',false,false)\n\t\t\t}\n\t\t\tif(guideRequired == true){\n\t\t\t\tguideTag = guideTag + '\\n' + '<guide>\\n<reference type=\"cover\" title=\"cover\" href=\"' + href + '\"/>' + '\\n</guide>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\tguideTag = '';\n\t\t\t}\n\t\t}\n\t\t//Find the backcover.html file and update in the manifest\n\t\telse if(file == 'backcover.html' || file == 'back_cover.html'){\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\tbackcoverfileFound = true;\n\t\t\tif(smilFileFound){\n\t\t\t\titemTag('backcover-html',href,'application/xhtml+xml','backcover-smil',true,false);\n\t\t\t}\n\t\t\telse{\n\t\t\t\titemTag('backcover-html',href,'application/xhtml+xml','',false,false)\n\t\t\t}\n\t\t}\n\t\t\n\t\t//other HTML files\n\t\telse{\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\thtmlPageID(file,href,OEBPSFolder,'xhtml'); //Function to check the html files and update in the manifest\n\t\t}\n\t}\n\n\t//If File name has the extension of \".xhtml\"\n\telse if((file.toString().indexOf('.xhtml')>0)){\n\t\t\n\t\t//Find the nav.html file and update in the manifest\n\t\tif(file == 'nav.xhtml'){\n\t\t\titemTag('nav-1',href,'application/xhtml+xml','',false,true)\n\t\t}\n\t\t\n\t\t//Find the cover.html file and update in the manifest\n\t\telse if(file == 'cover.xhtml' || file == 'frontcover.xhtml'){\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\tcoverfileFound = true;\n\t\t\tif(smilFileFound){\n\t\t\t\titemTag('cover-html',href,'application/xhtml+xml','cover-smil',true,false);\n\t\t\t}\n\t\t\telse{\n\t\t\t\titemTag('cover-html',href,'application/xhtml+xml','',false,false)\n\t\t\t}\n\t\t\tif(guideRequired == 1 || guideRequired == '1'){\n\t\t\t\tguideTag = guideTag + '\\n' + '<guide>\\n<reference type=\"cover\" title=\"cover\" href=\"' + href + '\"/>' + '</guide>';\n\t\t\t}\n\t\t\telse{\n\t\t\t\tguideTag = '';\n\t\t\t}\n\t\t}\n\t\t//Find the backcover.html file and update in the manifest\n\t\telse if(file == 'backcover.xhtml' || file == 'back_cover.xhtml'){\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\tbackcoverfileFound = true;\n\t\t\tif(smilFileFound){\n\t\t\t\titemTag('backcover-html',href,'application/xhtml+xml','backcover-smil',true,false);\n\t\t\t}\n\t\t\telse{\n\t\t\t\titemTag('backcover-html',href,'application/xhtml+xml','',false,false)\n\t\t\t}\n\t\t}\n\t\t\n\t\t//other HTML files\n\t\telse{\n\t\t\tFinding_Page_Wise_Smil_File(OEBPSFolder,file); //Function declared to find the smil file for each html file.\n\t\t\thtmlPageID(file,href,OEBPSFolder,'xhtml'); //Function to check the html files and update in the manifest\n\t\t}\n\t}\n\t\n\telse if(file.toString().indexOf('.smil')>0){\n\t\tif(file == 'cover.smil' || file == 'frontcover.smil'){\n\t\t\titemTag('cover-smil',href,'application/xhtml+xml','',false,false)\n\t\t}\n\t\telse if(file == 'backcover.smil'){\n\t\t\titemTag('backcover-smil',href,'application/xhtml+xml','',false,false)\n\t\t}\n\t\telse{\n\t\t\tsmilPageID(file,href,OEBPSFolder); //Function to check the smil file and update in the manifest\n\t\t}\n\t}\n}", "title": "" }, { "docid": "450ac92d43070dcf2838378ecbfba690", "score": "0.46346316", "text": "function processSelectedFile(filePath, requestingField) {\r\n switch(requestingField){\r\n case '_markitUp':{\r\n if (typeof $.fn.markItUp !== 'undefined') $.markItUp({replaceWith: '<img src=\"/' + filePath +'\" alt=\"[![Описание]!]\" />'});\r\n break;\r\n }\r\n case '_markitUpFile':{\r\n if (typeof $.fn.markItUp !== 'undefined'){\r\n $.markItUp({replaceWith: '<a href=\"/' + filePath +'\" title=\"[![Описание]!]\" />[![Текст ссылки]!]</a>'});\r\n }\r\n break;\r\n }\r\n default:{\r\n $(\"#\" + requestingField).val(filePath);\r\n $(\"#\" + requestingField + 'Src').attr('src', '/' + filePath).parent().show();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "009418a6a4330f3bedebd4dce34b7e1f", "score": "0.46316603", "text": "function buildSubcaption() {\n const displayFileName = originalFilename || (files[0] && files[0].name)\n let subcaption = type === documentFileTypes.TEMPLATE ? category : `${requiredFileExtensions.join(', ')} · ${category}`\n if (displayFileName) subcaption = (\n <>\n <span role='link' onClick={originalFilename ? handleFileDownload : handleUploadedFileDownload}>\n {displayFileName}\n </span>\n {` · ${category}`}\n </>\n )\n return <PDocInfo includeTopMargin={!displayFileName}>{subcaption}</PDocInfo>\n }", "title": "" }, { "docid": "c52d7afbbffe682be6cf64a2cf634a98", "score": "0.46303162", "text": "function Save(event) {\n\tCompile(); //in case user has not compiled before saving\n\tvar name=$(\".pdfEmbed\").attr(\"id\"); //name of input file, minus extension\n\tvar module=$(\".markingWrapper\").attr(\"id\"); //name of module\n\tvar compileText=$(\"#compileText\").val(); //compiled comments\n\t/* Make sure all newlines are \\r\\n for correct display in .txt file.\n\t * To avoid converting \\r\\n to \\r\\r\\n, first convert all \\r\\n to \\n,\n\t * and then convert all \\n to \\r\\n. */\n\tcompileText=compileText.replace(/\\r\\n/g, \"\\n\");\n\tcompileText=compileText.replace(/\\n/g, \"\\r\\n\");\n\tfileHeading=\"Module name: \"+module+\"\\r\\n\"+\"File name: \"+name+\"\\r\\n\\r\\n\"; //header with module and file names\n\tvar val=$('input[name=\"txtorpdf\"]:checked').val(); //get file type choice\n\tif (val==\"pdf\") {\n\t\tprintToPDF(compileText,name,fileHeading);\n\t}\n\telse if (val==\"txt\") {\n\t\ttextToWrite=fileHeading+compileText;\n\t\tprintToTXT(textToWrite,name);\n\t}\n\telse {\n\t\talert(\"There was an error.\");\n\t }\n}", "title": "" }, { "docid": "ebc9f831f56b3fe31cbe8bba7d3feca3", "score": "0.4629643", "text": "function add_to_file(entity){\r\n\tadd_to_palette(entity);\r\n\tadd_to_graphical_definition(entity);\r\n}", "title": "" }, { "docid": "54e35b71477030604a075e7ae40190b5", "score": "0.46281257", "text": "_generateMarkUp() {\n const id = Number(window.location.hash.slice(1));\n\n return `\n <li class=\"preview\">\n <a class=\"preview__link ${\n this._data.id === id ? 'preview__link--active' : ''\n }\" href=\"#${this._data.id}\">\n <figure class=\"preview__fig\">\n <img src=\"${this._data.image}\" alt=\"${this._data.title}\" />\n </figure>\n <div class=\"preview__data\">\n <h4 class=\"preview__title\">${this._data.title}</h4>\n <p class=\"preview__publisher\">${this._data.genres\n .map(genre => {\n return genre.name;\n })\n .join(', ')}</p>\n </div>\n </a>\n </li>\n `;\n }", "title": "" }, { "docid": "0df00a0cfba9b4f4ca41e18b4660e570", "score": "0.4626187", "text": "function template() {\n return [\n '<style>',\n 'productimagemodal a:hover {color:inherit;text-decoration:none;}',\n '.lightbox {font-size:16px; padding:10px 0;}',\n '</style>',\n '<a class=\"lightbox\" ng-click=\"open(500)\">',\n '<figure ng-hide=\"LineItem.Variant.PreviewUrl\">',\n '<img id=\"451_img_prod_lg\" class=\"product-image-large img-responsive\" ng-src=\"{{LineItem.Variant.PreviewUrl || LineItem.Variant.LargeImageUrl || LineItem.Product.LargeImageUrl}}\" imageonload />',\n '</figure>',\n '<figure ng-show=\"LineItem.Variant.PreviewUrl\">',\n '<img style=\"border:1px solid black;\" id=\"451_img_prod_lg\" class=\"product-image-large img-responsive\" ng-src=\"{{LineItem.Variant.PreviewUrl || LineItem.Variant.LargeImageUrl}}\" imageonload />',\n '</figure>',\n '</a>',\n '<br/><span ng-show=\"LineItem.Variant.PreviewUrl\" style=\"color:red;font-size:.8em;\">This is a draft. Please click \"View PDF\" to review proof.</span>'\n ].join('');\n }", "title": "" }, { "docid": "067ffbd0bb54150c5073aa2cc3b54cf3", "score": "0.46237862", "text": "function main() {\r\n\tvar progCounter = 1,\r\n\t\t\tfiles = [],\r\n\t\t\tsourceFolder = Folder.selectDialog('Select the folder with Illustrator .ai, .eps files');\r\n\t\r\n\t// Progress bar\r\n\tvar win = new Window('palette', 'FileVersionInformer', [150, 150, 600, 260]);\r\n\twin.pnl = win.add('panel', [10, 10, 440, 100], undefined);\r\n\twin.pnl.progBar = win.pnl.add('progressbar', [20, 35, 410, 50], 0, 100);\r\n\twin.pnl.progBarLabel = win.pnl.add('statictext', [20, 20, 320, 35], '0%');\r\n\r\n\tif (sourceFolder != null) {\r\n\t\tvar resultFile = new File(sourceFolder.path + '/' + sourceFolder.name + '/FileVersionInformer.txt');\r\n\t\tresultFile.encoding = 'UTF8';\r\n\t\tif (resultFile != null) resultFile.remove();\r\n\r\n\t\tfiles = getSubfolderFiles(sourceFolder);\r\n\r\n\t\t// If folder not empty\r\n\t\tif (files.length > 0) {\r\n\t\t\t//Show Progress bar\r\n\t\t\twin.show();\r\n\t\t\tresultFile.open('a+');\r\n\t\t\tresultFile.writeln('List of .ai, .eps files in Folder & Subolders');\r\n\t\t\tresultFile.writeln(\"------------------\");\r\n\t\t\tfor (var i = 0, fLen = files.length; i < fLen; i++) {\r\n\t\t\t\t// Change Progress bar\r\n\t\t\t\twin.pnl.progBar.value = progCounter * (100 / fLen);\r\n\t\t\t\twin.pnl.progBarLabel.text = win.pnl.progBar.value.toFixed(0) + \"%\";\r\n\t\t\t\twin.update();\r\n\t\t\t\t// Writing current file name and Illustrator version\r\n\t\t\t\tresultFile.writeln(\"File '\" + decodeURI(files[i].name) + \"' saved as \" + getVersion(files[i]));\r\n\t\t\t\tprogCounter++;\r\n\t\t\t}\r\n\t\t\tresultFile.writeln();\r\n\t\t\tresultFile.close();\r\n\t\t\talert('Script is done\\nLook \"FileVersionInformer.txt\" in source folder');\r\n\t\t} else {\r\n\t\t\talert('No matching files found');\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "8b3a0082b3225c8e62574961206c5e6b", "score": "0.4622428", "text": "function writeFavorites(id) {\r\n\r\n var rc;\r\n var str = '';\r\n var testExpr = false; var testStop = false;\r\n\r\n rc = showMenuItem('express');\r\n if (rc == '1') {\r\n testExpr = true;\r\n }\r\n rc = showMenuItem('stop');\r\n if (rc == '1') {\r\n testStop = true;\r\n }\r\n\r\n str += '<span class=\"leftContentListHeader\">Favorites: (<a href=\"..\\/customer_support\\/favorites.html\">Edit<\\/a>)';\r\n str += '<\\/span><ul class=\"leftContentList\">';\r\n if (testExpr) {\r\n str += '<li><a href=\"..\\/express_transfer\\/express_entry.html\">Express transfer entry<\\/a><\\/li>';\r\n }\r\n if (testStop) {\r\n str += '<li><a href=\"..\\/stop_payment\\/stoppay_request.html\">Stop payment request<\\/a><\\/li>';\r\n }\r\n str += '<\\/ul>';\r\n\r\n helpwriteContent(id, str);\r\n\r\n\r\n}", "title": "" }, { "docid": "ab46f5b1d5057bba531abfb459f65c8f", "score": "0.46131122", "text": "function produceHelpLink() {\n $('.added').remove();\n $('#modal-content').append(\n '<p class=\"flagged-content\">It looks like you are having a really hard time right now. Please let us put you in touch with some mental health professionals to get you the help you need!</p> <a href=\"./help\"><button class=\"short-button help-button\">Find Help</button></a>'\n );\n }", "title": "" } ]
f81f775dd73e5a6625c769e1e9a0f355
Get default list of books from NYT API for initial home view
[ { "docid": "b5a4bad31e442f9fb9b720a89d4082ee", "score": "0.6601119", "text": "async function getBooks(){\n if(!books){\n let result = await MyBooklistApi.bookSearch(\"fiction\", getCurrentDate(), user.username);\n setBooks(result);\n }\n }", "title": "" } ]
[ { "docid": "3f0a2b96fc0eebb63413a65418e24286", "score": "0.7624927", "text": "function getAllBooks(){\n fetch(baseURL)\n .then(res => res.json())\n .then(books => listBooks(books))\n }", "title": "" }, { "docid": "023703349365c97c5fc23ec4276baf89", "score": "0.75911146", "text": "function getBooks () {\n fetch(bookUrl)\n .then(resp => resp.json())\n .then(books => {\n renderBooks(books);\n window.allBooks = books\n }) //aspirational code to renderBooks(books)\n }", "title": "" }, { "docid": "6c7608a0d2ba75573ea8fdca951b1335", "score": "0.74060637", "text": "function getBooks() {\n return fetch(`${BASE_URL}/books`).then(res => res.json())\n}", "title": "" }, { "docid": "2821306c8bd6b155da7cf087d9b30421", "score": "0.72585243", "text": "function getBooks() {\n $.ajax({\n url: 'http://127.0.0.1:8000/book/',\n method: 'GET'\n }).done(function (response) {\n setBooks(response);\n });\n }", "title": "" }, { "docid": "05e93cee2ce13006cae7fba638d190c1", "score": "0.70434433", "text": "function loadBooks() {\n const data = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n credentials: 'include',\n // Authorization: 'Kinvey ' + localStorage.getItem('authToken'),\n };\n\n fetch(url, data)\n .then(handler)\n .then(displayBooks)\n .catch((err) => {\n console.warn(err);\n });\n }", "title": "" }, { "docid": "6fab0429f05d7fb0e7e8323febc96306", "score": "0.6945697", "text": "function getBooks() {\n fetch(\"http://localhost:3000/books\")\n .then(res => res.json())\n .then(books => showBooks(books))\n .catch(err => console.log(err))\n}", "title": "" }, { "docid": "f201e55c380e0715b269a0b8c496c1da", "score": "0.6886463", "text": "getAllBooks(url = this.baseUrl) {\r\n return fetch(url).then(response => response.json())\r\n }", "title": "" }, { "docid": "2c2814182e942e53ea81c904042ac157", "score": "0.68484396", "text": "async function getAllBooks () {\n console.log('book')\n const books = await fetchData(endpoint, config);\n // console.log(books)\n render.allBooks(books);\n}", "title": "" }, { "docid": "d2612d4ad62038bdd16604b3d489e084", "score": "0.68281645", "text": "function loadAllBooksHelper() {\r\n\t\trequest(loadAllBooks, \"books\", \"\");\r\n\t}", "title": "" }, { "docid": "a3f202215361e3158ed705e22e684200", "score": "0.68217725", "text": "getAllBooks() {\n return axios.get(`${url}/allBooks`);\n }", "title": "" }, { "docid": "48a18a2f0a5377afaab0b4c7603c5338", "score": "0.6805556", "text": "getBooks() {\n return this.service.sendGetRequest(this.books);\n }", "title": "" }, { "docid": "9001e51c53868c99a505bbc98e5aeded", "score": "0.67630416", "text": "function loadBooks() {\n API.getBooks()\n .then((res) => setBooks(res.data))\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "c617ec4b4f25aeb12932f15690989346", "score": "0.6659803", "text": "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "ddfd700e6175937bcc299b8bdaab93fd", "score": "0.66387504", "text": "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "ddfd700e6175937bcc299b8bdaab93fd", "score": "0.66387504", "text": "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "7d0e42fcf486eee90c5ed1b57fcfc376", "score": "0.662945", "text": "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "84a4b51a78bb1290aeba848c01f50439", "score": "0.662299", "text": "getBooks(){\n fetch('http://localhost:3001/api/home')\n .then((res) => {\n return res.json()\n })\n .then((data) => {\n this.setState({\n books: data,\n \n })\n })\n }", "title": "" }, { "docid": "936702ccf9912cf3ba13b2d4b534dd7d", "score": "0.66125685", "text": "function getBooks() {\n let request = new XMLHttpRequest();\n request.open('GET', 'http://localhost:7000/books');\n request.addEventListener('load', function () {\n // responseText is a property of the request object\n // (that name was chosen for us)\n let response = JSON.parse(request.responseText);\n let books = response.books;\n let parent = document.querySelector('main ul');\n\n for (let i = 0; i < books.length; ) {\n let element = document.createElement('li');\n element.textContent = books[i].title;\n\n // append to parent\n parent.appendChild(element);\n }\n });\n request.send();\n}", "title": "" }, { "docid": "cff0ff4571a9ab062fdb2c5668e117f9", "score": "0.6597616", "text": "function loadBooks() {\n API.getBooks()\n .then(res => {\n setBooks(res.data);\n // console.log(res);\n })\n .catch(err => console.log(err.response));\n }", "title": "" }, { "docid": "f447757929f3120cce94ebea6635b3c1", "score": "0.6570552", "text": "function getBooks(request, response,next) {\n bookDb.get()\n .then(results => {\n if(results.length === 0){\n response.render('pages/searches/new');\n }else{\n response.render('pages/index', {books: results})\n }\n })\n .catch( next );\n}", "title": "" }, { "docid": "0f0fca048d528865a9a309de92cb6194", "score": "0.6522621", "text": "function listBooks(response, request) {\n\n var authorID = request.params.authorID;\n\n return memory.authors[authorID].books\n \n \n}", "title": "" }, { "docid": "dd822802177d7370e8229dcf6edc3e7c", "score": "0.65110916", "text": "function loadBooks() {\n API.getBooks()\n .then(res => {\n console.log(res.data)\n setBooks(res.data)\n })\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "08650888c6451f8f3df0ad31d856144e", "score": "0.6509764", "text": "function getBooks(){\n fetch('http://localhost:3000/books')\n .then(resp => resp.json())\n .then(book => book.forEach(title))\n}", "title": "" }, { "docid": "54f48f16df3c70eb8a12053518a10698", "score": "0.6485135", "text": "function listBooks() {\n return initDB('thr').then(function(db) {\n var books = [];\n return visitRecords(db, 'books', function(cursor) {\n var book = cursor.value;\n books.push({ID: book.ID, title: book.title});\n }).then(function() {\n return books;\n });\n });\n }", "title": "" }, { "docid": "0985e8484173dd95d2e631dd0198186b", "score": "0.64726925", "text": "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "65cf6ba39f63f085430281119eeffe05", "score": "0.643764", "text": "async function loadBooks() {\n const response = await api.get('books');\n setBooks(response.data);\n }", "title": "" }, { "docid": "7004548a94d9294dbf4a57529aacd4fa", "score": "0.63875973", "text": "function fetchBook() {\n Books.get($stateParams.id)\n .then(function(book) {\n $scope.book = book;\n })\n .catch(function(error) {\n $scope.error = error;\n });\n }", "title": "" }, { "docid": "7c1bee9b11c3d04151c8f2ed13e7ebf8", "score": "0.63746303", "text": "getBooks(title) {\n return this.service.sendGetRequest(this.books + '/' + title.value);\n }", "title": "" }, { "docid": "fdee494f325ad060b22c43f68740861d", "score": "0.63723487", "text": "function getBooks () {\n\t\t\treturn backendService.getBooks()\n\t\t\t\t.then(function (response) {\n\t\t\t\t\tallBooks = response; // keep a copy of all the books, without filtering.\n\t\t\t\t\treturn allBooks;\n\t\t\t\t});\n\t\t}", "title": "" }, { "docid": "a267c49970abd312d49f4f419535055a", "score": "0.6339854", "text": "function httpGetAllBooks(req, res) {\n if (isBooksEmpty()) return res.status(400).json({\n error: 'There are currently no books'\n })\n\n const books = getBooks()\n return res.status(200).json(books)\n}", "title": "" }, { "docid": "6211db6c591b7f95d46669adcde7baa2", "score": "0.6339586", "text": "index(request, response) {\n Book.find({}) // to find all documents, use an empty object\n .then(books => response.json(books))\n .catch(error => response.status(Http.MovedPermanently).json(error));\n }", "title": "" }, { "docid": "6bec06929f6c32852edd5d3c5718fdd8", "score": "0.6273572", "text": "static displayBooksToList() {\n const books = Store.getBooks();\n\n books.forEach((book) => {\n UI.addBookToList(book)\n });\n }", "title": "" }, { "docid": "4180bd99f2ca9df283777690d562e92e", "score": "0.62667763", "text": "function bookGet() {\n\tgetBook = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=stripbooks';\n\tsetContent();\n}", "title": "" }, { "docid": "006c7855583268f64f19b58af21a768d", "score": "0.6266645", "text": "static getBooks() {\n let books;\n if (localStorage.getItem(\"books\") === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem(\"books\"));\n }\n return books;\n }", "title": "" }, { "docid": "f02bfb99edae6ef34f4fa4c5adb65f9b", "score": "0.62574327", "text": "static getBooks() {\n let books;\n if(localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n }", "title": "" }, { "docid": "4357aa9aca3b778912d5a9ba673ee1c3", "score": "0.6250445", "text": "getbooks() {\n let books;\n if (!localStorage.getItem(\"books\")) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem(\"books\"));\n }\n\n return books;\n }", "title": "" }, { "docid": "4b61f6e2394216a7468f8a5e8e480867", "score": "0.6246075", "text": "function getBookList()\r\n\t{\r\n\t\t$.ajax({\r\n\t\t url: contextPath + \"/books/ajaxGetListOfAllBooks\", \r\n\t\t type: 'GET', \r\n\t\t dataType: 'json', \r\n\t\t contentType: 'application/json',\r\n\t\t mimeType: 'application/json',\r\n\t\t timeout: 5000,\r\n\t\t cache: false,\r\n\t\t success: function(books) \r\n\t\t {\r\n\t\t },\r\n error: function (xhr, textStatus, errorThrown) \r\n {\r\n \tconsole.log(xhr.responseText);\r\n alert('Failed to get list of books because of a server error.');\r\n loadingIndicator.fadeOut();\r\n }\r\n\t\t});\t\r\n\t}", "title": "" }, { "docid": "2bfaeccf1343ebb6572797f77f4b59d1", "score": "0.623997", "text": "static getBooks() {\n let books;\n if (localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n return books;\n }", "title": "" }, { "docid": "4ac37ce902296784af3a4e6fda89b09b", "score": "0.6232824", "text": "getBooks(){\n fetch('/books').then(response=>{response.json().then(data=>{\n console.log(data)\n this.setState({foundBooks:data})\n })})\n }", "title": "" }, { "docid": "247b252387efbf20d57db29f82037792", "score": "0.62205833", "text": "static displayBooks(){\n // Taking books from the local Storage\n const books = Store.getBooks();\n\n // Looping through the books and adding it to bookList\n books.forEach((book) => UI.addBookToList(book));\n }", "title": "" }, { "docid": "e5f9b05e3d011787338912cd577d9cd0", "score": "0.620033", "text": "static getBooks() {\n\t\tlet books;\n\t\tif (localStorage.getItem(\"books\") === null) {\n\t\t\tbooks = [];\n\t\t} else {\n\t\t\tbooks = JSON.parse(localStorage.getItem(\"books\"));\n\t\t}\n\t\treturn books;\n\t}", "title": "" }, { "docid": "79f7768701ddc8094212a16bcc37fb58", "score": "0.61899716", "text": "function loadBooks(res) {\n console.log(res.data)\n setBooks(res.data.data)\n }", "title": "" }, { "docid": "eb12da9346096c78785700719e42b4f5", "score": "0.6179471", "text": "getbooks(){\r\n BooksAPI.getAll().then((books) => {\r\n // add books to state\r\n this.setState({ books })\r\n })\r\n }", "title": "" }, { "docid": "85d7247b8331ec0b8e873a8280c95c4d", "score": "0.6173654", "text": "static displayBook(){\n // //Imaginary local storage for trial purpose\n // const bookstore=[\n // {\n // title: 'Book One',\n // author: 'John Doe',\n // isbn: '345678'\n // },\n // {\n // title: 'Book Two',\n // author: 'Nobel Reo',\n // isbn: '348982'\n // }\n // ];\n const books = Store.getBooks();\n books.forEach((book) => UI.addBookToList(book));\n }", "title": "" }, { "docid": "86d6c9c89f4fd77edb01278511145ff9", "score": "0.61577606", "text": "static getBooks() {\n let books;\n if (localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n\n return books;\n }", "title": "" }, { "docid": "f5aaba5156369d957408315a8dd67699", "score": "0.6143092", "text": "function returnBooks(res){\n myLibrary.books = [];\n res.items.forEach(function(item) {\n //if price is undefined, then define price at 0\n if(item.saleInfo.listPrice == undefined){\n item.saleInfo[\"listPrice\"] = {amount: null};\n }\n\n //check if price is exist, if yes then create new book\n if (item.saleInfo.listPrice){\n // Book constructor is in book.js\n let temp = new Book(item.volumeInfo.title,\n item.volumeInfo.description,\n item.volumeInfo.imageLinks.smallThumbnail,\n item.saleInfo.listPrice.amount,\n item.volumeInfo.authors,\n item.volumeInfo.previewLink\n );\n myLibrary.books.push(temp);\n }\n\n });\n //print each book on webpage\n myLibrary.printBooks();\n highlightWords();\n}", "title": "" }, { "docid": "a50055e0d9abdb466b9bff992eba13dc", "score": "0.6131037", "text": "loadBooksFromServer () {\n\t\t fetch('http://localhost:8080/books')\n .then(result => result.json())\n .then(result => this.setState({ books: result })\n )\n\t\t }", "title": "" }, { "docid": "e46f3fc767792e59b8452d782fed8be5", "score": "0.61240333", "text": "function getBooks() {\n clubID = this.value;\n // console.log('clubID', clubID);\n fetch('/get_books_in_genre?clubID=' + clubID)\n .then(function (response) {\n return response.json();\n }).then(function (json) {\n // console.log('GET response', json);\n if (json.length > 0) {\n set_book_select(json);\n };\n });\n}", "title": "" }, { "docid": "eea9b29223a818af0d659d0dd5791c44", "score": "0.61204356", "text": "function getBookList() {\n\t\ttoggleControls(\"on\");\n\t\tif(localStorage.length === 0) {\n\t\t\talert(\"Your bookshelf was empty so example books were added\");\n\t\t\tautofillData();\n\t\t}\n\t\tvar list = $.find('#listOfBooks');\n\t\t$('#bookList').attr('id', 'items');\n\t\tfor (var i = 0, j = localStorage.length; i < j; i++) {\n\t\t\tvar makeLi = $('<li class=\"bookItem\"></li>').appendTo(list);\n\t\t\tvar linksLi = $('<li class=\"bookLink\"></li>').appendTo(list);\n\t\t\tvar key = localStorage.key(i);\n\t\t\tvar value = localStorage.getItem(key);\n\t\t\tvar object = JSON.parse(value);\n\t\t\tfor(var x in object){\n\t\t\t\t$('<p>' + object[x][0] + object[x][1] + '</p>').appendTo(makeLi);\n\t\t\t}\n\t\t\tmakeBookLinks(localStorage.key(i), linksLi);\n\t\t}\n\t\t$('#listOfBooks').listview('refresh');\t\n\t}", "title": "" }, { "docid": "e737bbf998a312306b9872ad05b14e17", "score": "0.61125845", "text": "function findBook(req, res) {\n\n let url = 'https://www.googleapis.com/books/v1/volumes?q=';\n\n if (req.body.search[1] === 'title') { url += `+intitle:${req.body.search[0]}`; }\n\n if (req.body.search[1] === 'author') { url += `+inauthor:${req.body.search[0]}`; }\n\n superagent.get(url)\n\n .then(data => {\n // console.log('data >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', data.body.items[0].volumeInfo);\n\n let books = data.body.items.map(value => {\n return new Book(value);\n });\n // console.log(books);\n res.render('pages/searches/show', { book: books });\n }).catch(error => console.log(error));\n\n}", "title": "" }, { "docid": "3f319024affeee74c53a74bdf1a13c73", "score": "0.6110733", "text": "static displayBooks() {\n const books = Store.getBooks();\n books.forEach(function (book) {\n const ui = new UI();\n ui.addBookToList(book);\n })\n\n }", "title": "" }, { "docid": "fb2d8303fcb1f783fc41a8c5855ec4f6", "score": "0.6108553", "text": "static displayBooks () {\n\t\tconst books = Store.getBooks();\n\n\t\t//Loop through each book and call method addBookToList\n\n\t\tbooks.forEach((book) => UI.addBookToList(book));\n\t}", "title": "" }, { "docid": "27eee8c4927cbd1f86eb824dab970a73", "score": "0.60926735", "text": "fetchData() {\n let bookList = [];\n fetch(\"http://localhost:3010/books\") //fetch from the link\n .then(response => response.json()) // and whatever response we get from here\n .then(data => {\n // take the data\n for (const book of data) {\n //fetching the books\n bookList.push(book);\n }\n this.setState({ books: bookList }); // and adding it to the state books.\n });\n }", "title": "" }, { "docid": "77d945afee2273c076d759e13cb587e6", "score": "0.6083968", "text": "function getBooksData(searchTerm)\n{\n const settings = {\n url: BOOKS_SEARCH_URL,\n data: {\n q: `${searchTerm}`,\n maxResults: 6,\n startIndex: 0\n },\n dataType: 'json',\n type: 'GET',\n success: displayData\n };\n\n $.get(settings);\n}", "title": "" }, { "docid": "55a11753a5e62fe976f8ead1bf46eb2a", "score": "0.6075646", "text": "function allBooks(){\r\n\t\tvisibility(\"none\", \"singlebook\");\r\n\t\tvisibility(\"\", \"allbooks\");\r\n\t\tif(this.status == SUCCESS){\r\n\t\t\tvar title = this.responseXML.querySelectorAll(\"title\");\r\n\t\t\tvar folder = this.responseXML.querySelectorAll(\"folder\");\r\n\t\t\tfor (var i = 0; i < title.length; i++) {\r\n\t\t\t\tvar book = document.createElement(\"div\");\r\n\t\t\t\tvar text = document.createElement(\"p\");\r\n\t\t\t\tvar image = document.createElement(\"img\");\r\n\t\t\t\tvar fileName = folder[i].textContent; \r\n\t\t\t\tvar img = \"books/\" + fileName + \"/cover.jpg\";\r\n\t\t\t\timage.src = img;\r\n\t\t\t\timage.alt = fileName;\r\n\t\t\t\timage.className = fileName; // gives classname to get to its page\r\n\t\t\t\ttext.className = fileName;\r\n\t\t\t\ttext.innerHTML = title[i].textContent;\r\n\t\t\t\tbook.appendChild(image);\r\n\t\t\t\tbook.appendChild(text);\r\n\t\t\t\tdocument.getElementById(\"allbooks\").appendChild(book);\r\n\t\t\t\timage.onclick = load;\r\n\t\t\t\ttext.onclick = load;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}", "title": "" }, { "docid": "36e77ed23f8089293cfedfda1576548f", "score": "0.60674167", "text": "function loadBooks() {\n\n\t// We return the promise that axios gives us\n\treturn axios.get(apiBooksUrl)\n\t\t.then(response => response.data) // turns to a promise of books\n\t\t.catch(error => {\n\t\t\tconsole.log(\"AJAX request finished with an error :(\");\n\t\t\tconsole.error(error);\n\t\t});\n}", "title": "" }, { "docid": "6cb44011a4c6d55c5ee58a11ccc3acda", "score": "0.6065946", "text": "async getBooks(req, res, next){\n try {\n res.send( await BooksModel.paginate({}, {\n sort: 'title',\n page: req.params.page && req.params.page > 0 ? req.params.page : 1,\n limit: 20,\n }) )\n } catch(e) {\n return exhandler(res)\n }\n }", "title": "" }, { "docid": "3903666803494ce53f7faab452245f2e", "score": "0.6056448", "text": "static getBook() {\n let books;\n if (localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n\n return books;\n }", "title": "" }, { "docid": "f5355bdbbb9f3e2cabf38b584742b12a", "score": "0.605171", "text": "async getAllBooks(parent,args,ctx,info){\n return await ctx.db.query.books({\n where : {active:true}\n },`{\n id\n title\n author\n publisher {\n name\n discount\n }\n category{\n name\n }\n type {\n name\n }\n images {\n src\n }\n mrp\n sku\n }`);\n \n }", "title": "" }, { "docid": "31a12eaa19d65540e21ecb84c8d77195", "score": "0.6046002", "text": "getAllBooks() {\n return new Promise((resolve, reject) => {\n // Make an API call to get all books currently in my shelves and set the state when the response is ready\n BooksAPI.getAll().then((books) => {\n this.setState({ books })\n resolve()\n }).catch((err) => {\n reject(err)\n })\n })\n }", "title": "" }, { "docid": "5bde759059b6e6df4a9b73873403a8fd", "score": "0.6045281", "text": "GETNOTEBOOKS (state, notebooks) {\n state.notebooks = notebooks\n }", "title": "" }, { "docid": "9865a9e7ed827f42fb496f0b359ff997", "score": "0.60412765", "text": "function getNYTListJSON(category, eventCallback) {\r\n\r\n\tconsole.log(category);\r\n\r\n\trequest.get({\r\n\t\turl: \"https://api.nytimes.com/svc/books/v3/lists.json\",\r\n\t\tqs: {\r\n\t\t\t'api-key': \"APIKEY\",\r\n\t\t\t'list': category\r\n\t\t},\r\n\t\t}, function(err, response, body) {\r\n\r\n\t\t\tvar list_of_books = [];\r\n\r\n\t\t\tif (body){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tbody = JSON.parse(body);\r\n\t\t\t\t}catch(e){\r\n\t\t\t\t\tvar list_of_books = [];\r\n\t\t\t\t\teventCallback(list_of_books);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\r\n\t\t\tfor (var i = 0,length = body.results.length; i < length; i++ ) {\r\n\r\n\t\t\t\tvar book_details={};\r\n\r\n\t\t\t\tbook_details.title = body.results[i].book_details[0].title;\r\n\t\t\t\tbook_details.titleupper = body.results[i].book_details[0].title;\r\n\t\t\t\tbook_details.author = body.results[i].book_details[0].author;\r\n\t\t\t\tbook_details.contributor = body.results[i].book_details[0].contributor;\r\n\t\t\t\tbook_details.rank = body.results[i].rank;\r\n\t\t\t\tbook_details.primary_isbn10 = body.results[i].book_details[0].primary_isbn10;\r\n\t\t\t\tbook_details.primary_isbn13 = body.results[i].book_details[0].primary_isbn13;\r\n\r\n\t\t\t\tvar isbns_string = body.results[i].book_details[0].primary_isbn13 + \",\";\r\n\r\n\t\t\t\tfor (var j = 0, jlength = body.results[i].isbns.length; j < jlength; j++){\r\n\t\t\t\t\tisbns_string = isbns_string + body.results[i].isbns[j].isbn10 + \",\" + body.results[i].isbns[j].isbn13 + \",\" ;\r\n\t\t\t\t}\r\n\t\t\t\tisbns_string = isbns_string.slice(0, -1);\r\n\r\n\t\t\t\tbook_details.isbns_string = isbns_string;\r\n\r\n\t\t\t\tdescription = body.results[i].book_details[0].description;\r\n\t\t\t\tweeks_on_list = body.results[i].weeks_on_list;\r\n\t\t\t\tpublished_date = body.results[i].published_date;\r\n\t\t\t\tvar weeks_on_list_str = \"\"\r\n\r\n\t\t\t\tswitch(parseInt(weeks_on_list)){\r\n\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\tweeks_on_list_str = \"is new to the New York Times Best Sellers List. \";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tweeks_on_list_str = \"has been on the New York Times Best Sellers List for one week. \";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tweeks_on_list_str = \"has been on the New York Times Best Sellers List for \" + weeks_on_list + \" weeks. \";\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tbook_details.description = book_details.title + \", \" + book_details.contributor + \", \" + weeks_on_list_str + \" Here's a brief description of the book, \" + description;\r\n\r\n\t\t\t\tlist_of_books[i] = book_details;\r\n\t\t\t}\r\n\r\n\t\t\tstringify(list_of_books);\r\n\t\t\tconsole.log(list_of_books);\r\n\r\n\t\t\teventCallback(list_of_books);\r\n\t\t}).on('err', function (e) {\r\n console.log(\"Got error: \", e);\r\n });\r\n\r\n}", "title": "" }, { "docid": "b6e384945e03d15972d8d7f394b2d26d", "score": "0.6040367", "text": "static displayBooks() {\n\t\tconst books = Store.getBooks();\n\t\tbooks.forEach(function (book) {\n\t\t\tconst ui = new UI();\n\t\t\tui.addBookToList(book);\n\t\t});\n\t}", "title": "" }, { "docid": "3361f15082320ff9929dfc967e22050d", "score": "0.6029992", "text": "static displayBooks(){\n let books = Store.getBooks();\n const ui = new UI();\n\n // Add all books to list\n books.forEach(function(book){\n ui.addBookToLib(book);\n });\n }", "title": "" }, { "docid": "e8dd39281bc8f62a11a73c20fb966feb", "score": "0.60215753", "text": "static displayBooks() {\n const books = Store.getBooks();\n\n books.forEach(book => {\n const ui = new UI();\n\n // Add book to UI\n ui.addBookToList(book);\n });\n\n }", "title": "" }, { "docid": "8c915fe7bf959256ffac4925da160c5a", "score": "0.6015565", "text": "static async fetchAllBookings() {\n return api.get('/booking').then((response) => {\n return response.data.map((b) => new Booking(b));\n });\n }", "title": "" }, { "docid": "a89849423d87b17f000691d5eafee5d0", "score": "0.6014124", "text": "function fetchBooks(url){\n return fetch(url)\n .then(resp => resp.json())\n}", "title": "" }, { "docid": "2f0860c8dd02d43d3b4edbe3437db826", "score": "0.60116285", "text": "getListOfBooks(id) {\n axios({\n url: 'https://localhost:5001/api/author/' + id,\n method: 'GET',\n }).then(response => {\n this.setState({\n books: response.data.books,\n showBooksModal: true,\n });\n }).catch((error) => {\n this.handleAlert(Utils.handleAxiosError(error), 'danger')\n })\n }", "title": "" }, { "docid": "49912a88ef0dc6418b9a8f4c0c6bc691", "score": "0.60089505", "text": "getCurrentBooks() {\n BooksAPI.getAll().then(currentBooks => {\n this.setState({ currentBooks });\n });\n }", "title": "" }, { "docid": "820f49aea7786593c9afef1bf93464d0", "score": "0.6000798", "text": "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 }", "title": "" }, { "docid": "b2cf540a73cc4a1086e180a0d818acc0", "score": "0.5994361", "text": "static getBooks(){\n let books;\n\n if(localStorage.getItem('books') === null){\n books = [];\n }\n else{\n books = JSON.parse(localStorage.getItem('books'));\n }\n\n return books;\n }", "title": "" }, { "docid": "23cf322d063bcef3728db64913d12157", "score": "0.5990742", "text": "static fetchBooksFromGoogle(searchInput){ //searchInput from Content.js\n return fetch(`https://www.googleapis.com/books/v1/volumes?q=${searchInput}`)\n .then(response => response.json())\n .then(json => {\n return json.items.map(item => this.createBook(item)) //returns an array of objects created from the createBook fn.\n })\n }", "title": "" }, { "docid": "4c0982694d7cbbb8de914cbe8eca1d32", "score": "0.59895355", "text": "static getBooks(){\n let books;\n if(localStorage.getItem('books') === null){\n books = [];\n }\n else{\n books = JSON.parse(localStorage.getItem('books'));\n }\n return books;\n }", "title": "" }, { "docid": "6fa1aae28f0adada144624cc131321e2", "score": "0.5984487", "text": "function getBooksFromGoogleAPI(searchURL){\n\t$.ajax({\n\t\turl: searchURL,\n\t\tsuccess: function(data){\n\t\t\tvar temphtml = '';\n\t\t\tsearchResult = data;\n\t\t\tfor(var i = 0; i < 5 && i < data['totalItems']; i++){\n\t\t\t\tvar title = data.items[i].volumeInfo.title;\n\t\t\t\tvar author = \"\";\n\t\t\t\tif(data.items[i].volumeInfo.hasOwnProperty('authors')){\n\t\t\t\t\tauthor = 'By: ' + data.items[i].volumeInfo.authors[0];\n\t\t\t\t}\n\t\t\t\ttemphtml += '<a class=\"list-group-item list-group-item-action flex-column align-items-start\" href=\"#\">';\n\t\t\t\ttemphtml += '<div class=\"d-flex w-100 justify-content-between\">';\n\t\t\t\ttemphtml += '<h5 class=\"mb-1\">' + title + '</h5></div>';\n\t\t\t\ttemphtml += '<p class=\"mb-1\">' + author + '</p>';\n\t\t\t\ttemphtml += '<p class=\"sr-only\" id=\"index\">' + i + '</p>';\n\t\t\t\ttemphtml += '</a>';\n\t\t\t}\n\t\t\t$(\"#navSearchResults\").html(temphtml).removeClass(\"d-none\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3ced0d5e7433c10cdb2af66b4b8d9b1d", "score": "0.5982355", "text": "function getBooks(){\n $.ajax(\"https://den-super-crud.herokuapp.com/books\").done(function(data){\n // Store books array in a variable\n var booksObject = data.books;\n \n // Using for loop to add list items to DOM\n for(let i = 0; i < booksObject.length; i++){\n $('#books').append(\"<ul><span class='bookTitle'>Book \" + (i+1) + \"</span>\" + \n \"<li><span class='francois'>Title:</span> \" + booksObject[i].title + \"</li>\" + \n \"<li><span class='francois'>Author:</span> \" + booksObject[i].author + \"</li>\" +\n \"<li><span class='francois'>Cover:</span> \" + \"<img src=\" + booksObject[i].image + \">\" + \"</li>\" +\n \"<li><span class='francois'>Release Date:</span> \" + booksObject[i].releaseDate + \"</li>\" +\n \"</ul>\");\n }\n });\n}", "title": "" }, { "docid": "428af730406e210717ddd8796763d740", "score": "0.5979119", "text": "componentDidMount() {\n axios\n .get(\n `https://www.googleapis.com/books/v1/volumes?q=subject:fiction&filter=paid-ebooks&langRestrict=en&maxResults=20&&orderBy=newest&key=${process.env.REACT_APP_GOOGLE_BOOK_TOKEN}`\n )\n .then((response) => {\n console.log(\"axios Api\", response.data);\n this.setState({\n booksFromApi: response.data.items,\n });\n })\n .catch((error) => {\n console.log(error);\n });\n\n // service\n\n // .get(\"/bookFromData\")\n // .then((result) => {\n // console.log(\"fetch ggl id and populate \", result.data);\n // this.setState({\n // saveList: result.data,\n // });\n // })\n // .catch((error) => console.log(error));\n }", "title": "" }, { "docid": "c2c699ed47f41987c6b092939ed663e2", "score": "0.59708005", "text": "async function getBooks() {\r\n\ttry{\r\n\t\t// lean() transforms mongoose object to json object\r\n\t\tconst data = await newBoek.find().lean();\r\n\t\treturn data;\r\n\t} catch (error) {\r\n\t\tconsole.log('getBooks failed ' + error);\r\n\t}\r\n}", "title": "" }, { "docid": "b2f4b08e640012633e35af5967d4acaf", "score": "0.5959853", "text": "getAllBooks() {\n this.bookCtrl.getAllBooks( (err, books) => {\n if (err) {this.setState({msg: err});}\n else {\n this.setState({books: books});\n }\n });\n }", "title": "" }, { "docid": "c8bbed00d55aef27fdbeb292cb29fe9c", "score": "0.5943651", "text": "function getBookReview() {\n\tvar queryURL =\n\t\t'https://api.nytimes.com/svc/books/v3/reviews.json?title=' +\n\t\tsearchTerm +\n\t\t'&api-key=AGFM7Bkp4YHthCReyXQ2KGqDWUyAaMLW';\n\t$.ajax({\n\t\turl: queryURL,\n\t\tmethod: 'GET'\n\t}).then(function (response) {\n\t\tbookReview = response.results[0].url;\n\t\tsetContent();\n\t});\n}", "title": "" }, { "docid": "bc01a82e0c92b5baa14b9ebbb74a0b52", "score": "0.5937384", "text": "static getBooks(){\n let books;\n\n // check for books not stored in local storage? \n // create empty books : add those books to books\n if(localStorage.getItem('books') === null){\n books = [];\n }else{\n books = JSON.parse(localStorage.getItem('books'));\n }\n return books;\n }", "title": "" }, { "docid": "75354284a35b52775f4bb6f203af05cb", "score": "0.5934934", "text": "function getBooks(){\n let books;\n\n if (localStorage.getItem(\"books\") === null){\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem(\"books\"));\n }\n\n return books\n}", "title": "" }, { "docid": "d4e82f40539bc983f844e16dc87aafff", "score": "0.59247637", "text": "function displayBookList() {\n displayAllBooks();\n}", "title": "" }, { "docid": "7c3f7fc8f7eb2ba5861c41fd0f5fd369", "score": "0.5908304", "text": "function loadAndDisplayBooks() {\n\n\tloadBooks().then(books => {\n\t\tdisplayBooks(books);\n\t});\n}", "title": "" }, { "docid": "d8ee31ee674e196772a3e90485c9550d", "score": "0.5908132", "text": "function getBook(obj) {\n fetch(bookUrl + obj.id)\n .then(response => response.json());\n }", "title": "" }, { "docid": "b4a00f21c1f29c4ddbe1a16f94f8b9af", "score": "0.58938646", "text": "function getBook(request, response) {\n //get bookshelves\n getBookshelves()\n //using returned values\n .then(shelves => {\n bookDb.get(request.params.id)\n .then(result => {\n response.render('pages/books/show', { book: result[0], bookshelves: shelves })\n })\n .catch(err => handleError(err, response));\n })\n}", "title": "" }, { "docid": "7d68eabeedd9bb11151bdfc90384c0b0", "score": "0.5874883", "text": "constructor() {\n super()\n this.state = {\n books: null, // we will load the books via the API\n }\n }", "title": "" }, { "docid": "4aac79b1909fbf02fab98ff613e54141", "score": "0.5874391", "text": "getBooks() {\n $.ajax({\n url: this._apiUrl + '/books',\n method: 'GET',\n dataType: 'JSON'\n }).done(response => { //strzalkowo, ZWRACAC UWAGE NA NAWIAS OKRAGLY-przechodzi nizej.\n console.log(response);\n let booksLength = response.length;\n for (let i=0;i<booksLength;i++) { // pętla po wszystkich ksiazkach, zeby je wrzucic do DOM\n let newLiElement = $(`<li data-id=\" ${response[i].id}\">`);\n let newSpan = $(\"<span>\");\n newSpan.append(`(${response[i].author})`); // daje autora o odpowiednim id i nawias na nim\n newLiElement.append(response[i].title); // tytul w liste\n newLiElement.append(newSpan);\n this._ul.append(newLiElement); // dodaje juz do ul w DOM\n }\n\n })\n }", "title": "" }, { "docid": "3e4c8e1281d252bc8a285662a11702d4", "score": "0.58709586", "text": "async getMyBooks(req, res, next){\n try {\n // sets the page for pagination\n let p = req.params.page && req.params.page > 0 ? req.params.page : 1\n\n // sets pagination limit\n let l = 20\n\n // the query\n res.send(\n await BooksModel.paginate({\n posted_by: req.user.id,\n }, {\n sort: 'title',\n limit: l,\n page: p,\n })\n )\n } catch(e) {\n return exhandler(res)\n }\n }", "title": "" }, { "docid": "69aade796643fdc18145b6c3b77d3408", "score": "0.58694917", "text": "function showAllBooks() {\n $('#book-list').empty();\n getBooks();\n getSearchItems();\n}", "title": "" }, { "docid": "79d73fd1f67083b4312a00fb2a3bce8d", "score": "0.5856438", "text": "function getBestSellers() {\n const url = `${searchOptions.api}${selector}${searchOptions.typeEnd}${searchOptions.key}`;\n\n //Fetch protocol for API URL\n fetch(url)\n .then((response) => response.json())\n .then((response) => {\n //Confirm that the correct list_name is being pulled from the API:\n setBooks(response);\n })\n .catch(console.error);\n }", "title": "" }, { "docid": "79cc5adb72fc9ce097b8ee7f5e30c0e2", "score": "0.58554673", "text": "function getMyBooks(req, res, next) {\r\n //\r\n var owner = req.user ? req.user.email : null\r\n if(owner) {\r\n BookModel.find({ owner: owner }, function(err, mybooks) {\r\n if(err) throw err\r\n // mybooks will be 0 length array if no values found\r\n res.status(200).json({\r\n data: {\r\n items: mybooks\r\n }\r\n })\r\n })\r\n }\r\n}", "title": "" }, { "docid": "569fcd06ed3b56904b231e64dd6f1b30", "score": "0.58356947", "text": "function loadDoc()\n{\n var searchText = document.getElementById(\"namehere\").value;\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n\n var Obj = JSON.parse(this.responseText);\n document.getElementById(\"myDIV\").innerHTML=\"\";\n for(var i =0 ;i<Obj.Books.length;i++)\n {\n createHTMLView(i,Obj);\n }\n }\n };\n xhttp.open(\"GET\", \"http://it-ebooks-api.info/v1/search/\".concat(searchText), true);\n xhttp.send();\n}", "title": "" }, { "docid": "96835a0094c1f8cf955e9481cfdce7f9", "score": "0.5832468", "text": "function getBooks(bibleParam, callback) {\n var dfd = $.Deferred();\n bible = bibleParam;\n // if default books found use it\n var booksPath = bible.defaultIndex ? (baseUrl + '/defaults/books/' + bible.defaultIndex + '.bz2') : (baseUrl + bible.dbpath + '/' + 'books.bz2');\n $.when(getBzData(booksPath)).then(d => {\n dfd.resolve(books = d);\n });\n return dfd.promise();\n }", "title": "" }, { "docid": "d5f922f42e228554a0ea06a1bd725456", "score": "0.5829122", "text": "async componentDidMount() {\n const response = await fetch(`https://deployed-collective-api.herokuapp.com/api/books`)\n const json = await response.json()\n this.setState({books: json, filteredBooks: json} )\n }", "title": "" }, { "docid": "f368e49bcbe254f2b2b6e2d7639df5d7", "score": "0.582861", "text": "function getAuthors() {\n $.get(\"/api/authors\", renderAuthorList);\n }", "title": "" }, { "docid": "a1a5f823d4d69c3548f221bd34ea4300", "score": "0.58263147", "text": "function getNytApi(event) {\n event.preventDefault()\n\n bestSellersList.empty();\n var listType = document.getElementById('list-type');\n var listValue = listType.options[listType.selectedIndex].value;\n\n listType.addEventListener(\"change\", (e) => {\n const value = e.target.value;\n const text = listType.options[listType.selectedIndex].value;\n\n if (value) {\n listValue = listType.options[listType.selectedIndex].value;\n console.log(listValue)\n } else {\n document.getElementById(\"pick\").textContent = \"\";\n }\n });\n\n var requestUrlNyt = \"https://api.nytimes.com/svc/books/v3/lists/current/\" + listValue + \".json?&api-key=sRQWJNPgmG9zigAss0SflGl9oOG4nTnU\";\n console.log(requestUrlNyt);\n\n fetch(requestUrlNyt)\n .then(function (response) {\n return response.json();\n })\n .then(function (response) {\n console.log(requestUrlNyt)\n\n for (var i = 0; i < response.results.books.length; i++) {\n var bookCard = document.createElement('li');\n bookCard.setAttribute('class', 'card cell small-2 result-card');\n\n var linkBook = document.createElement('a');\n linkBook.href = response.results.books[i].amazon_product_url;\n linkBook.setAttribute('target', '_blank');\n bookCard.append(linkBook);\n\n var thumbImg = document.createElement('img');\n thumbImg.setAttribute('alt', `${response.results.books[i].title}`)\n thumbImg.src = response.results.books[i].book_image;\n linkBook.append(thumbImg);\n\n var favoriteEl = document.createElement('span');\n favoriteEl.setAttribute('class', 'label warning');\n favoriteEl.textContent = 'Favorite Me';\n bookCard.append(favoriteEl);\n\n var isbnNumber = document.createElement('span');\n isbnNumber.textContent = response.results.books[i].primary_isbn13;\n console.log(response.results.books[i].primary_isbn13);\n console.log(isbnNumber.textContent);\n isbnNumber.setAttribute('style', 'display: none');\n bookCard.append(isbnNumber);\n\n bestSellersList.append(bookCard);\n\n console.log(response.results.books[i].amazon_product_url);\n console.log(resultCard);\n\n }\n })\n}", "title": "" }, { "docid": "22c473819782219d09bdbee345e220d8", "score": "0.582231", "text": "function renderHomePage(request, response) {\n let selectBooks = 'SELECT id, author, title, isbn, image_url, description FROM books;';\n client.query(selectBooks).then(result => {\n response.render('pages/index', { booksList: result.rows, booksCount: result.rows.length });\n });\n}", "title": "" }, { "docid": "1d498a5cc88b876a7f33fb7e734434a5", "score": "0.5819619", "text": "getBooks() {\n getAll().then((data) => {\n this.setState({books: data})\n })\n }", "title": "" }, { "docid": "0281ccb5bfb6266e73a5f71fb8219729", "score": "0.58092403", "text": "function setRecommendedBooks(){\n $.ajax({\n url: '/books?isRecommended=true',\n type: 'GET',\n dataType: 'json',\n success: (data) => { if(data){ setBooksToPage(data, 'recommendedBooks') }}\n });\n}", "title": "" }, { "docid": "b4e8cdd8a1e921e6f34371db27e28340", "score": "0.5808463", "text": "function listAddressBooks(callback, limit, offset) {\n var data = {}\n if (limit === undefined) {\n limit = null;\n } else {\n data['limit'] = limit;\n }\n if (offset === undefined) {\n offset = null;\n } else {\n data['offset'] = offset;\n }\n sendRequest('addressbooks', 'GET', data, true, callback);\n}", "title": "" } ]